@equinor/fusion-framework-cli 8.1.1 → 9.0.1

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.
Files changed (133) hide show
  1. package/CHANGELOG.md +105 -0
  2. package/README.md +78 -0
  3. package/bin/cli.mjs +1 -4
  4. package/dist/bin/build-application.js +44 -0
  5. package/dist/bin/build-application.js.map +1 -0
  6. package/dist/bin/bundle-application.js +55 -0
  7. package/dist/bin/bundle-application.js.map +1 -0
  8. package/dist/bin/create-dev-serve.js +117 -0
  9. package/dist/bin/create-dev-serve.js.map +1 -0
  10. package/dist/bin/create-export-config.js +51 -0
  11. package/dist/bin/create-export-config.js.map +1 -0
  12. package/dist/bin/create-export-manifest.js +60 -0
  13. package/dist/bin/create-export-manifest.js.map +1 -0
  14. package/dist/bin/dev-portal/AppLoader.js +54 -0
  15. package/dist/bin/dev-portal/AppLoader.js.map +1 -0
  16. package/dist/bin/dev-portal/BookMarkSideSheet.js +15 -0
  17. package/dist/bin/dev-portal/BookMarkSideSheet.js.map +1 -0
  18. package/dist/bin/dev-portal/ContextSelector.js +107 -0
  19. package/dist/bin/dev-portal/ContextSelector.js.map +1 -0
  20. package/dist/bin/dev-portal/EquinorLoader.js +14 -0
  21. package/dist/bin/dev-portal/EquinorLoader.js.map +1 -0
  22. package/dist/bin/dev-portal/ErrorViewer.js +7 -0
  23. package/dist/bin/dev-portal/ErrorViewer.js.map +1 -0
  24. package/dist/bin/dev-portal/FusionLogo.js +4 -0
  25. package/dist/bin/dev-portal/FusionLogo.js.map +1 -0
  26. package/dist/bin/dev-portal/Header.js +31 -0
  27. package/dist/bin/dev-portal/Header.js.map +1 -0
  28. package/dist/bin/dev-portal/Router.js +46 -0
  29. package/dist/bin/dev-portal/Router.js.map +1 -0
  30. package/dist/bin/dev-portal/config.js +45 -0
  31. package/dist/bin/dev-portal/config.js.map +1 -0
  32. package/dist/bin/dev-portal/main.js +11 -0
  33. package/dist/bin/dev-portal/main.js.map +1 -0
  34. package/dist/bin/dev-portal/usePersonResolver.js +40 -0
  35. package/dist/bin/dev-portal/usePersonResolver.js.map +1 -0
  36. package/dist/bin/dev-proxy.js +75 -0
  37. package/dist/bin/dev-proxy.js.map +1 -0
  38. package/dist/bin/main.app.js +78 -0
  39. package/dist/bin/main.app.js.map +1 -0
  40. package/dist/bin/main.js +18 -0
  41. package/dist/bin/main.js.map +1 -0
  42. package/dist/bin/utils/execute-commant.js +20 -0
  43. package/dist/bin/utils/execute-commant.js.map +1 -0
  44. package/dist/bin/utils/format.js +17 -0
  45. package/dist/bin/utils/format.js.map +1 -0
  46. package/dist/bin/utils/load-app-config.js +34 -0
  47. package/dist/bin/utils/load-app-config.js.map +1 -0
  48. package/dist/bin/utils/load-manifest.js +35 -0
  49. package/dist/bin/utils/load-manifest.js.map +1 -0
  50. package/dist/bin/utils/load-package.js +24 -0
  51. package/dist/bin/utils/load-package.js.map +1 -0
  52. package/dist/bin/utils/load-vite-config.js +54 -0
  53. package/dist/bin/utils/load-vite-config.js.map +1 -0
  54. package/dist/bin/utils/spinner.js +67 -0
  55. package/dist/bin/utils/spinner.js.map +1 -0
  56. package/dist/lib/app-config.js +54 -0
  57. package/dist/lib/app-config.js.map +1 -0
  58. package/dist/lib/app-manifest.js +70 -0
  59. package/dist/lib/app-manifest.js.map +1 -0
  60. package/dist/lib/app-package.js +33 -0
  61. package/dist/lib/app-package.js.map +1 -0
  62. package/dist/lib/index.js +4 -0
  63. package/dist/lib/index.js.map +1 -0
  64. package/dist/lib/utils/assert.js +27 -0
  65. package/dist/lib/utils/assert.js.map +1 -0
  66. package/dist/lib/utils/config.js +76 -0
  67. package/dist/lib/utils/config.js.map +1 -0
  68. package/dist/lib/utils/expect.js +27 -0
  69. package/dist/lib/utils/expect.js.map +1 -0
  70. package/dist/lib/utils/file-exists.js +27 -0
  71. package/dist/lib/utils/file-exists.js.map +1 -0
  72. package/dist/lib/utils/types.js +2 -0
  73. package/dist/lib/utils/types.js.map +1 -0
  74. package/dist/lib/vite-config.js +81 -0
  75. package/dist/lib/vite-config.js.map +1 -0
  76. package/dist/lib/vite-logger.js +14 -0
  77. package/dist/lib/vite-logger.js.map +1 -0
  78. package/dist/types/bin/build-application.d.ts +12 -0
  79. package/dist/types/bin/bundle-application.d.ts +4 -0
  80. package/dist/types/bin/create-dev-serve.d.ts +10 -0
  81. package/dist/types/bin/create-export-config.d.ts +7 -0
  82. package/dist/types/bin/create-export-manifest.d.ts +20 -0
  83. package/dist/types/bin/dev-portal/AppLoader.d.ts +4 -0
  84. package/dist/types/bin/dev-portal/BookMarkSideSheet.d.ts +6 -0
  85. package/dist/types/bin/dev-portal/ContextSelector.d.ts +2 -0
  86. package/dist/types/bin/dev-portal/EquinorLoader.d.ts +5 -0
  87. package/dist/types/bin/dev-portal/ErrorViewer.d.ts +4 -0
  88. package/dist/types/bin/dev-portal/FusionLogo.d.ts +6 -0
  89. package/dist/types/bin/dev-portal/Header.d.ts +3 -0
  90. package/dist/types/bin/dev-portal/Router.d.ts +1 -0
  91. package/dist/types/bin/dev-portal/config.d.ts +3 -0
  92. package/dist/types/bin/dev-portal/main.d.ts +1 -0
  93. package/dist/types/bin/dev-portal/usePersonResolver.d.ts +1 -0
  94. package/dist/types/bin/dev-proxy.d.ts +27 -0
  95. package/dist/types/bin/main.app.d.ts +3 -0
  96. package/dist/types/bin/main.d.ts +1 -0
  97. package/dist/types/bin/utils/execute-commant.d.ts +8 -0
  98. package/dist/types/bin/utils/format.d.ts +9 -0
  99. package/dist/types/bin/utils/load-app-config.d.ts +9 -0
  100. package/dist/types/bin/utils/load-manifest.d.ts +9 -0
  101. package/dist/types/bin/utils/load-package.d.ts +5 -0
  102. package/dist/types/bin/utils/load-vite-config.d.ts +10 -0
  103. package/dist/types/bin/utils/spinner.d.ts +19 -0
  104. package/dist/types/lib/app-config.d.ts +27 -0
  105. package/dist/types/lib/app-manifest.d.ts +35 -0
  106. package/dist/types/lib/app-package.d.ts +23 -0
  107. package/dist/types/lib/index.d.ts +3 -0
  108. package/dist/types/lib/utils/assert.d.ts +10 -0
  109. package/dist/types/lib/utils/config.d.ts +26 -0
  110. package/dist/types/lib/utils/expect.d.ts +4 -0
  111. package/dist/types/lib/utils/file-exists.d.ts +6 -0
  112. package/dist/types/lib/utils/types.d.ts +6 -0
  113. package/dist/types/lib/vite-config.d.ts +17 -0
  114. package/dist/types/lib/vite-logger.d.ts +2 -0
  115. package/dist/types/version.d.ts +1 -0
  116. package/dist/version.js +1 -1
  117. package/package.json +26 -2
  118. package/dist/scripts/app-config.d.ts +0 -38
  119. package/dist/scripts/app-config.js +0 -73
  120. package/dist/scripts/app-config.js.map +0 -1
  121. package/dist/scripts/create-config.d.ts +0 -7
  122. package/dist/scripts/create-config.js +0 -59
  123. package/dist/scripts/create-config.js.map +0 -1
  124. package/dist/scripts/main.d.ts +0 -2
  125. package/dist/scripts/main.js +0 -51
  126. package/dist/scripts/main.js.map +0 -1
  127. package/dist/scripts/serve.d.ts +0 -6
  128. package/dist/scripts/serve.js +0 -109
  129. package/dist/scripts/serve.js.map +0 -1
  130. package/dist/version.d.ts +0 -1
  131. /package/dist/{scripts/dev-portal → bin/public}/assets/index-61aab88e.js +0 -0
  132. /package/dist/{scripts/dev-portal → bin/public}/index.html +0 -0
  133. /package/dist/{index.d.ts → types/index.d.ts} +0 -0
@@ -0,0 +1,81 @@
1
+ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
2
+ function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
3
+ return new (P || (P = Promise))(function (resolve, reject) {
4
+ function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
5
+ function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
6
+ function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
7
+ step((generator = generator.apply(thisArg, _arguments || [])).next());
8
+ });
9
+ };
10
+ import nodePath from 'node:path';
11
+ import { defineConfig, mergeConfig } from 'vite';
12
+ import { createViteLogger } from './vite-logger.js';
13
+ import { AssertionError, assertObject } from './utils/assert.js';
14
+ import { loadConfig, resolveConfig, initiateConfig, } from './utils/config.js';
15
+ import viteEnv from 'vite-plugin-environment';
16
+ import tsconfigPaths from 'vite-tsconfig-paths';
17
+ import { fileExistsSync } from './utils/file-exists.js';
18
+ const configFilename = 'app.vite.config';
19
+ export function assertViteConfig(config) {
20
+ assertObject(config);
21
+ }
22
+ export const loadViteConfig = (filename) => loadConfig(filename !== null && filename !== void 0 ? filename : configFilename);
23
+ export const resolveViteConfig = (options) => __awaiter(void 0, void 0, void 0, function* () {
24
+ if (options === null || options === void 0 ? void 0 : options.file) {
25
+ const config = yield loadViteConfig(options.file);
26
+ return {
27
+ config,
28
+ path: options.file,
29
+ };
30
+ }
31
+ return resolveConfig(configFilename, { find: options });
32
+ });
33
+ export const createAppViteConfig = (env, options) => __awaiter(void 0, void 0, void 0, function* () {
34
+ const resolved = yield resolveViteConfig(options);
35
+ if (resolved) {
36
+ const config = yield initiateConfig(resolved.config, env);
37
+ return { config, path: resolved.path };
38
+ }
39
+ else if (options === null || options === void 0 ? void 0 : options.file) {
40
+ throw new AssertionError({
41
+ message: `Expected to load config from ${options.file}`,
42
+ expected: '<file>',
43
+ });
44
+ }
45
+ });
46
+ export const resolveEntryPoint = (cwd, dir, opt) => {
47
+ var _a;
48
+ cwd !== null && cwd !== void 0 ? cwd : (cwd = process.cwd());
49
+ dir !== null && dir !== void 0 ? dir : (dir = 'src');
50
+ const files = (_a = opt === null || opt === void 0 ? void 0 : opt.files) !== null && _a !== void 0 ? _a : ['index.ts', 'index.tsx', 'main.ts', 'main.tsx'];
51
+ return files
52
+ .map((file) => [dir, file].join('/'))
53
+ .find((file) => fileExistsSync(nodePath.resolve(cwd, file)));
54
+ };
55
+ export const createViteConfig = (env, overrides) => __awaiter(void 0, void 0, void 0, function* () {
56
+ const { root = process.cwd() } = env;
57
+ const entry = String(resolveEntryPoint(root));
58
+ const defaultConfig = defineConfig({
59
+ plugins: [
60
+ tsconfigPaths(),
61
+ viteEnv({
62
+ NODE_ENV: env.mode,
63
+ }),
64
+ ],
65
+ root,
66
+ server: {
67
+ middlewareMode: true,
68
+ },
69
+ appType: 'custom',
70
+ build: {
71
+ lib: {
72
+ entry,
73
+ fileName: 'app-bundle',
74
+ formats: ['es'],
75
+ },
76
+ },
77
+ customLogger: createViteLogger(),
78
+ });
79
+ return overrides ? mergeConfig(defaultConfig, overrides) : defaultConfig;
80
+ });
81
+ //# sourceMappingURL=vite-config.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"vite-config.js","sourceRoot":"","sources":["../../src/lib/vite-config.ts"],"names":[],"mappings":"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"}
@@ -0,0 +1,14 @@
1
+ import { createLogger as _createLogger } from 'vite';
2
+ export const createViteLogger = () => {
3
+ const logger = _createLogger();
4
+ const originalWarning = logger.warn;
5
+ logger.warn = (msg, options) => {
6
+ if (msg.includes('import(manifest.entry)') &&
7
+ msg.includes('dynamic-import-vars#limitations'))
8
+ return;
9
+ originalWarning(msg, options);
10
+ };
11
+ return logger;
12
+ };
13
+ export default createViteLogger;
14
+ //# sourceMappingURL=vite-logger.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"vite-logger.js","sourceRoot":"","sources":["../../src/lib/vite-logger.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,IAAI,aAAa,EAAE,MAAM,MAAM,CAAC;AAErD,MAAM,CAAC,MAAM,gBAAgB,GAAG,GAAG,EAAE;IACjC,MAAM,MAAM,GAAG,aAAa,EAAE,CAAC;IAC/B,MAAM,eAAe,GAAG,MAAM,CAAC,IAAI,CAAC;IACpC,MAAM,CAAC,IAAI,GAAG,CAAC,GAAG,EAAE,OAAO,EAAE,EAAE;QAE3B,IACI,GAAG,CAAC,QAAQ,CAAC,wBAAwB,CAAC;YACtC,GAAG,CAAC,QAAQ,CAAC,iCAAiC,CAAC;YAE/C,OAAO;QACX,eAAe,CAAC,GAAG,EAAE,OAAO,CAAC,CAAC;IAClC,CAAC,CAAC;IACF,OAAO,MAAM,CAAC;AAClB,CAAC,CAAC;AAEF,eAAe,gBAAgB,CAAC"}
@@ -0,0 +1,12 @@
1
+ export declare const buildApplication: (options: {
2
+ configSourceFiles?: {
3
+ app?: string;
4
+ manifest?: string;
5
+ vite?: string;
6
+ };
7
+ outDir: string;
8
+ library?: 'react';
9
+ }) => Promise<{
10
+ viteConfig: import("vite").UserConfig | Record<string, any>;
11
+ viteBuild: import("rollup").RollupOutput | import("rollup").RollupOutput[] | import("rollup").RollupWatcher;
12
+ }>;
@@ -0,0 +1,4 @@
1
+ export declare const bundleApplication: (options: {
2
+ outDir: string;
3
+ archive: string;
4
+ }) => Promise<void>;
@@ -0,0 +1,10 @@
1
+ export declare const createDevServer: (options: {
2
+ portal: string;
3
+ configSourceFiles: {
4
+ app?: string;
5
+ manifest?: string;
6
+ vite?: string;
7
+ };
8
+ port?: number;
9
+ library?: 'react';
10
+ }) => Promise<void>;
@@ -0,0 +1,7 @@
1
+ import { ConfigExecuterEnv } from '../lib/utils/config.js';
2
+ export declare const createExportConfig: (options?: {
3
+ command?: ConfigExecuterEnv['command'];
4
+ configFile?: string;
5
+ outputFile?: string;
6
+ }) => Promise<import("../lib/app-config.js").AppConfig>;
7
+ export default createExportConfig;
@@ -0,0 +1,20 @@
1
+ import { ConfigExecuterEnv } from '../lib/utils/config.js';
2
+ import { AppManifest } from '../lib/app-manifest.js';
3
+ export declare const normalizeVersion: (version: string) => {
4
+ major: number;
5
+ minor: number;
6
+ patch: number;
7
+ };
8
+ type AppManifestExport = Omit<AppManifest, 'version'> & {
9
+ version: {
10
+ major: number;
11
+ minor: number;
12
+ patch: number;
13
+ };
14
+ };
15
+ export declare const createExportManifest: (options?: {
16
+ command?: ConfigExecuterEnv['command'];
17
+ configFile?: string;
18
+ outputFile?: string;
19
+ }) => Promise<AppManifestExport>;
20
+ export default createExportManifest;
@@ -0,0 +1,4 @@
1
+ export declare const AppLoader: (props: {
2
+ readonly appKey: string;
3
+ }) => import("react/jsx-runtime").JSX.Element;
4
+ export default AppLoader;
@@ -0,0 +1,6 @@
1
+ type BookmarkSideSheetProps = {
2
+ readonly isOpen: boolean;
3
+ onClose(): void;
4
+ };
5
+ export declare const BookmarkSideSheet: ({ isOpen, onClose }: BookmarkSideSheetProps) => import("react/jsx-runtime").JSX.Element;
6
+ export {};
@@ -0,0 +1,2 @@
1
+ export declare const ContextSelector: () => import("react/jsx-runtime").JSX.Element;
2
+ export default ContextSelector;
@@ -0,0 +1,5 @@
1
+ import React from 'react';
2
+ export declare const EquinorLoader: ({ children, text, }: React.PropsWithChildren<{
3
+ readonly text: string;
4
+ }>) => JSX.Element;
5
+ export default EquinorLoader;
@@ -0,0 +1,4 @@
1
+ export declare const ErrorViewer: ({ error }: {
2
+ readonly error: Error;
3
+ }) => import("react/jsx-runtime").JSX.Element;
4
+ export default ErrorViewer;
@@ -0,0 +1,6 @@
1
+ /// <reference types="react" />
2
+ type FusionLogoProps = Omit<React.SVGProps<SVGSVGElement>, 'viewBox'> & {
3
+ readonly scale?: number;
4
+ };
5
+ export declare const FusionLogo: (props: FusionLogoProps) => import("react/jsx-runtime").JSX.Element;
6
+ export default FusionLogo;
@@ -0,0 +1,3 @@
1
+ import '@material-ui/styles';
2
+ export declare const Header: () => import("react/jsx-runtime").JSX.Element;
3
+ export default Header;
@@ -0,0 +1 @@
1
+ export declare const Router: () => import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1,3 @@
1
+ import { FrameworkConfigurator } from '@equinor/fusion-framework';
2
+ export declare const configure: (config: FrameworkConfigurator) => Promise<void>;
3
+ export default configure;
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1 @@
1
+ export declare const usePersonResolver: () => any;
@@ -0,0 +1,27 @@
1
+ /// <reference types="node" />
2
+ import express, { type Express } from 'express';
3
+ import { type Options as ProxyOptions } from 'http-proxy-middleware';
4
+ import { type AppManifest } from '../lib/app-manifest.js';
5
+ import { type IncomingMessage } from 'node:http';
6
+ import { type AppConfig } from '../lib/app-config.js';
7
+ type ProxyHandlerResult<T> = {
8
+ response?: T;
9
+ statusCode?: number;
10
+ path?: string;
11
+ } | void;
12
+ type ProxyHandlerReturn<T> = Promise<ProxyHandlerResult<T>> | ProxyHandlerResult<T>;
13
+ export interface ProxyHandler {
14
+ onManifestResponse(slug: {
15
+ appKey: string;
16
+ }, message: IncomingMessage, data?: AppManifest): ProxyHandlerReturn<AppManifest>;
17
+ onConfigResponse(slug: {
18
+ appKey: string;
19
+ }, message: IncomingMessage, data?: AppConfig): ProxyHandlerReturn<AppConfig>;
20
+ }
21
+ export declare const createDevProxy: (handler: ProxyHandler, options: Pick<ProxyOptions, "target"> & {
22
+ staticAssets?: {
23
+ path: string;
24
+ options?: Parameters<typeof express.static>[1];
25
+ }[] | undefined;
26
+ }) => Express;
27
+ export default createDevProxy;
@@ -0,0 +1,3 @@
1
+ import { Command } from 'commander';
2
+ declare const _default: (program: Command) => void;
3
+ export default _default;
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1,8 @@
1
+ type Commands = {
2
+ app: {
3
+ build: '';
4
+ manifest: '';
5
+ };
6
+ };
7
+ export declare const executeCommand: <TProgram extends "app">(program: TProgram, command: keyof Commands[TProgram], ...options: any[]) => Promise<unknown>;
8
+ export {};
@@ -0,0 +1,9 @@
1
+ import { relative } from 'node:path';
2
+ import chalk from 'chalk';
3
+ export { chalk };
4
+ export declare const formatPath: (path: string, opt?: {
5
+ relative?: boolean;
6
+ cwd?: string;
7
+ }) => string;
8
+ export declare const formatByteSize: (input: string | number) => string;
9
+ export default chalk;
@@ -0,0 +1,9 @@
1
+ import { type ConfigExecuterEnv } from '../../lib/utils/config.js';
2
+ import { type ResolvedAppPackage } from '../../lib/app-package.js';
3
+ export declare const loadAppConfig: (env: ConfigExecuterEnv, pkg: ResolvedAppPackage, options?: {
4
+ file?: string;
5
+ }) => Promise<{
6
+ config: import("../../lib/app-config.js").AppConfig;
7
+ path?: string | undefined;
8
+ }>;
9
+ export default loadAppConfig;
@@ -0,0 +1,9 @@
1
+ import { type ConfigExecuterEnv } from '../../lib/utils/config.js';
2
+ import { type ResolvedAppPackage } from '../../lib/app-package.js';
3
+ export declare const loadAppManifest: (env: ConfigExecuterEnv, pkg: ResolvedAppPackage, options?: {
4
+ file?: string;
5
+ }) => Promise<{
6
+ manifest: import("../../lib/app-manifest.js").AppManifest;
7
+ path?: string | undefined;
8
+ }>;
9
+ export default loadAppManifest;
@@ -0,0 +1,5 @@
1
+ export declare const loadPackage: () => Promise<{
2
+ root: string;
3
+ packageJson: import("../../lib/app-package.js").AppPackageJson;
4
+ path: string;
5
+ }>;
@@ -0,0 +1,10 @@
1
+ import { type ConfigExecuterEnv } from '../../lib/utils/config.js';
2
+ export declare const loadViteConfig: (env: ConfigExecuterEnv, options?: {
3
+ file?: string;
4
+ }) => Promise<{
5
+ viteConfig: Record<string, any>;
6
+ path: string | undefined;
7
+ } | {
8
+ viteConfig: import("vite").UserConfig;
9
+ path?: undefined;
10
+ }>;
@@ -0,0 +1,19 @@
1
+ import { Options, type Ora } from 'ora';
2
+ export declare class Spinner {
3
+ #private;
4
+ get ora(): Ora;
5
+ static Global(options?: Options): Spinner;
6
+ static Clone(spinner?: Spinner): Spinner;
7
+ static get Current(): Spinner;
8
+ static set Current(spinner: Spinner);
9
+ constructor(options?: Options);
10
+ get prefixText(): string;
11
+ info(...args: string[]): void;
12
+ succeed(...args: string[]): void;
13
+ start(...args: string[]): void;
14
+ fail(...args: string[]): void;
15
+ warn(...args: string[]): void;
16
+ clear(): void;
17
+ stop(): void;
18
+ stopAndPersist(...args: Parameters<Ora['stopAndPersist']>): void;
19
+ }
@@ -0,0 +1,27 @@
1
+ import { type ResolvedConfig, type FindConfigOptions, ConfigExecuterEnv } from './utils/config.js';
2
+ import { ResolvedAppPackage } from './app-package.js';
3
+ export type AppConfig = {
4
+ environment?: Record<string, unknown>;
5
+ endpoints?: Record<string, string>;
6
+ };
7
+ type FindAppConfigOptions = FindConfigOptions & {
8
+ file?: string;
9
+ };
10
+ export type AppConfigFn = (env: ConfigExecuterEnv, args: {
11
+ base: AppConfig;
12
+ }) => AppConfig | Promise<AppConfig>;
13
+ export type AppConfigExport = AppConfig | AppConfigFn;
14
+ export declare const appConfigFilename = "app.config";
15
+ export declare function assertAppConfig(value: AppConfig): asserts value;
16
+ export declare const defineAppConfig: (fn: AppConfigFn) => AppConfigFn;
17
+ export declare const mergeAppConfigs: (base: Partial<AppConfig>, overrides: Partial<AppConfig>) => AppConfig;
18
+ export declare const loadAppConfig: (filename?: string) => Promise<import("./utils/config.js").ConfigExecuter<AppConfig, import("./utils/config.js").ConfigExecuterArgs>>;
19
+ export declare const resolveAppConfig: (options?: FindConfigOptions & {
20
+ file?: string;
21
+ }) => Promise<ResolvedConfig<AppConfigFn> | void>;
22
+ export declare const createAppConfigFromPackage: (_pkg: ResolvedAppPackage) => AppConfig;
23
+ export declare const createAppConfig: (env: ConfigExecuterEnv, base: AppConfig, options?: FindAppConfigOptions) => Promise<{
24
+ config: AppConfig;
25
+ path?: string;
26
+ }>;
27
+ export {};
@@ -0,0 +1,35 @@
1
+ import { ResolvedAppPackage } from './app-package.js';
2
+ import { type FindConfigOptions, type ResolvedConfig, ConfigExecuterEnv } from './utils/config.js';
3
+ import { RecursivePartial } from './utils/types.js';
4
+ export type AppManifest = {
5
+ version: string;
6
+ key: string;
7
+ entry: string;
8
+ name: string;
9
+ shortName: string;
10
+ description?: string;
11
+ admins?: string[];
12
+ owners?: string[];
13
+ main?: string;
14
+ icon?: string;
15
+ };
16
+ export type AppManifestFn = (env: ConfigExecuterEnv, args: {
17
+ base: AppManifest;
18
+ }) => AppManifest | Promise<AppManifest>;
19
+ type FindManifestOptions = FindConfigOptions & {
20
+ file?: string;
21
+ };
22
+ export declare const manifestConfigFilename = "app.manifest.config";
23
+ export declare const defineAppManifest: (fn: AppManifestFn) => AppManifestFn;
24
+ export declare function assertAppManifest(value: AppManifest): asserts value;
25
+ export declare const mergeManifests: (base: RecursivePartial<AppManifest>, overrides: RecursivePartial<AppManifest>) => AppManifest;
26
+ export declare const loadManifest: (filename?: string) => Promise<import("./utils/config.js").ConfigExecuter<AppManifest, import("./utils/config.js").ConfigExecuterArgs>>;
27
+ export declare const resolveManifest: (options?: FindConfigOptions & {
28
+ file?: string;
29
+ }) => Promise<ResolvedConfig<AppManifestFn> | void>;
30
+ export declare const createManifestFromPackage: (pkg: ResolvedAppPackage) => AppManifest;
31
+ export declare const createManifest: (env: ConfigExecuterEnv, base: AppManifest, options?: FindManifestOptions) => Promise<{
32
+ manifest: AppManifest;
33
+ path?: string;
34
+ }>;
35
+ export {};
@@ -0,0 +1,23 @@
1
+ import { PackageJson, type NormalizeOptions as ResolveAppPackageOptions } from 'read-pkg-up';
2
+ import { AppManifest } from './app-manifest.js';
3
+ export type AppPackageJson = PackageJson & {
4
+ manifest?: AppManifest;
5
+ };
6
+ type DefinePackageFn = () => AppPackageJson | Promise<AppPackageJson>;
7
+ type DefinePackageExporter = AppPackageJson | DefinePackageFn;
8
+ export interface defineAppPackage {
9
+ (obj: AppPackageJson): AppPackageJson;
10
+ }
11
+ export interface defineAppPackage {
12
+ (fn: DefinePackageFn): void;
13
+ }
14
+ export type ResolvedAppPackage = {
15
+ packageJson: AppPackageJson;
16
+ path: string;
17
+ };
18
+ export declare function defineAppPackage(fnOrObject: DefinePackageExporter): DefinePackageExporter;
19
+ export declare const resolveEntryPoint: (packageJson: Pick<PackageJson, 'main' | 'module'>) => string;
20
+ export declare const resolveAppKey: (packageJson: Pick<PackageJson, 'name'>) => string;
21
+ export declare const assertPackage: (_pkg: Partial<AppPackageJson>) => void;
22
+ export declare const resolveAppPackage: (options?: ResolveAppPackageOptions) => Promise<ResolvedAppPackage>;
23
+ export default resolveAppPackage;
@@ -0,0 +1,3 @@
1
+ export { mergeManifests, defineAppManifest, type AppManifest, type AppManifestFn, } from './app-manifest.js';
2
+ export { mergeAppConfigs, defineAppConfig, type AppConfig, type AppConfigFn, type AppConfigExport, } from './app-config.js';
3
+ export { defineAppPackage, resolveAppKey, resolveEntryPoint, type AppPackageJson, type ResolvedAppPackage, } from './app-package.js';
@@ -0,0 +1,10 @@
1
+ import assert, { AssertionError } from 'node:assert';
2
+ export { assert, AssertionError };
3
+ export declare function assertNumber(value: unknown, message?: string): asserts value;
4
+ export declare function assertObject(value: object, message?: string | Error): asserts value;
5
+ declare function assertObjectEntryValue<P>(value: unknown, prop: P, message?: string): asserts value;
6
+ export declare function assertObjectEntries<T extends object, P extends Array<keyof T>>(value: T, options?: {
7
+ props?: P;
8
+ assertion?: typeof assertObjectEntryValue;
9
+ preMessage?: string;
10
+ }): asserts value;
@@ -0,0 +1,26 @@
1
+ import { Options } from 'find-up';
2
+ export declare const supportedExt: readonly [".ts", ".js", ".json"];
3
+ export type SupportedExt = (typeof supportedExt)[number];
4
+ export type FindConfigOptions = Omit<Options, 'file'> & {
5
+ extensions?: Array<SupportedExt>;
6
+ };
7
+ export type ResolveConfigOptions = {
8
+ find?: FindConfigOptions;
9
+ };
10
+ export type ConfigExecuterEnv = {
11
+ command: 'serve' | 'build';
12
+ mode: string;
13
+ root?: string;
14
+ };
15
+ export type ConfigExecuterArgs = [ConfigExecuterEnv, ...any[]];
16
+ export type ConfigExecuter<TType = any, TArgs extends ConfigExecuterArgs = ConfigExecuterArgs> = (...args: TArgs) => TType | Promise<TType>;
17
+ export type ConfigExecuterType<T> = T extends ConfigExecuter<infer TType> ? TType : never;
18
+ export type ResolvedConfig<TType extends ConfigExecuter> = {
19
+ path: string;
20
+ config: TType;
21
+ };
22
+ export declare const findConfigs: (filename: string, options?: FindConfigOptions) => Promise<string[]>;
23
+ export declare const resolveConfig: <TType>(filename: string, options?: ResolveConfigOptions) => Promise<void | ResolvedConfig<ConfigExecuter<TType, ConfigExecuterArgs>>>;
24
+ export declare const loadConfig: <TType>(file: string) => Promise<ConfigExecuter<TType, ConfigExecuterArgs>>;
25
+ export declare function initiateConfig<TConfig extends ConfigExecuter>(config: TConfig, ...args: Parameters<TConfig>): Promise<ConfigExecuterType<TConfig>>;
26
+ export default loadConfig;
@@ -0,0 +1,4 @@
1
+ export declare const expect: <T>(value: T) => {
2
+ toBe: (expected: T, message: string) => asserts expected;
3
+ toBeInstanceOf: (expected: T, message: string) => asserts expected;
4
+ };
@@ -0,0 +1,6 @@
1
+ type Options = {
2
+ assert?: boolean;
3
+ };
4
+ export declare const fileExistsSync: (file: string, options?: Options) => boolean;
5
+ export declare const fileExists: (file: string, options?: Options) => boolean;
6
+ export {};
@@ -0,0 +1,6 @@
1
+ export type RecursivePartial<T> = {
2
+ [P in keyof T]?: T[P] extends Array<infer U> ? Array<Value<U>> : Value<T[P]>;
3
+ };
4
+ type AllowedPrimitives = boolean | string | number | Date;
5
+ type Value<T> = T extends AllowedPrimitives ? T : RecursivePartial<T>;
6
+ export {};
@@ -0,0 +1,17 @@
1
+ import { type UserConfig, type UserConfigFn } from 'vite';
2
+ import { type FindConfigOptions, type ResolvedConfig, ConfigExecuterEnv } from './utils/config.js';
3
+ export declare function assertViteConfig(config: UserConfig): asserts config;
4
+ export declare const loadViteConfig: (filename?: string) => Promise<import("./utils/config.js").ConfigExecuter<UserConfig, import("./utils/config.js").ConfigExecuterArgs>>;
5
+ export declare const resolveViteConfig: (options?: FindConfigOptions & {
6
+ file?: string;
7
+ }) => Promise<ResolvedConfig<UserConfigFn> | void>;
8
+ export declare const createAppViteConfig: (env: ConfigExecuterEnv, options?: FindConfigOptions & {
9
+ file?: string;
10
+ }) => Promise<{
11
+ config: UserConfig;
12
+ path?: string;
13
+ } | void>;
14
+ export declare const resolveEntryPoint: (cwd?: string, dir?: string, opt?: {
15
+ files?: string[];
16
+ }) => string | undefined;
17
+ export declare const createViteConfig: (env: ConfigExecuterEnv, overrides?: UserConfig) => Promise<UserConfig>;
@@ -0,0 +1,2 @@
1
+ export declare const createViteLogger: () => import("vite").Logger;
2
+ export default createViteLogger;
@@ -0,0 +1 @@
1
+ export declare const version = "9.0.1";
package/dist/version.js CHANGED
@@ -1,2 +1,2 @@
1
- export const version = '8.1.1';
1
+ export const version = '9.0.1';
2
2
  //# sourceMappingURL=version.js.map
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@equinor/fusion-framework-cli",
3
- "version": "8.1.1",
3
+ "version": "9.0.1",
4
4
  "keywords": [
5
5
  "Fusion",
6
6
  "Fusion Framework",
@@ -12,22 +12,44 @@
12
12
  "access": "public"
13
13
  },
14
14
  "type": "module",
15
+ "main": "./bin/main.js",
15
16
  "bin": {
16
17
  "fusion-framework-cli": "./bin/cli.mjs"
17
18
  },
19
+ "exports": {
20
+ ".": {
21
+ "import": {
22
+ "default": "./dist/lib/index.js",
23
+ "types": "./dist/types/lib/index.d.ts"
24
+ }
25
+ }
26
+ },
27
+ "types": "./dist/types/lib/index.d.ts",
18
28
  "dependencies": {
19
29
  "@equinor/eds-core-react": "^0.32.4",
20
30
  "@equinor/eds-icons": "^0.19.3",
21
31
  "@equinor/eds-tokens": "^0.9.2",
32
+ "@types/adm-zip": "^0.5.0",
33
+ "@types/semver": "^7.5.0",
22
34
  "@vitejs/plugin-react": "^4.0.4",
35
+ "adm-zip": "^0.5.10",
36
+ "chalk": "^5.3.0",
23
37
  "commander": "^11.0.0",
38
+ "deepmerge": "^4.3.1",
24
39
  "express": "^4.18.2",
40
+ "express-rate-limit": "^6.9.0",
25
41
  "find-up": "^6.3.0",
26
42
  "http-proxy-middleware": "^2.0.6",
27
- "kleur": "^4.1.5",
43
+ "is-mergeable-object": "^1.1.1",
28
44
  "ora": "^7.0.1",
45
+ "portfinder": "^1.0.32",
46
+ "pretty-bytes": "^6.1.1",
47
+ "read-pkg-up": "^10.0.0",
48
+ "semver": "^7.5.4",
49
+ "ts-import": "5.0.0-beta.0",
29
50
  "vite": "^4.4.9",
30
51
  "vite-plugin-environment": "^1.1.3",
52
+ "vite-plugin-restart": "^0.3.1",
31
53
  "vite-tsconfig-paths": "^4.2.0",
32
54
  "@equinor/fusion-framework-app": "^7.1.3",
33
55
  "@equinor/fusion-observable": "^8.1.1"
@@ -53,8 +75,10 @@
53
75
  "react": "^18.2.0",
54
76
  "react-dom": "^18.2.0",
55
77
  "react-router-dom": "^6.15.0",
78
+ "rollup": "^3.28.1",
56
79
  "rxjs": "^7.8.1",
57
80
  "styled-components": "^6.0.7",
81
+ "types": "link:./types",
58
82
  "typescript": "^5.1.3",
59
83
  "@equinor/fusion-framework": "^7.0.18",
60
84
  "@equinor/fusion-framework-app": "^7.1.3",
@@ -1,38 +0,0 @@
1
- declare const supportedTypes: readonly ["js", "json"];
2
- type SupportedTyped = (typeof supportedTypes)[number];
3
- type PackageInfo = {
4
- version: string;
5
- name: string;
6
- main: string;
7
- };
8
- type AppConfig = {
9
- manifest?: {
10
- key?: string;
11
- };
12
- environment?: Record<string, unknown>;
13
- endpoints?: Record<string, string>;
14
- portalHost?: string;
15
- };
16
- type ConfigSource = {
17
- type: SupportedTyped;
18
- file: string;
19
- };
20
- type LocalConfig = AppConfig & {
21
- configSource?: ConfigSource;
22
- pkg: any;
23
- root: any;
24
- };
25
- export declare const resolvePackageRoot: () => string;
26
- export declare const resolvePackage: () => {
27
- root: string;
28
- pkg: PackageInfo;
29
- };
30
- export declare const getConfigType: (root: string) => {
31
- type: SupportedTyped;
32
- file: string;
33
- } | undefined;
34
- export declare const loadConfig: (path: string) => Promise<AppConfig & {
35
- configSource?: ConfigSource | undefined;
36
- }>;
37
- export declare const resolveAppConfig: () => Promise<LocalConfig>;
38
- export {};