From 16140fb5398507cde0bad3952a8e4897359f2b83 Mon Sep 17 00:00:00 2001 From: Nick Bartlett Date: Wed, 19 Feb 2020 15:05:24 -0500 Subject: [PATCH 1/3] =?UTF-8?q?=F0=9F=94=A7=20Update=20build=20process=20t?= =?UTF-8?q?o=20use=20references?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * converge on a single workflow with jobs * :sparkles: add a github actions badge and link to the readme --- .github/workflows/main.yml | 23 ++++++++++++++++--- .gitignore | 1 + package.json | 6 +++-- packages/blocks/package.json | 2 +- packages/blocks/tsconfig.build.json | 11 +++++++-- packages/blocks/tsconfig.json | 4 ---- packages/bolt-interactions/package.json | 2 +- .../bolt-interactions/tsconfig.build.json | 15 ++++++++++-- packages/bolt-interactions/tsconfig.json | 4 ---- packages/bolt-storage-file/package.json | 2 +- .../bolt-storage-file/tsconfig.build.json | 11 +++++++-- packages/bolt-storage-file/tsconfig.json | 4 ---- packages/fixtures/package.json | 2 +- packages/fixtures/src/index.ts | 2 -- packages/fixtures/tsconfig.build.json | 11 +++++++-- packages/fixtures/tsconfig.json | 4 ---- packages/jest-bolt-receiver/package.json | 2 +- .../jest-bolt-receiver/tsconfig.build.json | 18 +++++++++++++-- packages/jest-bolt-receiver/tsconfig.json | 4 ---- packages/jest-mock-web-client/package.json | 2 +- .../jest-mock-web-client/tsconfig.build.json | 11 +++++++-- packages/jest-mock-web-client/tsconfig.json | 4 ---- packages/koa-bolt/tsconfig.build.json | 11 +++++++-- packages/koa-bolt/tsconfig.json | 4 ---- packages/slackctl/tsconfig.json | 6 +++-- tsconfig.build.json | 19 +++++++++++++++ tsconfig.json | 18 ++------------- 27 files changed, 130 insertions(+), 73 deletions(-) create mode 100644 tsconfig.build.json diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 92c96e5..37ab4cc 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -23,6 +23,26 @@ jobs: - uses: pre-commit/action@v1.0.1 + build: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v2 + + - name: Read .nvmrc and pass it on + run: echo ::set-output name=NVMRC::$(cat .nvmrc) + id: nvm + + - name: Setup node w/ nvm version + uses: actions/setup-node@v1 + with: + node-version: '${{ steps.nvm.outputs.NVMRC }}' + + - name: yarn install w/ cache + uses: bahmutov/npm-install@v1 + + - name: Run tsc build + run: yarn build + lint: runs-on: ubuntu-latest steps: @@ -75,9 +95,6 @@ jobs: - name: Install Packages run: yarn install --frozen-lockfile - - name: Test - run: yarn test - - name: Authenticate with Registry run: | yarn logout diff --git a/.gitignore b/.gitignore index 69d4439..6a6b9db 100644 --- a/.gitignore +++ b/.gitignore @@ -9,3 +9,4 @@ coverage/ # output for tsc compile lib/ +*.tsbuildinfo diff --git a/package.json b/package.json index ae75977..da5c26b 100644 --- a/package.json +++ b/package.json @@ -4,11 +4,13 @@ "scripts": { "test": "yarn lint && yarn lerna run test", "lint": "yarn eslint && yarn type", - "eslint": "eslint . --ext .js,.ts --max-warnings 0", + "eslint": "eslint . --ext .js,.ts --max-warnings 0 --report-unused-disable-directives", "type": "tsc --noEmit", "fmt": "pre-commit run --all-files && yarn eslint --fix", "build": "lerna run tsc", - "cleanBuilds": "find ./packages -type d -name lib -prune -exec rm -rf {} \\;", + "cleanbuilds": "yarn cleanBuilds:out && yarn cleanBuilds:buildinfo", + "cleanBuilds:out": "find ./packages -type d -name lib -prune -exec rm -rf {} \\;", + "cleanBuilds:buildinfo": "find ./packages -type f -name tsconfig.build.tsbuildinfo -prune -exec rm {} \\;", "lerna:version": "lerna version --no-push", "lerna:publish": "lerna publish from-package" }, diff --git a/packages/blocks/package.json b/packages/blocks/package.json index 5be5ef2..a71cb68 100644 --- a/packages/blocks/package.json +++ b/packages/blocks/package.json @@ -9,7 +9,7 @@ "directory": "packages/blocks" }, "scripts": { - "tsc": "tsc -p ./tsconfig.build.json", + "tsc": "tsc -b ./tsconfig.build.json", "test": "jest" }, "author": "", diff --git a/packages/blocks/tsconfig.build.json b/packages/blocks/tsconfig.build.json index 75e7e30..9b84c4d 100644 --- a/packages/blocks/tsconfig.build.json +++ b/packages/blocks/tsconfig.build.json @@ -1,4 +1,11 @@ { - "extends": "./tsconfig.json", - "exclude": ["./**/*.spec.ts"] + "extends": "../../tsconfig.build.json", + "include": ["./src"], + "exclude": ["./**/*.spec.ts"], + "compilerOptions": { + "rootDir": "./src", + "outDir": "./lib", + "composite": true + }, + "references": [] } diff --git a/packages/blocks/tsconfig.json b/packages/blocks/tsconfig.json index 8e029ab..7513033 100644 --- a/packages/blocks/tsconfig.json +++ b/packages/blocks/tsconfig.json @@ -1,8 +1,4 @@ { "extends": "../../tsconfig.json", - "compilerOptions": { - "rootDir": "./src", - "outDir": "./lib" - }, "include": ["./src"] } diff --git a/packages/bolt-interactions/package.json b/packages/bolt-interactions/package.json index 362889e..5c6732c 100644 --- a/packages/bolt-interactions/package.json +++ b/packages/bolt-interactions/package.json @@ -4,7 +4,7 @@ "description": "Easily create interaction patterns in bolt.", "main": "lib/index.js", "scripts": { - "tsc": "tsc -p ./tsconfig.build.json", + "tsc": "tsc -b ./tsconfig.build.json", "test": "NODE_ENV=test yarn jest" }, "license": "Apache-2.0", diff --git a/packages/bolt-interactions/tsconfig.build.json b/packages/bolt-interactions/tsconfig.build.json index 75e7e30..bd7dce0 100644 --- a/packages/bolt-interactions/tsconfig.build.json +++ b/packages/bolt-interactions/tsconfig.build.json @@ -1,4 +1,15 @@ { - "extends": "./tsconfig.json", - "exclude": ["./**/*.spec.ts"] + "extends": "../../tsconfig.build.json", + "include": ["./src"], + "exclude": ["./**/*.spec.ts"], + "compilerOptions": { + "rootDir": "./src", + "outDir": "./lib", + "composite": true + }, + "references": [ + { + "path": "../jest-mock-web-client/tsconfig.build.json" + } + ] } diff --git a/packages/bolt-interactions/tsconfig.json b/packages/bolt-interactions/tsconfig.json index 8e029ab..7513033 100644 --- a/packages/bolt-interactions/tsconfig.json +++ b/packages/bolt-interactions/tsconfig.json @@ -1,8 +1,4 @@ { "extends": "../../tsconfig.json", - "compilerOptions": { - "rootDir": "./src", - "outDir": "./lib" - }, "include": ["./src"] } diff --git a/packages/bolt-storage-file/package.json b/packages/bolt-storage-file/package.json index 6cff21a..839fc66 100644 --- a/packages/bolt-storage-file/package.json +++ b/packages/bolt-storage-file/package.json @@ -9,7 +9,7 @@ "directory": "packages/bolt-storage-file" }, "scripts": { - "tsc": "tsc -p ./tsconfig.build.json", + "tsc": "tsc -b ./tsconfig.build.json", "test": "NODE_ENV=test yarn jest" }, "license": "Apache-2.0", diff --git a/packages/bolt-storage-file/tsconfig.build.json b/packages/bolt-storage-file/tsconfig.build.json index 75e7e30..9b84c4d 100644 --- a/packages/bolt-storage-file/tsconfig.build.json +++ b/packages/bolt-storage-file/tsconfig.build.json @@ -1,4 +1,11 @@ { - "extends": "./tsconfig.json", - "exclude": ["./**/*.spec.ts"] + "extends": "../../tsconfig.build.json", + "include": ["./src"], + "exclude": ["./**/*.spec.ts"], + "compilerOptions": { + "rootDir": "./src", + "outDir": "./lib", + "composite": true + }, + "references": [] } diff --git a/packages/bolt-storage-file/tsconfig.json b/packages/bolt-storage-file/tsconfig.json index 8e029ab..7513033 100644 --- a/packages/bolt-storage-file/tsconfig.json +++ b/packages/bolt-storage-file/tsconfig.json @@ -1,8 +1,4 @@ { "extends": "../../tsconfig.json", - "compilerOptions": { - "rootDir": "./src", - "outDir": "./lib" - }, "include": ["./src"] } diff --git a/packages/fixtures/package.json b/packages/fixtures/package.json index 8c0b387..f257e30 100644 --- a/packages/fixtures/package.json +++ b/packages/fixtures/package.json @@ -9,7 +9,7 @@ "directory": "packages/fixtures" }, "scripts": { - "tsc": "tsc -p ./tsconfig.build.json", + "tsc": "tsc -b ./tsconfig.build.json", "test": "jest" }, "license": "Apache-2.0", diff --git a/packages/fixtures/src/index.ts b/packages/fixtures/src/index.ts index 8ee3034..22f04e1 100644 --- a/packages/fixtures/src/index.ts +++ b/packages/fixtures/src/index.ts @@ -2,6 +2,4 @@ import * as events from './events'; import fields from './fields'; import ServerlessTester from './serverless-tester'; -// Plans to add more fixtures like `web` for responses -// eslint-disable-next-line import/prefer-default-export export { events, fields, ServerlessTester }; diff --git a/packages/fixtures/tsconfig.build.json b/packages/fixtures/tsconfig.build.json index 75e7e30..9b84c4d 100644 --- a/packages/fixtures/tsconfig.build.json +++ b/packages/fixtures/tsconfig.build.json @@ -1,4 +1,11 @@ { - "extends": "./tsconfig.json", - "exclude": ["./**/*.spec.ts"] + "extends": "../../tsconfig.build.json", + "include": ["./src"], + "exclude": ["./**/*.spec.ts"], + "compilerOptions": { + "rootDir": "./src", + "outDir": "./lib", + "composite": true + }, + "references": [] } diff --git a/packages/fixtures/tsconfig.json b/packages/fixtures/tsconfig.json index 8e029ab..7513033 100644 --- a/packages/fixtures/tsconfig.json +++ b/packages/fixtures/tsconfig.json @@ -1,8 +1,4 @@ { "extends": "../../tsconfig.json", - "compilerOptions": { - "rootDir": "./src", - "outDir": "./lib" - }, "include": ["./src"] } diff --git a/packages/jest-bolt-receiver/package.json b/packages/jest-bolt-receiver/package.json index 7ce242b..f321578 100644 --- a/packages/jest-bolt-receiver/package.json +++ b/packages/jest-bolt-receiver/package.json @@ -9,7 +9,7 @@ "directory": "packages/jest-bolt-receiver" }, "scripts": { - "tsc": "tsc -p ./tsconfig.build.json", + "tsc": "tsc -b ./tsconfig.build.json", "test": "jest" }, "license": "Apache-2.0", diff --git a/packages/jest-bolt-receiver/tsconfig.build.json b/packages/jest-bolt-receiver/tsconfig.build.json index 75e7e30..92c4d1a 100644 --- a/packages/jest-bolt-receiver/tsconfig.build.json +++ b/packages/jest-bolt-receiver/tsconfig.build.json @@ -1,4 +1,18 @@ { - "extends": "./tsconfig.json", - "exclude": ["./**/*.spec.ts"] + "extends": "../../tsconfig.build.json", + "include": ["./src"], + "exclude": ["./**/*.spec.ts"], + "compilerOptions": { + "rootDir": "./src", + "outDir": "./lib", + "composite": true + }, + "references": [ + { + "path": "../jest-mock-web-client/tsconfig.build.json" + }, + { + "path": "../fixtures/tsconfig.build.json" + } + ] } diff --git a/packages/jest-bolt-receiver/tsconfig.json b/packages/jest-bolt-receiver/tsconfig.json index 8e029ab..7513033 100644 --- a/packages/jest-bolt-receiver/tsconfig.json +++ b/packages/jest-bolt-receiver/tsconfig.json @@ -1,8 +1,4 @@ { "extends": "../../tsconfig.json", - "compilerOptions": { - "rootDir": "./src", - "outDir": "./lib" - }, "include": ["./src"] } diff --git a/packages/jest-mock-web-client/package.json b/packages/jest-mock-web-client/package.json index 7715e7f..c986f3f 100644 --- a/packages/jest-mock-web-client/package.json +++ b/packages/jest-mock-web-client/package.json @@ -9,7 +9,7 @@ "directory": "packages/jest-mock-web-client" }, "scripts": { - "tsc": "tsc -p ./tsconfig.build.json", + "tsc": "tsc -b ./tsconfig.build.json", "test": "jest" }, "license": "Apache-2.0", diff --git a/packages/jest-mock-web-client/tsconfig.build.json b/packages/jest-mock-web-client/tsconfig.build.json index 75e7e30..9b84c4d 100644 --- a/packages/jest-mock-web-client/tsconfig.build.json +++ b/packages/jest-mock-web-client/tsconfig.build.json @@ -1,4 +1,11 @@ { - "extends": "./tsconfig.json", - "exclude": ["./**/*.spec.ts"] + "extends": "../../tsconfig.build.json", + "include": ["./src"], + "exclude": ["./**/*.spec.ts"], + "compilerOptions": { + "rootDir": "./src", + "outDir": "./lib", + "composite": true + }, + "references": [] } diff --git a/packages/jest-mock-web-client/tsconfig.json b/packages/jest-mock-web-client/tsconfig.json index 8e029ab..7513033 100644 --- a/packages/jest-mock-web-client/tsconfig.json +++ b/packages/jest-mock-web-client/tsconfig.json @@ -1,8 +1,4 @@ { "extends": "../../tsconfig.json", - "compilerOptions": { - "rootDir": "./src", - "outDir": "./lib" - }, "include": ["./src"] } diff --git a/packages/koa-bolt/tsconfig.build.json b/packages/koa-bolt/tsconfig.build.json index 75e7e30..9b84c4d 100644 --- a/packages/koa-bolt/tsconfig.build.json +++ b/packages/koa-bolt/tsconfig.build.json @@ -1,4 +1,11 @@ { - "extends": "./tsconfig.json", - "exclude": ["./**/*.spec.ts"] + "extends": "../../tsconfig.build.json", + "include": ["./src"], + "exclude": ["./**/*.spec.ts"], + "compilerOptions": { + "rootDir": "./src", + "outDir": "./lib", + "composite": true + }, + "references": [] } diff --git a/packages/koa-bolt/tsconfig.json b/packages/koa-bolt/tsconfig.json index 8e029ab..7513033 100644 --- a/packages/koa-bolt/tsconfig.json +++ b/packages/koa-bolt/tsconfig.json @@ -1,8 +1,4 @@ { "extends": "../../tsconfig.json", - "compilerOptions": { - "rootDir": "./src", - "outDir": "./lib" - }, "include": ["./src"] } diff --git a/packages/slackctl/tsconfig.json b/packages/slackctl/tsconfig.json index 3176325..bbf1f15 100644 --- a/packages/slackctl/tsconfig.json +++ b/packages/slackctl/tsconfig.json @@ -1,6 +1,8 @@ { "extends": "../../tsconfig.json", "compilerOptions": { - "rootDir": "src" - } + "rootDir": "src", + "composite": true + }, + "references": [] } diff --git a/tsconfig.build.json b/tsconfig.build.json new file mode 100644 index 0000000..80ae143 --- /dev/null +++ b/tsconfig.build.json @@ -0,0 +1,19 @@ +{ + "compilerOptions": { + "declaration": true, + "module": "commonjs", + "esModuleInterop": true, + "allowSyntheticDefaultImports": true, + "moduleResolution": "node", + "noImplicitAny": true, + "strict": true, + "preserveSymlinks": true, + "allowJs": true, + "noLib": false, + "sourceMap": true, + "removeComments": true, + "emitDecoratorMetadata": true, + "experimentalDecorators": true + }, + "exclude": ["node_modules", "**/coverage", "**/lib"] +} diff --git a/tsconfig.json b/tsconfig.json index 6d8a0c7..68a5059 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -1,23 +1,9 @@ { + "extends": "./tsconfig.build.json", "compilerOptions": { "baseUrl": ".", - "declaration": true, - "module": "commonjs", - "esModuleInterop": true, - "allowSyntheticDefaultImports": true, - "moduleResolution": "node", - "noImplicitAny": true, - "strict": true, - "preserveSymlinks": true, - "allowJs": true, - "noLib": false, - "sourceMap": true, - "removeComments": true, - "emitDecoratorMetadata": true, - "experimentalDecorators": true, "paths": { "@slack-wrench/*": ["packages/*/src"] } - }, - "exclude": ["node_modules", "**/coverage", "**/lib"] + } } From 9d73575197984d24c5b51ad00dac6448203fed75 Mon Sep 17 00:00:00 2001 From: Nick Bartlett Date: Thu, 20 Feb 2020 11:16:40 -0500 Subject: [PATCH 2/3] remove unnecessary rule --- tsconfig.build.json | 1 - 1 file changed, 1 deletion(-) diff --git a/tsconfig.build.json b/tsconfig.build.json index 80ae143..ac7304a 100644 --- a/tsconfig.build.json +++ b/tsconfig.build.json @@ -9,7 +9,6 @@ "strict": true, "preserveSymlinks": true, "allowJs": true, - "noLib": false, "sourceMap": true, "removeComments": true, "emitDecoratorMetadata": true, From 46d7bc21e4da624a774567e46d63f8e6630b6916 Mon Sep 17 00:00:00 2001 From: Nick Bartlett Date: Thu, 20 Feb 2020 11:22:51 -0500 Subject: [PATCH 3/3] -p -> -b for koa-bolt --- packages/koa-bolt/package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/koa-bolt/package.json b/packages/koa-bolt/package.json index 9b4d394..15ce33c 100644 --- a/packages/koa-bolt/package.json +++ b/packages/koa-bolt/package.json @@ -9,7 +9,7 @@ "directory": "packages/bolt-koa" }, "scripts": { - "tsc": "tsc -p ./tsconfig.build.json", + "tsc": "tsc -b ./tsconfig.build.json", "test": "NODE_ENV=test yarn jest" }, "license": "Apache-2.0",