@fragno-dev/node 0.0.6 → 0.0.8

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.
@@ -1,8 +1,11 @@
1
- $ tsdown
2
- ℹ tsdown v0.15.6 powered by rolldown v1.0.0-beta.41
1
+
2
+ > @fragno-dev/node@0.0.8 build /home/runner/work/fragno/fragno/packages/fragno-node
3
+ > tsdown
4
+
5
+ ℹ tsdown v0.15.12 powered by rolldown v1.0.0-beta.45
3
6
  ℹ Using tsdown config: /home/runner/work/fragno/fragno/packages/fragno-node/tsdown.config.ts
4
7
  ℹ entry: fragno-node.ts
5
- ℹ target: node20.0.0
8
+ ℹ target: node22.0.0
6
9
  ℹ tsconfig: tsconfig.json
7
10
  ℹ Build start
8
11
  ℹ dist/fragno-node.js 1.37 kB │ gzip: 0.50 kB
@@ -10,4 +13,4 @@ $ tsdown
10
13
  ℹ dist/fragno-node.d.ts.map 0.20 kB │ gzip: 0.14 kB
11
14
  ℹ dist/fragno-node.d.ts 1.40 kB │ gzip: 0.50 kB
12
15
  ℹ 4 files, total: 4.64 kB
13
- ✔ Build complete in 5147ms
16
+ ✔ Build complete in 5597ms
package/CHANGELOG.md CHANGED
@@ -1,5 +1,19 @@
1
1
  # @fragno-dev/node
2
2
 
3
+ ## 0.0.8
4
+
5
+ ### Patch Changes
6
+
7
+ - 5ea24d2: refactor: improve Fragment builder and instatiator
8
+
9
+ ## 0.0.7
10
+
11
+ ### Patch Changes
12
+
13
+ - Updated dependencies [1fa71f3]
14
+ - Updated dependencies [c1483c6]
15
+ - @fragno-dev/core@0.0.7
16
+
3
17
  ## 0.0.6
4
18
 
5
19
  ### Patch Changes
package/LICENSE.md ADDED
@@ -0,0 +1,16 @@
1
+ Copyright 2025 - present "ReJot Nederland B.V.", and individual contributors.
2
+
3
+ Permission is hereby granted, free of charge, to any person obtaining a copy of this software and
4
+ associated documentation files (the “Software”), to deal in the Software without restriction,
5
+ including without limitation the rights to use, copy, modify, merge, publish, distribute,
6
+ sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is
7
+ furnished to do so, subject to the following conditions:
8
+
9
+ The above copyright notice and this permission notice shall be included in all copies or substantial
10
+ portions of the Software.
11
+
12
+ THE SOFTWARE IS PROVIDED “AS IS”, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT
13
+ NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
14
+ NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES
15
+ OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
16
+ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
@@ -1,13 +1,8 @@
1
1
  import express, { type Application } from "express";
2
2
  import { test, expect, describe, beforeAll, afterAll } from "vitest";
3
3
  import { z } from "zod";
4
- import {
5
- defineFragment,
6
- defineRoute,
7
- createFragment,
8
- type FragnoInstantiatedFragment,
9
- type FragnoPublicClientConfig,
10
- } from "@fragno-dev/core";
4
+ import { defineFragment, defineRoute, instantiate } from "@fragno-dev/core";
5
+ import { type FragnoPublicClientConfig } from "@fragno-dev/core/client";
11
6
  import { toNodeHandler } from "./fragno-node";
12
7
 
13
8
  describe("Fragno Express integration", () => {
@@ -23,13 +18,21 @@ describe("Fragno Express integration", () => {
23
18
  const clientConfig: FragnoPublicClientConfig = {
24
19
  baseUrl: "http://localhost",
25
20
  };
26
- let testFragment: FragnoInstantiatedFragment<[typeof usersRoute]>;
21
+
22
+ function instantiateTestFragment() {
23
+ return instantiate(testFragmentDefinition)
24
+ .withRoutes([usersRoute])
25
+ .withOptions(clientConfig)
26
+ .build();
27
+ }
28
+
29
+ let testFragment: ReturnType<typeof instantiateTestFragment>;
27
30
  let app: Application;
28
31
  let server: ReturnType<typeof app.listen>;
29
32
  let port: number;
30
33
 
31
34
  function createExpressServerForTest() {
32
- testFragment = createFragment(testFragmentDefinition, {}, [usersRoute], clientConfig);
35
+ testFragment = instantiateTestFragment();
33
36
  app = express();
34
37
 
35
38
  app.all("/api/test-fragment/{*any}", toNodeHandler(testFragment.handler));
@@ -1,13 +1,8 @@
1
1
  import { createServer, type RequestListener, type Server } from "node:http";
2
2
  import { test, expect, describe } from "vitest";
3
3
  import { z } from "zod";
4
- import {
5
- defineFragment,
6
- defineRoute,
7
- createFragment,
8
- type FragnoInstantiatedFragment,
9
- type FragnoPublicClientConfig,
10
- } from "@fragno-dev/core";
4
+ import { defineFragment, defineRoute, instantiate } from "@fragno-dev/core";
5
+ import { type FragnoPublicClientConfig } from "@fragno-dev/core/client";
11
6
  import { toNodeHandler } from "./fragno-node";
12
7
 
13
8
  describe("Fragno Node.js integration", () => {
@@ -23,14 +18,22 @@ describe("Fragno Node.js integration", () => {
23
18
  const clientConfig: FragnoPublicClientConfig = {
24
19
  baseUrl: "http://localhost",
25
20
  };
26
- let testFragment: FragnoInstantiatedFragment<[typeof usersRoute]>;
21
+
22
+ function instantiateTestFragment() {
23
+ return instantiate(testFragmentDefinition)
24
+ .withRoutes([usersRoute])
25
+ .withOptions(clientConfig)
26
+ .build();
27
+ }
28
+
29
+ let testFragment: ReturnType<typeof instantiateTestFragment>;
27
30
  let server: Server;
28
31
  let port: number;
29
32
 
30
33
  function createServerForTest(
31
- listenerFactory: (fragment: FragnoInstantiatedFragment<[typeof usersRoute]>) => RequestListener,
34
+ listenerFactory: (fragment: ReturnType<typeof instantiateTestFragment>) => RequestListener,
32
35
  ) {
33
- testFragment = createFragment(testFragmentDefinition, {}, [usersRoute], clientConfig);
36
+ testFragment = instantiateTestFragment();
34
37
  server = createServer(listenerFactory(testFragment));
35
38
  server.listen(0);
36
39
 
@@ -1,13 +1,8 @@
1
1
  import express, { type Application } from "express";
2
2
  import { test, expect, describe, beforeAll, afterAll, assert } from "vitest";
3
3
  import { z } from "zod";
4
- import {
5
- defineFragment,
6
- defineRoute,
7
- createFragment,
8
- type FragnoInstantiatedFragment,
9
- type FragnoPublicClientConfig,
10
- } from "@fragno-dev/core";
4
+ import { defineFragment, defineRoute, instantiate } from "@fragno-dev/core";
5
+ import { type FragnoPublicClientConfig } from "@fragno-dev/core/client";
11
6
  import { toNodeHandler } from "./fragno-node";
12
7
 
13
8
  describe("Node.js Streaming", () => {
@@ -29,13 +24,21 @@ describe("Node.js Streaming", () => {
29
24
  const clientConfig: FragnoPublicClientConfig = {
30
25
  baseUrl: "http://localhost",
31
26
  };
32
- let testFragment: FragnoInstantiatedFragment<[typeof streamRoute]>;
27
+
28
+ function instantiateTestFragment() {
29
+ return instantiate(testFragmentDefinition)
30
+ .withRoutes([streamRoute])
31
+ .withOptions(clientConfig)
32
+ .build();
33
+ }
34
+
35
+ let testFragment: ReturnType<typeof instantiateTestFragment>;
33
36
  let app: Application;
34
37
  let server: ReturnType<typeof app.listen>;
35
38
  let port: number;
36
39
 
37
40
  function createExpressServerForTest() {
38
- testFragment = createFragment(testFragmentDefinition, {}, [streamRoute], clientConfig);
41
+ testFragment = instantiateTestFragment();
39
42
  app = express();
40
43
 
41
44
  app.all("/api/test-fragment/{*any}", toNodeHandler(testFragment.handler));
package/package.json CHANGED
@@ -1,9 +1,8 @@
1
1
  {
2
2
  "name": "@fragno-dev/node",
3
- "version": "0.0.6",
3
+ "version": "0.0.8",
4
4
  "exports": {
5
5
  ".": {
6
- "bun": "./fragno-node.ts",
7
6
  "development": "./fragno-node.ts",
8
7
  "types": "./dist/fragno-node.d.ts",
9
8
  "default": "./dist/fragno-node.js"
@@ -11,29 +10,38 @@
11
10
  "./package.json": "./package.json"
12
11
  },
13
12
  "type": "module",
14
- "scripts": {
15
- "build": "tsdown",
16
- "build:watch": "tsdown --watch",
17
- "types:check": "tsc --noEmit"
18
- },
19
- "peerDependencies": {
20
- "@fragno-dev/core": "0.0.6"
21
- },
22
13
  "engines": {
23
- "node": "^20.0.0 || >=22.0.0"
14
+ "node": ">=22"
24
15
  },
25
16
  "devDependencies": {
26
- "@fragno-dev/core": "0.0.6",
27
- "@fragno-private/typescript-config": "0.0.1",
28
17
  "@types/node": "^22",
29
18
  "@types/express": "^5.0.3",
19
+ "@vitest/coverage-istanbul": "^3.2.4",
30
20
  "express": "^5.1.0",
31
- "zod": "^4.0.5"
21
+ "vitest": "^3.2.4",
22
+ "zod": "^4.0.5",
23
+ "@fragno-dev/core": "0.1.9",
24
+ "@fragno-private/typescript-config": "0.0.1",
25
+ "@fragno-private/vitest-config": "0.0.0"
32
26
  },
33
27
  "dependencies": {
34
28
  "@remix-run/node-fetch-server": "^0.8.0"
35
29
  },
36
30
  "main": "./dist/fragno-node.js",
37
31
  "module": "./dist/fragno-node.js",
38
- "types": "./dist/fragno-node.d.ts"
39
- }
32
+ "types": "./dist/fragno-node.d.ts",
33
+ "repository": {
34
+ "type": "git",
35
+ "url": "https://github.com/rejot-dev/fragno.git",
36
+ "directory": "packages/fragno-node"
37
+ },
38
+ "homepage": "https://fragno.dev",
39
+ "license": "MIT",
40
+ "scripts": {
41
+ "build": "tsdown",
42
+ "build:watch": "tsdown --watch",
43
+ "types:check": "tsc --noEmit",
44
+ "test": "vitest run",
45
+ "test:watch": "vitest --watch"
46
+ }
47
+ }
package/vitest.config.ts CHANGED
@@ -1,3 +1,4 @@
1
1
  import { defineConfig } from "vitest/config";
2
+ import { baseConfig } from "@fragno-private/vitest-config";
2
3
 
3
- export default defineConfig({});
4
+ export default defineConfig(baseConfig);
@@ -1 +0,0 @@
1
- $ tsc --noEmit