@supsign/unplugin-interfaces 0.1.0 → 0.1.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/dist/astro.js CHANGED
@@ -1,4 +1,4 @@
1
- import { src_default } from "./src-CskmyrvV.js";
1
+ import { src_default } from "./src-DyBB0CwK.js";
2
2
 
3
3
  //#region src/astro.ts
4
4
  var astro_default = (options) => ({
package/dist/esbuild.js CHANGED
@@ -1,4 +1,4 @@
1
- import { unpluginFactory } from "./src-CskmyrvV.js";
1
+ import { unpluginFactory } from "./src-DyBB0CwK.js";
2
2
  import { createEsbuildPlugin } from "unplugin";
3
3
 
4
4
  //#region src/esbuild.ts
package/dist/farm.js CHANGED
@@ -1,4 +1,4 @@
1
- import { unpluginFactory } from "./src-CskmyrvV.js";
1
+ import { unpluginFactory } from "./src-DyBB0CwK.js";
2
2
  import { createFarmPlugin } from "unplugin";
3
3
 
4
4
  //#region src/farm.ts
package/dist/index.d.ts CHANGED
@@ -2,15 +2,15 @@ import { Options } from "./types-BVbGtSvv.js";
2
2
  import * as unplugin0 from "unplugin";
3
3
  import { UnpluginFactory } from "unplugin";
4
4
  import * as esbuild0 from "esbuild";
5
- import * as vite0 from "vite";
6
- import * as rollup0 from "rollup";
5
+ import * as vite1 from "vite";
6
+ import * as rollup1 from "rollup";
7
7
  import * as webpack0 from "webpack";
8
8
 
9
9
  //#region src/index.d.ts
10
10
  declare const unpluginFactory: UnpluginFactory<Options | undefined>;
11
11
  declare const unplugin: unplugin0.UnpluginInstance<Options | undefined, boolean>;
12
- declare const vite: (options?: Options | undefined) => vite0.Plugin<any> | vite0.Plugin<any>[];
13
- declare const rollup: (options?: Options | undefined) => rollup0.Plugin<any> | rollup0.Plugin<any>[];
12
+ declare const vite: (options?: Options | undefined) => vite1.Plugin<any> | vite1.Plugin<any>[];
13
+ declare const rollup: (options?: Options | undefined) => rollup1.Plugin<any> | rollup1.Plugin<any>[];
14
14
  declare const webpack: (options?: Options | undefined) => webpack0.WebpackPluginInstance;
15
15
  declare const esbuild: (options?: Options | undefined) => esbuild0.Plugin;
16
16
  //#endregion
package/dist/index.js CHANGED
@@ -1,3 +1,3 @@
1
- import { esbuild, rollup, src_default, unplugin, unpluginFactory, vite, webpack } from "./src-CskmyrvV.js";
1
+ import { esbuild, rollup, src_default, unplugin, unpluginFactory, vite, webpack } from "./src-DyBB0CwK.js";
2
2
 
3
3
  export { src_default as default, esbuild, rollup, unplugin, unpluginFactory, vite, webpack };
package/dist/nuxt.js CHANGED
@@ -1,6 +1,6 @@
1
- import "./src-CskmyrvV.js";
2
- import { vite_default } from "./vite-B3qRJmDz.js";
3
- import { webpack_default } from "./webpack-Do7Ul9CV.js";
1
+ import "./src-DyBB0CwK.js";
2
+ import { vite_default } from "./vite-Bc6kO4Bd.js";
3
+ import { webpack_default } from "./webpack-7x38_B5C.js";
4
4
  import { addVitePlugin, addWebpackPlugin, defineNuxtModule } from "@nuxt/kit";
5
5
 
6
6
  //#region src/nuxt.ts
package/dist/rollup.d.ts CHANGED
@@ -1,7 +1,7 @@
1
1
  import { Options } from "./types-BVbGtSvv.js";
2
- import * as rollup1 from "rollup";
2
+ import * as rollup0 from "rollup";
3
3
 
4
4
  //#region src/rollup.d.ts
5
- declare const _default: (options?: Options | undefined) => rollup1.Plugin<any> | rollup1.Plugin<any>[];
5
+ declare const _default: (options?: Options | undefined) => rollup0.Plugin<any> | rollup0.Plugin<any>[];
6
6
  //#endregion
7
7
  export { _default as default };
package/dist/rollup.js CHANGED
@@ -1,4 +1,4 @@
1
- import { unpluginFactory } from "./src-CskmyrvV.js";
1
+ import { unpluginFactory } from "./src-DyBB0CwK.js";
2
2
  import { createRollupPlugin } from "unplugin";
3
3
 
4
4
  //#region src/rollup.ts
package/dist/rspack.js CHANGED
@@ -1,4 +1,4 @@
1
- import { unpluginFactory } from "./src-CskmyrvV.js";
1
+ import { unpluginFactory } from "./src-DyBB0CwK.js";
2
2
  import { createRspackPlugin } from "unplugin";
3
3
 
4
4
  //#region src/rspack.ts
@@ -1585,6 +1585,10 @@ function generateInterfaces(opts) {
1585
1585
  ];
1586
1586
  fs.mkdirSync(path.dirname(outputFile), { recursive: true });
1587
1587
  fs.writeFileSync(outputFile, globalLines.join("\n"), "utf-8");
1588
+ return {
1589
+ files: files.length,
1590
+ interfaces: interfaces.flatMap((i) => i.names).length
1591
+ };
1588
1592
  }
1589
1593
 
1590
1594
  //#endregion
@@ -1603,18 +1607,22 @@ function resolveOptions(root, options = {}) {
1603
1607
  //#region src/index.ts
1604
1608
  const unpluginFactory = (userOptions = {}, meta) => {
1605
1609
  const opts = resolveOptions(meta.framework === "vite" ? meta?.vite?.server?.config?.root ?? process.cwd() : process.cwd(), userOptions);
1606
- const generate = () => generateInterfaces(opts);
1607
1610
  return {
1608
1611
  name: "@supsign/unplugin-interfaces",
1609
1612
  buildStart() {
1610
- generate();
1613
+ const result = generateInterfaces(opts);
1614
+ this.info(`Generated ${result.interfaces} interfaces from ${result.files} files`);
1611
1615
  },
1612
1616
  vite: { configureServer(server) {
1613
1617
  const watcher = esm_default.watch(opts.interfaceDir, {
1614
1618
  ignored: (filePath) => filePath.endsWith("index.ts") || filePath.endsWith(".d.ts") || [...opts.excludeFiles].some((f) => filePath.endsWith(f)),
1615
1619
  ignoreInitial: true
1616
1620
  });
1617
- watcher.on("add", generate).on("change", generate).on("unlink", generate);
1621
+ const log = (action) => {
1622
+ const result = generateInterfaces(opts);
1623
+ server.config.logger.info(`${action}: ${result.interfaces} interfaces from ${result.files} files`, { timestamp: true });
1624
+ };
1625
+ watcher.on("add", () => log("Added file, regenerated")).on("change", () => log("Updated file, regenerated")).on("unlink", () => log("Removed file, regenerated"));
1618
1626
  server.watcher.on("close", () => watcher.close());
1619
1627
  } },
1620
1628
  transformInclude(id) {
@@ -1,4 +1,4 @@
1
- import { unpluginFactory } from "./src-CskmyrvV.js";
1
+ import { unpluginFactory } from "./src-DyBB0CwK.js";
2
2
  import { createVitePlugin } from "unplugin";
3
3
 
4
4
  //#region src/vite.ts
package/dist/vite.d.ts CHANGED
@@ -1,7 +1,7 @@
1
1
  import { Options } from "./types-BVbGtSvv.js";
2
- import * as vite1 from "vite";
2
+ import * as vite0 from "vite";
3
3
 
4
4
  //#region src/vite.d.ts
5
- declare const _default: (options?: Options | undefined) => vite1.Plugin<any> | vite1.Plugin<any>[];
5
+ declare const _default: (options?: Options | undefined) => vite0.Plugin<any> | vite0.Plugin<any>[];
6
6
  //#endregion
7
7
  export { _default as default };
package/dist/vite.js CHANGED
@@ -1,4 +1,4 @@
1
- import "./src-CskmyrvV.js";
2
- import { vite_default } from "./vite-B3qRJmDz.js";
1
+ import "./src-DyBB0CwK.js";
2
+ import { vite_default } from "./vite-Bc6kO4Bd.js";
3
3
 
4
4
  export { vite_default as default };
@@ -1,4 +1,4 @@
1
- import { unpluginFactory } from "./src-CskmyrvV.js";
1
+ import { unpluginFactory } from "./src-DyBB0CwK.js";
2
2
  import { createWebpackPlugin } from "unplugin";
3
3
 
4
4
  //#region src/webpack.ts
package/dist/webpack.js CHANGED
@@ -1,4 +1,4 @@
1
- import "./src-CskmyrvV.js";
2
- import { webpack_default } from "./webpack-Do7Ul9CV.js";
1
+ import "./src-DyBB0CwK.js";
2
+ import { webpack_default } from "./webpack-7x38_B5C.js";
3
3
 
4
4
  export { webpack_default as default };
package/package.json CHANGED
@@ -1,8 +1,7 @@
1
1
  {
2
2
  "name": "@supsign/unplugin-interfaces",
3
3
  "type": "module",
4
- "version": "0.1.0",
5
- "packageManager": "pnpm@10.18.3",
4
+ "version": "0.1.1",
6
5
  "description": "",
7
6
  "license": "MIT",
8
7
  "homepage": "https://github.com/supsign/unplugin-interfaces#readme",
@@ -47,16 +46,6 @@
47
46
  "files": [
48
47
  "dist"
49
48
  ],
50
- "scripts": {
51
- "build": "tsdown",
52
- "dev": "tsdown -w",
53
- "lint": "eslint .",
54
- "play": "npm -C playground run dev",
55
- "prepublishOnly": "npm run build",
56
- "release": "bumpp && pnpm publish",
57
- "start": "tsx src/index.ts",
58
- "test": "vitest"
59
- },
60
49
  "peerDependencies": {
61
50
  "@farmfe/core": ">=1",
62
51
  "@nuxt/kit": "^3",
@@ -108,5 +97,14 @@
108
97
  "vite": "^6.4.0",
109
98
  "vitest": "^3.2.4",
110
99
  "webpack": "^5.102.1"
100
+ },
101
+ "scripts": {
102
+ "build": "tsdown",
103
+ "dev": "tsdown -w",
104
+ "lint": "eslint .",
105
+ "play": "npm -C playground run dev",
106
+ "release": "bumpp && pnpm publish",
107
+ "start": "tsx src/index.ts",
108
+ "test": "vitest"
111
109
  }
112
- }
110
+ }