summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGravatar Tom Willemse2026-08-22 00:30:26 -0700
committerGravatar Tom Willemse2026-08-22 00:30:26 -0700
commit2edfa920e0be2b3d63f3c6b0fb36f0c1c32c4339 (patch)
tree87b888d91e08844221d3e7b63dec408b6d0e8ae0
parent7c74afb2082e5ab2dfaef3d3c92da2049dbfa67f (diff)
downloadlezer-2edfa920e0be2b3d63f3c6b0fb36f0c1c32c4339.tar.gz
lezer-2edfa920e0be2b3d63f3c6b0fb36f0c1c32c4339.zip
Upgrade phel
-rw-r--r--composer.json3
-rw-r--r--phel-config.php23
-rw-r--r--src/app.phel8
-rw-r--r--src/controller/routes.phel10
-rw-r--r--src/module/greet.phel2
-rw-r--r--src/view/main.phel4
-rw-r--r--tests/module/greet-test.phel6
7 files changed, 22 insertions, 34 deletions
diff --git a/composer.json b/composer.json
index 921d611..57f4b25 100644
--- a/composer.json
+++ b/composer.json
@@ -12,8 +12,7 @@
"type": "project",
"require": {
"php": ">=8.3",
- "phel-lang/phel-lang": ">=0.24",
- "phel-lang/router": "^0.8"
+ "phel-lang/phel-lang": ">=0.50"
},
"require-dev": {
"symfony/var-dumper": "^6.4"
diff --git a/phel-config.php b/phel-config.php
index 504ab23..e653adf 100644
--- a/phel-config.php
+++ b/phel-config.php
@@ -3,22 +3,11 @@
declare(strict_types=1);
use Phel\Config\PhelConfig;
-use Phel\Config\PhelExportConfig;
-use Phel\Config\PhelBuildConfig;
+use Phel\Config\ProjectLayout;
-return (new PhelConfig())
- ->setSrcDirs(['src'])
- ->setTestDirs(['tests'])
- ->setVendorDir('vendor')
- ->setKeepGeneratedTempFiles(false)
- ->setFormatDirs(['src', 'tests'])
- ->setBuildConfig((new PhelBuildConfig())
- ->setMainPhelNamespace('lezer\app')
- ->setMainPhpPath('out/index.php'))
- ->setExportConfig((new PhelExportConfig())
- ->setFromDirectories(['src/phel'])
- ->setNamespacePrefix('PhelGenerated')
- ->setTargetDirectory('src/PhelGenerated'))
- ->setIgnoreWhenBuilding(['local.phel'])
- ->setNoCacheWhenBuilding(['lezer/app'])
+return PhelConfig::forProject(ProjectLayout::Flat)
+ ->withMainPhelNamespace('lezer.app')
+ ->withIgnoreWhenBuilding(['local.phel'])
+ ->withNoCacheWhenBuilding(['lezer.app'])
+ ->withOptimizationLevel(2)
;
diff --git a/src/app.phel b/src/app.phel
index bcee391..9e1e0bd 100644
--- a/src/app.phel
+++ b/src/app.phel
@@ -1,7 +1,7 @@
-(ns lezer\app
- (:require lezer\controller\routes)
- (:require phel\router :as r)
- (:require phel\http :as h))
+(ns lezer.app
+ (:require lezer.controller.routes)
+ (:require phel.router :as r)
+ (:require phel.http :as h))
(def app
(r/handler
diff --git a/src/controller/routes.phel b/src/controller/routes.phel
index 93674d8..5f93cc2 100644
--- a/src/controller/routes.phel
+++ b/src/controller/routes.phel
@@ -1,8 +1,8 @@
-(ns lezer\controller\routes
- (:require lezer\view\main :refer [index-html])
- (:require lezer\module\greet :as g)
- (:require phel\router :as r)
- (:require phel\http :as h))
+(ns lezer.controller.routes
+ (:require lezer.view.main :refer [index-html])
+ (:require lezer.module.greet :as g)
+ (:require phel.router :as r)
+ (:require phel.http :as h))
(defn index-handler [req]
(h/response-from-map {:status 200
diff --git a/src/module/greet.phel b/src/module/greet.phel
index 09f49bd..0b1e780 100644
--- a/src/module/greet.phel
+++ b/src/module/greet.phel
@@ -1,4 +1,4 @@
-(ns lezer\module\greet)
+(ns lezer.module.greet)
(defn greet [name]
(str "Hello, " name))
diff --git a/src/view/main.phel b/src/view/main.phel
index 277c4d3..5d369ab 100644
--- a/src/view/main.phel
+++ b/src/view/main.phel
@@ -1,5 +1,5 @@
-(ns lezer\view\main
- (:require phel\html :refer [html doctype]))
+(ns lezer.view.main
+ (:require phel.html :refer [html doctype]))
(def- head
[:head
diff --git a/tests/module/greet-test.phel b/tests/module/greet-test.phel
index 927429b..ba0baf8 100644
--- a/tests/module/greet-test.phel
+++ b/tests/module/greet-test.phel
@@ -1,6 +1,6 @@
-(ns lezer-tests\module\example-test
- (:require lezer\module\greet :as g)
- (:require phel\test :refer [deftest is]))
+(ns lezer-tests.module.example-test
+ (:require lezer.module.greet :as g)
+ (:require phel.test :refer [deftest is]))
(deftest test-greet
(is (= "Hello, Name" (g/greet "Name"))))