pinia icon indicating copy to clipboard operation
pinia copied to clipboard

feat(nuxt): supports automatic import of stores from extend layers

Open wzc520pyfm opened this issue 1 year ago • 5 comments

When I install pinia in a nuxt layer and create stores folder, and then I extend this layer in another nuxt application, I find that the stores are not automatically imported.

What this PR does:

When addImportsDir, consider the nuxt layers also.

Refer:

Pinia autoImports for nuxt

Nuxt layers

wzc520pyfm avatar Nov 09 '24 17:11 wzc520pyfm

Deploy Preview for pinia-playground canceled.

Name Link
Latest commit 3f4442f71dc5b67f0d1479ab81f09ea59e340ef0
Latest deploy log https://app.netlify.com/sites/pinia-playground/deploys/672fa0866fec6d00089bec54

netlify[bot] avatar Nov 09 '24 17:11 netlify[bot]

Deploy Preview for pinia-official canceled.

Name Link
Latest commit 3f4442f71dc5b67f0d1479ab81f09ea59e340ef0
Latest deploy log https://app.netlify.com/sites/pinia-official/deploys/672fa086672e41000862bf3b

netlify[bot] avatar Nov 09 '24 17:11 netlify[bot]

Open in Stackblitz

npm i https://pkg.pr.new/pinia@2828
npm i https://pkg.pr.new/@pinia/nuxt@2828
npm i https://pkg.pr.new/@pinia/testing@2828

commit: 3f4442f

pkg-pr-new[bot] avatar Nov 28 '24 15:11 pkg-pr-new[bot]

I noticed there is also https://github.com/vuejs/pinia/pull/2757, so let's use that one instead. Thanks for the PR!

posva avatar Nov 28 '24 15:11 posva

Codecov Report

:white_check_mark: All modified and coverable lines are covered by tests. :white_check_mark: Project coverage is 89.34%. Comparing base (6e90153) to head (3f4442f). :warning: Report is 49 commits behind head on v2.

Additional details and impacted files
@@           Coverage Diff           @@
##               v2    #2828   +/-   ##
=======================================
  Coverage   89.34%   89.34%           
=======================================
  Files          14       14           
  Lines        1323     1323           
  Branches      218      219    +1     
=======================================
  Hits         1182     1182           
  Misses        140      140           
  Partials        1        1           

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.

:rocket: New features to boost your workflow:
  • :snowflake: Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • :package: JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

codecov[bot] avatar Nov 28 '24 15:11 codecov[bot]