create-faas-app 2.3.1 → 2.5.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/dist/index.js +3 -6
- package/dist/index.mjs +3 -6
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -10,8 +10,7 @@ var child_process = require('child_process');
|
|
|
10
10
|
var Validator = {
|
|
11
11
|
name(input) {
|
|
12
12
|
const match = /^[a-z0-9-_]+$/i.test(input) ? true : "Must be a-z, 0-9 or -_";
|
|
13
|
-
if (match !== true)
|
|
14
|
-
return match;
|
|
13
|
+
if (match !== true) return match;
|
|
15
14
|
if (fs.existsSync(input))
|
|
16
15
|
return `${input} folder exists, please try another name`;
|
|
17
16
|
return true;
|
|
@@ -27,8 +26,7 @@ async function action(options = {}) {
|
|
|
27
26
|
initial: "faasjs",
|
|
28
27
|
validate: Validator.name
|
|
29
28
|
}).then((res) => res.value);
|
|
30
|
-
if (!answers.name)
|
|
31
|
-
return;
|
|
29
|
+
if (!answers.name) return;
|
|
32
30
|
fs.mkdirSync(answers.name);
|
|
33
31
|
const runtime = process.versions.bun ? "bun" : "npm";
|
|
34
32
|
fs.writeFileSync(
|
|
@@ -154,8 +152,7 @@ describe('hello', () => {
|
|
|
154
152
|
);
|
|
155
153
|
if (runtime === "bun") {
|
|
156
154
|
child_process.execSync(`cd ${answers.name} && bun test`, { stdio: "inherit" });
|
|
157
|
-
} else
|
|
158
|
-
child_process.execSync(`cd ${answers.name} && npm run test`, { stdio: "inherit" });
|
|
155
|
+
} else child_process.execSync(`cd ${answers.name} && npm run test`, { stdio: "inherit" });
|
|
159
156
|
}
|
|
160
157
|
function action_default(program) {
|
|
161
158
|
program.description("Create a new faas app").on("--help", () => console.log("Examples:\nnpx create-faas-app")).option("--name <name>", "Project name").action(action);
|
package/dist/index.mjs
CHANGED
|
@@ -8,8 +8,7 @@ import { execSync } from 'node:child_process';
|
|
|
8
8
|
var Validator = {
|
|
9
9
|
name(input) {
|
|
10
10
|
const match = /^[a-z0-9-_]+$/i.test(input) ? true : "Must be a-z, 0-9 or -_";
|
|
11
|
-
if (match !== true)
|
|
12
|
-
return match;
|
|
11
|
+
if (match !== true) return match;
|
|
13
12
|
if (existsSync(input))
|
|
14
13
|
return `${input} folder exists, please try another name`;
|
|
15
14
|
return true;
|
|
@@ -25,8 +24,7 @@ async function action(options = {}) {
|
|
|
25
24
|
initial: "faasjs",
|
|
26
25
|
validate: Validator.name
|
|
27
26
|
}).then((res) => res.value);
|
|
28
|
-
if (!answers.name)
|
|
29
|
-
return;
|
|
27
|
+
if (!answers.name) return;
|
|
30
28
|
mkdirSync(answers.name);
|
|
31
29
|
const runtime = process.versions.bun ? "bun" : "npm";
|
|
32
30
|
writeFileSync(
|
|
@@ -152,8 +150,7 @@ describe('hello', () => {
|
|
|
152
150
|
);
|
|
153
151
|
if (runtime === "bun") {
|
|
154
152
|
execSync(`cd ${answers.name} && bun test`, { stdio: "inherit" });
|
|
155
|
-
} else
|
|
156
|
-
execSync(`cd ${answers.name} && npm run test`, { stdio: "inherit" });
|
|
153
|
+
} else execSync(`cd ${answers.name} && npm run test`, { stdio: "inherit" });
|
|
157
154
|
}
|
|
158
155
|
function action_default(program) {
|
|
159
156
|
program.description("Create a new faas app").on("--help", () => console.log("Examples:\nnpx create-faas-app")).option("--name <name>", "Project name").action(action);
|