From 0db7ef746e050a24490df9ba45bad440fa2b087b Mon Sep 17 00:00:00 2001 From: ijlee2 Date: Wed, 15 Jan 2025 15:54:31 +0100 Subject: [PATCH 1/6] chore: Renamed script --- CONTRIBUTING.md | 24 +++++++++++++----------- package.json | 2 +- 2 files changed, 14 insertions(+), 12 deletions(-) diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index e2ad86d8..c035c73e 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -87,26 +87,28 @@ Here are some guidelines to help you and everyone else. Publish packages (for admins) -1. Generate a [personal access token](https://github.com/settings/tokens/) in GitHub, with `repo` and `read:user` scopes enabled. +1. Generate a [personal access token](https://github.com/settings/tokens/) in GitHub, with `repo` and `read:user` scopes enabled. This token will be used to retrieve pull request information. -1. Run the `release:changelog` script. This removes changesets, updates the package versions, and updates the `CHANGELOG`'s. +1. Run the `release:prepare` script. This removes changesets, updates package versions, and updates `CHANGELOG`s. ```sh # From the workspace root - GITHUB_TOKEN= pnpm release:changelog + GITHUB_TOKEN= pnpm release:prepare ``` - The `release:changelog` script also updated the workspace root's version (by following the highest version formula). We will use it to name the tag that will be published. + Note, `release:prepare` also updated the workspace root's version (e.g. from `0.1.1` to `0.1.2`). We will use it to name the tag that will be published. - ``` - # Highest version formula - workspace root version = max( - max(all package versions), - workspace root version + 0.0.1, - ); +1. Review the file changes. Commit them in a branch, then open a pull request to merge the changes to the `main` branch. + + ```sh + # From the workspace root + git checkout -b tag-0.1.2 + git add . + git commit -m "Tagged 0.1.2" + git push origin tag-0.1.2 ``` -1. [Create a tag](https://github.com/ijlee2/codemod-utils/releases/new) and provide release notes. The tag name should match the workspace root's version. +1. [Create a tag](https://github.com/ijlee2/codemod-utils/releases/new) and provide release notes. The tag name should match the workspace root's version (e.g. `0.1.2`). 1. Publish the packages. diff --git a/package.json b/package.json index 0f7148de..241ae6be 100644 --- a/package.json +++ b/package.json @@ -15,7 +15,7 @@ "lint": "pnpm --filter \"*\" lint", "lint:fix": "pnpm --filter \"*\" lint:fix", "prepare": "pnpm build", - "release:changelog": "changeset version; update-workspace-root-version", + "release:prepare": "changeset version; update-workspace-root-version", "release:publish": "pnpm build && changeset publish", "test": "pnpm --filter \"*\" test" }, From 489dce09e39e77499a8898f820de0e50f28434bf Mon Sep 17 00:00:00 2001 From: ijlee2 Date: Wed, 15 Jan 2025 15:56:18 +0100 Subject: [PATCH 2/6] chore: Updated blueprints --- .../src/blueprints/.github/workflows/ci.yml | 5 ----- packages/cli/src/blueprints/CONTRIBUTING.md | 21 +++++++++++++++---- packages/cli/src/blueprints/LICENSE.md | 2 +- packages/cli/src/blueprints/package.json | 12 +++++------ packages/cli/src/steps/update-package-json.ts | 7 +++++++ .../cli/src/utils/blueprints/get-version.ts | 1 + 6 files changed, 32 insertions(+), 16 deletions(-) diff --git a/packages/cli/src/blueprints/.github/workflows/ci.yml b/packages/cli/src/blueprints/.github/workflows/ci.yml index fbce4ff5..ad943dba 100644 --- a/packages/cli/src/blueprints/.github/workflows/ci.yml +++ b/packages/cli/src/blueprints/.github/workflows/ci.yml @@ -8,7 +8,6 @@ on: env: NODE_VERSION: 18 - PNPM_VERSION: 9 jobs: lint: @@ -21,8 +20,6 @@ jobs: - name: Set up pnpm uses: pnpm/action-setup@v4 - with: - version: ${{ env.PNPM_VERSION }} - name: Use Node.js ${{ env.NODE_VERSION }} uses: actions/setup-node@v4 @@ -47,8 +44,6 @@ jobs: - name: Set up pnpm uses: pnpm/action-setup@v4 - with: - version: ${{ env.PNPM_VERSION }} - name: Use Node.js ${{ env.NODE_VERSION }} uses: actions/setup-node@v4 diff --git a/packages/cli/src/blueprints/CONTRIBUTING.md b/packages/cli/src/blueprints/CONTRIBUTING.md index b8959c03..d737f07f 100644 --- a/packages/cli/src/blueprints/CONTRIBUTING.md +++ b/packages/cli/src/blueprints/CONTRIBUTING.md @@ -83,15 +83,28 @@ Here are some guidelines to help you and everyone else. Publish package (for admins) -1. Generate a [personal access token](https://github.com/settings/tokens/) in GitHub, with `repo` and `read:user` scopes enabled. +1. Generate a [personal access token](https://github.com/settings/tokens/) in GitHub, with `repo` and `read:user` scopes enabled. This token will be used to retrieve pull request information. -1. Run the `release:changelog` script. This removes changesets, updates the package version, and updates the `CHANGELOG`. +1. Run the `release:prepare` script. This removes changesets, updates package versions, and updates `CHANGELOG`s. ```sh - GITHUB_TOKEN= pnpm release:changelog + # From the workspace root + GITHUB_TOKEN= pnpm release:prepare ``` -1. [Create a tag](https://github.com//<%= options.codemod.name %>/releases/new) and provide release notes. The tag name should match the package version. + Note, `release:prepare` also updated the workspace root's version (e.g. from `0.1.1` to `0.1.2`). We will use it to name the tag that will be published. + +1. Review the file changes. Commit them in a branch, then open a pull request to merge the changes to the `main` branch. + + ```sh + # From the workspace root + git checkout -b tag-0.1.2 + git add . + git commit -m "Tagged 0.1.2" + git push origin tag-0.1.2 + ``` + +1. [Create a tag](https://github.com//<%= options.codemod.name %>/releases/new) and provide release notes. The tag name should match the workspace root's version (e.g. `0.1.2`). 1. Publish the package. diff --git a/packages/cli/src/blueprints/LICENSE.md b/packages/cli/src/blueprints/LICENSE.md index ff84a5be..8ba573fc 100644 --- a/packages/cli/src/blueprints/LICENSE.md +++ b/packages/cli/src/blueprints/LICENSE.md @@ -1,6 +1,6 @@ The MIT License (MIT) -Copyright (c) 2024 +Copyright (c) 2025 Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: diff --git a/packages/cli/src/blueprints/package.json b/packages/cli/src/blueprints/package.json index 7d08d402..6f836e9c 100644 --- a/packages/cli/src/blueprints/package.json +++ b/packages/cli/src/blueprints/package.json @@ -22,13 +22,13 @@ ], "scripts": { "build": "./build.sh --production", - "lint": "concurrently 'pnpm:lint:*(!fix)' --names 'lint:'", - "lint:fix": "concurrently 'pnpm:lint:*:fix' --names 'fix:'", + "lint": "concurrently \"pnpm:lint:*(!fix)\" --names \"lint:\"", + "lint:fix": "concurrently \"pnpm:lint:*:fix\" --names \"fix:\"", "lint:js": "eslint . --cache", "lint:js:fix": "eslint . --fix", "lint:types": "tsc --noEmit", "prepare": "pnpm build", - "release:changelog": "changeset version", + "release:prepare": "changeset version", "release:publish": "pnpm build && changeset publish", "test": "./build.sh --test && mt dist-for-testing --quiet" }, @@ -61,11 +61,11 @@ "src" ], "scripts": { - "lint": "concurrently 'pnpm:lint:*(!fix)' --names 'lint:'", - "lint:fix": "concurrently 'pnpm:lint:*:fix' --names 'fix:'", + "lint": "concurrently \"pnpm:lint:*(!fix)\" --names \"lint:\"", + "lint:fix": "concurrently \"pnpm:lint:*:fix\" --names \"fix:\"", "lint:js": "eslint . --cache", "lint:js:fix": "eslint . --fix", - "release:changelog": "changeset version", + "release:prepare": "changeset version", "release:publish": "changeset publish", "test": "mt tests --quiet" }, diff --git a/packages/cli/src/steps/update-package-json.ts b/packages/cli/src/steps/update-package-json.ts index fde0f2ef..a7ffbe1f 100644 --- a/packages/cli/src/steps/update-package-json.ts +++ b/packages/cli/src/steps/update-package-json.ts @@ -78,6 +78,12 @@ function updateDevDependencies( packageJson['devDependencies'] = convertToObject(devDependencies); } +function addPackageManager(packageJson: PackageJson): void { + const version = getVersion('pnpm').replace(/^\^/, ''); + + packageJson['packageManager'] = `pnpm@${version}`; +} + function addPnpmOverrides(packageJson: PackageJson, options: Options): void { const { codemod } = options; @@ -103,6 +109,7 @@ export function updatePackageJson(options: Options): void { updateDependencies(packageJson, options); updateDevDependencies(packageJson, options); + addPackageManager(packageJson); addPnpmOverrides(packageJson, options); const destination = join(projectRoot, codemod.name, 'package.json'); diff --git a/packages/cli/src/utils/blueprints/get-version.ts b/packages/cli/src/utils/blueprints/get-version.ts index b44eeb2f..42f35072 100644 --- a/packages/cli/src/utils/blueprints/get-version.ts +++ b/packages/cli/src/utils/blueprints/get-version.ts @@ -28,6 +28,7 @@ const latestVersions = new Map([ ['eslint-plugin-prettier', '5.2.1'], ['eslint-plugin-simple-import-sort', '12.1.1'], ['eslint-plugin-typescript-sort-keys', '3.3.0'], + ['pnpm', '9.15.4'], ['prettier', '3.4.1'], ['typescript', '5.7.2'], ['yargs', '17.7.2'], From 826eb1061b688c553d51ee33282023cc22311df6 Mon Sep 17 00:00:00 2001 From: ijlee2 Date: Wed, 15 Jan 2025 15:56:21 +0100 Subject: [PATCH 3/6] chore: Updated blueprints --- .../.github/workflows/ci.yml | 5 ----- .../CONTRIBUTING.md | 21 +++++++++++++++---- .../LICENSE.md | 2 +- .../package.json | 9 ++++---- .../.github/workflows/ci.yml | 5 ----- .../CONTRIBUTING.md | 21 +++++++++++++++---- .../ember-codemod-pod-to-octane/LICENSE.md | 2 +- .../ember-codemod-pod-to-octane/package.json | 9 ++++---- .../.github/workflows/ci.yml | 5 ----- .../CONTRIBUTING.md | 21 +++++++++++++++---- .../LICENSE.md | 2 +- .../package.json | 7 ++++--- .../.github/workflows/ci.yml | 5 ----- .../CONTRIBUTING.md | 21 +++++++++++++++---- .../ember-codemod-pod-to-octane/LICENSE.md | 2 +- .../ember-codemod-pod-to-octane/package.json | 7 ++++--- 16 files changed, 90 insertions(+), 54 deletions(-) diff --git a/packages/cli/tests/fixtures/javascript-with-addons/output/ember-codemod-args-to-signature/.github/workflows/ci.yml b/packages/cli/tests/fixtures/javascript-with-addons/output/ember-codemod-args-to-signature/.github/workflows/ci.yml index fbce4ff5..ad943dba 100644 --- a/packages/cli/tests/fixtures/javascript-with-addons/output/ember-codemod-args-to-signature/.github/workflows/ci.yml +++ b/packages/cli/tests/fixtures/javascript-with-addons/output/ember-codemod-args-to-signature/.github/workflows/ci.yml @@ -8,7 +8,6 @@ on: env: NODE_VERSION: 18 - PNPM_VERSION: 9 jobs: lint: @@ -21,8 +20,6 @@ jobs: - name: Set up pnpm uses: pnpm/action-setup@v4 - with: - version: ${{ env.PNPM_VERSION }} - name: Use Node.js ${{ env.NODE_VERSION }} uses: actions/setup-node@v4 @@ -47,8 +44,6 @@ jobs: - name: Set up pnpm uses: pnpm/action-setup@v4 - with: - version: ${{ env.PNPM_VERSION }} - name: Use Node.js ${{ env.NODE_VERSION }} uses: actions/setup-node@v4 diff --git a/packages/cli/tests/fixtures/javascript-with-addons/output/ember-codemod-args-to-signature/CONTRIBUTING.md b/packages/cli/tests/fixtures/javascript-with-addons/output/ember-codemod-args-to-signature/CONTRIBUTING.md index 5ba03103..54cb275f 100644 --- a/packages/cli/tests/fixtures/javascript-with-addons/output/ember-codemod-args-to-signature/CONTRIBUTING.md +++ b/packages/cli/tests/fixtures/javascript-with-addons/output/ember-codemod-args-to-signature/CONTRIBUTING.md @@ -83,15 +83,28 @@ Here are some guidelines to help you and everyone else. Publish package (for admins) -1. Generate a [personal access token](https://github.com/settings/tokens/) in GitHub, with `repo` and `read:user` scopes enabled. +1. Generate a [personal access token](https://github.com/settings/tokens/) in GitHub, with `repo` and `read:user` scopes enabled. This token will be used to retrieve pull request information. -1. Run the `release:changelog` script. This removes changesets, updates the package version, and updates the `CHANGELOG`. +1. Run the `release:prepare` script. This removes changesets, updates package versions, and updates `CHANGELOG`s. ```sh - GITHUB_TOKEN= pnpm release:changelog + # From the workspace root + GITHUB_TOKEN= pnpm release:prepare ``` -1. [Create a tag](https://github.com//ember-codemod-args-to-signature/releases/new) and provide release notes. The tag name should match the package version. + Note, `release:prepare` also updated the workspace root's version (e.g. from `0.1.1` to `0.1.2`). We will use it to name the tag that will be published. + +1. Review the file changes. Commit them in a branch, then open a pull request to merge the changes to the `main` branch. + + ```sh + # From the workspace root + git checkout -b tag-0.1.2 + git add . + git commit -m "Tagged 0.1.2" + git push origin tag-0.1.2 + ``` + +1. [Create a tag](https://github.com//ember-codemod-args-to-signature/releases/new) and provide release notes. The tag name should match the workspace root's version (e.g. `0.1.2`). 1. Publish the package. diff --git a/packages/cli/tests/fixtures/javascript-with-addons/output/ember-codemod-args-to-signature/LICENSE.md b/packages/cli/tests/fixtures/javascript-with-addons/output/ember-codemod-args-to-signature/LICENSE.md index ff84a5be..8ba573fc 100644 --- a/packages/cli/tests/fixtures/javascript-with-addons/output/ember-codemod-args-to-signature/LICENSE.md +++ b/packages/cli/tests/fixtures/javascript-with-addons/output/ember-codemod-args-to-signature/LICENSE.md @@ -1,6 +1,6 @@ The MIT License (MIT) -Copyright (c) 2024 +Copyright (c) 2025 Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: diff --git a/packages/cli/tests/fixtures/javascript-with-addons/output/ember-codemod-args-to-signature/package.json b/packages/cli/tests/fixtures/javascript-with-addons/output/ember-codemod-args-to-signature/package.json index 821f147a..6264c2e5 100644 --- a/packages/cli/tests/fixtures/javascript-with-addons/output/ember-codemod-args-to-signature/package.json +++ b/packages/cli/tests/fixtures/javascript-with-addons/output/ember-codemod-args-to-signature/package.json @@ -22,11 +22,11 @@ "src" ], "scripts": { - "lint": "concurrently 'pnpm:lint:*(!fix)' --names 'lint:'", - "lint:fix": "concurrently 'pnpm:lint:*:fix' --names 'fix:'", + "lint": "concurrently \"pnpm:lint:*(!fix)\" --names \"lint:\"", + "lint:fix": "concurrently \"pnpm:lint:*:fix\" --names \"fix:\"", "lint:js": "eslint . --cache", "lint:js:fix": "eslint . --fix", - "release:changelog": "changeset version", + "release:prepare": "changeset version", "release:publish": "changeset publish", "test": "mt tests --quiet" }, @@ -57,5 +57,6 @@ }, "engines": { "node": "18.* || >= 20" - } + }, + "packageManager": "pnpm@9.15.4" } diff --git a/packages/cli/tests/fixtures/javascript/output/ember-codemod-pod-to-octane/.github/workflows/ci.yml b/packages/cli/tests/fixtures/javascript/output/ember-codemod-pod-to-octane/.github/workflows/ci.yml index fbce4ff5..ad943dba 100644 --- a/packages/cli/tests/fixtures/javascript/output/ember-codemod-pod-to-octane/.github/workflows/ci.yml +++ b/packages/cli/tests/fixtures/javascript/output/ember-codemod-pod-to-octane/.github/workflows/ci.yml @@ -8,7 +8,6 @@ on: env: NODE_VERSION: 18 - PNPM_VERSION: 9 jobs: lint: @@ -21,8 +20,6 @@ jobs: - name: Set up pnpm uses: pnpm/action-setup@v4 - with: - version: ${{ env.PNPM_VERSION }} - name: Use Node.js ${{ env.NODE_VERSION }} uses: actions/setup-node@v4 @@ -47,8 +44,6 @@ jobs: - name: Set up pnpm uses: pnpm/action-setup@v4 - with: - version: ${{ env.PNPM_VERSION }} - name: Use Node.js ${{ env.NODE_VERSION }} uses: actions/setup-node@v4 diff --git a/packages/cli/tests/fixtures/javascript/output/ember-codemod-pod-to-octane/CONTRIBUTING.md b/packages/cli/tests/fixtures/javascript/output/ember-codemod-pod-to-octane/CONTRIBUTING.md index d4ba38c7..a53d596e 100644 --- a/packages/cli/tests/fixtures/javascript/output/ember-codemod-pod-to-octane/CONTRIBUTING.md +++ b/packages/cli/tests/fixtures/javascript/output/ember-codemod-pod-to-octane/CONTRIBUTING.md @@ -83,15 +83,28 @@ Here are some guidelines to help you and everyone else. Publish package (for admins) -1. Generate a [personal access token](https://github.com/settings/tokens/) in GitHub, with `repo` and `read:user` scopes enabled. +1. Generate a [personal access token](https://github.com/settings/tokens/) in GitHub, with `repo` and `read:user` scopes enabled. This token will be used to retrieve pull request information. -1. Run the `release:changelog` script. This removes changesets, updates the package version, and updates the `CHANGELOG`. +1. Run the `release:prepare` script. This removes changesets, updates package versions, and updates `CHANGELOG`s. ```sh - GITHUB_TOKEN= pnpm release:changelog + # From the workspace root + GITHUB_TOKEN= pnpm release:prepare ``` -1. [Create a tag](https://github.com//ember-codemod-pod-to-octane/releases/new) and provide release notes. The tag name should match the package version. + Note, `release:prepare` also updated the workspace root's version (e.g. from `0.1.1` to `0.1.2`). We will use it to name the tag that will be published. + +1. Review the file changes. Commit them in a branch, then open a pull request to merge the changes to the `main` branch. + + ```sh + # From the workspace root + git checkout -b tag-0.1.2 + git add . + git commit -m "Tagged 0.1.2" + git push origin tag-0.1.2 + ``` + +1. [Create a tag](https://github.com//ember-codemod-pod-to-octane/releases/new) and provide release notes. The tag name should match the workspace root's version (e.g. `0.1.2`). 1. Publish the package. diff --git a/packages/cli/tests/fixtures/javascript/output/ember-codemod-pod-to-octane/LICENSE.md b/packages/cli/tests/fixtures/javascript/output/ember-codemod-pod-to-octane/LICENSE.md index ff84a5be..8ba573fc 100644 --- a/packages/cli/tests/fixtures/javascript/output/ember-codemod-pod-to-octane/LICENSE.md +++ b/packages/cli/tests/fixtures/javascript/output/ember-codemod-pod-to-octane/LICENSE.md @@ -1,6 +1,6 @@ The MIT License (MIT) -Copyright (c) 2024 +Copyright (c) 2025 Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: diff --git a/packages/cli/tests/fixtures/javascript/output/ember-codemod-pod-to-octane/package.json b/packages/cli/tests/fixtures/javascript/output/ember-codemod-pod-to-octane/package.json index 6a7ca28b..93e29b86 100644 --- a/packages/cli/tests/fixtures/javascript/output/ember-codemod-pod-to-octane/package.json +++ b/packages/cli/tests/fixtures/javascript/output/ember-codemod-pod-to-octane/package.json @@ -22,11 +22,11 @@ "src" ], "scripts": { - "lint": "concurrently 'pnpm:lint:*(!fix)' --names 'lint:'", - "lint:fix": "concurrently 'pnpm:lint:*:fix' --names 'fix:'", + "lint": "concurrently \"pnpm:lint:*(!fix)\" --names \"lint:\"", + "lint:fix": "concurrently \"pnpm:lint:*:fix\" --names \"fix:\"", "lint:js": "eslint . --cache", "lint:js:fix": "eslint . --fix", - "release:changelog": "changeset version", + "release:prepare": "changeset version", "release:publish": "changeset publish", "test": "mt tests --quiet" }, @@ -52,5 +52,6 @@ }, "engines": { "node": "18.* || >= 20" - } + }, + "packageManager": "pnpm@9.15.4" } diff --git a/packages/cli/tests/fixtures/typescript-with-addons/output/ember-codemod-args-to-signature/.github/workflows/ci.yml b/packages/cli/tests/fixtures/typescript-with-addons/output/ember-codemod-args-to-signature/.github/workflows/ci.yml index fbce4ff5..ad943dba 100644 --- a/packages/cli/tests/fixtures/typescript-with-addons/output/ember-codemod-args-to-signature/.github/workflows/ci.yml +++ b/packages/cli/tests/fixtures/typescript-with-addons/output/ember-codemod-args-to-signature/.github/workflows/ci.yml @@ -8,7 +8,6 @@ on: env: NODE_VERSION: 18 - PNPM_VERSION: 9 jobs: lint: @@ -21,8 +20,6 @@ jobs: - name: Set up pnpm uses: pnpm/action-setup@v4 - with: - version: ${{ env.PNPM_VERSION }} - name: Use Node.js ${{ env.NODE_VERSION }} uses: actions/setup-node@v4 @@ -47,8 +44,6 @@ jobs: - name: Set up pnpm uses: pnpm/action-setup@v4 - with: - version: ${{ env.PNPM_VERSION }} - name: Use Node.js ${{ env.NODE_VERSION }} uses: actions/setup-node@v4 diff --git a/packages/cli/tests/fixtures/typescript-with-addons/output/ember-codemod-args-to-signature/CONTRIBUTING.md b/packages/cli/tests/fixtures/typescript-with-addons/output/ember-codemod-args-to-signature/CONTRIBUTING.md index 5ba03103..54cb275f 100644 --- a/packages/cli/tests/fixtures/typescript-with-addons/output/ember-codemod-args-to-signature/CONTRIBUTING.md +++ b/packages/cli/tests/fixtures/typescript-with-addons/output/ember-codemod-args-to-signature/CONTRIBUTING.md @@ -83,15 +83,28 @@ Here are some guidelines to help you and everyone else. Publish package (for admins) -1. Generate a [personal access token](https://github.com/settings/tokens/) in GitHub, with `repo` and `read:user` scopes enabled. +1. Generate a [personal access token](https://github.com/settings/tokens/) in GitHub, with `repo` and `read:user` scopes enabled. This token will be used to retrieve pull request information. -1. Run the `release:changelog` script. This removes changesets, updates the package version, and updates the `CHANGELOG`. +1. Run the `release:prepare` script. This removes changesets, updates package versions, and updates `CHANGELOG`s. ```sh - GITHUB_TOKEN= pnpm release:changelog + # From the workspace root + GITHUB_TOKEN= pnpm release:prepare ``` -1. [Create a tag](https://github.com//ember-codemod-args-to-signature/releases/new) and provide release notes. The tag name should match the package version. + Note, `release:prepare` also updated the workspace root's version (e.g. from `0.1.1` to `0.1.2`). We will use it to name the tag that will be published. + +1. Review the file changes. Commit them in a branch, then open a pull request to merge the changes to the `main` branch. + + ```sh + # From the workspace root + git checkout -b tag-0.1.2 + git add . + git commit -m "Tagged 0.1.2" + git push origin tag-0.1.2 + ``` + +1. [Create a tag](https://github.com//ember-codemod-args-to-signature/releases/new) and provide release notes. The tag name should match the workspace root's version (e.g. `0.1.2`). 1. Publish the package. diff --git a/packages/cli/tests/fixtures/typescript-with-addons/output/ember-codemod-args-to-signature/LICENSE.md b/packages/cli/tests/fixtures/typescript-with-addons/output/ember-codemod-args-to-signature/LICENSE.md index ff84a5be..8ba573fc 100644 --- a/packages/cli/tests/fixtures/typescript-with-addons/output/ember-codemod-args-to-signature/LICENSE.md +++ b/packages/cli/tests/fixtures/typescript-with-addons/output/ember-codemod-args-to-signature/LICENSE.md @@ -1,6 +1,6 @@ The MIT License (MIT) -Copyright (c) 2024 +Copyright (c) 2025 Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: diff --git a/packages/cli/tests/fixtures/typescript-with-addons/output/ember-codemod-args-to-signature/package.json b/packages/cli/tests/fixtures/typescript-with-addons/output/ember-codemod-args-to-signature/package.json index d537498b..53ff4cd4 100644 --- a/packages/cli/tests/fixtures/typescript-with-addons/output/ember-codemod-args-to-signature/package.json +++ b/packages/cli/tests/fixtures/typescript-with-addons/output/ember-codemod-args-to-signature/package.json @@ -22,13 +22,13 @@ ], "scripts": { "build": "./build.sh --production", - "lint": "concurrently 'pnpm:lint:*(!fix)' --names 'lint:'", - "lint:fix": "concurrently 'pnpm:lint:*:fix' --names 'fix:'", + "lint": "concurrently \"pnpm:lint:*(!fix)\" --names \"lint:\"", + "lint:fix": "concurrently \"pnpm:lint:*:fix\" --names \"fix:\"", "lint:js": "eslint . --cache", "lint:js:fix": "eslint . --fix", "lint:types": "tsc --noEmit", "prepare": "pnpm build", - "release:changelog": "changeset version", + "release:prepare": "changeset version", "release:publish": "pnpm build && changeset publish", "test": "./build.sh --test && mt dist-for-testing --quiet" }, @@ -68,6 +68,7 @@ "engines": { "node": "18.* || >= 20" }, + "packageManager": "pnpm@9.15.4", "pnpm": { "overrides": { "eslint-plugin-import@2.31.0>tsconfig-paths": "^4.2.0" diff --git a/packages/cli/tests/fixtures/typescript/output/ember-codemod-pod-to-octane/.github/workflows/ci.yml b/packages/cli/tests/fixtures/typescript/output/ember-codemod-pod-to-octane/.github/workflows/ci.yml index fbce4ff5..ad943dba 100644 --- a/packages/cli/tests/fixtures/typescript/output/ember-codemod-pod-to-octane/.github/workflows/ci.yml +++ b/packages/cli/tests/fixtures/typescript/output/ember-codemod-pod-to-octane/.github/workflows/ci.yml @@ -8,7 +8,6 @@ on: env: NODE_VERSION: 18 - PNPM_VERSION: 9 jobs: lint: @@ -21,8 +20,6 @@ jobs: - name: Set up pnpm uses: pnpm/action-setup@v4 - with: - version: ${{ env.PNPM_VERSION }} - name: Use Node.js ${{ env.NODE_VERSION }} uses: actions/setup-node@v4 @@ -47,8 +44,6 @@ jobs: - name: Set up pnpm uses: pnpm/action-setup@v4 - with: - version: ${{ env.PNPM_VERSION }} - name: Use Node.js ${{ env.NODE_VERSION }} uses: actions/setup-node@v4 diff --git a/packages/cli/tests/fixtures/typescript/output/ember-codemod-pod-to-octane/CONTRIBUTING.md b/packages/cli/tests/fixtures/typescript/output/ember-codemod-pod-to-octane/CONTRIBUTING.md index d4ba38c7..a53d596e 100644 --- a/packages/cli/tests/fixtures/typescript/output/ember-codemod-pod-to-octane/CONTRIBUTING.md +++ b/packages/cli/tests/fixtures/typescript/output/ember-codemod-pod-to-octane/CONTRIBUTING.md @@ -83,15 +83,28 @@ Here are some guidelines to help you and everyone else. Publish package (for admins) -1. Generate a [personal access token](https://github.com/settings/tokens/) in GitHub, with `repo` and `read:user` scopes enabled. +1. Generate a [personal access token](https://github.com/settings/tokens/) in GitHub, with `repo` and `read:user` scopes enabled. This token will be used to retrieve pull request information. -1. Run the `release:changelog` script. This removes changesets, updates the package version, and updates the `CHANGELOG`. +1. Run the `release:prepare` script. This removes changesets, updates package versions, and updates `CHANGELOG`s. ```sh - GITHUB_TOKEN= pnpm release:changelog + # From the workspace root + GITHUB_TOKEN= pnpm release:prepare ``` -1. [Create a tag](https://github.com//ember-codemod-pod-to-octane/releases/new) and provide release notes. The tag name should match the package version. + Note, `release:prepare` also updated the workspace root's version (e.g. from `0.1.1` to `0.1.2`). We will use it to name the tag that will be published. + +1. Review the file changes. Commit them in a branch, then open a pull request to merge the changes to the `main` branch. + + ```sh + # From the workspace root + git checkout -b tag-0.1.2 + git add . + git commit -m "Tagged 0.1.2" + git push origin tag-0.1.2 + ``` + +1. [Create a tag](https://github.com//ember-codemod-pod-to-octane/releases/new) and provide release notes. The tag name should match the workspace root's version (e.g. `0.1.2`). 1. Publish the package. diff --git a/packages/cli/tests/fixtures/typescript/output/ember-codemod-pod-to-octane/LICENSE.md b/packages/cli/tests/fixtures/typescript/output/ember-codemod-pod-to-octane/LICENSE.md index ff84a5be..8ba573fc 100644 --- a/packages/cli/tests/fixtures/typescript/output/ember-codemod-pod-to-octane/LICENSE.md +++ b/packages/cli/tests/fixtures/typescript/output/ember-codemod-pod-to-octane/LICENSE.md @@ -1,6 +1,6 @@ The MIT License (MIT) -Copyright (c) 2024 +Copyright (c) 2025 Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: diff --git a/packages/cli/tests/fixtures/typescript/output/ember-codemod-pod-to-octane/package.json b/packages/cli/tests/fixtures/typescript/output/ember-codemod-pod-to-octane/package.json index 5688755b..5fa6b304 100644 --- a/packages/cli/tests/fixtures/typescript/output/ember-codemod-pod-to-octane/package.json +++ b/packages/cli/tests/fixtures/typescript/output/ember-codemod-pod-to-octane/package.json @@ -22,13 +22,13 @@ ], "scripts": { "build": "./build.sh --production", - "lint": "concurrently 'pnpm:lint:*(!fix)' --names 'lint:'", - "lint:fix": "concurrently 'pnpm:lint:*:fix' --names 'fix:'", + "lint": "concurrently \"pnpm:lint:*(!fix)\" --names \"lint:\"", + "lint:fix": "concurrently \"pnpm:lint:*:fix\" --names \"fix:\"", "lint:js": "eslint . --cache", "lint:js:fix": "eslint . --fix", "lint:types": "tsc --noEmit", "prepare": "pnpm build", - "release:changelog": "changeset version", + "release:prepare": "changeset version", "release:publish": "pnpm build && changeset publish", "test": "./build.sh --test && mt dist-for-testing --quiet" }, @@ -63,6 +63,7 @@ "engines": { "node": "18.* || >= 20" }, + "packageManager": "pnpm@9.15.4", "pnpm": { "overrides": { "eslint-plugin-import@2.31.0>tsconfig-paths": "^4.2.0" From df64ad0c0001acd5dea5fe26ec5058a2fe25f335 Mon Sep 17 00:00:00 2001 From: ijlee2 Date: Wed, 15 Jan 2025 15:59:05 +0100 Subject: [PATCH 4/6] chore: Updated latestVersions --- .../cli/src/utils/blueprints/get-version.ts | 38 +++++++++---------- 1 file changed, 19 insertions(+), 19 deletions(-) diff --git a/packages/cli/src/utils/blueprints/get-version.ts b/packages/cli/src/utils/blueprints/get-version.ts index 42f35072..11a6bfa4 100644 --- a/packages/cli/src/utils/blueprints/get-version.ts +++ b/packages/cli/src/utils/blueprints/get-version.ts @@ -2,35 +2,35 @@ import { decideVersion } from '@codemod-utils/blueprints'; const latestVersions = new Map([ ['@babel/core', '7.26.0'], - ['@babel/eslint-parser', '7.25.9'], - ['@changesets/cli', '2.27.10'], + ['@babel/eslint-parser', '7.26.5'], + ['@changesets/cli', '2.27.11'], ['@changesets/get-github-info', '0.6.0'], - ['@codemod-utils/ast-javascript', '1.2.9'], - ['@codemod-utils/ast-template', '1.1.5'], - ['@codemod-utils/blueprints', '1.1.6'], - ['@codemod-utils/ember', '2.0.1'], - ['@codemod-utils/files', '2.0.5'], - ['@codemod-utils/json', '1.1.10'], - ['@codemod-utils/tests', '1.1.8'], + ['@codemod-utils/ast-javascript', '1.2.10'], + ['@codemod-utils/ast-template', '1.1.6'], + ['@codemod-utils/blueprints', '1.1.7'], + ['@codemod-utils/ember', '2.0.2'], + ['@codemod-utils/files', '2.0.6'], + ['@codemod-utils/json', '1.1.11'], + ['@codemod-utils/tests', '1.1.9'], ['@sondr3/minitest', '0.1.2'], ['@tsconfig/node18', '18.2.4'], ['@tsconfig/strictest', '2.0.5'], - ['@types/node', '18.19.67'], + ['@types/node', '18.19.70'], ['@types/yargs', '17.0.33'], - ['@typescript-eslint/eslint-plugin', '8.16.0'], - ['@typescript-eslint/parser', '8.16.0'], - ['concurrently', '9.1.0'], + ['@typescript-eslint/eslint-plugin', '8.20.0'], + ['@typescript-eslint/parser', '8.20.0'], + ['concurrently', '9.1.2'], ['eslint', '8.57.1'], - ['eslint-config-prettier', '9.1.0'], - ['eslint-import-resolver-typescript', '3.6.3'], + ['eslint-config-prettier', '10.0.1'], + ['eslint-import-resolver-typescript', '3.7.0'], ['eslint-plugin-import', '2.31.0'], - ['eslint-plugin-n', '17.14.0'], - ['eslint-plugin-prettier', '5.2.1'], + ['eslint-plugin-n', '17.15.1'], + ['eslint-plugin-prettier', '5.2.2'], ['eslint-plugin-simple-import-sort', '12.1.1'], ['eslint-plugin-typescript-sort-keys', '3.3.0'], ['pnpm', '9.15.4'], - ['prettier', '3.4.1'], - ['typescript', '5.7.2'], + ['prettier', '3.4.2'], + ['typescript', '5.7.3'], ['yargs', '17.7.2'], ]); From f7a716dd3dc8fece40650128af7d67debebd4dc2 Mon Sep 17 00:00:00 2001 From: ijlee2 Date: Wed, 15 Jan 2025 15:59:19 +0100 Subject: [PATCH 5/6] chore: Updated fixtures --- .../package.json | 28 +++++++-------- .../ember-codemod-pod-to-octane/package.json | 18 +++++----- .../package.json | 36 +++++++++---------- .../ember-codemod-pod-to-octane/package.json | 26 +++++++------- 4 files changed, 54 insertions(+), 54 deletions(-) diff --git a/packages/cli/tests/fixtures/javascript-with-addons/output/ember-codemod-args-to-signature/package.json b/packages/cli/tests/fixtures/javascript-with-addons/output/ember-codemod-args-to-signature/package.json index 6264c2e5..223b6c37 100644 --- a/packages/cli/tests/fixtures/javascript-with-addons/output/ember-codemod-args-to-signature/package.json +++ b/packages/cli/tests/fixtures/javascript-with-addons/output/ember-codemod-args-to-signature/package.json @@ -31,29 +31,29 @@ "test": "mt tests --quiet" }, "dependencies": { - "@codemod-utils/ast-javascript": "^1.2.9", - "@codemod-utils/ast-template": "^1.1.5", - "@codemod-utils/blueprints": "^1.1.6", - "@codemod-utils/ember": "^2.0.1", - "@codemod-utils/files": "^2.0.5", - "@codemod-utils/json": "^1.1.10", + "@codemod-utils/ast-javascript": "^1.2.10", + "@codemod-utils/ast-template": "^1.1.6", + "@codemod-utils/blueprints": "^1.1.7", + "@codemod-utils/ember": "^2.0.2", + "@codemod-utils/files": "^2.0.6", + "@codemod-utils/json": "^1.1.11", "yargs": "^17.7.2" }, "devDependencies": { "@babel/core": "^7.26.0", - "@babel/eslint-parser": "^7.25.9", - "@changesets/cli": "^2.27.10", + "@babel/eslint-parser": "^7.26.5", + "@changesets/cli": "^2.27.11", "@changesets/get-github-info": "^0.6.0", - "@codemod-utils/tests": "^1.1.8", + "@codemod-utils/tests": "^1.1.9", "@sondr3/minitest": "^0.1.2", - "concurrently": "^9.1.0", + "concurrently": "^9.1.2", "eslint": "^8.57.1", - "eslint-config-prettier": "^9.1.0", + "eslint-config-prettier": "^10.0.1", "eslint-plugin-import": "^2.31.0", - "eslint-plugin-n": "^17.14.0", - "eslint-plugin-prettier": "^5.2.1", + "eslint-plugin-n": "^17.15.1", + "eslint-plugin-prettier": "^5.2.2", "eslint-plugin-simple-import-sort": "^12.1.1", - "prettier": "^3.4.1" + "prettier": "^3.4.2" }, "engines": { "node": "18.* || >= 20" diff --git a/packages/cli/tests/fixtures/javascript/output/ember-codemod-pod-to-octane/package.json b/packages/cli/tests/fixtures/javascript/output/ember-codemod-pod-to-octane/package.json index 93e29b86..d84f303c 100644 --- a/packages/cli/tests/fixtures/javascript/output/ember-codemod-pod-to-octane/package.json +++ b/packages/cli/tests/fixtures/javascript/output/ember-codemod-pod-to-octane/package.json @@ -31,24 +31,24 @@ "test": "mt tests --quiet" }, "dependencies": { - "@codemod-utils/files": "^2.0.5", + "@codemod-utils/files": "^2.0.6", "yargs": "^17.7.2" }, "devDependencies": { "@babel/core": "^7.26.0", - "@babel/eslint-parser": "^7.25.9", - "@changesets/cli": "^2.27.10", + "@babel/eslint-parser": "^7.26.5", + "@changesets/cli": "^2.27.11", "@changesets/get-github-info": "^0.6.0", - "@codemod-utils/tests": "^1.1.8", + "@codemod-utils/tests": "^1.1.9", "@sondr3/minitest": "^0.1.2", - "concurrently": "^9.1.0", + "concurrently": "^9.1.2", "eslint": "^8.57.1", - "eslint-config-prettier": "^9.1.0", + "eslint-config-prettier": "^10.0.1", "eslint-plugin-import": "^2.31.0", - "eslint-plugin-n": "^17.14.0", - "eslint-plugin-prettier": "^5.2.1", + "eslint-plugin-n": "^17.15.1", + "eslint-plugin-prettier": "^5.2.2", "eslint-plugin-simple-import-sort": "^12.1.1", - "prettier": "^3.4.1" + "prettier": "^3.4.2" }, "engines": { "node": "18.* || >= 20" diff --git a/packages/cli/tests/fixtures/typescript-with-addons/output/ember-codemod-args-to-signature/package.json b/packages/cli/tests/fixtures/typescript-with-addons/output/ember-codemod-args-to-signature/package.json index 53ff4cd4..7bae0df1 100644 --- a/packages/cli/tests/fixtures/typescript-with-addons/output/ember-codemod-args-to-signature/package.json +++ b/packages/cli/tests/fixtures/typescript-with-addons/output/ember-codemod-args-to-signature/package.json @@ -33,37 +33,37 @@ "test": "./build.sh --test && mt dist-for-testing --quiet" }, "dependencies": { - "@codemod-utils/ast-javascript": "^1.2.9", - "@codemod-utils/ast-template": "^1.1.5", - "@codemod-utils/blueprints": "^1.1.6", - "@codemod-utils/ember": "^2.0.1", - "@codemod-utils/files": "^2.0.5", - "@codemod-utils/json": "^1.1.10", + "@codemod-utils/ast-javascript": "^1.2.10", + "@codemod-utils/ast-template": "^1.1.6", + "@codemod-utils/blueprints": "^1.1.7", + "@codemod-utils/ember": "^2.0.2", + "@codemod-utils/files": "^2.0.6", + "@codemod-utils/json": "^1.1.11", "yargs": "^17.7.2" }, "devDependencies": { "@babel/core": "^7.26.0", - "@changesets/cli": "^2.27.10", + "@changesets/cli": "^2.27.11", "@changesets/get-github-info": "^0.6.0", - "@codemod-utils/tests": "^1.1.8", + "@codemod-utils/tests": "^1.1.9", "@sondr3/minitest": "^0.1.2", "@tsconfig/node18": "^18.2.4", "@tsconfig/strictest": "^2.0.5", - "@types/node": "^18.19.67", + "@types/node": "^18.19.70", "@types/yargs": "^17.0.33", - "@typescript-eslint/eslint-plugin": "^8.16.0", - "@typescript-eslint/parser": "^8.16.0", - "concurrently": "^9.1.0", + "@typescript-eslint/eslint-plugin": "^8.20.0", + "@typescript-eslint/parser": "^8.20.0", + "concurrently": "^9.1.2", "eslint": "^8.57.1", - "eslint-config-prettier": "^9.1.0", - "eslint-import-resolver-typescript": "^3.6.3", + "eslint-config-prettier": "^10.0.1", + "eslint-import-resolver-typescript": "^3.7.0", "eslint-plugin-import": "^2.31.0", - "eslint-plugin-n": "^17.14.0", - "eslint-plugin-prettier": "^5.2.1", + "eslint-plugin-n": "^17.15.1", + "eslint-plugin-prettier": "^5.2.2", "eslint-plugin-simple-import-sort": "^12.1.1", "eslint-plugin-typescript-sort-keys": "^3.3.0", - "prettier": "^3.4.1", - "typescript": "^5.7.2" + "prettier": "^3.4.2", + "typescript": "^5.7.3" }, "engines": { "node": "18.* || >= 20" diff --git a/packages/cli/tests/fixtures/typescript/output/ember-codemod-pod-to-octane/package.json b/packages/cli/tests/fixtures/typescript/output/ember-codemod-pod-to-octane/package.json index 5fa6b304..f2e028ae 100644 --- a/packages/cli/tests/fixtures/typescript/output/ember-codemod-pod-to-octane/package.json +++ b/packages/cli/tests/fixtures/typescript/output/ember-codemod-pod-to-octane/package.json @@ -33,32 +33,32 @@ "test": "./build.sh --test && mt dist-for-testing --quiet" }, "dependencies": { - "@codemod-utils/files": "^2.0.5", + "@codemod-utils/files": "^2.0.6", "yargs": "^17.7.2" }, "devDependencies": { "@babel/core": "^7.26.0", - "@changesets/cli": "^2.27.10", + "@changesets/cli": "^2.27.11", "@changesets/get-github-info": "^0.6.0", - "@codemod-utils/tests": "^1.1.8", + "@codemod-utils/tests": "^1.1.9", "@sondr3/minitest": "^0.1.2", "@tsconfig/node18": "^18.2.4", "@tsconfig/strictest": "^2.0.5", - "@types/node": "^18.19.67", + "@types/node": "^18.19.70", "@types/yargs": "^17.0.33", - "@typescript-eslint/eslint-plugin": "^8.16.0", - "@typescript-eslint/parser": "^8.16.0", - "concurrently": "^9.1.0", + "@typescript-eslint/eslint-plugin": "^8.20.0", + "@typescript-eslint/parser": "^8.20.0", + "concurrently": "^9.1.2", "eslint": "^8.57.1", - "eslint-config-prettier": "^9.1.0", - "eslint-import-resolver-typescript": "^3.6.3", + "eslint-config-prettier": "^10.0.1", + "eslint-import-resolver-typescript": "^3.7.0", "eslint-plugin-import": "^2.31.0", - "eslint-plugin-n": "^17.14.0", - "eslint-plugin-prettier": "^5.2.1", + "eslint-plugin-n": "^17.15.1", + "eslint-plugin-prettier": "^5.2.2", "eslint-plugin-simple-import-sort": "^12.1.1", "eslint-plugin-typescript-sort-keys": "^3.3.0", - "prettier": "^3.4.1", - "typescript": "^5.7.2" + "prettier": "^3.4.2", + "typescript": "^5.7.3" }, "engines": { "node": "18.* || >= 20" From c018ed164acf690724acc4882c54529fbcb9af25 Mon Sep 17 00:00:00 2001 From: ijlee2 Date: Wed, 15 Jan 2025 15:59:47 +0100 Subject: [PATCH 6/6] chore: Added changeset --- .changeset/small-shoes-beg.md | 5 +++++ 1 file changed, 5 insertions(+) create mode 100644 .changeset/small-shoes-beg.md diff --git a/.changeset/small-shoes-beg.md b/.changeset/small-shoes-beg.md new file mode 100644 index 00000000..c86c2ac7 --- /dev/null +++ b/.changeset/small-shoes-beg.md @@ -0,0 +1,5 @@ +--- +"@codemod-utils/cli": minor +--- + +Updated blueprints