@opentapd/tplugin-cli 0.39.0 → 0.39.1-alpha.1

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/cli.js CHANGED
@@ -89,13 +89,13 @@ program.command('encrypt <value>')
89
89
  .description('加密敏感变量')
90
90
  .action(actionRunner(value => require('./lib/encrypt')(value)));
91
91
 
92
- // resource 添加新的UI扩展模块
93
- program.command('resources')
94
- .description('添加扩展模块模板')
95
- .action(actionRunner(() => require('./lib/resources')()));
96
-
97
- // workspace 创建个人专属开发项目
98
92
  if (tpluginConf.tapd.pluginEnv !== 'cloud') {
93
+ // resource 添加新的UI扩展模块
94
+ program.command('resources')
95
+ .description('添加扩展模块模板')
96
+ .action(actionRunner(() => require('./lib/resources')()));
97
+
98
+ // workspace 创建个人专属开发项目
99
99
  program.command('workspace')
100
100
  .description('创建TAPD开发项目')
101
101
  .action(actionRunner(() => require('./lib/workspace')()));
package/lib/deploy.js CHANGED
@@ -261,7 +261,7 @@ async function deploy(branch, commit, code, { nick } = {}) {
261
261
  spinner.start('部署中... ...');
262
262
  let i = 0;
263
263
  // 轮训等待部署任务结果
264
- while (i++ < 60) {
264
+ while (i++ < 120) {
265
265
  let buildStatus = '';
266
266
  try {
267
267
  const { data } = await tapdsdk.request({ url: 'open_user_app/get_build_status', params: {
package/lib/serve.js CHANGED
@@ -65,6 +65,51 @@ module.exports = async () => {
65
65
  workspaceId = session.getConfig('companyId');
66
66
  }
67
67
 
68
+ if (tpluginConf.tapd.pluginEnv === 'cloud') {
69
+ //获取当前公司信息
70
+ const { data } = await tapdsdk.request({ url: 'open_user_app/get_company_info', params: {}, method: 'POST' });
71
+
72
+ //获取公司信息失败
73
+ if (!data.status || !data.data) {
74
+ spinner.fail("获取公司信息失败");
75
+ process.exit(1);
76
+ }
77
+
78
+
79
+ if(!data.data.is_test) {
80
+ spinner.info("当前企业不是测试企业");
81
+ const { data } = await tapdsdk.request({ url: 'open_user_app/get_test_deploy_company_option', params: {}, method: 'POST' });
82
+ if (!data.status || !data.data) {
83
+ spinner.fail("获取测试公司信息失败");
84
+ process.exit(1);
85
+ }
86
+
87
+ if(Array.isArray(data.data.data_list) && data.data.data_list.length === 0) {
88
+ const { createTestCompany } = await inquirer.prompt({
89
+ type: 'confirm',
90
+ message: '是否创建测试企业',
91
+ name: 'createTestCompany',
92
+ });
93
+
94
+ if (createTestCompany) {
95
+ spinner.info('开始创建测试企业');
96
+ const { data } = await tapdsdk.request({ url: 'open_user_app/register_test_company', params: {}, method: 'POST' });
97
+ if (!data.status) {
98
+ spinner.fail("创建测试企业失败");
99
+ process.exit(1);
100
+ }
101
+ spinner.succeed("创建测试企业成功,请重新登陆切换到测试企业");
102
+ process.exit(1);
103
+ } else {
104
+ spinner.info("请前往开放平台->开发者后台->应用测试创建测试企业");
105
+ process.exit(1);
106
+ }
107
+ } else {
108
+ spinner.fail("当前企业不是测试企业,请重新登陆切换到测试企业调试应用");
109
+ process.exit(1);
110
+ }
111
+ }
112
+ }
68
113
 
69
114
  console.log(`\n 进入调试空间: ${chalk.red(`${tpluginConf.tapd.tapdHost}/${workspaceId}`)}`);
70
115
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@opentapd/tplugin-cli",
3
- "version": "0.39.0",
3
+ "version": "0.39.1-alpha.1",
4
4
  "description": "tplugin-cli",
5
5
  "bin": {
6
6
  "tplugin-cli": "index.js"
@@ -78,5 +78,5 @@
78
78
  "node": ">=14.13.0"
79
79
  },
80
80
  "main": "index.js",
81
- "gitHead": "159fec2907a90f0d0d5a81f31cf4db9da9247c75"
81
+ "gitHead": "a75f75bc62555d69e3b39e1e179d62d6dee84070"
82
82
  }