From bcf37a9a982a57e33dc3019c2ff80d6823ccfc11 Mon Sep 17 00:00:00 2001 From: Boaz Poolman Date: Tue, 12 Dec 2023 19:01:40 +0100 Subject: [PATCH 1/3] chore: add main build:release command --- package.json | 1 + turbo.json | 3 +++ 2 files changed, 4 insertions(+) diff --git a/package.json b/package.json index e1384a0f..930681e7 100644 --- a/package.json +++ b/package.json @@ -7,6 +7,7 @@ ], "scripts": { "build": "turbo run build", + "build:release": "turbo run build:release", "develop": "turbo run develop", "eslint": "turbo run eslint", "eslint:fix": "turbo run eslint:fix", diff --git a/turbo.json b/turbo.json index 197c31fb..249ae624 100644 --- a/turbo.json +++ b/turbo.json @@ -5,6 +5,9 @@ "build": { "dependsOn": ["^build"] }, + "build:release": { + "dependsOn": ["^build:release"] + }, "eslint": { "outputs": [] }, From b98c5385fa1bdfc6285374f826310ba3caec0d6d Mon Sep 17 00:00:00 2001 From: Boaz Poolman Date: Wed, 13 Dec 2023 17:20:59 +0100 Subject: [PATCH 2/3] chore: set publishing directory to the package root --- packages/addons/menus/.npmignore | 6 ++++++ packages/addons/menus/package.json | 1 + packages/addons/redirects/.npmignore | 6 ++++++ packages/addons/redirects/package.json | 1 + packages/addons/sitemap/.npmignore | 6 ++++++ packages/addons/sitemap/package.json | 1 + packages/core/.npmignore | 6 ++++++ packages/core/package.json | 1 + packages/helper-plugin/.npmignore | 6 ++++++ packages/helper-plugin/package.json | 1 + 10 files changed, 35 insertions(+) create mode 100644 packages/addons/menus/.npmignore create mode 100644 packages/addons/redirects/.npmignore create mode 100644 packages/addons/sitemap/.npmignore create mode 100644 packages/core/.npmignore create mode 100644 packages/helper-plugin/.npmignore diff --git a/packages/addons/menus/.npmignore b/packages/addons/menus/.npmignore new file mode 100644 index 00000000..572309c0 --- /dev/null +++ b/packages/addons/menus/.npmignore @@ -0,0 +1,6 @@ +# ignore the .ts and .tsx files +*.ts +*.tsx + +# include the .d.ts files +!*.d.ts diff --git a/packages/addons/menus/package.json b/packages/addons/menus/package.json index 56c66071..0b431225 100644 --- a/packages/addons/menus/package.json +++ b/packages/addons/menus/package.json @@ -15,6 +15,7 @@ "scripts": { "build": "tsc", "build:release": "tsc --outDir build", + "prepublishOnly": "cp -r ./build/* . && rm -rf ./build", "develop": "tsc -w", "eslint": "../../../node_modules/.bin/eslint --max-warnings=0 './**/*.{js,jsx,ts,tsx}'", "eslint:fix": "../../../node_modules/.bin/eslint --fix './**/*.{js,jsx,ts,tsx}'" diff --git a/packages/addons/redirects/.npmignore b/packages/addons/redirects/.npmignore new file mode 100644 index 00000000..572309c0 --- /dev/null +++ b/packages/addons/redirects/.npmignore @@ -0,0 +1,6 @@ +# ignore the .ts and .tsx files +*.ts +*.tsx + +# include the .d.ts files +!*.d.ts diff --git a/packages/addons/redirects/package.json b/packages/addons/redirects/package.json index e472dd21..2ec657d7 100644 --- a/packages/addons/redirects/package.json +++ b/packages/addons/redirects/package.json @@ -15,6 +15,7 @@ "scripts": { "build": "tsc", "build:release": "tsc --outDir build", + "prepublishOnly": "cp -r ./build/* . && rm -rf ./build", "develop": "tsc -w", "eslint": "../../../node_modules/.bin/eslint --max-warnings=0 './**/*.{js,jsx,ts,tsx}'", "eslint:fix": "../../../node_modules/.bin/eslint --fix './**/*.{js,jsx,ts,tsx}'" diff --git a/packages/addons/sitemap/.npmignore b/packages/addons/sitemap/.npmignore new file mode 100644 index 00000000..572309c0 --- /dev/null +++ b/packages/addons/sitemap/.npmignore @@ -0,0 +1,6 @@ +# ignore the .ts and .tsx files +*.ts +*.tsx + +# include the .d.ts files +!*.d.ts diff --git a/packages/addons/sitemap/package.json b/packages/addons/sitemap/package.json index f7576ebe..b8c615fb 100644 --- a/packages/addons/sitemap/package.json +++ b/packages/addons/sitemap/package.json @@ -15,6 +15,7 @@ "scripts": { "build": "tsc", "build:release": "tsc --outDir build", + "prepublishOnly": "cp -r ./build/* . && rm -rf ./build", "develop": "yarn develop:copy-files && tsc -w", "develop:copy-files": "copyfiles -u 1 xsl/**/* ../../../playground/src/plugins/webtools-addon-sitemap/xsl/", "eslint": "../../../node_modules/.bin/eslint --max-warnings=0 './**/*.{js,jsx,ts,tsx}'", diff --git a/packages/core/.npmignore b/packages/core/.npmignore new file mode 100644 index 00000000..572309c0 --- /dev/null +++ b/packages/core/.npmignore @@ -0,0 +1,6 @@ +# ignore the .ts and .tsx files +*.ts +*.tsx + +# include the .d.ts files +!*.d.ts diff --git a/packages/core/package.json b/packages/core/package.json index 8f78b745..b0db15ed 100644 --- a/packages/core/package.json +++ b/packages/core/package.json @@ -13,6 +13,7 @@ "scripts": { "build": "tsc", "build:release": "tsc --outDir build", + "prepublishOnly": "cp -r ./build/* . && rm -rf ./build", "develop": "tsc -w", "eslint": "../../node_modules/.bin/eslint --max-warnings=0 './**/*.{js,jsx,ts,tsx}'", "eslint:fix": "../../node_modules/.bin/eslint --fix './**/*.{js,jsx,ts,tsx}'" diff --git a/packages/helper-plugin/.npmignore b/packages/helper-plugin/.npmignore new file mode 100644 index 00000000..572309c0 --- /dev/null +++ b/packages/helper-plugin/.npmignore @@ -0,0 +1,6 @@ +# ignore the .ts and .tsx files +*.ts +*.tsx + +# include the .d.ts files +!*.d.ts diff --git a/packages/helper-plugin/package.json b/packages/helper-plugin/package.json index f4a0eb83..02158ebe 100644 --- a/packages/helper-plugin/package.json +++ b/packages/helper-plugin/package.json @@ -15,6 +15,7 @@ "main": "src/index.js", "scripts": { "build": "tsc --outDir build", + "prepublishOnly": "cp -r ./build/* . && rm -rf ./build", "develop": "tsc -w", "eslint": "../../node_modules/.bin/eslint --max-warnings=0 './**/*.{js,jsx,ts,tsx}'", "eslint:fix": "../../node_modules/.bin/eslint --fix './**/*.{js,jsx,ts,tsx}'" From bb2d1b987d382b0e456a17acfa51d4642b0254dd Mon Sep 17 00:00:00 2001 From: Boaz Poolman Date: Wed, 13 Dec 2023 17:33:22 +0100 Subject: [PATCH 3/3] chore: setup github actions to publish changesets --- .github/workflows/release.yml | 6 +++++- package.json | 2 +- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 557cd339..b3e85e56 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -3,7 +3,7 @@ name: Release on: push: branches: - - monorepo + - master concurrency: ${{ github.workflow }}-${{ github.ref }} @@ -25,5 +25,9 @@ jobs: - name: Create Release Pull Request uses: changesets/action@v1 + with: + # This expects you to have a script called release which does a build for your packages and calls changeset publish + publish: yarn release env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + NPM_TOKEN: ${{ secrets.NPM_TOKEN }} diff --git a/package.json b/package.json index 930681e7..6038121c 100644 --- a/package.json +++ b/package.json @@ -7,10 +7,10 @@ ], "scripts": { "build": "turbo run build", - "build:release": "turbo run build:release", "develop": "turbo run develop", "eslint": "turbo run eslint", "eslint:fix": "turbo run eslint:fix", + "release": "turbo run build:release && changeset publish", "playground:install": "cd playground && yarn install", "playground:build": "cd playground && yarn build", "playground:start": "cd playground && yarn start",