@faststore/cli 2.0.2-alpha.0 → 2.0.12-alpha.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/CHANGELOG.md +18 -0
- package/dist/utils/generate.js +17 -30
- package/dist/utils/generate.js.map +1 -1
- package/package.json +8 -3
package/CHANGELOG.md
CHANGED
|
@@ -3,6 +3,24 @@
|
|
|
3
3
|
All notable changes to this project will be documented in this file.
|
|
4
4
|
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
|
|
5
5
|
|
|
6
|
+
## [2.0.12-alpha.0](https://github.com/vtex/faststore/compare/v2.0.11-alpha.0...v2.0.12-alpha.0) (2022-12-13)
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
### Features
|
|
10
|
+
|
|
11
|
+
* Beautify CLI messages with chalk ([#1550](https://github.com/vtex/faststore/issues/1550)) ([6c4c32c](https://github.com/vtex/faststore/commit/6c4c32c3ac0a97b55364b7251f2d90dc70f08952))
|
|
12
|
+
|
|
13
|
+
|
|
14
|
+
|
|
15
|
+
## 2.0.3-alpha.0 (2022-11-30)
|
|
16
|
+
|
|
17
|
+
|
|
18
|
+
### Chores
|
|
19
|
+
|
|
20
|
+
* Change from `patch` to `prepatch` release (alpha) ([#1523](https://github.com/vtex/faststore/issues/1523)) ([2f2c5b7](https://github.com/vtex/faststore/commit/2f2c5b77d2d71f887dad64a9488fabc4e6a29e07))
|
|
21
|
+
|
|
22
|
+
|
|
23
|
+
|
|
6
24
|
## [1.12.28](https://github.com/vtex/faststore/compare/v1.12.27...v1.12.28) (2022-11-09)
|
|
7
25
|
|
|
8
26
|
|
package/dist/utils/generate.js
CHANGED
|
@@ -2,9 +2,10 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.generate = void 0;
|
|
4
4
|
const tslib_1 = require("tslib");
|
|
5
|
-
const fs_extra_1 = require("fs-extra");
|
|
6
5
|
const deepmerge_1 = tslib_1.__importDefault(require("deepmerge"));
|
|
6
|
+
const fs_extra_1 = require("fs-extra");
|
|
7
7
|
const directory_1 = require("./directory");
|
|
8
|
+
const chalk_1 = tslib_1.__importDefault(require("chalk"));
|
|
8
9
|
const ignorePaths = ['node_modules'];
|
|
9
10
|
function createTmpFolder() {
|
|
10
11
|
try {
|
|
@@ -12,12 +13,10 @@ function createTmpFolder() {
|
|
|
12
13
|
(0, fs_extra_1.removeSync)(directory_1.tmpDir);
|
|
13
14
|
}
|
|
14
15
|
(0, fs_extra_1.mkdirsSync)(directory_1.tmpDir);
|
|
16
|
+
console.log(`${chalk_1.default.green('success')} - Temporary folder ${chalk_1.default.dim(directory_1.tmpFolderName)} created`);
|
|
15
17
|
}
|
|
16
18
|
catch (err) {
|
|
17
|
-
console.error(err);
|
|
18
|
-
}
|
|
19
|
-
finally {
|
|
20
|
-
console.log(`Temporary folder ${directory_1.tmpFolderName} created`);
|
|
19
|
+
console.error(`${chalk_1.default.red('error')} - ${err}`);
|
|
21
20
|
}
|
|
22
21
|
}
|
|
23
22
|
function copyCoreFiles() {
|
|
@@ -31,35 +30,29 @@ function copyCoreFiles() {
|
|
|
31
30
|
return shouldCopy;
|
|
32
31
|
},
|
|
33
32
|
});
|
|
33
|
+
console.log(`${chalk_1.default.green('success')} - Core files copied`);
|
|
34
34
|
}
|
|
35
35
|
catch (e) {
|
|
36
36
|
console.error(e);
|
|
37
37
|
}
|
|
38
|
-
finally {
|
|
39
|
-
console.log(`Core files copied`);
|
|
40
|
-
}
|
|
41
38
|
}
|
|
42
39
|
function copyUserSrcToCustomizations() {
|
|
43
40
|
try {
|
|
44
41
|
(0, fs_extra_1.copySync)(directory_1.userSrcDir, directory_1.tmpCustomizationsDir);
|
|
42
|
+
console.log(`${chalk_1.default.green('success')} - Custom files copied`);
|
|
45
43
|
}
|
|
46
44
|
catch (err) {
|
|
47
|
-
console.error(err);
|
|
48
|
-
}
|
|
49
|
-
finally {
|
|
50
|
-
console.log('Copied custom files');
|
|
45
|
+
console.error(`${chalk_1.default.red('error')} - ${err}`);
|
|
51
46
|
}
|
|
52
47
|
}
|
|
53
48
|
async function copyTheme() {
|
|
54
49
|
const storeConfig = await Promise.resolve().then(() => tslib_1.__importStar(require(directory_1.userStoreConfigFileDir)));
|
|
55
50
|
try {
|
|
56
51
|
(0, fs_extra_1.copyFileSync)(`${directory_1.userThemesFileDir}/${storeConfig.theme}.scss`, directory_1.tmpThemesCustomizationsFileDir);
|
|
52
|
+
console.log(`${chalk_1.default.green('success')} - Custom styles copied`);
|
|
57
53
|
}
|
|
58
54
|
catch (err) {
|
|
59
|
-
console.error(err);
|
|
60
|
-
}
|
|
61
|
-
finally {
|
|
62
|
-
console.log('Copied custom styles');
|
|
55
|
+
console.error(`${chalk_1.default.red('error')} - ${err}`);
|
|
63
56
|
}
|
|
64
57
|
}
|
|
65
58
|
function mergeCMSFile(fileName) {
|
|
@@ -70,12 +63,10 @@ function mergeCMSFile(fileName) {
|
|
|
70
63
|
const mergeContentTypes = [...coreContentTypesJSON, ...customContentTypesJSON];
|
|
71
64
|
try {
|
|
72
65
|
(0, fs_extra_1.writeFileSync)(`${directory_1.tmpCMSDir}/${fileName}`, JSON.stringify(mergeContentTypes));
|
|
66
|
+
console.log(`${chalk_1.default.green('success')} - CMS file ${chalk_1.default.dim(fileName)} created`);
|
|
73
67
|
}
|
|
74
68
|
catch (err) {
|
|
75
|
-
console.error(err);
|
|
76
|
-
}
|
|
77
|
-
finally {
|
|
78
|
-
console.log(`CMS file ${fileName} created`);
|
|
69
|
+
console.error(`${chalk_1.default.red('error')} - ${err}`);
|
|
79
70
|
}
|
|
80
71
|
}
|
|
81
72
|
function generateStoreConfigFile(content) {
|
|
@@ -87,23 +78,19 @@ async function copyStoreConfig() {
|
|
|
87
78
|
const storeConfigFromCore = await Promise.resolve().then(() => tslib_1.__importStar(require(directory_1.coreStoreConfigFileDir)));
|
|
88
79
|
const mergedStoreConfig = (0, deepmerge_1.default)(storeConfigFromCore, storeConfigFromStore);
|
|
89
80
|
(0, fs_extra_1.writeFileSync)(directory_1.tmpStoreConfigFileDir, generateStoreConfigFile(mergedStoreConfig));
|
|
81
|
+
console.log(`${chalk_1.default.green('success')} - File ${chalk_1.default.dim('store.config.js')} copied`);
|
|
90
82
|
}
|
|
91
83
|
catch (err) {
|
|
92
|
-
console.error(err);
|
|
93
|
-
}
|
|
94
|
-
finally {
|
|
95
|
-
console.log(`File store.config.js copied`);
|
|
84
|
+
console.error(`${chalk_1.default.red('error')} - ${err}`);
|
|
96
85
|
}
|
|
97
86
|
}
|
|
98
87
|
function mergeCMSFiles() {
|
|
99
88
|
try {
|
|
100
89
|
(0, fs_extra_1.mkdirsSync)(`${directory_1.tmpDir}/cms`);
|
|
90
|
+
console.log(`${chalk_1.default.green('success')} - CMS folder created`);
|
|
101
91
|
}
|
|
102
92
|
catch (err) {
|
|
103
|
-
console.error(err);
|
|
104
|
-
}
|
|
105
|
-
finally {
|
|
106
|
-
console.log(`CMS file created`);
|
|
93
|
+
console.error(`${chalk_1.default.red('error')} - ${err}`);
|
|
107
94
|
}
|
|
108
95
|
mergeCMSFile('content-types.json');
|
|
109
96
|
mergeCMSFile('sections.json');
|
|
@@ -111,11 +98,11 @@ function mergeCMSFiles() {
|
|
|
111
98
|
function createNodeModulesSymbolicLink() {
|
|
112
99
|
try {
|
|
113
100
|
(0, fs_extra_1.symlinkSync)(directory_1.userNodeModulesDir, directory_1.tmpNodeModulesDir);
|
|
101
|
+
console.log(`${chalk_1.default.green('success')} - Symbolic ${chalk_1.default.dim('node_modules')} link created from ${chalk_1.default.dim(directory_1.userNodeModulesDir)} to ${chalk_1.default.dim(directory_1.tmpNodeModulesDir)}`);
|
|
114
102
|
}
|
|
115
103
|
catch (err) {
|
|
116
|
-
console.error(err);
|
|
104
|
+
console.error(`${chalk_1.default.red('error')} - ${err}`);
|
|
117
105
|
}
|
|
118
|
-
console.log(`node_modules symbolic link created from ${directory_1.userNodeModulesDir} to ${directory_1.tmpNodeModulesDir}`);
|
|
119
106
|
}
|
|
120
107
|
async function generate(options) {
|
|
121
108
|
const { setup = false } = options ?? {};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"generate.js","sourceRoot":"","sources":["../../src/utils/generate.ts"],"names":[],"mappings":";;;;AAAA,
|
|
1
|
+
{"version":3,"file":"generate.js","sourceRoot":"","sources":["../../src/utils/generate.ts"],"names":[],"mappings":";;;;AAAA,kEAAiC;AACjC,uCASiB;AAEjB,2CAgBoB;AAEpB,0DAAyB;AAMzB,MAAM,WAAW,GAAG,CAAC,cAAc,CAAC,CAAA;AAEpC,SAAS,eAAe;IACtB,IAAI;QACF,IAAI,IAAA,qBAAU,EAAC,kBAAM,CAAC,EAAE;YACtB,IAAA,qBAAU,EAAC,kBAAM,CAAC,CAAA;SACnB;QAED,IAAA,qBAAU,EAAC,kBAAM,CAAC,CAAA;QAClB,OAAO,CAAC,GAAG,CACT,GAAG,eAAK,CAAC,KAAK,CAAC,SAAS,CAAC,uBAAuB,eAAK,CAAC,GAAG,CACvD,yBAAa,CACd,UAAU,CACZ,CAAA;KACF;IAAC,OAAO,GAAG,EAAE;QACZ,OAAO,CAAC,KAAK,CAAC,GAAG,eAAK,CAAC,GAAG,CAAC,OAAO,CAAC,MAAM,GAAG,EAAE,CAAC,CAAA;KAChD;AACH,CAAC;AAED,SAAS,aAAa;IACpB,IAAI;QACF,IAAA,mBAAQ,EAAC,mBAAO,EAAE,kBAAM,EAAE;YACxB,MAAM,CAAC,GAAG;gBACR,MAAM,aAAa,GAAG,GAAG,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,GAAG,EAAE,CAAA;gBAC1C,MAAM,UAAU,GAAG,aAAa;oBAC9B,CAAC,CAAC,CAAC,WAAW,CAAC,QAAQ,CAAC,aAAa,CAAC;oBACtC,CAAC,CAAC,IAAI,CAAA;gBAER,OAAO,UAAU,CAAA;YACnB,CAAC;SACF,CAAC,CAAA;QACF,OAAO,CAAC,GAAG,CAAC,GAAG,eAA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AAY;QACZ,2BAA2B,EAAE;QAC7B,SAAS,EAAE;QACX,aAAa,EAAE;QACf,eAAe,EAAE;KAClB,CAAC,CAAA;AACJ,CAAC;AApBD,4BAoBC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@faststore/cli",
|
|
3
|
-
"version": "2.0.
|
|
3
|
+
"version": "2.0.12-alpha.0",
|
|
4
4
|
"description": "FastStore CLI",
|
|
5
5
|
"author": "Emerson Laurentino @emersonlaurentino",
|
|
6
6
|
"bin": {
|
|
@@ -20,13 +20,14 @@
|
|
|
20
20
|
"@oclif/core": "^1.16.4",
|
|
21
21
|
"@oclif/plugin-help": "^5",
|
|
22
22
|
"@oclif/plugin-not-found": "^2.3.3",
|
|
23
|
+
"chalk": "~4.1.2",
|
|
23
24
|
"chokidar": "^3.5.3",
|
|
24
25
|
"deepmerge": "^4.2.2",
|
|
25
26
|
"fs-extra": "^10.1.0",
|
|
26
27
|
"path": "^0.12.7"
|
|
27
28
|
},
|
|
28
29
|
"devDependencies": {
|
|
29
|
-
"@faststore/shared": "^2.0.
|
|
30
|
+
"@faststore/shared": "^2.0.3-alpha.0",
|
|
30
31
|
"@types/chai": "^4",
|
|
31
32
|
"@types/fs-extra": "^9.0.13",
|
|
32
33
|
"@types/node": "^16.11.63",
|
|
@@ -37,6 +38,10 @@
|
|
|
37
38
|
"tslib": "^2.3.1",
|
|
38
39
|
"typescript": "^4.8.4"
|
|
39
40
|
},
|
|
41
|
+
"volta": {
|
|
42
|
+
"node": "16.18.0",
|
|
43
|
+
"yarn": "1.19.1"
|
|
44
|
+
},
|
|
40
45
|
"oclif": {
|
|
41
46
|
"bin": "faststore",
|
|
42
47
|
"dirname": "faststore",
|
|
@@ -63,5 +68,5 @@
|
|
|
63
68
|
"oclif"
|
|
64
69
|
],
|
|
65
70
|
"types": "dist/index.d.ts",
|
|
66
|
-
"gitHead": "
|
|
71
|
+
"gitHead": "46332a271c557f6e7f80c79a589bc97393240908"
|
|
67
72
|
}
|