@assembly-js/app-foundation 0.3.0 → 0.3.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/CHANGELOG.md CHANGED
@@ -19,6 +19,10 @@ A patch release never changes what an app's build requires; a minor release may
19
19
  not by hand; see `changes/README.md`. CI fails a PR that changes a check script without a
20
20
  `bump: minor` change file.
21
21
 
22
+ ## 0.3.1
23
+ - [guidance] The build agent now upgrades an app's bridge to 2.1.0 and its foundation package instead of skipping a deep link, mounts the location reporter, and deep-links notifications to the specific record.
24
+ - [new] App destinations in `NavigateDestination` now accept an optional `path` for links to an app's inner page.
25
+
22
26
  ## 0.3.0
23
27
  - [new] `LocationReporter` is exported from `@assembly-js/app-foundation/client`, so apps born before the deeplink image can mount it in their layout and report their inner location to the host with the same surface-prefix handling as new apps.
24
28
 
package/CLAUDE.md CHANGED
@@ -48,6 +48,9 @@ Assembly-specific gotchas live in `.claude/skills/<name>/SKILL.md`. Invoke them
48
48
  <!-- feature:deep-link-bridge-nav -->
49
49
  - `assembly-platform-links` — link platform records (client, company, invoice, contract, form, file) to their portal detail page via `linkTo()`; never hand-build a host URL. Also links between workspace apps by install id. Check the app's installed app-bridge first (see the skill) — `navigateTo` doesn't exist on older peers — and only link staff-only destinations (client, company, form, etc.) from the dashboard surface, never the client portal.
50
50
  <!-- /feature:deep-link-bridge-nav -->
51
+ <!-- feature:deep-link-app-inner-location -->
52
+ - `assembly-app-inner-location` — mount `<LocationReporter />` so the host mirrors the app's inner page in its address bar; deep-link a notification or link to a specific record with `linkTo({ to: 'app', installId, path })`, never to the app root. Never hand-write location reporting.
53
+ <!-- /feature:deep-link-app-inner-location -->
51
54
  <!-- feature:cross-app-apis -->
52
55
  - `assembly-app-clients` — calling another workspace app through its generated client in `generated/apps/<appId>/` (`installerClient`, by verb and path), and rendering an empty state that names the app when the call is refused instead of a 500.
53
56
  <!-- /feature:cross-app-apis -->
@@ -48,6 +48,7 @@ export type NavigateDestination = {
48
48
  } | {
49
49
  to: 'app';
50
50
  installId: string;
51
+ path?: string;
51
52
  };
52
53
  export type NavigateToOptions = {
53
54
  replace?: boolean;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@assembly-js/app-foundation",
3
- "version": "0.3.0",
3
+ "version": "0.3.1",
4
4
  "description": "Versioned foundation helpers and build context for Assembly generated apps",
5
5
  "type": "module",
6
6
  "files": [
@@ -0,0 +1,19 @@
1
+ <!-- feature:deep-link-app-inner-location -->
2
+ ---
3
+ name: assembly-app-inner-location
4
+ description: Use whenever the app has inner pages the host should mirror in its address bar, or when a notification, email or link should open this app on a specific record instead of its root. Covers mounting LocationReporter and pointing notifications at a specific record.
5
+ ---
6
+
7
+ ## What the reporter does
8
+
9
+ The host mirrors the app's inner page in its own address bar and can open the app straight at an inner page. That only works if the app reports its location, and `<LocationReporter />` from the foundation package does exactly that. The reporter needs `AssemblyBridge.location`, which ships in app-bridge 2.1.0, and a `navigateTo`-only 2.0.0 bridge lacks it. Check with `grep -q onNavigate node_modules/@assembly-js/app-bridge/dist/index.d.ts && echo supported || echo unsupported`; if `unsupported`, run `bun add @assembly-js/app-bridge@2.1.0` (exact stable release, never a prerelease or range), then `bunx tsc --noEmit`, before mounting the reporter.
10
+
11
+ - Mount `<LocationReporter />` once, in `app/layout.tsx`, imported from `@assembly-js/app-foundation/client`. If it is already there, leave it.
12
+ - Never write custom `location.report` or `location.onNavigate` code, and never hand-write a `LocationSync` component. The reporter already handles surface prefixes and route changes.
13
+
14
+ ## Notifications deep-link to the record, not the app root
15
+
16
+ When the app sends an email or in-product notification about a specific record (a document request, a submission), the destination is set by the notification's `ctaParams` and surface, not by `linkTo`. Pass `ctaParams` that identify the record (`ctaParams: { requestId: request.id }`) and render that record from an existing inner route of this app, one that works when opened cold. Follow `assembly-notifications` for the send-and-open pattern.
17
+
18
+ To link from a button inside the app to an inner page, use `linkTo` as described in `assembly-platform-links` (the `app` destination takes an optional `path`).
19
+ <!-- /feature:deep-link-app-inner-location -->
@@ -14,7 +14,13 @@ Before writing any `linkTo()` or `AssemblyBridge.navigateTo()` call, check what
14
14
  grep -q navigateTo node_modules/@assembly-js/app-bridge/dist/index.d.ts && echo supported || echo unsupported
15
15
  ```
16
16
 
17
- If it reports `unsupported`, do not use this skill — there is no supported way for this app to trigger platform navigation yet. Skip the link rather than ship a button that silently does nothing.
17
+ If it reports `unsupported`, upgrade the app in this same turn instead of skipping the link:
18
+
19
+ 1. Confirm the app is on the foundation package: `grep -q app-foundation package.json`. If it is not (vendored `lib/`), say the security update must land first and stop — do not attempt the migration in a feature turn.
20
+ 2. Pin the bridge to the exact stable release: `bun add @assembly-js/app-bridge@2.1.0`. Never pin a prerelease (`-beta`, `-rc`, `-next`) or a range.
21
+ 3. Bump the foundation dependency listed in `package.json` to `^0.3.0`, the floor that exports `linkTo` and `LocationReporter` (`bun add <that package name>@^0.3.0`).
22
+ 4. Run `bunx tsc --noEmit` and `bun run build`, and confirm the existing header and toast bridge calls still type-check. Fix any break before continuing.
23
+ 5. Re-run the check above, then proceed with this skill.
18
24
 
19
25
  ## When to reach for this skill
20
26
 
@@ -74,7 +80,7 @@ The host rejects staff-only destinations when the viewer is a client in the port
74
80
  | `article` | `articleId` | — | Yes |
75
81
  | `files` | — | `channelId` | Yes |
76
82
  | `channel` | — | `channelId` | Yes |
77
- | `app` | `installId` | — | Yes, if the target app is installed for that viewer |
83
+ | `app` | `installId` | `path` | Yes, if the target app is installed for that viewer |
78
84
  | `home` | — | — | No — staff only |
79
85
  | `product` | — | — | No — staff only |
80
86
  | `helpdesk` | — | — | Yes |