From 486f89d7e094c48b8b95d07f21ff382ebb11d3f6 Mon Sep 17 00:00:00 2001 From: Daniel Date: Thu, 7 Sep 2023 17:21:20 +0200 Subject: [PATCH] build: renamed *:test to test:* in every file (#811) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit ## 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. --------- Co-authored-by: Josh Goldberg --- .github/DEVELOPMENT.md | 10 +++++----- .github/workflows/test-create.yml | 2 +- .github/workflows/test-initialize.yml | 2 +- .github/workflows/test-migrate.yml | 2 +- package.json | 6 +++--- src/steps/updateLocalFiles.test.ts | 18 +++++++++--------- src/steps/updateLocalFiles.ts | 6 +++--- 7 files changed, 23 insertions(+), 23 deletions(-) diff --git a/.github/DEVELOPMENT.md b/.github/DEVELOPMENT.md index 79f038b0..9dcc5ea2 100644 --- a/.github/DEVELOPMENT.md +++ b/.github/DEVELOPMENT.md @@ -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: @@ -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: @@ -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 @@ -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: @@ -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`. diff --git a/.github/workflows/test-create.yml b/.github/workflows/test-create.yml index 6d2d0a85..3a055927 100644 --- a/.github/workflows/test-create.yml +++ b/.github/workflows/test-create.yml @@ -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 diff --git a/.github/workflows/test-initialize.yml b/.github/workflows/test-initialize.yml index 1f52dffe..ac736a6d 100644 --- a/.github/workflows/test-initialize.yml +++ b/.github/workflows/test-initialize.yml @@ -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 diff --git a/.github/workflows/test-migrate.yml b/.github/workflows/test-migrate.yml index 3c83e6eb..30e99073 100644 --- a/.github/workflows/test-migrate.yml +++ b/.github/workflows/test-migrate.yml @@ -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 diff --git a/package.json b/package.json index 3bd00ffd..815e04eb 100644 --- a/package.json +++ b/package.json @@ -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": { diff --git a/src/steps/updateLocalFiles.test.ts b/src/steps/updateLocalFiles.test.ts index 1a858ca5..4553c1b5 100644 --- a/src/steps/updateLocalFiles.test.ts +++ b/src/steps/updateLocalFiles.test.ts @@ -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": "", }, ], @@ -146,7 +146,7 @@ describe("updateLocalFiles", () => { [ { "files": "./package.json", - "from": /"migrate:test": "\\.\\+\\\\n/g, + "from": /"test:migrate": "\\.\\+\\\\n/g, "to": "", }, ], @@ -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": "", }, ], @@ -281,7 +281,7 @@ describe("updateLocalFiles", () => { [ { "files": "./package.json", - "from": /"migrate:test": "\\.\\+\\\\n/g, + "from": /"test:migrate": "\\.\\+\\\\n/g, "to": "", }, ], @@ -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": "", }, ], @@ -419,7 +419,7 @@ describe("updateLocalFiles", () => { [ { "files": "./package.json", - "from": /"migrate:test": "\\.\\+\\\\n/g, + "from": /"test:migrate": "\\.\\+\\\\n/g, "to": "", }, ], diff --git a/src/steps/updateLocalFiles.ts b/src/steps/updateLocalFiles.ts index d088466d..d47b0d8e 100644 --- a/src/steps/updateLocalFiles.ts +++ b/src/steps/updateLocalFiles.ts @@ -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"],