pro-editor-schema 1.6.6-beta.1 → 1.6.6-dev.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.
Files changed (2) hide show
  1. package/README.md +33 -34
  2. package/package.json +2 -5
package/README.md CHANGED
@@ -31,10 +31,7 @@ npm install
31
31
  | `npm run test` | Run tests once with Vitest |
32
32
  | `npm run test:watch` | Run tests in watch mode |
33
33
  | `npm run check` | Run the full verification pipeline (`npm ci`, `typecheck`, `lint`, `test`, `build`) |
34
- | `npm run release:patch` | Create `release/v*`, bump patch, and push (`1.3.4` → `1.3.5`) |
35
- | `npm run release:minor` | Create `release/v*`, bump minor, and push (`1.3.4` → `1.4.0`) |
36
- | `npm run release:major` | Create `release/v*`, bump major, and push (`1.3.4` → `2.0.0`) |
37
- | `npm run release:prerelease` | Create `prerelease/v*`, bump prerelease, and push (`1.4.0` → `1.4.1-beta.0`) |
34
+ | `npm run pr` | Open a PR into master, or into a new release/prerelease branch (see Publishing) |
38
35
 
39
36
  For local development, `npm run check` is the fastest way to verify everything before pushing.
40
37
 
@@ -42,48 +39,50 @@ For local development, `npm run check` is the fastest way to verify everything b
42
39
 
43
40
  The package is published to npm as `pro-editor-schema`.
44
41
 
45
- Publishing is automated by GitHub Actions when a pull request into `master` is merged from a `release/` or `prerelease/` branch.
42
+ A dev only creates a branch, pushes the fix and runs `npm run pr`. PRs are never merged automatically: someone reviews and merges them.
46
43
 
47
- | Branch prefix | npm dist-tag |
48
- | ------------- | ------------ |
49
- | `release/` | `latest` |
50
- | `prerelease/` | `prerelease` |
44
+ ### Release flow
51
45
 
52
- Other merged branches do not publish.
46
+ 1. Create your branch (e.g. `fix/code`) from the branch you want to build on, its **source**: `master`, a `release/v*` branch for a hotfix (e.g. `git switch -c fix/code origin/release/v1.6.0`), or a `prerelease/v*` branch for the next dev version. Commit your work.
47
+ 2. Run:
53
48
 
54
- ### Prerequisites
55
-
56
- 1. You must have publish access to the `pro-editor-schema` package on npm.
57
- 2. Start from a clean git working tree.
49
+ ```bash
50
+ npm run pr
51
+ ```
58
52
 
59
- ### Publish a release
53
+ It shows your branch's source, then asks what to create. The option matching the source is preselected.
60
54
 
61
- From your current branch, run one of:
55
+ | Choice | What the script does |
56
+ | ------------ | ------------------------------------------------------------------------------------------------------------ |
57
+ | `No version` | Opens a PR into the source. Nothing is released. (Preselected for `master`.) |
58
+ | `Release` | Asks patch / minor / major, creates `release/v<version>` from the source, commits the version bump on your branch and opens a PR into it. npm tag `latest`. (Preselected for `release/*`.) |
59
+ | `Prerelease` | Same with a dev version and `prerelease/v<version>`, e.g. `prerelease/v1.7.0-dev.0`. npm tag `prerelease`. (Preselected for `prerelease/*`.) |
62
60
 
63
- - `npm run release:patch` — bug fixes / small backwards-compatible changes, e.g. `1.3.4` → branch `release/v1.3.5`
64
- - `npm run release:minor` — backwards-compatible functionality, e.g. `1.3.4` → branch `release/v1.4.0`
65
- - `npm run release:major` — breaking changes, e.g. `1.3.4` → branch `release/v2.0.0`
66
- - `npm run release:prerelease` — beta prerelease, e.g. `1.4.0` → branch `prerelease/v1.4.1-beta.0` (then `1.4.1-beta.0` → `prerelease/v1.4.1-beta.1`)
61
+ The new version is based on the source: npm's `latest` for `master`, otherwise the source branch's version, e.g. a patch from `release/v1.6.0` creates `release/v1.6.1`. A patch release from `master` asks for confirmation first, since it ships all dev changes on `master`. For a hotfix, create your branch from the `release/v*` branch instead.
67
62
 
68
- Each command:
63
+ Version choices (examples starting from `1.6.3`):
69
64
 
70
- 1. Creates the `release/v*` or `prerelease/v*` branch.
71
- 2. Bumps `package.json` and commits the version.
72
- 3. Pushes the branch (and version tag) to origin.
65
+ | Choice | Use for | Example |
66
+ | ------------ | ----------------------------------------- | ------------------------------- |
67
+ | `patch` | bug fixes, small backwards-compatible changes | `1.6.3` → `1.6.4` |
68
+ | `minor` | new backwards-compatible features | `1.6.3` → `1.7.0` |
69
+ | `major` | breaking changes | `1.6.3` → `2.0.0` |
70
+ | `prepatch` | dev version of the next bug-fix version | `1.6.3` → `1.6.4-dev.0` |
71
+ | `preminor` | dev version of the next feature version | `1.6.3` → `1.7.0-dev.0` |
72
+ | `premajor` | dev version of the next breaking version | `1.6.3` → `2.0.0-dev.0` |
73
+ | `prerelease` | next dev version of the same version (shown while one is in progress) | `1.7.0-dev.0` → `1.7.0-dev.1` |
73
74
 
74
- Then open a pull request into `master` and merge it.
75
+ 3. Someone reviews and merges the PR.
76
+ 4. Merging into `release/v<version>` or `prerelease/v<version>` runs `.github/workflows/release.yml`, which creates the `v<version>` tag and GitHub release with generated notes (a pre-release for `prerelease/*`), then starts `.github/workflows/publish.yml`.
77
+ 5. `publish.yml` runs the tests, builds and publishes to npm: dev versions with the `prerelease` dist-tag, others with `latest`. A hotfix older than the current `latest` (e.g. `1.6.1` while `latest` is `1.6.3`) is published as `latest-1.6`, so `latest` never moves backwards; its GitHub release is not marked as Latest either.
78
+ 6. `release.yml` also opens a PR from the release/prerelease branch into `master` (once per branch; later merges update it), so master stays up to date. Someone reviews and merges it; it does not release anything.
75
79
 
76
- Merging a `release/` or `prerelease/` branch into `master` starts the publishing workflow.
80
+ Merging into `master` (or any other branch) does not release or publish anything. Publishing a GitHub release by hand also runs `publish.yml`.
77
81
 
78
- The workflow:
82
+ ### Prerequisites
79
83
 
80
- 1. Checks out the repository.
81
- 2. Installs dependencies with `npm ci`.
82
- 3. Runs the full test suite.
83
- 4. Runs TypeScript typechecking.
84
- 5. Runs ESLint.
85
- 6. Builds the package.
86
- 7. Publishes to npm with the `latest` or `prerelease` dist-tag, based on the branch prefix.
84
+ - The GitHub CLI (`gh`) installed and logged in (`gh auth login`).
85
+ - Do not bump the version yourself; `npm run pr` does it.
87
86
 
88
87
  ### Latest releases
89
88
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "pro-editor-schema",
3
- "version": "1.6.6-beta.1",
3
+ "version": "1.6.6-dev.0",
4
4
  "description": "Pro Editor XML schemas",
5
5
  "main": "dist/index.js",
6
6
  "module": "dist/index.mjs",
@@ -32,10 +32,7 @@
32
32
  "test:watch": "vitest",
33
33
  "generate:docbook": "node scripts/generate-docbook-content-model.mjs",
34
34
  "check": "npm ci && npm run typecheck && npm run lint && npm run test && npm run build",
35
- "release:prerelease": "npm version prerelease --preid=beta && git push origin HEAD",
36
- "release:patch": "npm version patch && git push origin HEAD --follow-tags",
37
- "release:minor": "npm version minor && git push origin HEAD --follow-tags",
38
- "release:major": "npm version major && git push origin HEAD --follow-tags"
35
+ "pr": "bash scripts/create-pr.sh"
39
36
  },
40
37
  "devDependencies": {
41
38
  "@eslint/js": "^10.0.1",