Skip to content

Commit

Permalink
Merge pull request #275 from ojvribeiro/fix/remove-pinia
Browse files Browse the repository at this point in the history
feat: remove built-in Pinia
  • Loading branch information
ojvribeiro authored Sep 2, 2024
2 parents cd82a63 + 5beda62 commit fc09404
Show file tree
Hide file tree
Showing 7 changed files with 6 additions and 14 deletions.
Binary file modified bun.lockb
Binary file not shown.
1 change: 0 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,6 @@
"http-server": "14.1.1",
"laravel-mix": "6.0.49",
"laravel-mix-ejs": "2.0.1",
"pinia": "2.0.36",
"postcss": "8.4.31",
"resolve-url-loader": "5.0.0",
"sass": "1.54.5",
Expand Down
6 changes: 3 additions & 3 deletions src/config/aliases.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,9 @@ const VulmixAliases = () => {
'@assets': fs.existsSync(`${ABSOLUTE_ROOT_PATH}/assets`)
? `${ABSOLUTE_ROOT_PATH}/assets`
: false,
'@icons': fs.existsSync(`${ABSOLUTE_ROOT_PATH}/assets/icons`)
? `${ABSOLUTE_ROOT_PATH}/assets/icons`
: false,
'@components': fs.existsSync(`${ABSOLUTE_ROOT_PATH}/components`)
? `${ABSOLUTE_ROOT_PATH}/components`
: false,
Expand All @@ -33,9 +36,6 @@ const VulmixAliases = () => {
'@plugins': fs.existsSync(`${ABSOLUTE_ROOT_PATH}/plugins`)
? `${ABSOLUTE_ROOT_PATH}/plugins`
: false,
'@stores': fs.existsSync(`${ABSOLUTE_ROOT_PATH}/stores`)
? `${ABSOLUTE_ROOT_PATH}/stores`
: false,
'@404': fs.existsSync(`${ABSOLUTE_ROOT_PATH}/404.vue`)
? `${ABSOLUTE_ROOT_PATH}/404.vue`
: `${ABSOLUTE_PACKAGE_PATH}/src/vue/pages/404.vue`,
Expand Down
2 changes: 0 additions & 2 deletions src/config/imports.js
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,6 @@ module.exports.UnpluginAutoImports = () => {
...(VulmixConfig.imports?.presets || []),
'vue',
'vue-router',
'pinia',
unheadComposablesImports[0],
],
// Enable auto import by filename for default module exports under directories
Expand All @@ -72,7 +71,6 @@ module.exports.UnpluginAutoImports = () => {
`${ABSOLUTE_PACKAGE_PATH}/src/vue/utils/**`, // all nested modules
`${ABSOLUTE_ROOT_PATH}/composables/**`, // all nested modules
`${ABSOLUTE_PACKAGE_PATH}/src/vue/composables/**`, // all nested modules
`${ABSOLUTE_ROOT_PATH}/stores/**`, // all nested modules
],

// Filepath to generate corresponding .d.ts file.
Expand Down
4 changes: 2 additions & 2 deletions src/vue/components/runtime/Icon.vue
Original file line number Diff line number Diff line change
Expand Up @@ -55,13 +55,13 @@
currentFormat: string = 'svg'
if (props.format === 'svg') {
iconsImport = require.context('@assets/icons/', true, /\.svg$/)
iconsImport = require.context('@icons/', true, /\.svg$/)
currentFormat = 'svg'
}
if (props.format === 'png') {
iconsImport = require.context('@assets/icons/', true, /\.png$/)
iconsImport = require.context('@icons/', true, /\.png$/)
currentFormat = 'png'
}
Expand Down
4 changes: 0 additions & 4 deletions src/vue/main.ts
Original file line number Diff line number Diff line change
@@ -1,15 +1,12 @@
import { createApp, type App as VueApp } from 'vue'
import { createRouter, createWebHistory, type Router } from 'vue-router'
import { createHead, type VueHeadClient } from '@unhead/vue'
import { createPinia } from 'pinia'

const App = require('@appFile').default

const app: VueApp<Element> = createApp(App)
const head: VueHeadClient<{}> = createHead()

const pinia = createPinia()

/**
* Built-in components
*/
Expand Down Expand Up @@ -142,7 +139,6 @@ layoutFiles.keys().map((key: string) => {

app.use(router)
app.use(head)
app.use(pinia)

const pluginFiles = require.context('@plugins/', true, /\.(js|ts)$/i)

Expand Down
3 changes: 1 addition & 2 deletions utils/tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,7 @@
"@components/*": ["./components/*"],
"@composables/*": ["./composables/*"],
"@layouts/*": ["./layouts/*"],
"@pages/*": ["./pages/*"],
"@stores/*": ["./stores/*"]
"@pages/*": ["./pages/*"]
}
},
"include": [
Expand Down

0 comments on commit fc09404

Please sign in to comment.