@equinor/echo-cli 0.20.0-beta-2 → 0.20.0-beta-4

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.
@@ -0,0 +1,42 @@
1
+ {
2
+ "name": "@equinor/echo-cpc",
3
+ "version": "0.0.1",
4
+ "description": "",
5
+ "main": "build/index.js",
6
+ "source": "src/index.ts",
7
+ "scripts": {
8
+ "build": "echo-build -c && npm run env",
9
+ "env": "bash ./env.sh",
10
+ "start": "echo-build -s -d",
11
+ "start-admin": "echo-build -s -d -a"
12
+ },
13
+ "author": "",
14
+ "license": "ISC",
15
+ "peerDependencies": {
16
+ "@equinor/echo-base": "0.7.5",
17
+ "@equinor/echo-components": "0.12.4",
18
+ "@equinor/echo-core": "^0.9.19",
19
+ "@equinor/echo-framework": "0.24.0",
20
+ "@equinor/echo-search": "0.15.17",
21
+ "@equinor/echo-utils": "^0.4.11",
22
+ "@equinor/eds-core-react": "0.43.0",
23
+ "@equinor/eds-icons": "0.22.0",
24
+ "lodash": "^4.17.21",
25
+ "react": "^18.3.1",
26
+ "react-dom": "^18.2.0"
27
+ },
28
+ "devDependencies": {
29
+ "@equinor/echo-base": "0.7.5",
30
+ "@equinor/echo-components": "0.12.4",
31
+ "@equinor/echo-core": "^0.9.19",
32
+ "@equinor/echo-framework": "0.24.0",
33
+ "@equinor/echo-search": "0.15.17",
34
+ "@equinor/echo-utils": "^0.4.11",
35
+ "@equinor/eds-core-react": "0.43.0",
36
+ "@equinor/echo-cli": "0.20.0-beta-2",
37
+ "@types/react": "18.0.27",
38
+ "@types/react-dom": "18.0.10",
39
+ "react": "18.2.0",
40
+ "react-dom": "18.2.0"
41
+ }
42
+ }
@@ -0,0 +1,41 @@
1
+ ![logo](https://raw.githubusercontent.com/equinor/EchoCore/main/doc/ee.png)
2
+
3
+ # Echo - cpc
4
+
5
+ This module has been bootstrapped by EchoCli.
6
+
7
+ ### NPM
8
+
9
+ ```sh-session
10
+ $ npm install @equinor/echo-module-cpc --save
11
+ ```
12
+
13
+ # Development
14
+
15
+ First time usage, run following command first:
16
+
17
+ ```sh-session
18
+ $ npm install
19
+ ```
20
+
21
+ ### NPM build
22
+
23
+ ```sh-session
24
+ $ npm run build
25
+ ```
26
+
27
+ ### NPM build watch
28
+
29
+ ```sh-session
30
+ $ npm run start
31
+ ```
32
+
33
+ ## Publish
34
+
35
+ For now the only way to include a module to echo is to publish the package to npmjs.com or npm.equinor.com
36
+
37
+ For npmjs use:
38
+
39
+ ```sh-session
40
+ $ npm run publish
41
+ ```
@@ -0,0 +1,5 @@
1
+ .wrapper {
2
+ margin-top: 150px;
3
+ padding: 16px;
4
+ text-align: center;
5
+ }
@@ -0,0 +1,11 @@
1
+ import React from 'react';
2
+ import style from './app.module.css';
3
+
4
+ export const App: React.FC = (): JSX.Element => {
5
+ return (
6
+ <div className={style.wrapper}>
7
+ <h1>Echo App Template</h1>
8
+ <p>This is an app template for Echo Applications</p>
9
+ </div>
10
+ );
11
+ };
@@ -0,0 +1,6 @@
1
+ import { EchoModuleApi } from '@equinor/echo-core';
2
+ import { App } from './app';
3
+
4
+ export function setup(api: EchoModuleApi): void {
5
+ api.registerApp(App);
6
+ }
@@ -0,0 +1,25 @@
1
+ {
2
+ "include": ["src"],
3
+ "compilerOptions": {
4
+ "sourceMap": true,
5
+ "noImplicitAny": false,
6
+ "module": "ES2015",
7
+ "target": "es5",
8
+ "lib": [
9
+ "esnext",
10
+ "dom",
11
+ "dom.iterable"
12
+ ],
13
+ "removeComments": true,
14
+ "allowSyntheticDefaultImports": true,
15
+ "jsx": "react",
16
+ "allowJs": true,
17
+ "baseUrl": "./src",
18
+ "esModuleInterop": true,
19
+ "resolveJsonModule": true,
20
+ "moduleResolution": "node",
21
+ "downlevelIteration": true,
22
+ "types": ["@equinor/echo-scripts"],
23
+ }
24
+ }
25
+
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@equinor/echo-cli",
3
- "version": "0.20.0-beta-2",
3
+ "version": "0.20.0-beta-4",
4
4
  "description": "Command line interface for Echo Apps",
5
5
  "main": "dist/index.js",
6
6
  "source": "src/test.js",
@@ -47,7 +47,7 @@
47
47
  "@babel/preset-typescript": "7.27.1",
48
48
  "@equinor/echo-scripts": "0.1.5",
49
49
  "@oclif/command": "1.8.36",
50
- "@oclif/plugin-plugins": "5.4.37",
50
+ "@oclif/plugin-plugins": "^5.4.38",
51
51
  "@svgr/webpack": "8.1.0",
52
52
  "assert": "2.1.0",
53
53
  "autoprefixer": "10.4.21",
@@ -83,10 +83,10 @@
83
83
  },
84
84
  "devDependencies": {
85
85
  "@microsoft/microsoft-graph-types": "2.40.0",
86
- "@types/express": "5.0.1",
86
+ "@types/express": "^5.0.2",
87
87
  "@types/jest": "29.5.14",
88
88
  "@types/listr": "0.14.9",
89
- "@types/node": "22.15.18",
89
+ "@types/node": "^22.15.19",
90
90
  "@types/pem": "1.14.4",
91
91
  "@types/react": "18.3.18",
92
92
  "@types/webpack-bundle-analyzer": "4.7.0",
@@ -96,7 +96,7 @@
96
96
  "@typescript-eslint/eslint-plugin": "8.32.1",
97
97
  "@typescript-eslint/parser": "8.32.1",
98
98
  "babel-jest": "29.7.0",
99
- "eslint": "9.26.0",
99
+ "eslint": "^9.27.0",
100
100
  "eslint-config-prettier": "10.1.5",
101
101
  "eslint-plugin-prettier": "5.4.0",
102
102
  "eslint-plugin-react": "7.37.5",
@@ -1,11 +1,30 @@
1
- import React from 'react';
1
+ import EchoCore, { EchoEnv } from '@equinor/echo-core';
2
+ import React, { useEffect, useState } from 'react';
2
3
  import style from './app.module.css';
3
4
 
4
- export const App: React.FC = (): JSX.Element => {
5
+ const baseApiUrl = EchoEnv.env().REACT_APP_API_URL;
6
+
7
+ async function getVersion(): Promise<string> {
8
+ const data = await EchoCore.EchoClient.fetch(`${baseApiUrl}/Version`);
9
+ return await data.text();
10
+ }
11
+
12
+ const App: React.FC = (): JSX.Element => {
13
+ const [echoVersion, setEchoVersion] = useState('');
14
+
15
+ useEffect(() => {
16
+ getVersion().then((version: string) => {
17
+ setEchoVersion(version);
18
+ });
19
+ });
20
+
5
21
  return (
6
22
  <div className={style.wrapper}>
7
23
  <h1>Echo App Template</h1>
8
24
  <p>This is an app template for Echo Applications</p>
25
+ <h6>Echo v{echoVersion}</h6>
9
26
  </div>
10
27
  );
11
28
  };
29
+
30
+ export default App;
@@ -1,5 +1,5 @@
1
1
  import { EchoModuleApi } from '@equinor/echo-core';
2
- import { App } from './app';
2
+ import App from './app';
3
3
 
4
4
  export function setup(api: EchoModuleApi): void {
5
5
  api.registerApp(App);