create-typescript-app 2.19.1 → 2.20.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.
@@ -1,3 +1,4 @@
1
+ import _ from "lodash";
1
2
  import { z } from "zod";
2
3
  import { base } from "../base.js";
3
4
  import { resolveUses } from "./actions/resolveUses.js";
@@ -5,11 +6,33 @@ import { blockGitHubApps } from "./blockGitHubApps.js";
5
6
  import { blockREADME } from "./blockREADME.js";
6
7
  import { blockRemoveFiles } from "./blockRemoveFiles.js";
7
8
  import { blockVitest } from "./blockVitest.js";
9
+ import { intakeFileAsYaml } from "./intake/intakeFileAsYaml.js";
8
10
  const blockCodecov = base.createBlock({
9
11
  about: {
10
12
  name: "Codecov"
11
13
  },
12
- addons: { env: z.record(z.string(), z.string()).optional() },
14
+ addons: {
15
+ env: z.record(z.string(), z.string()).optional()
16
+ },
17
+ intake({ files }) {
18
+ const ciYaml = intakeFileAsYaml(files, [".github", "workflows", "ci.yml"]);
19
+ if (!ciYaml) {
20
+ return void 0;
21
+ }
22
+ const steps = _.get(ciYaml, ["jobs", "test", "steps"]);
23
+ if (!steps) {
24
+ return void 0;
25
+ }
26
+ const step = steps.find(
27
+ (step2) => typeof step2.uses === "string" && step2.uses.startsWith("codecov/codecov-action")
28
+ );
29
+ if (!step) {
30
+ return void 0;
31
+ }
32
+ return {
33
+ env: step.env
34
+ };
35
+ },
13
36
  produce({ addons, options }) {
14
37
  const { env } = addons;
15
38
  return {
@@ -0,0 +1,5 @@
1
+ import { IntakeDirectory, IntakeFileEntry } from 'bingo-fs';
2
+
3
+ declare function intakeFile(files: IntakeDirectory, filePath: string[]): IntakeFileEntry | undefined;
4
+
5
+ export { intakeFile };
@@ -0,0 +1,13 @@
1
+ function intakeFile(files, filePath) {
2
+ if (!filePath.length) {
3
+ return void 0;
4
+ }
5
+ const entry = files[filePath[0]];
6
+ if (filePath.length === 1) {
7
+ return Array.isArray(entry) ? entry : void 0;
8
+ }
9
+ return typeof entry === "object" && !Array.isArray(entry) ? intakeFile(entry, filePath.slice(1)) : void 0;
10
+ }
11
+ export {
12
+ intakeFile
13
+ };
@@ -0,0 +1,5 @@
1
+ import { IntakeDirectory } from 'bingo-fs';
2
+
3
+ declare function intakeFileAsYaml(files: IntakeDirectory, filePath: string[]): unknown;
4
+
5
+ export { intakeFileAsYaml };
@@ -0,0 +1,13 @@
1
+ import jsYaml from "js-yaml";
2
+ import { intakeFile } from "./intakeFile.js";
3
+ function intakeFileAsYaml(files, filePath) {
4
+ const file = intakeFile(files, filePath);
5
+ try {
6
+ return file && jsYaml.load(file[0]);
7
+ } catch {
8
+ return void 0;
9
+ }
10
+ }
11
+ export {
12
+ intakeFileAsYaml
13
+ };
@@ -33,9 +33,9 @@ var scripts = {
33
33
  tsc: "tsc"
34
34
  };
35
35
  var dependencies = {
36
- bingo: "^0.5.11",
37
- "bingo-fs": "^0.5.4",
38
- "bingo-stratum": "^0.5.8",
36
+ bingo: "^0.5.12",
37
+ "bingo-fs": "^0.5.5",
38
+ "bingo-stratum": "^0.5.9",
39
39
  "cached-factory": "^0.1.0",
40
40
  "cspell-populate-words": "^0.3.0",
41
41
  execa: "^9.5.2",
@@ -82,13 +82,13 @@ var devDependencies = {
82
82
  "@vitest/eslint-plugin": "1.1.38",
83
83
  "all-contributors-cli": "6.26.1",
84
84
  "bingo-requests": "0.5.5",
85
- "bingo-stratum-testers": "0.5.7",
85
+ "bingo-stratum-testers": "0.5.8",
86
86
  "bingo-testers": "0.5.7",
87
87
  "console-fail-test": "0.5.0",
88
88
  cspell: "8.17.5",
89
89
  eslint: "9.22.0",
90
90
  "eslint-plugin-jsdoc": "50.6.8",
91
- "eslint-plugin-jsonc": "2.19.1",
91
+ "eslint-plugin-jsonc": "2.20.0",
92
92
  "eslint-plugin-markdown": "5.1.0",
93
93
  "eslint-plugin-n": "17.16.2",
94
94
  "eslint-plugin-package-json": "0.29.0",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "create-typescript-app",
3
- "version": "2.19.1",
3
+ "version": "2.20.0",
4
4
  "description": "Quickstart-friendly TypeScript template with comprehensive, configurable, opinionated tooling. 🎁",
5
5
  "repository": {
6
6
  "type": "git",
@@ -37,9 +37,9 @@
37
37
  "*": "prettier --ignore-unknown --write"
38
38
  },
39
39
  "dependencies": {
40
- "bingo": "^0.5.11",
41
- "bingo-fs": "^0.5.4",
42
- "bingo-stratum": "^0.5.8",
40
+ "bingo": "^0.5.12",
41
+ "bingo-fs": "^0.5.5",
42
+ "bingo-stratum": "^0.5.9",
43
43
  "cached-factory": "^0.1.0",
44
44
  "cspell-populate-words": "^0.3.0",
45
45
  "execa": "^9.5.2",
@@ -86,13 +86,13 @@
86
86
  "@vitest/eslint-plugin": "1.1.38",
87
87
  "all-contributors-cli": "6.26.1",
88
88
  "bingo-requests": "0.5.5",
89
- "bingo-stratum-testers": "0.5.7",
89
+ "bingo-stratum-testers": "0.5.8",
90
90
  "bingo-testers": "0.5.7",
91
91
  "console-fail-test": "0.5.0",
92
92
  "cspell": "8.17.5",
93
93
  "eslint": "9.22.0",
94
94
  "eslint-plugin-jsdoc": "50.6.8",
95
- "eslint-plugin-jsonc": "2.19.1",
95
+ "eslint-plugin-jsonc": "2.20.0",
96
96
  "eslint-plugin-markdown": "5.1.0",
97
97
  "eslint-plugin-n": "17.16.2",
98
98
  "eslint-plugin-package-json": "0.29.0",