@contentful/create-contentful-app 1.16.0 → 1.16.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/lib/includeFunction.js +3 -3
- package/lib/index.js +6 -1
- package/package.json +3 -3
package/lib/includeFunction.js
CHANGED
|
@@ -25,19 +25,19 @@ const addBuildCommand = (0, package_1.getAddBuildCommandFn)({
|
|
|
25
25
|
command: 'node build-functions.js',
|
|
26
26
|
});
|
|
27
27
|
const VALID_FUNCTION_TEMPLATES_DIRS = [
|
|
28
|
-
'
|
|
28
|
+
'external-references',
|
|
29
29
|
'appevent-filter',
|
|
30
30
|
'appevent-handler',
|
|
31
31
|
'appevent-transformation',
|
|
32
32
|
];
|
|
33
33
|
function functionTemplateFromName(functionName) {
|
|
34
34
|
let dirName = functionName;
|
|
35
|
-
if (functionName === 'external-references')
|
|
36
|
-
dirName = 'templates'; // backwards compatible for the apps repo examples folder for delivery functions (external-references)
|
|
37
35
|
if (!VALID_FUNCTION_TEMPLATES_DIRS.includes(dirName)) {
|
|
38
36
|
console.error(`Invalid function template: ${functionName}. Must be one of ${VALID_FUNCTION_TEMPLATES_DIRS.join(', ')}.`);
|
|
39
37
|
process.exit(1);
|
|
40
38
|
}
|
|
39
|
+
if (functionName === 'external-references')
|
|
40
|
+
dirName = 'templates'; // backwards compatible for the apps repo examples folder for delivery functions (external-references)
|
|
41
41
|
return dirName;
|
|
42
42
|
}
|
|
43
43
|
function cloneFunction(destination, templateIsJavascript, functionName) {
|
package/lib/index.js
CHANGED
|
@@ -114,6 +114,11 @@ function initProject(appName, options) {
|
|
|
114
114
|
yield (0, includeAppAction_1.cloneAppAction)(fullAppFolder, !!normalizedOptions.javascript);
|
|
115
115
|
}
|
|
116
116
|
if (!isInteractive && (0, utils_1.isContentfulTemplate)(templateSource) && normalizedOptions.function) {
|
|
117
|
+
// If function flag is specified, but no function name is provided, we default to external-references
|
|
118
|
+
// for legacy support.
|
|
119
|
+
if (normalizedOptions.function === true) {
|
|
120
|
+
normalizedOptions.function = 'external-references';
|
|
121
|
+
}
|
|
117
122
|
yield (0, includeFunction_1.cloneFunction)(fullAppFolder, !!normalizedOptions.javascript, normalizedOptions.function);
|
|
118
123
|
}
|
|
119
124
|
updatePackageName(fullAppFolder);
|
|
@@ -160,7 +165,7 @@ function initProject(appName, options) {
|
|
|
160
165
|
`format: URL (HTTPS or SSH) or ${(0, logger_1.code)('vendor:user/repo')} (e.g., ${(0, logger_1.code)('github:user/repo')})`,
|
|
161
166
|
].join('\n'))
|
|
162
167
|
.option('-a, --action', 'include a hosted app action in the ts or js template')
|
|
163
|
-
.option('-f, --function
|
|
168
|
+
.option('-f, --function [function-template-name]', 'include the specified function template')
|
|
164
169
|
.action(initProject);
|
|
165
170
|
yield commander_1.program.parseAsync();
|
|
166
171
|
});
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@contentful/create-contentful-app",
|
|
3
|
-
"version": "1.16.
|
|
3
|
+
"version": "1.16.2",
|
|
4
4
|
"description": "A template for building Contentful Apps",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"contentful",
|
|
@@ -75,11 +75,11 @@
|
|
|
75
75
|
"@types/validate-npm-package-name": "4.0.2",
|
|
76
76
|
"chai": "^4.3.7",
|
|
77
77
|
"chai-as-promised": "^7.1.1",
|
|
78
|
-
"contentful-management": "11.
|
|
78
|
+
"contentful-management": "11.25.0",
|
|
79
79
|
"mocha": "^10.2.0",
|
|
80
80
|
"sinon": "^17.0.0",
|
|
81
81
|
"sinon-chai": "^3.7.0",
|
|
82
82
|
"ts-node": "^10.9.1"
|
|
83
83
|
},
|
|
84
|
-
"gitHead": "
|
|
84
|
+
"gitHead": "3121b601d52eb45be574db0f623830216684dd9c"
|
|
85
85
|
}
|