Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

🔧 Update build process to use references #44

Merged
merged 3 commits into from
Feb 20, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
23 changes: 20 additions & 3 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,26 @@ jobs:

- uses: pre-commit/action@v1.0.1

build:
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

do we want this to happen on PR? I guess this way we know explicitly if a PR breaks our build, which I like.

if so, we'll need it to be a required check after merging

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:
Expand Down Expand Up @@ -75,9 +95,6 @@ jobs:
- name: Install Packages
run: yarn install --frozen-lockfile

- name: Test
run: yarn test
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Found that we missed this as this stage relies on it already.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yeah, I'm still iffy on trusting another machine with different installs potentially passed the build and using that as justification here that we're good. probably enough of an edge case to justify removing this (could use frozen-lockfile in master/push condition also, potentially).


- name: Authenticate with Registry
run: |
yarn logout
Expand Down
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -9,3 +9,4 @@ coverage/

# output for tsc compile
lib/
*.tsbuildinfo
6 changes: 4 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

surprised this isn't more obvious/a best practice. why haven't I been using this?

"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"
},
Expand Down
2 changes: 1 addition & 1 deletion packages/blocks/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
"directory": "packages/blocks"
},
"scripts": {
"tsc": "tsc -p ./tsconfig.build.json",
"tsc": "tsc -b ./tsconfig.build.json",
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

"test": "jest"
},
"author": "",
Expand Down
11 changes: 9 additions & 2 deletions packages/blocks/tsconfig.build.json
Original file line number Diff line number Diff line change
@@ -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": []
}
4 changes: 0 additions & 4 deletions packages/blocks/tsconfig.json
Original file line number Diff line number Diff line change
@@ -1,8 +1,4 @@
{
"extends": "../../tsconfig.json",
"compilerOptions": {
"rootDir": "./src",
"outDir": "./lib"
},
"include": ["./src"]
}
2 changes: 1 addition & 1 deletion packages/bolt-interactions/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down
15 changes: 13 additions & 2 deletions packages/bolt-interactions/tsconfig.build.json
Original file line number Diff line number Diff line change
@@ -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"
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Important to reference the .build here

}
]
}
4 changes: 0 additions & 4 deletions packages/bolt-interactions/tsconfig.json
Original file line number Diff line number Diff line change
@@ -1,8 +1,4 @@
{
"extends": "../../tsconfig.json",
"compilerOptions": {
"rootDir": "./src",
"outDir": "./lib"
},
"include": ["./src"]
}
2 changes: 1 addition & 1 deletion packages/bolt-storage-file/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down
11 changes: 9 additions & 2 deletions packages/bolt-storage-file/tsconfig.build.json
Original file line number Diff line number Diff line change
@@ -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": []
}
4 changes: 0 additions & 4 deletions packages/bolt-storage-file/tsconfig.json
Original file line number Diff line number Diff line change
@@ -1,8 +1,4 @@
{
"extends": "../../tsconfig.json",
"compilerOptions": {
"rootDir": "./src",
"outDir": "./lib"
},
"include": ["./src"]
}
2 changes: 1 addition & 1 deletion packages/fixtures/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down
2 changes: 0 additions & 2 deletions packages/fixtures/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🎉 ✨

export { events, fields, ServerlessTester };
11 changes: 9 additions & 2 deletions packages/fixtures/tsconfig.build.json
Original file line number Diff line number Diff line change
@@ -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": []
}
4 changes: 0 additions & 4 deletions packages/fixtures/tsconfig.json
Original file line number Diff line number Diff line change
@@ -1,8 +1,4 @@
{
"extends": "../../tsconfig.json",
"compilerOptions": {
"rootDir": "./src",
"outDir": "./lib"
},
"include": ["./src"]
}
2 changes: 1 addition & 1 deletion packages/jest-bolt-receiver/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down
18 changes: 16 additions & 2 deletions packages/jest-bolt-receiver/tsconfig.build.json
Original file line number Diff line number Diff line change
@@ -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"
}
]
}
4 changes: 0 additions & 4 deletions packages/jest-bolt-receiver/tsconfig.json
Original file line number Diff line number Diff line change
@@ -1,8 +1,4 @@
{
"extends": "../../tsconfig.json",
"compilerOptions": {
"rootDir": "./src",
"outDir": "./lib"
},
"include": ["./src"]
}
2 changes: 1 addition & 1 deletion packages/jest-mock-web-client/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down
11 changes: 9 additions & 2 deletions packages/jest-mock-web-client/tsconfig.build.json
Original file line number Diff line number Diff line change
@@ -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": []
}
4 changes: 0 additions & 4 deletions packages/jest-mock-web-client/tsconfig.json
Original file line number Diff line number Diff line change
@@ -1,8 +1,4 @@
{
"extends": "../../tsconfig.json",
"compilerOptions": {
"rootDir": "./src",
"outDir": "./lib"
},
"include": ["./src"]
}
2 changes: 1 addition & 1 deletion packages/koa-bolt/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down
11 changes: 9 additions & 2 deletions packages/koa-bolt/tsconfig.build.json
Original file line number Diff line number Diff line change
@@ -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": []
}
4 changes: 0 additions & 4 deletions packages/koa-bolt/tsconfig.json
Original file line number Diff line number Diff line change
@@ -1,8 +1,4 @@
{
"extends": "../../tsconfig.json",
"compilerOptions": {
"rootDir": "./src",
"outDir": "./lib"
},
"include": ["./src"]
}
6 changes: 4 additions & 2 deletions packages/slackctl/tsconfig.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
{
"extends": "../../tsconfig.json",
"compilerOptions": {
"rootDir": "src"
}
"rootDir": "src",
"composite": true
},
"references": []
}
18 changes: 18 additions & 0 deletions tsconfig.build.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
{
"compilerOptions": {
"declaration": true,
"module": "commonjs",
"esModuleInterop": true,
"allowSyntheticDefaultImports": true,
"moduleResolution": "node",
"noImplicitAny": true,
"strict": true,
"preserveSymlinks": true,
"allowJs": true,
"sourceMap": true,
"removeComments": true,
"emitDecoratorMetadata": true,
"experimentalDecorators": true
},
"exclude": ["node_modules", "**/coverage", "**/lib"]
}
18 changes: 2 additions & 16 deletions tsconfig.json
Original file line number Diff line number Diff line change
@@ -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"]
}
}