@stacksjs/build 0.51.0 → 0.52.1

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
@@ -1,14 +1,14 @@
1
1
  import type { PluginOption } from 'vite';
2
- import type { AutoImportsOptions, ComponentOptions, InspectOptions, LayoutOptions, MarkdownOptions, PagesOptions } from '@stacksjs/types';
2
+ import type { AutoImportsOptions, ComponentOptions, InspectOptions, LayoutOptions, MarkdownOptions, PagesOption } from '@stacksjs/types';
3
3
  import { resolve } from '@stacksjs/path';
4
4
  declare function inspect(options?: InspectOptions): import("vite").Plugin;
5
5
  declare function layouts(options?: LayoutOptions): import("vite").Plugin;
6
6
  declare function components(options?: ComponentOptions): PluginOption;
7
- declare function pages(options?: PagesOptions): import("vite").Plugin;
7
+ declare function pages(options?: PagesOption): import("vite").Plugin;
8
8
  declare function markdown(options?: MarkdownOptions): import("vite").Plugin;
9
9
  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
@@ -10,7 +10,7 @@ import LinkAttributes from "markdown-it-link-attributes";
10
10
  import Shiki from "markdown-it-shiki";
11
11
  import { VitePWA } from "vite-plugin-pwa";
12
12
  import { defu } from "defu";
13
- import p, { resolve } from "@stacksjs/path";
13
+ import { path as p, resolve } from "@stacksjs/path";
14
14
  function inspect(options) {
15
15
  return Inspect(options);
16
16
  }
@@ -67,29 +67,22 @@ function autoImports(options) {
67
67
  "vue",
68
68
  "vue-router",
69
69
  "vue/macros",
70
- "@vueuse/core",
71
- "@vueuse/head",
72
- "@vueuse/math",
73
70
  "vitest",
74
- { "@vueuse/shared": ["isClient", "isDef", "isBoolean", "isFunction", "isNumber", "isString", "isObject", "isWindow", "now", "timestamp", "clamp", "noop", "rand", "isIOS", "hasOwn"] }
71
+ { "@stacksjs/ui": ["CssEngine", "UiEngine", "Store", "presetForms", "transformerCompileClass"] }
75
72
  ],
76
73
  dirs: [
77
- p.functionsPath(),
78
- p.componentsPath(),
74
+ p.projectPath("functions"),
75
+ p.projectPath("components"),
79
76
  p.projectPath("config"),
80
77
  // auto imported utilities start here
81
78
  p.aiPath("src"),
82
79
  p.arraysPath("src"),
83
80
  p.authPath("src"),
84
- p.authPath("src"),
85
81
  p.cachePath("src"),
86
82
  p.chatPath("src"),
87
- p.collectionsPath("src"),
88
83
  p.databasePath("src"),
89
84
  p.desktopPath("src"),
90
- p.emailPath("src"),
91
85
  p.errorHandlingPath("src"),
92
- p.eventsPath("src"),
93
86
  p.healthPath("src"),
94
87
  p.lintPath("src"),
95
88
  p.loggingPath("src"),
@@ -107,9 +100,7 @@ function autoImports(options) {
107
100
  p.storagePath("src"),
108
101
  p.stringsPath("src"),
109
102
  p.tablesPath("src"),
110
- p.stringsPath("src"),
111
103
  p.testingPath("src"),
112
- p.uiPath("src"),
113
104
  p.utilsPath("src"),
114
105
  p.validationPath("src")
115
106
  ],
@@ -173,12 +164,14 @@ function uiEngine(isWebComponent = false) {
173
164
  include: [/\.vue$/, /\.md$/]
174
165
  });
175
166
  }
176
- const componentPreset = (isWebComponent = false) => [
177
- inspect,
178
- uiEngine(isWebComponent),
179
- cssEngine(isWebComponent),
180
- autoImports,
181
- components,
182
- markdown
183
- ];
167
+ function componentPreset(isWebComponent = false) {
168
+ return [
169
+ inspect,
170
+ uiEngine(isWebComponent),
171
+ cssEngine(isWebComponent),
172
+ autoImports,
173
+ components,
174
+ markdown
175
+ ];
176
+ }
184
177
  export { resolve, componentPreset, uiEngine, autoImports, cssEngine, components, inspect, markdown, pages, pwa, layouts };
@@ -1,20 +1,22 @@
1
1
  import { defineConfig } from "vite";
2
2
  import { buildEntriesPath, frameworkPath, projectPath } from "@stacksjs/path";
3
3
  import { library } from "@stacksjs/config";
4
- import { server } from "@stacksjs/server";
5
4
  import { alias } from "@stacksjs/alias";
6
5
  import { autoImports, components, cssEngine, inspect, uiEngine } from "./stacks.mjs";
7
6
  export const vueComponentsConfig = {
8
7
  root: frameworkPath("components/vue"),
9
8
  envDir: projectPath(),
10
9
  envPrefix: "APP_",
11
- server,
10
+ server: {
11
+ port: 3333,
12
+ open: true
13
+ },
12
14
  resolve: {
13
15
  dedupe: ["vue"],
14
16
  alias
15
17
  },
16
18
  optimizeDeps: {
17
- exclude: ["vue"]
19
+ exclude: ["vue", "fsevents", "@novu/mandrill", "@maizzle/framework", "browser-sync-ui"]
18
20
  },
19
21
  plugins: [
20
22
  // preview(),
@@ -32,7 +34,7 @@ export function vueComponentsBuildOptions() {
32
34
  emptyOutDir: true,
33
35
  lib: {
34
36
  entry: buildEntriesPath("vue-components.ts"),
35
- name: library.vueComponents.name,
37
+ name: library.vueComponents?.name,
36
38
  formats: ["cjs", "es"],
37
39
  fileName: (format) => {
38
40
  if (format === "es")
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.1",
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.8",
52
+ "vite-plugin-inspect": "^0.7.26",
53
+ "vite-plugin-pages": "^0.30.1",
54
+ "vite-plugin-pwa": "^0.15.0",
55
+ "vite-plugin-vue-layouts": "^0.8.0",
56
+ "vite-plugin-vue-markdown": "^0.23.5",
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.1",
61
+ "@stacksjs/config": "0.52.1",
62
+ "@stacksjs/path": "0.52.1",
63
+ "@stacksjs/server": "0.52.1",
64
+ "@stacksjs/types": "0.52.1",
65
+ "@stacksjs/utils": "0.52.1"
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.1"
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
  }