@equinor/echo-cli 3.0.0 → 3.1.1-beta-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 (38) hide show
  1. package/README.md +413 -393
  2. package/lib/__test__/utils/merg.test.d.ts +1 -0
  3. package/lib/__test__/utils/merg.test.js +29 -0
  4. package/lib/__test__/utils/merg.test.js.map +1 -0
  5. package/lib/echo-dev-host/README.md +121 -121
  6. package/lib/echo-dev-host/babel.config.js +10 -10
  7. package/lib/echo-dev-host/jest.config.js +21 -21
  8. package/lib/echo-dev-host/package-lock.json +14542 -14542
  9. package/lib/echo-dev-host/package.json +5 -5
  10. package/lib/echo-dev-host/public/env-config.js +17 -17
  11. package/lib/echo-dev-host/public/index.html +21 -21
  12. package/lib/echo-dev-host/src/components/Home/Home.tsx +1 -2
  13. package/lib/echo-dev-host/tsconfig.json +21 -21
  14. package/lib/echo-dev-host/webpack.config.js +145 -145
  15. package/lib/tools/releaseWorkflow/align-echo-dev-host-deps.d.ts +22 -0
  16. package/lib/tools/releaseWorkflow/align-echo-dev-host-deps.js +149 -0
  17. package/lib/tools/releaseWorkflow/align-echo-dev-host-deps.js.map +1 -0
  18. package/lib/tools/releaseWorkflow/bump-version.d.ts +27 -0
  19. package/lib/tools/releaseWorkflow/bump-version.js +81 -0
  20. package/lib/tools/releaseWorkflow/bump-version.js.map +1 -0
  21. package/lib/tools/releaseWorkflow/verify-echo-libs-published.d.ts +21 -0
  22. package/lib/tools/releaseWorkflow/verify-echo-libs-published.js +72 -0
  23. package/lib/tools/releaseWorkflow/verify-echo-libs-published.js.map +1 -0
  24. package/package.json +116 -112
  25. package/templates/echoAppTemplate/.gitattributes +3 -3
  26. package/templates/echoAppTemplate/package.json +35 -35
  27. package/templates/echoAppTemplate/readme.md +41 -41
  28. package/templates/echoAppTemplate/tsconfig.json +25 -25
  29. package/templates/echoAppTemplateTutorial/.gitattributes +3 -3
  30. package/templates/echoAppTemplateTutorial/package.json +36 -36
  31. package/templates/echoAppTemplateTutorial/readme.md +41 -41
  32. package/templates/echoAppTemplateTutorial/tsconfig.json +25 -25
  33. package/templates/echoLibraryTemplate/package.json +35 -35
  34. package/templates/echoLibraryTemplate/public/index.html +21 -21
  35. package/templates/echoLibraryTemplate/readme.md +1 -1
  36. package/templates/echoPluginTemplate/package.json +35 -35
  37. package/templates/echoPluginTemplate/public/index.html +21 -21
  38. package/templates/echoPluginTemplate/readme.md +1 -1
@@ -22,12 +22,12 @@
22
22
  "license": "MIT",
23
23
  "dependencies": {
24
24
  "@equinor/echo-base": "3.0.0",
25
- "@equinor/echo-components": "3.0.0",
26
- "@equinor/echo-core": "3.0.0",
27
- "@equinor/echo-framework": "3.0.0",
25
+ "@equinor/echo-components": "3.1.0",
26
+ "@equinor/echo-core": "3.1.0",
27
+ "@equinor/echo-framework": "3.1.0",
28
28
  "@equinor/echo-scripts": "0.1.5",
29
29
  "@equinor/echo-search": "3.0.0",
30
- "@equinor/echo-utils": "3.0.0",
30
+ "@equinor/echo-utils": "3.1.0",
31
31
  "@equinor/eds-core-react": "0.49.0",
32
32
  "@equinor/eds-icons": "0.22.0",
33
33
  "@equinor/eds-tokens": "2.1.0",
@@ -42,7 +42,7 @@
42
42
  "lodash": "4.17.23",
43
43
  "react": "18.3.1",
44
44
  "react-dom": "18.3.1",
45
- "react-router-dom": "6.30.1",
45
+ "react-router-dom": "6.30.3",
46
46
  "react-sortablejs": "6.1.4",
47
47
  "sortablejs": "1.15.6",
48
48
  "styled-components": "6.3.8",
@@ -1,17 +1,17 @@
1
- window._env_ = {
2
- HTTPS: "true",
3
- GENERATE_SOURCEMAP: "true",
4
- INLINE_RUNTIME_CHUNK: "false",
5
- WEBSITE_HOSTNAME: "localhost:3000;",
6
- REACT_APP_DEFAULT_CACHE_LOCATION: "localstorage",
7
- REACT_APP_API_URL: "https://dt-echopedia-api-dev.azurewebsites.net",
8
- REACT_APP_WEB_URL: "https://dt-echopedia-web-dev.azurewebsites.net",
9
- REACT_APP_WEB_PROD_URL: "https://echo.equinor.com",
10
- REACT_APP_AZURE_AD_TENNANT: "StatoilSRM.onmicrosoft.com",
11
- REACT_APP_AZURE_AD_TENNANT_ID: "3aa4a235-b6e2-48d5-9195-7fcf05b459b0",
12
- REACT_APP_AZURE_AD_CLIENT_ID: "751d2504-0b66-4b78-9807-4b60525a14c6",
13
- REACT_APP_API_CLIENT_ID: "aef35d97-53d4-4fd0-adaf-c5a514b38436",
14
- REACT_APP_APPINSIGHTS_CONNECTION_STRING: "InstrumentationKey=e5299075-a00d-4012-96f9-42861e8d8a9e;IngestionEndpoint=https://northeurope-3.in.applicationinsights.azure.com/;LiveEndpoint=https://northeurope.livediagnostics.monitor.azure.com/;ApplicationId=a9b64222-d4a9-42e6-a615-7428fe1a26af",
15
- REACT_APP_AZURE_BUILD_NUMBER: "0.8.dev.9",
16
- REACT_APP_LOGGER_ACTIVE: "false",
17
- }
1
+ window._env_ = {
2
+ HTTPS: "true",
3
+ GENERATE_SOURCEMAP: "true",
4
+ INLINE_RUNTIME_CHUNK: "false",
5
+ WEBSITE_HOSTNAME: "localhost:3000;",
6
+ REACT_APP_DEFAULT_CACHE_LOCATION: "localstorage",
7
+ REACT_APP_API_URL: "https://dt-echopedia-api-dev.azurewebsites.net",
8
+ REACT_APP_WEB_URL: "https://dt-echopedia-web-dev.azurewebsites.net",
9
+ REACT_APP_WEB_PROD_URL: "https://echo.equinor.com",
10
+ REACT_APP_AZURE_AD_TENNANT: "StatoilSRM.onmicrosoft.com",
11
+ REACT_APP_AZURE_AD_TENNANT_ID: "3aa4a235-b6e2-48d5-9195-7fcf05b459b0",
12
+ REACT_APP_AZURE_AD_CLIENT_ID: "751d2504-0b66-4b78-9807-4b60525a14c6",
13
+ REACT_APP_API_CLIENT_ID: "aef35d97-53d4-4fd0-adaf-c5a514b38436",
14
+ REACT_APP_APPINSIGHTS_CONNECTION_STRING: "InstrumentationKey=e5299075-a00d-4012-96f9-42861e8d8a9e;IngestionEndpoint=https://northeurope-3.in.applicationinsights.azure.com/;LiveEndpoint=https://northeurope.livediagnostics.monitor.azure.com/;ApplicationId=a9b64222-d4a9-42e6-a615-7428fe1a26af",
15
+ REACT_APP_AZURE_BUILD_NUMBER: "0.8.dev.9",
16
+ REACT_APP_LOGGER_ACTIVE: "false",
17
+ }
@@ -1,21 +1,21 @@
1
- <!doctype html>
2
- <html lang="en">
3
- <head>
4
- <meta charset="UTF-8" />
5
- <script type="application/javascript" src="./env-config.js"></script>
6
- <meta http-equiv="X-UA-Compatible" content="IE=edge" />
7
- <meta
8
- name="viewport"
9
- content="width=device-width,initial-scale=1,maximum-scale=1,user-scalable=no,viewport-fit=cover"
10
- />
11
- <link href="./index.css" rel="stylesheet" />
12
- <link rel="stylesheet" href="https://cdn.eds.equinor.com/font/equinor-font.css" />
13
- <link rel="preconnect" href="https://login.microsoftonline.com" />
14
- <link rel="preconnect" href="https://dc.services.visualstudio.com" />
15
- <link rel="preconnect" href="https://cdn.eds.equinor.com" />
16
- <title>Echo | Development</title>
17
- </head>
18
- <body data-color-scheme="light">
19
- <div id="root"></div>
20
- </body>
21
- </html>
1
+ <!doctype html>
2
+ <html lang="en">
3
+ <head>
4
+ <meta charset="UTF-8" />
5
+ <script type="application/javascript" src="./env-config.js"></script>
6
+ <meta http-equiv="X-UA-Compatible" content="IE=edge" />
7
+ <meta
8
+ name="viewport"
9
+ content="width=device-width,initial-scale=1,maximum-scale=1,user-scalable=no,viewport-fit=cover"
10
+ />
11
+ <link href="./index.css" rel="stylesheet" />
12
+ <link rel="stylesheet" href="https://cdn.eds.equinor.com/font/equinor-font.css" />
13
+ <link rel="preconnect" href="https://login.microsoftonline.com" />
14
+ <link rel="preconnect" href="https://dc.services.visualstudio.com" />
15
+ <link rel="preconnect" href="https://cdn.eds.equinor.com" />
16
+ <title>Echo | Development</title>
17
+ </head>
18
+ <body data-color-scheme="light">
19
+ <div id="root"></div>
20
+ </body>
21
+ </html>
@@ -1,4 +1,4 @@
1
- import { AppLinks, EchoLogo, Footer, PlantSelector } from '@equinor/echo-framework';
1
+ import { AppLinks, EchoLogo, PlantSelector } from '@equinor/echo-framework';
2
2
  import React from 'react';
3
3
  import placeholderHomeImage from '../../images/frontpage-brand-placeholder.jpg';
4
4
  import style from './home.module.css';
@@ -17,7 +17,6 @@ export const Home: React.FC = () => {
17
17
  <div className={style.brandSliderContainer}>
18
18
  <img src={placeholderHomeImage} alt="Application Echo on tablet" />
19
19
  </div>
20
- <Footer />
21
20
  </main>
22
21
  );
23
22
  };
@@ -1,21 +1,21 @@
1
- {
2
- "compilerOptions": {
3
- "strict": true,
4
- "jsx": "react-jsx",
5
- "lib": ["dom", "dom.iterable", "esnext"],
6
- "allowSyntheticDefaultImports": true,
7
- "esModuleInterop": true,
8
- "module": "commonjs",
9
- "outDir": "./build/",
10
- "preserveConstEnums": true,
11
- "removeComments": true,
12
- "sourceMap": true,
13
- "noImplicitAny": false,
14
- "allowJs": true,
15
- "skipLibCheck": true,
16
- "target": "es5",
17
- "resolveJsonModule": true,
18
- "types": ["@equinor/echo-scripts", "@types/node", "@types/webpack-env", "@types/jest"]
19
- },
20
- "include": ["src"]
21
- }
1
+ {
2
+ "compilerOptions": {
3
+ "strict": true,
4
+ "jsx": "react-jsx",
5
+ "lib": ["dom", "dom.iterable", "esnext"],
6
+ "allowSyntheticDefaultImports": true,
7
+ "esModuleInterop": true,
8
+ "module": "commonjs",
9
+ "outDir": "./build/",
10
+ "preserveConstEnums": true,
11
+ "removeComments": true,
12
+ "sourceMap": true,
13
+ "noImplicitAny": false,
14
+ "allowJs": true,
15
+ "skipLibCheck": true,
16
+ "target": "es5",
17
+ "resolveJsonModule": true,
18
+ "types": ["@equinor/echo-scripts", "@types/node", "@types/webpack-env", "@types/jest"]
19
+ },
20
+ "include": ["src"]
21
+ }
@@ -1,145 +1,145 @@
1
- import CopyPlugin from 'copy-webpack-plugin';
2
- import Dotenv from 'dotenv-webpack';
3
- import HtmlWebpackPlugin from 'html-webpack-plugin';
4
- import path from 'path';
5
- import { fileURLToPath } from 'url';
6
- import WebpackBar from 'webpackbar';
7
-
8
- const webpackConfig = (env) => {
9
- console.log('Building the dev host application for EchoCli.');
10
-
11
- const __filename = fileURLToPath(import.meta.url);
12
- const __dirname = path.dirname(__filename);
13
-
14
- const buildOutputFolder = 'echo-dev-host-build';
15
-
16
- return {
17
- entry: ['@babel/polyfill', './src/index.tsx'],
18
- mode: 'production',
19
- devtool: 'source-map',
20
- output: {
21
- clean: true,
22
- path: path.resolve(process.cwd(), buildOutputFolder),
23
- filename: '[name].echo.bundle.js',
24
- chunkFilename: 'assets/[name].[contenthash].chunk.js',
25
- publicPath: '/'
26
- },
27
- resolve: {
28
- extensions: ['.ts', '.tsx', '.js', '.jsx'],
29
- fallback: {
30
- crypto: false,
31
- stream: false,
32
- buffer: false
33
- }
34
- },
35
- module: {
36
- rules: [
37
- {
38
- test: /\.(ts|tsx)$/,
39
- loader: 'ts-loader',
40
- exclude: /node_modules/
41
- },
42
- {
43
- test: /\.(js|jsx)$/,
44
- exclude: /node_modules/,
45
- loader: 'babel-loader'
46
- },
47
- {
48
- test: /\.css$/,
49
- use: [
50
- 'style-loader',
51
- {
52
- loader: 'css-loader',
53
- options: {
54
- importLoaders: 1,
55
- modules: {
56
- mode: 'local',
57
- localIdentName: 'echo-[folder]__[local]-[hash:base64:5]',
58
- namedExport: false,
59
- exportLocalsConvention: 'as-is'
60
- }
61
- }
62
- }
63
- ],
64
- include: /\.module\.css$/
65
- },
66
- {
67
- test: /\.css$/,
68
- use: ['style-loader', 'css-loader'],
69
- exclude: /\.module\.css$/
70
- },
71
- {
72
- test: /\.svg$/,
73
- use: ['@svgr/webpack']
74
- },
75
- {
76
- test: /\.(png|jpe?g|gif)$/i,
77
- use: [
78
- {
79
- loader: 'file-loader'
80
- }
81
- ]
82
- }
83
- ]
84
- },
85
- devServer: {
86
- static: [
87
- {
88
- directory: path.join(__dirname, 'public')
89
- },
90
- {
91
- directory: path.join(__dirname, 'build')
92
- }
93
- ],
94
- compress: true,
95
- port: 3000,
96
- hot: true,
97
- historyApiFallback: true,
98
- server: 'https',
99
- headers: {
100
- 'Access-Control-Allow-Origin': '*',
101
- 'Access-Control-Allow-Methods': 'GET, POST, PUT, DELETE, PATCH, OPTIONS',
102
- 'Access-Control-Allow-Headers': 'X-Requested-With, content-type, Authorization'
103
- }
104
- // overlay: {
105
- // warnings: true,
106
- // errors: true,
107
- // },
108
- },
109
- plugins: [
110
- new Dotenv({
111
- ignoreStub: false,
112
- expand: true,
113
- systemvars: false
114
- }),
115
- new HtmlWebpackPlugin({
116
- template: path.resolve(__dirname, './public/index.html')
117
- }),
118
- new WebpackBar({
119
- name: 'Echo module',
120
- color: '#007079',
121
- profile: true
122
- }),
123
- new CopyPlugin({
124
- patterns: [
125
- {
126
- from: path.resolve(__dirname, './public/index.css'),
127
- to: path.resolve(process.cwd(), buildOutputFolder, 'index.css')
128
- },
129
- {
130
- from: path.resolve(__dirname, './public/env-config.js'),
131
- to: path.resolve(process.cwd(), buildOutputFolder, 'env-config.js')
132
- }
133
- ]
134
- })
135
- ],
136
- optimization: {
137
- splitChunks: {
138
- chunks: 'all'
139
- },
140
- minimize: true
141
- }
142
- };
143
- };
144
-
145
- export default webpackConfig;
1
+ import CopyPlugin from 'copy-webpack-plugin';
2
+ import Dotenv from 'dotenv-webpack';
3
+ import HtmlWebpackPlugin from 'html-webpack-plugin';
4
+ import path from 'path';
5
+ import { fileURLToPath } from 'url';
6
+ import WebpackBar from 'webpackbar';
7
+
8
+ const webpackConfig = (env) => {
9
+ console.log('Building the dev host application for EchoCli.');
10
+
11
+ const __filename = fileURLToPath(import.meta.url);
12
+ const __dirname = path.dirname(__filename);
13
+
14
+ const buildOutputFolder = 'echo-dev-host-build';
15
+
16
+ return {
17
+ entry: ['@babel/polyfill', './src/index.tsx'],
18
+ mode: 'production',
19
+ devtool: 'source-map',
20
+ output: {
21
+ clean: true,
22
+ path: path.resolve(process.cwd(), buildOutputFolder),
23
+ filename: '[name].echo.bundle.js',
24
+ chunkFilename: 'assets/[name].[contenthash].chunk.js',
25
+ publicPath: '/'
26
+ },
27
+ resolve: {
28
+ extensions: ['.ts', '.tsx', '.js', '.jsx'],
29
+ fallback: {
30
+ crypto: false,
31
+ stream: false,
32
+ buffer: false
33
+ }
34
+ },
35
+ module: {
36
+ rules: [
37
+ {
38
+ test: /\.(ts|tsx)$/,
39
+ loader: 'ts-loader',
40
+ exclude: /node_modules/
41
+ },
42
+ {
43
+ test: /\.(js|jsx)$/,
44
+ exclude: /node_modules/,
45
+ loader: 'babel-loader'
46
+ },
47
+ {
48
+ test: /\.css$/,
49
+ use: [
50
+ 'style-loader',
51
+ {
52
+ loader: 'css-loader',
53
+ options: {
54
+ importLoaders: 1,
55
+ modules: {
56
+ mode: 'local',
57
+ localIdentName: 'echo-[folder]__[local]-[hash:base64:5]',
58
+ namedExport: false,
59
+ exportLocalsConvention: 'as-is'
60
+ }
61
+ }
62
+ }
63
+ ],
64
+ include: /\.module\.css$/
65
+ },
66
+ {
67
+ test: /\.css$/,
68
+ use: ['style-loader', 'css-loader'],
69
+ exclude: /\.module\.css$/
70
+ },
71
+ {
72
+ test: /\.svg$/,
73
+ use: ['@svgr/webpack']
74
+ },
75
+ {
76
+ test: /\.(png|jpe?g|gif)$/i,
77
+ use: [
78
+ {
79
+ loader: 'file-loader'
80
+ }
81
+ ]
82
+ }
83
+ ]
84
+ },
85
+ devServer: {
86
+ static: [
87
+ {
88
+ directory: path.join(__dirname, 'public')
89
+ },
90
+ {
91
+ directory: path.join(__dirname, 'build')
92
+ }
93
+ ],
94
+ compress: true,
95
+ port: 3000,
96
+ hot: true,
97
+ historyApiFallback: true,
98
+ server: 'https',
99
+ headers: {
100
+ 'Access-Control-Allow-Origin': '*',
101
+ 'Access-Control-Allow-Methods': 'GET, POST, PUT, DELETE, PATCH, OPTIONS',
102
+ 'Access-Control-Allow-Headers': 'X-Requested-With, content-type, Authorization'
103
+ }
104
+ // overlay: {
105
+ // warnings: true,
106
+ // errors: true,
107
+ // },
108
+ },
109
+ plugins: [
110
+ new Dotenv({
111
+ ignoreStub: false,
112
+ expand: true,
113
+ systemvars: false
114
+ }),
115
+ new HtmlWebpackPlugin({
116
+ template: path.resolve(__dirname, './public/index.html')
117
+ }),
118
+ new WebpackBar({
119
+ name: 'Echo module',
120
+ color: '#007079',
121
+ profile: true
122
+ }),
123
+ new CopyPlugin({
124
+ patterns: [
125
+ {
126
+ from: path.resolve(__dirname, './public/index.css'),
127
+ to: path.resolve(process.cwd(), buildOutputFolder, 'index.css')
128
+ },
129
+ {
130
+ from: path.resolve(__dirname, './public/env-config.js'),
131
+ to: path.resolve(process.cwd(), buildOutputFolder, 'env-config.js')
132
+ }
133
+ ]
134
+ })
135
+ ],
136
+ optimization: {
137
+ splitChunks: {
138
+ chunks: 'all'
139
+ },
140
+ minimize: true
141
+ }
142
+ };
143
+ };
144
+
145
+ export default webpackConfig;
@@ -0,0 +1,22 @@
1
+ #!/usr/bin/env node
2
+ /**
3
+ * Aligns echo-dev-host dependencies with root package.json and echo-libs.
4
+ * This ensures echo-dev-host uses the same versions as the main app.
5
+ *
6
+ * Usage: node lib/tools/releaseWorkflow/align-echo-dev-host-deps.js [--dry-run]
7
+ * Exit code: 0 on success, 1 on error
8
+ */
9
+ export interface AlignmentChange {
10
+ readonly dep: string;
11
+ readonly oldVersion: string;
12
+ readonly newVersion: string;
13
+ }
14
+ export interface AlignmentResult {
15
+ readonly echoLibsChanges: ReadonlyArray<AlignmentChange>;
16
+ readonly depsChanges: ReadonlyArray<AlignmentChange>;
17
+ readonly unchanged: ReadonlyArray<string>;
18
+ }
19
+ export declare const ECHO_LIBS: readonly ["echo-base", "echo-core", "echo-utils", "echo-search", "echo-components", "echo-framework"];
20
+ export declare const DEPS_TO_SYNC: readonly ["@equinor/eds-core-react", "@equinor/eds-icons", "@equinor/eds-tokens", "@equinor/eds-utils", "@microsoft/signalr", "@svgr/webpack", "@tanstack/react-query", "classnames", "fs-extra", "history", "immer", "lodash", "react", "react-dom", "react-router-dom", "react-sortablejs", "sortablejs", "styled-components", "zustand"];
21
+ export declare function alignDependencies(dryRun?: boolean): AlignmentResult;
22
+ export declare function formatResult(result: AlignmentResult): string;
@@ -0,0 +1,149 @@
1
+ #!/usr/bin/env node
2
+ /**
3
+ * Aligns echo-dev-host dependencies with root package.json and echo-libs.
4
+ * This ensures echo-dev-host uses the same versions as the main app.
5
+ *
6
+ * Usage: node lib/tools/releaseWorkflow/align-echo-dev-host-deps.js [--dry-run]
7
+ * Exit code: 0 on success, 1 on error
8
+ */
9
+ import * as fs from 'fs';
10
+ import * as path from 'path';
11
+ // Use process.cwd() - scripts are run from echo-cli directory
12
+ const CLI_ROOT = process.cwd();
13
+ const REPO_ROOT = path.resolve(CLI_ROOT, '../..');
14
+ export const ECHO_LIBS = [
15
+ 'echo-base',
16
+ 'echo-core',
17
+ 'echo-utils',
18
+ 'echo-search',
19
+ 'echo-components',
20
+ 'echo-framework'
21
+ ];
22
+ // Dependencies to sync from root package.json (excluding @equinor/echo-*)
23
+ export const DEPS_TO_SYNC = [
24
+ '@equinor/eds-core-react',
25
+ '@equinor/eds-icons',
26
+ '@equinor/eds-tokens',
27
+ '@equinor/eds-utils',
28
+ '@microsoft/signalr',
29
+ '@svgr/webpack',
30
+ '@tanstack/react-query',
31
+ 'classnames',
32
+ 'fs-extra',
33
+ 'history',
34
+ 'immer',
35
+ 'lodash',
36
+ 'react',
37
+ 'react-dom',
38
+ 'react-router-dom',
39
+ 'react-sortablejs',
40
+ 'sortablejs',
41
+ 'styled-components',
42
+ 'zustand'
43
+ ];
44
+ function readJson(filePath) {
45
+ try {
46
+ return JSON.parse(fs.readFileSync(filePath, 'utf8'));
47
+ }
48
+ catch (error) {
49
+ throw new Error(`Failed to read ${filePath}: ${error}`);
50
+ }
51
+ }
52
+ function writeJson(filePath, data) {
53
+ fs.writeFileSync(filePath, JSON.stringify(data, null, 4) + '\n', 'utf8');
54
+ }
55
+ function getEchoLibVersion(libName) {
56
+ const libPath = path.resolve(REPO_ROOT, 'libs', libName, 'package.json');
57
+ const pkg = readJson(libPath);
58
+ return pkg.version;
59
+ }
60
+ function getRootDepVersion(rootPkg, dep) {
61
+ return rootPkg.dependencies?.[dep] ?? rootPkg.devDependencies?.[dep];
62
+ }
63
+ export function alignDependencies(dryRun = false) {
64
+ const rootPkgPath = path.resolve(REPO_ROOT, 'package.json');
65
+ const devHostPkgPath = path.resolve(CLI_ROOT, 'echo-dev-host/package.json');
66
+ const rootPkg = readJson(rootPkgPath);
67
+ const devHostPkg = readJson(devHostPkgPath);
68
+ const echoLibsChanges = [];
69
+ const depsChanges = [];
70
+ const unchanged = [];
71
+ // Create mutable copy of dependencies
72
+ const newDeps = { ...devHostPkg.dependencies };
73
+ // Update echo-libs versions
74
+ for (const lib of ECHO_LIBS) {
75
+ const packageName = `@equinor/${lib}`;
76
+ const newVersion = getEchoLibVersion(lib);
77
+ const oldVersion = newDeps[packageName];
78
+ if (oldVersion !== newVersion) {
79
+ echoLibsChanges.push({ dep: packageName, oldVersion: oldVersion ?? '(missing)', newVersion });
80
+ newDeps[packageName] = newVersion;
81
+ }
82
+ else {
83
+ unchanged.push(packageName);
84
+ }
85
+ }
86
+ // Align other dependencies with root
87
+ for (const dep of DEPS_TO_SYNC) {
88
+ const newVersion = getRootDepVersion(rootPkg, dep);
89
+ if (!newVersion)
90
+ continue;
91
+ const oldVersion = newDeps[dep];
92
+ if (oldVersion !== newVersion) {
93
+ depsChanges.push({ dep, oldVersion: oldVersion ?? '(missing)', newVersion });
94
+ newDeps[dep] = newVersion;
95
+ }
96
+ else {
97
+ unchanged.push(dep);
98
+ }
99
+ }
100
+ // Write updated package.json (unless dry run)
101
+ if (!dryRun && (echoLibsChanges.length > 0 || depsChanges.length > 0)) {
102
+ const updatedPkg = { ...devHostPkg, dependencies: newDeps };
103
+ writeJson(devHostPkgPath, updatedPkg);
104
+ }
105
+ return { echoLibsChanges, depsChanges, unchanged };
106
+ }
107
+ export function formatResult(result) {
108
+ const lines = ['Aligning echo-dev-host dependencies...', ''];
109
+ if (result.echoLibsChanges.length > 0) {
110
+ lines.push('📦 Echo libs updated:');
111
+ for (const change of result.echoLibsChanges) {
112
+ lines.push(` ${change.dep}: ${change.oldVersion} → ${change.newVersion}`);
113
+ }
114
+ lines.push('');
115
+ }
116
+ if (result.depsChanges.length > 0) {
117
+ lines.push('📦 Dependencies updated:');
118
+ for (const change of result.depsChanges) {
119
+ lines.push(` ${change.dep}: ${change.oldVersion} → ${change.newVersion}`);
120
+ }
121
+ lines.push('');
122
+ }
123
+ const totalChanges = result.echoLibsChanges.length + result.depsChanges.length;
124
+ if (totalChanges === 0) {
125
+ lines.push('✅ All dependencies are already aligned!');
126
+ }
127
+ else {
128
+ lines.push(`✅ Updated ${totalChanges} dependencies`);
129
+ }
130
+ return lines.join('\n');
131
+ }
132
+ // Run if executed directly
133
+ const isMain = process.argv[1]?.includes('align-echo-dev-host-deps');
134
+ if (isMain) {
135
+ const dryRun = process.argv.includes('--dry-run');
136
+ if (dryRun) {
137
+ console.log('(Dry run - no changes will be written)\n');
138
+ }
139
+ try {
140
+ const result = alignDependencies(dryRun);
141
+ console.log(formatResult(result));
142
+ process.exit(0);
143
+ }
144
+ catch (error) {
145
+ console.error('Error:', error);
146
+ process.exit(1);
147
+ }
148
+ }
149
+ //# sourceMappingURL=align-echo-dev-host-deps.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"align-echo-dev-host-deps.js","sourceRoot":"","sources":["../../../src/tools/releaseWorkflow/align-echo-dev-host-deps.ts"],"names":[],"mappings":";AACA;;;;;;GAMG;AAEH,OAAO,KAAK,EAAE,MAAM,IAAI,CAAC;AACzB,OAAO,KAAK,IAAI,MAAM,MAAM,CAAC;AAE7B,8DAA8D;AAC9D,MAAM,QAAQ,GAAG,OAAO,CAAC,GAAG,EAAE,CAAC;AAC/B,MAAM,SAAS,GAAG,IAAI,CAAC,OAAO,CAAC,QAAQ,EAAE,OAAO,CAAC,C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