@corva/create-app 0.28.0-1 → 0.28.0-5
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/common/node/gitignore +130 -0
- package/{templates/scheduler → common}/python/Makefile +0 -1
- package/common/python/gitignore +160 -0
- package/{templates/scheduler → common}/python/requirements.txt +0 -0
- package/lib/constants/manifest.js +1 -11
- package/lib/constants/package.js +150 -39
- package/lib/flows/lib/manifest.js +17 -1
- package/lib/helpers/manifest.js +10 -12
- package/lib/helpers/resolve-app-runtime.js +29 -0
- package/lib/helpers/utils.js +17 -17
- package/lib/index.js +145 -142
- package/package.json +3 -2
- package/templates/{scheduler/node → javascript/scheduler}/README.md +0 -0
- package/templates/{scheduler/node → javascript/scheduler}/__test__/processor.test.js +0 -0
- package/templates/{scheduler/node → javascript/scheduler}/index.js +0 -0
- package/templates/{scheduler/node → javascript/scheduler}/src/processor.js +0 -0
- package/templates/{stream/node → javascript/stream}/README.md +0 -0
- package/templates/{stream/node → javascript/stream}/__test__/processor.test.js +0 -0
- package/templates/{stream/node → javascript/stream}/index.js +0 -0
- package/templates/{stream/node → javascript/stream}/src/processor.js +0 -0
- package/templates/{task/node → javascript/task}/README.md +0 -0
- package/templates/{task/node → javascript/task}/__test__/processor.test.js +0 -0
- package/templates/{task/node → javascript/task}/index.js +0 -0
- package/templates/{task/node → javascript/task}/src/processor.js +0 -0
- package/templates/{ui/js → javascript/ui}/.env +0 -0
- package/templates/{ui/js → javascript/ui}/.env.sample +0 -0
- package/templates/{ui/js → javascript/ui}/.eslintrc +0 -0
- package/templates/{ui/js → javascript/ui}/.prettierrc +0 -0
- package/templates/{ui/js → javascript/ui}/README.md +0 -0
- package/templates/{ui/js → javascript/ui}/config-overrides.js +0 -0
- package/templates/{ui/js → javascript/ui}/gitignore +0 -0
- package/templates/{ui/js → javascript/ui}/src/App.css +0 -0
- package/templates/{ui/js → javascript/ui}/src/App.js +0 -0
- package/templates/{ui/js → javascript/ui}/src/AppSettings.js +0 -0
- package/templates/{ui/js → javascript/ui}/src/assets/logo.svg +0 -0
- package/templates/{ui/js → javascript/ui}/src/constants.js +0 -0
- package/templates/{ui/js → javascript/ui}/src/index.js +0 -0
- package/templates/{scheduler/python → python/scheduler}/README.md +0 -0
- package/templates/{scheduler/python → python/scheduler}/lambda_function.py +0 -0
- package/templates/{scheduler/python → python/scheduler}/test/__init__.py +0 -0
- package/templates/{scheduler/python → python/scheduler}/test/app_test.py +0 -0
- package/templates/{stream/python → python/stream}/README.md +0 -0
- package/templates/{stream/python → python/stream}/lambda_function.py +0 -0
- package/templates/{stream/python → python/stream}/test/__init__.py +0 -0
- package/templates/{stream/python → python/stream}/test/app_test.py +0 -0
- package/templates/{task/python → python/task}/README.md +0 -0
- package/templates/{task/python → python/task}/lambda_function.py +0 -0
- package/templates/{task/python → python/task}/test/__init__.py +0 -0
- package/templates/{task/python → python/task}/test/app_test.py +0 -0
- package/templates/{scheduler/node-ts → typescript/scheduler}/README.md +0 -0
- package/templates/{scheduler/node-ts → typescript/scheduler}/__test__/processor.spec.ts +0 -0
- package/templates/{scheduler/node-ts → typescript/scheduler}/index.ts +0 -0
- package/templates/{scheduler/node-ts → typescript/scheduler}/lib/processor.ts +0 -0
- package/templates/{stream/node-ts → typescript/stream}/README.md +0 -0
- package/templates/{stream/node-ts → typescript/stream}/__test__/processor.spec.ts +0 -0
- package/templates/{stream/node-ts → typescript/stream}/index.ts +0 -0
- package/templates/{stream/node-ts → typescript/stream}/lib/processor.ts +0 -0
- package/templates/{task/node-ts → typescript/task}/README.md +0 -0
- package/templates/{task/node-ts → typescript/task}/__test__/processor.spec.ts +0 -0
- package/templates/{task/node-ts → typescript/task}/index.ts +0 -0
- package/templates/{task/node-ts → typescript/task}/src/processor.ts +0 -0
- package/templates/{ui/ts → typescript/ui}/.env +0 -0
- package/templates/{ui/ts → typescript/ui}/.env.sample +0 -0
- package/templates/{ui/ts → typescript/ui}/.eslintrc +0 -0
- package/templates/{ui/ts → typescript/ui}/.prettierrc +0 -0
- package/templates/{ui/ts → typescript/ui}/README.md +0 -0
- package/templates/{ui/ts → typescript/ui}/config-overrides.js +0 -0
- package/templates/{ui/ts → typescript/ui}/gitignore +0 -0
- package/templates/{ui/ts → typescript/ui}/src/App.css +0 -0
- package/templates/{ui/ts → typescript/ui}/src/App.tsx +0 -0
- package/templates/{ui/ts → typescript/ui}/src/AppSettings.tsx +0 -0
- package/templates/{ui/ts → typescript/ui}/src/assets/logo.svg +0 -0
- package/templates/{ui/ts → typescript/ui}/src/constants.ts +0 -0
- package/templates/{ui/ts → typescript/ui}/src/custom.d.ts +0 -0
- package/templates/{ui/ts → typescript/ui}/src/index.js +0 -0
- package/templates/{ui/ts → typescript/ui}/tsconfig.json +0 -0
- package/templates/scheduler/node/gitignore +0 -21
- package/templates/scheduler/node/package.json +0 -17
- package/templates/scheduler/node-ts/gitignore +0 -25
- package/templates/scheduler/node-ts/lib/processor.js +0 -16
- package/templates/scheduler/node-ts/lib/processor.js.map +0 -1
- package/templates/scheduler/node-ts/package.json +0 -37
- package/templates/scheduler/node-ts/tsconfig.build.json +0 -11
- package/templates/scheduler/node-ts/tsconfig.json +0 -34
- package/templates/stream/node/gitignore +0 -21
- package/templates/stream/node/package.json +0 -17
- package/templates/stream/node-ts/gitignore +0 -25
- package/templates/stream/node-ts/package.json +0 -37
- package/templates/stream/node-ts/tsconfig.build.json +0 -11
- package/templates/stream/node-ts/tsconfig.json +0 -34
- package/templates/stream/python/Makefile +0 -15
- package/templates/stream/python/requirements.txt +0 -2
- package/templates/task/node/gitignore +0 -21
- package/templates/task/node/package.json +0 -17
- package/templates/task/node-ts/gitignore +0 -25
- package/templates/task/node-ts/package.json +0 -37
- package/templates/task/node-ts/tsconfig.build.json +0 -11
- package/templates/task/node-ts/tsconfig.json +0 -34
- package/templates/task/python/Makefile +0 -15
- package/templates/task/python/requirements.txt +0 -2
|
@@ -0,0 +1,130 @@
|
|
|
1
|
+
# Logs
|
|
2
|
+
logs
|
|
3
|
+
*.log
|
|
4
|
+
npm-debug.log*
|
|
5
|
+
yarn-debug.log*
|
|
6
|
+
yarn-error.log*
|
|
7
|
+
lerna-debug.log*
|
|
8
|
+
.pnpm-debug.log*
|
|
9
|
+
|
|
10
|
+
# Diagnostic reports (https://nodejs.org/api/report.html)
|
|
11
|
+
report.[0-9]*.[0-9]*.[0-9]*.[0-9]*.json
|
|
12
|
+
|
|
13
|
+
# Runtime data
|
|
14
|
+
pids
|
|
15
|
+
*.pid
|
|
16
|
+
*.seed
|
|
17
|
+
*.pid.lock
|
|
18
|
+
|
|
19
|
+
# Directory for instrumented libs generated by jscoverage/JSCover
|
|
20
|
+
lib-cov
|
|
21
|
+
|
|
22
|
+
# Coverage directory used by tools like istanbul
|
|
23
|
+
coverage
|
|
24
|
+
*.lcov
|
|
25
|
+
|
|
26
|
+
# nyc test coverage
|
|
27
|
+
.nyc_output
|
|
28
|
+
|
|
29
|
+
# Grunt intermediate storage (https://gruntjs.com/creating-plugins#storing-task-files)
|
|
30
|
+
.grunt
|
|
31
|
+
|
|
32
|
+
# Bower dependency directory (https://bower.io/)
|
|
33
|
+
bower_components
|
|
34
|
+
|
|
35
|
+
# node-waf configuration
|
|
36
|
+
.lock-wscript
|
|
37
|
+
|
|
38
|
+
# Compiled binary addons (https://nodejs.org/api/addons.html)
|
|
39
|
+
build/Release
|
|
40
|
+
|
|
41
|
+
# Dependency directories
|
|
42
|
+
node_modules/
|
|
43
|
+
jspm_packages/
|
|
44
|
+
|
|
45
|
+
# Snowpack dependency directory (https://snowpack.dev/)
|
|
46
|
+
web_modules/
|
|
47
|
+
|
|
48
|
+
# TypeScript cache
|
|
49
|
+
*.tsbuildinfo
|
|
50
|
+
|
|
51
|
+
# Optional npm cache directory
|
|
52
|
+
.npm
|
|
53
|
+
|
|
54
|
+
# Optional eslint cache
|
|
55
|
+
.eslintcache
|
|
56
|
+
|
|
57
|
+
# Optional stylelint cache
|
|
58
|
+
.stylelintcache
|
|
59
|
+
|
|
60
|
+
# Microbundle cache
|
|
61
|
+
.rpt2_cache/
|
|
62
|
+
.rts2_cache_cjs/
|
|
63
|
+
.rts2_cache_es/
|
|
64
|
+
.rts2_cache_umd/
|
|
65
|
+
|
|
66
|
+
# Optional REPL history
|
|
67
|
+
.node_repl_history
|
|
68
|
+
|
|
69
|
+
# Output of 'npm pack'
|
|
70
|
+
*.tgz
|
|
71
|
+
|
|
72
|
+
# Yarn Integrity file
|
|
73
|
+
.yarn-integrity
|
|
74
|
+
|
|
75
|
+
# dotenv environment variable files
|
|
76
|
+
.env
|
|
77
|
+
.env.development.local
|
|
78
|
+
.env.test.local
|
|
79
|
+
.env.production.local
|
|
80
|
+
.env.local
|
|
81
|
+
|
|
82
|
+
# parcel-bundler cache (https://parceljs.org/)
|
|
83
|
+
.cache
|
|
84
|
+
.parcel-cache
|
|
85
|
+
|
|
86
|
+
# Next.js build output
|
|
87
|
+
.next
|
|
88
|
+
out
|
|
89
|
+
|
|
90
|
+
# Nuxt.js build / generate output
|
|
91
|
+
.nuxt
|
|
92
|
+
dist
|
|
93
|
+
|
|
94
|
+
# Gatsby files
|
|
95
|
+
.cache/
|
|
96
|
+
# Comment in the public line in if your project uses Gatsby and not Next.js
|
|
97
|
+
# https://nextjs.org/blog/next-9-1#public-directory-support
|
|
98
|
+
# public
|
|
99
|
+
|
|
100
|
+
# vuepress build output
|
|
101
|
+
.vuepress/dist
|
|
102
|
+
|
|
103
|
+
# vuepress v2.x temp and cache directory
|
|
104
|
+
.temp
|
|
105
|
+
.cache
|
|
106
|
+
|
|
107
|
+
# Docusaurus cache and generated files
|
|
108
|
+
.docusaurus
|
|
109
|
+
|
|
110
|
+
# Serverless directories
|
|
111
|
+
.serverless/
|
|
112
|
+
|
|
113
|
+
# FuseBox cache
|
|
114
|
+
.fusebox/
|
|
115
|
+
|
|
116
|
+
# DynamoDB Local files
|
|
117
|
+
.dynamodb/
|
|
118
|
+
|
|
119
|
+
# TernJS port file
|
|
120
|
+
.tern-port
|
|
121
|
+
|
|
122
|
+
# Stores VSCode versions used for testing VSCode extensions
|
|
123
|
+
.vscode-test
|
|
124
|
+
|
|
125
|
+
# yarn v2
|
|
126
|
+
.yarn/cache
|
|
127
|
+
.yarn/unplugged
|
|
128
|
+
.yarn/build-state.yml
|
|
129
|
+
.yarn/install-state.gz
|
|
130
|
+
.pnp.*
|
|
@@ -0,0 +1,160 @@
|
|
|
1
|
+
# Byte-compiled / optimized / DLL files
|
|
2
|
+
__pycache__/
|
|
3
|
+
*.py[cod]
|
|
4
|
+
*$py.class
|
|
5
|
+
|
|
6
|
+
# C extensions
|
|
7
|
+
*.so
|
|
8
|
+
|
|
9
|
+
# Distribution / packaging
|
|
10
|
+
.Python
|
|
11
|
+
build/
|
|
12
|
+
develop-eggs/
|
|
13
|
+
dist/
|
|
14
|
+
downloads/
|
|
15
|
+
eggs/
|
|
16
|
+
.eggs/
|
|
17
|
+
lib/
|
|
18
|
+
lib64/
|
|
19
|
+
parts/
|
|
20
|
+
sdist/
|
|
21
|
+
var/
|
|
22
|
+
wheels/
|
|
23
|
+
share/python-wheels/
|
|
24
|
+
*.egg-info/
|
|
25
|
+
.installed.cfg
|
|
26
|
+
*.egg
|
|
27
|
+
MANIFEST
|
|
28
|
+
|
|
29
|
+
# PyInstaller
|
|
30
|
+
# Usually these files are written by a python script from a template
|
|
31
|
+
# before PyInstaller builds the exe, so as to inject date/other infos into it.
|
|
32
|
+
*.manifest
|
|
33
|
+
*.spec
|
|
34
|
+
|
|
35
|
+
# Installer logs
|
|
36
|
+
pip-log.txt
|
|
37
|
+
pip-delete-this-directory.txt
|
|
38
|
+
|
|
39
|
+
# Unit test / coverage reports
|
|
40
|
+
htmlcov/
|
|
41
|
+
.tox/
|
|
42
|
+
.nox/
|
|
43
|
+
.coverage
|
|
44
|
+
.coverage.*
|
|
45
|
+
.cache
|
|
46
|
+
nosetests.xml
|
|
47
|
+
coverage.xml
|
|
48
|
+
*.cover
|
|
49
|
+
*.py,cover
|
|
50
|
+
.hypothesis/
|
|
51
|
+
.pytest_cache/
|
|
52
|
+
cover/
|
|
53
|
+
|
|
54
|
+
# Translations
|
|
55
|
+
*.mo
|
|
56
|
+
*.pot
|
|
57
|
+
|
|
58
|
+
# Django stuff:
|
|
59
|
+
*.log
|
|
60
|
+
local_settings.py
|
|
61
|
+
db.sqlite3
|
|
62
|
+
db.sqlite3-journal
|
|
63
|
+
|
|
64
|
+
# Flask stuff:
|
|
65
|
+
instance/
|
|
66
|
+
.webassets-cache
|
|
67
|
+
|
|
68
|
+
# Scrapy stuff:
|
|
69
|
+
.scrapy
|
|
70
|
+
|
|
71
|
+
# Sphinx documentation
|
|
72
|
+
docs/_build/
|
|
73
|
+
|
|
74
|
+
# PyBuilder
|
|
75
|
+
.pybuilder/
|
|
76
|
+
target/
|
|
77
|
+
|
|
78
|
+
# Jupyter Notebook
|
|
79
|
+
.ipynb_checkpoints
|
|
80
|
+
|
|
81
|
+
# IPython
|
|
82
|
+
profile_default/
|
|
83
|
+
ipython_config.py
|
|
84
|
+
|
|
85
|
+
# pyenv
|
|
86
|
+
# For a library or package, you might want to ignore these files since the code is
|
|
87
|
+
# intended to run in multiple environments; otherwise, check them in:
|
|
88
|
+
# .python-version
|
|
89
|
+
|
|
90
|
+
# pipenv
|
|
91
|
+
# According to pypa/pipenv#598, it is recommended to include Pipfile.lock in version control.
|
|
92
|
+
# However, in case of collaboration, if having platform-specific dependencies or dependencies
|
|
93
|
+
# having no cross-platform support, pipenv may install dependencies that don't work, or not
|
|
94
|
+
# install all needed dependencies.
|
|
95
|
+
#Pipfile.lock
|
|
96
|
+
|
|
97
|
+
# poetry
|
|
98
|
+
# Similar to Pipfile.lock, it is generally recommended to include poetry.lock in version control.
|
|
99
|
+
# This is especially recommended for binary packages to ensure reproducibility, and is more
|
|
100
|
+
# commonly ignored for libraries.
|
|
101
|
+
# https://python-poetry.org/docs/basic-usage/#commit-your-poetrylock-file-to-version-control
|
|
102
|
+
#poetry.lock
|
|
103
|
+
|
|
104
|
+
# pdm
|
|
105
|
+
# Similar to Pipfile.lock, it is generally recommended to include pdm.lock in version control.
|
|
106
|
+
#pdm.lock
|
|
107
|
+
# pdm stores project-wide configurations in .pdm.toml, but it is recommended to not include it
|
|
108
|
+
# in version control.
|
|
109
|
+
# https://pdm.fming.dev/#use-with-ide
|
|
110
|
+
.pdm.toml
|
|
111
|
+
|
|
112
|
+
# PEP 582; used by e.g. github.com/David-OConnor/pyflow and github.com/pdm-project/pdm
|
|
113
|
+
__pypackages__/
|
|
114
|
+
|
|
115
|
+
# Celery stuff
|
|
116
|
+
celerybeat-schedule
|
|
117
|
+
celerybeat.pid
|
|
118
|
+
|
|
119
|
+
# SageMath parsed files
|
|
120
|
+
*.sage.py
|
|
121
|
+
|
|
122
|
+
# Environments
|
|
123
|
+
.env
|
|
124
|
+
.venv
|
|
125
|
+
env/
|
|
126
|
+
venv/
|
|
127
|
+
ENV/
|
|
128
|
+
env.bak/
|
|
129
|
+
venv.bak/
|
|
130
|
+
|
|
131
|
+
# Spyder project settings
|
|
132
|
+
.spyderproject
|
|
133
|
+
.spyproject
|
|
134
|
+
|
|
135
|
+
# Rope project settings
|
|
136
|
+
.ropeproject
|
|
137
|
+
|
|
138
|
+
# mkdocs documentation
|
|
139
|
+
/site
|
|
140
|
+
|
|
141
|
+
# mypy
|
|
142
|
+
.mypy_cache/
|
|
143
|
+
.dmypy.json
|
|
144
|
+
dmypy.json
|
|
145
|
+
|
|
146
|
+
# Pyre type checker
|
|
147
|
+
.pyre/
|
|
148
|
+
|
|
149
|
+
# pytype static type analyzer
|
|
150
|
+
.pytype/
|
|
151
|
+
|
|
152
|
+
# Cython debug symbols
|
|
153
|
+
cython_debug/
|
|
154
|
+
|
|
155
|
+
# PyCharm
|
|
156
|
+
# JetBrains specific template is maintained in a separate JetBrains.gitignore that can
|
|
157
|
+
# be found at https://github.com/github/gitignore/blob/main/Global/JetBrains.gitignore
|
|
158
|
+
# and can be added to the global gitignore or merged into this file. For a more nuclear
|
|
159
|
+
# option (not recommended) you can uncomment the following to ignore the entire idea folder.
|
|
160
|
+
#.idea/
|
|
File without changes
|
|
@@ -69,14 +69,6 @@ const defaultDataAppPythonManifest = {
|
|
|
69
69
|
},
|
|
70
70
|
};
|
|
71
71
|
|
|
72
|
-
const defaultTimeSchedulerSettings = {
|
|
73
|
-
cron_string: '*/5 * * * *',
|
|
74
|
-
};
|
|
75
|
-
|
|
76
|
-
const defaultDepthSchedulerSettings = {
|
|
77
|
-
depth_milestone: 1,
|
|
78
|
-
};
|
|
79
|
-
|
|
80
72
|
const getManifestMandatoryKeys = (opts) => {
|
|
81
73
|
const keys = manifestOptions(opts.projectName).reduce((acc, option) => {
|
|
82
74
|
if (option.required) {
|
|
@@ -111,7 +103,7 @@ const SCHEDULER_TYPE_NATURAL_TIME = { name: 'Natural Time', value: 1 };
|
|
|
111
103
|
const SCHEDULER_TYPE_DATA_TIME = { name: 'Data Time', value: 2 };
|
|
112
104
|
const SCHEDULER_TYPE_DEPTH = { name: 'Date Depth', value: 4 };
|
|
113
105
|
|
|
114
|
-
const manifestOptions = (projectName) => [
|
|
106
|
+
const manifestOptions = (projectName = 'Corva Dev Center App') => [
|
|
115
107
|
{ name: 'developerName', message: 'Enter the Developer Name', default: 'O&G Company' },
|
|
116
108
|
{ name: 'developerIdentifier', message: 'Enter the Developer Identifier', default: 'oandgc' },
|
|
117
109
|
{
|
|
@@ -219,8 +211,6 @@ module.exports = {
|
|
|
219
211
|
defaultUIAppManifest,
|
|
220
212
|
defaultDataAppNodeManifest,
|
|
221
213
|
defaultDataAppPythonManifest,
|
|
222
|
-
defaultTimeSchedulerSettings,
|
|
223
|
-
defaultDepthSchedulerSettings,
|
|
224
214
|
manifestOptions,
|
|
225
215
|
getManifestMandatoryKeys,
|
|
226
216
|
SCHEDULER_TYPE_NATURAL_TIME,
|
package/lib/constants/package.js
CHANGED
|
@@ -1,41 +1,38 @@
|
|
|
1
|
-
const
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
'prop-types': '^15.6.1',
|
|
20
|
-
'react': '17.0.1',
|
|
21
|
-
'react-dom': '17.0.1',
|
|
22
|
-
},
|
|
23
|
-
};
|
|
1
|
+
const uiDependencies = {
|
|
2
|
+
'@corva/ui': 'latest',
|
|
3
|
+
'@material-ui/core': '4.11.2',
|
|
4
|
+
'@material-ui/icons': '4.9.1',
|
|
5
|
+
'@material-ui/lab': '4.0.0-alpha.57',
|
|
6
|
+
'@material-ui/pickers': '3.2.10',
|
|
7
|
+
'classnames': '2.2.6',
|
|
8
|
+
'corva-convert-units': '1.10.17',
|
|
9
|
+
'highcharts': '8.1.2',
|
|
10
|
+
'highcharts-react-official': '2.2.2',
|
|
11
|
+
'lodash': '^4.17.4',
|
|
12
|
+
'mapbox.js': '3.2.1',
|
|
13
|
+
'moment': '2.23.0',
|
|
14
|
+
'moment-timezone': '0.5.23',
|
|
15
|
+
'prop-types': '^15.6.1',
|
|
16
|
+
'react': '17.0.1',
|
|
17
|
+
'react-dom': '17.0.1',
|
|
18
|
+
}
|
|
24
19
|
|
|
25
|
-
const
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
20
|
+
const jsUiDevDependencies = {
|
|
21
|
+
'postcss-loader': '4.1.0',
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
const tsUiDevDependencies = {
|
|
25
|
+
'@tsconfig/create-react-app': '1.0.2',
|
|
26
|
+
'@types/material-ui': '0.21.9',
|
|
27
|
+
'@types/react': '^17.0.22',
|
|
28
|
+
'@types/react-dom': '^17.0.9',
|
|
29
|
+
'@typescript-eslint/eslint-plugin': '^4.31.2',
|
|
30
|
+
'@typescript-eslint/parser': '^4.31.2',
|
|
31
|
+
'ts-loader': '8.2.0',
|
|
32
|
+
'typescript': '^4.4.3',
|
|
36
33
|
};
|
|
37
34
|
|
|
38
|
-
const
|
|
35
|
+
const uiScripts = {
|
|
39
36
|
build: 'webpack --config=./config-overrides.js --mode production',
|
|
40
37
|
start: 'webpack-dev-server --config=./config-overrides.js --open --mode development',
|
|
41
38
|
zip: 'create-corva-app zip .',
|
|
@@ -43,8 +40,122 @@ const scripts = {
|
|
|
43
40
|
release: 'create-corva-app release .',
|
|
44
41
|
};
|
|
45
42
|
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
scripts,
|
|
43
|
+
const uiPackage = {
|
|
44
|
+
version: '0.0.1',
|
|
45
|
+
main: 'src/index.js',
|
|
46
|
+
scripts: uiScripts,
|
|
47
|
+
dependencies: uiDependencies,
|
|
48
|
+
devDependencies: jsUiDevDependencies
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
const tsUiPackage = {
|
|
52
|
+
...uiPackage,
|
|
53
|
+
devDependencies: tsUiDevDependencies
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
const nodeNpmScripts = {
|
|
57
|
+
"bundle": "create-corva-app zip .",
|
|
58
|
+
"test": "npm audit --production && npm run unit",
|
|
59
|
+
"unit": "jest --passWithNoTests"
|
|
50
60
|
};
|
|
61
|
+
|
|
62
|
+
const nodeDependencies = {
|
|
63
|
+
"@corva/node-sdk": "^6.2.0"
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
const nodeDevDependencies = {
|
|
67
|
+
"jest": "^27.5.1"
|
|
68
|
+
}
|
|
69
|
+
|
|
70
|
+
const nodeTsDevDependencies = {
|
|
71
|
+
"@types/jest": "^27.4.1",
|
|
72
|
+
"jest": "^27.5.1",
|
|
73
|
+
"ts-jest": "^27.1.4",
|
|
74
|
+
"typescript": "^4.6.3"
|
|
75
|
+
}
|
|
76
|
+
|
|
77
|
+
const nodeYarnScripts = {
|
|
78
|
+
...nodeNpmScripts,
|
|
79
|
+
"test": "yarn audit --groups dependencies && yarn unit",
|
|
80
|
+
}
|
|
81
|
+
|
|
82
|
+
const nodeTsScripts = {
|
|
83
|
+
...nodeNpmScripts,
|
|
84
|
+
"build": "tsc -p tsconfig.build.json",
|
|
85
|
+
}
|
|
86
|
+
|
|
87
|
+
const nodeTsYarnScripts = {
|
|
88
|
+
...nodeYarnScripts,
|
|
89
|
+
"build": "tsc -p tsconfig.build.json",
|
|
90
|
+
}
|
|
91
|
+
|
|
92
|
+
const nodeNpmPackage = {
|
|
93
|
+
version: '0.0.1',
|
|
94
|
+
main: 'index.js',
|
|
95
|
+
private: true,
|
|
96
|
+
dependencies: nodeDependencies,
|
|
97
|
+
devDependencies: nodeDevDependencies,
|
|
98
|
+
scripts: nodeNpmScripts
|
|
99
|
+
}
|
|
100
|
+
|
|
101
|
+
const nodeYarnPackage = {
|
|
102
|
+
...nodeNpmPackage,
|
|
103
|
+
scripts: nodeYarnScripts
|
|
104
|
+
}
|
|
105
|
+
|
|
106
|
+
const nodeTsNpmPackage = {
|
|
107
|
+
...nodeNpmPackage,
|
|
108
|
+
devDependencies: nodeTsDevDependencies,
|
|
109
|
+
scripts: nodeTsScripts
|
|
110
|
+
}
|
|
111
|
+
|
|
112
|
+
const nodeTsYarnPackage = {
|
|
113
|
+
...nodeTsNpmPackage,
|
|
114
|
+
scripts: nodeTsYarnScripts
|
|
115
|
+
}
|
|
116
|
+
|
|
117
|
+
const extendWithTsConfig = (package, version) => {
|
|
118
|
+
package.devDependencies = {
|
|
119
|
+
[`@tsconfig/node${version}`]: `^${version === '12' ? '1.0.9' : '1.0.1'}`,
|
|
120
|
+
...package.devDependencies,
|
|
121
|
+
};
|
|
122
|
+
|
|
123
|
+
return package;
|
|
124
|
+
}
|
|
125
|
+
|
|
126
|
+
const defaults = {
|
|
127
|
+
javascript: {
|
|
128
|
+
yarn: {
|
|
129
|
+
ui: () => uiPackage,
|
|
130
|
+
task: () => nodeYarnPackage,
|
|
131
|
+
scheduler: () => nodeYarnPackage,
|
|
132
|
+
stream: () => nodeYarnPackage
|
|
133
|
+
},
|
|
134
|
+
npm: {
|
|
135
|
+
ui: () => uiPackage,
|
|
136
|
+
task: () => nodeNpmPackage,
|
|
137
|
+
scheduler: () => nodeNpmPackage,
|
|
138
|
+
stream: () => nodeNpmPackage
|
|
139
|
+
},
|
|
140
|
+
},
|
|
141
|
+
typescript: {
|
|
142
|
+
yarn: {
|
|
143
|
+
ui: () => tsUiPackage,
|
|
144
|
+
task: ({ version }) => extendWithTsConfig(nodeTsYarnPackage, version),
|
|
145
|
+
scheduler: ({ version }) => extendWithTsConfig(nodeTsYarnPackage, version),
|
|
146
|
+
stream: ({ version }) => extendWithTsConfig(nodeTsYarnPackage, version)
|
|
147
|
+
},
|
|
148
|
+
npm: {
|
|
149
|
+
ui: () => tsUiPackage,
|
|
150
|
+
task: ({ version }) => extendWithTsConfig(nodeTsNpmPackage, version),
|
|
151
|
+
scheduler: ({ version }) => extendWithTsConfig(nodeTsNpmPackage, version),
|
|
152
|
+
stream: ({ version }) => extendWithTsConfig(nodeTsNpmPackage, version)
|
|
153
|
+
}
|
|
154
|
+
}
|
|
155
|
+
};
|
|
156
|
+
|
|
157
|
+
module.exports = {
|
|
158
|
+
getDefaultsForPackageJson: (manifest, runtime) => {
|
|
159
|
+
return defaults[runtime.language][runtime.packageManager][manifest.type](runtime);
|
|
160
|
+
}
|
|
161
|
+
}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
const { APP_TYPES, APP_RUNTIMES } = require('../../constants/cli');
|
|
1
|
+
const { APP_TYPES, APP_RUNTIMES, TEMPLATE_TYPES } = require('../../constants/cli');
|
|
2
2
|
|
|
3
3
|
const NODE_RUNTIMES = [APP_RUNTIMES.NODE12, APP_RUNTIMES.NODE14];
|
|
4
4
|
|
|
@@ -11,6 +11,18 @@ class Manifest {
|
|
|
11
11
|
return this.manifest.settings.runtime;
|
|
12
12
|
}
|
|
13
13
|
|
|
14
|
+
get type() {
|
|
15
|
+
return this.manifest.application.type
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
get name() {
|
|
19
|
+
return this.manifest.application.name
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
get description() {
|
|
23
|
+
return this.manifest.application.description
|
|
24
|
+
}
|
|
25
|
+
|
|
14
26
|
isNode() {
|
|
15
27
|
return NODE_RUNTIMES.includes(this.manifest.settings.runtime);
|
|
16
28
|
}
|
|
@@ -26,6 +38,10 @@ class Manifest {
|
|
|
26
38
|
isPython() {
|
|
27
39
|
return this.manifest.settings.runtime === APP_RUNTIMES.PYTHON3;
|
|
28
40
|
}
|
|
41
|
+
|
|
42
|
+
isScheduler() {
|
|
43
|
+
return this.manifest.application.type === APP_TYPES.SCHEDULER;
|
|
44
|
+
}
|
|
29
45
|
}
|
|
30
46
|
|
|
31
47
|
module.exports = { Manifest };
|
package/lib/helpers/manifest.js
CHANGED
|
@@ -34,7 +34,7 @@ function fillManifest(answers) {
|
|
|
34
34
|
settings: {
|
|
35
35
|
...defaultManifestProperties.settings,
|
|
36
36
|
runtime,
|
|
37
|
-
|
|
37
|
+
app: defaultAppSettings({
|
|
38
38
|
type: answers.appType,
|
|
39
39
|
schedulerType: answers.schedulerType,
|
|
40
40
|
cronString: answers.cronString,
|
|
@@ -63,19 +63,17 @@ function defaultAppSettings({ type, schedulerType, cronString, depthMilestone })
|
|
|
63
63
|
return {};
|
|
64
64
|
}
|
|
65
65
|
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
:
|
|
66
|
+
if (schedulerType === manifestConstants.SCHEDULER_TYPE_DEPTH.value) {
|
|
67
|
+
return {
|
|
68
|
+
scheduler_type: schedulerType,
|
|
69
|
+
depth_milestone: depthMilestone || 1
|
|
70
|
+
}
|
|
71
|
+
}
|
|
70
72
|
|
|
71
73
|
return {
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
cron_string: cronString,
|
|
76
|
-
depth_milestone: depthMilestone,
|
|
77
|
-
},
|
|
78
|
-
};
|
|
74
|
+
scheduler_type: schedulerType,
|
|
75
|
+
cron_string: cronString || '*/5 * * * *',
|
|
76
|
+
}
|
|
79
77
|
}
|
|
80
78
|
|
|
81
79
|
module.exports = {
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
const { APP_TYPES } = require("../constants/cli");
|
|
2
|
+
|
|
3
|
+
const resolveAppRuntime = (opts) => {
|
|
4
|
+
if (opts.appType === APP_TYPES.UI) {
|
|
5
|
+
return {
|
|
6
|
+
language: opts.useTypescript ? "typescript" : "javascript",
|
|
7
|
+
packageManager: opts.packageManager,
|
|
8
|
+
version: process.version.replace(/^v/, ""),
|
|
9
|
+
}
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
if (opts.runtime.startsWith('node')) {
|
|
13
|
+
const version = /nodejs(\d{2})\.x/.exec(opts.runtime)[1];
|
|
14
|
+
|
|
15
|
+
return {
|
|
16
|
+
language: opts.useTypescript ? "typescript" : "javascript",
|
|
17
|
+
packageManager: opts.packageManager,
|
|
18
|
+
version
|
|
19
|
+
}
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
return {
|
|
23
|
+
language: "python",
|
|
24
|
+
packageManager: 'pip',
|
|
25
|
+
version: '3.8'
|
|
26
|
+
}
|
|
27
|
+
};
|
|
28
|
+
|
|
29
|
+
module.exports = { resolveAppRuntime };
|
package/lib/helpers/utils.js
CHANGED
|
@@ -13,29 +13,29 @@ function copyFileSync(source, target) {
|
|
|
13
13
|
fs.writeFileSync(targetFile, fs.readFileSync(source));
|
|
14
14
|
}
|
|
15
15
|
|
|
16
|
-
function copyFolderRecursiveSync(
|
|
17
|
-
let files = [];
|
|
18
|
-
|
|
16
|
+
function copyFolderRecursiveSync(sourceFolder, targetFolder) {
|
|
19
17
|
//check if folder needs to be created or integrated
|
|
20
|
-
let targetFolder;
|
|
21
|
-
if (path.basename(source) !== excludeFolderName) {
|
|
22
|
-
targetFolder = path.join(target, path.basename(source));
|
|
23
|
-
} else targetFolder = target;
|
|
24
18
|
if (!fs.existsSync(targetFolder)) {
|
|
25
19
|
fs.mkdirSync(targetFolder);
|
|
26
20
|
}
|
|
27
21
|
|
|
22
|
+
if (!fs.lstatSync(sourceFolder).isDirectory()) {
|
|
23
|
+
return;
|
|
24
|
+
}
|
|
25
|
+
|
|
28
26
|
//copy
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
}
|
|
27
|
+
const items = fs.readdirSync(sourceFolder);
|
|
28
|
+
|
|
29
|
+
for (const item of items) {
|
|
30
|
+
const curSource = path.join(sourceFolder, item);
|
|
31
|
+
|
|
32
|
+
if (fs.lstatSync(curSource).isDirectory()) {
|
|
33
|
+
copyFolderRecursiveSync(curSource, path.join(targetFolder, item));
|
|
34
|
+
|
|
35
|
+
continue;
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
copyFileSync(curSource, targetFolder);
|
|
39
39
|
}
|
|
40
40
|
}
|
|
41
41
|
|