@mgz-app/viteforge 1.0.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.
Files changed (37) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +738 -0
  3. package/dist/index.cjs +3359 -0
  4. package/dist/index.d.ts +319 -0
  5. package/dist/index.d.ts.map +1 -0
  6. package/dist/index.mjs +3319 -0
  7. package/dist/plugins/base64-assets.d.ts +3 -0
  8. package/dist/plugins/base64-assets.d.ts.map +1 -0
  9. package/dist/plugins/calculate-built-size.d.ts +6 -0
  10. package/dist/plugins/calculate-built-size.d.ts.map +1 -0
  11. package/dist/plugins/dev-reload.d.ts +31 -0
  12. package/dist/plugins/dev-reload.d.ts.map +1 -0
  13. package/dist/plugins/glsl/index.d.ts +5 -0
  14. package/dist/plugins/glsl/index.d.ts.map +1 -0
  15. package/dist/plugins/glsl/load-shader.d.ts +4 -0
  16. package/dist/plugins/glsl/load-shader.d.ts.map +1 -0
  17. package/dist/plugins/glsl/types.d.ts +21 -0
  18. package/dist/plugins/glsl/types.d.ts.map +1 -0
  19. package/dist/plugins/glsl-import.d.ts +4 -0
  20. package/dist/plugins/glsl-import.d.ts.map +1 -0
  21. package/dist/plugins/index.cjs +3038 -0
  22. package/dist/plugins/index.d.ts +11 -0
  23. package/dist/plugins/index.d.ts.map +1 -0
  24. package/dist/plugins/index.mjs +3017 -0
  25. package/dist/plugins/inject-nonce.d.ts +6 -0
  26. package/dist/plugins/inject-nonce.d.ts.map +1 -0
  27. package/dist/plugins/post-processing.d.ts +46 -0
  28. package/dist/plugins/post-processing.d.ts.map +1 -0
  29. package/dist/plugins/restart-on-rebuild.d.ts +36 -0
  30. package/dist/plugins/restart-on-rebuild.d.ts.map +1 -0
  31. package/dist/plugins/text-file.d.ts +17 -0
  32. package/dist/plugins/text-file.d.ts.map +1 -0
  33. package/dist/plugins/txt-loader.d.ts +3 -0
  34. package/dist/plugins/txt-loader.d.ts.map +1 -0
  35. package/dist/plugins/worker.d.ts +7 -0
  36. package/dist/plugins/worker.d.ts.map +1 -0
  37. package/package.json +75 -0
@@ -0,0 +1,3 @@
1
+ import type { Plugin } from "vite";
2
+ export declare function base64AssetPlugin(): Plugin;
3
+ //# sourceMappingURL=base64-assets.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"base64-assets.d.ts","sourceRoot":"","sources":["../../src/plugins/base64-assets.ts"],"names":[],"mappings":"AAMA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,MAAM,CAAC;AAInC,wBAAgB,iBAAiB,IAAI,MAAM,CAiF1C"}
@@ -0,0 +1,6 @@
1
+ import type { Plugin } from "vite";
2
+ export interface CalculateBuiltSizePluginOptions {
3
+ outputDir?: string;
4
+ }
5
+ export declare function calculateBuiltSizePlugin(options?: CalculateBuiltSizePluginOptions): Plugin;
6
+ //# sourceMappingURL=calculate-built-size.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"calculate-built-size.d.ts","sourceRoot":"","sources":["../../src/plugins/calculate-built-size.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,MAAM,CAAC;AAEnC,MAAM,WAAW,+BAA+B;IAC9C,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB;AAED,wBAAgB,wBAAwB,CAAC,OAAO,GAAE,+BAAoC,GAAG,MAAM,CAsD9F"}
@@ -0,0 +1,31 @@
1
+ import type { Plugin } from "vite";
2
+ export interface DevReloadPluginOptions {
3
+ /**
4
+ * Port for the WebSocket server that notifies clients of rebuilds.
5
+ * @default 21816
6
+ */
7
+ port?: number;
8
+ }
9
+ /**
10
+ * Vite plugin that starts a lightweight WebSocket server during `vite build --watch`.
11
+ * When a rebuild completes, all connected browser clients receive a "change" message.
12
+ *
13
+ * Pair with `devReloadClientScript()` to inject the client-side reload snippet.
14
+ */
15
+ export declare function devReloadPlugin(options?: DevReloadPluginOptions): Plugin;
16
+ /**
17
+ * Returns a self-executing script snippet that connects to the dev-reload
18
+ * WebSocket server and reloads the page when a rebuild is detected.
19
+ *
20
+ * Inject this into your client HTML during development builds only.
21
+ *
22
+ * @example
23
+ * ```ts
24
+ * // As a Vite banner or script tag
25
+ * const snippet = devReloadClientScript({ port: 21816 });
26
+ * ```
27
+ */
28
+ export declare function devReloadClientScript(options?: {
29
+ port?: number;
30
+ }): string;
31
+ //# sourceMappingURL=dev-reload.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"dev-reload.d.ts","sourceRoot":"","sources":["../../src/plugins/dev-reload.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,MAAM,CAAC;AAEnC,MAAM,WAAW,sBAAsB;IACrC;;;OAGG;IACH,IAAI,CAAC,EAAE,MAAM,CAAC;CACf;AAqFD;;;;;GAKG;AACH,wBAAgB,eAAe,CAAC,OAAO,GAAE,sBAA2B,GAAG,MAAM,CAsE5E;AAED;;;;;;;;;;;GAWG;AACH,wBAAgB,qBAAqB,CAAC,OAAO,GAAE;IAAE,IAAI,CAAC,EAAE,MAAM,CAAA;CAAO,GAAG,MAAM,CAI7E"}
@@ -0,0 +1,5 @@
1
+ export { minifyShader as minify } from "./load-shader";
2
+ import type { PluginOptions } from "./types";
3
+ import type { Plugin } from "vite";
4
+ export default function glsl({ include, exclude, defaultExtension, warnDuplicatedImports, removeDuplicatedImports, importKeywords, onComplete, minify, watch, root }?: PluginOptions): Promise<Plugin>;
5
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/plugins/glsl/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,IAAI,MAAM,EAAE,MAAM,eAAe,CAAC;AAKvD,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,SAAS,CAAC;AAC7C,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,MAAM,CAAC;AAEnC,wBAA8B,IAAI,CAAC,EACjC,OAAoF,EACpF,OAAmB,EACnB,gBAAyB,EACzB,qBAA4B,EAC5B,uBAA+B,EAC/B,cAA6B,EAC7B,UAAsB,EACtB,MAAc,EACd,KAAY,EACZ,IAAU,EACX,GAAE,aAAkB,GAAG,OAAO,CAAC,MAAM,CAAC,CAsEtC"}
@@ -0,0 +1,4 @@
1
+ import type { LoadingOptions, LoadingOutput } from "./types";
2
+ export declare function minifyShader(shader: string, newLine?: boolean): string;
3
+ export default function loadShader(source: string, shader: string, options: LoadingOptions): Promise<LoadingOutput>;
4
+ //# sourceMappingURL=load-shader.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"load-shader.d.ts","sourceRoot":"","sources":["../../../src/plugins/glsl/load-shader.ts"],"names":[],"mappings":"AAKA,OAAO,KAAK,EAAE,cAAc,EAAE,aAAa,EAAE,MAAM,SAAS,CAAC;AA0F7D,wBAAgB,YAAY,CAAC,MAAM,EAAE,MAAM,EAAE,OAAO,UAAQ,GAAG,MAAM,CAmDpE;AAmED,wBAA8B,UAAU,CACtC,MAAM,EAAE,MAAM,EACd,MAAM,EAAE,MAAM,EACd,OAAO,EAAE,cAAc,GACtB,OAAO,CAAC,aAAa,CAAC,CAcxB"}
@@ -0,0 +1,21 @@
1
+ export type OnComplete = ((shader: string, path: string) => Promise<string> | string) | undefined;
2
+ export type GlobPattern = string | string[];
3
+ export interface LoadingOptions {
4
+ warnDuplicatedImports: boolean;
5
+ removeDuplicatedImports: boolean;
6
+ defaultExtension: string;
7
+ importKeywords: string[];
8
+ onComplete: OnComplete;
9
+ minify: boolean;
10
+ root: string;
11
+ }
12
+ export type PluginOptions = Partial<LoadingOptions> & {
13
+ include?: GlobPattern;
14
+ exclude?: GlobPattern;
15
+ watch?: boolean;
16
+ };
17
+ export interface LoadingOutput {
18
+ dependentChunks: Map<string, string[]>;
19
+ outputShader: string;
20
+ }
21
+ //# sourceMappingURL=types.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../src/plugins/glsl/types.ts"],"names":[],"mappings":"AAAA,MAAM,MAAM,UAAU,GAAG,CAAC,CAAC,MAAM,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,KAAK,OAAO,CAAC,MAAM,CAAC,GAAG,MAAM,CAAC,GAAG,SAAS,CAAC;AAElG,MAAM,MAAM,WAAW,GAAG,MAAM,GAAG,MAAM,EAAE,CAAC;AAE5C,MAAM,WAAW,cAAc;IAC7B,qBAAqB,EAAE,OAAO,CAAC;IAC/B,uBAAuB,EAAE,OAAO,CAAC;IACjC,gBAAgB,EAAE,MAAM,CAAC;IACzB,cAAc,EAAE,MAAM,EAAE,CAAC;IACzB,UAAU,EAAE,UAAU,CAAC;IACvB,MAAM,EAAE,OAAO,CAAC;IAChB,IAAI,EAAE,MAAM,CAAC;CACd;AAED,MAAM,MAAM,aAAa,GAAG,OAAO,CAAC,cAAc,CAAC,GAAG;IACpD,OAAO,CAAC,EAAE,WAAW,CAAC;IACtB,OAAO,CAAC,EAAE,WAAW,CAAC;IACtB,KAAK,CAAC,EAAE,OAAO,CAAC;CACjB,CAAC;AAEF,MAAM,WAAW,aAAa;IAC5B,eAAe,EAAE,GAAG,CAAC,MAAM,EAAE,MAAM,EAAE,CAAC,CAAC;IACvC,YAAY,EAAE,MAAM,CAAC;CACtB"}
@@ -0,0 +1,4 @@
1
+ import type { PluginOption } from "vite";
2
+ declare function getGLSLPlugin(): Promise<PluginOption>;
3
+ export { getGLSLPlugin };
4
+ //# sourceMappingURL=glsl-import.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"glsl-import.d.ts","sourceRoot":"","sources":["../../src/plugins/glsl-import.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,MAAM,CAAC;AAEzC,iBAAe,aAAa,IAAI,OAAO,CAAC,YAAY,CAAC,CAIpD;AAED,OAAO,EAAE,aAAa,EAAE,CAAC"}