@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 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
- ![Screenshot of `npx create-contentful-app my-app`](./docs/screenshot.png)
20
+ ![Screenshot of `npx create-contentful-app my-app`](https://raw.githubusercontent.com/contentful/create-contentful-app/master/packages/contentful--create-contentful-app/docs/screenshot.png)
21
21
 
22
22
  ## Bootstrap
23
23
 
package/lib/index.js CHANGED
@@ -94,7 +94,7 @@ function initProject(appName, options) {
94
94
  successMessage(fullAppFolder);
95
95
  }
96
96
  catch (err) {
97
- (0, logger_1.error)(`Failed to create ${appName}`, String(err));
97
+ (0, logger_1.error)(`Failed to create ${appName}`, err);
98
98
  process.exit(1);
99
99
  }
100
100
  });
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
- ${error.startsWith('Error: ') ? error.substring(7) : error}
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
- message = 'Destination directory is not empty.';
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 new Error(message);
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.2.2",
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.2",
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": "1984bfe83b80a3f291ae753d7c37cc9dd734e5e0"
67
+ "gitHead": "257b55c95bf7ec19f5d998fad0ed7d7367a3beb4"
68
68
  }