unplugin-saykit 0.1.0 → 0.3.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/README.md CHANGED
@@ -2,6 +2,8 @@
2
2
 
3
3
  > Universal build-tool plugin for [SayKit](https://saykit.js.org).
4
4
 
5
+ [![Coverage](https://codecov.io/gh/k0d13/saykit/graph/badge.svg?flag=plugin-unplugin)](https://codecov.io/gh/k0d13/saykit?flags%5B0%5D=plugin-unplugin)
6
+
5
7
  Works with Vite, Rollup, Rolldown, Webpack, Rspack, esbuild, Farm, and Bun via [unplugin](https://github.com/unjs/unplugin).
6
8
 
7
9
  ## Install
package/dist/bun.mjs CHANGED
@@ -1,4 +1,4 @@
1
- import src_default from "./index.mjs";
1
+ import { t as src_default } from "./src-B4Rsypvw.mjs";
2
2
  //#region src/bun.ts
3
3
  var bun_default = src_default.bun;
4
4
  //#endregion
package/dist/esbuild.mjs CHANGED
@@ -1,4 +1,4 @@
1
- import src_default from "./index.mjs";
1
+ import { t as src_default } from "./src-B4Rsypvw.mjs";
2
2
  //#region src/esbuild.ts
3
3
  var esbuild_default = src_default.esbuild;
4
4
  //#endregion
package/dist/farm.mjs CHANGED
@@ -1,4 +1,4 @@
1
- import src_default from "./index.mjs";
1
+ import { t as src_default } from "./src-B4Rsypvw.mjs";
2
2
  //#region src/farm.ts
3
3
  var farm_default = src_default.farm;
4
4
  //#endregion
package/dist/index.mjs CHANGED
@@ -1,33 +1,2 @@
1
- import { readFile } from "node:fs/promises";
2
- import { relative } from "node:path";
3
- import { resolveConfig } from "@saykit/config/features/loader";
4
- import { generateHash } from "@saykit/config/features/messages";
5
- import { createUnplugin } from "unplugin";
6
- //#region src/index.ts
7
- var src_default = createUnplugin((_options) => {
8
- const config = resolveConfig();
9
- return {
10
- name: "saykit",
11
- enforce: "pre",
12
- transform: {
13
- filter: { id: { exclude: /node_modules/ } },
14
- handler: (code, id_) => {
15
- const id = relative(process.cwd(), id_).replaceAll("\\", "/").split("?")[0];
16
- return config.buckets.find((b) => b.match(id))?.transformer.transform(code, id) ?? code;
17
- }
18
- },
19
- load: {
20
- filter: { id: { exclude: /node_modules/ } },
21
- handler: async (id_) => {
22
- const id = relative(process.cwd(), id_).replaceAll("\\", "/").split("?")[0];
23
- const bucket = config.buckets.find((b) => b.output.match(id));
24
- if (!bucket) return;
25
- const content = await readFile(id, "utf8");
26
- const entries = bucket.formatter.parse(content).map((m) => [m.id || generateHash(m.message, m.context), m.translation || m.message]);
27
- return `export default ${JSON.stringify(Object.fromEntries(entries))}`;
28
- }
29
- }
30
- };
31
- });
32
- //#endregion
1
+ import { t as src_default } from "./src-B4Rsypvw.mjs";
33
2
  export { src_default as default };
@@ -0,0 +1 @@
1
+ export { };