routie dev init since i didn't adhere to any proper guidance up until now

This commit is contained in:
2026-04-29 22:27:29 -06:00
commit e1dabb71e2
15301 changed files with 3562618 additions and 0 deletions
+7
View File
@@ -0,0 +1,7 @@
import { AstroIntegration } from 'astro';
import { Options } from './types.mjs';
import 'vite';
declare function export_default(options: Options): AstroIntegration;
export { export_default as default };
+7
View File
@@ -0,0 +1,7 @@
import { AstroIntegration } from 'astro';
import { Options } from './types.js';
import 'vite';
declare function export_default(options: Options): AstroIntegration;
export { export_default as default };
File diff suppressed because it is too large Load Diff
+23
View File
@@ -0,0 +1,23 @@
import {
index_default
} from "./chunk-PDNCT3ZD.mjs";
// src/astro.ts
function astro_default(options) {
return {
name: "unplugin-fonts",
hooks: {
"astro:config:setup": async (astro) => {
var _a;
if (options == null ? void 0 : options.custom)
options.custom.stripPrefix = "public/";
(_a = astro.config.vite).plugins || (_a.plugins = []);
astro.config.vite.plugins.push(index_default.vite(options));
astro.injectScript("page-ssr", 'import "unfonts.css";');
}
}
};
}
export {
astro_default as default
};
+12
View File
@@ -0,0 +1,12 @@
---
import { links } from 'unplugin-fonts/head'
---
<>
{links.map((link) => {
const attrs = link?.attrs || {}
return (
<link {...attrs} data-unfont />
)
})}
</>
+2
View File
@@ -0,0 +1,2 @@
export { }
+2
View File
@@ -0,0 +1,2 @@
export { }
File diff suppressed because it is too large Load Diff
+7
View File
@@ -0,0 +1,7 @@
import * as unplugin from 'unplugin';
import { Options } from './types.mjs';
import 'vite';
declare const _default: (options?: Options | undefined) => unplugin.EsbuildPlugin;
export { _default as default };
+7
View File
@@ -0,0 +1,7 @@
import * as unplugin from 'unplugin';
import { Options } from './types.js';
import 'vite';
declare const _default: (options?: Options | undefined) => unplugin.EsbuildPlugin;
export { _default as default };
File diff suppressed because it is too large Load Diff
+9
View File
@@ -0,0 +1,9 @@
import {
index_default
} from "./chunk-PDNCT3ZD.mjs";
// src/esbuild.ts
var esbuild_default = index_default.esbuild;
export {
esbuild_default as default
};
+7
View File
@@ -0,0 +1,7 @@
import * as unplugin from 'unplugin';
import { Options } from './types.mjs';
import 'vite';
declare const _default: unplugin.UnpluginInstance<Options | undefined, boolean>;
export { _default as default };
+7
View File
@@ -0,0 +1,7 @@
import * as unplugin from 'unplugin';
import { Options } from './types.js';
import 'vite';
declare const _default: unplugin.UnpluginInstance<Options | undefined, boolean>;
export { _default as default };
File diff suppressed because it is too large Load Diff
+6
View File
@@ -0,0 +1,6 @@
import {
index_default
} from "./chunk-PDNCT3ZD.mjs";
export {
index_default as default
};
+7
View File
@@ -0,0 +1,7 @@
import * as _nuxt_schema from '@nuxt/schema';
import { Options } from './types.mjs';
import 'vite';
declare const _default: _nuxt_schema.NuxtModule<Options, Options, false>;
export { _default as default };
+7
View File
@@ -0,0 +1,7 @@
import * as _nuxt_schema from '@nuxt/schema';
import { Options } from './types.js';
import 'vite';
declare const _default: _nuxt_schema.NuxtModule<Options, Options, false>;
export { _default as default };
+1843
View File
File diff suppressed because it is too large Load Diff
+45
View File
@@ -0,0 +1,45 @@
import {
__spreadValues,
customVirtualModule,
fontsourceImports,
getHeadLinkTags,
index_default
} from "./chunk-PDNCT3ZD.mjs";
// src/nuxt.ts
import { addTemplate, addVitePlugin, addWebpackPlugin, defineNuxtModule } from "@nuxt/kit";
var nuxt_default = defineNuxtModule({
meta: {
name: "unplugin-fonts",
configKey: "unfonts"
},
setup(options, nuxt) {
var _a, _b, _c;
if ("fontsource" in options || "custom" in options) {
(_a = nuxt.options).css || (_a.css = []);
if (options.fontsource) {
for (const src of fontsourceImports(options.fontsource))
nuxt.options.css.push(src);
}
if (options.custom) {
nuxt.options.css.push("#build/unfonts.css");
options.custom.prefetchPrefix = nuxt.options.runtimeConfig.app.buildAssetsDir;
addTemplate({
filename: "unfonts.css",
getContents: () => customVirtualModule(options.custom, nuxt.options.rootDir)
});
}
}
const links = getHeadLinkTags(options);
(_b = nuxt.options.app).head || (_b.head = {});
(_c = nuxt.options.app.head).link || (_c.link = []);
for (const link of links) {
nuxt.options.app.head.link.push(__spreadValues({}, link.attrs));
}
addWebpackPlugin(index_default.webpack(options));
addVitePlugin(index_default.vite(options));
}
});
export {
nuxt_default as default
};
+7
View File
@@ -0,0 +1,7 @@
import * as rollup from 'rollup';
import { Options } from './types.mjs';
import 'vite';
declare const _default: (options?: Options | undefined) => rollup.Plugin<any> | rollup.Plugin<any>[];
export { _default as default };
+7
View File
@@ -0,0 +1,7 @@
import * as rollup from 'rollup';
import { Options } from './types.js';
import 'vite';
declare const _default: (options?: Options | undefined) => rollup.Plugin<any> | rollup.Plugin<any>[];
export { _default as default };
File diff suppressed because it is too large Load Diff
+9
View File
@@ -0,0 +1,9 @@
import {
index_default
} from "./chunk-PDNCT3ZD.mjs";
// src/rollup.ts
var rollup_default = index_default.rollup;
export {
rollup_default as default
};
+168
View File
@@ -0,0 +1,168 @@
import { HtmlTagDescriptor } from 'vite';
interface Options {
custom?: CustomFonts;
fontsource?: FontsourceFonts;
google?: GoogleFonts;
typekit?: TypeKitFonts;
sourcemap?: string;
}
interface CustomFontFace {
source: string;
name: string;
basename: string;
weight: number;
style: string;
display: string;
local?: string | string[];
files: {
src: string;
ext: string;
path: string;
format: string;
}[];
}
interface CustomFontFamily {
/**
* Name of the font family.
* @example 'Comic Sans MS'
*/
name: string;
/**
* Regex(es) of font files to import. The names of the files will
* predicate the `font-style` and `font-weight` values of the `@font-rule`'s.
* @see https://developer.mozilla.org/en-US/docs/Web/CSS/font-weight#common_weight_name_mapping
*
* @example
* A value of `./RobotoBoldItalic.*` will create this `@font-rule`:
*
* ```css
* font-face {
* font-family: 'Roboto';
* src: url(./RobotoBoldItalic.ttf) format('truetype')
* url(./RobotoBoldItalic.woff) format('woff')
* url(./RobotoBoldItalic.woff2) format('woff2');
* font-weight: bold;
* font-style: italic;
* font-display: auto;
* }
* ```
*/
src: string | string[];
/**
* Local name of the font. Used to add `src: local()` to `@font-rule`.
* @see https://developer.mozilla.org/en-US/docs/Web/CSS/@font-face#description
*/
local?: string | string[];
/**
* Allows to transform the generated config for any font face.
*
* @param font
* @returns
*/
transform?: (font: CustomFontFace) => CustomFontFace | null;
}
interface CustomFonts {
/**
* Font families.
*/
families: CustomFontFamily[] | Record<string, string | string[] | Omit<CustomFontFamily, 'name'>>;
/**
* Defines the default `font-display` value used for the generated
* `@font-rule` classes.
* @see https://developer.mozilla.org/fr/docs/Web/CSS/@font-face/font-display
* @default 'auto'
*/
display?: 'auto' | 'block' | 'swap' | 'fallback' | 'optional';
/**
* Using `<link rel="preload">` will trigger a request for the WebFont
* early in the critical rendering path, without having to wait for the
* CSSOM to be created.
* @see https://web.dev/optimize-webfont-loading/#preload-your-webfont-resources
* @default true
*/
preload?: boolean;
/**
* Using `<link rel="prefetch">` is intended for prefetching resources
* that will be used in the next navigation/page load
* (e.g. when you go to the next page)
*
* Note: this can not be used with `preload`
* @default false
*/
prefetch?: boolean;
prefetchPrefix?: string;
/**
* Provides a hook for filtering which `<link>` tags should be actually
* generated.
* @default true
*/
linkFilter?: (tags: HtmlTagDescriptor[]) => HtmlTagDescriptor[] | boolean;
/**
* @default: 'head-prepend'
*/
injectTo?: 'head' | 'body' | 'head-prepend' | 'body-prepend';
/**
* Remove the prefix from the front path
* @default: 'public/'
*/
stripPrefix?: string;
}
interface BaseFontsourceFontFamily {
name: string;
styles?: ('italic' | 'normal')[];
subset?: string;
}
interface WeightsFontsourceFontFamily extends BaseFontsourceFontFamily {
weights: (100 | 200 | 300 | 400 | 500 | 600 | 700 | 800 | 900)[];
}
interface VariableFontsourceFontFamily extends BaseFontsourceFontFamily {
variable: true | {
wght?: boolean;
wdth?: boolean;
slnt?: boolean;
opsz?: boolean;
ital?: boolean;
};
}
type FontsourceFontFamily = WeightsFontsourceFontFamily | VariableFontsourceFontFamily;
interface FontsourceFonts {
families: (string | FontsourceFontFamily)[];
}
interface GoogleFontFamily {
name: string;
styles?: string;
defer?: boolean;
}
interface GoogleFonts {
families: (string | GoogleFontFamily)[];
text?: string;
display?: 'auto' | 'block' | 'swap' | 'fallback' | 'optional';
preconnect?: boolean;
/**
* @default: 'head-prepend'
*/
injectTo?: 'head' | 'body' | 'head-prepend' | 'body-prepend';
/**
* @default: 'https://fonts.googleapis.com/css2'
*/
fontBaseUrl?: string;
/**
* @default: 'https://fonts.gstatic.com/'
*/
preconnectUrl?: string;
}
interface TypeKitFonts {
id: string;
defer?: boolean;
/**
* default: 'head-prepend'
*/
injectTo?: 'head' | 'body' | 'head-prepend' | 'body-prepend';
/**
* @default: 'https://use.typekit.net/'
*/
fontBaseUrl?: string;
}
export type { CustomFontFace, CustomFontFamily, CustomFonts, FontsourceFontFamily, FontsourceFonts, GoogleFontFamily, GoogleFonts, Options, TypeKitFonts };
+168
View File
@@ -0,0 +1,168 @@
import { HtmlTagDescriptor } from 'vite';
interface Options {
custom?: CustomFonts;
fontsource?: FontsourceFonts;
google?: GoogleFonts;
typekit?: TypeKitFonts;
sourcemap?: string;
}
interface CustomFontFace {
source: string;
name: string;
basename: string;
weight: number;
style: string;
display: string;
local?: string | string[];
files: {
src: string;
ext: string;
path: string;
format: string;
}[];
}
interface CustomFontFamily {
/**
* Name of the font family.
* @example 'Comic Sans MS'
*/
name: string;
/**
* Regex(es) of font files to import. The names of the files will
* predicate the `font-style` and `font-weight` values of the `@font-rule`'s.
* @see https://developer.mozilla.org/en-US/docs/Web/CSS/font-weight#common_weight_name_mapping
*
* @example
* A value of `./RobotoBoldItalic.*` will create this `@font-rule`:
*
* ```css
* font-face {
* font-family: 'Roboto';
* src: url(./RobotoBoldItalic.ttf) format('truetype')
* url(./RobotoBoldItalic.woff) format('woff')
* url(./RobotoBoldItalic.woff2) format('woff2');
* font-weight: bold;
* font-style: italic;
* font-display: auto;
* }
* ```
*/
src: string | string[];
/**
* Local name of the font. Used to add `src: local()` to `@font-rule`.
* @see https://developer.mozilla.org/en-US/docs/Web/CSS/@font-face#description
*/
local?: string | string[];
/**
* Allows to transform the generated config for any font face.
*
* @param font
* @returns
*/
transform?: (font: CustomFontFace) => CustomFontFace | null;
}
interface CustomFonts {
/**
* Font families.
*/
families: CustomFontFamily[] | Record<string, string | string[] | Omit<CustomFontFamily, 'name'>>;
/**
* Defines the default `font-display` value used for the generated
* `@font-rule` classes.
* @see https://developer.mozilla.org/fr/docs/Web/CSS/@font-face/font-display
* @default 'auto'
*/
display?: 'auto' | 'block' | 'swap' | 'fallback' | 'optional';
/**
* Using `<link rel="preload">` will trigger a request for the WebFont
* early in the critical rendering path, without having to wait for the
* CSSOM to be created.
* @see https://web.dev/optimize-webfont-loading/#preload-your-webfont-resources
* @default true
*/
preload?: boolean;
/**
* Using `<link rel="prefetch">` is intended for prefetching resources
* that will be used in the next navigation/page load
* (e.g. when you go to the next page)
*
* Note: this can not be used with `preload`
* @default false
*/
prefetch?: boolean;
prefetchPrefix?: string;
/**
* Provides a hook for filtering which `<link>` tags should be actually
* generated.
* @default true
*/
linkFilter?: (tags: HtmlTagDescriptor[]) => HtmlTagDescriptor[] | boolean;
/**
* @default: 'head-prepend'
*/
injectTo?: 'head' | 'body' | 'head-prepend' | 'body-prepend';
/**
* Remove the prefix from the front path
* @default: 'public/'
*/
stripPrefix?: string;
}
interface BaseFontsourceFontFamily {
name: string;
styles?: ('italic' | 'normal')[];
subset?: string;
}
interface WeightsFontsourceFontFamily extends BaseFontsourceFontFamily {
weights: (100 | 200 | 300 | 400 | 500 | 600 | 700 | 800 | 900)[];
}
interface VariableFontsourceFontFamily extends BaseFontsourceFontFamily {
variable: true | {
wght?: boolean;
wdth?: boolean;
slnt?: boolean;
opsz?: boolean;
ital?: boolean;
};
}
type FontsourceFontFamily = WeightsFontsourceFontFamily | VariableFontsourceFontFamily;
interface FontsourceFonts {
families: (string | FontsourceFontFamily)[];
}
interface GoogleFontFamily {
name: string;
styles?: string;
defer?: boolean;
}
interface GoogleFonts {
families: (string | GoogleFontFamily)[];
text?: string;
display?: 'auto' | 'block' | 'swap' | 'fallback' | 'optional';
preconnect?: boolean;
/**
* @default: 'head-prepend'
*/
injectTo?: 'head' | 'body' | 'head-prepend' | 'body-prepend';
/**
* @default: 'https://fonts.googleapis.com/css2'
*/
fontBaseUrl?: string;
/**
* @default: 'https://fonts.gstatic.com/'
*/
preconnectUrl?: string;
}
interface TypeKitFonts {
id: string;
defer?: boolean;
/**
* default: 'head-prepend'
*/
injectTo?: 'head' | 'body' | 'head-prepend' | 'body-prepend';
/**
* @default: 'https://use.typekit.net/'
*/
fontBaseUrl?: string;
}
export type { CustomFontFace, CustomFontFamily, CustomFonts, FontsourceFontFamily, FontsourceFonts, GoogleFontFamily, GoogleFonts, Options, TypeKitFonts };
+18
View File
@@ -0,0 +1,18 @@
"use strict";
var __defProp = Object.defineProperty;
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
var __getOwnPropNames = Object.getOwnPropertyNames;
var __hasOwnProp = Object.prototype.hasOwnProperty;
var __copyProps = (to, from, except, desc) => {
if (from && typeof from === "object" || typeof from === "function") {
for (let key of __getOwnPropNames(from))
if (!__hasOwnProp.call(to, key) && key !== except)
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
}
return to;
};
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
// src/types.ts
var types_exports = {};
module.exports = __toCommonJS(types_exports);
View File
+6
View File
@@ -0,0 +1,6 @@
import * as vite from 'vite';
import { Options } from './types.mjs';
declare const _default: (options?: Options | undefined) => vite.Plugin<any> | vite.Plugin<any>[];
export { _default as default };
+6
View File
@@ -0,0 +1,6 @@
import * as vite from 'vite';
import { Options } from './types.js';
declare const _default: (options?: Options | undefined) => vite.Plugin<any> | vite.Plugin<any>[];
export { _default as default };
+1811
View File
File diff suppressed because it is too large Load Diff
+9
View File
@@ -0,0 +1,9 @@
import {
index_default
} from "./chunk-PDNCT3ZD.mjs";
// src/vite.ts
var vite_default = index_default.vite;
export {
vite_default as default
};
+7
View File
@@ -0,0 +1,7 @@
import * as webpack from 'webpack';
import { Options } from './types.mjs';
import 'vite';
declare const _default: (options?: Options | undefined) => webpack.WebpackPluginInstance;
export { _default as default };
+7
View File
@@ -0,0 +1,7 @@
import * as webpack from 'webpack';
import { Options } from './types.js';
import 'vite';
declare const _default: (options?: Options | undefined) => webpack.WebpackPluginInstance;
export { _default as default };
File diff suppressed because it is too large Load Diff
+9
View File
@@ -0,0 +1,9 @@
import {
index_default
} from "./chunk-PDNCT3ZD.mjs";
// src/webpack.ts
var webpack_default = index_default.webpack;
export {
webpack_default as default
};