favgen 0.2.2 → 0.2.4

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/lib/index.d.mts CHANGED
@@ -1,3 +1,5 @@
1
- export { default as produceIcons } from "./generator.js";
2
- export { default as favgenVitePlugin } from "./vite-plugin.js";
1
+ import produceIconsImport from "./generator.js";
2
+ import favgenVitePluginImport from "./vite-plugin.js";
3
+ export declare const produceIcons: typeof produceIconsImport;
4
+ export declare const favgenVitePlugin: typeof favgenVitePluginImport;
3
5
  export type { FavgenVitePluginOptions } from "./vite-plugin.js";
package/lib/index.mjs CHANGED
@@ -1,10 +1,11 @@
1
- "use strict";
2
- var __importDefault = (this && this.__importDefault) || function (mod) {
3
- return (mod && mod.__esModule) ? mod : { "default": mod };
4
- };
5
- Object.defineProperty(exports, "__esModule", { value: true });
6
- exports.favgenVitePlugin = exports.produceIcons = void 0;
7
- var generator_js_1 = require("./generator.js");
8
- Object.defineProperty(exports, "produceIcons", { enumerable: true, get: function () { return __importDefault(generator_js_1).default; } });
9
- var vite_plugin_js_1 = require("./vite-plugin.js");
10
- Object.defineProperty(exports, "favgenVitePlugin", { enumerable: true, get: function () { return __importDefault(vite_plugin_js_1).default; } });
1
+ import produceIconsImport from "./generator.js";
2
+ import favgenVitePluginImport from "./vite-plugin.js";
3
+ function normalizeDefaultExport(mod) {
4
+ return (typeof mod === "object" &&
5
+ mod !== null &&
6
+ "default" in mod)
7
+ ? mod.default
8
+ : mod;
9
+ }
10
+ export const produceIcons = normalizeDefaultExport(produceIconsImport);
11
+ export const favgenVitePlugin = normalizeDefaultExport(favgenVitePluginImport);
@@ -1,7 +1,35 @@
1
- import type { Plugin } from "vite";
1
+ /// <reference types="node" />
2
+ /// <reference types="node" />
2
3
  export declare type FavgenVitePluginOptions = {
3
4
  source: string;
4
5
  colors?: number;
5
6
  assetsPath?: string;
6
7
  };
8
+ declare type HtmlTagDescriptor = {
9
+ tag: string;
10
+ attrs: Record<string, string>;
11
+ injectTo?: "head" | "body";
12
+ };
13
+ declare type ResolvedConfig = {
14
+ root: string;
15
+ base: string;
16
+ };
17
+ declare type EmitAsset = {
18
+ type: "asset";
19
+ fileName: string;
20
+ source: Buffer;
21
+ };
22
+ declare type PluginContext = {
23
+ emitFile: (asset: EmitAsset) => void;
24
+ };
25
+ declare type Plugin = {
26
+ name: string;
27
+ apply?: "build";
28
+ configResolved?: (resolvedConfig: ResolvedConfig) => void;
29
+ buildStart?: () => Promise<void>;
30
+ generateBundle?: (this: PluginContext) => void;
31
+ transformIndexHtml?: () => HtmlTagDescriptor[];
32
+ closeBundle?: () => Promise<void>;
33
+ };
7
34
  export default function favgenVitePlugin(options: FavgenVitePluginOptions): Plugin;
35
+ export {};
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "favgen",
3
- "version": "0.2.2",
3
+ "version": "0.2.4",
4
4
  "description": "CLI tool to generate a set of favicons from a single input file.",
5
5
  "keywords": [
6
6
  "favicon"