create-awesome-node-app 0.3.2 → 0.3.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/dist/index.cjs CHANGED
@@ -3458,10 +3458,14 @@ var getTemplatesForCategory = async (category) => {
3458
3458
  return templates;
3459
3459
  };
3460
3460
  var getExtensionsGroupedByCategory = async (type) => {
3461
+ const safeType = Array.isArray(type) ? type : [type];
3461
3462
  const templateData = await getTemplateData();
3462
- const extensions = templateData.extensions.filter(
3463
- (extension) => extension.type === type
3464
- );
3463
+ const extensions = templateData.extensions.filter((extension) => {
3464
+ const safeExtensionType = Array.isArray(extension.type) ? extension.type : [extension.type];
3465
+ return safeExtensionType.some(
3466
+ (extensionType) => safeType.includes(extensionType)
3467
+ );
3468
+ });
3465
3469
  const extensionsGroupedByCategory = extensions.reduce((acc, extension) => {
3466
3470
  const category = extension.category;
3467
3471
  if (!acc[category]) {
@@ -3496,6 +3500,21 @@ var getCnaOptions = async (options) => {
3496
3500
  message: `What's your project name?`,
3497
3501
  initial: options.projectName
3498
3502
  },
3503
+ {
3504
+ type: "select",
3505
+ name: "language",
3506
+ message: "What language do you want to use?",
3507
+ choices: [
3508
+ {
3509
+ title: "JavaScript",
3510
+ value: "js",
3511
+ disabled: true,
3512
+ description: "Wrong answer! Use TypeScript instead..."
3513
+ },
3514
+ { title: "TypeScript", value: "ts", description: "Correct answer! :D" }
3515
+ ],
3516
+ initial: 1
3517
+ },
3499
3518
  {
3500
3519
  type: "toggle",
3501
3520
  name: "useNpm",
@@ -3575,9 +3594,10 @@ var getCnaOptions = async (options) => {
3575
3594
  ]);
3576
3595
  appConfig.templatesOrExtensions = [];
3577
3596
  appConfig.extend = [];
3578
- const extensionsGroupedByCategory = await getExtensionsGroupedByCategory(
3579
- templateInput.template
3580
- );
3597
+ const extensionsGroupedByCategory = await getExtensionsGroupedByCategory([
3598
+ templateInput.template,
3599
+ "all"
3600
+ ]);
3581
3601
  for (const [category, extensions] of Object.entries(
3582
3602
  extensionsGroupedByCategory
3583
3603
  )) {
@@ -3639,7 +3659,7 @@ var getCnaOptions = async (options) => {
3639
3659
  // package.json
3640
3660
  var package_default = {
3641
3661
  name: "create-awesome-node-app",
3642
- version: "0.3.2",
3662
+ version: "0.3.4",
3643
3663
  type: "module",
3644
3664
  description: "Command line tool to create Node apps with a lot of different templates and extensions.",
3645
3665
  license: "MIT",
package/dist/index.js CHANGED
@@ -3464,10 +3464,14 @@ var getTemplatesForCategory = async (category) => {
3464
3464
  return templates;
3465
3465
  };
3466
3466
  var getExtensionsGroupedByCategory = async (type) => {
3467
+ const safeType = Array.isArray(type) ? type : [type];
3467
3468
  const templateData = await getTemplateData();
3468
- const extensions = templateData.extensions.filter(
3469
- (extension) => extension.type === type
3470
- );
3469
+ const extensions = templateData.extensions.filter((extension) => {
3470
+ const safeExtensionType = Array.isArray(extension.type) ? extension.type : [extension.type];
3471
+ return safeExtensionType.some(
3472
+ (extensionType) => safeType.includes(extensionType)
3473
+ );
3474
+ });
3471
3475
  const extensionsGroupedByCategory = extensions.reduce((acc, extension) => {
3472
3476
  const category = extension.category;
3473
3477
  if (!acc[category]) {
@@ -3502,6 +3506,21 @@ var getCnaOptions = async (options) => {
3502
3506
  message: `What's your project name?`,
3503
3507
  initial: options.projectName
3504
3508
  },
3509
+ {
3510
+ type: "select",
3511
+ name: "language",
3512
+ message: "What language do you want to use?",
3513
+ choices: [
3514
+ {
3515
+ title: "JavaScript",
3516
+ value: "js",
3517
+ disabled: true,
3518
+ description: "Wrong answer! Use TypeScript instead..."
3519
+ },
3520
+ { title: "TypeScript", value: "ts", description: "Correct answer! :D" }
3521
+ ],
3522
+ initial: 1
3523
+ },
3505
3524
  {
3506
3525
  type: "toggle",
3507
3526
  name: "useNpm",
@@ -3581,9 +3600,10 @@ var getCnaOptions = async (options) => {
3581
3600
  ]);
3582
3601
  appConfig.templatesOrExtensions = [];
3583
3602
  appConfig.extend = [];
3584
- const extensionsGroupedByCategory = await getExtensionsGroupedByCategory(
3585
- templateInput.template
3586
- );
3603
+ const extensionsGroupedByCategory = await getExtensionsGroupedByCategory([
3604
+ templateInput.template,
3605
+ "all"
3606
+ ]);
3587
3607
  for (const [category, extensions] of Object.entries(
3588
3608
  extensionsGroupedByCategory
3589
3609
  )) {
@@ -3645,7 +3665,7 @@ var getCnaOptions = async (options) => {
3645
3665
  // package.json
3646
3666
  var package_default = {
3647
3667
  name: "create-awesome-node-app",
3648
- version: "0.3.2",
3668
+ version: "0.3.4",
3649
3669
  type: "module",
3650
3670
  description: "Command line tool to create Node apps with a lot of different templates and extensions.",
3651
3671
  license: "MIT",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "create-awesome-node-app",
3
- "version": "0.3.2",
3
+ "version": "0.3.4",
4
4
  "type": "module",
5
5
  "description": "Command line tool to create Node apps with a lot of different templates and extensions.",
6
6
  "license": "MIT",