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

chore(scripts): Scripts Clean Up #26

Merged
merged 8 commits into from
May 9, 2018

Conversation

kwelch
Copy link
Contributor

@kwelch kwelch commented Apr 11, 2018

I have the starting point for the script clean up. As mentioned the jest-runner-tsc does not currently support reading the tsconfig.json file which is leading to errors when added.

I am going to put this here for initial review and look into how to update the new runner to take that file into account.

fixes #25

@kwelch
Copy link
Contributor Author

kwelch commented Apr 11, 2018

Locally the build is not working because bundlesize is failing. This may be related to @benmvp's comment on it being in build vs postbuild

Copy link
Contributor

@benmvp benmvp left a comment

Choose a reason for hiding this comment

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

Looks good but can't accept until we have a solution for Typescript. As of right now we're not checking TypeScript except maybe gen:declarations

@@ -10,7 +10,7 @@ cache: yarn
# Run the the validate script
# Temporarily also run the build script to make sure it works
# (will move this to the release step once that's implemented)
script: yarn run validate && yarn run build
script: yarn run validate --ci && yarn run build
Copy link
Contributor

Choose a reason for hiding this comment

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

now that you've reorganized this totally works! nice!

Copy link
Contributor Author

Choose a reason for hiding this comment

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

that and the fact that yarn passes flags through, made this part really simple.

@@ -36,12 +34,10 @@
"build": "npm-run-all build:targets gen:declarations",
"build:targets": "gulp build",
"prebuild:targets": "rm -rf dist && rm -rf lib",
"tsc": "tsc",
"postbuild": "bundlesize",
Copy link
Contributor

Choose a reason for hiding this comment

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

I think having it here as postbuild actually makes sense. Cuz it's not actually a "build" step, but something you wanna do afterwards 🎉

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I agree, but it was failing for me. I may have to review the docs on it to know how it works.

package.json Outdated
@@ -26,8 +26,6 @@
"homepage": "https://github.com/eventbrite/eventbrite-sdk-javascript#readme",
"license": "MIT",
"scripts": {
"check:size": "bundlesize",
"precheck:size": "yarn gulp build:dist:min",
"check:static": "npm-run-all --parallel lint tsc",
Copy link
Contributor

Choose a reason for hiding this comment

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

Is the plan to remove this once you get Typescript working in Jest? As of right now tsc no longer exists...

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Oh yes, that was my intent, I thought I removed it. I think I put it back since it was not in my checklist. 😄

@benmvp
Copy link
Contributor

benmvp commented Apr 24, 2018

Is this finished? For some reason I thought I was waiting on you to make a change...

@kwelch
Copy link
Contributor Author

kwelch commented Apr 24, 2018

Yes, we still need to crack the nut on typescript. jest-runner-tsc does not read the tsconfig which is causing this to throw errors. I have played with that package directly a bit to try and get it working, but I have not had enough time to make a dent in it. I want to peel it back to understand the runner better and possibly build it from scratch for education purposes.

@kwelch
Copy link
Contributor Author

kwelch commented Apr 24, 2018

I may be able to find a way break away the tsc update and the script clean up so this can land and backlog the tsc update. It would make them cleaner.

@kwelch
Copy link
Contributor Author

kwelch commented Apr 30, 2018

I just submitted this PR (azz/jest-runner-tsc#3) that will unblock this issue once accepted and released.

@kwelch kwelch force-pushed the scripts-clean-up branch from 0613a77 to 863a863 Compare May 7, 2018 13:51
@kwelch kwelch force-pushed the scripts-clean-up branch from 02d1bee to 863a863 Compare May 7, 2018 13:58
@kwelch
Copy link
Contributor Author

kwelch commented May 7, 2018

This should be all set. I did some clean up and made sure the tsc was separate. However, I think I remove all tsc (outside of build).

@benmvp
Copy link
Contributor

benmvp commented May 7, 2018

But now we're not running tsc at all right?

@kwelch
Copy link
Contributor Author

kwelch commented May 7, 2018

With these updates there is no check:static. tsc would be ran to build.

Should I add tsc to the start and validate?

@kwelch
Copy link
Contributor Author

kwelch commented May 8, 2018

The jest-runner-tsc has been updated with my changes 🎉!

@benmvp
Copy link
Contributor

benmvp commented May 8, 2018

Awesome! So type-checking will happen in start & validate since you added jest-tsc-config.js to jest projects. So we're good there. But much like you added lint script for just running linting I think we should still have tsc for just running typing. It may be useful on its own.

I kinda wanna rename tsc to something more generic like type-check or something... What do you think?

@kwelch
Copy link
Contributor Author

kwelch commented May 8, 2018

I completely agree with naming it based on the action and not the tech. I will push an update with that script.

Copy link
Contributor

@benmvp benmvp left a comment

Choose a reason for hiding this comment

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

The changes seem so minimal now, but it feels like it took so much effort!

@kwelch
Copy link
Contributor Author

kwelch commented May 8, 2018

Agreed, but I am ok with that. 😄

@rwholey-eb, Any objections?

@rwholey-eb rwholey-eb self-requested a review May 8, 2018 21:33
Copy link

@rwholey-eb rwholey-eb left a comment

Choose a reason for hiding this comment

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

this looks good to me! nice work dude!

@kwelch-eb
Copy link
Contributor

For merges, I assume we are following our internal pattern of merging our own after approval.

@kwelch-eb kwelch-eb merged commit f126268 into eventbrite:master May 9, 2018
@kwelch kwelch deleted the scripts-clean-up branch May 9, 2018 14:36
@ebtravis
Copy link
Collaborator

🎉 This PR is included in version 1.0.0 🎉

The release is available on:

Your semantic-release bot 📦🚀

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.

Scripts Review/Clean up
5 participants