gzkx-editor 0.0.0

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.
@@ -0,0 +1,104 @@
1
+ # How to contribute
2
+
3
+ - [Getting help](#getting-help)
4
+ - [Submitting bug reports](#submitting-bug-reports)
5
+ - [Contributing code](#contributing-code)
6
+
7
+ ## Getting help
8
+
9
+ Community discussion, questions, and informal bug reporting is done on the
10
+ [discuss.ProseMirror forum](http://discuss.prosemirror.net).
11
+
12
+ ## Submitting bug reports
13
+
14
+ Report bugs on the
15
+ [issue tracker](https://code.haverbeke.berlin/prosemirror/prosemirror/issues).
16
+ Before reporting a bug, please read these pointers.
17
+
18
+ - The issue tracker is for *bugs*, not requests for help. Questions
19
+ should be asked on the [forum](http://discuss.prosemirror.net).
20
+
21
+ - Include information about the version of the code that exhibits the
22
+ problem. For browser-related issues, include the browser and browser
23
+ version on which the problem occurred.
24
+
25
+ - Mention very precisely what went wrong. "X is broken" is not a good
26
+ bug report. What did you expect to happen? What happened instead?
27
+ Describe the exact steps a maintainer has to take to make the
28
+ problem occur. A screencast can be useful, but is no substitute for
29
+ a textual description.
30
+
31
+ - A great way to make it easy to reproduce your problem, if it can not
32
+ be trivially reproduced on the website demos, is to submit a script
33
+ that triggers the issue.
34
+
35
+ ## Contributing code
36
+
37
+ Code generated by a language model is not welcome in this project.
38
+ Please don't waste my time with it.
39
+
40
+ If you want to make a change that involves a significant overhaul of
41
+ the code or introduces a user-visible new feature, create an
42
+ [issue](https://code.haverbeke.berlin/prosemirror/prosemirror/issues/)
43
+ first with your proposal.
44
+
45
+ - Make sure you have a [Codeberg](https://codeberg.org/user/sign_up)
46
+ or [GitHub](https://github.com/signup/free) account.
47
+
48
+ - Use that to create a [code.haverbeke.berlin
49
+ account](https://code.haverbeke.berlin/user/login).
50
+
51
+ - Fork the relevant repository.
52
+
53
+ - Create a local checkout of the code. You can use the
54
+ [main repository](https://code.haverbeke.berlin/prosemirror/prosemirror) to
55
+ easily check out all core modules.
56
+
57
+ - Make your changes, and commit them
58
+
59
+ - If your changes are easy to test or likely to regress, add tests in
60
+ the relevant `test/` directory. Either put them in an existing
61
+ `test-*.js` file, if they fit there, or add a new file.
62
+
63
+ - Make sure all tests pass. Run `npm run test` to verify tests pass
64
+ (you will need Node.js v6+).
65
+
66
+ - Submit a pull request. Don't put more than one feature/fix in a
67
+ single pull request.
68
+
69
+ By contributing code to ProseMirror you
70
+
71
+ - Agree to license the contributed code under the project's [MIT
72
+ license](https://code.haverbeke.berlin/prosemirror/prosemirror/blob/main/LICENSE).
73
+
74
+ - Confirm that you have the right to contribute and license the code
75
+ in question. (Either you hold all rights on the code, or the rights
76
+ holder has explicitly granted the right to use it like this,
77
+ through a compatible open source license or through a direct
78
+ agreement with you.)
79
+
80
+ ### Coding standards
81
+
82
+ - ES6 syntax, targeting an ES5 runtime (i.e. don't use library
83
+ elements added by ES6, don't use ES7/ES.next syntax).
84
+
85
+ - 2 spaces per indentation level, no tabs.
86
+
87
+ - No semicolons except when necessary.
88
+
89
+ - Follow the surrounding code when it comes to spacing, brace
90
+ placement, etc.
91
+
92
+ - Brace-less single-statement bodies are encouraged whenever they
93
+ don't impact readability.
94
+
95
+ - [getdocs-ts](https://code.haverbeke.berlin/marijn/getdocs-ts)-style doc comments
96
+ above items that are part of the public API.
97
+
98
+ - When documenting non-public items, you can put the type after a
99
+ single colon, so that getdocs doesn't pick it up and add it to the
100
+ API reference.
101
+
102
+ - ProseMirror does *not* follow JSHint or JSLint prescribed style.
103
+ Patches that try to 'fix' code to pass one of these linters will not
104
+ be accepted.
package/LICENSE ADDED
@@ -0,0 +1,19 @@
1
+ Copyright (C) 2015-2017 by Marijn Haverbeke <marijn@haverbeke.berlin> and others
2
+
3
+ Permission is hereby granted, free of charge, to any person obtaining a copy
4
+ of this software and associated documentation files (the "Software"), to deal
5
+ in the Software without restriction, including without limitation the rights
6
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
7
+ copies of the Software, and to permit persons to whom the Software is
8
+ furnished to do so, subject to the following conditions:
9
+
10
+ The above copyright notice and this permission notice shall be included in
11
+ all copies or substantial portions of the Software.
12
+
13
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
14
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
15
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
16
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
17
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
18
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
19
+ THE SOFTWARE.
package/PUBLISH.md ADDED
@@ -0,0 +1,286 @@
1
+ # GZKX Editor 发包指南
2
+
3
+ ## 准备工作
4
+
5
+ ### 1. 安装 Node.js 和 npm
6
+
7
+ 确保已安装 Node.js (建议 v16+) 和 npm:
8
+
9
+ ```bash
10
+ node -v
11
+ npm -v
12
+ ```
13
+
14
+ ### 2. 配置 npm 镜像(可选)
15
+
16
+ 如果使用国内镜像:
17
+
18
+ ```bash
19
+ npm config set registry https://registry.npmmirror.com
20
+ ```
21
+
22
+ ### 3. 登录 npm
23
+
24
+ ```bash
25
+ npm login
26
+ ```
27
+
28
+ 按提示输入用户名、密码和邮箱。
29
+
30
+ ## 发包步骤
31
+
32
+ ### 方式一:手动发包
33
+
34
+ #### 1. 进入要发布的包目录
35
+
36
+ ```bash
37
+ cd model
38
+ ```
39
+
40
+ #### 2. 查看并确认 package.json
41
+
42
+ 确保 version、name、description 等信息正确:
43
+
44
+ ```json
45
+ {
46
+ "name": "gzkx-editor-model",
47
+ "version": "1.0.0",
48
+ "description": "GZKX Editor 文档模型"
49
+ }
50
+ ```
51
+
52
+ #### 3. 构建包
53
+
54
+ 每个包需要先构建:
55
+
56
+ ```bash
57
+ npm run prepare
58
+ # 或手动构建
59
+ npm run build
60
+ ```
61
+
62
+ #### 4. 发布到 npm
63
+
64
+ ```bash
65
+ npm publish --access public
66
+ ```
67
+
68
+ 对于 scoped 包(如 @your-scope/package)使用:
69
+
70
+ ```bash
71
+ npm publish --access public
72
+ ```
73
+
74
+ ### 方式二:批量发包脚本
75
+
76
+ 在项目根目录创建 `publish-all.sh`:
77
+
78
+ ```bash
79
+ #!/bin/bash
80
+
81
+ PACKAGES=(
82
+ "model"
83
+ "state"
84
+ "view"
85
+ "commands"
86
+ "transform"
87
+ "keymap"
88
+ "inputrules"
89
+ "history"
90
+ "collab"
91
+ "gapcursor"
92
+ "schema-basic"
93
+ "schema-list"
94
+ "menu"
95
+ "example-setup"
96
+ "markdown"
97
+ "dropcursor"
98
+ "search"
99
+ "changeset"
100
+ "test-builder"
101
+ )
102
+
103
+ for pkg in "${PACKAGES[@]}"; do
104
+ echo "Publishing $pkg..."
105
+ cd "$pkg"
106
+ npm publish --access public
107
+ cd ..
108
+ echo "$pkg published successfully!"
109
+ done
110
+
111
+ echo "All packages published!"
112
+ ```
113
+
114
+ 运行:
115
+
116
+ ```bash
117
+ chmod +x publish-all.sh
118
+ ./publish-all.sh
119
+ ```
120
+
121
+ ## 包发布流程详解
122
+
123
+ ### 1. 版本号管理
124
+
125
+ 采用语义化版本 (SemVer):
126
+
127
+ - **主版本 (major)**:不兼容的 API 变更
128
+ - **次版本 (minor)**:向后兼容的功能新增
129
+ - **补丁版本 (patch)**:向后兼容的问题修复
130
+
131
+ ```bash
132
+ # 升级补丁版本
133
+ npm version patch
134
+
135
+ # 升级次版本
136
+ npm version minor
137
+
138
+ # 升级主版本
139
+ npm version major
140
+ ```
141
+
142
+ ### 2. 发布前检查清单
143
+
144
+ - [ ] 更新 CHANGELOG.md
145
+ - [ ] 更新 version 字段
146
+ - [ ] 运行测试确保没有破坏性变更
147
+ - [ ] 检查 package.json 中的 description、maintainers 等信息
148
+ - [ ] 确认没有敏感信息泄露
149
+
150
+ ### 3. 打标签
151
+
152
+ ```bash
153
+ git add .
154
+ git commit -m "Release v1.0.0"
155
+ git tag -a v1.0.0 -m "Release version 1.0.0"
156
+ git push origin main --tags
157
+ ```
158
+
159
+ ## 发布到私有 Registry
160
+
161
+ ### 使用 Verdaccio
162
+
163
+ 1. 全局安装 Verdaccio:
164
+
165
+ ```bash
166
+ npm install -g verdaccio
167
+ ```
168
+
169
+ 2. 启动私有 registry:
170
+
171
+ ```bash
172
+ verdaccio
173
+ ```
174
+
175
+ 3. 修改 npm 配置指向私有 registry:
176
+
177
+ ```bash
178
+ npm config set registry http://localhost:4873
179
+ ```
180
+
181
+ 4. 登录:
182
+
183
+ ```bash
184
+ npm adduser --registry http://localhost:4873
185
+ ```
186
+
187
+ 5. 发布到私有 registry:
188
+
189
+ ```bash
190
+ cd model
191
+ npm publish --registry http://localhost:4873
192
+ ```
193
+
194
+ ## 常见问题
195
+
196
+ ### 1. 发布失败:need to login
197
+
198
+ ```bash
199
+ npm login
200
+ ```
201
+
202
+ ### 2. 发布失败:cannot modify version
203
+
204
+ 已发布的版本不能重复发布,需要升级版本号。
205
+
206
+ ### 3. 权限问题 (403 Forbidden)
207
+
208
+ 确保你有该包的管理权限,或者先创建新的包名。
209
+
210
+ ### 4. scoped 包发布
211
+
212
+ 如果使用 `@gzkx-editor/model` 格式,需要先在 npm 上创建 organization:
213
+
214
+ ```bash
215
+ npm org create gzkx-editor
216
+ ```
217
+
218
+ 然后发布:
219
+
220
+ ```bash
221
+ npm publish --access public
222
+ ```
223
+
224
+ ## 发布后验证
225
+
226
+ ```bash
227
+ # 查看已发布的包信息
228
+ npm view gzkx-editor-model
229
+
230
+ # 安装验证
231
+ npm install gzkx-editor-model
232
+ ```
233
+
234
+ ## CI/CD 自动发布
235
+
236
+ 可以配合 GitHub Actions 实现自动发布:
237
+
238
+ ```yaml
239
+ # .github/workflows/publish.yml
240
+ name: Publish
241
+
242
+ on:
243
+ release:
244
+ types: [created]
245
+
246
+ jobs:
247
+ publish:
248
+ runs-on: ubuntu-latest
249
+ steps:
250
+ - uses: actions/checkout@v3
251
+ - uses: actions/setup-node@v3
252
+ with:
253
+ node-version: '18'
254
+ registry-url: 'https://registry.npmjs.org'
255
+ - run: npm install
256
+ - run: npm run build
257
+ working-directory: ./model
258
+ - run: npm publish
259
+ env:
260
+ NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
261
+ working-directory: ./model
262
+ ```
263
+
264
+ ## 包依赖关系
265
+
266
+ 发布时请按以下顺序发布(从底层到上层):
267
+
268
+ 1. `gzkx-editor-model` - 无外部依赖
269
+ 2. `gzkx-editor-transform` - 依赖 model
270
+ 3. `gzkx-editor-state` - 依赖 model, transform, view
271
+ 4. `gzkx-editor-view` - 依赖 model, state, transform
272
+ 5. `gzkx-editor-commands` - 依赖 model, state, transform
273
+ 6. `gzkx-editor-keymap` - 依赖 state
274
+ 7. `gzkx-editor-inputrules` - 依赖 state, transform
275
+ 8. `gzkx-editor-history` - 依赖 state, transform, view
276
+ 9. `gzkx-editor-dropcursor` - 依赖 state, view, transform
277
+ 10. `gzkx-editor-gapcursor` - 依赖 keymap, model, state, view
278
+ 11. `gzkx-editor-schema-basic` - 依赖 model
279
+ 12. `gzkx-editor-schema-list` - 依赖 model, transform, state
280
+ 13. `gzkx-editor-menu` - 依赖 state, commands, history
281
+ 14. `gzkx-editor-collab` - 依赖 state, history, model, transform
282
+ 15. `gzkx-editor-example-setup` - 依赖多个上游包
283
+ 16. `gzkx-editor-markdown` - 依赖 model
284
+ 17. `gzkx-editor-search` - 依赖 model, state, view
285
+ 18. `gzkx-editor-changeset` - 依赖 transform
286
+ 19. `gzkx-editor-test-builder` - 依赖 model, schema-basic, schema-list
package/README.md ADDED
@@ -0,0 +1,80 @@
1
+ **This repository has moved to https://code.haverbeke.berlin/prosemirror/prosemirror**
2
+
3
+ # prosemirror
4
+
5
+ [ [**WEBSITE**](https://prosemirror.net) | [**ISSUES**](https://code.haverbeke.berlin/prosemirror/prosemirror/issues) | [**FORUM**](https://discuss.prosemirror.net) ]
6
+
7
+ ProseMirror is a well-behaved rich semantic content editor based on
8
+ contentEditable, with support for collaborative editing and custom
9
+ document schemas.
10
+
11
+ The ProseMirror library consists of a number of separate
12
+ [modules](https://code.haverbeke.berlin/prosemirror/). This repository just
13
+ serves as a central issue tracker, and holds a script to help easily
14
+ check out all the core modules for development.
15
+
16
+ The [project page](https://prosemirror.net) has more information, a
17
+ number of [examples](https://prosemirror.net/examples/) and the
18
+ [documentation](https://prosemirror.net/docs/).
19
+
20
+ This code is released under an
21
+ [MIT license](https://code.haverbeke.berlin/prosemirror/prosemirror/src/branch/main/LICENSE).
22
+ There's a [forum](http://discuss.prosemirror.net) for general
23
+ discussion and support requests, and the
24
+ [bug tracker](https://code.haverbeke.berlin/prosemirror/prosemirror/issues)
25
+ is the place to report issues.
26
+
27
+ **STOP READING HERE IF YOU'RE SIMPLY _USING_ PROSEMIRROR. YOU CAN
28
+ INSTALL THE SEPARATE [NPM
29
+ MODULES](https://www.npmjs.com/search?q=prosemirror-) FOR THAT. THE
30
+ INSTRUCTIONS BELOW ONLY APPLY WHEN _DEVELOPING_ PROSEMIRROR!**
31
+
32
+ ## Setting up a dev environment
33
+
34
+ Clone this repository, and make sure you have
35
+ [node](https://nodejs.org/en/) installed.
36
+ Next, from the cloned directory run:
37
+
38
+ bin/pm install
39
+
40
+ This will fetch the submodules, install their dependencies, and build
41
+ them.
42
+
43
+ The `bin/pm` script in this repository provides functionality for
44
+ working with the repositories:
45
+
46
+ * `bin/pm build` rebuilds all the modules
47
+
48
+ * `bin/pm watch` sets up a process that automatically rebuilds the
49
+ modules when they change
50
+
51
+ * `bin/pm status` prints the git status of all submodules
52
+
53
+ * `bin/pm commit <args>` runs `git commit` with the given arguments
54
+ in all submodules that have pending changes
55
+
56
+ * `bin/pm test` runs the (non-browser) tests in all modules
57
+
58
+ * `bin/pm push` runs `git push` in all modules
59
+
60
+ * `bin/pm grep <pattern>` greps through the source code for the
61
+ modules for the given pattern
62
+
63
+ * `bin/pm dev-start` starts a server that rebuilds the packages
64
+ whenever their sources change, and exposes the demo (`demo/*`)
65
+ under a webserver on port 8080
66
+
67
+ (Functionality for managing releases will be added in the future.)
68
+
69
+ ## Community
70
+
71
+ Development of ProseMirror happens in the various repositories exposed
72
+ under the [ProseMirror](https://code.haverbeke.berlin/prosemirror/) organization
73
+ on code.haverbeke.berlin. Bugs for core packages are tracked in the [bug
74
+ tracker](https://code.haverbeke.berlin/prosemirror/prosemirror/issues) for the
75
+ meta repository.
76
+
77
+ We aim to be an inclusive, welcoming community. To make that explicit,
78
+ we have a [code of
79
+ conduct](http://contributor-covenant.org/version/1/1/0/) that applies
80
+ to communication around the project.