@ corva/ 创建- app
应用程序生成器用于 科瓦.艾岛。 。 。 .
先决条件
- 节点: js 24.22.2或更新(https://nodejs.org/en/download/ (中文(简体) )(中文(简体) )
安装
npm i -g @corva/create-app
使用量
corva-create-app 提供方便用户的 CLI 向导以创建应用程序 .
Usage: create-corva-app [options] [command]
Options:
-h, --help display help for command
Commands:
create [options] [project-directory] Create a new app
zip [options] <project-directory> [patterns...] Bundle app
release [options] <project-directory> [patterns...] Release app
rerun [options] <project-directory> Rerun app
attach [options] <project-directory> Add app to live assets streams
help [command] display help for command
创建应用程序
创建新应用 create 命令.
Usage: create-corva-app create <project-directory> [options]
Create a new app
Arguments:
project-directory Project directory to work with (default: "Current working dir")
Options:
--developerName [string] Enter the Developer Name (default: "O&G Company")
--developerIdentifier [string] Enter the Developer Identifier (default: "oandgc")
--appType Choose the App Type (choices: "ui", "scheduler", "stream", "task")
--schedulerType Choose the scheduler type (choices: "1", "2", "4")
--cronString [string] Provide CRON string for the scheduler (default: "*/5 * * * *")
--depthMilestone [number] Provide depth milestone for the scheduler (default: 1)
--logType Choose the log type (choices: "time", "depth")
--appName [string] Enter the App Name (default: "Corva Dev Center App")
--description [string] Enter description (default: "This is the description of my app. You can do great things with it!")
--summary [string] Enter summary (default: "More information about this app goes here")
--category [string] Enter category (default: "")
--website [string] Enter website (default: "https://www.oandgexample.com/my-app/")
--segments Choose segments (choices: "drilling", "completion")
--runtime Choose runtime (choices: "ui", "nodejs24.x", "python3.14", "python3.13")
-p, --packageManager Please select the desired package manager (choices: "yarn", "npm")
-t, --useTypescript [boolean] Would you like to use TypesScript? (default: false)
--silent [boolean] Only log result of the operation (default: false)
--no-dependencies-install Skip installing dependencies
--no-git-init Skip initializing git repository
实例
创建 UI 应用程序
create-corva-app test --appName "Test" --segments "drilling" --category "wellDesign" --appKey "some-company.test.ui" --appType "ui" --runtime "ui"
创建节点Js TypeScript应用程序
create-corva-app test --appName "Test" --segments "drilling" --category "wellDesign" --appKey "some-company.test.scheduler" --appType "scheduler" --runtime "nodejs24.x" -t
创建 Python 应用程序
create-corva-app test --appName "Test" --segments "drilling" --category "analytics" --appKey "some-company.test.stream" --appType "stream" --runtime "python3.14"
齐普
创建包含应用程序的zip, 准备用于 Corva 用途 zip 命令.
Usage: create-corva-app zip [options] <project-directory> [patterns...]
Bundle app
Arguments:
project-directory Project directory to work with
patterns Additional patterns to zip (default: [])
Options:
--bump-version <string> Bump version (choices: "major", "minor", "patch", "skip")
--ignored-files [ignoredFiles...] Patterns to skip zip
--silent [boolean] Only log result of the operation (default: false)
什么是得到拉链?
默认情况下将包含下一份文件 .
对于 frontend 应用程序 :
manifest.jsonpackage.jsonyarn.lock.npmrcconfig-overrides.js(网页软件)vite.config.mjsindex.htmldevApp.jsisolatedApp.jsvitest.setup.jsvitest.global-setup.js- 下方的所有文件
src - 下方的所有文件
config - 下方的所有文件
public tsconfig.json
对于写在 node数字 :
manifest.jsonpackage.json- 无论是
package-lock.json或者说yarn.lock - 下方的所有文件
config文件夹 - 全部
*.js文件在src财务报告和审定财务报表lib文件夹( 如果typescript未使用) tsconfig.json, (中文(简体) ),tsconfig.build.json(如果有的话)typescript用于)- 全部
*.ts文件在src财务报告和审定财务报表lib文件夹( 如果typescript用于)
对于写在 python数字 :
manifest.jsonpyproject.toml, (中文(简体) ),uv.lock(如果应用中存在)- 全部
*.py文件
如果您想要将一些未包含的文件绑定, 请通过 patterns 参数.
请使用 ziping 跳过一些文件 --ignored-files 选项.
实例
从内容创建 zip 文件 test-app 文件夹将zip文件放入其中( p) .
create-corva-app zip test-app
创建 zip 文件自动凸起版本( A)
create-corva-app zip test-app --bump-version=patch
从内容创建 zip 文件 test-app 有自定义内容的文件夹( x)缩写 支持)
create-corva-app zip test-app some/missing/file1 some/other/missing/file2 all/files/*.glob
释放
将应用推到 Corva 使用 release 命令.
Usage: create-corva-app release [options] <project-directory> [patterns...]
Release app
Arguments:
project-directory Project directory to work with
patterns Additional patterns to zip (default: [])
Options:
--bump-version <string> Bump version (choices: "major", "minor", "patch", "skip")
--ignored-files [string...] Patterns to skip zip (default: [])
--env [string] Environment to use (choices: "qa", "staging", "production", default: "qa")
--api-key [string] Pre generated API key for authorization during app upload
--app-key [string] Explicitly set appKey that CLI is going to use. Otherwise it will be taken from manifest.json file. [works only for Front-End apps currently]
--notes [string] Add custom notes to published app
--label [string] Put a label on the release (choices: "DEV", "BETA", "PROD")
--remove-on-fail [boolean] Remove release if it fails during deployment (default: false)
--silent [boolean] Only log result of the operation (default: false)
--remove-on-success App package (.zip) will not be deleted after upload (default: true)
--remove-existing [boolean] If package.json version is already taken - remove the previously published package and upload a new one (default: false)
--zip-file-name <string> Upload an existing ZIP without recreating it or bumping its version
--prebuilt Skip the Corva build for an existing ZIP (requires --zip-file-name)
--author [string] Author name for the audit
实例
释放本地制作的软件包
在您自己的 CI 中构建应用程序并安装其依赖性, 然后上传已准备的 ZIP :
create-corva-app release . --zip-file-name app-prebuilt.zip --prebuilt \
--env production --api-key "$CORVA_API_KEY" --label BETA --notes "Prebuilt release"
CLI 上传 ZIP 不变, 等待部署, 用请求的标签发布
和笔记。 它不构建,安装依赖,凸起版本,或删除所提供的ZIP.
无 --prebuilt,Corva使用其正常的构建过程,包括何时 --zip-file-name 提供.
保留 manifest.json 在项目目录中,以及 package.json javaScript 应用程序: CLI 使用
用于识别应用程序的文件 --remove-existing,它的版本。 他们必须符合ZIP.
设置最后的应用密钥和版本 在此之前 编译 FE 应用程序; 捆绑嵌入此身份 .
与 --prebuilt,CLI在联系Corva之前检查了ZIP结构和相关元数据.
它检查根表/应用元数据, FE app.js, JavaScript 包版本,和 Python 条目点和
安装依赖性布局。 重复和不安全的归档路径被拒绝 。 元数据文件为
每只限取一米B. 它不改写ZIP或核实进口、嵌入式FE身份或原生
依赖兼容性;部署和运行时间测试仍然需要.
ZIP 条目必须位于归档根上, 没有附加工程文件夹 :
- 菲欧:
manifest.json, (中文(简体) ),package.json,和内容dist/(包括app.js,块, 和任何所需资产)。 不包括dist/本身,源代码,node_modules/或离线镜. - Python BE: (英语)
manifest.json,在运算表的出入口路径上应用代码,requirements.txt,并在requirements/。 。 。 . 构建 Linux 和 Python 版本的依赖性和 CPU 架构在表单中声明; macOS或Windows依赖性可能不会运行于Lambda上. 包含所有运行时间依赖, 因为 Corva跳过依赖性安装.
预建上传仍然使用平台的上传和运行时间限制;这个选项不会增加它们.
发布并请求版本
create-corva-app release test-app
在不增加版本的情况下发布
create-corva-app release test-app --bump-version=skip
用增加的版本发布
create-corva-app release test-app --bump-version=patch
使用自定义版本发布
create-corva-app release test-app --bump-version=4.2.0
使用作者选项发布( 默认情况下它将使用您的 GitHub 用户名)
create-corva-app release test-app --author=MyName