I believe that including pastel as a dependency includes unnecessary code to the generated CLI app, such as the parcel-bundler dependency.
Saving parcel with --save-dev doesn't work, because there's some runtime code in this library that's needed for the app to run. But the problem is that the runtime is installed alongside all the dev tooling.
As an example:
This is the package.json of the CLI (relevant parts only):
Since pastel is a devDependency, the fetch-translations command fails:
❯ npm run fetch-translations
> filmin-translations-cli fetch <args...>
/Users/francisco/Sites/filminweb/node_modules/yoga-layout-prebuilt/yoga-layout/build/Release/nbind.js:53
throw ex;
^
Error: Cannot find module 'pastel/boot'
Require stack:
- /Users/francisco/Sites/filminweb/node_modules/@filmin/translations/build/cli.js
at Function.Module._resolveFilename (internal/modules/cjs/loader.js:815:15)
at Function.Module._load (internal/modules/cjs/loader.js:667:27)
at Module.require (internal/modules/cjs/loader.js:887:19)
at require (internal/modules/cjs/helpers.js:74:18)
at Object.<anonymous> (/Users/francisco/Sites/filminweb/node_modules/@filmin/translations/build/cli.js:5:14)
at Module._compile (internal/modules/cjs/loader.js:999:30)
at Object.Module._extensions..js (internal/modules/cjs/loader.js:1027:10)
at Module.load (internal/modules/cjs/loader.js:863:32)
at Function.Module._load (internal/modules/cjs/loader.js:708:14)
at Function.executeUserEntryPoint [as runMain] (internal/modules/run_main.js:60:12) {
code: 'MODULE_NOT_FOUND',
requireStack: [
'/Users/francisco/Sites/filminweb/node_modules/@filmin/translations/build/cli.js'
]
}
In order to prevent the npm run fetch-translations command to fail, I have to move pastel from devDependencies to dependencies. But doing so also causes "CONSUMER" to load libraries such as parcel-bundler, which I believe are not necessary.
As a proposed solution, we could consider splitting pastel into two separate packages, the "dev cli" and the "runtime" (a.k.a. pastel/boot).
I believe that including
pastel
as a dependency includes unnecessary code to the generated CLI app, such as theparcel-bundler
dependency.Saving
parcel
with--save-dev
doesn't work, because there's some runtime code in this library that's needed for the app to run. But the problem is that the runtime is installed alongside all the dev tooling.As an example:
This is the
package.json
of the CLI (relevant parts only):And this is the
package.json
of the consumer (relevant parts only):Since
pastel
is adevDependency
, thefetch-translations
command fails:In order to prevent the
npm run fetch-translations
command to fail, I have to movepastel
fromdevDependencies
todependencies
. But doing so also causes"CONSUMER"
to load libraries such asparcel-bundler
, which I believe are not necessary.As a proposed solution, we could consider splitting
pastel
into two separate packages, the "dev cli" and the "runtime" (a.k.a.pastel/boot
).Any thoughts?