create-vxrn 1.27.1 → 2.0.0-beta.45.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.
- package/.turbo/turbo-build.log +1 -1
- package/dist/cjs/create.cjs +193 -194
- package/dist/cjs/create.native.cjs +262 -0
- package/dist/cjs/create.native.js +218 -227
- package/dist/cjs/create.native.js.map +1 -1
- package/dist/cjs/helpers/cloneStarter.cjs +83 -95
- package/dist/cjs/helpers/cloneStarter.native.cjs +114 -0
- package/dist/cjs/helpers/cloneStarter.native.js +86 -97
- package/dist/cjs/helpers/cloneStarter.native.js.map +1 -1
- package/dist/cjs/helpers/getProjectName.cjs +56 -65
- package/dist/cjs/helpers/getProjectName.native.cjs +75 -0
- package/dist/cjs/helpers/getProjectName.native.js +56 -64
- package/dist/cjs/helpers/getProjectName.native.js.map +1 -1
- package/dist/cjs/helpers/getTemplateInfo.cjs +39 -52
- package/dist/cjs/helpers/getTemplateInfo.native.cjs +67 -0
- package/dist/cjs/helpers/getTemplateInfo.native.js +48 -60
- package/dist/cjs/helpers/getTemplateInfo.native.js.map +1 -1
- package/dist/cjs/helpers/installDependencies.cjs +37 -43
- package/dist/cjs/helpers/installDependencies.native.cjs +51 -0
- package/dist/cjs/helpers/installDependencies.native.js +37 -42
- package/dist/cjs/helpers/installDependencies.native.js.map +1 -1
- package/dist/cjs/helpers/validateNpmPackage.cjs +25 -36
- package/dist/cjs/helpers/validateNpmPackage.native.cjs +42 -0
- package/dist/cjs/helpers/validateNpmPackage.native.js +25 -35
- package/dist/cjs/helpers/validateNpmPackage.native.js.map +1 -1
- package/dist/cjs/index.cjs +60 -69
- package/dist/cjs/index.native.cjs +92 -0
- package/dist/cjs/index.native.js +61 -69
- package/dist/cjs/index.native.js.map +1 -1
- package/dist/cjs/steps/bare.cjs +51 -61
- package/dist/cjs/steps/bare.native.cjs +121 -0
- package/dist/cjs/steps/bare.native.js +71 -82
- package/dist/cjs/steps/bare.native.js.map +1 -1
- package/dist/cjs/steps/fullstack.cjs +23 -35
- package/dist/cjs/steps/fullstack.native.cjs +50 -0
- package/dist/cjs/steps/fullstack.native.js +25 -36
- package/dist/cjs/steps/fullstack.native.js.map +1 -1
- package/dist/cjs/steps/one.cjs +42 -57
- package/dist/cjs/steps/one.native.cjs +97 -0
- package/dist/cjs/steps/one.native.js +46 -60
- package/dist/cjs/steps/one.native.js.map +1 -1
- package/dist/cjs/steps/types.cjs +9 -11
- package/dist/cjs/steps/types.native.cjs +18 -0
- package/dist/cjs/steps/types.native.js +9 -10
- package/dist/cjs/steps/types.native.js.map +1 -1
- package/dist/cjs/templates.cjs +54 -59
- package/dist/cjs/templates.native.cjs +70 -0
- package/dist/cjs/templates.native.js +55 -59
- package/dist/cjs/templates.native.js.map +1 -1
- package/dist/esm/create.mjs +179 -169
- package/dist/esm/create.mjs.map +1 -1
- package/dist/esm/create.native.js +204 -203
- package/dist/esm/create.native.js.map +1 -1
- package/dist/esm/helpers/cloneStarter.mjs +71 -77
- package/dist/esm/helpers/cloneStarter.mjs.map +1 -1
- package/dist/esm/helpers/cloneStarter.native.js +74 -80
- package/dist/esm/helpers/cloneStarter.native.js.map +1 -1
- package/dist/esm/helpers/getProjectName.mjs +41 -39
- package/dist/esm/helpers/getProjectName.mjs.map +1 -1
- package/dist/esm/helpers/getProjectName.native.js +41 -39
- package/dist/esm/helpers/getProjectName.native.js.map +1 -1
- package/dist/esm/helpers/getTemplateInfo.mjs +25 -27
- package/dist/esm/helpers/getTemplateInfo.mjs.map +1 -1
- package/dist/esm/helpers/getTemplateInfo.native.js +33 -35
- package/dist/esm/helpers/getTemplateInfo.native.js.map +1 -1
- package/dist/esm/helpers/installDependencies.mjs +25 -25
- package/dist/esm/helpers/installDependencies.mjs.map +1 -1
- package/dist/esm/helpers/installDependencies.native.js +25 -25
- package/dist/esm/helpers/installDependencies.native.js.map +1 -1
- package/dist/esm/helpers/validateNpmPackage.mjs +10 -10
- package/dist/esm/helpers/validateNpmPackage.mjs.map +1 -1
- package/dist/esm/helpers/validateNpmPackage.native.js +10 -10
- package/dist/esm/helpers/validateNpmPackage.native.js.map +1 -1
- package/dist/esm/index.js +51 -53
- package/dist/esm/index.js.map +1 -1
- package/dist/esm/index.mjs +51 -53
- package/dist/esm/index.mjs.map +1 -1
- package/dist/esm/index.native.js +52 -54
- package/dist/esm/index.native.js.map +1 -1
- package/dist/esm/steps/bare.mjs +35 -36
- package/dist/esm/steps/bare.mjs.map +1 -1
- package/dist/esm/steps/bare.native.js +55 -58
- package/dist/esm/steps/bare.native.js.map +1 -1
- package/dist/esm/steps/fullstack.mjs +8 -9
- package/dist/esm/steps/fullstack.mjs.map +1 -1
- package/dist/esm/steps/fullstack.native.js +10 -11
- package/dist/esm/steps/fullstack.native.js.map +1 -1
- package/dist/esm/steps/one.mjs +26 -32
- package/dist/esm/steps/one.mjs.map +1 -1
- package/dist/esm/steps/one.native.js +30 -36
- package/dist/esm/steps/one.native.js.map +1 -1
- package/dist/esm/steps/types.mjs +0 -2
- package/dist/esm/steps/types.native.js +0 -2
- package/dist/esm/templates.mjs +40 -34
- package/dist/esm/templates.mjs.map +1 -1
- package/dist/esm/templates.native.js +40 -34
- package/dist/esm/templates.native.js.map +1 -1
- package/package.json +4 -4
- package/dist/esm/steps/types.mjs.map +0 -1
- package/dist/esm/steps/types.native.js.map +0 -1
package/dist/cjs/index.cjs
CHANGED
|
@@ -6,22 +6,17 @@ var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
|
6
6
|
var __getProtoOf = Object.getPrototypeOf;
|
|
7
7
|
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
8
8
|
var __copyProps = (to, from, except, desc) => {
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
9
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
10
|
+
for (let key of __getOwnPropNames(from)) if (!__hasOwnProp.call(to, key) && key !== except) __defProp(to, key, {
|
|
11
|
+
get: () => from[key],
|
|
12
|
+
enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable
|
|
13
|
+
});
|
|
14
|
+
}
|
|
15
|
+
return to;
|
|
16
16
|
};
|
|
17
|
-
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
// compatible transform (i.e. "__esModule" has not been set), then set
|
|
21
|
-
// "default" to the CommonJS "module.exports" for node compatibility.
|
|
22
|
-
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", {
|
|
23
|
-
value: mod,
|
|
24
|
-
enumerable: true
|
|
17
|
+
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", {
|
|
18
|
+
value: mod,
|
|
19
|
+
enumerable: true
|
|
25
20
|
}) : target, mod));
|
|
26
21
|
var import_ansis = __toESM(require("ansis"));
|
|
27
22
|
var import_citty = require("citty");
|
|
@@ -33,66 +28,62 @@ var import_node_url = require("node:url");
|
|
|
33
28
|
var import_node_fs = require("node:fs");
|
|
34
29
|
const import_meta = {};
|
|
35
30
|
function exit() {
|
|
36
|
-
|
|
31
|
+
process.exit(0);
|
|
37
32
|
}
|
|
38
33
|
process.on("SIGTERM", exit);
|
|
39
34
|
process.on("SIGINT", exit);
|
|
40
35
|
const main = (0, import_citty.defineCommand)({
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
await (0, import_create.create)({
|
|
79
|
-
template: args.template
|
|
80
|
-
});
|
|
81
|
-
}
|
|
36
|
+
meta: {
|
|
37
|
+
name: "main",
|
|
38
|
+
version: "0.0.0",
|
|
39
|
+
description: "Welcome to vxrn"
|
|
40
|
+
},
|
|
41
|
+
args: {
|
|
42
|
+
directory: {
|
|
43
|
+
type: "positional",
|
|
44
|
+
description: "Directory to copy into",
|
|
45
|
+
default: ""
|
|
46
|
+
},
|
|
47
|
+
template: {
|
|
48
|
+
type: "string",
|
|
49
|
+
required: false,
|
|
50
|
+
description: "Choose a template in advance (avoid selection screen)."
|
|
51
|
+
},
|
|
52
|
+
info: {
|
|
53
|
+
type: "boolean",
|
|
54
|
+
description: "Output the post-install instructions for the template."
|
|
55
|
+
}
|
|
56
|
+
},
|
|
57
|
+
async run({ args }) {
|
|
58
|
+
if (args.info) {
|
|
59
|
+
let template = await (0, import_getTemplateInfo.getTemplateInfo)(args.template);
|
|
60
|
+
if ("extraSteps" in template) {
|
|
61
|
+
await template.extraSteps({
|
|
62
|
+
isFullClone: false,
|
|
63
|
+
projectName: import_node_path.default.basename((0, import_node_process.cwd)()),
|
|
64
|
+
projectPath: (0, import_node_process.cwd)()
|
|
65
|
+
});
|
|
66
|
+
}
|
|
67
|
+
return;
|
|
68
|
+
}
|
|
69
|
+
console.info();
|
|
70
|
+
console.info(import_ansis.default.bold("Creating vxrn app..."));
|
|
71
|
+
await (0, import_create.create)({ template: args.template });
|
|
72
|
+
}
|
|
82
73
|
});
|
|
83
74
|
(0, import_citty.runMain)(main);
|
|
84
75
|
function getPackageVersion() {
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
76
|
+
let dirname;
|
|
77
|
+
if (typeof __dirname !== "undefined") {
|
|
78
|
+
dirname = __dirname;
|
|
79
|
+
} else {
|
|
80
|
+
dirname = import_node_path.default.dirname((0, import_node_url.fileURLToPath)(import_meta.url));
|
|
81
|
+
}
|
|
82
|
+
const packagePath = import_node_path.default.join(dirname, "..", "..", "package.json");
|
|
83
|
+
const packageJson = JSON.parse((0, import_node_fs.readFileSync)(packagePath, "utf-8"));
|
|
84
|
+
return packageJson.version;
|
|
94
85
|
}
|
|
95
86
|
if (process.argv.includes("--version")) {
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
}
|
|
87
|
+
console.info(getPackageVersion());
|
|
88
|
+
process.exit(0);
|
|
89
|
+
}
|
|
@@ -0,0 +1,92 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
"use strict";
|
|
3
|
+
|
|
4
|
+
var __create = Object.create;
|
|
5
|
+
var __defProp = Object.defineProperty;
|
|
6
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
7
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
8
|
+
var __getProtoOf = Object.getPrototypeOf;
|
|
9
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
10
|
+
var __copyProps = (to, from, except, desc) => {
|
|
11
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
12
|
+
for (let key of __getOwnPropNames(from)) if (!__hasOwnProp.call(to, key) && key !== except) __defProp(to, key, {
|
|
13
|
+
get: () => from[key],
|
|
14
|
+
enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable
|
|
15
|
+
});
|
|
16
|
+
}
|
|
17
|
+
return to;
|
|
18
|
+
};
|
|
19
|
+
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", {
|
|
20
|
+
value: mod,
|
|
21
|
+
enumerable: true
|
|
22
|
+
}) : target, mod));
|
|
23
|
+
var import_ansis = __toESM(require("ansis"));
|
|
24
|
+
var import_citty = require("citty");
|
|
25
|
+
var import_path = __toESM(require("path"));
|
|
26
|
+
var import_process = require("process");
|
|
27
|
+
var import_getTemplateInfo = require("./helpers/getTemplateInfo.native.js");
|
|
28
|
+
var import_create = require("./create.native.js");
|
|
29
|
+
var import_url = require("url");
|
|
30
|
+
var import_fs = require("fs");
|
|
31
|
+
const import_meta = {};
|
|
32
|
+
function exit() {
|
|
33
|
+
process.exit(0);
|
|
34
|
+
}
|
|
35
|
+
process.on("SIGTERM", exit);
|
|
36
|
+
process.on("SIGINT", exit);
|
|
37
|
+
var main = (0, import_citty.defineCommand)({
|
|
38
|
+
meta: {
|
|
39
|
+
name: "main",
|
|
40
|
+
version: "0.0.0",
|
|
41
|
+
description: "Welcome to vxrn"
|
|
42
|
+
},
|
|
43
|
+
args: {
|
|
44
|
+
directory: {
|
|
45
|
+
type: "positional",
|
|
46
|
+
description: "Directory to copy into",
|
|
47
|
+
default: ""
|
|
48
|
+
},
|
|
49
|
+
template: {
|
|
50
|
+
type: "string",
|
|
51
|
+
required: false,
|
|
52
|
+
description: "Choose a template in advance (avoid selection screen)."
|
|
53
|
+
},
|
|
54
|
+
info: {
|
|
55
|
+
type: "boolean",
|
|
56
|
+
description: "Output the post-install instructions for the template."
|
|
57
|
+
}
|
|
58
|
+
},
|
|
59
|
+
async run(param) {
|
|
60
|
+
var { args } = param;
|
|
61
|
+
if (args.info) {
|
|
62
|
+
var template = await (0, import_getTemplateInfo.getTemplateInfo)(args.template);
|
|
63
|
+
if ("extraSteps" in template) {
|
|
64
|
+
await template.extraSteps({
|
|
65
|
+
isFullClone: false,
|
|
66
|
+
projectName: import_path.default.basename((0, import_process.cwd)()),
|
|
67
|
+
projectPath: (0, import_process.cwd)()
|
|
68
|
+
});
|
|
69
|
+
}
|
|
70
|
+
return;
|
|
71
|
+
}
|
|
72
|
+
console.info();
|
|
73
|
+
console.info(import_ansis.default.bold("Creating vxrn app..."));
|
|
74
|
+
await (0, import_create.create)({ template: args.template });
|
|
75
|
+
}
|
|
76
|
+
});
|
|
77
|
+
(0, import_citty.runMain)(main);
|
|
78
|
+
function getPackageVersion() {
|
|
79
|
+
var dirname;
|
|
80
|
+
if (typeof __dirname !== "undefined") {
|
|
81
|
+
dirname = __dirname;
|
|
82
|
+
} else {
|
|
83
|
+
dirname = import_path.default.dirname((0, import_url.fileURLToPath)(import_meta.url));
|
|
84
|
+
}
|
|
85
|
+
var packagePath = import_path.default.join(dirname, "..", "..", "package.json");
|
|
86
|
+
var packageJson = JSON.parse((0, import_fs.readFileSync)(packagePath, "utf-8"));
|
|
87
|
+
return packageJson.version;
|
|
88
|
+
}
|
|
89
|
+
if (process.argv.includes("--version")) {
|
|
90
|
+
console.info(getPackageVersion());
|
|
91
|
+
process.exit(0);
|
|
92
|
+
}
|
package/dist/cjs/index.native.js
CHANGED
|
@@ -8,22 +8,17 @@ var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
|
8
8
|
var __getProtoOf = Object.getPrototypeOf;
|
|
9
9
|
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
10
10
|
var __copyProps = (to, from, except, desc) => {
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
11
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
12
|
+
for (let key of __getOwnPropNames(from)) if (!__hasOwnProp.call(to, key) && key !== except) __defProp(to, key, {
|
|
13
|
+
get: () => from[key],
|
|
14
|
+
enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable
|
|
15
|
+
});
|
|
16
|
+
}
|
|
17
|
+
return to;
|
|
18
18
|
};
|
|
19
|
-
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
// compatible transform (i.e. "__esModule" has not been set), then set
|
|
23
|
-
// "default" to the CommonJS "module.exports" for node compatibility.
|
|
24
|
-
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", {
|
|
25
|
-
value: mod,
|
|
26
|
-
enumerable: true
|
|
19
|
+
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", {
|
|
20
|
+
value: mod,
|
|
21
|
+
enumerable: true
|
|
27
22
|
}) : target, mod));
|
|
28
23
|
var import_ansis = __toESM(require("ansis"));
|
|
29
24
|
var import_citty = require("citty");
|
|
@@ -35,68 +30,65 @@ var import_url = require("url");
|
|
|
35
30
|
var import_fs = require("fs");
|
|
36
31
|
const import_meta = {};
|
|
37
32
|
function exit() {
|
|
38
|
-
|
|
33
|
+
process.exit(0);
|
|
39
34
|
}
|
|
40
35
|
process.on("SIGTERM", exit);
|
|
41
36
|
process.on("SIGINT", exit);
|
|
42
37
|
var main = (0, import_citty.defineCommand)({
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
await (0, import_create.create)({
|
|
82
|
-
template: args.template
|
|
83
|
-
});
|
|
84
|
-
}
|
|
38
|
+
meta: {
|
|
39
|
+
name: "main",
|
|
40
|
+
version: "0.0.0",
|
|
41
|
+
description: "Welcome to vxrn"
|
|
42
|
+
},
|
|
43
|
+
args: {
|
|
44
|
+
directory: {
|
|
45
|
+
type: "positional",
|
|
46
|
+
description: "Directory to copy into",
|
|
47
|
+
default: ""
|
|
48
|
+
},
|
|
49
|
+
template: {
|
|
50
|
+
type: "string",
|
|
51
|
+
required: false,
|
|
52
|
+
description: "Choose a template in advance (avoid selection screen)."
|
|
53
|
+
},
|
|
54
|
+
info: {
|
|
55
|
+
type: "boolean",
|
|
56
|
+
description: "Output the post-install instructions for the template."
|
|
57
|
+
}
|
|
58
|
+
},
|
|
59
|
+
async run(param) {
|
|
60
|
+
var { args } = param;
|
|
61
|
+
if (args.info) {
|
|
62
|
+
var template = await (0, import_getTemplateInfo.getTemplateInfo)(args.template);
|
|
63
|
+
if ("extraSteps" in template) {
|
|
64
|
+
await template.extraSteps({
|
|
65
|
+
isFullClone: false,
|
|
66
|
+
projectName: import_path.default.basename((0, import_process.cwd)()),
|
|
67
|
+
projectPath: (0, import_process.cwd)()
|
|
68
|
+
});
|
|
69
|
+
}
|
|
70
|
+
return;
|
|
71
|
+
}
|
|
72
|
+
console.info();
|
|
73
|
+
console.info(import_ansis.default.bold("Creating vxrn app..."));
|
|
74
|
+
await (0, import_create.create)({ template: args.template });
|
|
75
|
+
}
|
|
85
76
|
});
|
|
86
77
|
(0, import_citty.runMain)(main);
|
|
87
78
|
function getPackageVersion() {
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
79
|
+
var dirname;
|
|
80
|
+
if (typeof __dirname !== "undefined") {
|
|
81
|
+
dirname = __dirname;
|
|
82
|
+
} else {
|
|
83
|
+
dirname = import_path.default.dirname((0, import_url.fileURLToPath)(import_meta.url));
|
|
84
|
+
}
|
|
85
|
+
var packagePath = import_path.default.join(dirname, "..", "..", "package.json");
|
|
86
|
+
var packageJson = JSON.parse((0, import_fs.readFileSync)(packagePath, "utf-8"));
|
|
87
|
+
return packageJson.version;
|
|
97
88
|
}
|
|
98
89
|
if (process.argv.includes("--version")) {
|
|
99
|
-
|
|
100
|
-
|
|
90
|
+
console.info(getPackageVersion());
|
|
91
|
+
process.exit(0);
|
|
101
92
|
}
|
|
93
|
+
|
|
102
94
|
//# sourceMappingURL=index.native.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["
|
|
1
|
+
{"version":3,"file":"index.native.js","names":[],"sources":["cjs/index.native.js"],"sourcesContent":["#!/usr/bin/env node\n\"use strict\";\nvar __create = Object.create;\nvar __defProp = Object.defineProperty;\nvar __getOwnPropDesc = Object.getOwnPropertyDescriptor;\nvar __getOwnPropNames = Object.getOwnPropertyNames;\nvar __getProtoOf = Object.getPrototypeOf;\nvar __hasOwnProp = Object.prototype.hasOwnProperty;\nvar __copyProps = (to, from, except, desc) => {\n if (from && typeof from === \"object\" || typeof from === \"function\") {\n for (let key of __getOwnPropNames(from))\n if (!__hasOwnProp.call(to, key) && key !== except)\n __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });\n }\n return to;\n};\nvar __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(\n // If the importer is in node compatibility mode or this is not an ESM\n // file that has been converted to a CommonJS file using a Babel-\n // compatible transform (i.e. \"__esModule\" has not been set), then set\n // \"default\" to the CommonJS \"module.exports\" for node compatibility.\n isNodeMode || !mod || !mod.__esModule ? __defProp(target, \"default\", { value: mod, enumerable: true }) : target,\n mod\n));\nvar import_ansis = __toESM(require(\"ansis\"));\nvar import_citty = require(\"citty\");\nvar import_path = __toESM(require(\"path\"));\nvar import_process = require(\"process\");\nvar import_getTemplateInfo = require(\"./helpers/getTemplateInfo\");\nvar import_create = require(\"./create\");\nvar import_url = require(\"url\");\nvar import_fs = require(\"fs\");\nconst import_meta = {};\nfunction exit() {\n process.exit(0);\n}\nprocess.on(\"SIGTERM\", exit);\nprocess.on(\"SIGINT\", exit);\nvar main = (0, import_citty.defineCommand)({\n meta: {\n name: \"main\",\n version: \"0.0.0\",\n description: \"Welcome to vxrn\"\n },\n args: {\n directory: {\n type: \"positional\",\n description: \"Directory to copy into\",\n default: \"\"\n },\n template: {\n type: \"string\",\n required: false,\n description: \"Choose a template in advance (avoid selection screen).\"\n },\n info: {\n type: \"boolean\",\n description: \"Output the post-install instructions for the template.\"\n }\n },\n async run(param) {\n var { args } = param;\n if (args.info) {\n var template = await (0, import_getTemplateInfo.getTemplateInfo)(args.template);\n if (\"extraSteps\" in template) {\n await template.extraSteps({\n isFullClone: false,\n projectName: import_path.default.basename((0, import_process.cwd)()),\n projectPath: (0, import_process.cwd)()\n });\n }\n return;\n }\n console.info();\n console.info(import_ansis.default.bold(\"Creating vxrn app...\"));\n await (0, import_create.create)({\n template: args.template\n });\n }\n});\n(0, import_citty.runMain)(main);\nfunction getPackageVersion() {\n var dirname;\n if (typeof __dirname !== \"undefined\") {\n dirname = __dirname;\n } else {\n dirname = import_path.default.dirname((0, import_url.fileURLToPath)(import_meta.url));\n }\n var packagePath = import_path.default.join(dirname, \"..\", \"..\", \"package.json\");\n var packageJson = JSON.parse((0, import_fs.readFileSync)(packagePath, \"utf-8\"));\n return packageJson.version;\n}\nif (process.argv.includes(\"--version\")) {\n console.info(getPackageVersion());\n process.exit(0);\n}\n//# sourceMappingURL=index.js.map\n"],"mappings":";;;;AAEA,IAAI,WAAW,OAAO;AACtB,IAAI,YAAY,OAAO;AACvB,IAAI,mBAAmB,OAAO;AAC9B,IAAI,oBAAoB,OAAO;AAC/B,IAAI,eAAe,OAAO;AAC1B,IAAI,eAAe,OAAO,UAAU;AACpC,IAAI,eAAe,IAAI,MAAM,QAAQ,SAAS;CAC5C,IAAI,QAAQ,OAAO,SAAS,YAAY,OAAO,SAAS,YAAY;EAClE,KAAK,IAAI,OAAO,kBAAkB,IAAI,GACpC,IAAI,CAAC,aAAa,KAAK,IAAI,GAAG,KAAK,QAAQ,QACzC,UAAU,IAAI,KAAK;GAAE,WAAW,KAAK;GAAM,YAAY,EAAE,OAAO,iBAAiB,MAAM,GAAG,MAAM,KAAK;EAAW,CAAC;CACvH;CACA,OAAO;AACT;AACA,IAAI,WAAW,KAAK,YAAY,YAAY,SAAS,OAAO,OAAO,SAAS,aAAa,GAAG,CAAC,IAAI,CAAC,GAAG,YAKnG,cAAc,CAAC,OAAO,CAAC,IAAI,aAAa,UAAU,QAAQ,WAAW;CAAE,OAAO;CAAK,YAAY;AAAK,CAAC,IAAI,QACzG,GACF;AACA,IAAI,eAAe,QAAQ,QAAQ,OAAO,CAAC;AAC3C,IAAI,eAAe,QAAQ,OAAO;AAClC,IAAI,cAAc,QAAQ,QAAQ,MAAM,CAAC;AACzC,IAAI,iBAAiB,QAAQ,SAAS;AACtC,IAAI,yBAAyB,QAAQ,qCAA2B;AAChE,IAAI,gBAAgB,QAAQ,oBAAU;AACtC,IAAI,aAAa,QAAQ,KAAK;AAC9B,IAAI,YAAY,QAAQ,IAAI;AAC5B,MAAM,cAAc,CAAC;AACrB,SAAS,OAAO;CACd,QAAQ,KAAK,CAAC;AAChB;AACA,QAAQ,GAAG,WAAW,IAAI;AAC1B,QAAQ,GAAG,UAAU,IAAI;AACzB,IAAI,QAAQ,GAAG,aAAa,cAAa,CAAE;CACzC,MAAM;EACJ,MAAM;EACN,SAAS;EACT,aAAa;CACf;CACA,MAAM;EACJ,WAAW;GACT,MAAM;GACN,aAAa;GACb,SAAS;EACX;EACA,UAAU;GACR,MAAM;GACN,UAAU;GACV,aAAa;EACf;EACA,MAAM;GACJ,MAAM;GACN,aAAa;EACf;CACF;CACA,MAAM,IAAI,OAAO;EACf,IAAI,EAAE,SAAS;EACf,IAAI,KAAK,MAAM;GACb,IAAI,WAAW,OAAO,GAAG,uBAAuB,gBAAe,CAAE,KAAK,QAAQ;GAC9E,IAAI,gBAAgB,UAAU;IAC5B,MAAM,SAAS,WAAW;KACxB,aAAa;KACb,aAAa,YAAY,QAAQ,UAAU,GAAG,eAAe,IAAG,CAAE,CAAC;KACnE,cAAc,GAAG,eAAe,IAAG,CAAE;IACvC,CAAC;GACH;GACA;EACF;EACA,QAAQ,KAAK;EACb,QAAQ,KAAK,aAAa,QAAQ,KAAK,sBAAsB,CAAC;EAC9D,OAAO,GAAG,cAAc,OAAM,CAAE,EAC9B,UAAU,KAAK,SACjB,CAAC;CACH;AACF,CAAC;CACA,GAAG,aAAa,QAAO,CAAE,IAAI;AAC9B,SAAS,oBAAoB;CAC3B,IAAI;CACJ,IAAI,OAAO,cAAc,aAAa;EACpC,UAAU;CACZ,OAAO;EACL,UAAU,YAAY,QAAQ,SAAS,GAAG,WAAW,cAAa,CAAE,YAAY,GAAG,CAAC;CACtF;CACA,IAAI,cAAc,YAAY,QAAQ,KAAK,SAAS,MAAM,MAAM,cAAc;CAC9E,IAAI,cAAc,KAAK,OAAO,GAAG,UAAU,aAAY,CAAE,aAAa,OAAO,CAAC;CAC9E,OAAO,YAAY;AACrB;AACA,IAAI,QAAQ,KAAK,SAAS,WAAW,GAAG;CACtC,QAAQ,KAAK,kBAAkB,CAAC;CAChC,QAAQ,KAAK,CAAC;AAChB"}
|
package/dist/cjs/steps/bare.cjs
CHANGED
|
@@ -5,86 +5,76 @@ var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
|
5
5
|
var __getProtoOf = Object.getPrototypeOf;
|
|
6
6
|
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
7
7
|
var __export = (target, all) => {
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
8
|
+
for (var name in all) __defProp(target, name, {
|
|
9
|
+
get: all[name],
|
|
10
|
+
enumerable: true
|
|
11
|
+
});
|
|
12
12
|
};
|
|
13
13
|
var __copyProps = (to, from, except, desc) => {
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
14
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
15
|
+
for (let key of __getOwnPropNames(from)) if (!__hasOwnProp.call(to, key) && key !== except) __defProp(to, key, {
|
|
16
|
+
get: () => from[key],
|
|
17
|
+
enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable
|
|
18
|
+
});
|
|
19
|
+
}
|
|
20
|
+
return to;
|
|
21
21
|
};
|
|
22
|
-
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
// compatible transform (i.e. "__esModule" has not been set), then set
|
|
26
|
-
// "default" to the CommonJS "module.exports" for node compatibility.
|
|
27
|
-
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", {
|
|
28
|
-
value: mod,
|
|
29
|
-
enumerable: true
|
|
22
|
+
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", {
|
|
23
|
+
value: mod,
|
|
24
|
+
enumerable: true
|
|
30
25
|
}) : target, mod));
|
|
31
|
-
var __toCommonJS = mod => __copyProps(__defProp({}, "__esModule", {
|
|
32
|
-
value: true
|
|
33
|
-
}), mod);
|
|
26
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
34
27
|
var bare_exports = {};
|
|
35
28
|
__export(bare_exports, {
|
|
36
|
-
|
|
37
|
-
|
|
29
|
+
default: () => bare_default,
|
|
30
|
+
replaceNameInUTF8File: () => replaceNameInUTF8File
|
|
38
31
|
});
|
|
39
32
|
module.exports = __toCommonJS(bare_exports);
|
|
40
33
|
var import_ansis = __toESM(require("ansis"));
|
|
41
34
|
var import_fs_extra = __toESM(require("fs-extra"));
|
|
42
35
|
var import_node_path = require("node:path");
|
|
43
36
|
function shouldIgnoreFile(filePath) {
|
|
44
|
-
|
|
37
|
+
return filePath.match(/node_modules|yarn.lock|package-lock.json/g);
|
|
45
38
|
}
|
|
46
39
|
function shouldRenameFile(filePath, nameToReplace) {
|
|
47
|
-
|
|
40
|
+
return (0, import_node_path.basename)(filePath).includes(nameToReplace);
|
|
48
41
|
}
|
|
49
42
|
async function renameFile(filePath, oldName, newName) {
|
|
50
|
-
|
|
51
|
-
|
|
43
|
+
const newFileName = (0, import_node_path.join)((0, import_node_path.dirname)(filePath), (0, import_node_path.basename)(filePath).replace(new RegExp(oldName, "g"), newName));
|
|
44
|
+
await import_fs_extra.default.rename(filePath, newFileName);
|
|
52
45
|
}
|
|
53
46
|
function walk(current) {
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
47
|
+
if (!import_fs_extra.default.lstatSync(current).isDirectory()) {
|
|
48
|
+
return [current];
|
|
49
|
+
}
|
|
50
|
+
const files = import_fs_extra.default.readdirSync(current).map((child) => walk((0, import_node_path.join)(current, child)));
|
|
51
|
+
const result = [];
|
|
52
|
+
return result.concat.apply([current], files);
|
|
60
53
|
}
|
|
61
54
|
async function replaceNameInUTF8File(filePath, projectName, templateName) {
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
55
|
+
const fileContent = await import_fs_extra.default.readFile(filePath, "utf8");
|
|
56
|
+
const replacedFileContent = fileContent.replace(new RegExp(templateName, "g"), projectName).replace(new RegExp(templateName.toLowerCase(), "g"), projectName.toLowerCase());
|
|
57
|
+
if (fileContent !== replacedFileContent) {
|
|
58
|
+
await import_fs_extra.default.writeFile(filePath, replacedFileContent, "utf8");
|
|
59
|
+
}
|
|
67
60
|
}
|
|
68
|
-
const main = async ({
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
}
|
|
86
|
-
if (isFullClone) {
|
|
87
|
-
console.info(`
|
|
61
|
+
const main = async ({ isFullClone, projectName }) => {
|
|
62
|
+
const placeholderName = "bare";
|
|
63
|
+
for (const filePath of walk(process.cwd()).reverse()) {
|
|
64
|
+
if (shouldIgnoreFile(filePath)) {
|
|
65
|
+
continue;
|
|
66
|
+
}
|
|
67
|
+
if (!(await import_fs_extra.default.stat(filePath)).isDirectory()) {
|
|
68
|
+
await replaceNameInUTF8File(filePath, projectName, "bare");
|
|
69
|
+
}
|
|
70
|
+
if (shouldRenameFile(filePath, placeholderName)) {
|
|
71
|
+
await renameFile(filePath, placeholderName, projectName);
|
|
72
|
+
} else if (shouldRenameFile(filePath, placeholderName.toLowerCase())) {
|
|
73
|
+
await renameFile(filePath, placeholderName.toLowerCase(), projectName.toLowerCase());
|
|
74
|
+
}
|
|
75
|
+
}
|
|
76
|
+
if (isFullClone) {
|
|
77
|
+
console.info(`
|
|
88
78
|
${import_ansis.default.green.bold("Done!")} Created a new project under ./${import_ansis.default.greenBright(projectName)} visit your project:
|
|
89
79
|
\u2022 ${import_ansis.default.green("cd")} ${projectName}
|
|
90
80
|
|
|
@@ -104,6 +94,6 @@ ${import_ansis.default.blue(`Run instructions for ${import_ansis.default.bold("i
|
|
|
104
94
|
\u2022 Hit the Run button
|
|
105
95
|
|
|
106
96
|
`);
|
|
107
|
-
|
|
97
|
+
}
|
|
108
98
|
};
|
|
109
|
-
var bare_default = main;
|
|
99
|
+
var bare_default = main;
|