aurelia / store

Aurelia single state store based on RxJS
MIT License
103 stars 27 forks source link

Library version 1.7.1 crashes Aurelia CLI Bundler builds #131

Open LukevanTricht opened 2 years ago

LukevanTricht commented 2 years ago

I'm submitting a bug report

Please tell us about your environment:

Current behavior: After upgrading from 1.7.0 to 1.7.1, my build now crashes with the following error:

./node_modules/aurelia-store/dist/aurelia-store.d.ts(1,33): error TS2307: Cannot find module '@redux-devtools/extension' or its corresponding type declarations.
./node_modules/aurelia-store/dist/aurelia-store.d.ts(64,46): error TS2307: Cannot find module '@redux-devtools/extension' or its corresponding type declarations.

Expected/desired behavior: Hopefully, a patch update like this shouldn't have killed the build process. Replication Steps(Can provide a minimal project as a repo if you'd like):

  1. Create a new AU project, as a custom project with Typescript, the Aurelia CLI as a bundler, and yarn
  2. yarn add aurelia-store
  3. Import any aurelia-store object(I chose connectTo)
  4. yarn build
zewa666 commented 2 years ago

meh, sry about that. It seems I've added the typings fir the extension as devDependency instead of prod.

meanwhile please npm i -d @redux-devtools/extension yourself to avoid that build issue

zewa666 commented 2 years ago

@LukevanTricht v1.7.2 has been released and should address this issue. Please take a look and see whether it works for you

LukevanTricht commented 2 years ago

@zewa666 It looks like you're missing a dependency that @redux-devtools requires, I got this warning doing the upgrade:

warning "aurelia-store > @redux-devtools/extension@3.2.2" has unmet peer dependency "redux@^3.1.0 || ^4.0.0".

And my build failed with:

/node_modules/@redux-devtools/extension/lib/types/developmentOnly.d.ts(1,31): error TS2307: Cannot find module 'redux' or its corresponding type declarations.
/node_modules/@redux-devtools/extension/lib/types/index.d.ts(1,54): error TS2307: Cannot find module 'redux' or its corresponding type declarations.
/node_modules/@redux-devtools/extension/lib/types/logOnly.d.ts(1,31): error TS2307: Cannot find module 'redux' or its corresponding type declarations.
/node_modules/@redux-devtools/extension/lib/types/logOnlyInProduction.d.ts(1,31): error TS2307: Cannot find module 'redux' or its corresponding type declarations.
zewa666 commented 2 years ago

that's super weird, as I've tested it out with a fresh new CLI project without any troubles. Although I must admit it was Webpack now that I think. Anyways, seems they're having the same type of issue I had of using a devDependency as prod :(

I'm definitely not interested in adding Redux as a dependency as that goes way too far just for the sake of typings. The offending line is here. I'm not sure whether a type-only import would perhaps remove the issue or whether this is something specific to the CLI bundler. @3cp any ideas?

EDIT: meh ... it's a peerDependency ... grrmpf. I really would have liked to use the upstream for proper typings but under this light it really starts to make no sense. I guess I'll have to copy/paste the EnhancerOptions type to the aurelia-store repo itself in order to avoid this mammoth of dependency hell