@contractspec/lib.exporter 3.7.6 → 3.7.9

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.
Files changed (2) hide show
  1. package/README.md +33 -51
  2. package/package.json +5 -5
package/README.md CHANGED
@@ -1,74 +1,56 @@
1
1
  # @contractspec/lib.exporter
2
2
 
3
- Website: https://contractspec.io/
3
+ Website: https://contractspec.io
4
4
 
5
+ **Generic CSV and XML exporters usable across web and mobile.**
5
6
 
6
- Platform-agnostic utilities for exporting data to CSV and XML formats.
7
+ ## What It Provides
7
8
 
8
- ## Purpose
9
-
10
- To provide a lightweight, dependency-free way to generate CSV and XML files on both the server (Node.js/Bun) and client (Browser/React Native).
9
+ - **Layer**: lib.
10
+ - **Consumers**: bundles.
11
+ - Related ContractSpec packages include `@contractspec/tool.bun`, `@contractspec/tool.typescript`.
12
+ - Related ContractSpec packages include `@contractspec/tool.bun`, `@contractspec/tool.typescript`.
11
13
 
12
14
  ## Installation
13
15
 
14
- ```bash
15
- npm install @contractspec/lib.exporter
16
- # or
17
- bun add @contractspec/lib.exporter
18
- ```
16
+ `npm install @contractspec/lib.exporter`
19
17
 
20
- ## Key Concepts
18
+ or
21
19
 
22
- - **Universal**: Works in any JS environment.
23
- - **Streaming-friendly**: Designed to handle data chunks (conceptually), though current implementation might be synchronous.
20
+ `bun add @contractspec/lib.exporter`
24
21
 
25
22
  ## Usage
26
23
 
27
- ```ts
28
- import { toCSV, toXML } from '@contractspec/lib.exporter';
29
-
30
- const data = [
31
- { id: 1, name: 'Alice' },
32
- { id: 2, name: 'Bob' },
33
- ];
34
-
35
- // Generate CSV string
36
- const csv = toCSV(data);
37
-
38
- // Generate XML string
39
- const xml = toXML(data, { rootName: 'Users', itemName: 'User' });
40
- ```
41
-
42
-
43
-
44
-
45
-
46
-
47
-
48
-
49
-
50
-
51
-
52
-
53
-
54
-
55
-
56
-
57
-
58
-
59
-
60
-
61
-
62
-
63
-
64
-
24
+ Import the root entrypoint from `@contractspec/lib.exporter`, or choose a documented subpath when you only need one part of the package surface.
65
25
 
26
+ ## Architecture
66
27
 
28
+ - `src/index.ts` is the root public barrel and package entrypoint.
67
29
 
30
+ ## Public Entry Points
68
31
 
32
+ - Export `.` resolves through `./src/index.ts`.
69
33
 
34
+ ## Local Commands
70
35
 
36
+ - `bun run dev` — contractspec-bun-build dev
37
+ - `bun run build` — bun run prebuild && bun run build:bundle && bun run build:types
38
+ - `bun run lint` — bun lint:fix
39
+ - `bun run lint:check` — biome check .
40
+ - `bun run lint:fix` — biome check --write --unsafe --only=nursery/useSortedClasses . && biome check --write .
41
+ - `bun run typecheck` — tsc --noEmit
42
+ - `bun run publish:pkg` — bun publish --tolerate-republish --ignore-scripts --verbose
43
+ - `bun run publish:pkg:canary` — bun publish:pkg --tag canary
44
+ - `bun run clean` — rimraf dist .turbo
45
+ - `bun run build:bundle` — contractspec-bun-build transpile
46
+ - `bun run build:types` — contractspec-bun-build types
47
+ - `bun run prebuild` — contractspec-bun-build prebuild
71
48
 
49
+ ## Recent Updates
72
50
 
51
+ - Replace eslint+prettier by biomejs to optimize speed.
73
52
 
53
+ ## Notes
74
54
 
55
+ - Export format must stay consistent for downstream consumers; column order and encoding are part of the contract.
56
+ - Do not introduce platform-specific APIs (Node-only or browser-only) without a universal fallback.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@contractspec/lib.exporter",
3
- "version": "3.7.6",
3
+ "version": "3.7.9",
4
4
  "description": "Generic CSV and XML exporters usable across web and mobile.",
5
5
  "keywords": [
6
6
  "contractspec",
@@ -20,15 +20,15 @@
20
20
  "dev": "contractspec-bun-build dev",
21
21
  "clean": "rimraf dist .turbo",
22
22
  "lint": "bun lint:fix",
23
- "lint:fix": "eslint src --fix",
24
- "lint:check": "eslint src",
23
+ "lint:fix": "biome check --write --unsafe --only=nursery/useSortedClasses . && biome check --write .",
24
+ "lint:check": "biome check .",
25
25
  "prebuild": "contractspec-bun-build prebuild",
26
26
  "typecheck": "tsc --noEmit"
27
27
  },
28
28
  "devDependencies": {
29
- "@contractspec/tool.typescript": "3.7.6",
29
+ "@contractspec/tool.typescript": "3.7.9",
30
30
  "typescript": "^5.9.3",
31
- "@contractspec/tool.bun": "3.7.6"
31
+ "@contractspec/tool.bun": "3.7.9"
32
32
  },
33
33
  "types": "./dist/index.d.ts",
34
34
  "files": [