Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 5 additions & 5 deletions packages/cli/devkit/src/module/locale/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ export default {
autoUpdateZ: '检查到您本地版本为 {localVersion} , 自动为您升级到兼容版本 {autoZVersion} 中...',
autoInstall: '本地尚未安装 {name} ,正在执行自动安装...',
// install-one.js
importPkgError: '您传入的包名有误,请输入正确的包名,如: @opentiny/cli-toolkit-xxx,@opentiny/cli-plugin-xxx',
importPkgError: '您传入的包名有误,请输入正确的包名,如: @opentiny/tiny-toolkit-xxx,@opentiny/tiny-plugin-xxx',
installSuccess: '{name} 安装成功',
updateSuccess: '{name} 更新成功',
// utils.js
Expand All @@ -32,7 +32,7 @@ export default {
recommendInstall: '请执行 {icon} {installTip} 来升级模块',
includeUpdate: '包含以下更新:',
installError: '{name} 安装报错,请确认该package是否存在!',
getModuleErr: '{modulePath} 文件运行失败,请检查,错误信息如下:'
getModuleErr: '{modulePath} 文件运行失败,请检查,错误信息如下:',
},
en: {
autoUpdate: '{name} has set an automatic update and is excuting an update operation...',
Expand All @@ -41,7 +41,7 @@ export default {
autoInstall: '{name} has not been installed, performing an automatic installation...',
// install-one.js
importPkgError:
'Package name is incorrect. Please re-enter the correct package nameeg: @opentiny/cli-toolkit-xxx @opentiny/cli-plugin-xxx',
'Package name is incorrect. Please re-enter the correct package name, eg: @opentiny/tiny-toolkit-xxx, @opentiny/tiny-plugin-xxx',
installSuccess: '{name} install completed',
updateSuccess: '{name} update completed',
// utils.js
Expand All @@ -54,6 +54,6 @@ export default {
recommendInstall: 'Please execute {icon} {installTip} to upgrade the module',
includeUpdate: 'Include the following updates:',
installError: 'Install {name} package error, please confirm whether the package exists!',
getModuleErr: '{modulePath} failed to run, more details:'
}
getModuleErr: '{modulePath} failed to run, more details:',
},
};
20 changes: 10 additions & 10 deletions packages/cli/devkit/src/npm/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ const TIMEOUT = 5000;
// 未配置cnpmrc时默认使用淘宝镜像源
const defaultRegistries = {
registry: 'https://registry.npmmirror.com/',
'@opentiny:registry': 'https://registry.npmmirror.com/'
'@opentiny:registry': 'https://registry.npmmirror.com/',
};

/**
Expand Down Expand Up @@ -154,14 +154,14 @@ export function setCnpmrc(config: any) {
* 获取安装器
*/
export function getInstaller() {
return require.resolve('npminstall/bin/install.js')
return require.resolve('npminstall/bin/install.js');
}

/**
* 获取卸载器
*/
export function getUnInstaller() {
return require.resolve('npminstall/bin/uninstall.js')
return require.resolve('npminstall/bin/uninstall.js');
}

/**
Expand Down Expand Up @@ -200,14 +200,14 @@ export async function installDependencies(options?: NpmOption) {
* @param options
*/
export async function runInstall(installer: string, paths: any, options?: NpmOption) {
const cwd = process.cwd();
const cwd = (options || {}).cwd || process.cwd();
const cacheDir = getCacheDir();
// npm默认值
const option = _.defaults(options || {}, {
stdio: 'inherit',
registry: getRegistry(),
cwd,
china: true
china: true,
});

// 支持cnpmrc设置缓存目录
Expand Down Expand Up @@ -247,8 +247,8 @@ export async function runInstall(installer: string, paths: any, options?: NpmOpt
S: '-save',
D: '-save-dev',
O: '-save-optional',
E: '-save-exact'
}
E: '-save-exact',
},
})
);

Expand Down Expand Up @@ -281,7 +281,7 @@ export async function has(name: string, options?: NpmOption) {
const registry = getRegistry(name);
options = {
registry,
...options
...options,
};
const url = `${options.registry}${encodeURIComponent(name)}/latest`;
log.debug('check module has =%s', url);
Expand Down Expand Up @@ -323,7 +323,7 @@ export async function latest(name: string, options?: NpmOption): Promise<Package
options = {
registry,
version: 'latest',
...options
...options,
};
const url = `${options.registry}${encodeURIComponent(name)}/${options.version}`;
let data = null;
Expand Down Expand Up @@ -352,5 +352,5 @@ export default {
has,
getCnpmrc,
setCnpmrc,
runInstall
runInstall,
};
16 changes: 15 additions & 1 deletion packages/toolkits/pro/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@opentiny/tiny-toolkit-pro",
"version": "1.0.10",
"version": "1.0.15",
"description": "TinyPro 开箱即用的中后台前端/设计解决方案",
"main": "dist/index.js",
"typings": "dist/index.d.ts",
Expand Down Expand Up @@ -101,6 +101,20 @@
]
},
"changeLog": [
{
"version": "1.0.15",
"log": [
"fix: 修复体验类问题5个"
]
},
{
"version": "1.0.14",
"log": [
"fix: 修复vue模板不能正常启动的问题",
"fix: 菜单是否显示优化",
"fix: 优化国际化词条"
]
},
{
"version": "1.0.2",
"log": [
Expand Down
13 changes: 11 additions & 2 deletions packages/toolkits/pro/src/lib/init.ts
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,9 @@ const getProjectInfo = (): Promise<ProjectInfo> => {
{ name: '暂不配置服务端', value: false },
],
prefix: '*',
when: (answers) => answers.serverFramework !== ServerFrameworks.Skip,
when: (answers) =>
answers.framework === VUE_TEMPLATE_PATH &&
answers.serverFramework !== ServerFrameworks.Skip,
},
{
type: 'list',
Expand Down Expand Up @@ -255,6 +257,11 @@ const createProjectSync = (answers: ProjectInfo) => {
log.error('配置项目信息创失败');
}

// ng模板不开启mock以及服务
if (templatePath === NG_TEMPLATE_PATH) {
return;
}

// 如果不对接服务端,全部接口采用mock
if (!serverConfirm) {
try {
Expand Down Expand Up @@ -316,7 +323,9 @@ export const installDependencies = (answers: ProjectInfo) => {
console.log(
chalk.green(
`${chalk.yellow(
`$ cd ${name}/${serverFramework} && npm run dev`
serverFramework === ServerFrameworks.SpringCloud
? `请查看 ${name}/${serverFramework}/README_CN.md `
: `$ cd ${name}/${serverFramework} && npm run dev`
)} # 开启server开发环境`
)
);
Expand Down
6 changes: 3 additions & 3 deletions packages/toolkits/pro/template/server/eggJs/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
},
"scripts": {
"start": "npm run stop && npm run tsc && egg-scripts start --title=egg-server-tgc-trace-server --ignore-stderr",
"stop": "ets clean && egg-scripts stop --title=egg-server-tgc-trace-server",
"stop": "tsc -b --clean && egg-scripts stop --title=egg-server-tgc-trace-server",
"dev": "egg-bin dev --host 127.0.0.1 --port 7001",
"debug": "egg-bin debug",
"test-local": "egg-bin test",
Expand All @@ -18,7 +18,7 @@
"ci": "npm run lint && npm run cov && npm run tsc",
"autod": "autod",
"lint": "eslint . --ext .ts",
"clean": "ets clean"
"clean": "tsc -b --clean"
},
"dependencies": {
"bcrypt": "^5.1.0",
Expand All @@ -41,7 +41,7 @@
"eslint": "^6.7.2",
"eslint-config-egg": "^8.0.0",
"tslib": "^1.9.0",
"typescript": "^3.0.0"
"typescript": "^4.9.4"
},
"engines": {
"node": ">=8.9.0"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@
有两种方式可供选择:

* 通过下载安装本地简化版 CSE 搭建本地开发环境,下载链接:
* [CSE 1.0](https://support.huaweicloud.com/devg-servicestage/ss-devg-0034.html)下载完成,一键启动start.bat;
* [CSE 2.0](https://support.huaweicloud.com/devg-cse/cse_devg_0036.html),下载完成,一键启动cse.exe

* 使用[华为云微服务引擎(CSE)](https://support.huaweicloud.com/qs-cse/cse_qs_0002.html)
Expand Down