-
Notifications
You must be signed in to change notification settings - Fork 25
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
Refactor/scripts standalone #2035
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.
yarn app-workflow sync
on the plh_tz
and debug
deployments is giving an error at the populate_src_assets step:
Error: Unknown arguments: open, input-folder, output-folder, cache-folder
(N.B. yarn workflow sync
runs without problem)
yarn scripts version
and yarn app-scripts version
both working as expected
yarn workflow deployment set
and yarn app-workflow deployment set
both working as expected
Also this branch seems to conflict with master in the yarn.lock
file, could you resolve that?
Thanks @esmeetewinkel, I think the issue is coming from the way some workflows need to call other workflows, and in the case of app-data processing not all the code required was available and it actually was just trying to execute the wrong code instead (super strange). Most of these issues I had marked for follow-up in #2061, although I've taken a quick look and should have fixed the specific sync workflow. I've also updated the scripts version number, so assuming the auto-build feature is working correctly you should be able to just try rerun |
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.
@jfmcquade |
PR Checklist
Description
In order to develop a desktop app, we need to be able to build and package the backend in a way that is consumable.
Main changes
bin
folder and bindings to allow executing scripts from compiled bundle (instead of compiling from typescript at runtime).Additional Changes
Review Notes
For now the
yarn scripts
andyarn workflow
should continue to work exactly as before (will be deprecated in the future following point above)The new commands
yarn app-scripts
oryarn app-workflow
should auto-build the scripts library and then execute as above. It should only rebuild when the scripts workspace package.json version updates (can test manually). Commands executed through this should then work as above, with initial execution being significantly faster (for me change from around 7s -> 2s)Dev Notes
For now the commands
yarn scripts
andyarn app-scripts
should be interchangeable, where the former executes the scripts in the usual way (compiling typescript files via ts-node at runtime) and the later executes from the built bundle.I had attempted integrating NX to allow automated caching and rebuilding scripts as required, although became unstuck due to an issue with executing interactive scripts from nx (
https://github.com/nrwl/nx/issues/8269
). So I reverted the changes and may revisit in the future (have closed #1695 accordingly). Instead I opted to manually include the package.json in build and compare version numbers from src/dist folders. This means when updating scripts in the future we should also remember to bump the scripts package.json versionFollow-up Tasks (to be addressed in PR #2061)
spawnsync
commands which requires full dev environment (e.g. typescript, installed packages etc.). Further work required to make linked packages consumable (either by building into npm package or updating package.json to export src index.ts and putting consumable methods in related index for use. Similarly calling spawnsync should be replaced with worker threadsyarn scripts
) in favour of compiled bin execution (yarn app-scripts
)Git Issues
Closes #
Screenshots/Videos
If useful, provide screenshot or capture to highlight main changes