@ir-kit/fn-schema-unplugin 0.1.0

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/LICENSE.md ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2025 Ahmed Rowaihi
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
package/README.md ADDED
@@ -0,0 +1,76 @@
1
+ # @ir-kit/fn-schema-unplugin
2
+
3
+ Bundler plugin for fn-schema. Resolves a virtual module to the extracted bundle, with HMR on source change in Vite. Built on [unplugin](https://github.com/unjs/unplugin) — same package powers Vite, webpack, Rollup, esbuild, Rspack, Rolldown, and Farm.
4
+
5
+ ## When to use it
6
+
7
+ You have a Vite/Next/webpack app and want fn-schema results available via a regular import — without running the [`cli`](../cli/README.md) as a separate process. The plugin keeps a warm `Project` instance during dev and triggers a reload when source files change.
8
+
9
+ ## Install
10
+
11
+ ```bash
12
+ pnpm add -D @ir-kit/fn-schema-unplugin
13
+ ```
14
+
15
+ ## Vite
16
+
17
+ ```ts
18
+ // vite.config.ts
19
+ import { defineConfig } from "vite"
20
+ import fnSchema from "@ir-kit/fn-schema-unplugin/vite"
21
+
22
+ export default defineConfig({
23
+ plugins: [
24
+ fnSchema({
25
+ files: "src/api/**/*.ts",
26
+ schema: { identity: "x-fn-schema-ts", transport: "x-fn-schema-transport" },
27
+ }),
28
+ ],
29
+ })
30
+ ```
31
+
32
+ ```ts
33
+ // app code
34
+ import schemas from "virtual:fn-schema/bundle"
35
+ import { createReader } from "@ir-kit/fn-schema-loader"
36
+
37
+ const reader = createReader(schemas)
38
+ ```
39
+
40
+ ## Other bundlers
41
+
42
+ ```ts
43
+ // webpack
44
+ const fnSchema = require("@ir-kit/fn-schema-unplugin/webpack").default
45
+
46
+ // rollup
47
+ import fnSchema from "@ir-kit/fn-schema-unplugin/rollup"
48
+
49
+ // esbuild
50
+ import fnSchema from "@ir-kit/fn-schema-unplugin/esbuild"
51
+ ```
52
+
53
+ Subpath exports also exist for `/rspack`, `/rolldown`, `/farm`.
54
+
55
+ ## Options
56
+
57
+ ```ts
58
+ interface FnSchemaPluginOptions {
59
+ files: string | string[] // required
60
+ cwd?: string // default: process.cwd()
61
+ tsConfigPath?: string
62
+ virtualModuleId?: string // default: "virtual:fn-schema/bundle"
63
+ // …all extract options (include, exclude, signature, schema, naming, hooks)
64
+ }
65
+ ```
66
+
67
+ ## CLI vs unplugin
68
+
69
+ | | CLI | unplugin |
70
+ |---|---|---|
71
+ | extra dev process | yes | no |
72
+ | HMR on schema change | manual (your watcher) | built-in (Vite) |
73
+ | works outside a bundler | yes | no |
74
+ | produces disk artifact (`schemas.json`) | yes | no (in-memory) |
75
+
76
+ Use the CLI when you want a checked-in `schemas.json` — for backend Node servers, deployment validation, or sharing across services. Use unplugin when fn-schema is a per-app dev concern.
@@ -0,0 +1,5 @@
1
+ import { fnSchema } from "./index.js";
2
+ declare const _default: (options: import("./index.js").FnSchemaPluginOptions) => import("unplugin").EsbuildPlugin;
3
+ export default _default;
4
+ export { fnSchema };
5
+ //# sourceMappingURL=esbuild.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"esbuild.d.ts","sourceRoot":"","sources":["../src/esbuild.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,YAAY,CAAC;;AAEtC,wBAAgC;AAChC,OAAO,EAAE,QAAQ,EAAE,CAAC"}
@@ -0,0 +1,4 @@
1
+ import { fnSchema } from "./index.js";
2
+ export default fnSchema.esbuild;
3
+ export { fnSchema };
4
+ //# sourceMappingURL=esbuild.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"esbuild.js","sourceRoot":"","sources":["../src/esbuild.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,YAAY,CAAC;AAEtC,eAAe,QAAQ,CAAC,OAAO,CAAC;AAChC,OAAO,EAAE,QAAQ,EAAE,CAAC"}
package/dist/farm.d.ts ADDED
@@ -0,0 +1,5 @@
1
+ import { fnSchema } from "./index.js";
2
+ declare const _default: (options: import("./index.js").FnSchemaPluginOptions) => JsPlugin;
3
+ export default _default;
4
+ export { fnSchema };
5
+ //# sourceMappingURL=farm.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"farm.d.ts","sourceRoot":"","sources":["../src/farm.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,YAAY,CAAC;;AAEtC,wBAA6B;AAC7B,OAAO,EAAE,QAAQ,EAAE,CAAC"}
package/dist/farm.js ADDED
@@ -0,0 +1,4 @@
1
+ import { fnSchema } from "./index.js";
2
+ export default fnSchema.farm;
3
+ export { fnSchema };
4
+ //# sourceMappingURL=farm.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"farm.js","sourceRoot":"","sources":["../src/farm.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,YAAY,CAAC;AAEtC,eAAe,QAAQ,CAAC,IAAI,CAAC;AAC7B,OAAO,EAAE,QAAQ,EAAE,CAAC"}
@@ -0,0 +1,13 @@
1
+ import { type ExtractOptions } from "@ir-kit/fn-schema-core";
2
+ import { type UnpluginInstance } from "unplugin";
3
+ export interface FnSchemaPluginOptions extends Omit<ExtractOptions, "files" | "source" | "targets"> {
4
+ /** Glob pattern(s) for source files. Required. */
5
+ files: string | string[];
6
+ /** Working directory for glob resolution + ts-morph project. Default: process.cwd(). */
7
+ cwd?: string;
8
+ /** Virtual module specifier consumers import. Default: `virtual:fn-schema/bundle`. */
9
+ virtualModuleId?: string;
10
+ }
11
+ export declare const fnSchema: UnpluginInstance<FnSchemaPluginOptions, false>;
12
+ export default fnSchema;
13
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AACA,OAAO,EAEL,KAAK,cAAc,EAGpB,MAAM,wBAAwB,CAAC;AAIhC,OAAO,EAAkB,KAAK,gBAAgB,EAAE,MAAM,UAAU,CAAC;AAEjE,MAAM,WAAW,qBACf,SAAQ,IAAI,CAAC,cAAc,EAAE,OAAO,GAAG,QAAQ,GAAG,SAAS,CAAC;IAC5D,kDAAkD;IAClD,KAAK,EAAE,MAAM,GAAG,MAAM,EAAE,CAAC;IACzB,wFAAwF;IACxF,GAAG,CAAC,EAAE,MAAM,CAAC;IACb,sFAAsF;IACtF,eAAe,CAAC,EAAE,MAAM,CAAC;CAC1B;AAuBD,eAAO,MAAM,QAAQ,EAAE,gBAAgB,CAAC,qBAAqB,EAAE,KAAK,CA0FhE,CAAC;AAEL,eAAe,QAAQ,CAAC"}
package/dist/index.js ADDED
@@ -0,0 +1,108 @@
1
+ import path from "node:path";
2
+ import { createProject, } from "@ir-kit/fn-schema-core";
3
+ import { typescript } from "@ir-kit/fn-schema-typescript";
4
+ import chokidar from "chokidar";
5
+ import { glob } from "tinyglobby";
6
+ import { createUnplugin } from "unplugin";
7
+ const DEFAULT_VIRTUAL_ID = "virtual:fn-schema/bundle";
8
+ function buildBundle(result) {
9
+ return {
10
+ $schema: "http://json-schema.org/draft-07/schema#",
11
+ definitions: result.definitions,
12
+ signatures: Object.fromEntries(result.signatures.map((s) => [
13
+ s.id,
14
+ { input: s.input, output: s.output },
15
+ ])),
16
+ };
17
+ }
18
+ export const fnSchema = createUnplugin((options) => {
19
+ const cwd = path.resolve(options.cwd ?? process.cwd());
20
+ const virtualId = options.virtualModuleId ?? DEFAULT_VIRTUAL_ID;
21
+ const resolvedId = `\0${virtualId}`;
22
+ const patterns = Array.isArray(options.files)
23
+ ? options.files
24
+ : [options.files];
25
+ let project = null;
26
+ let cachedSource = null;
27
+ let watcher = null;
28
+ const ensureProject = () => {
29
+ if (project)
30
+ return project;
31
+ project = createProject({
32
+ cwd,
33
+ tsConfigPath: options.tsConfigPath,
34
+ extractors: [typescript()],
35
+ });
36
+ return project;
37
+ };
38
+ const generate = async () => {
39
+ const files = await glob(patterns, {
40
+ cwd,
41
+ absolute: true,
42
+ onlyFiles: true,
43
+ ignore: [
44
+ "**/node_modules/**",
45
+ "**/dist/**",
46
+ "**/__fn_schema_virtual__/**",
47
+ ],
48
+ });
49
+ const result = await ensureProject().extract({ ...options, files });
50
+ const bundle = buildBundle(result);
51
+ return `export default ${JSON.stringify(bundle)};`;
52
+ };
53
+ return {
54
+ name: "@ir-kit/fn-schema-unplugin",
55
+ enforce: "pre",
56
+ resolveId(id) {
57
+ if (id === virtualId)
58
+ return resolvedId;
59
+ return null;
60
+ },
61
+ async load(id) {
62
+ if (id !== resolvedId)
63
+ return null;
64
+ cachedSource ??= await generate();
65
+ return cachedSource;
66
+ },
67
+ async buildEnd() {
68
+ if (!watcher) {
69
+ project?.dispose();
70
+ project = null;
71
+ }
72
+ },
73
+ vite: {
74
+ async configureServer(server) {
75
+ watcher = chokidar.watch(patterns, {
76
+ cwd,
77
+ ignoreInitial: true,
78
+ ignored: [
79
+ "**/node_modules/**",
80
+ "**/dist/**",
81
+ "**/__fn_schema_virtual__/**",
82
+ ],
83
+ });
84
+ const reload = async (relPath) => {
85
+ const abs = path.resolve(cwd, relPath);
86
+ project?.refresh([abs]);
87
+ cachedSource = null;
88
+ const mod = server.moduleGraph.getModuleById(resolvedId);
89
+ if (mod) {
90
+ server.moduleGraph.invalidateModule(mod);
91
+ server.ws.send({ type: "full-reload" });
92
+ }
93
+ };
94
+ watcher.on("change", reload);
95
+ watcher.on("add", reload);
96
+ watcher.on("unlink", reload);
97
+ server.httpServer?.once("close", () => {
98
+ void watcher?.close();
99
+ watcher = null;
100
+ project?.dispose();
101
+ project = null;
102
+ });
103
+ },
104
+ },
105
+ };
106
+ });
107
+ export default fnSchema;
108
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,IAAI,MAAM,WAAW,CAAC;AAC7B,OAAO,EACL,aAAa,GAId,MAAM,wBAAwB,CAAC;AAChC,OAAO,EAAE,UAAU,EAAE,MAAM,8BAA8B,CAAC;AAC1D,OAAO,QAAQ,MAAM,UAAU,CAAC;AAChC,OAAO,EAAE,IAAI,EAAE,MAAM,YAAY,CAAC;AAClC,OAAO,EAAE,cAAc,EAAyB,MAAM,UAAU,CAAC;AAYjE,MAAM,kBAAkB,GAAG,0BAA0B,CAAC;AAQtD,SAAS,WAAW,CAAC,MAAqB;IACxC,OAAO;QACL,OAAO,EAAE,yCAAyC;QAClD,WAAW,EAAE,MAAM,CAAC,WAAW;QAC/B,UAAU,EAAE,MAAM,CAAC,WAAW,CAC5B,MAAM,CAAC,UAAU,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC;YAC3B,CAAC,CAAC,EAAE;YACJ,EAAE,KAAK,EAAE,CAAC,CAAC,KAAK,EAAE,MAAM,EAAE,CAAC,CAAC,MAAM,EAAE;SACrC,CAAC,CACH;KAC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,CAAC;wBACzC,MAAM,CAAC,EAAE,CAAC,IAAI,CAAC,EAAE,IAAI,EAAE,aAAa,EAAE,CAAC,CAAC;oBAC1C,CAAC;gBACH,CAAC,CAAC;gBACF,OAAO,CAAC,EAAE,CAAC,QAAQ,EAAE,MAAM,CAAC,CAAC;gBAC7B,OAAO,CAAC,EAAE,CAAC,KAAK,EAAE,MAAM,CAAC,CAAC;gBAC1B,OAAO,CAAC,EAAE,CAAC,QAAQ,EAAE,MAAM,CAAC,CAAC;gBAC7B,MAAM,CAAC,UAAU,EAAE,IAAI,CAAC,OAAO,EAAE,GAAG,EAAE;oBACpC,KAAK,OAAO,EAAE,KAAK,EAAE,CAAC;oBACtB,OAAO,GAAG,IAAI,CAAC;oBACf,OAAO,EAAE,OAAO,EAAE,CAAC;oBACnB,OAAO,GAAG,IAAI,CAAC;gBACjB,CAAC,CAAC,CAAC;YACL,CAAC;SACF;KACF,CAAC;AACJ,CAAC,CAAC,CAAC;AAEL,eAAe,QAAQ,CAAC"}
@@ -0,0 +1,5 @@
1
+ import { fnSchema } from "./index.js";
2
+ declare const _default: (options: import("./index.js").FnSchemaPluginOptions) => import("unplugin").RolldownPlugin<any>;
3
+ export default _default;
4
+ export { fnSchema };
5
+ //# sourceMappingURL=rolldown.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"rolldown.d.ts","sourceRoot":"","sources":["../src/rolldown.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,YAAY,CAAC;;AAEtC,wBAAiC;AACjC,OAAO,EAAE,QAAQ,EAAE,CAAC"}
@@ -0,0 +1,4 @@
1
+ import { fnSchema } from "./index.js";
2
+ export default fnSchema.rolldown;
3
+ export { fnSchema };
4
+ //# sourceMappingURL=rolldown.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"rolldown.js","sourceRoot":"","sources":["../src/rolldown.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,YAAY,CAAC;AAEtC,eAAe,QAAQ,CAAC,QAAQ,CAAC;AACjC,OAAO,EAAE,QAAQ,EAAE,CAAC"}
@@ -0,0 +1,5 @@
1
+ import { fnSchema } from "./index.js";
2
+ declare const _default: (options: import("./index.js").FnSchemaPluginOptions) => RollupPlugin;
3
+ export default _default;
4
+ export { fnSchema };
5
+ //# sourceMappingURL=rollup.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"rollup.d.ts","sourceRoot":"","sources":["../src/rollup.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,YAAY,CAAC;;AAEtC,wBAA+B;AAC/B,OAAO,EAAE,QAAQ,EAAE,CAAC"}
package/dist/rollup.js ADDED
@@ -0,0 +1,4 @@
1
+ import { fnSchema } from "./index.js";
2
+ export default fnSchema.rollup;
3
+ export { fnSchema };
4
+ //# sourceMappingURL=rollup.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"rollup.js","sourceRoot":"","sources":["../src/rollup.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,YAAY,CAAC;AAEtC,eAAe,QAAQ,CAAC,MAAM,CAAC;AAC/B,OAAO,EAAE,QAAQ,EAAE,CAAC"}
@@ -0,0 +1,5 @@
1
+ import { fnSchema } from "./index.js";
2
+ declare const _default: (options: import("./index.js").FnSchemaPluginOptions) => RspackPluginInstance;
3
+ export default _default;
4
+ export { fnSchema };
5
+ //# sourceMappingURL=rspack.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"rspack.d.ts","sourceRoot":"","sources":["../src/rspack.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,YAAY,CAAC;;AAEtC,wBAA+B;AAC/B,OAAO,EAAE,QAAQ,EAAE,CAAC"}
package/dist/rspack.js ADDED
@@ -0,0 +1,4 @@
1
+ import { fnSchema } from "./index.js";
2
+ export default fnSchema.rspack;
3
+ export { fnSchema };
4
+ //# sourceMappingURL=rspack.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"rspack.js","sourceRoot":"","sources":["../src/rspack.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,YAAY,CAAC;AAEtC,eAAe,QAAQ,CAAC,MAAM,CAAC;AAC/B,OAAO,EAAE,QAAQ,EAAE,CAAC"}
package/dist/vite.d.ts ADDED
@@ -0,0 +1,5 @@
1
+ import { fnSchema } from "./index.js";
2
+ declare const _default: (options: import("./index.js").FnSchemaPluginOptions) => import("unplugin").VitePlugin<any>;
3
+ export default _default;
4
+ export { fnSchema };
5
+ //# sourceMappingURL=vite.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"vite.d.ts","sourceRoot":"","sources":["../src/vite.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,YAAY,CAAC;;AAEtC,wBAA6B;AAC7B,OAAO,EAAE,QAAQ,EAAE,CAAC"}
package/dist/vite.js ADDED
@@ -0,0 +1,4 @@
1
+ import { fnSchema } from "./index.js";
2
+ export default fnSchema.vite;
3
+ export { fnSchema };
4
+ //# sourceMappingURL=vite.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"vite.js","sourceRoot":"","sources":["../src/vite.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,YAAY,CAAC;AAEtC,eAAe,QAAQ,CAAC,IAAI,CAAC;AAC7B,OAAO,EAAE,QAAQ,EAAE,CAAC"}
@@ -0,0 +1,5 @@
1
+ import { fnSchema } from "./index.js";
2
+ declare const _default: (options: import("./index.js").FnSchemaPluginOptions) => WebpackPluginInstance;
3
+ export default _default;
4
+ export { fnSchema };
5
+ //# sourceMappingURL=webpack.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"webpack.d.ts","sourceRoot":"","sources":["../src/webpack.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,YAAY,CAAC;;AAEtC,wBAAgC;AAChC,OAAO,EAAE,QAAQ,EAAE,CAAC"}
@@ -0,0 +1,4 @@
1
+ import { fnSchema } from "./index.js";
2
+ export default fnSchema.webpack;
3
+ export { fnSchema };
4
+ //# sourceMappingURL=webpack.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"webpack.js","sourceRoot":"","sources":["../src/webpack.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,YAAY,CAAC;AAEtC,eAAe,QAAQ,CAAC,OAAO,CAAC;AAChC,OAAO,EAAE,QAAQ,EAAE,CAAC"}
package/package.json ADDED
@@ -0,0 +1,97 @@
1
+ {
2
+ "name": "@ir-kit/fn-schema-unplugin",
3
+ "version": "0.1.0",
4
+ "description": "Bundler plugin for fn-schema. Exposes a virtual module that resolves to the extracted bundle, with HMR on source change in dev. Built on unplugin so the same package powers Vite, webpack, Rollup, esbuild, Rspack, Rolldown, and Farm.",
5
+ "keywords": [
6
+ "json-schema",
7
+ "function-signature",
8
+ "vite-plugin",
9
+ "webpack-plugin",
10
+ "rollup-plugin",
11
+ "esbuild-plugin",
12
+ "unplugin",
13
+ "hmr"
14
+ ],
15
+ "homepage": "https://github.com/ir-kit/ir-kit/tree/main/packages/fn-schema/unplugin",
16
+ "bugs": {
17
+ "url": "https://github.com/ir-kit/ir-kit/issues"
18
+ },
19
+ "license": "MIT",
20
+ "author": {
21
+ "name": "Ahmed Rowaihi",
22
+ "email": "ahmedrowaihi@gmail.com"
23
+ },
24
+ "repository": {
25
+ "type": "git",
26
+ "url": "git+https://github.com/ir-kit/ir-kit.git",
27
+ "directory": "packages/fn-schema/unplugin"
28
+ },
29
+ "type": "module",
30
+ "sideEffects": false,
31
+ "main": "./dist/index.js",
32
+ "types": "./dist/index.d.ts",
33
+ "exports": {
34
+ ".": {
35
+ "types": "./dist/index.d.ts",
36
+ "import": "./dist/index.js"
37
+ },
38
+ "./vite": {
39
+ "types": "./dist/vite.d.ts",
40
+ "import": "./dist/vite.js"
41
+ },
42
+ "./webpack": {
43
+ "types": "./dist/webpack.d.ts",
44
+ "import": "./dist/webpack.js"
45
+ },
46
+ "./rollup": {
47
+ "types": "./dist/rollup.d.ts",
48
+ "import": "./dist/rollup.js"
49
+ },
50
+ "./esbuild": {
51
+ "types": "./dist/esbuild.d.ts",
52
+ "import": "./dist/esbuild.js"
53
+ },
54
+ "./rspack": {
55
+ "types": "./dist/rspack.d.ts",
56
+ "import": "./dist/rspack.js"
57
+ },
58
+ "./rolldown": {
59
+ "types": "./dist/rolldown.d.ts",
60
+ "import": "./dist/rolldown.js"
61
+ },
62
+ "./farm": {
63
+ "types": "./dist/farm.d.ts",
64
+ "import": "./dist/farm.js"
65
+ },
66
+ "./package.json": "./package.json"
67
+ },
68
+ "files": [
69
+ "dist",
70
+ "LICENSE.md"
71
+ ],
72
+ "publishConfig": {
73
+ "access": "public",
74
+ "provenance": true
75
+ },
76
+ "dependencies": {
77
+ "chokidar": "^4.0.3",
78
+ "tinyglobby": "^0.2.10",
79
+ "unplugin": "^3.0.0",
80
+ "@ir-kit/fn-schema-core": "0.1.0",
81
+ "@ir-kit/fn-schema-typescript": "0.1.0"
82
+ },
83
+ "devDependencies": {
84
+ "@types/node": "^22",
85
+ "vitest": "^4.0.0",
86
+ "@ir-kit/tsconfig": "0.0.0"
87
+ },
88
+ "engines": {
89
+ "node": ">=20.19.0"
90
+ },
91
+ "scripts": {
92
+ "build": "tsc -p tsconfig.build.json",
93
+ "dev": "tsc -p tsconfig.build.json --watch",
94
+ "typecheck": "tsc --noEmit",
95
+ "test": "vitest run --passWithNoTests"
96
+ }
97
+ }