vite-plugin-spiral 0.1.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 +115 -0
- package/dist/bin/clean.d.ts +20 -0
- package/dist/bin/clean.js +203 -0
- package/dist/chunk-VHEBKNM2.js +49 -0
- package/dist/fonts/index.d.ts +9 -0
- package/dist/fonts/index.js +12 -0
- package/dist/index.d.ts +44 -0
- package/dist/index.js +1111 -0
- package/dist/types-B2Q2BHEj.d.ts +137 -0
- package/package.json +71 -0
|
@@ -0,0 +1,137 @@
|
|
|
1
|
+
type FontProviderType = 'local' | 'google' | 'bunny' | 'fontsource';
|
|
2
|
+
type FontFormat = 'woff2' | 'woff' | 'ttf' | 'otf' | 'eot';
|
|
3
|
+
type FontStyle = 'normal' | 'italic' | 'oblique';
|
|
4
|
+
type RemoteFontStyle = 'normal' | 'italic';
|
|
5
|
+
type FontWeight = number | string;
|
|
6
|
+
type FontDisplay = 'auto' | 'block' | 'swap' | 'fallback' | 'optional';
|
|
7
|
+
type PreloadSelector<W extends FontWeight = FontWeight> = {
|
|
8
|
+
weight: W;
|
|
9
|
+
style?: FontStyle;
|
|
10
|
+
};
|
|
11
|
+
type BaseFontOptions<W extends FontWeight = FontWeight> = {
|
|
12
|
+
alias?: string;
|
|
13
|
+
variable?: string;
|
|
14
|
+
weights?: readonly W[];
|
|
15
|
+
styles?: FontStyle[];
|
|
16
|
+
subsets?: string[];
|
|
17
|
+
display?: FontDisplay;
|
|
18
|
+
preload?: boolean | PreloadSelector<W>[];
|
|
19
|
+
fallbacks?: string[];
|
|
20
|
+
optimizedFallbacks?: boolean;
|
|
21
|
+
};
|
|
22
|
+
type LocalVariantDefinition = {
|
|
23
|
+
src: string | string[];
|
|
24
|
+
weight?: FontWeight;
|
|
25
|
+
style?: FontStyle;
|
|
26
|
+
};
|
|
27
|
+
type LocalFontOptions = Omit<BaseFontOptions, 'weights' | 'styles' | 'subsets'> & ({
|
|
28
|
+
variants: LocalVariantDefinition[];
|
|
29
|
+
src?: never;
|
|
30
|
+
} | {
|
|
31
|
+
src: string;
|
|
32
|
+
variants?: never;
|
|
33
|
+
});
|
|
34
|
+
type RemoteFontOptions<W extends FontWeight = FontWeight> = Omit<BaseFontOptions<W>, 'styles'> & {
|
|
35
|
+
styles?: RemoteFontStyle[];
|
|
36
|
+
};
|
|
37
|
+
type FontsourceFontOptions<W extends FontWeight = FontWeight> = Omit<BaseFontOptions<W>, 'styles'> & {
|
|
38
|
+
styles?: RemoteFontStyle[];
|
|
39
|
+
package?: string;
|
|
40
|
+
};
|
|
41
|
+
type FontDefinition = {
|
|
42
|
+
family: string;
|
|
43
|
+
alias: string;
|
|
44
|
+
provider: FontProviderType;
|
|
45
|
+
variable: string;
|
|
46
|
+
weights: FontWeight[];
|
|
47
|
+
styles: FontStyle[];
|
|
48
|
+
subsets: string[];
|
|
49
|
+
display: FontDisplay;
|
|
50
|
+
preload: boolean | PreloadSelector[];
|
|
51
|
+
fallbacks: string[];
|
|
52
|
+
optimizedFallbacks: boolean;
|
|
53
|
+
_local?: {
|
|
54
|
+
variants: LocalVariantDefinition[];
|
|
55
|
+
} | {
|
|
56
|
+
src: string;
|
|
57
|
+
};
|
|
58
|
+
_fontsource?: {
|
|
59
|
+
package?: string;
|
|
60
|
+
};
|
|
61
|
+
};
|
|
62
|
+
type ResolvedFontFile = {
|
|
63
|
+
source: string;
|
|
64
|
+
format: FontFormat;
|
|
65
|
+
unicodeRange?: string;
|
|
66
|
+
};
|
|
67
|
+
type ResolvedFontVariant = {
|
|
68
|
+
weight: FontWeight;
|
|
69
|
+
style: FontStyle;
|
|
70
|
+
files: ResolvedFontFile[];
|
|
71
|
+
};
|
|
72
|
+
type ResolvedFontFamily = {
|
|
73
|
+
family: string;
|
|
74
|
+
alias: string;
|
|
75
|
+
variable: string;
|
|
76
|
+
display: FontDisplay;
|
|
77
|
+
optimizedFallbacks: boolean;
|
|
78
|
+
fallbackFamily?: string;
|
|
79
|
+
fallbackCss?: string;
|
|
80
|
+
fallbacks: string[];
|
|
81
|
+
preload: boolean | PreloadSelector[];
|
|
82
|
+
provider: FontProviderType;
|
|
83
|
+
variants: ResolvedFontVariant[];
|
|
84
|
+
};
|
|
85
|
+
type FontManifest = {
|
|
86
|
+
version: 1;
|
|
87
|
+
style: {
|
|
88
|
+
file?: string;
|
|
89
|
+
inline?: string;
|
|
90
|
+
fallbackCss?: string;
|
|
91
|
+
familyStyles: Record<string, string>;
|
|
92
|
+
variables: Record<string, string>;
|
|
93
|
+
};
|
|
94
|
+
preloads: FontManifestPreload[];
|
|
95
|
+
families: Record<string, FontManifestFamily>;
|
|
96
|
+
};
|
|
97
|
+
type FontManifestPreload = {
|
|
98
|
+
alias: string;
|
|
99
|
+
family: string;
|
|
100
|
+
weight: FontWeight;
|
|
101
|
+
style: FontStyle;
|
|
102
|
+
file?: string;
|
|
103
|
+
url?: string;
|
|
104
|
+
as: 'font';
|
|
105
|
+
type: string;
|
|
106
|
+
crossorigin: 'anonymous';
|
|
107
|
+
};
|
|
108
|
+
type FontManifestFamily = {
|
|
109
|
+
family: string;
|
|
110
|
+
variable: string;
|
|
111
|
+
fallbackFamily?: string;
|
|
112
|
+
fallbacks?: string[];
|
|
113
|
+
variants: Record<string, FontManifestVariant>;
|
|
114
|
+
};
|
|
115
|
+
type FontManifestVariant = {
|
|
116
|
+
files: FontManifestVariantFile[];
|
|
117
|
+
};
|
|
118
|
+
type FontManifestVariantFile = {
|
|
119
|
+
file?: string;
|
|
120
|
+
url?: string;
|
|
121
|
+
format: FontFormat;
|
|
122
|
+
unicodeRange?: string;
|
|
123
|
+
};
|
|
124
|
+
type ParsedFontFace = {
|
|
125
|
+
family: string;
|
|
126
|
+
style: FontStyle;
|
|
127
|
+
weight: FontWeight;
|
|
128
|
+
src: ParsedFontSrc[];
|
|
129
|
+
unicodeRange?: string;
|
|
130
|
+
display?: string;
|
|
131
|
+
};
|
|
132
|
+
type ParsedFontSrc = {
|
|
133
|
+
url: string;
|
|
134
|
+
format: FontFormat;
|
|
135
|
+
};
|
|
136
|
+
|
|
137
|
+
export type { BaseFontOptions as B, FontDefinition as F, LocalFontOptions as L, ParsedFontFace as P, RemoteFontOptions as R, FontDisplay as a, FontFormat as b, FontManifest as c, FontManifestFamily as d, FontManifestPreload as e, FontManifestVariant as f, FontManifestVariantFile as g, FontProviderType as h, FontStyle as i, FontWeight as j, FontsourceFontOptions as k, LocalVariantDefinition as l, ParsedFontSrc as m, PreloadSelector as n, RemoteFontStyle as o, ResolvedFontFamily as p, ResolvedFontFile as q, ResolvedFontVariant as r };
|
package/package.json
ADDED
|
@@ -0,0 +1,71 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "vite-plugin-spiral",
|
|
3
|
+
"version": "0.1.0",
|
|
4
|
+
"description": "Vite integration for Spiral applications.",
|
|
5
|
+
"type": "module",
|
|
6
|
+
"license": "MIT",
|
|
7
|
+
"author": "chianglintu <crzone68@gmail.com>",
|
|
8
|
+
"homepage": "https://github.com/chianglintu/vite-plugin-spiral#readme",
|
|
9
|
+
"repository": {
|
|
10
|
+
"type": "git",
|
|
11
|
+
"url": "git+https://github.com/chianglintu/vite-plugin-spiral.git"
|
|
12
|
+
},
|
|
13
|
+
"bugs": {
|
|
14
|
+
"url": "https://github.com/chianglintu/vite-plugin-spiral/issues"
|
|
15
|
+
},
|
|
16
|
+
"keywords": [
|
|
17
|
+
"spiral",
|
|
18
|
+
"vite",
|
|
19
|
+
"vite-plugin",
|
|
20
|
+
"stempler",
|
|
21
|
+
"php"
|
|
22
|
+
],
|
|
23
|
+
"main": "./dist/index.js",
|
|
24
|
+
"types": "./dist/index.d.ts",
|
|
25
|
+
"bin": {
|
|
26
|
+
"spiral-vite-clean": "dist/bin/clean.js"
|
|
27
|
+
},
|
|
28
|
+
"files": [
|
|
29
|
+
"dist"
|
|
30
|
+
],
|
|
31
|
+
"exports": {
|
|
32
|
+
".": {
|
|
33
|
+
"types": "./dist/index.d.ts",
|
|
34
|
+
"import": "./dist/index.js"
|
|
35
|
+
},
|
|
36
|
+
"./fonts": {
|
|
37
|
+
"types": "./dist/fonts/index.d.ts",
|
|
38
|
+
"import": "./dist/fonts/index.js"
|
|
39
|
+
}
|
|
40
|
+
},
|
|
41
|
+
"engines": {
|
|
42
|
+
"node": "^20.19.0 || >=22.12.0"
|
|
43
|
+
},
|
|
44
|
+
"scripts": {
|
|
45
|
+
"build": "tsup src/index.ts src/fonts/index.ts src/bin/clean.ts --format esm --dts --clean",
|
|
46
|
+
"prepack": "npm run build",
|
|
47
|
+
"test": "vitest run"
|
|
48
|
+
},
|
|
49
|
+
"peerDependencies": {
|
|
50
|
+
"fontaine": "^0.8.0",
|
|
51
|
+
"vite": "^8.0.0"
|
|
52
|
+
},
|
|
53
|
+
"peerDependenciesMeta": {
|
|
54
|
+
"fontaine": {
|
|
55
|
+
"optional": true
|
|
56
|
+
}
|
|
57
|
+
},
|
|
58
|
+
"dependencies": {
|
|
59
|
+
"picocolors": "^1.1.1",
|
|
60
|
+
"tinyglobby": "^0.2.15",
|
|
61
|
+
"vite-plugin-full-reload": "^1.2.0"
|
|
62
|
+
},
|
|
63
|
+
"devDependencies": {
|
|
64
|
+
"@types/node": "^25.9.1",
|
|
65
|
+
"tsup": "^8.5.0",
|
|
66
|
+
"typescript": "^6.0.3",
|
|
67
|
+
"fontaine": "^0.8.0",
|
|
68
|
+
"vite": "^8.0.14",
|
|
69
|
+
"vitest": "^4.0.15"
|
|
70
|
+
}
|
|
71
|
+
}
|