@fluid-app/fluid-cli-portal 0.1.31 → 0.1.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
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@fluid-app/fluid-cli-portal",
3
- "version": "0.1.31",
3
+ "version": "0.1.33",
4
4
  "description": "Fluid CLI plugin for building portal applications",
5
5
  "files": [
6
6
  "dist",
@@ -32,7 +32,7 @@
32
32
  "p-limit": "^7.3.0",
33
33
  "prompts": "^2.4.2",
34
34
  "tsx": "^4.21.0",
35
- "@fluid-app/fluid-cli": "0.1.11"
35
+ "@fluid-app/fluid-cli": "0.1.12"
36
36
  },
37
37
  "devDependencies": {
38
38
  "@swc/core": "^1.15.18",
@@ -44,8 +44,8 @@
44
44
  "tsdown": "^0.21.0",
45
45
  "typescript": "^5",
46
46
  "vite": "^6.0.0",
47
- "@fluid-app/fluidos-api-client": "0.1.0",
48
- "@fluid-app/typescript-config": "0.0.0"
47
+ "@fluid-app/typescript-config": "0.0.0",
48
+ "@fluid-app/fluidos-api-client": "0.1.0"
49
49
  },
50
50
  "engines": {
51
51
  "node": ">=18.0.0"
@@ -0,0 +1,27 @@
1
+ # Dependencies
2
+ node_modules/
3
+
4
+ # Build output
5
+ dist/
6
+
7
+ # Environment files
8
+ .env
9
+ .env.local
10
+ .env.*.local
11
+
12
+ # Editor directories
13
+ .idea/
14
+ .vscode/
15
+ *.swp
16
+ *.swo
17
+
18
+ # OS files
19
+ .DS_Store
20
+ Thumbs.db
21
+
22
+ # Portal sync metadata (generated by fluid portal pull/push)
23
+ .portal-sync/
24
+
25
+ # Logs
26
+ *.log
27
+ pnpm-debug.log*
@@ -0,0 +1,36 @@
1
+ # AGENTS.md
2
+
3
+ Guidance for AI coding tools working in this generated Fluid portal project.
4
+
5
+ This project is primarily authored through the Fluid OS portal definition sync workflow. Author portal structure, routes, and content through pulled Fluid OS JSON under `portal/` unless a human explicitly asks for a different architecture.
6
+
7
+ ## Source of truth
8
+
9
+ - Use `.agents/skills/fluid-portal-authoring/SKILL.md` for portal definition work.
10
+ - Use `.agents/skills/fluid-widget-authoring/SKILL.md` for company widget creation with `pnpm widget:create`, widget manifests, property schemas, runtime CSS, validation, build, and publish work.
11
+ - `.claude/skills/...` contains the same generated skills for Claude-compatible tools.
12
+
13
+ ## Portal workflow
14
+
15
+ 1. Run `pnpm pull` to sync the remote Fluid OS definition into `portal/`.
16
+ 2. Edit the pulled JSON under `portal/`.
17
+ 3. Validate locally with `pnpm typecheck`, `pnpm lint`, and `pnpm build` when applicable.
18
+ 4. Run `pnpm push` to sync local `portal/` JSON back to the remote working/draft definition.
19
+ 5. Run `pnpm exec fluid portal version create --activate` only when the pushed definition should become live.
20
+
21
+ Do not edit `.portal-sync/` by hand. It is generated sync metadata.
22
+
23
+ ## Command boundaries
24
+
25
+ - `pnpm pull` / `fluid portal pull`: downloads the portal definition into `portal/`.
26
+ - `pnpm push` / `fluid portal push`: updates the remote working/draft definition from local JSON.
27
+ - `fluid portal version create --activate`: publishes the remote working/draft definition as the live version.
28
+ - `pnpm build`: builds the hosted portal shell assets into `dist/`.
29
+ - `fluid portal deploy`: publishes company-owned widget runtime artifacts, not portal JSON and not shell assets.
30
+
31
+ ## Quality bar
32
+
33
+ - Keep portal JSON valid and references consistent.
34
+ - Preserve stable IDs and slugs unless the change intentionally renames them.
35
+ - Keep the portal shell thin; do not fork SDK internals into this app.
36
+ - For widget changes, use `pnpm widget:create <name>` / `fluid portal widget create <name>` and follow the copied `fluid-widget-authoring` skill before editing manifests or schemas.
@@ -0,0 +1,153 @@
1
+ ---
2
+ name: fluid-portal-authoring
3
+ description: Use when modifying this generated Fluid portal project through the supported pull/edit/push/version workflow, including portal/ JSON, themes, navigations, screens, profiles, local validation, and distinguishing portal definition sync from widget artifact deployment.
4
+ ---
5
+
6
+ # Fluid Portal Authoring
7
+
8
+ Use this skill before changing a generated Fluid portal project.
9
+
10
+ ## Supported authoring model
11
+
12
+ This template is a Fluid portal shell plus a local copy of the Fluid OS portal definition.
13
+ The supported workflow is:
14
+
15
+ 1. Pull the remote portal definition into `portal/`.
16
+ 2. Edit the pulled JSON files locally.
17
+ 3. Validate and preview locally.
18
+ 4. Push the JSON changes back to the remote working/draft definition.
19
+ 5. Create and activate a version when the pushed definition should go live.
20
+
21
+ In generated portal projects, routes, portal structure, screens, themes, profiles, and definition metadata are owned by Fluid OS JSON under `portal/` after pull.
22
+
23
+ ## Important files and directories
24
+
25
+ - `src/main.tsx`: portal shell bootstrap. Keep this small.
26
+ - `src/portal.config.ts`: portal SDK integration and widget/package exports when present.
27
+ - `src/index.css`: app-level CSS imports and global styles.
28
+ - `portal/`: pulled Fluid OS definition JSON. This is the primary editing surface for portal content.
29
+ - `.portal-sync/`: generated sync metadata used by pull/push diffing. Do not edit by hand.
30
+ - `.fluidrc`: generated CLI profile binding for this portal project.
31
+ - `.agents/skills/fluid-widget-authoring/SKILL.md`: widget authoring guidance when this portal owns widget packages or widget manifests.
32
+
33
+ ## Pull before editing
34
+
35
+ Run:
36
+
37
+ ```bash
38
+ pnpm pull
39
+ ```
40
+
41
+ Expected result:
42
+
43
+ - `portal/` contains local JSON for Fluid OS resources such as screens, themes, navigations, profiles, and definition metadata.
44
+ - `.portal-sync/` contains sync state used to compute future diffs.
45
+ - `.fluidrc` pins the CLI profile when the project was created with a profile.
46
+
47
+ Pull before making changes unless you intentionally want to overwrite local work. If local JSON and remote state may both have changed, inspect the diff before pushing.
48
+
49
+ ## Edit pulled portal JSON
50
+
51
+ Work inside `portal/` for portal definition changes.
52
+
53
+ Guidelines:
54
+
55
+ - Keep JSON valid and deterministic.
56
+ - Preserve stable IDs, slugs, and cross-resource references unless intentionally changing them.
57
+ - Update references together. If a navigation item points to a screen/theme/profile slug or ID, make sure the target exists in `portal/`.
58
+ - Prefer small, reviewable edits. One portal content change per PR is easier to validate.
59
+ - Do not hand-edit `.portal-sync/`; it is sync metadata, not source content.
60
+ - Do not invent unsupported fields. Match the shapes produced by `pnpm pull`.
61
+
62
+ ## Validate locally
63
+
64
+ Run the checks that match the change:
65
+
66
+ ```bash
67
+ pnpm typecheck
68
+ pnpm lint
69
+ pnpm build
70
+ ```
71
+
72
+ For portal JSON changes, also run a push dry run or validation command if available in your CLI version. If a command reports broken cross-references, fix the JSON references before pushing.
73
+
74
+ Use local preview for visual/content changes:
75
+
76
+ ```bash
77
+ pnpm dev
78
+ ```
79
+
80
+ Expected result: the portal shell starts and can load the local pulled portal definition for preview where supported by the SDK/tooling.
81
+
82
+ ## Push definition changes
83
+
84
+ Run:
85
+
86
+ ```bash
87
+ pnpm push
88
+ ```
89
+
90
+ What push does:
91
+
92
+ - Reads local `portal/` JSON.
93
+ - Compares it against `.portal-sync/` state.
94
+ - Shows or applies a diff to the remote working/draft Fluid OS definition.
95
+ - Updates the remote draft/working state.
96
+
97
+ What push does not do:
98
+
99
+ - It does not create a live Fluid OS version by itself.
100
+ - It does not upload hosted portal shell assets from `dist/`.
101
+ - It does not publish widget runtime artifacts.
102
+
103
+ After a successful push, inspect the remote portal definition if possible and run the app locally or against the target environment.
104
+
105
+ ## Publish a live portal version
106
+
107
+ After pushing and verifying the working/draft definition, create and activate a version when the change should become live:
108
+
109
+ ```bash
110
+ pnpm exec fluid portal version create --activate
111
+ ```
112
+
113
+ Use this only when the pushed definition is ready for users. If activation should be coordinated with a release or content review, stop and ask the project owner before running it.
114
+
115
+ ## Distinguish the three deploy/sync paths
116
+
117
+ Do not mix these up:
118
+
119
+ - `pnpm push` / `fluid portal push`: syncs `portal/` JSON to the remote working/draft Fluid OS definition.
120
+ - `fluid portal version create --activate`: snapshots the remote working/draft definition and makes it live.
121
+ - GitHub Actions or hosting deployment: uploads the built portal shell assets from `dist/`.
122
+ - `fluid portal deploy`: publishes company-owned widget runtime artifacts. It is not the portal JSON push command and it is not the hosted shell asset deployment.
123
+
124
+ ## Widget work inside a portal project
125
+
126
+ Company-owned portal widgets are still supported. Use the widget scaffold command, then follow the copied `fluid-widget-authoring` skill for detailed manifest, property schema, theme token, validation, build, and publish rules.
127
+
128
+ ```bash
129
+ pnpm widget:create my-widget
130
+ # or
131
+ pnpm exec fluid portal widget create my-widget
132
+ ```
133
+
134
+ Short version:
135
+
136
+ - Keep widget code under the scaffolded `src/widgets/<name>/` directory.
137
+ - Keep widget metadata serializable.
138
+ - Keep `defaultProps` aligned with property schema defaults.
139
+ - Use semantic theme tokens.
140
+ - Import runtime CSS from the widget build graph.
141
+ - Validate/build widget artifacts before publishing them.
142
+
143
+ ## Preflight checklist
144
+
145
+ Before considering portal work complete:
146
+
147
+ - [ ] Pulled the latest remote definition or intentionally worked from current local JSON.
148
+ - [ ] Edited only supported files for the change.
149
+ - [ ] Preserved JSON validity and cross-resource references.
150
+ - [ ] Kept portal structure, routes, and content changes in pulled Fluid OS JSON under `portal/`.
151
+ - [ ] Ran typecheck/lint/build or the closest available checks.
152
+ - [ ] Ran push only when the local `portal/` diff was understood.
153
+ - [ ] Created/activated a version only when the definition should go live.
@@ -1,5 +1,5 @@
1
1
  import { createPortal } from "@fluid-app/portal-sdk";
2
- import { customPages, customWidgets } from "./portal.config";
2
+ import { customWidgets } from "./portal.config";
3
3
  import "./index.css";
4
4
 
5
- createPortal({ customPages, customWidgets });
5
+ createPortal({ customWidgets });
@@ -1,40 +1,14 @@
1
- /**
2
- * Portal Configuration
3
- *
4
- * Register custom page components and widget plugins here.
5
- *
6
- * - customPages: rendered by AppShell when a navigation slug matches
7
- * - customWidgets: registered as plugin widgets in the builder and SDK
8
- *
9
- * Navigation structure is defined in navigation.config.ts and synced
10
- * to the Fluid OS API on `fluid deploy`.
11
- */
12
-
13
- import type { ComponentType } from "react";
14
1
  import type { WidgetManifest } from "@fluid-app/portal-sdk";
15
- import { DashboardScreen } from "./screens/Dashboard";
16
2
 
17
3
  /**
18
- * Custom page components keyed by navigation slug.
4
+ * Portal SDK integration point.
19
5
  *
20
- * When AppShell resolves a navigation item, it checks this map first.
21
- * If a matching slug is found here, the custom component is rendered
22
- * instead of the default system screen or placeholder.
23
- */
24
- export const customPages: Record<string, ComponentType> = {
25
- dashboard: DashboardScreen,
26
- // Add more custom screens here:
27
- // "example-form": ExampleFormScreen,
28
- };
29
-
30
- /**
31
- * Custom widget plugins.
6
+ * Portal screens, themes, navigations, and profiles are authored through
7
+ * the Fluid OS definition sync workflow: `pnpm pull`, edit `portal/`,
8
+ * then `pnpm push`. Keep portal structure, routes, and content in the
9
+ * pulled Fluid OS JSON files.
32
10
  *
33
- * Each manifest registers a widget in both the builder palette
34
- * and the SDK runtime. Add manifests here after scaffolding
35
- * with `fluid widget create <name>`.
11
+ * Keep this file for widget manifests or source widget packages that need
12
+ * to be available to the SDK preview/runtime.
36
13
  */
37
- export const customWidgets: WidgetManifest[] = [
38
- // Import and add widget manifests here:
39
- // stockTicker,
40
- ];
14
+ export const customWidgets: WidgetManifest[] = [];