@equinor/fusion-framework-cli 11.0.0-next.8 → 11.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.
Files changed (224) hide show
  1. package/CHANGELOG.md +58 -103
  2. package/README.md +112 -57
  3. package/bin/build/bin.mjs +1 -0
  4. package/bin/build/cli.mjs +7 -0
  5. package/bin/cli.mjs +1 -1
  6. package/dist/esm/lib/app/app-config.js.map +1 -1
  7. package/dist/esm/lib/app/app-manifest.js.map +1 -1
  8. package/dist/esm/lib/app/app-package.js +1 -1
  9. package/dist/esm/lib/app/app-package.js.map +1 -1
  10. package/dist/esm/lib/app/merge-app-config.js +11 -5
  11. package/dist/esm/lib/app/merge-app-config.js.map +1 -1
  12. package/dist/esm/lib/app/merge-app-manifest.js +2 -2
  13. package/dist/esm/lib/app/merge-app-manifest.js.map +1 -1
  14. package/dist/esm/lib/index.js +3 -1
  15. package/dist/esm/lib/index.js.map +1 -1
  16. package/dist/esm/lib/load-dev-server-config.js +7 -3
  17. package/dist/esm/lib/load-dev-server-config.js.map +1 -1
  18. package/dist/esm/lib/merge-dev-server-config.js +24 -16
  19. package/dist/esm/lib/merge-dev-server-config.js.map +1 -1
  20. package/dist/esm/lib/portal/create-portal-manifest.js.map +1 -1
  21. package/dist/esm/lib/portal/load-portal-config.js +1 -1
  22. package/dist/esm/lib/portal/load-portal-config.js.map +1 -1
  23. package/dist/esm/lib/portal/load-portal-manifest.js +8 -4
  24. package/dist/esm/lib/portal/load-portal-manifest.js.map +1 -1
  25. package/dist/esm/lib/portal/load-portal-schema.js.map +1 -1
  26. package/dist/esm/lib/portal/portal-config.js.map +1 -1
  27. package/dist/esm/lib/utils/index.js +1 -0
  28. package/dist/esm/lib/utils/index.js.map +1 -1
  29. package/dist/esm/lib/utils/resolve-annotations.js +48 -5
  30. package/dist/esm/lib/utils/resolve-annotations.js.map +1 -1
  31. package/dist/esm/lib/utils/resolve-devops-annotations.js +7 -3
  32. package/dist/esm/lib/utils/resolve-devops-annotations.js.map +1 -1
  33. package/dist/esm/lib/utils/resolve-git-commit-sha.js +1 -0
  34. package/dist/esm/lib/utils/resolve-git-commit-sha.js.map +1 -1
  35. package/dist/esm/lib/utils/resolve-github-annotations.js +16 -72
  36. package/dist/esm/lib/utils/resolve-github-annotations.js.map +1 -1
  37. package/dist/esm/version.js +1 -1
  38. package/dist/types/bin/app-build.d.ts +2 -2
  39. package/dist/types/bin/app-check.d.ts +2 -2
  40. package/dist/types/bin/app-config-publish.d.ts +2 -2
  41. package/dist/types/bin/app-config.d.ts +3 -3
  42. package/dist/types/bin/app-dev.d.ts +1 -1
  43. package/dist/types/bin/app-manifest.d.ts +3 -3
  44. package/dist/types/bin/app-pack.d.ts +1 -1
  45. package/dist/types/bin/app-tag.d.ts +3 -3
  46. package/dist/types/bin/app-upload.d.ts +2 -2
  47. package/dist/types/bin/helpers/load-vite-config.d.ts +1 -2
  48. package/dist/types/bin/helpers/resolve-app-config.d.ts +3 -3
  49. package/dist/types/bin/helpers/resolve-app-manifest.d.ts +3 -3
  50. package/dist/types/bin/helpers/resolve-portal-config.d.ts +3 -3
  51. package/dist/types/bin/helpers/resolve-portal-manifest.d.ts +3 -4
  52. package/dist/types/bin/helpers/resolve-project-package.d.ts +2 -2
  53. package/dist/types/bin/index.d.ts +9 -0
  54. package/dist/types/bin/pack.d.ts +1 -1
  55. package/dist/types/bin/portal-build.d.ts +5 -5
  56. package/dist/types/bin/portal-config-publish.d.ts +2 -2
  57. package/dist/types/bin/portal-config.d.ts +4 -4
  58. package/dist/types/bin/portal-dev.d.ts +2 -2
  59. package/dist/types/bin/portal-manifest.d.ts +4 -4
  60. package/dist/types/bin/portal-pack.d.ts +3 -3
  61. package/dist/types/bin/portal-tag.d.ts +2 -2
  62. package/dist/types/bin/portal-upload.d.ts +2 -2
  63. package/dist/types/bin/utils/create-dev-server.d.ts +2 -2
  64. package/dist/types/cli/commands/disco/resolve.d.ts +1 -1
  65. package/dist/types/cli/main.d.ts +0 -20
  66. package/dist/types/cli/options/env.d.ts +1 -2
  67. package/dist/types/lib/app/app-config.d.ts +2 -2
  68. package/dist/types/lib/app/app-manifest.d.ts +1 -1
  69. package/dist/types/lib/app/merge-app-config.d.ts +1 -1
  70. package/dist/types/lib/app/merge-app-manifest.d.ts +1 -1
  71. package/dist/types/lib/index.d.ts +3 -2
  72. package/dist/types/lib/legacy.d.ts +1 -1
  73. package/dist/types/lib/load-dev-server-config.d.ts +2 -2
  74. package/dist/types/lib/merge-dev-server-config.d.ts +1 -1
  75. package/dist/types/lib/portal/create-portal-manifest.d.ts +1 -1
  76. package/dist/types/lib/portal/load-portal-manifest.d.ts +2 -2
  77. package/dist/types/lib/portal/load-portal-schema.d.ts +1 -1
  78. package/dist/types/lib/portal/portal-config.d.ts +2 -2
  79. package/dist/types/lib/portal/portal-manifest.schema.d.ts +6 -6
  80. package/dist/types/lib/types.d.ts +29 -0
  81. package/dist/types/lib/utils/index.d.ts +1 -0
  82. package/dist/types/lib/utils/resolve-annotations.d.ts +35 -1
  83. package/dist/types/lib/utils/resolve-devops-annotations.d.ts +28 -3
  84. package/dist/types/lib/utils/resolve-git-commit-sha.d.ts +1 -0
  85. package/dist/types/lib/utils/resolve-github-annotations.d.ts +85 -13
  86. package/dist/types/lib/utils/types.d.ts +57 -1
  87. package/dist/types/version.d.ts +1 -1
  88. package/docs/application.md +63 -8
  89. package/docs/auth.md +17 -1
  90. package/docs/migration-v10-to-v11.md +32 -20
  91. package/package.json +69 -33
  92. package/bin/build/bin.js +0 -28
  93. package/bin/build/cli.js +0 -10099
  94. package/bin/build/create-auth-client-B_j4Y_Dr.js +0 -1415
  95. package/bin/build/portal-config-publish-ezU_DFki.js +0 -29578
  96. package/dist/esm/bin/app-build.js +0 -34
  97. package/dist/esm/bin/app-build.js.map +0 -1
  98. package/dist/esm/bin/app-check.js +0 -63
  99. package/dist/esm/bin/app-check.js.map +0 -1
  100. package/dist/esm/bin/app-config-publish.js +0 -89
  101. package/dist/esm/bin/app-config-publish.js.map +0 -1
  102. package/dist/esm/bin/app-config.js +0 -48
  103. package/dist/esm/bin/app-config.js.map +0 -1
  104. package/dist/esm/bin/app-dev.js +0 -102
  105. package/dist/esm/bin/app-dev.js.map +0 -1
  106. package/dist/esm/bin/app-manifest.js +0 -38
  107. package/dist/esm/bin/app-manifest.js.map +0 -1
  108. package/dist/esm/bin/app-pack.js +0 -51
  109. package/dist/esm/bin/app-pack.js.map +0 -1
  110. package/dist/esm/bin/app-tag.js +0 -89
  111. package/dist/esm/bin/app-tag.js.map +0 -1
  112. package/dist/esm/bin/app-upload.js +0 -109
  113. package/dist/esm/bin/app-upload.js.map +0 -1
  114. package/dist/esm/bin/helpers/load-bundle-metadata.js +0 -32
  115. package/dist/esm/bin/helpers/load-bundle-metadata.js.map +0 -1
  116. package/dist/esm/bin/helpers/load-vite-config.js +0 -55
  117. package/dist/esm/bin/helpers/load-vite-config.js.map +0 -1
  118. package/dist/esm/bin/helpers/resolve-app-config.js +0 -46
  119. package/dist/esm/bin/helpers/resolve-app-config.js.map +0 -1
  120. package/dist/esm/bin/helpers/resolve-app-manifest.js +0 -55
  121. package/dist/esm/bin/helpers/resolve-app-manifest.js.map +0 -1
  122. package/dist/esm/bin/helpers/resolve-portal-config.js +0 -46
  123. package/dist/esm/bin/helpers/resolve-portal-config.js.map +0 -1
  124. package/dist/esm/bin/helpers/resolve-portal-manifest.js +0 -55
  125. package/dist/esm/bin/helpers/resolve-portal-manifest.js.map +0 -1
  126. package/dist/esm/bin/helpers/resolve-project-package.js +0 -32
  127. package/dist/esm/bin/helpers/resolve-project-package.js.map +0 -1
  128. package/dist/esm/bin/index.js +0 -12
  129. package/dist/esm/bin/index.js.map +0 -1
  130. package/dist/esm/bin/pack.js +0 -70
  131. package/dist/esm/bin/pack.js.map +0 -1
  132. package/dist/esm/bin/portal-build.js +0 -40
  133. package/dist/esm/bin/portal-build.js.map +0 -1
  134. package/dist/esm/bin/portal-config-publish.js +0 -74
  135. package/dist/esm/bin/portal-config-publish.js.map +0 -1
  136. package/dist/esm/bin/portal-config.js +0 -48
  137. package/dist/esm/bin/portal-config.js.map +0 -1
  138. package/dist/esm/bin/portal-dev.js +0 -61
  139. package/dist/esm/bin/portal-dev.js.map +0 -1
  140. package/dist/esm/bin/portal-manifest.js +0 -38
  141. package/dist/esm/bin/portal-manifest.js.map +0 -1
  142. package/dist/esm/bin/portal-pack.js +0 -60
  143. package/dist/esm/bin/portal-pack.js.map +0 -1
  144. package/dist/esm/bin/portal-tag.js +0 -96
  145. package/dist/esm/bin/portal-tag.js.map +0 -1
  146. package/dist/esm/bin/portal-upload.js +0 -99
  147. package/dist/esm/bin/portal-upload.js.map +0 -1
  148. package/dist/esm/bin/utils/ConsoleLogger.js +0 -112
  149. package/dist/esm/bin/utils/ConsoleLogger.js.map +0 -1
  150. package/dist/esm/bin/utils/create-dev-server.js +0 -167
  151. package/dist/esm/bin/utils/create-dev-server.js.map +0 -1
  152. package/dist/esm/bin/utils/format.js +0 -47
  153. package/dist/esm/bin/utils/format.js.map +0 -1
  154. package/dist/esm/bin/utils/index.js +0 -5
  155. package/dist/esm/bin/utils/index.js.map +0 -1
  156. package/dist/esm/bin/utils/spinner.js +0 -142
  157. package/dist/esm/bin/utils/spinner.js.map +0 -1
  158. package/dist/esm/cli/commands/app/alias.js +0 -42
  159. package/dist/esm/cli/commands/app/alias.js.map +0 -1
  160. package/dist/esm/cli/commands/app/build.js +0 -53
  161. package/dist/esm/cli/commands/app/build.js.map +0 -1
  162. package/dist/esm/cli/commands/app/check.js +0 -57
  163. package/dist/esm/cli/commands/app/check.js.map +0 -1
  164. package/dist/esm/cli/commands/app/config.js +0 -103
  165. package/dist/esm/cli/commands/app/config.js.map +0 -1
  166. package/dist/esm/cli/commands/app/dev.js +0 -67
  167. package/dist/esm/cli/commands/app/dev.js.map +0 -1
  168. package/dist/esm/cli/commands/app/index.js +0 -42
  169. package/dist/esm/cli/commands/app/index.js.map +0 -1
  170. package/dist/esm/cli/commands/app/manifest.js +0 -82
  171. package/dist/esm/cli/commands/app/manifest.js.map +0 -1
  172. package/dist/esm/cli/commands/app/pack.js +0 -71
  173. package/dist/esm/cli/commands/app/pack.js.map +0 -1
  174. package/dist/esm/cli/commands/app/publish.js +0 -130
  175. package/dist/esm/cli/commands/app/publish.js.map +0 -1
  176. package/dist/esm/cli/commands/app/tag.js +0 -113
  177. package/dist/esm/cli/commands/app/tag.js.map +0 -1
  178. package/dist/esm/cli/commands/app/upload.js +0 -85
  179. package/dist/esm/cli/commands/app/upload.js.map +0 -1
  180. package/dist/esm/cli/commands/auth/index.js +0 -22
  181. package/dist/esm/cli/commands/auth/index.js.map +0 -1
  182. package/dist/esm/cli/commands/auth/login.js +0 -72
  183. package/dist/esm/cli/commands/auth/login.js.map +0 -1
  184. package/dist/esm/cli/commands/auth/logout.js +0 -58
  185. package/dist/esm/cli/commands/auth/logout.js.map +0 -1
  186. package/dist/esm/cli/commands/auth/token.js +0 -78
  187. package/dist/esm/cli/commands/auth/token.js.map +0 -1
  188. package/dist/esm/cli/commands/disco/index.js +0 -6
  189. package/dist/esm/cli/commands/disco/index.js.map +0 -1
  190. package/dist/esm/cli/commands/disco/resolve.js +0 -58
  191. package/dist/esm/cli/commands/disco/resolve.js.map +0 -1
  192. package/dist/esm/cli/commands/index.js +0 -11
  193. package/dist/esm/cli/commands/index.js.map +0 -1
  194. package/dist/esm/cli/commands/portal/build.js +0 -27
  195. package/dist/esm/cli/commands/portal/build.js.map +0 -1
  196. package/dist/esm/cli/commands/portal/config.js +0 -101
  197. package/dist/esm/cli/commands/portal/config.js.map +0 -1
  198. package/dist/esm/cli/commands/portal/dev.js +0 -27
  199. package/dist/esm/cli/commands/portal/dev.js.map +0 -1
  200. package/dist/esm/cli/commands/portal/index.js +0 -23
  201. package/dist/esm/cli/commands/portal/index.js.map +0 -1
  202. package/dist/esm/cli/commands/portal/manifest.js +0 -48
  203. package/dist/esm/cli/commands/portal/manifest.js.map +0 -1
  204. package/dist/esm/cli/commands/portal/pack.js +0 -40
  205. package/dist/esm/cli/commands/portal/pack.js.map +0 -1
  206. package/dist/esm/cli/commands/portal/publish.js +0 -76
  207. package/dist/esm/cli/commands/portal/publish.js.map +0 -1
  208. package/dist/esm/cli/commands/portal/schema.js +0 -70
  209. package/dist/esm/cli/commands/portal/schema.js.map +0 -1
  210. package/dist/esm/cli/commands/portal/tag.js +0 -73
  211. package/dist/esm/cli/commands/portal/tag.js.map +0 -1
  212. package/dist/esm/cli/commands/portal/upload.js +0 -41
  213. package/dist/esm/cli/commands/portal/upload.js.map +0 -1
  214. package/dist/esm/cli/main.js +0 -52
  215. package/dist/esm/cli/main.js.map +0 -1
  216. package/dist/esm/cli/options/auth.js +0 -96
  217. package/dist/esm/cli/options/auth.js.map +0 -1
  218. package/dist/esm/cli/options/env.js +0 -30
  219. package/dist/esm/cli/options/env.js.map +0 -1
  220. package/dist/esm/lib/framework.node.js +0 -104
  221. package/dist/esm/lib/framework.node.js.map +0 -1
  222. package/dist/esm/version.js.map +0 -1
  223. package/dist/tsconfig.tsbuildinfo +0 -1
  224. /package/dist/types/{lib → bin}/framework.node.d.ts +0 -0
@@ -1,13 +1,44 @@
1
1
  /**
2
- * Interface for the expected structure of the GitHub Actions event payload.
2
+ * Represents the payload structure for various GitHub webhook events.
3
+ *
4
+ * This type covers common fields found in GitHub event payloads, such as push, pull request,
5
+ * workflow, and release events. All properties are optional to accommodate the differences
6
+ * between event types.
7
+ *
8
+ * @remarks only some are mapped to the GitHub API event types.
9
+ *
10
+ * @property after - The SHA of the most recent commit on the ref after the event.
11
+ * @property head_commit - Information about the head commit, including its SHA.
12
+ * @property ref - The Git ref (branch or tag) that triggered the event.
13
+ * @property workflow - The name of the workflow (for workflow-related events).
14
+ * @property action - The action performed (e.g., "opened", "closed", "created").
15
+ * @property repository - Information about the repository where the event occurred.
16
+ * @property pull_request - Details about the pull request (for pull request events).
17
+ * @property release - Details about the release (for release events).
18
+ * @property sender - Information about the user who triggered the event.
3
19
  */
4
- export interface GithubEventPayload {
20
+ type GithubEventPayload = {
21
+ after?: string;
22
+ head_commit?: {
23
+ id?: string;
24
+ };
25
+ ref?: string;
26
+ workflow?: string;
27
+ action?: string;
28
+ repository?: {
29
+ owner?: {
30
+ login?: string;
31
+ avatar_url?: string;
32
+ };
33
+ name?: string;
34
+ license?: {
35
+ name?: string;
36
+ };
37
+ homepage?: string;
38
+ };
5
39
  pull_request?: {
6
40
  number?: number;
7
41
  title?: string;
8
- user?: {
9
- login?: string;
10
- };
11
42
  head?: {
12
43
  sha?: string;
13
44
  ref?: string;
@@ -16,11 +47,6 @@ export interface GithubEventPayload {
16
47
  updated_at?: string;
17
48
  html_url?: string;
18
49
  };
19
- after?: string;
20
- head_commit?: {
21
- id?: string;
22
- };
23
- ref?: string;
24
50
  release?: {
25
51
  tag_name?: string;
26
52
  name?: string;
@@ -31,9 +57,54 @@ export interface GithubEventPayload {
31
57
  published_at?: string;
32
58
  html_url?: string;
33
59
  };
60
+ sender?: {
61
+ login?: string;
62
+ avatar_url?: string;
63
+ };
64
+ };
65
+ /**
66
+ * Represents metadata and contextual information related to GitHub Actions workflows,
67
+ * pull requests, commits, releases, and associated actors.
68
+ *
69
+ * @property pull_request - Information about the pull request associated with the workflow run.
70
+ * @property pull_request.number - The pull request number.
71
+ * @property pull_request.title - The title of the pull request.
72
+ * @property pull_request.user - The user who created the pull request.
73
+ * @property pull_request.user.login - The login name of the pull request creator.
74
+ * @property pull_request.head - The head commit information of the pull request.
75
+ * @property pull_request.head.sha - The SHA of the head commit.
76
+ * @property pull_request.head.ref - The reference name of the head commit.
77
+ * @property pull_request.created_at - The creation timestamp of the pull request.
78
+ * @property pull_request.updated_at - The last update timestamp of the pull request.
79
+ * @property pull_request.html_url - The URL to view the pull request on GitHub.
80
+ * @property actor - The GitHub username of the actor who triggered the workflow.
81
+ * @property runId - The unique identifier of the workflow run.
82
+ * @property runUrl - The URL to view the workflow run on GitHub.
83
+ * @property repository - The full name of the repository (e.g., "owner/repo").
84
+ * @property after - The SHA of the commit after the workflow run.
85
+ * @property head_commit - Information about the head commit.
86
+ * @property head_commit.id - The SHA of the head commit.
87
+ * @property ref - The Git reference (e.g., "refs/heads/main").
88
+ * @property release - Information about the release associated with the workflow run.
89
+ * @property release.tag_name - The tag name of the release.
90
+ * @property release.name - The name of the release.
91
+ * @property release.body - The body or description of the release.
92
+ * @property release.draft - Indicates if the release is a draft.
93
+ * @property release.prerelease - Indicates if the release is a prerelease.
94
+ * @property release.created_at - The creation timestamp of the release.
95
+ * @property release.published_at - The publication timestamp of the release.
96
+ * @property release.html_url - The URL to view the release on GitHub.
97
+ * @property workflow - The name of the workflow.
98
+ * @property action - The name of the action being executed.
99
+ */
100
+ export type GithubAnnotations = GithubEventPayload & {
34
101
  workflow?: string;
35
102
  action?: string;
36
- }
103
+ eventName: string;
104
+ actor?: string;
105
+ runId?: string;
106
+ runUrl?: string;
107
+ };
37
108
  /**
38
109
  * Resolves GitHub Actions-specific annotation variables from environment variables.
39
110
  *
@@ -50,6 +121,7 @@ export interface GithubEventPayload {
50
121
  * - GITHUB_REPOSITORY: Repository in the format owner/repo
51
122
  * - GITHUB_SERVER_URL: Base URL of the GitHub server (defaults to https://github.com)
52
123
  * - GITHUB_EVENT_PATH: Path to the event payload file (JSON)
124
+ * - GITHUB_WORKFLOW: Name of the workflow
53
125
  *
54
126
  * Notes for maintainers:
55
127
  * - The event payload can be large; consider truncating or parsing if only specific fields are needed.
@@ -61,5 +133,5 @@ export interface GithubEventPayload {
61
133
  * - To add more annotations, extract additional environment variables as needed and include them in the returned object.
62
134
  * - For custom workflows or self-hosted runners, verify that all required environment variables are available.
63
135
  */
64
- export declare const resolveAnnotations: () => Record<string, string>;
65
- export default resolveAnnotations;
136
+ export declare const resolveGithubAnnotations: () => GithubAnnotations;
137
+ export default resolveGithubAnnotations;
@@ -1,6 +1,62 @@
1
+ /**
2
+ * Recursively makes all properties of a type optional, including nested objects and arrays.
3
+ *
4
+ * - For object types, all properties become optional and the transformation is applied deeply.
5
+ * - For array properties, the transformation is applied to the array's element type.
6
+ * - For primitive types and functions, the type is preserved as-is.
7
+ *
8
+ * This utility is useful for scenarios such as:
9
+ * - Creating deeply partial configuration objects (e.g., for overrides or patch updates)
10
+ * - Accepting partial user input for complex data structures
11
+ * - Safely merging deeply nested objects
12
+ *
13
+ * @template T - The type to make recursively partial.
14
+ *
15
+ * @example
16
+ * // Simple object
17
+ * type Foo = { a: number; b: { c: string } };
18
+ * // RecursivePartial<Foo> is: { a?: number; b?: { c?: string } }
19
+ *
20
+ * // Object with array
21
+ * type Bar = { items: { id: string; value: number }[] };
22
+ * // RecursivePartial<Bar> is: { items?: Array<{ id?: string; value?: number }> }
23
+ *
24
+ * // Nested and mixed types
25
+ * type Baz = { x: number; y: { z: { w: string[] } } };
26
+ * // RecursivePartial<Baz> is: { x?: number; y?: { z?: { w?: string[] } } }
27
+ *
28
+ * // With primitives and functions
29
+ * type Qux = { cb: () => void; flag: boolean; nested: { n: number } };
30
+ * // RecursivePartial<Qux> is: { cb?: () => void; flag?: boolean; nested?: { n?: number } }
31
+ *
32
+ * @remarks
33
+ * - RecursivePartial preserves the original type for primitives, functions, and Date objects.
34
+ * - For union types, each member is transformed recursively.
35
+ * - TypeScript's built-in Partial<T> only makes top-level properties optional; RecursivePartial applies this deeply.
36
+ *
37
+ * @see Partial
38
+ * @see Value
39
+ */
1
40
  export type RecursivePartial<T> = {
2
41
  [P in keyof T]?: T[P] extends Array<infer U> ? Array<Value<U>> : Value<T[P]>;
3
42
  };
4
- type AllowedPrimitives = Function | boolean | string | number | Date;
43
+ type AnyFunction = (...args: any[]) => unknown;
44
+ /**
45
+ * Represents the set of primitive types and commonly used types allowed in the framework.
46
+ * Includes function types, booleans, strings, numbers, and Date objects.
47
+ *
48
+ * @remarks
49
+ * - `AnyFunction` should be defined elsewhere as a type representing any function signature.
50
+ * - Useful for constraining generic types or utility functions to a specific set of primitives.
51
+ */
52
+ type AllowedPrimitives = AnyFunction | boolean | string | number | Date;
53
+ /**
54
+ * Resolves to the type `T` if it extends `AllowedPrimitives`, otherwise recursively makes all properties of `T` optional.
55
+ *
56
+ * @typeParam T - The type to be evaluated.
57
+ * @remarks
58
+ * This utility type is useful for creating deeply partial versions of complex types,
59
+ * while preserving primitive types as-is.
60
+ */
5
61
  type Value<T> = T extends AllowedPrimitives ? T : RecursivePartial<T>;
6
62
  export {};
@@ -1 +1 @@
1
- export declare const version = "11.0.0-next.8";
1
+ export declare const version = "11.0.0";
@@ -98,6 +98,18 @@ pnpm init
98
98
  }
99
99
  ```
100
100
 
101
+ > **Build Output Configuration:**
102
+ > The CLI uses the `main` field (or `module` field) in your `package.json` to determine where to output the built application bundle. If neither field is specified, it defaults to `./dist/bundle.js`.
103
+ >
104
+ > **Why this approach?** Using the `main`/`module` fields ensures your package works correctly when served directly or when developing portals with internal references. This follows Node.js package conventions and enables proper module resolution.
105
+ >
106
+ > **Important:** The output directory cannot be the project root, the `src` directory, or the current working directory. Always specify a dedicated build directory like `dist/`, `build/`, or similar.
107
+ >
108
+ > **Examples:**
109
+ > - `"main": "dist/index.js"` → outputs to `dist/index.js`
110
+ > - `"module": "build/app.esm.js"` → outputs to `build/app.esm.js`
111
+ > - No `main`/`module` specified → defaults to `dist/bundle.js`
112
+
101
113
  #### Example `app.manifest.ts`
102
114
 
103
115
  ```ts
@@ -105,8 +117,8 @@ import { defineAppManifest } from '@equinor/fusion-framework-cli/app';
105
117
 
106
118
  export default defineAppManifest(async (env, { base }) => ({
107
119
  ...base,
108
- name: 'My Fusion App',
109
- version: '0.0.1',
120
+ appKey: 'my-app',
121
+ displayName: 'My First Awesome Fusion App'
110
122
  // Add more manifest fields as needed
111
123
  }));
112
124
  ```
@@ -136,6 +148,15 @@ pnpm fusion-framework-cli dev
136
148
 
137
149
  ### 5. Log in to Fusion Framework (if needed)
138
150
 
151
+ > [!NOTE]
152
+ > __All HTTP requests to Fusion services require an authorized user.__
153
+ > For example, before running `fusion-framework-cli app publish`, make sure you are authenticated using `fusion-framework-cli auth login`.
154
+
155
+ > [!WARNING]
156
+ > The `fusion-framework-cli auth login` command is only available in interactive environments (such as your local terminal). For CI/CD pipelines or automated deployments, you must provide a valid authentication token using the `FUSION_TOKEN` environment variable.
157
+ >
158
+ > See [Authentication](./auth.md#setting-the-fusion-token-in-github) for details on setting up tokens for CI/CD.
159
+
139
160
  ```sh
140
161
  pnpm fusion-framework-cli auth login
141
162
  ```
@@ -144,7 +165,7 @@ pnpm fusion-framework-cli auth login
144
165
 
145
166
  ```sh
146
167
  pnpm fusion-framework-cli publish --env <environment>
147
- pnpm fusion-framework-cli app config --upload --env <environment>
168
+ pnpm fusion-framework-cli app config --publish --env <environment>
148
169
  ```
149
170
 
150
171
  > **Tip:** For CI/CD and automation, set the `FUSION_TOKEN` environment variable. See [Authentication](./docs/auth.md) for details.
@@ -292,7 +313,7 @@ jobs:
292
313
  - name: Publish application
293
314
  run: pnpm exec fusion-framework-cli app upload --env ${{ matrix.env }} app-bundle.zip
294
315
  - step: Upload configuration
295
- run: pnpm exec fusion-framework-cli app config --upload --env ${{ matrix.env }}
316
+ run: pnpm exec fusion-framework-cli app config --publish --env ${{ matrix.env }}
296
317
  ```
297
318
 
298
319
  > [!TIP]
@@ -305,7 +326,7 @@ You can use environment variables in your app configuration to inject secrets or
305
326
 
306
327
  ```yml
307
328
  step: Upload configuration
308
- run: pnpm exec fusion-framework-cli app config --upload --env ${{ matrix.env }}
329
+ run: pnpm exec fusion-framework-cli app config --publish --env ${{ matrix.env }}
309
330
  with:
310
331
  CONFIG_VALUE_FOO: ${{ VAR.ENVIRONMENT_CONFIG_VALUE }}
311
332
  CONFIG_VALUE_BAR: ${{ SECRETS.ENVIRONMENT_CONFIG_SECRET_VALUE }}
@@ -342,6 +363,7 @@ The Fusion Framework CLI provides a suite of commands to support the full applic
342
363
  - [Pack](#pack) — Bundle your app into a distributable archive.
343
364
  - [Upload](#upload) — Upload your app bundle to the Fusion app store.
344
365
  - [Tag](#tag) — Tag a published app version for release management.
366
+ - [Manifest](#manifest) — Generate your app manifest file.
345
367
  - [Check](#check) — Verify your app's registration status.
346
368
  - [Aliases](#aliases) — Deprecated commands and their replacements.
347
369
 
@@ -383,7 +405,7 @@ Publish your application to the Fusion app store (registry) for deployment. This
383
405
  | ------------------ | --------------------------------------------------------------------------------------------------- | ----------------- |
384
406
  | `[bundle]` | Path to the app bundle to upload. If omitted, the CLI will build and bundle your app automatically. | |
385
407
  | `-e`, `--env` | Target environment for deployment (e.g., `ci`, `fqa`, `fprd`). | |
386
- | `-m`, `--manifest` | Manifest file to use for bundling (e.g., `app.manifest.ts`). | `app.manifest.ts` |
408
+ | `-m`, `--manifest` | Manifest file to use for bundling (e.g., `app.manifest.ts`) (optional). | `app.manifest.ts` |
387
409
  | `-t`, `--tag` | Tag to apply to the published app (`latest` \| `preview`). | `latest` |
388
410
  | `-d`, `--debug` | Enable debug mode for verbose logging. | `false` |
389
411
  | `--token` | Authentication token for Fusion. | |
@@ -474,6 +496,14 @@ pnpm fusion-framework-cli build
474
496
  pnpm fusion-framework-cli build app.manifest.dev.ts --debug
475
497
  ```
476
498
 
499
+ > [!NOTE]
500
+ > The build output location is determined by the `main` field (or `module` field) in your `package.json`. If neither field is specified, the CLI defaults to `./dist/bundle.js`. This approach ensures your package works correctly when served directly or when developing portals with internal references, following Node.js package conventions for proper module resolution. The output directory cannot be the project root, the `src` directory, or the current working directory.
501
+ >
502
+ > **Examples:**
503
+ > - `"main": "dist/index.js"` → builds to `dist/index.js`
504
+ > - `"module": "build/app.esm.js"` → builds to `build/app.esm.js`
505
+ > - No `main`/`module` specified → defaults to `dist/bundle.js`
506
+
477
507
  ### Pack
478
508
 
479
509
  Build a distributable app bundle archive for deployment.
@@ -562,17 +592,42 @@ pnpm fusion-framework-cli app tag <tag> [options]
562
592
  ```sh
563
593
  pnpm fusion-framework-cli app tag latest
564
594
  pnpm fusion-framework-cli app tag preview --env prod --manifest app.manifest.prod.ts
565
- pnpm fusion-framework-cli app tag stable --appKey my-app --version 1.2.3
595
+ pnpm fusion-framework-cli app tag latest --appKey my-app --version 1.2.3
566
596
  ```
567
597
 
568
598
  > [!TIP] You can roll back a release by tagging a previous build as `latest`. Simply run the tag command with the desired version to make it the active release for deployment.
569
599
 
570
600
  > [!NOTE]
571
601
  > - The `tag` command requires a published application version. You can specify the app key and version directly, or let the CLI resolve them from your manifest file.
572
- > - Supported tags are: `latest`, `preview`, and `stable`.
602
+ > - Supported tags are: `latest` and `preview`.
573
603
  > - Authentication options (`--token`, `--tenantId`, `--clientId`) can be set via CLI flags or environment variables.
574
604
  > - If tagging fails, an error will be logged and the process will exit with a non-zero code.
575
605
 
606
+ ### Manifest
607
+
608
+ Generate and output your application manifest for Fusion apps.
609
+
610
+ | Option/Argument | Description | Default / Example |
611
+ | --------------------- | -------------------------------------------------------------------------- | ----------------- |
612
+ | `[manifest]` | Manifest build file to use (e.g., `app.manifest[.env]?.[ts,js,json]`). | `app.manifest.ts` |
613
+ | `-d, --debug` | Enable debug mode for verbose logging. | `false` |
614
+ | `-o, --output <path>` | Write manifest to the specified file (default: stdout). | `stdout` |
615
+ | `-s, --silent` | Silent mode, suppresses output except errors. | `false` |
616
+
617
+ **Usage:**
618
+ ```sh
619
+ pnpm fusion-framework-cli app manifest [manifest] [options]
620
+ ```
621
+
622
+ **Examples:**
623
+ ```sh
624
+ pnpm fusion-framework-cli app manifest
625
+ pnpm fusion-framework-cli app manifest app.manifest.prod.ts --output ./dist/app.manifest.json
626
+ pnpm fusion-framework-cli app manifest --debug
627
+ ```
628
+
629
+ > **Tip:** By default, the manifest is printed to stdout. Use `--output` to write it to a file for use in CI/CD pipelines or for inspection.
630
+
576
631
  ### Check
577
632
 
578
633
  Check if a Fusion application is registered in the Fusion app store (registry).
package/docs/auth.md CHANGED
@@ -75,7 +75,7 @@ When configuring authentication for the Fusion Framework CLI, you will encounter
75
75
 
76
76
  ## Local Development
77
77
 
78
- ### Logging in with the CLI
78
+ ### Login in with the CLI
79
79
 
80
80
  For local development, you should authenticate interactively using the CLI's built-in login command. This uses the `interactive` authentication mode, which will prompt you to sign in via your browser and securely store your credentials for future CLI commands.
81
81
 
@@ -113,6 +113,22 @@ The CLI provides several authentication-related options for advanced scenarios o
113
113
 
114
114
  These options allow you to use the CLI with custom tenants, client apps, or tokens if needed, but for most development scenarios, the built-in defaults are sufficient and only the `--scope` option is commonly changed. This flexibility supports both simple and advanced authentication needs, making it easy to get started while enabling custom setups for more complex environments.
115
115
 
116
+ ### Acquiring token
117
+
118
+ The `auth token` command is designed to show your access token for the current user.
119
+
120
+ ```sh
121
+ fusion-framework-cli auth token
122
+ ```
123
+
124
+ > [!TIP]
125
+ > The `--silent` flag outputs only the token (no extra logging), which is useful for exporting the token as an environment variable or saving it to a file for local testing or scripting:
126
+ > ```sh
127
+ > export FUSION_TOKEN=$(fusion-framework-cli auth token --silent)
128
+ > ```
129
+
130
+ > [!Note] This command requires an interactive user context and MSAL Node. It is not suitable for CI/CD environments, as there is no user available in those scenarios. Use it for local development, testing, or whenever you need to preserve a Fusion token for your own scripts or tools.
131
+
116
132
  ## CI/CD
117
133
 
118
134
  ### Setting the Fusion Token in GitHub
@@ -1,5 +1,5 @@
1
1
  ---
2
- title: Migration Guide: v10 to v11 CLI Command Changes
2
+ title: Migration Guide - v10 to v11 CLI Command Changes
3
3
  description: >
4
4
  Comprehensive guide to migrating CLI commands from v10 to v11 of the Fusion Framework, including deprecated commands, new command names, authentication changes, and best practices for updating scripts and pipelines.
5
5
  category: cli
@@ -33,11 +33,11 @@ With v11, we switched to using the Fusion Framework itself for CLI operations. T
33
33
  - **Reduced duplication:** By reusing core modules, bug fixes and new features are shared between CLI and Framework code.
34
34
  - **Performance:** The framework is now initialized only when needed (e.g., for HTTP calls or authentication), improving startup time and resource usage.
35
35
 
36
- ## Deprecated App Command Aliases
36
+ ## Command Changes
37
37
 
38
- This guide covers command changes for the `fusion-framework-cli app` scope.
38
+ ### Deprecated App Command Aliases
39
39
 
40
- The following table lists the old commands and their new equivalents:
40
+ The following `fusion-framework-cli app` commands have been renamed:
41
41
 
42
42
  | Old Command | New Command |
43
43
  | -------------- | ----------- |
@@ -46,29 +46,41 @@ The following table lists the old commands and their new equivalents:
46
46
  | build-manifest | manifest |
47
47
  | build-publish | publish |
48
48
 
49
- When using a deprecated command, the CLI will display a warning message and guide you to use the new command. Deprecated options such as `--service` are no longer supported; use `--env` instead.
50
-
51
49
  > [!WARNING]
52
- > The deprecated commands will continue to work for now, but they are scheduled for removal in the next major release. Please migrate to the new commands as soon as possible.
50
+ > **Deprecated commands will be removed in the next major release.** While they continue to work with warning messages, please migrate to the new commands immediately.
53
51
 
54
- ### Additional Notes
55
- - The deprecated `--service` option is no longer supported. Use `--env` for environment selection.
56
- - Only the new command names will be supported in future versions. Update your CI/CD pipelines and documentation as soon as possible.
57
- - The deprecated commands are maintained for backward compatibility during the transition to v11, but will be removed in the next major release. Please migrate to the new commands as soon as possible.
52
+ ### Option Changes
53
+ - **Removed:** `--service` option
54
+ - **Use instead:** `--env` for environment selection
58
55
 
59
56
  ## Authentication Changes
60
- - The `FUSION_TOKEN` environment variable should only be used for CI/CD and automated deployments.
61
- - For local development, users should authenticate interactively by running:
57
+
58
+ Authentication behavior has been updated to improve security and consistency:
59
+
60
+ - **For CI/CD and automation:** Continue using the `FUSION_TOKEN` environment variable
61
+ - **For local development:** Use interactive authentication:
62
62
  ```sh
63
63
  fusion-framework-cli auth login
64
64
  ```
65
- before executing any commands.
66
65
 
67
- ## What to Check When Migrating
68
- - Update all scripts, documentation, and CI/CD pipelines to use the new command names.
69
- - Remove any usage of the deprecated `--service` option and replace it with `--env`.
70
- - Ensure your local development workflow uses `fusion-framework-cli auth login` for authentication.
71
- - Review any custom integrations that may rely on CLI startup behavior, as initialization is now on-demand.
66
+ ## Migration Checklist
67
+
68
+ When upgrading from v10 to v11, ensure you:
69
+
70
+ - [ ] **Update command names** in all scripts and CI/CD pipelines:
71
+ - `build-pack` → `pack`
72
+ - `build-upload` → `upload`
73
+ - `build-manifest` → `manifest`
74
+ - `build-publish` → `publish`
75
+ - [ ] **Replace `--service` with `--env`** for environment selection
76
+ - [ ] **Update local development workflow** to use `fusion-framework-cli auth login`
77
+ - [ ] **Review custom integrations** that may depend on CLI startup behavior (now on-demand)
78
+ - [ ] **Update documentation** and team guidelines with new command syntax
79
+
80
+ ## Getting Help
72
81
 
73
- For more details, see the CLI release notes or run `pnpm fusion-framework-cli app --help`.
82
+ For additional information:
83
+ - Run `pnpm fusion-framework-cli app --help` to see current command options
84
+ - Check the CLI release notes for detailed changes
85
+ - Review related documentation: [Authentication](./auth.md) and [Application Commands](./application.md)
74
86
 
package/package.json CHANGED
@@ -1,7 +1,6 @@
1
1
  {
2
2
  "name": "@equinor/fusion-framework-cli",
3
- "version": "11.0.0-next.8",
4
- "homepage": "https://github.com/equinor/fusion-framework",
3
+ "version": "11.0.0",
5
4
  "keywords": [
6
5
  "Fusion",
7
6
  "Fusion Framework",
@@ -12,12 +11,17 @@
12
11
  "publishConfig": {
13
12
  "access": "public"
14
13
  },
14
+ "engines": {
15
+ "node": ">=20.0.0"
16
+ },
15
17
  "files": [
16
- "bin",
17
- "dist",
18
- "docs",
19
- "CHANGELOG.md",
20
- "README.md"
18
+ "./bin",
19
+ "./dist/esm/lib",
20
+ "./dist/esm/version.js",
21
+ "./dist/types",
22
+ "./docs",
23
+ "./CHANGELOG.md",
24
+ "./README.md"
21
25
  ],
22
26
  "type": "module",
23
27
  "bin": {
@@ -45,7 +49,43 @@
45
49
  },
46
50
  "./bin": {
47
51
  "types": "./dist/types/bin/index.d.ts",
48
- "import": "./bin/build/bin.js"
52
+ "import": "./bin/build/bin.mjs"
53
+ },
54
+ "./lib": {
55
+ "types": "./dist/types/lib/index.d.ts",
56
+ "import": "./dist/esm/lib/index.js"
57
+ },
58
+ "./utils": {
59
+ "types": "./dist/types/lib/utils/index.d.ts",
60
+ "import": "./dist/esm/lib/utils/index.js"
61
+ },
62
+ "./package.json": "./package.json",
63
+ "./README.md": "./README.md",
64
+ "./CHANGELOG.md": "./CHANGELOG.md"
65
+ },
66
+ "typesVersions": {
67
+ "*": {
68
+ ".": [
69
+ "dist/types/lib/index.d.ts"
70
+ ],
71
+ "app": [
72
+ "dist/types/lib/app/index.d.ts"
73
+ ],
74
+ "portal": [
75
+ "dist/types/lib/portal/index.d.ts"
76
+ ],
77
+ "dev-server": [
78
+ "dist/types/lib/dev-server.d.ts"
79
+ ],
80
+ "bin": [
81
+ "dist/types/bin/index.d.ts"
82
+ ],
83
+ "lib": [
84
+ "dist/types/lib/index.d.ts"
85
+ ],
86
+ "utils": [
87
+ "dist/types/lib/utils/index.d.ts"
88
+ ]
49
89
  }
50
90
  },
51
91
  "repository": {
@@ -54,46 +94,42 @@
54
94
  "directory": "packages/cli"
55
95
  },
56
96
  "dependencies": {
57
- "adm-zip": "^0.5.10",
58
97
  "commander": "^13.0.0",
59
- "keytar": "7.9.0",
98
+ "deepmerge": "^4.3.1",
60
99
  "ora": "^8.0.1",
61
- "vite": "^6.3.5",
62
- "chalk": "^5.3.0",
63
100
  "read-package-up": "^11.0.0",
64
- "zod": "^3.25.20",
65
- "@equinor/fusion-framework-dev-portal": "^1.0.0-next.2",
66
- "@equinor/fusion-framework-dev-server": "^1.0.0-next.4",
67
- "@equinor/fusion-imports": "^1.1.1-next.0"
101
+ "vite": "^6.3.5",
102
+ "zod": "^3.25.76",
103
+ "@equinor/fusion-framework-dev-portal": "^1.0.0",
104
+ "@equinor/fusion-framework-dev-server": "^1.0.0",
105
+ "@equinor/fusion-framework-module-msal-node": "^1.0.0",
106
+ "@equinor/fusion-imports": "^1.1.1"
68
107
  },
69
108
  "devDependencies": {
70
- "ajv": "^8.17.1",
71
- "pretty-bytes": "^7.0.0",
72
- "is-ci": "^4.1.0",
73
- "open": "^10.1.1",
74
- "lodash.mergewith": "^4.6.2",
75
- "type-fest": "^4.40.0",
76
- "rollup": "^4.39.0",
77
109
  "@rollup/plugin-commonjs": "^28.0.3",
78
110
  "@rollup/plugin-json": "^6.1.0",
79
111
  "@rollup/plugin-node-resolve": "^16.0.1",
112
+ "@rollup/plugin-replace": "^6.0.2",
80
113
  "@types/adm-zip": "^0.5.0",
81
- "@types/lodash.mergewith": "^4.6.9",
82
- "@types/node": "^20.11.14",
114
+ "adm-zip": "^0.5.10",
115
+ "ajv": "^8.17.1",
116
+ "chalk": "^5.3.0",
117
+ "is-ci": "^4.1.0",
118
+ "open": "^10.1.1",
119
+ "pretty-bytes": "^7.0.0",
120
+ "rollup": "^4.46.3",
121
+ "rollup-plugin-terser": "^7.0.2",
83
122
  "rxjs": "^7.8.1",
123
+ "type-fest": "^4.40.0",
84
124
  "typescript": "^5.8.2",
85
- "@equinor/fusion-framework-module-app": "^6.1.13",
86
- "@equinor/fusion-framework-module-http": "^6.3.3-next.2",
87
- "@equinor/fusion-framework-module": "^4.4.3-next.1",
88
- "@equinor/fusion-framework-module-msal-node": "^0.1.1-next.2",
89
- "@equinor/fusion-framework-module-service-discovery": "^8.0.15-next.2"
125
+ "@equinor/fusion-framework-module-app": "^6.1.17",
126
+ "@equinor/fusion-framework-module": "^5.0.0",
127
+ "@equinor/fusion-framework-module-http": "^6.3.4",
128
+ "@equinor/fusion-framework-module-service-discovery": "^8.0.18"
90
129
  },
91
130
  "peerDependenciesMeta": {
92
131
  "typescript": {
93
132
  "optional": true
94
- },
95
- "keytar": {
96
- "optional": true
97
133
  }
98
134
  },
99
135
  "scripts": {
package/bin/build/bin.js DELETED
@@ -1,28 +0,0 @@
1
- export { b as buildApplication, c as buildPortal, a as bundleApp, d as bundlePortal, g as generateApplicationConfig, e as generatePortalConfig, l as loadPortalManifest, h as pack, p as publishAppConfig, f as publishPortalConfig, s as startAppDevServer } from './portal-config-publish-ezU_DFki.js';
2
- import 'vite';
3
- import 'chalk';
4
- import '@equinor/fusion-imports';
5
- import '@equinor/fusion-framework-dev-server';
6
- import 'node:fs';
7
- import 'node:fs/promises';
8
- import 'node:path';
9
- import 'read-package-up';
10
- import 'node:url';
11
- import 'node:assert';
12
- import 'node:child_process';
13
- import 'zod';
14
- import 'adm-zip';
15
- import 'http';
16
- import 'https';
17
- import 'crypto';
18
- import 'buffer';
19
- import 'stream';
20
- import 'util';
21
- import 'fs';
22
- import 'path';
23
- import 'node:http';
24
- import 'node:process';
25
- import 'node:buffer';
26
- import 'node:util';
27
- import 'node:os';
28
- import 'ora';