Compare commits
1 commit
main
...
wip-assets
Author | SHA1 | Date | |
---|---|---|---|
|
ae582c5a0d |
26 changed files with 4937 additions and 16 deletions
|
@ -1,7 +1,7 @@
|
|||
// @ts-check
|
||||
export default /** @type {import('astro').AstroUserConfig} */ ({
|
||||
buildOptions: {
|
||||
site: 'https://docs.astro.build/',
|
||||
site: 'https://docs.astro.build/docs',
|
||||
},
|
||||
renderers: [
|
||||
// Our main renderer for frontend components
|
||||
|
|
|
@ -1,15 +1,58 @@
|
|||
// Full Astro Configuration API Documentation:
|
||||
// https://docs.astro.build/reference/configuration-reference
|
||||
import Icons from 'unplugin-icons/vite';
|
||||
|
||||
// @type-check enabled!
|
||||
// VSCode and other TypeScript-enabled text editors will provide auto-completion,
|
||||
// helpful tooltips, and warnings if your exported object is invalid.
|
||||
// You can disable this by removing "@ts-check" and `@type` comments below.
|
||||
|
||||
// TODO: Adding assets to a vite plugin is hard
|
||||
// needs to handle load response, adding asset via middleware, AND adding asset via generateBundle
|
||||
// use https://api.giphy.com/v1/gifs/search?q=paul+rudd&api_key=dc6zaTOxFJmzC
|
||||
// function createUnsplashPlugin() {
|
||||
// const virtualModuleId = 'astro:unsplash'
|
||||
// const resolvedVirtualModuleId = '\0' + virtualModuleId;
|
||||
// return {
|
||||
// resolveId(id) {
|
||||
// if (id.startsWith(virtualModuleId)) {
|
||||
// return '\0' + id;
|
||||
// }
|
||||
// },
|
||||
// async load(id) {
|
||||
// const lookup = 'astronaut';
|
||||
|
||||
// }
|
||||
// }
|
||||
// };
|
||||
|
||||
// INSTEAD DO: https://github.com/antfu/unplugin-icons
|
||||
// but, set up load src/fonts
|
||||
// function createFontawesomePlugin() {
|
||||
|
||||
// };
|
||||
|
||||
// INSTEAD DO: https://github.com/feat-agency/vite-plugin-webfont-dl
|
||||
// but, hook it via imports instead of CSS injection
|
||||
function createFontsPlugin() {}
|
||||
|
||||
// @ts-check
|
||||
export default /** @type {import('astro').AstroUserConfig} */ (
|
||||
{
|
||||
// Set "renderers" to "[]" to disable all default, builtin component support.
|
||||
// renderers: [],
|
||||
}
|
||||
);
|
||||
export default /** @type {import('astro').AstroUserConfig} */ ({
|
||||
// Set "renderers" to "[]" to disable all default, builtin component support.
|
||||
// renderers: [],
|
||||
/*
|
||||
|
||||
|
||||
icons: {include: ['fa-solid', 'fa-brand']},
|
||||
|
||||
|
||||
*/
|
||||
fonts: ['roboto@400', 'roboto@700', 'roboto-slab'],
|
||||
vite: {
|
||||
plugins: [
|
||||
Icons({
|
||||
compiler: 'raw',
|
||||
}),
|
||||
],
|
||||
},
|
||||
});
|
||||
|
|
|
@ -9,6 +9,11 @@
|
|||
"preview": "astro preview"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@iconify-json/mdi": "^1.0.16",
|
||||
"astro": "^0.23.0-next.1"
|
||||
},
|
||||
"dependencies": {
|
||||
"@iconify/json": "^2.0.33",
|
||||
"unplugin-icons": "^0.13.0"
|
||||
}
|
||||
}
|
||||
|
|
BIN
examples/starter/public/assets/roboto-400.woff2
Normal file
BIN
examples/starter/public/assets/roboto-400.woff2
Normal file
Binary file not shown.
BIN
examples/starter/public/assets/roboto-700.woff2
Normal file
BIN
examples/starter/public/assets/roboto-700.woff2
Normal file
Binary file not shown.
BIN
examples/starter/public/assets/roboto-slab-400.woff2
Normal file
BIN
examples/starter/public/assets/roboto-slab-400.woff2
Normal file
Binary file not shown.
BIN
examples/starter/src/assets/book.png
Normal file
BIN
examples/starter/src/assets/book.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 520 KiB |
1
examples/starter/src/assets/book.svg
Normal file
1
examples/starter/src/assets/book.svg
Normal file
|
@ -0,0 +1 @@
|
|||
<svg aria-hidden="true" focusable="false" data-prefix="fas" data-icon="book" class="svg-inline--fa fa-book fa-w-14" role="img" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 448 512"><path fill="currentColor" d="M448 360V24c0-13.3-10.7-24-24-24H96C43 0 0 43 0 96v320c0 53 43 96 96 96h328c13.3 0 24-10.7 24-24v-16c0-7.5-3.5-14.3-8.9-18.7-4.2-15.4-4.2-59.3 0-74.7 5.4-4.3 8.9-11.1 8.9-18.6zM128 134c0-3.3 2.7-6 6-6h212c3.3 0 6 2.7 6 6v20c0 3.3-2.7 6-6 6H134c-3.3 0-6-2.7-6-6v-20zm0 64c0-3.3 2.7-6 6-6h212c3.3 0 6 2.7 6 6v20c0 3.3-2.7 6-6 6H134c-3.3 0-6-2.7-6-6v-20zm253.4 250H96c-17.7 0-32-14.3-32-32 0-17.6 14.4-32 32-32h285.4c-1.9 17.1-1.9 46.9 0 64z"></path></svg>
|
After Width: | Height: | Size: 666 B |
3
examples/starter/src/assets/file-icon.svg
Normal file
3
examples/starter/src/assets/file-icon.svg
Normal file
|
@ -0,0 +1,3 @@
|
|||
<svg xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24">
|
||||
<path fill="#FF5D01" fill-rule="evenodd" d="M4.428 14.135c-.312.997-.467 1.495-.429 1.968.036.417.178.818.413 1.165.266.392.7.682 1.57 1.261l3.839 2.56c.775.516 1.163.775 1.582.876.37.09.757.09 1.128.003.42-.1.81-.357 1.588-.87L18 18.533c.878-.581 1.318-.87 1.588-1.266A2.43 2.43 0 0020 16.095c.039-.477-.122-.978-.44-1.982l-3.4-10.7c-.165-.52-.247-.779-.405-.972a1.296 1.296 0 00-.523-.382c-.23-.092-.502-.092-1.047-.092H9.754c-.547 0-.822 0-1.053.094a1.29 1.29 0 00-.524.384c-.158.194-.239.455-.401.977L4.428 14.136zm9.93-9.897c.13.162.198.383.331.82l2.919 9.588a12.146 12.146 0 00-3.49-1.18l-1.9-6.423a.248.248 0 00-.474 0l-1.878 6.418a12.128 12.128 0 00-3.505 1.184l2.934-9.588c.133-.439.2-.658.331-.82.116-.143.267-.254.437-.323.194-.078.423-.078.881-.078h2.095c.458 0 .688 0 .882.078.17.069.32.18.437.324zm-2.263 11.557c1.106 0 2.067-.28 2.548-.692a2.1 2.1 0 01-.155 1.636c-.308.57-.755.853-1.158 1.108-.506.321-.941.598-.941 1.34 0 .245.056.479.157.686a1.868 1.868 0 01-1.151-1.725v-.046c0-.512.001-1.143-.722-1.143a.765.765 0 00-.766.764c-.812-.813-.741-1.983-.741-1.983 0-.239.024-.611.131-.936.302.568 1.44.99 2.798.99z" clip-rule="evenodd"/>
|
||||
</svg>
|
After Width: | Height: | Size: 1.2 KiB |
Binary file not shown.
Binary file not shown.
|
@ -1,8 +1,32 @@
|
|||
---
|
||||
// Component Imports
|
||||
import Tour from '../components/Tour.astro';
|
||||
// You can import components from any supported Framework here!
|
||||
/* ASTRO:COMPONENT_IMPORTS */
|
||||
import {Icon, Image, Font} from 'astro/components';
|
||||
|
||||
// LOCAL ASSETS:
|
||||
import ImageBook from '../assets/book.png';
|
||||
// ImageBook = {url, height, width}
|
||||
// <Image use={ImageBook} />
|
||||
import IconBook from '../assets/book.svg';
|
||||
// IconBook = {raw}
|
||||
// <Icon use={IconBook} />
|
||||
import robotoFont400 from '../assets/fonts/roboto-slab-v22-latin-regular.woff2';
|
||||
// robotoFont = {url}
|
||||
// <Font use={robotoFont} family={} weight={} style={} />
|
||||
|
||||
// REMOTE ASSETS:
|
||||
|
||||
// Images:
|
||||
// N/A, people can create custom instegrations. (ex: unsplash)
|
||||
// Fonts:
|
||||
// N/A, added via config instead.
|
||||
// Icons 1:
|
||||
import {IconRocket} from 'astro/icons';
|
||||
// Icons 2 - Fontawesome Free:
|
||||
// Use astro-icon or https://github.com/antfu/unplugin-icons
|
||||
// Icons 3 - Fontawesome Pro, advanced:
|
||||
// N/A, people can create a custom integration.
|
||||
|
||||
|
||||
// Component Script:
|
||||
// You can write any JavaScript/TypeScript that you'd like here.
|
||||
|
@ -18,13 +42,11 @@ let title = 'My Astro Site';
|
|||
<meta charset="UTF-8">
|
||||
<meta name="viewport" content="width=device-width">
|
||||
<title>{title}</title>
|
||||
|
||||
<link rel="icon" type="image/x-icon" href="/favicon.ico" />
|
||||
<style global>
|
||||
@import "../styles/global.css";
|
||||
@import "../styles/home.css";
|
||||
</style>
|
||||
|
||||
<style>
|
||||
header {
|
||||
display: flex;
|
||||
|
@ -32,7 +54,11 @@ let title = 'My Astro Site';
|
|||
gap: 1em;
|
||||
max-width: min(100%, 68ch);
|
||||
}
|
||||
body {
|
||||
font-family: 'Roboto Slab';
|
||||
}
|
||||
</style>
|
||||
<!-- <Font use={robotoFont400} family="Roboto Slab" weight={400} style="normal" /> -->
|
||||
</head>
|
||||
<body>
|
||||
<main>
|
||||
|
@ -40,6 +66,10 @@ let title = 'My Astro Site';
|
|||
<div>
|
||||
<img width="60" height="80" src="/assets/logo.svg" alt="Astro logo">
|
||||
<h1>Welcome to <a href="https://astro.build/">Astro</a></h1>
|
||||
<Icon use={IconBook} />
|
||||
<Icon use={IconRocket} />
|
||||
<Image use={ImageBook} />
|
||||
<Font use={robotoFont400} family={'Roboto'} weight={400} />
|
||||
</div>
|
||||
</header>
|
||||
|
||||
|
|
|
@ -1,5 +1,9 @@
|
|||
{
|
||||
"compilerOptions": {
|
||||
"moduleResolution": "node"
|
||||
}
|
||||
"moduleResolution": "node",
|
||||
"types": [
|
||||
"unplugin-icons/types/raw"
|
||||
]
|
||||
},
|
||||
"include": ["./src"]
|
||||
}
|
||||
|
|
20
packages/astro/components/Font.astro
Normal file
20
packages/astro/components/Font.astro
Normal file
|
@ -0,0 +1,20 @@
|
|||
---
|
||||
export interface Props {
|
||||
use: string;
|
||||
family: string;
|
||||
weight: number;
|
||||
style?: string;
|
||||
}
|
||||
|
||||
const { use, family, weight, style } = Astro.props;
|
||||
---
|
||||
<Fragment set:html={`<style>
|
||||
/* roboto-slab-regular - latin */
|
||||
@font-face {
|
||||
font-family: '${family}';
|
||||
font-style: ${style || 'normal'};
|
||||
font-weight: ${weight};
|
||||
src: local(''),
|
||||
url('${use}') format('woff2');
|
||||
}
|
||||
</style>`}></Fragment>
|
12
packages/astro/components/Icon.astro
Normal file
12
packages/astro/components/Icon.astro
Normal file
|
@ -0,0 +1,12 @@
|
|||
---
|
||||
export interface Props {
|
||||
use: string;
|
||||
size?: number;
|
||||
}
|
||||
|
||||
let { use, size = 32 } = Astro.props;
|
||||
if (!use.startsWith('<svg')) {
|
||||
use = `<svg height="${size}" width="${size}" fill="currentColor">${use}</svg>`;
|
||||
}
|
||||
---
|
||||
<Fragment set:html={use} />
|
8
packages/astro/components/Image.astro
Normal file
8
packages/astro/components/Image.astro
Normal file
|
@ -0,0 +1,8 @@
|
|||
---
|
||||
export interface Props {
|
||||
use: string;
|
||||
}
|
||||
|
||||
const { use } = Astro.props;
|
||||
---
|
||||
<img src={use} />
|
|
@ -2,3 +2,8 @@ export { default as Code } from './Code.astro';
|
|||
export { default as Debug } from './Debug.astro';
|
||||
export { default as Markdown } from './Markdown.astro';
|
||||
export { default as Prism } from './Prism.astro';
|
||||
|
||||
export { default as Font } from './Font.astro';
|
||||
export { default as Icon } from './Icon.astro';
|
||||
export { default as Image } from './Image.astro';
|
||||
|
||||
|
|
4586
packages/astro/icons/index.js
Normal file
4586
packages/astro/icons/index.js
Normal file
File diff suppressed because one or more lines are too long
|
@ -16,6 +16,7 @@
|
|||
"exports": {
|
||||
".": "./astro.js",
|
||||
"./client/*": "./dist/runtime/client/*",
|
||||
"./icons": "./icons/index.js",
|
||||
"./components": "./components/index.js",
|
||||
"./components/*": "./components/*",
|
||||
"./debug": "./components/Debug.astro",
|
||||
|
@ -70,6 +71,7 @@
|
|||
"@proload/plugin-tsm": "^0.1.0",
|
||||
"@types/babel__core": "^7.1.15",
|
||||
"@types/debug": "^4.1.7",
|
||||
"@types/node-fetch": "^3.0.3",
|
||||
"@web/parse5-utils": "^1.3.0",
|
||||
"astring": "^1.7.5",
|
||||
"ci-info": "^3.2.0",
|
||||
|
|
|
@ -42,6 +42,7 @@ export const AstroConfigSchema = z.object({
|
|||
.default('./dist')
|
||||
.transform((val) => new URL(val)),
|
||||
renderers: z.array(z.string()).optional().default(['@astrojs/renderer-svelte', '@astrojs/renderer-vue', '@astrojs/renderer-react', '@astrojs/renderer-preact']),
|
||||
fonts: z.array(z.string()).optional().default([]),
|
||||
markdownOptions: z
|
||||
.object({
|
||||
footnotes: z.boolean().optional(),
|
||||
|
|
|
@ -4,12 +4,15 @@ import type { LogOptions } from './logger';
|
|||
import { builtinModules } from 'module';
|
||||
import { fileURLToPath } from 'url';
|
||||
import vite from './vite.js';
|
||||
|
||||
import astroVitePlugin from '../vite-plugin-astro/index.js';
|
||||
import astroViteServerPlugin from '../vite-plugin-astro-server/index.js';
|
||||
import astroPostprocessVitePlugin from '../vite-plugin-astro-postprocess/index.js';
|
||||
import configAliasVitePlugin from '../vite-plugin-config-alias/index.js';
|
||||
import markdownVitePlugin from '../vite-plugin-markdown/index.js';
|
||||
import jsxVitePlugin from '../vite-plugin-jsx/index.js';
|
||||
import svgVitePlugin from '../vite-plugin-svg/index.js';
|
||||
import fontsVitePlugin from '../vite-plugin-fonts/index.js';
|
||||
import { resolveDependency } from './util.js';
|
||||
|
||||
// Some packages are just external, and that’s the way it goes.
|
||||
|
@ -53,6 +56,8 @@ export async function createVite(inlineConfig: ViteConfigWithSSR, { astroConfig,
|
|||
astroViteServerPlugin({ config: astroConfig, logging }),
|
||||
markdownVitePlugin({ config: astroConfig }),
|
||||
jsxVitePlugin({ config: astroConfig, logging }),
|
||||
svgVitePlugin(),
|
||||
await fontsVitePlugin({ config: astroConfig, logging }),
|
||||
astroPostprocessVitePlugin({ config: astroConfig }),
|
||||
],
|
||||
publicDir: fileURLToPath(astroConfig.public),
|
||||
|
|
|
@ -14,6 +14,7 @@ import { injectTags } from './html.js';
|
|||
import { getParams, validateGetStaticPathsResult } from './routing.js';
|
||||
import { createResult } from './result.js';
|
||||
import { callGetStaticPaths, findPathItemByKey, RouteCache } from './route-cache.js';
|
||||
import { fontFamilies } from '../../vite-plugin-fonts/index.js';
|
||||
|
||||
const svelteStylesRE = /svelte\?svelte&type=style/;
|
||||
|
||||
|
@ -263,6 +264,13 @@ export async function render(renderers: Renderer[], mod: ComponentInstance, ssrO
|
|||
}
|
||||
});
|
||||
|
||||
console.log('AHHHH');
|
||||
tags.push({
|
||||
tag: 'style',
|
||||
children: `/*Astro Fonts:*/\n` + fontFamilies.join('\n'),
|
||||
injectTo: 'head',
|
||||
});
|
||||
|
||||
// add injected tags
|
||||
html = injectTags(html, tags);
|
||||
|
||||
|
|
59
packages/astro/src/vite-plugin-fonts/index.ts
Normal file
59
packages/astro/src/vite-plugin-fonts/index.ts
Normal file
|
@ -0,0 +1,59 @@
|
|||
import type { Plugin } from '../core/vite';
|
||||
import type { LogOptions } from '../core/logger';
|
||||
import type { AstroConfig } from '../@types/astro';
|
||||
import { createWriteStream } from 'node:fs';
|
||||
import { pipeline } from 'node:stream';
|
||||
import { promisify } from 'node:util';
|
||||
// @ts-expect-error
|
||||
import fetch from 'node-fetch';
|
||||
const streamPipeline = promisify(pipeline);
|
||||
|
||||
export let fontFamilies: string[] = [];
|
||||
|
||||
export default async function createPluginjsx({ config, logging }: { config: AstroConfig; logging: LogOptions }): Promise<Plugin> {
|
||||
// Load the fonts
|
||||
const fonts = config.fonts;
|
||||
const fontQueries = fonts.reduce((collect, fontQuery) => {
|
||||
const [fontId, fontWeight] = fontQuery.split('@');
|
||||
if (!collect.has(fontId)) {
|
||||
collect.set(fontId, []);
|
||||
}
|
||||
collect.get(fontId)!.push(fontWeight || '400');
|
||||
return collect;
|
||||
}, new Map<string, string[]>());
|
||||
|
||||
fontFamilies.length = 0; // hack: clear the array without losing a reference
|
||||
await Promise.all(
|
||||
[...fontQueries.entries()].map(async ([fontId, fontWeights]) => {
|
||||
const data = await fetch(`https://google-webfonts-helper.herokuapp.com/api/fonts/${fontId}`).then((r: any) => r.json());
|
||||
// console.log(data, fontId, fontWeights);
|
||||
for (const fontWeight of fontWeights) {
|
||||
const variant = data.variants.find((v: any) => v.fontWeight == fontWeight);
|
||||
if (!variant) {
|
||||
throw new Error('AHH!');
|
||||
}
|
||||
const downloadFontId = 'assets/' + fontId + '-' + fontWeight + '.woff2';
|
||||
|
||||
const fontDownloadResponse = await fetch(variant.woff2);
|
||||
if (!fontDownloadResponse.ok) throw new Error(`unexpected response ${fontDownloadResponse.statusText}`);
|
||||
await streamPipeline(fontDownloadResponse.body, createWriteStream(new URL(downloadFontId, config.public)));
|
||||
|
||||
fontFamilies.push(
|
||||
`@font-face {
|
||||
font-family: ${variant.fontFamily};
|
||||
font-style: ${variant.fontStyle};
|
||||
font-weight: ${variant.fontWeight};
|
||||
font-display: 'optional';
|
||||
src: local(''),
|
||||
url('/${downloadFontId}') format('woff2');
|
||||
}`.replace(/(^\s*)|\n/gm, '')
|
||||
);
|
||||
}
|
||||
})
|
||||
);
|
||||
|
||||
return {
|
||||
name: 'astro:fonts',
|
||||
async configureServer() {},
|
||||
};
|
||||
}
|
30
packages/astro/src/vite-plugin-svg/index.ts
Normal file
30
packages/astro/src/vite-plugin-svg/index.ts
Normal file
|
@ -0,0 +1,30 @@
|
|||
import type { Plugin } from '../core/vite';
|
||||
import * as fs from 'node:fs/promises';
|
||||
|
||||
export const SPECIAL_QUERY_RE = /[\?&](?:worker|sharedworker|raw|url)\b/
|
||||
|
||||
/** Use Astro config to allow for alternate or multiple JSX renderers (by default Vite will assume React) */
|
||||
export default function createSvgPlugin(): Plugin {
|
||||
const svgRegex = /\.svg$/
|
||||
|
||||
return {
|
||||
name: 'astro:jsx',
|
||||
enforce: 'pre', // run transforms before other plugins
|
||||
async resolveId (id, source, ...options) {
|
||||
if (!id.match(svgRegex)) {
|
||||
return null;
|
||||
}
|
||||
const resolution = await this.resolve(id, source, { skipSelf: true, ...options });
|
||||
return resolution;
|
||||
},
|
||||
async load (id) {
|
||||
console.log(id);
|
||||
if (!id.match(svgRegex)) {
|
||||
return null;
|
||||
}
|
||||
let svg = await fs.readFile(id, 'utf-8');
|
||||
console.log(svg);
|
||||
return `export default ${JSON.stringify(svg)}`
|
||||
}
|
||||
};
|
||||
}
|
47
scripts/icons/index.mjs
Normal file
47
scripts/icons/index.mjs
Normal file
|
@ -0,0 +1,47 @@
|
|||
import glob from 'tiny-glob';
|
||||
import fs from 'fs/promises';
|
||||
|
||||
let fontModuleContents = '';
|
||||
let uniqueIconIds = new Set();
|
||||
let foo = await glob('/Users/fks/Downloads/material-design-icons-master/src/**/24px.svg', {absolute: true, filesOnly: true});
|
||||
foo = foo.filter(a => !a.endsWith('round/24px.svg') && !a.endsWith('sharp/24px.svg') && !a.endsWith('twotone/24px.svg'));
|
||||
for (const iconPath of foo) {
|
||||
const iconId = `Icon` + iconPath
|
||||
.replace(/\/Users\/fks\/Downloads\/material-design-icons-master\/src\/.*?\/(.*?)\//, '$1')
|
||||
.replace('materialicons', '__')
|
||||
.replace('/24px.svg', '')
|
||||
.replace(/(^.)|(_[a-z0-9])|(__o)/g, v => v.toUpperCase())
|
||||
.replace(/_/g, '');
|
||||
const iconContents = (await fs.readFile(iconPath, {encoding: 'utf-8'}))
|
||||
.replace(/^\<svg.*?\>/, '')
|
||||
.replace(/\<\/svg\>$/, '');
|
||||
// console.log(iconContents);
|
||||
if (uniqueIconIds.has(iconId)) {
|
||||
console.log('CONFLICt', iconId);
|
||||
continue;
|
||||
}
|
||||
uniqueIconIds.add(iconId);
|
||||
fontModuleContents += `export const ${iconId} = ${JSON.stringify(iconContents)};\n`;
|
||||
}
|
||||
|
||||
fontModuleContents += `\n`;
|
||||
|
||||
let brands = await glob('/Users/fks/Downloads/fontawesome-free-5.15.4-web/svgs/brands/*.svg', {absolute: true, filesOnly: true});
|
||||
for (const iconPath of brands) {
|
||||
const iconId = `Logo` + iconPath
|
||||
.replace(/\/Users\/fks\/Downloads\/fontawesome\-free\-5\.15\.4\-web\/svgs\/brands\/(.*?)\.svg/, '$1')
|
||||
.replace(/(^.)|(\-[a-z0-9])/g, v => v.toUpperCase())
|
||||
.replace(/\-/g, '');
|
||||
const iconContents = (await fs.readFile(iconPath, {encoding: 'utf-8'}))
|
||||
.replace(/^\<svg.*?\>/, '')
|
||||
.replace(/\<\/svg\>$/, '');
|
||||
if (uniqueIconIds.has(iconId)) {
|
||||
console.log('CONFLICt', iconId);
|
||||
continue;
|
||||
}
|
||||
uniqueIconIds.add(iconId);
|
||||
fontModuleContents += `export const ${iconId} = ${JSON.stringify(iconContents)};\n`;
|
||||
}
|
||||
|
||||
|
||||
await fs.writeFile(`/Users/fks/Code/astro/packages/astro/icons/index.js`, fontModuleContents, {encoding: 'utf-8'});
|
58
yarn.lock
58
yarn.lock
|
@ -128,6 +128,13 @@
|
|||
dependencies:
|
||||
"@types/throttle-debounce" "^2.1.0"
|
||||
|
||||
"@antfu/utils@^0.4.0":
|
||||
version "0.4.0"
|
||||
resolved "https://registry.yarnpkg.com/@antfu/utils/-/utils-0.4.0.tgz#df100ed9922d7359bf6c99083765b5207086b9a7"
|
||||
integrity sha512-gqkpvjkgFUu+s3kP+Ly33OKpo5zvVY3FDFhv5BIb98SncS3KD6DNxPfNDjwHIoyXbz1leWo1j8DtRLZ1D2Jv+Q==
|
||||
dependencies:
|
||||
"@types/throttle-debounce" "^2.1.0"
|
||||
|
||||
"@apideck/better-ajv-errors@^0.3.1":
|
||||
version "0.3.2"
|
||||
resolved "https://registry.yarnpkg.com/@apideck/better-ajv-errors/-/better-ajv-errors-0.3.2.tgz#cd6d3814eda8aee38ee2e3fa6457be43af4f8361"
|
||||
|
@ -1364,7 +1371,22 @@
|
|||
resolved "https://registry.yarnpkg.com/@humanwhocodes/object-schema/-/object-schema-1.2.1.tgz#b520529ec21d8e5945a1851dfd1c32e94e39ff45"
|
||||
integrity sha512-ZnQMnLV4e7hDlUvw8H+U8ASL02SS2Gn6+9Ac3wGGLIe7+je2AeAOxPY+izIPJDfFDb7eDjev0Us8MO1iFRN8hA==
|
||||
|
||||
"@iconify/types@^1.0.12":
|
||||
"@iconify-json/mdi@^1.0.16":
|
||||
version "1.0.16"
|
||||
resolved "https://registry.yarnpkg.com/@iconify-json/mdi/-/mdi-1.0.16.tgz#bea26ebdb7dc67ad83c8f05c5ecc1b5fa44429f5"
|
||||
integrity sha512-EkmhzOXiaY5nDPz/eMzD6p1gVp9igRVZ0lIlsbpCgVokXV5iX08dAAz930JMzrcaE8aD8MSVikPagGNN74L13g==
|
||||
dependencies:
|
||||
"@iconify/types" "^1.0.10"
|
||||
|
||||
"@iconify/json@^2.0.33":
|
||||
version "2.0.33"
|
||||
resolved "https://registry.yarnpkg.com/@iconify/json/-/json-2.0.33.tgz#a04478a20dd8b92c75dc23ffa5e1a5d15e550bf5"
|
||||
integrity sha512-fVSm3rjcUJUX45BIs+AzVXQopI7oWfuxKnHleJKR//bEUK5UfUGHUu7860Wz8z9FuHKVejq+VxJItjFRl96OAQ==
|
||||
dependencies:
|
||||
"@iconify/types" "^1.0.9"
|
||||
pathe "^0.0.2"
|
||||
|
||||
"@iconify/types@^1.0.10", "@iconify/types@^1.0.12", "@iconify/types@^1.0.9":
|
||||
version "1.0.12"
|
||||
resolved "https://registry.yarnpkg.com/@iconify/types/-/types-1.0.12.tgz#839f1f784b7030b94482d51996570f4dbd7d6796"
|
||||
integrity sha512-6er6wSGF3hgc1JEZqiGpg21CTCjHBYOUwqLmb2Idzkjiw6ogalGP0ZMLVutCzah+0WB4yP+Zd2oVPN8jvJ+Ftg==
|
||||
|
@ -1897,7 +1919,7 @@
|
|||
dependencies:
|
||||
"@types/unist" "*"
|
||||
|
||||
"@types/node-fetch@^3.0.0":
|
||||
"@types/node-fetch@^3.0.0", "@types/node-fetch@^3.0.3":
|
||||
version "3.0.3"
|
||||
resolved "https://registry.yarnpkg.com/@types/node-fetch/-/node-fetch-3.0.3.tgz#9d969c9a748e841554a40ee435d26e53fa3ee899"
|
||||
integrity sha512-HhggYPH5N+AQe/OmN6fmhKmRRt2XuNJow+R3pQwJxOOF9GuwM7O2mheyGeIrs5MOIeNjDEdgdoyHBOrFeJBR3g==
|
||||
|
@ -5756,7 +5778,7 @@ kleur@^4.0.3, kleur@^4.1.1, kleur@^4.1.4, kleur@~4.1.4:
|
|||
resolved "https://registry.yarnpkg.com/kleur/-/kleur-4.1.4.tgz#8c202987d7e577766d039a8cd461934c01cda04d"
|
||||
integrity sha512-8QADVssbrFjivHWQU7KkMgptGTl6WAcSdlbBPY4uNF+mWr6DGcKrvY2w4FQJoXch7+fKMjj0dRrL75vk3k23OA==
|
||||
|
||||
kolorist@^1.5.0:
|
||||
kolorist@^1.5.0, kolorist@^1.5.1:
|
||||
version "1.5.1"
|
||||
resolved "https://registry.yarnpkg.com/kolorist/-/kolorist-1.5.1.tgz#c3d66dc4fabde4f6b7faa6efda84c00491f9e52b"
|
||||
integrity sha512-lxpCM3HTvquGxKGzHeknB/sUjuVoUElLlfYnXZT73K8geR9jQbroGlSCFBax9/0mpGoD3kzcMLnOlGQPJJNyqQ==
|
||||
|
@ -7235,6 +7257,11 @@ path-type@^4.0.0:
|
|||
resolved "https://registry.yarnpkg.com/path-type/-/path-type-4.0.0.tgz#84ed01c0a7ba380afe09d90a8c180dcd9d03043b"
|
||||
integrity sha512-gDKb8aZMDeD/tZWs9P6+q0J9Mwkdl6xMV8TjnGP3qJVJ06bdMgkbBlLU8IdfOsIsFz2BW1rNVT3XuNEl8zPAvw==
|
||||
|
||||
pathe@^0.0.2:
|
||||
version "0.0.2"
|
||||
resolved "https://registry.yarnpkg.com/pathe/-/pathe-0.0.2.tgz#d690780e578a8127e1d65828387609c153afc309"
|
||||
integrity sha512-mmK20YtPb4yXHlaPuOD/uPIpRu7iIK45GA/GiRSlNpIdfWDG5aEQmFT1HHtBmJB+t/6DvFOtOsEipsPA8Bx2cw==
|
||||
|
||||
pathe@^0.2.0:
|
||||
version "0.2.0"
|
||||
resolved "https://registry.yarnpkg.com/pathe/-/pathe-0.2.0.tgz#30fd7bbe0a0d91f0e60bae621f5d19e9e225c339"
|
||||
|
@ -9339,6 +9366,26 @@ unpipe@1.0.0:
|
|||
resolved "https://registry.yarnpkg.com/unpipe/-/unpipe-1.0.0.tgz#b2bf4ee8514aae6165b4817829d21b2ef49904ec"
|
||||
integrity sha1-sr9O6FFKrmFltIF4KdIbLvSZBOw=
|
||||
|
||||
unplugin-icons@^0.13.0:
|
||||
version "0.13.0"
|
||||
resolved "https://registry.yarnpkg.com/unplugin-icons/-/unplugin-icons-0.13.0.tgz#9bb2e75c61609dae86938044186288590bb990ba"
|
||||
integrity sha512-CyAl0HV3bZUGT7ut9agpPRhEYXCvufr80Fh72yrkD57BVCTZ7ze10Rt63ZrvPXiJQpd+aI/Bizm2aqOf3WPSfg==
|
||||
dependencies:
|
||||
"@antfu/install-pkg" "^0.1.0"
|
||||
"@antfu/utils" "^0.4.0"
|
||||
"@iconify/utils" "^1.0.20"
|
||||
debug "^4.3.3"
|
||||
kolorist "^1.5.1"
|
||||
local-pkg "^0.4.0"
|
||||
unplugin "^0.2.21"
|
||||
|
||||
unplugin@^0.2.21:
|
||||
version "0.2.21"
|
||||
resolved "https://registry.yarnpkg.com/unplugin/-/unplugin-0.2.21.tgz#7852cddd9f78f0b32881812fd2efd5a39dcc64e5"
|
||||
integrity sha512-IJ15/L5XbhnV7J09Zjk0FT5HEkBjkXucWAXQWRsmEtUxmmxwh23yavrmDbCF6ZPxWiVB28+wnKIHePTRRpQPbQ==
|
||||
dependencies:
|
||||
webpack-virtual-modules "^0.4.3"
|
||||
|
||||
upath@^1.2.0:
|
||||
version "1.2.0"
|
||||
resolved "https://registry.yarnpkg.com/upath/-/upath-1.2.0.tgz#8f66dbcd55a883acdae4408af8b035a5044c1894"
|
||||
|
@ -9626,6 +9673,11 @@ webidl-conversions@^4.0.2:
|
|||
resolved "https://registry.yarnpkg.com/webidl-conversions/-/webidl-conversions-4.0.2.tgz#a855980b1f0b6b359ba1d5d9fb39ae941faa63ad"
|
||||
integrity sha512-YQ+BmxuTgd6UXZW3+ICGfyqRyHXVlD5GtQr5+qjiNW7bF0cqrzX500HVXPBOvgXb5YnzDd+h0zqyv61KUD7+Sg==
|
||||
|
||||
webpack-virtual-modules@^0.4.3:
|
||||
version "0.4.3"
|
||||
resolved "https://registry.yarnpkg.com/webpack-virtual-modules/-/webpack-virtual-modules-0.4.3.tgz#cd597c6d51d5a5ecb473eea1983a58fa8a17ded9"
|
||||
integrity sha512-5NUqC2JquIL2pBAAo/VfBP6KuGkHIZQXW/lNKupLPfhViwh8wNsu0BObtl09yuKZszeEUfbXz8xhrHvSG16Nqw==
|
||||
|
||||
whatwg-url@^5.0.0:
|
||||
version "5.0.0"
|
||||
resolved "https://registry.yarnpkg.com/whatwg-url/-/whatwg-url-5.0.0.tgz#966454e8765462e37644d3626f6742ce8b70965d"
|
||||
|
|
Loading…
Add table
Reference in a new issue