create-typescript-app 1.29.38 → 1.29.40
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 +8 -1
- package/lib/bin/index.js.map +1 -1
- package/lib/bin/mode.d.ts +2 -0
- package/lib/bin/mode.js.map +1 -1
- package/lib/create/createRerunSuggestion.d.ts +1 -0
- package/lib/create/createWithOptions.d.ts +1 -0
- package/lib/create/index.d.ts +1 -0
- package/lib/create/index.js +2 -1
- package/lib/create/index.js.map +1 -1
- package/lib/initialize/index.d.ts +1 -0
- package/lib/initialize/index.js +2 -1
- package/lib/initialize/index.js.map +1 -1
- package/lib/initialize/initializeWithOptions.d.ts +1 -0
- package/lib/migrate/index.d.ts +1 -0
- package/lib/migrate/index.js +2 -1
- package/lib/migrate/index.js.map +1 -1
- package/lib/migrate/migrateWithOptions.d.ts +1 -0
- package/lib/shared/options/augmentOptionsWithExcludes.js.map +1 -1
- package/lib/shared/options/readOptions.d.ts +3 -1
- package/lib/shared/options/readOptions.js +45 -3
- package/lib/shared/options/readOptions.js.map +1 -1
- package/lib/shared/types.d.ts +22 -22
- package/lib/steps/uninstallPackages.js +3 -1
- package/lib/steps/uninstallPackages.js.map +1 -1
- package/lib/steps/writing/creation/dotGitHub/createWorkflowFile.js +1 -1
- package/lib/steps/writing/creation/dotGitHub/createWorkflowFile.js.map +1 -1
- package/lib/steps/writing/creation/dotGitHub/workflows.js +4 -4
- package/lib/steps/writing/creation/dotGitHub/workflows.js.map +1 -1
- package/package.json +7 -5
package/lib/bin/index.js
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import * as prompts from "@clack/prompts";
|
|
2
2
|
import chalk from "chalk";
|
|
3
3
|
import { parseArgs } from "node:util";
|
|
4
|
+
import { fromZodError } from "zod-validation-error";
|
|
4
5
|
import { createRerunSuggestion } from "../create/createRerunSuggestion.js";
|
|
5
6
|
import { create } from "../create/index.js";
|
|
6
7
|
import { initialize } from "../initialize/index.js";
|
|
@@ -41,7 +42,8 @@ async function bin(args) {
|
|
|
41
42
|
prompts.outro(chalk.red(mode?.message ?? operationMessage("cancelled")));
|
|
42
43
|
return 1;
|
|
43
44
|
}
|
|
44
|
-
const
|
|
45
|
+
const runners = { create, initialize, migrate };
|
|
46
|
+
const { code, options, zodError } = await runners[mode](args);
|
|
45
47
|
prompts.log.info(
|
|
46
48
|
[
|
|
47
49
|
chalk.italic(`Tip: to run again with the same input values, use:`),
|
|
@@ -50,6 +52,11 @@ async function bin(args) {
|
|
|
50
52
|
);
|
|
51
53
|
if (code) {
|
|
52
54
|
logLine();
|
|
55
|
+
if (zodError) {
|
|
56
|
+
const validationError = fromZodError(zodError);
|
|
57
|
+
logLine(chalk.red(validationError));
|
|
58
|
+
logLine();
|
|
59
|
+
}
|
|
53
60
|
prompts.cancel(
|
|
54
61
|
code === StatusCodes.Cancelled ? operationMessage("cancelled") : operationMessage("failed")
|
|
55
62
|
);
|
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\";\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 { promptForMode } from \"./mode.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\tprompts.intro(\n\t\t[\n\t\t\tchalk.greenBright(`Welcome to`),\n\t\t\tchalk.bgGreenBright.black(`create-typescript-app`),\n\t\t\tchalk.greenBright(`! 🎉`),\n\t\t].join(\" \"),\n\t);\n\n\tlogLine();\n\tlogLine(\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);\n\tlogLine(\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\tmode: { type: \"string\" },\n\t\t},\n\t\tstrict: false,\n\t});\n\n\tconst mode = await promptForMode(values.mode);\n\tif (typeof mode !== \"string\") {\n\t\tprompts.outro(chalk.red(mode?.message ?? operationMessage(\"cancelled\")));\n\t\treturn 1;\n\t}\n\n\tconst {
|
|
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 { promptForMode } from \"./mode.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\tprompts.intro(\n\t\t[\n\t\t\tchalk.greenBright(`Welcome to`),\n\t\t\tchalk.bgGreenBright.black(`create-typescript-app`),\n\t\t\tchalk.greenBright(`! 🎉`),\n\t\t].join(\" \"),\n\t);\n\n\tlogLine();\n\tlogLine(\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);\n\tlogLine(\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\tmode: { type: \"string\" },\n\t\t},\n\t\tstrict: false,\n\t});\n\n\tconst mode = await promptForMode(values.mode);\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, options, zodError } = await runners[mode](args);\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(mode, options)),\n\t\t].join(\" \"),\n\t);\n\n\tif (code) {\n\t\tlogLine();\n\n\t\tif (zodError) {\n\t\t\tconst validationError = fromZodError(zodError);\n\t\t\tlogLine(chalk.red(validationError));\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,YAAY,aAAa;AACzB,OAAO,WAAW;AAClB,SAAS,iBAAiB;AAC1B,SAAS,oBAAoB;AAE7B,SAAS,6BAA6B;AACtC,SAAS,cAAc;AACvB,SAAS,kBAAkB;AAC3B,SAAS,eAAe;AACxB,SAAS,eAAe;AACxB,SAAS,mBAAmB;AAC5B,SAAS,qBAAqB;AAE9B,MAAM,mBAAmB,CAAC,SACzB,aAAa,IAAI;AAElB,eAAsB,IAAI,MAAgB;AACzC,UAAQ,MAAM;AAEd,UAAQ;AAAA,IACP;AAAA,MACC,MAAM,YAAY,YAAY;AAAA,MAC9B,MAAM,cAAc,MAAM,uBAAuB;AAAA,MACjD,MAAM,YAAY,aAAM;AAAA,IACzB,EAAE,KAAK,GAAG;AAAA,EACX;AAEA,UAAQ;AACR;AAAA,IACC,MAAM;AAAA,MACL;AAAA,IACD;AAAA,EACD;AACA;AAAA,IACC,MAAM;AAAA,MACL;AAAA,IACD;AAAA,EACD;AAEA,QAAM,EAAE,OAAO,IAAI,UAAU;AAAA,IAC5B;AAAA,IACA,SAAS;AAAA,MACR,MAAM,EAAE,MAAM,SAAS;AAAA,IACxB;AAAA,IACA,QAAQ;AAAA,EACT,CAAC;AAED,QAAM,OAAO,MAAM,cAAc,OAAO,IAAI;AAC5C,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,SAAS,SAAS,IAAI,MAAM,QAAQ,IAAI,EAAE,IAAI;AAE5D,UAAQ,IAAI;AAAA,IACX;AAAA,MACC,MAAM,OAAO,oDAAoD;AAAA,MACjE,MAAM,KAAK,sBAAsB,MAAM,OAAO,CAAC;AAAA,IAChD,EAAE,KAAK,GAAG;AAAA,EACX;AAEA,MAAI,MAAM;AACT,YAAQ;AAER,QAAI,UAAU;AACb,YAAM,kBAAkB,aAAa,QAAQ;AAC7C,cAAQ,MAAM,IAAI,eAAe,CAAC;AAClC,cAAQ;AAAA,IACT;AAEA,YAAQ;AAAA,MACP,SAAS,YAAY,YAClB,iBAAiB,WAAW,IAC5B,iBAAiB,QAAQ;AAAA,IAC7B;AAAA,EACD;AAEA,SAAO;AACR;","names":[]}
|
package/lib/bin/mode.d.ts
CHANGED
|
@@ -1,9 +1,11 @@
|
|
|
1
|
+
import z from 'zod';
|
|
1
2
|
import { StatusCode } from '../shared/codes.js';
|
|
2
3
|
import { Options } from '../shared/types.js';
|
|
3
4
|
|
|
4
5
|
interface ModeResult {
|
|
5
6
|
code: StatusCode;
|
|
6
7
|
options: Partial<Options>;
|
|
8
|
+
zodError?: z.ZodError<object>;
|
|
7
9
|
}
|
|
8
10
|
type ModeRunner = (args: string[]) => Promise<ModeResult>;
|
|
9
11
|
type Mode = "create" | "initialize" | "migrate";
|
package/lib/bin/mode.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/bin/mode.ts"],"sourcesContent":["import * as prompts from \"@clack/prompts\";\nimport chalk from \"chalk\";\n\nimport { StatusCode } from \"../shared/codes.js\";\nimport { filterPromptCancel } from \"../shared/prompts.js\";\nimport { Options } from \"../shared/types.js\";\n\nexport interface ModeResult {\n\tcode: StatusCode;\n\toptions: Partial<Options>;\n}\n\nexport type ModeRunner = (args: string[]) => Promise<ModeResult>;\n\nexport type Mode = \"create\" | \"initialize\" | \"migrate\";\n\nconst allowedModes = [\"create\", \"initialize\", \"migrate\"] satisfies Mode[];\n\nfunction isMode(input: boolean | string): input is Mode {\n\treturn allowedModes.includes(input as Mode);\n}\n\nexport async function promptForMode(input: boolean | string | undefined) {\n\tif (input) {\n\t\tif (!isMode(input)) {\n\t\t\treturn new Error(\n\t\t\t\t`Unknown --mode: ${input}. Allowed modes are: ${allowedModes.join(\n\t\t\t\t\t\", \",\n\t\t\t\t)}.`,\n\t\t\t);\n\t\t}\n\n\t\treturn input;\n\t}\n\n\tconst label = (base: string, text: string) => `${chalk.bold(base)} ${text}`;\n\n\tconst selection = filterPromptCancel(\n\t\t(await prompts.select({\n\t\t\tmessage: chalk.blue(\"How would you like to use the template?\"),\n\t\t\toptions: [\n\t\t\t\t{\n\t\t\t\t\tlabel: label(\"create\", \"a new repository in a child directory\"),\n\t\t\t\t\tvalue: \"create\",\n\t\t\t\t},\n\t\t\t\t{\n\t\t\t\t\tlabel: label(\n\t\t\t\t\t\t\"initialize\",\n\t\t\t\t\t\t\"a freshly repository in the current directory\",\n\t\t\t\t\t),\n\t\t\t\t\tvalue: \"initialize\",\n\t\t\t\t},\n\t\t\t\t{\n\t\t\t\t\tlabel: label(\n\t\t\t\t\t\t\"migrate\",\n\t\t\t\t\t\t\"an existing repository in the current directory\",\n\t\t\t\t\t),\n\t\t\t\t\tvalue: \"migrate\",\n\t\t\t\t},\n\t\t\t],\n\t\t})) as Mode | symbol,\n\t);\n\n\treturn selection;\n}\n"],"mappings":"AAAA,YAAY,aAAa;AACzB,OAAO,WAAW;
|
|
1
|
+
{"version":3,"sources":["../../src/bin/mode.ts"],"sourcesContent":["import * as prompts from \"@clack/prompts\";\nimport chalk from \"chalk\";\nimport z from \"zod\";\n\nimport { StatusCode } from \"../shared/codes.js\";\nimport { filterPromptCancel } from \"../shared/prompts.js\";\nimport { Options } from \"../shared/types.js\";\n\nexport interface ModeResult {\n\tcode: StatusCode;\n\toptions: Partial<Options>;\n\tzodError?: z.ZodError<object>;\n}\n\nexport type ModeRunner = (args: string[]) => Promise<ModeResult>;\n\nexport type Mode = \"create\" | \"initialize\" | \"migrate\";\n\nconst allowedModes = [\"create\", \"initialize\", \"migrate\"] satisfies Mode[];\n\nfunction isMode(input: boolean | string): input is Mode {\n\treturn allowedModes.includes(input as Mode);\n}\n\nexport async function promptForMode(input: boolean | string | undefined) {\n\tif (input) {\n\t\tif (!isMode(input)) {\n\t\t\treturn new Error(\n\t\t\t\t`Unknown --mode: ${input}. Allowed modes are: ${allowedModes.join(\n\t\t\t\t\t\", \",\n\t\t\t\t)}.`,\n\t\t\t);\n\t\t}\n\n\t\treturn input;\n\t}\n\n\tconst label = (base: string, text: string) => `${chalk.bold(base)} ${text}`;\n\n\tconst selection = filterPromptCancel(\n\t\t(await prompts.select({\n\t\t\tmessage: chalk.blue(\"How would you like to use the template?\"),\n\t\t\toptions: [\n\t\t\t\t{\n\t\t\t\t\tlabel: label(\"create\", \"a new repository in a child directory\"),\n\t\t\t\t\tvalue: \"create\",\n\t\t\t\t},\n\t\t\t\t{\n\t\t\t\t\tlabel: label(\n\t\t\t\t\t\t\"initialize\",\n\t\t\t\t\t\t\"a freshly repository in the current directory\",\n\t\t\t\t\t),\n\t\t\t\t\tvalue: \"initialize\",\n\t\t\t\t},\n\t\t\t\t{\n\t\t\t\t\tlabel: label(\n\t\t\t\t\t\t\"migrate\",\n\t\t\t\t\t\t\"an existing repository in the current directory\",\n\t\t\t\t\t),\n\t\t\t\t\tvalue: \"migrate\",\n\t\t\t\t},\n\t\t\t],\n\t\t})) as Mode | symbol,\n\t);\n\n\treturn selection;\n}\n"],"mappings":"AAAA,YAAY,aAAa;AACzB,OAAO,WAAW;AAIlB,SAAS,0BAA0B;AAanC,MAAM,eAAe,CAAC,UAAU,cAAc,SAAS;AAEvD,SAAS,OAAO,OAAwC;AACvD,SAAO,aAAa,SAAS,KAAa;AAC3C;AAEA,eAAsB,cAAc,OAAqC;AACxE,MAAI,OAAO;AACV,QAAI,CAAC,OAAO,KAAK,GAAG;AACnB,aAAO,IAAI;AAAA,QACV,mBAAmB,KAAK,wBAAwB,aAAa;AAAA,UAC5D;AAAA,QACD,CAAC;AAAA,MACF;AAAA,IACD;AAEA,WAAO;AAAA,EACR;AAEA,QAAM,QAAQ,CAAC,MAAc,SAAiB,GAAG,MAAM,KAAK,IAAI,CAAC,IAAI,IAAI;AAEzE,QAAM,YAAY;AAAA,IAChB,MAAM,QAAQ,OAAO;AAAA,MACrB,SAAS,MAAM,KAAK,yCAAyC;AAAA,MAC7D,SAAS;AAAA,QACR;AAAA,UACC,OAAO,MAAM,UAAU,uCAAuC;AAAA,UAC9D,OAAO;AAAA,QACR;AAAA,QACA;AAAA,UACC,OAAO;AAAA,YACN;AAAA,YACA;AAAA,UACD;AAAA,UACA,OAAO;AAAA,QACR;AAAA,QACA;AAAA,UACC,OAAO;AAAA,YACN;AAAA,YACA;AAAA,UACD;AAAA,UACA,OAAO;AAAA,QACR;AAAA,MACD;AAAA,IACD,CAAC;AAAA,EACF;AAEA,SAAO;AACR;","names":[]}
|
package/lib/create/index.d.ts
CHANGED
package/lib/create/index.js
CHANGED
|
@@ -12,7 +12,8 @@ async function create(args) {
|
|
|
12
12
|
if (inputs.cancelled) {
|
|
13
13
|
return {
|
|
14
14
|
code: StatusCodes.Cancelled,
|
|
15
|
-
options: inputs.options
|
|
15
|
+
options: inputs.options,
|
|
16
|
+
zodError: inputs.zodError
|
|
16
17
|
};
|
|
17
18
|
}
|
|
18
19
|
const wat = await createAndEnterRepository(inputs.options.repository);
|
package/lib/create/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/create/index.ts"],"sourcesContent":["import * as prompts from \"@clack/prompts\";\nimport chalk from \"chalk\";\n\nimport { ModeResult } from \"../bin/mode.js\";\nimport { outro } from \"../shared/cli/outro.js\";\nimport { StatusCodes } from \"../shared/codes.js\";\nimport { readOptions } from \"../shared/options/readOptions.js\";\nimport { runOrRestore } from \"../shared/runOrRestore.js\";\nimport { createAndEnterRepository } from \"./createAndEnterRepository.js\";\nimport { createRerunSuggestion } from \"./createRerunSuggestion.js\";\nimport { createWithOptions } from \"./createWithOptions.js\";\n\nexport async function create(args: string[]): Promise<ModeResult> {\n\tconst inputs = await readOptions(args);\n\tif (inputs.cancelled) {\n\t\treturn {\n\t\t\tcode: StatusCodes.Cancelled,\n\t\t\toptions: inputs.options,\n\t\t};\n\t}\n\n\tconst wat = await createAndEnterRepository(inputs.options.repository);\n\tif (!wat) {\n\t\tprompts.outro(\n\t\t\tchalk.red(\n\t\t\t\t`The ${inputs.options.repository} directory already exists. Please remove the directory or try a different name.`,\n\t\t\t),\n\t\t);\n\t\treturn { code: StatusCodes.Failure, options: inputs.options };\n\t}\n\n\treturn {\n\t\tcode: await runOrRestore({\n\t\t\trun: async () => {\n\t\t\t\tconst { sentToGitHub } = await createWithOptions(inputs);\n\n\t\t\t\toutro(\n\t\t\t\t\tsentToGitHub\n\t\t\t\t\t\t? [\n\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\tlabel:\n\t\t\t\t\t\t\t\t\t\t\"Now all you have to do is populate the repository's ACCESS_TOKEN and NPM_TOKEN secrets, and enable the Codecov and Renovate GitHub apps.\",\n\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t ]\n\t\t\t\t\t\t: [\n\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\tlabel:\n\t\t\t\t\t\t\t\t\t\t\"Consider creating a GitHub repository from the new directory:\",\n\t\t\t\t\t\t\t\t\tlines: [\n\t\t\t\t\t\t\t\t\t\t`cd ${inputs.options.repository}`,\n\t\t\t\t\t\t\t\t\t\tcreateRerunSuggestion(\"initialize\", {\n\t\t\t\t\t\t\t\t\t\t\t...inputs.options,\n\t\t\t\t\t\t\t\t\t\t\tskipGitHubApi: false,\n\t\t\t\t\t\t\t\t\t\t\tskipInstall: false,\n\t\t\t\t\t\t\t\t\t\t}),\n\t\t\t\t\t\t\t\t\t\t`git add -A`,\n\t\t\t\t\t\t\t\t\t\t`git commit -m \"feat: initial commit ✨\"`,\n\t\t\t\t\t\t\t\t\t\t`git push -u origin main`,\n\t\t\t\t\t\t\t\t\t],\n\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\tlabel:\n\t\t\t\t\t\t\t\t\t\t\"If you do, be sure to populate its ACCESS_TOKEN and NPM_TOKEN secrets, and enable the Codecov and Renovate GitHub apps.\",\n\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t ],\n\t\t\t\t);\n\t\t\t},\n\t\t\tskipRestore: inputs.options.skipRestore,\n\t\t}),\n\t\toptions: inputs.options,\n\t};\n}\n"],"mappings":"AAAA,YAAY,aAAa;AACzB,OAAO,WAAW;AAGlB,SAAS,aAAa;AACtB,SAAS,mBAAmB;AAC5B,SAAS,mBAAmB;AAC5B,SAAS,oBAAoB;AAC7B,SAAS,gCAAgC;AACzC,SAAS,6BAA6B;AACtC,SAAS,yBAAyB;AAElC,eAAsB,OAAO,MAAqC;AACjE,QAAM,SAAS,MAAM,YAAY,IAAI;AACrC,MAAI,OAAO,WAAW;AACrB,WAAO;AAAA,MACN,MAAM,YAAY;AAAA,MAClB,SAAS,OAAO;AAAA,
|
|
1
|
+
{"version":3,"sources":["../../src/create/index.ts"],"sourcesContent":["import * as prompts from \"@clack/prompts\";\nimport chalk from \"chalk\";\n\nimport { ModeResult } from \"../bin/mode.js\";\nimport { outro } from \"../shared/cli/outro.js\";\nimport { StatusCodes } from \"../shared/codes.js\";\nimport { readOptions } from \"../shared/options/readOptions.js\";\nimport { runOrRestore } from \"../shared/runOrRestore.js\";\nimport { createAndEnterRepository } from \"./createAndEnterRepository.js\";\nimport { createRerunSuggestion } from \"./createRerunSuggestion.js\";\nimport { createWithOptions } from \"./createWithOptions.js\";\n\nexport async function create(args: string[]): Promise<ModeResult> {\n\tconst inputs = await readOptions(args);\n\tif (inputs.cancelled) {\n\t\treturn {\n\t\t\tcode: StatusCodes.Cancelled,\n\t\t\toptions: inputs.options,\n\t\t\tzodError: inputs.zodError,\n\t\t};\n\t}\n\n\tconst wat = await createAndEnterRepository(inputs.options.repository);\n\tif (!wat) {\n\t\tprompts.outro(\n\t\t\tchalk.red(\n\t\t\t\t`The ${inputs.options.repository} directory already exists. Please remove the directory or try a different name.`,\n\t\t\t),\n\t\t);\n\t\treturn { code: StatusCodes.Failure, options: inputs.options };\n\t}\n\n\treturn {\n\t\tcode: await runOrRestore({\n\t\t\trun: async () => {\n\t\t\t\tconst { sentToGitHub } = await createWithOptions(inputs);\n\n\t\t\t\toutro(\n\t\t\t\t\tsentToGitHub\n\t\t\t\t\t\t? [\n\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\tlabel:\n\t\t\t\t\t\t\t\t\t\t\"Now all you have to do is populate the repository's ACCESS_TOKEN and NPM_TOKEN secrets, and enable the Codecov and Renovate GitHub apps.\",\n\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t ]\n\t\t\t\t\t\t: [\n\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\tlabel:\n\t\t\t\t\t\t\t\t\t\t\"Consider creating a GitHub repository from the new directory:\",\n\t\t\t\t\t\t\t\t\tlines: [\n\t\t\t\t\t\t\t\t\t\t`cd ${inputs.options.repository}`,\n\t\t\t\t\t\t\t\t\t\tcreateRerunSuggestion(\"initialize\", {\n\t\t\t\t\t\t\t\t\t\t\t...inputs.options,\n\t\t\t\t\t\t\t\t\t\t\tskipGitHubApi: false,\n\t\t\t\t\t\t\t\t\t\t\tskipInstall: false,\n\t\t\t\t\t\t\t\t\t\t}),\n\t\t\t\t\t\t\t\t\t\t`git add -A`,\n\t\t\t\t\t\t\t\t\t\t`git commit -m \"feat: initial commit ✨\"`,\n\t\t\t\t\t\t\t\t\t\t`git push -u origin main`,\n\t\t\t\t\t\t\t\t\t],\n\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\tlabel:\n\t\t\t\t\t\t\t\t\t\t\"If you do, be sure to populate its ACCESS_TOKEN and NPM_TOKEN secrets, and enable the Codecov and Renovate GitHub apps.\",\n\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t ],\n\t\t\t\t);\n\t\t\t},\n\t\t\tskipRestore: inputs.options.skipRestore,\n\t\t}),\n\t\toptions: inputs.options,\n\t};\n}\n"],"mappings":"AAAA,YAAY,aAAa;AACzB,OAAO,WAAW;AAGlB,SAAS,aAAa;AACtB,SAAS,mBAAmB;AAC5B,SAAS,mBAAmB;AAC5B,SAAS,oBAAoB;AAC7B,SAAS,gCAAgC;AACzC,SAAS,6BAA6B;AACtC,SAAS,yBAAyB;AAElC,eAAsB,OAAO,MAAqC;AACjE,QAAM,SAAS,MAAM,YAAY,IAAI;AACrC,MAAI,OAAO,WAAW;AACrB,WAAO;AAAA,MACN,MAAM,YAAY;AAAA,MAClB,SAAS,OAAO;AAAA,MAChB,UAAU,OAAO;AAAA,IAClB;AAAA,EACD;AAEA,QAAM,MAAM,MAAM,yBAAyB,OAAO,QAAQ,UAAU;AACpE,MAAI,CAAC,KAAK;AACT,YAAQ;AAAA,MACP,MAAM;AAAA,QACL,OAAO,OAAO,QAAQ,UAAU;AAAA,MACjC;AAAA,IACD;AACA,WAAO,EAAE,MAAM,YAAY,SAAS,SAAS,OAAO,QAAQ;AAAA,EAC7D;AAEA,SAAO;AAAA,IACN,MAAM,MAAM,aAAa;AAAA,MACxB,KAAK,YAAY;AAChB,cAAM,EAAE,aAAa,IAAI,MAAM,kBAAkB,MAAM;AAEvD;AAAA,UACC,eACG;AAAA,YACA;AAAA,cACC,OACC;AAAA,YACF;AAAA,UACA,IACA;AAAA,YACA;AAAA,cACC,OACC;AAAA,cACD,OAAO;AAAA,gBACN,MAAM,OAAO,QAAQ,UAAU;AAAA,gBAC/B,sBAAsB,cAAc;AAAA,kBACnC,GAAG,OAAO;AAAA,kBACV,eAAe;AAAA,kBACf,aAAa;AAAA,gBACd,CAAC;AAAA,gBACD;AAAA,gBACA;AAAA,gBACA;AAAA,cACD;AAAA,YACD;AAAA,YACA;AAAA,cACC,OACC;AAAA,YACF;AAAA,UACA;AAAA,QACJ;AAAA,MACD;AAAA,MACA,aAAa,OAAO,QAAQ;AAAA,IAC7B,CAAC;AAAA,IACD,SAAS,OAAO;AAAA,EACjB;AACD;","names":[]}
|
package/lib/initialize/index.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/initialize/index.ts"],"sourcesContent":["import { ModeRunner } from \"../bin/mode.js\";\nimport { outro } from \"../shared/cli/outro.js\";\nimport { StatusCodes } from \"../shared/codes.js\";\nimport { ensureGitRepository } from \"../shared/ensureGitRepository.js\";\nimport { readOptions } from \"../shared/options/readOptions.js\";\nimport { runOrRestore } from \"../shared/runOrRestore.js\";\nimport { initializeWithOptions } from \"./initializeWithOptions.js\";\n\nexport const initialize: ModeRunner = async (args) => {\n\tconst inputs = await readOptions(args);\n\tif (inputs.cancelled) {\n\t\treturn {\n\t\t\tcode: StatusCodes.Cancelled,\n\t\t\toptions: inputs.options,\n\t\t};\n\t}\n\n\tawait ensureGitRepository();\n\n\treturn {\n\t\tcode: await runOrRestore({\n\t\t\trun: async () => {\n\t\t\t\tawait initializeWithOptions(inputs);\n\n\t\t\t\toutro([\n\t\t\t\t\t{\n\t\t\t\t\t\tlabel: \"You may consider committing these changes:\",\n\t\t\t\t\t\tlines: [\n\t\t\t\t\t\t\t`git add -A`,\n\t\t\t\t\t\t\t`git commit -m \"feat: initialized repo ✨`,\n\t\t\t\t\t\t\t`git push`,\n\t\t\t\t\t\t],\n\t\t\t\t\t},\n\t\t\t\t\t{\n\t\t\t\t\t\tlabel:\n\t\t\t\t\t\t\t\"Otherwise, all you have to do is populate the repository's ACCESS_TOKEN and NPM_TOKEN secrets, and enable the Codecov and Renovate GitHub apps.\",\n\t\t\t\t\t},\n\t\t\t\t]);\n\t\t\t},\n\t\t\tskipRestore: inputs.options.skipRestore,\n\t\t}),\n\t\toptions: inputs.options,\n\t};\n};\n"],"mappings":"AACA,SAAS,aAAa;AACtB,SAAS,mBAAmB;AAC5B,SAAS,2BAA2B;AACpC,SAAS,mBAAmB;AAC5B,SAAS,oBAAoB;AAC7B,SAAS,6BAA6B;AAE/B,MAAM,aAAyB,OAAO,SAAS;AACrD,QAAM,SAAS,MAAM,YAAY,IAAI;AACrC,MAAI,OAAO,WAAW;AACrB,WAAO;AAAA,MACN,MAAM,YAAY;AAAA,MAClB,SAAS,OAAO;AAAA,
|
|
1
|
+
{"version":3,"sources":["../../src/initialize/index.ts"],"sourcesContent":["import { ModeRunner } from \"../bin/mode.js\";\nimport { outro } from \"../shared/cli/outro.js\";\nimport { StatusCodes } from \"../shared/codes.js\";\nimport { ensureGitRepository } from \"../shared/ensureGitRepository.js\";\nimport { readOptions } from \"../shared/options/readOptions.js\";\nimport { runOrRestore } from \"../shared/runOrRestore.js\";\nimport { initializeWithOptions } from \"./initializeWithOptions.js\";\n\nexport const initialize: ModeRunner = async (args) => {\n\tconst inputs = await readOptions(args);\n\tif (inputs.cancelled) {\n\t\treturn {\n\t\t\tcode: StatusCodes.Cancelled,\n\t\t\toptions: inputs.options,\n\t\t\tzodError: inputs.zodError,\n\t\t};\n\t}\n\n\tawait ensureGitRepository();\n\n\treturn {\n\t\tcode: await runOrRestore({\n\t\t\trun: async () => {\n\t\t\t\tawait initializeWithOptions(inputs);\n\n\t\t\t\toutro([\n\t\t\t\t\t{\n\t\t\t\t\t\tlabel: \"You may consider committing these changes:\",\n\t\t\t\t\t\tlines: [\n\t\t\t\t\t\t\t`git add -A`,\n\t\t\t\t\t\t\t`git commit -m \"feat: initialized repo ✨`,\n\t\t\t\t\t\t\t`git push`,\n\t\t\t\t\t\t],\n\t\t\t\t\t},\n\t\t\t\t\t{\n\t\t\t\t\t\tlabel:\n\t\t\t\t\t\t\t\"Otherwise, all you have to do is populate the repository's ACCESS_TOKEN and NPM_TOKEN secrets, and enable the Codecov and Renovate GitHub apps.\",\n\t\t\t\t\t},\n\t\t\t\t]);\n\t\t\t},\n\t\t\tskipRestore: inputs.options.skipRestore,\n\t\t}),\n\t\toptions: inputs.options,\n\t};\n};\n"],"mappings":"AACA,SAAS,aAAa;AACtB,SAAS,mBAAmB;AAC5B,SAAS,2BAA2B;AACpC,SAAS,mBAAmB;AAC5B,SAAS,oBAAoB;AAC7B,SAAS,6BAA6B;AAE/B,MAAM,aAAyB,OAAO,SAAS;AACrD,QAAM,SAAS,MAAM,YAAY,IAAI;AACrC,MAAI,OAAO,WAAW;AACrB,WAAO;AAAA,MACN,MAAM,YAAY;AAAA,MAClB,SAAS,OAAO;AAAA,MAChB,UAAU,OAAO;AAAA,IAClB;AAAA,EACD;AAEA,QAAM,oBAAoB;AAE1B,SAAO;AAAA,IACN,MAAM,MAAM,aAAa;AAAA,MACxB,KAAK,YAAY;AAChB,cAAM,sBAAsB,MAAM;AAElC,cAAM;AAAA,UACL;AAAA,YACC,OAAO;AAAA,YACP,OAAO;AAAA,cACN;AAAA,cACA;AAAA,cACA;AAAA,YACD;AAAA,UACD;AAAA,UACA;AAAA,YACC,OACC;AAAA,UACF;AAAA,QACD,CAAC;AAAA,MACF;AAAA,MACA,aAAa,OAAO,QAAQ;AAAA,IAC7B,CAAC;AAAA,IACD,SAAS,OAAO;AAAA,EACjB;AACD;","names":[]}
|
package/lib/migrate/index.d.ts
CHANGED
package/lib/migrate/index.js
CHANGED
package/lib/migrate/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/migrate/index.ts"],"sourcesContent":["import { ModeRunner } from \"../bin/mode.js\";\nimport { outro } from \"../shared/cli/outro.js\";\nimport { StatusCodes } from \"../shared/codes.js\";\nimport { ensureGitRepository } from \"../shared/ensureGitRepository.js\";\nimport { readOptions } from \"../shared/options/readOptions.js\";\nimport { runOrRestore } from \"../shared/runOrRestore.js\";\nimport { migrateWithOptions } from \"./migrateWithOptions.js\";\n\nexport const migrate: ModeRunner = async (args) => {\n\tconst inputs = await readOptions(args);\n\tif (inputs.cancelled) {\n\t\treturn {\n\t\t\tcode: StatusCodes.Cancelled,\n\t\t\toptions: inputs.options,\n\t\t};\n\t}\n\n\tawait ensureGitRepository();\n\n\treturn {\n\t\tcode: await runOrRestore({\n\t\t\trun: async () => {\n\t\t\t\tawait migrateWithOptions(inputs);\n\n\t\t\t\toutro([\n\t\t\t\t\t{\n\t\t\t\t\t\tlabel: \"You may consider committing these changes:\",\n\t\t\t\t\t\tlines: [\n\t\t\t\t\t\t\t`git add -A`,\n\t\t\t\t\t\t\t`git commit -m \"migrated repo to create-typescript-app ✨`,\n\t\t\t\t\t\t\t`git push`,\n\t\t\t\t\t\t],\n\t\t\t\t\t},\n\t\t\t\t]);\n\t\t\t},\n\t\t\tskipRestore: inputs.options.skipRestore,\n\t\t}),\n\t\toptions: inputs.options,\n\t};\n};\n"],"mappings":"AACA,SAAS,aAAa;AACtB,SAAS,mBAAmB;AAC5B,SAAS,2BAA2B;AACpC,SAAS,mBAAmB;AAC5B,SAAS,oBAAoB;AAC7B,SAAS,0BAA0B;AAE5B,MAAM,UAAsB,OAAO,SAAS;AAClD,QAAM,SAAS,MAAM,YAAY,IAAI;AACrC,MAAI,OAAO,WAAW;AACrB,WAAO;AAAA,MACN,MAAM,YAAY;AAAA,MAClB,SAAS,OAAO;AAAA,
|
|
1
|
+
{"version":3,"sources":["../../src/migrate/index.ts"],"sourcesContent":["import { ModeRunner } from \"../bin/mode.js\";\nimport { outro } from \"../shared/cli/outro.js\";\nimport { StatusCodes } from \"../shared/codes.js\";\nimport { ensureGitRepository } from \"../shared/ensureGitRepository.js\";\nimport { readOptions } from \"../shared/options/readOptions.js\";\nimport { runOrRestore } from \"../shared/runOrRestore.js\";\nimport { migrateWithOptions } from \"./migrateWithOptions.js\";\n\nexport const migrate: ModeRunner = async (args) => {\n\tconst inputs = await readOptions(args);\n\tif (inputs.cancelled) {\n\t\treturn {\n\t\t\tcode: StatusCodes.Cancelled,\n\t\t\toptions: inputs.options,\n\t\t\tzodError: inputs.zodError,\n\t\t};\n\t}\n\n\tawait ensureGitRepository();\n\n\treturn {\n\t\tcode: await runOrRestore({\n\t\t\trun: async () => {\n\t\t\t\tawait migrateWithOptions(inputs);\n\n\t\t\t\toutro([\n\t\t\t\t\t{\n\t\t\t\t\t\tlabel: \"You may consider committing these changes:\",\n\t\t\t\t\t\tlines: [\n\t\t\t\t\t\t\t`git add -A`,\n\t\t\t\t\t\t\t`git commit -m \"migrated repo to create-typescript-app ✨`,\n\t\t\t\t\t\t\t`git push`,\n\t\t\t\t\t\t],\n\t\t\t\t\t},\n\t\t\t\t]);\n\t\t\t},\n\t\t\tskipRestore: inputs.options.skipRestore,\n\t\t}),\n\t\toptions: inputs.options,\n\t};\n};\n"],"mappings":"AACA,SAAS,aAAa;AACtB,SAAS,mBAAmB;AAC5B,SAAS,2BAA2B;AACpC,SAAS,mBAAmB;AAC5B,SAAS,oBAAoB;AAC7B,SAAS,0BAA0B;AAE5B,MAAM,UAAsB,OAAO,SAAS;AAClD,QAAM,SAAS,MAAM,YAAY,IAAI;AACrC,MAAI,OAAO,WAAW;AACrB,WAAO;AAAA,MACN,MAAM,YAAY;AAAA,MAClB,SAAS,OAAO;AAAA,MAChB,UAAU,OAAO;AAAA,IAClB;AAAA,EACD;AAEA,QAAM,oBAAoB;AAE1B,SAAO;AAAA,IACN,MAAM,MAAM,aAAa;AAAA,MACxB,KAAK,YAAY;AAChB,cAAM,mBAAmB,MAAM;AAE/B,cAAM;AAAA,UACL;AAAA,YACC,OAAO;AAAA,YACP,OAAO;AAAA,cACN;AAAA,cACA;AAAA,cACA;AAAA,YACD;AAAA,UACD;AAAA,QACD,CAAC;AAAA,MACF;AAAA,MACA,aAAa,OAAO,QAAQ;AAAA,IAC7B,CAAC;AAAA,IACD,SAAS,OAAO;AAAA,EACjB;AACD;","names":[]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../src/shared/options/augmentOptionsWithExcludes.ts"],"sourcesContent":["import * as prompts from \"@clack/prompts\";\n\nimport { filterPromptCancel } from \"../prompts.js\";\nimport { Options } from \"../types.js\";\n\
|
|
1
|
+
{"version":3,"sources":["../../../src/shared/options/augmentOptionsWithExcludes.ts"],"sourcesContent":["import * as prompts from \"@clack/prompts\";\n\nimport { filterPromptCancel } from \"../prompts.js\";\nimport { InputBase, Options } from \"../types.js\";\n\nconst exclusionDescriptions = {\n\texcludeCompliance: {\n\t\thint: \"--exclude-compliance\",\n\t\tlabel:\n\t\t\t\"Add a GitHub Actions workflow to verify that PRs match an expected format.\",\n\t},\n\texcludeContributors: {\n\t\thint: \"--exclude-contributors\",\n\t\tlabel:\n\t\t\t\"Add all-contributors to track contributions and display them in a README.md table.\",\n\t},\n\texcludeLintJson: {\n\t\thint: \"--exclude-lint-json\",\n\t\tlabel: \"Apply linting and sorting to *.json and *.jsonc files.\",\n\t},\n\texcludeLintKnip: {\n\t\thint: \"--exclude-lint-knip\",\n\t\tlabel: \"Add Knip to detect unused files, dependencies, and code exports.\",\n\t},\n\texcludeLintMd: {\n\t\thint: \"--exclude-lint-md\",\n\t\tlabel: \"Apply linting to *.md files.\",\n\t},\n\texcludeLintPackageJson: {\n\t\thint: \"--exclude-lint-package-json\",\n\t\tlabel: \"Add npm-package-json-lint to lint for package.json correctness.\",\n\t},\n\texcludeLintPackages: {\n\t\thint: \"--exclude-lint-packages\",\n\t\tlabel:\n\t\t\t\"Add a pnpm dedupe workflow to ensure packages aren't duplicated unnecessarily.\",\n\t},\n\texcludeLintPerfectionist: {\n\t\thint: \"--exclude-lint-perfectionist\",\n\t\tlabel:\n\t\t\t\"Apply eslint-plugin-perfectionist to ensure imports, keys, and so on are in sorted order.\",\n\t},\n\texcludeLintSpelling: {\n\t\thint: \"--exclude-lint-spelling\",\n\t\tlabel: \"Add cspell to spell check against dictionaries of known words.\",\n\t},\n\texcludeLintYml: {\n\t\thint: \"--exclude-lint-yml\",\n\t\tlabel: \"Apply linting and sorting to *.yaml and *.yml files.\",\n\t},\n\texcludeReleases: {\n\t\thint: \"--exclude-releases\",\n\t\tlabel:\n\t\t\t\"Add release-it to generate changelogs, package bumps, and publishes based on conventional commits.\",\n\t},\n\texcludeRenovate: {\n\t\thint: \"--exclude-renovate\",\n\t\tlabel: \"Add a Renovate config to dependencies up-to-date with PRs.\",\n\t},\n\texcludeTests: {\n\t\thint: \"--exclude-tests\",\n\t\tlabel:\n\t\t\t\"Add Vitest tooling for fast unit tests, configured with coverage tracking.\",\n\t},\n} as const;\n\ntype ExclusionKey = keyof typeof exclusionDescriptions;\n\nconst exclusionKeys = Object.keys(exclusionDescriptions) as ExclusionKey[];\n\nexport async function augmentOptionsWithExcludes(\n\toptions: Options,\n): Promise<Options | undefined> {\n\tif (\n\t\tObject.keys(options).some(\n\t\t\t(key) =>\n\t\t\t\tkey in exclusionDescriptions &&\n\t\t\t\toptions[key as keyof typeof options] !== undefined,\n\t\t)\n\t) {\n\t\treturn options;\n\t}\n\n\tconst base =\n\t\toptions.base ??\n\t\tfilterPromptCancel<InputBase | symbol>(\n\t\t\tawait prompts.select({\n\t\t\t\tmessage: `How much tooling would you like the template to set up for you?`,\n\t\t\t\toptions: [\n\t\t\t\t\t{\n\t\t\t\t\t\thint: \"recommended\",\n\t\t\t\t\t\tlabel: \"Everything! 🙌\",\n\t\t\t\t\t\tvalue: \"everything\",\n\t\t\t\t\t},\n\t\t\t\t\t{\n\t\t\t\t\t\tlabel: \"Just the bare essentials, please.\",\n\t\t\t\t\t\tvalue: \"minimum\",\n\t\t\t\t\t},\n\t\t\t\t\t{\n\t\t\t\t\t\tlabel: \"Allow me to customize.\",\n\t\t\t\t\t\tvalue: \"prompt\",\n\t\t\t\t\t},\n\t\t\t\t],\n\t\t\t}),\n\t\t);\n\n\tswitch (base) {\n\t\tcase undefined:\n\t\t\treturn undefined;\n\n\t\tcase \"everything\":\n\t\t\treturn options;\n\n\t\tcase \"minimum\":\n\t\t\treturn {\n\t\t\t\t...options,\n\t\t\t\t...Object.fromEntries(\n\t\t\t\t\texclusionKeys.map((exclusion) => [\n\t\t\t\t\t\texclusion,\n\t\t\t\t\t\toptions[exclusion] ?? true,\n\t\t\t\t\t]),\n\t\t\t\t),\n\t\t\t};\n\n\t\tcase \"prompt\":\n\t\t\tconst exclusionsNotEnabled = new Set(\n\t\t\t\tfilterPromptCancel(\n\t\t\t\t\tawait prompts.multiselect({\n\t\t\t\t\t\tinitialValues: exclusionKeys,\n\t\t\t\t\t\tmessage:\n\t\t\t\t\t\t\t\"Select the tooling portions you'd like to remove. All are enabled by default.\",\n\t\t\t\t\t\toptions: Object.entries(exclusionDescriptions).map(\n\t\t\t\t\t\t\t([value, { hint, label }]) => ({\n\t\t\t\t\t\t\t\thint,\n\t\t\t\t\t\t\t\tlabel,\n\t\t\t\t\t\t\t\tvalue: value as ExclusionKey,\n\t\t\t\t\t\t\t}),\n\t\t\t\t\t\t),\n\t\t\t\t\t}),\n\t\t\t\t),\n\t\t\t);\n\n\t\t\treturn {\n\t\t\t\t...options,\n\t\t\t\t...Object.fromEntries(\n\t\t\t\t\texclusionKeys.map(\n\t\t\t\t\t\t(exclusionKey) =>\n\t\t\t\t\t\t\t[exclusionKey, !exclusionsNotEnabled.has(exclusionKey)] as const,\n\t\t\t\t\t),\n\t\t\t\t),\n\t\t\t};\n\t}\n}\n"],"mappings":"AAAA,YAAY,aAAa;AAEzB,SAAS,0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AAAA,QACA;AAAA,UACC,OAAO;AAAA,UACP,OAAO;AAAA,QACR;AAAA,QACA;AAAA,UACC,OAAO;AAAA,UACP,OAAO;AAAA,QACR;AAAA,MACD;AAAA,IACD,CAAC;AAAA,EACF;AAED,UAAQ,MAAM;AAAA,IACb,KAAK;AACJ,aAAO;AAAA,IAER,KAAK;AACJ,aAAO;AAAA,IAER,KAAK;AACJ,aAAO;AAAA,QACN,GAAG;AAAA,QACH,GAAG,OAAO;AAAA,UACT,cAAc,IAAI,CAAC,cAAc;AAAA,YAChC;AAAA,YACA,QAAQ,SAAS,KAAK;AAAA,UACvB,CAAC;AAAA,QACF;AAAA,MACD;AAAA,IAED,KAAK;AACJ,YAAM,uBAAuB,IAAI;AAAA,QAChC;AAAA,UACC,MAAM,QAAQ,YAAY;AAAA,YACzB,eAAe;AAAA,YACf,SACC;AAAA,YACD,SAAS,OAAO,QAAQ,qBAAqB,EAAE;AAAA,cAC9C,CAAC,CAAC,OAAO,EAAE,MAAM,MAAM,CAAC,OAAO;AAAA,gBAC9B;AAAA,gBACA;AAAA,gBACA;AAAA,cACD;AAAA,YACD;AAAA,UACD,CAAC;AAAA,QACF;AAAA,MACD;AAEA,aAAO;AAAA,QACN,GAAG;AAAA,QACH,GAAG,OAAO;AAAA,UACT,cAAc;AAAA,YACb,CAAC,iBACA,CAAC,cAAc,CAAC,qBAAqB,IAAI,YAAY,CAAC;AAAA,UACxD;AAAA,QACD;AAAA,MACD;AAAA,EACF;AACD;","names":[]}
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
1
2
|
import { Options } from '../types.js';
|
|
2
3
|
import { GitHub } from './getGitHub.js';
|
|
3
4
|
import 'octokit';
|
|
@@ -8,7 +9,8 @@ interface GitHubAndOptions {
|
|
|
8
9
|
}
|
|
9
10
|
interface OptionsParseCancelled {
|
|
10
11
|
cancelled: true;
|
|
11
|
-
options:
|
|
12
|
+
options: object;
|
|
13
|
+
zodError?: z.ZodError<object>;
|
|
12
14
|
}
|
|
13
15
|
interface OptionsParseSuccess extends GitHubAndOptions {
|
|
14
16
|
cancelled: false;
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { parseArgs } from "node:util";
|
|
2
2
|
import { titleCase } from "title-case";
|
|
3
|
+
import { z } from "zod";
|
|
3
4
|
import { withSpinner } from "../cli/spinners.js";
|
|
4
5
|
import { allArgOptions } from "./args.js";
|
|
5
6
|
import { augmentOptionsWithExcludes } from "./augmentOptionsWithExcludes.js";
|
|
@@ -15,7 +16,7 @@ async function readOptions(args) {
|
|
|
15
16
|
strict: false,
|
|
16
17
|
tokens: true
|
|
17
18
|
});
|
|
18
|
-
const
|
|
19
|
+
const mappedOptions = {
|
|
19
20
|
author: values.author,
|
|
20
21
|
base: values.base,
|
|
21
22
|
createRepository: values["create-repository"],
|
|
@@ -44,8 +45,17 @@ async function readOptions(args) {
|
|
|
44
45
|
skipUninstall: !!values["skip-uninstall"],
|
|
45
46
|
title: values.title
|
|
46
47
|
};
|
|
48
|
+
const optionsParseResult = optionsSchema.safeParse(mappedOptions);
|
|
49
|
+
if (!optionsParseResult.success) {
|
|
50
|
+
return {
|
|
51
|
+
cancelled: true,
|
|
52
|
+
options: mappedOptions,
|
|
53
|
+
zodError: optionsParseResult.error
|
|
54
|
+
};
|
|
55
|
+
}
|
|
56
|
+
const options = optionsParseResult.data;
|
|
47
57
|
options.owner ??= await getPrefillOrPromptedOption(
|
|
48
|
-
|
|
58
|
+
options.owner,
|
|
49
59
|
"What organization or user will the repository be under?",
|
|
50
60
|
defaults.owner
|
|
51
61
|
);
|
|
@@ -96,9 +106,12 @@ async function readOptions(args) {
|
|
|
96
106
|
const augmentedOptions = await augmentOptionsWithExcludes({
|
|
97
107
|
...options,
|
|
98
108
|
author: options.author ?? await defaults.owner(),
|
|
109
|
+
description: options.description,
|
|
99
110
|
email: options.email ?? await defaults.email(),
|
|
100
111
|
funding: options.funding ?? await defaults.funding(),
|
|
101
|
-
|
|
112
|
+
owner: options.owner,
|
|
113
|
+
repository,
|
|
114
|
+
title: options.title
|
|
102
115
|
});
|
|
103
116
|
if (!augmentedOptions) {
|
|
104
117
|
return {
|
|
@@ -112,6 +125,35 @@ async function readOptions(args) {
|
|
|
112
125
|
options: augmentedOptions
|
|
113
126
|
};
|
|
114
127
|
}
|
|
128
|
+
const optionsSchema = z.object({
|
|
129
|
+
author: z.string().optional(),
|
|
130
|
+
base: z.union([z.literal("everything"), z.literal("minimum"), z.literal("prompt")]).optional(),
|
|
131
|
+
createRepository: z.boolean().optional(),
|
|
132
|
+
description: z.string().optional(),
|
|
133
|
+
email: z.string().email().optional(),
|
|
134
|
+
excludeCompliance: z.boolean().optional(),
|
|
135
|
+
excludeContributors: z.boolean().optional(),
|
|
136
|
+
excludeLintJson: z.boolean().optional(),
|
|
137
|
+
excludeLintKnip: z.boolean().optional(),
|
|
138
|
+
excludeLintMd: z.boolean().optional(),
|
|
139
|
+
excludeLintPackageJson: z.boolean().optional(),
|
|
140
|
+
excludeLintPackages: z.boolean().optional(),
|
|
141
|
+
excludeLintPerfectionist: z.boolean().optional(),
|
|
142
|
+
excludeLintSpelling: z.boolean().optional(),
|
|
143
|
+
excludeLintYml: z.boolean().optional(),
|
|
144
|
+
excludeReleases: z.boolean().optional(),
|
|
145
|
+
excludeRenovate: z.boolean().optional(),
|
|
146
|
+
excludeTests: z.boolean().optional(),
|
|
147
|
+
funding: z.string().optional(),
|
|
148
|
+
owner: z.string().optional(),
|
|
149
|
+
repository: z.string().optional(),
|
|
150
|
+
skipGitHubApi: z.boolean(),
|
|
151
|
+
skipInstall: z.boolean(),
|
|
152
|
+
skipRemoval: z.boolean(),
|
|
153
|
+
skipRestore: z.boolean().optional(),
|
|
154
|
+
skipUninstall: z.boolean(),
|
|
155
|
+
title: z.string().optional()
|
|
156
|
+
});
|
|
115
157
|
export {
|
|
116
158
|
readOptions
|
|
117
159
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../src/shared/options/readOptions.ts"],"sourcesContent":["import { parseArgs } from \"node:util\";\nimport { titleCase } from \"title-case\";\n\nimport { withSpinner } from \"../cli/spinners.js\";\nimport {
|
|
1
|
+
{"version":3,"sources":["../../../src/shared/options/readOptions.ts"],"sourcesContent":["import { parseArgs } from \"node:util\";\nimport { titleCase } from \"title-case\";\nimport { z } from \"zod\";\n\nimport { withSpinner } from \"../cli/spinners.js\";\nimport { Options } from \"../types.js\";\nimport { allArgOptions } from \"./args.js\";\nimport { augmentOptionsWithExcludes } from \"./augmentOptionsWithExcludes.js\";\nimport { ensureRepositoryExists } from \"./ensureRepositoryExists.js\";\nimport { GitHub, getGitHub } from \"./getGitHub.js\";\nimport { getPrefillOrPromptedOption } from \"./getPrefillOrPromptedOption.js\";\nimport { getGitAndNpmDefaults } from \"./readGitAndNpmDefaults/index.js\";\n\nexport interface GitHubAndOptions {\n\tgithub: GitHub | undefined;\n\toptions: Options;\n}\n\nexport interface OptionsParseCancelled {\n\tcancelled: true;\n\toptions: object;\n\tzodError?: z.ZodError<object>;\n}\n\nexport interface OptionsParseSuccess extends GitHubAndOptions {\n\tcancelled: false;\n}\n\nexport type OptionsParseResult = OptionsParseCancelled | OptionsParseSuccess;\n\nexport async function readOptions(args: string[]): Promise<OptionsParseResult> {\n\tconst defaults = getGitAndNpmDefaults();\n\tconst { values } = parseArgs({\n\t\targs,\n\t\toptions: allArgOptions,\n\t\tstrict: false,\n\t\ttokens: true,\n\t});\n\n\tconst mappedOptions = {\n\t\tauthor: values.author,\n\t\tbase: values.base,\n\t\tcreateRepository: values[\"create-repository\"],\n\t\tdescription: values.description,\n\t\temail: values.email,\n\t\texcludeCompliance: values[\"exclude-compliance\"],\n\t\texcludeContributors: values[\"exclude-contributors\"],\n\t\texcludeLintJson: values[\"exclude-lint-json\"],\n\t\texcludeLintKnip: values[\"exclude-lint-knip\"],\n\t\texcludeLintMd: values[\"exclude-lint-md\"],\n\t\texcludeLintPackageJson: values[\"exclude-lint-package-json\"],\n\t\texcludeLintPackages: values[\"exclude-lint-packages\"],\n\t\texcludeLintPerfectionist: values[\"exclude-lint-perfectionist\"],\n\t\texcludeLintSpelling: values[\"exclude-lint-spelling\"],\n\t\texcludeLintYml: values[\"exclude-lint-yml\"],\n\t\texcludeReleases: values[\"exclude-releases\"],\n\t\texcludeRenovate: values[\"exclude-renovate\"],\n\t\texcludeTests: values[\"unit-tests\"],\n\t\tfunding: values.funding,\n\t\towner: values.owner,\n\t\trepository: values.repository,\n\t\tskipGitHubApi: !!values[\"skip-github-api\"],\n\t\tskipInstall: !!values[\"skip-install\"],\n\t\tskipRemoval: !!values[\"skip-removal\"],\n\t\tskipRestore: values[\"skip-restore\"],\n\t\tskipUninstall: !!values[\"skip-uninstall\"],\n\t\ttitle: values.title,\n\t};\n\n\tconst optionsParseResult = optionsSchema.safeParse(mappedOptions);\n\n\tif (!optionsParseResult.success) {\n\t\treturn {\n\t\t\tcancelled: true,\n\t\t\toptions: mappedOptions,\n\t\t\tzodError: optionsParseResult.error,\n\t\t};\n\t}\n\n\tconst options = optionsParseResult.data;\n\n\toptions.owner ??= await getPrefillOrPromptedOption(\n\t\toptions.owner,\n\t\t\"What organization or user will the repository be under?\",\n\t\tdefaults.owner,\n\t);\n\tif (!options.owner) {\n\t\treturn {\n\t\t\tcancelled: true,\n\t\t\toptions,\n\t\t};\n\t}\n\n\toptions.repository ??= await getPrefillOrPromptedOption(\n\t\toptions.repository,\n\t\t\"What will the kebab-case name of the repository be?\",\n\t\tdefaults.repository,\n\t);\n\tif (!options.repository) {\n\t\treturn {\n\t\t\tcancelled: true,\n\t\t\toptions,\n\t\t};\n\t}\n\n\tconst { github, repository } = await ensureRepositoryExists(\n\t\tvalues[\"skip-github-api\"]\n\t\t\t? undefined\n\t\t\t: await withSpinner(\"Checking GitHub authentication\", getGitHub),\n\t\t{\n\t\t\tcreateRepository: options.createRepository,\n\t\t\towner: options.owner,\n\t\t\trepository: options.repository,\n\t\t},\n\t);\n\tif (!repository) {\n\t\treturn { cancelled: true, options };\n\t}\n\n\toptions.description ??= await getPrefillOrPromptedOption(\n\t\toptions.description,\n\t\t\"How would you describe the new package?\",\n\t\tasync () =>\n\t\t\t(await defaults.description()) ?? \"A very lovely package. Hooray!\",\n\t);\n\tif (!options.description) {\n\t\treturn { cancelled: true, options };\n\t}\n\n\toptions.title ??= await getPrefillOrPromptedOption(\n\t\toptions.title,\n\t\t\"What will the Title Case title of the repository be?\",\n\t\tasync () =>\n\t\t\t(await defaults.title()) ?? titleCase(repository).replaceAll(\"-\", \" \"),\n\t);\n\tif (!options.title) {\n\t\treturn { cancelled: true, options };\n\t}\n\n\tconst augmentedOptions = await augmentOptionsWithExcludes({\n\t\t...options,\n\t\tauthor: options.author ?? (await defaults.owner()),\n\t\tdescription: options.description,\n\t\temail: options.email ?? (await defaults.email()),\n\t\tfunding: options.funding ?? (await defaults.funding()),\n\t\towner: options.owner,\n\t\trepository,\n\t\ttitle: options.title,\n\t});\n\n\tif (!augmentedOptions) {\n\t\treturn {\n\t\t\tcancelled: true,\n\t\t\toptions,\n\t\t};\n\t}\n\n\treturn {\n\t\tcancelled: false,\n\t\tgithub,\n\t\toptions: augmentedOptions,\n\t};\n}\n\nconst optionsSchema = z.object({\n\tauthor: z.string().optional(),\n\tbase: z\n\t\t.union([z.literal(\"everything\"), z.literal(\"minimum\"), z.literal(\"prompt\")])\n\t\t.optional(),\n\tcreateRepository: z.boolean().optional(),\n\tdescription: z.string().optional(),\n\temail: z.string().email().optional(),\n\texcludeCompliance: z.boolean().optional(),\n\texcludeContributors: z.boolean().optional(),\n\texcludeLintJson: z.boolean().optional(),\n\texcludeLintKnip: z.boolean().optional(),\n\texcludeLintMd: z.boolean().optional(),\n\texcludeLintPackageJson: z.boolean().optional(),\n\texcludeLintPackages: z.boolean().optional(),\n\texcludeLintPerfectionist: z.boolean().optional(),\n\texcludeLintSpelling: z.boolean().optional(),\n\texcludeLintYml: z.boolean().optional(),\n\texcludeReleases: z.boolean().optional(),\n\texcludeRenovate: z.boolean().optional(),\n\texcludeTests: z.boolean().optional(),\n\tfunding: z.string().optional(),\n\towner: z.string().optional(),\n\trepository: z.string().optional(),\n\tskipGitHubApi: z.boolean(),\n\tskipInstall: z.boolean(),\n\tskipRemoval: z.boolean(),\n\tskipRestore: z.boolean().optional(),\n\tskipUninstall: z.boolean(),\n\ttitle: z.string().optional(),\n});\n"],"mappings":"AAAA,SAAS,iBAAiB;AAC1B,SAAS,iBAAiB;AAC1B,SAAS,SAAS;AAElB,SAAS,mBAAmB;AAE5B,SAAS,qBAAqB;AAC9B,SAAS,kCAAkC;AAC3C,SAAS,8BAA8B;AACvC,SAAiB,iBAAiB;AAClC,SAAS,kCAAkC;AAC3C,SAAS,4BAA4B;AAmBrC,eAAsB,YAAY,MAA6C;AAC9E,QAAM,WAAW,qBAAqB;AACtC,QAAM,EAAE,OAAO,IAAI,UAAU;AAAA,IAC5B;AAAA,IACA,SAAS;AAAA,IACT,QAAQ;AAAA,IACR,QAAQ;AAAA,EACT,CAAC;AAED,QAAM,gBAAgB;AAAA,IACrB,QAAQ,OAAO;AAAA,IACf,MAAM,OAAO;AAAA,IACb,kBAAkB,OAAO,mBAAmB;AAAA,IAC5C,aAAa,OAAO;AAAA,IACpB,OAAO,OAAO;AAAA,IACd,mBAAmB,OAAO,oBAAoB;AAAA,IAC9C,qBAAqB,OAAO,sBAAsB;AAAA,IAClD,iBAAiB,OAAO,mBAAmB;AAAA,IAC3C,iBAAiB,OAAO,mBAAmB;AAAA,IAC3C,eAAe,OAAO,iBAAiB;AAAA,IACvC,wBAAwB,OAAO,2BAA2B;AAAA,IAC1D,qBAAqB,OAAO,uBAAuB;AAAA,IACnD,0BAA0B,OAAO,4BAA4B;AAAA,IAC7D,qBAAqB,OAAO,uBAAuB;AAAA,IACnD,gBAAgB,OAAO,kBAAkB;AAAA,IACzC,iBAAiB,OAAO,kBAAkB;AAAA,IAC1C,iBAAiB,OAAO,kBAAkB;AAAA,IAC1C,cAAc,OAAO,YAA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AAS;AAAA,EAC1C,iBAAiB,EAAE,QAAQ,EAAE,SAAS;AAAA,EACtC,iBAAiB,EAAE,QAAQ,EAAE,SAAS;AAAA,EACtC,eAAe,EAAE,QAAQ,EAAE,SAAS;AAAA,EACpC,wBAAwB,EAAE,QAAQ,EAAE,SAAS;AAAA,EAC7C,qBAAqB,EAAE,QAAQ,EAAE,SAAS;AAAA,EAC1C,0BAA0B,EAAE,QAAQ,EAAE,SAAS;AAAA,EAC/C,qBAAqB,EAAE,QAAQ,EAAE,SAAS;AAAA,EAC1C,gBAAgB,EAAE,QAAQ,EAAE,SAAS;AAAA,EACrC,iBAAiB,EAAE,QAAQ,EAAE,SAAS;AAAA,EACtC,iBAAiB,EAAE,QAAQ,EAAE,SAAS;AAAA,EACtC,cAAc,EAAE,QAAQ,EAAE,SAAS;AAAA,EACnC,SAAS,EAAE,OAAO,EAAE,SAAS;AAAA,EAC7B,OAAO,EAAE,OAAO,EAAE,SAAS;AAAA,EAC3B,YAAY,EAAE,OAAO,EAAE,SAAS;AAAA,EAChC,eAAe,EAAE,QAAQ;AAAA,EACzB,aAAa,EAAE,QAAQ;AAAA,EACvB,aAAa,EAAE,QAAQ;AAAA,EACvB,aAAa,EAAE,QAAQ,EAAE,SAAS;AAAA,EAClC,eAAe,EAAE,QAAQ;AAAA,EACzB,OAAO,EAAE,OAAO,EAAE,SAAS;AAC5B,CAAC;","names":[]}
|
package/lib/shared/types.d.ts
CHANGED
|
@@ -22,32 +22,32 @@ interface PartialPackageData {
|
|
|
22
22
|
}
|
|
23
23
|
type InputBase = "everything" | "minimum" | "prompt";
|
|
24
24
|
interface Options {
|
|
25
|
-
author
|
|
26
|
-
base
|
|
27
|
-
createRepository
|
|
25
|
+
author?: string;
|
|
26
|
+
base?: InputBase;
|
|
27
|
+
createRepository?: boolean;
|
|
28
28
|
description: string;
|
|
29
|
-
email
|
|
30
|
-
excludeCompliance
|
|
31
|
-
excludeContributors
|
|
32
|
-
excludeLintJson
|
|
33
|
-
excludeLintKnip
|
|
34
|
-
excludeLintMd
|
|
35
|
-
excludeLintPackageJson
|
|
36
|
-
excludeLintPackages
|
|
37
|
-
excludeLintPerfectionist
|
|
38
|
-
excludeLintSpelling
|
|
39
|
-
excludeLintYml
|
|
40
|
-
excludeReleases
|
|
41
|
-
excludeRenovate
|
|
42
|
-
excludeTests
|
|
43
|
-
funding
|
|
29
|
+
email?: string;
|
|
30
|
+
excludeCompliance?: boolean;
|
|
31
|
+
excludeContributors?: boolean;
|
|
32
|
+
excludeLintJson?: boolean;
|
|
33
|
+
excludeLintKnip?: boolean;
|
|
34
|
+
excludeLintMd?: boolean;
|
|
35
|
+
excludeLintPackageJson?: boolean;
|
|
36
|
+
excludeLintPackages?: boolean;
|
|
37
|
+
excludeLintPerfectionist?: boolean;
|
|
38
|
+
excludeLintSpelling?: boolean;
|
|
39
|
+
excludeLintYml?: boolean;
|
|
40
|
+
excludeReleases?: boolean;
|
|
41
|
+
excludeRenovate?: boolean;
|
|
42
|
+
excludeTests?: boolean;
|
|
43
|
+
funding?: string;
|
|
44
44
|
owner: string;
|
|
45
45
|
repository: string;
|
|
46
46
|
skipGitHubApi: boolean;
|
|
47
|
-
skipInstall
|
|
48
|
-
skipRemoval
|
|
49
|
-
skipRestore
|
|
50
|
-
skipUninstall
|
|
47
|
+
skipInstall?: boolean;
|
|
48
|
+
skipRemoval?: boolean;
|
|
49
|
+
skipRestore?: boolean;
|
|
50
|
+
skipUninstall?: boolean;
|
|
51
51
|
title: string;
|
|
52
52
|
}
|
|
53
53
|
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/steps/uninstallPackages.ts"],"sourcesContent":["import { $ } from \"execa\";\n\nimport { readPackageData, removeDependencies } from \"../shared/packages.js\";\n\nexport async function uninstallPackages() {\n\tconst packageData = await readPackageData();\n\n\tawait removeDependencies(\n\t\t[\n\t\t\t\"@clack/prompts\",\n\t\t\t\"all-contributors-for-repository\",\n\t\t\t\"chalk\",\n\t\t\t\"execa\",\n\t\t\t\"git-remote-origin-url\",\n\t\t\t\"git-url-parse\",\n\t\t\t\"lazy-value\",\n\t\t\t\"js-yaml\",\n\t\t\t\"npm-user\",\n\t\t\t\"octokit\",\n\t\t\t\"prettier\",\n\t\t\t\"replace-in-file\",\n\t\t\t\"title-case\",\n\t\t],\n\t\tpackageData.dependencies,\n\t);\n\n\tawait removeDependencies(\n\t\t[\n\t\t\t\"@octokit/request-error\",\n\t\t\t\"@types/git-url-parse\",\n\t\t\t\"@types/js-yaml\",\n\t\t\t\"@types/prettier\",\n\t\t\t\"all-contributors-cli\",\n\t\t\t\"c8\",\n\t\t\t\"globby\",\n\t\t\t\"tsx\",\n\t\t],\n\t\tpackageData.devDependencies,\n\t\t\"-D\",\n\t);\n\n\tawait $`pnpm add prettier -D`;\n}\n"],"mappings":"AAAA,SAAS,SAAS;AAElB,SAAS,iBAAiB,0BAA0B;AAEpD,eAAsB,oBAAoB;AACzC,QAAM,cAAc,MAAM,gBAAgB;AAE1C,QAAM;AAAA,IACL;AAAA,MACC;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,IACD;AAAA,IACA,YAAY;AAAA,EACb;AAEA,QAAM;AAAA,IACL;AAAA,MACC;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,IACD;AAAA,IACA,YAAY;AAAA,IACZ;AAAA,EACD;AAEA,QAAM;AACP;","names":[]}
|
|
1
|
+
{"version":3,"sources":["../../src/steps/uninstallPackages.ts"],"sourcesContent":["import { $ } from \"execa\";\n\nimport { readPackageData, removeDependencies } from \"../shared/packages.js\";\n\nexport async function uninstallPackages() {\n\tconst packageData = await readPackageData();\n\n\tawait removeDependencies(\n\t\t[\n\t\t\t\"@clack/prompts\",\n\t\t\t\"all-contributors-for-repository\",\n\t\t\t\"chalk\",\n\t\t\t\"execa\",\n\t\t\t\"git-remote-origin-url\",\n\t\t\t\"git-url-parse\",\n\t\t\t\"lazy-value\",\n\t\t\t\"js-yaml\",\n\t\t\t\"npm-user\",\n\t\t\t\"octokit\",\n\t\t\t\"prettier\",\n\t\t\t\"replace-in-file\",\n\t\t\t\"title-case\",\n\t\t\t\"zod\",\n\t\t\t\"zod-validation-error\",\n\t\t],\n\t\tpackageData.dependencies,\n\t);\n\n\tawait removeDependencies(\n\t\t[\n\t\t\t\"@octokit/request-error\",\n\t\t\t\"@types/git-url-parse\",\n\t\t\t\"@types/js-yaml\",\n\t\t\t\"@types/prettier\",\n\t\t\t\"all-contributors-cli\",\n\t\t\t\"c8\",\n\t\t\t\"globby\",\n\t\t\t\"tsx\",\n\t\t],\n\t\tpackageData.devDependencies,\n\t\t\"-D\",\n\t);\n\n\tawait $`pnpm add prettier -D`;\n}\n"],"mappings":"AAAA,SAAS,SAAS;AAElB,SAAS,iBAAiB,0BAA0B;AAEpD,eAAsB,oBAAoB;AACzC,QAAM,cAAc,MAAM,gBAAgB;AAE1C,QAAM;AAAA,IACL;AAAA,MACC;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,IACD;AAAA,IACA,YAAY;AAAA,EACb;AAEA,QAAM;AAAA,IACL;AAAA,MACC;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,IACD;AAAA,IACA,YAAY;AAAA,IACZ;AAAA,EACD;AAEA,QAAM;AACP;","names":[]}
|
|
@@ -17,7 +17,7 @@ function createWorkflowFile({
|
|
|
17
17
|
[name.replaceAll(" ", "_").toLowerCase()]: {
|
|
18
18
|
"runs-on": "ubuntu-latest",
|
|
19
19
|
steps: "runs" in options ? [
|
|
20
|
-
{ uses: "actions/checkout@
|
|
20
|
+
{ uses: "actions/checkout@v4" },
|
|
21
21
|
{ uses: "./.github/actions/prepare" },
|
|
22
22
|
...options.runs.map((run) => ({ run }))
|
|
23
23
|
] : options.steps
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../../../src/steps/writing/creation/dotGitHub/createWorkflowFile.ts"],"sourcesContent":["import { formatYaml } from \"../formatters/formatYaml.js\";\n\ninterface WorkflowFileConcurrency {\n\t\"cancel-in-progress\": boolean;\n\tgroup: string;\n}\n\ninterface WorkflowFileOn {\n\tpull_request?:\n\t\t| {\n\t\t\t\tbranches?: string | string[];\n\t\t\t\ttypes?: string[];\n\t\t }\n\t\t| null\n\t\t| string;\n\tpull_request_target?: {\n\t\ttypes: string[];\n\t};\n\tpush?: {\n\t\tbranches: string[];\n\t};\n\trelease?: {\n\t\ttypes: string[];\n\t};\n\tworkflow_dispatch?: null | string;\n}\n\ninterface WorkflowFilePermissions {\n\tcontents?: string;\n\t\"id-token\"?: string;\n\t\"pull-requests\"?: string;\n}\n\ninterface WorkflowFileStep {\n\tenv?: Record<string, string>;\n\tif?: string;\n\tname?: string;\n\trun?: string;\n\tuses?: string;\n\twith?: Record<string, unknown>;\n}\n\ninterface WorkflowFileOptionsBase {\n\tconcurrency?: WorkflowFileConcurrency;\n\tname: string;\n\ton?: WorkflowFileOn;\n\tpermissions?: WorkflowFilePermissions;\n}\n\ninterface WorkflowFileOptionsRuns extends WorkflowFileOptionsBase {\n\truns: (WorkflowFileStep | string)[];\n}\n\ninterface WorkflowFileOptionsSteps extends WorkflowFileOptionsBase {\n\tsteps: WorkflowFileStep[];\n}\n\ntype WorkflowFileOptions = WorkflowFileOptionsRuns | WorkflowFileOptionsSteps;\n\nexport function createWorkflowFile({\n\tconcurrency,\n\tname,\n\ton = {\n\t\tpull_request: null,\n\t\tpush: {\n\t\t\tbranches: [\"main\"],\n\t\t},\n\t},\n\tpermissions,\n\t...options\n}: WorkflowFileOptions) {\n\treturn (\n\t\tformatYaml({\n\t\t\tconcurrency,\n\t\t\tjobs: {\n\t\t\t\t[name.replaceAll(\" \", \"_\").toLowerCase()]: {\n\t\t\t\t\t\"runs-on\": \"ubuntu-latest\",\n\t\t\t\t\tsteps:\n\t\t\t\t\t\t\"runs\" in options\n\t\t\t\t\t\t\t? [\n\t\t\t\t\t\t\t\t\t{ uses: \"actions/checkout@
|
|
1
|
+
{"version":3,"sources":["../../../../../src/steps/writing/creation/dotGitHub/createWorkflowFile.ts"],"sourcesContent":["import { formatYaml } from \"../formatters/formatYaml.js\";\n\ninterface WorkflowFileConcurrency {\n\t\"cancel-in-progress\": boolean;\n\tgroup: string;\n}\n\ninterface WorkflowFileOn {\n\tpull_request?:\n\t\t| {\n\t\t\t\tbranches?: string | string[];\n\t\t\t\ttypes?: string[];\n\t\t }\n\t\t| null\n\t\t| string;\n\tpull_request_target?: {\n\t\ttypes: string[];\n\t};\n\tpush?: {\n\t\tbranches: string[];\n\t};\n\trelease?: {\n\t\ttypes: string[];\n\t};\n\tworkflow_dispatch?: null | string;\n}\n\ninterface WorkflowFilePermissions {\n\tcontents?: string;\n\t\"id-token\"?: string;\n\t\"pull-requests\"?: string;\n}\n\ninterface WorkflowFileStep {\n\tenv?: Record<string, string>;\n\tif?: string;\n\tname?: string;\n\trun?: string;\n\tuses?: string;\n\twith?: Record<string, unknown>;\n}\n\ninterface WorkflowFileOptionsBase {\n\tconcurrency?: WorkflowFileConcurrency;\n\tname: string;\n\ton?: WorkflowFileOn;\n\tpermissions?: WorkflowFilePermissions;\n}\n\ninterface WorkflowFileOptionsRuns extends WorkflowFileOptionsBase {\n\truns: (WorkflowFileStep | string)[];\n}\n\ninterface WorkflowFileOptionsSteps extends WorkflowFileOptionsBase {\n\tsteps: WorkflowFileStep[];\n}\n\ntype WorkflowFileOptions = WorkflowFileOptionsRuns | WorkflowFileOptionsSteps;\n\nexport function createWorkflowFile({\n\tconcurrency,\n\tname,\n\ton = {\n\t\tpull_request: null,\n\t\tpush: {\n\t\t\tbranches: [\"main\"],\n\t\t},\n\t},\n\tpermissions,\n\t...options\n}: WorkflowFileOptions) {\n\treturn (\n\t\tformatYaml({\n\t\t\tconcurrency,\n\t\t\tjobs: {\n\t\t\t\t[name.replaceAll(\" \", \"_\").toLowerCase()]: {\n\t\t\t\t\t\"runs-on\": \"ubuntu-latest\",\n\t\t\t\t\tsteps:\n\t\t\t\t\t\t\"runs\" in options\n\t\t\t\t\t\t\t? [\n\t\t\t\t\t\t\t\t\t{ uses: \"actions/checkout@v4\" },\n\t\t\t\t\t\t\t\t\t{ uses: \"./.github/actions/prepare\" },\n\t\t\t\t\t\t\t\t\t...options.runs.map((run) => ({ run })),\n\t\t\t\t\t\t\t ]\n\t\t\t\t\t\t\t: options.steps,\n\t\t\t\t},\n\t\t\t},\n\t\t\tname,\n\t\t\ton,\n\t\t\tpermissions,\n\t\t})\n\t\t\t.replaceAll(/\\n(\\S)/g, \"\\n\\n$1\")\n\t\t\t// https://github.com/nodeca/js-yaml/pull/515\n\t\t\t.replaceAll(/: \"\\\\n(.+)\"/g, \": |\\n$1\")\n\t\t\t.replaceAll(\"\\\\n\", \"\\n\")\n\t\t\t.replaceAll(\"\\\\t\", \" \")\n\t);\n}\n"],"mappings":"AAAA,SAAS,kBAAkB;AA2DpB,SAAS,mBAAmB;AAAA,EAClC;AAAA,EACA;AAAA,EACA,KAAK;AAAA,IACJ,cAAc;AAAA,IACd,MAAM;AAAA,MACL,UAAU,CAAC,MAAM;AAAA,IAClB;AAAA,EACD;AAAA,EACA;AAAA,EACA,GAAG;AACJ,GAAwB;AACvB,SACC,WAAW;AAAA,IACV;AAAA,IACA,MAAM;AAAA,MACL,CAAC,KAAK,WAAW,KAAK,GAAG,EAAE,YAAY,CAAC,GAAG;AAAA,QAC1C,WAAW;AAAA,QACX,OACC,UAAU,UACP;AAAA,UACA,EAAE,MAAM,sBAAsB;AAAA,UAC9B,EAAE,MAAM,4BAA4B;AAAA,UACpC,GAAG,QAAQ,KAAK,IAAI,CAAC,SAAS,EAAE,IAAI,EAAE;AAAA,QACtC,IACA,QAAQ;AAAA,MACb;AAAA,IACD;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,EACD,CAAC,EACC,WAAW,WAAW,QAAQ,EAE9B,WAAW,gBAAgB,SAAS,EACpC,WAAW,OAAO,IAAI,EACtB,WAAW,OAAO,IAAI;AAE1B;","names":[]}
|
|
@@ -76,7 +76,7 @@ echo "See https://github.com/actions-ecosystem/action-remove-labels/issues/221."
|
|
|
76
76
|
}
|
|
77
77
|
},
|
|
78
78
|
steps: [
|
|
79
|
-
{ uses: "actions/checkout@
|
|
79
|
+
{ uses: "actions/checkout@v4", with: { "fetch-depth": 0 } },
|
|
80
80
|
{ uses: "./.github/actions/prepare" },
|
|
81
81
|
{
|
|
82
82
|
env: { GITHUB_TOKEN: "${{ secrets.ACCESS_TOKEN }}" },
|
|
@@ -128,7 +128,7 @@ echo "See https://github.com/actions-ecosystem/action-remove-labels/issues/221."
|
|
|
128
128
|
}
|
|
129
129
|
},
|
|
130
130
|
steps: [
|
|
131
|
-
{ uses: "actions/checkout@
|
|
131
|
+
{ uses: "actions/checkout@v4", with: { "fetch-depth": 0 } },
|
|
132
132
|
{
|
|
133
133
|
run: `echo "npm_version=$(npm pkg get version | tr -d '"')" >> "$GITHUB_ENV"`
|
|
134
134
|
},
|
|
@@ -167,7 +167,7 @@ echo "See https://github.com/actions-ecosystem/action-remove-labels/issues/221."
|
|
|
167
167
|
},
|
|
168
168
|
steps: [
|
|
169
169
|
{
|
|
170
|
-
uses: "actions/checkout@
|
|
170
|
+
uses: "actions/checkout@v4",
|
|
171
171
|
with: {
|
|
172
172
|
"fetch-depth": 0
|
|
173
173
|
}
|
|
@@ -267,7 +267,7 @@ echo "See https://github.com/actions-ecosystem/action-remove-labels/issues/221."
|
|
|
267
267
|
"test.yml": createWorkflowFile({
|
|
268
268
|
name: "Test",
|
|
269
269
|
steps: [
|
|
270
|
-
{ uses: "actions/checkout@
|
|
270
|
+
{ uses: "actions/checkout@v4" },
|
|
271
271
|
{ uses: "./.github/actions/prepare" },
|
|
272
272
|
{ run: "pnpm run test --coverage" },
|
|
273
273
|
{
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../../../src/steps/writing/creation/dotGitHub/workflows.ts"],"sourcesContent":["/* spellchecker: disable */\nimport { Options } from \"../../../../shared/types.js\";\nimport { createWorkflowFile } from \"./createWorkflowFile.js\";\n\nexport function createWorkflows(options: Options) {\n\treturn {\n\t\t\"build.yml\": createWorkflowFile({\n\t\t\tname: \"Build\",\n\t\t\truns: [\"pnpm build\", \"node ./lib/index.js\"],\n\t\t}),\n\t\t\"pr-review-requested.yml\": createWorkflowFile({\n\t\t\tname: \"PR Review Requested\",\n\t\t\ton: {\n\t\t\t\tpull_request_target: {\n\t\t\t\t\ttypes: [\"review_requested\"],\n\t\t\t\t},\n\t\t\t},\n\t\t\tpermissions: {\n\t\t\t\t\"pull-requests\": \"write\",\n\t\t\t},\n\t\t\tsteps: [\n\t\t\t\t{\n\t\t\t\t\tuses: \"actions-ecosystem/action-remove-labels@v1\",\n\t\t\t\t\twith: {\n\t\t\t\t\t\tlabels: \"status: waiting for author\",\n\t\t\t\t\t},\n\t\t\t\t},\n\t\t\t\t{\n\t\t\t\t\tif: \"failure()\",\n\t\t\t\t\trun: 'echo \"Don\\'t worry if the previous step failed.\"\\necho \"See https://github.com/actions-ecosystem/action-remove-labels/issues/221.\"\\n',\n\t\t\t\t},\n\t\t\t],\n\t\t}),\n\t\t\"prettier.yml\": createWorkflowFile({\n\t\t\tname: \"Prettier\",\n\t\t\truns: [\"pnpm format --list-different\"],\n\t\t}),\n\t\t\"tsc.yml\": createWorkflowFile({\n\t\t\tname: \"Type Check\",\n\t\t\truns: [\"pnpm tsc\"],\n\t\t}),\n\t\t...(!options.excludeCompliance && {\n\t\t\t\"compliance.yml\": createWorkflowFile({\n\t\t\t\tname: \"Compliance\",\n\t\t\t\ton: {\n\t\t\t\t\tpull_request: {\n\t\t\t\t\t\tbranches: [\"main\"],\n\t\t\t\t\t\ttypes: [\"edited\", \"opened\", \"reopened\", \"synchronize\"],\n\t\t\t\t\t},\n\t\t\t\t},\n\t\t\t\tpermissions: {\n\t\t\t\t\t\"pull-requests\": \"write\",\n\t\t\t\t},\n\t\t\t\tsteps: [\n\t\t\t\t\t{\n\t\t\t\t\t\tuses: \"mtfoley/pr-compliance-action@main\",\n\t\t\t\t\t\twith: {\n\t\t\t\t\t\t\t\"body-auto-close\": false,\n\t\t\t\t\t\t\t\"ignore-authors\": [\n\t\t\t\t\t\t\t\t\"allcontributors\",\n\t\t\t\t\t\t\t\t\"allcontributors[bot]\",\n\t\t\t\t\t\t\t\t\"renovate\",\n\t\t\t\t\t\t\t\t\"renovate[bot]\",\n\t\t\t\t\t\t\t].join(\"\\n\"),\n\t\t\t\t\t\t\t\"ignore-team-members\": false,\n\t\t\t\t\t\t},\n\t\t\t\t\t},\n\t\t\t\t],\n\t\t\t}),\n\t\t}),\n\t\t...(!options.excludeContributors && {\n\t\t\t\"contributors.yml\": createWorkflowFile({\n\t\t\t\tname: \"Contributors\",\n\t\t\t\ton: {\n\t\t\t\t\tpush: {\n\t\t\t\t\t\tbranches: [\"main\"],\n\t\t\t\t\t},\n\t\t\t\t},\n\t\t\t\tsteps: [\n\t\t\t\t\t{ uses: \"actions/checkout@v3\", with: { \"fetch-depth\": 0 } },\n\t\t\t\t\t{ uses: \"./.github/actions/prepare\" },\n\t\t\t\t\t{\n\t\t\t\t\t\tenv: { GITHUB_TOKEN: \"${{ secrets.ACCESS_TOKEN }}\" },\n\t\t\t\t\t\tuses: `JoshuaKGoldberg/all-contributors-auto-action@v0.3.2`,\n\t\t\t\t\t},\n\t\t\t\t],\n\t\t\t}),\n\t\t}),\n\t\t\"lint.yml\": createWorkflowFile({\n\t\t\tname: \"Lint\",\n\t\t\truns: [\"pnpm lint\"],\n\t\t}),\n\t\t...(!options.excludeLintKnip && {\n\t\t\t\"lint-knip.yml\": createWorkflowFile({\n\t\t\t\tname: \"Lint Knip\",\n\t\t\t\truns: [\"pnpm lint:knip\"],\n\t\t\t}),\n\t\t}),\n\t\t...(!options.excludeLintMd && {\n\t\t\t\"lint-markdown.yml\": createWorkflowFile({\n\t\t\t\tname: \"Lint Markdown\",\n\t\t\t\truns: [\"pnpm lint:md\"],\n\t\t\t}),\n\t\t}),\n\t\t...(!options.excludeLintPackageJson && {\n\t\t\t\"lint-package-json.yml\": createWorkflowFile({\n\t\t\t\tname: \"Lint Package JSON\",\n\t\t\t\truns: [\"pnpm lint:package-json\"],\n\t\t\t}),\n\t\t}),\n\t\t...(!options.excludeLintPackageJson && {\n\t\t\t\"lint-packages.yml\": createWorkflowFile({\n\t\t\t\tname: \"Lint Packages\",\n\t\t\t\truns: [\"pnpm lint:packages\"],\n\t\t\t}),\n\t\t}),\n\t\t...(!options.excludeLintSpelling && {\n\t\t\t\"lint-spelling.yml\": createWorkflowFile({\n\t\t\t\tname: \"Lint spelling\",\n\t\t\t\truns: [\"pnpm lint:spelling\"],\n\t\t\t}),\n\t\t}),\n\t\t...(!options.excludeReleases && {\n\t\t\t\"post-release.yml\": createWorkflowFile({\n\t\t\t\tname: \"Post Release\",\n\t\t\t\ton: {\n\t\t\t\t\trelease: {\n\t\t\t\t\t\ttypes: [\"published\"],\n\t\t\t\t\t},\n\t\t\t\t},\n\t\t\t\tsteps: [\n\t\t\t\t\t{ uses: \"actions/checkout@v3\", with: { \"fetch-depth\": 0 } },\n\t\t\t\t\t{\n\t\t\t\t\t\trun: `echo \"npm_version=$(npm pkg get version | tr -d '\"')\" >> \"$GITHUB_ENV\"`,\n\t\t\t\t\t},\n\t\t\t\t\t{\n\t\t\t\t\t\tuses: \"apexskier/github-release-commenter@v1\",\n\t\t\t\t\t\twith: {\n\t\t\t\t\t\t\tGITHUB_TOKEN: \"${{ secrets.GITHUB_TOKEN }}\",\n\t\t\t\t\t\t\t\"comment-template\": `\n\t\t\t\t\t\t\t:tada: This is included in version {release_link} :tada:\n\n\t\t\t\t\t\t\tThe release is available on:\n\t\t\t\t\n\t\t\t\t\t\t\t* [GitHub releases](https://github.com/${options.owner}/${options.repository}/releases/tag/{release_tag})\n\t\t\t\t\t\t\t* [npm package (@latest dist-tag)](https://www.npmjs.com/package/${options.repository}/v/\\${{ env.npm_version }})\n\t\t\t\t\n\t\t\t\t\t\t\tCheers! 📦🚀\n\t\t\t\t\t\t`,\n\t\t\t\t\t\t},\n\t\t\t\t\t},\n\t\t\t\t],\n\t\t\t}),\n\t\t\t\"release.yml\": createWorkflowFile({\n\t\t\t\tconcurrency: {\n\t\t\t\t\t\"cancel-in-progress\": true,\n\t\t\t\t\tgroup: \"${{ github.workflow }}\",\n\t\t\t\t},\n\t\t\t\tname: \"Release\",\n\t\t\t\ton: {\n\t\t\t\t\tpush: {\n\t\t\t\t\t\tbranches: [\"main\"],\n\t\t\t\t\t},\n\t\t\t\t},\n\t\t\t\tpermissions: {\n\t\t\t\t\tcontents: \"write\",\n\t\t\t\t\t\"id-token\": \"write\",\n\t\t\t\t},\n\t\t\t\tsteps: [\n\t\t\t\t\t{\n\t\t\t\t\t\tuses: \"actions/checkout@v3\",\n\t\t\t\t\t\twith: {\n\t\t\t\t\t\t\t\"fetch-depth\": 0,\n\t\t\t\t\t\t},\n\t\t\t\t\t},\n\t\t\t\t\t{\n\t\t\t\t\t\tuses: \"./.github/actions/prepare\",\n\t\t\t\t\t},\n\t\t\t\t\t{\n\t\t\t\t\t\trun: \"pnpm build\",\n\t\t\t\t\t},\n\t\t\t\t\t{\n\t\t\t\t\t\trun: 'git config user.name \"${GITHUB_ACTOR}\"',\n\t\t\t\t\t},\n\t\t\t\t\t{\n\t\t\t\t\t\trun: 'git config user.email \"${GITHUB_ACTOR}@users.noreply.github.com\"',\n\t\t\t\t\t},\n\t\t\t\t\t{\n\t\t\t\t\t\tenv: {\n\t\t\t\t\t\t\tNPM_TOKEN: \"${{ secrets.NPM_TOKEN }}\",\n\t\t\t\t\t\t},\n\t\t\t\t\t\trun: \"npm config set //registry.npmjs.org/:_authToken $NPM_TOKEN\",\n\t\t\t\t\t},\n\t\t\t\t\t{\n\t\t\t\t\t\tname: \"Delete branch protection on main\",\n\t\t\t\t\t\tuses: \"actions/github-script@v6.4.1\",\n\t\t\t\t\t\twith: {\n\t\t\t\t\t\t\t\"github-token\": \"${{ secrets.ACCESS_TOKEN }}\",\n\t\t\t\t\t\t\tscript: `\n\t\t\t\t\t\t\t\ttry {\n\t\t\t\t\t\t\t\t\tawait github.request(\n\t\t\t\t\t\t\t\t\t \\`DELETE /repos/${options.owner}/${options.repository}/branches/main/protection\\`,\n\t\t\t\t\t\t\t\t\t);\n\t\t\t\t\t\t\t\t} catch (error) {\n\t\t\t\t\t\t\t\t\tif (!error.message?.includes?.(\"Branch not protected\")) {\n\t\t\t\t\t\t\t\t\t\tthrow error;\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t}`,\n\t\t\t\t\t\t},\n\t\t\t\t\t},\n\t\t\t\t\t{\n\t\t\t\t\t\tenv: {\n\t\t\t\t\t\t\tGITHUB_TOKEN: \"${{ secrets.ACCESS_TOKEN }}\",\n\t\t\t\t\t\t},\n\t\t\t\t\t\trun: `\n\t\t\t\t\t\tif pnpm run should-semantic-release ; then\n\t\t\t\t\t\t pnpm release-it --verbose\n\t\t\t\t\t\t gh workflow run post-release.yml\n\t\t\t\t\t\tfi`,\n\t\t\t\t\t},\n\t\t\t\t\t{\n\t\t\t\t\t\tif: \"always()\",\n\t\t\t\t\t\tname: \"Recreate branch protection on main\",\n\t\t\t\t\t\tuses: \"actions/github-script@v6.4.1\",\n\t\t\t\t\t\twith: {\n\t\t\t\t\t\t\t\"github-token\": \"${{ secrets.ACCESS_TOKEN }}\",\n\t\t\t\t\t\t\tscript: `\n\t\t\t\t\t\t\tgithub.request(\n\t\t\t\t\t\t\t \\`PUT /repos/${options.owner}/${options.repository}/branches/main/protection\\`,\n\t\t\t\t\t\t\t {\n\t\t\t\t\t\t\t\t allow_deletions: false,\n\t\t\t\t\t\t\t\t allow_force_pushes: true,\n\t\t\t\t\t\t\t\t allow_fork_pushes: false,\n\t\t\t\t\t\t\t\t allow_fork_syncing: true,\n\t\t\t\t\t\t\t\t block_creations: false,\n\t\t\t\t\t\t\t\t branch: \"main\",\n\t\t\t\t\t\t\t\t enforce_admins: false,\n\t\t\t\t\t\t\t\t owner: \"${options.owner}\",\n\t\t\t\t\t\t\t\t repo: \"${options.repository}\",\n\t\t\t\t\t\t\t\t required_conversation_resolution: true,\n\t\t\t\t\t\t\t\t required_linear_history: false,\n\t\t\t\t\t\t\t\t required_pull_request_reviews: null,\n\t\t\t\t\t\t\t\t required_status_checks: {\n\t\t\t\t\t\t\t\t\tchecks: [\n\t\t\t\t\t\t\t\t\t { context: \"build\" },\n\t\t\t\t\t\t\t\t\t { context: \"compliance\" },\n\t\t\t\t\t\t\t\t\t { context: \"lint\" },\n\t\t\t\t\t\t\t\t\t { context: \"lint_knip\" },\n\t\t\t\t\t\t\t\t\t { context: \"lint_markdown\" },\n\t\t\t\t\t\t\t\t\t { context: \"lint_package_json\" },\n\t\t\t\t\t\t\t\t\t { context: \"lint_packages\" },\n\t\t\t\t\t\t\t\t\t { context: \"lint_spelling\" },\n\t\t\t\t\t\t\t\t\t { context: \"prettier\" },\n\t\t\t\t\t\t\t\t\t { context: \"test\" },\n\t\t\t\t\t\t\t\t\t],\n\t\t\t\t\t\t\t\t\tstrict: false,\n\t\t\t\t\t\t\t\t },\n\t\t\t\t\t\t\t\t restrictions: null,\n\t\t\t\t\t\t\t }\n\t\t\t\t\t\t\t);\n\t\t\t\t\t\t`,\n\t\t\t\t\t\t},\n\t\t\t\t\t},\n\t\t\t\t],\n\t\t\t}),\n\t\t}),\n\t\t...(options.excludeTests && {\n\t\t\t\"test.yml\": createWorkflowFile({\n\t\t\t\tname: \"Test\",\n\t\t\t\tsteps: [\n\t\t\t\t\t{ uses: \"actions/checkout@v3\" },\n\t\t\t\t\t{ uses: \"./.github/actions/prepare\" },\n\t\t\t\t\t{ run: \"pnpm run test --coverage\" },\n\t\t\t\t\t{\n\t\t\t\t\t\tname: \"Codecov\",\n\t\t\t\t\t\tuses: \"codecov/codecov-action@v3\",\n\t\t\t\t\t\twith: { \"github-token\": \"${{ secrets.GITHUB_TOKEN }}\" },\n\t\t\t\t\t},\n\t\t\t\t],\n\t\t\t}),\n\t\t}),\n\t};\n}\n"],"mappings":"AAEA,SAAS,0BAA0B;AAE5B,SAAS,gBAAgB,SAAkB;AACjD,SAAO;AAAA,IACN,aAAa,mBAAmB;AAAA,MAC/B,MAAM;AAAA,MACN,MAAM,CAAC,cAAc,qBAAqB;AAAA,IAC3C,CAAC;AAAA,IACD,2BAA2B,mBAAmB;AAAA,MAC7C,MAAM;AAAA,MACN,IAAI;AAAA,QACH,qBAAqB;AAAA,UACpB,OAAO,CAAC,kBAAkB;AAAA,QAC3B;AAAA,MACD;AAAA,MACA,aAAa;AAAA,QACZ,iBAAiB;AAAA,MAClB;AAAA,MACA,OAAO;AAAA,QACN;AAAA,UACC,MAAM;AAAA,UACN,MAAM;AAAA,YACL,QAAQ;AAAA,UACT;AAAA,QACD;AAAA,QACA;AAAA,UACC,IAAI;AAAA,UACJ,KAAK;AAAA;AAAA;AAAA,QACN;AAAA,MACD;AAAA,IACD,CAAC;AAAA,IACD,gBAAgB,mBAAmB;AAAA,MAClC,MAAM;AAAA,MACN,MAAM,CAAC,8BAA8B;AAAA,IACtC,CAAC;AAAA,IACD,WAAW,mBAAmB;AAAA,MAC7B,MAAM;AAAA,MACN,MAAM,CAAC,UAAU;AAAA,IAClB,CAAC;AAAA,IACD,GAAI,CAAC,QAAQ,qBAAqB;AAAA,MACjC,kBAAkB,mBAAmB;AAAA,QACpC,MAAM;AAAA,QACN,IAAI;AAAA,UACH,cAAc;AAAA,YACb,UAAU,CAAC,MAAM;AAAA,YACjB,OAAO,CAAC,UAAU,UAAU,YAAY,aAAa;A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MAAM;AAAA,YACN,MAAM;AAAA,YACN,MAAM,EAAE,gBAAgB,8BAA8B;AAAA,UACvD;AAAA,QACD;AAAA,MACD,CAAC;AAAA,IACF;AAAA,EACD;AACD;","names":[]}
|
|
1
|
+
{"version":3,"sources":["../../../../../src/steps/writing/creation/dotGitHub/workflows.ts"],"sourcesContent":["/* spellchecker: disable */\nimport { Options } from \"../../../../shared/types.js\";\nimport { createWorkflowFile } from \"./createWorkflowFile.js\";\n\nexport function createWorkflows(options: Options) {\n\treturn {\n\t\t\"build.yml\": createWorkflowFile({\n\t\t\tname: \"Build\",\n\t\t\truns: [\"pnpm build\", \"node ./lib/index.js\"],\n\t\t}),\n\t\t\"pr-review-requested.yml\": createWorkflowFile({\n\t\t\tname: \"PR Review Requested\",\n\t\t\ton: {\n\t\t\t\tpull_request_target: {\n\t\t\t\t\ttypes: [\"review_requested\"],\n\t\t\t\t},\n\t\t\t},\n\t\t\tpermissions: {\n\t\t\t\t\"pull-requests\": \"write\",\n\t\t\t},\n\t\t\tsteps: [\n\t\t\t\t{\n\t\t\t\t\tuses: \"actions-ecosystem/action-remove-labels@v1\",\n\t\t\t\t\twith: {\n\t\t\t\t\t\tlabels: \"status: waiting for author\",\n\t\t\t\t\t},\n\t\t\t\t},\n\t\t\t\t{\n\t\t\t\t\tif: \"failure()\",\n\t\t\t\t\trun: 'echo \"Don\\'t worry if the previous step failed.\"\\necho \"See https://github.com/actions-ecosystem/action-remove-labels/issues/221.\"\\n',\n\t\t\t\t},\n\t\t\t],\n\t\t}),\n\t\t\"prettier.yml\": createWorkflowFile({\n\t\t\tname: \"Prettier\",\n\t\t\truns: [\"pnpm format --list-different\"],\n\t\t}),\n\t\t\"tsc.yml\": createWorkflowFile({\n\t\t\tname: \"Type Check\",\n\t\t\truns: [\"pnpm tsc\"],\n\t\t}),\n\t\t...(!options.excludeCompliance && {\n\t\t\t\"compliance.yml\": createWorkflowFile({\n\t\t\t\tname: \"Compliance\",\n\t\t\t\ton: {\n\t\t\t\t\tpull_request: {\n\t\t\t\t\t\tbranches: [\"main\"],\n\t\t\t\t\t\ttypes: [\"edited\", \"opened\", \"reopened\", \"synchronize\"],\n\t\t\t\t\t},\n\t\t\t\t},\n\t\t\t\tpermissions: {\n\t\t\t\t\t\"pull-requests\": \"write\",\n\t\t\t\t},\n\t\t\t\tsteps: [\n\t\t\t\t\t{\n\t\t\t\t\t\tuses: \"mtfoley/pr-compliance-action@main\",\n\t\t\t\t\t\twith: {\n\t\t\t\t\t\t\t\"body-auto-close\": false,\n\t\t\t\t\t\t\t\"ignore-authors\": [\n\t\t\t\t\t\t\t\t\"allcontributors\",\n\t\t\t\t\t\t\t\t\"allcontributors[bot]\",\n\t\t\t\t\t\t\t\t\"renovate\",\n\t\t\t\t\t\t\t\t\"renovate[bot]\",\n\t\t\t\t\t\t\t].join(\"\\n\"),\n\t\t\t\t\t\t\t\"ignore-team-members\": false,\n\t\t\t\t\t\t},\n\t\t\t\t\t},\n\t\t\t\t],\n\t\t\t}),\n\t\t}),\n\t\t...(!options.excludeContributors && {\n\t\t\t\"contributors.yml\": createWorkflowFile({\n\t\t\t\tname: \"Contributors\",\n\t\t\t\ton: {\n\t\t\t\t\tpush: {\n\t\t\t\t\t\tbranches: [\"main\"],\n\t\t\t\t\t},\n\t\t\t\t},\n\t\t\t\tsteps: [\n\t\t\t\t\t{ uses: \"actions/checkout@v4\", with: { \"fetch-depth\": 0 } },\n\t\t\t\t\t{ uses: \"./.github/actions/prepare\" },\n\t\t\t\t\t{\n\t\t\t\t\t\tenv: { GITHUB_TOKEN: \"${{ secrets.ACCESS_TOKEN }}\" },\n\t\t\t\t\t\tuses: `JoshuaKGoldberg/all-contributors-auto-action@v0.3.2`,\n\t\t\t\t\t},\n\t\t\t\t],\n\t\t\t}),\n\t\t}),\n\t\t\"lint.yml\": createWorkflowFile({\n\t\t\tname: \"Lint\",\n\t\t\truns: [\"pnpm lint\"],\n\t\t}),\n\t\t...(!options.excludeLintKnip && {\n\t\t\t\"lint-knip.yml\": createWorkflowFile({\n\t\t\t\tname: \"Lint Knip\",\n\t\t\t\truns: [\"pnpm lint:knip\"],\n\t\t\t}),\n\t\t}),\n\t\t...(!options.excludeLintMd && {\n\t\t\t\"lint-markdown.yml\": createWorkflowFile({\n\t\t\t\tname: \"Lint Markdown\",\n\t\t\t\truns: [\"pnpm lint:md\"],\n\t\t\t}),\n\t\t}),\n\t\t...(!options.excludeLintPackageJson && {\n\t\t\t\"lint-package-json.yml\": createWorkflowFile({\n\t\t\t\tname: \"Lint Package JSON\",\n\t\t\t\truns: [\"pnpm lint:package-json\"],\n\t\t\t}),\n\t\t}),\n\t\t...(!options.excludeLintPackageJson && {\n\t\t\t\"lint-packages.yml\": createWorkflowFile({\n\t\t\t\tname: \"Lint Packages\",\n\t\t\t\truns: [\"pnpm lint:packages\"],\n\t\t\t}),\n\t\t}),\n\t\t...(!options.excludeLintSpelling && {\n\t\t\t\"lint-spelling.yml\": createWorkflowFile({\n\t\t\t\tname: \"Lint spelling\",\n\t\t\t\truns: [\"pnpm lint:spelling\"],\n\t\t\t}),\n\t\t}),\n\t\t...(!options.excludeReleases && {\n\t\t\t\"post-release.yml\": createWorkflowFile({\n\t\t\t\tname: \"Post Release\",\n\t\t\t\ton: {\n\t\t\t\t\trelease: {\n\t\t\t\t\t\ttypes: [\"published\"],\n\t\t\t\t\t},\n\t\t\t\t},\n\t\t\t\tsteps: [\n\t\t\t\t\t{ uses: \"actions/checkout@v4\", with: { \"fetch-depth\": 0 } },\n\t\t\t\t\t{\n\t\t\t\t\t\trun: `echo \"npm_version=$(npm pkg get version | tr -d '\"')\" >> \"$GITHUB_ENV\"`,\n\t\t\t\t\t},\n\t\t\t\t\t{\n\t\t\t\t\t\tuses: \"apexskier/github-release-commenter@v1\",\n\t\t\t\t\t\twith: {\n\t\t\t\t\t\t\tGITHUB_TOKEN: \"${{ secrets.GITHUB_TOKEN }}\",\n\t\t\t\t\t\t\t\"comment-template\": `\n\t\t\t\t\t\t\t:tada: This is included in version {release_link} :tada:\n\n\t\t\t\t\t\t\tThe release is available on:\n\t\t\t\t\n\t\t\t\t\t\t\t* [GitHub releases](https://github.com/${options.owner}/${options.repository}/releases/tag/{release_tag})\n\t\t\t\t\t\t\t* [npm package (@latest dist-tag)](https://www.npmjs.com/package/${options.repository}/v/\\${{ env.npm_version }})\n\t\t\t\t\n\t\t\t\t\t\t\tCheers! 📦🚀\n\t\t\t\t\t\t`,\n\t\t\t\t\t\t},\n\t\t\t\t\t},\n\t\t\t\t],\n\t\t\t}),\n\t\t\t\"release.yml\": createWorkflowFile({\n\t\t\t\tconcurrency: {\n\t\t\t\t\t\"cancel-in-progress\": true,\n\t\t\t\t\tgroup: \"${{ github.workflow }}\",\n\t\t\t\t},\n\t\t\t\tname: \"Release\",\n\t\t\t\ton: {\n\t\t\t\t\tpush: {\n\t\t\t\t\t\tbranches: [\"main\"],\n\t\t\t\t\t},\n\t\t\t\t},\n\t\t\t\tpermissions: {\n\t\t\t\t\tcontents: \"write\",\n\t\t\t\t\t\"id-token\": \"write\",\n\t\t\t\t},\n\t\t\t\tsteps: [\n\t\t\t\t\t{\n\t\t\t\t\t\tuses: \"actions/checkout@v4\",\n\t\t\t\t\t\twith: {\n\t\t\t\t\t\t\t\"fetch-depth\": 0,\n\t\t\t\t\t\t},\n\t\t\t\t\t},\n\t\t\t\t\t{\n\t\t\t\t\t\tuses: \"./.github/actions/prepare\",\n\t\t\t\t\t},\n\t\t\t\t\t{\n\t\t\t\t\t\trun: \"pnpm build\",\n\t\t\t\t\t},\n\t\t\t\t\t{\n\t\t\t\t\t\trun: 'git config user.name \"${GITHUB_ACTOR}\"',\n\t\t\t\t\t},\n\t\t\t\t\t{\n\t\t\t\t\t\trun: 'git config user.email \"${GITHUB_ACTOR}@users.noreply.github.com\"',\n\t\t\t\t\t},\n\t\t\t\t\t{\n\t\t\t\t\t\tenv: {\n\t\t\t\t\t\t\tNPM_TOKEN: \"${{ secrets.NPM_TOKEN }}\",\n\t\t\t\t\t\t},\n\t\t\t\t\t\trun: \"npm config set //registry.npmjs.org/:_authToken $NPM_TOKEN\",\n\t\t\t\t\t},\n\t\t\t\t\t{\n\t\t\t\t\t\tname: \"Delete branch protection on main\",\n\t\t\t\t\t\tuses: \"actions/github-script@v6.4.1\",\n\t\t\t\t\t\twith: {\n\t\t\t\t\t\t\t\"github-token\": \"${{ secrets.ACCESS_TOKEN }}\",\n\t\t\t\t\t\t\tscript: `\n\t\t\t\t\t\t\t\ttry {\n\t\t\t\t\t\t\t\t\tawait github.request(\n\t\t\t\t\t\t\t\t\t \\`DELETE /repos/${options.owner}/${options.repository}/branches/main/protection\\`,\n\t\t\t\t\t\t\t\t\t);\n\t\t\t\t\t\t\t\t} catch (error) {\n\t\t\t\t\t\t\t\t\tif (!error.message?.includes?.(\"Branch not protected\")) {\n\t\t\t\t\t\t\t\t\t\tthrow error;\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t}`,\n\t\t\t\t\t\t},\n\t\t\t\t\t},\n\t\t\t\t\t{\n\t\t\t\t\t\tenv: {\n\t\t\t\t\t\t\tGITHUB_TOKEN: \"${{ secrets.ACCESS_TOKEN }}\",\n\t\t\t\t\t\t},\n\t\t\t\t\t\trun: `\n\t\t\t\t\t\tif pnpm run should-semantic-release ; then\n\t\t\t\t\t\t pnpm release-it --verbose\n\t\t\t\t\t\t gh workflow run post-release.yml\n\t\t\t\t\t\tfi`,\n\t\t\t\t\t},\n\t\t\t\t\t{\n\t\t\t\t\t\tif: \"always()\",\n\t\t\t\t\t\tname: \"Recreate branch protection on main\",\n\t\t\t\t\t\tuses: \"actions/github-script@v6.4.1\",\n\t\t\t\t\t\twith: {\n\t\t\t\t\t\t\t\"github-token\": \"${{ secrets.ACCESS_TOKEN }}\",\n\t\t\t\t\t\t\tscript: `\n\t\t\t\t\t\t\tgithub.request(\n\t\t\t\t\t\t\t \\`PUT /repos/${options.owner}/${options.repository}/branches/main/protection\\`,\n\t\t\t\t\t\t\t {\n\t\t\t\t\t\t\t\t allow_deletions: false,\n\t\t\t\t\t\t\t\t allow_force_pushes: true,\n\t\t\t\t\t\t\t\t allow_fork_pushes: false,\n\t\t\t\t\t\t\t\t allow_fork_syncing: true,\n\t\t\t\t\t\t\t\t block_creations: false,\n\t\t\t\t\t\t\t\t branch: \"main\",\n\t\t\t\t\t\t\t\t enforce_admins: false,\n\t\t\t\t\t\t\t\t owner: \"${options.owner}\",\n\t\t\t\t\t\t\t\t repo: \"${options.repository}\",\n\t\t\t\t\t\t\t\t required_conversation_resolution: true,\n\t\t\t\t\t\t\t\t required_linear_history: false,\n\t\t\t\t\t\t\t\t required_pull_request_reviews: null,\n\t\t\t\t\t\t\t\t required_status_checks: {\n\t\t\t\t\t\t\t\t\tchecks: [\n\t\t\t\t\t\t\t\t\t { context: \"build\" },\n\t\t\t\t\t\t\t\t\t { context: \"compliance\" },\n\t\t\t\t\t\t\t\t\t { context: \"lint\" },\n\t\t\t\t\t\t\t\t\t { context: \"lint_knip\" },\n\t\t\t\t\t\t\t\t\t { context: \"lint_markdown\" },\n\t\t\t\t\t\t\t\t\t { context: \"lint_package_json\" },\n\t\t\t\t\t\t\t\t\t { context: \"lint_packages\" },\n\t\t\t\t\t\t\t\t\t { context: \"lint_spelling\" },\n\t\t\t\t\t\t\t\t\t { context: \"prettier\" },\n\t\t\t\t\t\t\t\t\t { context: \"test\" },\n\t\t\t\t\t\t\t\t\t],\n\t\t\t\t\t\t\t\t\tstrict: false,\n\t\t\t\t\t\t\t\t },\n\t\t\t\t\t\t\t\t restrictions: null,\n\t\t\t\t\t\t\t }\n\t\t\t\t\t\t\t);\n\t\t\t\t\t\t`,\n\t\t\t\t\t\t},\n\t\t\t\t\t},\n\t\t\t\t],\n\t\t\t}),\n\t\t}),\n\t\t...(options.excludeTests && {\n\t\t\t\"test.yml\": createWorkflowFile({\n\t\t\t\tname: \"Test\",\n\t\t\t\tsteps: [\n\t\t\t\t\t{ uses: \"actions/checkout@v4\" },\n\t\t\t\t\t{ uses: \"./.github/actions/prepare\" },\n\t\t\t\t\t{ run: \"pnpm run test --coverage\" },\n\t\t\t\t\t{\n\t\t\t\t\t\tname: \"Codecov\",\n\t\t\t\t\t\tuses: \"codecov/codecov-action@v3\",\n\t\t\t\t\t\twith: { \"github-token\": \"${{ secrets.GITHUB_TOKEN }}\" },\n\t\t\t\t\t},\n\t\t\t\t],\n\t\t\t}),\n\t\t}),\n\t};\n}\n"],"mappings":"AAEA,SAAS,0BAA0B;AAE5B,SAAS,gBAAgB,SAAkB;AACjD,SAAO;AAAA,IACN,aAAa,mBAAmB;AAAA,MAC/B,MAAM;AAAA,MACN,MAAM,CAAC,cAAc,qBAAqB;AAAA,IAC3C,CAAC;AAAA,IACD,2BAA2B,mBAAmB;AAAA,MAC7C,MAAM;AAAA,MACN,IAAI;AAAA,QACH,qBAAqB;AAAA,UACpB,OAAO,CAAC,kBAAkB;AAAA,QAC3B;AAAA,MACD;AAAA,MACA,aAAa;AAAA,QACZ,iBAAiB;AAAA,MAClB;AAAA,MACA,OAAO;AAAA,QACN;AAAA,UACC,MAAM;AAAA,UACN,MAAM;AAAA,YACL,QAAQ;AAAA,UACT;AAAA,QACD;AAAA,QACA;AAAA,UACC,IAAI;AAAA,UACJ,KAAK;AAAA;AAAA;AAAA,QACN;AAAA,MACD;AAAA,IACD,CAAC;AAAA,IACD,gBAAgB,mBAAmB;AAAA,MAClC,MAAM;AAAA,MACN,MAAM,CAAC,8BAA8B;AAAA,IACtC,CAAC;AAAA,IACD,WAAW,mBAAmB;AAAA,MAC7B,MAAM;AAAA,MACN,MAAM,CAAC,UAAU;AAAA,IAClB,CAAC;AAAA,IACD,GAAI,CAAC,QAAQ,qBAAqB;AAAA,MACjC,kBAAkB,mBAAmB;AAAA,QACpC,MAAM;AAAA,QACN,IAAI;AAAA,UACH,cAAc;AAAA,YACb,UAAU,CAAC,MAAM;AAAA,YACjB,OAAO,CAAC,UAAU,UAAU,YAAY,aAAa;AAAA,UACtD;AAAA,QACD;A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AAAA,YACN,MAAM,EAAE,gBAAgB,8BAA8B;AAAA,UACvD;AAAA,QACD;AAAA,MACD,CAAC;AAAA,IACF;AAAA,EACD;AACD;","names":[]}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "create-typescript-app",
|
|
3
|
-
"version": "1.29.
|
|
3
|
+
"version": "1.29.40",
|
|
4
4
|
"description": "Quickstart-friendly TypeScript template with comprehensive formatting, linting, releases, testing, and other great tooling built-in. ✨",
|
|
5
5
|
"repository": {
|
|
6
6
|
"type": "git",
|
|
@@ -56,7 +56,9 @@
|
|
|
56
56
|
"octokit": "^3.1.0",
|
|
57
57
|
"prettier": "^3.0.2",
|
|
58
58
|
"replace-in-file": "^7.0.1",
|
|
59
|
-
"title-case": "^3.0.3"
|
|
59
|
+
"title-case": "^3.0.3",
|
|
60
|
+
"zod": "^3.22.2",
|
|
61
|
+
"zod-validation-error": "^1.5.0"
|
|
60
62
|
},
|
|
61
63
|
"devDependencies": {
|
|
62
64
|
"@octokit/request-error": "^5.0.0",
|
|
@@ -73,7 +75,7 @@
|
|
|
73
75
|
"cspell": "^7.0.1",
|
|
74
76
|
"eslint": "^8.48.0",
|
|
75
77
|
"eslint-config-prettier": "^9.0.0",
|
|
76
|
-
"eslint-plugin-deprecation": "^
|
|
78
|
+
"eslint-plugin-deprecation": "^2.0.0",
|
|
77
79
|
"eslint-plugin-eslint-comments": "^3.2.0",
|
|
78
80
|
"eslint-plugin-import": "^2.28.1",
|
|
79
81
|
"eslint-plugin-jsdoc": "^46.5.0",
|
|
@@ -88,7 +90,7 @@
|
|
|
88
90
|
"globby": "^13.2.2",
|
|
89
91
|
"husky": "^8.0.3",
|
|
90
92
|
"jsonc-eslint-parser": "^2.3.0",
|
|
91
|
-
"knip": "2.
|
|
93
|
+
"knip": "2.24.1",
|
|
92
94
|
"lint-staged": "^14.0.1",
|
|
93
95
|
"markdownlint": "^0.31.0",
|
|
94
96
|
"markdownlint-cli": "^0.36.0",
|
|
@@ -105,7 +107,7 @@
|
|
|
105
107
|
"vitest": "^0.34.3",
|
|
106
108
|
"yaml-eslint-parser": "^1.2.2"
|
|
107
109
|
},
|
|
108
|
-
"packageManager": "pnpm@8.7.
|
|
110
|
+
"packageManager": "pnpm@8.7.5",
|
|
109
111
|
"engines": {
|
|
110
112
|
"node": ">=18"
|
|
111
113
|
},
|