create-typescript-app 1.57.4 → 1.57.6
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.
|
@@ -7,6 +7,7 @@ function getFirstMatchingArg(key) {
|
|
|
7
7
|
(arg) => arg.replaceAll("-", "") === key.toLowerCase()
|
|
8
8
|
);
|
|
9
9
|
}
|
|
10
|
+
const defaultValues = /* @__PURE__ */ new Map([["access", "public"]]);
|
|
10
11
|
function createRerunSuggestion(options) {
|
|
11
12
|
const optionsNormalized = {
|
|
12
13
|
...options,
|
|
@@ -22,16 +23,20 @@ function createRerunSuggestion(options) {
|
|
|
22
23
|
...options.logo ? {
|
|
23
24
|
logo: options.logo.src,
|
|
24
25
|
logoAlt: options.logo.alt
|
|
25
|
-
} : { logo: void 0 }
|
|
26
|
+
} : { logo: void 0 },
|
|
27
|
+
...options.offline && {
|
|
28
|
+
skipAllContributorsApi: void 0,
|
|
29
|
+
skipGitHubApi: void 0
|
|
30
|
+
}
|
|
26
31
|
};
|
|
27
32
|
const args = Object.entries(optionsNormalized).sort(
|
|
28
33
|
([a], [b]) => a === "base" ? -1 : b === "base" ? 1 : a.localeCompare(b)
|
|
29
34
|
).filter(
|
|
30
|
-
([key, value]) => getExclusions(options, optionsNormalized.base)[key] == void 0 && !!value
|
|
35
|
+
([key, value]) => getExclusions(options, optionsNormalized.base)[key] == void 0 && !!value && value !== defaultValues.get(key)
|
|
31
36
|
).map(([key, value]) => {
|
|
32
37
|
return `--${getFirstMatchingArg(key)}${stringifyValue(value)}`;
|
|
33
38
|
}).join(" ");
|
|
34
|
-
return
|
|
39
|
+
return ["npx create-typescript-app", args].filter(Boolean).join(" ");
|
|
35
40
|
}
|
|
36
41
|
function stringifyValue(value) {
|
|
37
42
|
if (Array.isArray(value)) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/create/createRerunSuggestion.ts"],"sourcesContent":["import { allArgOptions } from \"../shared/options/args.js\";\nimport {\n\tExclusionKey,\n\tgetExclusions,\n} from \"../shared/options/exclusionKeys.js\";\nimport { Options } from \"../shared/types.js\";\n\nfunction getFirstMatchingArg(key: string) {\n\treturn Object.keys(allArgOptions).find(\n\t\t(arg) => arg.replaceAll(\"-\", \"\") === key.toLowerCase(),\n\t);\n}\n\nexport function createRerunSuggestion(options: Partial<Options>): string {\n\tconst optionsNormalized = {\n\t\t...options,\n\t\temail: undefined,\n\t\t...(options.email && {\n\t\t\temailGitHub: options.email.github,\n\t\t\temailNpm: options.email.npm,\n\t\t}),\n\t\t...(options.guide\n\t\t\t? {\n\t\t\t\t\tguide: options.guide.href,\n\t\t\t\t\tguideTitle: options.guide.title,\n\t\t\t }\n\t\t\t: { guide: undefined }),\n\t\t...(options.logo\n\t\t\t? {\n\t\t\t\t\tlogo: options.logo.src,\n\t\t\t\t\tlogoAlt: options.logo.alt,\n\t\t\t }\n\t\t\t: { logo: undefined }),\n\t};\n\n\tconst args = Object.entries(optionsNormalized)\n\t\t// Sort so the base is first, then the rest are sorted alphabetically\n\t\t.sort(([a], [b]) =>\n\t\t\ta === \"base\" ? -1 : b === \"base\" ? 1 : a.localeCompare(b),\n\t\t)\n\t\t// Filter out
|
|
1
|
+
{"version":3,"sources":["../../src/create/createRerunSuggestion.ts"],"sourcesContent":["import { allArgOptions } from \"../shared/options/args.js\";\nimport {\n\tExclusionKey,\n\tgetExclusions,\n} from \"../shared/options/exclusionKeys.js\";\nimport { Options } from \"../shared/types.js\";\n\nfunction getFirstMatchingArg(key: string) {\n\treturn Object.keys(allArgOptions).find(\n\t\t(arg) => arg.replaceAll(\"-\", \"\") === key.toLowerCase(),\n\t);\n}\n\nconst defaultValues = new Map([[\"access\", \"public\"]]);\n\nexport function createRerunSuggestion(options: Partial<Options>): string {\n\tconst optionsNormalized = {\n\t\t...options,\n\t\temail: undefined,\n\t\t...(options.email && {\n\t\t\temailGitHub: options.email.github,\n\t\t\temailNpm: options.email.npm,\n\t\t}),\n\t\t...(options.guide\n\t\t\t? {\n\t\t\t\t\tguide: options.guide.href,\n\t\t\t\t\tguideTitle: options.guide.title,\n\t\t\t }\n\t\t\t: { guide: undefined }),\n\t\t...(options.logo\n\t\t\t? {\n\t\t\t\t\tlogo: options.logo.src,\n\t\t\t\t\tlogoAlt: options.logo.alt,\n\t\t\t }\n\t\t\t: { logo: undefined }),\n\t\t...(options.offline && {\n\t\t\tskipAllContributorsApi: undefined,\n\t\t\tskipGitHubApi: undefined,\n\t\t}),\n\t};\n\n\tconst args = Object.entries(optionsNormalized)\n\t\t// Sort so the base is first, then the rest are sorted alphabetically\n\t\t.sort(([a], [b]) =>\n\t\t\ta === \"base\" ? -1 : b === \"base\" ? 1 : a.localeCompare(b),\n\t\t)\n\t\t// Filter out entries with an excluded key or a default or falsy value\n\t\t.filter(\n\t\t\t([key, value]) =>\n\t\t\t\tgetExclusions(options, optionsNormalized.base)[key as ExclusionKey] ==\n\t\t\t\t\tundefined &&\n\t\t\t\t!!value &&\n\t\t\t\tvalue !== defaultValues.get(key),\n\t\t)\n\t\t.map(([key, value]) => {\n\t\t\treturn `--${getFirstMatchingArg(key)}${stringifyValue(value)}`;\n\t\t})\n\t\t.join(\" \");\n\n\treturn [\"npx create-typescript-app\", args].filter(Boolean).join(\" \");\n}\n\nfunction stringifyValue(\n\tvalue: boolean | string | string[] | undefined,\n): string {\n\tif (Array.isArray(value)) {\n\t\treturn stringifyValue(value.join(\" \"));\n\t}\n\n\tif (typeof value === \"boolean\" && value) {\n\t\treturn \"\";\n\t}\n\n\tconst valueStringified = `${value}`;\n\n\treturn valueStringified.includes(\" \")\n\t\t? ` \"${valueStringified}\"`\n\t\t: ` ${valueStringified}`;\n}\n"],"mappings":"AAAA,SAAS,qBAAqB;AAC9B;AAAA,EAEC;AAAA,OACM;AAGP,SAAS,oBAAoB,KAAa;AACzC,SAAO,OAAO,KAAK,aAAa,EAAE;AAAA,IACjC,CAAC,QAAQ,IAAI,WAAW,KAAK,EAAE,MAAM,IAAI,YAAY;AAA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AAK,GAAG,CAAC;AAAA,EACtC;AAEA,MAAI,OAAO,UAAU,aAAa,OAAO;AACxC,WAAO;AAAA,EACR;AAEA,QAAM,mBAAmB,GAAG,KAAK;AAEjC,SAAO,iBAAiB,SAAS,GAAG,IACjC,KAAK,gBAAgB,MACrB,IAAI,gBAAgB;AACxB;","names":[]}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "create-typescript-app",
|
|
3
|
-
"version": "1.57.
|
|
3
|
+
"version": "1.57.6",
|
|
4
4
|
"description": "Quickstart-friendly TypeScript template with comprehensive, configurable, opinionated tooling. 💝",
|
|
5
5
|
"repository": "JoshuaKGoldberg/create-typescript-app",
|
|
6
6
|
"license": "MIT",
|