Skip to content

Commit

Permalink
build: renamed *:test to test:* in every file (#811)
Browse files Browse the repository at this point in the history
<!-- 👋 Hi, thanks for sending a PR to create-typescript-app! 💖.
Please fill out all fields below and make sure each item is true and [x]
checked.
Otherwise we may not be able to review your PR. -->

## PR Checklist

- [x] Addresses an existing open issue: fixes #786
- [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
Also fixed a typo "initiamigratelize" in
.github/workflows/DEVELOPMENT.md.
<!-- Description of what is changed and how the code change does that.
-->

---------

Co-authored-by: Josh Goldberg <[email protected]>
  • Loading branch information
DanexQ and JoshuaKGoldberg authored Sep 7, 2023
1 parent c348a61 commit 486f89d
Show file tree
Hide file tree
Showing 7 changed files with 23 additions and 23 deletions.
10 changes: 5 additions & 5 deletions .github/DEVELOPMENT.md
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,7 @@ You can run the end-to-end test for creation locally on the command-line.
Note that the files need to be built with `pnpm run build` beforehand.

```shell
pnpm run create:test
pnpm run test:create
```

That end-to-end test executes `script/create-test-e2e.js`, which:
Expand All @@ -142,7 +142,7 @@ You can run the end-to-end test for initializing locally on the command-line.
Note that files need to be built with `pnpm run build` beforehand.

```shell
pnpm run initialize:test
pnpm run test:initialize
```

That end-to-end test executes `script/initialize-test-e2e.js`, which:
Expand All @@ -153,7 +153,7 @@ That end-to-end test executes `script/initialize-test-e2e.js`, which:
4. Resets everything
5. Runs initialization a second time, capturing test coverage

The `pnpm run initialize:test` script is run in CI to ensure that templating changes are in sync with the template's actual files.
The `pnpm run test:initialize` script is run in CI to ensure that templating changes are in sync with the template's actual files.
See `.github/workflows/test-initialize.yml`.

### The Migration Script
Expand Down Expand Up @@ -183,7 +183,7 @@ node ../create-typescript-app/bin/migrate.js
You can run the end-to-end test for migrating locally on the command-line:

```shell
pnpm run initiamigratelize:test
pnpm run test:migrate
```

That end-to-end test executes `script/migrate-test-e2e.js`, which:
Expand All @@ -192,5 +192,5 @@ That end-to-end test executes `script/migrate-test-e2e.js`, which:
2. Checks that only a small list of allowed files were changed
3. Checks that the local repository's files were changed correctly (e.g. removed initialization-only files)

The `pnpm run migrate:test` script is run in CI to ensure that templating changes are in sync with the template's actual files.
The `pnpm run test:migrate` script is run in CI to ensure that templating changes are in sync with the template's actual files.
See `.github/workflows/test-migrate.yml`.
2 changes: 1 addition & 1 deletion .github/workflows/test-create.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ jobs:
- uses: actions/checkout@v4
- uses: ./.github/actions/prepare
- run: pnpm run build
- run: pnpm run create:test
- run: pnpm run test:create
- if: always()
name: Codecov
uses: codecov/codecov-action@v3
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/test-initialize.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ jobs:
- uses: actions/checkout@v4
- uses: ./.github/actions/prepare
- run: pnpm run build
- run: pnpm run initialize:test
- run: pnpm run test:initialize
- if: always()
name: Codecov
uses: codecov/codecov-action@v3
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/test-migrate.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ jobs:
- uses: actions/checkout@v4
- uses: ./.github/actions/prepare
- run: pnpm run build
- run: pnpm run migrate:test
- run: pnpm run test:migrate
- if: always()
name: Codecov
uses: codecov/codecov-action@v3
Expand Down
6 changes: 3 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -23,21 +23,21 @@
],
"scripts": {
"build": "tsup",
"create:test": "node script/create-test-e2e.js",
"format": "prettier \"**/*\" --ignore-unknown",
"format:write": "pnpm format --write",
"initialize": "tsx ./src/bin/index.js --mode initialize",
"initialize:test": "node script/initialize-test-e2e.js",
"lint": "eslint . .*js --max-warnings 0",
"lint:knip": "knip",
"lint:md": "markdownlint \"**/*.md\" \".github/**/*.md\" --rules sentences-per-line",
"lint:package-json": "npmPkgJsonLint .",
"lint:packages": "pnpm dedupe --check",
"lint:spelling": "cspell \"**\" \".github/**/*\"",
"migrate:test": "node script/migrate-test-e2e.js",
"prepare": "husky install",
"should-semantic-release": "should-semantic-release --verbose",
"test": "vitest",
"test:create": "node script/create-test-e2e.js",
"test:initialize": "node script/initialize-test-e2e.js",
"test:migrate": "node script/migrate-test-e2e.js",
"tsc": "tsc"
},
"lint-staged": {
Expand Down
18 changes: 9 additions & 9 deletions src/steps/updateLocalFiles.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -125,14 +125,14 @@ describe("updateLocalFiles", () => {
[
{
"files": "./package.json",
"from": /"create:test": "\\.\\+\\\\n/g,
"from": /"test:create": "\\.\\+\\\\n/g,
"to": "",
},
],
[
{
"files": "./package.json",
"from": /"initialize:test": "\\.\\*/g,
"from": /"test:initialize": "\\.\\*/g,
"to": "",
},
],
Expand All @@ -146,7 +146,7 @@ describe("updateLocalFiles", () => {
[
{
"files": "./package.json",
"from": /"migrate:test": "\\.\\+\\\\n/g,
"from": /"test:migrate": "\\.\\+\\\\n/g,
"to": "",
},
],
Expand Down Expand Up @@ -260,14 +260,14 @@ describe("updateLocalFiles", () => {
[
{
"files": "./package.json",
"from": /"create:test": "\\.\\+\\\\n/g,
"from": /"test:create": "\\.\\+\\\\n/g,
"to": "",
},
],
[
{
"files": "./package.json",
"from": /"initialize:test": "\\.\\*/g,
"from": /"test:initialize": "\\.\\*/g,
"to": "",
},
],
Expand All @@ -281,7 +281,7 @@ describe("updateLocalFiles", () => {
[
{
"files": "./package.json",
"from": /"migrate:test": "\\.\\+\\\\n/g,
"from": /"test:migrate": "\\.\\+\\\\n/g,
"to": "",
},
],
Expand Down Expand Up @@ -398,14 +398,14 @@ describe("updateLocalFiles", () => {
[
{
"files": "./package.json",
"from": /"create:test": "\\.\\+\\\\n/g,
"from": /"test:create": "\\.\\+\\\\n/g,
"to": "",
},
],
[
{
"files": "./package.json",
"from": /"initialize:test": "\\.\\*/g,
"from": /"test:initialize": "\\.\\*/g,
"to": "",
},
],
Expand All @@ -419,7 +419,7 @@ describe("updateLocalFiles", () => {
[
{
"files": "./package.json",
"from": /"migrate:test": "\\.\\+\\\\n/g,
"from": /"test:migrate": "\\.\\+\\\\n/g,
"to": "",
},
],
Expand Down
6 changes: 3 additions & 3 deletions src/steps/updateLocalFiles.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,10 +19,10 @@ export async function updateLocalFiles(options: Options) {
[/\/\*\n.+\*\/\n\n/gs, ``, ".eslintrc.cjs"],
[/"author": ".+"/g, `"author": "${options.author}"`, "./package.json"],
[/"bin": ".+\n/g, ``, "./package.json"],
[/"create:test": ".+\n/g, ``, "./package.json"],
[/"initialize:test": ".*/g, ``, "./package.json"],
[/"test:create": ".+\n/g, ``, "./package.json"],
[/"test:initialize": ".*/g, ``, "./package.json"],
[/"initialize": ".*/g, ``, "./package.json"],
[/"migrate:test": ".+\n/g, ``, "./package.json"],
[/"test:migrate": ".+\n/g, ``, "./package.json"],
[/## Getting Started.*## Development/gs, `## Development`, "./README.md"],
[/\n## Setup Scripts.*$/gs, "", "./.github/DEVELOPMENT.md"],
[`\t\t"src/initialize/index.ts",\n`, ``, "./knip.jsonc"],
Expand Down

0 comments on commit 486f89d

Please sign in to comment.