@microsoft/rayfin-guide 1.36.0-alpha.1687 → 1.36.0-alpha.1756
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/assets/docs/app-backend/deep-linking.md +43 -5
- package/assets/docs/app-backend/deploy.md +18 -2
- package/assets/docs/cli/connectors/invoke.md +58 -1
- package/assets/docs/cli/functions/dev-apply.md +23 -3
- package/assets/docs/cli/functions/init.md +9 -0
- package/assets/docs/cli/index.md +1 -1
- package/assets/docs/cli/templates.md +17 -1
- package/assets/docs/hosting/index.md +12 -1
- package/package.json +1 -1
|
@@ -33,6 +33,8 @@ Your app owns the shape of the state object.
|
|
|
33
33
|
npm install @microsoft/rayfin-app-state-fabric
|
|
34
34
|
```
|
|
35
35
|
|
|
36
|
+
If your project uses prerelease Rayfin packages, install the same exact version of `@microsoft/rayfin-app-state-fabric` as the other `@microsoft/rayfin-*` packages in the project.
|
|
37
|
+
|
|
36
38
|
## Create the client
|
|
37
39
|
|
|
38
40
|
Create one client for the lifetime of your app and share it, rather than constructing one per component.
|
|
@@ -40,13 +42,13 @@ Create one client for the lifetime of your app and share it, rather than constru
|
|
|
40
42
|
```typescript
|
|
41
43
|
import { createFabricAppStateClient } from '@microsoft/rayfin-app-state-fabric';
|
|
42
44
|
|
|
43
|
-
const appState = createFabricAppStateClient(
|
|
44
|
-
targetOrigin: 'https://app.fabric.microsoft.com',
|
|
45
|
-
});
|
|
45
|
+
const appState = createFabricAppStateClient();
|
|
46
46
|
```
|
|
47
47
|
|
|
48
|
-
|
|
49
|
-
|
|
48
|
+
Leave `targetOrigin` unset.
|
|
49
|
+
The parent window is a Fabric extension host, not the portal origin shown in the address bar, and its origin varies by environment.
|
|
50
|
+
Pinning the portal origin makes the browser silently discard every message.
|
|
51
|
+
When `targetOrigin` is omitted, messages are posted with `"*"` and inbound events are not origin-checked.
|
|
50
52
|
|
|
51
53
|
## Read launch state before first render
|
|
52
54
|
|
|
@@ -66,6 +68,36 @@ It resolves from the seeded URL on hosts that support it, so awaiting it does no
|
|
|
66
68
|
Treat launch state as untrusted input.
|
|
67
69
|
Anyone can edit a link before sharing it, so validate it exactly as you would a query parameter before using it to drive queries.
|
|
68
70
|
|
|
71
|
+
## Keep the restored route through sign-in
|
|
72
|
+
|
|
73
|
+
A Rayfin app is authenticated, and its route guard sends a signed-out visitor to the sign-in route.
|
|
74
|
+
That redirect runs after the launch state has been restored, so a guard that does not carry the requested route forward replaces it, and the visitor lands on the default page.
|
|
75
|
+
|
|
76
|
+
This is the normal path for a shared link, because the recipient is usually not signed in yet.
|
|
77
|
+
|
|
78
|
+
Capture the requested route when you redirect to the sign-in route, then return to it after sign-in.
|
|
79
|
+
|
|
80
|
+
```tsx
|
|
81
|
+
if (requireAuth && !isAuthenticated) {
|
|
82
|
+
const redirectState: AuthRedirectState = {
|
|
83
|
+
from: `${location.pathname}${location.search}`,
|
|
84
|
+
};
|
|
85
|
+
return <Navigate to="/auth" replace state={redirectState} />;
|
|
86
|
+
}
|
|
87
|
+
|
|
88
|
+
if (!requireAuth && isAuthenticated) {
|
|
89
|
+
return <Navigate to={resolveReturnPath(location.state)} replace />;
|
|
90
|
+
}
|
|
91
|
+
```
|
|
92
|
+
|
|
93
|
+
Validate the captured route before navigating back to it.
|
|
94
|
+
Accept only same-origin application paths, and reject the sign-in route itself so sign-in cannot loop.
|
|
95
|
+
|
|
96
|
+
Keeping the sign-in route out of the state you persist is not the same thing.
|
|
97
|
+
A shared link needs both: never write the sign-in route into deep-link state, and carry the requested route across the sign-in redirect.
|
|
98
|
+
|
|
99
|
+
Templates that ship a route guard already carry the requested route through sign-in, so preserve that behavior as you add routes.
|
|
100
|
+
|
|
69
101
|
## Write state as the user navigates
|
|
70
102
|
|
|
71
103
|
Choose between the two writers by asking who caused the change.
|
|
@@ -167,6 +199,12 @@ Validate launch state before using it, and tolerate state written by a different
|
|
|
167
199
|
**`isSupported()` resolves to `undefined`.**
|
|
168
200
|
Either the app is not embedded in the Fabric portal, or deep linking has not reached this tenant yet.
|
|
169
201
|
Both are expected, and your app should fall back to its own routing.
|
|
202
|
+
Also check that the client does not set `targetOrigin`; pinning the portal origin silently prevents communication with the Fabric extension host.
|
|
203
|
+
|
|
204
|
+
**A shared link opens the default page instead of the shared view.**
|
|
205
|
+
The app restored the launch state and then replaced it.
|
|
206
|
+
Check the sign-in redirect first, because the recipient of a shared link is usually signed out.
|
|
207
|
+
See [Keep the restored route through sign-in](#keep-the-restored-route-through-sign-in).
|
|
170
208
|
|
|
171
209
|
**Writes reject with `STATE_TOO_LARGE`.**
|
|
172
210
|
The state exceeds the encoded budget the host reported.
|
|
@@ -107,7 +107,9 @@ After deployment, the CLI prints:
|
|
|
107
107
|
|
|
108
108
|
Each deployment is recorded in `rayfin/.deployments.json` (the registry of every workspace you have deployed to from this project), and the corresponding `RAYFIN_PUBLIC_*` variables are merged into `rayfin/.env` so subsequent commands and your frontend pick up the same values.
|
|
109
109
|
|
|
110
|
-
For frontend frameworks, the CLI
|
|
110
|
+
For frontend frameworks, the CLI refreshes a framework-specific `.env.local` (for example, for Vite) before the static build.
|
|
111
|
+
Detection and environment generation use the frontend directory selected by `services.staticHosting.path` and its optional `root`, while the public deployment values come from the project's `rayfin/.env`.
|
|
112
|
+
If detection or environment generation fails, the deployment reports a warning with guidance instead of treating it as a successful refresh.
|
|
111
113
|
|
|
112
114
|
```text title="rayfin/.deployments.json"
|
|
113
115
|
{
|
|
@@ -165,9 +167,23 @@ services:
|
|
|
165
167
|
Use `-n, --dry-run` to see what the CLI would do without creating or modifying any resources:
|
|
166
168
|
|
|
167
169
|
```bash
|
|
168
|
-
npx rayfin up -n
|
|
170
|
+
npx rayfin up -n --workspace-id <workspace-id>
|
|
169
171
|
```
|
|
170
172
|
|
|
173
|
+
Preview validates deterministic local static-hosting inputs before authentication or remote lookup.
|
|
174
|
+
The configured frontend `path` and optional build `root` must exist and be directories.
|
|
175
|
+
When `buildCommand` is configured, the output `folder` may be missing because the build has not run yet.
|
|
176
|
+
Without a build command, the output folder must already exist and contain files.
|
|
177
|
+
Static input checks are skipped when static hosting is disabled or excluded.
|
|
178
|
+
|
|
179
|
+
After local validation, preview uses the same authentication and workspace-selection rules as deployment.
|
|
180
|
+
It makes read-only Fabric requests to resolve the current workspace display name and ID, showing both before the planned operations.
|
|
181
|
+
With `--json`, these values are available as `plan.workspaceName` and `plan.workspaceId`.
|
|
182
|
+
If the workspace cannot be resolved, preview exits nonzero without creating or modifying resources.
|
|
183
|
+
|
|
184
|
+
Preview does not run builds, provision an item, apply settings or schemas, or update project deployment files.
|
|
185
|
+
A successful preview is not a build result or a guarantee that remote deployment operations will succeed.
|
|
186
|
+
|
|
171
187
|
### Skip specific services
|
|
172
188
|
|
|
173
189
|
Use `--exclude-services <names>` to skip the build/package/deploy phase for supported services without touching the rest of the deployment.
|
|
@@ -5,7 +5,7 @@ sidebar_position: 4
|
|
|
5
5
|
# connector invoke
|
|
6
6
|
|
|
7
7
|
```bash
|
|
8
|
-
npx rayfin connector invoke <connector-name> <operation> (--input '<json>' | --file <path>) [--verbose] [--json]
|
|
8
|
+
npx rayfin connector invoke <connector-name> <operation> (--input '<json>' | --file <path>) [--output-file <path>] [--max-inline-bytes <bytes>] [--verbose] [--json]
|
|
9
9
|
```
|
|
10
10
|
|
|
11
11
|
`connector invoke` runs a single named operation against a configured connector and prints the result. It is the loop for exercising [Category B connectors](./index.md#two-categories-of-connector) — `executeQuery` over DAX or KQL — without writing any app code.
|
|
@@ -50,6 +50,8 @@ Two transports, chosen by connector type:
|
|
|
50
50
|
|
|
51
51
|
Success emits `{status: 'ok', connector, operation, output}`. In non-JSON modes it prints `✅ Invoked <name>.<operation>` followed by the output.
|
|
52
52
|
|
|
53
|
+
A result larger than 8 KB is written to a file instead of being printed whole; see [Large results](#large-results).
|
|
54
|
+
|
|
53
55
|
What `output` holds depends on the connector. `fabric-semanticmodel` normalises inside its `invoke` middleware, so `output` is already a discriminated result rather than the raw service envelope: `{status: 'success', table, requestId}`, where `table.columns` are `{name, dataType}` and `table.rows` are column-aligned arrays. No caller-side conversion is needed, and the same shape comes back whether the operation ran locally or through the deployed item.
|
|
54
56
|
|
|
55
57
|
A resolved call is **not** automatically a success, and the failure signal depends on the same distinction. A connector that normalises reports Power BI failures — expired token, missing Build permission, throttling — as `{status: 'error', error, requestId}`, where `error` carries `category`, `message`, and optional `code` and `details`. A connector that returns the raw envelope reports failure as `status: 'Failed'` instead. The CLI reads both, converts either into a non-zero exit, and surfaces the service-supplied request id for tracing.
|
|
@@ -82,6 +84,56 @@ For example, an invalid DAX query exits with code `1` and can emit:
|
|
|
82
84
|
Read `connectorError.code` and `connectorError.details` rather than parsing the display string.
|
|
83
85
|
Service diagnostics may contain query or model content; review them before sharing or recording them in logs.
|
|
84
86
|
|
|
87
|
+
## Large results
|
|
88
|
+
|
|
89
|
+
A query has no upper bound on how much it returns, and printing a multi-megabyte result set floods a terminal — or, when an agent runs the CLI and reads its stdout, burns the agent's context window on rows it cannot use.
|
|
90
|
+
|
|
91
|
+
When the serialized result exceeds **8 KB**, the full payload is written to a file and `output` carries only a preview.
|
|
92
|
+
|
|
93
|
+
That threshold is a token budget, not a byte intuition.
|
|
94
|
+
Connector output tokenizes at roughly 2.8 characters per token, and numeric table data at about 1.8, so 8 KB is around 3k–4.5k tokens — a reasonable cost for one probe.
|
|
95
|
+
For scale, 256 KB of the same data is 93,000–144,000 tokens, which is most of a typical context window.
|
|
96
|
+
|
|
97
|
+
The preview samples bulk data but preserves metadata: arrays of **50 or fewer** entries pass through whole, longer arrays keep their first 20 entries, and long strings are cut.
|
|
98
|
+
That rule is what keeps a column list intact — a sampled column list would report a partial schema with nothing marking it partial, so a caller asking what a query returns would get a confident wrong answer.
|
|
99
|
+
If a 20-entry sample would itself exceed the threshold, the sample shrinks (10, 5, 2, 1) until it fits; only if no setting fits does `output` become `null`.
|
|
100
|
+
|
|
101
|
+
The envelope gains these fields, so this is detectable rather than silent:
|
|
102
|
+
|
|
103
|
+
| Field | Meaning |
|
|
104
|
+
| ----------------- | ------------------------------------------------------------ |
|
|
105
|
+
| `outputFile` | Absolute path the full result was written to. |
|
|
106
|
+
| `outputBytes` | Serialized size of the full result, in bytes. |
|
|
107
|
+
| `outputTruncated` | `true` when `output` is a preview rather than the whole result. |
|
|
108
|
+
| `previewItems` | Entries kept from each sampled array, or `0` when `output` is `null`. |
|
|
109
|
+
|
|
110
|
+
Read `outputFile` instead of re-running the query.
|
|
111
|
+
The file holds exactly what `output` would have held, so it can be passed straight to `jq` or opened by an agent.
|
|
112
|
+
|
|
113
|
+
Spilled results are written to `<project-root>/rayfin/.temp/invoke-results/` with owner-only permissions, and are pruned after 14 days or 20 files, whichever comes first.
|
|
114
|
+
`rayfin/.temp/` is the CLI's existing scratch directory and is covered by the scaffolded `.gitignore`, so query results — which are customer data — cannot be committed by a stray `git add`.
|
|
115
|
+
|
|
116
|
+
Two flags control this:
|
|
117
|
+
|
|
118
|
+
- `--max-inline-bytes <bytes>` — change the threshold. `0` restores the old behavior and always prints the result in full.
|
|
119
|
+
- `--output-file <path>` — always write the full result to `<path>`, whatever its size. The inline result is still shown in full unless it also crosses the threshold.
|
|
120
|
+
|
|
121
|
+
```json
|
|
122
|
+
{
|
|
123
|
+
"status": "ok",
|
|
124
|
+
"connector": "mymodel",
|
|
125
|
+
"operation": "executeQuery",
|
|
126
|
+
"output": { "status": "success", "table": { "columns": [], "rows": [] } },
|
|
127
|
+
"outputFile": "/path/to/app/rayfin/.temp/invoke-results/2026-09-21T101500.123Z-mymodel-executequery-1a2b3c4d.json",
|
|
128
|
+
"outputBytes": 4821004,
|
|
129
|
+
"outputTruncated": true,
|
|
130
|
+
"previewItems": 20
|
|
131
|
+
}
|
|
132
|
+
```
|
|
133
|
+
|
|
134
|
+
If the file cannot be written, the command still succeeds with a truncated `output` and warns — falling back to printing the whole payload would recreate the problem this exists to prevent.
|
|
135
|
+
An explicit `--output-file` that cannot be written fails instead, because the caller named that path.
|
|
136
|
+
|
|
85
137
|
## Examples
|
|
86
138
|
|
|
87
139
|
```bash
|
|
@@ -93,6 +145,9 @@ npx rayfin connector invoke --name mymodel --operation executeQuery --file ./pay
|
|
|
93
145
|
|
|
94
146
|
# Machine-readable (no --verbose allowed alongside)
|
|
95
147
|
npx rayfin connector invoke mymodel executeQuery --input '{"query":"EVALUATE TOPN(1, Sales)"}' --json
|
|
148
|
+
|
|
149
|
+
# Send the full result to a known path instead of hunting for the spill file
|
|
150
|
+
npx rayfin connector invoke mymodel executeQuery --file ./payload.json --output-file ./result.json --json
|
|
96
151
|
```
|
|
97
152
|
|
|
98
153
|
## Errors
|
|
@@ -106,3 +161,5 @@ npx rayfin connector invoke mymodel executeQuery --input '{"query":"EVALUATE TOP
|
|
|
106
161
|
| `missing workspaceId/itemId in rayfin.yml` | Add both under `config:`, or re-run [`connector add`](./add.md). |
|
|
107
162
|
| `Access token has the wrong audience for the Power BI query API` | Unset or replace `RAYFIN_TOKEN`, or re-run without `--json` to consent interactively. |
|
|
108
163
|
| `No remote endpoint configured` | The non-semantic-model transport needs a deployed item — run `npx rayfin up` first. |
|
|
164
|
+
| `Invalid --max-inline-bytes value` | Pass a non-negative whole number of bytes, or `0` to always print inline. |
|
|
165
|
+
| `Could not write the result to <path>` | Point `--output-file` at a writable path, or drop the flag to use the default location. |
|
|
@@ -4,7 +4,8 @@ sidebar_position: 2
|
|
|
4
4
|
|
|
5
5
|
# dev functions apply
|
|
6
6
|
|
|
7
|
-
Start the local Rayfin functions runtime against your active deployment, with
|
|
7
|
+
Start the local Rayfin functions runtime against your active deployment, with automatic recompilation when a `build:watch` script is configured, a live typegen watcher, and debugger support.
|
|
8
|
+
This is the command you run while developing and debugging functions.
|
|
8
9
|
|
|
9
10
|
```bash
|
|
10
11
|
npx rayfin dev functions apply [--port <port>] [--inspect-port <port>] [--no-debug] [--no-emit-env]
|
|
@@ -34,13 +35,32 @@ npx rayfin dev functions apply [--port <port>] [--inspect-port <port>] [--no-deb
|
|
|
34
35
|
5. Preserves the existing same-origin adapter in bundled Vite templates.
|
|
35
36
|
For recognized older or custom Vite clients, the first run patches `functionsBaseUrl` to read the generated URL only during development.
|
|
36
37
|
6. Builds the functions project, runs a one-shot typegen, then starts a visible **typegen watcher** (`[typegen]` prefix) that keeps `src/types.ts` in sync as you edit `function_app.ts`.
|
|
37
|
-
7. Starts `func start`
|
|
38
|
+
7. Starts `func start` alongside the package's `npm run build:watch` compiler watcher when configured, and writes a `.vscode/launch.json` **"Functions: Attach"** configuration for debugging.
|
|
38
39
|
|
|
39
|
-
Press `Ctrl+C` to stop the host and
|
|
40
|
+
Press `Ctrl+C` to stop the host and watchers.
|
|
40
41
|
This command does not start the frontend.
|
|
41
42
|
Run the Vite frontend separately to invoke local functions through `/.rayfin/api/<name>`, or use `npx rayfin dev` to start both together.
|
|
42
43
|
If the local Functions host is unavailable, the Vite adapter returns HTTP 502 instead of invoking deployed function code.
|
|
43
44
|
|
|
45
|
+
## Automatic recompilation
|
|
46
|
+
|
|
47
|
+
Both `npx rayfin dev functions apply` and `npx rayfin dev` build the functions package once, then run its `build:watch` script alongside the local Functions host if the script is configured.
|
|
48
|
+
Both commands use `services.functions.path` from `rayfin.yml` and preserve `services.functions.buildCommand` for the initial build.
|
|
49
|
+
|
|
50
|
+
To enable automatic recompilation, define a long-running `build:watch` script in the functions package's `package.json`; the TypeScript scaffold uses `"build:watch": "tsc --build --watch"`.
|
|
51
|
+
If you use a custom compiler or bundler, set that script to its watch command instead.
|
|
52
|
+
Source edits are compiled into `dist`, which the host watches to reload handlers.
|
|
53
|
+
The separate typegen watcher keeps `src/types.ts` up to date and does not rewrite the file when the generated types are unchanged.
|
|
54
|
+
|
|
55
|
+
If `build:watch` is absent, the CLI warns and starts the host without a compiler watcher; run the functions package's build command manually after source edits.
|
|
56
|
+
Type generation remains enabled without a compiler watcher.
|
|
57
|
+
An invalid watch script or an unreadable package manifest remains an error.
|
|
58
|
+
An initial build failure prevents host startup; later compiler diagnostics can be fixed without restarting the session.
|
|
59
|
+
If the compiler watcher exits, the session stops rather than serving stale code.
|
|
60
|
+
|
|
61
|
+
Core Tools owns worker reloads; edits made while it is restarting can occasionally leave a stale handler running.
|
|
62
|
+
If the response remains stale after compilation finishes, restart the dev session.
|
|
63
|
+
|
|
44
64
|
## Debugging
|
|
45
65
|
|
|
46
66
|
With debugging enabled (default), attach your debugger to the inspector port (`9229` by default) using the generated **"Functions: Attach"** launch configuration in VS Code. Pass `--no-debug` to run without the inspector.
|
|
@@ -30,6 +30,15 @@ Run this from a directory that already contains a `rayfin/` project (i.e. you ha
|
|
|
30
30
|
5. **Generates types** — runs a one-shot typegen to produce `rayfin/functions/src/types.ts` (the `AppFunctionsSchema`).
|
|
31
31
|
6. **Installs AI agent files** so assistants understand the functions surface.
|
|
32
32
|
|
|
33
|
+
## Runtime version
|
|
34
|
+
|
|
35
|
+
Fresh and forced scaffolds pin `@microsoft/fabric-user-data-functions` to the exact version of the running Rayfin CLI, matching connector scaffolding.
|
|
36
|
+
This also applies when `rayfin init` scaffolds the Functions service.
|
|
37
|
+
|
|
38
|
+
The running CLI version may differ from the SDK version already installed in your app.
|
|
39
|
+
Run the CLI release you want the Functions runtime to match.
|
|
40
|
+
Re-running without `--force` preserves the existing Functions `package.json`, including any runtime version you selected.
|
|
41
|
+
|
|
33
42
|
## Scaffolded structure
|
|
34
43
|
|
|
35
44
|
```text
|
package/assets/docs/cli/index.md
CHANGED
|
@@ -70,7 +70,7 @@ Functions are server-side user-defined functions (UDFs) that run in the Fabric r
|
|
|
70
70
|
| Command | Description |
|
|
71
71
|
| --- | --- |
|
|
72
72
|
| `npx rayfin functions init [directory]` | Scaffold `rayfin/functions/`, enable the functions service, install dependencies, build, and generate types. See [functions init](./functions/init.md). |
|
|
73
|
-
| `npx rayfin dev functions apply` | Run the local function host with
|
|
73
|
+
| `npx rayfin dev functions apply` | Run the local function host with an optional compiler watcher, live typegen, and debugger support. See [dev functions apply](./functions/dev-apply.md). |
|
|
74
74
|
| `npx rayfin up functions deploy` | Build, package, and deploy functions to the remote Rayfin item. `rayfin up` runs this automatically. See [up functions deploy](./functions/deploy.md). |
|
|
75
75
|
|
|
76
76
|
### Connectors
|
|
@@ -80,6 +80,13 @@ To skip the prompt, pass `-t`/`--template <name>` using one of the names from `-
|
|
|
80
80
|
npm create @microsoft/rayfin@latest my-app -- --template todoapp
|
|
81
81
|
```
|
|
82
82
|
|
|
83
|
+
> **Windows PowerShell:** some npm/Node.js versions drop the `--` separator, so `--template` is read by npm itself instead of being forwarded to Rayfin.
|
|
84
|
+
> Use `npm.cmd` instead of `npm` to avoid the issue on every Node.js version:
|
|
85
|
+
>
|
|
86
|
+
> ```powershell
|
|
87
|
+
> npm.cmd create @microsoft/rayfin@latest my-app -- --template todoapp
|
|
88
|
+
> ```
|
|
89
|
+
|
|
83
90
|
## Scaffold from an external git repository
|
|
84
91
|
|
|
85
92
|
Pass any git URL to `-t`/`--template`:
|
|
@@ -181,6 +188,8 @@ registries:
|
|
|
181
188
|
description: Our team's reusable starters
|
|
182
189
|
url: https://github.com/example-org/rayfin-templates.git
|
|
183
190
|
ref: v1.2.0
|
|
191
|
+
alphaRef: v1.3.0-alpha
|
|
192
|
+
betaRef: v1.3.0-beta
|
|
184
193
|
path: catalogs/official
|
|
185
194
|
```
|
|
186
195
|
|
|
@@ -192,10 +201,17 @@ Each entry supports the following fields:
|
|
|
192
201
|
| `url` | Yes | Git URL of the template repository (HTTPS, SSH, `git@`, or `file://`) |
|
|
193
202
|
| `displayName` | No | Human-readable label (defaults to `name`) |
|
|
194
203
|
| `description` | No | Short description shown in pickers and `--list-templates` |
|
|
195
|
-
| `ref` | No | Git tag, branch, or full commit SHA to pin to (defaults to the repository's default branch) |
|
|
204
|
+
| `ref` | No | Stable/default Git tag, branch, or full commit SHA to pin to (defaults to the repository's default branch) |
|
|
205
|
+
| `alphaRef` | No | Git ref used by alpha CLI versions; falls back to `ref` |
|
|
206
|
+
| `betaRef` | No | Git ref used by beta CLI versions; falls back to `ref` |
|
|
196
207
|
| `path` | No | Subdirectory inside the repo where the manifest lives |
|
|
197
208
|
| `templateName` | No | For a multi-template repo, the entry `name` or `path` to pre-select so consumers skip the picker |
|
|
198
209
|
|
|
210
|
+
The running CLI's package version selects the ref. Stable releases use `ref`,
|
|
211
|
+
versions such as `1.2.0-alpha.3` use `alphaRef`, and versions such as
|
|
212
|
+
`1.2.0-beta.2` use `betaRef`. If the matching channel ref is omitted, the CLI
|
|
213
|
+
uses `ref`. Other prerelease labels also use `ref`.
|
|
214
|
+
|
|
199
215
|
### Conflict handling
|
|
200
216
|
|
|
201
217
|
The CLI loads registries in tier order (bundled → user-global → project-local).
|
|
@@ -34,7 +34,8 @@ services:
|
|
|
34
34
|
| --- | --- | --- | --- |
|
|
35
35
|
| `enabled` | Yes | — | Set to `true` to enable static hosting. |
|
|
36
36
|
| `folder` | Yes | — | Output folder containing built static files, relative to `root`. |
|
|
37
|
-
| `
|
|
37
|
+
| `path` | No | Project root | Frontend package directory, relative to the Rayfin project root. |
|
|
38
|
+
| `root` | No | `path` or project root | Build directory, relative to `path` when configured, otherwise the project root. |
|
|
38
39
|
| `buildCommand` | No | — | Shell command to run before packaging (for example, `npm run build`). |
|
|
39
40
|
| `indexDocument` | No | — | Default document to serve for directory requests (for example, `index.html`). |
|
|
40
41
|
|
|
@@ -72,6 +73,11 @@ services:
|
|
|
72
73
|
|
|
73
74
|
This resolves the output path to `<project-root>/frontend/dist`.
|
|
74
75
|
|
|
76
|
+
For a workspace package, use `path: packages/frontend` instead of `root: frontend`.
|
|
77
|
+
The CLI detects the framework and refreshes `.env.local` in that frontend directory before building.
|
|
78
|
+
When both `path` and `root` are configured, the build and environment directory is `<project-root>/<path>/<root>`.
|
|
79
|
+
The `path`, `root`, and `folder` values must be relative and cannot traverse outside their containing directory.
|
|
80
|
+
|
|
75
81
|
## Deploying static content
|
|
76
82
|
|
|
77
83
|
### Full deployment with `rayfin up`
|
|
@@ -85,6 +91,11 @@ rayfin up
|
|
|
85
91
|
|
|
86
92
|
After deployment, the CLI prints the hosting URL and stores it in `rayfin/.deployments.json` for reference.
|
|
87
93
|
|
|
94
|
+
Use `rayfin up --dry-run --workspace-id <workspace-id>` to validate local inputs and display the resolved target without deploying.
|
|
95
|
+
Preview requires the frontend package and build directory to exist.
|
|
96
|
+
It does not run the build, so a missing output folder is allowed when `buildCommand` is configured.
|
|
97
|
+
Without a build command, preview requires existing, nonempty output.
|
|
98
|
+
|
|
88
99
|
#### Skip static deployment during local dev
|
|
89
100
|
|
|
90
101
|
Use `rayfin dev` for the normal inner loop.
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@microsoft/rayfin-guide",
|
|
3
|
-
"version": "1.36.0-alpha.
|
|
3
|
+
"version": "1.36.0-alpha.1756",
|
|
4
4
|
"description": "Cross-cutting Builder guides for the Rayfin platform — discovered by `@microsoft/rayfin-docs` via the `rayfinDocs` package.json field convention.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"files": [
|