Skip to content

Commit b7db35d

Browse files
docs: also mention --add-* CLI flags (#2051)
## PR Checklist - [x] Addresses an existing open issue: fixes #2049 - [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 Throws in a nice little example for good measure. 🎁
1 parent f551102 commit b7db35d

File tree

2 files changed

+61
-51
lines changed

2 files changed

+61
-51
lines changed

docs/Blocks.md

Lines changed: 53 additions & 47 deletions
Original file line numberDiff line numberDiff line change
@@ -5,53 +5,59 @@ Each can be individually turned off or on.
55

66
This table summarizes each block and which base levels they're included in:
77

8-
| Block | Exclusion Flag | Minimal | Common | Everything |
9-
| ---------------------------- | ---------------------------------------- | ------- | ------ | ---------- |
10-
| AllContributors | `--exclude-allcontributors` | || 💯 |
11-
| Are The Types Wrong | `--exclude-are-the-types-wrong` | | | |
12-
| Contributing Docs | `--exclude-contributing-docs` | ✔️ || 💯 |
13-
| Contributor Covenant | `--exclude-contributor-covenant` | ✔️ || 💯 |
14-
| CSpell | `--exclude-cspell` | | | 💯 |
15-
| Codecov | `--exclude-codecov` | || 💯 |
16-
| Development Docs | `--exclude-development-docs` | ✔️ || 💯 |
17-
| ESLint | `--exclude-eslint` | ✔️ || 💯 |
18-
| ESLint Comments Plugin | `--exclude-eslint-comments-plugin` | | | 💯 |
19-
| ESLint JSDoc Plugin | `--exclude-eslint-jsdoc-plugin` | | | 💯 |
20-
| ESLint JSONC Plugin | `--exclude-eslint-jsonc-plugin` | | | 💯 |
21-
| ESLint Markdown Plugin | `--exclude-eslint-markdown-plugin` | | | 💯 |
22-
| ESLint More Styling | `--exclude-eslint-more-styling` | | | 💯 |
23-
| ESLint Node Plugin | `--exclude-eslint-node-plugin` | | | 💯 |
24-
| ESLint package.json Plugin | `--exclude-eslint-package-json-plugin` | | | 💯 |
25-
| ESLint Perfectionist Plugin | `--exclude-eslint-perfectionist-plugin` | | | 💯 |
26-
| ESLint Regexp Plugin | `--exclude-eslint-regexp-plugin` | | | 💯 |
27-
| ESLint YML Plugin | `--exclude-eslint-yml-plugin` | | | 💯 |
28-
| Funding | `--exclude-funding` | || 💯 |
29-
| GitHub Actions CI | `--exclude-github-actions-ci` | ✔️ || 💯 |
30-
| GitHub Issue Templates | `--exclude-github-issue-templates` | ✔️ || 💯 |
31-
| GitHub PR Template | `--exclude-github-pr-template` | ✔️ || 💯 |
32-
| Gitignore | `--exclude-gitignore` | ✔️ || 💯 |
33-
| Knip | `--exclude-knip` | | | 💯 |
34-
| Main | `--exclude-main` | ✔️ || 💯 |
35-
| Markdownlint | `--exclude-markdownlint` | | | 💯 |
36-
| MIT License | `--exclude-mit-license` | ✔️ || 💯 |
37-
| ncc | `--exclude-ncc` | | | |
38-
| nvmrc | `--exclude-nvmrc` | | | 💯 |
39-
| Package JSON | `--exclude-package-json` | ✔️ || 💯 |
40-
| pnpm Dedupe | `--exclude-pnpm-dedupe` | | | 💯 |
41-
| PR Compliance | `--exclude-pr-compliance` | | | 💯 |
42-
| Prettier | `--exclude-prettier` | ✔️ || 💯 |
43-
| Prettier Plugin Curly | `--exclude-prettier-plugin-curly` | | | 💯 |
44-
| Prettier Plugin Package JSON | `--exclude-prettier-plugin-package-json` | | | 💯 |
45-
| Prettier Plugin Sh | `--exclude-prettier-plugin-sh` | | | 💯 |
46-
| README.md | `--exclude-readme-md` | ✔️ || 💯 |
47-
| release-it | `--exclude-release-it` | || 💯 |
48-
| Renovate | `--exclude-renovate` | | | 💯 |
49-
| Security Docs | `--exclude-security-docs` | ✔️ || 💯 |
50-
| Templated With | `--exclude-templated-with` | ✔️ || 💯 |
51-
| TSup | `--exclude-tsup` | ✔️ || 💯 |
52-
| TypeScript | `--exclude-typescript` | ✔️ || 💯 |
53-
| Vitest | `--exclude-vitest` | || 💯 |
54-
| VS Code | `--exclude-vs-code` | | | 💯 |
8+
| Block | Flags | Minimal | Common | Everything |
9+
| ---------------------------- | ------------------------------------------------------------------------------ | ------- | ------ | ---------- |
10+
| AllContributors | `--add-allcontributors`, `--exclude-allcontributors` | || 💯 |
11+
| Are The Types Wrong | `--add-are-the-types-wrong`, `--exclude-are-the-types-wrong` | | | |
12+
| Contributing Docs | `--add-contributing-docs`, `--exclude-contributing-docs` | ✔️ || 💯 |
13+
| Contributor Covenant | `--add-contributor-covenant`, `--exclude-contributor-covenant` | ✔️ || 💯 |
14+
| CSpell | `--add-cspell`, `--exclude-cspell` | | | 💯 |
15+
| Codecov | `--add-codecov`, `--exclude-codecov` | || 💯 |
16+
| Development Docs | `--add-development-docs`, `--exclude-development-docs` | ✔️ || 💯 |
17+
| ESLint | `--add-eslint`, `--exclude-eslint` | ✔️ || 💯 |
18+
| ESLint Comments Plugin | `--add-eslint-comments-plugin`, `--exclude-eslint-comments-plugin` | | | 💯 |
19+
| ESLint JSDoc Plugin | `--add-eslint-jsdoc-plugin`, `--exclude-eslint-jsdoc-plugin` | | | 💯 |
20+
| ESLint JSONC Plugin | `--add-eslint-jsonc-plugin`, `--exclude-eslint-jsonc-plugin` | | | 💯 |
21+
| ESLint Markdown Plugin | `--add-eslint-markdown-plugin`, `--exclude-eslint-markdown-plugin` | | | 💯 |
22+
| ESLint More Styling | `--add-eslint-more-styling`, `--exclude-eslint-more-styling` | | | 💯 |
23+
| ESLint Node Plugin | `--add-eslint-node-plugin`, `--exclude-eslint-node-plugin` | | | 💯 |
24+
| ESLint package.json Plugin | `--add-eslint-package-json-plugin`, `--exclude-eslint-package-json-plugin` | | | 💯 |
25+
| ESLint Perfectionist Plugin | `--add-eslint-perfectionist-plugin`, `--exclude-eslint-perfectionist-plugin` | | | 💯 |
26+
| ESLint Regexp Plugin | `--add-eslint-regexp-plugin`, `--exclude-eslint-regexp-plugin` | | | 💯 |
27+
| ESLint YML Plugin | `--add-eslint-yml-plugin`, `--exclude-eslint-yml-plugin` | | | 💯 |
28+
| Funding | `--add-funding`, `--exclude-funding` | || 💯 |
29+
| GitHub Actions CI | `--add-github-actions-ci`, `--exclude-github-actions-ci` | ✔️ || 💯 |
30+
| GitHub Issue Templates | `--add-github-issue-templates`, `--exclude-github-issue-templates` | ✔️ || 💯 |
31+
| GitHub PR Template | `--add-github-pr-template`, `--exclude-github-pr-template` | ✔️ || 💯 |
32+
| Gitignore | `--add-gitignore`, `--exclude-gitignore` | ✔️ || 💯 |
33+
| Knip | `--add-knip`, `--exclude-knip` | | | 💯 |
34+
| Main | `--add-main`, `--exclude-main` | ✔️ || 💯 |
35+
| Markdownlint | `--add-markdownlint`, `--exclude-markdownlint` | | | 💯 |
36+
| MIT License | `--add-mit-license`, `--exclude-mit-license` | ✔️ || 💯 |
37+
| ncc | `--add-ncc`, `--exclude-ncc` | | | |
38+
| nvmrc | `--add-nvmrc`, `--exclude-nvmrc` | | | 💯 |
39+
| Package JSON | `--add-package-json`, `--exclude-package-json` | ✔️ || 💯 |
40+
| pnpm Dedupe | `--add-pnpm-dedupe`, `--exclude-pnpm-dedupe` | | | 💯 |
41+
| PR Compliance | `--add-pr-compliance`, `--exclude-pr-compliance` | | | 💯 |
42+
| Prettier | `--add-prettier`, `--exclude-prettier` | ✔️ || 💯 |
43+
| Prettier Plugin Curly | `--add-prettier-plugin-curly`, `--exclude-prettier-plugin-curly` | | | 💯 |
44+
| Prettier Plugin Package JSON | `--add-prettier-plugin-package-json`, `--exclude-prettier-plugin-package-json` | | | 💯 |
45+
| Prettier Plugin Sh | `--add-prettier-plugin-sh`, `--exclude-prettier-plugin-sh` | | | 💯 |
46+
| README.md | `--add-readme-md`, `--exclude-readme-md` | ✔️ || 💯 |
47+
| release-it | `--add-release-it`, `--exclude-release-it` | || 💯 |
48+
| Renovate | `--add-renovate`, `--exclude-renovate` | | | 💯 |
49+
| Security Docs | `--add-security-docs`, `--exclude-security-docs` | ✔️ || 💯 |
50+
| Templated With | `--add-templated-with`, `--exclude-templated-with` | ✔️ || 💯 |
51+
| TSup | `--add-tsup`, `--exclude-tsup` | ✔️ || 💯 |
52+
| TypeScript | `--add-typescript`, `--exclude-typescript` | ✔️ || 💯 |
53+
| Vitest | `--add-vitest`, `--exclude-vitest` | || 💯 |
54+
| VS Code | `--add-vs-code`, `--exclude-vs-code` | | | 💯 |
55+
56+
For example, this uses ncc instead of the default tsup builder:
57+
58+
```shell
59+
npx create-typescript-app --add-ncc --exclude-tsup
60+
```
5561

5662
See also [CLI](./CLI.md) for customizing templated repositories when running `npx create-typescript-app`.
5763

src/docsBlocks.test.ts

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ const expectedLines = await createExpectedLines();
1818
// you'll need to add a row like:
1919
//
2020
// ```md
21-
// | Example | `--exclude-example` | | ✅ | 💯 |
21+
// | Example | `--add-example`, `--exclude-example` | | ✅ | 💯 |
2222
// ```
2323
//
2424
// Rows are kept sorted by alphabetical order of name.
@@ -51,8 +51,8 @@ async function createActualLines() {
5151

5252
async function createExpectedLines() {
5353
const lines = [
54-
"| Block | Exclusion Flag | Minimal | Common | Everything |",
55-
"| ----- | -------------- | ------- | ------ | ---------- |",
54+
"| Block | Flags | Minimal | Common | Everything |",
55+
"| ----- | ----- | ------- | ------ | ---------- |",
5656
];
5757

5858
for (const block of Object.values(blocks) as Block[]) {
@@ -62,7 +62,7 @@ async function createExpectedLines() {
6262
lines.push(
6363
[
6464
name,
65-
`\`--exclude-${name.replaceAll(/\W+/g, "-").toLowerCase()}\``,
65+
`${createFlag("add", name)}, ${createFlag("exclude", name)}`,
6666
presets.minimal.blocks.includes(block) ? "✔️" : " ",
6767
presets.common.blocks.includes(block) ? "✅" : " ",
6868
presets.everything.blocks.includes(block) ? "💯" : " ",
@@ -79,6 +79,10 @@ async function createExpectedLines() {
7979
return splitTable(expectedTable);
8080
}
8181

82+
function createFlag(prefix: string, name: string) {
83+
return `\`--${prefix}-${name.replaceAll(/\W+/g, "-").toLowerCase()}\``;
84+
}
85+
8286
function splitTable(table: string) {
8387
return table
8488
.split("\n")

0 commit comments

Comments
 (0)