-
Notifications
You must be signed in to change notification settings - Fork 28
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
fix: workspace script sharing #86
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for the nice PR description.
Things look close:
- I think we can get rid of
build:examples
? - I would like to keep the template as simple and as close to a conventional typescript project as as possible. I expect people to basically copy and paste the directory, so ideally it relies as minimally as possible on workspace specific things.
Question: what is the use case for building just package at a time? Seems like it could maybe get the inter-workspace deps confused?
Co-authored-by: Zeke Mostov <32168567+emostov@users.noreply.github.com>
Co-authored-by: Zeke Mostov <32168567+emostov@users.noreply.github.com>
Awesome made those changes. I removed
The main idea behind it was noticed when I was working in examples, and I only needed to update and run the local code there and didnt want to re build each package. Then I thought that having workshare scripts would help mitigate any future issues with packages, but also if one wanted to work lets say in |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🌞
This PR aims to handle a behavior that yarn 2.x introduces. Being in a workspace we now need to share scripts accessing
bin
commands from@substrate/dev
. This is only useful if you are developing in a single package and want to run the build locally.For example, if we call
yarn build
from the root directory it has access to thebin
commands, and will then be accessible to the script calls in each packagespackage.json
. If we were tocd
into one of the packages they no longer have access, therefore we need to share scripts from the root directory. That can be achieved by adding a colon:
in the root package.json directory followed by acd $INIT_CWD &&
in the scripts itself.For example:
"build:workspace": "cd $INIT_CWD && rimraf lib/ && substrate-exec-tsc -p tsconfig.build.json"
You then would just call it as
yarn build:workspace
in the packages scripts.