From cc702cd7e83f98fe46cb5393afbac2fda553d55f Mon Sep 17 00:00:00 2001 From: Sam Rose <11774595+sam-b-rose@users.noreply.github.com> Date: Thu, 18 Jan 2024 06:58:05 +1100 Subject: [PATCH] Remove preversion workaround for Changesets (#11449) Removes the `preversion` scripts that allowed us to call the `preversion` npm script hook before creating a new release with `@changesets/cli`. --- package.json | 4 +--- scripts/preversion.js | 24 ------------------------ turbo.json | 18 ++++++++++++------ 3 files changed, 13 insertions(+), 33 deletions(-) delete mode 100644 scripts/preversion.js diff --git a/package.json b/package.json index 4b35315f6c7..b2f86925351 100644 --- a/package.json +++ b/package.json @@ -35,10 +35,8 @@ "type-check": "tsc --build", "changeset": "changeset", "gen-assets": "turbo run gen-assets --filter=polaris.shopify.com", - "preversion-packages": "node scripts/preversion.js", - "version-packages": "yarn preversion-packages && changeset version", + "version-packages": "changeset version", "release": "turbo run build --filter='!polaris.shopify.com' && changeset publish", - "preversion": "echo \"Error: use @changsets/cli to version packages\" && exit 1", "new-migration": "yarn workspace @shopify/polaris-migrator generate", "postinstall": "patch-package" }, diff --git a/scripts/preversion.js b/scripts/preversion.js deleted file mode 100644 index ef3bec876b8..00000000000 --- a/scripts/preversion.js +++ /dev/null @@ -1,24 +0,0 @@ -const {execSync} = require('child_process'); - -const getReleasePlan = require('@changesets/get-release-plan').default; - -const run = async () => { - const {releases} = await getReleasePlan(process.cwd()); - const packages = releases.map((release) => release.name); - - const execOpts = {stdio: 'inherit'}; - execSync( - `yarn turbo run preversion ${packages - .map((pkg) => `--filter=${pkg}`) - .join(' ')}`, - execOpts, - ); -}; - -try { - run(); -} catch (err) { - // eslint-disable-next-line no-console - console.error(err); - process.exit(1); -} diff --git a/turbo.json b/turbo.json index 6b452749cc7..e3fe109ea7c 100644 --- a/turbo.json +++ b/turbo.json @@ -3,15 +3,24 @@ "baseBranch": "origin/main", "pipeline": { "build": { - "outputs": ["dist/**", ".next/**", "build/**", ".cache/**"], - "dependsOn": ["^build"] + "outputs": [ + "dist/**", + ".next/**", + "build/**", + ".cache/**" + ], + "dependsOn": [ + "^build" + ] }, "test": { "outputs": [], "dependsOn": [] }, "lint": { - "outputs": [".eslintcache"] + "outputs": [ + ".eslintcache" + ] }, "dev": { "cache": false @@ -19,9 +28,6 @@ "clean": { "cache": false }, - "preversion": { - "cache": false - }, "gen-assets": { "cache": false }