feat: add initial node sea support
authorJérôme Benoit <jerome.benoit@piment-noir.org>
Sun, 14 Jul 2024 15:12:56 +0000 (17:12 +0200)
committerJérôme Benoit <jerome.benoit@piment-noir.org>
Sun, 14 Jul 2024 15:12:56 +0000 (17:12 +0200)
sea does not support ESM yet

Signed-off-by: Jérôme Benoit <jerome.benoit@piment-noir.org>
package.json
sea-config.json [new file with mode: 0644]

index 72bd673388273fa0dea931b893bd9b866df86fda..7b4a7f19cd07a2fa5dd9a72638bb379bba65733a 100644 (file)
@@ -71,7 +71,8 @@
     "test:debug": "glob -c \"node --import tsx --test --inspect\" \"tests/**/*.test.ts\"",
     "coverage": "c8 report --reporter=lcov",
     "coverage:html": "c8 report --reporter=html",
-    "clinic:clean": "clinic clean"
+    "clinic:clean": "clinic clean",
+    "sea": "pnpm exec rimraf ./dist/evse-simulator ./dist/evse-simulator.blob && node --experimental-sea-config sea-config.json && cp $(volta which node || n which lts || nvm which node || command -v node) ./dist/evse-simulator && npx postject ./dist/evse-simulator NODE_SEA_BLOB ./dist/evse-simulator.blob --sentinel-fuse NODE_SEA_FUSE_fce680ab2cc467b6e072b8b5df1996b2"
   },
   "pnpm": {
     "overrides": {
diff --git a/sea-config.json b/sea-config.json
new file mode 100644 (file)
index 0000000..1d9de76
--- /dev/null
@@ -0,0 +1,5 @@
+{
+  "main": "./dist/start.js",
+  "output": "./dist/evse-simulator.blob",
+  "disableExperimentalSEAWarning": true
+}