@omnicajs/icons 0.2.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.
Files changed (70) hide show
  1. package/CHANGELOG.md +17 -0
  2. package/README.md +113 -0
  3. package/assets/icons/filled/actions/badge-recommendation.svg +3 -0
  4. package/assets/icons/filled/actions/clear-circle-small.svg +3 -0
  5. package/assets/icons/filled/actions/clear-circle.svg +1 -1
  6. package/assets/icons/filled/commerce/shopping-cart-sale.svg +3 -0
  7. package/assets/icons/filled/layout/browser-window-close.svg +3 -0
  8. package/assets/icons/filled/layout/browser-window-in.svg +3 -0
  9. package/assets/icons/filled/navigation/exit.svg +4 -0
  10. package/assets/icons/filled/navigation/menu-squares.svg +3 -0
  11. package/dist/_virtual/_rolldown/runtime.cjs +23 -0
  12. package/dist/build.js +1 -13
  13. package/dist/extracted/bundler/component-loader.cjs +26 -0
  14. package/dist/extracted/bundler/component-loader.d.ts +3 -0
  15. package/dist/extracted/bundler/plugin.cjs +125 -0
  16. package/dist/extracted/bundler/plugin.d.ts +21 -0
  17. package/dist/extracted/bundler/template-assets-loader.cjs +8 -0
  18. package/dist/extracted/bundler/template-assets-loader.d.ts +3 -0
  19. package/dist/extracted/core.d.ts +14 -0
  20. package/dist/extracted/core.js +64 -0
  21. package/dist/extracted/manifest.cjs +23 -0
  22. package/dist/extracted/manifest.d.ts +11 -0
  23. package/dist/extracted/manifest.js +20 -0
  24. package/dist/extracted/vite.d.ts +8 -0
  25. package/dist/extracted/vite.js +174 -0
  26. package/dist/filled/actions.cjs +1 -1
  27. package/dist/filled/actions.d.ts +1 -1
  28. package/dist/filled/actions.js +1 -1
  29. package/dist/filled/commerce.cjs +1 -1
  30. package/dist/filled/commerce.d.ts +1 -1
  31. package/dist/filled/commerce.js +1 -1
  32. package/dist/filled/index.cjs +4 -4
  33. package/dist/filled/index.d.ts +4 -4
  34. package/dist/filled/index.js +4 -4
  35. package/dist/filled/layout.cjs +1 -1
  36. package/dist/filled/layout.d.ts +1 -1
  37. package/dist/filled/layout.js +1 -1
  38. package/dist/filled/navigation.cjs +1 -1
  39. package/dist/filled/navigation.d.ts +1 -1
  40. package/dist/filled/navigation.js +1 -1
  41. package/dist/manifest.cjs +1 -1
  42. package/dist/manifest.js +1 -1
  43. package/dist/manifest.json +55 -11
  44. package/dist/rspack.cjs +14 -0
  45. package/dist/rspack.d.ts +16 -0
  46. package/dist/shared/sprite.d.ts +2 -0
  47. package/dist/shared/sprite.js +16 -0
  48. package/dist/sprites/filled/actions.svg +7 -1
  49. package/dist/sprites/filled/commerce.svg +3 -0
  50. package/dist/sprites/filled/layout.svg +6 -0
  51. package/dist/sprites/filled/navigation.svg +6 -0
  52. package/dist/sprites/filled.svg +22 -1
  53. package/dist/{adapter-output.d.ts → subset/adapter-output.d.ts} +1 -1
  54. package/dist/{adapter-output.js → subset/adapter-output.js} +1 -1
  55. package/dist/subset/vite.d.ts +7 -0
  56. package/dist/subset/vite.js +61 -0
  57. package/dist/{webpack-loader.cjs → subset/webpack-loader.cjs} +5 -9
  58. package/dist/{webpack-loader.d.ts → subset/webpack-loader.d.ts} +1 -1
  59. package/dist/{webpack-runtime.cjs → subset/webpack-runtime.cjs} +1 -1
  60. package/dist/subset/webpack.cjs +27 -0
  61. package/dist/subset/webpack.d.ts +14 -0
  62. package/dist/vite.d.ts +4 -7
  63. package/dist/vite.js +3 -61
  64. package/dist/webpack.cjs +9 -21
  65. package/dist/webpack.d.ts +12 -7
  66. package/metadata/icon-keywords.json +9 -0
  67. package/metadata/migrations/groups-v1.json +2 -2
  68. package/package.json +14 -2
  69. package/vue.d.ts +36 -0
  70. /package/dist/{webpack-runtime.d.ts → subset/webpack-runtime.d.ts} +0 -0
package/dist/vite.js CHANGED
@@ -1,61 +1,3 @@
1
- import { createAdapterDeclarations, createAdapterRuntime } from "./adapter-output.js";
2
- import { buildIconSet } from "./build.js";
3
- import fs from "node:fs/promises";
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
- let node_path = require("node:path");
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 virtualModuleId = "virtual:omnicajs-icons";
5
- var OmnicaIconsPlugin = class {
6
- #options;
7
- constructor(options) {
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
- const runtimePath = (0, node_path.join)(__dirname, "webpack-runtime.cjs");
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.OmnicaIconsPlugin = OmnicaIconsPlugin;
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 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]`. */
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 OmnicaIconsPlugin implements WebpackPluginInstance {
15
+ export declare class OmnicaIconComponentsPlugin implements WebpackPluginInstance {
11
16
  #private;
12
- constructor(options: OmnicaIconsPluginOptions);
17
+ constructor(options?: OmnicaIconComponentsPluginOptions);
13
18
  apply(compiler: Compiler): void;
14
19
  }
@@ -20,6 +20,7 @@
20
20
  "ui/auto-chain-forward"
21
21
  ],
22
22
  "autorenew": [],
23
+ "badge-recommendation": [],
23
24
  "beta": [
24
25
  "ui/beta",
25
26
  "ui/beta_test"
@@ -42,6 +43,9 @@
42
43
  "clear": [],
43
44
  "clear-all": [],
44
45
  "clear-circle": [],
46
+ "clear-circle-small": [
47
+ "actions/clear-circle"
48
+ ],
45
49
  "clear-square": [],
46
50
  "command": [],
47
51
  "copy": [
@@ -740,6 +744,7 @@
740
744
  "shopping-cart-remove": [
741
745
  "actions/shopping-cart-remove"
742
746
  ],
747
+ "shopping-cart-sale": [],
743
748
  "subscribe": [
744
749
  "actions/subscribe"
745
750
  ],
@@ -1938,6 +1943,8 @@
1938
1943
  "browser-window": [
1939
1944
  "actions/browser-window"
1940
1945
  ],
1946
+ "browser-window-close": [],
1947
+ "browser-window-in": [],
1941
1948
  "browser-windows": [
1942
1949
  "actions/browser-windows"
1943
1950
  ],
@@ -2382,6 +2389,7 @@
2382
2389
  "enter": [
2383
2390
  "other/enter"
2384
2391
  ],
2392
+ "exit": [],
2385
2393
  "explore": [
2386
2394
  "ui/explore"
2387
2395
  ],
@@ -2419,6 +2427,7 @@
2419
2427
  "ui/menu_left_right",
2420
2428
  "ui/menu-right"
2421
2429
  ],
2430
+ "menu-squares": [],
2422
2431
  "menu-vertical": [
2423
2432
  "ui/menu_vertical",
2424
2433
  "ui/menu-vertical"
@@ -265,10 +265,10 @@
265
265
  },
266
266
  {
267
267
  "source": "assets/icons/actions/clear-circle.svg",
268
- "destination": "assets/icons/filled/actions/clear-circle.svg",
268
+ "destination": "assets/icons/filled/actions/clear-circle-small.svg",
269
269
  "variant": "filled",
270
270
  "group": "actions",
271
- "name": "clear-circle",
271
+ "name": "clear-circle-small",
272
272
  "canonical": true
273
273
  },
274
274
  {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@omnicajs/icons",
3
- "version": "0.2.0",
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
+ }