@nimiplatform/app-tools 0.12.4 → 0.13.1
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 +137 -494
- package/lib/app-dependency-combinations.mjs +1 -0
- package/lib/app-doctor-update.mjs +8 -2
- package/lib/app-project-lifecycle.mjs +1 -1
- package/lib/app-scaffold-profiles.mjs +85 -28
- package/lib/app-scaffold.mjs +10 -1
- package/package.json +4 -5
- package/skills/nimi-app-lifecycle/references/safety-declaration.md +1 -1
- package/skills/nimi-app-lifecycle/references/upgrade-platform.md +20 -11
- package/templates/app-source/src/ai-studio-core/messages/en.json +2 -0
- package/templates/app-source/src/ai-studio-core/messages/zh.json +2 -0
- package/templates/app-source/src/ai-studio-core/section-ai-testing.tsx +8 -1
- package/templates/app-source/src/ai-studio-core/workspace.tsx +31 -7
- package/templates/app-source/src/workbench-core/workbench-core.css +4 -0
- package/templates/app-source/src/workbench-core/workbench-core.tsx +5 -3
- package/templates/default-starter/AGENTS.md +1 -1
- package/templates/default-starter/README.md +46 -41
- package/templates/default-starter/src/shell/App.tsx +14 -2
- package/templates/default-starter/src/shell/authenticated-shell.tsx +5 -6
- package/templates/default-starter/tsconfig.json +1 -0
|
@@ -1,19 +1,21 @@
|
|
|
1
1
|
# Acme Widget
|
|
2
2
|
|
|
3
|
-
This standalone App was generated
|
|
3
|
+
This standalone App was generated from an identity-neutral base combined with the explicitly selected admitted features.
|
|
4
4
|
|
|
5
5
|
Profile: `standalone`.
|
|
6
6
|
|
|
7
|
-
|
|
8
|
-
- App-owned license: `LICENSE` starts as an MIT license naming the package author, or the App title when no author was given. Replace it with the App's own terms as needed and declare the matching `license` identifier in `package.json` before packaging; `sync` never rewrites it.
|
|
9
|
-
- Scaffold-managed code: carrier/auth wiring, identity, manifests, build/release inputs, managed workflow, generated composition glue, and the template's own license notice in `licenses/nimi-app-template.txt`.
|
|
10
|
-
- Package-owned projections: `.nimi/{config,contracts,methodology}/**`, materialized by the pinned local `nimicoding` package during `init`.
|
|
7
|
+
## Code Ownership
|
|
11
8
|
|
|
12
|
-
`
|
|
9
|
+
- **App-owned product code**: `src/workbench-core/**`, selected `src/capabilities/**`, `src/shell/routes/app-navigation.tsx`, and your subsequent product edits. Extend the App-owned destination catalog and use its single Kit controller for navigation position. Keep drafts, business records, and one-time actions within their respective business owners. If no feature was selected, the base starts without a sidebar or fold command.
|
|
10
|
+
- **App-owned license**: `LICENSE` starts as an MIT license naming the package author (or the App title if no author was given). Replace it with the App's own terms as needed and set the matching `license` identifier in `package.json` before packaging. `sync` never rewrites `LICENSE`.
|
|
11
|
+
- **Scaffold-managed code**: Carrier and auth wiring, identity, manifests, build/release inputs, managed workflows, generated composition glue, and the template's own license notice in `licenses/nimi-app-template.txt`.
|
|
12
|
+
- **Package-owned projections**: `.nimi/{config,contracts,methodology}/**`, materialized by the pinned local `nimicoding` package during `init`.
|
|
13
|
+
|
|
14
|
+
`sync` refreshes scaffold-managed files without overwriting App-owned code. `check` is read-only and non-mutating. Changing the App's identity, profile, or direct feature selection requires generating a fresh scaffold.
|
|
13
15
|
|
|
14
16
|
## Workflow
|
|
15
17
|
|
|
16
|
-
`create` has completed.
|
|
18
|
+
`create` has completed. Run the following commands in order:
|
|
17
19
|
|
|
18
20
|
```bash
|
|
19
21
|
pnpm install
|
|
@@ -25,51 +27,54 @@ pnpm run app:build -- --target windows-x86_64
|
|
|
25
27
|
pnpm dev
|
|
26
28
|
```
|
|
27
29
|
|
|
28
|
-
|
|
30
|
+
### Local Development
|
|
31
|
+
|
|
32
|
+
`pnpm dev` launches the official Desktop-supervised Electron development Host. Launching the renderer, Electron, or Tauri directly does not establish protected Nimi access.
|
|
33
|
+
|
|
34
|
+
### Building & Carrier Layout
|
|
35
|
+
|
|
36
|
+
The default `windows-x86_64` build outputs a fresh non-installer Electron directory at `dist-electron-package/acme-widget-shell-win32-x64/`, containing:
|
|
37
|
+
|
|
38
|
+
- The App-specific executable `acme-widget-shell.exe`
|
|
39
|
+
- ASAR-packaged JavaScript and renderer assets
|
|
40
|
+
- Unpacked native add-ons and shared libraries (`**/*.{node,dylib,dll}`) with their relative layout preserved for the OS loader
|
|
41
|
+
|
|
42
|
+
The production bundle rejects `--nimi-dev-renderer-url`. The protected native binding arrives only through Kit's optional dependency—do not add it directly to this App.
|
|
29
43
|
|
|
30
|
-
|
|
44
|
+
`pnpm run build:tauri:production` remains an explicit alternative when a Tauri build profile is deliberately selected; it is not the default production carrier.
|
|
31
45
|
|
|
32
|
-
|
|
46
|
+
### Packaging & Release Boundaries
|
|
33
47
|
|
|
34
|
-
|
|
48
|
+
After a real target build finishes, run `pnpm run pack -- --target <target-id>`. `app-tools` is the sole package owner and intentionally provides no local `publish` command. Pushing a protected version tag triggers the managed GitHub Release workflow; you then submit the resulting immutable Release through the separate Registry pull-request and human-review flow.
|
|
35
49
|
|
|
36
|
-
`
|
|
50
|
+
Before cutting a production release, the public GitHub repository must enable a protected `v*` tag ruleset and immutable releases, and provide a read-only repository-admin token to verify those settings. On Windows, tag-triggered production builds run the App-declared build owner without a Nimi signing step. Publishers may sign the exact declared Host through their own build or signing custody; production `pack` records either a verified Authenticode signature or an explicit unsigned posture, and rejects invalid or unresolved signatures. Manual workflow dispatch runs only the non-production path.
|
|
37
51
|
|
|
38
|
-
Runtime, Realm, registry admission, installed state and process truth remain with their canonical owners. This repository stores no Runtime credentials or protected session material.
|
|
52
|
+
A GitHub Release remains independent from registry admission, Runtime installation, Desktop launch, and Nimi Access. Runtime, Realm, registry admission, installed state, and process truth remain with their canonical owners. This repository stores no Runtime credentials or protected session material.
|
|
39
53
|
|
|
40
54
|
## Publish with GitHub
|
|
41
55
|
|
|
42
|
-
`NIMI_REPOSITORY_ADMIN_TOKEN` is only
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
for repository setup, permission details, version tagging, and
|
|
60
|
-
recovery from setup errors. Local checks do not verify GitHub secrets.
|
|
61
|
-
|
|
62
|
-
Run `pnpm exec nimi-app check --production`, then the real production build
|
|
63
|
-
and pack. Commit the release on the repository's default branch and push an
|
|
64
|
-
annotated `v<package.json version>` tag. Watch **Actions → nimi-app-release**.
|
|
65
|
-
If a repository setting or secret is missing, fix it and **Re-run failed jobs**;
|
|
66
|
-
keep the existing tag. Registry admission is a separate human review after
|
|
67
|
-
the immutable Release exists.
|
|
56
|
+
`NIMI_REPOSITORY_ADMIN_TOKEN` is used only to inspect tag-protection and Release immutability settings and requires **Administration: Read-only** permission. The built-in GitHub token handles the actual Release upload but cannot read the Release immutability setting. Local development does not require `NIMI_REPOSITORY_ADMIN_TOKEN`.
|
|
57
|
+
|
|
58
|
+
Complete these one-time repository settings before pushing a release tag:
|
|
59
|
+
|
|
60
|
+
1. **Settings → General → Releases:** Enable Release immutability.
|
|
61
|
+
2. **Settings → Rules → Rulesets:** Create an active tag ruleset for `v*` that restricts updates and deletions.
|
|
62
|
+
3. [Create a fine-grained token](https://github.com/settings/personal-access-tokens/new) scoped to this repository's owner and only this repository, with **Administration: Read-only**. Complete organization approval if required.
|
|
63
|
+
4. **Settings → Secrets and variables → Actions → New repository secret:** Save the token under the exact name `NIMI_REPOSITORY_ADMIN_TOKEN`.
|
|
64
|
+
|
|
65
|
+
See the [step-by-step publishing guide](https://github.com/nimiplatform/nimi/blob/main/app-tools/README.md#publishing-on-github) for repository setup, permission details, version tagging, and recovery from setup errors. Local checks do not verify GitHub secrets.
|
|
66
|
+
|
|
67
|
+
When ready to release:
|
|
68
|
+
|
|
69
|
+
1. Run `pnpm exec nimi-app check --production`, followed by the real production build and pack.
|
|
70
|
+
2. Commit the release on the repository's default branch and push an annotated `v<package.json version>` tag.
|
|
71
|
+
3. Monitor **Actions → nimi-app-release**. If a repository setting or secret is missing, fix it and choose **Re-run failed jobs** while keeping the existing tag.
|
|
72
|
+
4. Submit the resulting immutable Release for separate human review to request registry admission.
|
|
68
73
|
|
|
69
74
|
## Support
|
|
70
75
|
|
|
71
|
-
Report startup or Runtime issues through this repository's issue tracker.
|
|
76
|
+
Report startup or Runtime issues through this repository's issue tracker. Remove credentials and other private data from all diagnostics before submitting.
|
|
72
77
|
|
|
73
78
|
## Acceptance status
|
|
74
79
|
|
|
75
|
-
This README does not certify the App. Dependency
|
|
80
|
+
This README does not certify the App. Dependency installation, tests, builds, target packaging, GitHub Releases, registry admission, Runtime installation, Desktop launch, and principal user interactions remain `NOT-VERIFIED` until actually executed. Focused tests or CDP visibility do not constitute release acceptance.
|
|
@@ -1,5 +1,9 @@
|
|
|
1
1
|
import { WorkbenchRuntimeGate } from '../workbench-core/index.js';
|
|
2
2
|
import { NimiToaster } from '@nimiplatform/kit/ui';
|
|
3
|
+
import { NimiAppChrome } from '@nimiplatform/kit/ui/app-chrome';
|
|
4
|
+
import appPackage from '../../package.json';
|
|
5
|
+
import { hasGeneratedViews } from '../scaffold/generated/navigation.js';
|
|
6
|
+
import { AppNavigationProvider, useAppNavigation } from './routes/app-navigation.js';
|
|
3
7
|
import { AuthenticatedShell } from './authenticated-shell.js';
|
|
4
8
|
import {
|
|
5
9
|
appTitle,
|
|
@@ -10,8 +14,15 @@ import {
|
|
|
10
14
|
} from './workbench-target-adapter.js';
|
|
11
15
|
|
|
12
16
|
export function App() {
|
|
17
|
+
return <AppNavigationProvider><AppFrame /></AppNavigationProvider>;
|
|
18
|
+
}
|
|
19
|
+
function AppFrame() {
|
|
20
|
+
const owner = useAppNavigation();
|
|
13
21
|
return (
|
|
14
|
-
|
|
22
|
+
<div className="flex h-full min-h-0 flex-col overflow-hidden">
|
|
23
|
+
<NimiAppChrome metadata={{ name: appTitle, version: appPackage.version, license: 'license' in appPackage && typeof appPackage.license === 'string' ? appPackage.license : undefined }} navigation={owner.navigation} navigationEnabled={owner.ready}
|
|
24
|
+
sidebar={hasGeneratedViews && owner.ready ? { visible: owner.sidebarVisible, onVisibleChange: owner.setSidebarVisible } : undefined} />
|
|
25
|
+
<div className="flex min-h-0 flex-1 flex-col overflow-hidden">
|
|
15
26
|
<WorkbenchRuntimeGate
|
|
16
27
|
appTitle={appTitle}
|
|
17
28
|
copy={targetRuntimeGateCopy}
|
|
@@ -21,7 +32,8 @@ export function App() {
|
|
|
21
32
|
>
|
|
22
33
|
<AuthenticatedShell />
|
|
23
34
|
</WorkbenchRuntimeGate>
|
|
35
|
+
</div>
|
|
24
36
|
<NimiToaster />
|
|
25
|
-
|
|
37
|
+
</div>
|
|
26
38
|
);
|
|
27
39
|
}
|
|
@@ -1,13 +1,12 @@
|
|
|
1
1
|
import { AmbientBackground } from '@nimiplatform/kit/ui';
|
|
2
2
|
import { ProductArea } from './routes/product-area.js';
|
|
3
|
+
import { useEffect } from 'react';
|
|
4
|
+
import { useAppNavigation } from './routes/app-navigation.js';
|
|
3
5
|
|
|
4
|
-
//
|
|
5
|
-
// The app owns its full canvas directly: a kit AmbientBackground glass backdrop
|
|
6
|
-
// hosts the product area full-bleed. There is no competing scaffold chrome to
|
|
7
|
-
// hide — the previous app-chrome header + side-panel (which the workbench had to
|
|
8
|
-
// CSS-hide) are removed. Product chrome (navigation, command bar, identity) is
|
|
9
|
-
// owned by the product area, not duplicated here.
|
|
6
|
+
// The ready subtree declares availability; its teardown fences App navigation.
|
|
10
7
|
export function AuthenticatedShell() {
|
|
8
|
+
const { setReady } = useAppNavigation();
|
|
9
|
+
useEffect(() => { setReady(true); return () => setReady(false); }, [setReady]);
|
|
11
10
|
return (
|
|
12
11
|
<AmbientBackground
|
|
13
12
|
variant="mesh"
|