create-typescript-app 1.57.6 → 1.57.7
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/steps/initializeGitHubRepository/initializeBranchProtectionSettings.d.ts +1 -1
- package/lib/steps/initializeGitHubRepository/initializeBranchProtectionSettings.js +10 -10
- package/lib/steps/initializeGitHubRepository/initializeBranchProtectionSettings.js.map +1 -1
- package/package.json +1 -1
|
@@ -3,6 +3,6 @@ import { Options } from '../../shared/types.js';
|
|
|
3
3
|
import 'zod';
|
|
4
4
|
import '../../shared/codes.js';
|
|
5
5
|
|
|
6
|
-
declare function initializeBranchProtectionSettings(octokit: Octokit,
|
|
6
|
+
declare function initializeBranchProtectionSettings(octokit: Octokit, options: Options): Promise<false | undefined>;
|
|
7
7
|
|
|
8
8
|
export { initializeBranchProtectionSettings };
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
async function initializeBranchProtectionSettings(octokit,
|
|
1
|
+
async function initializeBranchProtectionSettings(octokit, options) {
|
|
2
2
|
try {
|
|
3
3
|
await octokit.request(
|
|
4
|
-
`PUT /repos/${owner}/${repository}/branches/main/protection`,
|
|
4
|
+
`PUT /repos/${options.owner}/${options.repository}/branches/main/protection`,
|
|
5
5
|
{
|
|
6
6
|
allow_deletions: false,
|
|
7
7
|
allow_force_pushes: true,
|
|
@@ -10,22 +10,22 @@ async function initializeBranchProtectionSettings(octokit, { owner, repository }
|
|
|
10
10
|
block_creations: false,
|
|
11
11
|
branch: "main",
|
|
12
12
|
enforce_admins: false,
|
|
13
|
-
owner,
|
|
14
|
-
repo: repository,
|
|
13
|
+
owner: options.owner,
|
|
14
|
+
repo: options.repository,
|
|
15
15
|
required_conversation_resolution: true,
|
|
16
16
|
required_linear_history: false,
|
|
17
17
|
required_pull_request_reviews: null,
|
|
18
18
|
required_status_checks: {
|
|
19
19
|
checks: [
|
|
20
20
|
{ context: "build" },
|
|
21
|
-
{ context: "compliance" },
|
|
22
21
|
{ context: "lint" },
|
|
23
|
-
{ context: "lint_knip" },
|
|
24
|
-
{ context: "lint_markdown" },
|
|
25
|
-
{ context: "lint_packages" },
|
|
26
|
-
{ context: "lint_spelling" },
|
|
27
22
|
{ context: "prettier" },
|
|
28
|
-
{ context: "
|
|
23
|
+
...options.excludeCompliance ? [] : [{ context: "compliance" }],
|
|
24
|
+
...options.excludeLintKnip ? [] : [{ context: "lint_knip" }],
|
|
25
|
+
...options.excludeLintMd ? [] : [{ context: "lint_markdown" }],
|
|
26
|
+
...options.excludeLintPackages ? [] : [{ context: "lint_packages" }],
|
|
27
|
+
...options.excludeLintSpelling ? [] : [{ context: "lint_spelling" }],
|
|
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\
|
|
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{ context: \"lint\" },\n\t\t\t\t\t\t{ context: \"prettier\" },\n\t\t\t\t\t\t...(options.excludeCompliance ? [] : [{ context: \"compliance\" }]),\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...(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,EAAE,SAAS,OAAO;AAAA,YAClB,EAAE,SAAS,WAAW;AAAA,YACtB,GAAI,QAAQ,oBAAoB,CAAC,IAAI,CAAC,EAAE,SAAS,aAAa,CAAC;AAAA,YAC/D,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,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":[]}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "create-typescript-app",
|
|
3
|
-
"version": "1.57.
|
|
3
|
+
"version": "1.57.7",
|
|
4
4
|
"description": "Quickstart-friendly TypeScript template with comprehensive, configurable, opinionated tooling. 💝",
|
|
5
5
|
"repository": "JoshuaKGoldberg/create-typescript-app",
|
|
6
6
|
"license": "MIT",
|