braid-text 0.2.116 → 0.2.117

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 (3) hide show
  1. package/index.js +1 -1
  2. package/package.json +1 -2
  3. package/AI-README.md +0 -82
package/index.js CHANGED
@@ -1144,7 +1144,7 @@ function create_braid_text() {
1144
1144
  if (braid_text.db_folder) {
1145
1145
  await db_folder_init()
1146
1146
  var pages = new Set()
1147
- for (let x of await require('fs').promises.readdir(braid_text.db_folder)) pages.add(decode_filename(x.replace(/\.\w+$/, '')))
1147
+ for (let x of await require('fs').promises.readdir(braid_text.db_folder)) if (/\.\d+$/.test(x)) pages.add(decode_filename(x.replace(/\.\d+$/, '')))
1148
1148
  return [...pages.keys()]
1149
1149
  } else return Object.keys(braid_text.cache)
1150
1150
  } catch (e) { return [] }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "braid-text",
3
- "version": "0.2.116",
3
+ "version": "0.2.117",
4
4
  "description": "Library for collaborative text over http using braid.",
5
5
  "author": "Braid Working Group",
6
6
  "repository": "braid-org/braid-text",
@@ -13,7 +13,6 @@
13
13
  "simpleton-client.js",
14
14
  "web-utils.js",
15
15
  "README.md",
16
- "AI-README.md",
17
16
  "editor.html",
18
17
  "markdown-editor.html",
19
18
  "server-demo.js"
package/AI-README.md DELETED
@@ -1,82 +0,0 @@
1
- # AI-README for braid-text
2
-
3
- This document provides AI assistants with key information about the braid-text project, including development procedures and architecture notes.
4
-
5
- ## Release Procedure
6
-
7
- Follow these steps to create a new release:
8
-
9
- 1. **Version Bump**
10
- - Update the version in `package.json` (use smallest version bump: patch level)
11
- - Current version format: `0.2.x`
12
-
13
- 2. **Run Tests**
14
- - Run `node test/test.js` - should show all 74 tests passing
15
- - Run `node test/fuzz-test.js` - runs 10,000 iterations (takes ~5-10 minutes), should complete with `best_n = Infinity @ NaN` indicating success
16
- - Both tests must pass before proceeding
17
-
18
- 3. **Commit Changes**
19
- - Use commit message format: `VERSION - description`
20
- - Example: `0.2.73 - adds automatic test cleanup`
21
- - Keep description concise and descriptive
22
-
23
- 4. **Push to Remote**
24
- - Run `git push` to push to the remote repository
25
-
26
- 5. **Publish to npm**
27
- - Run `npm publish` to publish the new version
28
-
29
- ## Test Suite
30
-
31
- ### test/test.js
32
- - Main test suite with 74 tests
33
- - Tests Braid protocol, version control, syncing, and collaboration features
34
- - Automatically cleans up `test_db_folder` after completion
35
- - Run with: `node test/test.js`
36
- - Filter tests with: `node test/test.js --filter="sync"`
37
-
38
- ### test/fuzz-test.js
39
- - Fuzz testing suite that generates random edits and verifies correctness
40
- - Tests diamond-types integration and merge operations
41
- - Runs 10,000 iterations by default (takes approximately 5-10 minutes)
42
- - Success indicated by `best_n = Infinity @ NaN` at completion (no failures found)
43
- - Run with: `node test/fuzz-test.js`
44
- - Let it run to completion - do not interrupt
45
-
46
- ## Project Structure
47
-
48
- - **index.js** - Main library file implementing Braid protocol for collaborative text
49
- - **package.json** - Package configuration and dependencies
50
- - **test/** - Test suite directory
51
- - **test.js** - Main test runner (supports both console and browser modes)
52
- - **tests.js** - Test definitions (shared between console and browser)
53
- - **fuzz-test.js** - Fuzz testing suite
54
- - **test.html** - Browser test interface
55
-
56
- ## Key Dependencies
57
-
58
- - **@braid.org/diamond-types-node** - CRDT implementation for conflict-free text editing
59
- - **braid-http** - Braid protocol HTTP implementation
60
- - **url-file-db** - File-based database for persistent storage
61
-
62
- ## Architecture Notes
63
-
64
- - Implements the Braid protocol for synchronizing collaborative text over HTTP
65
- - Uses diamond-types CRDT for conflict-free merging
66
- - Supports both simpleton and dt (diamond-types) merge strategies
67
- - Provides version control with parents tracking and version history
68
- - File-based persistence with case-insensitive filesystem support
69
-
70
- ## Common Operations
71
-
72
- ### Running Tests Locally
73
- ```bash
74
- node test/test.js # Run all tests
75
- node test/test.js --filter="sync" # Run tests matching "sync"
76
- node test/fuzz-test.js # Run fuzz tests
77
- ```
78
-
79
- ### Test Cleanup
80
- The test suite automatically cleans up temporary files and databases. If manual cleanup is needed:
81
- - Test database is created at `test/test_db_folder` during tests
82
- - Automatically removed after test completion