@equinor/fusion-framework-cli 15.5.2 → 15.6.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 +41 -0
- package/README.md +28 -0
- package/bin/build/bin.mjs +1 -1
- package/dist/esm/version.js +1 -1
- package/dist/types/bin/configure-framework.test.d.ts +1 -0
- package/dist/types/bin/index.d.ts +1 -0
- package/dist/types/bin/utils/create-dev-server-config.d.ts +6 -0
- package/dist/types/bin/utils/create-dev-server.test.d.ts +1 -0
- package/dist/types/bin/utils/identify-request.d.ts +22 -0
- package/dist/types/bin/utils/identify-request.test.d.ts +1 -0
- package/dist/types/bin/utils/index.d.ts +1 -0
- package/dist/types/bin/utils/resolve-mock-auth-endpoint.d.ts +16 -0
- package/dist/types/bin/utils/resolve-mock-auth-endpoint.test.d.ts +1 -0
- package/dist/types/version.d.ts +1 -1
- package/package.json +6 -6
package/dist/esm/version.js
CHANGED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -29,6 +29,7 @@ export { uploadPortalBundle, type UploadPortalOptions } from './upload-portal-bu
|
|
|
29
29
|
export { tagPortal } from './tag-portal.js';
|
|
30
30
|
export { pack } from './pack.js';
|
|
31
31
|
export { ConsoleLogger } from './utils/ConsoleLogger.js';
|
|
32
|
+
export { defaultHeaders } from './utils/default-headers.js';
|
|
32
33
|
export { type FusionFramework, FusionEnv, } from './fusion-env.js';
|
|
33
34
|
export { configureFramework, type FusionFrameworkSettings } from './configure-framework.js';
|
|
34
35
|
export { resolveDefaultEnv } from './resolve-default-env.js';
|
|
@@ -37,6 +37,12 @@ export type CreateDevServerOptions = {
|
|
|
37
37
|
};
|
|
38
38
|
/** Origin of a local mock server (e.g. `http://localhost:4010`) to use for service discovery. */
|
|
39
39
|
mock?: string;
|
|
40
|
+
/**
|
|
41
|
+
* Origin of a mock server used for service discovery only, when mock auth was enabled without
|
|
42
|
+
* `mock` (for example through `FUSION_SPA_MSAL_MOCK`). Keeps mock tokens away from real
|
|
43
|
+
* service discovery. Ignored when `mock` is set.
|
|
44
|
+
*/
|
|
45
|
+
mockDiscovery?: string;
|
|
40
46
|
};
|
|
41
47
|
/**
|
|
42
48
|
* Creates the full dev server configuration for Fusion CLI.
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Adds the Fusion Framework CLI identification headers (`X-Fusion-CLI-Name`,
|
|
3
|
+
* `X-Fusion-CLI-Version` and `User-Agent`) to an outgoing HTTP request.
|
|
4
|
+
*
|
|
5
|
+
* Intended as a default request handler on the HTTP module so that every client
|
|
6
|
+
* created by the CLI (service discovery included) identifies itself, instead of
|
|
7
|
+
* each command having to remember to pass the headers. Headers already present on
|
|
8
|
+
* the request are kept, so a caller can still override the identification.
|
|
9
|
+
*
|
|
10
|
+
* @template TRequest - Request shape carrying an optional `headers` init.
|
|
11
|
+
* @param request - The outgoing request being processed by the HTTP request handler.
|
|
12
|
+
* @returns A copy of the request with the identification headers applied.
|
|
13
|
+
*
|
|
14
|
+
* @example
|
|
15
|
+
* ```typescript
|
|
16
|
+
* builder.defaultHttpRequestHandler.set('fusion-cli-identification', identifyRequest);
|
|
17
|
+
* ```
|
|
18
|
+
*/
|
|
19
|
+
export declare const identifyRequest: <TRequest extends {
|
|
20
|
+
headers?: HeadersInit;
|
|
21
|
+
}>(request: TRequest) => TRequest;
|
|
22
|
+
export default identifyRequest;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -15,5 +15,6 @@ export { ConsoleLogger } from './ConsoleLogger.js';
|
|
|
15
15
|
export { createDevServerConfig, type CreateDevServerOptions, } from './create-dev-server-config.js';
|
|
16
16
|
export { createDevServer } from './create-dev-server.js';
|
|
17
17
|
export { defaultHeaders } from './default-headers.js';
|
|
18
|
+
export { identifyRequest } from './identify-request.js';
|
|
18
19
|
export { formatAuthError } from './format-auth-error.js';
|
|
19
20
|
export { formatTokenAcquisitionError } from './format-token-acquisition-error.js';
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import type { RuntimeEnv } from '@equinor/fusion-framework-cli/lib';
|
|
2
|
+
/**
|
|
3
|
+
* Resolves the mock server origin implied by `FUSION_SPA_MSAL_MOCK`, so the dev server can send
|
|
4
|
+
* service discovery to the same mock that issues the tokens.
|
|
5
|
+
*
|
|
6
|
+
* `FUSION_SPA_MSAL_MOCK=true` (from the environment or a `.env` file) makes the SPA sign in with
|
|
7
|
+
* unsigned mock tokens. Real service discovery rejects those tokens, so forwarding discovery
|
|
8
|
+
* requests upstream only produces a stream of `401` responses. Mock auth therefore implies mock
|
|
9
|
+
* discovery, exactly like `--mock` does.
|
|
10
|
+
*
|
|
11
|
+
* @param env - Runtime environment; `mode` and `root` select the `.env` files to read.
|
|
12
|
+
* @param envDir - Optional Vite `envDir`, relative to `root`.
|
|
13
|
+
* @returns `FUSION_SPA_MSAL_MOCK_SERVER_URL`, or `http://localhost:4010` when only
|
|
14
|
+
* `FUSION_SPA_MSAL_MOCK` is set; `undefined` when mock auth is not enabled.
|
|
15
|
+
*/
|
|
16
|
+
export declare function resolveMockAuthEndpoint(env: Pick<RuntimeEnv, 'mode' | 'root'>, envDir?: string): string | undefined;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
package/dist/types/version.d.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export declare const version = "15.
|
|
1
|
+
export declare const version = "15.6.0";
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@equinor/fusion-framework-cli",
|
|
3
|
-
"version": "15.
|
|
3
|
+
"version": "15.6.0",
|
|
4
4
|
"keywords": [
|
|
5
5
|
"Fusion",
|
|
6
6
|
"Fusion Framework",
|
|
@@ -94,11 +94,11 @@
|
|
|
94
94
|
"directory": "packages/cli"
|
|
95
95
|
},
|
|
96
96
|
"dependencies": {
|
|
97
|
-
"@equinor/fusion-framework-dev-portal": "11.1.
|
|
98
|
-
"@equinor/fusion-framework-dev-server": "2.
|
|
97
|
+
"@equinor/fusion-framework-dev-portal": "11.1.5",
|
|
98
|
+
"@equinor/fusion-framework-dev-server": "2.3.1",
|
|
99
99
|
"@equinor/fusion-framework-module-azure-identity": "0.3.3",
|
|
100
100
|
"@equinor/fusion-framework-vite-plugin-raw-imports": "2.0.4",
|
|
101
|
-
"@equinor/fusion-framework-vite-plugin-react-router": "0.1.
|
|
101
|
+
"@equinor/fusion-framework-vite-plugin-react-router": "0.1.3",
|
|
102
102
|
"@equinor/fusion-imports": "2.0.6",
|
|
103
103
|
"@types/inquirer": "^9.0.9",
|
|
104
104
|
"chalk": "^6.0.0",
|
|
@@ -123,13 +123,13 @@
|
|
|
123
123
|
"@equinor/fusion-framework-module": "6.1.5",
|
|
124
124
|
"@equinor/fusion-framework-module-app": "8.2.1",
|
|
125
125
|
"@equinor/fusion-framework-module-http": "8.1.3",
|
|
126
|
-
"@equinor/fusion-framework-module-service-discovery": "10.
|
|
126
|
+
"@equinor/fusion-framework-module-service-discovery": "10.2.0",
|
|
127
127
|
"@rollup/plugin-commonjs": "^29.0.0",
|
|
128
128
|
"@rollup/plugin-json": "^6.1.0",
|
|
129
129
|
"@rollup/plugin-node-resolve": "^16.0.1",
|
|
130
130
|
"@rollup/plugin-replace": "^6.0.2",
|
|
131
131
|
"@rollup/plugin-terser": "^1.0.0",
|
|
132
|
-
"@types/adm-zip": "^0.
|
|
132
|
+
"@types/adm-zip": "^0.6.0",
|
|
133
133
|
"@types/normalize-package-data": "^2.4.4",
|
|
134
134
|
"@types/semver": "^7.7.1",
|
|
135
135
|
"adm-zip": "^0.6.0",
|