@silgi/module-builder 0.8.2 → 0.8.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.
@@ -5,7 +5,6 @@ import { promises } from "node:fs";
5
5
  import { join } from "node:path";
6
6
  import { pathToFileURL } from "node:url";
7
7
  import { createJiti } from "jiti";
8
- import "mlly";
9
8
  import { resolve } from "pathe";
10
9
  import { readPackageJSON } from "pkg-types";
11
10
  import { pkgDir } from "silgi/runtime/meta";
@@ -64,6 +63,32 @@ var build_default = defineCommand({
64
63
  target: "esnext",
65
64
  dts: true,
66
65
  unbundle: true,
66
+ plugins: [{
67
+ name: "graphql",
68
+ transform: async (code, id) => {
69
+ if (id.endsWith(".graphql")) {
70
+ try {
71
+ const fs = await import("node:fs/promises");
72
+ const path = await import("node:path");
73
+ const outDir$1 = "dist";
74
+ const cwd$1 = process.cwd();
75
+ let relPath = id;
76
+ if (path.isAbsolute(id)) relPath = path.relative(cwd$1, id);
77
+ if (relPath.startsWith(`src${path.sep}`)) relPath = relPath.slice(4);
78
+ const outPath = path.join(outDir$1, relPath);
79
+ await fs.mkdir(path.dirname(outPath), { recursive: true });
80
+ await fs.writeFile(outPath, code);
81
+ } catch (e) {
82
+ console.warn("[graphql plugin] .graphql dosyası kopyalanamadı:", id, e);
83
+ }
84
+ return {
85
+ code: "",
86
+ map: null
87
+ };
88
+ }
89
+ return null;
90
+ }
91
+ }],
67
92
  external: [
68
93
  /dist[\\/]runtime[\\/]/,
69
94
  "silgi",
@@ -89,12 +114,12 @@ var build_default = defineCommand({
89
114
  const _exports = await scanExports(moduleRawPath, true);
90
115
  const cleanedExports = _exports.map(({ from,...rest }) => rest);
91
116
  moduleMeta.exports = cleanedExports;
92
- if (ctx.pkg) {
93
- if (!moduleMeta.name) moduleMeta.name = ctx.pkg.name;
94
- if (!moduleMeta.version) moduleMeta.version = ctx.pkg.version;
117
+ if (ctx.options.pkg) {
118
+ if (!moduleMeta.name) moduleMeta.name = ctx.options.pkg.name;
119
+ if (!moduleMeta.version) moduleMeta.version = ctx.options.pkg.version;
95
120
  }
96
- moduleMeta._packageName = ctx.pkg?.name;
97
- if (ctx.pkg?.modules) moduleMeta._modules = ctx.pkg?.configmodules;
121
+ moduleMeta._packageName = ctx.options.pkg?.name;
122
+ if (ctx.options.pkg?.modules) moduleMeta._modules = ctx.options.pkg?.configmodules;
98
123
  moduleMeta.builder = {
99
124
  [name]: version,
100
125
  unbuild: await readPackageJSON("unbuild").then((r) => r.version).catch(() => "unknown")
package/dist/package.mjs CHANGED
@@ -1,6 +1,6 @@
1
1
  //#region package.json
2
2
  var name = "@silgi/module-builder";
3
- var version = "0.8.2";
3
+ var version = "0.8.4";
4
4
  var description = "Complete solution for building Silgi modules";
5
5
 
6
6
  //#endregion
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@silgi/module-builder",
3
3
  "type": "module",
4
- "version": "0.8.2",
4
+ "version": "0.8.4",
5
5
  "private": false,
6
6
  "description": "Complete solution for building Silgi modules",
7
7
  "exports": {
@@ -19,7 +19,6 @@
19
19
  "consola": "^3.4.2",
20
20
  "defu": "^6.1.4",
21
21
  "jiti": "^2.4.2",
22
- "mlly": "^1.7.4",
23
22
  "pathe": "^2.0.3",
24
23
  "pkg-types": "^2.1.0",
25
24
  "silgi": "^0.41.40",