create-typescript-app 2.9.0 → 2.9.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.
Files changed (83) hide show
  1. package/lib/base.d.ts +15 -25
  2. package/lib/base.js +9 -9
  3. package/lib/blocks/actions/resolveUses.d.ts +6 -0
  4. package/lib/blocks/actions/resolveUses.js +26 -0
  5. package/lib/blocks/blockAllContributors.d.ts +4 -0
  6. package/lib/blocks/blockAllContributors.js +14 -2
  7. package/lib/blocks/blockAreTheTypesWrong.d.ts +4 -0
  8. package/lib/blocks/blockCSpell.d.ts +4 -0
  9. package/lib/blocks/blockCTATransitions.d.ts +4 -0
  10. package/lib/blocks/blockCTATransitions.js +12 -3
  11. package/lib/blocks/blockCodecov.d.ts +4 -0
  12. package/lib/blocks/blockCodecov.js +7 -2
  13. package/lib/blocks/blockContributingDocs.d.ts +4 -0
  14. package/lib/blocks/blockContributorCovenant.d.ts +4 -0
  15. package/lib/blocks/blockDevelopmentDocs.d.ts +4 -0
  16. package/lib/blocks/blockESLint.d.ts +4 -0
  17. package/lib/blocks/blockESLintComments.d.ts +4 -0
  18. package/lib/blocks/blockESLintJSDoc.d.ts +4 -0
  19. package/lib/blocks/blockESLintJSONC.d.ts +4 -0
  20. package/lib/blocks/blockESLintMarkdown.d.ts +4 -0
  21. package/lib/blocks/blockESLintMoreStyling.d.ts +4 -0
  22. package/lib/blocks/blockESLintNode.d.ts +4 -0
  23. package/lib/blocks/blockESLintPackageJson.d.ts +4 -0
  24. package/lib/blocks/blockESLintPerfectionist.d.ts +4 -0
  25. package/lib/blocks/blockESLintRegexp.d.ts +4 -0
  26. package/lib/blocks/blockESLintYML.d.ts +4 -0
  27. package/lib/blocks/blockExampleFiles.d.ts +4 -0
  28. package/lib/blocks/blockFunding.d.ts +4 -0
  29. package/lib/blocks/blockGitHubActionsCI.d.ts +4 -0
  30. package/lib/blocks/blockGitHubActionsCI.js +45 -24
  31. package/lib/blocks/blockGitHubApps.d.ts +4 -0
  32. package/lib/blocks/blockGitHubIssueTemplates.d.ts +4 -0
  33. package/lib/blocks/blockGitHubPRTemplate.d.ts +4 -0
  34. package/lib/blocks/blockGitignore.d.ts +4 -0
  35. package/lib/blocks/blockKnip.d.ts +4 -0
  36. package/lib/blocks/blockMITLicense.d.ts +4 -0
  37. package/lib/blocks/blockMarkdownlint.d.ts +4 -0
  38. package/lib/blocks/blockNvmrc.d.ts +4 -0
  39. package/lib/blocks/blockPRCompliance.d.ts +4 -0
  40. package/lib/blocks/blockPRCompliance.js +7 -2
  41. package/lib/blocks/blockPackageJson.d.ts +4 -0
  42. package/lib/blocks/blockPnpmDedupe.d.ts +4 -0
  43. package/lib/blocks/blockPnpmDedupe.js +1 -1
  44. package/lib/blocks/blockPrettier.d.ts +4 -0
  45. package/lib/blocks/blockPrettierPluginCurly.d.ts +4 -0
  46. package/lib/blocks/blockPrettierPluginPackageJson.d.ts +4 -0
  47. package/lib/blocks/blockPrettierPluginSh.d.ts +4 -0
  48. package/lib/blocks/blockREADME.d.ts +4 -0
  49. package/lib/blocks/blockReleaseIt.d.ts +4 -0
  50. package/lib/blocks/blockReleaseIt.js +24 -4
  51. package/lib/blocks/blockRemoveDependencies.d.ts +4 -0
  52. package/lib/blocks/blockRemoveFiles.d.ts +4 -0
  53. package/lib/blocks/blockRenovate.d.ts +4 -0
  54. package/lib/blocks/blockRepositoryBranchRuleset.d.ts +4 -0
  55. package/lib/blocks/blockRepositoryLabels.d.ts +4 -0
  56. package/lib/blocks/blockRepositorySecrets.d.ts +4 -0
  57. package/lib/blocks/blockRepositorySettings.d.ts +4 -0
  58. package/lib/blocks/blockSecurityDocs.d.ts +4 -0
  59. package/lib/blocks/blockTSup.d.ts +4 -0
  60. package/lib/blocks/blockTemplatedWith.d.ts +4 -0
  61. package/lib/blocks/blockTypeScript.d.ts +4 -0
  62. package/lib/blocks/blockVSCode.d.ts +4 -0
  63. package/lib/blocks/blockVitest.d.ts +4 -0
  64. package/lib/blocks/files/createMultiWorkflowFile.d.ts +5 -1
  65. package/lib/blocks/files/createMultiWorkflowFile.js +7 -2
  66. package/lib/blocks/files/formatYaml.js +2 -1
  67. package/lib/blocks/files/removeUsesQuotes.d.ts +3 -0
  68. package/lib/blocks/files/removeUsesQuotes.js +9 -0
  69. package/lib/blocks/index.d.ts +172 -0
  70. package/lib/data/packageData.d.ts +2 -1
  71. package/lib/index.d.ts +15 -1
  72. package/lib/inputs/inputFromDirectory.d.ts +8 -0
  73. package/lib/inputs/inputFromDirectory.js +13 -0
  74. package/lib/options/readWorkflowsVersions.d.ts +7 -0
  75. package/lib/options/readWorkflowsVersions.js +62 -0
  76. package/lib/presets/common.d.ts +10 -0
  77. package/lib/presets/everything.d.ts +10 -0
  78. package/lib/presets/index.d.ts +30 -0
  79. package/lib/presets/minimal.d.ts +10 -0
  80. package/lib/schemas.d.ts +57 -0
  81. package/lib/schemas.js +20 -0
  82. package/lib/template.d.ts +10 -0
  83. package/package.json +2 -1
package/lib/base.d.ts CHANGED
@@ -2,26 +2,6 @@ import * as bingo_stratum from 'bingo-stratum';
2
2
  import { BaseOptionsFor } from 'bingo-stratum';
3
3
  import { z } from 'zod';
4
4
 
5
- declare const zContributor: z.ZodObject<{
6
- avatar_url: z.ZodString;
7
- contributions: z.ZodArray<z.ZodString, "many">;
8
- login: z.ZodString;
9
- name: z.ZodString;
10
- profile: z.ZodString;
11
- }, "strip", z.ZodTypeAny, {
12
- avatar_url: string;
13
- contributions: string[];
14
- login: string;
15
- name: string;
16
- profile: string;
17
- }, {
18
- avatar_url: string;
19
- contributions: string[];
20
- login: string;
21
- name: string;
22
- profile: string;
23
- }>;
24
- type Contributor = z.infer<typeof zContributor>;
25
5
  declare const base: bingo_stratum.Base<{
26
6
  access: z.ZodUnion<[z.ZodLiteral<"public">, z.ZodLiteral<"restricted">]>;
27
7
  author: z.ZodOptional<z.ZodString>;
@@ -33,16 +13,16 @@ declare const base: bingo_stratum.Base<{
33
13
  name: z.ZodString;
34
14
  profile: z.ZodString;
35
15
  }, "strip", z.ZodTypeAny, {
16
+ name: string;
36
17
  avatar_url: string;
37
18
  contributions: string[];
38
19
  login: string;
39
- name: string;
40
20
  profile: string;
41
21
  }, {
22
+ name: string;
42
23
  avatar_url: string;
43
24
  contributions: string[];
44
25
  login: string;
45
- name: string;
46
26
  profile: string;
47
27
  }>, "many">>;
48
28
  description: z.ZodDefault<z.ZodString>;
@@ -84,11 +64,11 @@ declare const base: bingo_stratum.Base<{
84
64
  href: z.ZodString;
85
65
  title: z.ZodString;
86
66
  }, "strip", z.ZodTypeAny, {
87
- href: string;
88
67
  title: string;
89
- }, {
90
68
  href: string;
69
+ }, {
91
70
  title: string;
71
+ href: string;
92
72
  }>>;
93
73
  keywords: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
94
74
  logo: z.ZodOptional<z.ZodObject<{
@@ -137,7 +117,17 @@ declare const base: bingo_stratum.Base<{
137
117
  title: z.ZodString;
138
118
  usage: z.ZodOptional<z.ZodString>;
139
119
  version: z.ZodOptional<z.ZodString>;
120
+ workflowsVersions: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodRecord<z.ZodString, z.ZodObject<{
121
+ hash: z.ZodOptional<z.ZodString>;
122
+ pinned: z.ZodOptional<z.ZodBoolean>;
123
+ }, "strip", z.ZodTypeAny, {
124
+ pinned?: boolean | undefined;
125
+ hash?: string | undefined;
126
+ }, {
127
+ pinned?: boolean | undefined;
128
+ hash?: string | undefined;
129
+ }>>>>;
140
130
  }>;
141
131
  type BaseOptions = BaseOptionsFor<typeof base>;
142
132
 
143
- export { type BaseOptions, type Contributor, base };
133
+ export { type BaseOptions, base };
package/lib/base.js CHANGED
@@ -30,13 +30,8 @@ import { readRepository } from "./options/readRepository.js";
30
30
  import { readRulesetId } from "./options/readRulesetId.js";
31
31
  import { readTitle } from "./options/readTitle.js";
32
32
  import { readUsage } from "./options/readUsage.js";
33
- const zContributor = z.object({
34
- avatar_url: z.string(),
35
- contributions: z.array(z.string()),
36
- login: z.string(),
37
- name: z.string(),
38
- profile: z.string()
39
- });
33
+ import { readWorkflowsVersions } from "./options/readWorkflowsVersions.js";
34
+ import { zContributor, zWorkflowsVersions } from "./schemas.js";
40
35
  const base = createBase({
41
36
  options: {
42
37
  access: z.union([z.literal("public"), z.literal("restricted")]).describe("which `npm publish --access` to release npm packages with"),
@@ -97,7 +92,8 @@ const base = createBase({
97
92
  rulesetId: z.string().optional().describe("GitHub branch ruleset ID for main branch protections"),
98
93
  title: z.string().describe("'Title Case' title for the repository"),
99
94
  usage: z.string().optional().describe("Markdown docs to put in README.md under the ## Usage heading"),
100
- version: z.string().optional().describe("package version to publish as and store in `package.json`")
95
+ version: z.string().optional().describe("package version to publish as and store in `package.json`"),
96
+ workflowsVersions: zWorkflowsVersions.optional().describe("existing versions of GitHub Actions workflows used")
101
97
  },
102
98
  prepare({ options, take }) {
103
99
  const getAccess = lazyValue(async () => await readAccess(getPackageData));
@@ -175,6 +171,9 @@ const base = createBase({
175
171
  async () => await readUsage(getEmoji, getReadme, getRepository)
176
172
  );
177
173
  const getVersion = lazyValue(async () => (await getPackageData()).version);
174
+ const getWorkflowData = lazyValue(
175
+ async () => await readWorkflowsVersions(take)
176
+ );
178
177
  return {
179
178
  access: getAccess,
180
179
  author: getAuthor,
@@ -197,7 +196,8 @@ const base = createBase({
197
196
  rulesetId: getRulesetId,
198
197
  title: getTitle,
199
198
  usage: getUsage,
200
- version: getVersion
199
+ version: getVersion,
200
+ workflowsVersions: getWorkflowData
201
201
  };
202
202
  }
203
203
  });
@@ -0,0 +1,6 @@
1
+ import { WorkflowsVersions } from '../../schemas.js';
2
+ import 'zod';
3
+
4
+ declare function resolveUses(action: string, version: string, workflowsVersions?: WorkflowsVersions): string;
5
+
6
+ export { resolveUses };
@@ -0,0 +1,26 @@
1
+ import { CachedFactory } from "cached-factory";
2
+ import semver from "semver";
3
+ const semverCoercions = new CachedFactory((version) => {
4
+ return semver.coerce(version)?.toString() ?? "0.0.0";
5
+ });
6
+ function resolveUses(action, version, workflowsVersions) {
7
+ if (!workflowsVersions || !(action in workflowsVersions)) {
8
+ return `${action}@${version}`;
9
+ }
10
+ const workflowVersions = workflowsVersions[action];
11
+ const biggestVersion = Object.keys(workflowVersions).reduce(
12
+ (highestVersion, potentialVersion) => semver.gt(
13
+ semverCoercions.get(potentialVersion),
14
+ semverCoercions.get(highestVersion)
15
+ ) ? potentialVersion : highestVersion,
16
+ version
17
+ );
18
+ if (!(biggestVersion in workflowVersions)) {
19
+ return `${action}@${biggestVersion}`;
20
+ }
21
+ const atBiggestVersion = workflowVersions[biggestVersion];
22
+ return atBiggestVersion.hash ? `${action}@${atBiggestVersion.hash} # ${biggestVersion}` : `${action}@${biggestVersion}`;
23
+ }
24
+ export {
25
+ resolveUses
26
+ };
@@ -53,6 +53,10 @@ declare const blockAllContributors: bingo_stratum.BlockWithoutAddons<{
53
53
  rulesetId?: string | undefined;
54
54
  usage?: string | undefined;
55
55
  version?: string | undefined;
56
+ workflowsVersions?: Record<string, Record<string, {
57
+ pinned?: boolean | undefined;
58
+ hash?: string | undefined;
59
+ }>> | undefined;
56
60
  }>;
57
61
 
58
62
  export { blockAllContributors };
@@ -1,6 +1,7 @@
1
1
  import _ from "lodash";
2
2
  import { base } from "../base.js";
3
3
  import { ownerContributions } from "../data/contributions.js";
4
+ import { resolveUses } from "./actions/resolveUses.js";
4
5
  import { blockPrettier } from "./blockPrettier.js";
5
6
  import { blockREADME } from "./blockREADME.js";
6
7
  import { blockRepositorySecrets } from "./blockRepositorySecrets.js";
@@ -54,11 +55,22 @@ const blockAllContributors = base.createBlock({
54
55
  }
55
56
  },
56
57
  steps: [
57
- { uses: "actions/checkout@v4", with: { "fetch-depth": 0 } },
58
+ {
59
+ uses: resolveUses(
60
+ "actions/checkout",
61
+ "v4",
62
+ options.workflowsVersions
63
+ ),
64
+ with: { "fetch-depth": 0 }
65
+ },
58
66
  { uses: "./.github/actions/prepare" },
59
67
  {
60
68
  env: { GITHUB_TOKEN: "${{ secrets.ACCESS_TOKEN }}" },
61
- uses: `JoshuaKGoldberg/all-contributors-auto-action@v0.5.0`
69
+ uses: resolveUses(
70
+ "JoshuaKGoldberg/all-contributors-auto-action",
71
+ "v0.5.0",
72
+ options.workflowsVersions
73
+ )
62
74
  }
63
75
  ]
64
76
  })
@@ -53,6 +53,10 @@ declare const blockAreTheTypesWrong: bingo_stratum.BlockWithoutAddons<{
53
53
  rulesetId?: string | undefined;
54
54
  usage?: string | undefined;
55
55
  version?: string | undefined;
56
+ workflowsVersions?: Record<string, Record<string, {
57
+ pinned?: boolean | undefined;
58
+ hash?: string | undefined;
59
+ }>> | undefined;
56
60
  }>;
57
61
 
58
62
  export { blockAreTheTypesWrong };
@@ -56,6 +56,10 @@ declare const blockCSpell: bingo_stratum.BlockWithAddons<{
56
56
  rulesetId?: string | undefined;
57
57
  usage?: string | undefined;
58
58
  version?: string | undefined;
59
+ workflowsVersions?: Record<string, Record<string, {
60
+ pinned?: boolean | undefined;
61
+ hash?: string | undefined;
62
+ }>> | undefined;
59
63
  }>;
60
64
 
61
65
  export { blockCSpell };
@@ -53,6 +53,10 @@ declare const blockCTATransitions: bingo_stratum.BlockWithoutAddons<{
53
53
  rulesetId?: string | undefined;
54
54
  usage?: string | undefined;
55
55
  version?: string | undefined;
56
+ workflowsVersions?: Record<string, Record<string, {
57
+ pinned?: boolean | undefined;
58
+ hash?: string | undefined;
59
+ }>> | undefined;
56
60
  }>;
57
61
 
58
62
  export { blockCTATransitions };
@@ -1,12 +1,13 @@
1
1
  import { base } from "../base.js";
2
2
  import { packageData } from "../data/packageData.js";
3
+ import { resolveUses } from "./actions/resolveUses.js";
3
4
  import { blockGitHubActionsCI } from "./blockGitHubActionsCI.js";
4
5
  import { blockPackageJson } from "./blockPackageJson.js";
5
6
  const blockCTATransitions = base.createBlock({
6
7
  about: {
7
8
  name: "CTA Transitions"
8
9
  },
9
- produce() {
10
+ produce({ options }) {
10
11
  return {
11
12
  addons: [
12
13
  blockGitHubActionsCI({
@@ -23,7 +24,11 @@ const blockCTATransitions = base.createBlock({
23
24
  steps: [
24
25
  { run: "pnpx create-typescript-app" },
25
26
  {
26
- uses: "stefanzweifel/git-auto-commit-action@v5",
27
+ uses: resolveUses(
28
+ "stefanzweifel/git-auto-commit-action",
29
+ "v5",
30
+ options.workflowsVersions
31
+ ),
27
32
  with: {
28
33
  commit_author: "The Friendly Bingo Bot <bot@create.bingo>",
29
34
  commit_message: "Check in changes from re-running npx create-typescript-app",
@@ -32,7 +37,11 @@ const blockCTATransitions = base.createBlock({
32
37
  }
33
38
  },
34
39
  {
35
- uses: "mshick/add-pr-comment@v2",
40
+ uses: resolveUses(
41
+ "mshick/add-pr-comment",
42
+ "v2",
43
+ options.workflowsVersions
44
+ ),
36
45
  with: {
37
46
  issue: "${{ github.event.pull_request.number }}",
38
47
  message: [
@@ -55,6 +55,10 @@ declare const blockCodecov: bingo_stratum.BlockWithAddons<{
55
55
  rulesetId?: string | undefined;
56
56
  usage?: string | undefined;
57
57
  version?: string | undefined;
58
+ workflowsVersions?: Record<string, Record<string, {
59
+ pinned?: boolean | undefined;
60
+ hash?: string | undefined;
61
+ }>> | undefined;
58
62
  }>;
59
63
 
60
64
  export { blockCodecov };
@@ -1,5 +1,6 @@
1
1
  import { z } from "zod";
2
2
  import { base } from "../base.js";
3
+ import { resolveUses } from "./actions/resolveUses.js";
3
4
  import { blockGitHubApps } from "./blockGitHubApps.js";
4
5
  import { blockRemoveFiles } from "./blockRemoveFiles.js";
5
6
  import { blockVitest } from "./blockVitest.js";
@@ -8,7 +9,7 @@ const blockCodecov = base.createBlock({
8
9
  name: "Codecov"
9
10
  },
10
11
  addons: { env: z.record(z.string(), z.string()).optional() },
11
- produce({ addons }) {
12
+ produce({ addons, options }) {
12
13
  const { env } = addons;
13
14
  return {
14
15
  addons: [
@@ -25,7 +26,11 @@ const blockCodecov = base.createBlock({
25
26
  {
26
27
  ...env && { env },
27
28
  if: "always()",
28
- uses: "codecov/codecov-action@v3"
29
+ uses: resolveUses(
30
+ "codecov/codecov-action",
31
+ "v3",
32
+ options.workflowsVersions
33
+ )
29
34
  }
30
35
  ]
31
36
  })
@@ -53,6 +53,10 @@ declare const blockContributingDocs: bingo_stratum.BlockWithoutAddons<{
53
53
  rulesetId?: string | undefined;
54
54
  usage?: string | undefined;
55
55
  version?: string | undefined;
56
+ workflowsVersions?: Record<string, Record<string, {
57
+ pinned?: boolean | undefined;
58
+ hash?: string | undefined;
59
+ }>> | undefined;
56
60
  }>;
57
61
 
58
62
  export { blockContributingDocs };
@@ -53,6 +53,10 @@ declare const blockContributorCovenant: bingo_stratum.BlockWithoutAddons<{
53
53
  rulesetId?: string | undefined;
54
54
  usage?: string | undefined;
55
55
  version?: string | undefined;
56
+ workflowsVersions?: Record<string, Record<string, {
57
+ pinned?: boolean | undefined;
58
+ hash?: string | undefined;
59
+ }>> | undefined;
56
60
  }>;
57
61
 
58
62
  export { blockContributorCovenant };
@@ -67,6 +67,10 @@ declare const blockDevelopmentDocs: bingo_stratum.BlockWithAddons<{
67
67
  rulesetId?: string | undefined;
68
68
  usage?: string | undefined;
69
69
  version?: string | undefined;
70
+ workflowsVersions?: Record<string, Record<string, {
71
+ pinned?: boolean | undefined;
72
+ hash?: string | undefined;
73
+ }>> | undefined;
70
74
  }>;
71
75
 
72
76
  export { blockDevelopmentDocs };
@@ -79,6 +79,10 @@ declare const blockESLint: bingo_stratum.BlockWithAddons<{
79
79
  rulesetId?: string | undefined;
80
80
  usage?: string | undefined;
81
81
  version?: string | undefined;
82
+ workflowsVersions?: Record<string, Record<string, {
83
+ pinned?: boolean | undefined;
84
+ hash?: string | undefined;
85
+ }>> | undefined;
82
86
  }>;
83
87
 
84
88
  export { blockESLint };
@@ -53,6 +53,10 @@ declare const blockESLintComments: bingo_stratum.BlockWithoutAddons<{
53
53
  rulesetId?: string | undefined;
54
54
  usage?: string | undefined;
55
55
  version?: string | undefined;
56
+ workflowsVersions?: Record<string, Record<string, {
57
+ pinned?: boolean | undefined;
58
+ hash?: string | undefined;
59
+ }>> | undefined;
56
60
  }>;
57
61
 
58
62
  export { blockESLintComments };
@@ -53,6 +53,10 @@ declare const blockESLintJSDoc: bingo_stratum.BlockWithoutAddons<{
53
53
  rulesetId?: string | undefined;
54
54
  usage?: string | undefined;
55
55
  version?: string | undefined;
56
+ workflowsVersions?: Record<string, Record<string, {
57
+ pinned?: boolean | undefined;
58
+ hash?: string | undefined;
59
+ }>> | undefined;
56
60
  }>;
57
61
 
58
62
  export { blockESLintJSDoc };
@@ -53,6 +53,10 @@ declare const blockESLintJSONC: bingo_stratum.BlockWithoutAddons<{
53
53
  rulesetId?: string | undefined;
54
54
  usage?: string | undefined;
55
55
  version?: string | undefined;
56
+ workflowsVersions?: Record<string, Record<string, {
57
+ pinned?: boolean | undefined;
58
+ hash?: string | undefined;
59
+ }>> | undefined;
56
60
  }>;
57
61
 
58
62
  export { blockESLintJSONC };
@@ -53,6 +53,10 @@ declare const blockESLintMarkdown: bingo_stratum.BlockWithoutAddons<{
53
53
  rulesetId?: string | undefined;
54
54
  usage?: string | undefined;
55
55
  version?: string | undefined;
56
+ workflowsVersions?: Record<string, Record<string, {
57
+ pinned?: boolean | undefined;
58
+ hash?: string | undefined;
59
+ }>> | undefined;
56
60
  }>;
57
61
 
58
62
  export { blockESLintMarkdown };
@@ -53,6 +53,10 @@ declare const blockESLintMoreStyling: bingo_stratum.BlockWithoutAddons<{
53
53
  rulesetId?: string | undefined;
54
54
  usage?: string | undefined;
55
55
  version?: string | undefined;
56
+ workflowsVersions?: Record<string, Record<string, {
57
+ pinned?: boolean | undefined;
58
+ hash?: string | undefined;
59
+ }>> | undefined;
56
60
  }>;
57
61
 
58
62
  export { blockESLintMoreStyling };
@@ -53,6 +53,10 @@ declare const blockESLintNode: bingo_stratum.BlockWithoutAddons<{
53
53
  rulesetId?: string | undefined;
54
54
  usage?: string | undefined;
55
55
  version?: string | undefined;
56
+ workflowsVersions?: Record<string, Record<string, {
57
+ pinned?: boolean | undefined;
58
+ hash?: string | undefined;
59
+ }>> | undefined;
56
60
  }>;
57
61
 
58
62
  export { blockESLintNode };
@@ -53,6 +53,10 @@ declare const blockESLintPackageJson: bingo_stratum.BlockWithoutAddons<{
53
53
  rulesetId?: string | undefined;
54
54
  usage?: string | undefined;
55
55
  version?: string | undefined;
56
+ workflowsVersions?: Record<string, Record<string, {
57
+ pinned?: boolean | undefined;
58
+ hash?: string | undefined;
59
+ }>> | undefined;
56
60
  }>;
57
61
 
58
62
  export { blockESLintPackageJson };
@@ -53,6 +53,10 @@ declare const blockESLintPerfectionist: bingo_stratum.BlockWithoutAddons<{
53
53
  rulesetId?: string | undefined;
54
54
  usage?: string | undefined;
55
55
  version?: string | undefined;
56
+ workflowsVersions?: Record<string, Record<string, {
57
+ pinned?: boolean | undefined;
58
+ hash?: string | undefined;
59
+ }>> | undefined;
56
60
  }>;
57
61
 
58
62
  export { blockESLintPerfectionist };
@@ -53,6 +53,10 @@ declare const blockESLintRegexp: bingo_stratum.BlockWithoutAddons<{
53
53
  rulesetId?: string | undefined;
54
54
  usage?: string | undefined;
55
55
  version?: string | undefined;
56
+ workflowsVersions?: Record<string, Record<string, {
57
+ pinned?: boolean | undefined;
58
+ hash?: string | undefined;
59
+ }>> | undefined;
56
60
  }>;
57
61
 
58
62
  export { blockESLintRegexp };
@@ -53,6 +53,10 @@ declare const blockESLintYML: bingo_stratum.BlockWithoutAddons<{
53
53
  rulesetId?: string | undefined;
54
54
  usage?: string | undefined;
55
55
  version?: string | undefined;
56
+ workflowsVersions?: Record<string, Record<string, {
57
+ pinned?: boolean | undefined;
58
+ hash?: string | undefined;
59
+ }>> | undefined;
56
60
  }>;
57
61
 
58
62
  export { blockESLintYML };
@@ -55,6 +55,10 @@ declare const blockExampleFiles: bingo_stratum.BlockWithAddons<{
55
55
  rulesetId?: string | undefined;
56
56
  usage?: string | undefined;
57
57
  version?: string | undefined;
58
+ workflowsVersions?: Record<string, Record<string, {
59
+ pinned?: boolean | undefined;
60
+ hash?: string | undefined;
61
+ }>> | undefined;
58
62
  }>;
59
63
 
60
64
  export { blockExampleFiles };
@@ -53,6 +53,10 @@ declare const blockFunding: bingo_stratum.BlockWithoutAddons<{
53
53
  rulesetId?: string | undefined;
54
54
  usage?: string | undefined;
55
55
  version?: string | undefined;
56
+ workflowsVersions?: Record<string, Record<string, {
57
+ pinned?: boolean | undefined;
58
+ hash?: string | undefined;
59
+ }>> | undefined;
56
60
  }>;
57
61
 
58
62
  export { blockFunding };
@@ -95,6 +95,10 @@ declare const blockGitHubActionsCI: bingo_stratum.BlockWithAddons<{
95
95
  rulesetId?: string | undefined;
96
96
  usage?: string | undefined;
97
97
  version?: string | undefined;
98
+ workflowsVersions?: Record<string, Record<string, {
99
+ pinned?: boolean | undefined;
100
+ hash?: string | undefined;
101
+ }>> | undefined;
98
102
  }>;
99
103
 
100
104
  export { blockGitHubActionsCI, zActionStep };
@@ -1,10 +1,12 @@
1
1
  import jsYaml from "js-yaml";
2
2
  import { z } from "zod";
3
3
  import { base } from "../base.js";
4
+ import { resolveUses } from "./actions/resolveUses.js";
4
5
  import { blockRemoveFiles } from "./blockRemoveFiles.js";
5
6
  import { blockRepositoryBranchRuleset } from "./blockRepositoryBranchRuleset.js";
6
7
  import { createMultiWorkflowFile } from "./files/createMultiWorkflowFile.js";
7
8
  import { createSoloWorkflowFile } from "./files/createSoloWorkflowFile.js";
9
+ import { removeUsesQuotes } from "./files/removeUsesQuotes.js";
8
10
  const zActionStep = z.intersection(
9
11
  z.object({
10
12
  env: z.record(z.string(), z.string()).optional(),
@@ -28,7 +30,7 @@ const blockGitHubActionsCI = base.createBlock({
28
30
  ).optional(),
29
31
  removedWorkflows: z.array(z.string()).optional()
30
32
  },
31
- produce({ addons }) {
33
+ produce({ addons, options }) {
32
34
  const { jobs } = addons;
33
35
  return {
34
36
  addons: [
@@ -40,26 +42,36 @@ const blockGitHubActionsCI = base.createBlock({
40
42
  ".github": {
41
43
  actions: {
42
44
  prepare: {
43
- "action.yml": jsYaml.dump({
44
- description: "Prepares the repo for a typical CI job",
45
- name: "Prepare",
46
- runs: {
47
- steps: [
48
- {
49
- uses: "pnpm/action-setup@v4"
50
- },
51
- {
52
- uses: "actions/setup-node@v4",
53
- with: { cache: "pnpm", "node-version": "20" }
54
- },
55
- {
56
- run: "pnpm install --frozen-lockfile",
57
- shell: "bash"
58
- }
59
- ],
60
- using: "composite"
61
- }
62
- }).replaceAll(/\n(\S)/g, "\n\n$1")
45
+ "action.yml": removeUsesQuotes(
46
+ jsYaml.dump({
47
+ description: "Prepares the repo for a typical CI job",
48
+ name: "Prepare",
49
+ runs: {
50
+ steps: [
51
+ {
52
+ uses: resolveUses(
53
+ "pnpm/action-setup",
54
+ "v4",
55
+ options.workflowsVersions
56
+ )
57
+ },
58
+ {
59
+ uses: resolveUses(
60
+ "actions/setup-node",
61
+ "v4",
62
+ options.workflowsVersions
63
+ ),
64
+ with: { cache: "pnpm", "node-version": "20" }
65
+ },
66
+ {
67
+ run: "pnpm install --frozen-lockfile",
68
+ shell: "bash"
69
+ }
70
+ ],
71
+ using: "composite"
72
+ }
73
+ }).replaceAll(/\n(\S)/g, "\n\n$1")
74
+ )
63
75
  }
64
76
  },
65
77
  workflows: {
@@ -83,13 +95,18 @@ const blockGitHubActionsCI = base.createBlock({
83
95
  },
84
96
  steps: [
85
97
  {
86
- uses: "github/accessibility-alt-text-bot@v1.4.0"
98
+ uses: resolveUses(
99
+ "github/accessibility-alt-text-bot",
100
+ "v1.4.0",
101
+ options.workflowsVersions
102
+ )
87
103
  }
88
104
  ]
89
105
  }),
90
106
  "ci.yml": jobs && createMultiWorkflowFile({
91
107
  jobs: jobs.sort((a, b) => a.name.localeCompare(b.name)),
92
- name: "CI"
108
+ name: "CI",
109
+ workflowsVersions: options.workflowsVersions
93
110
  }),
94
111
  "pr-review-requested.yml": createSoloWorkflowFile({
95
112
  name: "PR Review Requested",
@@ -103,7 +120,11 @@ const blockGitHubActionsCI = base.createBlock({
103
120
  },
104
121
  steps: [
105
122
  {
106
- uses: "actions-ecosystem/action-remove-labels@v1",
123
+ uses: resolveUses(
124
+ "actions-ecosystem/action-remove-labels",
125
+ "v1",
126
+ options.workflowsVersions
127
+ ),
107
128
  with: {
108
129
  labels: "status: waiting for author"
109
130
  }
@@ -58,6 +58,10 @@ declare const blockGitHubApps: bingo_stratum.BlockWithAddons<{
58
58
  rulesetId?: string | undefined;
59
59
  usage?: string | undefined;
60
60
  version?: string | undefined;
61
+ workflowsVersions?: Record<string, Record<string, {
62
+ pinned?: boolean | undefined;
63
+ hash?: string | undefined;
64
+ }>> | undefined;
61
65
  }>;
62
66
 
63
67
  export { blockGitHubApps };
@@ -53,6 +53,10 @@ declare const blockGitHubIssueTemplates: bingo_stratum.BlockWithoutAddons<{
53
53
  rulesetId?: string | undefined;
54
54
  usage?: string | undefined;
55
55
  version?: string | undefined;
56
+ workflowsVersions?: Record<string, Record<string, {
57
+ pinned?: boolean | undefined;
58
+ hash?: string | undefined;
59
+ }>> | undefined;
56
60
  }>;
57
61
 
58
62
  export { blockGitHubIssueTemplates };