create-awesome-node-app 0.5.0 → 0.6.2

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
@@ -27,7 +27,7 @@ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__ge
27
27
 
28
28
  // node_modules/color-name/index.js
29
29
  var require_color_name = __commonJS({
30
- "node_modules/color-name/index.js"(exports, module2) {
30
+ "node_modules/color-name/index.js"(exports2, module2) {
31
31
  "use strict";
32
32
  module2.exports = {
33
33
  "aliceblue": [240, 248, 255],
@@ -184,7 +184,8 @@ var require_color_name = __commonJS({
184
184
 
185
185
  // node_modules/color-convert/conversions.js
186
186
  var require_conversions = __commonJS({
187
- "node_modules/color-convert/conversions.js"(exports, module2) {
187
+ "node_modules/color-convert/conversions.js"(exports2, module2) {
188
+ "use strict";
188
189
  var cssKeywords = require_color_name();
189
190
  var reverseKeywords = {};
190
191
  for (const key of Object.keys(cssKeywords)) {
@@ -855,7 +856,8 @@ var require_conversions = __commonJS({
855
856
 
856
857
  // node_modules/color-convert/route.js
857
858
  var require_route = __commonJS({
858
- "node_modules/color-convert/route.js"(exports, module2) {
859
+ "node_modules/color-convert/route.js"(exports2, module2) {
860
+ "use strict";
859
861
  var conversions = require_conversions();
860
862
  function buildGraph() {
861
863
  const graph = {};
@@ -925,7 +927,8 @@ var require_route = __commonJS({
925
927
 
926
928
  // node_modules/color-convert/index.js
927
929
  var require_color_convert = __commonJS({
928
- "node_modules/color-convert/index.js"(exports, module2) {
930
+ "node_modules/color-convert/index.js"(exports2, module2) {
931
+ "use strict";
929
932
  var conversions = require_conversions();
930
933
  var route = require_route();
931
934
  var convert = {};
@@ -986,7 +989,7 @@ var require_color_convert = __commonJS({
986
989
 
987
990
  // node_modules/ansi-styles/index.js
988
991
  var require_ansi_styles = __commonJS({
989
- "node_modules/ansi-styles/index.js"(exports, module2) {
992
+ "node_modules/ansi-styles/index.js"(exports2, module2) {
990
993
  "use strict";
991
994
  var wrapAnsi16 = (fn, offset) => (...args) => {
992
995
  const code = fn(...args);
@@ -1128,7 +1131,7 @@ var require_ansi_styles = __commonJS({
1128
1131
 
1129
1132
  // node_modules/has-flag/index.js
1130
1133
  var require_has_flag = __commonJS({
1131
- "node_modules/has-flag/index.js"(exports, module2) {
1134
+ "node_modules/has-flag/index.js"(exports2, module2) {
1132
1135
  "use strict";
1133
1136
  module2.exports = (flag, argv = process.argv) => {
1134
1137
  const prefix = flag.startsWith("-") ? "" : flag.length === 1 ? "-" : "--";
@@ -1141,7 +1144,7 @@ var require_has_flag = __commonJS({
1141
1144
 
1142
1145
  // node_modules/supports-color/index.js
1143
1146
  var require_supports_color = __commonJS({
1144
- "node_modules/supports-color/index.js"(exports, module2) {
1147
+ "node_modules/supports-color/index.js"(exports2, module2) {
1145
1148
  "use strict";
1146
1149
  var os = require("os");
1147
1150
  var tty = require("tty");
@@ -1243,7 +1246,7 @@ var require_supports_color = __commonJS({
1243
1246
 
1244
1247
  // node_modules/chalk/source/util.js
1245
1248
  var require_util = __commonJS({
1246
- "node_modules/chalk/source/util.js"(exports, module2) {
1249
+ "node_modules/chalk/source/util.js"(exports2, module2) {
1247
1250
  "use strict";
1248
1251
  var stringReplaceAll = (string, substring, replacer) => {
1249
1252
  let index = string.indexOf(substring);
@@ -1282,7 +1285,7 @@ var require_util = __commonJS({
1282
1285
 
1283
1286
  // node_modules/chalk/source/templates.js
1284
1287
  var require_templates = __commonJS({
1285
- "node_modules/chalk/source/templates.js"(exports, module2) {
1288
+ "node_modules/chalk/source/templates.js"(exports2, module2) {
1286
1289
  "use strict";
1287
1290
  var TEMPLATE_REGEX = /(?:\\(u(?:[a-f\d]{4}|\{[a-f\d]{1,6}\})|x[a-f\d]{2}|.))|(?:\{(~)?(\w+(?:\([^)]*\))?(?:\.\w+(?:\([^)]*\))?)*)(?:[ \t]|(?=\r?\n)))|(\})|((?:.|[\r\n\f])+?)/gi;
1288
1291
  var STYLE_REGEX = /(?:^|\.)(\w+)(?:\(([^)]*)\))?/g;
@@ -1396,7 +1399,7 @@ var require_templates = __commonJS({
1396
1399
 
1397
1400
  // node_modules/chalk/source/index.js
1398
1401
  var require_source = __commonJS({
1399
- "node_modules/chalk/source/index.js"(exports, module2) {
1402
+ "node_modules/chalk/source/index.js"(exports2, module2) {
1400
1403
  "use strict";
1401
1404
  var ansiStyles = require_ansi_styles();
1402
1405
  var { stdout: stdoutColor, stderr: stderrColor } = require_supports_color();
@@ -1608,7 +1611,7 @@ var getTemplateData = async () => {
1608
1611
  return templateDataCache.data;
1609
1612
  };
1610
1613
  var getTemplateCategories = async (cliArgs) => {
1611
- if (cliArgs == null ? void 0 : cliArgs.category) {
1614
+ if (cliArgs?.category) {
1612
1615
  return [cliArgs.category];
1613
1616
  }
1614
1617
  const templateData = await getTemplateData();
@@ -1631,7 +1634,7 @@ var getCategoryData = async (categorySlug) => {
1631
1634
  return void 0;
1632
1635
  };
1633
1636
  var getTemplatesForCategory = async (category, cliArgs) => {
1634
- const selectedCategory = (cliArgs == null ? void 0 : cliArgs.category) || category;
1637
+ const selectedCategory = cliArgs?.category || category;
1635
1638
  if (!selectedCategory) {
1636
1639
  throw new Error("Category is required in non-interactive mode.");
1637
1640
  }
@@ -1642,7 +1645,7 @@ var getTemplatesForCategory = async (category, cliArgs) => {
1642
1645
  return templates;
1643
1646
  };
1644
1647
  var getExtensionsGroupedByCategory = async (type, cliArgs) => {
1645
- const selectedType = (cliArgs == null ? void 0 : cliArgs.type) ? cliArgs.type.split(",") : type;
1648
+ const selectedType = cliArgs?.type ? cliArgs.type.split(",") : type;
1646
1649
  const safeType = Array.isArray(selectedType) ? selectedType : [selectedType];
1647
1650
  const templateData = await getTemplateData();
1648
1651
  const extensions = templateData.extensions.filter((extension) => {
@@ -1651,19 +1654,22 @@ var getExtensionsGroupedByCategory = async (type, cliArgs) => {
1651
1654
  (extensionType) => safeType.includes(extensionType)
1652
1655
  );
1653
1656
  });
1654
- const extensionsGroupedByCategory = extensions.reduce((acc, extension) => {
1655
- const category = extension.category;
1656
- if (!acc[category]) {
1657
- acc[category] = [];
1658
- }
1659
- acc[category].push(extension);
1660
- return acc;
1661
- }, {});
1657
+ const extensionsGroupedByCategory = extensions.reduce(
1658
+ (acc, extension) => {
1659
+ const category = extension.category;
1660
+ if (!acc[category]) {
1661
+ acc[category] = [];
1662
+ }
1663
+ acc[category].push(extension);
1664
+ return acc;
1665
+ },
1666
+ {}
1667
+ );
1662
1668
  return extensionsGroupedByCategory;
1663
1669
  };
1664
1670
 
1665
1671
  // src/options.ts
1666
- import_prompts.default.override(import_yargs.default.argv);
1672
+ import_prompts.default.override((0, import_yargs.default)(process.argv.slice(2)).argv);
1667
1673
  var PACKAGE_MANAGERS = ["npm", "yarn", "pnpm"];
1668
1674
  var isValidUrl = (url) => {
1669
1675
  try {
@@ -1703,7 +1709,7 @@ var processNonInteractiveOptions = async (options) => {
1703
1709
  }
1704
1710
  if (options.addons && Array.isArray(options.addons)) {
1705
1711
  const extensionsGroupedByCategory = await getExtensionsGroupedByCategory([
1706
- (matchedTemplate == null ? void 0 : matchedTemplate.type) || "custom",
1712
+ matchedTemplate?.type || "custom",
1707
1713
  "all"
1708
1714
  ]);
1709
1715
  const extensions = options.addons.map((addon) => {
@@ -1728,10 +1734,9 @@ var processNonInteractiveOptions = async (options) => {
1728
1734
  const additionalExtensions = options.extend.filter(Boolean).map((extension) => ({ url: extension }));
1729
1735
  templatesOrExtensions.push(...additionalExtensions);
1730
1736
  }
1731
- if (options.aiTool && !["cursor", "copilot", "none"].includes(options.aiTool)) {
1732
- throw new Error("Invalid --ai-tool option. Use: cursor, copilot, or none");
1737
+ if (Object.prototype.hasOwnProperty.call(options, "aiTool")) {
1738
+ delete options.aiTool;
1733
1739
  }
1734
- options.aiTool = options.aiTool || "none";
1735
1740
  options.templatesOrExtensions = templatesOrExtensions;
1736
1741
  if (options.verbose) {
1737
1742
  console.log(JSON.stringify(options, null, 2));
@@ -1744,8 +1749,8 @@ var processInteractiveOptions = async (options) => {
1744
1749
  const categoryData = await getCategoryData(categorySlug);
1745
1750
  return {
1746
1751
  slug: categorySlug,
1747
- name: (categoryData == null ? void 0 : categoryData.name) || categorySlug,
1748
- description: (categoryData == null ? void 0 : categoryData.description) || ""
1752
+ name: categoryData?.name || categorySlug,
1753
+ description: categoryData?.description || ""
1749
1754
  };
1750
1755
  });
1751
1756
  const categoryDataList = await Promise.all(categoryDataPromises);
@@ -1779,28 +1784,9 @@ var processInteractiveOptions = async (options) => {
1779
1784
  initial: options.packageManager ? PACKAGE_MANAGERS.indexOf(options.packageManager) : 0
1780
1785
  },
1781
1786
  {
1782
- type: "select",
1783
- name: "aiTool",
1784
- message: "Which AI coding tool would you like to configure?",
1785
- choices: [
1786
- {
1787
- title: "Cursor Rules",
1788
- value: "cursor",
1789
- description: "Add .cursorrules configuration for Cursor IDE"
1790
- },
1791
- {
1792
- title: "GitHub Copilot Instructions",
1793
- value: "copilot",
1794
- description: "Add .github/copilot-instructions.md for GitHub Copilot"
1795
- },
1796
- {
1797
- title: "None",
1798
- value: "none",
1799
- description: "Don't add any AI tool configuration"
1800
- }
1801
- ],
1802
- initial: 2
1803
- // Default to "None"
1787
+ type: null,
1788
+ name: "__removed_aiTool",
1789
+ message: "(AI tool selection removed)"
1804
1790
  },
1805
1791
  {
1806
1792
  type: "select",
@@ -1811,14 +1797,11 @@ var processInteractiveOptions = async (options) => {
1811
1797
  }
1812
1798
  ]);
1813
1799
  const templates = await getTemplatesForCategory(baseInput.category);
1814
- const templateOptions = templates.map((template) => {
1815
- var _a;
1816
- return {
1817
- title: template.name,
1818
- value: template.url,
1819
- description: template.description + " Keywords: " + ((_a = template.labels) == null ? void 0 : _a.join(", "))
1820
- };
1821
- });
1800
+ const templateOptions = templates.map((template) => ({
1801
+ title: template.name,
1802
+ value: template.url,
1803
+ description: template.description + " Keywords: " + template.labels?.join(", ")
1804
+ }));
1822
1805
  const templateInput = await (0, import_prompts.default)(
1823
1806
  baseInput.category === "custom" ? [
1824
1807
  {
@@ -1847,7 +1830,7 @@ var processInteractiveOptions = async (options) => {
1847
1830
  (template) => template.url === templateInput.template
1848
1831
  );
1849
1832
  const templateTemplateOrExtension = templateInput.template;
1850
- const customOptions = (existingTemplate == null ? void 0 : existingTemplate.customOptions) || [];
1833
+ const customOptions = existingTemplate?.customOptions || [];
1851
1834
  const appConfig = await (0, import_prompts.default)([
1852
1835
  // The following prompts are placeholders for future inputs
1853
1836
  {
@@ -1868,27 +1851,24 @@ var processInteractiveOptions = async (options) => {
1868
1851
  appConfig.templatesOrExtensions = [];
1869
1852
  appConfig.extend = [];
1870
1853
  const extensionsGroupedByCategory = await getExtensionsGroupedByCategory([
1871
- (existingTemplate == null ? void 0 : existingTemplate.type) || "custom",
1854
+ existingTemplate?.type || "custom",
1872
1855
  "all"
1873
1856
  ]);
1874
1857
  for (const [categorySlug, extensions] of Object.entries(
1875
1858
  extensionsGroupedByCategory
1876
1859
  )) {
1877
1860
  const categoryData = await getCategoryData(categorySlug);
1878
- const categoryName = (categoryData == null ? void 0 : categoryData.name) || categorySlug;
1879
- const categoryDescription = (categoryData == null ? void 0 : categoryData.description) || "";
1861
+ const categoryName = categoryData?.name || categorySlug;
1862
+ const categoryDescription = categoryData?.description || "";
1880
1863
  const { selected } = await (0, import_prompts.default)({
1881
1864
  type: "multiselect",
1882
1865
  name: "selected",
1883
1866
  message: `Select extensions for ${categoryName}${categoryDescription ? `: ${categoryDescription}` : ""}`,
1884
- choices: extensions.map((extension) => {
1885
- var _a;
1886
- return {
1887
- title: extension.name,
1888
- value: extension.url,
1889
- description: extension.description + " Keywords: " + ((_a = extension.labels) == null ? void 0 : _a.join(", "))
1890
- };
1891
- }),
1867
+ choices: extensions.map((extension) => ({
1868
+ title: extension.name,
1869
+ value: extension.url,
1870
+ description: extension.description + " Keywords: " + extension.labels?.join(", ")
1871
+ })),
1892
1872
  initial: 0
1893
1873
  });
1894
1874
  appConfig.templatesOrExtensions = appConfig.templatesOrExtensions ? [...appConfig.templatesOrExtensions, ...selected] : [];
@@ -1945,7 +1925,7 @@ var getCnaOptions = async (options) => {
1945
1925
  // package.json
1946
1926
  var package_default = {
1947
1927
  name: "create-awesome-node-app",
1948
- version: "0.5.0",
1928
+ version: "0.6.2",
1949
1929
  type: "module",
1950
1930
  description: "Command line tool to create Node apps with a lot of different templates and extensions.",
1951
1931
  license: "MIT",
@@ -1967,9 +1947,15 @@ var package_default = {
1967
1947
  }
1968
1948
  ],
1969
1949
  engines: {
1970
- node: ">=18.0.0"
1950
+ node: ">=22.0.0"
1971
1951
  },
1972
1952
  main: "index.js",
1953
+ exports: {
1954
+ ".": {
1955
+ types: "./dist/index.d.ts",
1956
+ import: "./index.js"
1957
+ }
1958
+ },
1973
1959
  files: [
1974
1960
  "index.js",
1975
1961
  "dist/**"
@@ -1986,27 +1972,29 @@ var package_default = {
1986
1972
  build: "tsup src/index.ts --format cjs,esm --dts",
1987
1973
  dev: "tsup src/index.ts --watch --format cjs,esm --dts",
1988
1974
  "type-check": "tsc --noEmit",
1989
- lint: "eslint .",
1990
- "lint:fix": "eslint . --fix"
1975
+ lint: "eslint 'src/**/*.{ts,tsx,js}'",
1976
+ "lint:fix": "eslint 'src/**/*.{ts,tsx,js}' --fix",
1977
+ test: "node --test tests/**/*.test.mjs"
1991
1978
  },
1992
1979
  dependencies: {
1993
1980
  "@create-node-app/core": "*",
1994
- axios: "^1.6.0",
1995
- "ci-info": "^4.0.0",
1996
- commander: "^13.1.0",
1997
- prompts: "^2.4.1",
1998
- semver: "^7.5.2",
1999
- yargs: "^17.0.1"
1981
+ axios: "^1.12.2",
1982
+ "ci-info": "^4.3.0",
1983
+ commander: "^14.0.1",
1984
+ prompts: "^2.4.2",
1985
+ semver: "^7.7.2",
1986
+ yargs: "^18.0.0"
2000
1987
  },
2001
1988
  devDependencies: {
2002
1989
  "@create-node-app/eslint-config-ts": "*",
2003
- "@types/node": "^18.14.6",
1990
+ "@types/node": "^24.5.2",
2004
1991
  "@types/prompts": "^2.4.9",
2005
- "@types/yargs": "^17.0.22",
2006
- eslint: "^7.23.0",
2007
- "eslint-config-turbo": "^0.0.4",
2008
- tsup: "^6.2.3",
2009
- "eslint-plugin-turbo": "^0.0.4"
1992
+ "@types/yargs": "^17.0.33",
1993
+ "@types/semver": "^7.5.8",
1994
+ eslint: "^9.35.0",
1995
+ "eslint-config-turbo": "^2.5.6",
1996
+ tsup: "^8.5.0",
1997
+ "eslint-plugin-turbo": "^2.5.6"
2010
1998
  }
2011
1999
  };
2012
2000
 
@@ -2018,10 +2006,10 @@ var listTemplates = async () => {
2018
2006
  for (const categorySlug of categories) {
2019
2007
  const categoryData = await getCategoryData(categorySlug);
2020
2008
  const templates = await getTemplatesForCategory(categorySlug);
2021
- const categoryName = (categoryData == null ? void 0 : categoryData.name) || categorySlug;
2009
+ const categoryName = categoryData?.name || categorySlug;
2022
2010
  console.log(import_chalk.default.bold.green(`
2023
2011
  ${categoryName}:`));
2024
- if (categoryData == null ? void 0 : categoryData.description) {
2012
+ if (categoryData?.description) {
2025
2013
  console.log(` ${categoryData.description}`);
2026
2014
  }
2027
2015
  templates.forEach((template) => {
@@ -2043,9 +2031,7 @@ var listAddons = async ({
2043
2031
  templateType = await getTemplateTypeFromSlug(templateSlug);
2044
2032
  }
2045
2033
  const types = templateType ? [templateType, "all"] : ["all"];
2046
- const extensionsGroupedByCategory = await getExtensionsGroupedByCategory(
2047
- types
2048
- );
2034
+ const extensionsGroupedByCategory = await getExtensionsGroupedByCategory(types);
2049
2035
  console.log(import_chalk.default.bold.blue("\nAvailable Addons:"));
2050
2036
  if (templateSlug) {
2051
2037
  console.log(
@@ -2057,10 +2043,10 @@ Compatible with template: ${templateSlug}`)
2057
2043
  extensionsGroupedByCategory
2058
2044
  )) {
2059
2045
  const categoryData = await getCategoryData(categorySlug);
2060
- const categoryName = (categoryData == null ? void 0 : categoryData.name) || categorySlug;
2046
+ const categoryName = categoryData?.name || categorySlug;
2061
2047
  console.log(import_chalk.default.bold.green(`
2062
2048
  ${categoryName}:`));
2063
- if (categoryData == null ? void 0 : categoryData.description) {
2049
+ if (categoryData?.description) {
2064
2050
  console.log(` ${categoryData.description}`);
2065
2051
  }
2066
2052
  extensions.forEach((extension) => {
@@ -2078,7 +2064,9 @@ var getTemplateTypeFromSlug = async (templateSlug) => {
2078
2064
  const categories = await getTemplateCategories();
2079
2065
  for (const category of categories) {
2080
2066
  const templates = await getTemplatesForCategory(category);
2081
- const template = templates.find((t) => t.slug === templateSlug);
2067
+ const template = templates.find(
2068
+ (t) => t.slug === templateSlug
2069
+ );
2082
2070
  if (template) {
2083
2071
  return template.type;
2084
2072
  }
@@ -2099,21 +2087,18 @@ var main = async () => {
2099
2087
  ).option(
2100
2088
  "--addons [extensions...]",
2101
2089
  "specify extensions to apply for the boilerplate generation"
2102
- ).option("--use-yarn", "use yarn instead of npm or pnpm").option("--use-pnpm", "use pnpm instead of yarn or npm").option(
2103
- "--ai-tool <tool>",
2104
- "specify AI tool configuration (cursor, copilot, none)"
2105
- ).option("--interactive", "run in interactive mode to select options", false).option("--list-templates", "list all available templates").option("--list-addons", "list all available addons").action((providedProjectName) => {
2090
+ ).option("--use-yarn", "use yarn instead of npm or pnpm").option("--use-pnpm", "use pnpm instead of yarn or npm").option("--interactive", "run in interactive mode to select options", false).option("--list-templates", "list all available templates").option("--list-addons", "list all available addons").action((providedProjectName) => {
2106
2091
  projectName = providedProjectName || projectName;
2107
2092
  });
2108
2093
  program.parse(process.argv);
2109
2094
  const opts = program.opts();
2110
2095
  (0, import_core.checkNodeVersion)(package_default.engines.node, package_default.name);
2111
- const latest = await (0, import_core.checkForLatestVersion)("create-awesome-node-app");
2112
- if (latest && import_semver.default.lt(package_default.version, latest)) {
2096
+ const latestVersion = await (0, import_core.checkForLatestVersion)("create-awesome-node-app");
2097
+ if (latestVersion && import_semver.default.lt(package_default.version, latestVersion)) {
2113
2098
  console.log();
2114
2099
  console.error(
2115
2100
  import_chalk2.default.yellow(
2116
- `You are running \`create-awesome-node-app\` ${package_default.version}, which is behind the latest release (${latest}).
2101
+ `You are running \`create-awesome-node-app\` ${package_default.version}, which is behind the latest release (${latestVersion}).
2117
2102
 
2118
2103
  We recommend always using the latest version of create-awesome-node-app if possible.`
2119
2104
  )
@@ -2132,13 +2117,9 @@ We recommend always using the latest version of create-awesome-node-app if possi
2132
2117
  }
2133
2118
  const { useYarn, usePnpm, ...restOpts } = opts;
2134
2119
  const packageManager = useYarn ? "yarn" : usePnpm ? "pnpm" : "npm";
2135
- const templatesOrExtensions = [restOpts.template].concat(Array.isArray(restOpts.extend) ? restOpts.extend : []).reduce((acc, templateOrExtension) => {
2136
- if (!templateOrExtension) {
2137
- return acc;
2138
- }
2139
- return acc.concat({
2140
- url: templateOrExtension
2141
- });
2120
+ const templatesOrExtensions = [restOpts.template].filter(Boolean).reduce((acc, templateOrExtension) => {
2121
+ if (!templateOrExtension) return acc;
2122
+ return acc.concat({ url: templateOrExtension });
2142
2123
  }, []);
2143
2124
  return (0, import_core.createNodeApp)(
2144
2125
  projectName,
@@ -0,0 +1,2 @@
1
+
2
+ export { }
package/dist/index.d.ts CHANGED
@@ -1,2 +1,2 @@
1
1
 
2
- export { }
2
+ export { }
package/dist/index.js CHANGED
@@ -7,9 +7,8 @@ var __hasOwnProp = Object.prototype.hasOwnProperty;
7
7
  var __require = /* @__PURE__ */ ((x) => typeof require !== "undefined" ? require : typeof Proxy !== "undefined" ? new Proxy(x, {
8
8
  get: (a, b) => (typeof require !== "undefined" ? require : a)[b]
9
9
  }) : x)(function(x) {
10
- if (typeof require !== "undefined")
11
- return require.apply(this, arguments);
12
- throw new Error('Dynamic require of "' + x + '" is not supported');
10
+ if (typeof require !== "undefined") return require.apply(this, arguments);
11
+ throw Error('Dynamic require of "' + x + '" is not supported');
13
12
  });
14
13
  var __commonJS = (cb, mod) => function __require2() {
15
14
  return mod || (0, cb[__getOwnPropNames(cb)[0]])((mod = { exports: {} }).exports, mod), mod.exports;
@@ -191,6 +190,7 @@ var require_color_name = __commonJS({
191
190
  // node_modules/color-convert/conversions.js
192
191
  var require_conversions = __commonJS({
193
192
  "node_modules/color-convert/conversions.js"(exports, module) {
193
+ "use strict";
194
194
  var cssKeywords = require_color_name();
195
195
  var reverseKeywords = {};
196
196
  for (const key of Object.keys(cssKeywords)) {
@@ -862,6 +862,7 @@ var require_conversions = __commonJS({
862
862
  // node_modules/color-convert/route.js
863
863
  var require_route = __commonJS({
864
864
  "node_modules/color-convert/route.js"(exports, module) {
865
+ "use strict";
865
866
  var conversions = require_conversions();
866
867
  function buildGraph() {
867
868
  const graph = {};
@@ -932,6 +933,7 @@ var require_route = __commonJS({
932
933
  // node_modules/color-convert/index.js
933
934
  var require_color_convert = __commonJS({
934
935
  "node_modules/color-convert/index.js"(exports, module) {
936
+ "use strict";
935
937
  var conversions = require_conversions();
936
938
  var route = require_route();
937
939
  var convert = {};
@@ -1618,7 +1620,7 @@ var getTemplateData = async () => {
1618
1620
  return templateDataCache.data;
1619
1621
  };
1620
1622
  var getTemplateCategories = async (cliArgs) => {
1621
- if (cliArgs == null ? void 0 : cliArgs.category) {
1623
+ if (cliArgs?.category) {
1622
1624
  return [cliArgs.category];
1623
1625
  }
1624
1626
  const templateData = await getTemplateData();
@@ -1641,7 +1643,7 @@ var getCategoryData = async (categorySlug) => {
1641
1643
  return void 0;
1642
1644
  };
1643
1645
  var getTemplatesForCategory = async (category, cliArgs) => {
1644
- const selectedCategory = (cliArgs == null ? void 0 : cliArgs.category) || category;
1646
+ const selectedCategory = cliArgs?.category || category;
1645
1647
  if (!selectedCategory) {
1646
1648
  throw new Error("Category is required in non-interactive mode.");
1647
1649
  }
@@ -1652,7 +1654,7 @@ var getTemplatesForCategory = async (category, cliArgs) => {
1652
1654
  return templates;
1653
1655
  };
1654
1656
  var getExtensionsGroupedByCategory = async (type, cliArgs) => {
1655
- const selectedType = (cliArgs == null ? void 0 : cliArgs.type) ? cliArgs.type.split(",") : type;
1657
+ const selectedType = cliArgs?.type ? cliArgs.type.split(",") : type;
1656
1658
  const safeType = Array.isArray(selectedType) ? selectedType : [selectedType];
1657
1659
  const templateData = await getTemplateData();
1658
1660
  const extensions = templateData.extensions.filter((extension) => {
@@ -1661,19 +1663,22 @@ var getExtensionsGroupedByCategory = async (type, cliArgs) => {
1661
1663
  (extensionType) => safeType.includes(extensionType)
1662
1664
  );
1663
1665
  });
1664
- const extensionsGroupedByCategory = extensions.reduce((acc, extension) => {
1665
- const category = extension.category;
1666
- if (!acc[category]) {
1667
- acc[category] = [];
1668
- }
1669
- acc[category].push(extension);
1670
- return acc;
1671
- }, {});
1666
+ const extensionsGroupedByCategory = extensions.reduce(
1667
+ (acc, extension) => {
1668
+ const category = extension.category;
1669
+ if (!acc[category]) {
1670
+ acc[category] = [];
1671
+ }
1672
+ acc[category].push(extension);
1673
+ return acc;
1674
+ },
1675
+ {}
1676
+ );
1672
1677
  return extensionsGroupedByCategory;
1673
1678
  };
1674
1679
 
1675
1680
  // src/options.ts
1676
- prompts.override(yargs.argv);
1681
+ prompts.override(yargs(process.argv.slice(2)).argv);
1677
1682
  var PACKAGE_MANAGERS = ["npm", "yarn", "pnpm"];
1678
1683
  var isValidUrl = (url) => {
1679
1684
  try {
@@ -1713,7 +1718,7 @@ var processNonInteractiveOptions = async (options) => {
1713
1718
  }
1714
1719
  if (options.addons && Array.isArray(options.addons)) {
1715
1720
  const extensionsGroupedByCategory = await getExtensionsGroupedByCategory([
1716
- (matchedTemplate == null ? void 0 : matchedTemplate.type) || "custom",
1721
+ matchedTemplate?.type || "custom",
1717
1722
  "all"
1718
1723
  ]);
1719
1724
  const extensions = options.addons.map((addon) => {
@@ -1738,10 +1743,9 @@ var processNonInteractiveOptions = async (options) => {
1738
1743
  const additionalExtensions = options.extend.filter(Boolean).map((extension) => ({ url: extension }));
1739
1744
  templatesOrExtensions.push(...additionalExtensions);
1740
1745
  }
1741
- if (options.aiTool && !["cursor", "copilot", "none"].includes(options.aiTool)) {
1742
- throw new Error("Invalid --ai-tool option. Use: cursor, copilot, or none");
1746
+ if (Object.prototype.hasOwnProperty.call(options, "aiTool")) {
1747
+ delete options.aiTool;
1743
1748
  }
1744
- options.aiTool = options.aiTool || "none";
1745
1749
  options.templatesOrExtensions = templatesOrExtensions;
1746
1750
  if (options.verbose) {
1747
1751
  console.log(JSON.stringify(options, null, 2));
@@ -1754,8 +1758,8 @@ var processInteractiveOptions = async (options) => {
1754
1758
  const categoryData = await getCategoryData(categorySlug);
1755
1759
  return {
1756
1760
  slug: categorySlug,
1757
- name: (categoryData == null ? void 0 : categoryData.name) || categorySlug,
1758
- description: (categoryData == null ? void 0 : categoryData.description) || ""
1761
+ name: categoryData?.name || categorySlug,
1762
+ description: categoryData?.description || ""
1759
1763
  };
1760
1764
  });
1761
1765
  const categoryDataList = await Promise.all(categoryDataPromises);
@@ -1789,28 +1793,9 @@ var processInteractiveOptions = async (options) => {
1789
1793
  initial: options.packageManager ? PACKAGE_MANAGERS.indexOf(options.packageManager) : 0
1790
1794
  },
1791
1795
  {
1792
- type: "select",
1793
- name: "aiTool",
1794
- message: "Which AI coding tool would you like to configure?",
1795
- choices: [
1796
- {
1797
- title: "Cursor Rules",
1798
- value: "cursor",
1799
- description: "Add .cursorrules configuration for Cursor IDE"
1800
- },
1801
- {
1802
- title: "GitHub Copilot Instructions",
1803
- value: "copilot",
1804
- description: "Add .github/copilot-instructions.md for GitHub Copilot"
1805
- },
1806
- {
1807
- title: "None",
1808
- value: "none",
1809
- description: "Don't add any AI tool configuration"
1810
- }
1811
- ],
1812
- initial: 2
1813
- // Default to "None"
1796
+ type: null,
1797
+ name: "__removed_aiTool",
1798
+ message: "(AI tool selection removed)"
1814
1799
  },
1815
1800
  {
1816
1801
  type: "select",
@@ -1821,14 +1806,11 @@ var processInteractiveOptions = async (options) => {
1821
1806
  }
1822
1807
  ]);
1823
1808
  const templates = await getTemplatesForCategory(baseInput.category);
1824
- const templateOptions = templates.map((template) => {
1825
- var _a;
1826
- return {
1827
- title: template.name,
1828
- value: template.url,
1829
- description: template.description + " Keywords: " + ((_a = template.labels) == null ? void 0 : _a.join(", "))
1830
- };
1831
- });
1809
+ const templateOptions = templates.map((template) => ({
1810
+ title: template.name,
1811
+ value: template.url,
1812
+ description: template.description + " Keywords: " + template.labels?.join(", ")
1813
+ }));
1832
1814
  const templateInput = await prompts(
1833
1815
  baseInput.category === "custom" ? [
1834
1816
  {
@@ -1857,7 +1839,7 @@ var processInteractiveOptions = async (options) => {
1857
1839
  (template) => template.url === templateInput.template
1858
1840
  );
1859
1841
  const templateTemplateOrExtension = templateInput.template;
1860
- const customOptions = (existingTemplate == null ? void 0 : existingTemplate.customOptions) || [];
1842
+ const customOptions = existingTemplate?.customOptions || [];
1861
1843
  const appConfig = await prompts([
1862
1844
  // The following prompts are placeholders for future inputs
1863
1845
  {
@@ -1878,27 +1860,24 @@ var processInteractiveOptions = async (options) => {
1878
1860
  appConfig.templatesOrExtensions = [];
1879
1861
  appConfig.extend = [];
1880
1862
  const extensionsGroupedByCategory = await getExtensionsGroupedByCategory([
1881
- (existingTemplate == null ? void 0 : existingTemplate.type) || "custom",
1863
+ existingTemplate?.type || "custom",
1882
1864
  "all"
1883
1865
  ]);
1884
1866
  for (const [categorySlug, extensions] of Object.entries(
1885
1867
  extensionsGroupedByCategory
1886
1868
  )) {
1887
1869
  const categoryData = await getCategoryData(categorySlug);
1888
- const categoryName = (categoryData == null ? void 0 : categoryData.name) || categorySlug;
1889
- const categoryDescription = (categoryData == null ? void 0 : categoryData.description) || "";
1870
+ const categoryName = categoryData?.name || categorySlug;
1871
+ const categoryDescription = categoryData?.description || "";
1890
1872
  const { selected } = await prompts({
1891
1873
  type: "multiselect",
1892
1874
  name: "selected",
1893
1875
  message: `Select extensions for ${categoryName}${categoryDescription ? `: ${categoryDescription}` : ""}`,
1894
- choices: extensions.map((extension) => {
1895
- var _a;
1896
- return {
1897
- title: extension.name,
1898
- value: extension.url,
1899
- description: extension.description + " Keywords: " + ((_a = extension.labels) == null ? void 0 : _a.join(", "))
1900
- };
1901
- }),
1876
+ choices: extensions.map((extension) => ({
1877
+ title: extension.name,
1878
+ value: extension.url,
1879
+ description: extension.description + " Keywords: " + extension.labels?.join(", ")
1880
+ })),
1902
1881
  initial: 0
1903
1882
  });
1904
1883
  appConfig.templatesOrExtensions = appConfig.templatesOrExtensions ? [...appConfig.templatesOrExtensions, ...selected] : [];
@@ -1955,7 +1934,7 @@ var getCnaOptions = async (options) => {
1955
1934
  // package.json
1956
1935
  var package_default = {
1957
1936
  name: "create-awesome-node-app",
1958
- version: "0.5.0",
1937
+ version: "0.6.2",
1959
1938
  type: "module",
1960
1939
  description: "Command line tool to create Node apps with a lot of different templates and extensions.",
1961
1940
  license: "MIT",
@@ -1977,9 +1956,15 @@ var package_default = {
1977
1956
  }
1978
1957
  ],
1979
1958
  engines: {
1980
- node: ">=18.0.0"
1959
+ node: ">=22.0.0"
1981
1960
  },
1982
1961
  main: "index.js",
1962
+ exports: {
1963
+ ".": {
1964
+ types: "./dist/index.d.ts",
1965
+ import: "./index.js"
1966
+ }
1967
+ },
1983
1968
  files: [
1984
1969
  "index.js",
1985
1970
  "dist/**"
@@ -1996,27 +1981,29 @@ var package_default = {
1996
1981
  build: "tsup src/index.ts --format cjs,esm --dts",
1997
1982
  dev: "tsup src/index.ts --watch --format cjs,esm --dts",
1998
1983
  "type-check": "tsc --noEmit",
1999
- lint: "eslint .",
2000
- "lint:fix": "eslint . --fix"
1984
+ lint: "eslint 'src/**/*.{ts,tsx,js}'",
1985
+ "lint:fix": "eslint 'src/**/*.{ts,tsx,js}' --fix",
1986
+ test: "node --test tests/**/*.test.mjs"
2001
1987
  },
2002
1988
  dependencies: {
2003
1989
  "@create-node-app/core": "*",
2004
- axios: "^1.6.0",
2005
- "ci-info": "^4.0.0",
2006
- commander: "^13.1.0",
2007
- prompts: "^2.4.1",
2008
- semver: "^7.5.2",
2009
- yargs: "^17.0.1"
1990
+ axios: "^1.12.2",
1991
+ "ci-info": "^4.3.0",
1992
+ commander: "^14.0.1",
1993
+ prompts: "^2.4.2",
1994
+ semver: "^7.7.2",
1995
+ yargs: "^18.0.0"
2010
1996
  },
2011
1997
  devDependencies: {
2012
1998
  "@create-node-app/eslint-config-ts": "*",
2013
- "@types/node": "^18.14.6",
1999
+ "@types/node": "^24.5.2",
2014
2000
  "@types/prompts": "^2.4.9",
2015
- "@types/yargs": "^17.0.22",
2016
- eslint: "^7.23.0",
2017
- "eslint-config-turbo": "^0.0.4",
2018
- tsup: "^6.2.3",
2019
- "eslint-plugin-turbo": "^0.0.4"
2001
+ "@types/yargs": "^17.0.33",
2002
+ "@types/semver": "^7.5.8",
2003
+ eslint: "^9.35.0",
2004
+ "eslint-config-turbo": "^2.5.6",
2005
+ tsup: "^8.5.0",
2006
+ "eslint-plugin-turbo": "^2.5.6"
2020
2007
  }
2021
2008
  };
2022
2009
 
@@ -2028,10 +2015,10 @@ var listTemplates = async () => {
2028
2015
  for (const categorySlug of categories) {
2029
2016
  const categoryData = await getCategoryData(categorySlug);
2030
2017
  const templates = await getTemplatesForCategory(categorySlug);
2031
- const categoryName = (categoryData == null ? void 0 : categoryData.name) || categorySlug;
2018
+ const categoryName = categoryData?.name || categorySlug;
2032
2019
  console.log(import_chalk.default.bold.green(`
2033
2020
  ${categoryName}:`));
2034
- if (categoryData == null ? void 0 : categoryData.description) {
2021
+ if (categoryData?.description) {
2035
2022
  console.log(` ${categoryData.description}`);
2036
2023
  }
2037
2024
  templates.forEach((template) => {
@@ -2053,9 +2040,7 @@ var listAddons = async ({
2053
2040
  templateType = await getTemplateTypeFromSlug(templateSlug);
2054
2041
  }
2055
2042
  const types = templateType ? [templateType, "all"] : ["all"];
2056
- const extensionsGroupedByCategory = await getExtensionsGroupedByCategory(
2057
- types
2058
- );
2043
+ const extensionsGroupedByCategory = await getExtensionsGroupedByCategory(types);
2059
2044
  console.log(import_chalk.default.bold.blue("\nAvailable Addons:"));
2060
2045
  if (templateSlug) {
2061
2046
  console.log(
@@ -2067,10 +2052,10 @@ Compatible with template: ${templateSlug}`)
2067
2052
  extensionsGroupedByCategory
2068
2053
  )) {
2069
2054
  const categoryData = await getCategoryData(categorySlug);
2070
- const categoryName = (categoryData == null ? void 0 : categoryData.name) || categorySlug;
2055
+ const categoryName = categoryData?.name || categorySlug;
2071
2056
  console.log(import_chalk.default.bold.green(`
2072
2057
  ${categoryName}:`));
2073
- if (categoryData == null ? void 0 : categoryData.description) {
2058
+ if (categoryData?.description) {
2074
2059
  console.log(` ${categoryData.description}`);
2075
2060
  }
2076
2061
  extensions.forEach((extension) => {
@@ -2088,7 +2073,9 @@ var getTemplateTypeFromSlug = async (templateSlug) => {
2088
2073
  const categories = await getTemplateCategories();
2089
2074
  for (const category of categories) {
2090
2075
  const templates = await getTemplatesForCategory(category);
2091
- const template = templates.find((t) => t.slug === templateSlug);
2076
+ const template = templates.find(
2077
+ (t) => t.slug === templateSlug
2078
+ );
2092
2079
  if (template) {
2093
2080
  return template.type;
2094
2081
  }
@@ -2109,21 +2096,18 @@ var main = async () => {
2109
2096
  ).option(
2110
2097
  "--addons [extensions...]",
2111
2098
  "specify extensions to apply for the boilerplate generation"
2112
- ).option("--use-yarn", "use yarn instead of npm or pnpm").option("--use-pnpm", "use pnpm instead of yarn or npm").option(
2113
- "--ai-tool <tool>",
2114
- "specify AI tool configuration (cursor, copilot, none)"
2115
- ).option("--interactive", "run in interactive mode to select options", false).option("--list-templates", "list all available templates").option("--list-addons", "list all available addons").action((providedProjectName) => {
2099
+ ).option("--use-yarn", "use yarn instead of npm or pnpm").option("--use-pnpm", "use pnpm instead of yarn or npm").option("--interactive", "run in interactive mode to select options", false).option("--list-templates", "list all available templates").option("--list-addons", "list all available addons").action((providedProjectName) => {
2116
2100
  projectName = providedProjectName || projectName;
2117
2101
  });
2118
2102
  program.parse(process.argv);
2119
2103
  const opts = program.opts();
2120
2104
  checkNodeVersion(package_default.engines.node, package_default.name);
2121
- const latest = await checkForLatestVersion("create-awesome-node-app");
2122
- if (latest && semver.lt(package_default.version, latest)) {
2105
+ const latestVersion = await checkForLatestVersion("create-awesome-node-app");
2106
+ if (latestVersion && semver.lt(package_default.version, latestVersion)) {
2123
2107
  console.log();
2124
2108
  console.error(
2125
2109
  import_chalk2.default.yellow(
2126
- `You are running \`create-awesome-node-app\` ${package_default.version}, which is behind the latest release (${latest}).
2110
+ `You are running \`create-awesome-node-app\` ${package_default.version}, which is behind the latest release (${latestVersion}).
2127
2111
 
2128
2112
  We recommend always using the latest version of create-awesome-node-app if possible.`
2129
2113
  )
@@ -2142,13 +2126,9 @@ We recommend always using the latest version of create-awesome-node-app if possi
2142
2126
  }
2143
2127
  const { useYarn, usePnpm, ...restOpts } = opts;
2144
2128
  const packageManager = useYarn ? "yarn" : usePnpm ? "pnpm" : "npm";
2145
- const templatesOrExtensions = [restOpts.template].concat(Array.isArray(restOpts.extend) ? restOpts.extend : []).reduce((acc, templateOrExtension) => {
2146
- if (!templateOrExtension) {
2147
- return acc;
2148
- }
2149
- return acc.concat({
2150
- url: templateOrExtension
2151
- });
2129
+ const templatesOrExtensions = [restOpts.template].filter(Boolean).reduce((acc, templateOrExtension) => {
2130
+ if (!templateOrExtension) return acc;
2131
+ return acc.concat({ url: templateOrExtension });
2152
2132
  }, []);
2153
2133
  return createNodeApp(
2154
2134
  projectName,
package/index.js CHANGED
@@ -1,3 +1,3 @@
1
1
  #!/usr/bin/env node
2
-
2
+ // Use CJS wrapper which loads core CJS build (avoids dynamic require issues for now)
3
3
  import "./dist/index.cjs";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "create-awesome-node-app",
3
- "version": "0.5.0",
3
+ "version": "0.6.2",
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",
@@ -22,9 +22,15 @@
22
22
  }
23
23
  ],
24
24
  "engines": {
25
- "node": ">=18.0.0"
25
+ "node": ">=22.0.0"
26
26
  },
27
27
  "main": "index.js",
28
+ "exports": {
29
+ ".": {
30
+ "types": "./dist/index.d.ts",
31
+ "import": "./index.js"
32
+ }
33
+ },
28
34
  "files": [
29
35
  "index.js",
30
36
  "dist/**"
@@ -41,26 +47,28 @@
41
47
  "build": "tsup src/index.ts --format cjs,esm --dts",
42
48
  "dev": "tsup src/index.ts --watch --format cjs,esm --dts",
43
49
  "type-check": "tsc --noEmit",
44
- "lint": "eslint .",
45
- "lint:fix": "eslint . --fix"
50
+ "lint": "eslint 'src/**/*.{ts,tsx,js}'",
51
+ "lint:fix": "eslint 'src/**/*.{ts,tsx,js}' --fix",
52
+ "test": "node --test tests/**/*.test.mjs"
46
53
  },
47
54
  "dependencies": {
48
55
  "@create-node-app/core": "*",
49
- "axios": "^1.6.0",
50
- "ci-info": "^4.0.0",
51
- "commander": "^13.1.0",
52
- "prompts": "^2.4.1",
53
- "semver": "^7.5.2",
54
- "yargs": "^17.0.1"
56
+ "axios": "^1.12.2",
57
+ "ci-info": "^4.3.0",
58
+ "commander": "^14.0.1",
59
+ "prompts": "^2.4.2",
60
+ "semver": "^7.7.2",
61
+ "yargs": "^18.0.0"
55
62
  },
56
63
  "devDependencies": {
57
64
  "@create-node-app/eslint-config-ts": "*",
58
- "@types/node": "^18.14.6",
65
+ "@types/node": "^24.5.2",
59
66
  "@types/prompts": "^2.4.9",
60
- "@types/yargs": "^17.0.22",
61
- "eslint": "^7.23.0",
62
- "eslint-config-turbo": "^0.0.4",
63
- "tsup": "^6.2.3",
64
- "eslint-plugin-turbo": "^0.0.4"
67
+ "@types/yargs": "^17.0.33",
68
+ "@types/semver": "^7.5.8",
69
+ "eslint": "^9.35.0",
70
+ "eslint-config-turbo": "^2.5.6",
71
+ "tsup": "^8.5.0",
72
+ "eslint-plugin-turbo": "^2.5.6"
65
73
  }
66
74
  }