Skip to content

Commit

Permalink
Upgrade phel:0.13
Browse files Browse the repository at this point in the history
  • Loading branch information
Chemaclass committed Apr 17, 2024
1 parent 1dd6842 commit 89338ae
Show file tree
Hide file tree
Showing 4 changed files with 19 additions and 7 deletions.
11 changes: 8 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ This repository provides you the basic setup to start coding phel.

### Requirements

Phel requires at least PHP 8.0 and Composer.
Phel requires at least PHP 8.2 and Composer.
You can either use it from your local machine OR using docker.
- This repository contains the basic Dockerfile to run phel.

Expand All @@ -29,9 +29,14 @@ You can either use it from your local machine OR using docker.
### Phel code

1. Write your phel code in `src/`
1. Execute your code with `vendor/bin/phel run src/main.phel`
1. Run your code with `vendor/bin/phel run src/main.phel`

### Tests
#### Or run the executable transpiled PHP result

1. `vendor/bin/phel build`
1. `php out/main.php`

#### Tests

1. Write your phel tests in `tests/`
1. Execute your tests with `./vendor/bin/phel test`
Expand Down
2 changes: 1 addition & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
"license": "MIT",
"require": {
"php": ">=8.2",
"phel-lang/phel-lang": "^0.12"
"phel-lang/phel-lang": "^0.13"
},
"require-dev": {
"symfony/var-dumper": "^6.4"
Expand Down
7 changes: 7 additions & 0 deletions example/using-exported-phel-function.php
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,13 @@

Phel::run($projectRootDir, 'cli-skeleton\modules\adder-module');

###################################################
# Remember to run phel export command to generate
# the PHP classes from the exported phel functions:
#
# $ vendor/bin/phel export
# $ php example/using-exported-phel-function.php
###################################################
$adder = new AdderModule();
$result = $adder->adder(1, 2, 3);

Expand Down
6 changes: 3 additions & 3 deletions phel-config.php
Original file line number Diff line number Diff line change
Expand Up @@ -10,13 +10,13 @@
->setSrcDirs(['src'])
->setTestDirs(['tests'])
->setOut((new PhelOutConfig())
->setDestDir('out')
->setMainPhelNamespace('cli-skeleton\main')
->setMainPhpFilename('index'))
->setMainPhpPath('out/main.php'))
->setFormatDirs(['src', 'tests'])
->setExport((new PhelExportConfig())
->setDirectories(['src/modules'])
->setNamespacePrefix('PhelGenerated')
->setTargetDirectory('src/PhelGenerated'))
->setIgnoreWhenBuilding(['local.phel'])
->setKeepGeneratedTempFiles(false);
->setKeepGeneratedTempFiles(false)
;

0 comments on commit 89338ae

Please sign in to comment.