@rljson/io 0.0.1

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/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2025 Rljson
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
@@ -0,0 +1 @@
1
+ # Architecture
package/README.blog.md ADDED
@@ -0,0 +1,3 @@
1
+ # Blog
2
+
3
+ Add latest posts at the end.
@@ -0,0 +1,143 @@
1
+ # Contributors
2
+
3
+ ## Important
4
+
5
+ ⚠️ IMPORTANT: On `Windows, please checkout the repo on drive C`.
6
+ There is a bug in the Vscode vitest extension v 1.14.4, making debugging tests
7
+ not work. <https://github.com/vitest-dev/vscode/issues/548>
8
+ Please check from time to time, if the issue is fixed and remove this hint.
9
+
10
+ ## Report issues
11
+
12
+ Visit <https://github.com/rljson/io/issues>
13
+
14
+ Check if there is already an issue for your problem
15
+
16
+ If no, report the issue
17
+
18
+ ## Check out
19
+
20
+ ```bash
21
+ mkdir rljson
22
+ cd rljson
23
+ git clone https://github.com/rljson/io.git
24
+ cd io
25
+ ```
26
+
27
+ ## Install pnpm
28
+
29
+ Windows:
30
+
31
+ ```bash
32
+ corepack enable pnpm
33
+ ```
34
+
35
+ Mac:
36
+
37
+ ```bash
38
+ sudo corepack enable pnpm
39
+ ```
40
+
41
+ ## Install dependencies
42
+
43
+ ```bash
44
+ pnpm install
45
+ ```
46
+
47
+ ## Run the tests
48
+
49
+ ```bash
50
+ pnpm run test
51
+ ```
52
+
53
+ ## Build the package
54
+
55
+ ```bash
56
+ pnpm run build
57
+ ```
58
+
59
+ ## Publish the package
60
+
61
+ Open `package.json`.
62
+
63
+ Increase `version`.
64
+
65
+ Compile typescript:
66
+
67
+ ```bash
68
+ pnpm run build
69
+ ```
70
+
71
+ Make publish dry-run
72
+
73
+ ```bash
74
+ pnpm publish --access=public --dry-run
75
+ ```
76
+
77
+ Check the changes to uploaded
78
+
79
+ Publish the package
80
+
81
+ ```bash
82
+ pnpm publish --access=public
83
+ ```
84
+
85
+ ## Architecture
86
+
87
+ Reade [README.architecture.md](./README.architecture.md) to get an overview
88
+ of the package's architecture.
89
+
90
+ ## Install Vscode extensions
91
+
92
+ Open this project in `vscode`.
93
+
94
+ Press `Cmd+Shift+P`.
95
+
96
+ Type `Extensions: Show Recommended Extensions` and press `Enter`.
97
+
98
+ The recommended extensions will be shown.
99
+
100
+ Make sure, all recommended extensions are shown.
101
+
102
+ ## Uninstall all test extensions, e.g. Jest or Jasmine
103
+
104
+ Jest or Jasmine extensions conflict with the `Vitest` extension used for this
105
+ project.
106
+
107
+ Uninstall them, if you have installed them.
108
+
109
+ ## Debug tests
110
+
111
+ In Vscode: At the `left side bar` click on the `Test tube` icon to open the `Test explorer`.
112
+
113
+ At the `top`, click on the `refresh` icon to show update the tests.
114
+
115
+ Open a test file (`*.spec.ts`)
116
+
117
+ Set a breakpoint.
118
+
119
+ Press `alt` and click on the play button left beside the test.
120
+
121
+ Execution should stop at the breakpoint.
122
+
123
+ ## Update goldens
124
+
125
+ In various tests we are creating golden files, that are reference files that
126
+ are compared against the files created in the tests.
127
+
128
+ If change is detected, the fest fail.
129
+
130
+ An example is `test/goldens/README.md` which is compared against
131
+ `dist/README.md`.
132
+
133
+ If the changes are desired, update the golden files:
134
+
135
+ Open `update-goldens.ts`
136
+
137
+ Set `export const updateGoldens` to `true`
138
+
139
+ Run tests again.
140
+
141
+ Set `export const updateGoldens` to `false`.
142
+
143
+ Run tests again.
package/README.md ADDED
@@ -0,0 +1,18 @@
1
+ # @rljson/io
2
+
3
+ Low level interface for reading and writing RLJSON data
4
+
5
+ ## Users
6
+
7
+ | File | Purpose |
8
+ | ------------------------------------ | --------------------------- |
9
+ | [README.public.md](README.public.md) | Install and use the package |
10
+
11
+ ## Contributors
12
+
13
+ | File | Purpose |
14
+ | ------------------------------------------------ | ----------------------------- |
15
+ | [README.contributors.md](README.contributors.md) | Run, debug, build and publish |
16
+ | [README.architecture.md](README.architecture.md) | Software architecture guide |
17
+ | [README.trouble.md](README.trouble.md) | Errors & solutions |
18
+ | [README.blog.md](README.blog.md) | Blog |
@@ -0,0 +1,7 @@
1
+ # @rljson/
2
+
3
+ Todo: Add description here
4
+
5
+ ## Example
6
+
7
+ [src/example.ts](src/example.ts)
@@ -0,0 +1,36 @@
1
+ <!--
2
+
3
+ -->
4
+
5
+ # Trouble shooting
6
+
7
+ ## Table of contents <!-- omit in toc -->
8
+
9
+ - [Vscode Windows: Debugging is not working](#vscode-windows-debugging-is-not-working)
10
+ - [GitHub actions: Cannot find module @rollup/rollup-linux-x64-gnu](#github-actions-cannot-find-module-rolluprollup-linux-x64-gnu)
11
+
12
+ ## Vscode Windows: Debugging is not working
13
+
14
+ Date: 2025-03-08
15
+
16
+ ⚠️ IMPORTANT: On Windows, please check out the repo on drive C. There is a bug
17
+ in the VS Code Vitest extension (v1.14.4), which prevents test debugging from
18
+ working: <https://github.com/vitest-dev/vscode/issues/548> Please check from
19
+ time to time if the issue has been fixed and remove this note once it is
20
+ resolved.
21
+
22
+ ## GitHub actions: Cannot find module @rollup/rollup-linux-x64-gnu
23
+
24
+ ⚠️ Error: Cannot find module @rollup/rollup-linux-x64-gnu. npm has a bug related to
25
+ optional dependencies (<https://github.com/npm/cli/issues/4828>). Please try `npm
26
+ i` again after removing both package-lock.json and node_modules directory.
27
+
28
+ Solution:
29
+
30
+ ```bash
31
+ rm -rf node_modules
32
+ rm package-lock.json
33
+ npm install
34
+ ```
35
+
36
+ Then push `package-lock.yaml` again
@@ -0,0 +1 @@
1
+ # Architecture
@@ -0,0 +1,3 @@
1
+ # Blog
2
+
3
+ Add latest posts at the end.
@@ -0,0 +1,143 @@
1
+ # Contributors
2
+
3
+ ## Important
4
+
5
+ ⚠️ IMPORTANT: On `Windows, please checkout the repo on drive C`.
6
+ There is a bug in the Vscode vitest extension v 1.14.4, making debugging tests
7
+ not work. <https://github.com/vitest-dev/vscode/issues/548>
8
+ Please check from time to time, if the issue is fixed and remove this hint.
9
+
10
+ ## Report issues
11
+
12
+ Visit <https://github.com/rljson/io/issues>
13
+
14
+ Check if there is already an issue for your problem
15
+
16
+ If no, report the issue
17
+
18
+ ## Check out
19
+
20
+ ```bash
21
+ mkdir rljson
22
+ cd rljson
23
+ git clone https://github.com/rljson/io.git
24
+ cd io
25
+ ```
26
+
27
+ ## Install pnpm
28
+
29
+ Windows:
30
+
31
+ ```bash
32
+ corepack enable pnpm
33
+ ```
34
+
35
+ Mac:
36
+
37
+ ```bash
38
+ sudo corepack enable pnpm
39
+ ```
40
+
41
+ ## Install dependencies
42
+
43
+ ```bash
44
+ pnpm install
45
+ ```
46
+
47
+ ## Run the tests
48
+
49
+ ```bash
50
+ pnpm run test
51
+ ```
52
+
53
+ ## Build the package
54
+
55
+ ```bash
56
+ pnpm run build
57
+ ```
58
+
59
+ ## Publish the package
60
+
61
+ Open `package.json`.
62
+
63
+ Increase `version`.
64
+
65
+ Compile typescript:
66
+
67
+ ```bash
68
+ pnpm run build
69
+ ```
70
+
71
+ Make publish dry-run
72
+
73
+ ```bash
74
+ pnpm publish --access=public --dry-run
75
+ ```
76
+
77
+ Check the changes to uploaded
78
+
79
+ Publish the package
80
+
81
+ ```bash
82
+ pnpm publish --access=public
83
+ ```
84
+
85
+ ## Architecture
86
+
87
+ Reade [README.architecture.md](./README.architecture.md) to get an overview
88
+ of the package's architecture.
89
+
90
+ ## Install Vscode extensions
91
+
92
+ Open this project in `vscode`.
93
+
94
+ Press `Cmd+Shift+P`.
95
+
96
+ Type `Extensions: Show Recommended Extensions` and press `Enter`.
97
+
98
+ The recommended extensions will be shown.
99
+
100
+ Make sure, all recommended extensions are shown.
101
+
102
+ ## Uninstall all test extensions, e.g. Jest or Jasmine
103
+
104
+ Jest or Jasmine extensions conflict with the `Vitest` extension used for this
105
+ project.
106
+
107
+ Uninstall them, if you have installed them.
108
+
109
+ ## Debug tests
110
+
111
+ In Vscode: At the `left side bar` click on the `Test tube` icon to open the `Test explorer`.
112
+
113
+ At the `top`, click on the `refresh` icon to show update the tests.
114
+
115
+ Open a test file (`*.spec.ts`)
116
+
117
+ Set a breakpoint.
118
+
119
+ Press `alt` and click on the play button left beside the test.
120
+
121
+ Execution should stop at the breakpoint.
122
+
123
+ ## Update goldens
124
+
125
+ In various tests we are creating golden files, that are reference files that
126
+ are compared against the files created in the tests.
127
+
128
+ If change is detected, the fest fail.
129
+
130
+ An example is `test/goldens/README.md` which is compared against
131
+ `dist/README.md`.
132
+
133
+ If the changes are desired, update the golden files:
134
+
135
+ Open `update-goldens.ts`
136
+
137
+ Set `export const updateGoldens` to `true`
138
+
139
+ Run tests again.
140
+
141
+ Set `export const updateGoldens` to `false`.
142
+
143
+ Run tests again.
package/dist/README.md ADDED
@@ -0,0 +1,18 @@
1
+ # @rljson/io
2
+
3
+ Low level interface for reading and writing RLJSON data
4
+
5
+ ## Users
6
+
7
+ | File | Purpose |
8
+ | ------------------------------------ | --------------------------- |
9
+ | [README.public.md](README.public.md) | Install and use the package |
10
+
11
+ ## Contributors
12
+
13
+ | File | Purpose |
14
+ | ------------------------------------------------ | ----------------------------- |
15
+ | [README.contributors.md](README.contributors.md) | Run, debug, build and publish |
16
+ | [README.architecture.md](README.architecture.md) | Software architecture guide |
17
+ | [README.trouble.md](README.trouble.md) | Errors & solutions |
18
+ | [README.blog.md](README.blog.md) | Blog |
@@ -0,0 +1,7 @@
1
+ # @rljson/
2
+
3
+ Todo: Add description here
4
+
5
+ ## Example
6
+
7
+ [src/example.ts](src/example.ts)
@@ -0,0 +1,36 @@
1
+ <!--
2
+
3
+ -->
4
+
5
+ # Trouble shooting
6
+
7
+ ## Table of contents <!-- omit in toc -->
8
+
9
+ - [Vscode Windows: Debugging is not working](#vscode-windows-debugging-is-not-working)
10
+ - [GitHub actions: Cannot find module @rollup/rollup-linux-x64-gnu](#github-actions-cannot-find-module-rolluprollup-linux-x64-gnu)
11
+
12
+ ## Vscode Windows: Debugging is not working
13
+
14
+ Date: 2025-03-08
15
+
16
+ ⚠️ IMPORTANT: On Windows, please check out the repo on drive C. There is a bug
17
+ in the VS Code Vitest extension (v1.14.4), which prevents test debugging from
18
+ working: <https://github.com/vitest-dev/vscode/issues/548> Please check from
19
+ time to time if the issue has been fixed and remove this note once it is
20
+ resolved.
21
+
22
+ ## GitHub actions: Cannot find module @rollup/rollup-linux-x64-gnu
23
+
24
+ ⚠️ Error: Cannot find module @rollup/rollup-linux-x64-gnu. npm has a bug related to
25
+ optional dependencies (<https://github.com/npm/cli/issues/4828>). Please try `npm
26
+ i` again after removing both package-lock.json and node_modules directory.
27
+
28
+ Solution:
29
+
30
+ ```bash
31
+ rm -rf node_modules
32
+ rm package-lock.json
33
+ npm install
34
+ ```
35
+
36
+ Then push `package-lock.yaml` again
@@ -0,0 +1,4 @@
1
+ /**
2
+ * The example function demonstrates how the package works
3
+ */
4
+ export declare const example: () => void;
@@ -0,0 +1 @@
1
+ export * from './io.ts';
package/dist/io.d.ts ADDED
@@ -0,0 +1,11 @@
1
+ import { Rljson } from '@rljson/rljson';
2
+ export interface Io {
3
+ write(request: {
4
+ data: Rljson;
5
+ }): Promise<void>;
6
+ readRow(request: {
7
+ table: string;
8
+ where: Record<string, any>;
9
+ }): Promise<Rljson>;
10
+ }
11
+ export declare const exampleIo = "Checkout @rljson/io-mem for an example implementation";
package/dist/io.js ADDED
@@ -0,0 +1,5 @@
1
+ // @license
2
+ const exampleIo = "Checkout @rljson/io-mem for an example implementation";
3
+ export {
4
+ exampleIo
5
+ };
@@ -0,0 +1,12 @@
1
+ // @license
2
+ // Copyright (c) 2025 Rljson
3
+ //
4
+ // Use of this source code is governed by terms that can be
5
+ // found in the LICENSE file in the root of this package.
6
+
7
+ /**
8
+ * The example function demonstrates how the package works
9
+ */
10
+ export const example = () => {
11
+ console.log('exampleIo');
12
+ };
package/package.json ADDED
@@ -0,0 +1,62 @@
1
+ {
2
+ "name": "@rljson/io",
3
+ "version": "0.0.1",
4
+ "packageManager": "pnpm@10.6.2",
5
+ "description": "Low level interface for reading and writing RLJSON data",
6
+ "homepage": "https://github.com/rljson/io",
7
+ "bugs": "https://github.com/rljson/io/issues",
8
+ "private": false,
9
+ "license": "MIT",
10
+ "engines": {
11
+ "node": ">=22.14.0"
12
+ },
13
+ "repository": {
14
+ "type": "git",
15
+ "url": "git+https://github.com/rljson/io.git"
16
+ },
17
+ "main": "dist/index.js",
18
+ "types": "dist/index.d.ts",
19
+ "files": [
20
+ "dist"
21
+ ],
22
+ "type": "module",
23
+ "scripts": {
24
+ "build": "npx vite build && tsc && cp README* dist && mkdir dist/src && cp src/example.ts dist/src",
25
+ "test": "npx vitest run --coverage && npm run lint",
26
+ "prebuild": "npm run test",
27
+ "prepublishOnly": "npm run build && npm run test",
28
+ "lint": "npx eslint",
29
+ "updateGoldens": "cross-env UPDATE_GOLDENS=true npm test"
30
+ },
31
+ "devDependencies": {
32
+ "@types/node": "^22.13.10",
33
+ "@typescript-eslint/eslint-plugin": "^8.26.1",
34
+ "@typescript-eslint/parser": "^8.26.1",
35
+ "@vitest/coverage-v8": "^3.0.8",
36
+ "cross-env": "^7.0.3",
37
+ "eslint": "^9.22.0",
38
+ "eslint-plugin-jsdoc": "^50.6.6",
39
+ "eslint-plugin-tsdoc": "^0.4.0",
40
+ "globals": "^16.0.0",
41
+ "jsdoc": "^4.0.4",
42
+ "typescript": "~5.8.2",
43
+ "typescript-eslint": "^8.26.1",
44
+ "vite": "^6.2.1",
45
+ "vite-node": "^3.0.8",
46
+ "vite-plugin-dts": "^4.5.3",
47
+ "vite-tsconfig-paths": "^5.1.4",
48
+ "vitest": "^3.0.8",
49
+ "vitest-dom": "^0.1.1"
50
+ },
51
+ "pnpm": {
52
+ "onlyBuiltDependencies": [
53
+ "esbuild"
54
+ ]
55
+ },
56
+ "dependencies": {
57
+ "@rljson/hash": "^0.0.9",
58
+ "@rljson/json": "^0.0.7",
59
+ "@rljson/rljson": "^0.0.6",
60
+ "@rljson/validate": "^0.0.4"
61
+ }
62
+ }