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

Conversation

barlock
Copy link
Contributor

@barlock barlock commented Feb 20, 2020

Related Issue
Supports #42

Related PRs
This PR is not dependent on any other PR

What does this PR do?
Fixes the broken tsc compiler so we can release things.

Description of Changes

  1. Added a build stage so we catch this at merge time later
  2. Added references to project tsconfigs. Interestingly, you can't have references and paths play nicely together, so, well, you'll see.
  3. Boyscouting, added --report-unused-disable-directives to eslint and fixed the one error.

Inspiration and description in implementation: https://medium.com/@NiGhTTraX/how-to-set-up-a-typescript-monorepo-with-lerna-c6acda7d4559

Future implementation: microsoft/TypeScript#25376

What gif most accurately describes how I feel towards this PR?

@@ -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).

uses: bahmutov/npm-install@v1

- name: Run ESLint and TSC type check
run: yarn build
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Stop this from happening at merge time.

@@ -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.

},
"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

@@ -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.

🎉 ✨

@barlock barlock force-pushed the build-with-references branch from 0dc7c12 to 2271db5 Compare February 20, 2020 15:38
* converge on a single workflow with jobs
* ✨ add a github actions badge and link to the readme
@barlock barlock force-pushed the build-with-references branch from 2271db5 to 16140fb Compare February 20, 2020 15:42
tteltrab
tteltrab previously approved these changes Feb 20, 2020
Copy link
Collaborator

@tteltrab tteltrab left a comment

Choose a reason for hiding this comment

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

one small comment. lgtm otherwise

@@ -75,9 +95,6 @@ jobs:
- name: Install Packages
run: yarn install --frozen-lockfile

- name: Test
run: yarn test
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).

@@ -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?

"strict": true,
"preserveSymlinks": true,
"allowJs": true,
"noLib": false,
Copy link
Collaborator

Choose a reason for hiding this comment

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

@@ -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

tteltrab
tteltrab previously approved these changes Feb 20, 2020
Copy link
Collaborator

@tteltrab tteltrab left a comment

Choose a reason for hiding this comment

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

:shipit:

@tteltrab tteltrab merged commit 3a0b738 into master Feb 20, 2020
@tteltrab tteltrab deleted the build-with-references branch February 20, 2020 16:27
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants