create-typescript-app 1.65.0 → 1.67.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.
- package/lib/create/createRerunSuggestion.js.map +1 -1
- package/lib/create/index.js.map +1 -1
- package/lib/shared/options/createOptionDefaults/index.js.map +1 -1
- package/lib/shared/options/ensureRepositoryExists.js.map +1 -1
- package/lib/shared/options/optionsSchema.d.ts +6 -6
- package/lib/shared/options/readOptions.js.map +1 -1
- package/lib/steps/addOwnerAsAllContributor.js.map +1 -1
- package/lib/steps/clearUnnecessaryFiles.js +1 -0
- package/lib/steps/clearUnnecessaryFiles.js.map +1 -1
- package/lib/steps/createJoshuaKGoldbergReplacement.js.map +1 -1
- package/lib/steps/finalizeDependencies.js.map +1 -1
- package/lib/steps/initializeGitHubRepository/initializeBranchProtectionSettings.js +9 -9
- package/lib/steps/initializeGitHubRepository/initializeBranchProtectionSettings.js.map +1 -1
- package/lib/steps/updateLocalFiles.js +1 -1
- package/lib/steps/updateLocalFiles.js.map +1 -1
- package/lib/steps/writing/creation/createESLintConfig.js +5 -0
- package/lib/steps/writing/creation/createESLintConfig.js.map +1 -1
- package/lib/steps/writing/creation/dotGitHub/createDevelopment/index.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/lib/steps/writing/creation/dotHusky.js +1 -5
- package/lib/steps/writing/creation/dotHusky.js.map +1 -1
- package/lib/steps/writing/creation/dotVSCode.js.map +1 -1
- package/lib/steps/writing/creation/writePackageJson.js +3 -1
- package/lib/steps/writing/creation/writePackageJson.js.map +1 -1
- package/package.json +40 -40
- package/lib/steps/writing/creation/dotGitHub/createWorkflowFile.js.map +0 -1
|
@@ -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;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;AAAA,QACA,aAAa;AA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AAA,MACD,CAAC;AAAA,MACD,eAAe,mBAAmB;AAAA,QACjC,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,IACA,GAAI,CAAC,QAAQ,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\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};\n}\n"],"mappings":"AACA,SAAS,+BAA+B;AACxC,SAAS,8BAA8B;AAEhC,SAAS,gBAAgB,SAAkB;AACjD,SAAO;AAAA,IACN,kCAAkC,uBAAuB;AAAA,MACxD,IAAI;AAAA,MACJ,MAAM;AAAA,MACN,IAAI;AAAA,QACH,eAAe;AAAA,UACd,OAAO,CAAC,WAAW,QAAQ;AAAA,QAC5B;AAAA,QACA,QAAQ;AAAA,UACP,OAAO,CAAC,UAAU,QAAQ;AAAA,QAC3B;AAAA,QACA,cAAc;AAAA,UACb,OA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V,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
|
|
|
@@ -2,11 +2,7 @@ import { formatIgnoreFile } from "./formatters/formatIgnoreFile.js";
|
|
|
2
2
|
function createDotHusky() {
|
|
3
3
|
return {
|
|
4
4
|
".gitignore": formatIgnoreFile(["_"]),
|
|
5
|
-
"pre-commit": formatIgnoreFile([
|
|
6
|
-
`#!/bin/sh`,
|
|
7
|
-
`. "$(dirname "$0")/_/husky.sh"`,
|
|
8
|
-
"npx lint-staged"
|
|
9
|
-
])
|
|
5
|
+
"pre-commit": formatIgnoreFile(["npx lint-staged"])
|
|
10
6
|
};
|
|
11
7
|
}
|
|
12
8
|
export {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../../src/steps/writing/creation/dotHusky.ts"],"sourcesContent":["import { formatIgnoreFile } from \"./formatters/formatIgnoreFile.js\";\n\nexport function createDotHusky() {\n\treturn {\n\t\t\".gitignore\": formatIgnoreFile([\"_\"]),\n\t\t\"pre-commit\": formatIgnoreFile([\
|
|
1
|
+
{"version":3,"sources":["../../../../src/steps/writing/creation/dotHusky.ts"],"sourcesContent":["import { formatIgnoreFile } from \"./formatters/formatIgnoreFile.js\";\n\nexport function createDotHusky() {\n\treturn {\n\t\t\".gitignore\": formatIgnoreFile([\"_\"]),\n\t\t\"pre-commit\": formatIgnoreFile([\"npx lint-staged\"]),\n\t};\n}\n"],"mappings":"AAAA,SAAS,wBAAwB;AAE1B,SAAS,iBAAiB;AAChC,SAAO;AAAA,IACN,cAAc,iBAAiB,CAAC,GAAG,CAAC;AAAA,IACpC,cAAc,iBAAiB,CAAC,iBAAiB,CAAC;AAAA,EACnD;AACD;","names":[]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../../src/steps/writing/creation/dotVSCode.ts"],"sourcesContent":["import { Options } from \"../../../shared/types.js\";\nimport { formatJson } from \"./formatters/formatJson.js\";\n\n/* spellchecker: disable */\nexport async function createDotVSCode(options: Options) {\n\treturn {\n\t\t\"extensions.json\": await formatJson({\n\t\t\trecommendations: [\n\t\t\t\t\"DavidAnson.vscode-markdownlint\",\n\t\t\t\t\"dbaeumer.vscode-eslint\",\n\t\t\t\t\"esbenp.prettier-vscode\",\n\t\t\t\t!options.excludeLintSpelling && \"streetsidesoftware.code-spell-checker\",\n\t\t\t].filter(Boolean),\n\t\t}),\n\t\t...(options.excludeTests && !options.bin\n\t\t\t? {}\n\t\t\t: {\n\t\t\t\t\t\"launch.json\": await formatJson({\n\t\t\t\t\t\tconfigurations: [\n\t\t\t\t\t\t\t...(options.excludeTests\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\t\t{\n\t\t\t\t\t\t\t\t\t\t\targs: [\"run\", \"${relativeFile}\"],\n\t\t\t\t\t\t\t\t\t\t\tautoAttachChildProcesses: true,\n\t\t\t\t\t\t\t\t\t\t\tconsole: \"integratedTerminal\",\n\t\t\t\t\t\t\t\t\t\t\tname: \"Debug Current Test File\",\n\t\t\t\t\t\t\t\t\t\t\tprogram:\n\t\t\t\t\t\t\t\t\t\t\t\t\"${workspaceRoot}/node_modules/vitest/vitest.mjs\",\n\t\t\t\t\t\t\t\t\t\t\trequest: \"launch\",\n\t\t\t\t\t\t\t\t\t\t\tskipFiles: [\"<node_internals>/**\", \"**/node_modules/**\"],\n\t\t\t\t\t\t\t\t\t\t\tsmartStep: true,\n\t\t\t\t\t\t\t\t\t\t\ttype: \"node\",\n\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t
|
|
1
|
+
{"version":3,"sources":["../../../../src/steps/writing/creation/dotVSCode.ts"],"sourcesContent":["import { Options } from \"../../../shared/types.js\";\nimport { formatJson } from \"./formatters/formatJson.js\";\n\n/* spellchecker: disable */\nexport async function createDotVSCode(options: Options) {\n\treturn {\n\t\t\"extensions.json\": await formatJson({\n\t\t\trecommendations: [\n\t\t\t\t\"DavidAnson.vscode-markdownlint\",\n\t\t\t\t\"dbaeumer.vscode-eslint\",\n\t\t\t\t\"esbenp.prettier-vscode\",\n\t\t\t\t!options.excludeLintSpelling && \"streetsidesoftware.code-spell-checker\",\n\t\t\t].filter(Boolean),\n\t\t}),\n\t\t...(options.excludeTests && !options.bin\n\t\t\t? {}\n\t\t\t: {\n\t\t\t\t\t\"launch.json\": await formatJson({\n\t\t\t\t\t\tconfigurations: [\n\t\t\t\t\t\t\t...(options.excludeTests\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\t\t{\n\t\t\t\t\t\t\t\t\t\t\targs: [\"run\", \"${relativeFile}\"],\n\t\t\t\t\t\t\t\t\t\t\tautoAttachChildProcesses: true,\n\t\t\t\t\t\t\t\t\t\t\tconsole: \"integratedTerminal\",\n\t\t\t\t\t\t\t\t\t\t\tname: \"Debug Current Test File\",\n\t\t\t\t\t\t\t\t\t\t\tprogram:\n\t\t\t\t\t\t\t\t\t\t\t\t\"${workspaceRoot}/node_modules/vitest/vitest.mjs\",\n\t\t\t\t\t\t\t\t\t\t\trequest: \"launch\",\n\t\t\t\t\t\t\t\t\t\t\tskipFiles: [\"<node_internals>/**\", \"**/node_modules/**\"],\n\t\t\t\t\t\t\t\t\t\t\tsmartStep: true,\n\t\t\t\t\t\t\t\t\t\t\ttype: \"node\",\n\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t]),\n\t\t\t\t\t\t\t...(options.bin\n\t\t\t\t\t\t\t\t? [\n\t\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\t\tname: \"Debug Program\",\n\t\t\t\t\t\t\t\t\t\t\tpreLaunchTask: \"build\",\n\t\t\t\t\t\t\t\t\t\t\tprogram: options.bin,\n\t\t\t\t\t\t\t\t\t\t\trequest: \"launch\",\n\t\t\t\t\t\t\t\t\t\t\tskipFiles: [\"<node_internals>/**\"],\n\t\t\t\t\t\t\t\t\t\t\ttype: \"node\",\n\t\t\t\t\t\t\t\t\t\t},\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\tversion: \"0.2.0\",\n\t\t\t\t\t}),\n\t\t\t\t}),\n\t\t\"settings.json\": await formatJson({\n\t\t\t\"editor.codeActionsOnSave\": {\n\t\t\t\t\"source.fixAll.eslint\": \"explicit\",\n\t\t\t},\n\t\t\t\"editor.defaultFormatter\": \"esbenp.prettier-vscode\",\n\t\t\t\"editor.formatOnSave\": true,\n\t\t\t\"editor.rulers\": [80],\n\t\t\t\"eslint.probe\": [\n\t\t\t\t\"javascript\",\n\t\t\t\t\"javascriptreact\",\n\t\t\t\t\"json\",\n\t\t\t\t\"jsonc\",\n\t\t\t\t\"markdown\",\n\t\t\t\t\"typescript\",\n\t\t\t\t\"typescriptreact\",\n\t\t\t\t\"yaml\",\n\t\t\t],\n\t\t\t\"eslint.rules.customizations\": [{ rule: \"*\", severity: \"warn\" }],\n\t\t\t\"eslint.useFlatConfig\": true,\n\t\t\t\"typescript.tsdk\": \"node_modules/typescript/lib\",\n\t\t}),\n\t\t\"tasks.json\": await formatJson({\n\t\t\ttasks: [\n\t\t\t\t{\n\t\t\t\t\tdetail: \"Build the project\",\n\t\t\t\t\tlabel: \"build\",\n\t\t\t\t\tscript: \"build\",\n\t\t\t\t\ttype: \"npm\",\n\t\t\t\t},\n\t\t\t],\n\t\t\tversion: \"2.0.0\",\n\t\t}),\n\t};\n}\n"],"mappings":"AACA,SAAS,kBAAkB;AAG3B,eAAsB,gBAAgB,SAAkB;AACvD,SAAO;AAAA,IACN,mBAAmB,MAAM,WAAW;AAAA,MACnC,iBAAiB;AAAA,QAChB;AAAA,QACA;AAAA,QACA;AAAA,QACA,CAAC,QAAQ,uBAAuB;AAAA,MACjC,EAAE,OAAO,OAAO;AAAA,IACjB,CAAC;AAAA,IACD,GAAI,QAAQ,gBAAgB,CAAC,QAAQ,MAClC,CAAC,IACD;AAAA,MACA,eAAe,MAAM,WAAW;AAAA,QAC/B,gBAAgB;AAAA,UACf,GAAI,QAAQ,eACT,CAAC,IACD;AAAA,YACA;AAAA,cACC,MAAM,CAAC,OAAO,iBAAiB;AAAA,cAC/B,0BAA0B;AAAA,cAC1B,SAAS;AAAA,cACT,MAAM;AAAA,cACN,SACC;AAAA,cACD,SAAS;AAAA,cACT,WAAW,CAAC,uBAAuB,oBAAoB;AAAA,cACvD,WAAW;AAAA,cACX,MAAM;AAAA,YACP;AAAA,UACD;AAAA,UACF,GAAI,QAAQ,MACT;AAAA,YACA;AAAA,cACC,MAAM;AAAA,cACN,eAAe;AAAA,cACf,SAAS,QAAQ;AAAA,cACjB,SAAS;AAAA,cACT,WAAW,CAAC,qBAAqB;AAAA,cACjC,MAAM;AAAA,YACP;AAAA,UACD,IACC,CAAC;AAAA,QACL;AAAA,QACA,SAAS;AAAA,MACV,CAAC;AAAA,IACF;AAAA,IACF,iBAAiB,MAAM,WAAW;AAAA,MACjC,4BAA4B;AAAA,QAC3B,wBAAwB;AAAA,MACzB;AAAA,MACA,2BAA2B;AAAA,MAC3B,uBAAuB;AAAA,MACvB,iBAAiB,CAAC,EAAE;AAAA,MACpB,gBAAgB;AAAA,QACf;AAAA,QACA;AAAA,QACA;AAAA,QACA;AAAA,QACA;AAAA,QACA;AAAA,QACA;AAAA,QACA;AAAA,MACD;AAAA,MACA,+BAA+B,CAAC,EAAE,MAAM,KAAK,UAAU,OAAO,CAAC;AAAA,MAC/D,wBAAwB;AAAA,MACxB,mBAAmB;AAAA,IACpB,CAAC;AAAA,IACD,cAAc,MAAM,WAAW;AAAA,MAC9B,OAAO;AAAA,QACN;AAAA,UACC,QAAQ;AAAA,UACR,OAAO;AAAA,UACP,QAAQ;AAAA,UACR,MAAM;AAAA,QACP;AAAA,MACD;AAAA,MACA,SAAS;AAAA,IACV,CAAC;AAAA,EACF;AACD;","names":[]}
|
|
@@ -44,11 +44,13 @@ async function writePackageJson(options) {
|
|
|
44
44
|
// Remove fields we know we don't want, such as old or redundant configs
|
|
45
45
|
eslintConfig: void 0,
|
|
46
46
|
husky: void 0,
|
|
47
|
+
jest: void 0,
|
|
48
|
+
mocha: void 0,
|
|
47
49
|
prettierConfig: void 0,
|
|
48
50
|
types: void 0,
|
|
49
51
|
// The rest of the fields are ones we know from our template
|
|
50
52
|
engines: {
|
|
51
|
-
node: ">=18"
|
|
53
|
+
node: ">=18.3.0"
|
|
52
54
|
},
|
|
53
55
|
files: [
|
|
54
56
|
options.bin?.replace(/^\.\//, ""),
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../../src/steps/writing/creation/writePackageJson.ts"],"sourcesContent":["import { readFileSafeAsJson } from \"../../../shared/readFileSafeAsJson.js\";\nimport { Options, PartialPackageData } from \"../../../shared/types.js\";\nimport { formatJson } from \"./formatters/formatJson.js\";\n\nconst devDependenciesToRemove = [\n\t\"@babel/core\",\n\t\"@babel/preset-env\",\n\t\"@babel/preset-react\",\n\t\"@babel/preset-typescript\",\n\t\"@swc/jest\",\n\t\"@vitest/coverage-istanbul\",\n\t\"ava\",\n\t\"babel-jest\",\n\t\"commitlint\",\n\t\"cson-parser\",\n\t\"esbuild\",\n\t\"eslint-config-prettier\",\n\t\"eslint-plugin-import\",\n\t\"eslint-plugin-jest\",\n\t\"eslint-plugin-prettier\",\n\t\"eslint-plugin-simple-import-sort\",\n\t\"eslint-plugin-typescript-sort-keys\",\n\t\"jasmine\",\n\t\"jest\",\n\t\"mocha\",\n\t\"npm-run-all\",\n\t\"pnpm-deduplicate\",\n\t\"pretty-quick\",\n\t\"ts-jest\",\n];\n\nexport async function writePackageJson(options: Options) {\n\tconst existingPackageJson =\n\t\t((await readFileSafeAsJson(\n\t\t\t\"./package.json\",\n\t\t)) as null | PartialPackageData) ?? {};\n\n\treturn await formatJson({\n\t\t// If we didn't already have a version, set it to 0.0.0\n\t\tversion: \"0.0.0\",\n\n\t\t// To start, copy over all existing package fields (e.g. \"dependencies\")\n\t\t...existingPackageJson,\n\n\t\tauthor: { email: options.email.npm, name: options.author },\n\t\tbin: options.bin,\n\t\tdescription: options.description,\n\t\tkeywords: options.keywords?.length\n\t\t\t? options.keywords.flatMap((keyword) => keyword.split(/ /))\n\t\t\t: undefined,\n\n\t\t// We copy all existing dev dependencies except those we know are not used anymore\n\t\tdevDependencies: copyDevDependencies(existingPackageJson),\n\n\t\t// Remove fields we know we don't want, such as old or redundant configs\n\t\teslintConfig: undefined,\n\t\thusky: undefined,\n\t\tprettierConfig: undefined,\n\t\ttypes: undefined,\n\n\t\t// The rest of the fields are ones we know from our template\n\t\tengines: {\n\t\t\tnode: \">=18\",\n\t\t},\n\t\tfiles: [\n\t\t\toptions.bin?.replace(/^\\.\\//, \"\"),\n\t\t\t\"lib/\",\n\t\t\t\"package.json\",\n\t\t\t\"LICENSE.md\",\n\t\t\t\"README.md\",\n\t\t].filter(Boolean),\n\t\tlicense: \"MIT\",\n\t\t\"lint-staged\": {\n\t\t\t\"*\": \"prettier --ignore-unknown --write\",\n\t\t},\n\t\tmain: \"./lib/index.js\",\n\t\tname: options.repository,\n\t\tpublishConfig: {\n\t\t\tprovenance: true,\n\t\t},\n\t\trepository: {\n\t\t\ttype: \"git\",\n\t\t\turl: `https://github.com/${options.owner}/${options.repository}`,\n\t\t},\n\t\tscripts: {\n\t\t\t...existingPackageJson.scripts,\n\t\t\t...(!options.excludeBuild && {\n\t\t\t\tbuild: \"tsup\",\n\t\t\t}),\n\t\t\tformat: \"prettier .\",\n\t\t\tlint: \"eslint . --max-warnings 0\",\n\t\t\t...(!options.excludeLintKnip && {\n\t\t\t\t\"lint:knip\": \"knip\",\n\t\t\t}),\n\t\t\t...(!options.excludeLintMd && {\n\t\t\t\t\"lint:md\":\n\t\t\t\t\t'markdownlint \"**/*.md\" \".github/**/*.md\" --rules sentences-per-line',\n\t\t\t}),\n\t\t\t...(!options.excludeLintPackages && {\n\t\t\t\t\"lint:packages\": \"pnpm dedupe --check\",\n\t\t\t}),\n\t\t\t...(!options.excludeLintSpelling && {\n\t\t\t\t\"lint:spelling\": 'cspell \"**\" \".github/**/*\"',\n\t\t\t}),\n\t\t\tprepare: \"husky\",\n\t\t\t...(!options.excludeReleases && { test: \"vitest\" }),\n\t\t\ttsc: \"tsc\",\n\t\t},\n\t\ttype: \"module\",\n\t});\n}\n\nfunction copyDevDependencies(existingPackageJson: object) {\n\tconst devDependencies =\n\t\t\"devDependencies\" in existingPackageJson\n\t\t\t? (existingPackageJson.devDependencies as Record<string, string>)\n\t\t\t: {};\n\n\tfor (const devDependencyToRemove of devDependenciesToRemove) {\n\t\t// eslint-disable-next-line @typescript-eslint/no-dynamic-delete\n\t\tdelete devDependencies[devDependencyToRemove];\n\t}\n\n\treturn devDependencies;\n}\n"],"mappings":"AAAA,SAAS,0BAA0B;AAEnC,SAAS,kBAAkB;AAE3B,M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A,SAAS;AAAA,MACR,GAAG,oBAAoB;AAAA,MACvB,GAAI,CAAC,QAAQ,gBAAgB;AAAA,QAC5B,OAAO;AAAA,MACR;AAAA,MACA,QAAQ;AAAA,MACR,MAAM;AAAA,MACN,GAAI,CAAC,QAAQ,mBAAmB;AAAA,QAC/B,aAAa;AAAA,MACd;AAAA,MACA,GAAI,CAAC,QAAQ,iBAAiB;AAAA,QAC7B,WACC;AAAA,MACF;AAAA,MACA,GAAI,CAAC,QAAQ,uBAAuB;AAAA,QACnC,iBAAiB;AAAA,MAClB;AAAA,MACA,GAAI,CAAC,QAAQ,uBAAuB;AAAA,QACnC,iBAAiB;AAAA,MAClB;AAAA,MACA,SAAS;AAAA,MACT,GAAI,CAAC,QAAQ,mBAAmB,EAAE,MAAM,SAAS;AAAA,MACjD,KAAK;AAAA,IACN;AAAA,IACA,MAAM;AAAA,EACP,CAAC;AACF;AAEA,SAAS,oBAAoB,qBAA6B;AACzD,QAAM,kBACL,qBAAqB,sBACjB,oBAAoB,kBACrB,CAAC;AAEL,aAAW,yBAAyB,yBAAyB;AAE5D,WAAO,gBAAgB,qBAAqB;AAAA,EAC7C;AAEA,SAAO;AACR;","names":[]}
|
|
1
|
+
{"version":3,"sources":["../../../../src/steps/writing/creation/writePackageJson.ts"],"sourcesContent":["import { readFileSafeAsJson } from \"../../../shared/readFileSafeAsJson.js\";\nimport { Options, PartialPackageData } from \"../../../shared/types.js\";\nimport { formatJson } from \"./formatters/formatJson.js\";\n\nconst devDependenciesToRemove = [\n\t\"@babel/core\",\n\t\"@babel/preset-env\",\n\t\"@babel/preset-react\",\n\t\"@babel/preset-typescript\",\n\t\"@swc/jest\",\n\t\"@vitest/coverage-istanbul\",\n\t\"ava\",\n\t\"babel-jest\",\n\t\"commitlint\",\n\t\"cson-parser\",\n\t\"esbuild\",\n\t\"eslint-config-prettier\",\n\t\"eslint-plugin-import\",\n\t\"eslint-plugin-jest\",\n\t\"eslint-plugin-prettier\",\n\t\"eslint-plugin-simple-import-sort\",\n\t\"eslint-plugin-typescript-sort-keys\",\n\t\"jasmine\",\n\t\"jest\",\n\t\"mocha\",\n\t\"npm-run-all\",\n\t\"pnpm-deduplicate\",\n\t\"pretty-quick\",\n\t\"ts-jest\",\n];\n\nexport async function writePackageJson(options: Options) {\n\tconst existingPackageJson =\n\t\t((await readFileSafeAsJson(\n\t\t\t\"./package.json\",\n\t\t)) as null | PartialPackageData) ?? {};\n\n\treturn await formatJson({\n\t\t// If we didn't already have a version, set it to 0.0.0\n\t\tversion: \"0.0.0\",\n\n\t\t// To start, copy over all existing package fields (e.g. \"dependencies\")\n\t\t...existingPackageJson,\n\n\t\tauthor: { email: options.email.npm, name: options.author },\n\t\tbin: options.bin,\n\t\tdescription: options.description,\n\t\tkeywords: options.keywords?.length\n\t\t\t? options.keywords.flatMap((keyword) => keyword.split(/ /))\n\t\t\t: undefined,\n\n\t\t// We copy all existing dev dependencies except those we know are not used anymore\n\t\tdevDependencies: copyDevDependencies(existingPackageJson),\n\n\t\t// Remove fields we know we don't want, such as old or redundant configs\n\t\teslintConfig: undefined,\n\t\thusky: undefined,\n\t\tjest: undefined,\n\t\tmocha: undefined,\n\t\tprettierConfig: undefined,\n\t\ttypes: undefined,\n\n\t\t// The rest of the fields are ones we know from our template\n\t\tengines: {\n\t\t\tnode: \">=18.3.0\",\n\t\t},\n\t\tfiles: [\n\t\t\toptions.bin?.replace(/^\\.\\//, \"\"),\n\t\t\t\"lib/\",\n\t\t\t\"package.json\",\n\t\t\t\"LICENSE.md\",\n\t\t\t\"README.md\",\n\t\t].filter(Boolean),\n\t\tlicense: \"MIT\",\n\t\t\"lint-staged\": {\n\t\t\t\"*\": \"prettier --ignore-unknown --write\",\n\t\t},\n\t\tmain: \"./lib/index.js\",\n\t\tname: options.repository,\n\t\tpublishConfig: {\n\t\t\tprovenance: true,\n\t\t},\n\t\trepository: {\n\t\t\ttype: \"git\",\n\t\t\turl: `https://github.com/${options.owner}/${options.repository}`,\n\t\t},\n\t\tscripts: {\n\t\t\t...existingPackageJson.scripts,\n\t\t\t...(!options.excludeBuild && {\n\t\t\t\tbuild: \"tsup\",\n\t\t\t}),\n\t\t\tformat: \"prettier .\",\n\t\t\tlint: \"eslint . --max-warnings 0\",\n\t\t\t...(!options.excludeLintKnip && {\n\t\t\t\t\"lint:knip\": \"knip\",\n\t\t\t}),\n\t\t\t...(!options.excludeLintMd && {\n\t\t\t\t\"lint:md\":\n\t\t\t\t\t'markdownlint \"**/*.md\" \".github/**/*.md\" --rules sentences-per-line',\n\t\t\t}),\n\t\t\t...(!options.excludeLintPackages && {\n\t\t\t\t\"lint:packages\": \"pnpm dedupe --check\",\n\t\t\t}),\n\t\t\t...(!options.excludeLintSpelling && {\n\t\t\t\t\"lint:spelling\": 'cspell \"**\" \".github/**/*\"',\n\t\t\t}),\n\t\t\tprepare: \"husky\",\n\t\t\t...(!options.excludeReleases && { test: \"vitest\" }),\n\t\t\ttsc: \"tsc\",\n\t\t},\n\t\ttype: \"module\",\n\t});\n}\n\nfunction copyDevDependencies(existingPackageJson: object) {\n\tconst devDependencies =\n\t\t\"devDependencies\" in existingPackageJson\n\t\t\t? (existingPackageJson.devDependencies as Record<string, string>)\n\t\t\t: {};\n\n\tfor (const devDependencyToRemove of devDependenciesToRemove) {\n\t\t// eslint-disable-next-line @typescript-eslint/no-dynamic-delete\n\t\tdelete devDependencies[devDependencyToRemove];\n\t}\n\n\treturn devDependencies;\n}\n"],"mappings":"AAAA,SAAS,0BAA0B;AAEnC,SAAS,kBAAkB;AAE3B,MAAM,0BAA0B;AAAA,EAC/B;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AACD;A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AA,QAC7B,WACC;AAAA,MACF;AAAA,MACA,GAAI,CAAC,QAAQ,uBAAuB;AAAA,QACnC,iBAAiB;AAAA,MAClB;AAAA,MACA,GAAI,CAAC,QAAQ,uBAAuB;AAAA,QACnC,iBAAiB;AAAA,MAClB;AAAA,MACA,SAAS;AAAA,MACT,GAAI,CAAC,QAAQ,mBAAmB,EAAE,MAAM,SAAS;AAAA,MACjD,KAAK;AAAA,IACN;AAAA,IACA,MAAM;AAAA,EACP,CAAC;AACF;AAEA,SAAS,oBAAoB,qBAA6B;AACzD,QAAM,kBACL,qBAAqB,sBACjB,oBAAoB,kBACrB,CAAC;AAEL,aAAW,yBAAyB,yBAAyB;AAE5D,WAAO,gBAAgB,qBAAqB;AAAA,EAC7C;AAEA,SAAO;AACR;","names":[]}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "create-typescript-app",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.67.0",
|
|
4
4
|
"description": "Quickstart-friendly TypeScript template with comprehensive, configurable, opinionated tooling. 💝",
|
|
5
5
|
"repository": {
|
|
6
6
|
"type": "git",
|
|
@@ -42,69 +42,69 @@
|
|
|
42
42
|
},
|
|
43
43
|
"dependencies": {
|
|
44
44
|
"@clack/prompts": "^0.7.0",
|
|
45
|
-
"all-contributors-for-repository": "^0.2.
|
|
45
|
+
"all-contributors-for-repository": "^0.2.2",
|
|
46
46
|
"chalk": "^5.3.0",
|
|
47
|
-
"execa": "^9.
|
|
47
|
+
"execa": "^9.3.0",
|
|
48
48
|
"get-github-auth-token": "^0.1.0",
|
|
49
49
|
"git-remote-origin-url": "^4.0.0",
|
|
50
|
-
"git-url-parse": "^14.
|
|
50
|
+
"git-url-parse": "^14.1.0",
|
|
51
51
|
"js-yaml": "^4.1.0",
|
|
52
52
|
"lazy-value": "^3.0.0",
|
|
53
|
-
"npm-user": "^6.
|
|
54
|
-
"octokit": "^4.0.
|
|
53
|
+
"npm-user": "^6.1.1",
|
|
54
|
+
"octokit": "^4.0.2",
|
|
55
55
|
"parse-author": "^2.0.0",
|
|
56
|
-
"prettier": "^3.
|
|
57
|
-
"replace-in-file": "^
|
|
58
|
-
"rimraf": "^6.0.
|
|
59
|
-
"title-case": "^4.1
|
|
60
|
-
"zod": "^3.
|
|
61
|
-
"zod-validation-error": "^3.
|
|
56
|
+
"prettier": "^3.3.3",
|
|
57
|
+
"replace-in-file": "^8.1.0",
|
|
58
|
+
"rimraf": "^6.0.1",
|
|
59
|
+
"title-case": "^4.3.1",
|
|
60
|
+
"zod": "^3.23.8",
|
|
61
|
+
"zod-validation-error": "^3.3.1"
|
|
62
62
|
},
|
|
63
63
|
"devDependencies": {
|
|
64
64
|
"@eslint-community/eslint-plugin-eslint-comments": "^4.3.0",
|
|
65
|
-
"@eslint/js": "^9.
|
|
66
|
-
"@octokit/request-error": "^6.1.
|
|
65
|
+
"@eslint/js": "^9.8.0",
|
|
66
|
+
"@octokit/request-error": "^6.1.4",
|
|
67
67
|
"@release-it/conventional-changelog": "^8.0.1",
|
|
68
68
|
"@types/eslint-plugin-markdown": "^2.0.2",
|
|
69
69
|
"@types/eslint__js": "^8.42.3",
|
|
70
70
|
"@types/git-url-parse": "^9.0.3",
|
|
71
71
|
"@types/js-yaml": "^4.0.9",
|
|
72
|
-
"@types/node": "^
|
|
72
|
+
"@types/node": "^22.1.0",
|
|
73
73
|
"@types/parse-author": "^2.0.3",
|
|
74
|
-
"@vitest/coverage-v8": "^2.0.
|
|
75
|
-
"c8": "^10.
|
|
74
|
+
"@vitest/coverage-v8": "^2.0.5",
|
|
75
|
+
"c8": "^10.1.2",
|
|
76
76
|
"console-fail-test": "^0.4.4",
|
|
77
|
-
"cspell": "^8.1
|
|
78
|
-
"eslint": "^9.
|
|
79
|
-
"eslint-plugin-jsdoc": "^
|
|
80
|
-
"eslint-plugin-jsonc": "^2.
|
|
81
|
-
"eslint-plugin-markdown": "^5.
|
|
82
|
-
"eslint-plugin-n": "^17.
|
|
83
|
-
"eslint-plugin-package-json": "^0.15.
|
|
84
|
-
"eslint-plugin-perfectionist": "^3.1.
|
|
85
|
-
"eslint-plugin-regexp": "^2.
|
|
86
|
-
"eslint-plugin-vitest": "^0.5.
|
|
77
|
+
"cspell": "^8.13.1",
|
|
78
|
+
"eslint": "^9.8.0",
|
|
79
|
+
"eslint-plugin-jsdoc": "^50.0.0",
|
|
80
|
+
"eslint-plugin-jsonc": "^2.16.0",
|
|
81
|
+
"eslint-plugin-markdown": "^5.1.0",
|
|
82
|
+
"eslint-plugin-n": "^17.10.2",
|
|
83
|
+
"eslint-plugin-package-json": "^0.15.2",
|
|
84
|
+
"eslint-plugin-perfectionist": "^3.1.3",
|
|
85
|
+
"eslint-plugin-regexp": "^2.6.0",
|
|
86
|
+
"eslint-plugin-vitest": "^0.5.4",
|
|
87
87
|
"eslint-plugin-yml": "^1.14.0",
|
|
88
|
-
"globby": "^14.0.
|
|
89
|
-
"husky": "^9.
|
|
88
|
+
"globby": "^14.0.2",
|
|
89
|
+
"husky": "^9.1.4",
|
|
90
90
|
"jsonc-eslint-parser": "^2.4.0",
|
|
91
|
-
"knip": "5.
|
|
92
|
-
"lint-staged": "^15.2.
|
|
91
|
+
"knip": "5.27.1",
|
|
92
|
+
"lint-staged": "^15.2.8",
|
|
93
93
|
"markdownlint": "^0.34.0",
|
|
94
94
|
"markdownlint-cli": "^0.41.0",
|
|
95
|
-
"prettier-plugin-curly": "^0.2.
|
|
96
|
-
"prettier-plugin-packagejson": "^2.5.
|
|
95
|
+
"prettier-plugin-curly": "^0.2.2",
|
|
96
|
+
"prettier-plugin-packagejson": "^2.5.1",
|
|
97
97
|
"prettier-plugin-sh": "^0.14.0",
|
|
98
|
-
"release-it": "^17.
|
|
98
|
+
"release-it": "^17.6.0",
|
|
99
99
|
"sentences-per-line": "^0.2.1",
|
|
100
|
-
"tsup": "^8.
|
|
101
|
-
"tsx": "^4.
|
|
102
|
-
"typescript": "^5.5.
|
|
103
|
-
"typescript-eslint": "^8.0.
|
|
104
|
-
"vitest": "^2.0.
|
|
100
|
+
"tsup": "^8.2.4",
|
|
101
|
+
"tsx": "^4.16.5",
|
|
102
|
+
"typescript": "^5.5.4",
|
|
103
|
+
"typescript-eslint": "^8.0.1",
|
|
104
|
+
"vitest": "^2.0.5"
|
|
105
105
|
},
|
|
106
106
|
"engines": {
|
|
107
|
-
"node": ">=18"
|
|
107
|
+
"node": ">=18.3.0"
|
|
108
108
|
},
|
|
109
109
|
"publishConfig": {
|
|
110
110
|
"provenance": true
|
|
@@ -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 ]\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,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":[]}
|