Skip to content

Commit 64e33ca

Browse files
feat: switch bin to Bingo's runTemplateCLI (#1943)
## PR Checklist - [x] Addresses an existing open issue: fixes #1941 - [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 Corresponding PR to JoshuaKGoldberg/bingo#214. 🎁
1 parent 61909be commit 64e33ca

11 files changed

+120
-198
lines changed

README.md

+1-3
Original file line numberDiff line numberDiff line change
@@ -38,11 +38,9 @@ First make sure you have the following installed:
3838
Then in an existing repository or in your directory where you'd like to make a new repository:
3939

4040
```shell
41-
npx bingo typescript-app@beta
41+
npx create-typescript-app@beta
4242
```
4343

44-
That will launch `create-typescript-app` using the [`bingo` runner](https://create.bingo).
45-
4644
You can read more about the supported setup modes in their docs pages:
4745

4846
- [**Creating from the terminal**](./docs/Creation.md): creating a new repository locally on the command-line _(recommended)_

bin/index.js

+3-13
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,6 @@
11
#!/usr/bin/env node
2-
import chalk from "chalk";
2+
import { runTemplateCLI } from "bingo";
33

4-
console.log(
5-
[
6-
"create-typescript-app is now run using ",
7-
chalk.bold("bingo"),
8-
".\n\nRun:\n ",
9-
chalk.bold("npx bingo", process.argv.slice(2).join(" ")),
10-
"\n\nYou can read more on:\n https://",
11-
chalk.bold("create.bingo"),
12-
"\n\nThanks for using create-typescript-app! 🎁",
13-
].join(""),
14-
);
4+
import { template } from "../lib/index.js";
155

16-
process.exitCode = 1;
6+
process.exitCode = await runTemplateCLI(template);

docs/Creation.md

+3-3
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
# Creating from the Terminal
22

3-
You can run `npx bingo typescript-app@beta` in your terminal to interactively create a new repository:
3+
You can run `npx create-typescript-app@beta` in your terminal to interactively create a new repository:
44

55
```shell
6-
npx bingo typescript-app@beta
6+
npx create-typescript-app@beta
77
```
88

99
The creation script will by default:
@@ -34,7 +34,7 @@ See [Options.md](./Options.md).
3434
For example, skipping the _"This package was templated with..."_ block:
3535

3636
```shell
37-
npx bingo typescript-app@beta --mode create --exclude-templated-with
37+
npx create-typescript-app@beta --mode create --exclude-templated-with
3838
```
3939

4040
See [Blocks.md](./Blocks.md) for details on the tooling pieces and which presets they're included in.

docs/FAQs.md

-12
Original file line numberDiff line numberDiff line change
@@ -173,18 +173,6 @@ Each of the included tools exists for a good reason and provides real value.
173173

174174
If you don't want to use any particular tool, you can always remove it manually.
175175

176-
### What tooling does this package use that isn't part of created repositories?
177-
178-
Glad you asked!
179-
These are the projects used across many parts of `create-typescript-app`:
180-
181-
- [Chalk](https://github.com/chalk/chalk): Makes it easier to print colored characters in the terminal.
182-
- [Clack](https://www.clack.cc): Provides interactive terminal prompts and loading spinners.
183-
- [execa](https://github.com/sindresorhus/execa): Makes it easier to run child processes.
184-
- [Octokit](https://github.com/octokit/octokit.js#octokitjs):
185-
- [tsx](https://github.com/esbuild-kit/tsx): Quickly runs TypeScript files with ESBuild.
186-
- [Zod](https://zod.dev): TypeScript-first schema validation with static type inference.
187-
188176
## Why tabs?
189177

190178
This repository template configures `"useTabs": true` in the root-level `.prettierrc.json`.

docs/Initialization.md

+3-3
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
11
# Initializing from the Template
22

3-
As an alternative to [creating with `npx bingo typescript-app@beta`](./Creation.md), the [_Use this template_](https://github.com/JoshuaKGoldberg/create-typescript-app/generate) button on GitHub can be used to quickly create a new repository from the template.
3+
As an alternative to [creating with `npx create-typescript-app@beta`](./Creation.md), the [_Use this template_](https://github.com/JoshuaKGoldberg/create-typescript-app/generate) button on GitHub can be used to quickly create a new repository from the template.
44
You can set up the new repository locally by cloning it and installing packages:
55

66
```shell
77
git clone https://github.com/YourUsername/YourRepositoryName
88
cd YourRepositoryName
9-
npx bingo typescript-app@beta
9+
npx create-typescript-app@beta
1010
```
1111

1212
You'll then need to manually go through the following two steps to set up tooling on GitHub:
@@ -29,7 +29,7 @@ See [Options.md](./Options.md).
2929
For example, skipping the _"This package was templated with..."_ block:
3030

3131
```shell
32-
npx bingo typescript-app@beta --exclude-templated-with
32+
npx create-typescript-app@beta --exclude-templated-with
3333
```
3434

3535
See [Blocks.md](./Blocks.md) for details on the tooling pieces and which presets they're included in.

docs/Migration.md

+3-3
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
# Migrating an Existing Repository
22

3-
If you have an existing repository that you'd like to give the files from this repository, you can run `npx bingo typescript-app@beta` in it to "migrate" its tooling to this template's.
3+
If you have an existing repository that you'd like to give the files from this repository, you can run `npx create-typescript-app@beta` in it to "migrate" its tooling to this template's.
44

55
```shell
6-
npx bingo typescript-app@beta
6+
npx create-typescript-app@beta
77
```
88

99
The migration script will:
@@ -46,7 +46,7 @@ See [Options.md](./Options.md).
4646
For example, skipping the _"This package was templated with..."_ block:
4747

4848
```shell
49-
npx bingo typescript-app@beta --exclude-templated-with
49+
npx create-typescript-app@beta --exclude-templated-with
5050
```
5151

5252
See [Blocks.md](./Blocks.md) for details on the tooling pieces and which presets they're included in.

docs/Options.md

+11-7
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,18 @@
11
# Options
22

33
`create-typescript-app` is built on top of [Bingo](https://create.bingo).
4-
`npx bingo typescript-app@beta` supports all the flags defined by the [`bingo` CLI](https://www.create.bingo/cli).
5-
It provides three Presets:
4+
It supports all the flags supported by [Bingo CLIs](https://www.create.bingo/cli).
5+
6+
`npx create-typescript-app@beta` provides three `--preset` options:
67

78
1. **Minimal**: Just bare starter tooling: building, formatting, linting, and type checking.
89
2. **Common**: Bare starters plus testing and automation for all-contributors and releases.
910
3. **Everything**: The most comprehensive tooling imaginable: sorting, spellchecking, and more!
1011

11-
For example, to create a new repository on the _everything_ preset:
12+
For example, to create a new repository with the _Everything_ preset:
1213

1314
```shell
14-
npx bingo typescript-app@beta --preset everything
15+
npx create-typescript-app@beta --preset everything
1516
```
1617

1718
`create-typescript-app` itself adds in two sections of flags:
@@ -34,7 +35,7 @@ Each will be prompted for when creating a new repository if not explicitly provi
3435
For example, pre-populating both required base options:
3536

3637
```shell
37-
npx bingo typescript-app@beta --description "My awesome TypeScript app! 💖" --title "My TypeScript App"
38+
npx create-typescript-app@beta --description "My awesome TypeScript app! 💖" --title "My TypeScript App"
3839
```
3940

4041
That script will run completely autonomously, no prompted inputs required. ✨
@@ -56,16 +57,19 @@ They will be inferred from the running user, and if migrating an existing reposi
5657
For example, customizing the npm author and funding source:
5758

5859
```shell
59-
npx bingo typescript-app@beta --author my-npm-username --funding MyGitHubOrganization
60+
npx create-typescript-app@beta --author my-npm-username --funding MyGitHubOrganization
6061
```
6162

6263
## Block Exclusions
6364

65+
> TODO: This is not implemented yet!
66+
> <https://github.com/JoshuaKGoldberg/bingo/issues/215>
67+
6468
Per [Bingo > Stratum > Configurations > `blocks`](https://www.create.bingo/engines/stratum/details/configurations#blocks), individual Blocks may be excluded from running.
6569
For example, initializing with all tooling except for Renovate:
6670

6771
```shell
68-
npx bingo typescript-app@beta --exclude-renovate
72+
npx create-typescript-app@beta --exclude-renovate
6973
```
7074

7175
See [Blocks.md](./Blocks.md) for the list of blocks and their corresponding presets.

package.json

+8-9
Original file line numberDiff line numberDiff line change
@@ -37,19 +37,18 @@
3737
"*": "prettier --ignore-unknown --write"
3838
},
3939
"dependencies": {
40-
"bingo": "^0.4.1",
41-
"bingo-fs": "^0.4.1",
42-
"bingo-stratum": "^0.4.1",
43-
"chalk": "^5.4.1",
40+
"bingo": "^0.5.0",
41+
"bingo-fs": "^0.5.0",
42+
"bingo-stratum": "^0.5.0",
4443
"cspell-populate-words": "^0.3.0",
4544
"execa": "^9.5.2",
4645
"git-remote-origin-url": "^4.0.0",
4746
"git-url-parse": "^16.0.1",
4847
"html-to-text": "^9.0.5",
4948
"image-size": "^1.2.0",
50-
"input-from-file": "^0.4.1",
51-
"input-from-file-json": "^0.4.1",
52-
"input-from-script": "^0.4.1",
49+
"input-from-file": "^0.5.0",
50+
"input-from-file-json": "^0.5.0",
51+
"input-from-script": "^0.5.0",
5352
"js-yaml": "^4.1.0",
5453
"lazy-value": "^3.0.0",
5554
"lodash": "^4.17.21",
@@ -79,8 +78,8 @@
7978
"@vitest/coverage-v8": "3.0.6",
8079
"@vitest/eslint-plugin": "1.1.31",
8180
"all-contributors-cli": "6.26.1",
82-
"bingo-stratum-testers": "0.4.1",
83-
"bingo-testers": "0.4.1",
81+
"bingo-stratum-testers": "0.5.0",
82+
"bingo-testers": "0.5.0",
8483
"console-fail-test": "0.5.0",
8584
"cspell": "8.17.3",
8685
"eslint": "9.20.1",

0 commit comments

Comments
 (0)