olovaplugin 1.0.5 → 1.0.6

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 ADDED
@@ -0,0 +1,33 @@
1
+ # olova-plugins
2
+
3
+ A collection of Vite plugins for the Olova framework.
4
+
5
+ ## Installation
6
+
7
+ ```bash
8
+ npm install olova-plugins
9
+ ```
10
+
11
+ ## Usage
12
+
13
+ In your `vite.config.ts`:
14
+
15
+ ```ts
16
+ import { defineConfig } from "vite";
17
+ import { olovaPlugins } from "olova-plugins";
18
+
19
+ export default defineConfig({
20
+ plugins: [olovaPlugins()],
21
+ });
22
+ ```
23
+
24
+ ## Includes
25
+
26
+ - Config Plugin
27
+ - Router Plugin
28
+ - Framework Plugin
29
+ - Virtual HTML Plugin
30
+ - SSG Plugin
31
+ - Clean URL Plugin
32
+ - Auto Generate Plugin
33
+ - Error Overlay Plugin
@@ -0,0 +1,123 @@
1
+ import { Plugin } from 'vite';
2
+
3
+ declare function configPlugin(): Plugin;
4
+
5
+ declare function routerPlugin(): Plugin;
6
+
7
+ declare function frameworkPlugin(): Plugin;
8
+
9
+ declare function virtualHtmlPlugin(): Plugin;
10
+
11
+ declare function ssgPlugin(): Plugin;
12
+
13
+ declare function cleanUrlPlugin(): Plugin;
14
+
15
+ declare function autoGeneratePlugin(): Plugin;
16
+
17
+ declare function proactiveErrorPlugin(): Plugin;
18
+
19
+ declare function minifyHtml(html: string): string;
20
+ declare function generateBuildId(): string;
21
+ declare function generateResourceHints(): string;
22
+ declare function generateCriticalCSS(): string;
23
+ declare function generateServiceWorkerScript(): string;
24
+ declare function generateServiceWorkerContent(buildId: string, assets: string[]): string;
25
+ declare function generatePerformanceMeta(): string;
26
+
27
+ interface OlovaHydrationData {
28
+ route: string;
29
+ metadata?: Record<string, unknown>;
30
+ params?: Record<string, string>;
31
+ chunks?: string[];
32
+ isStatic?: boolean;
33
+ }
34
+ declare function generateOlovaHydration(data: OlovaHydrationData, buildId: string): string;
35
+ /**
36
+ * Generate JSON-LD structured data script for SEO
37
+ * This is injected into <head> for search engine crawlers
38
+ */
39
+ declare function generateJsonLd(data: OlovaHydrationData): string;
40
+ /**
41
+ * Parse flight data from the page (client-side utility)
42
+ * Use this to access hydration data in your components
43
+ */
44
+ declare function parseFlightData(): Record<string, unknown> | null;
45
+
46
+ declare const colors: {
47
+ reset: string;
48
+ bold: string;
49
+ dim: string;
50
+ italic: string;
51
+ underline: string;
52
+ black: string;
53
+ red: string;
54
+ green: string;
55
+ yellow: string;
56
+ blue: string;
57
+ magenta: string;
58
+ cyan: string;
59
+ white: string;
60
+ gray: string;
61
+ bgBlack: string;
62
+ bgRed: string;
63
+ bgGreen: string;
64
+ bgYellow: string;
65
+ bgBlue: string;
66
+ bgMagenta: string;
67
+ bgCyan: string;
68
+ bgWhite: string;
69
+ };
70
+ declare const symbols: {
71
+ success: string;
72
+ error: string;
73
+ warning: string;
74
+ info: string;
75
+ arrow: string;
76
+ arrowRight: string;
77
+ bullet: string;
78
+ filled: string;
79
+ lambda: string;
80
+ triangle: string;
81
+ square: string;
82
+ diamond: string;
83
+ star: string;
84
+ check: string;
85
+ cross: string;
86
+ pointer: string;
87
+ };
88
+ declare function formatTime(ms: number): string;
89
+ declare function formatBytes(bytes: number): string;
90
+ declare const logger: {
91
+ banner: (name: string, version?: string) => void;
92
+ header: (text: string) => void;
93
+ info: (text: string) => void;
94
+ success: (text: string, time?: number) => void;
95
+ error: (text: string) => void;
96
+ warn: (text: string) => void;
97
+ step: (text: string, time?: number) => void;
98
+ route: (route: string, type: "static" | "ssr" | "isr", size?: number, time?: number) => void;
99
+ indent: (text: string, level?: number) => void;
100
+ newline: () => void;
101
+ dim: (text: string) => string;
102
+ bold: (text: string) => string;
103
+ cyan: (text: string) => string;
104
+ green: (text: string) => string;
105
+ yellow: (text: string) => string;
106
+ red: (text: string) => string;
107
+ magenta: (text: string) => string;
108
+ };
109
+ declare function createTimer(): {
110
+ elapsed: () => number;
111
+ format: () => string;
112
+ };
113
+
114
+ /**
115
+ * =============================================================================
116
+ * OLOVA FRAMEWORK PLUGINS
117
+ * All Vite plugins for the Olova framework consolidated in one file
118
+ * =============================================================================
119
+ */
120
+
121
+ declare function olovaPlugins(): Plugin[];
122
+
123
+ export { type OlovaHydrationData, autoGeneratePlugin, cleanUrlPlugin, colors, configPlugin, createTimer, formatBytes, formatTime, frameworkPlugin, generateBuildId, generateCriticalCSS, generateJsonLd, generateOlovaHydration, generatePerformanceMeta, generateResourceHints, generateServiceWorkerContent, generateServiceWorkerScript, logger, minifyHtml, olovaPlugins, parseFlightData, proactiveErrorPlugin, routerPlugin, ssgPlugin, symbols, virtualHtmlPlugin };
@@ -0,0 +1,123 @@
1
+ import { Plugin } from 'vite';
2
+
3
+ declare function configPlugin(): Plugin;
4
+
5
+ declare function routerPlugin(): Plugin;
6
+
7
+ declare function frameworkPlugin(): Plugin;
8
+
9
+ declare function virtualHtmlPlugin(): Plugin;
10
+
11
+ declare function ssgPlugin(): Plugin;
12
+
13
+ declare function cleanUrlPlugin(): Plugin;
14
+
15
+ declare function autoGeneratePlugin(): Plugin;
16
+
17
+ declare function proactiveErrorPlugin(): Plugin;
18
+
19
+ declare function minifyHtml(html: string): string;
20
+ declare function generateBuildId(): string;
21
+ declare function generateResourceHints(): string;
22
+ declare function generateCriticalCSS(): string;
23
+ declare function generateServiceWorkerScript(): string;
24
+ declare function generateServiceWorkerContent(buildId: string, assets: string[]): string;
25
+ declare function generatePerformanceMeta(): string;
26
+
27
+ interface OlovaHydrationData {
28
+ route: string;
29
+ metadata?: Record<string, unknown>;
30
+ params?: Record<string, string>;
31
+ chunks?: string[];
32
+ isStatic?: boolean;
33
+ }
34
+ declare function generateOlovaHydration(data: OlovaHydrationData, buildId: string): string;
35
+ /**
36
+ * Generate JSON-LD structured data script for SEO
37
+ * This is injected into <head> for search engine crawlers
38
+ */
39
+ declare function generateJsonLd(data: OlovaHydrationData): string;
40
+ /**
41
+ * Parse flight data from the page (client-side utility)
42
+ * Use this to access hydration data in your components
43
+ */
44
+ declare function parseFlightData(): Record<string, unknown> | null;
45
+
46
+ declare const colors: {
47
+ reset: string;
48
+ bold: string;
49
+ dim: string;
50
+ italic: string;
51
+ underline: string;
52
+ black: string;
53
+ red: string;
54
+ green: string;
55
+ yellow: string;
56
+ blue: string;
57
+ magenta: string;
58
+ cyan: string;
59
+ white: string;
60
+ gray: string;
61
+ bgBlack: string;
62
+ bgRed: string;
63
+ bgGreen: string;
64
+ bgYellow: string;
65
+ bgBlue: string;
66
+ bgMagenta: string;
67
+ bgCyan: string;
68
+ bgWhite: string;
69
+ };
70
+ declare const symbols: {
71
+ success: string;
72
+ error: string;
73
+ warning: string;
74
+ info: string;
75
+ arrow: string;
76
+ arrowRight: string;
77
+ bullet: string;
78
+ filled: string;
79
+ lambda: string;
80
+ triangle: string;
81
+ square: string;
82
+ diamond: string;
83
+ star: string;
84
+ check: string;
85
+ cross: string;
86
+ pointer: string;
87
+ };
88
+ declare function formatTime(ms: number): string;
89
+ declare function formatBytes(bytes: number): string;
90
+ declare const logger: {
91
+ banner: (name: string, version?: string) => void;
92
+ header: (text: string) => void;
93
+ info: (text: string) => void;
94
+ success: (text: string, time?: number) => void;
95
+ error: (text: string) => void;
96
+ warn: (text: string) => void;
97
+ step: (text: string, time?: number) => void;
98
+ route: (route: string, type: "static" | "ssr" | "isr", size?: number, time?: number) => void;
99
+ indent: (text: string, level?: number) => void;
100
+ newline: () => void;
101
+ dim: (text: string) => string;
102
+ bold: (text: string) => string;
103
+ cyan: (text: string) => string;
104
+ green: (text: string) => string;
105
+ yellow: (text: string) => string;
106
+ red: (text: string) => string;
107
+ magenta: (text: string) => string;
108
+ };
109
+ declare function createTimer(): {
110
+ elapsed: () => number;
111
+ format: () => string;
112
+ };
113
+
114
+ /**
115
+ * =============================================================================
116
+ * OLOVA FRAMEWORK PLUGINS
117
+ * All Vite plugins for the Olova framework consolidated in one file
118
+ * =============================================================================
119
+ */
120
+
121
+ declare function olovaPlugins(): Plugin[];
122
+
123
+ export { type OlovaHydrationData, autoGeneratePlugin, cleanUrlPlugin, colors, configPlugin, createTimer, formatBytes, formatTime, frameworkPlugin, generateBuildId, generateCriticalCSS, generateJsonLd, generateOlovaHydration, generatePerformanceMeta, generateResourceHints, generateServiceWorkerContent, generateServiceWorkerScript, logger, minifyHtml, olovaPlugins, parseFlightData, proactiveErrorPlugin, routerPlugin, ssgPlugin, symbols, virtualHtmlPlugin };