@magnolia/cli-jumpstart-plugin 1.0.3 → 1.0.5

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,12 @@
1
1
  # Changelog
2
2
 
3
+ ## 1.0.5 (2025-04-30)
4
+ * Set graphql.introspection property to true ([MGNLCLI-371](https://magnolia-cms.atlassian.net/browse/MGNLCLI-371))
5
+ * Inform user about using name and password tokens from nexus ([MGNLCLI-374](https://magnolia-cms.atlassian.net/browse/MGNLCLI-374))
6
+
7
+ ## 1.0.4 (2025-03-17)
8
+ * Fix template download ([MGNLCLI-366](https://magnolia-cms.atlassian.net/browse/MGNLCLI-366))
9
+
3
10
  ## 1.0.3 (2025-03-17)
4
11
  * Add lightModulesPath to mgnl.config.js ([MGNLCLI-255](https://magnolia-cms.atlassian.net/browse/MGNLCLI-255))
5
12
  * Place bundle to correct place when no postCommand is defined ([MGNLCLI-276](https://magnolia-cms.atlassian.net/browse/MGNLCLI-276))
@@ -157,7 +157,7 @@ export default class JumpstartPlugin extends PluginTemplate {
157
157
  value: template,
158
158
  };
159
159
  });
160
- const { template } = yield inquirer.prompt([
160
+ let { template } = yield inquirer.prompt([
161
161
  {
162
162
  type: 'list',
163
163
  name: 'template',
@@ -165,6 +165,7 @@ export default class JumpstartPlugin extends PluginTemplate {
165
165
  choices: prependNumbersToChoices(choices),
166
166
  },
167
167
  ]);
168
+ template = Object.assign({ name: template.name }, template.value);
168
169
  if (template.name) {
169
170
  names.push(template.name);
170
171
  }
@@ -65,6 +65,7 @@ export const handleLightModulesFolder = () => __awaiter(void 0, void 0, void 0,
65
65
  };
66
66
  if (webApp.endsWith('magnoliaAuthor')) {
67
67
  props['magnolia.develop'] = 'true';
68
+ props['magnolia.graphql.introspection.enabled'] = 'true';
68
69
  }
69
70
  const webAppPropertiesFilePath = path.join(webApp, 'WEB-INF', 'config', 'default', 'magnolia.properties');
70
71
  editProperties(webAppPropertiesFilePath, props);
@@ -100,9 +101,15 @@ const editProperties = (filePath, props) => {
100
101
  };
101
102
  const replaceInConfig = (config, props) => {
102
103
  Object.keys(props).forEach((key) => {
103
- const regex = '(' + key.replace(/\./g, '\\.') + ')(\s*=\s*)(.+)'; // eslint-disable-line no-useless-escape
104
+ const regexPattern = '(' + key.replace(/\./g, '\\.') + ')(\s*=\s*)(.+)'; // eslint-disable-line no-useless-escape
105
+ const regex = new RegExp(regexPattern);
104
106
  const replacement = '$1$2' + props[key];
105
- config = config.replace(new RegExp(regex), replacement);
107
+ if (regex.test(config)) {
108
+ config = config.replace(regex, replacement);
109
+ }
110
+ else {
111
+ config += `\n${key}=${props[key]}`;
112
+ }
106
113
  });
107
114
  return config;
108
115
  };
@@ -189,6 +196,10 @@ export const askForCredentials = (bundle) => __awaiter(void 0, void 0, void 0, f
189
196
  logger === null || logger === void 0 ? void 0 : logger.info(i18nInstance.t('info-enter-credentials', {
190
197
  bundle: bundle,
191
198
  }));
199
+ if (bundle.startsWith('https://nexus.magnolia-cms.com') ||
200
+ bundle.startsWith('https://nexus.magnolia-cms.cn')) {
201
+ logger === null || logger === void 0 ? void 0 : logger.warn(i18nInstance.t('info-use-nexus-token'));
202
+ }
192
203
  return inquirer.prompt([
193
204
  {
194
205
  type: 'input',
@@ -6,6 +6,10 @@
6
6
  "option-snapshot-description": "download the latest snapshot version of the specified or latest stable webapp",
7
7
 
8
8
  "info-enter-credentials": "Enter the credentials for \"{{bundle}}\"",
9
+ "info-use-nexus-token": [
10
+ "To download from Nexus, please use your \"user token name code\" as the username and your \"user token pass code\" as the password, instead of your SSO login credentials",
11
+ "For more details, visit: https://docs.magnolia-cms.com/magnolia-cli/getting-started/jumpstarting/#_nexus_token_credentials"
12
+ ],
9
13
  "info-template-not-found": "Template \"{{template}}\" not found",
10
14
  "info-download-preparing": "Retrieving download URL from: {{url}}",
11
15
  "info-download-starting": "Starting download from: {{downloadUrl}}",
package/dist/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@magnolia/cli-jumpstart-plugin",
3
- "version": "1.0.3",
3
+ "version": "1.0.5",
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": {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@magnolia/cli-jumpstart-plugin",
3
- "version": "1.0.3",
3
+ "version": "1.0.5",
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": {