Skip to content

Commit a51c624

Browse files
feat: split contributors option into exclude-all-contributors and --skip-all-contributors-api (#899)
## PR Checklist - [x] Addresses an existing open issue: fixes #875; fixes #898 - [x] That issue was marked as [`status: accepting prs`](https://github.com/JoshuaKGoldberg/create-typescript-app/issues?q=is%3Aopen+is%3Aissue+label%3A%22status%3A+accepting+prs%22) - [x] Steps in [CONTRIBUTING.md](https://github.com/JoshuaKGoldberg/create-typescript-app/blob/main/.github/CONTRIBUTING.md) were taken ## Overview Splits the option into: * `--exclude-all-contributors`: disables the all-contributors feature altogether * `--skip-all-contributors-api`: allows the all-contributors feature, but skips fetching past contributions from GitHub
1 parent 9696273 commit a51c624

33 files changed

+565
-58
lines changed

cspell.json

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,8 @@
99
"pnpm-lock.yaml"
1010
],
1111
"words": [
12+
"allcontributors",
13+
"apexskier",
1214
"Codecov",
1315
"codespace",
1416
"commitlint",
@@ -20,11 +22,14 @@
2022
"knip",
2123
"lcov",
2224
"markdownlintignore",
25+
"mtfoley",
2326
"npmignore",
27+
"npmjs",
2428
"npmpackagejsonlintrc",
2529
"outro",
2630
"packagejson",
2731
"quickstart",
32+
"tada",
2833
"tsup",
2934
"Unstaged",
3035
"wontfix"

docs/Creation.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,8 +23,8 @@ Hooray! 🥳
2323
You can explicitly provide some or all of the options the script would prompt for as command-line flags.
2424
See [Options.md](./Options.md).
2525

26-
For example, running the creation script and skipping all APIs:
26+
For example, running the creation script and skipping all GitHub APIs:
2727

2828
```shell
29-
npx create-typescript-app --mode create --exclude-contributors --skip-github-api
29+
npx create-typescript-app --mode create --skip-all-contributors-api --skip-github-api
3030
```

docs/Initialization.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -37,8 +37,8 @@ See [Options.md](./Options.md).
3737

3838
`pnpm run initialize` will set `--mode` to `initialize`.
3939

40-
For example, running the initialization script and skipping all APIs:
40+
For example, running the initialization script and skipping all GitHub APIs:
4141

4242
```shell
43-
pnpm run initialize --exclude-contributors --skip-github-api
43+
pnpm run initialize --skip-all-contributors-api --skip-github-api
4444
```

docs/Migration.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,8 +16,8 @@ npx create-typescript-app
1616
You can explicitly provide some or all of the options the script would prompt for as command-line flags.
1717
See [Options.md](./Options.md).
1818

19-
For example, running the migration script and skipping all APIs:
19+
For example, running the migration script and skipping all GitHub APIs:
2020

2121
```shell
22-
npx create-typescript-app --mode migrate --exclude-contributors --skip-github-api
22+
npx create-typescript-app --mode migrate --skip-all-contributors-api --skip-github-api
2323
```

docs/Options.md

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -74,8 +74,8 @@ The setup scripts can be directed with CLI flags to opt out tooling portions and
7474
The setup scripts normally will prompt you to select how much of the tooling you'd like to enable in a new repository.
7575
Alternately, you can bypass that prompt by providing any number of the following CLI flags:
7676

77+
- `--exclude-all-contributors`: Don't add all-contributors to track contributions and display them in a README.md table.
7778
- `--exclude-compliance`: Don't add a GitHub Actions workflow to verify that PRs match an expected format.
78-
- `--exclude-contributors`: Don't add all-contributors to track contributions and display them in a README.md table.
7979
- `--exclude-lint-json`: Don't apply linting and sorting to `*.json` and `*.jsonc` files.
8080
- `--exclude-lint-knip`: Don't add Knip to detect unused files, dependencies, and code exports.
8181
- `--exclude-lint-md`: Don't apply linting to `*.md` files.
@@ -107,18 +107,18 @@ npx create-typescript-app --exclude-lint-package-json --exclude-lint-packages --
107107

108108
You can prevent the migration script from making some network-based changes using any or all of the following CLI flags:
109109

110-
- `--exclude-contributors` _(`boolean`)_: Skips network calls that fetch all-contributors data from GitHub
111-
- This flag does nothing if `--exclude-contributors` was specified.
110+
- `--skip-all-contributors-api` _(`boolean`)_: Skips network calls that fetch all-contributors data from GitHub
111+
- This flag does nothing if `--skip-all-contributors` was specified.
112112
- `--skip-github-api` _(`boolean`)_: Skips calling to GitHub APIs.
113113
- `--skip-install` _(`boolean`)_: Skips installing all the new template packages with `pnpm`.
114114

115115
For example, providing all three flags will completely skip all network requests:
116116

117117
```shell
118-
npx create-typescript-app --exclude-contributors --skip-github-api --skip-install
118+
npx create-typescript-app --skip-all-contributors-api --skip-github-api --skip-install
119119
```
120120

121-
> 💡 Tip: To temporarily preview what the script would apply, you can run with all `--skip-*` flags, then `git add -A; git reset --hard HEAD` to completely reset all changes.
121+
> 💡 Tip: To temporarily preview what the script would apply without making changes on GitHub, you can run with all `--skip-*-api` flags, then `git add -A; git reset --hard HEAD` to completely reset all changes.
122122
123123
### Skipping Local Changes
124124

script/create-test-e2e.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ await $`rm -rf ${repository}`;
1212

1313
await $({
1414
stdio: "inherit",
15-
})`c8 -o ./coverage-create -r html -r lcov --src src node ./bin/index.js --base everything --mode create --author ${author} --email ${email} --description ${description} --owner ${owner} --title ${title} --repository ${repository} --exclude-contributors --skip-github-api`;
15+
})`c8 -o ./coverage-create -r html -r lcov --src src node ./bin/index.js --base everything --mode create --author ${author} --email ${email} --description ${description} --owner ${owner} --title ${title} --repository ${repository} --skip-all-contributors-api --skip-github-api`;
1616

1717
process.chdir(repository);
1818

script/initialize-test-e2e.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ const repository = "new-repository-test";
1111
// First we run initialize to modifies the local repo, so we can test the changes
1212
await $({
1313
stdio: "inherit",
14-
})`node ./bin/index.js --description ${description} --base everything --mode initialize --owner ${owner} --title ${title} --repository ${repository} --skip-github-api --skip-restore`;
14+
})`node ./bin/index.js --description ${description} --base everything --mode initialize --owner ${owner} --title ${title} --repository ${repository} --skip-all-contributors-api --skip-github-api --skip-restore`;
1515

1616
const newPackageJson = JSON.parse(
1717
(await fs.readFile("./package.json")).toString(),
@@ -49,4 +49,4 @@ await $`pnpm i`;
4949
await $`pnpm run build`;
5050
await $({
5151
stdio: "inherit",
52-
})`c8 -o ./coverage-initialize -r html -r lcov --src src node ./bin/index.js --base everything --description ${description} --mode initialize --owner ${owner} --title ${title} --repository ${repository} --exclude-contributors --skip-github-api --skip-removal --skip-restore`;
52+
})`c8 -o ./coverage-initialize -r html -r lcov --src src node ./bin/index.js --base everything --description ${description} --mode initialize --owner ${owner} --title ${title} --repository ${repository} --skip-all-contributors-api --skip-github-api --skip-removal --skip-restore`;

script/migrate-test-e2e.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ const title = "Create TypeScript App";
1111

1212
await $({
1313
stdio: "inherit",
14-
})`c8 -o ./coverage-migrate -r html -r lcov --src src node ./bin/index.js --base everything --mode migrate --description ${description} --email-github ${emailGithub} --email-npm ${emailNpm} --owner ${owner} --title ${title} --repository ${repository} --exclude-contributors --skip-github-api --skip-install`;
14+
})`c8 -o ./coverage-migrate -r html -r lcov --src src node ./bin/index.js --base everything --mode migrate --description ${description} --email-github ${emailGithub} --email-npm ${emailNpm} --owner ${owner} --title ${title} --repository ${repository} --skip-all-contributors-api --skip-github-api --skip-install`;
1515

1616
const { stdout: gitStatus } = await $`git status`;
1717
console.log(`Stdout from running \`git status\`:\n${gitStatus}`);

src/create/createRerunSuggestion.test.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -13,8 +13,8 @@ const options = {
1313
github: "[email protected]",
1414
1515
},
16+
excludeAllContributors: true,
1617
excludeCompliance: true,
17-
excludeContributors: true,
1818
excludeLintJSDoc: true,
1919
excludeLintJson: true,
2020
excludeLintKnip: true,
@@ -45,7 +45,7 @@ describe("createRerunSuggestion", () => {
4545
const actual = createRerunSuggestion(options);
4646

4747
expect(actual).toMatchInlineSnapshot(
48-
'"npx create-typescript-app --mode create --base everything --access public --author TestAuthor --create-repository true --description \\"Test description.\\" --email-github [email protected] --email-npm [email protected] --exclude-compliance true --exclude-contributors true --exclude-lint-jsdoc true --exclude-lint-json true --exclude-lint-knip true --exclude-lint-package-json true --exclude-lint-perfectionist true --mode create --owner TestOwner --repository test-repository --skip-github-api true --skip-install true --skip-removal true --title \\"Test Title\\""',
48+
'"npx create-typescript-app --mode create --base everything --access public --author TestAuthor --create-repository true --description \\"Test description.\\" --email-github [email protected] --email-npm [email protected] --exclude-all-contributors true --exclude-compliance true --exclude-lint-jsdoc true --exclude-lint-json true --exclude-lint-knip true --exclude-lint-package-json true --exclude-lint-perfectionist true --mode create --owner TestOwner --repository test-repository --skip-github-api true --skip-install true --skip-removal true --title \\"Test Title\\""',
4949
);
5050
});
5151

@@ -60,7 +60,7 @@ describe("createRerunSuggestion", () => {
6060
});
6161

6262
expect(actual).toMatchInlineSnapshot(
63-
'"npx create-typescript-app --mode initialize --base everything --access public --author TestAuthor --create-repository true --description \\"Test description.\\" --email-github [email protected] --email-npm [email protected] --exclude-compliance true --exclude-contributors true --exclude-lint-jsdoc true --exclude-lint-json true --exclude-lint-knip true --exclude-lint-package-json true --exclude-lint-perfectionist true --logo test/src.png --logo-alt \\"Test alt.\\" --mode initialize --owner TestOwner --repository test-repository --skip-github-api true --skip-install true --skip-removal true --title \\"Test Title\\""',
63+
'"npx create-typescript-app --mode initialize --base everything --access public --author TestAuthor --create-repository true --description \\"Test description.\\" --email-github [email protected] --email-npm [email protected] --exclude-all-contributors true --exclude-compliance true --exclude-lint-jsdoc true --exclude-lint-json true --exclude-lint-knip true --exclude-lint-package-json true --exclude-lint-perfectionist true --logo test/src.png --logo-alt \\"Test alt.\\" --mode initialize --owner TestOwner --repository test-repository --skip-github-api true --skip-install true --skip-removal true --title \\"Test Title\\""',
6464
);
6565
});
6666

@@ -74,7 +74,7 @@ describe("createRerunSuggestion", () => {
7474
});
7575

7676
expect(actual).toMatchInlineSnapshot(
77-
'"npx create-typescript-app --mode initialize --base everything --access public --author TestAuthor --create-repository true --description \\"Test description.\\" --email-github [email protected] --email-npm [email protected] --exclude-compliance true --exclude-contributors true --exclude-lint-jsdoc true --exclude-lint-json true --exclude-lint-knip true --exclude-lint-md true --exclude-lint-package-json true --exclude-lint-perfectionist true --exclude-lint-spelling true --mode initialize --owner TestOwner --repository test-repository --skip-github-api true --skip-install true --skip-removal true --title \\"Test Title\\""',
77+
'"npx create-typescript-app --mode initialize --base everything --access public --author TestAuthor --create-repository true --description \\"Test description.\\" --email-github [email protected] --email-npm [email protected] --exclude-all-contributors true --exclude-compliance true --exclude-lint-jsdoc true --exclude-lint-json true --exclude-lint-knip true --exclude-lint-md true --exclude-lint-package-json true --exclude-lint-perfectionist true --exclude-lint-spelling true --mode initialize --owner TestOwner --repository test-repository --skip-github-api true --skip-install true --skip-removal true --title \\"Test Title\\""',
7878
);
7979
});
8080
});

src/create/createWithOptions.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ export async function createWithOptions({ github, options }: GitHubAndOptions) {
2727
],
2828
]);
2929

30-
if (!options.excludeContributors) {
30+
if (!options.excludeAllContributors && !options.skipAllContributorsApi) {
3131
await withSpinner("Adding contributors to table", async () => {
3232
await addToolAllContributors(options.owner);
3333
});

0 commit comments

Comments
 (0)