@contentful/app-scripts 2.5.2 → 2.5.6
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.
|
@@ -54,6 +54,32 @@ async function activateBundle({ accessToken, organization, definition, bundleId,
|
|
|
54
54
|
}, currentDefinition);
|
|
55
55
|
}
|
|
56
56
|
catch (err) {
|
|
57
|
+
let errorData;
|
|
58
|
+
try {
|
|
59
|
+
errorData = JSON.parse(err.message);
|
|
60
|
+
}
|
|
61
|
+
catch {
|
|
62
|
+
errorData = null;
|
|
63
|
+
}
|
|
64
|
+
if (errorData?.status === 400 && errorData?.message?.includes('Function upload failed')) {
|
|
65
|
+
// Extract first line of error message (the actual error type)
|
|
66
|
+
const firstLine = errorData.message.split('\n')[0];
|
|
67
|
+
const errorType = firstLine.replace('Function upload failed: ', '');
|
|
68
|
+
// Clean display
|
|
69
|
+
console.error(`\n${(0, chalk_1.bold)((0, chalk_1.yellow)('❌ Function Upload Failed'))}\n`);
|
|
70
|
+
console.error(`${(0, chalk_1.bold)('Error:')} ${errorType}\n`);
|
|
71
|
+
if (errorData.details?.errors?.[0]) {
|
|
72
|
+
// Show just the first few lines of stack trace
|
|
73
|
+
const firstError = errorData.details.errors[0];
|
|
74
|
+
const lines = firstError.split('\n').slice(0, 3);
|
|
75
|
+
console.error(lines.join('\n'));
|
|
76
|
+
}
|
|
77
|
+
console.error(`\n${(0, chalk_1.cyan)('💡 Tip:')} Line numbers may reference minified code, rebuild with ${(0, chalk_1.bold)('--no-minify')} to debug your source code:`);
|
|
78
|
+
console.error(` ${(0, chalk_1.bold)('npm run build:functions -- --no-minify && npm run upload')}\n`);
|
|
79
|
+
// Don't re-throw (prevents Commander duplicate display)
|
|
80
|
+
process.exit(1);
|
|
81
|
+
}
|
|
82
|
+
// Default error handling for other errors
|
|
57
83
|
(0, utils_1.throwError)(err, 'Something went wrong activating your bundle. Make sure you used the correct definition-id.');
|
|
58
84
|
}
|
|
59
85
|
finally {
|
package/lib/bin.js
CHANGED
|
@@ -80,6 +80,7 @@ async function runCommand(command, options) {
|
|
|
80
80
|
.option('-e, --esbuild-config <path>', 'custom esbuild config file path')
|
|
81
81
|
.option('-m, --manifest-file <path>', 'Contentful app manifest file path')
|
|
82
82
|
.option('-w, --watch', 'watch for changes')
|
|
83
|
+
.option('--no-minify', 'disable minification for debugging (not recommended for production)')
|
|
83
84
|
.action(async (options) => {
|
|
84
85
|
await runCommand(index_1.buildFunctions, options);
|
|
85
86
|
});
|
|
@@ -133,7 +133,7 @@ async function mergeAppManifest(localPath, localTmpPath) {
|
|
|
133
133
|
});
|
|
134
134
|
}
|
|
135
135
|
else {
|
|
136
|
-
// add the function to the json's "functions" array
|
|
136
|
+
// add the function to the json's "functions" array
|
|
137
137
|
await (0, file_1.mergeJsonIntoFile)({
|
|
138
138
|
source: (0, node_path_1.resolve)(localTmpPath, tmpAppManifestType),
|
|
139
139
|
destination: (0, node_path_1.resolve)(localPath, constants_1.CONTENTFUL_APP_MANIFEST),
|
package/lib/types.d.ts
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@contentful/app-scripts",
|
|
3
|
-
"version": "2.5.
|
|
3
|
+
"version": "2.5.6",
|
|
4
4
|
"description": "A collection of scripts for building Contentful Apps",
|
|
5
5
|
"author": "Contentful GmbH",
|
|
6
6
|
"license": "MIT",
|
|
@@ -56,10 +56,10 @@
|
|
|
56
56
|
"chalk": "4.1.2",
|
|
57
57
|
"commander": "12.1.0",
|
|
58
58
|
"contentful-management": "^11.48.1",
|
|
59
|
-
"dotenv": "
|
|
59
|
+
"dotenv": "17.2.2",
|
|
60
60
|
"esbuild": "^0.25.1",
|
|
61
61
|
"ignore": "7.0.5",
|
|
62
|
-
"inquirer": "8.2.
|
|
62
|
+
"inquirer": "8.2.7",
|
|
63
63
|
"lodash": "4.17.21",
|
|
64
64
|
"merge-options": "^3.0.4",
|
|
65
65
|
"open": "8.4.2",
|
|
@@ -67,26 +67,21 @@
|
|
|
67
67
|
"tiged": "^2.12.7",
|
|
68
68
|
"zod": "^3.24.1"
|
|
69
69
|
},
|
|
70
|
-
"
|
|
71
|
-
"tiged": {
|
|
72
|
-
"rimraf": "^5.0.0"
|
|
73
|
-
}
|
|
74
|
-
},
|
|
75
|
-
"gitHead": "ec4f9a14fbd808d85a73b2c4f8fc96ac5f1f2b47",
|
|
70
|
+
"gitHead": "b44c54a3301e10a7d6b8e4b0e745f697f7be4681",
|
|
76
71
|
"devDependencies": {
|
|
77
72
|
"@types/adm-zip": "0.5.7",
|
|
78
73
|
"@types/analytics-node": "3.1.14",
|
|
79
74
|
"@types/chai": "4.3.16",
|
|
80
75
|
"@types/inquirer": "8.2.1",
|
|
81
|
-
"@types/lodash": "4.17.
|
|
76
|
+
"@types/lodash": "4.17.20",
|
|
82
77
|
"@types/mocha": "10.0.10",
|
|
83
78
|
"@types/node": "^22.13.10",
|
|
84
79
|
"@types/proxyquire": "1.3.31",
|
|
85
80
|
"@types/sinon": "17.0.4",
|
|
86
81
|
"chai": "4.5.0",
|
|
87
|
-
"mocha": "11.
|
|
82
|
+
"mocha": "11.7.4",
|
|
88
83
|
"proxyquire": "2.1.3",
|
|
89
|
-
"sinon": "
|
|
84
|
+
"sinon": "21.0.0",
|
|
90
85
|
"ts-mocha": "11.1.0",
|
|
91
86
|
"ts-node": "10.9.2"
|
|
92
87
|
}
|