@stacksjs/build 0.51.0 → 0.52.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -38,7 +38,7 @@ pnpm test
38
38
 
39
39
  Please see our [releases](https://github.com/stacksjs/stacks/releases) page for more information on what has changed recently.
40
40
 
41
- ## 💪🏼 Contributing
41
+ ## 🚜 Contributing
42
42
 
43
43
  Please review the [Contributing Guide](https://github.com/stacksjs/contributing) for details.
44
44
 
package/dist/desktop.mjs CHANGED
@@ -1,17 +1,139 @@
1
+ import path from "node:path";
1
2
  import { defineConfig } from "vite";
2
- import { server } from "@stacksjs/server";
3
- import { cssEngine, uiEngine } from ".//index.mjs";
3
+ import Vue from "@vitejs/plugin-vue";
4
+ import Pages from "vite-plugin-pages";
5
+ import generateSitemap from "vite-ssg-sitemap";
6
+ import Components from "unplugin-vue-components/vite";
7
+ import AutoImport from "unplugin-auto-import/vite";
8
+ import Markdown from "vite-plugin-vue-markdown";
9
+ import { VitePWA } from "vite-plugin-pwa";
10
+ import Inspect from "vite-plugin-inspect";
11
+ import LinkAttributes from "markdown-it-link-attributes";
12
+ import Unocss from "@unocss/vite";
13
+ import Shiki from "markdown-it-shiki";
4
14
  export default defineConfig({
15
+ resolve: {
16
+ alias: {
17
+ "~/": `${path.resolve(__dirname, "../../../../")}/`
18
+ }
19
+ },
5
20
  clearScreen: false,
6
- server,
7
- envPrefix: "APP_",
21
+ server: {
22
+ port: 3333,
23
+ strictPort: true
24
+ },
25
+ envPrefix: ["VITE_", "TAURI_"],
8
26
  plugins: [
9
- uiEngine(),
10
- cssEngine()
27
+ Vue({
28
+ include: [/\.vue$/, /\.md$/],
29
+ reactivityTransform: true
30
+ }),
31
+ // https://github.com/hannoeru/vite-plugin-pages
32
+ Pages({
33
+ extensions: ["vue", "md"]
34
+ }),
35
+ // https://github.com/antfu/unplugin-auto-import
36
+ AutoImport({
37
+ imports: [
38
+ "vue",
39
+ "vue-router",
40
+ "vue-i18n",
41
+ "vue/macros",
42
+ "@vueuse/head",
43
+ "@vueuse/core"
44
+ ],
45
+ dts: "../../../auto-imports.d.ts",
46
+ dirs: [
47
+ "../../../../functions",
48
+ "../../../../app/stores"
49
+ ],
50
+ vueTemplate: true
51
+ }),
52
+ // https://github.com/antfu/unplugin-vue-components
53
+ Components({
54
+ // allow auto load markdown components under `./src/components/`
55
+ extensions: ["vue", "md"],
56
+ // allow auto import and register components used in markdown
57
+ include: [/\.vue$/, /\.vue\?vue/, /\.md$/],
58
+ dts: "../../../../components"
59
+ }),
60
+ // https://github.com/antfu/unocss
61
+ // see unocss.config.ts for config
62
+ Unocss({
63
+ configFile: "../../ui/src/unocss.config.ts",
64
+ mode: "vue-scoped"
65
+ }),
66
+ // https://github.com/antfu/vite-plugin-vue-markdown
67
+ // Don't need this? Try vitesse-lite: https://github.com/antfu/vitesse-lite
68
+ Markdown({
69
+ wrapperClasses: "prose prose-sm m-auto text-left",
70
+ headEnabled: true,
71
+ markdownItSetup(md) {
72
+ md.use(Shiki, {
73
+ theme: {
74
+ light: "vitesse-light",
75
+ dark: "vitesse-dark"
76
+ }
77
+ });
78
+ md.use(LinkAttributes, {
79
+ matcher: (link) => /^https?:\/\//.test(link),
80
+ attrs: {
81
+ target: "_blank",
82
+ rel: "noopener"
83
+ }
84
+ });
85
+ }
86
+ }),
87
+ // https://github.com/antfu/vite-plugin-pwa
88
+ VitePWA({
89
+ registerType: "autoUpdate",
90
+ includeAssets: ["favicon.ico", "safari-pinned-tab.svg"],
91
+ manifest: {
92
+ name: "Vitesse",
93
+ short_name: "Vitesse",
94
+ theme_color: "#ffffff",
95
+ icons: [
96
+ {
97
+ src: "/pwa-192x192.png",
98
+ sizes: "192x192",
99
+ type: "image/png"
100
+ },
101
+ {
102
+ src: "/pwa-512x512.png",
103
+ sizes: "512x512",
104
+ type: "image/png"
105
+ },
106
+ {
107
+ src: "/pwa-512x512.png",
108
+ sizes: "512x512",
109
+ type: "image/png",
110
+ purpose: "any maskable"
111
+ }
112
+ ]
113
+ }
114
+ }),
115
+ // https://github.com/antfu/vite-plugin-inspect
116
+ // Visit http://localhost:3333/__inspect/ to see the inspector
117
+ Inspect()
11
118
  ],
12
- build: {
13
- target: ["es2021", "chrome97", "safari13"],
14
- minify: !process.env.APP_DEBUG ? "esbuild" : false,
15
- sourcemap: !!process.env.APP_DEBUG
119
+ // https://github.com/vitest-dev/vitest
120
+ test: {
121
+ include: ["test/**/*.test.ts"],
122
+ environment: "jsdom",
123
+ deps: {
124
+ inline: ["@vue", "@vueuse", "vue-demi"]
125
+ }
126
+ },
127
+ // https://github.com/antfu/vite-ssg
128
+ ssgOptions: {
129
+ script: "async",
130
+ formatting: "minify",
131
+ onFinished() {
132
+ generateSitemap();
133
+ }
134
+ },
135
+ ssr: {
136
+ // TODO: workaround until they support native ESM
137
+ noExternal: ["workbox-window", /vue-i18n/]
16
138
  }
17
139
  });
package/dist/stacks.d.ts CHANGED
@@ -10,5 +10,5 @@ declare function autoImports(options?: AutoImportsOptions): any;
10
10
  declare function cssEngine(isWebComponent?: boolean): import("vite").Plugin[];
11
11
  declare function pwa(): import("vite").Plugin[];
12
12
  declare function uiEngine(isWebComponent?: boolean): import("vite").Plugin;
13
- declare const componentPreset: (isWebComponent?: boolean) => PluginOption;
13
+ declare function componentPreset(isWebComponent?: boolean): PluginOption;
14
14
  export { resolve, componentPreset, uiEngine, autoImports, cssEngine, components, inspect, markdown, pages, pwa, layouts };
package/dist/stacks.mjs CHANGED
@@ -71,7 +71,7 @@ function autoImports(options) {
71
71
  "@vueuse/head",
72
72
  "@vueuse/math",
73
73
  "vitest",
74
- { "@vueuse/shared": ["isClient", "isDef", "isBoolean", "isFunction", "isNumber", "isString", "isObject", "isWindow", "now", "timestamp", "clamp", "noop", "rand", "isIOS", "hasOwn"] }
74
+ { "@vueuse/shared": ["isClient", "now", "timestamp", "clamp", "noop", "rand", "isIOS", "hasOwn"] }
75
75
  ],
76
76
  dirs: [
77
77
  p.functionsPath(),
@@ -173,12 +173,14 @@ function uiEngine(isWebComponent = false) {
173
173
  include: [/\.vue$/, /\.md$/]
174
174
  });
175
175
  }
176
- const componentPreset = (isWebComponent = false) => [
177
- inspect,
178
- uiEngine(isWebComponent),
179
- cssEngine(isWebComponent),
180
- autoImports,
181
- components,
182
- markdown
183
- ];
176
+ function componentPreset(isWebComponent = false) {
177
+ return [
178
+ inspect,
179
+ uiEngine(isWebComponent),
180
+ cssEngine(isWebComponent),
181
+ autoImports,
182
+ components,
183
+ markdown
184
+ ];
185
+ }
184
186
  export { resolve, componentPreset, uiEngine, autoImports, cssEngine, components, inspect, markdown, pages, pwa, layouts };
package/package.json CHANGED
@@ -1,8 +1,8 @@
1
1
  {
2
2
  "name": "@stacksjs/build",
3
3
  "type": "module",
4
- "version": "0.51.0",
5
- "packageManager": "pnpm@7.26.3",
4
+ "version": "0.52.0",
5
+ "packageManager": "pnpm@8.5.1",
6
6
  "description": "The Stacks framework build tools and configurations.",
7
7
  "author": "Chris Breuer",
8
8
  "license": "MIT",
@@ -26,6 +26,14 @@
26
26
  "nitro",
27
27
  "vue"
28
28
  ],
29
+ "exports": {
30
+ ".": {
31
+ "types": "./dist/index.d.ts",
32
+ "import": "./dist/index.mjs"
33
+ }
34
+ },
35
+ "module": "dist/index.mjs",
36
+ "types": "dist/index.d.ts",
29
37
  "contributors": [
30
38
  "Chris Breuer <chris@ow3.org>"
31
39
  ],
@@ -33,41 +41,35 @@
33
41
  "dist",
34
42
  "README.md"
35
43
  ],
36
- "engines": {
37
- "node": ">=v18.14.0",
38
- "pnpm": ">=7.26.3"
39
- },
40
44
  "peerDependencies": {
41
- "@vitejs/plugin-vue": "^4.0.0",
45
+ "@vitejs/plugin-vue": "^4.2.3",
42
46
  "markdown-it-link-attributes": "^4.0.1",
43
- "markdown-it-shiki": "^0.7.2",
44
- "unbuild": "^1.1.1",
45
- "unplugin-auto-import": "^0.13.0",
46
- "unplugin-vue-components": "^0.23.0",
47
- "vite": "^4.1.1",
48
- "vite-plugin-inspect": "^0.7.15",
49
- "vite-plugin-pages": "^0.28.0",
50
- "vite-plugin-pwa": "^0.14.1",
51
- "vite-plugin-vue-layouts": "^0.7.0",
52
- "vite-plugin-vue-markdown": "^0.22.2",
53
- "vite-ssg": "^0.22.1",
54
- "vite-ssg-sitemap": "^0.4.3",
47
+ "markdown-it-shiki": "^0.9.0",
48
+ "unbuild": "^1.2.1",
49
+ "unplugin-auto-import": "^0.16.0",
50
+ "unplugin-vue-components": "^0.24.1",
51
+ "vite": "^4.3.7",
52
+ "vite-plugin-inspect": "^0.7.26",
53
+ "vite-plugin-pages": "^0.29.0",
54
+ "vite-plugin-pwa": "^0.14.7",
55
+ "vite-plugin-vue-layouts": "^0.8.0",
56
+ "vite-plugin-vue-markdown": "^0.23.4",
57
+ "vite-ssg": "^0.22.2",
58
+ "vite-ssg-sitemap": "^0.5.1",
55
59
  "vue-docgen-web-types": "^0.1.8",
56
- "@stacksjs/alias": "0.51.0",
57
- "@stacksjs/config": "0.51.0",
58
- "@stacksjs/path": "0.51.0",
59
- "@stacksjs/server": "0.51.0",
60
- "@stacksjs/types": "0.51.0",
61
- "@stacksjs/utils": "0.51.0"
60
+ "@stacksjs/alias": "0.52.0",
61
+ "@stacksjs/config": "0.52.0",
62
+ "@stacksjs/path": "0.52.0",
63
+ "@stacksjs/server": "0.52.0",
64
+ "@stacksjs/types": "0.52.0",
65
+ "@stacksjs/utils": "0.52.0"
62
66
  },
63
67
  "devDependencies": {
64
- "mkdist": "^1.1.0",
65
- "typescript": "^4.9.5",
66
- "@stacksjs/testing": "0.51.0"
68
+ "@stacksjs/development": "0.52.0"
67
69
  },
68
70
  "scripts": {
69
- "build": "mkdist -d",
70
- "dev": "mkdist -d",
71
+ "build": "unbuild",
72
+ "dev": "unbuild --stub",
71
73
  "typecheck": "tsc --noEmit"
72
74
  }
73
75
  }