@magnolia/cli-jumpstart-plugin 1.0.5 → 1.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/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,13 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## 1.1.0 (2025-06-06)
|
|
4
|
+
* Add support for named auth profiles in project templates for reusing credentials across bundles ([MGNLCLI-387](https://magnolia-cms.atlassian.net/browse/MGNLCLI-387))
|
|
5
|
+
* Add support for 6.4 version ([MGNLCLI-389](https://magnolia-cms.atlassian.net/browse/MGNLCLI-389))
|
|
6
|
+
* Use project-templates from gitlab instead of bitbucket ([MGNLCLI-390](https://magnolia-cms.atlassian.net/browse/MGNLCLI-390))
|
|
7
|
+
|
|
8
|
+
## 1.0.6 (2025-05-30)
|
|
9
|
+
* Ignore -overlay webapps from nexus ([MGNLCLI-391](https://magnolia-cms.atlassian.net/browse/MGNLCLI-391))
|
|
10
|
+
|
|
3
11
|
## 1.0.5 (2025-04-30)
|
|
4
12
|
* Set graphql.introspection property to true ([MGNLCLI-371](https://magnolia-cms.atlassian.net/browse/MGNLCLI-371))
|
|
5
13
|
* Inform user about using name and password tokens from nexus ([MGNLCLI-374](https://magnolia-cms.atlassian.net/browse/MGNLCLI-374))
|
|
@@ -13,6 +13,7 @@ export default class JumpstartPlugin extends PluginTemplate {
|
|
|
13
13
|
projectTemplates?: Array<Template>;
|
|
14
14
|
options: Option[];
|
|
15
15
|
credentials?: Credentials;
|
|
16
|
+
authProfiles: any;
|
|
16
17
|
description: string;
|
|
17
18
|
constructor();
|
|
18
19
|
executePostCommands(bundle: Bundle, file: string): Promise<void>;
|
package/dist/jumpstart-plugin.js
CHANGED
|
@@ -41,6 +41,7 @@ export default class JumpstartPlugin extends PluginTemplate {
|
|
|
41
41
|
this.name = 'jumpstart';
|
|
42
42
|
this.version = pkg.version;
|
|
43
43
|
this.usage = '[options]';
|
|
44
|
+
this.authProfiles = {};
|
|
44
45
|
i18nInstance = initI18n(this.name, 'translation', path.join(__dirname, 'lib/locales'));
|
|
45
46
|
this.description = i18nInstance.t('description');
|
|
46
47
|
this.options = [
|
|
@@ -75,19 +76,29 @@ export default class JumpstartPlugin extends PluginTemplate {
|
|
|
75
76
|
}
|
|
76
77
|
handleTemplate(template, options) {
|
|
77
78
|
return __awaiter(this, void 0, void 0, function* () {
|
|
78
|
-
if (template.auth) {
|
|
79
|
-
|
|
79
|
+
if (template.auth !== undefined) {
|
|
80
|
+
if (typeof template.auth === 'boolean') {
|
|
81
|
+
this.credentials = yield askForCredentials(template.name);
|
|
82
|
+
}
|
|
83
|
+
else {
|
|
84
|
+
for (const key of Object.keys(template.auth)) {
|
|
85
|
+
const desc = template.auth[key].description;
|
|
86
|
+
if (desc !== undefined) {
|
|
87
|
+
logger.info(desc);
|
|
88
|
+
}
|
|
89
|
+
this.authProfiles[key] = yield askForCredentials(key);
|
|
90
|
+
}
|
|
91
|
+
}
|
|
80
92
|
}
|
|
81
93
|
for (const bundle of template.bundles || []) {
|
|
82
|
-
let file;
|
|
83
94
|
try {
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
95
|
+
const credentials = bundle.auth === true
|
|
96
|
+
? yield askForCredentials(bundle.name || bundle.url)
|
|
97
|
+
: typeof bundle.auth === 'string'
|
|
98
|
+
? this.authProfiles[bundle.auth] ||
|
|
99
|
+
(yield askForCredentials(bundle.auth))
|
|
100
|
+
: this.credentials;
|
|
101
|
+
const file = yield downloadBundle(bundle, credentials, undefined, options);
|
|
91
102
|
if (file) {
|
|
92
103
|
yield this.executePostCommands(bundle, file);
|
|
93
104
|
}
|
|
@@ -130,7 +141,7 @@ export default class JumpstartPlugin extends PluginTemplate {
|
|
|
130
141
|
}
|
|
131
142
|
else {
|
|
132
143
|
errorMsg = i18nInstance.t('error-no-projectTemplates-from-default');
|
|
133
|
-
const res = yield axios.get('https://
|
|
144
|
+
const res = yield axios.get('https://gitlab.magnolia-platform.com/magnolia-cli/plugins/cli-project-templates/-/raw/main/projectTemplates.json');
|
|
134
145
|
this.projectTemplates = res.data.projectTemplates;
|
|
135
146
|
}
|
|
136
147
|
}
|
package/dist/lib/download.js
CHANGED
|
@@ -102,6 +102,7 @@ export const getDownloadUrl = (bundle, credentials, options) => __awaiter(void 0
|
|
|
102
102
|
try {
|
|
103
103
|
const url = new URL(bundle.url);
|
|
104
104
|
url.searchParams.set('prerelease', 'false');
|
|
105
|
+
url.searchParams.set('maven.classifier', '');
|
|
105
106
|
if (bundle.version) {
|
|
106
107
|
if (options.snapshot ||
|
|
107
108
|
bundle.version.toLowerCase().includes('snapshot')) {
|
|
@@ -116,6 +117,7 @@ export const getDownloadUrl = (bundle, credentials, options) => __awaiter(void 0
|
|
|
116
117
|
}
|
|
117
118
|
if ((bundle.version.startsWith('latest') ||
|
|
118
119
|
bundle.version.startsWith('6.3') ||
|
|
120
|
+
bundle.version.startsWith('6.4') ||
|
|
119
121
|
bundle.version.includes('alpha') ||
|
|
120
122
|
bundle.version.includes('beta') ||
|
|
121
123
|
bundle.version.includes('rc')) &&
|
|
@@ -12,8 +12,9 @@ import path from 'path';
|
|
|
12
12
|
import { getMicroprofileConfigLocation } from './helper.js';
|
|
13
13
|
import { i18nInstance, logger } from '../jumpstart-plugin.js';
|
|
14
14
|
export const handleMicroprofileConfig = (bundle, dest) => __awaiter(void 0, void 0, void 0, function* () {
|
|
15
|
-
var _a;
|
|
16
|
-
if (!((_a = bundle.version) === null || _a === void 0 ? void 0 : _a.startsWith('6.3'))
|
|
15
|
+
var _a, _b;
|
|
16
|
+
if (!((_a = bundle.version) === null || _a === void 0 ? void 0 : _a.startsWith('6.3')) &&
|
|
17
|
+
!((_b = bundle.version) === null || _b === void 0 ? void 0 : _b.startsWith('6.4')))
|
|
17
18
|
return;
|
|
18
19
|
const tomcatPath = path.join(path.resolve(dest), '../../');
|
|
19
20
|
const webappName = path.basename(dest);
|
package/dist/package.json
CHANGED
package/dist/types/types.d.ts
CHANGED
|
@@ -21,7 +21,9 @@ export interface Bundle {
|
|
|
21
21
|
export interface TemplateBase {
|
|
22
22
|
name: string;
|
|
23
23
|
description?: string;
|
|
24
|
-
auth?: boolean
|
|
24
|
+
auth?: boolean | Record<string, {
|
|
25
|
+
description?: string;
|
|
26
|
+
}>;
|
|
25
27
|
}
|
|
26
28
|
export interface TemplateWithChildren extends TemplateBase {
|
|
27
29
|
children: Array<Template>;
|
package/package.json
CHANGED