@cloudbase/framework-plugin-low-code 1.0.3-alpha.5 → 1.0.3-alpha.8

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@cloudbase/framework-plugin-low-code",
3
- "version": "1.0.3-alpha.5",
3
+ "version": "1.0.3-alpha.8",
4
4
  "description": "云开发 Tencent CloudBase Framework Low Code Plugin,将低码配置生成完整项目并一键部署云开发资源。",
5
5
  "author": "yhsunshining@gmail.com",
6
6
  "homepage": "https://github.com/TencentCloudBase/cloudbase-framework#readme",
@@ -31,7 +31,7 @@
31
31
  "build": "tsc",
32
32
  "test": "jest",
33
33
  "link": "node scripts/link-packages.js",
34
- "postinstall": "node scripts/postinstall.js"
34
+ "preinstall": "node scripts/preinstall.js"
35
35
  },
36
36
  "bugs": {
37
37
  "url": "https://github.com/TencentCloudBase/cloudbase-framework/issues"
@@ -2,22 +2,22 @@ const spawn = require('cross-spawn');
2
2
  const fs = require('fs-extra');
3
3
  const path = require('path');
4
4
 
5
- const packageName = 'miniprogram-ci@^1.8.0';
6
- async function installDependencies(targetDir) {
5
+ const packageName = '';
6
+ function installDependencies(targetDir) {
7
7
  if (!process.env.CLOUDBASE_CIID) {
8
8
  return;
9
9
  }
10
10
 
11
11
  let yarnExists = false;
12
- try {
13
- let { stdout } = spawn.sync('yarn', ['-v']);
14
- let str = stdout.toString();
15
- if (Number(str.split('.')?.[0]) <= 1) {
16
- yarnExists = true;
17
- }
18
- } catch (e) {}
12
+ // try {
13
+ // let { stdout } = spawn.sync('yarn', ['-v']);
14
+ // let str = stdout.toString();
15
+ // if (Number(str.split('.')?.[0]) <= 1) {
16
+ // yarnExists = true;
17
+ // }
18
+ // } catch (e) {}
19
19
 
20
- const npmOptions = ['--prefer-offline', '--no-audit', '--progress=false'];
20
+ const npmOptions = ['--prefer-offline', '--no-audit', '--progress=false', '--production', '--no-package-lock'];
21
21
 
22
22
  let installProcess;
23
23
  // 云端构建, 选用 npm
@@ -27,17 +27,16 @@ async function installDependencies(targetDir) {
27
27
  stdio: 'inherit',
28
28
  };
29
29
 
30
- if (yarnExists && process.env.CLOUDBASE_CIID) {
30
+ if (yarnExists && !process.env.CLOUDBASE_CIID) {
31
31
  const addPackage = packageName ? ['add', packageName] : [];
32
32
 
33
- installProcess = spawn.sync('yarn', [...addPackage, registry], installlProcessOptions);
33
+ installProcess = spawn.sync('yarn', [...addPackage], installlProcessOptions);
34
34
  } else {
35
35
  installProcess = spawn.sync('npm', ['install', packageName, ...npmOptions], installlProcessOptions);
36
36
  }
37
37
 
38
38
  try {
39
- await fs.remove(path.join(path.join(targetDir, 'package-lock.json')));
40
- await fs.remove(path.join(path.join(targetDir, 'yarn.lock')));
39
+ fs.removeSync(path.join(path.join(targetDir, 'yarn.lock')));
41
40
  } catch (e) {}
42
41
  }
43
42
 
@@ -0,0 +1,14 @@
1
+ const fs = require('fs-extra');
2
+ const path = require('path');
3
+
4
+ function installDependencies(targetDir) {
5
+ if (!process.env.CLOUDBASE_CIID) {
6
+ return;
7
+ }
8
+
9
+ try {
10
+ fs.removeSync(path.join(path.join(targetDir, 'package-lock.json')));
11
+ } catch (e) {}
12
+ }
13
+
14
+ installDependencies(process.cwd());