@squiz/component-cli-lib 1.15.0 → 1.16.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/.npm/_logs/2023-02-27T23_01_00_928Z-debug-0.log +39 -0
- package/lib/index.js +1 -1
- package/lib/index.js.map +3 -3
- package/lib/templates/advanced/manifest.json +7 -0
- package/lib/templates/basic/manifest.json +9 -0
- package/package.json +9 -9
- package/src/component-init.ts +5 -5
- package/templates/advanced/manifest.json +7 -0
- package/templates/basic/manifest.json +9 -0
- package/tsconfig.tsbuildinfo +1 -1
- package/.npm/_logs/2023-02-27T07_58_42_731Z-debug-0.log +0 -39
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@squiz/component-cli-lib",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.16.0",
|
|
4
4
|
"description": "",
|
|
5
5
|
"main": "lib/index.js",
|
|
6
6
|
"scripts": {
|
|
@@ -13,12 +13,12 @@
|
|
|
13
13
|
"author": "",
|
|
14
14
|
"license": "ISC",
|
|
15
15
|
"devDependencies": {
|
|
16
|
-
"@squiz/component-lib": "1.
|
|
17
|
-
"@squiz/component-web-api-lib": "1.
|
|
18
|
-
"@squiz/dx-common-lib": "1.
|
|
19
|
-
"@squiz/dx-json-schema-lib": "1.
|
|
20
|
-
"@squiz/dx-logger-lib": "1.
|
|
21
|
-
"@squiz/virus-scanner-lib": "1.
|
|
16
|
+
"@squiz/component-lib": "1.16.0",
|
|
17
|
+
"@squiz/component-web-api-lib": "1.16.0",
|
|
18
|
+
"@squiz/dx-common-lib": "1.16.0",
|
|
19
|
+
"@squiz/dx-json-schema-lib": "1.16.0",
|
|
20
|
+
"@squiz/dx-logger-lib": "1.16.0",
|
|
21
|
+
"@squiz/virus-scanner-lib": "1.16.0",
|
|
22
22
|
"@types/cli-color": "2.0.2",
|
|
23
23
|
"@types/express": "4.17.17",
|
|
24
24
|
"@types/jest": "28.1.8",
|
|
@@ -32,12 +32,12 @@
|
|
|
32
32
|
"typescript": "4.9.4"
|
|
33
33
|
},
|
|
34
34
|
"dependencies": {
|
|
35
|
-
"@squiz/render-runtime-lib": "1.
|
|
35
|
+
"@squiz/render-runtime-lib": "1.16.0",
|
|
36
36
|
"archiver": "5.3.1",
|
|
37
37
|
"axios": "1.3.2",
|
|
38
38
|
"cli-color": "^2.0.2",
|
|
39
39
|
"open": "^8.4.0",
|
|
40
40
|
"supertest": "^6.2.3"
|
|
41
41
|
},
|
|
42
|
-
"gitHead": "
|
|
42
|
+
"gitHead": "6fbf11b4507a80f8ef6dd09b489bbebf2bcfbac1"
|
|
43
43
|
}
|
package/src/component-init.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import
|
|
1
|
+
import fse from 'fs-extra';
|
|
2
2
|
import path from 'path';
|
|
3
3
|
import { getLogger, LoggerOptions } from '@squiz/dx-logger-lib';
|
|
4
4
|
|
|
@@ -31,18 +31,18 @@ export default async function componentInit(options: {
|
|
|
31
31
|
const destination = path.resolve(options.destination);
|
|
32
32
|
|
|
33
33
|
// If the destination folder already exists, and it's not empty, throw an error
|
|
34
|
-
if (await
|
|
35
|
-
const files = await
|
|
34
|
+
if (await fse.pathExists(destination)) {
|
|
35
|
+
const files = await fse.readdir(destination);
|
|
36
36
|
if (files.length > 0) {
|
|
37
37
|
throw new Error('The destination folder already exists and is not empty.');
|
|
38
38
|
}
|
|
39
39
|
} else {
|
|
40
40
|
// If the destination folder doesn't exist, create it
|
|
41
|
-
await
|
|
41
|
+
await fse.mkdirp(destination);
|
|
42
42
|
}
|
|
43
43
|
|
|
44
44
|
// Copy the contents of the source folder to the destination folder
|
|
45
|
-
await
|
|
45
|
+
await fse.copy(sourceFolder, destination);
|
|
46
46
|
|
|
47
47
|
logger.info('Component initialized!');
|
|
48
48
|
}
|