@magnolia/cli-jumpstart-plugin 1.1.2 → 1.1.4
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/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,11 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## 1.1.4 (2025-09-19)
|
|
4
|
+
* Hotfix: Remove part causing 404 when downloading from nexus
|
|
5
|
+
|
|
6
|
+
## 1.1.3 (2025-09-16)
|
|
7
|
+
* Jumpstart should resolve template path before switching CWD ([MGNLCLI-421](https://magnolia-cms.atlassian.net/browse/MGNLCLI-421))
|
|
8
|
+
|
|
3
9
|
## 1.1.2 (2025-08-08)
|
|
4
10
|
* Ask for credentials before checking for tomcat ([MGNLCLI-417](https://magnolia-cms.atlassian.net/browse/MGNLCLI-417))
|
|
5
11
|
|
|
@@ -18,7 +18,7 @@ export default class JumpstartPlugin extends PluginTemplate {
|
|
|
18
18
|
constructor();
|
|
19
19
|
executePostCommands(bundle: Bundle, file: string): Promise<void>;
|
|
20
20
|
handleTemplate(template: TemplateWithoutChildren, options: PluginOptions): Promise<void>;
|
|
21
|
-
setProjectTemplates(options: PluginOptions): Promise<void>;
|
|
21
|
+
setProjectTemplates(options: PluginOptions, originalCwd: string): Promise<void>;
|
|
22
22
|
promptTemplateSelection(templates: Array<Template>, names?: string[]): Promise<TemplateWithoutChildren | undefined>;
|
|
23
23
|
findTemplateByIdentifier(identifier: string): TemplateWithoutChildren | undefined;
|
|
24
24
|
chooseTemplate(options: PluginOptions): Promise<void>;
|
package/dist/jumpstart-plugin.js
CHANGED
|
@@ -143,7 +143,7 @@ export default class JumpstartPlugin extends PluginTemplate {
|
|
|
143
143
|
}
|
|
144
144
|
});
|
|
145
145
|
}
|
|
146
|
-
setProjectTemplates(options) {
|
|
146
|
+
setProjectTemplates(options, originalCwd) {
|
|
147
147
|
return __awaiter(this, void 0, void 0, function* () {
|
|
148
148
|
var _a;
|
|
149
149
|
let errorMsg;
|
|
@@ -154,8 +154,13 @@ export default class JumpstartPlugin extends PluginTemplate {
|
|
|
154
154
|
this.projectTemplates = res.data.projectTemplates;
|
|
155
155
|
}
|
|
156
156
|
else if (options.projectTemplates) {
|
|
157
|
-
|
|
158
|
-
|
|
157
|
+
const projectTemplatesPath = path.resolve(originalCwd, options.projectTemplates);
|
|
158
|
+
if (!fs.existsSync(projectTemplatesPath)) {
|
|
159
|
+
throw new CreateError(i18nInstance.t('error-projectTemplates-file-not-found', { path: projectTemplatesPath }));
|
|
160
|
+
}
|
|
161
|
+
errorMsg = i18nInstance.t('error-no-projectTemplates-from-path', { path: projectTemplatesPath });
|
|
162
|
+
this.projectTemplates =
|
|
163
|
+
requireFn(projectTemplatesPath).projectTemplates;
|
|
159
164
|
}
|
|
160
165
|
else {
|
|
161
166
|
errorMsg = i18nInstance.t('error-no-projectTemplates-from-default');
|
|
@@ -164,7 +169,10 @@ export default class JumpstartPlugin extends PluginTemplate {
|
|
|
164
169
|
}
|
|
165
170
|
}
|
|
166
171
|
catch (e) {
|
|
167
|
-
if (
|
|
172
|
+
if (e instanceof CreateError) {
|
|
173
|
+
throw e;
|
|
174
|
+
}
|
|
175
|
+
else if (errorMsg) {
|
|
168
176
|
throw new CreateError(errorMsg + `\n${e.message}`);
|
|
169
177
|
}
|
|
170
178
|
else {
|
|
@@ -347,7 +355,7 @@ export default class JumpstartPlugin extends PluginTemplate {
|
|
|
347
355
|
process.chdir(targetDir);
|
|
348
356
|
}
|
|
349
357
|
try {
|
|
350
|
-
yield this.setProjectTemplates(options);
|
|
358
|
+
yield this.setProjectTemplates(options, originalCwd);
|
|
351
359
|
yield this.chooseTemplate(options);
|
|
352
360
|
logger === null || logger === void 0 ? void 0 : logger.info(i18nInstance.t('info-project-downloaded'));
|
|
353
361
|
logger === null || logger === void 0 ? void 0 : logger.info(i18nInstance.t('info-registered-commands'));
|
package/dist/lib/download.js
CHANGED
|
@@ -267,7 +267,6 @@ export const getDownloadUrl = (bundle, credentials, options, authProfiles) => __
|
|
|
267
267
|
var _a, _b, _c;
|
|
268
268
|
try {
|
|
269
269
|
const { item, modifiedBundle } = yield fetchMavenArtifact(bundle, options, credentials, true, authProfiles);
|
|
270
|
-
const params = new URLSearchParams(bundle.url.split('?')[1]);
|
|
271
270
|
bundle.version = modifiedBundle.version;
|
|
272
271
|
if (!item) {
|
|
273
272
|
throw new Error(i18nInstance.t('error-no-artifact-available', {
|
|
@@ -278,12 +277,7 @@ export const getDownloadUrl = (bundle, credentials, options, authProfiles) => __
|
|
|
278
277
|
if (isMagnoliaBundle(bundle) && ((_c = item === null || item === void 0 ? void 0 : item.maven2) === null || _c === void 0 ? void 0 : _c.version)) {
|
|
279
278
|
discoveredMagnoliaVersion = item.maven2.version;
|
|
280
279
|
}
|
|
281
|
-
|
|
282
|
-
downloadUrl = downloadUrl === null || downloadUrl === void 0 ? void 0 : downloadUrl.split('/magnolia.');
|
|
283
|
-
downloadUrl =
|
|
284
|
-
downloadUrl &&
|
|
285
|
-
`${downloadUrl[0]}/${params.get('repository')}${item.path}`;
|
|
286
|
-
return downloadUrl;
|
|
280
|
+
return item.downloadUrl;
|
|
287
281
|
}
|
|
288
282
|
catch (error) {
|
|
289
283
|
if (error.code === 'UNABLE_TO_GET_ISSUER_CERT_LOCALLY') {
|
|
@@ -53,6 +53,7 @@
|
|
|
53
53
|
"error-while-getting-projectTemplates": "An error occurred while getting \"projectTemplates\":",
|
|
54
54
|
"error-no-projectTemplates-from-url": "Cannot fetch remote projectTemplates file located at: \"{{url}}\"; are you connected to the internet? does it point to a JSON file?",
|
|
55
55
|
"error-no-projectTemplates-from-path": "Cannot read projectTemplates from a local file located at: \"{{path}}\"; is it a JSON file?",
|
|
56
|
+
"error-projectTemplates-file-not-found": "ProjectTemplates file not found at: \"{{path}}\"; please check the file path and ensure the file exists",
|
|
56
57
|
"error-no-projectTemplates-from-default": "Cannot fetch default projectTemplates; are you connected to the internet?",
|
|
57
58
|
"error-extensions-calling-fn-retry": "Error calling function: \"{{name}}\"; {{retry}}/{{maxRetry}}; waiting {{delay}}ms before retry",
|
|
58
59
|
"error-extensions-fn-not-found": "\"{{function}}\" function not found",
|
package/dist/package.json
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@magnolia/cli-jumpstart-plugin",
|
|
3
|
-
"version": "1.1.
|
|
3
|
+
"version": "1.1.4",
|
|
4
4
|
"description": "A plugin for Magnolia CLI to download and set up a new headless or freemarker-based project with Magnolia webapp",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"scripts": {
|
|
7
7
|
"prepare": "husky || true",
|
|
8
|
-
"test": "npm run build && node --experimental-vm-modules node_modules/jest/bin/jest.js",
|
|
9
|
-
"build": "
|
|
8
|
+
"test": "npm run lint && npm run build && node --experimental-vm-modules node_modules/jest/bin/jest.js",
|
|
9
|
+
"build": "tsc && cpy package.json dist && cpy lib/locales dist",
|
|
10
10
|
"depcheck": "depcheck",
|
|
11
11
|
"lint": "eslint .",
|
|
12
12
|
"lint:fix": "npm run lint -- --fix",
|
|
@@ -25,6 +25,7 @@
|
|
|
25
25
|
"devDependencies": {
|
|
26
26
|
"@jest/globals": "^29.7.0",
|
|
27
27
|
"@types/decompress": "^4.2.7",
|
|
28
|
+
"@types/filenamify": "^2.0.1",
|
|
28
29
|
"@types/fs-extra": "^11.0.4",
|
|
29
30
|
"@types/inquirer": "^9.0.7",
|
|
30
31
|
"@types/js-beautify": "^1.14.3",
|
package/package.json
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@magnolia/cli-jumpstart-plugin",
|
|
3
|
-
"version": "1.1.
|
|
3
|
+
"version": "1.1.4",
|
|
4
4
|
"description": "A plugin for Magnolia CLI to download and set up a new headless or freemarker-based project with Magnolia webapp",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"scripts": {
|
|
7
7
|
"prepare": "husky || true",
|
|
8
|
-
"test": "npm run build && node --experimental-vm-modules node_modules/jest/bin/jest.js",
|
|
9
|
-
"build": "
|
|
8
|
+
"test": "npm run lint && npm run build && node --experimental-vm-modules node_modules/jest/bin/jest.js",
|
|
9
|
+
"build": "tsc && cpy package.json dist && cpy lib/locales dist",
|
|
10
10
|
"depcheck": "depcheck",
|
|
11
11
|
"lint": "eslint .",
|
|
12
12
|
"lint:fix": "npm run lint -- --fix",
|
|
@@ -25,6 +25,7 @@
|
|
|
25
25
|
"devDependencies": {
|
|
26
26
|
"@jest/globals": "^29.7.0",
|
|
27
27
|
"@types/decompress": "^4.2.7",
|
|
28
|
+
"@types/filenamify": "^2.0.1",
|
|
28
29
|
"@types/fs-extra": "^11.0.4",
|
|
29
30
|
"@types/inquirer": "^9.0.7",
|
|
30
31
|
"@types/js-beautify": "^1.14.3",
|