Skip to content

Commit

Permalink
feat: converts from compile to build command
Browse files Browse the repository at this point in the history
  • Loading branch information
mabasic committed Sep 2, 2023
1 parent 540afb8 commit d082cb3
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 13 deletions.
14 changes: 6 additions & 8 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@
## TODO

- [ ] The code in `src/helpers.phel` should be somewhere else. Maybe in Phel (extract-data-from-request) or converted to a public function in mabasic/phel-json library (encode-value).
- [ ] Upgrade to latest version of Phel. For some reason I am having problems with this atm.

## Requirements

Expand All @@ -25,13 +24,13 @@ composer install
pn install

# Use this to compile the phel application to php.
composer compile
composer build

# dev mode
PHEL_MODE=slow php -S localhost:8000 -t public/

# prod mode
composer compile && PHEL_MODE=fast php -S localhost:8000 -t public/
composer build && PHEL_MODE=fast php -S localhost:8000 -t public/
```

For managing SCSS:
Expand All @@ -56,8 +55,7 @@ composer test
## Code Formatting

```bash
vendor/bin/phel format src/
vendor/bin/phel format tests/
vendor/bin/phel format

# or

Expand All @@ -69,12 +67,12 @@ composer format
Compile PHEL to PHP.

```bash
vendor/bin/phel compile --no-cache
vendor/bin/phel build --no-cache

# or

composer compile
composer compile:no-cache
composer build
composer build:no-cache
```

verify that `index.php` has the right code uncommented (fast/slow).
Expand Down
8 changes: 4 additions & 4 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -25,13 +25,13 @@
"prefer-stable": true,
"scripts": {
"dev:slow": "PHEL_MODE=slow php -S localhost:8000 -t public/",
"dev:fast": "composer compile && PHEL_MODE=fast php -S localhost:8000 -t public/",
"dev:fast": "composer build && PHEL_MODE=fast php -S localhost:8000 -t public/",
"pre-install-cmd": [
"@php -r \"file_exists('.env') || copy('.env.example', '.env');\""
],
"test": "vendor/bin/phel test",
"compile": "vendor/bin/phel compile",
"compile:no-cache": "vendor/bin/phel compile --no-cache",
"format": "vendor/bin/phel format src/ tests/"
"build": "vendor/bin/phel build",
"build:no-cache": "vendor/bin/phel build --no-cache",
"format": "vendor/bin/phel format"
}
}
2 changes: 1 addition & 1 deletion public/index.php
Original file line number Diff line number Diff line change
Expand Up @@ -18,4 +18,4 @@

// Runs previously compiled PHP code (Fast).
require_once $projectRootDir . "vendor/autoload.php";
require_once $projectRootDir . "dist/app/boot.php";
require_once $projectRootDir . "out/app/boot.php";

0 comments on commit d082cb3

Please sign in to comment.