create-typescript-app 1.66.0 → 1.67.1
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/shared/options/optionsSchema.d.ts +2 -2
- package/lib/steps/initializeGitHubRepository/initializeBranchProtectionSettings.js +9 -9
- package/lib/steps/initializeGitHubRepository/initializeBranchProtectionSettings.js.map +1 -1
- package/lib/steps/writeReadme/findIntroSectionClose.js +4 -0
- package/lib/steps/writeReadme/findIntroSectionClose.js.map +1 -1
- package/lib/steps/writing/creation/dotGitHub/createMultiWorkflowFile.d.ts +16 -0
- package/lib/steps/writing/creation/dotGitHub/createMultiWorkflowFile.js +33 -0
- package/lib/steps/writing/creation/dotGitHub/createMultiWorkflowFile.js.map +1 -0
- package/lib/steps/writing/creation/dotGitHub/{createWorkflowFile.d.ts → createSoloWorkflowFile.d.ts} +2 -2
- package/lib/steps/writing/creation/dotGitHub/{createWorkflowFile.js → createSoloWorkflowFile.js} +7 -12
- package/lib/steps/writing/creation/dotGitHub/createSoloWorkflowFile.js.map +1 -0
- package/lib/steps/writing/creation/dotGitHub/createWorkflows.d.ts +4 -12
- package/lib/steps/writing/creation/dotGitHub/createWorkflows.js +103 -97
- package/lib/steps/writing/creation/dotGitHub/createWorkflows.js.map +1 -1
- package/lib/steps/writing/creation/dotGitHub/formatWorkflowYaml.d.ts +3 -0
- package/lib/steps/writing/creation/dotGitHub/formatWorkflowYaml.js +8 -0
- package/lib/steps/writing/creation/dotGitHub/formatWorkflowYaml.js.map +1 -0
- package/lib/steps/writing/creation/dotGitHub/index.d.ts +4 -12
- package/package.json +1 -1
- package/lib/steps/writing/creation/dotGitHub/createWorkflowFile.js.map +0 -1
|
@@ -112,8 +112,8 @@ declare const optionsSchema: z.ZodObject<{
|
|
|
112
112
|
skipUninstall: z.ZodOptional<z.ZodBoolean>;
|
|
113
113
|
title: z.ZodOptional<z.ZodString>;
|
|
114
114
|
}, "strip", z.ZodTypeAny, {
|
|
115
|
-
offline?: boolean | undefined;
|
|
116
115
|
description?: string | undefined;
|
|
116
|
+
offline?: boolean | undefined;
|
|
117
117
|
access?: "public" | "restricted" | undefined;
|
|
118
118
|
author?: string | undefined;
|
|
119
119
|
auto?: boolean | undefined;
|
|
@@ -161,8 +161,8 @@ declare const optionsSchema: z.ZodObject<{
|
|
|
161
161
|
guideTitle?: string | undefined;
|
|
162
162
|
logoAlt?: string | undefined;
|
|
163
163
|
}, {
|
|
164
|
-
offline?: boolean | undefined;
|
|
165
164
|
description?: string | undefined;
|
|
165
|
+
offline?: boolean | undefined;
|
|
166
166
|
access?: "public" | "restricted" | undefined;
|
|
167
167
|
author?: string | undefined;
|
|
168
168
|
auto?: boolean | undefined;
|
|
@@ -17,15 +17,15 @@ async function initializeBranchProtectionSettings(octokit, options) {
|
|
|
17
17
|
required_pull_request_reviews: null,
|
|
18
18
|
required_status_checks: {
|
|
19
19
|
checks: [
|
|
20
|
-
{ context: "
|
|
21
|
-
{ context: "
|
|
22
|
-
{ context: "
|
|
23
|
-
...options.
|
|
24
|
-
...options.
|
|
25
|
-
...options.
|
|
26
|
-
...options.
|
|
27
|
-
|
|
28
|
-
...options.excludeTests ? [] : [{ context: "
|
|
20
|
+
{ context: "Build" },
|
|
21
|
+
...options.excludeCompliance ? [] : [{ context: "Compliance" }],
|
|
22
|
+
{ context: "Lint" },
|
|
23
|
+
...options.excludeLintKnip ? [] : [{ context: "Lint Knip" }],
|
|
24
|
+
...options.excludeLintMd ? [] : [{ context: "Lint Markdown" }],
|
|
25
|
+
...options.excludeLintPackages ? [] : [{ context: "Lint Packages" }],
|
|
26
|
+
...options.excludeLintSpelling ? [] : [{ context: "Lint Spelling" }],
|
|
27
|
+
{ context: "Prettier" },
|
|
28
|
+
...options.excludeTests ? [] : [{ context: "Test" }]
|
|
29
29
|
],
|
|
30
30
|
strict: false
|
|
31
31
|
},
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../src/steps/initializeGitHubRepository/initializeBranchProtectionSettings.ts"],"sourcesContent":["import { RequestError } from \"@octokit/request-error\";\nimport { Octokit } from \"octokit\";\n\nimport { Options } from \"../../shared/types.js\";\n\nexport async function initializeBranchProtectionSettings(\n\toctokit: Octokit,\n\toptions: Options,\n) {\n\ttry {\n\t\tawait octokit.request(\n\t\t\t`PUT /repos/${options.owner}/${options.repository}/branches/main/protection`,\n\t\t\t{\n\t\t\t\tallow_deletions: false,\n\t\t\t\tallow_force_pushes: true,\n\t\t\t\tallow_fork_pushes: false,\n\t\t\t\tallow_fork_syncing: true,\n\t\t\t\tblock_creations: false,\n\t\t\t\tbranch: \"main\",\n\t\t\t\tenforce_admins: false,\n\t\t\t\towner: options.owner,\n\t\t\t\trepo: options.repository,\n\t\t\t\trequired_conversation_resolution: true,\n\t\t\t\trequired_linear_history: false,\n\t\t\t\trequired_pull_request_reviews: null,\n\t\t\t\trequired_status_checks: {\n\t\t\t\t\tchecks: [\n\t\t\t\t\t\t{ context: \"
|
|
1
|
+
{"version":3,"sources":["../../../src/steps/initializeGitHubRepository/initializeBranchProtectionSettings.ts"],"sourcesContent":["import { RequestError } from \"@octokit/request-error\";\nimport { Octokit } from \"octokit\";\n\nimport { Options } from \"../../shared/types.js\";\n\nexport async function initializeBranchProtectionSettings(\n\toctokit: Octokit,\n\toptions: Options,\n) {\n\ttry {\n\t\tawait octokit.request(\n\t\t\t`PUT /repos/${options.owner}/${options.repository}/branches/main/protection`,\n\t\t\t{\n\t\t\t\tallow_deletions: false,\n\t\t\t\tallow_force_pushes: true,\n\t\t\t\tallow_fork_pushes: false,\n\t\t\t\tallow_fork_syncing: true,\n\t\t\t\tblock_creations: false,\n\t\t\t\tbranch: \"main\",\n\t\t\t\tenforce_admins: false,\n\t\t\t\towner: options.owner,\n\t\t\t\trepo: options.repository,\n\t\t\t\trequired_conversation_resolution: true,\n\t\t\t\trequired_linear_history: false,\n\t\t\t\trequired_pull_request_reviews: null,\n\t\t\t\trequired_status_checks: {\n\t\t\t\t\tchecks: [\n\t\t\t\t\t\t{ context: \"Build\" },\n\t\t\t\t\t\t...(options.excludeCompliance ? [] : [{ context: \"Compliance\" }]),\n\t\t\t\t\t\t{ context: \"Lint\" },\n\t\t\t\t\t\t...(options.excludeLintKnip ? [] : [{ context: \"Lint Knip\" }]),\n\t\t\t\t\t\t...(options.excludeLintMd ? [] : [{ context: \"Lint Markdown\" }]),\n\t\t\t\t\t\t...(options.excludeLintPackages\n\t\t\t\t\t\t\t? []\n\t\t\t\t\t\t\t: [{ context: \"Lint Packages\" }]),\n\t\t\t\t\t\t...(options.excludeLintSpelling\n\t\t\t\t\t\t\t? []\n\t\t\t\t\t\t\t: [{ context: \"Lint Spelling\" }]),\n\t\t\t\t\t\t{ context: \"Prettier\" },\n\t\t\t\t\t\t...(options.excludeTests ? [] : [{ context: \"Test\" }]),\n\t\t\t\t\t],\n\t\t\t\t\tstrict: false,\n\t\t\t\t},\n\t\t\t\trestrictions: null,\n\t\t\t},\n\t\t);\n\t} catch (error) {\n\t\tif ((error as RequestError).status === 403) {\n\t\t\treturn false;\n\t\t}\n\n\t\tthrow error;\n\t}\n}\n"],"mappings":"AAKA,eAAsB,mCACrB,SACA,SACC;AACD,MAAI;AACH,UAAM,QAAQ;AAAA,MACb,cAAc,QAAQ,KAAK,IAAI,QAAQ,UAAU;AAAA,MACjD;AAAA,QACC,iBAAiB;AAAA,QACjB,oBAAoB;AAAA,QACpB,mBAAmB;AAAA,QACnB,oBAAoB;AAAA,QACpB,iBAAiB;AAAA,QACjB,QAAQ;AAAA,QACR,gBAAgB;AAAA,QAChB,OAAO,QAAQ;AAAA,QACf,MAAM,QAAQ;AAAA,QACd,kCAAkC;AAAA,QAClC,yBAAyB;AAAA,QACzB,+BAA+B;AAAA,QAC/B,wBAAwB;AAAA,UACvB,QAAQ;AAAA,YACP,EAAE,SAAS,QAAQ;AAAA,YACnB,GAAI,QAAQ,oBAAoB,CAAC,IAAI,CAAC,EAAE,SAAS,aAAa,CAAC;AAAA,YAC/D,EAAE,SAAS,OAAO;AAAA,YAClB,GAAI,QAAQ,kBAAkB,CAAC,IAAI,CAAC,EAAE,SAAS,YAAY,CAAC;AAAA,YAC5D,GAAI,QAAQ,gBAAgB,CAAC,IAAI,CAAC,EAAE,SAAS,gBAAgB,CAAC;AAAA,YAC9D,GAAI,QAAQ,sBACT,CAAC,IACD,CAAC,EAAE,SAAS,gBAAgB,CAAC;AAAA,YAChC,GAAI,QAAQ,sBACT,CAAC,IACD,CAAC,EAAE,SAAS,gBAAgB,CAAC;AAAA,YAChC,EAAE,SAAS,WAAW;AAAA,YACtB,GAAI,QAAQ,eAAe,CAAC,IAAI,CAAC,EAAE,SAAS,OAAO,CAAC;AAAA,UACrD;AAAA,UACA,QAAQ;AAAA,QACT;AAAA,QACA,cAAc;AAAA,MACf;AAAA,IACD;AAAA,EACD,SAAS,OAAO;AACf,QAAK,MAAuB,WAAW,KAAK;AAC3C,aAAO;AAAA,IACR;AAEA,UAAM;AAAA,EACP;AACD;","names":[]}
|
|
@@ -1,5 +1,9 @@
|
|
|
1
1
|
import { existingBadgeMatcherCreators } from "./findExistingBadges.js";
|
|
2
2
|
function findIntroSectionClose(contents) {
|
|
3
|
+
const projectLogoMatch = /<img align="right" alt="Project logo.+" src=".+">/.exec(contents);
|
|
4
|
+
if (projectLogoMatch) {
|
|
5
|
+
return contents.indexOf("\n", projectLogoMatch.index) + 2;
|
|
6
|
+
}
|
|
3
7
|
const indexOfH2OrCodeBlock = contents.search(/## |<\s*h2|```/);
|
|
4
8
|
if (indexOfH2OrCodeBlock !== -1) {
|
|
5
9
|
return indexOfH2OrCodeBlock - 2;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../src/steps/writeReadme/findIntroSectionClose.ts"],"sourcesContent":["import { existingBadgeMatcherCreators } from \"./findExistingBadges.js\";\n\nexport function findIntroSectionClose(contents: string) {\n\t// Highest priority
|
|
1
|
+
{"version":3,"sources":["../../../src/steps/writeReadme/findIntroSectionClose.ts"],"sourcesContent":["import { existingBadgeMatcherCreators } from \"./findExistingBadges.js\";\n\nexport function findIntroSectionClose(contents: string) {\n\t// Highest priority: after an existing create-typescript-app-style logo\n\tconst projectLogoMatch =\n\t\t/<img align=\"right\" alt=\"Project logo.+\" src=\".+\">/.exec(contents);\n\tif (projectLogoMatch) {\n\t\treturn contents.indexOf(\"\\n\", projectLogoMatch.index) + 2;\n\t}\n\n\t// Next: before a first code block or h2, presumably following badges\n\tconst indexOfH2OrCodeBlock = contents.search(/## |<\\s*h2|```/);\n\n\tif (indexOfH2OrCodeBlock !== -1) {\n\t\treturn indexOfH2OrCodeBlock - 2;\n\t}\n\n\t// Failing those, if any badges are found, go after the last of them\n\tfor (const createMatcher of existingBadgeMatcherCreators) {\n\t\tconst lastMatch = [...contents.matchAll(createMatcher())].at(-1);\n\n\t\tif (lastMatch?.index) {\n\t\t\treturn lastMatch.index + lastMatch[0].length + 2;\n\t\t}\n\t}\n\n\t// Lastly, go for the second line altogether\n\treturn contents.indexOf(\"\\n\", 1) + 1;\n}\n"],"mappings":"AAAA,SAAS,oCAAoC;AAEtC,SAAS,sBAAsB,UAAkB;AAEvD,QAAM,mBACL,oDAAoD,KAAK,QAAQ;AAClE,MAAI,kBAAkB;AACrB,WAAO,SAAS,QAAQ,MAAM,iBAAiB,KAAK,IAAI;AAAA,EACzD;AAGA,QAAM,uBAAuB,SAAS,OAAO,gBAAgB;AAE7D,MAAI,yBAAyB,IAAI;AAChC,WAAO,uBAAuB;AAAA,EAC/B;AAGA,aAAW,iBAAiB,8BAA8B;AACzD,UAAM,YAAY,CAAC,GAAG,SAAS,SAAS,cAAc,CAAC,CAAC,EAAE,GAAG,EAAE;AAE/D,QAAI,WAAW,OAAO;AACrB,aAAO,UAAU,QAAQ,UAAU,CAAC,EAAE,SAAS;AAAA,IAChD;AAAA,EACD;AAGA,SAAO,SAAS,QAAQ,MAAM,CAAC,IAAI;AACpC;","names":[]}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
type MultiWorkflowJobStep = {
|
|
2
|
+
run: string;
|
|
3
|
+
} | {
|
|
4
|
+
uses: string;
|
|
5
|
+
};
|
|
6
|
+
interface MultiWorkflowJobOptions {
|
|
7
|
+
name: string;
|
|
8
|
+
steps: MultiWorkflowJobStep[];
|
|
9
|
+
}
|
|
10
|
+
interface MultiWorkflowFileOptions {
|
|
11
|
+
jobs: MultiWorkflowJobOptions[];
|
|
12
|
+
name: string;
|
|
13
|
+
}
|
|
14
|
+
declare function createMultiWorkflowFile({ jobs, name, }: MultiWorkflowFileOptions): string;
|
|
15
|
+
|
|
16
|
+
export { type MultiWorkflowFileOptions, type MultiWorkflowJobOptions, type MultiWorkflowJobStep, createMultiWorkflowFile };
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import { formatWorkflowYaml } from "./formatWorkflowYaml.js";
|
|
2
|
+
function createMultiWorkflowFile({
|
|
3
|
+
jobs,
|
|
4
|
+
name
|
|
5
|
+
}) {
|
|
6
|
+
return formatWorkflowYaml({
|
|
7
|
+
jobs: Object.fromEntries(
|
|
8
|
+
jobs.map((job) => [
|
|
9
|
+
job.name.toLowerCase().replaceAll(" ", "_"),
|
|
10
|
+
{
|
|
11
|
+
name: job.name,
|
|
12
|
+
"runs-on": "ubuntu-latest",
|
|
13
|
+
steps: [
|
|
14
|
+
{ uses: "actions/checkout@v4" },
|
|
15
|
+
{ uses: "./.github/actions/prepare" },
|
|
16
|
+
...job.steps
|
|
17
|
+
]
|
|
18
|
+
}
|
|
19
|
+
])
|
|
20
|
+
),
|
|
21
|
+
name,
|
|
22
|
+
on: {
|
|
23
|
+
pull_request: null,
|
|
24
|
+
push: {
|
|
25
|
+
branches: ["main"]
|
|
26
|
+
}
|
|
27
|
+
}
|
|
28
|
+
});
|
|
29
|
+
}
|
|
30
|
+
export {
|
|
31
|
+
createMultiWorkflowFile
|
|
32
|
+
};
|
|
33
|
+
//# sourceMappingURL=createMultiWorkflowFile.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../../../../src/steps/writing/creation/dotGitHub/createMultiWorkflowFile.ts"],"sourcesContent":["import { formatWorkflowYaml } from \"./formatWorkflowYaml.js\";\n\nexport type MultiWorkflowJobStep = { run: string } | { uses: string };\n\nexport interface MultiWorkflowJobOptions {\n\tname: string;\n\tsteps: MultiWorkflowJobStep[];\n}\n\nexport interface MultiWorkflowFileOptions {\n\tjobs: MultiWorkflowJobOptions[];\n\tname: string;\n}\n\nexport function createMultiWorkflowFile({\n\tjobs,\n\tname,\n}: MultiWorkflowFileOptions) {\n\treturn formatWorkflowYaml({\n\t\tjobs: Object.fromEntries(\n\t\t\tjobs.map((job) => [\n\t\t\t\tjob.name.toLowerCase().replaceAll(\" \", \"_\"),\n\t\t\t\t{\n\t\t\t\t\tname: job.name,\n\t\t\t\t\t\"runs-on\": \"ubuntu-latest\",\n\t\t\t\t\tsteps: [\n\t\t\t\t\t\t{ uses: \"actions/checkout@v4\" },\n\t\t\t\t\t\t{ uses: \"./.github/actions/prepare\" },\n\t\t\t\t\t\t...job.steps,\n\t\t\t\t\t],\n\t\t\t\t},\n\t\t\t]),\n\t\t),\n\t\tname,\n\t\ton: {\n\t\t\tpull_request: null,\n\t\t\tpush: {\n\t\t\t\tbranches: [\"main\"],\n\t\t\t},\n\t\t},\n\t});\n}\n"],"mappings":"AAAA,SAAS,0BAA0B;AAc5B,SAAS,wBAAwB;AAAA,EACvC;AAAA,EACA;AACD,GAA6B;AAC5B,SAAO,mBAAmB;AAAA,IACzB,MAAM,OAAO;AAAA,MACZ,KAAK,IAAI,CAAC,QAAQ;AAAA,QACjB,IAAI,KAAK,YAAY,EAAE,WAAW,KAAK,GAAG;AAAA,QAC1C;AAAA,UACC,MAAM,IAAI;AAAA,UACV,WAAW;AAAA,UACX,OAAO;AAAA,YACN,EAAE,MAAM,sBAAsB;AAAA,YAC9B,EAAE,MAAM,4BAA4B;AAAA,YACpC,GAAG,IAAI;AAAA,UACR;AAAA,QACD;AAAA,MACD,CAAC;AAAA,IACF;AAAA,IACA;AAAA,IACA,IAAI;AAAA,MACH,cAAc;AAAA,MACd,MAAM;AAAA,QACL,UAAU,CAAC,MAAM;AAAA,MAClB;AAAA,IACD;AAAA,EACD,CAAC;AACF;","names":[]}
|
package/lib/steps/writing/creation/dotGitHub/{createWorkflowFile.d.ts → createSoloWorkflowFile.d.ts}
RENAMED
|
@@ -52,6 +52,6 @@ interface WorkflowFileOptionsSteps extends WorkflowFileOptionsBase {
|
|
|
52
52
|
steps: WorkflowFileStep[];
|
|
53
53
|
}
|
|
54
54
|
type WorkflowFileOptions = WorkflowFileOptionsRuns | WorkflowFileOptionsSteps;
|
|
55
|
-
declare function
|
|
55
|
+
declare function createSoloWorkflowFile({ concurrency, name, on, permissions, ...options }: WorkflowFileOptions): string;
|
|
56
56
|
|
|
57
|
-
export {
|
|
57
|
+
export { createSoloWorkflowFile };
|
package/lib/steps/writing/creation/dotGitHub/{createWorkflowFile.js → createSoloWorkflowFile.js}
RENAMED
|
@@ -1,17 +1,12 @@
|
|
|
1
|
-
import {
|
|
2
|
-
function
|
|
1
|
+
import { formatWorkflowYaml } from "./formatWorkflowYaml.js";
|
|
2
|
+
function createSoloWorkflowFile({
|
|
3
3
|
concurrency,
|
|
4
4
|
name,
|
|
5
|
-
on
|
|
6
|
-
pull_request: null,
|
|
7
|
-
push: {
|
|
8
|
-
branches: ["main"]
|
|
9
|
-
}
|
|
10
|
-
},
|
|
5
|
+
on,
|
|
11
6
|
permissions,
|
|
12
7
|
...options
|
|
13
8
|
}) {
|
|
14
|
-
return
|
|
9
|
+
return formatWorkflowYaml({
|
|
15
10
|
concurrency,
|
|
16
11
|
jobs: {
|
|
17
12
|
[name.replaceAll(" ", "_").toLowerCase()]: {
|
|
@@ -27,9 +22,9 @@ function createWorkflowFile({
|
|
|
27
22
|
name,
|
|
28
23
|
on,
|
|
29
24
|
permissions
|
|
30
|
-
})
|
|
25
|
+
});
|
|
31
26
|
}
|
|
32
27
|
export {
|
|
33
|
-
|
|
28
|
+
createSoloWorkflowFile
|
|
34
29
|
};
|
|
35
|
-
//# sourceMappingURL=
|
|
30
|
+
//# sourceMappingURL=createSoloWorkflowFile.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../../../../src/steps/writing/creation/dotGitHub/createSoloWorkflowFile.ts"],"sourcesContent":["import { formatWorkflowYaml } from \"./formatWorkflowYaml.js\";\n\ninterface WorkflowFileConcurrency {\n\t\"cancel-in-progress\"?: boolean;\n\tgroup: string;\n}\n\ninterface WorkflowFileOn {\n\tissue_comment?: {\n\t\ttypes?: string[];\n\t};\n\tissues?: {\n\t\ttypes?: string[];\n\t};\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\tissues?: 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\tif?: string;\n\tname: string;\n\ton?: WorkflowFileOn;\n\tpermissions?: WorkflowFilePermissions;\n}\n\ninterface WorkflowFileOptionsRuns extends WorkflowFileOptionsBase {\n\truns: (string | WorkflowFileStep)[];\n}\n\ninterface WorkflowFileOptionsSteps extends WorkflowFileOptionsBase {\n\tsteps: WorkflowFileStep[];\n}\n\ntype WorkflowFileOptions = WorkflowFileOptionsRuns | WorkflowFileOptionsSteps;\n\nexport function createSoloWorkflowFile({\n\tconcurrency,\n\tname,\n\ton,\n\tpermissions,\n\t...options\n}: WorkflowFileOptions) {\n\treturn formatWorkflowYaml({\n\t\tconcurrency,\n\t\tjobs: {\n\t\t\t[name.replaceAll(\" \", \"_\").toLowerCase()]: {\n\t\t\t\t...(options.if && { if: options.if }),\n\t\t\t\t\"runs-on\": \"ubuntu-latest\",\n\t\t\t\tsteps:\n\t\t\t\t\t\"runs\" in options\n\t\t\t\t\t\t? [\n\t\t\t\t\t\t\t\t{ uses: \"actions/checkout@v4\" },\n\t\t\t\t\t\t\t\t{ uses: \"./.github/actions/prepare\" },\n\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: options.steps,\n\t\t\t},\n\t\t},\n\t\tname,\n\t\ton,\n\t\tpermissions,\n\t});\n}\n"],"mappings":"AAAA,SAAS,0BAA0B;AAmE5B,SAAS,uBAAuB;AAAA,EACtC;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA,GAAG;AACJ,GAAwB;AACvB,SAAO,mBAAmB;AAAA,IACzB;AAAA,IACA,MAAM;AAAA,MACL,CAAC,KAAK,WAAW,KAAK,GAAG,EAAE,YAAY,CAAC,GAAG;AAAA,QAC1C,GAAI,QAAQ,MAAM,EAAE,IAAI,QAAQ,GAAG;AAAA,QACnC,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,QACvC,IACC,QAAQ;AAAA,MACb;AAAA,IACD;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,EACD,CAAC;AACF;","names":[]}
|
|
@@ -3,21 +3,13 @@ import 'zod';
|
|
|
3
3
|
import '../../../../shared/codes.js';
|
|
4
4
|
|
|
5
5
|
declare function createWorkflows(options: Options): {
|
|
6
|
-
"test.yml"?: string | undefined;
|
|
7
|
-
"post-release.yml"?: string | undefined;
|
|
8
6
|
"release.yml"?: string | undefined;
|
|
9
|
-
"
|
|
10
|
-
"
|
|
11
|
-
"lint-markdown.yml"?: string | undefined;
|
|
12
|
-
"lint-knip.yml"?: string | undefined;
|
|
13
|
-
"accessibility-alt-text-bot.yml": string;
|
|
14
|
-
"lint.yml": string;
|
|
7
|
+
"pr-review-requested.yml": string;
|
|
8
|
+
"post-release.yml"?: string | undefined;
|
|
15
9
|
"contributors.yml"?: string | undefined;
|
|
16
10
|
"compliance.yml"?: string | undefined;
|
|
17
|
-
"
|
|
18
|
-
"
|
|
19
|
-
"prettier.yml": string;
|
|
20
|
-
"tsc.yml": string;
|
|
11
|
+
"accessibility-alt-text-bot.yml": string;
|
|
12
|
+
"ci.yml": string;
|
|
21
13
|
};
|
|
22
14
|
|
|
23
15
|
export { createWorkflows };
|
|
@@ -1,45 +1,90 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { createMultiWorkflowFile } from "./createMultiWorkflowFile.js";
|
|
2
|
+
import { createSoloWorkflowFile } from "./createSoloWorkflowFile.js";
|
|
2
3
|
function createWorkflows(options) {
|
|
3
4
|
return {
|
|
4
|
-
"
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
}),
|
|
8
|
-
"pr-review-requested.yml": createWorkflowFile({
|
|
9
|
-
name: "PR Review Requested",
|
|
5
|
+
"accessibility-alt-text-bot.yml": createSoloWorkflowFile({
|
|
6
|
+
if: "${{ !endsWith(github.actor, '[bot]') }}",
|
|
7
|
+
name: "Accessibility Alt Text Bot",
|
|
10
8
|
on: {
|
|
11
|
-
|
|
12
|
-
types: ["
|
|
9
|
+
issue_comment: {
|
|
10
|
+
types: ["created", "edited"]
|
|
11
|
+
},
|
|
12
|
+
issues: {
|
|
13
|
+
types: ["edited", "opened"]
|
|
14
|
+
},
|
|
15
|
+
pull_request: {
|
|
16
|
+
types: ["edited", "opened"]
|
|
13
17
|
}
|
|
14
18
|
},
|
|
15
19
|
permissions: {
|
|
20
|
+
issues: "write",
|
|
16
21
|
"pull-requests": "write"
|
|
17
22
|
},
|
|
18
23
|
steps: [
|
|
19
24
|
{
|
|
20
|
-
uses: "
|
|
21
|
-
with: {
|
|
22
|
-
labels: "status: waiting for author"
|
|
23
|
-
}
|
|
24
|
-
},
|
|
25
|
-
{
|
|
26
|
-
if: "failure()",
|
|
27
|
-
run: `echo "Don't worry if the previous step failed."
|
|
28
|
-
echo "See https://github.com/actions-ecosystem/action-remove-labels/issues/221."
|
|
29
|
-
`
|
|
25
|
+
uses: "github/accessibility-alt-text-bot@v1.4.0"
|
|
30
26
|
}
|
|
31
27
|
]
|
|
32
28
|
}),
|
|
33
|
-
"
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
29
|
+
"ci.yml": createMultiWorkflowFile({
|
|
30
|
+
jobs: [
|
|
31
|
+
{
|
|
32
|
+
name: "Build",
|
|
33
|
+
steps: [{ run: "pnpm build" }, { run: "node ./lib/index.js" }]
|
|
34
|
+
},
|
|
35
|
+
{
|
|
36
|
+
name: "Prettier",
|
|
37
|
+
steps: [{ run: "pnpm format --list-different" }]
|
|
38
|
+
},
|
|
39
|
+
{
|
|
40
|
+
name: "Type Check",
|
|
41
|
+
steps: [{ run: "pnpm tsc" }]
|
|
42
|
+
},
|
|
43
|
+
{
|
|
44
|
+
name: "Lint",
|
|
45
|
+
steps: [
|
|
46
|
+
...options.bin ? [{ run: "pnpm build" }] : [],
|
|
47
|
+
{ run: "pnpm lint" }
|
|
48
|
+
]
|
|
49
|
+
},
|
|
50
|
+
...options.excludeLintKnip ? [] : [
|
|
51
|
+
{
|
|
52
|
+
name: "Lint Knip",
|
|
53
|
+
steps: [{ run: "pnpm lint:knip" }]
|
|
54
|
+
}
|
|
55
|
+
],
|
|
56
|
+
...options.excludeLintMd ? [] : [
|
|
57
|
+
{
|
|
58
|
+
name: "Lint Markdown",
|
|
59
|
+
steps: [{ run: "pnpm lint:md" }]
|
|
60
|
+
}
|
|
61
|
+
],
|
|
62
|
+
...options.excludeLintPackages ? [] : [
|
|
63
|
+
{
|
|
64
|
+
name: "Lint Packages",
|
|
65
|
+
steps: [{ run: "pnpm lint:packages" }]
|
|
66
|
+
}
|
|
67
|
+
],
|
|
68
|
+
...options.excludeLintSpelling ? [] : [
|
|
69
|
+
{
|
|
70
|
+
name: "Lint Spelling",
|
|
71
|
+
steps: [{ run: "pnpm lint:spelling" }]
|
|
72
|
+
}
|
|
73
|
+
],
|
|
74
|
+
...options.excludeTests ? [] : [
|
|
75
|
+
{
|
|
76
|
+
name: "Test",
|
|
77
|
+
steps: [
|
|
78
|
+
{ run: "pnpm run test --coverage" },
|
|
79
|
+
{ uses: "codecov/codecov-action@v3" }
|
|
80
|
+
]
|
|
81
|
+
}
|
|
82
|
+
]
|
|
83
|
+
],
|
|
84
|
+
name: "CI"
|
|
40
85
|
}),
|
|
41
86
|
...!options.excludeCompliance && {
|
|
42
|
-
"compliance.yml":
|
|
87
|
+
"compliance.yml": createSoloWorkflowFile({
|
|
43
88
|
name: "Compliance",
|
|
44
89
|
on: {
|
|
45
90
|
pull_request: {
|
|
@@ -66,7 +111,7 @@ echo "See https://github.com/actions-ecosystem/action-remove-labels/issues/221."
|
|
|
66
111
|
})
|
|
67
112
|
},
|
|
68
113
|
...!options.excludeAllContributors && {
|
|
69
|
-
"contributors.yml":
|
|
114
|
+
"contributors.yml": createSoloWorkflowFile({
|
|
70
115
|
name: "Contributors",
|
|
71
116
|
on: {
|
|
72
117
|
push: {
|
|
@@ -83,60 +128,8 @@ echo "See https://github.com/actions-ecosystem/action-remove-labels/issues/221."
|
|
|
83
128
|
]
|
|
84
129
|
})
|
|
85
130
|
},
|
|
86
|
-
"accessibility-alt-text-bot.yml": createWorkflowFile({
|
|
87
|
-
if: "${{ !endsWith(github.actor, '[bot]') }}",
|
|
88
|
-
name: "Accessibility Alt Text Bot",
|
|
89
|
-
on: {
|
|
90
|
-
issue_comment: {
|
|
91
|
-
types: ["created", "edited"]
|
|
92
|
-
},
|
|
93
|
-
issues: {
|
|
94
|
-
types: ["edited", "opened"]
|
|
95
|
-
},
|
|
96
|
-
pull_request: {
|
|
97
|
-
types: ["edited", "opened"]
|
|
98
|
-
}
|
|
99
|
-
},
|
|
100
|
-
permissions: {
|
|
101
|
-
issues: "write",
|
|
102
|
-
"pull-requests": "write"
|
|
103
|
-
},
|
|
104
|
-
steps: [
|
|
105
|
-
{
|
|
106
|
-
uses: "github/accessibility-alt-text-bot@v1.4.0"
|
|
107
|
-
}
|
|
108
|
-
]
|
|
109
|
-
}),
|
|
110
|
-
"lint.yml": createWorkflowFile({
|
|
111
|
-
name: "Lint",
|
|
112
|
-
runs: [...options.bin ? ["pnpm build"] : [], "pnpm lint"]
|
|
113
|
-
}),
|
|
114
|
-
...!options.excludeLintKnip && {
|
|
115
|
-
"lint-knip.yml": createWorkflowFile({
|
|
116
|
-
name: "Lint Knip",
|
|
117
|
-
runs: ["pnpm lint:knip"]
|
|
118
|
-
})
|
|
119
|
-
},
|
|
120
|
-
...!options.excludeLintMd && {
|
|
121
|
-
"lint-markdown.yml": createWorkflowFile({
|
|
122
|
-
name: "Lint Markdown",
|
|
123
|
-
runs: ["pnpm lint:md"]
|
|
124
|
-
})
|
|
125
|
-
},
|
|
126
|
-
...!options.excludeLintPackages && {
|
|
127
|
-
"lint-packages.yml": createWorkflowFile({
|
|
128
|
-
name: "Lint Packages",
|
|
129
|
-
runs: ["pnpm lint:packages"]
|
|
130
|
-
})
|
|
131
|
-
},
|
|
132
|
-
...!options.excludeLintSpelling && {
|
|
133
|
-
"lint-spelling.yml": createWorkflowFile({
|
|
134
|
-
name: "Lint spelling",
|
|
135
|
-
runs: ["pnpm lint:spelling"]
|
|
136
|
-
})
|
|
137
|
-
},
|
|
138
131
|
...!options.excludeReleases && {
|
|
139
|
-
"post-release.yml":
|
|
132
|
+
"post-release.yml": createSoloWorkflowFile({
|
|
140
133
|
name: "Post Release",
|
|
141
134
|
on: {
|
|
142
135
|
release: {
|
|
@@ -165,8 +158,35 @@ echo "See https://github.com/actions-ecosystem/action-remove-labels/issues/221."
|
|
|
165
158
|
}
|
|
166
159
|
}
|
|
167
160
|
]
|
|
168
|
-
})
|
|
169
|
-
|
|
161
|
+
})
|
|
162
|
+
},
|
|
163
|
+
"pr-review-requested.yml": createSoloWorkflowFile({
|
|
164
|
+
name: "PR Review Requested",
|
|
165
|
+
on: {
|
|
166
|
+
pull_request_target: {
|
|
167
|
+
types: ["review_requested"]
|
|
168
|
+
}
|
|
169
|
+
},
|
|
170
|
+
permissions: {
|
|
171
|
+
"pull-requests": "write"
|
|
172
|
+
},
|
|
173
|
+
steps: [
|
|
174
|
+
{
|
|
175
|
+
uses: "actions-ecosystem/action-remove-labels@v1",
|
|
176
|
+
with: {
|
|
177
|
+
labels: "status: waiting for author"
|
|
178
|
+
}
|
|
179
|
+
},
|
|
180
|
+
{
|
|
181
|
+
if: "failure()",
|
|
182
|
+
run: `echo "Don't worry if the previous step failed."
|
|
183
|
+
echo "See https://github.com/actions-ecosystem/action-remove-labels/issues/221."
|
|
184
|
+
`
|
|
185
|
+
}
|
|
186
|
+
]
|
|
187
|
+
}),
|
|
188
|
+
...!options.excludeReleases && {
|
|
189
|
+
"release.yml": createSoloWorkflowFile({
|
|
170
190
|
concurrency: {
|
|
171
191
|
group: "${{ github.workflow }}"
|
|
172
192
|
},
|
|
@@ -203,20 +223,6 @@ echo "See https://github.com/actions-ecosystem/action-remove-labels/issues/221."
|
|
|
203
223
|
}
|
|
204
224
|
]
|
|
205
225
|
})
|
|
206
|
-
},
|
|
207
|
-
...!options.excludeTests && {
|
|
208
|
-
"test.yml": createWorkflowFile({
|
|
209
|
-
name: "Test",
|
|
210
|
-
steps: [
|
|
211
|
-
{ uses: "actions/checkout@v4" },
|
|
212
|
-
{ uses: "./.github/actions/prepare" },
|
|
213
|
-
{ run: "pnpm run test --coverage" },
|
|
214
|
-
{
|
|
215
|
-
name: "Codecov",
|
|
216
|
-
uses: "codecov/codecov-action@v3"
|
|
217
|
-
}
|
|
218
|
-
]
|
|
219
|
-
})
|
|
220
226
|
}
|
|
221
227
|
};
|
|
222
228
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../../../src/steps/writing/creation/dotGitHub/createWorkflows.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[\n\t\t\t\t\t\t\t\t\t...(options.excludeAllContributors\n\t\t\t\t\t\t\t\t\t\t? []\n\t\t\t\t\t\t\t\t\t\t: [\"allcontributors\", \"allcontributors[bot]\"]),\n\t\t\t\t\t\t\t\t\t...(options.excludeRenovate\n\t\t\t\t\t\t\t\t\t\t? []\n\t\t\t\t\t\t\t\t\t\t: [\"renovate\", \"renovate[bot]\"]),\n\t\t\t\t\t\t\t\t].join(\"\\n\") || undefined,\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.excludeAllContributors && {\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.4.3`,\n\t\t\t\t\t},\n\t\t\t\t],\n\t\t\t}),\n\t\t}),\n\t\t\"accessibility-alt-text-bot.yml\": createWorkflowFile({\n\t\t\tif: \"${{ !endsWith(github.actor, '[bot]') }}\",\n\t\t\tname: \"Accessibility Alt Text Bot\",\n\t\t\ton: {\n\t\t\t\tissue_comment: {\n\t\t\t\t\ttypes: [\"created\", \"edited\"],\n\t\t\t\t},\n\t\t\t\tissues: {\n\t\t\t\t\ttypes: [\"edited\", \"opened\"],\n\t\t\t\t},\n\t\t\t\tpull_request: {\n\t\t\t\t\ttypes: [\"edited\", \"opened\"],\n\t\t\t\t},\n\t\t\t},\n\t\t\tpermissions: {\n\t\t\t\tissues: \"write\",\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: \"github/accessibility-alt-text-bot@v1.4.0\",\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: [...(options.bin ? [\"pnpm build\"] : []), \"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.excludeLintPackages && {\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\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\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\n\t\t\t\t\t\t\tCheers! 📦🚀\n\t\t\t\t\t\t`,\n\t\t\t\t\t\t\tGITHUB_TOKEN: \"${{ secrets.GITHUB_TOKEN }}\",\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\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\tref: \"main\",\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\tenv: {\n\t\t\t\t\t\t\tGITHUB_TOKEN: \"${{ secrets.ACCESS_TOKEN }}\",\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\tuses: \"JoshuaKGoldberg/release-it-action@v0.2.2\",\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},\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;AA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AQ,gBAAgB;AAAA,MAC5B,YAAY,mBAAmB;AAAA,QAC9B,MAAM;AAAA,QACN,OAAO;AAAA,UACN,EAAE,MAAM,sBAAsB;AAAA,UAC9B,EAAE,MAAM,4BAA4B;AAAA,UACpC,EAAE,KAAK,2BAA2B;AAAA,UAClC;AAAA,YACC,MAAM;AAAA,YACN,MAAM;AAAA,UACP;AAAA,QACD;AAAA,MACD,CAAC;AAAA,IACF;AAAA,EACD;AACD;","names":[]}
|
|
1
|
+
{"version":3,"sources":["../../../../../src/steps/writing/creation/dotGitHub/createWorkflows.ts"],"sourcesContent":["import { Options } from \"../../../../shared/types.js\";\nimport { createMultiWorkflowFile } from \"./createMultiWorkflowFile.js\";\nimport { createSoloWorkflowFile } from \"./createSoloWorkflowFile.js\";\n\nexport function createWorkflows(options: Options) {\n\treturn {\n\t\t\"accessibility-alt-text-bot.yml\": createSoloWorkflowFile({\n\t\t\tif: \"${{ !endsWith(github.actor, '[bot]') }}\",\n\t\t\tname: \"Accessibility Alt Text Bot\",\n\t\t\ton: {\n\t\t\t\tissue_comment: {\n\t\t\t\t\ttypes: [\"created\", \"edited\"],\n\t\t\t\t},\n\t\t\t\tissues: {\n\t\t\t\t\ttypes: [\"edited\", \"opened\"],\n\t\t\t\t},\n\t\t\t\tpull_request: {\n\t\t\t\t\ttypes: [\"edited\", \"opened\"],\n\t\t\t\t},\n\t\t\t},\n\t\t\tpermissions: {\n\t\t\t\tissues: \"write\",\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: \"github/accessibility-alt-text-bot@v1.4.0\",\n\t\t\t\t},\n\t\t\t],\n\t\t}),\n\t\t\"ci.yml\": createMultiWorkflowFile({\n\t\t\tjobs: [\n\t\t\t\t{\n\t\t\t\t\tname: \"Build\",\n\t\t\t\t\tsteps: [{ run: \"pnpm build\" }, { run: \"node ./lib/index.js\" }],\n\t\t\t\t},\n\t\t\t\t{\n\t\t\t\t\tname: \"Prettier\",\n\t\t\t\t\tsteps: [{ run: \"pnpm format --list-different\" }],\n\t\t\t\t},\n\t\t\t\t{\n\t\t\t\t\tname: \"Type Check\",\n\t\t\t\t\tsteps: [{ run: \"pnpm tsc\" }],\n\t\t\t\t},\n\t\t\t\t{\n\t\t\t\t\tname: \"Lint\",\n\t\t\t\t\tsteps: [\n\t\t\t\t\t\t...(options.bin ? [{ run: \"pnpm build\" }] : []),\n\t\t\t\t\t\t{ run: \"pnpm lint\" },\n\t\t\t\t\t],\n\t\t\t\t},\n\t\t\t\t...(options.excludeLintKnip\n\t\t\t\t\t? []\n\t\t\t\t\t: [\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\tname: \"Lint Knip\",\n\t\t\t\t\t\t\t\tsteps: [{ run: \"pnpm lint:knip\" }],\n\t\t\t\t\t\t\t},\n\t\t\t\t\t\t]),\n\t\t\t\t...(options.excludeLintMd\n\t\t\t\t\t? []\n\t\t\t\t\t: [\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\tname: \"Lint Markdown\",\n\t\t\t\t\t\t\t\tsteps: [{ run: \"pnpm lint:md\" }],\n\t\t\t\t\t\t\t},\n\t\t\t\t\t\t]),\n\t\t\t\t...(options.excludeLintPackages\n\t\t\t\t\t? []\n\t\t\t\t\t: [\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\tname: \"Lint Packages\",\n\t\t\t\t\t\t\t\tsteps: [{ run: \"pnpm lint:packages\" }],\n\t\t\t\t\t\t\t},\n\t\t\t\t\t\t]),\n\t\t\t\t...(options.excludeLintSpelling\n\t\t\t\t\t? []\n\t\t\t\t\t: [\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\tname: \"Lint Spelling\",\n\t\t\t\t\t\t\t\tsteps: [{ run: \"pnpm lint:spelling\" }],\n\t\t\t\t\t\t\t},\n\t\t\t\t\t\t]),\n\t\t\t\t...(options.excludeTests\n\t\t\t\t\t? []\n\t\t\t\t\t: [\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\tname: \"Test\",\n\t\t\t\t\t\t\t\tsteps: [\n\t\t\t\t\t\t\t\t\t{ run: \"pnpm run test --coverage\" },\n\t\t\t\t\t\t\t\t\t{ uses: \"codecov/codecov-action@v3\" },\n\t\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],\n\t\t\tname: \"CI\",\n\t\t}),\n\t\t...(!options.excludeCompliance && {\n\t\t\t\"compliance.yml\": createSoloWorkflowFile({\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[\n\t\t\t\t\t\t\t\t\t...(options.excludeAllContributors\n\t\t\t\t\t\t\t\t\t\t? []\n\t\t\t\t\t\t\t\t\t\t: [\"allcontributors\", \"allcontributors[bot]\"]),\n\t\t\t\t\t\t\t\t\t...(options.excludeRenovate\n\t\t\t\t\t\t\t\t\t\t? []\n\t\t\t\t\t\t\t\t\t\t: [\"renovate\", \"renovate[bot]\"]),\n\t\t\t\t\t\t\t\t].join(\"\\n\") || undefined,\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.excludeAllContributors && {\n\t\t\t\"contributors.yml\": createSoloWorkflowFile({\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.4.3`,\n\t\t\t\t\t},\n\t\t\t\t],\n\t\t\t}),\n\t\t}),\n\t\t...(!options.excludeReleases && {\n\t\t\t\"post-release.yml\": createSoloWorkflowFile({\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\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\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\n\t\t\t\t\t\t\tCheers! 📦🚀\n\t\t\t\t\t\t`,\n\t\t\t\t\t\t\tGITHUB_TOKEN: \"${{ secrets.GITHUB_TOKEN }}\",\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\"pr-review-requested.yml\": createSoloWorkflowFile({\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...(!options.excludeReleases && {\n\t\t\t\"release.yml\": createSoloWorkflowFile({\n\t\t\t\tconcurrency: {\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\tref: \"main\",\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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uB;AAAA,MACjD,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,GAAI,CAAC,QAAQ,mBAAmB;AAAA,MAC/B,eAAe,uBAAuB;AAAA,QACrC,aAAa;AAAA,UACZ,OAAO;AAAA,QACR;AAAA,QACA,MAAM;AAAA,QACN,IAAI;AAAA,UACH,MAAM;AAAA,YACL,UAAU,CAAC,MAAM;AAAA,UAClB;AAAA,QACD;AAAA,QACA,aAAa;AAAA,UACZ,UAAU;AAAA,UACV,YAAY;AAAA,QACb;AAAA,QACA,OAAO;AAAA,UACN;AAAA,YACC,MAAM;AAAA,YACN,MAAM;AAAA,cACL,eAAe;AAAA,cACf,KAAK;AAAA,YACN;AAAA,UACD;AAAA,UACA;AAAA,YACC,MAAM;AAAA,UACP;AAAA,UACA;AAAA,YACC,KAAK;AAAA,UACN;AAAA,UACA;AAAA,YACC,KAAK;AAAA,cACJ,cAAc;AAAA,cACd,WAAW;AAAA,YACZ;AAAA,YACA,MAAM;AAAA,UACP;AAAA,QACD;AAAA,MACD,CAAC;AAAA,IACF;AAAA,EACD;AACD;","names":[]}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { formatYaml } from "../formatters/formatYaml.js";
|
|
2
|
+
function formatWorkflowYaml(value) {
|
|
3
|
+
return formatYaml(value).replaceAll(/\n(\S)/g, "\n\n$1").replaceAll(/: "\\n(.+)"/g, ": |\n$1").replaceAll("\\n", "\n").replaceAll("\\t", " ");
|
|
4
|
+
}
|
|
5
|
+
export {
|
|
6
|
+
formatWorkflowYaml
|
|
7
|
+
};
|
|
8
|
+
//# sourceMappingURL=formatWorkflowYaml.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../../../../src/steps/writing/creation/dotGitHub/formatWorkflowYaml.ts"],"sourcesContent":["import { formatYaml } from \"../formatters/formatYaml.js\";\n\nexport function formatWorkflowYaml(value: unknown) {\n\treturn (\n\t\tformatYaml(value)\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;AAEpB,SAAS,mBAAmB,OAAgB;AAClD,SACC,WAAW,KAAK,EACd,WAAW,WAAW,QAAQ,EAE9B,WAAW,gBAAgB,SAAS,EACpC,WAAW,OAAO,IAAI,EACtB,WAAW,OAAO,IAAI;AAE1B;","names":[]}
|
|
@@ -23,21 +23,13 @@ declare function createDotGitHub(options: Options): Promise<{
|
|
|
23
23
|
"04-tooling.yml": string;
|
|
24
24
|
};
|
|
25
25
|
workflows: {
|
|
26
|
-
"test.yml"?: string | undefined;
|
|
27
|
-
"post-release.yml"?: string | undefined;
|
|
28
26
|
"release.yml"?: string | undefined;
|
|
29
|
-
"
|
|
30
|
-
"
|
|
31
|
-
"lint-markdown.yml"?: string | undefined;
|
|
32
|
-
"lint-knip.yml"?: string | undefined;
|
|
33
|
-
"accessibility-alt-text-bot.yml": string;
|
|
34
|
-
"lint.yml": string;
|
|
27
|
+
"pr-review-requested.yml": string;
|
|
28
|
+
"post-release.yml"?: string | undefined;
|
|
35
29
|
"contributors.yml"?: string | undefined;
|
|
36
30
|
"compliance.yml"?: string | undefined;
|
|
37
|
-
"
|
|
38
|
-
"
|
|
39
|
-
"prettier.yml": string;
|
|
40
|
-
"tsc.yml": string;
|
|
31
|
+
"accessibility-alt-text-bot.yml": string;
|
|
32
|
+
"ci.yml": string;
|
|
41
33
|
};
|
|
42
34
|
}>;
|
|
43
35
|
|
package/package.json
CHANGED
|
@@ -1 +0,0 @@
|
|
|
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\tissue_comment?: {\n\t\ttypes?: string[];\n\t};\n\tissues?: {\n\t\ttypes?: string[];\n\t};\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\tissues?: 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\tif?: string;\n\tname: string;\n\ton?: WorkflowFileOn;\n\tpermissions?: WorkflowFilePermissions;\n}\n\ninterface WorkflowFileOptionsRuns extends WorkflowFileOptionsBase {\n\truns: (string | WorkflowFileStep)[];\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...(options.if && { if: options.if }),\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\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;AAmEpB,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,GAAI,QAAQ,MAAM,EAAE,IAAI,QAAQ,GAAG;AAAA,QACnC,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,QACvC,IACC,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":[]}
|