@assembly-js/app-foundation 0.3.8 → 0.3.10
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 +6 -0
- package/CLAUDE.md +6 -0
- package/dist/scripts.d.ts +1 -1
- package/dist/scripts.js +5 -0
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -19,6 +19,12 @@ 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.10
|
|
23
|
+
- [guidance] Build agents are told to reuse an existing provider module and warned that adding a new requiredSecrets entry pauses a published app at the setup form.
|
|
24
|
+
|
|
25
|
+
## 0.3.9
|
|
26
|
+
- [fix] `getOfflineAssembly` from `@assembly-js/app-foundation/scripts` now refuses to run inside Next, so a route under `app/` can no longer use it to act with the installer's access. The entry shipped in 0.2.1 for standalone scripts only and nothing the build agent is taught imports it from a route, so no existing app's code needs to change.
|
|
27
|
+
|
|
22
28
|
## 0.3.8
|
|
23
29
|
- [behavior] An app that calls a provider's inferred route now lists that provider in `.assembly/app-deps.json`.
|
|
24
30
|
|
package/CLAUDE.md
CHANGED
|
@@ -535,6 +535,12 @@ Two paths, decided by whether an `assembly-integrations` skill is present and, i
|
|
|
535
535
|
1. **Read the credential only from `process.env.<KEY>`, server-side only.** Route handlers, server components, and server actions can read it. Client components, `'use client'` modules, and anything that ends up in the browser bundle cannot. Never hardcode a value, never persist one to the database, never read from the URL, never write `.env*` files.
|
|
536
536
|
2. **Declare every secret you read in `.assembly/app.json`.** Add an entry under a top-level `requiredSecrets` array in the same change that introduces the call. The Assembly platform reads this manifest after the build, prompts the user for each value, and injects them as Vercel env vars at deploy.
|
|
537
537
|
|
|
538
|
+
### Adding a secret to an app that already calls the provider
|
|
539
|
+
|
|
540
|
+
- If the app already calls this provider, extend that module rather than declaring a second credential for the same provider.
|
|
541
|
+
- If that module reads its credential from the app database, keep using it for this change, tell the user once, and offer moving it to `requiredSecrets` as a separate step (they re-enter the value). Do not read or move the values. This does not relax rule 1: never store a new credential in the database.
|
|
542
|
+
- Adding a new `requiredSecrets` entry to a published app pauses it at the setup form until the value is supplied.
|
|
543
|
+
|
|
538
544
|
### Manifest shape
|
|
539
545
|
|
|
540
546
|
```json
|
package/dist/scripts.d.ts
CHANGED
|
@@ -3,6 +3,6 @@ import { type AssemblyAPI } from '@assembly-js/node-sdk';
|
|
|
3
3
|
* The script-side counterpart of `getOfflineAssembly` from `/server`: mints a
|
|
4
4
|
* short-lived app-scoped bearer from `ASSEMBLY_API_KEY` and returns a bearer-only
|
|
5
5
|
* client. There is no request here, so the viewer-identity guard `/server` applies
|
|
6
|
-
* does not exist; use this only from scripts
|
|
6
|
+
* does not exist, so it refuses to run inside Next instead; use this only from scripts.
|
|
7
7
|
*/
|
|
8
8
|
export declare function getOfflineAssembly(): Promise<AssemblyAPI>;
|
package/dist/scripts.js
CHANGED
|
@@ -4676,6 +4676,11 @@ async function mintBearerFromAppKey() {
|
|
|
4676
4676
|
|
|
4677
4677
|
// src/scripts.ts
|
|
4678
4678
|
async function getOfflineAssembly() {
|
|
4679
|
+
if (process.env.NEXT_RUNTIME) {
|
|
4680
|
+
throw new Error(
|
|
4681
|
+
"getOfflineAssembly from '/scripts' must not run inside Next: its app-scoped bearer acts as the installer. Use getAssembly() or getAssemblyForRequest() from '/server' in user-facing routes, or getOfflineAssembly() from '/server' for cron and webhook routes"
|
|
4682
|
+
);
|
|
4683
|
+
}
|
|
4679
4684
|
if (!process.env.ASSEMBLY_API_KEY) {
|
|
4680
4685
|
throw new Error(
|
|
4681
4686
|
"getOfflineAssembly: ASSEMBLY_API_KEY is not set \u2014 cannot mint an app-scoped bearer"
|