create-typescript-app 1.48.0 → 1.49.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/lib/bin/index.js +10 -3
- package/lib/bin/index.js.map +1 -1
- package/package.json +2 -2
package/lib/bin/index.js
CHANGED
|
@@ -35,15 +35,22 @@ async function bin(args) {
|
|
|
35
35
|
short: "h",
|
|
36
36
|
type: "boolean"
|
|
37
37
|
},
|
|
38
|
-
mode: { type: "string" }
|
|
38
|
+
mode: { type: "string" },
|
|
39
|
+
version: {
|
|
40
|
+
short: "v",
|
|
41
|
+
type: "boolean"
|
|
42
|
+
}
|
|
39
43
|
},
|
|
40
44
|
strict: false
|
|
41
45
|
});
|
|
42
|
-
|
|
43
|
-
if (help) {
|
|
46
|
+
if (values.help) {
|
|
44
47
|
logHelpText([introPrompts, ...introWarnings]);
|
|
45
48
|
return 0;
|
|
46
49
|
}
|
|
50
|
+
if (values.version) {
|
|
51
|
+
console.log(version);
|
|
52
|
+
return 0;
|
|
53
|
+
}
|
|
47
54
|
prompts.intro(introPrompts);
|
|
48
55
|
logLine();
|
|
49
56
|
logLine(introWarnings[0]);
|
package/lib/bin/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/bin/index.ts"],"sourcesContent":["import * as prompts from \"@clack/prompts\";\nimport chalk from \"chalk\";\nimport { parseArgs } from \"node:util\";\nimport { fromZodError } from \"zod-validation-error\";\n\nimport { createRerunSuggestion } from \"../create/createRerunSuggestion.js\";\nimport { create } from \"../create/index.js\";\nimport { initialize } from \"../initialize/index.js\";\nimport { migrate } from \"../migrate/index.js\";\nimport { logLine } from \"../shared/cli/lines.js\";\nimport { StatusCodes } from \"../shared/codes.js\";\nimport { logHelpText } from \"./help.js\";\nimport { getVersionFromPackageJson } from \"./packageJson.js\";\nimport { promptForMode } from \"./promptForMode.js\";\n\nconst operationMessage = (verb: string) =>\n\t`Operation ${verb}. Exiting - maybe another time? 👋`;\n\nexport async function bin(args: string[]) {\n\tconsole.clear();\n\n\tconst version = await getVersionFromPackageJson();\n\n\tconst introPrompts = [\n\t\tchalk.greenBright(`✨ Welcome to`),\n\t\tchalk.bgGreenBright.black(`create-typescript-app`),\n\t\tchalk.greenBright(`${version}! ✨`),\n\t].join(\" \");\n\n\tconst introWarnings = [\n\t\tchalk.yellow(\n\t\t\t\"⚠️ This template is early stage, opinionated, and not endorsed by the TypeScript team. ⚠️\",\n\t\t),\n\t\tchalk.yellow(\n\t\t\t\"⚠️ If any tooling it sets displeases you, you can always remove that portion manually. ⚠️\",\n\t\t),\n\t];\n\n\tconst { values } = parseArgs({\n\t\targs,\n\t\toptions: {\n\t\t\thelp: {\n\t\t\t\tshort: \"h\",\n\t\t\t\ttype: \"boolean\",\n\t\t\t},\n\t\t\tmode: { type: \"string\" },\n\t\t
|
|
1
|
+
{"version":3,"sources":["../../src/bin/index.ts"],"sourcesContent":["import * as prompts from \"@clack/prompts\";\nimport chalk from \"chalk\";\nimport { parseArgs } from \"node:util\";\nimport { fromZodError } from \"zod-validation-error\";\n\nimport { createRerunSuggestion } from \"../create/createRerunSuggestion.js\";\nimport { create } from \"../create/index.js\";\nimport { initialize } from \"../initialize/index.js\";\nimport { migrate } from \"../migrate/index.js\";\nimport { logLine } from \"../shared/cli/lines.js\";\nimport { StatusCodes } from \"../shared/codes.js\";\nimport { logHelpText } from \"./help.js\";\nimport { getVersionFromPackageJson } from \"./packageJson.js\";\nimport { promptForMode } from \"./promptForMode.js\";\n\nconst operationMessage = (verb: string) =>\n\t`Operation ${verb}. Exiting - maybe another time? 👋`;\n\nexport async function bin(args: string[]) {\n\tconsole.clear();\n\n\tconst version = await getVersionFromPackageJson();\n\n\tconst introPrompts = [\n\t\tchalk.greenBright(`✨ Welcome to`),\n\t\tchalk.bgGreenBright.black(`create-typescript-app`),\n\t\tchalk.greenBright(`${version}! ✨`),\n\t].join(\" \");\n\n\tconst introWarnings = [\n\t\tchalk.yellow(\n\t\t\t\"⚠️ This template is early stage, opinionated, and not endorsed by the TypeScript team. ⚠️\",\n\t\t),\n\t\tchalk.yellow(\n\t\t\t\"⚠️ If any tooling it sets displeases you, you can always remove that portion manually. ⚠️\",\n\t\t),\n\t];\n\n\tconst { values } = parseArgs({\n\t\targs,\n\t\toptions: {\n\t\t\thelp: {\n\t\t\t\tshort: \"h\",\n\t\t\t\ttype: \"boolean\",\n\t\t\t},\n\t\t\tmode: { type: \"string\" },\n\t\t\tversion: {\n\t\t\t\tshort: \"v\",\n\t\t\t\ttype: \"boolean\",\n\t\t\t},\n\t\t},\n\t\tstrict: false,\n\t});\n\n\tif (values.help) {\n\t\tlogHelpText([introPrompts, ...introWarnings]);\n\t\treturn 0;\n\t}\n\n\tif (values.version) {\n\t\tconsole.log(version);\n\t\treturn 0;\n\t}\n\n\tprompts.intro(introPrompts);\n\n\tlogLine();\n\tlogLine(introWarnings[0]);\n\tlogLine(introWarnings[1]);\n\n\tconst { mode, options: promptedOptions } = await promptForMode(\n\t\t!!values.auto,\n\t\tvalues.mode,\n\t);\n\tif (typeof mode !== \"string\") {\n\t\tprompts.outro(chalk.red(mode?.message ?? operationMessage(\"cancelled\")));\n\t\treturn 1;\n\t}\n\n\tconst runners = { create, initialize, migrate };\n\tconst { code, error, options } = await runners[mode](args, promptedOptions);\n\n\tprompts.log.info(\n\t\t[\n\t\t\tchalk.italic(`Tip: to run again with the same input values, use:`),\n\t\t\tchalk.blue(createRerunSuggestion(options)),\n\t\t].join(\" \"),\n\t);\n\n\tif (code) {\n\t\tlogLine();\n\n\t\tif (error) {\n\t\t\tlogLine(\n\t\t\t\tchalk.red(typeof error === \"string\" ? error : fromZodError(error)),\n\t\t\t);\n\t\t\tlogLine();\n\t\t}\n\n\t\tprompts.cancel(\n\t\t\tcode === StatusCodes.Cancelled\n\t\t\t\t? operationMessage(\"cancelled\")\n\t\t\t\t: operationMessage(\"failed\"),\n\t\t);\n\t}\n\n\treturn code;\n}\n"],"mappings":"AAAA,Y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;AAAA,IAChD,CAAC,CAAC,OAAO;AAAA,IACT,OAAO;AAAA,EACR;AACA,MAAI,OAAO,SAAS,UAAU;AAC7B,YAAQ,MAAM,MAAM,IAAI,MAAM,WAAW,iBAAiB,WAAW,CAAC,CAAC;AACvE,WAAO;AAAA,EACR;AAEA,QAAM,UAAU,EAAE,QAAQ,YAAY,QAAQ;AAC9C,QAAM,EAAE,MAAM,OAAO,QAAQ,IAAI,MAAM,QAAQ,IAAI,EAAE,MAAM,eAAe;AAE1E,UAAQ,IAAI;AAAA,IACX;AAAA,MACC,MAAM,OAAO,oDAAoD;AAAA,MACjE,MAAM,KAAK,sBAAsB,OAAO,CAAC;AAAA,IAC1C,EAAE,KAAK,GAAG;AAAA,EACX;AAEA,MAAI,MAAM;AACT,YAAQ;AAER,QAAI,OAAO;AACV;AAAA,QACC,MAAM,IAAI,OAAO,UAAU,WAAW,QAAQ,aAAa,KAAK,CAAC;AAAA,MAClE;AACA,cAAQ;AAAA,IACT;AAEA,YAAQ;AAAA,MACP,SAAS,YAAY,YAClB,iBAAiB,WAAW,IAC5B,iBAAiB,QAAQ;AAAA,IAC7B;AAAA,EACD;AAEA,SAAO;AACR;","names":[]}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "create-typescript-app",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.49.0",
|
|
4
4
|
"description": "Quickstart-friendly TypeScript template with comprehensive, configurable, opinionated tooling. 💝",
|
|
5
5
|
"repository": {
|
|
6
6
|
"type": "git",
|
|
@@ -90,7 +90,7 @@
|
|
|
90
90
|
"globby": "^14.0.0",
|
|
91
91
|
"husky": "^8.0.3",
|
|
92
92
|
"jsonc-eslint-parser": "^2.3.0",
|
|
93
|
-
"knip": "3.
|
|
93
|
+
"knip": "3.3.0",
|
|
94
94
|
"lint-staged": "^15.0.0",
|
|
95
95
|
"markdownlint": "^0.32.0",
|
|
96
96
|
"markdownlint-cli": "^0.37.0",
|