@nocobase/app-skills 0.1.0-beta.31 → 0.1.0-beta.33
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
|
@@ -15,7 +15,7 @@ Use this Skill when building a feature in this application: a page, an endpoint,
|
|
|
15
15
|
|
|
16
16
|
Do not use it to develop a published plugin package. Plugin development has its own protocol and lives in a separate repository.
|
|
17
17
|
|
|
18
|
-
Do not use it to upgrade the template this application was generated from. That is `.agents/skills/nocobase-app-upgrade/`, which reconciles a newer template release against the application without reverting the user's work.
|
|
18
|
+
Do not use it to upgrade the template this application was generated from, which is also how the application moves to a newer NocoBase version when the user asks to upgrade NocoBase or its core. That is `.agents/skills/nocobase-app-upgrade/`, which reconciles a newer template release against the application without reverting the user's work.
|
|
19
19
|
|
|
20
20
|
## Before you start
|
|
21
21
|
|
|
@@ -282,8 +282,10 @@ Application templates configure `logging.loggers.request.file.name: request`, so
|
|
|
282
282
|
|
|
283
283
|
Use `loggingToken` from `@nocobase/app-server/logging` and `logging.getLogger(source)` for application and plugin diagnostics. Sources without a file override share `storage/logs/app.<UTC-date>.<part>.log` containing JSON Lines. `getLogger()` uses source `system`; omit `default`. Only `logging.loggers.<source>.file.name` routes a source into a separate file, without duplicating it into app. Configure `logging.file.enabled`, `name`, `retentionDays`, `maxFileSizeMB`, and `maxTotalSizeMB` independently from `logging.console.enabled` and `logging.console.pretty`. Total retention covers all files in the directory. Both development and production capture structured files; pretty only formats the terminal. Omit legacy top-level `pretty`, `default`, and `maxSizeMB` in new configuration. Host capture policy overrides App and source enablement, output and level settings. Source file overrides accept only `name` and `enabled`; they cannot change the directory or retention budget; outside that boundary explicit custom transports own their destinations.
|
|
284
284
|
|
|
285
|
-
Application composition roots call `createAppFromRuntime(runtime)` to transfer resolved configuration, paths, mode and Host logging policy and bind `runtime.app`. Preserve this when upgrading templates: Host supplies App, deployment, and runtime identities and capture policy through that boundary. Hosted runtime logs belong to the App volume, never the expanded release directory.
|
|
285
|
+
Application composition roots call `createAppFromRuntime(runtime)` to transfer resolved configuration, paths, mode, `NODE_ENV` and Host logging policy and bind `runtime.app`. Preserve this when upgrading templates: Host supplies App, deployment, and runtime identities and capture policy through that boundary. Hosted runtime logs belong to the App volume, never the expanded release directory.
|
|
286
286
|
|
|
287
287
|
`runtime.paths`, the configuration loader’s `context.paths`, and `app.paths` share the resolved `AppPaths` object. It exposes directory fields and `root()`, `server()`, `database()`, `client()`, `config()`, and `storage()` methods. Input `AppPathOptions` is normalized after application path policies run. Standalone declarations provide `deploymentRootDir` relative to the code root; configuration and default storage live in that deployment root, while code resources stay under `rootDir`. Server and CLI use the same declaration.
|
|
288
288
|
|
|
289
289
|
Standalone environment loading reads packaged code-root `.env` defaults, then deployment-root `.env` and `.env.local`, then the process environment and explicit overrides. Packaged defaults remain effective when deployment files are absent. Embedded scopes only use their explicitly supplied environment.
|
|
290
|
+
|
|
291
|
+
Server providers use `app.nodeEnv` for environment checks. `createAppFromRuntime()` copies it from `runtime.env.NODE_ENV`, so an embedded application's behavior does not depend on the hosting process's `process.env.NODE_ENV`. A manually composed `Application` can supply its own `nodeEnv` option; an omitted value remains undefined rather than inheriting the host environment.
|
|
@@ -2,10 +2,17 @@
|
|
|
2
2
|
name: nocobase-app-upgrade
|
|
3
3
|
description: >-
|
|
4
4
|
Upgrade this application to a newer release of the template it was generated
|
|
5
|
-
from
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
5
|
+
from, which is how this application moves to a newer NocoBase version. Users
|
|
6
|
+
rarely think in terms of templates, so use it whenever the user asks to
|
|
7
|
+
upgrade or update NocoBase, the NocoBase core, kernel or framework version,
|
|
8
|
+
or the @nocobase packages as a whole — for example "upgrade NocoBase",
|
|
9
|
+
"update the NocoBase core version", "move to the latest NocoBase release",
|
|
10
|
+
"升级 NocoBase", "升级 NocoBase 内核版本", "更新 NocoBase 到最新版" — as well as
|
|
11
|
+
when they ask to upgrade the template, pull in template changes, move to a
|
|
12
|
+
newer template version, or reconcile the application with upstream. Do not
|
|
13
|
+
use for ordinary feature development, for upgrading a single dependency, or
|
|
14
|
+
for upgrading an already deployed build on a server, which the app installer
|
|
15
|
+
handles.
|
|
9
16
|
metadata:
|
|
10
17
|
short-description: Merge a newer template release into this application
|
|
11
18
|
---
|
|
@@ -47,13 +54,27 @@ node -p "JSON.stringify(require('./package.json').nocobase, null, 2)"
|
|
|
47
54
|
|
|
48
55
|
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
56
|
|
|
50
|
-
## 3.
|
|
57
|
+
## 3. Select the release channel and fetch both releases
|
|
58
|
+
|
|
59
|
+
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.
|
|
60
|
+
|
|
61
|
+
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
62
|
|
|
52
63
|
```bash
|
|
53
64
|
REGISTRY=https://registry.npmjs.org
|
|
54
65
|
TEMPLATE=$(node -p "require('./package.json').nocobase.templatePackage")
|
|
55
66
|
BASE=$(node -p "require('./package.json').nocobase.defaultTemplateVersion")
|
|
56
|
-
|
|
67
|
+
npm view "$TEMPLATE" dist-tags --json --registry="$REGISTRY"
|
|
68
|
+
|
|
69
|
+
# Set CHANNEL to beta or latest according to the selection above.
|
|
70
|
+
CHANNEL=beta
|
|
71
|
+
TARGET=$(npm view "$TEMPLATE@$CHANNEL" version --registry="$REGISTRY")
|
|
72
|
+
# For an explicitly requested version, assign that exact version to TARGET instead.
|
|
73
|
+
```
|
|
74
|
+
|
|
75
|
+
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.
|
|
76
|
+
|
|
77
|
+
```bash
|
|
57
78
|
WORK=$(mktemp -d)
|
|
58
79
|
|
|
59
80
|
for VERSION in "$BASE" "$TARGET"; do
|
|
@@ -65,8 +86,6 @@ done
|
|
|
65
86
|
|
|
66
87
|
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
88
|
|
|
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
89
|
## 4. Read what changed, and who else changed it
|
|
71
90
|
|
|
72
91
|
```bash
|