@nocobase/app-skills 0.1.0-beta.30 → 0.1.0-beta.32

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@nocobase/app-skills",
3
- "version": "0.1.0-beta.30",
3
+ "version": "0.1.0-beta.32",
4
4
  "description": "Agent Skills for developing, upgrading and deploying NocoBase applications.",
5
5
  "license": "Apache-2.0",
6
6
  "repository": {
@@ -18,7 +18,7 @@
18
18
  "devDependencies": {
19
19
  "@playwright/test": "^1.62.1",
20
20
  "prettier": "^3.9.6",
21
- "@nocobase/dev-config": "0.1.0-beta.21"
21
+ "@nocobase/dev-config": "0.1.0-beta.22"
22
22
  },
23
23
  "peerDependencies": {
24
24
  "@playwright/test": "^1.62.1",
@@ -47,13 +47,27 @@ node -p "JSON.stringify(require('./package.json').nocobase, null, 2)"
47
47
 
48
48
  If `nocobase.templatePackage` is missing, use the confirmed package name for `TEMPLATE` instead of the manifest lookup below, then record it in the manifest during the agreed source merge.
49
49
 
50
- ## 3. Fetch both releases
50
+ ## 3. Select the release channel and fetch both releases
51
+
52
+ Resolve the user's requested channel before choosing TARGET. An explicit version takes precedence. For a beta upgrade, use the template's `beta` dist-tag; for an explicit `latest` upgrade, use its `latest` dist-tag. If the user only asks to upgrade, retain the baseline's channel: use `beta` for a beta baseline and `latest` for a stable baseline; clarify other prerelease channels instead of guessing. State the selected channel and resolved version in the upgrade plan.
53
+
54
+ The tags are independent pointers, not a version ordering: `beta` tracks beta releases, while `latest` is npm's default tag and can still point to an older beta before a stable release exists. Do not assume `latest` is newer or stable, or choose the highest version across all channels. If the user asks for a stable release but `latest` resolves to a prerelease, explain that the tag does not provide a stable target and clarify before proceeding. A missing requested tag is not permission to fall back to another channel.
51
55
 
52
56
  ```bash
53
57
  REGISTRY=https://registry.npmjs.org
54
58
  TEMPLATE=$(node -p "require('./package.json').nocobase.templatePackage")
55
59
  BASE=$(node -p "require('./package.json').nocobase.defaultTemplateVersion")
56
- TARGET=<target version>
60
+ npm view "$TEMPLATE" dist-tags --json --registry="$REGISTRY"
61
+
62
+ # Set CHANNEL to beta or latest according to the selection above.
63
+ CHANNEL=beta
64
+ TARGET=$(npm view "$TEMPLATE@$CHANNEL" version --registry="$REGISTRY")
65
+ # For an explicitly requested version, assign that exact version to TARGET instead.
66
+ ```
67
+
68
+ Use semantic version ordering to compare the resolved TARGET with BASE. If equal, there is no template upgrade; if older, report the result rather than performing an implicit downgrade. Resolve a tag once, then use that exact version for fetching, the source diff and `defaultTemplateVersion`, even if the tag moves during the upgrade. Fetch dependencies from the target template's manifest; do not independently move every `@nocobase/*` dependency to a dist-tag, since packages have separate versions and release schedules.
69
+
70
+ ```bash
57
71
  WORK=$(mktemp -d)
58
72
 
59
73
  for VERSION in "$BASE" "$TARGET"; do
@@ -65,8 +79,6 @@ done
65
79
 
66
80
  These are published tarballs, not Git checkouts — they carry only what `files` publishes, and npm never publishes `.gitignore`. That is fine: both sides are missing the same things.
67
81
 
68
- Do not read the `beta` dist-tag as "newest". While every release is a prerelease, changesets tags each one `latest` and leaves `beta` on the first version ever published.
69
-
70
82
  ## 4. Read what changed, and who else changed it
71
83
 
72
84
  ```bash
@@ -93,11 +93,11 @@ Extract the archive as the service user or transfer ownership to that user. Writ
93
93
  On a server without a container platform, prefer `@nocobase/app-installer` to running the archive by hand: it installs the archive into a directory of its own, writes `config.yml` and `app.env`, applies migrations, runs the application under pm2, and later upgrades to a new archive with a backup of every SQLite database and an automatic rollback when the new release fails to start. The server needs Node.js 24 and a global pm2, nothing from the project. The global `nocobase-app-installer` Skill drives it, and its `--help` documents every flag:
94
94
 
95
95
  ```bash
96
- npx --registry=https://registry.npmjs.org @nocobase/app-installer install /srv/nocobase/crm --archive /tmp/crm.tar.gz --origin https://apps.example.com
97
- npx --registry=https://registry.npmjs.org @nocobase/app-installer upgrade --dir /srv/nocobase/crm --archive /tmp/crm.tar.gz
96
+ npx --registry=https://registry.npmjs.org @nocobase/app-installer@beta install /srv/nocobase/crm --archive /tmp/crm.tar.gz --origin https://apps.example.com
97
+ npx --registry=https://registry.npmjs.org @nocobase/app-installer@beta upgrade --dir /srv/nocobase/crm --archive /tmp/crm.tar.gz
98
98
  ```
99
99
 
100
- Published product applications can also be deployed with an app-installer version whose `--help` offers `--app`: `install /srv/nocobase/studio --app studio` is equivalent to `--app @nocobase/studio`. This route needs pnpm 11+ and builds the published package on the server without a repository checkout, preserving its identity and version. An npm installation upgrades the same package with `upgrade --dir <root>` (latest), `--to <version or tag>`, or `--rebuild` (installed version). Read `source.kind` in `status` before choosing the upgrade command; an archive installation still needs `--archive`. The same persistent configuration, backup and rollback rules apply.
100
+ Published product applications can also be deployed with an app-installer version whose `--help` offers `--app`: `install /srv/nocobase/studio --app @nocobase/studio@beta` explicitly selects the beta channel. This route needs pnpm 11+ and builds the published package on the server without a repository checkout, preserving its identity and version. An npm installation upgrades the same package with `upgrade --dir <root> --to beta`, an explicitly requested `--to <version or tag>`, or `--rebuild` (installed version). Read `source.kind` in `status` before choosing the upgrade command; an archive installation still needs `--archive`. The same persistent configuration, backup and rollback rules apply.
101
101
 
102
102
  `install --base-path /crm` chooses the mount path and writes it to `app.env` as `APP_BASE_PATH`; without it the server default `/main` applies. Upgrades keep the path `app.env` names, and editing it there moves the application on its next start. The installer refuses an archive for another application, an older version or another machine. The same version built again deploys as a new release, so the version need not be bumped for each deployment. An archive from an `@nocobase/app-cli` that predates relocatable builds has its mount path compiled in and runs only at that path, so a mismatch is refused with `BASE_PATH_MISMATCH`; one older still, which records no build time, or a release whose `@nocobase/app-server` predates `APP_STORAGE_DIR`, is refused: upgrade the project's NocoBase packages and build again. Each application on the server gets its own directory, port and pm2 process.
103
103