@equinor/echo-cli 2.0.1 → 2.1.0-beta-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.
- package/README.md +381 -357
- package/lib/echo-dev-host/README.md +121 -121
- package/lib/echo-dev-host/babel.config.js +10 -10
- package/lib/echo-dev-host/jest.config.js +21 -21
- package/lib/echo-dev-host/package-lock.json +13124 -13124
- package/lib/echo-dev-host/public/env-config.js +17 -17
- package/lib/echo-dev-host/public/index.html +21 -21
- package/lib/echo-dev-host/tsconfig.json +21 -21
- package/lib/echo-dev-host/webpack.config.js +145 -145
- package/lib/sync-dev-host-to-app.d.ts +26 -0
- package/lib/sync-dev-host-to-app.js +63 -0
- package/lib/sync-dev-host-to-app.js.map +1 -0
- package/lib/sync-echo-dev-versions.d.ts +6 -0
- package/lib/sync-echo-dev-versions.js +43 -0
- package/lib/sync-echo-dev-versions.js.map +1 -0
- package/lib/tools/buildScripts/buildAndCopyDevHost.d.ts +38 -1
- package/lib/tools/buildScripts/buildAndCopyDevHost.js +73 -10
- package/lib/tools/buildScripts/buildAndCopyDevHost.js.map +1 -1
- package/lib/tools/buildScripts/buildAndCopyDevHost.test.js +502 -0
- package/lib/tools/buildScripts/buildAndCopyDevHost.test.js.map +1 -0
- package/lib/utils/merge.test.d.ts +1 -0
- package/lib/{__test__/utils/merg.test.js → utils/merge.test.js} +2 -2
- package/lib/utils/merge.test.js.map +1 -0
- package/package.json +111 -110
- package/templates/echoAppTemplate/.gitattributes +3 -3
- package/templates/echoAppTemplate/package.json +35 -35
- package/templates/echoAppTemplate/readme.md +41 -41
- package/templates/echoAppTemplate/tsconfig.json +25 -25
- package/templates/echoAppTemplateTutorial/.gitattributes +3 -3
- package/templates/echoAppTemplateTutorial/package.json +36 -36
- package/templates/echoAppTemplateTutorial/readme.md +41 -41
- package/templates/echoAppTemplateTutorial/tsconfig.json +25 -25
- package/templates/echoLibraryTemplate/package.json +35 -35
- package/templates/echoLibraryTemplate/public/index.html +21 -21
- package/templates/echoLibraryTemplate/readme.md +1 -1
- package/templates/echoPluginTemplate/package.json +35 -35
- package/templates/echoPluginTemplate/public/index.html +21 -21
- package/templates/echoPluginTemplate/readme.md +1 -1
- package/lib/__test__/utils/merg.test.js.map +0 -1
- /package/lib/{__test__/utils/merg.test.d.ts → tools/buildScripts/buildAndCopyDevHost.test.d.ts} +0 -0
|
@@ -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>
|
|
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>
|
|
19
|
+
<div id="root"></div>
|
|
20
|
+
</body>
|
|
21
|
+
</html>
|
|
@@ -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,26 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
import { Command } from '@oclif/core';
|
|
3
|
+
/**
|
|
4
|
+
* Command to synchronize echo-dev-host library versions with the consumer application's package.json.
|
|
5
|
+
*
|
|
6
|
+
* This command is useful when switching between git branches that may have different versions of
|
|
7
|
+
* @equinor/echo-* dependencies. It rebuilds the echo-dev-host to use the exact versions specified
|
|
8
|
+
* in the consumer app's package.json.
|
|
9
|
+
*
|
|
10
|
+
* @remarks
|
|
11
|
+
* The command performs the following steps:
|
|
12
|
+
* 1. Locates the consumer app's package.json containing @equinor/echo-* dependencies
|
|
13
|
+
* 2. Displays current versions of echo libraries in both dev-host and the app
|
|
14
|
+
* 3. Rebuilds echo-dev-host using sync mode to match the app's exact dependency versions
|
|
15
|
+
*
|
|
16
|
+
* @example
|
|
17
|
+
* ```bash
|
|
18
|
+
* npx sync-dev-host-to-app
|
|
19
|
+
* ```
|
|
20
|
+
*
|
|
21
|
+
* @throws {Error} Exits with code 1 if no package.json with @equinor/echo-* dependencies is found
|
|
22
|
+
*/
|
|
23
|
+
export default class SyncDevHostToApp extends Command {
|
|
24
|
+
static readonly description = "Sync echo-dev-host to use exact echo library versions from your app (useful after switching git branches)";
|
|
25
|
+
run(): Promise<void>;
|
|
26
|
+
}
|
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
import { Command } from '@oclif/core';
|
|
3
|
+
import chalk from 'chalk';
|
|
4
|
+
import path from 'node:path';
|
|
5
|
+
import { ECHO_HOST_BUILD_OUTPUT_FOLDER, ECHO_HOST_TEMP_BUILD_FOLDER } from './const/common.js';
|
|
6
|
+
import { buildAndCopyDevHost } from './tools/buildScripts/buildAndCopyDevHost.js';
|
|
7
|
+
import { findConsumerAppPackageJson } from './utils/findConsumerAppPackageJson.js';
|
|
8
|
+
import { printEchoLibsVersions } from './utils/printEchoLibsVersions.js';
|
|
9
|
+
/**
|
|
10
|
+
* Command to synchronize echo-dev-host library versions with the consumer application's package.json.
|
|
11
|
+
*
|
|
12
|
+
* This command is useful when switching between git branches that may have different versions of
|
|
13
|
+
* @equinor/echo-* dependencies. It rebuilds the echo-dev-host to use the exact versions specified
|
|
14
|
+
* in the consumer app's package.json.
|
|
15
|
+
*
|
|
16
|
+
* @remarks
|
|
17
|
+
* The command performs the following steps:
|
|
18
|
+
* 1. Locates the consumer app's package.json containing @equinor/echo-* dependencies
|
|
19
|
+
* 2. Displays current versions of echo libraries in both dev-host and the app
|
|
20
|
+
* 3. Rebuilds echo-dev-host using sync mode to match the app's exact dependency versions
|
|
21
|
+
*
|
|
22
|
+
* @example
|
|
23
|
+
* ```bash
|
|
24
|
+
* npx sync-dev-host-to-app
|
|
25
|
+
* ```
|
|
26
|
+
*
|
|
27
|
+
* @throws {Error} Exits with code 1 if no package.json with @equinor/echo-* dependencies is found
|
|
28
|
+
*/
|
|
29
|
+
export default class SyncDevHostToApp extends Command {
|
|
30
|
+
static description = 'Sync echo-dev-host to use exact echo library versions from your app (useful after switching git branches)';
|
|
31
|
+
async run() {
|
|
32
|
+
console.log(chalk.cyan.bold('\n🔄 Syncing echo-dev-host versions to match your app...\n'));
|
|
33
|
+
// 1. Find consumer app package.json
|
|
34
|
+
const consumerPkgPath = findConsumerAppPackageJson(process.cwd());
|
|
35
|
+
if (!consumerPkgPath) {
|
|
36
|
+
console.error(chalk.red('Could not find a package.json with @equinor/echo-* dependencies.\nMake sure you are in an Echo module project directory.'));
|
|
37
|
+
process.exit(1);
|
|
38
|
+
}
|
|
39
|
+
// 2. Show current versions
|
|
40
|
+
const devHostPkgPath = path.resolve(process.cwd(), 'node_modules', '@equinor', 'echo-cli', 'lib', 'echo-dev-host', 'package.json');
|
|
41
|
+
console.log(chalk.yellow('Current versions:\n'));
|
|
42
|
+
await printEchoLibsVersions({
|
|
43
|
+
devHostPkgPath,
|
|
44
|
+
appPkgPath: consumerPkgPath,
|
|
45
|
+
fetchLatest: false
|
|
46
|
+
});
|
|
47
|
+
console.log(chalk.cyan("\n📌 This will rebuild echo-dev-host to match your app's package.json versions exactly.\n"));
|
|
48
|
+
// 3. Rebuild dev host with sync mode (forces consumer app versions)
|
|
49
|
+
const cliNodeModules = path.resolve(process.cwd(), 'node_modules', '@equinor', 'echo-cli');
|
|
50
|
+
const finalOutput = path.join(cliNodeModules, ECHO_HOST_BUILD_OUTPUT_FOLDER);
|
|
51
|
+
await buildAndCopyDevHost({
|
|
52
|
+
cliNodeModules,
|
|
53
|
+
tmpDevHostFolder: path.resolve(process.cwd(), ECHO_HOST_TEMP_BUILD_FOLDER),
|
|
54
|
+
finalOutputDir: finalOutput,
|
|
55
|
+
isProdBuild: false,
|
|
56
|
+
syncMode: true // New flag to force exact version matching
|
|
57
|
+
});
|
|
58
|
+
console.log(chalk.green.bold("\n✅ Sync complete! echo-dev-host now uses your app's echo lib versions.\n"));
|
|
59
|
+
console.log(chalk.gray('You can now run "npm start" to start your Echo app.\n'));
|
|
60
|
+
}
|
|
61
|
+
}
|
|
62
|
+
SyncDevHostToApp.run();
|
|
63
|
+
//# sourceMappingURL=sync-dev-host-to-app.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"sync-dev-host-to-app.js","sourceRoot":"","sources":["../src/sync-dev-host-to-app.ts"],"names":[],"mappings":";AACA,OAAO,EAAE,OAAO,EAAE,MAAM,aAAa,CAAC;AACtC,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,IAAI,MAAM,WAAW,CAAC;AAC7B,OAAO,EAAE,6BAA6B,EAAE,2BAA2B,EAAE,MAAM,mBAAmB,CAAC;AAC/F,OAAO,EAAE,mBAAmB,EAAE,MAAM,6CAA6C,CAAC;AAClF,OAAO,EAAE,0BAA0B,EAAE,MAAM,uCAAuC,CAAC;AACnF,OAAO,EAAE,qBAAqB,EAAE,MAAM,kCAAkC,CAAC;AAEzE;;;;;;;;;;;;;;;;;;;GAmBG;AACH,MAAM,CAAC,OAAO,OAAO,gBAAiB,SAAQ,OAAO;IACjD,MAAM,CAAU,WAAW,GACvB,2GAA2G,CAAC;IAEhH,KAAK,CAAC,GAAG;QACL,OAAO,CAAC,GAAG,CAAC,KAAK,CAAC,IAAI,CAAC,IAAI,CAAC,4DAA4D,CAAC,CAAC,CAAC;QAE3F,oCAAoC;QACpC,MAAM,eAAe,GAAG,0BAA0B,CAAC,OAAO,CAAC,GAAG,EAAE,CAAC,CAAC;QAClE,IAAI,CAAC,eAAe,EAAE,CAAC;YACnB,OAAO,CAAC,KAAK,CACT,KAAK,CAAC,GAAG,CACL,0HAA0H,CAC7H,CACJ,CAAC;YACF,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;QACpB,CAAC;QAED,2BAA2B;QAC3B,MAAM,cAAc,GAAG,IAAI,CAAC,OAAO,CAC/B,OAAO,CAAC,GAAG,EAAE,EACb,cAAc,EACd,UAAU,EACV,UAAU,EACV,KAAK,EACL,eAAe,EACf,cAAc,CACjB,CAAC;QAEF,OAAO,CAAC,GAAG,CAAC,KAAK,CAAC,MAAM,CAAC,qBAAqB,CAAC,CAAC,CAAC;QACjD,MAAM,qBAAqB,CAAC;YACxB,cAAc;YACd,UAAU,EAAE,eAAe;YAC3B,WAAW,EAAE,KAAK;SACrB,CAAC,CAAC;QAEH,OAAO,CAAC,GAAG,CACP,KAAK,CAAC,IAAI,CAAC,2FAA2F,CAAC,CAC1G,CAAC;QAEF,oEAAoE;QACpE,MAAM,cAAc,GAAG,IAAI,CAAC,OAAO,CAAC,OAAO,CAAC,GAAG,EAAE,EAAE,cAAc,EAAE,UAAU,EAAE,UAAU,CAAC,CAAC;QAC3F,MAAM,WAAW,GAAG,IAAI,CAAC,IAAI,CAAC,cAAc,EAAE,6BAA6B,CAAC,CAAC;QAE7E,MAAM,mBAAmB,CAAC;YACtB,cAAc;YACd,gBAAgB,EAAE,IAAI,CAAC,OAAO,CAAC,OAAO,CAAC,GAAG,EAAE,EAAE,2BAA2B,CAAC;YAC1E,cAAc,EAAE,WAAW;YAC3B,WAAW,EAAE,KAAK;YAClB,QAAQ,EAAE,IAAI,CAAC,2CAA2C;SAC7D,CAAC,CAAC;QAEH,OAAO,CAAC,GAAG,CAAC,KAAK,CAAC,KAAK,CAAC,IAAI,CAAC,2EAA2E,CAAC,CAAC,CAAC;QAC3G,OAAO,CAAC,GAAG,CAAC,KAAK,CAAC,IAAI,CAAC,uDAAuD,CAAC,CAAC,CAAC;IACrF,CAAC;;AAGL,gBAAgB,CAAC,GAAG,EAAE,CAAC"}
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
import { Command } from '@oclif/core';
|
|
3
|
+
export default class SyncEchoDevVersions extends Command {
|
|
4
|
+
static readonly description = "Sync echo-dev-host to use exact echo library versions from your app (useful after switching git branches)";
|
|
5
|
+
run(): Promise<void>;
|
|
6
|
+
}
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
import { Command } from '@oclif/core';
|
|
3
|
+
import chalk from 'chalk';
|
|
4
|
+
import path from 'node:path';
|
|
5
|
+
import { ECHO_HOST_BUILD_OUTPUT_FOLDER, ECHO_HOST_TEMP_BUILD_FOLDER } from './const/common.js';
|
|
6
|
+
import { buildAndCopyDevHost } from './tools/buildScripts/buildAndCopyDevHost.js';
|
|
7
|
+
import { findConsumerAppPackageJson } from './utils/findConsumerAppPackageJson.js';
|
|
8
|
+
import { printEchoLibsVersions } from './utils/printEchoLibsVersions.js';
|
|
9
|
+
export default class SyncEchoDevVersions extends Command {
|
|
10
|
+
static description = 'Sync echo-dev-host to use exact echo library versions from your app (useful after switching git branches)';
|
|
11
|
+
async run() {
|
|
12
|
+
console.log(chalk.cyan.bold('\n🔄 Syncing echo-dev-host versions to match your app...\n'));
|
|
13
|
+
// 1. Find consumer app package.json
|
|
14
|
+
const consumerPkgPath = findConsumerAppPackageJson(process.cwd());
|
|
15
|
+
if (!consumerPkgPath) {
|
|
16
|
+
console.error(chalk.red('Could not find a package.json with @equinor/echo-* dependencies.\nMake sure you are in an Echo module project directory.'));
|
|
17
|
+
process.exit(1);
|
|
18
|
+
}
|
|
19
|
+
// 2. Show current versions
|
|
20
|
+
const devHostPkgPath = path.resolve(process.cwd(), 'node_modules', '@equinor', 'echo-cli', 'lib', 'echo-dev-host', 'package.json');
|
|
21
|
+
console.log(chalk.yellow('Current versions:\n'));
|
|
22
|
+
await printEchoLibsVersions({
|
|
23
|
+
devHostPkgPath,
|
|
24
|
+
appPkgPath: consumerPkgPath,
|
|
25
|
+
fetchLatest: false
|
|
26
|
+
});
|
|
27
|
+
console.log(chalk.cyan("\n📌 This will rebuild echo-dev-host to match your app's package.json versions exactly.\n"));
|
|
28
|
+
// 3. Rebuild dev host with sync mode (forces consumer app versions)
|
|
29
|
+
const cliNodeModules = path.resolve(process.cwd(), 'node_modules', '@equinor', 'echo-cli');
|
|
30
|
+
const finalOutput = path.join(cliNodeModules, ECHO_HOST_BUILD_OUTPUT_FOLDER);
|
|
31
|
+
await buildAndCopyDevHost({
|
|
32
|
+
cliNodeModules,
|
|
33
|
+
tmpDevHostFolder: path.resolve(process.cwd(), ECHO_HOST_TEMP_BUILD_FOLDER),
|
|
34
|
+
finalOutputDir: finalOutput,
|
|
35
|
+
isProdBuild: false,
|
|
36
|
+
syncMode: true // New flag to force exact version matching
|
|
37
|
+
});
|
|
38
|
+
console.log(chalk.green.bold("\n✅ Sync complete! echo-dev-host now uses your app's echo lib versions.\n"));
|
|
39
|
+
console.log(chalk.gray('You can now run "npm start" to start your Echo app.\n'));
|
|
40
|
+
}
|
|
41
|
+
}
|
|
42
|
+
SyncEchoDevVersions.run();
|
|
43
|
+
//# sourceMappingURL=sync-echo-dev-versions.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"sync-echo-dev-versions.js","sourceRoot":"","sources":["../src/sync-echo-dev-versions.ts"],"names":[],"mappings":";AACA,OAAO,EAAE,OAAO,EAAE,MAAM,aAAa,CAAC;AACtC,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,IAAI,MAAM,WAAW,CAAC;AAC7B,OAAO,EAAE,6BAA6B,EAAE,2BAA2B,EAAE,MAAM,mBAAmB,CAAC;AAC/F,OAAO,EAAE,mBAAmB,EAAE,MAAM,6CAA6C,CAAC;AAClF,OAAO,EAAE,0BAA0B,EAAE,MAAM,uCAAuC,CAAC;AACnF,OAAO,EAAE,qBAAqB,EAAE,MAAM,kCAAkC,CAAC;AAEzE,MAAM,CAAC,OAAO,OAAO,mBAAoB,SAAQ,OAAO;IACpD,MAAM,CAAU,WAAW,GACvB,2GAA2G,CAAC;IAEhH,KAAK,CAAC,GAAG;QACL,OAAO,CAAC,GAAG,CAAC,KAAK,CAAC,IAAI,CAAC,IAAI,CAAC,4DAA4D,CAAC,CAAC,CAAC;QAE3F,oCAAoC;QACpC,MAAM,eAAe,GAAG,0BAA0B,CAAC,OAAO,CAAC,GAAG,EAAE,CAAC,CAAC;QAClE,IAAI,CAAC,eAAe,EAAE,CAAC;YACnB,OAAO,CAAC,KAAK,CACT,KAAK,CAAC,GAAG,CACL,0HAA0H,CAC7H,CACJ,CAAC;YACF,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;QACpB,CAAC;QAED,2BAA2B;QAC3B,MAAM,cAAc,GAAG,IAAI,CAAC,OAAO,CAC/B,OAAO,CAAC,GAAG,EAAE,EACb,cAAc,EACd,UAAU,EACV,UAAU,EACV,KAAK,EACL,eAAe,EACf,cAAc,CACjB,CAAC;QAEF,OAAO,CAAC,GAAG,CAAC,KAAK,CAAC,MAAM,CAAC,qBAAqB,CAAC,CAAC,CAAC;QACjD,MAAM,qBAAqB,CAAC;YACxB,cAAc;YACd,UAAU,EAAE,eAAe;YAC3B,WAAW,EAAE,KAAK;SACrB,CAAC,CAAC;QAEH,OAAO,CAAC,GAAG,CACP,KAAK,CAAC,IAAI,CAAC,2FAA2F,CAAC,CAC1G,CAAC;QAEF,oEAAoE;QACpE,MAAM,cAAc,GAAG,IAAI,CAAC,OAAO,CAAC,OAAO,CAAC,GAAG,EAAE,EAAE,cAAc,EAAE,UAAU,EAAE,UAAU,CAAC,CAAC;QAC3F,MAAM,WAAW,GAAG,IAAI,CAAC,IAAI,CAAC,cAAc,EAAE,6BAA6B,CAAC,CAAC;QAE7E,MAAM,mBAAmB,CAAC;YACtB,cAAc;YACd,gBAAgB,EAAE,IAAI,CAAC,OAAO,CAAC,OAAO,CAAC,GAAG,EAAE,EAAE,2BAA2B,CAAC;YAC1E,cAAc,EAAE,WAAW;YAC3B,WAAW,EAAE,KAAK;YAClB,QAAQ,EAAE,IAAI,CAAC,2CAA2C;SAC7D,CAAC,CAAC;QAEH,OAAO,CAAC,GAAG,CAAC,KAAK,CAAC,KAAK,CAAC,IAAI,CAAC,2EAA2E,CAAC,CAAC,CAAC;QAC3G,OAAO,CAAC,GAAG,CAAC,KAAK,CAAC,IAAI,CAAC,uDAAuD,CAAC,CAAC,CAAC;IACrF,CAAC;;AAGL,mBAAmB,CAAC,GAAG,EAAE,CAAC"}
|
|
@@ -21,9 +21,46 @@
|
|
|
21
21
|
* @remarks
|
|
22
22
|
* - Exits the process if a suitable consumer app package.json cannot be found.
|
|
23
23
|
*/
|
|
24
|
-
export declare function buildAndCopyDevHost({ cliNodeModules, tmpDevHostFolder, finalOutputDir, isProdBuild }: {
|
|
24
|
+
export declare function buildAndCopyDevHost({ cliNodeModules, tmpDevHostFolder, finalOutputDir, isProdBuild, syncMode }: {
|
|
25
25
|
cliNodeModules: string;
|
|
26
26
|
tmpDevHostFolder: string;
|
|
27
27
|
finalOutputDir: string;
|
|
28
28
|
isProdBuild?: boolean;
|
|
29
|
+
syncMode?: boolean;
|
|
29
30
|
}): Promise<void>;
|
|
31
|
+
/**
|
|
32
|
+
* Determines the versions of Echo libraries to use for a production build of the dev host,
|
|
33
|
+
* based on the dependencies specified in the consumer application's package.json.
|
|
34
|
+
*
|
|
35
|
+
* This function compares the Echo library dependencies between the consumer app and the dev host.
|
|
36
|
+
* If the consumer app requires a newer version of an Echo library than the dev host, the dev host's
|
|
37
|
+
* package.json is updated to use the consumer app's version for that library.
|
|
38
|
+
*
|
|
39
|
+
* The function logs the source of each version decision and writes any necessary updates to the dev host's
|
|
40
|
+
* package.json file.
|
|
41
|
+
*
|
|
42
|
+
* @param appPkgPath - The file path to the consumer application's package.json.
|
|
43
|
+
* @param tmpDevHostFolder - The folder path containing the dev host's package.json.
|
|
44
|
+
* @returns A promise that resolves to a record mapping each Echo library name to the version that will be used for the build.
|
|
45
|
+
* @internal - Exported for testing purposes only
|
|
46
|
+
*/
|
|
47
|
+
export declare function determineEchoLibVersionsForProdBuild({ appPkgPath, tmpDevHostFolder }: {
|
|
48
|
+
appPkgPath: string;
|
|
49
|
+
tmpDevHostFolder: string;
|
|
50
|
+
}): Promise<Record<string, string>>;
|
|
51
|
+
/**
|
|
52
|
+
* Forces the dev host to use the exact echo library versions from the consumer app's package.json.
|
|
53
|
+
* This is useful for developers switching between git branches with different echo lib versions.
|
|
54
|
+
*
|
|
55
|
+
* Unlike production builds which use max(consumer, devHost), this function always uses the consumer's
|
|
56
|
+
* version regardless of whether it's higher or lower than the dev host's current version.
|
|
57
|
+
*
|
|
58
|
+
* @param appPkgPath - The file path to the consumer application's package.json.
|
|
59
|
+
* @param tmpDevHostFolder - The folder path containing the dev host's package.json.
|
|
60
|
+
* @returns A promise that resolves to a record mapping each Echo library name to the version from the consumer app.
|
|
61
|
+
* @internal - Exported for testing purposes only
|
|
62
|
+
*/
|
|
63
|
+
export declare function syncDevHostToConsumerVersions({ appPkgPath, tmpDevHostFolder }: {
|
|
64
|
+
appPkgPath: string;
|
|
65
|
+
tmpDevHostFolder: string;
|
|
66
|
+
}): Promise<Record<string, string>>;
|