@maxtropy/create-isv-app
v0.1.2
Published
Interactive CLI for scaffolding Maxtropy ISV Vue micro frontend apps.
Downloads
458
Keywords
Readme
@maxtropy/create-isv-app
用于生成 Maxtropy ISV Vue 微前端子项目的交互式脚手架。
Usage
npm create @maxtropy/isv-appor:
npx @maxtropy/create-isv-app当前版本只支持逐步问答,不支持 --app-name、--target 等命令行参数。
If your local npm registry points to the company Nexus group and the package is
published to npmjs, check whether @maxtropy:registry is also configured:
npm config get @maxtropy:registryIf it points to Nexus, plain --registry is not enough because the scoped
registry has higher priority. Use one of these options.
One-off command:
npx --yes --@maxtropy:registry=https://registry.npmjs.org/ @maxtropy/create-isv-appor:
npm create --@maxtropy:registry=https://registry.npmjs.org/ @maxtropy/isv-appPermanent user config:
npm config set @maxtropy:registry https://registry.npmjs.org/Publish
This is a scoped public package. package.json includes:
{
"publishConfig": {
"access": "public"
}
}Publish with:
npm publishEquivalent one-off command:
npm publish --access publicIf the team wants to use the package through Nexus, publish or proxy it in the
Nexus npm repository first. Otherwise local installs using a Nexus registry will
fail with 404 Not Found.
Prompts
- 微前端 app key,必须以
ms-开头,后面跟两位小写字母,例如ms-ne - 项目目录名,默认根据 app key 自动生成
- 本地开发端口,默认根据现有
micro-main-ui本地端口自动推荐 - 代理前缀,默认
api,server
The local test target is derived from the app key:
https://portal.test.maxtropy.com/infra/{appName}/Generated Project
The generated app includes:
- Vue 3 + Vite 4 + TypeScript
- Pinia, Vue Router, Element Plus and Axios
@maxtropy/v-components@maxtropy/vite-plugin-isv-local- Micro frontend runtime setup with
microAppRewrite,microAppRouterHandle,withIsvErrorRoutesandvitePluginReplaceLocation - Axios request wrapper with 401
redirectToLogin - Blob export helper
.npmrcwith@maxtropy:registry=https://registry.npmjs.org/- Demo routes:
/demo/bordered-page/demo/plain-page
Shell Registration
The CLI does not edit micro-main-ui. After generation, add the printed
localSubAppUrls entry and, if needed, add the app to appList.
