@contentful/create-contentful-app 1.17.1 → 1.17.3

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.
@@ -4,16 +4,16 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
4
4
  };
5
5
  Object.defineProperty(exports, "__esModule", { value: true });
6
6
  exports.cloneFunction = void 0;
7
- const promises_1 = require("fs/promises");
8
7
  const path_1 = require("path");
9
8
  const constants_1 = require("./constants");
10
9
  const tiged_1 = __importDefault(require("tiged"));
11
10
  const logger_1 = require("./logger");
12
11
  const file_1 = require("./utils/file");
13
12
  const package_1 = require("./utils/package");
13
+ // TODO: after appActions work we can change this getAddBuildCommandFn params from command -> defaultCommand as examples will have build commands
14
14
  const addBuildCommand = (0, package_1.getAddBuildCommandFn)({
15
15
  name: 'build:functions',
16
- command: 'node build-functions.js',
16
+ command: 'contentful-app-scripts build-functions --ci',
17
17
  });
18
18
  const VALID_FUNCTION_TEMPLATES_DIRS = [
19
19
  'appevent-filter',
@@ -45,8 +45,6 @@ async function cloneFunction(destination, templateIsJavascript, functionName) {
45
45
  source: `${functionDirectoryPath}/${constants_1.CONTENTFUL_APP_MANIFEST}`,
46
46
  destination: `${destination}/${constants_1.CONTENTFUL_APP_MANIFEST}`,
47
47
  });
48
- // move the build file from the actions folder to the root folder
49
- const copyBuildFile = (0, promises_1.rename)(`${functionDirectoryPath}/build-functions.js`, `${destination}/build-functions.js`);
50
48
  // modify package.json build commands
51
49
  const packageJsonLocation = (0, path_1.resolve)(`${destination}/package.json`);
52
50
  const packageJsonExists = await (0, file_1.exists)(packageJsonLocation);
@@ -59,7 +57,7 @@ async function cloneFunction(destination, templateIsJavascript, functionName) {
59
57
  destination: packageJsonLocation,
60
58
  mergeFn: addBuildCommand,
61
59
  });
62
- await Promise.all([writeAppManifest, copyBuildFile, writeBuildCommand]);
60
+ await Promise.all([writeAppManifest, writeBuildCommand]);
63
61
  await d.remove(functionDirectoryPath, destination, {
64
62
  action: 'remove',
65
63
  files: constants_1.IGNORED_CLONED_FILES.map((fileName) => `${functionDirectoryPath}/${fileName}`),
@@ -7,16 +7,17 @@ exports.getAddBuildCommandFn = void 0;
7
7
  const merge_options_1 = __importDefault(require("merge-options"));
8
8
  function getAddBuildCommandFn({ name, command }) {
9
9
  return (packageJson, additionalProperties) => {
10
- let buildCommand = packageJson?.scripts?.build ?? '';
10
+ let destBuildCommand = packageJson?.scripts?.build ?? '';
11
+ const sourceBuildCommand = additionalProperties?.scripts?.build ?? command;
11
12
  const triggerCommand = `npm run ${name}`;
12
- if (buildCommand === '') {
13
- buildCommand = triggerCommand;
13
+ if (destBuildCommand === '') {
14
+ destBuildCommand = triggerCommand;
14
15
  }
15
- else if (!buildCommand.split(/\s*&+\s*/).includes(triggerCommand)) {
16
- buildCommand += ` && ${triggerCommand}`;
16
+ else if (!destBuildCommand.split(/\s*&+\s*/).includes(triggerCommand)) {
17
+ destBuildCommand += ` && ${triggerCommand}`;
17
18
  }
18
19
  return (0, merge_options_1.default)({}, packageJson, additionalProperties, {
19
- scripts: { [name]: command, build: buildCommand },
20
+ scripts: { [name]: sourceBuildCommand, build: destBuildCommand },
20
21
  });
21
22
  };
22
23
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@contentful/create-contentful-app",
3
- "version": "1.17.1",
3
+ "version": "1.17.3",
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": "1.31.1",
39
+ "@contentful/app-scripts": "1.32.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.40.0",
77
+ "contentful-management": "11.40.2",
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": "abfff61de7708ed53d3f3afbbb59f64673ca5a4a"
83
+ "gitHead": "526f5b4c5cd834168a30397d1e4104476ef2dc05"
84
84
  }