fontmin-rs 0.1.0-beta.2 → 0.1.0-beta.4
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/bin/fontmin-rs.mjs +3 -2
- package/dist/{compat-B5e9im94.mjs → compat-C8pV9xb2.mjs} +66 -32
- package/dist/compat.mjs +1 -1
- package/dist/index.d.mts +10 -2
- package/dist/index.mjs +2 -2
- package/package.json +7 -4
package/bin/fontmin-rs.mjs
CHANGED
|
@@ -32,7 +32,7 @@ const DEFAULT_CONFIG_FILES = [
|
|
|
32
32
|
const MODULE_CONFIG_EXTENSIONS = new Set(['.ts', '.mts', '.mjs', '.cjs'])
|
|
33
33
|
const INIT_CONFIG_FILE = 'fontmin.config.jsonc'
|
|
34
34
|
const CACHE_SCHEMA_VERSION = 'v1'
|
|
35
|
-
const FONTMIN_VERSION = '0.1.0-beta.
|
|
35
|
+
const FONTMIN_VERSION = '0.1.0-beta.4'
|
|
36
36
|
const DEFAULT_CACHE_DIR = 'node_modules/.cache/fontmin-rs'
|
|
37
37
|
let emitWarnings = true
|
|
38
38
|
const DEFAULT_INIT_CONFIG = `{
|
|
@@ -1232,7 +1232,8 @@ async function findConfig(cwd = process.cwd()) {
|
|
|
1232
1232
|
|
|
1233
1233
|
async function isFile(path) {
|
|
1234
1234
|
try {
|
|
1235
|
-
|
|
1235
|
+
const stats = await stat(path)
|
|
1236
|
+
return stats.isFile()
|
|
1236
1237
|
} catch {
|
|
1237
1238
|
return false
|
|
1238
1239
|
}
|
|
@@ -57,6 +57,39 @@ function withConfigDefaults(config, configDir) {
|
|
|
57
57
|
};
|
|
58
58
|
}
|
|
59
59
|
//#endregion
|
|
60
|
+
//#region src/diagnostics.ts
|
|
61
|
+
const bridgeDiagnosticPattern = /^\[(?<code>fontmin::[a-z_]+)\] (?<message>[\s\S]+)$/u;
|
|
62
|
+
var FontminDiagnosticError = class extends Error {
|
|
63
|
+
name = "FontminDiagnosticError";
|
|
64
|
+
code;
|
|
65
|
+
constructor(code, message, options) {
|
|
66
|
+
super(message, options);
|
|
67
|
+
this.code = code;
|
|
68
|
+
}
|
|
69
|
+
};
|
|
70
|
+
function normalizeFontminDiagnostic(error) {
|
|
71
|
+
let message;
|
|
72
|
+
if (error instanceof Error) message = error.message;
|
|
73
|
+
else if (typeof error === "string") message = error;
|
|
74
|
+
const match = message?.match(bridgeDiagnosticPattern);
|
|
75
|
+
if (match === null || match === void 0) {
|
|
76
|
+
if (error instanceof Error) return error;
|
|
77
|
+
if (typeof error === "string") return new Error(error, { cause: error });
|
|
78
|
+
return new Error("fontmin-rs operation failed", { cause: error });
|
|
79
|
+
}
|
|
80
|
+
const code = match.groups?.["code"];
|
|
81
|
+
const diagnosticMessage = match.groups?.["message"];
|
|
82
|
+
if (code === void 0 || diagnosticMessage === void 0) return new Error("fontmin-rs operation returned an invalid diagnostic", { cause: error });
|
|
83
|
+
return new FontminDiagnosticError(code, diagnosticMessage, { cause: error });
|
|
84
|
+
}
|
|
85
|
+
function withFontminDiagnostics(operation) {
|
|
86
|
+
try {
|
|
87
|
+
return operation();
|
|
88
|
+
} catch (error) {
|
|
89
|
+
throw normalizeFontminDiagnostic(error);
|
|
90
|
+
}
|
|
91
|
+
}
|
|
92
|
+
//#endregion
|
|
60
93
|
//#region src/native-loader.ts
|
|
61
94
|
const require$1 = createRequire(import.meta.url);
|
|
62
95
|
let binding;
|
|
@@ -90,8 +123,8 @@ async function initializeWasmRuntime() {
|
|
|
90
123
|
const wasm = await import(wasmPackageName);
|
|
91
124
|
await wasm.initWasm(bytes);
|
|
92
125
|
return wasm;
|
|
93
|
-
} catch (
|
|
94
|
-
throw new Error("fontmin-rs WASM runtime failed to initialize", { cause });
|
|
126
|
+
} catch (error) {
|
|
127
|
+
throw new Error("fontmin-rs WASM runtime failed to initialize", { cause: error });
|
|
95
128
|
}
|
|
96
129
|
}
|
|
97
130
|
//#endregion
|
|
@@ -153,10 +186,10 @@ function subsetTtf(input, options = {}) {
|
|
|
153
186
|
const inputBuffer = Buffer.isBuffer(input) ? input : Buffer.from(input);
|
|
154
187
|
const binding = loadNativeBinding();
|
|
155
188
|
if ((options.missingGlyphs ?? "warn") === "warn") {
|
|
156
|
-
const warning = missingGlyphWarning(binding.analyzeCoverage(inputBuffer, coverageOptionsFromSubset(nativeOptions)));
|
|
189
|
+
const warning = missingGlyphWarning(withFontminDiagnostics(() => binding.analyzeCoverage(inputBuffer, coverageOptionsFromSubset(nativeOptions))));
|
|
157
190
|
if (warning !== void 0) process.emitWarning(warning, { code: "FONTMIN_MISSING_GLYPHS" });
|
|
158
191
|
}
|
|
159
|
-
return binding.subsetTtf(inputBuffer, nativeOptions);
|
|
192
|
+
return withFontminDiagnostics(() => binding.subsetTtf(inputBuffer, nativeOptions));
|
|
160
193
|
}
|
|
161
194
|
function resolveSubsetText(options) {
|
|
162
195
|
if (options.textFile === void 0) return options.text;
|
|
@@ -165,11 +198,11 @@ function resolveSubsetText(options) {
|
|
|
165
198
|
}
|
|
166
199
|
function analyzeCoverage(input, options = {}) {
|
|
167
200
|
const inputBuffer = Buffer.isBuffer(input) ? input : Buffer.from(input);
|
|
168
|
-
return loadNativeBinding().analyzeCoverage(inputBuffer, toNativeCoverageOptions(options));
|
|
201
|
+
return withFontminDiagnostics(() => loadNativeBinding().analyzeCoverage(inputBuffer, toNativeCoverageOptions(options)));
|
|
169
202
|
}
|
|
170
203
|
function inspect(input) {
|
|
171
204
|
const inputBuffer = Buffer.isBuffer(input) ? input : Buffer.from(input);
|
|
172
|
-
return loadNativeBinding().inspectFont(inputBuffer);
|
|
205
|
+
return withFontminDiagnostics(() => loadNativeBinding().inspectFont(inputBuffer));
|
|
173
206
|
}
|
|
174
207
|
function toNativeCoverageOptions(options) {
|
|
175
208
|
const nativeOptions = {};
|
|
@@ -190,33 +223,33 @@ function missingGlyphWarning(report) {
|
|
|
190
223
|
}
|
|
191
224
|
function ttfToWoff(input, options = {}) {
|
|
192
225
|
const inputBuffer = Buffer.isBuffer(input) ? input : Buffer.from(input);
|
|
193
|
-
return loadNativeBinding().ttfToWoff(inputBuffer, toNativeWoffOptions(options));
|
|
226
|
+
return withFontminDiagnostics(() => loadNativeBinding().ttfToWoff(inputBuffer, toNativeWoffOptions(options)));
|
|
194
227
|
}
|
|
195
228
|
function woffToTtf(input) {
|
|
196
229
|
const inputBuffer = Buffer.isBuffer(input) ? input : Buffer.from(input);
|
|
197
|
-
return loadNativeBinding().woffToTtf(inputBuffer);
|
|
230
|
+
return withFontminDiagnostics(() => loadNativeBinding().woffToTtf(inputBuffer));
|
|
198
231
|
}
|
|
199
232
|
function woff2ToTtf(input) {
|
|
200
233
|
const inputBuffer = Buffer.isBuffer(input) ? input : Buffer.from(input);
|
|
201
|
-
return loadNativeBinding().woff2ToTtf(inputBuffer);
|
|
234
|
+
return withFontminDiagnostics(() => loadNativeBinding().woff2ToTtf(inputBuffer));
|
|
202
235
|
}
|
|
203
236
|
function eotToTtf(input) {
|
|
204
237
|
const inputBuffer = Buffer.isBuffer(input) ? input : Buffer.from(input);
|
|
205
|
-
return loadNativeBinding().eotToTtf(inputBuffer);
|
|
238
|
+
return withFontminDiagnostics(() => loadNativeBinding().eotToTtf(inputBuffer));
|
|
206
239
|
}
|
|
207
240
|
function otfToTtf(input, options = {}) {
|
|
208
241
|
const nativeOptions = {};
|
|
209
242
|
assignDefined(nativeOptions, "preserveHinting", options.preserveHinting);
|
|
210
243
|
assignDefined(nativeOptions, "variationCoordinates", options.variationCoordinates);
|
|
211
244
|
const inputBuffer = Buffer.isBuffer(input) ? input : Buffer.from(input);
|
|
212
|
-
return loadNativeBinding().otfToTtf(inputBuffer, nativeOptions);
|
|
245
|
+
return withFontminDiagnostics(() => loadNativeBinding().otfToTtf(inputBuffer, nativeOptions));
|
|
213
246
|
}
|
|
214
247
|
function ttfToWoff2(input, options = {}) {
|
|
215
248
|
const nativeOptions = {};
|
|
216
249
|
assertAvailableWoff2Fallback(options.fallback);
|
|
217
250
|
if (options.quality !== void 0) nativeOptions.quality = options.quality;
|
|
218
251
|
const inputBuffer = Buffer.isBuffer(input) ? input : Buffer.from(input);
|
|
219
|
-
return loadNativeBinding().ttfToWoff2(inputBuffer, nativeOptions);
|
|
252
|
+
return withFontminDiagnostics(() => loadNativeBinding().ttfToWoff2(inputBuffer, nativeOptions));
|
|
220
253
|
}
|
|
221
254
|
async function ttfToWoff2Async(input, options = {}) {
|
|
222
255
|
if (options.fallback === "wasm") return ttfToWoff2WithWasm(input, options);
|
|
@@ -243,25 +276,25 @@ async function ttfToWoff2WithWasm(input, options) {
|
|
|
243
276
|
}
|
|
244
277
|
function validateWoff2(input) {
|
|
245
278
|
const inputBuffer = Buffer.isBuffer(input) ? input : Buffer.from(input);
|
|
246
|
-
loadNativeBinding().validateWoff2(inputBuffer);
|
|
279
|
+
withFontminDiagnostics(() => loadNativeBinding().validateWoff2(inputBuffer));
|
|
247
280
|
}
|
|
248
281
|
function ttfToEot(input, options = {}) {
|
|
249
282
|
const nativeOptions = {};
|
|
250
283
|
if (options.version !== void 0) nativeOptions.version = options.version;
|
|
251
284
|
const inputBuffer = Buffer.isBuffer(input) ? input : Buffer.from(input);
|
|
252
|
-
return loadNativeBinding().ttfToEot(inputBuffer, nativeOptions);
|
|
285
|
+
return withFontminDiagnostics(() => loadNativeBinding().ttfToEot(inputBuffer, nativeOptions));
|
|
253
286
|
}
|
|
254
287
|
function ttfToSvg(input, options = {}) {
|
|
255
288
|
const nativeOptions = {};
|
|
256
289
|
if (options.fontFamily !== void 0) nativeOptions.fontFamily = options.fontFamily;
|
|
257
290
|
const inputBuffer = Buffer.isBuffer(input) ? input : Buffer.from(input);
|
|
258
|
-
return loadNativeBinding().ttfToSvg(inputBuffer, nativeOptions);
|
|
291
|
+
return withFontminDiagnostics(() => loadNativeBinding().ttfToSvg(inputBuffer, nativeOptions));
|
|
259
292
|
}
|
|
260
293
|
function svgFontToTtf(input, options = {}) {
|
|
261
|
-
return loadNativeBinding().svgFontToTtf(input, toNativeSvg2TtfOptions(options));
|
|
294
|
+
return withFontminDiagnostics(() => loadNativeBinding().svgFontToTtf(input, toNativeSvg2TtfOptions(options)));
|
|
262
295
|
}
|
|
263
296
|
function svgsToTtf(inputs, options = {}) {
|
|
264
|
-
return loadNativeBinding().svgsToTtf(inputs.map((input) => toNativeSvgIcon(input)), toNativeSvgs2TtfOptions(options));
|
|
297
|
+
return withFontminDiagnostics(() => loadNativeBinding().svgsToTtf(inputs.map((input) => toNativeSvgIcon(input)), toNativeSvgs2TtfOptions(options)));
|
|
265
298
|
}
|
|
266
299
|
function generateFontFaceCss(sources, options = {}) {
|
|
267
300
|
const nativeSources = sources.map((source) => toNativeCssFontSource(source));
|
|
@@ -276,7 +309,7 @@ function generateFontFaceCss(sources, options = {}) {
|
|
|
276
309
|
if (options.fontDisplay !== void 0) nativeOptions.fontDisplay = options.fontDisplay;
|
|
277
310
|
if (options.target !== void 0) nativeOptions.target = options.target;
|
|
278
311
|
if (options.unicodeRanges !== void 0) nativeOptions.unicodeRanges = options.unicodeRanges;
|
|
279
|
-
return loadNativeBinding().generateFontFaceCss(nativeSources, nativeOptions);
|
|
312
|
+
return withFontminDiagnostics(() => loadNativeBinding().generateFontFaceCss(nativeSources, nativeOptions));
|
|
280
313
|
}
|
|
281
314
|
function resolveCssFontFamily(sources, fontFamily) {
|
|
282
315
|
if (typeof fontFamily === "string") return fontFamily;
|
|
@@ -296,6 +329,10 @@ function toNativeCssFontSource(source) {
|
|
|
296
329
|
}
|
|
297
330
|
//#endregion
|
|
298
331
|
//#region src/optimize-runtime.ts
|
|
332
|
+
const defaultRuntimeLoaders = {
|
|
333
|
+
loadNative: loadNativeRuntime,
|
|
334
|
+
loadWasm: createWasmRuntime
|
|
335
|
+
};
|
|
299
336
|
function resolvePipelineRuntimeMode(configured, fallbacks) {
|
|
300
337
|
if (fallbacks.includes("js")) throw new Error("WOFF2 fallback `js` is not available in this build");
|
|
301
338
|
const legacy = [...new Set(fallbacks)];
|
|
@@ -357,6 +394,10 @@ const nativeRuntime = {
|
|
|
357
394
|
return ttfToWoff2(input, options);
|
|
358
395
|
}
|
|
359
396
|
};
|
|
397
|
+
function loadNativeRuntime() {
|
|
398
|
+
loadNativeBinding();
|
|
399
|
+
return nativeRuntime;
|
|
400
|
+
}
|
|
360
401
|
async function createWasmRuntime(loadRuntime = loadWasmRuntime) {
|
|
361
402
|
const wasm = await loadRuntime();
|
|
362
403
|
return {
|
|
@@ -402,17 +443,10 @@ async function runWasmOperation(operation, run) {
|
|
|
402
443
|
function assertWasmOptionSupported(operation, name, value) {
|
|
403
444
|
if (value !== void 0) throw new Error(`fontmin-rs WASM ${operation} does not support option ${name}`);
|
|
404
445
|
}
|
|
405
|
-
const defaultRuntimeLoaders = {
|
|
406
|
-
loadNative() {
|
|
407
|
-
loadNativeBinding();
|
|
408
|
-
return nativeRuntime;
|
|
409
|
-
},
|
|
410
|
-
loadWasm: createWasmRuntime
|
|
411
|
-
};
|
|
412
446
|
//#endregion
|
|
413
447
|
//#region src/optimize.ts
|
|
414
448
|
const CACHE_SCHEMA_VERSION = "v1";
|
|
415
|
-
const FONTMIN_VERSION = "0.1.0-beta.
|
|
449
|
+
const FONTMIN_VERSION = "0.1.0-beta.4";
|
|
416
450
|
const DEFAULT_CACHE_DIR = "node_modules/.cache/fontmin-rs";
|
|
417
451
|
const DEFAULT_SVG_ICON_START_UNICODE = 57345;
|
|
418
452
|
const CSS_GLYPHS_META_KEY = "cssGlyphs";
|
|
@@ -424,9 +458,9 @@ const MIME_TYPES_BY_FORMAT = {
|
|
|
424
458
|
woff: "font/woff",
|
|
425
459
|
woff2: "font/woff2"
|
|
426
460
|
};
|
|
427
|
-
async function optimize(
|
|
428
|
-
const cwd =
|
|
429
|
-
config = await resolveConfigTextFile(
|
|
461
|
+
async function optimize(unresolvedConfig) {
|
|
462
|
+
const cwd = unresolvedConfig.cwd === void 0 ? process.cwd() : unresolvedConfig.cwd;
|
|
463
|
+
const config = await resolveConfigTextFile(unresolvedConfig, cwd);
|
|
430
464
|
const plugins = sortPlugins(await resolvePluginTextFiles(pluginsFromConfig(config), cwd));
|
|
431
465
|
const legacyFallbacks = woff2FallbacksFromPlugins(plugins);
|
|
432
466
|
const runtime = createRuntimeSelector(resolvePipelineRuntimeMode(config.runtime, legacyFallbacks));
|
|
@@ -447,7 +481,7 @@ async function optimize(config) {
|
|
|
447
481
|
}
|
|
448
482
|
for (const plugin of plugins) if (isBuiltin(plugin, "css")) {
|
|
449
483
|
const cssAsset = await runCss(assets, plugin.native.options, await runtime.resolve());
|
|
450
|
-
if (cssAsset !== void 0) assets = assets
|
|
484
|
+
if (cssAsset !== void 0) assets = [...assets, cssAsset];
|
|
451
485
|
} else {
|
|
452
486
|
if (plugin.generateBundle !== void 0) await plugin.generateBundle(assets, context);
|
|
453
487
|
assets = [...assets, ...emittedAssets.splice(0)];
|
|
@@ -740,7 +774,7 @@ async function expandInputPath(input, cwd) {
|
|
|
740
774
|
return matches.sort((left, right) => left.localeCompare(right));
|
|
741
775
|
}
|
|
742
776
|
function isGlobPattern(path) {
|
|
743
|
-
return /[*?[\]{}]
|
|
777
|
+
return /[*?[\]{}]/u.test(path);
|
|
744
778
|
}
|
|
745
779
|
async function transformAssets(assets, plugin, context, runtime) {
|
|
746
780
|
if (isBuiltin(plugin, "glyph")) return flatMapAssets(assets, async (asset) => runGlyph(asset, plugin.native.options, await runtime.resolve()));
|
|
@@ -1284,4 +1318,4 @@ var FontminCompat = class {
|
|
|
1284
1318
|
}
|
|
1285
1319
|
};
|
|
1286
1320
|
//#endregion
|
|
1287
|
-
export { woff2ToTtf as _, generateFontFaceCss as a,
|
|
1321
|
+
export { woff2ToTtf as _, generateFontFaceCss as a, defineConfig as b, subsetTtf as c, ttfToEot as d, ttfToSvg as f, validateWoff2 as g, ttfToWoff2Async as h, eotToTtf as i, svgFontToTtf as l, ttfToWoff2 as m, optimize as n, inspect as o, ttfToWoff as p, analyzeCoverage as r, otfToTtf as s, FontminCompat as t, svgsToTtf as u, woffToTtf as v, loadConfig as x, FontminDiagnosticError as y };
|
package/dist/compat.mjs
CHANGED
package/dist/index.d.mts
CHANGED
|
@@ -5,6 +5,14 @@ import { fontminCompatPreset } from "./presets.mjs";
|
|
|
5
5
|
declare function defineConfig<T extends FontminConfig>(config: T): T;
|
|
6
6
|
declare function loadConfig(configPath?: string): Promise<FontminConfig>;
|
|
7
7
|
//#endregion
|
|
8
|
+
//#region src/diagnostics.d.ts
|
|
9
|
+
type FontminDiagnosticCode = 'fontmin::config' | 'fontmin::convert_failed' | 'fontmin::invalid_font' | 'fontmin::io' | 'fontmin::missing_glyph' | 'fontmin::napi_bridge_failed' | 'fontmin::plugin_failed' | 'fontmin::unsupported_format';
|
|
10
|
+
declare class FontminDiagnosticError extends Error {
|
|
11
|
+
readonly name = "FontminDiagnosticError";
|
|
12
|
+
readonly code: FontminDiagnosticCode;
|
|
13
|
+
constructor(code: FontminDiagnosticCode, message: string, options?: ErrorOptions);
|
|
14
|
+
}
|
|
15
|
+
//#endregion
|
|
8
16
|
//#region src/native.d.ts
|
|
9
17
|
declare function subsetTtf(input: Uint8Array, options?: SubsetOptions): Buffer;
|
|
10
18
|
declare function analyzeCoverage(input: Uint8Array, options?: CoverageOptions): CoverageReport;
|
|
@@ -24,6 +32,6 @@ declare function svgsToTtf(inputs: SvgIcon[], options?: Svgs2TtfOptions): Buffer
|
|
|
24
32
|
declare function generateFontFaceCss(sources: CssFontSource[], options?: CssOptions): string;
|
|
25
33
|
//#endregion
|
|
26
34
|
//#region src/optimize.d.ts
|
|
27
|
-
declare function optimize(
|
|
35
|
+
declare function optimize(unresolvedConfig: FontminConfig): Promise<FontAsset[]>;
|
|
28
36
|
//#endregion
|
|
29
|
-
export { type AssetFormat, type CacheOptions, type ConfigOutput, type CoverageOptions, type CoverageReport, type CssFontFamily, type CssFontSource, type CssGlyph, type CssOptions, type DeliverySlice, type FontAsset, type FontFormat, type FontInfo, type FontMetadata, type FontminCompatPresetOptions, type FontminConfig, type FontminPlugin, type LayoutSubsetMode, type MaybePromise, type MissingGlyphPolicy, type ModernWebOptions, type Otf2TtfOptions, type OutputConfig, type OutputFormat, type PluginContext, type PluginDiagnostic, type RuntimeMode, type SubsetOptions, type Svg2TtfOptions, type SvgIcon, type Svgs2TtfOptions, type Ttf2EotOptions, type Ttf2SvgOptions, type Ttf2Woff2Options, type Ttf2WoffOptions, type WoffOptions, analyzeCoverage, css, FontminCompat as default, defineConfig, definePlugin, deliverySlices, eotToTtf, fontminCompatPreset, generateFontFaceCss, glyph, inspect, loadConfig, modernWeb, optimize, otf2ttf, otfToTtf, subsetTtf, svg2ttf, svgFontToTtf, svgs2ttf, svgsToTtf, ttf2eot, ttf2svg, ttf2woff, ttf2woff2, ttfToEot, ttfToSvg, ttfToWoff, ttfToWoff2, ttfToWoff2Async, validateWoff2, woff2ToTtf, woffToTtf };
|
|
37
|
+
export { type AssetFormat, type CacheOptions, type ConfigOutput, type CoverageOptions, type CoverageReport, type CssFontFamily, type CssFontSource, type CssGlyph, type CssOptions, type DeliverySlice, type FontAsset, type FontFormat, type FontInfo, type FontMetadata, type FontminCompatPresetOptions, type FontminConfig, type FontminDiagnosticCode, FontminDiagnosticError, type FontminPlugin, type LayoutSubsetMode, type MaybePromise, type MissingGlyphPolicy, type ModernWebOptions, type Otf2TtfOptions, type OutputConfig, type OutputFormat, type PluginContext, type PluginDiagnostic, type RuntimeMode, type SubsetOptions, type Svg2TtfOptions, type SvgIcon, type Svgs2TtfOptions, type Ttf2EotOptions, type Ttf2SvgOptions, type Ttf2Woff2Options, type Ttf2WoffOptions, type WoffOptions, analyzeCoverage, css, FontminCompat as default, defineConfig, definePlugin, deliverySlices, eotToTtf, fontminCompatPreset, generateFontFaceCss, glyph, inspect, loadConfig, modernWeb, optimize, otf2ttf, otfToTtf, subsetTtf, svg2ttf, svgFontToTtf, svgs2ttf, svgsToTtf, ttf2eot, ttf2svg, ttf2woff, ttf2woff2, ttfToEot, ttfToSvg, ttfToWoff, ttfToWoff2, ttfToWoff2Async, validateWoff2, woff2ToTtf, woffToTtf };
|
package/dist/index.mjs
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { _ as woff2ToTtf, a as generateFontFaceCss, b as
|
|
1
|
+
import { _ as woff2ToTtf, a as generateFontFaceCss, b as defineConfig, c as subsetTtf, d as ttfToEot, f as ttfToSvg, g as validateWoff2, h as ttfToWoff2Async, i as eotToTtf, l as svgFontToTtf, m as ttfToWoff2, n as optimize, o as inspect, p as ttfToWoff, r as analyzeCoverage, s as otfToTtf, t as FontminCompat, u as svgsToTtf, v as woffToTtf, x as loadConfig, y as FontminDiagnosticError } from "./compat-C8pV9xb2.mjs";
|
|
2
2
|
import { css, definePlugin, deliverySlices, glyph, modernWeb, otf2ttf, svg2ttf, svgs2ttf, ttf2eot, ttf2svg, ttf2woff, ttf2woff2 } from "./plugins.mjs";
|
|
3
3
|
import { fontminCompatPreset } from "./presets.mjs";
|
|
4
|
-
export { analyzeCoverage, css, FontminCompat as default, defineConfig, definePlugin, deliverySlices, eotToTtf, fontminCompatPreset, generateFontFaceCss, glyph, inspect, loadConfig, modernWeb, optimize, otf2ttf, otfToTtf, subsetTtf, svg2ttf, svgFontToTtf, svgs2ttf, svgsToTtf, ttf2eot, ttf2svg, ttf2woff, ttf2woff2, ttfToEot, ttfToSvg, ttfToWoff, ttfToWoff2, ttfToWoff2Async, validateWoff2, woff2ToTtf, woffToTtf };
|
|
4
|
+
export { FontminDiagnosticError, analyzeCoverage, css, FontminCompat as default, defineConfig, definePlugin, deliverySlices, eotToTtf, fontminCompatPreset, generateFontFaceCss, glyph, inspect, loadConfig, modernWeb, optimize, otf2ttf, otfToTtf, subsetTtf, svg2ttf, svgFontToTtf, svgs2ttf, svgsToTtf, ttf2eot, ttf2svg, ttf2woff, ttf2woff2, ttfToEot, ttfToSvg, ttfToWoff, ttfToWoff2, ttfToWoff2Async, validateWoff2, woff2ToTtf, woffToTtf };
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "fontmin-rs",
|
|
3
|
-
"version": "0.1.0-beta.
|
|
3
|
+
"version": "0.1.0-beta.4",
|
|
4
4
|
"description": "Fast font subsetter and converter written in Rust with Node.js bindings.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"font",
|
|
@@ -58,7 +58,7 @@
|
|
|
58
58
|
"dependencies": {
|
|
59
59
|
"jsonc-parser": "^3.3.1",
|
|
60
60
|
"tinyglobby": "^0.2.17",
|
|
61
|
-
"@fontmin-rs/wasm": "0.1.0-beta.
|
|
61
|
+
"@fontmin-rs/wasm": "0.1.0-beta.4"
|
|
62
62
|
},
|
|
63
63
|
"devDependencies": {
|
|
64
64
|
"@ntnyq/tsconfig": "^3.1.0",
|
|
@@ -70,7 +70,10 @@
|
|
|
70
70
|
"vitest": "^4.1.10"
|
|
71
71
|
},
|
|
72
72
|
"optionalDependencies": {
|
|
73
|
-
"@fontmin-rs/binding": "0.1.0-beta.
|
|
73
|
+
"@fontmin-rs/binding": "0.1.0-beta.4"
|
|
74
|
+
},
|
|
75
|
+
"engines": {
|
|
76
|
+
"node": ">=22.0.0"
|
|
74
77
|
},
|
|
75
78
|
"scripts": {
|
|
76
79
|
"bench": "vitest bench --run bench",
|
|
@@ -78,7 +81,7 @@
|
|
|
78
81
|
"dev": "tsdown --watch",
|
|
79
82
|
"format": "oxfmt",
|
|
80
83
|
"format:check": "oxfmt --check",
|
|
81
|
-
"lint": "oxlint",
|
|
84
|
+
"lint": "oxlint --deny-warnings",
|
|
82
85
|
"pretest": "node ../../scripts/ensure-wasm.mjs",
|
|
83
86
|
"test": "vitest --run",
|
|
84
87
|
"test:browser": "pnpm run build && node tests/browser-load.mjs",
|