Skip to content

full pnpx #1976

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Draft
wants to merge 2 commits into
base: main
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .husky/pre-commit
Original file line number Diff line number Diff line change
@@ -1 +1 @@
npx lint-staged
pnpx lint-staged
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ First make sure you have the following installed:
Then in an existing repository or in your directory where you'd like to make a new repository:

```shell
npx create-typescript-app
pnpx create-typescript-app
```

You can read more about the supported runtime modes in their docs pages:
Expand All @@ -51,7 +51,7 @@ You can read more about `create-typescript-app` and the tooling it supports:
2. [**Options**](./docs/Options.md): granular options to customize how the template is run.
3. [**FAQs**](./docs/FAQs.md): frequently asked questions

> [!NOTE]
> [!NOTE]
> This template is early stage, opinionated, and not endorsed by the TypeScript team.
> It can be configured to set up a _lot_ of tooling out of the box.
> If you don't want to use any particular tool, you can always remove it manually.
Expand Down
2 changes: 1 addition & 1 deletion docs/FAQs.md
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@ Here we'll outline the steps required to migrate a CTA app to a GitHub Action:
```diff
+pnpm run build
+git add dist
npx lint-staged
pnpx lint-staged
```

2. Create an [`action.yml` metadata file](https://docs.github.com/en/actions/creating-actions/creating-a-javascript-action#creating-an-action-metadata-file).
Expand Down
10 changes: 5 additions & 5 deletions docs/Options.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
`create-typescript-app` is built on top of [Bingo](https://create.bingo).
It supports all the flags supported by [Bingo CLIs](https://www.create.bingo/cli).

`npx create-typescript-app` provides three `--preset` options:
`pnpx create-typescript-app` provides three `--preset` options:

1. **Minimal**: Just bare starter tooling: building, formatting, linting, and type checking.
2. **Common**: Bare starters plus testing and automation for all-contributors and releases.
Expand All @@ -12,7 +12,7 @@ It supports all the flags supported by [Bingo CLIs](https://www.create.bingo/cli
For example, to create a new repository with the _Everything_ preset:

```shell
npx create-typescript-app --preset everything
pnpx create-typescript-app --preset everything
```

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

```shell
npx create-typescript-app --directory my-typescript-app --description "My awesome TypeScript app! 💖" --preset everything
pnpx create-typescript-app --directory my-typescript-app --description "My awesome TypeScript app! 💖" --preset everything
```

That script will run completely autonomously, no prompted inputs required. ✨
Expand All @@ -58,7 +58,7 @@ They will be inferred from the running user, and if migrating an existing reposi
For example, customizing the npm author and funding source:

```shell
npx create-typescript-app --author my-npm-username --funding MyGitHubOrganization
pnpx create-typescript-app --author my-npm-username --funding MyGitHubOrganization
```

## Block Exclusions
Expand All @@ -67,7 +67,7 @@ Per [Bingo > Stratum > Configurations > `blocks`](https://www.create.bingo/engin
For example, initializing with all tooling except for Renovate:

```shell
npx create-typescript-app --exclude-renovate
pnpx create-typescript-app --exclude-renovate
```

See [Blocks.md](./Blocks.md) for the list of blocks and their corresponding presets.
6 changes: 3 additions & 3 deletions docs/Setup.md
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
# Setup Mode

You can run `npx create-typescript-app` in your terminal to interactively create a new repository:
You can run `pnpx create-typescript-app` in your terminal to interactively create a new repository:

```shell
npx create-typescript-app
pnpx create-typescript-app
```

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

```shell
npx create-typescript-app --mode create --exclude-templated-with
pnpx create-typescript-app --mode create --exclude-templated-with
```

See [Blocks.md](./Blocks.md) for details on the tooling pieces and which presets they're included in.
6 changes: 3 additions & 3 deletions docs/Transition.md
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
# Transition Mode

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

```shell
npx create-typescript-app
pnpx create-typescript-app
```

The transition script will:
Expand Down Expand Up @@ -46,7 +46,7 @@ See [Options.md](./Options.md).
For example, skipping the _"This package was templated with..."_ block:

```shell
npx create-typescript-app --exclude-templated-with
pnpx create-typescript-app --exclude-templated-with
```

See [Blocks.md](./Blocks.md) for details on the tooling pieces and which presets they're included in.
6 changes: 3 additions & 3 deletions docs/UseThisTemplate.md
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
# Using the Template Repository

As an alternative to [creating with `npx create-typescript-app`](./Setup.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.
As an alternative to [creating with `pnpx create-typescript-app`](./Setup.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.
You can set up the new repository locally by cloning it and installing packages:

```shell
git clone https://github.com/YourUsername/YourRepositoryName
cd YourRepositoryName
npx create-typescript-app
pnpx create-typescript-app
```

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

```shell
npx create-typescript-app --exclude-templated-with
pnpx create-typescript-app --exclude-templated-with
```

See [Blocks.md](./Blocks.md) for details on the tooling pieces and which presets they're included in.
2 changes: 1 addition & 1 deletion src/blocks/blockAreTheTypesWrong.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ describe("blockAreTheTypesWrong", () => {
"run": "pnpm build",
},
{
"run": "npx --yes @arethetypeswrong/cli --pack . --ignore-rules cjs-resolves-to-esm",
"run": "pnpx --yes @arethetypeswrong/cli --pack . --ignore-rules cjs-resolves-to-esm",
},
],
},
Expand Down
2 changes: 1 addition & 1 deletion src/blocks/blockAreTheTypesWrong.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ export const blockAreTheTypesWrong = base.createBlock({
steps: [
{ run: "pnpm build" },
{
run: "npx --yes @arethetypeswrong/cli --pack . --ignore-rules cjs-resolves-to-esm",
run: "pnpx --yes @arethetypeswrong/cli --pack . --ignore-rules cjs-resolves-to-esm",
},
],
},
Expand Down
6 changes: 3 additions & 3 deletions src/blocks/blockPrettier.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@ describe("blockPrettier", () => {
".gitignore": "_
",
"pre-commit": [
"npx lint-staged
"pnpx lint-staged
",
{
"executable": true,
Expand Down Expand Up @@ -203,7 +203,7 @@ describe("blockPrettier", () => {
".gitignore": "_
",
"pre-commit": [
"npx lint-staged
"pnpx lint-staged
",
{
"executable": true,
Expand Down Expand Up @@ -333,7 +333,7 @@ describe("blockPrettier", () => {
".gitignore": "_
",
"pre-commit": [
"npx lint-staged
"pnpx lint-staged
",
{
"executable": true,
Expand Down
2 changes: 1 addition & 1 deletion src/blocks/blockPrettier.ts
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ pnpm format --write
files: {
".husky": {
".gitignore": "_\n",
"pre-commit": ["npx lint-staged\n", { executable: true }],
"pre-commit": ["pnpx lint-staged\n", { executable: true }],
},
".prettierignore": formatIgnoreFile(
["/.husky", "/lib", "/pnpm-lock.yaml", ...ignores].sort(),
Expand Down