pro-editor-schema 1.1.3 → 1.1.4

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/README.md CHANGED
@@ -18,18 +18,73 @@ npm install
18
18
 
19
19
  ## Scripts
20
20
 
21
- | Command | Description |
22
- | --- | --- |
23
- | `npm run dev` | Build in watch mode |
24
- | `npm run build` | Build CJS, ESM, and type declarations |
25
- | `npm run typecheck` | Run TypeScript without emitting files |
26
- | `npm run lint` | Run ESLint on `src/` |
27
- | `npm run test` | Run tests once with Vitest |
28
- | `npm run test:watch` | Run tests in watch mode |
29
- | `npm run check` | Run the full verification pipeline (`npm ci`, `typecheck`, `lint`, `test`, `build`) |
21
+ | Command | Description |
22
+ | -------------------- | ----------------------------------------------------------------------------------- |
23
+ | `npm run dev` | Build in watch mode |
24
+ | `npm run build` | Build CJS, ESM, and type declarations |
25
+ | `npm run typecheck` | Run TypeScript without emitting files |
26
+ | `npm run lint` | Run ESLint on `src/` |
27
+ | `npm run test` | Run tests once with Vitest |
28
+ | `npm run test:watch` | Run tests in watch mode |
29
+ | `npm run check` | Run the full verification pipeline (`npm ci`, `typecheck`, `lint`, `test`, `build`) |
30
30
 
31
31
  For local development, `npm run check` is the fastest way to verify everything before pushing.
32
32
 
33
+ ## Publishing
34
+
35
+ The package is published to npm as `pro-editor-schema`. Use the `staging` tag for pre-release installs, and the default `latest` tag for production.
36
+
37
+ ### Prerequisites
38
+
39
+ 1. You must have publish access to the `pro-editor-schema` package on npm.
40
+ 2. Log in if needed:
41
+
42
+ ```bash
43
+ npm login
44
+ ```
45
+
46
+ 3. Bump the version in `package.json` (and commit it). npm rejects republishing an existing version.
47
+ 4. Verify the package:
48
+
49
+ ```bash
50
+ npm run check
51
+ ```
52
+
53
+ ### Publish to staging
54
+
55
+ ```bash
56
+ npm publish --tag staging --access public
57
+ ```
58
+
59
+ Install the staging build in a consumer app with:
60
+
61
+ ```bash
62
+ npm install pro-editor-schema@staging
63
+ ```
64
+
65
+ ### Publish to production
66
+
67
+ Production uses npm’s default `latest` tag:
68
+
69
+ ```bash
70
+ npm publish --access public
71
+ ```
72
+
73
+ Install the production build with:
74
+
75
+ ```bash
76
+ npm install pro-editor-schema
77
+ # or explicitly:
78
+ npm install pro-editor-schema@latest
79
+ ```
80
+
81
+ ### Notes
82
+
83
+ - Always run `npm run check` before publishing so typecheck, lint, tests, and build succeed.
84
+ - Each publish needs a new `version` in `package.json`.
85
+ - Staging and production can point at different versions at the same time (for example `1.1.3` on `staging` and `1.1.2` on `latest`).
86
+ - GitHub Actions also publishes to `latest` when you push a `v*` git tag (see `.github/workflows/publish.yml`).
87
+
33
88
  ## CI
34
89
 
35
90
  GitHub Actions runs on push and pull requests to `main` / `master`:
@@ -125,12 +180,10 @@ const para = createElement({
125
180
  ```ts
126
181
  import { validateXml } from "pro-editor-schema";
127
182
 
128
- const errors = validateXml(
129
- rootElement,
130
- elementsToLink,
131
- linkElements,
132
- ["para", "heading"],
133
- );
183
+ const errors = validateXml(rootElement, elementsToLink, linkElements, [
184
+ "para",
185
+ "heading",
186
+ ]);
134
187
  ```
135
188
 
136
189
  `validateXml` parameters:
package/dist/index.js CHANGED
@@ -2982,7 +2982,7 @@ var validateReferenceCited = (referenceElement, linkElements) => {
2982
2982
 
2983
2983
  // src/validation/validateWeblink.ts
2984
2984
  var import_mark = __toESM(require("mark.js"));
2985
- var WEB_URI_PATTERN = "(?:(?:https?):\\/\\/)?(?:[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?\\.)+[a-zA-Z]{2,}(?::\\d{1,5})?(?:\\/[^\\s]*)?";
2985
+ var WEB_URI_PATTERN = "(?:(?:https?):\\/\\/|www\\.)(?:[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?\\.)+[a-zA-Z]{2,}(?::\\d{1,5})?(?:\\/[^\\s]*)?";
2986
2986
  var WEB_URI_IN_TEXT_REGEX = new RegExp(WEB_URI_PATTERN, "gi");
2987
2987
  var POSSIBLE_WEBLINK_EXCLUDE_SELECTORS = [
2988
2988
  "tag",
package/dist/index.mjs CHANGED
@@ -2904,7 +2904,7 @@ var validateReferenceCited = (referenceElement, linkElements) => {
2904
2904
 
2905
2905
  // src/validation/validateWeblink.ts
2906
2906
  import Mark from "mark.js";
2907
- var WEB_URI_PATTERN = "(?:(?:https?):\\/\\/)?(?:[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?\\.)+[a-zA-Z]{2,}(?::\\d{1,5})?(?:\\/[^\\s]*)?";
2907
+ var WEB_URI_PATTERN = "(?:(?:https?):\\/\\/|www\\.)(?:[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?\\.)+[a-zA-Z]{2,}(?::\\d{1,5})?(?:\\/[^\\s]*)?";
2908
2908
  var WEB_URI_IN_TEXT_REGEX = new RegExp(WEB_URI_PATTERN, "gi");
2909
2909
  var POSSIBLE_WEBLINK_EXCLUDE_SELECTORS = [
2910
2910
  "tag",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "pro-editor-schema",
3
- "version": "1.1.3",
3
+ "version": "1.1.4",
4
4
  "description": "Pro Editor XML schemas",
5
5
  "main": "dist/index.js",
6
6
  "module": "dist/index.mjs",