favgen 0.2.1 → 0.2.3

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.
@@ -0,0 +1,3 @@
1
+ export { default as produceIcons } from "./generator.js";
2
+ export { default as favgenVitePlugin } from "./vite-plugin.js";
3
+ export type { FavgenVitePluginOptions } from "./vite-plugin.js";
package/lib/index.mjs ADDED
@@ -0,0 +1,2 @@
1
+ export { default as produceIcons } from "./generator.js";
2
+ export { default as favgenVitePlugin } from "./vite-plugin.js";
@@ -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.1",
3
+ "version": "0.2.3",
4
4
  "description": "CLI tool to generate a set of favicons from a single input file.",
5
5
  "keywords": [
6
6
  "favicon"
@@ -10,7 +10,15 @@
10
10
  "homepage": "https://github.com/favgen/favgen",
11
11
  "repository": "https://github.com/favgen/favgen.git",
12
12
  "main": "lib/index.js",
13
+ "module": "lib/index.mjs",
13
14
  "types": "lib/index.d.ts",
15
+ "exports": {
16
+ ".": {
17
+ "import": "./lib/index.mjs",
18
+ "require": "./lib/index.js",
19
+ "types": "./lib/index.d.ts"
20
+ }
21
+ },
14
22
  "bin": "bin/index.js",
15
23
  "files": [
16
24
  "lib/",