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

Refactor: Script dependencies #2061

Draft
wants to merge 8 commits into
base: master
Choose a base branch
from
Draft

Conversation

chrismclarke
Copy link
Member

@chrismclarke chrismclarke commented Aug 23, 2023

PR Checklist

  • PR title descriptive (can be used in release notes)

TODO - Current code changes

TODO - Tasks identified in #2035

  • Part of standalone build still triggers 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 threads
  • Debug xlsxWorkbookProcessor which appears to be running slower now integrated
  • Reconsider NX integration (likely when looking into desktop app build scripts)
  • Replace direct scripts ts-node invocation method (currently yarn scripts) in favour of compiled bin execution (yarn app-scripts)
  • Documentation
  • Integrate into desktop electron app (https://github.com/bennymeg/nx-electron)

Note - resources related to worker threads

Description

Start of work refactoring scripts that call external dependencies to avoid use of child spawn methods. This involves refactoring packages that use a cli-based approach (yarn scripts gdrive download) to export methods that can be used directly (lib-based)

  • Make gdrive scripts lib-based
  • Make workflow run lib-based

Dev Notes

Should notice speed improvements for workflows as they no longer spawn child processes to execute

TODO

  • Blocked by fix: sync_local workflow #2041 and Refactor/scripts standalone #2035
  • Find a way to allow deployment ts to be evaluated at runtime from JS environment
    Best solution so far likely to assume user has ts-node installed, possibly rewriting imports to local functions and executing. Could looks at reverting esm -> cjs and/or updating ts-node. May also be useful to move deployment config code to own workspace. Alternative could be to change config format to js and return instead of export Refactor/deployment scripts #2086
  • Review all other instances of calling spawn/spawnsync (e.g. translations apply, app-data)
  • Consider if possible to get code working to get deployment in an async way (remove need for sync alternative)

Git Issues

Closes #

Screenshots/Videos

If useful, provide screenshot or capture to highlight main changes

@chrismclarke chrismclarke changed the title Refactor/scripts spawn Refactor: Script dependencies Aug 23, 2023
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.

1 participant