Skip to content

Commit 3a5e5ab

Browse files
Merge branch 'main' into patch-1
2 parents a929e8a + 3e6d843 commit 3a5e5ab

543 files changed

Lines changed: 45477 additions & 6158 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.github/ISSUE_TEMPLATE/bug-report.yml

Lines changed: 17 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,14 @@ labels:
44
- "stage: triage"
55
- "type: bug"
66
body:
7+
- type: markdown
8+
attributes:
9+
value: |
10+
Community contributions start with issues. Pull requests are limited to repository collaborators.
11+
[Read why and how to contribute](https://github.com/superdoc/docx-editor/blob/main/CONTRIBUTING.md).
12+
Report suspected security vulnerabilities privately through [GitHub Security Advisories](https://github.com/superdoc/docx-editor/security/advisories/new), not in a public issue.
13+
Remove confidential information from any files, screenshots, or logs you share.
14+
715
- type: textarea
816
id: description
917
attributes:
@@ -19,7 +27,7 @@ body:
1927
id: reproduction
2028
attributes:
2129
label: Steps to reproduce
22-
description: How can we reproduce this? Include a sample .docx file if possible.
30+
description: How can we reproduce this? Include a small reproduction or synthetic .docx file if possible.
2331
placeholder: |
2432
1. Open the attached .docx file
2533
2. Scroll to page 2
@@ -55,3 +63,11 @@ body:
5563
attributes:
5664
label: Additional context
5765
description: Screenshots, error messages, browser console output, or anything else that helps.
66+
67+
- type: textarea
68+
id: investigation
69+
attributes:
70+
label: Investigation or proposed fix
71+
description: If you’ve already investigated, share your findings, test results, or a link to a patch. You don’t need to write a fix to report a bug.
72+
validations:
73+
required: false

.github/ISSUE_TEMPLATE/config.yml

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,11 @@
11
blank_issues_enabled: false
22
contact_links:
3+
- name: Report a security vulnerability
4+
url: https://github.com/superdoc/docx-editor/security/advisories/new
5+
about: Report suspected vulnerabilities privately. Do not include vulnerability details in public issues.
36
- name: Questions & Discussion
47
url: https://discord.com/invite/b9UuaZRyaB
58
about: Ask questions or chat with the community on Discord
69
- name: Want to contribute?
710
url: https://github.com/superdoc/docx-editor/blob/main/CONTRIBUTING.md
8-
about: Check out our contributing guide to get started
11+
about: Community contributions start with issues. Read why and how to help.

.github/ISSUE_TEMPLATE/feature-request.yml

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,14 @@ labels:
44
- "stage: triage"
55
- "type: feature"
66
body:
7+
- type: markdown
8+
attributes:
9+
value: |
10+
Community contributions start with issues. Pull requests are limited to repository collaborators.
11+
[Read why and how to contribute](https://github.com/superdoc/docx-editor/blob/main/CONTRIBUTING.md).
12+
Report suspected security vulnerabilities privately through [GitHub Security Advisories](https://github.com/superdoc/docx-editor/security/advisories/new), not in a public issue.
13+
Remove confidential information from any files, screenshots, or logs you share.
14+
715
- type: textarea
816
id: problem
917
attributes:

.github/workflows/examples.yml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,7 @@ jobs:
4242
- 'packages/document-api/**'
4343
- 'packages/react/**'
4444
- 'packages/superdoc/**'
45+
- 'packages/sdk/**'
4546
- 'scripts/check-examples.mjs'
4647
- 'scripts/__tests__/check-examples.test.mjs'
4748
- 'scripts/check-go-links.mjs'
@@ -95,6 +96,10 @@ jobs:
9596
if: needs.detect.outputs.examples == 'true'
9697
run: pnpm --filter @superdoc/react run build
9798

99+
- name: Build SDK example dependencies
100+
if: needs.detect.outputs.examples == 'true'
101+
run: pnpm run generate:all && pnpm --filter @superdoc/sdk run build
102+
98103
- name: Install Chromium
99104
if: needs.detect.outputs.examples == 'true'
100105
run: pnpm --filter @superdoc-examples/vanilla exec playwright install --with-deps chromium

.github/workflows/notify-orbit.yml

Lines changed: 0 additions & 42 deletions
This file was deleted.

CONTRIBUTING.md

Lines changed: 41 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,27 +1,42 @@
11
# Contributing to SuperDoc
22

3-
Thanks for helping out. Bug reports, docs, examples, tests, and code are all
4-
welcome.
3+
Community contributions start with an issue. Pull requests are limited to
4+
repository collaborators.
5+
6+
We’ve found that reviewing and integrating external PRs often takes more time
7+
than implementing a fix from a clear report. Even a small change can affect
8+
other editor behavior that requires broader context to verify. We want to
9+
explain this upfront so you don’t spend time on a PR we can’t accept.
510

611
## Ways to contribute
712

8-
**Report a rendering bug.** Open a `.docx` in SuperDoc, compare it with
9-
Microsoft Word, and if they differ,
10-
[file an issue](https://github.com/superdoc/docx-editor/issues/new?template=bug-report.yml)
11-
with the file attached. A reproduction document is the single most useful thing
12-
you can send.
13+
Report suspected security vulnerabilities privately through
14+
[GitHub Security Advisories](https://github.com/superdoc/docx-editor/security/advisories/new),
15+
as described in our [security policy](SECURITY.md). Do not include vulnerability
16+
details in public issues.
1317

14-
**Improve the docs.** They live in `apps/docs/` and ship to
15-
[docs.superdoc.dev](https://docs.superdoc.dev). Run `pnpm run dev:docs` to
16-
preview your changes.
18+
Bug reports, feature requests, documentation feedback, and technical
19+
investigations are welcome. Search [open issues](https://github.com/superdoc/docx-editor/issues)
20+
first, then [open an issue](https://github.com/superdoc/docx-editor/issues/new/choose)
21+
with what you’re trying to do, what happened, and what you expected.
22+
23+
For bugs, include your SuperDoc version and a small reproduction if possible.
24+
For rendering differences, include a sample `.docx` and screenshots showing
25+
SuperDoc and Microsoft Word. Use synthetic or redacted documents without
26+
confidential information.
1727

18-
**Add an example.** Keep it runnable and focused on one documented outcome. All examples live in `examples/`.
28+
Already investigated or written a fix? Include your findings, test results, or
29+
a link to the patch in the issue. That context helps us understand the problem
30+
and develop a solution. You don’t need to write code to contribute.
1931

20-
**Fix a bug or add a feature.** Start with
21-
[good first issues](https://github.com/superdoc/docx-editor/issues?q=is%3Aissue+is%3Aopen+label%3A%22good+first+issue%22)
22-
or [help wanted](https://github.com/superdoc/docx-editor/issues?q=is%3Aissue+is%3Aopen+label%3A%22help+wanted%22).
23-
For anything large, open an issue first so we can agree on the approach before
24-
you write code.
32+
## Working on the code
33+
34+
The instructions below cover local development and PRs for repository
35+
collaborators. You can also use them to reproduce a problem locally.
36+
37+
Documentation lives in `apps/docs/` and ships to
38+
[docs.superdoc.dev](https://docs.superdoc.dev). Run `pnpm run dev:docs` to
39+
preview it. Runnable examples live in `examples/`.
2540

2641
## Choose a branch
2742

@@ -129,6 +144,16 @@ message, since the release version is derived from it:
129144

130145
A local Git hook checks the message format before the commit lands.
131146

147+
### Peer dependency changes
148+
149+
Peer dependencies are a compatibility contract with applications that install a published SuperDoc package. Any authored change to that contract requires manual review. CI compares the effective packed ranges, including `catalog:` and `workspace:` resolutions, with the pull request base and leaves a review comment when they differ.
150+
151+
Use a `feat:` title for a backward-compatible expansion such as widening a tested range, adding an optional peer, or making a required peer optional. Use a breaking `!` title for a change that removes accepted versions, adds a required peer, makes an optional peer required, or removes or replaces a peer contract. The protected check fails when the configured release planner would produce less than the required release impact; a breaking peer change cannot merge until the release path can produce the required major release.
152+
153+
The existing exact `superdoc` dependency and peer in `@superdoc/react` are a release-managed exception: the version stamper moves both pins only as part of the coordinated React and SuperDoc release train after protected PR checks. Changing the pin form, optionality, or compatibility policy is still an authored contract change and follows the rules above.
154+
155+
Read the [package compatibility policy](https://docs.superdoc.dev/resources/package-compatibility) before changing `peerDependencies`, `peerDependenciesMeta`, or a catalog entry used by a peer.
156+
132157
Before you open the PR:
133158

134159
- [ ] `pnpm test` passes

README.md

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -85,9 +85,14 @@ package state through one collaboration model.
8585

8686
## Contributing
8787

88-
Read the [contributing guide](https://github.com/superdoc/docx-editor/blob/main/CONTRIBUTING.md),
89-
browse [open issues](https://github.com/superdoc/docx-editor/issues), or join
90-
[Discord](https://discord.com/invite/b9UuaZRyaB).
88+
Community contributions start with an
89+
[issue](https://github.com/superdoc/docx-editor/issues/new/choose). Bug reports,
90+
feature requests, and technical investigations are welcome. Pull requests are
91+
limited to repository collaborators. Read the
92+
[contributing guide](https://github.com/superdoc/docx-editor/blob/main/CONTRIBUTING.md)
93+
for why and how to help, or join [Discord](https://discord.com/invite/b9UuaZRyaB)
94+
for questions. Report suspected security vulnerabilities privately through
95+
[GitHub Security Advisories](https://github.com/superdoc/docx-editor/security/advisories/new).
9196

9297
## Contributors
9398

apps/docs/COLLABORATION-DEMO.md

Lines changed: 53 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,53 @@
1+
# Collaboration demo
2+
3+
The docs own a staging-only Durable Object service in [collaboration-server](./collaboration-server/README.md).
4+
It uses the pinned SuperDoc runtime and Yjs WebSockets. Rooms expire after 15 minutes; only use sample text.
5+
The local Hocuspocus tutorial and access-control demo remain separate. Builds without a server URL show the illustration and local walkthrough.
6+
7+
## Local Hocuspocus server
8+
9+
From `superdoc/public`, start the server:
10+
11+
```bash
12+
VITE_SUPERDOC_EXAMPLE_PORT_OFFSET=100 pnpm --dir examples/collaboration exec tsx server.ts
13+
```
14+
15+
In another terminal, start docs on an available port:
16+
17+
```bash
18+
NEXT_PUBLIC_COLLABORATION_DEMO_URL=ws://127.0.0.1:1334 pnpm --filter @superdoc/docs exec next dev --port 3015
19+
```
20+
21+
Open `/editor/collaboration/connect-two-editors`. The demo connects automatically and starts collapsed. Expand it, edit either pane, and check the other. Alex's cursor is blue; Sam's is green.
22+
Restart asks before discarding edits and creates a new room. Unmount destroys both editor instances.
23+
24+
## Access checks
25+
26+
Start the separate localhost-only access server:
27+
28+
```bash
29+
pnpm --dir examples/collaboration exec tsx docs-access-server.ts
30+
```
31+
32+
Add `NEXT_PUBLIC_COLLABORATION_ACCESS_DEMO_URL=ws://127.0.0.1:1335` to the docs command and restart it.
33+
Open `/editor/collaboration/control-room-access`. Alex opens automatically; Sam may join, Taylor may not.
34+
The credentials are public fixtures, not a login system. Rooms stay in memory.
35+
36+
The pinned runtime reports rejected authentication as a generic connection error. This demo's `/access-result`
37+
endpoint confirms actual server rejections using a random connection-attempt ID, not the selected name.
38+
Results expire after one minute and the server retains at most 256. An unavailable result stays a connection error.
39+
This endpoint is demo infrastructure, not a SuperDoc API or a production authorization pattern.
40+
41+
## Browser checks
42+
43+
Run the focused browser tests against that page:
44+
45+
```bash
46+
DOCS_COLLABORATION_TEST_URL=http://127.0.0.1:3015/editor/collaboration/connect-two-editors VITE_SUPERDOC_EXAMPLE_PORT_OFFSET=200 pnpm --dir examples/collaboration test tests/docs-embed.spec.ts
47+
```
48+
49+
The test harness's own example servers use the offset of 200; the embedded demo connects to 1334.
50+
51+
Before hosting, add server-enforced expiration, room-scoped access, connection and payload limits, and abuse protection.
52+
Do not publish a build containing a localhost URL. No continuous connection-health indicator is claimed: initial readiness
53+
is not ongoing connectivity. After startup errors the sample stays visible; only explicit restart discards edits.

apps/docs/app/global.css

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,7 @@
7979
--color-fd-secondary-foreground: var(--sd-text-primary);
8080
}
8181

82-
.dark {
82+
:root.dark {
8383
--sd-gradient-from: #60a5fa;
8484
--sd-gradient-to: #c084fc;
8585
--sd-background: #0b0c10;
Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
.wrangler/
2+
.dev.vars*

0 commit comments

Comments
 (0)