@omnicajs/icons 0.3.0 → 0.3.1
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/CHANGELOG.md +6 -0
- package/README.md +113 -0
- package/dist/_virtual/_rolldown/runtime.cjs +23 -0
- package/dist/build.js +1 -13
- package/dist/extracted/bundler/component-loader.cjs +26 -0
- package/dist/extracted/bundler/component-loader.d.ts +3 -0
- package/dist/extracted/bundler/plugin.cjs +125 -0
- package/dist/extracted/bundler/plugin.d.ts +21 -0
- package/dist/extracted/bundler/template-assets-loader.cjs +8 -0
- package/dist/extracted/bundler/template-assets-loader.d.ts +3 -0
- package/dist/extracted/core.d.ts +14 -0
- package/dist/extracted/core.js +64 -0
- package/dist/extracted/manifest.cjs +23 -0
- package/dist/extracted/manifest.d.ts +11 -0
- package/dist/extracted/manifest.js +20 -0
- package/dist/extracted/vite.d.ts +8 -0
- package/dist/extracted/vite.js +174 -0
- package/dist/manifest.cjs +1 -1
- package/dist/manifest.js +1 -1
- package/dist/manifest.json +1 -1
- package/dist/rspack.cjs +14 -0
- package/dist/rspack.d.ts +16 -0
- package/dist/shared/sprite.d.ts +2 -0
- package/dist/shared/sprite.js +16 -0
- package/dist/{adapter-output.d.ts → subset/adapter-output.d.ts} +1 -1
- package/dist/{adapter-output.js → subset/adapter-output.js} +1 -1
- package/dist/subset/vite.d.ts +7 -0
- package/dist/subset/vite.js +61 -0
- package/dist/{webpack-loader.cjs → subset/webpack-loader.cjs} +5 -9
- package/dist/{webpack-loader.d.ts → subset/webpack-loader.d.ts} +1 -1
- package/dist/{webpack-runtime.cjs → subset/webpack-runtime.cjs} +1 -1
- package/dist/subset/webpack.cjs +27 -0
- package/dist/subset/webpack.d.ts +14 -0
- package/dist/vite.d.ts +4 -7
- package/dist/vite.js +3 -61
- package/dist/webpack.cjs +9 -21
- package/dist/webpack.d.ts +12 -7
- package/package.json +14 -2
- package/vue.d.ts +36 -0
- /package/dist/{webpack-runtime.d.ts → subset/webpack-runtime.d.ts} +0 -0
package/dist/manifest.json
CHANGED
package/dist/rspack.cjs
ADDED
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
2
|
+
const require_extracted_bundler_plugin = require("./extracted/bundler/plugin.cjs");
|
|
3
|
+
//#region tooling/rspack.ts
|
|
4
|
+
var OmnicaIconComponentsPlugin = class {
|
|
5
|
+
#plugin;
|
|
6
|
+
constructor(options = {}) {
|
|
7
|
+
this.#plugin = new require_extracted_bundler_plugin.BundlerIconComponentsPlugin(options);
|
|
8
|
+
}
|
|
9
|
+
apply(compiler) {
|
|
10
|
+
this.#plugin.apply(compiler);
|
|
11
|
+
}
|
|
12
|
+
};
|
|
13
|
+
//#endregion
|
|
14
|
+
exports.OmnicaIconComponentsPlugin = OmnicaIconComponentsPlugin;
|
package/dist/rspack.d.ts
ADDED
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import type { Compiler, RspackPluginInstance } from '@rspack/core';
|
|
2
|
+
export interface OmnicaIconComponentsPluginOptions {
|
|
3
|
+
/** Supports `[contenthash]` and `[contenthash:N]`. */
|
|
4
|
+
readonly filename?: string;
|
|
5
|
+
/** Overrides the loader used to compile the generated Vue SFC. */
|
|
6
|
+
readonly vueLoader?: string;
|
|
7
|
+
/** Client build output read by a later SSR build. Defaults to `<context>/dist`. */
|
|
8
|
+
readonly clientOutputDirectory?: string;
|
|
9
|
+
/** Overrides automatic Node-target SSR detection. */
|
|
10
|
+
readonly ssr?: boolean;
|
|
11
|
+
}
|
|
12
|
+
export declare class OmnicaIconComponentsPlugin implements RspackPluginInstance {
|
|
13
|
+
#private;
|
|
14
|
+
constructor(options?: OmnicaIconComponentsPluginOptions);
|
|
15
|
+
apply(compiler: Compiler): void;
|
|
16
|
+
}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
//#region tooling/shared/sprite.ts
|
|
2
|
+
var escapeRegExp = (value) => value.replace(/[.*+?^${}()|[\]\\]/g, "\\$&");
|
|
3
|
+
var serializeSprite = (symbols) => [
|
|
4
|
+
"<svg xmlns=\"http://www.w3.org/2000/svg\">",
|
|
5
|
+
symbols.join("\n"),
|
|
6
|
+
"</svg>",
|
|
7
|
+
""
|
|
8
|
+
].join("\n");
|
|
9
|
+
var extractSymbol = (sprite, symbolId, filename) => {
|
|
10
|
+
const expression = new RegExp(`<symbol\\b[^>]*\\bid=(["'])${escapeRegExp(symbolId)}\\1[\\s\\S]*?<\\/symbol>`);
|
|
11
|
+
const match = sprite.match(expression);
|
|
12
|
+
if (!match) throw new Error(`Unable to find symbol ${symbolId} in ${filename}`);
|
|
13
|
+
return match[0];
|
|
14
|
+
};
|
|
15
|
+
//#endregion
|
|
16
|
+
export { extractSymbol, serializeSprite };
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { IconBuildArtifact } from '
|
|
1
|
+
import type { IconBuildArtifact } from '../build.js';
|
|
2
2
|
type ModuleFormat = 'esm' | 'cjs';
|
|
3
3
|
export declare const createAdapterRuntime: (artifacts: readonly IconBuildArtifact[], spriteExpressions: Readonly<Record<string, string>>, format?: ModuleFormat) => string;
|
|
4
4
|
export declare const createAdapterDeclarations: (artifacts: readonly IconBuildArtifact[], moduleId?: string) => string;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
//#region tooling/adapter-output.ts
|
|
1
|
+
//#region tooling/subset/adapter-output.ts
|
|
2
2
|
var createAdapterRuntime = (artifacts, spriteExpressions, format = "esm") => {
|
|
3
3
|
const declaration = format === "esm" ? "export " : "";
|
|
4
4
|
return `const hasOwn = (object, key) => Object.prototype.hasOwnProperty.call(object, key)
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import type { IconBuildConfig } from '../build.js';
|
|
2
|
+
import type { Plugin } from 'vite';
|
|
3
|
+
export interface OmnicaIconsOptions extends IconBuildConfig {
|
|
4
|
+
/** Writes exact declarations for `virtual:omnicajs-icons`. The file must be included by consumer TypeScript. */
|
|
5
|
+
readonly declarationFile?: string;
|
|
6
|
+
}
|
|
7
|
+
export declare const omnicaIcons: (options: OmnicaIconsOptions) => Plugin;
|
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
import { buildIconSet } from "../build.js";
|
|
2
|
+
import { createAdapterDeclarations, createAdapterRuntime } from "./adapter-output.js";
|
|
3
|
+
import fs from "node:fs/promises";
|
|
4
|
+
import path from "node:path";
|
|
5
|
+
import crypto from "node:crypto";
|
|
6
|
+
//#region tooling/subset/vite.ts
|
|
7
|
+
var virtualModuleId = "virtual:omnicajs-icons";
|
|
8
|
+
var resolvedVirtualModuleId = `\0${virtualModuleId}`;
|
|
9
|
+
var omnicaIcons = (options) => {
|
|
10
|
+
let artifacts = [];
|
|
11
|
+
let command = "build";
|
|
12
|
+
const references = {};
|
|
13
|
+
return {
|
|
14
|
+
name: "omnicajs-icons",
|
|
15
|
+
enforce: "pre",
|
|
16
|
+
configResolved(config) {
|
|
17
|
+
command = config.command;
|
|
18
|
+
},
|
|
19
|
+
async buildStart() {
|
|
20
|
+
artifacts = await buildIconSet(options);
|
|
21
|
+
if (options.declarationFile) {
|
|
22
|
+
const declarationFile = path.resolve(options.declarationFile);
|
|
23
|
+
await fs.mkdir(path.dirname(declarationFile), { recursive: true });
|
|
24
|
+
await fs.writeFile(declarationFile, createAdapterDeclarations(artifacts));
|
|
25
|
+
}
|
|
26
|
+
if (command === "build") for (const artifact of artifacts) references[artifact.variant] = this.emitFile({
|
|
27
|
+
type: "asset",
|
|
28
|
+
name: `omnica-icons-${artifact.variant}.svg`,
|
|
29
|
+
source: artifact.spriteSource
|
|
30
|
+
});
|
|
31
|
+
},
|
|
32
|
+
configureServer(server) {
|
|
33
|
+
server.middlewares.use("/@omnicajs/icons/", (request, response, next) => {
|
|
34
|
+
const variant = request.url?.split(/[?#]/, 1)[0]?.replace(/\.svg$/, "");
|
|
35
|
+
const artifact = artifacts.find((candidate) => candidate.variant === variant);
|
|
36
|
+
if (!artifact) {
|
|
37
|
+
next();
|
|
38
|
+
return;
|
|
39
|
+
}
|
|
40
|
+
response.statusCode = 200;
|
|
41
|
+
response.setHeader("Content-Type", "image/svg+xml");
|
|
42
|
+
response.setHeader("Cache-Control", "no-cache");
|
|
43
|
+
response.end(artifact.spriteSource);
|
|
44
|
+
});
|
|
45
|
+
},
|
|
46
|
+
resolveId(id) {
|
|
47
|
+
return id === virtualModuleId ? resolvedVirtualModuleId : null;
|
|
48
|
+
},
|
|
49
|
+
load(id) {
|
|
50
|
+
if (id !== resolvedVirtualModuleId) return null;
|
|
51
|
+
const spriteExpressions = Object.fromEntries(artifacts.map((artifact) => {
|
|
52
|
+
if (command === "build") return [artifact.variant, `import.meta.ROLLUP_FILE_URL_${references[artifact.variant]}`];
|
|
53
|
+
const hash = crypto.createHash("sha256").update(artifact.spriteSource).digest("hex").slice(0, 8);
|
|
54
|
+
return [artifact.variant, JSON.stringify(`/@omnicajs/icons/${artifact.variant}.svg?v=${hash}`)];
|
|
55
|
+
}));
|
|
56
|
+
return createAdapterRuntime(artifacts, spriteExpressions);
|
|
57
|
+
}
|
|
58
|
+
};
|
|
59
|
+
};
|
|
60
|
+
//#endregion
|
|
61
|
+
export { omnicaIcons };
|
|
@@ -1,21 +1,17 @@
|
|
|
1
|
+
const require_extracted_bundler_plugin = require("../extracted/bundler/plugin.cjs");
|
|
1
2
|
let node_path = require("node:path");
|
|
2
|
-
let node_crypto = require("node:crypto");
|
|
3
|
-
let node_fs_promises = require("node:fs/promises");
|
|
4
3
|
let node_url = require("node:url");
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
const hash = (0, node_crypto.createHash)("sha256").update(source).digest("hex");
|
|
8
|
-
return template.replaceAll("[variant]", variant).replace(/\[contenthash(?::(\d+))?\]/g, (_match, length) => length ? hash.slice(0, Number(length)) : hash);
|
|
9
|
-
};
|
|
4
|
+
let node_fs_promises = require("node:fs/promises");
|
|
5
|
+
//#region tooling/subset/webpack-loader.ts
|
|
10
6
|
var omnicaIconsLoader = function() {
|
|
11
7
|
const callback = this.async();
|
|
12
8
|
const options = this.getOptions();
|
|
13
9
|
this.cacheable(true);
|
|
14
|
-
Promise.all([import((0, node_url.pathToFileURL)((0, node_path.join)(__dirname, "build.js")).href), import((0, node_url.pathToFileURL)((0, node_path.join)(__dirname, "adapter-output.js")).href)]).then(async ([{ buildIconSet }, { createAdapterDeclarations, createAdapterRuntime }]) => {
|
|
10
|
+
Promise.all([import((0, node_url.pathToFileURL)((0, node_path.join)(__dirname, "../build.js")).href), import((0, node_url.pathToFileURL)((0, node_path.join)(__dirname, "adapter-output.js")).href)]).then(async ([{ buildIconSet }, { createAdapterDeclarations, createAdapterRuntime }]) => {
|
|
15
11
|
const artifacts = await buildIconSet(options.config);
|
|
16
12
|
const spriteExpressions = {};
|
|
17
13
|
for (const artifact of artifacts) {
|
|
18
|
-
const filename =
|
|
14
|
+
const filename = require_extracted_bundler_plugin.renderContentHashFilename(options.filename.replaceAll("[variant]", artifact.variant), artifact.spriteSource);
|
|
19
15
|
this.emitFile(filename, artifact.spriteSource);
|
|
20
16
|
spriteExpressions[artifact.variant] = `(__webpack_public_path__ + ${JSON.stringify(filename)})`;
|
|
21
17
|
}
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
let node_path = require("node:path");
|
|
2
|
+
//#region tooling/subset/webpack.ts
|
|
3
|
+
var virtualModuleId = "virtual:omnicajs-icons";
|
|
4
|
+
var OmnicaIconsPlugin = class {
|
|
5
|
+
#options;
|
|
6
|
+
constructor(options) {
|
|
7
|
+
this.#options = options;
|
|
8
|
+
}
|
|
9
|
+
apply(compiler) {
|
|
10
|
+
const runtimePath = (0, node_path.join)(__dirname, "webpack-runtime.cjs");
|
|
11
|
+
const loaderPath = (0, node_path.join)(__dirname, "webpack-loader.cjs");
|
|
12
|
+
new compiler.webpack.NormalModuleReplacementPlugin(new RegExp(`^${virtualModuleId}$`), runtimePath).apply(compiler);
|
|
13
|
+
compiler.options.module.rules.unshift({
|
|
14
|
+
include: runtimePath,
|
|
15
|
+
use: [{
|
|
16
|
+
loader: loaderPath,
|
|
17
|
+
options: {
|
|
18
|
+
config: this.#options,
|
|
19
|
+
declarationFile: this.#options.declarationFile,
|
|
20
|
+
filename: this.#options.filename ?? "icons/omnica-[variant].[contenthash:8].svg"
|
|
21
|
+
}
|
|
22
|
+
}]
|
|
23
|
+
});
|
|
24
|
+
}
|
|
25
|
+
};
|
|
26
|
+
//#endregion
|
|
27
|
+
exports.OmnicaIconsPlugin = OmnicaIconsPlugin;
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import type { Compiler } from 'webpack';
|
|
2
|
+
import type { IconBuildConfig } from '../build.js';
|
|
3
|
+
import type { WebpackPluginInstance } from 'webpack';
|
|
4
|
+
export interface OmnicaIconsPluginOptions extends IconBuildConfig {
|
|
5
|
+
/** Writes exact declarations for `virtual:omnicajs-icons`. The file must be included by consumer TypeScript. */
|
|
6
|
+
readonly declarationFile?: string;
|
|
7
|
+
/** Supports `[variant]`, `[contenthash]`, and `[contenthash:N]`. */
|
|
8
|
+
readonly filename?: string;
|
|
9
|
+
}
|
|
10
|
+
export declare class OmnicaIconsPlugin implements WebpackPluginInstance {
|
|
11
|
+
#private;
|
|
12
|
+
constructor(options: OmnicaIconsPluginOptions);
|
|
13
|
+
apply(compiler: Compiler): void;
|
|
14
|
+
}
|
package/dist/vite.d.ts
CHANGED
|
@@ -1,7 +1,4 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
export
|
|
4
|
-
|
|
5
|
-
readonly declarationFile?: string;
|
|
6
|
-
}
|
|
7
|
-
export declare const omnicaIcons: (options: OmnicaIconsOptions) => Plugin;
|
|
1
|
+
export type { OmnicaIconComponentsOptions } from './extracted/vite.js';
|
|
2
|
+
export type { OmnicaIconsOptions } from './subset/vite.js';
|
|
3
|
+
export { omnicaIconComponents } from './extracted/vite.js';
|
|
4
|
+
export { omnicaIcons } from './subset/vite.js';
|
package/dist/vite.js
CHANGED
|
@@ -1,61 +1,3 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
|
|
4
|
-
import path from "node:path";
|
|
5
|
-
import crypto from "node:crypto";
|
|
6
|
-
//#region tooling/vite.ts
|
|
7
|
-
var virtualModuleId = "virtual:omnicajs-icons";
|
|
8
|
-
var resolvedVirtualModuleId = `\0${virtualModuleId}`;
|
|
9
|
-
var omnicaIcons = (options) => {
|
|
10
|
-
let artifacts = [];
|
|
11
|
-
let command = "build";
|
|
12
|
-
const references = {};
|
|
13
|
-
return {
|
|
14
|
-
name: "omnicajs-icons",
|
|
15
|
-
enforce: "pre",
|
|
16
|
-
configResolved(config) {
|
|
17
|
-
command = config.command;
|
|
18
|
-
},
|
|
19
|
-
async buildStart() {
|
|
20
|
-
artifacts = await buildIconSet(options);
|
|
21
|
-
if (options.declarationFile) {
|
|
22
|
-
const declarationFile = path.resolve(options.declarationFile);
|
|
23
|
-
await fs.mkdir(path.dirname(declarationFile), { recursive: true });
|
|
24
|
-
await fs.writeFile(declarationFile, createAdapterDeclarations(artifacts));
|
|
25
|
-
}
|
|
26
|
-
if (command === "build") for (const artifact of artifacts) references[artifact.variant] = this.emitFile({
|
|
27
|
-
type: "asset",
|
|
28
|
-
name: `omnica-icons-${artifact.variant}.svg`,
|
|
29
|
-
source: artifact.spriteSource
|
|
30
|
-
});
|
|
31
|
-
},
|
|
32
|
-
configureServer(server) {
|
|
33
|
-
server.middlewares.use("/@omnicajs/icons/", (request, response, next) => {
|
|
34
|
-
const variant = request.url?.split(/[?#]/, 1)[0]?.replace(/\.svg$/, "");
|
|
35
|
-
const artifact = artifacts.find((candidate) => candidate.variant === variant);
|
|
36
|
-
if (!artifact) {
|
|
37
|
-
next();
|
|
38
|
-
return;
|
|
39
|
-
}
|
|
40
|
-
response.statusCode = 200;
|
|
41
|
-
response.setHeader("Content-Type", "image/svg+xml");
|
|
42
|
-
response.setHeader("Cache-Control", "no-cache");
|
|
43
|
-
response.end(artifact.spriteSource);
|
|
44
|
-
});
|
|
45
|
-
},
|
|
46
|
-
resolveId(id) {
|
|
47
|
-
return id === virtualModuleId ? resolvedVirtualModuleId : null;
|
|
48
|
-
},
|
|
49
|
-
load(id) {
|
|
50
|
-
if (id !== resolvedVirtualModuleId) return null;
|
|
51
|
-
const spriteExpressions = Object.fromEntries(artifacts.map((artifact) => {
|
|
52
|
-
if (command === "build") return [artifact.variant, `import.meta.ROLLUP_FILE_URL_${references[artifact.variant]}`];
|
|
53
|
-
const hash = crypto.createHash("sha256").update(artifact.spriteSource).digest("hex").slice(0, 8);
|
|
54
|
-
return [artifact.variant, JSON.stringify(`/@omnicajs/icons/${artifact.variant}.svg?v=${hash}`)];
|
|
55
|
-
}));
|
|
56
|
-
return createAdapterRuntime(artifacts, spriteExpressions);
|
|
57
|
-
}
|
|
58
|
-
};
|
|
59
|
-
};
|
|
60
|
-
//#endregion
|
|
61
|
-
export { omnicaIcons };
|
|
1
|
+
import { omnicaIconComponents } from "./extracted/vite.js";
|
|
2
|
+
import { omnicaIcons } from "./subset/vite.js";
|
|
3
|
+
export { omnicaIconComponents, omnicaIcons };
|
package/dist/webpack.cjs
CHANGED
|
@@ -1,28 +1,16 @@
|
|
|
1
1
|
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
2
|
-
|
|
2
|
+
const require_extracted_bundler_plugin = require("./extracted/bundler/plugin.cjs");
|
|
3
|
+
const require_webpack = require("./subset/webpack.cjs");
|
|
3
4
|
//#region tooling/webpack.ts
|
|
4
|
-
var
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
this.#options = options;
|
|
5
|
+
var OmnicaIconComponentsPlugin = class {
|
|
6
|
+
#plugin;
|
|
7
|
+
constructor(options = {}) {
|
|
8
|
+
this.#plugin = new require_extracted_bundler_plugin.BundlerIconComponentsPlugin(options);
|
|
9
9
|
}
|
|
10
10
|
apply(compiler) {
|
|
11
|
-
|
|
12
|
-
const loaderPath = (0, node_path.join)(__dirname, "webpack-loader.cjs");
|
|
13
|
-
new compiler.webpack.NormalModuleReplacementPlugin(new RegExp(`^${virtualModuleId}$`), runtimePath).apply(compiler);
|
|
14
|
-
compiler.options.module.rules.unshift({
|
|
15
|
-
include: runtimePath,
|
|
16
|
-
use: [{
|
|
17
|
-
loader: loaderPath,
|
|
18
|
-
options: {
|
|
19
|
-
config: this.#options,
|
|
20
|
-
declarationFile: this.#options.declarationFile,
|
|
21
|
-
filename: this.#options.filename ?? "icons/omnica-[variant].[contenthash:8].svg"
|
|
22
|
-
}
|
|
23
|
-
}]
|
|
24
|
-
});
|
|
11
|
+
this.#plugin.apply(compiler);
|
|
25
12
|
}
|
|
26
13
|
};
|
|
27
14
|
//#endregion
|
|
28
|
-
exports.
|
|
15
|
+
exports.OmnicaIconComponentsPlugin = OmnicaIconComponentsPlugin;
|
|
16
|
+
exports.OmnicaIconsPlugin = require_webpack.OmnicaIconsPlugin;
|
package/dist/webpack.d.ts
CHANGED
|
@@ -1,14 +1,19 @@
|
|
|
1
1
|
import type { Compiler } from 'webpack';
|
|
2
|
-
import type { IconBuildConfig } from './build.js';
|
|
3
2
|
import type { WebpackPluginInstance } from 'webpack';
|
|
4
|
-
export
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
/** Supports `[
|
|
3
|
+
export type { OmnicaIconsPluginOptions } from './subset/webpack.js';
|
|
4
|
+
export { OmnicaIconsPlugin } from './subset/webpack.js';
|
|
5
|
+
export interface OmnicaIconComponentsPluginOptions {
|
|
6
|
+
/** Supports `[contenthash]` and `[contenthash:N]`. */
|
|
8
7
|
readonly filename?: string;
|
|
8
|
+
/** Overrides the loader used to compile the generated Vue SFC. */
|
|
9
|
+
readonly vueLoader?: string;
|
|
10
|
+
/** Client build output read by a later SSR build. Defaults to `<context>/dist`. */
|
|
11
|
+
readonly clientOutputDirectory?: string;
|
|
12
|
+
/** Overrides automatic Node-target SSR detection. */
|
|
13
|
+
readonly ssr?: boolean;
|
|
9
14
|
}
|
|
10
|
-
export declare class
|
|
15
|
+
export declare class OmnicaIconComponentsPlugin implements WebpackPluginInstance {
|
|
11
16
|
#private;
|
|
12
|
-
constructor(options
|
|
17
|
+
constructor(options?: OmnicaIconComponentsPluginOptions);
|
|
13
18
|
apply(compiler: Compiler): void;
|
|
14
19
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@omnicajs/icons",
|
|
3
|
-
"version": "0.3.
|
|
3
|
+
"version": "0.3.1",
|
|
4
4
|
"description": "OmnicaJS icon set.",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"repository": {
|
|
@@ -77,6 +77,13 @@
|
|
|
77
77
|
"types": "./dist/vite.d.ts",
|
|
78
78
|
"import": "./dist/vite.js"
|
|
79
79
|
},
|
|
80
|
+
"./vue": {
|
|
81
|
+
"types": "./vue.d.ts"
|
|
82
|
+
},
|
|
83
|
+
"./rspack": {
|
|
84
|
+
"types": "./dist/rspack.d.ts",
|
|
85
|
+
"require": "./dist/rspack.cjs"
|
|
86
|
+
},
|
|
80
87
|
"./webpack": {
|
|
81
88
|
"types": "./dist/webpack.d.ts",
|
|
82
89
|
"require": "./dist/webpack.cjs"
|
|
@@ -89,6 +96,7 @@
|
|
|
89
96
|
"assets",
|
|
90
97
|
"dist",
|
|
91
98
|
"metadata",
|
|
99
|
+
"/vue.d.ts",
|
|
92
100
|
"CHANGELOG.md",
|
|
93
101
|
"README.md",
|
|
94
102
|
"LICENSE"
|
|
@@ -114,7 +122,7 @@
|
|
|
114
122
|
"showcase:preview": "vitepress preview showcase --host 0.0.0.0",
|
|
115
123
|
"test": "yarn build && yarn test:unit && yarn test:fixtures",
|
|
116
124
|
"test:browser": "playwright test --config playwright.config.ts",
|
|
117
|
-
"test:fixtures": "node dist/cli.js build --config fixtures/cli/omnica-icons.config.mjs && tsc --noEmit -p fixtures/cli/tsconfig.json && vite build --config fixtures/vite/vite.config.ts && tsc --noEmit -p fixtures/vite/tsconfig.json && webpack --config fixtures/webpack/webpack.config.cjs && tsc --noEmit -p fixtures/webpack/tsconfig.json",
|
|
125
|
+
"test:fixtures": "node dist/cli.js build --config fixtures/cli/omnica-icons.config.mjs && tsc --noEmit -p fixtures/cli/tsconfig.json && vite build --config fixtures/vite/vite.config.ts && node fixtures/vite/assert-formats.mjs && vite build --config fixtures/vite/vite.config.ts --base / --ssr src/ssr.ts --outDir dist-ssr && node fixtures/vite/assert-ssr.mjs && tsc --noEmit -p fixtures/vite/tsconfig.json && webpack --config fixtures/webpack/webpack.config.cjs && webpack --config fixtures/webpack/webpack.ssr.config.cjs && tsc --noEmit -p fixtures/webpack/tsconfig.json && rspack build --config fixtures/rspack/rspack.config.cjs && rspack build --config fixtures/rspack/rspack.ssr.config.cjs && tsc --noEmit -p fixtures/rspack/tsconfig.json && node fixtures/assert-bundler-ssr.mjs && node fixtures/assert-bundler-ssr-public-path.mjs && node fixtures/assert-bundler-watch.mjs",
|
|
118
126
|
"test:unit": "node --test tests/*.test.ts",
|
|
119
127
|
"typecheck": "tsc --noEmit && tsc --noEmit --project showcase/tsconfig.json"
|
|
120
128
|
},
|
|
@@ -128,8 +136,11 @@
|
|
|
128
136
|
"@modulify/conventional-release": "^0.1.3",
|
|
129
137
|
"@omnicajs/eslint-plugin-dependencies": "^0.0.3",
|
|
130
138
|
"@playwright/test": "^1.61.1",
|
|
139
|
+
"@rspack/cli": "^2.1.8",
|
|
140
|
+
"@rspack/core": "^2.1.8",
|
|
131
141
|
"@stylistic/eslint-plugin": "^5.10.0",
|
|
132
142
|
"@types/node": "^25.9.2",
|
|
143
|
+
"@vitejs/plugin-vue": "^6.0.8",
|
|
133
144
|
"eslint": "^9.39.5",
|
|
134
145
|
"eslint-plugin-vue": "^10.9.2",
|
|
135
146
|
"globals": "^17.7.0",
|
|
@@ -143,6 +154,7 @@
|
|
|
143
154
|
"vue": "^3.5.39",
|
|
144
155
|
"vue-eslint-parser": "^10.4.1",
|
|
145
156
|
"vue-i18n": "^11.4.6",
|
|
157
|
+
"vue-loader": "^17.4.2",
|
|
146
158
|
"webpack": "^5.108.4",
|
|
147
159
|
"webpack-cli": "^7.2.1",
|
|
148
160
|
"yaml-eslint-parser": "^2.1.0"
|
package/vue.d.ts
ADDED
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
declare module '@omnicajs/icons/vue' {
|
|
2
|
+
import type { DefineComponent, SVGAttributes } from 'vue'
|
|
3
|
+
|
|
4
|
+
export type OmnicaIconProps = SVGAttributes & {
|
|
5
|
+
readonly [attribute: `data-${string}`]: string | number | boolean | null | undefined
|
|
6
|
+
}
|
|
7
|
+
export type OmnicaIconComponent = DefineComponent<OmnicaIconProps>
|
|
8
|
+
}
|
|
9
|
+
|
|
10
|
+
declare module '@omnicajs/icons/assets/icons/filled/*.svg?url' {
|
|
11
|
+
const url: string
|
|
12
|
+
|
|
13
|
+
export default url
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
declare module '@omnicajs/icons/assets/icons/outlined/*.svg?url' {
|
|
17
|
+
const url: string
|
|
18
|
+
|
|
19
|
+
export default url
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
declare module '@omnicajs/icons/assets/icons/filled/*.svg' {
|
|
23
|
+
import type { OmnicaIconComponent } from '@omnicajs/icons/vue'
|
|
24
|
+
|
|
25
|
+
const icon: OmnicaIconComponent
|
|
26
|
+
|
|
27
|
+
export default icon
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
declare module '@omnicajs/icons/assets/icons/outlined/*.svg' {
|
|
31
|
+
import type { OmnicaIconComponent } from '@omnicajs/icons/vue'
|
|
32
|
+
|
|
33
|
+
const icon: OmnicaIconComponent
|
|
34
|
+
|
|
35
|
+
export default icon
|
|
36
|
+
}
|
|
File without changes
|