@stacksjs/build 0.53.1 → 0.56.3

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/dist/index.d.ts CHANGED
@@ -1,7 +1,116 @@
1
- export * from './example-vue';
2
- export * from './example-wc';
3
- export * from './functions';
4
- export * from './pages';
5
- export * from './vue-components';
6
- export * from './web-components';
7
- export * from './stacks';
1
+ import * as vite from 'vite';
2
+ import { BuildOptions, PluginOption } from 'vite';
3
+ import { ViteConfig, InspectOptions, LayoutOptions, ComponentOptions, PagesOption, AutoImportsOptions } from '@stacksjs/types';
4
+ import { resolve } from '@stacksjs/path';
5
+
6
+ declare const vueComponentsExampleConfig: ViteConfig;
7
+ declare const _default$5: vite.UserConfigExport;
8
+
9
+ declare const exampleVue_vueComponentsExampleConfig: typeof vueComponentsExampleConfig;
10
+ declare namespace exampleVue {
11
+ export {
12
+ _default$5 as default,
13
+ exampleVue_vueComponentsExampleConfig as vueComponentsExampleConfig,
14
+ };
15
+ }
16
+
17
+ declare const webComponentsExampleConfig: ViteConfig;
18
+ declare const _default$4: vite.UserConfigExport;
19
+
20
+ declare const exampleWc_webComponentsExampleConfig: typeof webComponentsExampleConfig;
21
+ declare namespace exampleWc {
22
+ export {
23
+ _default$4 as default,
24
+ exampleWc_webComponentsExampleConfig as webComponentsExampleConfig,
25
+ };
26
+ }
27
+
28
+ declare const functionsConfig: ViteConfig;
29
+ declare function functionsBuildOptions(): BuildOptions;
30
+ declare const _default$3: vite.UserConfigExport;
31
+
32
+ declare const functions_functionsBuildOptions: typeof functionsBuildOptions;
33
+ declare const functions_functionsConfig: typeof functionsConfig;
34
+ declare namespace functions {
35
+ export {
36
+ _default$3 as default,
37
+ functions_functionsBuildOptions as functionsBuildOptions,
38
+ functions_functionsConfig as functionsConfig,
39
+ };
40
+ }
41
+
42
+ declare const pagesConfig: ViteConfig;
43
+ declare const _default$2: vite.UserConfigExport;
44
+
45
+ declare const views_pagesConfig: typeof pagesConfig;
46
+ declare namespace views {
47
+ export {
48
+ _default$2 as default,
49
+ views_pagesConfig as pagesConfig,
50
+ };
51
+ }
52
+
53
+ declare const vueComponentsConfig: ViteConfig;
54
+ declare function vueComponentsBuildOptions(): BuildOptions;
55
+ declare const _default$1: vite.UserConfigExport;
56
+
57
+ declare const vueComponents_vueComponentsBuildOptions: typeof vueComponentsBuildOptions;
58
+ declare const vueComponents_vueComponentsConfig: typeof vueComponentsConfig;
59
+ declare namespace vueComponents {
60
+ export {
61
+ _default$1 as default,
62
+ vueComponents_vueComponentsBuildOptions as vueComponentsBuildOptions,
63
+ vueComponents_vueComponentsConfig as vueComponentsConfig,
64
+ };
65
+ }
66
+
67
+ declare const webComponentsConfig: ViteConfig;
68
+ declare function webComponentsBuildOptions(): BuildOptions;
69
+ declare const _default: vite.UserConfigExport;
70
+
71
+ declare const webComponents_webComponentsBuildOptions: typeof webComponentsBuildOptions;
72
+ declare const webComponents_webComponentsConfig: typeof webComponentsConfig;
73
+ declare namespace webComponents {
74
+ export {
75
+ _default as default,
76
+ webComponents_webComponentsBuildOptions as webComponentsBuildOptions,
77
+ webComponents_webComponentsConfig as webComponentsConfig,
78
+ };
79
+ }
80
+
81
+ declare function inspect(options?: InspectOptions): vite.Plugin;
82
+ declare function layouts(options?: LayoutOptions): vite.Plugin;
83
+ declare function components(options?: ComponentOptions): PluginOption;
84
+ declare function pages(options?: PagesOption): vite.Plugin;
85
+ declare function autoImports(options?: AutoImportsOptions): any;
86
+ declare function cssEngine(isWebComponent?: boolean): vite.Plugin[];
87
+ declare function pwa(): vite.Plugin[];
88
+ declare function uiEngine(isWebComponent?: boolean): vite.Plugin;
89
+ declare function componentPreset(isWebComponent?: boolean): (vite.Plugin | vite.Plugin[])[];
90
+
91
+ declare const stacks_autoImports: typeof autoImports;
92
+ declare const stacks_componentPreset: typeof componentPreset;
93
+ declare const stacks_components: typeof components;
94
+ declare const stacks_cssEngine: typeof cssEngine;
95
+ declare const stacks_inspect: typeof inspect;
96
+ declare const stacks_layouts: typeof layouts;
97
+ declare const stacks_pages: typeof pages;
98
+ declare const stacks_pwa: typeof pwa;
99
+ declare const stacks_resolve: typeof resolve;
100
+ declare const stacks_uiEngine: typeof uiEngine;
101
+ declare namespace stacks {
102
+ export {
103
+ stacks_autoImports as autoImports,
104
+ stacks_componentPreset as componentPreset,
105
+ stacks_components as components,
106
+ stacks_cssEngine as cssEngine,
107
+ stacks_inspect as inspect,
108
+ stacks_layouts as layouts,
109
+ stacks_pages as pages,
110
+ stacks_pwa as pwa,
111
+ stacks_resolve as resolve,
112
+ stacks_uiEngine as uiEngine,
113
+ };
114
+ }
115
+
116
+ export { functions, stacks, views, exampleVue as vueComponentExample, vueComponents, exampleWc as webComponentExample, webComponents };
package/dist/index.mjs CHANGED
@@ -1,7 +1,456 @@
1
- export * from "./example-vue.mjs";
2
- export * from "./example-wc.mjs";
3
- export * from "./functions.mjs";
4
- export * from "./pages.mjs";
5
- export * from "./vue-components.mjs";
6
- export * from "./web-components.mjs";
7
- export * from "./stacks.mjs";
1
+ import { defineConfig, loadEnv } from 'vite';
2
+ import { examplesPath, functionsPath, projectPath, frameworkPath, libraryEntryPath, path, resolve, storagePath, libsPath } from '@stacksjs/path';
3
+ import { server } from '@stacksjs/server';
4
+ import { alias } from '@stacksjs/alias';
5
+ import { library, app } from '@stacksjs/config';
6
+ import mkcert from 'vite-plugin-mkcert';
7
+ import c from 'picocolors';
8
+ import AutoImport from 'unplugin-auto-import/vite';
9
+ import Components from 'unplugin-vue-components/vite';
10
+ import Vue from '@vitejs/plugin-vue';
11
+ import Unocss from 'unocss/vite';
12
+ import Inspect from 'vite-plugin-inspect';
13
+ import Pages from 'vite-plugin-pages';
14
+ import Layouts from 'vite-plugin-vue-layouts';
15
+ import { VitePWA } from 'vite-plugin-pwa';
16
+ import { defu } from 'defu';
17
+
18
+ const vueComponentsExampleConfig = {
19
+ root: examplesPath("vue-components"),
20
+ resolve: {
21
+ alias
22
+ },
23
+ server
24
+ // plugins: [
25
+ // uiEngine(),
26
+ // ],
27
+ };
28
+ const exampleVue = defineConfig(() => {
29
+ return vueComponentsExampleConfig;
30
+ });
31
+
32
+ const exampleVue$1 = {
33
+ __proto__: null,
34
+ default: exampleVue,
35
+ vueComponentsExampleConfig: vueComponentsExampleConfig
36
+ };
37
+
38
+ const webComponentsExampleConfig = {
39
+ root: examplesPath("web-components"),
40
+ resolve: {
41
+ alias
42
+ },
43
+ server
44
+ // plugins: [
45
+ // uiEngine(true),
46
+ // ],
47
+ };
48
+ const exampleWc = defineConfig(() => {
49
+ return webComponentsExampleConfig;
50
+ });
51
+
52
+ const exampleWc$1 = {
53
+ __proto__: null,
54
+ default: exampleWc,
55
+ webComponentsExampleConfig: webComponentsExampleConfig
56
+ };
57
+
58
+ const functionsConfig = {
59
+ root: functionsPath(),
60
+ envDir: projectPath(),
61
+ envPrefix: "",
62
+ resolve: {
63
+ alias
64
+ },
65
+ // plugins: [
66
+ // autoImports(),
67
+ // ],
68
+ build: functionsBuildOptions()
69
+ };
70
+ function functionsBuildOptions() {
71
+ return {
72
+ outDir: frameworkPath("functions/dist"),
73
+ emptyOutDir: true,
74
+ sourcemap: library.functions?.shouldGenerateSourcemap,
75
+ lib: {
76
+ entry: libraryEntryPath("functions"),
77
+ name: library.functions?.name,
78
+ formats: ["cjs", "es"],
79
+ fileName: (format) => {
80
+ if (format === "es")
81
+ return "index.mjs";
82
+ if (format === "cjs")
83
+ return "index.cjs";
84
+ return "index.?.js";
85
+ }
86
+ }
87
+ };
88
+ }
89
+ const functions = defineConfig(({ command }) => {
90
+ if (command === "serve")
91
+ return functionsConfig;
92
+ return functionsConfig;
93
+ });
94
+
95
+ const functions$1 = {
96
+ __proto__: null,
97
+ default: functions,
98
+ functionsBuildOptions: functionsBuildOptions,
99
+ functionsConfig: functionsConfig
100
+ };
101
+
102
+ const pagesConfig = {
103
+ root: functionsPath(),
104
+ envDir: projectPath(),
105
+ envPrefix: "FRONTEND_",
106
+ resolve: {
107
+ alias
108
+ },
109
+ plugins: [
110
+ // preview(),
111
+ // uiEngine(),
112
+ // pages(),
113
+ // cssEngine(),
114
+ // components(),
115
+ // layouts(),
116
+ // // i18n(),
117
+ // autoImports(),
118
+ // pwa(),
119
+ // inspect(),
120
+ ],
121
+ // https://github.com/antfu/vite-ssg
122
+ // ssgOptions: {
123
+ // script: 'async',
124
+ // formatting: 'minify',
125
+ // onFinished() { generateSitemap() },
126
+ // },
127
+ ssr: {
128
+ // TODO: workaround until they support native ESM
129
+ noExternal: ["workbox-window", /vue-i18n/]
130
+ }
131
+ };
132
+ const views = defineConfig(({ command }) => {
133
+ if (command === "serve")
134
+ return pagesConfig;
135
+ return pagesConfig;
136
+ });
137
+
138
+ const views$1 = {
139
+ __proto__: null,
140
+ default: views,
141
+ pagesConfig: pagesConfig
142
+ };
143
+
144
+ function inspect(options) {
145
+ return Inspect(options);
146
+ }
147
+ function layouts(options) {
148
+ return Layouts(options);
149
+ }
150
+ function components(options) {
151
+ const defaultOptions = {
152
+ // also allow auto-loading markdown components
153
+ extensions: ["vue", "md"],
154
+ include: [/\.vue$/, /\.vue\?vue/, /\.md$/],
155
+ dirs: [
156
+ path.componentsPath()
157
+ // pagesPath(),
158
+ ],
159
+ dts: path.frameworkPath("components.d.ts")
160
+ };
161
+ const newOptions = defu(options, defaultOptions);
162
+ return Components(newOptions);
163
+ }
164
+ function pages(options) {
165
+ const defaultOptions = {
166
+ extensions: ["vue", "md"],
167
+ dirs: [
168
+ path.pagesPath()
169
+ ]
170
+ };
171
+ const newOptions = defu(options, defaultOptions);
172
+ return Pages(newOptions);
173
+ }
174
+ function autoImports(options) {
175
+ const defaultOptions = {
176
+ imports: [
177
+ "vue",
178
+ "vue-router",
179
+ "vue/macros",
180
+ "vitest",
181
+ { "@stacksjs/ui": ["CssEngine", "UiEngine", "Store", "presetForms", "transformerCompileClass"] },
182
+ { "@stacksjs/logging": ["dd", "dump"] }
183
+ // we also export `log` in st stacks/cli
184
+ // { '@stacksjs/validation': ['validate', 'validateAll', 'validateSync', 'validateAllSync'] },
185
+ ],
186
+ dirs: [
187
+ path.resourcesPath("functions"),
188
+ path.resourcesPath("components"),
189
+ path.projectPath("config"),
190
+ // auto imported utilities start here
191
+ path.aiPath("src"),
192
+ path.arraysPath("src"),
193
+ path.authPath("src"),
194
+ path.cachePath("src"),
195
+ path.chatPath("src"),
196
+ path.cliPath("src"),
197
+ path.cloudPath("src"),
198
+ path.databasePath("src"),
199
+ path.datetimePath("src"),
200
+ path.desktopPath("src"),
201
+ path.errorHandlingPath("src"),
202
+ path.eventsPath("src"),
203
+ path.fakerPath("src"),
204
+ path.healthPath("src"),
205
+ path.lintPath("src"),
206
+ path.notificationsPath("src"),
207
+ path.objectsPath("src"),
208
+ path.ormPath("src"),
209
+ path.pathPath("src"),
210
+ path.paymentsPath("src"),
211
+ path.pushPath("src"),
212
+ path.queuePath("src"),
213
+ path.queryBuilderPath("src"),
214
+ path.realtimePath("src"),
215
+ path.routerPath("src"),
216
+ path.searchEnginePath("src"),
217
+ path.securityPath("src"),
218
+ path.signalsPath("src"),
219
+ path.smsPath("src"),
220
+ path.slugPath("src"),
221
+ path.storagePath("src"),
222
+ path.stringsPath("src"),
223
+ path.testingPath("src"),
224
+ path.utilsPath("src"),
225
+ path.validationPath("src")
226
+ ],
227
+ dts: path.frameworkPath("auto-imports.d.ts"),
228
+ vueTemplate: true,
229
+ eslintrc: {
230
+ enabled: false
231
+ // filepath: frameworkPath('.eslintrc-auto-import.json'),
232
+ }
233
+ };
234
+ const newOptions = defu(options, defaultOptions);
235
+ return AutoImport(newOptions);
236
+ }
237
+ function cssEngine(isWebComponent = false) {
238
+ return Unocss({
239
+ configFile: path.uiPath("src/unocss.ts"),
240
+ mode: isWebComponent ? "shadow-dom" : "vue-scoped"
241
+ });
242
+ }
243
+ function pwa() {
244
+ return VitePWA({
245
+ registerType: "autoUpdate",
246
+ includeAssets: ["favicon.svg", "safari-pinned-tab.svg"],
247
+ manifest: {
248
+ name: "Stacks",
249
+ short_name: "Stacks",
250
+ theme_color: "#ffffff",
251
+ icons: [
252
+ {
253
+ src: "/pwa-192x192.png",
254
+ sizes: "192x192",
255
+ type: "image/png"
256
+ },
257
+ {
258
+ src: "/pwa-512x512.png",
259
+ sizes: "512x512",
260
+ type: "image/png"
261
+ },
262
+ {
263
+ src: "/pwa-512x512.png",
264
+ sizes: "512x512",
265
+ type: "image/png",
266
+ purpose: "any maskable"
267
+ }
268
+ ]
269
+ }
270
+ });
271
+ }
272
+ function uiEngine(isWebComponent = false) {
273
+ if (isWebComponent) {
274
+ return Vue({
275
+ include: [/\.vue$/, /\.md$/],
276
+ template: {
277
+ compilerOptions: {
278
+ isCustomElement: () => true
279
+ }
280
+ }
281
+ });
282
+ }
283
+ return Vue({
284
+ include: [/\.vue$/, /\.md$/]
285
+ });
286
+ }
287
+ function componentPreset(isWebComponent = false) {
288
+ return [
289
+ // inspect,
290
+ uiEngine(isWebComponent),
291
+ cssEngine(isWebComponent)
292
+ // autoImports,
293
+ // components,
294
+ ];
295
+ }
296
+
297
+ const stacks = {
298
+ __proto__: null,
299
+ autoImports: autoImports,
300
+ componentPreset: componentPreset,
301
+ components: components,
302
+ cssEngine: cssEngine,
303
+ inspect: inspect,
304
+ layouts: layouts,
305
+ pages: pages,
306
+ pwa: pwa,
307
+ resolve: resolve,
308
+ uiEngine: uiEngine
309
+ };
310
+
311
+ const vueComponentsConfig = {
312
+ root: frameworkPath("libs/components/vue"),
313
+ base: frameworkPath(),
314
+ envDir: projectPath(),
315
+ envPrefix: "FRONTEND_",
316
+ publicDir: storagePath("public"),
317
+ server: {
318
+ https: true,
319
+ port: 3333,
320
+ open: true
321
+ },
322
+ resolve: {
323
+ dedupe: ["vue"],
324
+ alias
325
+ },
326
+ optimizeDeps: {
327
+ exclude: ["vue", "fsevents"]
328
+ },
329
+ plugins: [
330
+ // preview(),
331
+ uiEngine(),
332
+ cssEngine(),
333
+ autoImports(),
334
+ components(),
335
+ inspect(),
336
+ mkcert({
337
+ autoUpgrade: true,
338
+ savePath: libsPath("components/certs"),
339
+ keyFileName: library.name ? `library-${library.name}-key.pem` : "library-key.pem",
340
+ certFileName: library.name ? `library-${library.name}-cert.pem` : "library-cert.pem"
341
+ }),
342
+ {
343
+ // ...
344
+ configureServer(server) {
345
+ server.printUrls = () => {
346
+ const appUrl = app.url;
347
+ const frontendUrl = `https://${appUrl}`;
348
+ const backendUrl = `https://api.${appUrl}`;
349
+ const dashboardUrl = `https://admin.${appUrl}`;
350
+ const libraryUrl = `https://libs.${appUrl}`;
351
+ const docsUrl = `https://docs.${appUrl}`;
352
+ const inspectUrl = `https://${appUrl}/__inspect/`;
353
+ const stacksVersion = "alpha-0.x.x";
354
+ console.log(` ${c.blue(c.bold("STACKS"))} ${c.blue(stacksVersion)}`);
355
+ console.log(` ${c.green("\u279C")} ${c.bold("Frontend")}: ${c.green(frontendUrl)}`);
356
+ console.log(` ${c.green("\u279C")} ${c.bold("Backend")}: ${c.green(backendUrl)}`);
357
+ console.log(` ${c.green("\u279C")} ${c.bold("Dashboard")}: ${c.green(dashboardUrl)}`);
358
+ console.log(` ${c.green("\u279C")} ${c.bold("Library")}: ${c.green(libraryUrl)}`);
359
+ console.log(` ${c.green("\u279C")} ${c.bold("Docs")}: ${c.green(docsUrl)}`);
360
+ console.log(` ${c.green("\u279C")} ${c.dim("Inspect")}: ${c.green(inspectUrl)}`);
361
+ };
362
+ }
363
+ }
364
+ ],
365
+ build: vueComponentsBuildOptions()
366
+ };
367
+ function vueComponentsBuildOptions() {
368
+ return {
369
+ target: "esnext",
370
+ outDir: libsPath("components/vue/dist"),
371
+ emptyOutDir: true,
372
+ lib: {
373
+ entry: libraryEntryPath("vue-components"),
374
+ name: library.vueComponents?.name,
375
+ formats: ["cjs", "es"],
376
+ fileName: (format) => {
377
+ if (format === "es")
378
+ return "index.mjs";
379
+ if (format === "cjs")
380
+ return "index.cjs";
381
+ return "index.?.js";
382
+ }
383
+ },
384
+ rollupOptions: {
385
+ external: ["vue", "@stacksjs/alias"],
386
+ output: {
387
+ globals: {
388
+ vue: "Vue"
389
+ }
390
+ }
391
+ }
392
+ };
393
+ }
394
+ const vueComponents = defineConfig(({ command, mode }) => {
395
+ process.env = { ...process.env, ...loadEnv(mode, projectPath(), "") };
396
+ if (command === "serve")
397
+ return vueComponentsConfig;
398
+ return vueComponentsConfig;
399
+ });
400
+
401
+ const vueComponents$1 = {
402
+ __proto__: null,
403
+ default: vueComponents,
404
+ vueComponentsBuildOptions: vueComponentsBuildOptions,
405
+ vueComponentsConfig: vueComponentsConfig
406
+ };
407
+
408
+ const webComponentsConfig = {
409
+ root: frameworkPath("libs/components/web"),
410
+ envDir: projectPath(),
411
+ envPrefix: "FRONTEND_",
412
+ server,
413
+ resolve: {
414
+ alias
415
+ },
416
+ plugins: [
417
+ // inspect(),
418
+ // uiEngine(isWebComponent),
419
+ // cssEngine(isWebComponent),
420
+ // autoImports(),
421
+ // components(),
422
+ ],
423
+ build: webComponentsBuildOptions()
424
+ };
425
+ function webComponentsBuildOptions() {
426
+ return {
427
+ outDir: frameworkPath("components/web/dist"),
428
+ emptyOutDir: true,
429
+ lib: {
430
+ entry: libraryEntryPath("web-components"),
431
+ name: library.webComponents?.name,
432
+ formats: ["cjs", "es"],
433
+ fileName: (format) => {
434
+ if (format === "es")
435
+ return "index.mjs";
436
+ if (format === "cjs")
437
+ return "index.cjs";
438
+ return "index.?.js";
439
+ }
440
+ }
441
+ };
442
+ }
443
+ const webComponents = defineConfig(({ command }) => {
444
+ if (command === "serve")
445
+ return webComponentsConfig;
446
+ return webComponentsConfig;
447
+ });
448
+
449
+ const webComponents$1 = {
450
+ __proto__: null,
451
+ default: webComponents,
452
+ webComponentsBuildOptions: webComponentsBuildOptions,
453
+ webComponentsConfig: webComponentsConfig
454
+ };
455
+
456
+ export { functions$1 as functions, stacks, views$1 as views, exampleVue$1 as vueComponentExample, vueComponents$1 as vueComponents, exampleWc$1 as webComponentExample, webComponents$1 as webComponents };
package/package.json CHANGED
@@ -1,8 +1,8 @@
1
1
  {
2
2
  "name": "@stacksjs/build",
3
3
  "type": "module",
4
- "version": "0.53.1",
5
- "packageManager": "pnpm@8.5.1",
4
+ "version": "0.56.3",
5
+ "packageManager": "pnpm@8.6.5",
6
6
  "description": "The Stacks framework build tools and configurations.",
7
7
  "author": "Chris Breuer",
8
8
  "license": "MIT",
@@ -46,26 +46,27 @@
46
46
  "markdown-it-link-attributes": "^4.0.1",
47
47
  "markdown-it-shiki": "^0.9.0",
48
48
  "unbuild": "^1.2.1",
49
- "unplugin-auto-import": "^0.16.2",
50
- "unplugin-vue-components": "^0.24.1",
51
- "vite": "^4.3.8",
52
- "vite-plugin-inspect": "^0.7.28",
53
- "vite-plugin-pages": "^0.30.1",
54
- "vite-plugin-pwa": "^0.15.0",
49
+ "unplugin-auto-import": "^0.16.4",
50
+ "unplugin-vue-components": "^0.25.1",
51
+ "vite": "^4.3.9",
52
+ "vite-plugin-inspect": "^0.7.29",
53
+ "vite-plugin-pages": "^0.31.0",
54
+ "vite-plugin-pwa": "^0.16.4",
55
55
  "vite-plugin-vue-layouts": "^0.8.0",
56
56
  "vite-plugin-vue-markdown": "^0.23.5",
57
57
  "vite-ssg": "^0.22.2",
58
58
  "vite-ssg-sitemap": "^0.5.1",
59
59
  "vue-docgen-web-types": "^0.1.8",
60
- "@stacksjs/alias": "0.53.1",
61
- "@stacksjs/config": "0.53.1",
62
- "@stacksjs/path": "0.53.1",
63
- "@stacksjs/server": "0.53.1",
64
- "@stacksjs/types": "0.53.1",
65
- "@stacksjs/utils": "0.53.1"
60
+ "@stacksjs/config": "0.56.3",
61
+ "@stacksjs/path": "0.56.3",
62
+ "@stacksjs/server": "0.56.3",
63
+ "@stacksjs/types": "0.56.3",
64
+ "@stacksjs/utils": "0.56.3",
65
+ "@stacksjs/alias": "0.56.3"
66
66
  },
67
67
  "devDependencies": {
68
- "@stacksjs/development": "0.53.1"
68
+ "vite-plugin-mkcert": "^1.15.0",
69
+ "@stacksjs/development": "0.56.3"
69
70
  },
70
71
  "scripts": {
71
72
  "build": "unbuild",
package/dist/desktop.d.ts DELETED
@@ -1,2 +0,0 @@
1
- declare const _default: import("vite").UserConfigExport;
2
- export default _default;
package/dist/desktop.mjs DELETED
@@ -1,139 +0,0 @@
1
- import path from "node:path";
2
- import { defineConfig } from "vite";
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";
14
- export default defineConfig({
15
- resolve: {
16
- alias: {
17
- "~/": `${path.resolve(__dirname, "../../../../")}/`
18
- }
19
- },
20
- clearScreen: false,
21
- server: {
22
- port: 3333,
23
- strictPort: true
24
- },
25
- envPrefix: ["VITE_", "TAURI_"],
26
- plugins: [
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()
118
- ],
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/]
138
- }
139
- });
@@ -1,4 +0,0 @@
1
- import type { ViteConfig } from '@stacksjs/types';
2
- export declare const vueComponentsExampleConfig: ViteConfig;
3
- declare const _default: import("vite").UserConfigExport;
4
- export default _default;
@@ -1,18 +0,0 @@
1
- import { defineConfig } from "vite";
2
- import { examplesPath } from "@stacksjs/path";
3
- import { server } from "@stacksjs/server";
4
- import { alias } from "@stacksjs/alias";
5
- import { uiEngine } from "./index.mjs";
6
- export const vueComponentsExampleConfig = {
7
- root: examplesPath("vue-components"),
8
- resolve: {
9
- alias
10
- },
11
- server,
12
- plugins: [
13
- uiEngine()
14
- ]
15
- };
16
- export default defineConfig(() => {
17
- return vueComponentsExampleConfig;
18
- });
@@ -1,4 +0,0 @@
1
- import type { ViteConfig } from '@stacksjs/types';
2
- export declare const webComponentsExampleConfig: ViteConfig;
3
- declare const _default: import("vite").UserConfigExport;
4
- export default _default;
@@ -1,18 +0,0 @@
1
- import { defineConfig } from "vite";
2
- import { examplesPath } from "@stacksjs/path";
3
- import { server } from "@stacksjs/server";
4
- import { alias } from "@stacksjs/alias";
5
- import { uiEngine } from "./index.mjs";
6
- export const webComponentsExampleConfig = {
7
- root: examplesPath("web-components"),
8
- resolve: {
9
- alias
10
- },
11
- server,
12
- plugins: [
13
- uiEngine(true)
14
- ]
15
- };
16
- export default defineConfig(() => {
17
- return webComponentsExampleConfig;
18
- });
@@ -1,6 +0,0 @@
1
- import type { BuildOptions as ViteBuildOptions } from 'vite';
2
- import type { ViteConfig } from '@stacksjs/types';
3
- export declare const functionsConfig: ViteConfig;
4
- export declare function functionsBuildOptions(): ViteBuildOptions;
5
- declare const _default: import("vite").UserConfigExport;
6
- export default _default;
@@ -1,43 +0,0 @@
1
- import { defineConfig } from "vite";
2
- import { buildEntriesPath, frameworkPath, functionsPath, projectPath } from "@stacksjs/path";
3
- import { library } from "@stacksjs/config";
4
- import { alias } from "@stacksjs/alias";
5
- import { autoImports } from "./index.mjs";
6
- export const functionsConfig = {
7
- root: functionsPath(),
8
- envDir: projectPath(),
9
- envPrefix: "APP_",
10
- resolve: {
11
- alias
12
- },
13
- plugins: [
14
- autoImports()
15
- ],
16
- build: functionsBuildOptions()
17
- };
18
- export function functionsBuildOptions() {
19
- return {
20
- outDir: frameworkPath("functions/dist"),
21
- emptyOutDir: true,
22
- sourcemap: library.functions?.shouldGenerateSourcemap,
23
- lib: {
24
- entry: buildEntriesPath("functions.ts"),
25
- name: library.functions?.name,
26
- formats: library.functions?.shouldBuildIife ? ["cjs", "es", "iife"] : ["cjs", "es"],
27
- fileName: (format) => {
28
- if (format === "es")
29
- return "index.mjs";
30
- if (format === "cjs")
31
- return "index.cjs";
32
- if (format === "iife")
33
- return "index.iife.js";
34
- return "index.?.js";
35
- }
36
- }
37
- };
38
- }
39
- export default defineConfig(({ command }) => {
40
- if (command === "serve")
41
- return functionsConfig;
42
- return functionsConfig;
43
- });
package/dist/pages.d.ts DELETED
@@ -1,4 +0,0 @@
1
- import type { ViteConfig } from '@stacksjs/types';
2
- export declare const pagesConfig: ViteConfig;
3
- declare const _default: import("vite").UserConfigExport;
4
- export default _default;
package/dist/pages.mjs DELETED
@@ -1,40 +0,0 @@
1
- import { defineConfig } from "vite";
2
- import { functionsPath, projectPath } from "@stacksjs/path";
3
- import { alias } from "@stacksjs/alias";
4
- import { autoImports, components, cssEngine, inspect, layouts, markdown, pages, pwa, uiEngine } from "./index.mjs";
5
- export const pagesConfig = {
6
- root: functionsPath(),
7
- envDir: projectPath(),
8
- envPrefix: "APP_",
9
- resolve: {
10
- alias
11
- },
12
- plugins: [
13
- // preview(),
14
- uiEngine(),
15
- pages(),
16
- cssEngine(),
17
- components(),
18
- layouts(),
19
- // i18n(),
20
- markdown(),
21
- autoImports(),
22
- pwa(),
23
- inspect()
24
- ],
25
- // https://github.com/antfu/vite-ssg
26
- // ssgOptions: {
27
- // script: 'async',
28
- // formatting: 'minify',
29
- // onFinished() { generateSitemap() },
30
- // },
31
- ssr: {
32
- // TODO: workaround until they support native ESM
33
- noExternal: ["workbox-window", /vue-i18n/]
34
- }
35
- };
36
- export default defineConfig(({ command }) => {
37
- if (command === "serve")
38
- return pagesConfig;
39
- return pagesConfig;
40
- });
package/dist/stacks.d.ts DELETED
@@ -1,14 +0,0 @@
1
- import type { PluginOption } from 'vite';
2
- import type { AutoImportsOptions, ComponentOptions, InspectOptions, LayoutOptions, MarkdownOptions, PagesOption } from '@stacksjs/types';
3
- import { resolve } from '@stacksjs/path';
4
- declare function inspect(options?: InspectOptions): import("vite").Plugin;
5
- declare function layouts(options?: LayoutOptions): import("vite").Plugin;
6
- declare function components(options?: ComponentOptions): PluginOption;
7
- declare function pages(options?: PagesOption): import("vite").Plugin;
8
- declare function markdown(options?: MarkdownOptions): import("vite").Plugin;
9
- declare function autoImports(options?: AutoImportsOptions): any;
10
- declare function cssEngine(isWebComponent?: boolean): import("vite").Plugin[];
11
- declare function pwa(): import("vite").Plugin[];
12
- declare function uiEngine(isWebComponent?: boolean): import("vite").Plugin;
13
- declare function componentPreset(isWebComponent?: boolean): PluginOption;
14
- export { resolve, componentPreset, uiEngine, autoImports, cssEngine, components, inspect, markdown, pages, pwa, layouts };
package/dist/stacks.mjs DELETED
@@ -1,177 +0,0 @@
1
- import AutoImport from "unplugin-auto-import/vite";
2
- import Components from "unplugin-vue-components/vite";
3
- import Vue from "@vitejs/plugin-vue";
4
- import Unocss from "unocss/vite";
5
- import Inspect from "vite-plugin-inspect";
6
- import Pages from "vite-plugin-pages";
7
- import Layouts from "vite-plugin-vue-layouts";
8
- import Markdown from "vite-plugin-vue-markdown";
9
- import LinkAttributes from "markdown-it-link-attributes";
10
- import Shiki from "markdown-it-shiki";
11
- import { VitePWA } from "vite-plugin-pwa";
12
- import { defu } from "defu";
13
- import { path as p, resolve } from "@stacksjs/path";
14
- function inspect(options) {
15
- return Inspect(options);
16
- }
17
- function layouts(options) {
18
- return Layouts(options);
19
- }
20
- function components(options) {
21
- const defaultOptions = {
22
- // also allow auto-loading markdown components
23
- extensions: ["vue", "md"],
24
- include: [/\.vue$/, /\.vue\?vue/, /\.md$/],
25
- dirs: [
26
- p.componentsPath()
27
- // pagesPath(),
28
- ],
29
- dts: p.frameworkPath("components.d.ts")
30
- };
31
- const newOptions = defu(options, defaultOptions);
32
- return Components(newOptions);
33
- }
34
- function pages(options) {
35
- const defaultOptions = {
36
- extensions: ["vue", "md"],
37
- dirs: [
38
- p.pagesPath()
39
- ]
40
- };
41
- const newOptions = defu(options, defaultOptions);
42
- return Pages(newOptions);
43
- }
44
- function markdown(options) {
45
- const defaultOptions = {
46
- wrapperClasses: "prose prose-sm m-auto text-left",
47
- headEnabled: true,
48
- markdownItSetup(md) {
49
- md.use(Shiki, {
50
- theme: "nord"
51
- });
52
- md.use(LinkAttributes, {
53
- matcher: (link) => /^https?:\/\//.test(link),
54
- attrs: {
55
- target: "_blank",
56
- rel: "noopener"
57
- }
58
- });
59
- }
60
- };
61
- const newOptions = defu(options, defaultOptions);
62
- return Markdown(newOptions);
63
- }
64
- function autoImports(options) {
65
- const defaultOptions = {
66
- imports: [
67
- "vue",
68
- "vue-router",
69
- "vue/macros",
70
- "vitest",
71
- { "@stacksjs/ui": ["CssEngine", "UiEngine", "Store", "presetForms", "transformerCompileClass"] }
72
- ],
73
- dirs: [
74
- p.projectPath("functions"),
75
- p.projectPath("components"),
76
- p.projectPath("config"),
77
- // auto imported utilities start here
78
- p.aiPath("src"),
79
- p.arraysPath("src"),
80
- p.authPath("src"),
81
- p.cachePath("src"),
82
- p.chatPath("src"),
83
- p.databasePath("src"),
84
- p.desktopPath("src"),
85
- p.errorHandlingPath("src"),
86
- p.healthPath("src"),
87
- p.lintPath("src"),
88
- p.loggingPath("src"),
89
- p.notificationsPath("src"),
90
- p.objectsPath("src"),
91
- p.pathPath("src"),
92
- p.paymentsPath("src"),
93
- p.pushPath("src"),
94
- p.queuePath("src"),
95
- p.realtimePath("src"),
96
- p.routerPath("src"),
97
- p.searchEnginePath("src"),
98
- p.securityPath("src"),
99
- p.smsPath("src"),
100
- p.storagePath("src"),
101
- p.stringsPath("src"),
102
- p.tablesPath("src"),
103
- p.testingPath("src"),
104
- p.utilsPath("src"),
105
- p.validationPath("src")
106
- ],
107
- dts: p.frameworkPath("auto-imports.d.ts"),
108
- vueTemplate: true,
109
- eslintrc: {
110
- enabled: false
111
- // filepath: frameworkPath('.eslintrc-auto-import.json'),
112
- }
113
- };
114
- const newOptions = defu(options, defaultOptions);
115
- return AutoImport(newOptions);
116
- }
117
- function cssEngine(isWebComponent = false) {
118
- return Unocss({
119
- configFile: p.uiPath("src/unocss.ts"),
120
- mode: isWebComponent ? "shadow-dom" : "vue-scoped"
121
- });
122
- }
123
- function pwa() {
124
- return VitePWA({
125
- registerType: "autoUpdate",
126
- includeAssets: ["favicon.svg", "safari-pinned-tab.svg"],
127
- manifest: {
128
- name: "Stacks",
129
- short_name: "Stacks",
130
- theme_color: "#ffffff",
131
- icons: [
132
- {
133
- src: "/pwa-192x192.png",
134
- sizes: "192x192",
135
- type: "image/png"
136
- },
137
- {
138
- src: "/pwa-512x512.png",
139
- sizes: "512x512",
140
- type: "image/png"
141
- },
142
- {
143
- src: "/pwa-512x512.png",
144
- sizes: "512x512",
145
- type: "image/png",
146
- purpose: "any maskable"
147
- }
148
- ]
149
- }
150
- });
151
- }
152
- function uiEngine(isWebComponent = false) {
153
- if (isWebComponent) {
154
- return Vue({
155
- include: [/\.vue$/, /\.md$/],
156
- template: {
157
- compilerOptions: {
158
- isCustomElement: () => true
159
- }
160
- }
161
- });
162
- }
163
- return Vue({
164
- include: [/\.vue$/, /\.md$/]
165
- });
166
- }
167
- function componentPreset(isWebComponent = false) {
168
- return [
169
- inspect,
170
- uiEngine(isWebComponent),
171
- cssEngine(isWebComponent),
172
- autoImports,
173
- components,
174
- markdown
175
- ];
176
- }
177
- export { resolve, componentPreset, uiEngine, autoImports, cssEngine, components, inspect, markdown, pages, pwa, layouts };
@@ -1,6 +0,0 @@
1
- import type { ViteConfig } from '@stacksjs/types';
2
- import type { BuildOptions as ViteBuildOptions } from 'vite';
3
- export declare const vueComponentsConfig: ViteConfig;
4
- export declare function vueComponentsBuildOptions(): ViteBuildOptions;
5
- declare const _default: import("vite").UserConfigExport;
6
- export default _default;
@@ -1,61 +0,0 @@
1
- import { defineConfig } from "vite";
2
- import { buildEntriesPath, frameworkPath, projectPath } from "@stacksjs/path";
3
- import { library } from "@stacksjs/config";
4
- import { alias } from "@stacksjs/alias";
5
- import { autoImports, components, cssEngine, inspect, uiEngine } from "./stacks.mjs";
6
- export const vueComponentsConfig = {
7
- root: frameworkPath("components/vue"),
8
- envDir: projectPath(),
9
- envPrefix: "APP_",
10
- server: {
11
- port: 3333,
12
- open: true
13
- },
14
- resolve: {
15
- dedupe: ["vue"],
16
- alias
17
- },
18
- optimizeDeps: {
19
- exclude: ["vue", "fsevents", "@novu/mandrill", "@maizzle/framework", "browser-sync-ui"]
20
- },
21
- plugins: [
22
- // preview(),
23
- uiEngine(),
24
- cssEngine(),
25
- autoImports(),
26
- components(),
27
- inspect()
28
- ],
29
- build: vueComponentsBuildOptions()
30
- };
31
- export function vueComponentsBuildOptions() {
32
- return {
33
- outDir: frameworkPath("components/vue/dist"),
34
- emptyOutDir: true,
35
- lib: {
36
- entry: buildEntriesPath("vue-components.ts"),
37
- name: library.vueComponents?.name,
38
- formats: ["cjs", "es"],
39
- fileName: (format) => {
40
- if (format === "es")
41
- return "index.mjs";
42
- if (format === "cjs")
43
- return "index.cjs";
44
- return "index.?.js";
45
- }
46
- },
47
- rollupOptions: {
48
- external: ["vue"],
49
- output: {
50
- globals: {
51
- vue: "Vue"
52
- }
53
- }
54
- }
55
- };
56
- }
57
- export default defineConfig(({ command }) => {
58
- if (command === "serve")
59
- return vueComponentsConfig;
60
- return vueComponentsConfig;
61
- });
@@ -1,6 +0,0 @@
1
- import type { BuildOptions as ViteBuildOptions } from 'vite';
2
- import type { ViteConfig } from '@stacksjs/types';
3
- export declare const webComponentsConfig: ViteConfig;
4
- export declare function webComponentsBuildOptions(): ViteBuildOptions;
5
- declare const _default: import("vite").UserConfigExport;
6
- export default _default;
@@ -1,47 +0,0 @@
1
- import { defineConfig } from "vite";
2
- import { buildEntriesPath, componentsPath, frameworkPath, projectPath } from "@stacksjs/path";
3
- import { library } from "@stacksjs/config";
4
- import { server } from "@stacksjs/server";
5
- import { alias } from "@stacksjs/alias";
6
- import { autoImports, components, cssEngine, inspect, uiEngine } from "./index.mjs";
7
- const isWebComponent = true;
8
- export const webComponentsConfig = {
9
- root: componentsPath(),
10
- envDir: projectPath(),
11
- envPrefix: "APP_",
12
- server,
13
- resolve: {
14
- alias
15
- },
16
- plugins: [
17
- inspect(),
18
- uiEngine(isWebComponent),
19
- cssEngine(isWebComponent),
20
- autoImports(),
21
- components()
22
- ],
23
- build: webComponentsBuildOptions()
24
- };
25
- export function webComponentsBuildOptions() {
26
- return {
27
- outDir: frameworkPath("components/web/dist"),
28
- emptyOutDir: true,
29
- lib: {
30
- entry: buildEntriesPath("web-components.ts"),
31
- name: library.webComponents?.name,
32
- formats: ["cjs", "es"],
33
- fileName: (format) => {
34
- if (format === "es")
35
- return "index.mjs";
36
- if (format === "cjs")
37
- return "index.cjs";
38
- return "index.?.js";
39
- }
40
- }
41
- };
42
- }
43
- export default defineConfig(({ command }) => {
44
- if (command === "serve")
45
- return webComponentsConfig;
46
- return webComponentsConfig;
47
- });