@equinor/fusion-framework-cli 13.3.18 → 14.0.0
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 +122 -123
- package/README.md +150 -193
- package/bin/build/bin.mjs +1 -1
- package/bin/build/cli.mjs +3 -3
- package/dist/esm/lib/app/app-manifest.js.map +1 -1
- package/dist/esm/lib/app/index.js +9 -1
- package/dist/esm/lib/app/index.js.map +1 -1
- package/dist/esm/lib/app/load-app-manifest.js +3 -2
- package/dist/esm/lib/app/load-app-manifest.js.map +1 -1
- package/dist/esm/lib/dev-server.js +8 -0
- package/dist/esm/lib/dev-server.js.map +1 -1
- package/dist/esm/lib/index.js.map +1 -1
- package/dist/esm/lib/portal/index.js +8 -0
- package/dist/esm/lib/portal/index.js.map +1 -1
- package/dist/esm/lib/portal/portal-manifest.js +20 -1
- package/dist/esm/lib/portal/portal-manifest.js.map +1 -1
- package/dist/esm/lib/utils/expect.js +16 -2
- package/dist/esm/lib/utils/expect.js.map +1 -1
- package/dist/esm/lib/utils/file-exists.js +28 -0
- package/dist/esm/lib/utils/file-exists.js.map +1 -1
- package/dist/esm/lib/utils/index.js +8 -0
- package/dist/esm/lib/utils/index.js.map +1 -1
- package/dist/esm/version.js +1 -1
- package/dist/types/bin/app-config-publish.d.ts +9 -0
- package/dist/types/bin/app-serve.d.ts +49 -0
- package/dist/types/bin/index.d.ts +11 -0
- package/dist/types/bin/portal-config-publish.d.ts +10 -0
- package/dist/types/bin/utils/index.d.ts +9 -0
- package/dist/types/cli/commands/app/serve.d.ts +34 -0
- package/dist/types/cli/commands/index.d.ts +9 -0
- package/dist/types/lib/app/app-manifest.d.ts +6 -4
- package/dist/types/lib/app/index.d.ts +10 -1
- package/dist/types/lib/dev-server.d.ts +8 -0
- package/dist/types/lib/index.d.ts +8 -0
- package/dist/types/lib/portal/index.d.ts +8 -0
- package/dist/types/lib/portal/portal-manifest.d.ts +20 -0
- package/dist/types/lib/utils/expect.d.ts +18 -2
- package/dist/types/lib/utils/file-exists.d.ts +30 -0
- package/dist/types/lib/utils/index.d.ts +8 -0
- package/dist/types/version.d.ts +1 -1
- package/docs/ai-commands.md +162 -40
- package/docs/application.md +63 -0
- package/docs/auth.md +9 -0
- package/docs/portal.md +20 -0
- package/package.json +21 -23
package/README.md
CHANGED
|
@@ -1,242 +1,199 @@
|
|
|
1
|
-
|
|
1
|
+
# @equinor/fusion-framework-cli
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
Command-line toolkit for developing, building, and publishing Fusion Framework applications and portal templates. Provides a unified developer experience from local development to production deployment.
|
|
4
4
|
|
|
5
|
-
|
|
6
|
-
- **Fusion Applications**: Interactive web apps that run within the Fusion Portal
|
|
7
|
-
- **Portal Templates**: Customizable portal configurations for different business contexts
|
|
5
|
+
## Features
|
|
8
6
|
|
|
9
|
-
**
|
|
10
|
-
- **
|
|
11
|
-
-
|
|
12
|
-
-
|
|
13
|
-
-
|
|
14
|
-
-
|
|
15
|
-
-
|
|
16
|
-
- CI/CD
|
|
17
|
-
- **Plugin system
|
|
7
|
+
- **Application scaffolding** — generate new Fusion apps from predefined templates
|
|
8
|
+
- **Development server** — hot-reload dev server with service discovery and authentication
|
|
9
|
+
- **Build & bundle** — Vite-based production builds with manifest generation
|
|
10
|
+
- **Publish & tag** — upload bundles and configs to the Fusion app/portal service
|
|
11
|
+
- **Snapshot versions** — timestamped preview builds for PRs and CI (`--snapshot`)
|
|
12
|
+
- **Portal templates** — build, bundle, and deploy portal configurations
|
|
13
|
+
- **Service discovery** — resolve Fusion service endpoints from any environment
|
|
14
|
+
- **Authentication** — Azure AD login, token management, CI/CD token support
|
|
15
|
+
- **Plugin system** — extend the CLI with optional plugin packages
|
|
18
16
|
|
|
19
|
-
##
|
|
20
|
-
|
|
21
|
-
- **Node.js** (LTS version recommended)
|
|
22
|
-
- **pnpm** (or npm/yarn) package manager
|
|
23
|
-
- **Fusion Framework app or portal project** (or create a new one)
|
|
24
|
-
- **Access to Fusion services** (for authentication and deployment)
|
|
25
|
-
|
|
26
|
-
## Features & Benefits
|
|
27
|
-
|
|
28
|
-
- **🚀 Unified developer experience**: Single tool for the entire development lifecycle - from local development to production deployment
|
|
29
|
-
- **⚡ Rapid local development**: Built-in dev server with hot reload, service discovery, and real-time feedback
|
|
30
|
-
- **🎯 Environment-specific configuration**: Seamlessly manage manifests and configs across dev, test, and production environments
|
|
31
|
-
- **🔐 Integrated authentication**: Secure your apps locally and in CI/CD with Azure AD integration and token management
|
|
32
|
-
- **🔍 Service discovery**: Built-in support for Fusion services with automatic endpoint resolution
|
|
33
|
-
- **📦 Automated bundling & deployment**: One-command building, packaging, and publishing to Fusion registry
|
|
34
|
-
- **🏗️ Extensible architecture**: Support for apps, portals, widgets, and future Fusion components
|
|
35
|
-
- **📚 Comprehensive documentation**: Migration guides, detailed setup instructions, and troubleshooting resources
|
|
36
|
-
|
|
37
|
-
## Getting Started
|
|
38
|
-
|
|
39
|
-
**Install the CLI**
|
|
17
|
+
## Installation
|
|
40
18
|
|
|
41
19
|
```sh
|
|
42
20
|
pnpm add -D @equinor/fusion-framework-cli
|
|
43
21
|
```
|
|
44
22
|
|
|
45
|
-
|
|
23
|
+
The package exposes two binary aliases: `fusion-framework-cli` and `ffc`.
|
|
46
24
|
|
|
47
|
-
|
|
25
|
+
## Usage
|
|
26
|
+
|
|
27
|
+
### Create a new application
|
|
48
28
|
|
|
49
29
|
```sh
|
|
50
|
-
#
|
|
51
|
-
pnpm fusion-framework-cli app create my-
|
|
30
|
+
# Interactive template selection
|
|
31
|
+
pnpm fusion-framework-cli app create my-app
|
|
52
32
|
|
|
53
|
-
#
|
|
33
|
+
# Use a specific template
|
|
54
34
|
pnpm fusion-framework-cli app create my-app --template react-app
|
|
55
|
-
|
|
56
|
-
# Create in a specific directory with debug logging
|
|
57
|
-
pnpm fusion-framework-cli app create my-app --directory ./projects --debug
|
|
58
35
|
```
|
|
59
36
|
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
Create the required configuration files for your app:
|
|
63
|
-
|
|
64
|
-
- `app.manifest.ts` - Defines your app's metadata and capabilities
|
|
65
|
-
- `app.config.ts` - Contains runtime configuration and environment variables
|
|
66
|
-
|
|
67
|
-
See [Developing Apps](docs/application.md) for detailed setup and configuration guidance.
|
|
68
|
-
|
|
69
|
-
**Start the development server**
|
|
37
|
+
### Local development
|
|
70
38
|
|
|
71
39
|
```sh
|
|
40
|
+
# Start the dev server (app)
|
|
72
41
|
pnpm fusion-framework-cli dev
|
|
73
|
-
```
|
|
74
|
-
|
|
75
|
-
**Log in to the Fusion Framework (if needed)**
|
|
76
42
|
|
|
77
|
-
|
|
78
|
-
pnpm fusion-framework-cli
|
|
43
|
+
# Start the dev server (portal)
|
|
44
|
+
pnpm fusion-framework-cli portal dev
|
|
79
45
|
```
|
|
80
46
|
|
|
81
|
-
|
|
47
|
+
### Build and publish
|
|
82
48
|
|
|
83
49
|
```sh
|
|
84
|
-
#
|
|
85
|
-
pnpm fusion-framework-cli
|
|
86
|
-
|
|
87
|
-
# Publish and upload config in one command
|
|
88
|
-
pnpm fusion-framework-cli publish --env <environment> --config
|
|
89
|
-
```
|
|
90
|
-
|
|
91
|
-
**Build or publish snapshot artifacts**
|
|
92
|
-
|
|
93
|
-
> [!CAUTION]
|
|
94
|
-
> Snapshot versions are designed for **preview and testing purposes only** (e.g., pull requests, CI/CD test deployments). The snapshot version **only affects the manifest build metadata** — your `package.json` and source files remain unchanged.
|
|
50
|
+
# Build an application
|
|
51
|
+
pnpm fusion-framework-cli app build
|
|
95
52
|
|
|
96
|
-
|
|
97
|
-
-
|
|
98
|
-
- Optional identifier: `--snapshot pr-123` → `{version}-pr-123.{unix_timestamp}`
|
|
99
|
-
- Semver coercion strips any pre-release suffix first, e.g. `1.2.3-beta.1` → `1.2.3-snapshot.{unix_timestamp}`
|
|
53
|
+
# Bundle into a zip archive
|
|
54
|
+
pnpm fusion-framework-cli app pack
|
|
100
55
|
|
|
101
|
-
|
|
102
|
-
-
|
|
103
|
-
- Nightly builds: `--snapshot nightly`
|
|
104
|
-
- Feature branch testing: `--snapshot feature-xyz`
|
|
56
|
+
# Publish bundle + config to an environment
|
|
57
|
+
pnpm fusion-framework-cli app publish --env ci --config
|
|
105
58
|
|
|
106
|
-
|
|
107
|
-
# Package an app with a snapshot version
|
|
108
|
-
pnpm fusion-framework-cli app pack --snapshot
|
|
59
|
+
# Snapshot build for a PR
|
|
109
60
|
pnpm fusion-framework-cli app pack --snapshot pr-123
|
|
110
|
-
|
|
111
|
-
# Publish with a snapshot version
|
|
112
|
-
pnpm fusion-framework-cli app publish --snapshot
|
|
113
|
-
pnpm fusion-framework-cli app publish --snapshot nightly
|
|
114
61
|
```
|
|
115
62
|
|
|
116
|
-
|
|
63
|
+
### Authentication
|
|
117
64
|
|
|
118
65
|
```sh
|
|
119
|
-
#
|
|
120
|
-
pnpm fusion-framework-cli
|
|
121
|
-
|
|
122
|
-
# Or upload config separately
|
|
123
|
-
pnpm fusion-framework-cli app config --publish --env <environment>
|
|
124
|
-
```
|
|
66
|
+
# Interactive login
|
|
67
|
+
pnpm fusion-framework-cli auth login
|
|
125
68
|
|
|
126
|
-
|
|
69
|
+
# Retrieve a token
|
|
70
|
+
pnpm fusion-framework-cli auth token
|
|
127
71
|
|
|
128
|
-
|
|
72
|
+
# CI/CD: set FUSION_TOKEN environment variable instead
|
|
73
|
+
```
|
|
129
74
|
|
|
130
|
-
|
|
131
|
-
| -------------------------------------- | ------------------------------------ |
|
|
132
|
-
| `pnpm fusion-framework-cli app create` | Create new Fusion applications from templates |
|
|
133
|
-
| `pnpm fusion-framework-cli auth ...` | Authenticate with Fusion |
|
|
134
|
-
| `pnpm fusion-framework-cli app ...` | Working with Fusion applications |
|
|
135
|
-
| `pnpm fusion-framework-cli portal ...` | Working with Fusion portal templates |
|
|
136
|
-
| `pnpm fusion-framework-cli disco ...` | Service discovery and resolution |
|
|
75
|
+
### Command overview
|
|
137
76
|
|
|
138
|
-
**Optional Plugins:**
|
|
139
77
|
| Command | Description |
|
|
140
|
-
|
|
141
|
-
| `
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
78
|
+
|---|---|
|
|
79
|
+
| `app create` | Scaffold a new Fusion application from a template |
|
|
80
|
+
| `app build` | Build the application with Vite |
|
|
81
|
+
| `app pack` | Bundle the build into a zip archive |
|
|
82
|
+
| `app publish` | Build, pack, and upload in one step |
|
|
83
|
+
| `app upload` | Upload a pre-built bundle |
|
|
84
|
+
| `app config` | Generate or publish app configuration |
|
|
85
|
+
| `app tag` | Tag a published version (e.g. `latest`) |
|
|
86
|
+
| `app check` | Verify app registration in the app store |
|
|
87
|
+
| `app dev` | Start the application dev server |
|
|
88
|
+
| `app serve` | Preview a production build locally |
|
|
89
|
+
| `portal build` | Build a portal template |
|
|
90
|
+
| `portal pack` | Bundle the portal into a zip archive |
|
|
91
|
+
| `portal publish` | Build, pack, and upload a portal |
|
|
92
|
+
| `portal upload` | Upload a pre-built portal bundle |
|
|
93
|
+
| `portal config` | Generate or publish portal configuration |
|
|
94
|
+
| `portal tag` | Tag a published portal version |
|
|
95
|
+
| `portal dev` | Start the portal dev server |
|
|
96
|
+
| `auth login` | Authenticate with Azure AD |
|
|
97
|
+
| `auth logout` | Clear stored credentials |
|
|
98
|
+
| `auth token` | Print or acquire an access token |
|
|
99
|
+
| `disco resolve` | Resolve a Fusion service endpoint |
|
|
100
|
+
|
|
101
|
+
Run `pnpm fusion-framework-cli <command> --help` for detailed options.
|
|
102
|
+
|
|
103
|
+
## API Reference
|
|
104
|
+
|
|
105
|
+
The package exposes several sub-path exports for programmatic use:
|
|
106
|
+
|
|
107
|
+
### `@equinor/fusion-framework-cli` (root)
|
|
108
|
+
|
|
109
|
+
- `defineDevServerConfig` / `defineFusionCli` — type-safe config definition helpers
|
|
110
|
+
- `loadDevServerConfig` — load and merge dev-server configuration files
|
|
111
|
+
- `resolvePackage` / `resolveEntryPoint` — package and entry-point resolution
|
|
112
|
+
- `RuntimeEnv` — runtime environment type used across the CLI
|
|
113
|
+
|
|
114
|
+
### `@equinor/fusion-framework-cli/app`
|
|
115
|
+
|
|
116
|
+
- `defineAppManifest` / `defineAppConfig` — type-safe manifest and config helpers
|
|
117
|
+
- `loadAppManifest` / `loadAppConfig` — load and validate app manifest/config files
|
|
118
|
+
- `createAppManifestFromPackage` — generate a manifest from `package.json`
|
|
119
|
+
- `mergeAppManifests` / `mergeAppConfig` — deep-merge manifest/config objects
|
|
120
|
+
- `ApiAppConfigSchema` — Zod schema for app config validation
|
|
121
|
+
|
|
122
|
+
### `@equinor/fusion-framework-cli/portal`
|
|
123
|
+
|
|
124
|
+
- `definePortalManifest` / `definePortalConfig` / `definePortalSchema` — type-safe helpers
|
|
125
|
+
- `loadPortalManifest` / `loadPortalConfig` / `loadPortalSchema` — load and validate files
|
|
126
|
+
- `createPortalManifestFromPackage` — generate a portal manifest from `package.json`
|
|
127
|
+
- `validatePortalManifest` — validate a manifest against the Zod schema
|
|
128
|
+
|
|
129
|
+
### `@equinor/fusion-framework-cli/bin`
|
|
130
|
+
|
|
131
|
+
- `buildApplication` / `buildPortal` — programmatic Vite builds
|
|
132
|
+
- `bundleApp` / `bundlePortal` — build + pack into zip
|
|
133
|
+
- `uploadApplication` / `uploadPortalBundle` — upload bundles to the service
|
|
134
|
+
- `tagApplication` / `tagPortal` — tag published versions
|
|
135
|
+
- `initializeFramework` / `configureFramework` — set up the Fusion Framework for CLI operations
|
|
136
|
+
- `FusionEnv` — enum of supported Fusion environments
|
|
137
|
+
|
|
138
|
+
### `@equinor/fusion-framework-cli/utils`
|
|
139
|
+
|
|
140
|
+
- `assert` / `assertFileExists` / `assertObject` — assertion helpers
|
|
141
|
+
- `fileExists` / `fileExistsSync` — file-existence checks
|
|
142
|
+
- `writeFile` — write files with automatic directory creation
|
|
143
|
+
- `resolveAnnotations` — resolve CI/CD build annotations
|
|
144
|
+
- `generateSnapshotVersion` — create timestamped snapshot versions
|
|
145
|
+
|
|
146
|
+
## Configuration
|
|
147
|
+
|
|
148
|
+
### Application manifest (`app.manifest.ts`)
|
|
149
|
+
|
|
150
|
+
```ts
|
|
151
|
+
import { defineAppManifest } from '@equinor/fusion-framework-cli/app';
|
|
152
|
+
|
|
153
|
+
export default defineAppManifest((env, { base }) => ({
|
|
154
|
+
...base,
|
|
155
|
+
// override manifest fields here
|
|
156
|
+
}));
|
|
185
157
|
```
|
|
186
158
|
|
|
187
|
-
|
|
188
|
-
- `main`: **Required** - Points to your build output directory (CLI uses this to determine where to place built files)
|
|
189
|
-
- `files`: Specifies which files to include in your app bundle
|
|
190
|
-
- `scripts`: Convenient shortcuts for common CLI commands
|
|
191
|
-
|
|
192
|
-
> **Note:** The CLI determines the build output location from the `main` field in your package.json. If not specified, it defaults to `dist/bundle.js`.
|
|
193
|
-
|
|
194
|
-
## Documentation
|
|
159
|
+
### Application config (`app.config.ts`)
|
|
195
160
|
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
- [Developing Portals](docs/portal.md): Guide to building, configuring, and publishing portal templates
|
|
199
|
-
- [Dev Server](docs/dev-server.md): Understanding how the development server works, including architecture and configuration
|
|
161
|
+
```ts
|
|
162
|
+
import { defineAppConfig } from '@equinor/fusion-framework-cli/app';
|
|
200
163
|
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
**Additional Resources**
|
|
209
|
-
- [CLI Command Reference](docs/application.md#commands): Detailed documentation of all available commands and options
|
|
210
|
-
- [CI/CD Best Practices](docs/application.md#ci-cd): Automated workflows and deployment strategies
|
|
211
|
-
- [Troubleshooting Guide](docs/application.md#troubleshooting-faq): Common issues and solutions
|
|
212
|
-
|
|
213
|
-
**Internal Tools** (Fusion Core Team Only)
|
|
214
|
-
- [AI Commands](docs/ai-commands.md): ⚠️ **Internal use only** - AI-powered chat, embeddings, and search commands for codebase understanding (not supported for third-party users ...yet)
|
|
215
|
-
|
|
216
|
-
## Troubleshooting
|
|
164
|
+
export default defineAppConfig((env, { base }) => ({
|
|
165
|
+
environment: { MY_VAR: 'value' },
|
|
166
|
+
endpoints: {
|
|
167
|
+
api: { url: 'https://api.example.com', scopes: ['api://scope/.default'] },
|
|
168
|
+
},
|
|
169
|
+
}));
|
|
170
|
+
```
|
|
217
171
|
|
|
218
|
-
###
|
|
172
|
+
### Dev-server config (`dev-server.config.ts`)
|
|
219
173
|
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
- **libsecret errors on Linux?** Install libsecret using our [installation guide](https://equinor.github.io/fusion-framework/modules/auth/msal-node/#troubleshooting)
|
|
174
|
+
```ts
|
|
175
|
+
import { defineDevServerConfig } from '@equinor/fusion-framework-cli';
|
|
223
176
|
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
177
|
+
export default defineDevServerConfig((env, { base }) => ({
|
|
178
|
+
...base,
|
|
179
|
+
// override dev-server options here
|
|
180
|
+
}));
|
|
181
|
+
```
|
|
227
182
|
|
|
228
|
-
|
|
229
|
-
- **Build errors?** Verify your `app.manifest.ts` and `app.config.ts` files for syntax errors
|
|
230
|
-
- **Dev server not starting?** Check for port conflicts (default: 3000) or use `--port` option
|
|
231
|
-
- **Missing dependencies?** Ensure all required packages are installed with `pnpm install`
|
|
183
|
+
### CLI plugins (`fusion-cli.config.ts`)
|
|
232
184
|
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
- **Environment issues?** Check that you're using the correct `--env` parameter
|
|
185
|
+
```ts
|
|
186
|
+
import { defineFusionCli } from '@equinor/fusion-framework-cli';
|
|
236
187
|
|
|
237
|
-
|
|
188
|
+
export default defineFusionCli(() => ({
|
|
189
|
+
plugins: ['@equinor/fusion-framework-cli-plugin-ai'],
|
|
190
|
+
}));
|
|
191
|
+
```
|
|
238
192
|
|
|
239
|
-
|
|
240
|
-
- **Found a bug?** Open an issue on our GitHub repository
|
|
241
|
-
- **Need support?** Check the [docs folder](docs/) or reach out to the Fusion team
|
|
193
|
+
## Documentation
|
|
242
194
|
|
|
195
|
+
- [Developing Apps](docs/application.md) — build, configure, and deploy applications
|
|
196
|
+
- [Developing Portals](docs/portal.md) — build and publish portal templates
|
|
197
|
+
- [Dev Server](docs/dev-server.md) — architecture and configuration
|
|
198
|
+
- [Authentication](docs/auth.md) — local and CI/CD authentication setup
|
|
199
|
+
- [Migration v10 → v11](docs/migration-v10-to-v11.md) — breaking changes and upgrade steps
|