create-awesome-node-app 0.8.0 → 0.9.1
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/README.md +5 -5
- package/dist/index.cjs +55 -37
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +55 -37
- package/dist/index.js.map +1 -1
- package/package.json +10 -13
package/dist/index.js
CHANGED
|
@@ -970,9 +970,9 @@ var require_color_convert = __commonJS({
|
|
|
970
970
|
}
|
|
971
971
|
});
|
|
972
972
|
|
|
973
|
-
// node_modules/ansi-styles/index.js
|
|
973
|
+
// ../../node_modules/chalk/node_modules/ansi-styles/index.js
|
|
974
974
|
var require_ansi_styles = __commonJS({
|
|
975
|
-
"node_modules/ansi-styles/index.js"(exports, module) {
|
|
975
|
+
"../../node_modules/chalk/node_modules/ansi-styles/index.js"(exports, module) {
|
|
976
976
|
"use strict";
|
|
977
977
|
var wrapAnsi16 = (fn, offset) => (...args) => {
|
|
978
978
|
const code = fn(...args);
|
|
@@ -1227,9 +1227,9 @@ var require_supports_color = __commonJS({
|
|
|
1227
1227
|
}
|
|
1228
1228
|
});
|
|
1229
1229
|
|
|
1230
|
-
// node_modules/chalk/source/util.js
|
|
1230
|
+
// ../../node_modules/chalk/source/util.js
|
|
1231
1231
|
var require_util = __commonJS({
|
|
1232
|
-
"node_modules/chalk/source/util.js"(exports, module) {
|
|
1232
|
+
"../../node_modules/chalk/source/util.js"(exports, module) {
|
|
1233
1233
|
"use strict";
|
|
1234
1234
|
var stringReplaceAll = (string, substring, replacer) => {
|
|
1235
1235
|
let index = string.indexOf(substring);
|
|
@@ -1266,9 +1266,9 @@ var require_util = __commonJS({
|
|
|
1266
1266
|
}
|
|
1267
1267
|
});
|
|
1268
1268
|
|
|
1269
|
-
// node_modules/chalk/source/templates.js
|
|
1269
|
+
// ../../node_modules/chalk/source/templates.js
|
|
1270
1270
|
var require_templates = __commonJS({
|
|
1271
|
-
"node_modules/chalk/source/templates.js"(exports, module) {
|
|
1271
|
+
"../../node_modules/chalk/source/templates.js"(exports, module) {
|
|
1272
1272
|
"use strict";
|
|
1273
1273
|
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;
|
|
1274
1274
|
var STYLE_REGEX = /(?:^|\.)(\w+)(?:\(([^)]*)\))?/g;
|
|
@@ -1380,9 +1380,9 @@ var require_templates = __commonJS({
|
|
|
1380
1380
|
}
|
|
1381
1381
|
});
|
|
1382
1382
|
|
|
1383
|
-
// node_modules/chalk/source/index.js
|
|
1383
|
+
// ../../node_modules/chalk/source/index.js
|
|
1384
1384
|
var require_source = __commonJS({
|
|
1385
|
-
"node_modules/chalk/source/index.js"(exports, module) {
|
|
1385
|
+
"../../node_modules/chalk/source/index.js"(exports, module) {
|
|
1386
1386
|
"use strict";
|
|
1387
1387
|
var ansiStyles = require_ansi_styles();
|
|
1388
1388
|
var { stdout: stdoutColor, stderr: stderrColor } = require_supports_color();
|
|
@@ -1572,7 +1572,7 @@ import {
|
|
|
1572
1572
|
import { loadTemplateCnaConfig } from "@create-node-app/core";
|
|
1573
1573
|
import { isCI } from "ci-info";
|
|
1574
1574
|
import prompts from "prompts";
|
|
1575
|
-
var PACKAGE_MANAGERS = ["npm", "yarn", "pnpm"];
|
|
1575
|
+
var PACKAGE_MANAGERS = ["npm", "yarn", "pnpm", "bun"];
|
|
1576
1576
|
var isValidUrl = (url) => {
|
|
1577
1577
|
try {
|
|
1578
1578
|
new URL(url);
|
|
@@ -1854,10 +1854,41 @@ var getCnaOptions = async (options) => {
|
|
|
1854
1854
|
return processNonInteractiveOptions(options);
|
|
1855
1855
|
};
|
|
1856
1856
|
|
|
1857
|
+
// src/set-overrides.ts
|
|
1858
|
+
var unquoteSetValue = (value) => {
|
|
1859
|
+
if (value.startsWith('"') && value.endsWith('"') || value.startsWith("'") && value.endsWith("'")) {
|
|
1860
|
+
return value.slice(1, -1);
|
|
1861
|
+
}
|
|
1862
|
+
return value;
|
|
1863
|
+
};
|
|
1864
|
+
var parseSetOverrides = (set) => {
|
|
1865
|
+
const setOverrides = {};
|
|
1866
|
+
if (!Array.isArray(set)) {
|
|
1867
|
+
return setOverrides;
|
|
1868
|
+
}
|
|
1869
|
+
const assignments = [];
|
|
1870
|
+
for (const part of set) {
|
|
1871
|
+
if (part.includes("=") || assignments.length === 0) {
|
|
1872
|
+
assignments.push(part);
|
|
1873
|
+
} else {
|
|
1874
|
+
assignments[assignments.length - 1] += ` ${part}`;
|
|
1875
|
+
}
|
|
1876
|
+
}
|
|
1877
|
+
for (const assignment of assignments) {
|
|
1878
|
+
const eqIdx = assignment.indexOf("=");
|
|
1879
|
+
if (eqIdx > 0) {
|
|
1880
|
+
setOverrides[assignment.slice(0, eqIdx).trim()] = unquoteSetValue(
|
|
1881
|
+
assignment.slice(eqIdx + 1).trim()
|
|
1882
|
+
);
|
|
1883
|
+
}
|
|
1884
|
+
}
|
|
1885
|
+
return setOverrides;
|
|
1886
|
+
};
|
|
1887
|
+
|
|
1857
1888
|
// package.json
|
|
1858
1889
|
var package_default = {
|
|
1859
1890
|
name: "create-awesome-node-app",
|
|
1860
|
-
version: "0.
|
|
1891
|
+
version: "0.9.1",
|
|
1861
1892
|
type: "module",
|
|
1862
1893
|
description: "Command line tool to create Node apps with a lot of different templates and extensions.",
|
|
1863
1894
|
license: "MIT",
|
|
@@ -1911,25 +1942,22 @@ var package_default = {
|
|
|
1911
1942
|
"test:src": "npm run test"
|
|
1912
1943
|
},
|
|
1913
1944
|
dependencies: {
|
|
1914
|
-
"@create-node-app/core": "^0.6.
|
|
1915
|
-
axios: "^1.
|
|
1945
|
+
"@create-node-app/core": "^0.6.2",
|
|
1946
|
+
axios: "^1.16.0",
|
|
1916
1947
|
"ci-info": "^4.3.0",
|
|
1917
|
-
commander: "^14.0.
|
|
1948
|
+
commander: "^14.0.3",
|
|
1918
1949
|
prompts: "^2.4.2",
|
|
1919
|
-
semver: "^7.7.
|
|
1950
|
+
semver: "^7.7.4"
|
|
1920
1951
|
},
|
|
1921
1952
|
devDependencies: {
|
|
1922
|
-
"@create-node-app/core": "^0.6.
|
|
1923
|
-
"@
|
|
1924
|
-
"@types/node": "^24.5.2",
|
|
1953
|
+
"@create-node-app/core": "^0.6.2",
|
|
1954
|
+
"@types/node": "^26.0.1",
|
|
1925
1955
|
"@types/prompts": "^2.4.9",
|
|
1926
1956
|
"@types/semver": "^7.5.8",
|
|
1927
1957
|
eslint: "^9.35.0",
|
|
1928
|
-
|
|
1929
|
-
|
|
1930
|
-
|
|
1931
|
-
tsup: "^8.5.0",
|
|
1932
|
-
tsx: "^4.19.0"
|
|
1958
|
+
nock: "^14.0.15",
|
|
1959
|
+
tsup: "^8.5.1",
|
|
1960
|
+
tsx: "^4.22.4"
|
|
1933
1961
|
}
|
|
1934
1962
|
};
|
|
1935
1963
|
|
|
@@ -2022,7 +2050,7 @@ var main = async () => {
|
|
|
2022
2050
|
).option(
|
|
2023
2051
|
"--addons [extensions...]",
|
|
2024
2052
|
"specify extensions to apply for the boilerplate generation"
|
|
2025
|
-
).option("--use-yarn", "use yarn instead of npm or pnpm").option("--use-pnpm", "use pnpm instead of yarn or npm").option(
|
|
2053
|
+
).option("--use-yarn", "use yarn instead of npm or pnpm or bun").option("--use-pnpm", "use pnpm instead of yarn, npm, or bun").option("--use-bun", "use bun instead of npm, yarn, or pnpm").option(
|
|
2026
2054
|
"--interactive",
|
|
2027
2055
|
"force interactive mode (default outside CI unless --no-interactive)",
|
|
2028
2056
|
void 0
|
|
@@ -2031,7 +2059,7 @@ var main = async () => {
|
|
|
2031
2059
|
"disable interactive mode (use only flags / non-interactive flow)"
|
|
2032
2060
|
).option("--list-templates", "list all available templates").option("--list-addons", "list all available addons").option(
|
|
2033
2061
|
"--set <assignments...>",
|
|
2034
|
-
"set a custom template option (format: key=value
|
|
2062
|
+
"set a custom template option (format: key=value; quote values with spaces: --set 'projectName=My App' or --set 'projectName=My App' --set 'author=Jane Doe')"
|
|
2035
2063
|
).action((providedProjectName) => {
|
|
2036
2064
|
projectName = providedProjectName || projectName;
|
|
2037
2065
|
});
|
|
@@ -2060,19 +2088,9 @@ We recommend always using the latest version of create-awesome-node-app if possi
|
|
|
2060
2088
|
});
|
|
2061
2089
|
return;
|
|
2062
2090
|
}
|
|
2063
|
-
const { useYarn, usePnpm, set, ...restOpts } = opts;
|
|
2064
|
-
const packageManager = useYarn ? "yarn" : usePnpm ? "pnpm" : "npm";
|
|
2065
|
-
const setOverrides =
|
|
2066
|
-
if (Array.isArray(set)) {
|
|
2067
|
-
for (const assignment of set) {
|
|
2068
|
-
const eqIdx = assignment.indexOf("=");
|
|
2069
|
-
if (eqIdx > 0) {
|
|
2070
|
-
setOverrides[assignment.slice(0, eqIdx).trim()] = assignment.slice(
|
|
2071
|
-
eqIdx + 1
|
|
2072
|
-
);
|
|
2073
|
-
}
|
|
2074
|
-
}
|
|
2075
|
-
}
|
|
2091
|
+
const { useYarn, usePnpm, useBun, set, ...restOpts } = opts;
|
|
2092
|
+
const packageManager = useYarn ? "yarn" : usePnpm ? "pnpm" : useBun ? "bun" : "npm";
|
|
2093
|
+
const setOverrides = parseSetOverrides(set);
|
|
2076
2094
|
const templatesOrExtensions = [restOpts.template].concat(Array.isArray(restOpts.extend) ? restOpts.extend : []).filter(Boolean).reduce((acc, templateOrExtension) => {
|
|
2077
2095
|
if (!templateOrExtension) return acc;
|
|
2078
2096
|
return acc.concat({ url: templateOrExtension });
|