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’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Pinia stores are created with the wrong folder structure #12860

Closed
BenJackGill opened this issue Mar 19, 2022 · 3 comments · Fixed by #12908
Closed

Pinia stores are created with the wrong folder structure #12860

BenJackGill opened this issue Mar 19, 2022 · 3 comments · Fixed by #12908
Assignees
Labels
area/cli bug/2-confirmed We have reproduce the problem and confirmed that this is a bug. flavour/quasar-cli-vite flavour/quasar-cli-webpack kind/bug 🐞 Qv2 🔝 Quasar v2 issues

Comments

@BenJackGill
Copy link

BenJackGill commented Mar 19, 2022

What happened?

Creating a new Pinia store with the Quasar CLI command quasar new store cats will create a store with this incorrect folder structure.

It creates a store that looks like this (seems to be using the old Vuex folder structure):

.
└── src/
    └── stores/
        └── cats/
            ├── index.js     # The Pinia cat store

What did you expect to happen?

The docs say it should have created a folder structure like this:

.
└── src/
    └── stores/
        └── cats.js     # The Pinia cat store

Reproduction URL

n/a

How to reproduce?

  1. Update to the latest Quasar version
  2. Create a new app and choose Pinia as the store during CLI setup
  3. Use the Quasar CLI command quasar new store cats to create a new Pinia store

Flavour

Quasar CLI with Webpack (@quasar/cli | @quasar/app-webpack)

Areas

Quasar CLI Commands/Configuration (@quasar/cli | @quasar/app-webpack | @quasar/app-vite)

Platforms/Browsers

No response

Quasar info output

Operating System - Darwin(21.4.0) - darwin/x64
NodeJs - 14.17.6

Global packages
  NPM - 8.5.4
  yarn - 1.22.11
  @quasar/cli - 1.3.1
  @quasar/icongenie - 2.4.2
  cordova - Not installed

Important local packages
  quasar - 2.6.1 -- Build high-performance VueJS user interfaces (SPA, PWA, SSR, Mobile and Desktop) in record time
  @quasar/app-webpack - 3.4.3 -- Quasar Framework App CLI with Webpack
  @quasar/extras - 1.13.3 -- Quasar Framework fonts, icons and animations
  eslint-plugin-quasar - Not installed
  vue - 3.2.31 -- The progressive JavaScript framework for building modern web UI.
  vue-router - 4.0.14
  pinia - 2.0.12 -- Intuitive, type safe and flexible Store for Vue
  vuex - Not installed
  electron - Not installed
  electron-packager - Not installed
  electron-builder - Not installed
  @babel/core - 7.17.8 -- Babel compiler core.
  webpack - 5.70.0 -- Packs CommonJs/AMD modules for the browser. Allows to split your codebase into multiple bundles, which can be loaded on demand. Support loaders to preprocess files, i.e. json, jsx, es7, css, less, ... and your custom stuff.
  webpack-dev-server - 4.7.4 -- Serves a webpack app. Updates the browser on changes.
  workbox-webpack-plugin - Not installed
  register-service-worker - 1.7.2 -- Script for registering service worker, with hooks
  typescript - 4.6.2 -- TypeScript is a language for application scale JavaScript development
  @capacitor/core - Not installed
  @capacitor/cli - Not installed
  @capacitor/android - Not installed
  @capacitor/ios - Not installed

Quasar App Extensions
  *None installed*

Networking
  Host - BenBookPro
  en0 - 192.168.20.11

Relevant log output

No response

Additional context

No response

@github-actions
Copy link

Hi @BenJackGill! 👋

It looks like you provided an invalid or unsupported reproduction URL.
Do not use any service other than Codepen, jsFiddle, Codesandbox, and GitHub.
Make sure the URL you provided is correct and reachable. You can test it by visiting it in a private tab, another device, etc.
Please edit your original post above and provide a valid reproduction URL as explained.

Without a proper reproduction, your issue will have to get closed.

Thank you for your collaboration. 👏

@JokerMartini
Copy link

I agree this method for creating stores when using pinia is broken. it places it inside a subfolder. please fix this

yusufkandemir added a commit to yusufkandemir/quasar that referenced this issue Mar 23, 2022
@yusufkandemir yusufkandemir added bug/2-confirmed We have reproduce the problem and confirmed that this is a bug. flavour/quasar-cli-vite and removed bug/0-needs-info Need more info to reproduce labels Mar 23, 2022
rstoenescu pushed a commit that referenced this issue Mar 27, 2022
…ture (fix #12860) (#12908)

* refactr(app-vite): Convert 'sub-bin' files to regular JS files, enable linting on them
https://github.com/mysticatea/eslint-plugin-node/blob/v11.1.0/docs/rules/shebang.md

* fix(app-vite&app-webpack): Generate Pinia stores in a flat file structure (fix: #12860)

* refactor(app-vite&app-webpack): Simplify file generation
@rstoenescu
Copy link
Member

Enhancement will be available in q/app-vite 1.0.0-beta.9

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/cli bug/2-confirmed We have reproduce the problem and confirmed that this is a bug. flavour/quasar-cli-vite flavour/quasar-cli-webpack kind/bug 🐞 Qv2 🔝 Quasar v2 issues
Projects
None yet
4 participants