nxpage 0.0.1

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.
Files changed (2) hide show
  1. package/bin/nxpage.js +30 -0
  2. package/package.json +17 -0
package/bin/nxpage.js ADDED
@@ -0,0 +1,30 @@
1
+ #!/usr/bin/env node
2
+ import { spawn } from "child_process";
3
+ import { createRequire } from "module";
4
+
5
+ const require = createRequire(import.meta.url);
6
+
7
+ const cmd = process.argv[2];
8
+
9
+ // resolve Next CLI path from workspace
10
+ const nextBin = require.resolve("next/dist/bin/next");
11
+
12
+ const run = (args) =>
13
+ spawn("node", [nextBin, ...args], { stdio: "inherit" });
14
+
15
+ switch (cmd) {
16
+ case "dev":
17
+ run(["dev"]);
18
+ break;
19
+
20
+ case "build":
21
+ run(["build"]);
22
+ break;
23
+
24
+ case "start":
25
+ run(["start"]);
26
+ break;
27
+
28
+ default:
29
+ console.log("nxpage dev | build | start");
30
+ }
package/package.json ADDED
@@ -0,0 +1,17 @@
1
+ {
2
+ "name": "nxpage",
3
+ "version": "0.0.1",
4
+ "description": "NxPage framework built on top of Next.js",
5
+ "type": "module",
6
+ "bin": {
7
+ "nxpage": "./bin/nxpage.js"
8
+ },
9
+ "files": [
10
+ "bin"
11
+ ],
12
+ "dependencies": {
13
+ "next": "^14.0.0"
14
+ },
15
+ "keywords": ["nextjs", "framework", "nxpage"],
16
+ "license": "MIT"
17
+ }