Skip to content
This repository was archived by the owner on Jan 30, 2025. It is now read-only.
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
575 commits
Select commit Hold shift + click to select a range
b3c92f6
Merge pull request #719 from kasugamirai/chore/readme
dmonad Jun 19, 2025
f4fa053
fix typos
hyonun321 Jun 25, 2025
d5a74c9
Merge pull request #722 from hyonun321/typos
dmonad Jun 26, 2025
f94f2eb
Merge pull request #716 from i3dly/patch-2
dmonad Jun 30, 2025
783a7c4
remove newValue from YEvent
mattkrick Jul 10, 2025
4120d72
Merge pull request #725 from mattkrick/mattkrick-patch-1
dmonad Jul 11, 2025
4738944
Run tests without compilation. optimize testHelper output.
dmonad Mar 25, 2025
cfe67c1
basic delta implementation
dmonad Mar 25, 2025
e13fc60
implement support for diffing deletesets
dmonad Mar 27, 2025
0d3a149
add randomized tests for ds
dmonad Mar 28, 2025
da3cb22
use "insertSet" instead of computing state vectors in transactions
dmonad Apr 8, 2025
c554bd7
add test case for insertSet
dmonad Apr 8, 2025
46347ee
rename DeleteSet=>IdSet and add utilities and perf improvements
dmonad Apr 8, 2025
6360297
doc maintains ds
dmonad Apr 10, 2025
869dd2a
use stores ds to compute state as update
dmonad Apr 10, 2025
a6ae65d
Work on AttributionManager
dmonad Apr 12, 2025
8908bd2
[am] fixed tests
dmonad Apr 12, 2025
a360751
diffing of attribution manager state
dmonad Apr 12, 2025
55238e0
ds is no longer maintained on store - improves perf
dmonad Apr 12, 2025
1d025ae
rename AttributionManager=>IdMap
dmonad Apr 18, 2025
2d87301
implement attribution class that is de-duplicated in IdMap
dmonad Apr 18, 2025
99bcafe
efficient encoding & decoding of IdMaps
dmonad Apr 19, 2025
065f268
more renames (am=>idmap)
dmonad Apr 19, 2025
f78a7d0
more renames (ds=>idset)
dmonad Apr 19, 2025
5f5cf34
implement base AttributionManager class and use in Y.Text
dmonad Apr 20, 2025
2e2968e
attributions and fixes to idmap
dmonad Apr 20, 2025
6671071
first test case for attributions
dmonad Apr 21, 2025
3c37699
basic attribution test working
dmonad Apr 21, 2025
7de9476
attribution tests for adding and removing attributes
dmonad Apr 21, 2025
768d6b1
perf tests toDelta vs getContent
dmonad Apr 22, 2025
69786f7
add another example and create a writeup for attributing content.
dmonad Apr 23, 2025
fbfe0e0
working on performance
dmonad Apr 24, 2025
a6b2dd1
more perf improvements on getContent with attributedContent
dmonad Apr 24, 2025
f5e2a4d
add test case for finding a type in another ydoc
dmonad Apr 24, 2025
d399756
more work on optimizing. Improve the test case.
dmonad Apr 24, 2025
324620d
[attribution manager] returns null instead of empty array to reduce g…
dmonad Apr 27, 2025
ece7466
[AttributionManager] further improve performance to be almost on-par …
dmonad Apr 27, 2025
b3171c5
getContent on Y.Map
dmonad Apr 28, 2025
4f84024
implement and test getContent on all types
dmonad Apr 28, 2025
1722c8a
Implement & test getContentDeep for all types. Improve ability to com…
dmonad Apr 29, 2025
527e382
implement createAttributionsManagerFromDiff that automatically handle…
dmonad Apr 29, 2025
af2ccc7
add an simple attributions example
dmonad Apr 29, 2025
df4a424
lint
dmonad Apr 30, 2025
574892b
14.0.0-2
dmonad Apr 30, 2025
2daad96
implement idset.delete & idmap.delete
dmonad Apr 30, 2025
a43f198
[AttributionManager] auto-updates on doc changes and can destroy itself
dmonad Apr 30, 2025
d8143ef
fix nicks test
dmonad May 1, 2025
7528541
bump y-protocols
dmonad May 1, 2025
397f24b
14.0.0-3
dmonad May 1, 2025
2aba7bf
add missing exports for y-prosemirror
dmonad May 1, 2025
6e98b3f
14.0.0-4
dmonad May 1, 2025
00c2646
[idmap/idset] implement forEach and perf improvement on diffingAttrib…
dmonad May 1, 2025
04c6fbd
fix nicks test case
dmonad May 5, 2025
de12a0f
14.0.0-5
dmonad May 5, 2025
0efa4dd
[diffing] event returns delta class object, migrate away from legacy …
dmonad May 6, 2025
cb191e7
[y.text] event returns delta - fix a bunch of bugs
dmonad May 7, 2025
fc62061
lint & fix tests
dmonad May 7, 2025
6242254
events can be computed with attributions
dmonad May 8, 2025
b646654
be able to intersect idmaps and idsets
dmonad May 9, 2025
4d58274
more generic gedDelta implementation (could be used for events)
dmonad May 18, 2025
7d5d6b8
fix some edge cases
dmonad May 18, 2025
e1ef221
only have a single getDelta implementation for events and retrieving…
dmonad May 19, 2025
3fd60a2
first tests on attributed events
dmonad May 21, 2025
5b29e54
be able to insert into attributed content
dmonad May 21, 2025
43c7521
fix reading content with new api
dmonad May 22, 2025
34b90fc
[attribution] fixes for suggestion support in y-quill
dmonad May 23, 2025
90514dd
more attribution fixes for y-quill
dmonad May 24, 2025
f1ae2a7
suggestion fixes
dmonad May 29, 2025
172b157
fix puzzle1
dmonad May 30, 2025
d9490c4
fix issue with slicing content in attrMngr
dmonad May 31, 2025
6d7ccf6
fix am.readContent
dmonad May 31, 2025
4d50891
fuzz tests for unformatted text run
dmonad Jun 1, 2025
c37ee3e
fix suggestion issues with formatting by introducing an option to dis…
dmonad Jun 2, 2025
e62e1d7
implement StructSet abstraction
dmonad Jun 5, 2025
f41e633
work on allowing skips in struct store
dmonad Jun 5, 2025
78fb8d0
fixed another splicing issue with skips
dmonad Jun 6, 2025
a76d6e1
[skip allowed struct in yjs] fixed all tests
dmonad Jun 6, 2025
8ef8ffc
fix gc splice issues happening in y-quill
dmonad Jun 6, 2025
92bab00
be able to encode partial state with holes correctly
dmonad Jun 7, 2025
74a5a37
DiffAttributionManager supports accepting suggestions
dmonad Jun 8, 2025
10a0198
reject suggestion working
dmonad Jun 9, 2025
a9f802d
fixed a bunch of issues related to attribution of formats
dmonad Jun 9, 2025
9161a96
[delta] useAttributes doesn't clean up empty objects
dmonad Jun 10, 2025
d6a3e63
fixes for accepting / rejecting suggestions
dmonad Jun 10, 2025
5c5139b
handle another attribution edge case for formatting
dmonad Jun 11, 2025
a1a0f44
lint
dmonad Jun 11, 2025
05c79b9
14.0.0-6
dmonad Jun 11, 2025
5e4d240
[suggested formatting] implement previousUnattributedAttributes approach
dmonad Jun 12, 2025
6c78661
lint
dmonad Jun 12, 2025
ab9e726
14.0.0-7
dmonad Jun 12, 2025
e05d538
documentation for attribution feature
dmonad Jun 16, 2025
5000fe5
export createDelta
dmonad Jun 23, 2025
496389e
14.0.0-8
dmonad Jun 23, 2025
72393e6
work on new deltas with modifiers
dmonad Jul 7, 2025
e6ab2bb
major update on the (nested) event system. created dedicated delta cl…
dmonad Jul 19, 2025
5c86133
[readme] add Theneo as a user
dmonad Jul 25, 2025
2f47a98
add reference to lean-yjs
dmonad Sep 15, 2025
91384b5
[wip] refactor for lib0/delta v2
dmonad Oct 20, 2025
c9829b0
fixed most tests for delta v2 migration
dmonad Oct 21, 2025
1ce8154
fixed several v2 issues
dmonad Oct 22, 2025
1b07864
bump to lib0 beta release
dmonad Oct 23, 2025
0435919
no forced tests for release
dmonad Oct 23, 2025
57bc4d3
lint
dmonad Oct 23, 2025
19dbe61
14.0.0-9
dmonad Oct 23, 2025
584ad5f
bump deps and use new delta format
dmonad Oct 28, 2025
029aba4
usability - observeDeep returns function
dmonad Oct 29, 2025
61e3459
lint
dmonad Oct 29, 2025
54c041c
cleanup docs task
dmonad Oct 29, 2025
d298ca9
14.0.0-10
dmonad Oct 29, 2025
2f7895e
fixes and more tests for delta representation on abstract types
dmonad Oct 30, 2025
19b5134
fix all tests
dmonad Nov 3, 2025
452c83b
fix node tests
dmonad Nov 12, 2025
b82a71a
y.map should accept objects without constructor
dmonad Nov 13, 2025
b1b9552
add idmap encoding benchmark
dmonad Nov 17, 2025
27ab396
encodeStateAsUpdate returns Uint8Array<ArrayBuffer>
dmonad Nov 17, 2025
5f34773
[readUpdateIdRanges] and refactors
dmonad Nov 17, 2025
a4aa2f8
type rework, updates are now Uint8Array<ArrayBuffer>
dmonad Nov 17, 2025
2779edf
14.0.0-11
dmonad Nov 17, 2025
de10cf0
expose more missing api
dmonad Nov 18, 2025
658bd38
getContent returns editable delta yjs/y-prosemirror#203
dmonad Nov 18, 2025
03b0542
bump deps & make publishable
dmonad Nov 19, 2025
20ae14b
14.0.0-12
dmonad Nov 19, 2025
3718902
expose decodeIdMap
dmonad Nov 19, 2025
fb0c61a
14.0.0-13
dmonad Nov 19, 2025
d7b072e
add teleportal to the list of providers
dmonad Nov 25, 2025
8040111
implement diffDocsToDelta
dmonad Nov 27, 2025
7183623
14.0.0-14
dmonad Nov 27, 2025
b2df311
fixed all tests & proper diff /w attribution in nested deltas
dmonad Dec 7, 2025
4fe1914
14.0.0-15
dmonad Dec 7, 2025
933111f
fixed nested delta edge case
dmonad Dec 7, 2025
081886f
14.0.0-16
dmonad Dec 7, 2025
988bea2
temporary rename for beta releases depending on yjs
dmonad Dec 10, 2025
5c6278e
bundle and only export esm module
dmonad Dec 15, 2025
b1cff47
change global identifier name for compatibility with v13
dmonad Dec 15, 2025
481823c
fix preversion script
dmonad Dec 15, 2025
4e2c470
14.0.0-17
dmonad Dec 15, 2025
b61597f
bump lib0 to stable release
dmonad Dec 15, 2025
509a11f
14.0.0-18
dmonad Dec 15, 2025
157359a
refactor: minor cleanup of duplicate function
nperez0111 Dec 17, 2025
ca7c98f
feat: support attributing the content for `DiffAttributionManager` & …
nperez0111 Dec 17, 2025
48fc7e4
fix: remove default attributions
nperez0111 Dec 17, 2025
cce803c
Merge pull request #753 from nperez0111/attrs
dmonad Dec 17, 2025
f661af7
14.0.0-19
dmonad Dec 17, 2025
200907d
[chore] remove concurrently as a devDependency
nperez0111 Dec 18, 2025
7126035
Merge pull request #754 from nperez0111/rm-dep
dmonad Dec 19, 2025
dfa2190
fix: if there is not element to modify, throw an error
nperez0111 Dec 19, 2025
f523011
Merge pull request #755 from nperez0111/check-case
dmonad Dec 20, 2025
8fff0cf
docs: fix broken Liveblocks Yjs documentation link
computerscienceiscool Dec 21, 2025
88fd968
expose `SnapshotAttributionManager` and `createAttributionManagerFrom…
nperez0111 Dec 28, 2025
8724af0
Merge pull request #759 from nperez0111/snapshot-attribution-manager
dmonad Dec 28, 2025
9563811
[AttributionManager] implement acceptAllChanges and rejectAllChanges.…
dmonad Dec 30, 2025
2daa2ae
expose getPathTo and support custom attributionManager/renderer in re…
dmonad Dec 30, 2025
8cc17fc
Merge pull request #756 from computerscienceiscool/patch-1
dmonad Dec 30, 2025
301d383
simplifying type system
dmonad Dec 24, 2025
69131b7
started refactor expose a single Yjs type only using lib0@v1 delta
dmonad Dec 28, 2025
ec11ef6
more refactoring
dmonad Dec 29, 2025
2053f79
fix all type issues
dmonad Jan 6, 2026
8bd9946
[delta integration] fix many tests
dmonad Jan 9, 2026
bbaec17
[delta integration] fixed all tests
dmonad Jan 10, 2026
ffabdff
remove insertAfter
dmonad Jan 10, 2026
6ec341f
getContent => toDelta
dmonad Jan 10, 2026
1d78034
contentIds/contentMap API
dmonad Jan 10, 2026
65bc32f
attributions filtering, undo of contentIds
dmonad Jan 10, 2026
241d942
content utilities
dmonad Jan 10, 2026
53d4f0b
bump lib0 & add node 22 to github workflow
dmonad Jan 12, 2026
285031d
remove rollup bundle
dmonad Jan 12, 2026
5e7cc58
fix preversion script
dmonad Jan 12, 2026
e404922
14.0.0-20
dmonad Jan 12, 2026
2b5138a
rename readUpdateToContentIds => createContentIdsFromUpdate
dmonad Jan 13, 2026
bee0afb
add missing meta apis (mostly contentIds & contentMaps)
dmonad Jan 14, 2026
d741c46
[update] intersect
dmonad Jan 14, 2026
ff741d8
createDocFromUpdate
dmonad Jan 14, 2026
afd880b
14.0.0-21
dmonad Jan 14, 2026
cdc23b6
publish testhelper.js
dmonad Jan 19, 2026
68ae2f1
type issue in tests
dmonad Jan 19, 2026
c1755c5
14.0.0-22
dmonad Jan 19, 2026
fd175b9
Update README with Velt YJs CRDT details
rakesh-snippyly Jan 24, 2026
612ccb7
Remove emoji from Velt YJs CRDT link
rakesh-snippyly Jan 24, 2026
49cfa18
Update link text for Velt YJs in README
rakesh-snippyly Jan 24, 2026
19e3ac9
Update README with Velt YJs details
rakesh-snippyly Jan 24, 2026
3a69b95
[updates] createDocFromUpdates accepts DocOpts
dmonad Jan 31, 2026
db29b42
intersectUpdateWithContentIds returns Uint8Array<ArrayBuffer>
dmonad Feb 10, 2026
e431f01
Merge pull request #763 from rakesh-snippyly/patch-2
dmonad Feb 15, 2026
099ce92
lint issues
dmonad Feb 11, 2026
8cd979a
Mark Velt.dev as a sponsor
dmonad Feb 15, 2026
e3ba2cb
type fixes
dmonad Feb 23, 2026
b9ede1b
[undoContentIds] accepts UndoManagerOptions
dmonad Feb 25, 2026
ae7dc2d
lint & typechecks for lib0 upgrade
dmonad Feb 25, 2026
2e330c9
fix tests and upgrade deps
dmonad Feb 25, 2026
768a17e
14.0.0-rc.0
dmonad Feb 25, 2026
a14b056
global d.ts
dmonad Feb 26, 2026
ee0b63b
[Y.mergeUpdates] optimized for merging many updates
dmonad Feb 27, 2026
d31f97e
fix dist script
dmonad Feb 27, 2026
bd61d6c
fix version script
dmonad Feb 27, 2026
12b527e
release script
dmonad Feb 27, 2026
6f88d59
14.0.0-rc.1
dmonad Feb 27, 2026
585bcb7
excludeContentMap - singular
dmonad Mar 6, 2026
7795050
reproduce #767
dmonad Mar 14, 2026
91cd542
retain legacyTypeRef when undoing content
dmonad Mar 18, 2026
f58dc26
bump lib0
dmonad Mar 18, 2026
da05230
14.0.0-rc.2
dmonad Mar 18, 2026
75c10c1
schemas and upgrade lib0
dmonad Mar 23, 2026
574b539
test in release script
dmonad Mar 23, 2026
1f3f912
bump lib0
dmonad Mar 23, 2026
d6dc66c
14.0.0-rc.3
dmonad Mar 23, 2026
c06acb0
considering deleted content - fix applyDelta modifyOp
dmonad Mar 24, 2026
bf8450a
14.0.0-rc.4
dmonad Mar 24, 2026
c847d92
[applyDelta] fix skipping over uncountables
dmonad Mar 24, 2026
e2e44d8
fix stack overflow when using spread operator
dmonad Mar 25, 2026
ea8b268
14.0.0-rc.5
dmonad Mar 25, 2026
44bddad
14.0.0-rc.6
dmonad Mar 25, 2026
f983fb7
flatten, no more circular dependencies
dmonad Mar 27, 2026
cae87f7
update workflow to use node 22 and above
dmonad Mar 27, 2026
f54f258
publishing workflow
dmonad Mar 27, 2026
7033280
14.0.0-rc.7
dmonad Mar 27, 2026
d27b9ee
update workflow
dmonad Mar 27, 2026
4a91925
found bug in publishing workflow
dmonad Mar 27, 2026
799d986
publish global.d.ts
dmonad Mar 27, 2026
c2c510b
v14.0.0-rc.8
dmonad Mar 27, 2026
dc56cfb
fix global.d.ts export type issue
dmonad Mar 28, 2026
20b07c2
14.0.0-rc.9
dmonad Mar 28, 2026
9f06f9f
applyDelta forwards am on modify
dmonad Mar 29, 2026
612fef6
14.0.0-rc.10
dmonad Mar 29, 2026
16824d3
add funding.yml
dmonad Apr 2, 2026
12ecc79
add code of conduct and contributing guidelines
dmonad Apr 2, 2026
9719444
add y-atproto provider
dmonad Apr 7, 2026
8c45dd6
Revise security policy and reporting guidelines
dmonad Apr 7, 2026
6e24a53
[security] update reporting info
dmonad Apr 8, 2026
aa83215
Potential fix for code scanning alert no. 2: Workflow does not contai…
dmonad Apr 9, 2026
eb93946
Merge pull request #770 from yjs/alert-autofix-2
dmonad Apr 9, 2026
924bc0f
Add Scorecard workflow for supply-chain security
dmonad Apr 9, 2026
6e8a097
Merge pull request #771 from yjs/dmonad-patch-1
dmonad Apr 9, 2026
f22190a
Potential fix for code scanning alert no. 1: Workflow does not contai…
dmonad Apr 9, 2026
a03c103
Merge pull request #772 from yjs/alert-autofix-1
dmonad Apr 9, 2026
c3668c0
implement incident response plan
dmonad Apr 9, 2026
c52e946
Merge pull request #773 from yjs/incident-response-plan
dmonad Apr 9, 2026
d219368
add tooljet as a user
dmonad Apr 9, 2026
fe24f53
bump deps
dmonad Apr 9, 2026
52c6091
[ts] properly expose some types
dmonad Apr 11, 2026
ebae7a3
properly attribute deleted content in events
dmonad Apr 11, 2026
0694147
update dependencies
dmonad Apr 11, 2026
d3a4fa7
14.0.0-rc.11
dmonad Apr 11, 2026
6909511
update node in publishing script
dmonad Apr 11, 2026
3a1c249
thread model documentation
dmonad Apr 14, 2026
b591d31
nested delta fixes for suggestions
dmonad Apr 14, 2026
a3e870c
14.0.0-rc.12
dmonad Apr 14, 2026
2b5af46
update language bindings
dmonad Apr 14, 2026
f30c784
fix attribution change event to contain explicit attributions
dmonad Apr 14, 2026
ccff67a
bump lib0
dmonad Apr 14, 2026
da7366c
14.0.0-rc.13
dmonad Apr 14, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions .github/FUNDING.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
github: dmonad
open_collective: y-collective
90 changes: 90 additions & 0 deletions .github/INCIDENT_RESPONSE.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,90 @@
# Incident Response Plan

How Yjs maintainers handle security incidents. This plan is designed for small teams.

---

## 1. Receive a Private Disclosure

All security issues should be reported privately via the method described in [`SECURITY.md`](../SECURITY.md) (GitHub Security Advisory). Lower-severity issues can be filed as regular issues.

**Target:** Acknowledge receipt within 3 business days.

---

## 2. Triage

Assess severity:

| Severity | Example | Target |
|----------|---------|--------|
| **Critical** | Arbitrary code execution, compromised release | Acknowledge < 24h, fix < 7d |
| **High** | Data leakage, denial of service on shared docs | Acknowledge < 3d, fix < 14d |
| **Medium** | Edge-case corruption under unusual conditions | Fix in next release |
| **Low** | Informational, no direct user risk | Fix as scheduled |

These are good-faith targets for a volunteer-maintained project, not SLAs.

---

## 3. Contain & Fix

1. **Open a private GitHub Security Advisory** for the issue if one doesn't already exist.
2. **Develop the fix** in the advisory's private fork to avoid leaking details.
3. **Assign a CVE** through GitHub's advisory flow before publishing.
4. **Yank affected releases from npm** (`npm deprecate` with a message pointing to the advisory) if the severity is Critical or High.
5. **Publish the patched release** to npm.
6. **Update the version support matrix** in `SECURITY.md`.

---

## 4. Disclose

After the fix is published:

1. **Publish the GitHub Security Advisory** with:
- What happened
- Which versions are affected
- How users can update or mitigate
- The assigned CVE
2. **Notify sponsors** via the appropriate channel (email, GitHub Sponsors update, or OpenCollective post).
3. **Post to GitHub Discussions** for broader community awareness, linking to the advisory.

Responsible disclosure principles:
- Never publish details before a fix is available.
- Never name reporters without their consent.
- Coordinate embargo periods with downstream consumers (e.g., major framework integrations) when needed.

---

## 5. Post-Incident

Within one week of resolution:

- Note what happened, what worked, and what to improve (can be a short section in the advisory itself or a comment on the discussion post).
- Update this plan if the process broke down anywhere.

---

## 6. Checklist (quick reference)

```
[ ] Private report received & acknowledged
[ ] Severity assessed
[ ] Private advisory + fork created on GitHub
[ ] Fix developed & tested
[ ] CVE assigned
[ ] Affected npm versions deprecated (if Critical/High)
[ ] Patched release published
[ ] SECURITY.md version matrix updated
[ ] Advisory published
[ ] Sponsors notified
[ ] Community notified (Discussions)
[ ] Post-incident notes written
```

---

## Plan Maintenance

Review this plan once a year or after any incident. Changes are tracked in git history.
15 changes: 10 additions & 5 deletions .github/workflows/node.js.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,21 +9,26 @@ on:
pull_request:
branches: [ main ]

permissions:
contents: read

jobs:
build:

runs-on: ubuntu-latest

strategy:
matrix:
node-version: [10.x, 12.x, 14.x]
node-version: [22.x, 24.x]

steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v4
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v1
uses: actions/setup-node@v4
with:
node-version: ${{ matrix.node-version }}
- run: npm ci
- run: npm run build --if-present
- run: npm test
- run: npm run lint
- run: npm run test
env:
CI: true
31 changes: 0 additions & 31 deletions .github/workflows/nodejs.yml

This file was deleted.

70 changes: 70 additions & 0 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,70 @@
name: Publish to npm

on:
workflow_run:
workflows: ["Node.js CI"]
types: [completed]
branches: [main]

jobs:
check:
if: github.event.workflow_run.conclusion == 'success'
runs-on: ubuntu-latest
permissions:
contents: read
outputs:
should_publish: ${{ steps.version-check.outputs.should_publish }}
steps:
- uses: actions/checkout@v5
- uses: actions/setup-node@v5
with:
node-version: 24.x
- name: Check if version is already published
id: version-check
run: |
NAME=$(node -p "require('./package.json').name")
LOCAL=$(node -p "require('./package.json').version")
if npm view "${NAME}@${LOCAL}" version 2>/dev/null; then
echo "should_publish=false" >> "$GITHUB_OUTPUT"
echo "Version $LOCAL already published, skipping."
else
echo "should_publish=true" >> "$GITHUB_OUTPUT"
echo "New version detected: $LOCAL"
fi

publish:
needs: check
if: needs.check.outputs.should_publish == 'true'
runs-on: ubuntu-latest
permissions:
contents: write
id-token: write
steps:
- uses: actions/checkout@v5
- uses: actions/setup-node@v5
with:
node-version: 24.x
- run: npm ci
- name: Build
run: npm run dist
- name: Determine npm tag
id: npm-tag
run: |
VERSION=$(node -p "require('./package.json').version")
if [[ "$VERSION" == *-* ]]; then
echo "tag=beta" >> "$GITHUB_OUTPUT"
else
echo "tag=latest" >> "$GITHUB_OUTPUT"
fi
- name: Publish
run: npm publish --provenance --access public --tag ${{ steps.npm-tag.outputs.tag }}
- name: Create GitHub Release
run: |
VERSION=$(node -p "require('./package.json').version")
PRERELEASE=""
if [[ "$VERSION" == *-* ]]; then
PRERELEASE="--prerelease"
fi
gh release create "v${VERSION}" --generate-notes $PRERELEASE
env:
GH_TOKEN: ${{ github.token }}
78 changes: 78 additions & 0 deletions .github/workflows/scorecard.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,78 @@
# This workflow uses actions that are not certified by GitHub. They are provided
# by a third-party and are governed by separate terms of service, privacy
# policy, and support documentation.

name: Scorecard supply-chain security
on:
# For Branch-Protection check. Only the default branch is supported. See
# https://github.com/ossf/scorecard/blob/main/docs/checks.md#branch-protection
branch_protection_rule:
# To guarantee Maintained check is occasionally updated. See
# https://github.com/ossf/scorecard/blob/main/docs/checks.md#maintained
schedule:
- cron: '28 5 * * 0'
push:
branches: [ "main" ]

# Declare default permissions as read only.
permissions: read-all

jobs:
analysis:
name: Scorecard analysis
runs-on: ubuntu-latest
# `publish_results: true` only works when run from the default branch. conditional can be removed if disabled.
if: github.event.repository.default_branch == github.ref_name || github.event_name == 'pull_request'
permissions:
# Needed to upload the results to code-scanning dashboard.
security-events: write
# Needed to publish results and get a badge (see publish_results below).
id-token: write
# Uncomment the permissions below if installing in a private repository.
# contents: read
# actions: read

steps:
- name: "Checkout code"
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
with:
persist-credentials: false

- name: "Run analysis"
uses: ossf/scorecard-action@f49aabe0b5af0936a0987cfb85d86b75731b0186 # v2.4.1
with:
results_file: results.sarif
results_format: sarif
# (Optional) "write" PAT token. Uncomment the `repo_token` line below if:
# - you want to enable the Branch-Protection check on a *public* repository, or
# - you are installing Scorecard on a *private* repository
# To create the PAT, follow the steps in https://github.com/ossf/scorecard-action?tab=readme-ov-file#authentication-with-fine-grained-pat-optional.
# repo_token: ${{ secrets.SCORECARD_TOKEN }}

# Public repositories:
# - Publish results to OpenSSF REST API for easy access by consumers
# - Allows the repository to include the Scorecard badge.
# - See https://github.com/ossf/scorecard-action#publishing-results.
# For private repositories:
# - `publish_results` will always be set to `false`, regardless
# of the value entered here.
publish_results: true

# (Optional) Uncomment file_mode if you have a .gitattributes with files marked export-ignore
# file_mode: git

# Upload the results as artifacts (optional). Commenting out will disable uploads of run results in SARIF
# format to the repository Actions tab.
- name: "Upload artifact"
uses: actions/upload-artifact@4cec3d8aa04e39d1a68397de0c4cd6fb9dce8ec1 # v4.6.1
with:
name: SARIF file
path: results.sarif
retention-days: 5

# Upload the results to GitHub's code scanning dashboard (optional).
# Commenting out will disable upload of results to your repo's Code Scanning dashboard
- name: "Upload to code-scanning"
uses: github/codeql-action/upload-sarif@v3
with:
sarif_file: results.sarif
1 change: 1 addition & 0 deletions .well-known/funding-manifest-urls
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
https://yjs.dev
5 changes: 5 additions & 0 deletions CODE_OF_CONDUCT.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
# Contributor Covenant Code of Conduct

This project follows the [Contributor Covenant v2.1](https://www.contributor-covenant.org/version/2/1/code_of_conduct/).

By participating, you agree to uphold this code. Report unacceptable behavior to [kevin.jahns@protonmail.com](mailto:kevin.jahns@protonmail.com).
9 changes: 9 additions & 0 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
# Contributing

1. **Open an issue first.** Discuss your idea or bug report before writing code.
2. **Submit a PR** that references the issue.
3. **Include tests.** Every PR must include tests covering the change. Test-only PRs are welcome too.

Yjs is free to use, but not free to maintain. Companies that rely on Yjs are expected to support the project — through [sponsorship](https://github.com/sponsors/dmonad), contributions, or both — if they want issues, bug reports, and PRs addressed.

Every contribution becomes maintenance work for the project maintainers. Priority is given to features that serve the project's financial supporters. Other contributions may not be accepted solely for this reason.
10 changes: 5 additions & 5 deletions INTERNALS.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ article](https://blog.kevinjahns.de/are-crdts-suitable-for-shared-editing/).

Each client is assigned a unique *clientID* property on first insert. This is a
random 53-bit integer (53 bits because that fits in the javascript safe integer
range).
range \[JavaScript uses IEEE 754 floats\]).

## List items

Expand Down Expand Up @@ -60,7 +60,7 @@ characters have either been deleted or all characters are not deleted. The item
will be split if the run is interrupted for any reason (eg a character in the
middle of the run is deleted).

When an item is created, it stores a reference to the IDs of the preceeding and
When an item is created, it stores a reference to the IDs of the preceding and
succeeding item. These are stored in the item's `origin` and `originRight`
fields, respectively. These are used when peers concurrently insert at the same
location in a document. Though quite rare in practice, Yjs needs to make sure
Expand Down Expand Up @@ -88,7 +88,7 @@ When a local insert happens, Yjs needs to map the insert position in the
document (eg position 1000) to an ID. With just the linked list, this would
require a slow O(n) linear scan of the list. But when editing a document, most
inserts are either at the same position as the last insert, or nearby. To
improve performance, Yjs stores a cache of the 10 most recently looked up
improve performance, Yjs stores a cache of the 80 most recently looked up
insert positions in the document. This is consulted and updated when a position
is looked up to improve performance in the average case. The cache is updated
using a heuristic that is still changing (currently, it is updated when a new
Expand Down Expand Up @@ -149,8 +149,8 @@ concepts that can be used to create a custom network protocol:

* `update`: The Yjs document can be encoded to an *update* object that can be
parsed to reconstruct the document. Also every change on the document fires
an incremental document updates that allows clients to sync with each other.
The update object is an Uint8Array that efficiently encodes `Item` objects and
an incremental document update that allows clients to sync with each other.
The update object is a Uint8Array that efficiently encodes `Item` objects and
the delete set.
* `state vector`: A state vector defines the known state of each user (a set of
tuples `(client, clock)`). This object is also efficiently encoded as a
Expand Down
4 changes: 2 additions & 2 deletions LICENSE
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
The MIT License (MIT)

Copyright (c) 2014
- Kevin Jahns <kevin.jahns@rwth-aachen.de>.
Copyright (c) 2023
- Kevin Jahns <kevin.jahns@protonmail.com>.
- Chair of Computer Science 5 (Databases & Information Systems), RWTH Aachen University, Germany

Permission is hereby granted, free of charge, to any person obtaining a copy
Expand Down
Loading