build fixes
This commit is contained in:
parent
f8ed02ea0a
commit
6a9f04c0b1
|
|
@ -9,9 +9,6 @@ import { visualizer } from 'rollup-plugin-visualizer'
|
|||
import license from 'rollup-plugin-license'
|
||||
import esbuild from 'rollup-plugin-esbuild'
|
||||
|
||||
const svgFiles = readSvgs(),
|
||||
aliases = readAliases()
|
||||
|
||||
/**
|
||||
* Build icons
|
||||
*
|
||||
|
|
@ -38,6 +35,8 @@ export const buildIcons = ({
|
|||
indexFile = 'icons.js'
|
||||
}) => {
|
||||
const DIST_DIR = path.resolve(PACKAGES_DIR, name);
|
||||
const svgFiles = readSvgs(),
|
||||
aliases = readAliases()
|
||||
|
||||
let index = []
|
||||
let typings = []
|
||||
|
|
@ -97,7 +96,7 @@ export const buildIcons = ({
|
|||
})
|
||||
|
||||
// Write aliases
|
||||
if (aliases && aliasTemplate) {
|
||||
if (aliases.length && aliasTemplate) {
|
||||
let aliasesStr = '';
|
||||
|
||||
Object.entries(aliases).forEach(([from, to]) => {
|
||||
|
|
|
|||
|
|
@ -49,27 +49,29 @@ export const readSvgDirectory = (directory) => {
|
|||
export const readSvgs = () => {
|
||||
const svgFiles = readSvgDirectory(ICONS_DIR)
|
||||
|
||||
return svgFiles.map(svgFile => {
|
||||
const name = basename(svgFile, '.svg'),
|
||||
return svgFiles
|
||||
// .slice(0, 100)
|
||||
.map(svgFile => {
|
||||
const name = basename(svgFile, '.svg'),
|
||||
namePascal = toPascalCase(`icon ${name}`),
|
||||
contents = readSvg(svgFile, ICONS_DIR).trim(),
|
||||
path = resolve(ICONS_DIR, svgFile),
|
||||
obj = parseSync(contents.replace('<path stroke="none" d="M0 0h24v24H0z" fill="none"/>', ''));
|
||||
|
||||
return {
|
||||
name,
|
||||
namePascal,
|
||||
contents,
|
||||
obj,
|
||||
path
|
||||
};
|
||||
});
|
||||
return {
|
||||
name,
|
||||
namePascal,
|
||||
contents,
|
||||
obj,
|
||||
path
|
||||
};
|
||||
});
|
||||
}
|
||||
|
||||
export const readAliases = () => {
|
||||
const allAliases = JSON.parse(fs.readFileSync(resolve(HOME_DIR, 'aliases.json'), 'utf-8')),
|
||||
svgFilesList = readSvgDirectory(ICONS_DIR).map(name => name.replace('.svg', ''));
|
||||
|
||||
svgFilesList = readSvgs().map(icon => icon.name);
|
||||
|
||||
let aliases = [];
|
||||
|
||||
for (const [key, value] of Object.entries(allAliases)) {
|
||||
|
|
@ -128,14 +130,14 @@ export const toPascalCase = (string) => {
|
|||
|
||||
|
||||
|
||||
export const addFloats = function(n1, n2) {
|
||||
export const addFloats = function (n1, n2) {
|
||||
return Math.round((parseFloat(n1) + parseFloat(n2)) * 1000) / 1000
|
||||
}
|
||||
|
||||
export const optimizePath = function(path) {
|
||||
export const optimizePath = function (path) {
|
||||
let transformed = svgpath(path).rel().round(3).toString()
|
||||
|
||||
return svgParse(transformed).map(function(a) {
|
||||
return svgParse(transformed).map(function (a) {
|
||||
return a.join(' ')
|
||||
}).join('')
|
||||
}
|
||||
|
|
@ -160,16 +162,16 @@ export const optimizeSVG = (data) => {
|
|||
|
||||
export function buildIconsObject(svgFiles, getSvg) {
|
||||
return svgFiles
|
||||
.map(svgFile => {
|
||||
const name = path.basename(svgFile, '.svg');
|
||||
const svg = getSvg(svgFile);
|
||||
const contents = getSvgContents(svg);
|
||||
return { name, contents };
|
||||
})
|
||||
.reduce((icons, icon) => {
|
||||
icons[icon.name] = icon.contents;
|
||||
return icons;
|
||||
}, {});
|
||||
.map(svgFile => {
|
||||
const name = path.basename(svgFile, '.svg');
|
||||
const svg = getSvg(svgFile);
|
||||
const contents = getSvgContents(svg);
|
||||
return { name, contents };
|
||||
})
|
||||
.reduce((icons, icon) => {
|
||||
icons[icon.name] = icon.contents;
|
||||
return icons;
|
||||
}, {});
|
||||
}
|
||||
|
||||
function getSvgContents(svg) {
|
||||
|
|
@ -188,7 +190,7 @@ export const createScreenshot = async (filePath) => {
|
|||
await cp.exec(`rsvg-convert -x 4 -y 4 ${filePath} > ${filePath.replace('.svg', '@2x.png')}`)
|
||||
}
|
||||
|
||||
export const generateIconsPreview = async function(files, destFile, {
|
||||
export const generateIconsPreview = async function (files, destFile, {
|
||||
columnsCount = 19,
|
||||
paddingOuter = 7,
|
||||
color = '#354052',
|
||||
|
|
@ -197,28 +199,28 @@ export const generateIconsPreview = async function(files, destFile, {
|
|||
} = {}) {
|
||||
|
||||
const padding = 20,
|
||||
iconSize = 24
|
||||
iconSize = 24
|
||||
|
||||
const iconsCount = files.length,
|
||||
rowsCount = Math.ceil(iconsCount / columnsCount),
|
||||
width = columnsCount * (iconSize + padding) + 2 * paddingOuter - padding,
|
||||
height = rowsCount * (iconSize + padding) + 2 * paddingOuter - padding
|
||||
rowsCount = Math.ceil(iconsCount / columnsCount),
|
||||
width = columnsCount * (iconSize + padding) + 2 * paddingOuter - padding,
|
||||
height = rowsCount * (iconSize + padding) + 2 * paddingOuter - padding
|
||||
|
||||
let svgContentSymbols = '',
|
||||
svgContentIcons = '',
|
||||
x = paddingOuter,
|
||||
y = paddingOuter
|
||||
svgContentIcons = '',
|
||||
x = paddingOuter,
|
||||
y = paddingOuter
|
||||
|
||||
files.forEach(function(file, i) {
|
||||
files.forEach(function (file, i) {
|
||||
let name = path.basename(file, '.svg')
|
||||
|
||||
let svgFile = fs.readFileSync(file),
|
||||
svgFileContent = svgFile.toString()
|
||||
svgFileContent = svgFile.toString()
|
||||
|
||||
svgFileContent = svgFileContent.replace('<svg xmlns="http://www.w3.org/2000/svg"', `<symbol id="${name}"`)
|
||||
.replace(' width="24" height="24"', '')
|
||||
.replace('</svg>', '</symbol>')
|
||||
.replace(/\n\s+/g, '')
|
||||
.replace(' width="24" height="24"', '')
|
||||
.replace('</svg>', '</symbol>')
|
||||
.replace(/\n\s+/g, '')
|
||||
|
||||
svgContentSymbols += `\t${svgFileContent}\n`
|
||||
svgContentIcons += `\t<use xlink:href="#${name}" x="${x}" y="${y}" width="${iconSize}" height="${iconSize}" />\n`
|
||||
|
|
@ -234,26 +236,26 @@ export const generateIconsPreview = async function(files, destFile, {
|
|||
const svgContent = `<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" viewBox="0 0 ${width} ${height}" width="${width}" height="${height}" style="color: ${color}"><rect x="0" y="0" width="${width}" height="${height}" fill="${background}"></rect>\n${svgContentSymbols}\n${svgContentIcons}\n</svg>`
|
||||
|
||||
fs.writeFileSync(destFile, svgContent)
|
||||
|
||||
|
||||
if (png) {
|
||||
await createScreenshot(destFile)
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
export const printChangelog = function(newIcons, modifiedIcons, renamedIcons, pretty = false) {
|
||||
export const printChangelog = function (newIcons, modifiedIcons, renamedIcons, pretty = false) {
|
||||
if (newIcons.length > 0) {
|
||||
if (pretty) {
|
||||
console.log(`### ${newIcons.length} new icons:\n`)
|
||||
|
||||
newIcons.forEach(function(icon, i) {
|
||||
newIcons.forEach(function (icon, i) {
|
||||
console.log(`- \`${icon}\``)
|
||||
})
|
||||
} else {
|
||||
let str = ''
|
||||
str += `${newIcons.length} new icons: `
|
||||
|
||||
newIcons.forEach(function(icon, i) {
|
||||
newIcons.forEach(function (icon, i) {
|
||||
str += `\`${icon}\``
|
||||
|
||||
if ((i + 1) <= newIcons.length - 1) {
|
||||
|
|
@ -271,7 +273,7 @@ export const printChangelog = function(newIcons, modifiedIcons, renamedIcons, pr
|
|||
let str = ''
|
||||
str += `Fixed icons: `
|
||||
|
||||
modifiedIcons.forEach(function(icon, i) {
|
||||
modifiedIcons.forEach(function (icon, i) {
|
||||
str += `\`${icon}\``
|
||||
|
||||
if ((i + 1) <= modifiedIcons.length - 1) {
|
||||
|
|
@ -286,7 +288,7 @@ export const printChangelog = function(newIcons, modifiedIcons, renamedIcons, pr
|
|||
if (renamedIcons.length > 0) {
|
||||
console.log(`Renamed icons: `)
|
||||
|
||||
renamedIcons.forEach(function(icon, i) {
|
||||
renamedIcons.forEach(function (icon, i) {
|
||||
console.log(`- \`${icon[0]}\` renamed to \`${icon[1]}\``)
|
||||
})
|
||||
}
|
||||
|
|
@ -323,7 +325,7 @@ export const getCompileOptions = () => {
|
|||
throw 'property includeCategories is not an array or string'
|
||||
}
|
||||
const tags = Object.entries(require('./tags.json'))
|
||||
tempOptions.includeCategories.forEach(function(category) {
|
||||
tempOptions.includeCategories.forEach(function (category) {
|
||||
category = category.charAt(0).toUpperCase() + category.slice(1)
|
||||
for (const [icon, data] of tags) {
|
||||
if (data.category === category && compileOptions.includeIcons.indexOf(icon) === -1) {
|
||||
|
|
@ -337,14 +339,14 @@ export const getCompileOptions = () => {
|
|||
if (!Array.isArray(tempOptions.excludeIcons)) {
|
||||
throw 'property excludeIcons is not an array'
|
||||
}
|
||||
compileOptions.includeIcons = compileOptions.includeIcons.filter(function(icon) {
|
||||
compileOptions.includeIcons = compileOptions.includeIcons.filter(function (icon) {
|
||||
return tempOptions.excludeIcons.indexOf(icon) === -1
|
||||
})
|
||||
}
|
||||
|
||||
if (typeof tempOptions.excludeOffIcons !== 'undefined' && tempOptions.excludeOffIcons) {
|
||||
// Exclude `*-off` icons
|
||||
compileOptions.includeIcons = compileOptions.includeIcons.filter(function(icon) {
|
||||
compileOptions.includeIcons = compileOptions.includeIcons.filter(function (icon) {
|
||||
return !icon.endsWith('-off')
|
||||
})
|
||||
}
|
||||
|
|
|
|||
|
|
@ -61,6 +61,7 @@
|
|||
"@rollup/plugin-node-resolve": "9.0.0",
|
||||
"@svgr/babel-plugin-replace-jsx-attribute-value": "5.0.1",
|
||||
"@svgr/core": "5.4.0",
|
||||
"@testing-library/jest-dom": "^6.1.6",
|
||||
"@vue/babel-plugin-jsx": "^1.1.1",
|
||||
"adm-zip": "^0.5.10",
|
||||
"cheerio": "^1.0.0-rc.12",
|
||||
|
|
@ -69,6 +70,8 @@
|
|||
"fs-extra": "^10.1.0",
|
||||
"glob": "7.1.6",
|
||||
"html-minifier": "^4.0.0",
|
||||
"jest-serializer-html": "^7.1.0",
|
||||
"jsdom": "^23.0.1",
|
||||
"lodash.template": "4.5.0",
|
||||
"minimist": "1.2.6",
|
||||
"node-sass": "8.0.0",
|
||||
|
|
@ -89,9 +92,7 @@
|
|||
"svgpath": "^2.6.0",
|
||||
"svgson": "^5.2.1",
|
||||
"typescript": "^5.1.6",
|
||||
"vitest": "^1.1.2",
|
||||
"@testing-library/jest-dom": "^6.1.6",
|
||||
"jest-serializer-html": "^7.1.0"
|
||||
"vitest": "^1.1.2"
|
||||
},
|
||||
"release-it": {
|
||||
"plugins": {
|
||||
|
|
|
|||
|
|
@ -1,3 +1 @@
|
|||
export { default as IconAaa } from './icons/IconCircle';
|
||||
export { default as IconBbb } from './icons/IconSquare';
|
||||
export { default as IconCcc } from './icons/IconSquare';
|
||||
export {};
|
||||
|
|
@ -38,7 +38,7 @@ describe("Preact Icon component", () => {
|
|||
|
||||
const svg = container.getElementsByTagName("svg")[0]
|
||||
|
||||
expect(svg).toHaveStyle('color: red')
|
||||
expect(svg).toHaveStyle('color: rgb(255, 0, 0)')
|
||||
})
|
||||
|
||||
it("should match snapshot", () => {
|
||||
|
|
|
|||
|
|
@ -1,3 +1 @@
|
|||
export { default as IconAaa } from './icons/IconCircle';
|
||||
export { default as IconBbb } from './icons/IconSquare';
|
||||
export { default as IconCcc } from './icons/IconSquare';
|
||||
export {};
|
||||
|
|
@ -38,7 +38,7 @@ describe("React Icon component", () => {
|
|||
|
||||
const svg = container.getElementsByTagName("svg")[0]
|
||||
|
||||
expect(svg).toHaveStyle('color: red')
|
||||
expect(svg).toHaveStyle('color: rgb(255, 0, 0)')
|
||||
})
|
||||
|
||||
it("should match snapshot", () => {
|
||||
|
|
|
|||
|
|
@ -1,3 +1 @@
|
|||
export { default as IconAaa } from './icons/IconCircle';
|
||||
export { default as IconBbb } from './icons/IconSquare';
|
||||
export { default as IconCcc } from './icons/IconSquare';
|
||||
export {};
|
||||
|
|
@ -35,7 +35,7 @@ describe("Solidjs Icon component", () => {
|
|||
|
||||
const svg = container.getElementsByTagName("svg")[0]
|
||||
|
||||
expect(svg).toHaveStyle('color: red')
|
||||
expect(svg).toHaveStyle('color: rgb(255, 0, 0)')
|
||||
})
|
||||
|
||||
test("should match snapshot", () => {
|
||||
|
|
|
|||
|
|
@ -1,3 +1 @@
|
|||
export { default as IconAaa } from './icons/circle.svelte';
|
||||
export { default as IconBbb } from './icons/square.svelte';
|
||||
export { default as IconCcc } from './icons/square.svelte';
|
||||
export {};
|
||||
|
|
@ -33,7 +33,7 @@ describe("Svelte Icon component", () => {
|
|||
|
||||
const svg = container.getElementsByTagName("svg")[0]
|
||||
|
||||
expect(svg).toHaveStyle('color: red')
|
||||
expect(svg).toHaveStyle('color: rgb(255, 0, 0)')
|
||||
})
|
||||
|
||||
it("should update svg attributes when there are props passed to the component", () => {
|
||||
|
|
|
|||
|
|
@ -0,0 +1,22 @@
|
|||
// vitest.config.ts
|
||||
import { defineConfig } from "file:///Users/chomik/htdocs/tabler-icons/node_modules/.pnpm/vitest@1.1.2/node_modules/vitest/dist/config.js";
|
||||
import { svelte } from "file:///Users/chomik/htdocs/tabler-icons/node_modules/.pnpm/@sveltejs+vite-plugin-svelte@2.4.2_svelte@4.0.1_vite@4.0.4/node_modules/@sveltejs/vite-plugin-svelte/src/index.js";
|
||||
var vitest_config_default = defineConfig({
|
||||
plugins: [
|
||||
svelte({
|
||||
hot: false
|
||||
})
|
||||
],
|
||||
test: {
|
||||
globals: true,
|
||||
environment: "jsdom",
|
||||
setupFiles: "./setupVitest.ts",
|
||||
alias: [
|
||||
{ find: /^svelte$/, replacement: "svelte/internal" }
|
||||
]
|
||||
}
|
||||
});
|
||||
export {
|
||||
vitest_config_default as default
|
||||
};
|
||||
//# sourceMappingURL=data:application/json;base64,ewogICJ2ZXJzaW9uIjogMywKICAic291cmNlcyI6IFsidml0ZXN0LmNvbmZpZy50cyJdLAogICJzb3VyY2VzQ29udGVudCI6IFsiY29uc3QgX192aXRlX2luamVjdGVkX29yaWdpbmFsX2Rpcm5hbWUgPSBcIi9Vc2Vycy9jaG9taWsvaHRkb2NzL3RhYmxlci1pY29ucy9wYWNrYWdlcy9pY29ucy1zdmVsdGVcIjtjb25zdCBfX3ZpdGVfaW5qZWN0ZWRfb3JpZ2luYWxfZmlsZW5hbWUgPSBcIi9Vc2Vycy9jaG9taWsvaHRkb2NzL3RhYmxlci1pY29ucy9wYWNrYWdlcy9pY29ucy1zdmVsdGUvdml0ZXN0LmNvbmZpZy50c1wiO2NvbnN0IF9fdml0ZV9pbmplY3RlZF9vcmlnaW5hbF9pbXBvcnRfbWV0YV91cmwgPSBcImZpbGU6Ly8vVXNlcnMvY2hvbWlrL2h0ZG9jcy90YWJsZXItaWNvbnMvcGFja2FnZXMvaWNvbnMtc3ZlbHRlL3ZpdGVzdC5jb25maWcudHNcIjtpbXBvcnQgeyBkZWZpbmVDb25maWcgfSBmcm9tICd2aXRlc3QvY29uZmlnJ1xuaW1wb3J0IHsgc3ZlbHRlIH0gZnJvbSAnQHN2ZWx0ZWpzL3ZpdGUtcGx1Z2luLXN2ZWx0ZSdcblxuZXhwb3J0IGRlZmF1bHQgZGVmaW5lQ29uZmlnKHtcbiAgcGx1Z2luczogW1xuICAgIHN2ZWx0ZSh7XG4gICAgICBob3Q6IGZhbHNlLFxuICAgIH0pXG4gIF0sXG4gIHRlc3Q6IHtcbiAgICBnbG9iYWxzOiB0cnVlLFxuICAgIGVudmlyb25tZW50OiAnanNkb20nLFxuICAgIHNldHVwRmlsZXM6ICcuL3NldHVwVml0ZXN0LnRzJyxcbiAgICBhbGlhczogW1xuICAgICAgeyBmaW5kOiAvXnN2ZWx0ZSQvLCByZXBsYWNlbWVudDogXCJzdmVsdGUvaW50ZXJuYWxcIiB9XG4gICAgXVxuICB9LFxufSk7XG4iXSwKICAibWFwcGluZ3MiOiAiO0FBQTJWLFNBQVMsb0JBQW9CO0FBQ3hYLFNBQVMsY0FBYztBQUV2QixJQUFPLHdCQUFRLGFBQWE7QUFBQSxFQUMxQixTQUFTO0FBQUEsSUFDUCxPQUFPO0FBQUEsTUFDTCxLQUFLO0FBQUEsSUFDUCxDQUFDO0FBQUEsRUFDSDtBQUFBLEVBQ0EsTUFBTTtBQUFBLElBQ0osU0FBUztBQUFBLElBQ1QsYUFBYTtBQUFBLElBQ2IsWUFBWTtBQUFBLElBQ1osT0FBTztBQUFBLE1BQ0wsRUFBRSxNQUFNLFlBQVksYUFBYSxrQkFBa0I7QUFBQSxJQUNyRDtBQUFBLEVBQ0Y7QUFDRixDQUFDOyIsCiAgIm5hbWVzIjogW10KfQo=
|
||||
|
|
@ -1,3 +1 @@
|
|||
export { default as IconAaa } from './icons/IconCircle';
|
||||
export { default as IconBbb } from './icons/IconSquare';
|
||||
export { default as IconCcc } from './icons/IconSquare';
|
||||
export {};
|
||||
|
|
@ -1,15 +1,6 @@
|
|||
import { h } from 'vue';
|
||||
import type { SVGAttributes, FunctionalComponent } from 'vue';
|
||||
import defaultAttributes from './defaultAttributes';
|
||||
|
||||
export interface SVGProps extends Partial<SVGAttributes> {
|
||||
size?: 24 | number;
|
||||
strokeWidth?: number | string;
|
||||
}
|
||||
|
||||
export type IconNode = [elementName: string, attrs: Record<string, string>][];
|
||||
export type Icon = FunctionalComponent<SVGProps>;
|
||||
|
||||
import { Icon, IconNode } from './types';
|
||||
|
||||
const createVueComponent =
|
||||
(iconName: string, iconNamePascal: string, iconNode: IconNode): Icon =>
|
||||
|
|
|
|||
|
|
@ -0,0 +1,9 @@
|
|||
import type { SVGAttributes, FunctionalComponent } from 'vue';
|
||||
|
||||
export interface SVGProps extends Partial<SVGAttributes> {
|
||||
size?: 24 | number | string;
|
||||
strokeWidth?: number | string;
|
||||
}
|
||||
|
||||
export type IconNode = [elementName: string, attrs: Record<string, string>][];
|
||||
export type Icon = FunctionalComponent<SVGProps>;
|
||||
|
|
@ -33,7 +33,7 @@ describe("Vue Icon component", () => {
|
|||
|
||||
const svg = container.getElementsByTagName("svg")[0]
|
||||
|
||||
expect(svg).toHaveStyle('color: red')
|
||||
expect(svg).toHaveStyle('color: rgb(255, 0, 0)')
|
||||
})
|
||||
|
||||
it("should update svg attributes when there are props passed to the component", () => {
|
||||
|
|
|
|||
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
|
|
@ -34,8 +34,8 @@ const buildCategories = () => {
|
|||
|
||||
if(fs.existsSync(`./categories`)) {
|
||||
fs.rmSync(`./categories`, { recursive: true })
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
fs.mkdirSync(`./categories`)
|
||||
|
||||
|
||||
|
|
@ -70,14 +70,7 @@ export default ${namePascal} => \`${svg.contents}\`;`;
|
|||
const indexItemTemplate = ({
|
||||
name,
|
||||
namePascal
|
||||
}) => `export { default as ${namePascal} } from './icons/${namePascal}';`
|
||||
|
||||
const typeDefinitionsTemplate = () => `// Generated icons`
|
||||
|
||||
const indexTypeTemplate = ({
|
||||
namePascal
|
||||
}) => `export declare const ${namePascal}: string;`
|
||||
|
||||
}) => `export { default as ${namePascal} } from './${namePascal}';`
|
||||
|
||||
|
||||
buildSprite()
|
||||
|
|
@ -87,7 +80,7 @@ buildIcons({
|
|||
name: 'icons',
|
||||
componentTemplate,
|
||||
indexItemTemplate,
|
||||
typeDefinitionsTemplate,
|
||||
indexTypeTemplate,
|
||||
pretty: false
|
||||
pretty: false,
|
||||
extension: 'ts',
|
||||
indexFile: 'icons/index.ts',
|
||||
})
|
||||
|
|
|
|||
|
|
@ -45,8 +45,7 @@
|
|||
"copy:icons": "mkdir -p ./icons && cp ../../icons/*.svg ./icons/",
|
||||
"copy:tags": "cp ../../tags.json tags.json",
|
||||
"copy:license": "cp ../../LICENSE ./LICENSE",
|
||||
"clean": "rm -rf dist && rm -rf src/icons/*.js && rm -rf icons",
|
||||
"test": "jest --env=jsdom"
|
||||
"clean": "rm -rf dist && rm -rf src/icons/*.js && rm -rf src/icons/*.ts && rm -rf icons"
|
||||
},
|
||||
"keywords": [
|
||||
"icons",
|
||||
|
|
|
|||
|
|
@ -1,12 +1,13 @@
|
|||
import fs from 'fs'
|
||||
import { getRollupPlugins } from '../../.build/build-icons.mjs'
|
||||
import dts from "rollup-plugin-dts";
|
||||
|
||||
const pkg = JSON.parse(fs.readFileSync('package.json', 'utf-8'))
|
||||
|
||||
const packageName = '@tabler/icons';
|
||||
const outputFileName = 'tabler-icons';
|
||||
const outputDir = 'dist';
|
||||
const inputs = ['./src/tabler-icons.js'];
|
||||
const inputs = ['./src/tabler-icons.ts'];
|
||||
const bundles = [
|
||||
{
|
||||
format: 'umd',
|
||||
|
|
@ -33,25 +34,34 @@ const bundles = [
|
|||
];
|
||||
|
||||
const configs = bundles
|
||||
.map(({ inputs, outputDir, format, minify, preserveModules }) =>
|
||||
inputs.map(input => ({
|
||||
input,
|
||||
plugins: getRollupPlugins(pkg, minify),
|
||||
output: {
|
||||
name: packageName,
|
||||
...(preserveModules
|
||||
? {
|
||||
dir: `${outputDir}/${format}`,
|
||||
}
|
||||
: {
|
||||
file: `${outputDir}/${format}/${outputFileName}${minify ? '.min' : ''}.js`,
|
||||
}),
|
||||
format,
|
||||
preserveModules,
|
||||
sourcemap: true,
|
||||
},
|
||||
})),
|
||||
)
|
||||
.flat();
|
||||
.map(({ inputs, outputDir, format, minify, preserveModules }) =>
|
||||
inputs.map(input => ({
|
||||
input,
|
||||
plugins: getRollupPlugins(pkg, minify),
|
||||
output: {
|
||||
name: packageName,
|
||||
...(preserveModules
|
||||
? {
|
||||
dir: `${outputDir}/${format}`,
|
||||
}
|
||||
: {
|
||||
file: `${outputDir}/${format}/${outputFileName}${minify ? '.min' : ''}.js`,
|
||||
}),
|
||||
format,
|
||||
preserveModules,
|
||||
sourcemap: true,
|
||||
},
|
||||
})),
|
||||
)
|
||||
.flat();
|
||||
|
||||
export default configs;
|
||||
export default [
|
||||
{
|
||||
input: inputs[0],
|
||||
output: [{
|
||||
file: `dist/${outputFileName}.d.ts`, format: "es"
|
||||
}],
|
||||
plugins: [dts()],
|
||||
},
|
||||
...configs
|
||||
];
|
||||
|
|
|
|||
|
|
@ -1 +0,0 @@
|
|||
export * from './icons';
|
||||
|
|
@ -0,0 +1,2 @@
|
|||
export * from './icons/index';
|
||||
export * from './aliases';
|
||||
|
|
@ -1,25 +0,0 @@
|
|||
import fs from 'fs'
|
||||
import path from 'path'
|
||||
|
||||
describe('SVGIcon', () => {
|
||||
let container
|
||||
|
||||
beforeEach(() => {
|
||||
container = document.createElement('div')
|
||||
document.body.appendChild(container)
|
||||
})
|
||||
|
||||
afterEach(() => {
|
||||
container.innerHTML = ''
|
||||
document.body.removeChild(container)
|
||||
})
|
||||
|
||||
test('renders the correct class and XML namespace', () => {
|
||||
container.innerHTML = fs.readFileSync(path.join('./icons', '2fa.svg'), 'utf-8')
|
||||
const svg = container.querySelector('svg')
|
||||
|
||||
expect(svg.getAttribute('xmlns')).toBe('http://www.w3.org/2000/svg')
|
||||
expect(svg.classList.contains('icon')).toBe(true)
|
||||
expect(svg.classList.contains('icon-tabler')).toBe(true)
|
||||
})
|
||||
})
|
||||
230
pnpm-lock.yaml
230
pnpm-lock.yaml
|
|
@ -77,6 +77,9 @@ importers:
|
|||
jest-serializer-html:
|
||||
specifier: ^7.1.0
|
||||
version: 7.1.0
|
||||
jsdom:
|
||||
specifier: ^23.0.1
|
||||
version: 23.0.1
|
||||
lodash.template:
|
||||
specifier: 4.5.0
|
||||
version: 4.5.0
|
||||
|
|
@ -139,7 +142,7 @@ importers:
|
|||
version: 5.3.3
|
||||
vitest:
|
||||
specifier: ^1.1.2
|
||||
version: 1.1.2
|
||||
version: 1.1.2(jsdom@23.0.1)
|
||||
|
||||
packages/icons: {}
|
||||
|
||||
|
|
@ -5944,7 +5947,7 @@ packages:
|
|||
dom-accessibility-api: 0.5.15
|
||||
lodash: 4.17.21
|
||||
redent: 3.0.0
|
||||
vitest: 1.1.2
|
||||
vitest: 1.1.2(jsdom@23.0.1)
|
||||
dev: true
|
||||
|
||||
/@testing-library/preact@3.2.3(preact@10.11.3):
|
||||
|
|
@ -6462,6 +6465,15 @@ packages:
|
|||
- supports-color
|
||||
dev: true
|
||||
|
||||
/agent-base@7.1.0:
|
||||
resolution: {integrity: sha512-o/zjMZRhJxny7OyEF+Op8X+efiELC7k7yOjMzgfzVqOzXqkBkWI79YoTdOtsuWd5BWhAGAuOY/Xa6xpiaWXiNg==}
|
||||
engines: {node: '>= 14'}
|
||||
dependencies:
|
||||
debug: 4.3.4
|
||||
transitivePeerDependencies:
|
||||
- supports-color
|
||||
dev: true
|
||||
|
||||
/agentkeepalive@4.2.1:
|
||||
resolution: {integrity: sha512-Zn4cw2NEqd+9fiSVWMscnjyQ1a8Yfoc5oBajLeo5w+YBHgDUcEBY2hS4YpTz6iN5f/2zQiktcuM6tS8x1p9dpA==}
|
||||
engines: {node: '>= 8.0.0'}
|
||||
|
|
@ -7721,6 +7733,13 @@ packages:
|
|||
css-tree: 1.1.3
|
||||
dev: true
|
||||
|
||||
/cssstyle@3.0.0:
|
||||
resolution: {integrity: sha512-N4u2ABATi3Qplzf0hWbVCdjenim8F3ojEXpBDF5hBpjzW182MjNGLqfmQ0SkSPeQ+V86ZXgeH8aXj6kayd4jgg==}
|
||||
engines: {node: '>=14'}
|
||||
dependencies:
|
||||
rrweb-cssom: 0.6.0
|
||||
dev: true
|
||||
|
||||
/csstype@2.6.21:
|
||||
resolution: {integrity: sha512-Z1PhmomIfypOpoMjRQB70jfvy/wxT50qW08YXO5lMIJkrdq4yOTR+AW7FqutScmB9NkLwxo+jU+kZLbofZZq/w==}
|
||||
|
||||
|
|
@ -7757,6 +7776,14 @@ packages:
|
|||
engines: {node: '>= 12'}
|
||||
dev: true
|
||||
|
||||
/data-urls@5.0.0:
|
||||
resolution: {integrity: sha512-ZYP5VBHshaDAiVZxjbRVcFJpc+4xGgT0bK3vzy1HLN8jTO975HEbuYzZJcHoQEY5K1a0z8YayJkyVETa08eNTg==}
|
||||
engines: {node: '>=18'}
|
||||
dependencies:
|
||||
whatwg-mimetype: 4.0.0
|
||||
whatwg-url: 14.0.0
|
||||
dev: true
|
||||
|
||||
/de-indent@1.0.2:
|
||||
resolution: {integrity: sha512-e/1zu3xH5MQryN2zdVaF0OrdNLUbvWxzMbi+iNA6Bky7l1RoP8a2fIbRocyHclXt/arDrrR6lL3TqFD9pMQTsg==}
|
||||
dev: true
|
||||
|
|
@ -7786,6 +7813,10 @@ packages:
|
|||
engines: {node: '>=0.10.0'}
|
||||
dev: true
|
||||
|
||||
/decimal.js@10.4.3:
|
||||
resolution: {integrity: sha512-VBBaLc1MgL5XpzgIP7ny5Z6Nx3UrRkIViUkPUdtl9aya5amy3De1gsUUSB1g3+3sExYNjCAsAznmukyxCb1GRA==}
|
||||
dev: true
|
||||
|
||||
/decompress-response@4.2.1:
|
||||
resolution: {integrity: sha512-jOSne2qbyE+/r8G1VU+G/82LBs2Fs4LAsTiLSHOCOMZQl2OKZ6i8i4IyHemTe+/yIXOtTcRQMzPcgyhoFlqPkw==}
|
||||
engines: {node: '>=8'}
|
||||
|
|
@ -8786,6 +8817,15 @@ packages:
|
|||
mime-types: 2.1.35
|
||||
dev: true
|
||||
|
||||
/form-data@4.0.0:
|
||||
resolution: {integrity: sha512-ETEklSGi5t0QMZuiXoA/Q6vcnxcLQP5vdugSpuAyi6SVGi2clPPp+xgEhuMaHC+zGgn31Kd235W35f7Hykkaww==}
|
||||
engines: {node: '>= 6'}
|
||||
dependencies:
|
||||
asynckit: 0.4.0
|
||||
combined-stream: 1.0.8
|
||||
mime-types: 2.1.35
|
||||
dev: true
|
||||
|
||||
/formdata-polyfill@4.0.10:
|
||||
resolution: {integrity: sha512-buewHzMvYL29jdeQTVILecSaZKnt/RJWjoZCF5OW60Z67/GmSLBkOFM7qh1PI3zFNtJbaZL5eQu1vLfazOwj4g==}
|
||||
engines: {node: '>=12.20.0'}
|
||||
|
|
@ -9254,6 +9294,13 @@ packages:
|
|||
lru-cache: 6.0.0
|
||||
dev: true
|
||||
|
||||
/html-encoding-sniffer@4.0.0:
|
||||
resolution: {integrity: sha512-Y22oTqIU4uuPgEemfz7NDJz6OeKf12Lsu+QC+s3BVpda64lTiMYCyGwg5ki4vFxkMwQdeZDl2adZoqUgdFuTgQ==}
|
||||
engines: {node: '>=18'}
|
||||
dependencies:
|
||||
whatwg-encoding: 3.1.1
|
||||
dev: true
|
||||
|
||||
/html-entities@2.3.2:
|
||||
resolution: {integrity: sha512-c3Ab/url5ksaT0WyleslpBEthOzWhrjQbg75y7XUsfSzi3Dgzt0l8w5e7DylRn15MTlMMD58dTfzddNS2kcAjQ==}
|
||||
dev: true
|
||||
|
|
@ -9342,6 +9389,16 @@ packages:
|
|||
- supports-color
|
||||
dev: true
|
||||
|
||||
/http-proxy-agent@7.0.0:
|
||||
resolution: {integrity: sha512-+ZT+iBxVUQ1asugqnD6oWoRiS25AkjNfG085dKJGtGxkdwLQrMKU5wJr2bOOFAXzKcTuqq+7fZlTMgG3SRfIYQ==}
|
||||
engines: {node: '>= 14'}
|
||||
dependencies:
|
||||
agent-base: 7.1.0
|
||||
debug: 4.3.4
|
||||
transitivePeerDependencies:
|
||||
- supports-color
|
||||
dev: true
|
||||
|
||||
/http-signature@1.2.0:
|
||||
resolution: {integrity: sha512-CAbnr6Rz4CYQkLYUtSNXxQPUH2gK8f3iWexVlsnMeD+GjlsQ0Xsy1cOX+mN3dtxYomRy21CiOzU8Uhw6OwncEQ==}
|
||||
engines: {node: '>=0.8', npm: '>=1.3.7'}
|
||||
|
|
@ -9369,6 +9426,16 @@ packages:
|
|||
- supports-color
|
||||
dev: true
|
||||
|
||||
/https-proxy-agent@7.0.2:
|
||||
resolution: {integrity: sha512-NmLNjm6ucYwtcUmL7JQC1ZQ57LmHP4lT15FQ8D61nak1rO6DH+fz5qNK2Ap5UN4ZapYICE3/0KodcLYSPsPbaA==}
|
||||
engines: {node: '>= 14'}
|
||||
dependencies:
|
||||
agent-base: 7.1.0
|
||||
debug: 4.3.4
|
||||
transitivePeerDependencies:
|
||||
- supports-color
|
||||
dev: true
|
||||
|
||||
/human-signals@2.1.0:
|
||||
resolution: {integrity: sha512-B4FFZ6q/T2jhhksgkbEW3HBvWIfDW85snkQgawt07S7J5QXTk6BkNV+0yAeZrM5QpMAdYlocGoljn0sJ/WQkFw==}
|
||||
engines: {node: '>=10.17.0'}
|
||||
|
|
@ -9404,7 +9471,6 @@ packages:
|
|||
dependencies:
|
||||
safer-buffer: 2.1.2
|
||||
dev: true
|
||||
optional: true
|
||||
|
||||
/ieee754@1.2.1:
|
||||
resolution: {integrity: sha512-dcyqhDvX1C46lXZcVqCpK+FtMRQVdIMN6/Df5js2zouUsqG7I6sFxitIC+7KYK29KdXOLHdu9zL4sFnoVQnqaA==}
|
||||
|
|
@ -9741,6 +9807,10 @@ packages:
|
|||
engines: {node: '>=0.10.0'}
|
||||
dev: true
|
||||
|
||||
/is-potential-custom-element-name@1.0.1:
|
||||
resolution: {integrity: sha512-bCYeRA2rVibKZd+s2625gGnGF/t7DSqDs4dP7CrLA1m7jKWz6pps0LpYLJN8Q64HtmPKJ1hrN3nzPNKFEKOUiQ==}
|
||||
dev: true
|
||||
|
||||
/is-reference@1.2.1:
|
||||
resolution: {integrity: sha512-U82MsXXiFIrjCK4otLT+o2NA2Cd2g5MLoOVXUZjIOhLurrRxpEXzI8O0KZHr3IjLvlAH1kTPYSuqer5T9ZVBKQ==}
|
||||
dependencies:
|
||||
|
|
@ -10042,6 +10112,42 @@ packages:
|
|||
resolution: {integrity: sha512-UVU9dibq2JcFWxQPA6KCqj5O42VOmAY3zQUfEKxU0KpTGXwNoCjkX1e13eHNvw/xPynt6pU0rZ1htjWTNTSXsg==}
|
||||
dev: true
|
||||
|
||||
/jsdom@23.0.1:
|
||||
resolution: {integrity: sha512-2i27vgvlUsGEBO9+/kJQRbtqtm+191b5zAZrU/UezVmnC2dlDAFLgDYJvAEi94T4kjsRKkezEtLQTgsNEsW2lQ==}
|
||||
engines: {node: '>=18'}
|
||||
peerDependencies:
|
||||
canvas: ^2.11.2
|
||||
peerDependenciesMeta:
|
||||
canvas:
|
||||
optional: true
|
||||
dependencies:
|
||||
cssstyle: 3.0.0
|
||||
data-urls: 5.0.0
|
||||
decimal.js: 10.4.3
|
||||
form-data: 4.0.0
|
||||
html-encoding-sniffer: 4.0.0
|
||||
http-proxy-agent: 7.0.0
|
||||
https-proxy-agent: 7.0.2
|
||||
is-potential-custom-element-name: 1.0.1
|
||||
nwsapi: 2.2.7
|
||||
parse5: 7.1.2
|
||||
rrweb-cssom: 0.6.0
|
||||
saxes: 6.0.0
|
||||
symbol-tree: 3.2.4
|
||||
tough-cookie: 4.1.3
|
||||
w3c-xmlserializer: 5.0.0
|
||||
webidl-conversions: 7.0.0
|
||||
whatwg-encoding: 3.1.1
|
||||
whatwg-mimetype: 4.0.0
|
||||
whatwg-url: 14.0.0
|
||||
ws: 8.16.0
|
||||
xml-name-validator: 5.0.0
|
||||
transitivePeerDependencies:
|
||||
- bufferutil
|
||||
- supports-color
|
||||
- utf-8-validate
|
||||
dev: true
|
||||
|
||||
/jsesc@0.5.0:
|
||||
resolution: {integrity: sha512-uZz5UnB7u4T9LvwmFqXii7pZSouaRPorGs5who1Ip7VO0wxanFvBL7GkM6dTHlgX+jhBApRetaWpnDabOeTcnA==}
|
||||
hasBin: true
|
||||
|
|
@ -11057,6 +11163,10 @@ packages:
|
|||
commander: 5.1.0
|
||||
dev: true
|
||||
|
||||
/nwsapi@2.2.7:
|
||||
resolution: {integrity: sha512-ub5E4+FBPKwAZx0UwIQOjYWGHTEq5sPqHQNRN8Z9e4A7u3Tj1weLJsL59yH9vmvqEtBHaOmT6cYQKIZOxp35FQ==}
|
||||
dev: true
|
||||
|
||||
/oauth-sign@0.9.0:
|
||||
resolution: {integrity: sha512-fexhUFFPTGV8ybAtSIGbV6gOkSv8UtRbDBnAyLQw4QPKkgNlsH2ByPGtMUqdWkos6YCRmAqViwgZrJc/mRDzZQ==}
|
||||
dev: true
|
||||
|
|
@ -11674,6 +11784,11 @@ packages:
|
|||
engines: {node: '>=6'}
|
||||
dev: true
|
||||
|
||||
/punycode@2.3.1:
|
||||
resolution: {integrity: sha512-vYt7UD1U9Wg6138shLtLOvdAu+8DsC/ilFtEVHcH+wydcSpNE20AfSOduf6MkRFahL5FY7X1oU7nKVZFtfq8Fg==}
|
||||
engines: {node: '>=6'}
|
||||
dev: true
|
||||
|
||||
/pupa@3.1.0:
|
||||
resolution: {integrity: sha512-FLpr4flz5xZTSJxSeaheeMKN/EDzMdK7b8PTOC6a5PYFKTucWbdqjgqaEyH0shFiSJrVB1+Qqi4Tk19ccU6Aug==}
|
||||
engines: {node: '>=12.20'}
|
||||
|
|
@ -11686,6 +11801,10 @@ packages:
|
|||
engines: {node: '>=0.6'}
|
||||
dev: true
|
||||
|
||||
/querystringify@2.2.0:
|
||||
resolution: {integrity: sha512-FIqgj2EUvTa7R50u0rGsyTftzjYmv/a3hO345bZNrqabNqjtgiDMgmo4mkUjd+nzU5oF3dClKqFIPUKybUyqoQ==}
|
||||
dev: true
|
||||
|
||||
/queue-microtask@1.2.3:
|
||||
resolution: {integrity: sha512-NuaNSa6flKT5JaSYQzJok04JzTL1CA6aGhv5rfLW3PgqA+M2ChpZQnAC8h8i4ZFkBS8X5RqkDBHA7r4hej3K9A==}
|
||||
dev: true
|
||||
|
|
@ -12021,6 +12140,10 @@ packages:
|
|||
engines: {node: '>=0.10.0'}
|
||||
dev: true
|
||||
|
||||
/requires-port@1.0.0:
|
||||
resolution: {integrity: sha512-KigOCHcocU3XODJxsu8i/j8T9tzT4adHiecwORRQ0ZZFcp7ahwXuRU1m+yuO90C5ZUyGeGfocHDI14M3L3yDAQ==}
|
||||
dev: true
|
||||
|
||||
/resolve-alpn@1.2.1:
|
||||
resolution: {integrity: sha512-0a1F4l73/ZFZOakJnQ3FvkJ2+gSTQWz/r2KE5OdDY0TxPm5h4GkqkWWfM47T7HsbnOtcJVEF4epCVy6u7Q3K+g==}
|
||||
dev: true
|
||||
|
|
@ -12273,6 +12396,10 @@ packages:
|
|||
fsevents: 2.3.3
|
||||
dev: true
|
||||
|
||||
/rrweb-cssom@0.6.0:
|
||||
resolution: {integrity: sha512-APM0Gt1KoXBz0iIkkdB/kfvGOwC4UuJFeG/c+yV7wSc7q96cG/kJ0HiYCnzivD9SB53cLV1MlHFNfOuPaadYSw==}
|
||||
dev: true
|
||||
|
||||
/run-applescript@5.0.0:
|
||||
resolution: {integrity: sha512-XcT5rBksx1QdIhlFOCtgZkB99ZEouFZ1E2Kc2LHqNW13U3/74YGdkQRmThTwxy4QIyookibDKYZOPqX//6BlAg==}
|
||||
engines: {node: '>=12'}
|
||||
|
|
@ -12358,6 +12485,13 @@ packages:
|
|||
resolution: {integrity: sha512-NqVDv9TpANUjFm0N8uM5GxL36UgKi9/atZw+x7YFnQ8ckwFGKrl4xX4yWtrey3UJm5nP1kUbnYgLopqWNSRhWw==}
|
||||
dev: true
|
||||
|
||||
/saxes@6.0.0:
|
||||
resolution: {integrity: sha512-xAg7SOnEhrm5zI3puOOKyy1OMcMlIJZYNJY7xLBwSze0UjhPLnWfj2GF2EpT0jmzaJKIWKHLsaSSajf35bcYnA==}
|
||||
engines: {node: '>=v12.22.7'}
|
||||
dependencies:
|
||||
xmlchars: 2.2.0
|
||||
dev: true
|
||||
|
||||
/scheduler@0.23.0:
|
||||
resolution: {integrity: sha512-CtuThmgHNg7zIZWAXi3AsyIzA3n4xx7aNyjwC2VJldO2LMVDhFK+63xGqq6CsJH4rTAt6/M+N4GhZiDYPx9eUw==}
|
||||
dependencies:
|
||||
|
|
@ -13168,6 +13302,10 @@ packages:
|
|||
xml-reader: 2.4.3
|
||||
dev: true
|
||||
|
||||
/symbol-tree@3.2.4:
|
||||
resolution: {integrity: sha512-9QNk5KwDF+Bvz+PyObkmSYjI5ksVUYtjW7AU22r2NKcfLJcXp96hkDWU3+XndOsUb+AQ9QhfzfCT2O+CNWT5Tw==}
|
||||
dev: true
|
||||
|
||||
/tar-fs@2.1.1:
|
||||
resolution: {integrity: sha512-V0r2Y9scmbDRLCNex/+hYzvp/zyYjvFbHPNgVTKfQvVrb6guiE/fxP+XblDNR011utopbkex2nM4dHNV6GDsng==}
|
||||
dependencies:
|
||||
|
|
@ -13286,10 +13424,27 @@ packages:
|
|||
punycode: 2.1.1
|
||||
dev: true
|
||||
|
||||
/tough-cookie@4.1.3:
|
||||
resolution: {integrity: sha512-aX/y5pVRkfRnfmuX+OdbSdXvPe6ieKX/G2s7e98f4poJHnqH3281gDPm/metm6E/WRamfx7WC4HUqkWHfQHprw==}
|
||||
engines: {node: '>=6'}
|
||||
dependencies:
|
||||
psl: 1.9.0
|
||||
punycode: 2.1.1
|
||||
universalify: 0.2.0
|
||||
url-parse: 1.5.10
|
||||
dev: true
|
||||
|
||||
/tr46@0.0.3:
|
||||
resolution: {integrity: sha512-N3WMsuqV66lT30CrXNbEjx4GEwlow3v6rr4mCcv6prnfwhS01rkgyFdjPNBYd9br7LpXV1+Emh01fHnq2Gdgrw==}
|
||||
dev: true
|
||||
|
||||
/tr46@5.0.0:
|
||||
resolution: {integrity: sha512-tk2G5R2KRwBd+ZN0zaEXpmzdKyOYksXwywulIX95MBODjSzMIuQnQ3m8JxgbhnL1LeVo7lqQKsYa1O3Htl7K5g==}
|
||||
engines: {node: '>=18'}
|
||||
dependencies:
|
||||
punycode: 2.3.1
|
||||
dev: true
|
||||
|
||||
/trim-newlines@3.0.1:
|
||||
resolution: {integrity: sha512-c1PTsA3tYrIsLGkJkzHF+w9F2EyxfXGo4UyJc4pFL++FMjnq0HJS69T3M7d//gKrFKwy429bouPescbjecU+Zw==}
|
||||
engines: {node: '>=8'}
|
||||
|
|
@ -13479,6 +13634,11 @@ packages:
|
|||
engines: {node: '>= 4.0.0'}
|
||||
dev: true
|
||||
|
||||
/universalify@0.2.0:
|
||||
resolution: {integrity: sha512-CJ1QgKmNg3CwvAv/kOFmtnEN05f0D/cn9QntgNOQlQF9dgvVTHj3t+8JPdjqawCHk7V/KA+fbUqzZ9XWhcqPUg==}
|
||||
engines: {node: '>= 4.0.0'}
|
||||
dev: true
|
||||
|
||||
/universalify@2.0.0:
|
||||
resolution: {integrity: sha512-hAZsKq7Yy11Zu1DE0OzWjw7nnLZmJZYTDZZyEFHZdUhV8FkH5MCfoU1XMaxXovpyW5nq5scPqq0ZDP9Zyl04oQ==}
|
||||
engines: {node: '>= 10.0.0'}
|
||||
|
|
@ -13563,6 +13723,13 @@ packages:
|
|||
engines: {node: ^12.20.0 || ^14.13.1 || >=16.0.0}
|
||||
dev: true
|
||||
|
||||
/url-parse@1.5.10:
|
||||
resolution: {integrity: sha512-WypcfiRhfeUP9vvF0j6rw0J3hrWrw6iZv3+22h6iRMJ/8z1Tj6XfLP4DsUix5MhMPnXpiHDoKyoZ/bdCkwBCiQ==}
|
||||
dependencies:
|
||||
querystringify: 2.2.0
|
||||
requires-port: 1.0.0
|
||||
dev: true
|
||||
|
||||
/utif@2.0.1:
|
||||
resolution: {integrity: sha512-Z/S1fNKCicQTf375lIP9G8Sa1H/phcysstNrrSdZKj1f9g58J4NMgb5IgiEZN9/nLMPDwF0W7hdOe9Qq2IYoLg==}
|
||||
dependencies:
|
||||
|
|
@ -13750,7 +13917,7 @@ packages:
|
|||
vite: 5.0.10
|
||||
dev: true
|
||||
|
||||
/vitest@1.1.2:
|
||||
/vitest@1.1.2(jsdom@23.0.1):
|
||||
resolution: {integrity: sha512-nEw58z0PFBARwo3hWx6aKmI0Rob2avL9Mt2IYW+5mH5dS4S39J+VLH9aG8x6KZIgyegdE1p7/3JjZ93FzVCsoQ==}
|
||||
engines: {node: ^18.0.0 || >=20.0.0}
|
||||
hasBin: true
|
||||
|
|
@ -13785,6 +13952,7 @@ packages:
|
|||
chai: 4.3.10
|
||||
debug: 4.3.4
|
||||
execa: 8.0.1
|
||||
jsdom: 23.0.1
|
||||
local-pkg: 0.5.0
|
||||
magic-string: 0.30.5
|
||||
pathe: 1.1.1
|
||||
|
|
@ -13846,6 +14014,13 @@ packages:
|
|||
'@vue/server-renderer': 3.2.45(vue@3.2.45)
|
||||
'@vue/shared': 3.2.45
|
||||
|
||||
/w3c-xmlserializer@5.0.0:
|
||||
resolution: {integrity: sha512-o8qghlI8NZHU1lLPrpi2+Uq7abh4GGPpYANlalzWxyWteJOCsr/P+oPBA49TOLu5FTZO4d3F9MnWJfiMo4BkmA==}
|
||||
engines: {node: '>=18'}
|
||||
dependencies:
|
||||
xml-name-validator: 5.0.0
|
||||
dev: true
|
||||
|
||||
/walk-sync@2.2.0:
|
||||
resolution: {integrity: sha512-IC8sL7aB4/ZgFcGI2T1LczZeFWZ06b3zoHH7jBPyHxOtIIz1jppWHjjEXkOFvFojBVAK9pV7g47xOZ4LW3QLfg==}
|
||||
engines: {node: 8.* || >= 10.*}
|
||||
|
|
@ -13907,6 +14082,31 @@ packages:
|
|||
resolution: {integrity: sha512-2JAn3z8AR6rjK8Sm8orRC0h/bcl/DqL7tRPdGZ4I1CjdF+EaMLmYxBHyXuKL849eucPFhvBoxMsflfOb8kxaeQ==}
|
||||
dev: true
|
||||
|
||||
/webidl-conversions@7.0.0:
|
||||
resolution: {integrity: sha512-VwddBukDzu71offAQR975unBIGqfKZpM+8ZX6ySk8nYhVoo5CYaZyzt3YBvYtRtO+aoGlqxPg/B87NGVZ/fu6g==}
|
||||
engines: {node: '>=12'}
|
||||
dev: true
|
||||
|
||||
/whatwg-encoding@3.1.1:
|
||||
resolution: {integrity: sha512-6qN4hJdMwfYBtE3YBTTHhoeuUrDBPZmbQaxWAqSALV/MeEnR5z1xd8UKud2RAkFoPkmB+hli1TZSnyi84xz1vQ==}
|
||||
engines: {node: '>=18'}
|
||||
dependencies:
|
||||
iconv-lite: 0.6.3
|
||||
dev: true
|
||||
|
||||
/whatwg-mimetype@4.0.0:
|
||||
resolution: {integrity: sha512-QaKxh0eNIi2mE9p2vEdzfagOKHCcj1pJ56EEHGQOVxp8r9/iszLUUV7v89x9O1p/T+NlTM5W7jW6+cz4Fq1YVg==}
|
||||
engines: {node: '>=18'}
|
||||
dev: true
|
||||
|
||||
/whatwg-url@14.0.0:
|
||||
resolution: {integrity: sha512-1lfMEm2IEr7RIV+f4lUNPOqfFL+pO+Xw3fJSqmjX9AbXcXcYOkCe1P6+9VBZB6n94af16NfZf+sSk0JCBZC9aw==}
|
||||
engines: {node: '>=18'}
|
||||
dependencies:
|
||||
tr46: 5.0.0
|
||||
webidl-conversions: 7.0.0
|
||||
dev: true
|
||||
|
||||
/whatwg-url@5.0.0:
|
||||
resolution: {integrity: sha512-saE57nupxk6v3HY35+jzBwYa0rKSy0XR8JSxZPwgLr7ys0IBzhGviA1/TUGJLmSVqs8pb9AnvICXEuOHLprYTw==}
|
||||
dependencies:
|
||||
|
|
@ -14044,6 +14244,19 @@ packages:
|
|||
signal-exit: 3.0.7
|
||||
dev: true
|
||||
|
||||
/ws@8.16.0:
|
||||
resolution: {integrity: sha512-HS0c//TP7Ina87TfiPUz1rQzMhHrl/SG2guqRcTOIUYD2q8uhUdNHZYJUaQ8aTGPzCh+c6oawMKW35nFl1dxyQ==}
|
||||
engines: {node: '>=10.0.0'}
|
||||
peerDependencies:
|
||||
bufferutil: ^4.0.1
|
||||
utf-8-validate: '>=5.0.2'
|
||||
peerDependenciesMeta:
|
||||
bufferutil:
|
||||
optional: true
|
||||
utf-8-validate:
|
||||
optional: true
|
||||
dev: true
|
||||
|
||||
/xdg-basedir@5.1.0:
|
||||
resolution: {integrity: sha512-GCPAHLvrIH13+c0SuacwvRYj2SxJXQ4kaVTT5xgL3kPrz56XxkF21IGhjSE1+W0aw7gpBWRGXLCPnPby6lSpmQ==}
|
||||
engines: {node: '>=12'}
|
||||
|
|
@ -14072,6 +14285,11 @@ packages:
|
|||
eventemitter3: 2.0.3
|
||||
dev: true
|
||||
|
||||
/xml-name-validator@5.0.0:
|
||||
resolution: {integrity: sha512-EvGK8EJ3DhaHfbRlETOWAS5pO9MZITeauHKJyb8wyajUfQUenkIg2MvLDTZ4T/TgIcm3HU0TFBgWWboAZ30UHg==}
|
||||
engines: {node: '>=18'}
|
||||
dev: true
|
||||
|
||||
/xml-parse-from-string@1.0.1:
|
||||
resolution: {integrity: sha512-ErcKwJTF54uRzzNMXq2X5sMIy88zJvfN2DmdoQvy7PAFJ+tPRU6ydWuOKNMyfmOjdyBQTFREi60s0Y0SyI0G0g==}
|
||||
dev: true
|
||||
|
|
@ -14096,6 +14314,10 @@ packages:
|
|||
engines: {node: '>=4.0'}
|
||||
dev: true
|
||||
|
||||
/xmlchars@2.2.0:
|
||||
resolution: {integrity: sha512-JZnDKK8B0RCDw84FNdDAIpZK+JuJw+s7Lz8nksI7SIuU3UXJJslUthsi+uWBUYOwPFwW7W7PRLRfUKpxjtjFCw==}
|
||||
dev: true
|
||||
|
||||
/xregexp@2.0.0:
|
||||
resolution: {integrity: sha512-xl/50/Cf32VsGq/1R8jJE5ajH1yMCQkpmoS10QbFZWl2Oor4H0Me64Pu2yxvsRWK3m6soJbmGfzSR7BYmDcWAA==}
|
||||
dev: true
|
||||
|
|
|
|||
|
|
@ -1,7 +1,7 @@
|
|||
import { useState } from 'preact/hooks'
|
||||
import './app.css'
|
||||
|
||||
import { IconHeart, IconHeartFilled, IconMoodSmile } from '@tabler/icons-preact'
|
||||
import { IconAd, IconAdOff, IconAdFilled } from '@tabler/icons-preact';
|
||||
|
||||
|
||||
export function App() {
|
||||
|
|
@ -10,11 +10,11 @@ export function App() {
|
|||
return (
|
||||
<div className="App">
|
||||
<a onClick={() => setActive(!active)}>
|
||||
{active ? <IconHeartFilled size={48} /> : <IconHeart size={48} />}
|
||||
{active ? <IconAdOff size={48} /> : <IconAd size={48} />}
|
||||
</a>
|
||||
<IconMoodSmile size={48} stroke={1} />
|
||||
<IconMoodSmile size={48} stroke={1.5} />
|
||||
<IconMoodSmile size={48} stroke={2} />
|
||||
<IconAd size={48} stroke={1} />
|
||||
<IconAdOff size={48} stroke={1.5} />
|
||||
<IconAdFilled size={48} stroke={2} />
|
||||
</div>
|
||||
)
|
||||
);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,6 +1,6 @@
|
|||
import { useState } from 'react'
|
||||
import './App.css'
|
||||
import { IconHeart, IconHeartFilled, IconMoodSmile } from '@tabler/icons-react'
|
||||
import { IconAd, IconAdOff, IconAdFilled } from '@tabler/icons-react';
|
||||
|
||||
function App() {
|
||||
const [active, setActive] = useState(false)
|
||||
|
|
@ -8,13 +8,13 @@ function App() {
|
|||
return (
|
||||
<div className="App">
|
||||
<a onClick={() => setActive(!active)}>
|
||||
{active ? <IconHeartFilled size={48} /> : <IconHeart size={48} />}
|
||||
{active ? <IconAdOff size={48} /> : <IconAd size={48} />}
|
||||
</a>
|
||||
<IconMoodSmile size={48} stroke={1} />
|
||||
<IconMoodSmile size={48} stroke={1.5} />
|
||||
<IconMoodSmile size={48} stroke={2} />
|
||||
<IconAd size={48} stroke={1} />
|
||||
<IconAdOff size={48} stroke={1.5} />
|
||||
<IconAdFilled size={48} stroke={2} />
|
||||
</div>
|
||||
)
|
||||
);
|
||||
}
|
||||
|
||||
export default App
|
||||
|
|
|
|||
|
|
@ -1,17 +1,17 @@
|
|||
<script setup lang="ts">
|
||||
import { ref } from "vue"
|
||||
import { IconHeartFilled, IconHeart, IconMoodSmile } from '@tabler/icons-vue'
|
||||
import { IconAd, IconAdOff, IconAdFilled } from '@tabler/icons-vue'
|
||||
|
||||
const active = ref(false)
|
||||
</script>
|
||||
|
||||
<template>
|
||||
<a @click="active = !active">
|
||||
<IconHeartFilled v-if="active" size="48" />
|
||||
<IconHeart v-else size="48" />
|
||||
<IconAdOff v-if="active" size="48" />
|
||||
<IconAd v-else size="48" />
|
||||
</a>
|
||||
<IconMoodSmile size="48" stroke="1" />
|
||||
<IconMoodSmile size="48" stroke="1.5" />
|
||||
<IconMoodSmile size="48" stroke="2" />
|
||||
<IconAd size="48" stroke="1" />
|
||||
<IconAdOff size="48" stroke="1.5" />
|
||||
<IconAdFilled size="48" stroke="2" />
|
||||
</template>
|
||||
|
||||
|
|
|
|||
|
|
@ -2,10 +2,10 @@
|
|||
"$schema": "https://turbo.build/schema.json",
|
||||
"pipeline": {
|
||||
"build": {
|
||||
"outputs": [
|
||||
"dist/**"
|
||||
],
|
||||
"dependsOn": ["^build"]
|
||||
"outputs": ["dist/**"],
|
||||
"dependsOn": ["^build"],
|
||||
|
||||
"cache": false
|
||||
},
|
||||
"lint": {},
|
||||
"dev": {
|
||||
|
|
|
|||
Loading…
Reference in New Issue