@contentful/create-contentful-app 2.0.1-alpha.0 → 2.1.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/lib/index.js CHANGED
@@ -101,12 +101,12 @@ async function initProject(appName, options) {
101
101
  normalizedOptions.function = 'external-references';
102
102
  }
103
103
  process.chdir(fullAppFolder);
104
- `To add additional function templates to your app, use ${(0, logger_1.highlight)(chalk_1.default.green(`
104
+ (0, logger_1.wrapInBlanks)(`To add additional function templates to your app, use ${(0, logger_1.highlight)(chalk_1.default.green(`
105
105
  npx @contentful/app-scripts@latest generate-function \\
106
106
  --ci \\
107
107
  --name <name> \\
108
108
  --example <example> \\
109
- --language <typescript/javascript>`))}`;
109
+ --language <typescript/javascript>`))}`);
110
110
  const functionName = normalizedOptions.function
111
111
  .toLowerCase()
112
112
  .replace(/-([a-z])/g, (match, letter) => letter.toUpperCase());
@@ -157,7 +157,6 @@ async function initProject(appName, options) {
157
157
  `provide a template by its source repository.`,
158
158
  `format: URL (HTTPS or SSH) or ${(0, logger_1.code)('vendor:user/repo')} (e.g., ${(0, logger_1.code)('github:user/repo')})`,
159
159
  ].join('\n'))
160
- .option('-a, --action', 'include a hosted app action in the ts or js template')
161
160
  .option('-f, --function [function-template-name]', 'include the specified function template')
162
161
  .action(initProject);
163
162
  await commander_1.program.parseAsync();
package/lib/utils/file.js CHANGED
@@ -1,10 +1,6 @@
1
1
  "use strict";
2
- var __importDefault = (this && this.__importDefault) || function (mod) {
3
- return (mod && mod.__esModule) ? mod : { "default": mod };
4
- };
5
2
  Object.defineProperty(exports, "__esModule", { value: true });
6
- exports.exists = exports.mergeJsonIntoFile = exports.getJsonData = void 0;
7
- const merge_options_1 = __importDefault(require("merge-options"));
3
+ exports.exists = exports.getJsonData = void 0;
8
4
  const promises_1 = require("fs/promises");
9
5
  const path_1 = require("path");
10
6
  async function getJsonData(path) {
@@ -18,13 +14,6 @@ async function getJsonData(path) {
18
14
  return JSON.parse(await (0, promises_1.readFile)(normalizedPath, { encoding: 'utf-8' }));
19
15
  }
20
16
  exports.getJsonData = getJsonData;
21
- async function mergeJsonIntoFile({ source, destination, mergeFn = merge_options_1.default.bind({ concatArrays: false }), }) {
22
- const sourceJson = await getJsonData(source);
23
- const destinationJson = await getJsonData(destination);
24
- const mergedJson = mergeFn(destinationJson, sourceJson);
25
- await (0, promises_1.writeFile)((0, path_1.resolve)(destination), JSON.stringify(mergedJson, null, ' '));
26
- }
27
- exports.mergeJsonIntoFile = mergeJsonIntoFile;
28
17
  function exists(path) {
29
18
  return (0, promises_1.access)(path)
30
19
  .then(() => true)
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@contentful/create-contentful-app",
3
- "version": "2.0.1-alpha.0",
3
+ "version": "2.1.0",
4
4
  "description": "A template for building Contentful Apps",
5
5
  "keywords": [
6
6
  "contentful",
@@ -36,7 +36,7 @@
36
36
  "test": "mocha 'test/**/*.spec.{js,ts}'"
37
37
  },
38
38
  "dependencies": {
39
- "@contentful/app-scripts": "^2.1.2",
39
+ "@contentful/app-scripts": "2.2.0",
40
40
  "@segment/analytics-node": "^2.2.0",
41
41
  "chalk": "4.1.2",
42
42
  "commander": "12.1.0",
@@ -74,11 +74,11 @@
74
74
  "@types/validate-npm-package-name": "4.0.2",
75
75
  "chai": "^4.3.7",
76
76
  "chai-as-promised": "^7.1.1",
77
- "contentful-management": "11.47.3",
77
+ "contentful-management": "11.48.0",
78
78
  "mocha": "^10.2.0",
79
79
  "sinon": "^19.0.0",
80
80
  "sinon-chai": "^3.7.0",
81
81
  "ts-node": "^10.9.2"
82
82
  },
83
- "gitHead": "ccc4144ab5f50174d718f814c8a12304a36d1f18"
83
+ "gitHead": "f74bc713b10f3b7eafc95193327bebc91ec64d74"
84
84
  }