forge icon indicating copy to clipboard operation
forge copied to clipboard

create-electron-app with --template=typescript does not properly setup package.json scripts

Open phillippschmedt opened this issue 4 years ago • 1 comments

Preflight Checklist

  • [x ] I have read the contribution documentation for this project.
  • [x ] I agree to follow the code of conduct that this project follows, as appropriate.
  • [x ] I have searched the issue tracker for a bug that matches the one I want to file, without success.

Issue Details

  • Electron Forge Version:
    • 6.14.6
  • Operating System:
    • Windows 10

Expected Behavior

I expect that npx create-electron-app my-new-app --template=typescript sets up a ready to start project which will allow me to start, package and make the template app.

Actual Behavior

The typescript compiler (tsc) does not run before "npm run package" and "npm run make" resulting in the app bundle not including the required .js files to run the app.

To Reproduce

  1. Run npx create-electron-app my-new-app --template=typescript
  2. cd my-new-app
  3. npm run package or npm run make

Go to /out and try to run the app.

Additional Information

The cause for this that the template adds the tsc only to the "start" script and not on "package" and "make"

"start": "tsc && electron-forge start",
"package": "electron-forge package",
"make": "electron-forge make"

phillippschmedt avatar Oct 05 '20 20:10 phillippschmedt

So ideally, instead of limiting the running of tsc to the npm scripts, I'd like it to be run via a default Electron Forge hook (written in JavaScript), packageAfterCopy. I can go into more detail later.

malept avatar Oct 05 '20 20:10 malept

No longer relevant since https://github.com/electron/forge/pull/2948?

erikian avatar Oct 30 '22 14:10 erikian