Skip to content

Commit fe2bc6f

Browse files
committed
chore: wip
1 parent b7a450f commit fe2bc6f

File tree

12 files changed

+91
-83
lines changed

12 files changed

+91
-83
lines changed

pkgx.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,4 +20,4 @@ dependencies:
2020
rust-lang.org: ^1.74.1
2121
sqlite.org: ^3.42.0
2222
stedolan.github.io/jq: ^1.7 # can be removed when publishing works without npm
23-
redis.io: ^7.2.5
23+
redis.io: ^7.4.0

storage/framework/core/vite-plugin/src/auto-imports.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,9 @@ import type { AutoImportsOptions } from '@stacksjs/types'
33
import { unheadVueComposablesImports as VueHeadImports } from '@unhead/vue'
44
import AutoImport from 'unplugin-auto-import/vite'
55
import { VueRouterAutoImports } from 'unplugin-vue-router'
6+
import type { Plugin } from 'vite'
67

7-
export function autoImports(options?: AutoImportsOptions) {
8+
export function autoImports(options?: AutoImportsOptions): Plugin {
89
return AutoImport({
910
include: /\.(stx|vue|js|ts|mdx?|html)($|\?)/,
1011
imports: [

storage/framework/core/vite-plugin/src/components.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,9 @@
11
import { path as p } from '@stacksjs/path'
22
import type { ComponentOptions } from '@stacksjs/types'
33
import Components from 'unplugin-vue-components/vite'
4+
import type { Plugin } from 'vite'
45

5-
export function components(options?: ComponentOptions) {
6+
export function components(options?: ComponentOptions): Plugin {
67
return Components({
78
extensions: ['stx', 'vue', 'md'],
89
include: /\.(stx|vue|md)($|\?)/,
Lines changed: 16 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,20 @@
11
import { path as p } from '@stacksjs/path'
22
import UnoCSS from 'unocss/vite'
3+
import type { Plugin } from 'vite'
34

4-
export function cssEngine(isWebComponent = false) {
5-
return UnoCSS({
6-
configFile: p.uiPath('src/unocss.config.ts'),
7-
mode: isWebComponent ? 'shadow-dom' : 'vue-scoped',
8-
// content: {
9-
// pipeline: {
10-
// include: /\.(stx|vue|js|ts|mdx?|elm|html)($|\?)/,
11-
// // exclude files
12-
// // exclude: []
13-
// },
14-
// },
15-
})
5+
export function cssEngine(isWebComponent = false): Plugin {
6+
return {
7+
name: 'css-engine-plugin',
8+
...UnoCSS({
9+
configFile: p.uiPath('src/unocss.config.ts'),
10+
mode: isWebComponent ? 'shadow-dom' : 'vue-scoped',
11+
// content: {
12+
// pipeline: {
13+
// include: /\.(stx|vue|js|ts|mdx?|elm|html)($|\?)/,
14+
// // exclude files
15+
// // exclude: []
16+
// },
17+
// },
18+
}),
19+
}
1620
}

storage/framework/core/vite-plugin/src/docs.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,9 @@
11
import { kolorist as c } from '@stacksjs/cli'
22
import type { ViteDevServer } from 'vite'
3+
import type { Plugin } from 'vite'
34
import { version } from '../../package.json'
45

5-
export const docsEngine = {
6+
export const docsEngine: Plugin = {
67
name: 'stacks-plugin',
78
configureServer(server: ViteDevServer) {
89
// const base = server.config.base || '/'

storage/framework/core/vite-plugin/src/i18n.ts

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -3,10 +3,13 @@ import { path as p } from '@stacksjs/path'
33
import type { Plugin } from 'vite'
44

55
export function i18n(): Plugin {
6-
return VueI18n({
7-
runtimeOnly: true,
8-
compositionOnly: true,
9-
fullInstall: true,
10-
include: [p.resolve(__dirname, '../../../../../../../lang/**')],
11-
})
6+
return {
7+
name: 'i18n-plugin',
8+
...VueI18n({
9+
runtimeOnly: true,
10+
compositionOnly: true,
11+
fullInstall: true,
12+
include: [p.resolve(__dirname, '../../../../../../../lang/**')],
13+
}),
14+
}
1215
}
Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
import type { InspectOptions } from '@stacksjs/types'
2+
import type { Plugin } from 'vite'
23
import Inspect from 'vite-plugin-inspect'
34

4-
export function inspect(options?: InspectOptions) {
5+
export function inspect(options?: InspectOptions): Plugin {
56
return Inspect(options)
67
}

storage/framework/core/vite-plugin/src/layouts.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,9 @@
11
import { path as p } from '@stacksjs/path'
2+
import type { Plugin } from 'vite'
23
import Layouts from 'vite-plugin-vue-layouts'
34
import type { UserOptions as LayoutOptions } from 'vite-plugin-vue-layouts'
45

5-
export function layouts(options?: LayoutOptions) {
6+
export function layouts(options?: LayoutOptions): Plugin {
67
const opts = {
78
extensions: ['stx', 'vue'],
89
layoutsDirs: p.layoutsPath(),
Lines changed: 27 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -1,28 +1,33 @@
11
import LinkAttributes from 'markdown-it-link-attributes'
22
import Shiki from 'markdown-it-shikiji'
33
import Markdown from 'unplugin-vue-markdown/vite'
4+
import type { Plugin } from 'vite'
45

5-
export function markdown() {
6-
return Markdown({
7-
wrapperClasses: 'prose prose-sm m-auto text-left',
8-
headEnabled: true,
9-
async markdownItSetup(md) {
10-
md.use(LinkAttributes, {
11-
matcher: (link: string) => /^https?:\/\//.test(link),
12-
attrs: {
13-
target: '_blank',
14-
rel: 'noopener',
15-
},
16-
})
17-
md.use(
18-
await Shiki({
19-
defaultColor: false,
20-
themes: {
21-
light: 'vitesse-light',
22-
dark: 'vitesse-dark',
6+
export function markdown(): Plugin {
7+
return {
8+
name: 'markdown-plugin',
9+
10+
...Markdown({
11+
wrapperClasses: 'prose prose-sm m-auto text-left',
12+
headEnabled: true,
13+
async markdownItSetup(md) {
14+
md.use(LinkAttributes, {
15+
matcher: (link: string) => /^https?:\/\//.test(link),
16+
attrs: {
17+
target: '_blank',
18+
rel: 'noopener',
2319
},
24-
}),
25-
)
26-
},
27-
})
20+
})
21+
md.use(
22+
await Shiki({
23+
defaultColor: false,
24+
themes: {
25+
light: 'vitesse-light',
26+
dark: 'vitesse-dark',
27+
},
28+
}),
29+
)
30+
},
31+
}),
32+
}
2833
}

storage/framework/core/vite-plugin/src/pages.ts

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,21 @@
11
import { defu } from 'defu'
22
import type { Options, TreeNode } from 'unplugin-vue-router'
33
import VueRouter from 'unplugin-vue-router/vite'
4+
import type { Plugin } from 'vite'
45

56
// https://github.com/posva/unplugin-vue-router
6-
export function pages(options?: Options) {
7+
export function pages(options?: Options): Plugin {
78
const defaultOptions = {
89
extensions: ['.stx', '.vue', '.md'],
910
getRouteName: (routeNode: TreeNode) => getFileBasedRouteName(routeNode),
1011
}
1112

1213
const newOptions = defu(options, defaultOptions)
1314

14-
return VueRouter(newOptions)
15+
return {
16+
name: 'pages-plugin',
17+
...VueRouter(newOptions),
18+
}
1519
}
1620

1721
function getFileBasedRouteName(node: TreeNode): string {

0 commit comments

Comments
 (0)