@contentful/create-contentful-app 1.2.2 → 1.3.2
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/lib/index.js +1 -1
- package/lib/logger.js +13 -4
- package/lib/template.js +6 -4
- package/lib/utils.js +1 -1
- package/package.json +3 -3
package/README.md
CHANGED
|
@@ -17,7 +17,7 @@ To start developing your first app, run:
|
|
|
17
17
|
npx create-contentful-app my-first-app
|
|
18
18
|
```
|
|
19
19
|
|
|
20
|
-

|
|
21
21
|
|
|
22
22
|
## Bootstrap
|
|
23
23
|
|
package/lib/index.js
CHANGED
package/lib/logger.js
CHANGED
|
@@ -10,10 +10,19 @@ function warn(message) {
|
|
|
10
10
|
}
|
|
11
11
|
exports.warn = warn;
|
|
12
12
|
function error(message, error) {
|
|
13
|
-
console.log(`${chalk_1.default.red('Error:')} ${message}
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
13
|
+
console.log(`${chalk_1.default.red('Error:')} ${message}`);
|
|
14
|
+
if (error === undefined) {
|
|
15
|
+
return;
|
|
16
|
+
}
|
|
17
|
+
else if (error instanceof Error) {
|
|
18
|
+
console.log();
|
|
19
|
+
console.log(error);
|
|
20
|
+
}
|
|
21
|
+
else {
|
|
22
|
+
const strigifiedError = String(error);
|
|
23
|
+
console.log();
|
|
24
|
+
console.log(`${strigifiedError.startsWith('Error: ') ? strigifiedError.substring(7) : strigifiedError}`);
|
|
25
|
+
}
|
|
17
26
|
}
|
|
18
27
|
exports.error = error;
|
|
19
28
|
function highlight(str) {
|
package/lib/template.js
CHANGED
|
@@ -42,18 +42,20 @@ function getTemplateSource(options) {
|
|
|
42
42
|
return source;
|
|
43
43
|
}
|
|
44
44
|
function clone(source, destination) {
|
|
45
|
-
var _a;
|
|
46
45
|
return __awaiter(this, void 0, void 0, function* () {
|
|
47
46
|
const d = (0, degit_1.default)(source, { mode: 'tar', cache: false });
|
|
48
47
|
try {
|
|
49
48
|
yield d.clone(destination);
|
|
50
49
|
}
|
|
51
50
|
catch (e) {
|
|
52
|
-
let message = (_a = e.message) !== null && _a !== void 0 ? _a : 'Unknown error';
|
|
53
51
|
if (e.code === 'DEST_NOT_EMPTY') {
|
|
54
|
-
|
|
52
|
+
// In this case, we know that degit will suggest users
|
|
53
|
+
// provide a 'force' flag - this is a flag for degit though
|
|
54
|
+
// and not CCA. So we swallow the details of this error
|
|
55
|
+
// to avoid confusing people.
|
|
56
|
+
throw new Error('Destination directory is not empty.');
|
|
55
57
|
}
|
|
56
|
-
throw
|
|
58
|
+
throw e;
|
|
57
59
|
}
|
|
58
60
|
});
|
|
59
61
|
}
|
package/lib/utils.js
CHANGED
|
@@ -8,7 +8,7 @@ const logger_1 = require("./logger");
|
|
|
8
8
|
const MUTUALLY_EXCLUSIVE_OPTIONS = ['source', 'example', 'javascript', 'typescript'];
|
|
9
9
|
function exec(command, args, options) {
|
|
10
10
|
return new Promise((resolve, reject) => {
|
|
11
|
-
const process = (0, child_process_1.spawn)(command, args, Object.assign({ stdio: 'inherit' }, options));
|
|
11
|
+
const process = (0, child_process_1.spawn)(command, args, Object.assign({ stdio: 'inherit', shell: true }, options));
|
|
12
12
|
process.on('exit', (exitCode) => {
|
|
13
13
|
if (exitCode === 0) {
|
|
14
14
|
resolve();
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@contentful/create-contentful-app",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.3.2",
|
|
4
4
|
"description": "A template for building Contentful Apps",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"contentful",
|
|
@@ -35,7 +35,7 @@
|
|
|
35
35
|
"build": "tsc"
|
|
36
36
|
},
|
|
37
37
|
"dependencies": {
|
|
38
|
-
"@contentful/app-scripts": "^1.0
|
|
38
|
+
"@contentful/app-scripts": "^1.1.0",
|
|
39
39
|
"chalk": "^4.1.0",
|
|
40
40
|
"commander": "^9.0.0",
|
|
41
41
|
"degit": "2.8.4",
|
|
@@ -64,5 +64,5 @@
|
|
|
64
64
|
"@types/tildify": "^2.0.2",
|
|
65
65
|
"@types/validate-npm-package-name": "^3.0.3"
|
|
66
66
|
},
|
|
67
|
-
"gitHead": "
|
|
67
|
+
"gitHead": "257b55c95bf7ec19f5d998fad0ed7d7367a3beb4"
|
|
68
68
|
}
|