~repos /edge-city
git clone https://pyrossh.dev/repos/edge-city.git
edge-city is a next level meta-framework for react that runs only on edge runtimes
aab71840
—
Peter John 2 years ago
change cli to use node
- packages/cli/index.js +5 -5
packages/cli/index.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
#!/usr/bin/env
|
|
1
|
+
#!/usr/bin/env node
|
|
2
2
|
import meow from 'meow';
|
|
3
3
|
import esbuild from 'esbuild';
|
|
4
4
|
import resolve from 'esbuild-plugin-resolve';
|
|
@@ -12,10 +12,11 @@ import postcssNesting from "postcss-nesting";
|
|
|
12
12
|
import bytes from 'bytes';
|
|
13
13
|
import pc from 'picocolors';
|
|
14
14
|
import ms from 'ms';
|
|
15
|
-
import pkg from "./package.json";
|
|
16
15
|
|
|
16
|
+
const __dirname = path.dirname(import.meta.url.replace("file://", ""));
|
|
17
|
+
const version = JSON.parse(fs.readFileSync(path.join(__dirname, "package.json"))).version;
|
|
17
18
|
const cli = meow(`
|
|
18
|
-
parotta v${
|
|
19
|
+
parotta v${version}
|
|
19
20
|
|
|
20
21
|
Usage
|
|
21
22
|
$ parotta build cloudflare
|
|
@@ -28,7 +29,6 @@ if (cli.input.length != 2) {
|
|
|
28
29
|
cli.showHelp();
|
|
29
30
|
process.exit(0);
|
|
30
31
|
}
|
|
31
|
-
const version = (await import(path.join(import.meta.dir, "package.json"))).default.version;
|
|
32
32
|
console.log(`parotta v${version}`)
|
|
33
33
|
console.log(`running with NODE_ENV=${process.env.NODE_ENV}`);
|
|
34
34
|
|
|
@@ -74,7 +74,7 @@ const bundleJs = async ({ entryPoints, outfile, ...options }, plg) => {
|
|
|
74
74
|
...options,
|
|
75
75
|
define: {
|
|
76
76
|
'process.env.NODE_ENV': JSON.stringify(process.env.NODE_ENV || "development"),
|
|
77
|
-
'process.env.PG_CONN_URL': JSON.stringify(process.env.PG_CONN_URL),
|
|
77
|
+
'process.env.PG_CONN_URL': JSON.stringify(process.env.PG_CONN_URL || ""),
|
|
78
78
|
},
|
|
79
79
|
plugins: [
|
|
80
80
|
resolve({
|