@equinor/echo-cli 4.0.1 → 5.0.0-beta-r19

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 (101) hide show
  1. package/README.md +415 -413
  2. package/lib/config/common/echoModuleConfig.d.ts +0 -2
  3. package/lib/config/common/echoModuleConfig.js +1 -33
  4. package/lib/config/common/echoModuleConfig.js.map +1 -1
  5. package/lib/const/common.d.ts +0 -1
  6. package/lib/const/common.js +0 -1
  7. package/lib/const/common.js.map +1 -1
  8. package/lib/echo-dev-host/README.md +121 -121
  9. package/lib/echo-dev-host/babel.config.js +10 -10
  10. package/lib/echo-dev-host/echo-dev-host-build/d2d97a9feca22f12a8c8c7413d7867ac.jpg +0 -0
  11. package/lib/echo-dev-host/echo-dev-host-build/env-config.js +1 -0
  12. package/lib/echo-dev-host/echo-dev-host-build/index.css +60 -0
  13. package/lib/echo-dev-host/echo-dev-host-build/index.html +21 -0
  14. package/lib/echo-dev-host/echo-dev-host-build/main.echo.bundle.js +3 -0
  15. package/lib/echo-dev-host/echo-dev-host-build/main.echo.bundle.js.LICENSE.txt +97 -0
  16. package/lib/echo-dev-host/echo-dev-host-build/main.echo.bundle.js.map +1 -0
  17. package/lib/echo-dev-host/echo-dev-host-build/vendors-node_modules_babel_polyfill_lib_index_js-node_modules_react-dom_client_js-node_module-8e2452.echo.bundle.js +3 -0
  18. package/lib/echo-dev-host/echo-dev-host-build/vendors-node_modules_babel_polyfill_lib_index_js-node_modules_react-dom_client_js-node_module-8e2452.echo.bundle.js.LICENSE.txt +2892 -0
  19. package/lib/echo-dev-host/echo-dev-host-build/vendors-node_modules_babel_polyfill_lib_index_js-node_modules_react-dom_client_js-node_module-8e2452.echo.bundle.js.map +1 -0
  20. package/lib/echo-dev-host/jest.config.js +21 -21
  21. package/lib/echo-dev-host/package-lock.json +14548 -14542
  22. package/lib/echo-dev-host/package.json +18 -18
  23. package/lib/echo-dev-host/public/env-config.js +17 -17
  24. package/lib/echo-dev-host/public/index.html +21 -21
  25. package/lib/echo-dev-host/src/index.tsx +1 -1
  26. package/lib/echo-dev-host/tsconfig.json +21 -21
  27. package/lib/echo-dev-host/webpack.config.js +145 -145
  28. package/lib/sync-echo-dev-versions.d.ts +6 -0
  29. package/lib/sync-echo-dev-versions.js +43 -0
  30. package/lib/sync-echo-dev-versions.js.map +1 -0
  31. package/lib/tools/buildScripts/buildAndCopyDevHost.test.d.ts +1 -0
  32. package/lib/tools/buildScripts/buildAndCopyDevHost.test.js +500 -0
  33. package/lib/tools/buildScripts/buildAndCopyDevHost.test.js.map +1 -0
  34. package/lib/utils/merge.test.d.ts +1 -0
  35. package/lib/utils/merge.test.js +29 -0
  36. package/lib/utils/merge.test.js.map +1 -0
  37. package/package.json +111 -116
  38. package/lib/config/common/echoModuleId.d.ts +0 -5
  39. package/lib/config/common/echoModuleId.js +0 -15
  40. package/lib/config/common/echoModuleId.js.map +0 -1
  41. package/lib/config/common/updateEnv.d.ts +0 -6
  42. package/lib/config/common/updateEnv.js +0 -16
  43. package/lib/config/common/updateEnv.js.map +0 -1
  44. package/lib/echo-create.d.ts +0 -16
  45. package/lib/echo-create.js +0 -35
  46. package/lib/echo-create.js.map +0 -1
  47. package/lib/tools/create/copyFile.d.ts +0 -2
  48. package/lib/tools/create/copyFile.js +0 -16
  49. package/lib/tools/create/copyFile.js.map +0 -1
  50. package/lib/tools/create/createProject.d.ts +0 -2
  51. package/lib/tools/create/createProject.js +0 -83
  52. package/lib/tools/create/createProject.js.map +0 -1
  53. package/lib/tools/create/createSetTargetDirectory.d.ts +0 -1
  54. package/lib/tools/create/createSetTargetDirectory.js +0 -12
  55. package/lib/tools/create/createSetTargetDirectory.js.map +0 -1
  56. package/lib/tools/create/getAppTemplateName.d.ts +0 -1
  57. package/lib/tools/create/getAppTemplateName.js +0 -22
  58. package/lib/tools/create/getAppTemplateName.js.map +0 -1
  59. package/lib/tools/create/gitInit.d.ts +0 -1
  60. package/lib/tools/create/gitInit.js +0 -19
  61. package/lib/tools/create/gitInit.js.map +0 -1
  62. package/lib/tools/create/promptOptions.d.ts +0 -2
  63. package/lib/tools/create/promptOptions.js +0 -88
  64. package/lib/tools/create/promptOptions.js.map +0 -1
  65. package/lib/tools/create/updatePackageConfig.d.ts +0 -2
  66. package/lib/tools/create/updatePackageConfig.js +0 -28
  67. package/lib/tools/create/updatePackageConfig.js.map +0 -1
  68. package/lib/tools/create/updateReadme.d.ts +0 -2
  69. package/lib/tools/create/updateReadme.js +0 -23
  70. package/lib/tools/create/updateReadme.js.map +0 -1
  71. package/lib/types/createTypes.d.ts +0 -23
  72. package/lib/types/createTypes.js +0 -2
  73. package/lib/types/createTypes.js.map +0 -1
  74. package/templates/echoAppTemplate/.env +0 -0
  75. package/templates/echoAppTemplate/.gitattributes +0 -3
  76. package/templates/echoAppTemplate/env.sh +0 -54
  77. package/templates/echoAppTemplate/package.json +0 -36
  78. package/templates/echoAppTemplate/readme.md +0 -41
  79. package/templates/echoAppTemplate/src/app.module.css +0 -5
  80. package/templates/echoAppTemplate/src/app.tsx +0 -30
  81. package/templates/echoAppTemplate/src/index.ts +0 -6
  82. package/templates/echoAppTemplate/tsconfig.json +0 -25
  83. package/templates/echoAppTemplateTutorial/.env +0 -0
  84. package/templates/echoAppTemplateTutorial/.gitattributes +0 -3
  85. package/templates/echoAppTemplateTutorial/env.sh +0 -54
  86. package/templates/echoAppTemplateTutorial/package.json +0 -37
  87. package/templates/echoAppTemplateTutorial/readme.md +0 -41
  88. package/templates/echoAppTemplateTutorial/src/app.module.css +0 -5
  89. package/templates/echoAppTemplateTutorial/src/app.tsx +0 -30
  90. package/templates/echoAppTemplateTutorial/src/index.ts +0 -6
  91. package/templates/echoAppTemplateTutorial/tsconfig.json +0 -25
  92. package/templates/echoLibraryTemplate/package.json +0 -36
  93. package/templates/echoLibraryTemplate/public/ee.png +0 -0
  94. package/templates/echoLibraryTemplate/public/index.html +0 -21
  95. package/templates/echoLibraryTemplate/public/style.css +0 -43
  96. package/templates/echoLibraryTemplate/readme.md +0 -1
  97. package/templates/echoPluginTemplate/package.json +0 -36
  98. package/templates/echoPluginTemplate/public/ee.png +0 -0
  99. package/templates/echoPluginTemplate/public/index.html +0 -21
  100. package/templates/echoPluginTemplate/public/style.css +0 -43
  101. package/templates/echoPluginTemplate/readme.md +0 -1
@@ -1,88 +0,0 @@
1
- import inquirer from 'inquirer';
2
- export async function promptForMissingOptions(options) {
3
- const questions = [];
4
- const nameQuestion = [];
5
- const templateQuestion = [];
6
- if (!options.name || typeof options.name !== 'string') {
7
- nameQuestion.push({
8
- message: 'Please enter an app name',
9
- name: 'name',
10
- type: 'input'
11
- });
12
- }
13
- const selectedName = nameQuestion.length !== 0 ? await inquirer.prompt(nameQuestion) : options;
14
- if (!options.key) {
15
- questions.push({
16
- default: selectedName && slugify(selectedName.name),
17
- message: 'Please enter an app key',
18
- name: 'key',
19
- type: 'input'
20
- });
21
- }
22
- if (!options.shortName) {
23
- questions.push({
24
- default: selectedName && cleanText(selectedName.name),
25
- message: 'Please enter an app shortname',
26
- name: 'shortName',
27
- type: 'input'
28
- });
29
- }
30
- if (!options.path) {
31
- questions.push({
32
- default: selectedName && `/${cleanText(selectedName.name)}`,
33
- message: 'Please enter an app path',
34
- name: 'path',
35
- type: 'input'
36
- });
37
- }
38
- if (!options.description) {
39
- questions.push({
40
- default: '',
41
- message: 'Please enter an app description',
42
- name: 'description',
43
- type: 'input'
44
- });
45
- }
46
- if (!options.templateName) {
47
- templateQuestion.push({
48
- default: 'app',
49
- message: 'Please enter an app template (app | appTutorial)',
50
- name: 'template',
51
- type: 'input'
52
- });
53
- }
54
- const selectedTemplate = templateQuestion.length !== 0 ? await inquirer.prompt(templateQuestion) : options;
55
- if (!options.key) {
56
- questions.push({
57
- default: true,
58
- message: 'Initialize git?',
59
- name: 'git',
60
- type: 'confirm'
61
- });
62
- }
63
- const answers = await inquirer.prompt(questions);
64
- return {
65
- ...options,
66
- description: options.description || answers.description,
67
- git: options.git || answers.git,
68
- install: options.install || answers.install,
69
- key: options.key || answers.key,
70
- path: options.path || answers.path,
71
- name: selectedName.name,
72
- shortName: options.shortName || answers.shortName,
73
- templateName: selectedTemplate.templateName
74
- };
75
- }
76
- function cleanText(text) {
77
- return text
78
- .toLowerCase()
79
- .replace(/[^\w ]+/g, '')
80
- .replace(/ +/g, '');
81
- }
82
- function slugify(text) {
83
- return text
84
- .toLowerCase()
85
- .replace(/[^\w ]+/g, '')
86
- .replace(/ +/g, '-');
87
- }
88
- //# sourceMappingURL=promptOptions.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"promptOptions.js","sourceRoot":"","sources":["../../../src/tools/create/promptOptions.ts"],"names":[],"mappings":"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"}
@@ -1,2 +0,0 @@
1
- import { TemplateDir } from '../../types/createTypes.js';
2
- export declare function updatePackageConfig(options: TemplateDir): Promise<void>;
@@ -1,28 +0,0 @@
1
- import chalk from 'chalk';
2
- import * as fs from 'fs';
3
- import path from 'path';
4
- import { promisify } from 'util';
5
- const access = promisify(fs.access);
6
- export async function updatePackageConfig(options) {
7
- const configPath = path.join(options.targetDirectory || '', '/package.json');
8
- try {
9
- await access(configPath, fs.constants.R_OK);
10
- }
11
- catch (err) {
12
- if (err instanceof Error) {
13
- console.error('%s Cant access new app config', chalk.red.bold('ERROR'));
14
- process.exit(1);
15
- }
16
- else {
17
- throw err;
18
- }
19
- }
20
- const config = JSON.parse(fs.readFileSync(configPath).toString());
21
- config.name = `@equinor/echo-${options.name.trim().toLocaleLowerCase()}`;
22
- config.description = options.description;
23
- config.scripts = {
24
- ...config.scripts
25
- };
26
- fs.writeFileSync(configPath, JSON.stringify(config, null, 4));
27
- }
28
- //# sourceMappingURL=updatePackageConfig.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"updatePackageConfig.js","sourceRoot":"","sources":["../../../src/tools/create/updatePackageConfig.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,KAAK,EAAE,MAAM,IAAI,CAAC;AACzB,OAAO,IAAI,MAAM,MAAM,CAAC;AACxB,OAAO,EAAE,SAAS,EAAE,MAAM,MAAM,CAAC;AAGjC,MAAM,MAAM,GAAG,SAAS,CAAC,EAAE,CAAC,MAAM,CAAC,CAAC;AAEpC,MAAM,CAAC,KAAK,UAAU,mBAAmB,CAAC,OAAoB;IAC1D,MAAM,UAAU,GAAG,IAAI,CAAC,IAAI,CAAC,OAAO,CAAC,eAAe,IAAI,EAAE,EAAE,eAAe,CAAC,CAAC;IAE7E,IAAI,CAAC;QACD,MAAM,MAAM,CAAC,UAAU,EAAE,EAAE,CAAC,SAAS,CAAC,IAAI,CAAC,CAAC;IAChD,CAAC;IAAC,OAAO,GAAG,EAAE,CAAC;QACX,IAAI,GAAG,YAAY,KAAK,EAAE,CAAC;YACvB,OAAO,CAAC,KAAK,CAAC,+BAA+B,EAAE,KAAK,CAAC,GAAG,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC,CAAC;YACxE,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;QACpB,CAAC;aAAM,CAAC;YACJ,MAAM,GAAG,CAAC;QACd,CAAC;IACL,CAAC;IAED,MAAM,MAAM,GAAG,IAAI,CAAC,KAAK,CAAC,EAAE,CAAC,YAAY,CAAC,UAAU,CAAC,CAAC,QAAQ,EAAE,CAAC,CAAC;IAClE,MAAM,CAAC,IAAI,GAAG,iBAAiB,OAAO,CAAC,IAAI,CAAC,IAAI,EAAE,CAAC,iBAAiB,EAAE,EAAE,CAAC;IACzE,MAAM,CAAC,WAAW,GAAG,OAAO,CAAC,WAAW,CAAC;IACzC,MAAM,CAAC,OAAO,GAAG;QACb,GAAG,MAAM,CAAC,OAAO;KACpB,CAAC;IAEF,EAAE,CAAC,aAAa,CAAC,UAAU,EAAE,IAAI,CAAC,SAAS,CAAC,MAAM,EAAE,IAAI,EAAE,CAAC,CAAC,CAAC,CAAC;AAClE,CAAC"}
@@ -1,2 +0,0 @@
1
- import { TemplateDir } from '../../types/createTypes.js';
2
- export declare function updateReadme(options: TemplateDir): Promise<void>;
@@ -1,23 +0,0 @@
1
- import chalk from 'chalk';
2
- import * as fs from 'fs';
3
- import path from 'path';
4
- import { promisify } from 'util';
5
- const access = promisify(fs.access);
6
- export async function updateReadme(options) {
7
- const readmePath = path.join(options.targetDirectory || '', '/readme.md');
8
- try {
9
- await access(readmePath, fs.constants.R_OK);
10
- }
11
- catch (err) {
12
- if (err instanceof Error) {
13
- console.error('%s Cant access new app readme file', chalk.red.bold('ERROR'));
14
- process.exit(1);
15
- }
16
- else {
17
- throw err;
18
- }
19
- }
20
- const readme = fs.readFileSync(readmePath).toString();
21
- fs.writeFileSync(readmePath, readme.replace(new RegExp(/\%moduleName\%/, 'g'), options.name));
22
- }
23
- //# sourceMappingURL=updateReadme.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"updateReadme.js","sourceRoot":"","sources":["../../../src/tools/create/updateReadme.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,KAAK,EAAE,MAAM,IAAI,CAAC;AACzB,OAAO,IAAI,MAAM,MAAM,CAAC;AACxB,OAAO,EAAE,SAAS,EAAE,MAAM,MAAM,CAAC;AAGjC,MAAM,MAAM,GAAG,SAAS,CAAC,EAAE,CAAC,MAAM,CAAC,CAAC;AAEpC,MAAM,CAAC,KAAK,UAAU,YAAY,CAAC,OAAoB;IACnD,MAAM,UAAU,GAAG,IAAI,CAAC,IAAI,CAAC,OAAO,CAAC,eAAe,IAAI,EAAE,EAAE,YAAY,CAAC,CAAC;IAE1E,IAAI,CAAC;QACD,MAAM,MAAM,CAAC,UAAU,EAAE,EAAE,CAAC,SAAS,CAAC,IAAI,CAAC,CAAC;IAChD,CAAC;IAAC,OAAO,GAAG,EAAE,CAAC;QACX,IAAI,GAAG,YAAY,KAAK,EAAE,CAAC;YACvB,OAAO,CAAC,KAAK,CAAC,oCAAoC,EAAE,KAAK,CAAC,GAAG,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC,CAAC;YAC7E,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;QACpB,CAAC;aAAM,CAAC;YACJ,MAAM,GAAG,CAAC;QACd,CAAC;IACL,CAAC;IAED,MAAM,MAAM,GAAG,EAAE,CAAC,YAAY,CAAC,UAAU,CAAC,CAAC,QAAQ,EAAE,CAAC;IAEtD,EAAE,CAAC,aAAa,CAAC,UAAU,EAAE,MAAM,CAAC,OAAO,CAAC,IAAI,MAAM,CAAC,gBAAgB,EAAE,GAAG,CAAC,EAAE,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC;AAClG,CAAC"}
@@ -1,23 +0,0 @@
1
- export interface CreateBase {
2
- name: string;
3
- key: string;
4
- description: string;
5
- shortName: string;
6
- path: string;
7
- git: boolean;
8
- install: boolean;
9
- templateName: string;
10
- }
11
- export interface TemplateDir extends CreateBase {
12
- targetDirectory?: string;
13
- templateDirectory?: string;
14
- }
15
- export type AppOptions = CreateBase;
16
- export type PluginOptions = CreateBase;
17
- export type ModuleOptions = CreateBase;
18
- export interface Question {
19
- default?: string | boolean;
20
- message: string;
21
- name: string;
22
- type: string;
23
- }
@@ -1,2 +0,0 @@
1
- export {};
2
- //# sourceMappingURL=createTypes.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"createTypes.js","sourceRoot":"","sources":["../../src/types/createTypes.ts"],"names":[],"mappings":""}
File without changes
@@ -1,3 +0,0 @@
1
- * text=auto
2
- *.sh text eol=lf
3
- .env text eol=lf
@@ -1,54 +0,0 @@
1
- # Script copied from echopedia to make environment variables work in an app service. Using build folder instead of public folder.
2
- # The content of the .gitattributes file is needed so this script will work for both linux and windows.
3
-
4
- #!/bin/bash
5
-
6
- #https://www.freecodecamp.org/news/how-to-implement-runtime-environment-variables-with-create-react-app-docker-and-nginx-7f9d42a91d70/
7
- #
8
-
9
- # Recreate config file
10
- rm -rf ./env-config.js
11
- touch ./env-config.js
12
-
13
- echo "creating env-config.js"
14
-
15
- # Add assignment
16
- echo "window._env_ = {" >> ./env-config.js
17
-
18
- # Read each line in .env file
19
- # Each line represents key=value pairs
20
- while read -r line || [[ -n "$line" ]];
21
- do
22
- #only process lines containting =
23
- if [[ $line == *"="* ]]; then
24
-
25
- # Split env variables by character `=`
26
- if printf '%s\n' "$line" | grep -q -e '='; then
27
- varname=$(printf '%s\n' "$line" | sed -e 's/=.*//')
28
- varvalue=$(printf '%s\n' "$line" | sed -e 's/^[^=]*=//')
29
- fi
30
-
31
- # Read value of current variable if exists as Environment variable
32
- value=$(printf '%s\n' "${!varname}")
33
- # Otherwise use value from .env file
34
- [[ -z $value ]] && value=${varvalue}
35
-
36
- # Append configuration property to JS file
37
- echo " $varname: \"$value\"," >> ./env-config.js
38
-
39
- #print variables
40
- valueObfuscated=$(printf '%s' "$value" | cut -c 1-3)
41
- #echo " $varname: \"$value\"," #print the environment variables
42
- echo " $varname=\"$valueObfuscated***\"," #print the environment variables obfuscated
43
- fi
44
- done < .env
45
-
46
- echo "}" >> ./env-config.js
47
-
48
- #if directory exists, copy to public folder. Needed for dev enironment (npm start)
49
- if [ -d "build" ]; then
50
- rm -rf ./build/env-config.js
51
- cp ./env-config.js ./build/env-config.js
52
- fi
53
-
54
- echo "done creating env-config.js"
@@ -1,36 +0,0 @@
1
- {
2
- "name": "echo-app-template",
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.0 < 0.8.0",
17
- "@equinor/echo-components": ">= 0.11.1 < 0.12.0",
18
- "@equinor/echo-core": ">= 0.9.8 < 0.10.0",
19
- "@equinor/echo-search": ">= 0.15.3 < 0.16.0",
20
- "@equinor/echo-utils": ">= 0.4.1 < 0.5.0",
21
- "react": ">= 17.0.2",
22
- "react-dom": ">= 17.0.2"
23
- },
24
- "devDependencies": {
25
- "@equinor/echo-base": "0.7.3",
26
- "@equinor/echo-components": "0.11.16",
27
- "@equinor/echo-core": "0.9.12",
28
- "@equinor/echo-search": "0.15.8",
29
- "@equinor/echo-utils": "0.4.5",
30
- "@equinor/echo-cli": "0.14.18",
31
- "@types/react": "18.0.27",
32
- "@types/react-dom": "18.0.10",
33
- "react": "18.2.0",
34
- "react-dom": "18.2.0"
35
- }
36
- }
@@ -1,41 +0,0 @@
1
- ![logo](https://raw.githubusercontent.com/equinor/EchoCore/main/doc/ee.png)
2
-
3
- # Echo - %moduleName%
4
-
5
- This module has been bootstrapped by EchoCli.
6
-
7
- ### NPM
8
-
9
- ```sh-session
10
- $ npm install @equinor/echo-module-%moduleName% --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
- ```
@@ -1,5 +0,0 @@
1
- .wrapper {
2
- margin-top: 150px;
3
- padding: 16px;
4
- text-align: center;
5
- }
@@ -1,30 +0,0 @@
1
- import EchoCore, { EchoEnv } from '@equinor/echo-core';
2
- import React, { useEffect, useState } from 'react';
3
- import style from './app.module.css';
4
-
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
-
21
- return (
22
- <div className={style.wrapper}>
23
- <h1>Echo App Template</h1>
24
- <p>This is an app template for Echo Applications</p>
25
- <h6>Echo v{echoVersion}</h6>
26
- </div>
27
- );
28
- };
29
-
30
- export default App;
@@ -1,6 +0,0 @@
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
- }
@@ -1,25 +0,0 @@
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
-
File without changes
@@ -1,3 +0,0 @@
1
- * text=auto
2
- *.sh text eol=lf
3
- .env text eol=lf
@@ -1,54 +0,0 @@
1
- # Script copied from echopedia to make environment variables work in an app service. Using build folder instead of public folder.
2
- # The content of the .gitattributes file is needed so this script will work for both linux and windows.
3
-
4
- #!/bin/bash
5
-
6
- #https://www.freecodecamp.org/news/how-to-implement-runtime-environment-variables-with-create-react-app-docker-and-nginx-7f9d42a91d70/
7
- #
8
-
9
- # Recreate config file
10
- rm -rf ./env-config.js
11
- touch ./env-config.js
12
-
13
- echo "creating env-config.js"
14
-
15
- # Add assignment
16
- echo "window._env_ = {" >> ./env-config.js
17
-
18
- # Read each line in .env file
19
- # Each line represents key=value pairs
20
- while read -r line || [[ -n "$line" ]];
21
- do
22
- #only process lines containting =
23
- if [[ $line == *"="* ]]; then
24
-
25
- # Split env variables by character `=`
26
- if printf '%s\n' "$line" | grep -q -e '='; then
27
- varname=$(printf '%s\n' "$line" | sed -e 's/=.*//')
28
- varvalue=$(printf '%s\n' "$line" | sed -e 's/^[^=]*=//')
29
- fi
30
-
31
- # Read value of current variable if exists as Environment variable
32
- value=$(printf '%s\n' "${!varname}")
33
- # Otherwise use value from .env file
34
- [[ -z $value ]] && value=${varvalue}
35
-
36
- # Append configuration property to JS file
37
- echo " $varname: \"$value\"," >> ./env-config.js
38
-
39
- #print variables
40
- valueObfuscated=$(printf '%s' "$value" | cut -c 1-3)
41
- #echo " $varname: \"$value\"," #print the environment variables
42
- echo " $varname=\"$valueObfuscated***\"," #print the environment variables obfuscated
43
- fi
44
- done < .env
45
-
46
- echo "}" >> ./env-config.js
47
-
48
- #if directory exists, copy to public folder. Needed for dev enironment (npm start)
49
- if [ -d "build" ]; then
50
- rm -rf ./build/env-config.js
51
- cp ./env-config.js ./build/env-config.js
52
- fi
53
-
54
- echo "done creating env-config.js"
@@ -1,37 +0,0 @@
1
- {
2
- "name": "echo-app-template",
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
- "manifest": {},
16
- "peerDependencies": {
17
- "@equinor/echo-base": ">= 0.7.0 < 0.8.0",
18
- "@equinor/echo-components": ">= 0.11.1 < 0.12.0",
19
- "@equinor/echo-core": ">= 0.9.8 < 0.10.0",
20
- "@equinor/echo-search": ">= 0.15.3 < 0.16.0",
21
- "@equinor/echo-utils": ">= 0.4.1 < 0.5.0",
22
- "react": ">= 17.0.2",
23
- "react-dom": ">= 17.0.2"
24
- },
25
- "devDependencies": {
26
- "@equinor/echo-base": "0.7.3",
27
- "@equinor/echo-components": "0.11.16",
28
- "@equinor/echo-core": "0.9.12",
29
- "@equinor/echo-search": "0.15.8",
30
- "@equinor/echo-utils": "0.4.5",
31
- "@equinor/echo-cli": "0.14.18",
32
- "@types/react": "18.0.27",
33
- "@types/react-dom": "18.0.10",
34
- "react": "18.2.0",
35
- "react-dom": "18.2.0"
36
- }
37
- }
@@ -1,41 +0,0 @@
1
- ![logo](https://raw.githubusercontent.com/equinor/EchoCore/main/doc/ee.png)
2
-
3
- # Echo - %moduleName%
4
-
5
- This module has been bootstrapped by EchoCli.
6
-
7
- ### NPM
8
-
9
- ```sh-session
10
- $ npm install @equinor/echo-module-%moduleName% --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
- ```
@@ -1,5 +0,0 @@
1
- .wrapper {
2
- margin-top: 150px;
3
- padding: 16px;
4
- text-align: center;
5
- }
@@ -1,30 +0,0 @@
1
- import EchoCore, { EchoEnv } from '@equinor/echo-core';
2
- import React, { useEffect, useState } from 'react';
3
- import style from './app.module.css';
4
-
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
-
21
- return (
22
- <div className={style.wrapper}>
23
- <h1>Echo App Template</h1>
24
- <p>This is an app template for Echo Applications</p>
25
- <h6>Echo v{echoVersion}</h6>
26
- </div>
27
- );
28
- };
29
-
30
- export default App;
@@ -1,6 +0,0 @@
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
- }
@@ -1,25 +0,0 @@
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
-
@@ -1,36 +0,0 @@
1
- {
2
- "name": "echo-library-template",
3
- "version": "0.0.1",
4
- "description": "",
5
- "main": "build/index.js",
6
- "source": "src/index.ts",
7
- "scripts": {
8
- "build": "echo-build",
9
- "start": "echo-build -s -d"
10
- },
11
- "author": "",
12
- "license": "ISC",
13
- "manifest": {},
14
- "dependencies": {},
15
- "peerDependencies": {
16
- "@equinor/echo-base": ">= 0.7.0 < 0.8.0",
17
- "@equinor/echo-components": ">= 0.11.1 < 0.12.0",
18
- "@equinor/echo-core": ">= 0.9.8 < 0.10.0",
19
- "@equinor/echo-search": ">= 0.15.3 < 0.16.0",
20
- "@equinor/echo-utils": ">= 0.4.1 < 0.5.0",
21
- "react": ">= 17.0.2",
22
- "react-dom": " >= 17.0.2"
23
- },
24
- "devDependencies": {
25
- "@equinor/echo-base": "0.7.3",
26
- "@equinor/echo-components": "0.11.16",
27
- "@equinor/echo-core": "0.9.12",
28
- "@equinor/echo-search": "0.15.8",
29
- "@equinor/echo-utils": "0.4.5",
30
- "@equinor/echo-cli": "0.14.18",
31
- "@types/react": "18.0.27",
32
- "@types/react-dom": "18.0.10",
33
- "react": "18.2.0",
34
- "react-dom": "18.2.0"
35
- }
36
- }