cistack 3.0.1 → 3.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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "cistack",
3
- "version": "3.0.1",
3
+ "version": "3.1.0",
4
4
  "description": "Automatically generate GitHub Actions CI/CD pipelines by analysing your codebase",
5
5
  "main": "src/index.js",
6
6
  "bin": {
@@ -742,8 +742,8 @@ class WorkflowGenerator {
742
742
  steps.push(
743
743
  { name: 'Install Vercel CLI', run: 'npm install -g vercel' },
744
744
  { name: 'Pull Vercel environment', run: `vercel pull --yes --environment=${isPreview ? 'preview' : 'production'} --token=\${{ secrets.VERCEL_TOKEN }}` },
745
- { name: 'Build project', run: `vercel build ${prodFlag} --token=\${{ secrets.VERCEL_TOKEN }}` },
746
- { name: 'Deploy to Vercel', run: `vercel deploy --prebuilt ${prodFlag} --token=\${{ secrets.VERCEL_TOKEN }}` },
745
+ { name: 'Build project', run: `vercel build${prodFlag ? ' ' + prodFlag : ''} --token=\${{ secrets.VERCEL_TOKEN }}` },
746
+ { name: 'Deploy to Vercel', run: `vercel deploy --prebuilt${prodFlag ? ' ' + prodFlag : ''} --token=\${{ secrets.VERCEL_TOKEN }}` },
747
747
  );
748
748
  break;
749
749
  }
package/src/index.js CHANGED
@@ -257,20 +257,60 @@ class CIFlow {
257
257
  if (!confirmed) {
258
258
  console.log(chalk.yellow('\nCustomisation mode – answer the prompts below:\n'));
259
259
 
260
- const hostingChoices = ['firebase', 'vercel', 'netlify', 'aws', 'gcp', 'azure', 'heroku', 'render', 'railway', 'none'];
260
+ // Map lowercase choice values exact names used in _hostingDeploySteps() switch cases
261
+ const HOSTING_NAME_MAP = {
262
+ firebase: 'Firebase',
263
+ vercel: 'Vercel',
264
+ netlify: 'Netlify',
265
+ aws: 'AWS',
266
+ gcp: 'GCP App Engine',
267
+ azure: 'Azure',
268
+ heroku: 'Heroku',
269
+ render: 'Render',
270
+ railway: 'Railway',
271
+ 'github-pages':'GitHub Pages',
272
+ };
273
+
274
+ const hostingChoices = [
275
+ { name: 'Firebase', value: 'firebase' },
276
+ { name: 'Vercel', value: 'vercel' },
277
+ { name: 'Netlify', value: 'netlify' },
278
+ { name: 'AWS (S3 + CloudFront)', value: 'aws' },
279
+ { name: 'GCP App Engine',value: 'gcp' },
280
+ { name: 'Azure Web App', value: 'azure' },
281
+ { name: 'Heroku', value: 'heroku' },
282
+ { name: 'Render', value: 'render' },
283
+ { name: 'Railway', value: 'railway' },
284
+ { name: 'GitHub Pages', value: 'github-pages' },
285
+ { name: 'None', value: 'none' },
286
+ ];
287
+
288
+ // Pre-select whatever was already detected (match by canonical name)
289
+ const reverseMap = Object.fromEntries(
290
+ Object.entries(HOSTING_NAME_MAP).map(([k, v]) => [v.toLowerCase(), k])
291
+ );
292
+ const currentDefaults = config.hosting
293
+ .map((h) => reverseMap[h.name.toLowerCase()])
294
+ .filter(Boolean);
295
+
261
296
  const { customHosting } = await inquirer.prompt([
262
297
  {
263
298
  type: 'checkbox',
264
299
  name: 'customHosting',
265
300
  message: 'Select hosting platform(s):',
266
301
  choices: hostingChoices,
267
- default: config.hosting.map((h) => h.name.toLowerCase()),
302
+ default: currentDefaults,
268
303
  },
269
304
  ]);
270
305
 
271
306
  config.hosting = customHosting
272
307
  .filter((h) => h !== 'none')
273
- .map((h) => ({ name: h, confidence: 1.0, manual: true, secrets: [] }));
308
+ .map((h) => ({
309
+ name: HOSTING_NAME_MAP[h] || h, // always the correct PascalCase name
310
+ confidence: 1.0,
311
+ manual: true,
312
+ secrets: [],
313
+ }));
274
314
  }
275
315
 
276
316
  return config;