create-typescript-app 1.43.1 → 1.43.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -20,27 +20,28 @@ async function withSpinners(label, tasks) {
20
20
  logNewSection(`${label}...`);
21
21
  let currentLabel;
22
22
  let lastLogged;
23
- try {
24
- for (const [label2, run] of tasks) {
25
- currentLabel = label2;
26
- const line = makeLine(chalk.gray(` - ${label2}`));
27
- const stopWriting = startLineWithDots(line);
23
+ for (const [label2, run] of tasks) {
24
+ currentLabel = label2;
25
+ const line = makeLine(chalk.gray(` - ${label2}`));
26
+ const stopWriting = startLineWithDots(line);
27
+ try {
28
28
  await run();
29
+ } catch (error) {
30
+ const descriptor = `${lowerFirst(label2)} > ${lowerFirst(currentLabel)}`;
31
+ logLine(chalk.red(`\u274C Error ${descriptor}.`));
32
+ throw new Error(`Failed ${descriptor}`, { cause: error });
33
+ } finally {
29
34
  const lineLength = stopWriting();
30
- lastLogged = chalk.gray(`${line} \u2714\uFE0F
31
- `);
32
35
  readline.clearLine(process.stdout, -1);
33
36
  readline.moveCursor(process.stdout, -lineLength, 0);
34
- process.stdout.write(lastLogged);
35
37
  }
36
- readline.moveCursor(process.stdout, -lastLogged.length, -tasks.length - 2);
37
- readline.clearScreenDown(process.stdout);
38
- logNewSection(chalk.green(`\u2705 Passed ${lowerFirst(label)}.`));
39
- } catch (error) {
40
- const descriptor = `${lowerFirst(label)} > ${lowerFirst(currentLabel)}`;
41
- logLine(chalk.red(`\u274C Error ${descriptor}.`));
42
- throw new Error(`Failed ${descriptor}`, { cause: error });
38
+ lastLogged = chalk.gray(`${line} \u2714\uFE0F
39
+ `);
40
+ process.stdout.write(lastLogged);
43
41
  }
42
+ readline.moveCursor(process.stdout, -lastLogged.length, -tasks.length - 2);
43
+ readline.clearScreenDown(process.stdout);
44
+ logNewSection(chalk.green(`\u2705 Passed ${lowerFirst(label)}.`));
44
45
  }
45
46
  export {
46
47
  withSpinner,
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../src/shared/cli/spinners.ts"],"sourcesContent":["import * as prompts from \"@clack/prompts\";\nimport chalk from \"chalk\";\nimport readline from \"readline\";\n\nimport { logLine, logNewSection, makeLine } from \"./lines.js\";\nimport { lowerFirst } from \"./lowerFirst.js\";\nimport { startLineWithDots } from \"./startLineWithDots.js\";\n\nconst s = prompts.spinner();\n\nexport type SpinnerTask<Return> = () => Promise<Return>;\n\nexport type LabeledSpinnerTask<Return> = [string, SpinnerTask<Return>];\n\nexport async function withSpinner<Return>(\n\tlabel: string,\n\ttask: SpinnerTask<Return>,\n) {\n\ts.start(`${label}...`);\n\n\ttry {\n\t\tconst result = await task();\n\n\t\ts.stop(chalk.green(`✅ Passed ${lowerFirst(label)}.`));\n\n\t\treturn result;\n\t} catch (error) {\n\t\ts.stop(chalk.red(`❌ Error ${lowerFirst(label)}.`));\n\n\t\tthrow new Error(`Failed ${lowerFirst(label)}`, { cause: error });\n\t}\n}\n\nexport async function withSpinners(\n\tlabel: string,\n\ttasks: LabeledSpinnerTask<void>[],\n) {\n\tlogNewSection(`${label}...`);\n\n\tlet currentLabel!: string;\n\tlet lastLogged!: string;\n\n\ttry {\n\t\tfor (const [label, run] of tasks) {\n\t\t\tcurrentLabel = label;\n\n\t\t\tconst line = makeLine(chalk.gray(` - ${label}`));\n\t\t\tconst stopWriting = startLineWithDots(line);\n\n\t\t\tawait run();\n\n\t\t\tconst lineLength = stopWriting();\n\t\t\tlastLogged = chalk.gray(`${line} ✔️\\n`);\n\n\t\t\treadline.clearLine(process.stdout, -1);\n\t\t\treadline.moveCursor(process.stdout, -lineLength, 0);\n\t\t\tprocess.stdout.write(lastLogged);\n\t\t}\n\n\t\treadline.moveCursor(process.stdout, -lastLogged.length, -tasks.length - 2);\n\t\treadline.clearScreenDown(process.stdout);\n\n\t\tlogNewSection(chalk.green(`✅ Passed ${lowerFirst(label)}.`));\n\t} catch (error) {\n\t\tconst descriptor = `${lowerFirst(label)} > ${lowerF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MAAM;AAEvC,kBAAc,MAAM,MAAM,iBAAY,WAAW,KAAK,CAAC,GAAG,CAAC;AAAA,EAC5D,SAAS,OAAO;AACf,UAAM,aAAa,GAAG,WAAW,KAAK,CAAC,MAAM,WAAW,YAAY,CAAC;AAErE,YAAQ,MAAM,IAAI,gBAAW,UAAU,GAAG,CAAC;AAE3C,UAAM,IAAI,MAAM,UAAU,UAAU,IAAI,EAAE,OAAO,MAAM,CAAC;AAAA,EACzD;AACD;","names":["label"]}
1
+ {"version":3,"sources":["../../../src/shared/cli/spinners.ts"],"sourcesContent":["import * as prompts from \"@clack/prompts\";\nimport chalk from \"chalk\";\nimport readline from \"readline\";\n\nimport { logLine, logNewSection, makeLine } from \"./lines.js\";\nimport { lowerFirst } from \"./lowerFirst.js\";\nimport { startLineWithDots } from \"./startLineWithDots.js\";\n\nconst s = prompts.spinner();\n\nexport type SpinnerTask<Return> = () => Promise<Return>;\n\nexport type LabeledSpinnerTask<Return> = [string, SpinnerTask<Return>];\n\nexport async function withSpinner<Return>(\n\tlabel: string,\n\ttask: SpinnerTask<Return>,\n) {\n\ts.start(`${label}...`);\n\n\ttry {\n\t\tconst result = await task();\n\n\t\ts.stop(chalk.green(`✅ Passed ${lowerFirst(label)}.`));\n\n\t\treturn result;\n\t} catch (error) {\n\t\ts.stop(chalk.red(`❌ Error ${lowerFirst(label)}.`));\n\n\t\tthrow new Error(`Failed ${lowerFirst(label)}`, { cause: error });\n\t}\n}\n\nexport async function withSpinners(\n\tlabel: string,\n\ttasks: LabeledSpinnerTask<void>[],\n) {\n\tlogNewSection(`${label}...`);\n\n\tlet currentLabel!: string;\n\tlet lastLogged!: string;\n\n\tfor (const [label, run] of tasks) {\n\t\tcurrentLabel = label;\n\n\t\tconst line = makeLine(chalk.gray(` - ${label}`));\n\t\tconst stopWriting = startLineWithDots(line);\n\n\t\ttry {\n\t\t\tawait run();\n\t\t} catch (error) {\n\t\t\tconst descriptor = `${lowerFirst(label)} > ${lowerFirst(currentLabel)}`;\n\n\t\t\tlogLine(chalk.red(`❌ Error ${descriptor}.`));\n\n\t\t\tthrow new Error(`Failed ${descriptor}`, { cause: error });\n\t\t} finally {\n\t\t\tconst lineLength = stopWriting();\n\t\t\treadline.clearLine(process.stdout, -1);\n\t\t\treadline.moveCursor(process.stdout, -lineLength, 0);\n\t\t}\n\n\t\tlastLogged = chalk.gray(`${line} ✔️\\n`);\n\n\t\tprocess.stdout.write(lastLogged);\n\t}\n\n\treadline.moveCursor(process.stdout, -lastLogged.length, -tasks.length - 2);\n\treadline.clearScreenDown(process.stdout);\n\n\tlogNewSection(chalk.green(`✅ Passed ${lowerFirst(label)}.`));\n}\n"],"mappings":"AAAA,YAAY,aAAa;AACzB,OAAO,WAAW;AAClB,OAAO,cAAc;AAErB,SAAS,SAAS,eAAe,gBAAgB;AACjD,SAAS,kBAAkB;AAC3B,SAAS,yBAAyB;AAElC,MAAM,IAAI,QAAQ,QAAQ;AAM1B,eAAsB,YACrB,OACA,MACC;AACD,IAAE,MAAM,GAAG,KAAK,KAAK;AAErB,MAAI;AACH,UAAM,SAAS,MAAM,KAAK;AAE1B,MAAE,KAAK,MAAM,MAAM,iBAAY,WAAW,KAAK,CAAC,GAAG,CAAC;AAEpD,WAAO;AAAA,EACR,SAAS,OAAO;AACf,MAAE,KAAK,MAAM,IAAI,gBAAW,WAAW,KAAK,CAAC,GAAG,CAAC;AAEjD,UAAM,IAAI,MAAM,UAAU,WAAW,KAAK,CAAC,IAAI,EAAE,OAAO,MAAM,CAAC;AAAA,EAChE;AACD;AAEA,eAAsB,aACrB,OACA,OACC;AACD,gBAAc,GAAG,KAAK,KAAK;AAE3B,MAAI;AACJ,MAAI;AAEJ,aAAW,CAACA,QAAO,GAAG,KAAK,OAAO;AACjC,mBAAeA;AAEf,UAAM,OAAO,SAAS,MAAM,KAAK,MAAMA,MAAK,EAAE,CAAC;AAC/C,UAAM,cAAc,kBAAkB,IAAI;AAE1C,QAAI;AACH,YAAM,IAAI;AAAA,IACX,SAAS,OAAO;AACf,YAAM,aAAa,GAAG,WAAWA,MAAK,CAAC,MAAM,WAAW,YAAY,CAAC;AAErE,cAAQ,MAAM,IAAI,gBAAW,UAAU,GAAG,CAAC;AAE3C,YAAM,IAAI,MAAM,UAAU,UAAU,IAAI,EAAE,OAAO,MAAM,CAAC;AAAA,IACzD,UAAE;AACD,YAAM,aAAa,YAAY;AAC/B,eAAS,UAAU,QAAQ,QAAQ,EAAE;AACrC,eAAS,WAAW,QAAQ,QAAQ,CAAC,YAAY,CAAC;AAAA,IACnD;AAEA,iBAAa,MAAM,KAAK,GAAG,IAAI;AAAA,CAAO;AAEtC,YAAQ,OAAO,MAAM,UAAU;AAAA,EAChC;AAEA,WAAS,WAAW,QAAQ,QAAQ,CAAC,WAAW,QAAQ,CAAC,MAAM,SAAS,CAAC;AACzE,WAAS,gBAAgB,QAAQ,MAAM;AAEvC,gBAAc,MAAM,MAAM,iBAAY,WAAW,KAAK,CAAC,GAAG,CAAC;AAC5D;","names":["label"]}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "create-typescript-app",
3
- "version": "1.43.1",
3
+ "version": "1.43.2",
4
4
  "description": "Quickstart-friendly TypeScript template with comprehensive, configurable, opinionated tooling. 💝",
5
5
  "repository": {
6
6
  "type": "git",
@@ -74,7 +74,7 @@
74
74
  "@vitest/coverage-v8": "^0.34.3",
75
75
  "c8": "^8.0.1",
76
76
  "console-fail-test": "^0.2.3",
77
- "cspell": "^7.0.1",
77
+ "cspell": "^8.0.0",
78
78
  "eslint": "^8.48.0",
79
79
  "eslint-plugin-deprecation": "^2.0.0",
80
80
  "eslint-plugin-eslint-comments": "^3.2.0",
@@ -90,7 +90,7 @@
90
90
  "globby": "^13.2.2",
91
91
  "husky": "^8.0.3",
92
92
  "jsonc-eslint-parser": "^2.3.0",
93
- "knip": "2.39.0",
93
+ "knip": "2.40.0",
94
94
  "lint-staged": "^15.0.0",
95
95
  "markdownlint": "^0.31.0",
96
96
  "markdownlint-cli": "^0.37.0",