@jetshop/cli 5.10.0 → 5.12.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/README.md +1 -1
- package/oclif.manifest.json +1 -1
- package/package.json +1 -1
- package/src/.DS_Store +0 -0
- package/src/commands/init.js +16 -9
package/README.md
CHANGED
|
@@ -19,7 +19,7 @@ $ npm install -g @jetshop/cli
|
|
|
19
19
|
$ jetshop COMMAND
|
|
20
20
|
running command...
|
|
21
21
|
$ jetshop (-v|--version|version)
|
|
22
|
-
@jetshop/cli/5.
|
|
22
|
+
@jetshop/cli/5.12.0 darwin-arm64 node-v16.13.0
|
|
23
23
|
$ jetshop --help [COMMAND]
|
|
24
24
|
USAGE
|
|
25
25
|
$ jetshop COMMAND
|
package/oclif.manifest.json
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":"5.
|
|
1
|
+
{"version":"5.12.0","commands":{"init":{"id":"init","description":"Setup of base project for jetshop e-commerce","pluginName":"@jetshop/cli","pluginType":"core","aliases":[],"flags":{},"args":[{"name":"repoName"},{"name":"shopid"}]}}}
|
package/package.json
CHANGED
package/src/.DS_Store
ADDED
|
Binary file
|
package/src/commands/init.js
CHANGED
|
@@ -17,7 +17,12 @@ const log = console.log;
|
|
|
17
17
|
const packageJsonOverride = {
|
|
18
18
|
version: '1.0.0',
|
|
19
19
|
private: true,
|
|
20
|
-
scripts: {
|
|
20
|
+
scripts: {
|
|
21
|
+
precommit: 'lint-staged',
|
|
22
|
+
preversion: undefined,
|
|
23
|
+
'cypress:singledomain:open': undefined,
|
|
24
|
+
'cypress:singledomain': undefined
|
|
25
|
+
},
|
|
21
26
|
prettier: {
|
|
22
27
|
singleQuote: true,
|
|
23
28
|
overrides: [
|
|
@@ -40,7 +45,7 @@ const packageJsonOverride = {
|
|
|
40
45
|
};
|
|
41
46
|
|
|
42
47
|
const confirm = (message, defaultAnswer = false) =>
|
|
43
|
-
new Promise(async resolve => {
|
|
48
|
+
new Promise(async (resolve) => {
|
|
44
49
|
while (true) {
|
|
45
50
|
const resp = await cli.prompt(message, {
|
|
46
51
|
require: false,
|
|
@@ -53,29 +58,31 @@ const confirm = (message, defaultAnswer = false) =>
|
|
|
53
58
|
|
|
54
59
|
const getValidRepoName = async () => {
|
|
55
60
|
const repoName = await cli.prompt(chalk.bold.white('Repo name'));
|
|
56
|
-
const {
|
|
57
|
-
|
|
58
|
-
|
|
61
|
+
const {
|
|
62
|
+
validForNewPackages,
|
|
63
|
+
errors = [],
|
|
64
|
+
warnings = []
|
|
65
|
+
} = validateName(repoName);
|
|
59
66
|
|
|
60
67
|
if (validForNewPackages) {
|
|
61
68
|
return repoName;
|
|
62
69
|
}
|
|
63
70
|
|
|
64
|
-
warnings.map(warn => log(chalk.bold.yellow(warn)));
|
|
65
|
-
errors.map(err => log(chalk.bold.red(err)));
|
|
71
|
+
warnings.map((warn) => log(chalk.bold.yellow(warn)));
|
|
72
|
+
errors.map((err) => log(chalk.bold.red(err)));
|
|
66
73
|
|
|
67
74
|
return getValidRepoName();
|
|
68
75
|
};
|
|
69
76
|
|
|
70
77
|
// will download the package as a .tgz and store it in current PWD
|
|
71
78
|
// if the package does not exists, it will throw an exception
|
|
72
|
-
const downloadNpmPackage = packageName =>
|
|
79
|
+
const downloadNpmPackage = (packageName) =>
|
|
73
80
|
exec(`npm pack ${packageName}`, {
|
|
74
81
|
stdio: ['ignore', 'pipe', 'ignore']
|
|
75
82
|
}).then(({ stdout }) => stdout.toString().trim());
|
|
76
83
|
|
|
77
84
|
const unpackNpmPackage = (file, out_path) =>
|
|
78
|
-
new Promise(resolve =>
|
|
85
|
+
new Promise((resolve) =>
|
|
79
86
|
fs
|
|
80
87
|
.createReadStream(`./${file}`)
|
|
81
88
|
.pipe(unpack(`./${out_path}`, { strip: 1 }))
|