@ruvyxa/adapter-bun 1.0.2 → 1.0.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.
package/dist/index.d.ts CHANGED
@@ -1,7 +1,27 @@
1
1
  import type { Adapter } from "@ruvyxa/core";
2
+ /**
3
+ * Options for the Bun adapter.
4
+ */
2
5
  export interface BunAdapterOptions {
6
+ /** Custom entry point path. Defaults to `${outDir}/server/app`. */
3
7
  entry?: string;
4
8
  }
9
+ /**
10
+ * Create a Bun runtime deployment adapter for Ruvyxa.
11
+ *
12
+ * Produces a Bun-optimized server bundle that takes advantage of Bun's
13
+ * native performance features. Deploys to any Bun-compatible hosting.
14
+ *
15
+ * @example
16
+ * ```ts
17
+ * import { defineConfig } from "ruvyxa/config"
18
+ * import { bunAdapter } from "@ruvyxa/adapter-bun"
19
+ *
20
+ * export default defineConfig({
21
+ * adapter: bunAdapter({ entry: "./bun-entry.ts" })
22
+ * })
23
+ * ```
24
+ */
5
25
  export declare function bunAdapter(options?: BunAdapterOptions): Adapter;
6
26
  export default bunAdapter;
7
27
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAA+B,MAAM,cAAc,CAAA;AAExE,MAAM,WAAW,iBAAiB;IAChC,KAAK,CAAC,EAAE,MAAM,CAAA;CACf;AAED,wBAAgB,UAAU,CAAC,OAAO,GAAE,iBAAsB,GAAG,OAAO,CAcnE;AAED,eAAe,UAAU,CAAA"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAA+B,MAAM,cAAc,CAAA;AAExE;;GAEG;AACH,MAAM,WAAW,iBAAiB;IAChC,mEAAmE;IACnE,KAAK,CAAC,EAAE,MAAM,CAAA;CACf;AAED;;;;;;;;;;;;;;;GAeG;AACH,wBAAgB,UAAU,CAAC,OAAO,GAAE,iBAAsB,GAAG,OAAO,CA2BnE;AAED,eAAe,UAAU,CAAA"}
package/dist/index.js CHANGED
@@ -1,8 +1,31 @@
1
+ /**
2
+ * Create a Bun runtime deployment adapter for Ruvyxa.
3
+ *
4
+ * Produces a Bun-optimized server bundle that takes advantage of Bun's
5
+ * native performance features. Deploys to any Bun-compatible hosting.
6
+ *
7
+ * @example
8
+ * ```ts
9
+ * import { defineConfig } from "ruvyxa/config"
10
+ * import { bunAdapter } from "@ruvyxa/adapter-bun"
11
+ *
12
+ * export default defineConfig({
13
+ * adapter: bunAdapter({ entry: "./bun-entry.ts" })
14
+ * })
15
+ * ```
16
+ */
1
17
  export function bunAdapter(options = {}) {
18
+ if (options.entry !== undefined && typeof options.entry !== "string") {
19
+ throw new Error(`[RUV2001] bunAdapter: "entry" must be a string, got ${typeof options.entry}`);
20
+ }
21
+ if (options.entry !== undefined && options.entry.trim() === "") {
22
+ throw new Error(`[RUV2001] bunAdapter: "entry" must not be an empty string`);
23
+ }
2
24
  return {
3
25
  name: "bun",
4
26
  target: "node",
5
27
  build(ctx) {
28
+ validateBuildContext(ctx, "bunAdapter");
6
29
  return {
7
30
  name: "bun",
8
31
  target: "node",
@@ -14,4 +37,12 @@ export function bunAdapter(options = {}) {
14
37
  };
15
38
  }
16
39
  export default bunAdapter;
40
+ function validateBuildContext(ctx, adapterName) {
41
+ if (!ctx.root || typeof ctx.root !== "string") {
42
+ throw new Error(`[RUV2000] ${adapterName}: BuildContext.root is required and must be a non-empty string`);
43
+ }
44
+ if (!ctx.outDir || typeof ctx.outDir !== "string") {
45
+ throw new Error(`[RUV2000] ${adapterName}: BuildContext.outDir is required and must be a non-empty string`);
46
+ }
47
+ }
17
48
  //# sourceMappingURL=index.js.map
package/dist/index.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAMA,MAAM,UA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,CAAC;KACF,CAAA;AACH,CAAC;AAED,eAAe,UAAU,CAAA;AAEzB,SAAS,oBAAoB,CAAC,GAAiB,EAAE,WAAmB;IAClE,IAAI,CAAC,GAAG,CAAC,IAAI,IAAI,OAAO,GAAG,CAAC,IAAI,KAAK,QAAQ,EAAE,CAAC;QAC9C,MAAM,IAAI,KAAK,CACb,aAAa,WAAW,gEAAgE,CACzF,CAAA;IACH,CAAC;IACD,IAAI,CAAC,GAAG,CAAC,MAAM,IAAI,OAAO,GAAG,CAAC,MAAM,KAAK,QAAQ,EAAE,CAAC;QAClD,MAAM,IAAI,KAAK,CACb,aAAa,WAAW,kEAAkE,CAC3F,CAAA;IACH,CAAC;AACH,CAAC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ruvyxa/adapter-bun",
3
- "version": "1.0.2",
3
+ "version": "1.0.4",
4
4
  "description": "Run Ruvyxa on Bun-flavored hosts with typed adapter metadata for entrypoints and assets.",
5
5
  "license": "MIT",
6
6
  "type": "module",
@@ -38,12 +38,12 @@
38
38
  }
39
39
  },
40
40
  "dependencies": {
41
- "@ruvyxa/core": "^1.0.2"
41
+ "@ruvyxa/core": "^1.0.4"
42
42
  },
43
43
  "scripts": {
44
44
  "build": "tsc -p tsconfig.json",
45
45
  "check": "tsc -p tsconfig.json --noEmit",
46
- "test": "vitest run",
46
+ "test": "node --test \"../../../tests/packages/adapter-bun/**/*.test.ts\"",
47
47
  "format": "tsc -p tsconfig.json --noEmit"
48
48
  }
49
49
  }