From c3c2f8519c0de1b164074e87e68e77ad1af0d702 Mon Sep 17 00:00:00 2001 From: javieri-empathy <68222542+javieri-empathy@users.noreply.github.com> Date: Fri, 16 Jul 2021 08:33:56 +0200 Subject: [PATCH] ci: Fix publishing in x-components. Normalize build scripts. (#46) EX-4413 --- .github/workflows/build.yml | 2 -- .github/workflows/prepare-release.yml | 2 -- .github/workflows/publish-release.yml | 2 -- .github/workflows/release-alpha.yml | 2 -- package.json | 2 +- packages/deep-merge/package.json | 5 +++-- packages/get-safe-property-chain/package.json | 3 +++ packages/jest-utils/package.json | 8 +++++--- packages/logger/package.json | 3 +++ packages/search-adapter/package.json | 5 ++++- packages/search-types/package.json | 7 +++++-- packages/storage-service/package.json | 5 ++++- packages/x-components/package.json | 5 ++++- 13 files changed, 32 insertions(+), 19 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 1aae53e1b4..a923348f8e 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -10,8 +10,6 @@ jobs: token: ${{ secrets.SUPPORT_TOKEN }} - name: Install lerna and all packages run: npm ci - - name: Build all packages - run: npm run build - name: Run linter in all packages run: npm run lint - name: Run tests in all packages diff --git a/.github/workflows/prepare-release.yml b/.github/workflows/prepare-release.yml index d1d4662022..01e056a19c 100644 --- a/.github/workflows/prepare-release.yml +++ b/.github/workflows/prepare-release.yml @@ -11,8 +11,6 @@ jobs: fetch-depth: 0 - name: Install lerna and all packages run: npm ci - - name: Build all packages - run: npm run build - name: Run linter in all packages run: npm run lint - name: Run tests in all packages diff --git a/.github/workflows/publish-release.yml b/.github/workflows/publish-release.yml index 697e04e52e..2bb0e286a6 100644 --- a/.github/workflows/publish-release.yml +++ b/.github/workflows/publish-release.yml @@ -15,8 +15,6 @@ jobs: fetch-depth: 0 - name: Install lerna and all packages run: npm ci - - name: Build all packages - run: npm run build - name: Run linter in all packages run: npm run lint - name: Run tests in all packages diff --git a/.github/workflows/release-alpha.yml b/.github/workflows/release-alpha.yml index edcbe5a1e0..f509e35d1b 100644 --- a/.github/workflows/release-alpha.yml +++ b/.github/workflows/release-alpha.yml @@ -11,8 +11,6 @@ jobs: token: ${{ secrets.SUPPORT_TOKEN }} - name: Install lerna and all packages run: npm ci - - name: Build all packages - run: npm run build - name: Run linter in all packages run: npm run lint - name: Run tests in all packages diff --git a/package.json b/package.json index 05011a3c39..f342ecf0f7 100644 --- a/package.json +++ b/package.json @@ -7,7 +7,7 @@ "lint": "lerna run lint", "test": "lerna run test", "prepare-release:stable": "lerna version --conventional-commits --conventional-graduate --no-git-tag-version --yes", - "release:alpha": "lerna publish --conventional-commits --conventional-prerelease --yes", + "release:alpha": "lerna publish --conventional-commits --conventional-prerelease --yes --no-push", "publish-release": "node scripts/publish-release" }, "devDependencies": { diff --git a/packages/deep-merge/package.json b/packages/deep-merge/package.json index 80acfe11bd..1b7a50b4fe 100644 --- a/packages/deep-merge/package.json +++ b/packages/deep-merge/package.json @@ -29,12 +29,13 @@ }, "scripts": { "build": "tsc && tsc --project tsconfig.esm.json", - "build:local": "webpack --mode production && npm pack", "clean": "rimraf dist && rimraf coverage", "format": "prettier --write \"src/**/*.ts\"", "lint": "eslint src", + "postbuild": "npm pack", + "postinstall": "npm run build", "prepublishOnly": "npm run build", - "prebuild": "npm run clean && npm run lint && echo Using TypeScript && tsc --version", + "prebuild": "npm run clean", "test": "jest" }, "dependencies": { diff --git a/packages/get-safe-property-chain/package.json b/packages/get-safe-property-chain/package.json index a3015c4723..3e0ccfbad4 100644 --- a/packages/get-safe-property-chain/package.json +++ b/packages/get-safe-property-chain/package.json @@ -24,6 +24,9 @@ "build": "tsc && tsc --project tsconfig.esm.json", "build:watch": "tsc --watch", "lint": "eslint src", + "postbuild": "npm pack", + "postinstall": "npm run build", + "prepublishOnly": "npm run build", "test": "jest", "test:watch": "jest --watch", "test:coverage": "jest --coverage" diff --git a/packages/jest-utils/package.json b/packages/jest-utils/package.json index 1a51c24013..6d0c6bff6d 100644 --- a/packages/jest-utils/package.json +++ b/packages/jest-utils/package.json @@ -20,9 +20,11 @@ "directory": "packages/jest-utils" }, "scripts": { - "build": "npm pack", - "prebuild": "tsc", - "build:watch": "tsc --watch" + "build": "tsc", + "build:watch": "tsc --watch", + "postbuild": "npm pack", + "postinstall": "npm run build", + "prepublishOnly": "npm run build" }, "devDependencies": { "@types/jest": "^24.0.12 <= 24.0.13", diff --git a/packages/logger/package.json b/packages/logger/package.json index 452dbecbe0..0a88c20854 100644 --- a/packages/logger/package.json +++ b/packages/logger/package.json @@ -26,6 +26,9 @@ "build": "tsc && tsc --project tsconfig.esm.json", "build:watch": "tsc --watch", "lint": "eslint src", + "postbuild": "npm pack", + "postinstall": "npm run build", + "prepublishOnly": "npm run build", "test": "jest" }, "dependencies": { diff --git a/packages/search-adapter/package.json b/packages/search-adapter/package.json index b28235ebfd..dddd25228c 100644 --- a/packages/search-adapter/package.json +++ b/packages/search-adapter/package.json @@ -28,11 +28,14 @@ "node": ">=6.0.0" }, "scripts": { - "build": "tsc --project tsconfig.cjs.json && tsc --project tsconfig.esm.json && npm run gen:docs && npm pack", + "build": "tsc --project tsconfig.cjs.json && tsc --project tsconfig.esm.json && npm run gen:docs", "build:watch": "tsc --watch", "gen:model-docs": "api-extractor run -l", "gen:typescript-docs": "api-documenter markdown -i report -o docs", "gen:docs": "npm run gen:model-docs && npm run gen:typescript-docs", + "postbuild": "npm pack", + "postinstall": "npm run build", + "prepublishOnly": "npm run build", "test": "jest", "test:watch": "jest --watch", "test:coverage": "jest --coverage" diff --git a/packages/search-types/package.json b/packages/search-types/package.json index 7665436c20..313a328ffc 100644 --- a/packages/search-types/package.json +++ b/packages/search-types/package.json @@ -28,11 +28,14 @@ "node": ">=6.0.0" }, "scripts": { - "build": "rollup -c && npm run gen:docs && npm pack", + "build": "rollup -c && npm run gen:docs", "build:watch": "rollup -c -w", "gen:model-docs": "api-extractor run -c search-types-extractor.json -l && api-extractor run -c schema-extractor.json -l && api-extractor run -l", "gen:typescript-docs": "api-documenter markdown -i report -o docs", - "gen:docs": "npm run gen:model-docs && npm run gen:typescript-docs" + "gen:docs": "npm run gen:model-docs && npm run gen:typescript-docs", + "postbuild": "npm pack", + "postinstall": "npm run build", + "prepublishOnly": "npm run build" }, "dependencies": { "tslib": "~1.11.1" diff --git a/packages/storage-service/package.json b/packages/storage-service/package.json index b28f98978e..d5245eb363 100644 --- a/packages/storage-service/package.json +++ b/packages/storage-service/package.json @@ -31,7 +31,10 @@ "lint": "eslint src", "test": "jest", "test:watch": "jest --watch", - "test:coverage": "jest --coverage" + "test:coverage": "jest --coverage", + "postbuild": "npm pack", + "postinstall": "npm run build", + "prepublishOnly": "npm run build" }, "dependencies": { "@empathyco/x-logger": "^1.1.2-alpha.1", diff --git a/packages/x-components/package.json b/packages/x-components/package.json index 7ce8bd8194..d12a12c9d7 100644 --- a/packages/x-components/package.json +++ b/packages/x-components/package.json @@ -39,11 +39,14 @@ }, "scripts": { "serve": "vue-cli-service serve --skip-plugins eslint", - "build": "ts-node --project ./build/tsconfig.json ./build/build.ts && npm pack ./dist", + "build": "ts-node --project ./build/tsconfig.json ./build/build.ts", "build:website": "vue-cli-service build", "gen:docs": "rimraf ./docs && npm run gen:typescript-docs && npm run gen:component-docs", "gen:typescript-docs": "api-documenter markdown --input-folder dist/report --output-folder docs/API-reference/api", "gen:component-docs": "vue-docgen", + "postbuild": "npm pack ./dist", + "postinstall": "npm run build", + "prepublishOnly": "npm run build", "test:unit": "npm run test:unit-jest && npm run test:unit-cypress", "test:unit-jest": "vue-cli-service test:unit", "test:unit-cypress": "cypress run-ct",