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鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

Implement CLI hot-reload #1

Open
qhello opened this issue May 11, 2022 · 1 comment
Open

Implement CLI hot-reload #1

qhello opened this issue May 11, 2022 · 1 comment
Assignees
Labels
enhancement New feature or request

Comments

@qhello
Copy link
Owner

qhello commented May 11, 2022

Latest fresko version removed dependency to shelljs 馃殌

However, if one's project is relying on fresko to automatically run npm/yarn/pnpm install on a project that just got upgraded to latest fresko version (which happened @sline-io today), developers will run into this issue:

Error: Cannot find module '/XXX/node_modules/shelljs/src/exec-child.js'
    at Function.Module._resolveFilename (internal/modules/cjs/loader.js:902:15)
    at Function.Module._load (internal/modules/cjs/loader.js:746:27)
    at Function.executeUserEntryPoint [as runMain] (internal/modules/run_main.js:76:12)
    at internal/main/run_main_module.js:17:47 {
  code: 'MODULE_NOT_FOUND',
  requireStack: []
}

This is due to the fact that the fresko CLI currently running into the developer's terminal was still the version which had the dependency to shelljs - but during the CLI run the fresko dependencies changed - removing here the path to shelljs

Implementing a hot-reload feature into fresko would solve this issue, here's how it'd work:

  1. fresko is ran using git hooks - will save it's package version in memory
  2. each time a prompt's command is ran, we will check again if fresko package version changed
  3. if package version got changed, fresko would exit & reload itself, using the new version that just got installed
  4. optional: find a way to recover the CLI current state, to avoid re-starting the prompt sequence from the beginning
@qhello qhello added the enhancement New feature or request label May 11, 2022
@qhello qhello self-assigned this May 11, 2022
@qhello
Copy link
Owner Author

qhello commented May 13, 2022

though not a perfect solution, 6f16fec will help mitigate this issue, as now the CLI will ship fully bundled 馃幐

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant