webstudio 0.292.0 → 0.294.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/bin.js +21 -2
- package/lib/cli.js +90362 -59493
- package/lib/content-runtime.js +81 -81
- package/package.json +23 -20
- package/templates/cloudflare/package.json +1 -1
- package/templates/defaults/app/redirect-url.ts +39 -2
- package/templates/defaults/app/route-templates/html.tsx +9 -0
- package/templates/defaults/app/route-templates/text.tsx +9 -0
- package/templates/defaults/app/route-templates/xml.tsx +9 -0
- package/templates/defaults/package.json +8 -8
- package/templates/react-router/app/redirect-url.ts +39 -2
- package/templates/react-router/app/route-templates/html.tsx +9 -0
- package/templates/react-router/app/route-templates/text.tsx +9 -0
- package/templates/react-router/app/route-templates/xml.tsx +9 -0
- package/templates/react-router/package.json +8 -8
- package/templates/react-router-cloudflare/package.json +1 -1
- package/templates/ssg/app/route-templates/html/+data.ts +8 -0
- package/templates/ssg/package.json +6 -6
package/bin.js
CHANGED
|
@@ -1,5 +1,24 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
|
|
3
|
-
import {
|
|
3
|
+
import { createRequire } from "node:module";
|
|
4
|
+
import semver from "semver";
|
|
4
5
|
|
|
5
|
-
|
|
6
|
+
const require = createRequire(import.meta.url);
|
|
7
|
+
const packageJson = require("./package.json");
|
|
8
|
+
|
|
9
|
+
const start = async () => {
|
|
10
|
+
const currentVersion = process.versions.node;
|
|
11
|
+
const supportedVersionRange = packageJson.engines.node;
|
|
12
|
+
if (semver.satisfies(currentVersion, supportedVersionRange) === false) {
|
|
13
|
+
console.error(
|
|
14
|
+
`Webstudio CLI requires Node.js ${supportedVersionRange}. Detected Node.js ${currentVersion}. Install a supported Node.js version and try again.`
|
|
15
|
+
);
|
|
16
|
+
process.exitCode = 1;
|
|
17
|
+
return;
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
const { main } = await import("./lib/cli.js");
|
|
21
|
+
await main();
|
|
22
|
+
};
|
|
23
|
+
|
|
24
|
+
await start();
|