@shijiu/jsview-vue 0.9.247 → 0.9.248

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/README.md CHANGED
@@ -8,13 +8,13 @@ jsview-vue/test用于调试jsview-vue,需要在npm start之前运行npm ci安
8
8
 
9
9
  ``` git submodule update --init --recursive ```
10
10
 
11
- 2. 打包:
11
+ 2. 打包(为了自动管理版本号,所以不用npm pack):
12
12
 
13
- ``` npm pack ```
13
+ ``` npm run fast-pack 或 ./scripts/deploy-fast-pack.js```
14
14
 
15
- 3. 发布:
15
+ 3. 发布(为了自动管理版本号,所以不用npm publish):
16
16
 
17
- ``` npm deploy ```
17
+ ``` npm run fast-publish 或 ./scripts/deploy-fast-publish.js```
18
18
 
19
19
  4. 注意事项:
20
20
 
package/package.json CHANGED
@@ -1,14 +1,14 @@
1
1
  {
2
2
  "name": "@shijiu/jsview-vue",
3
- "version": "0.9.247",
3
+ "version": "0.9.248",
4
4
  "bin": {
5
5
  "jsview-post-build": "./scripts/jsview-post-build.js",
6
6
  "jsview-post-install": "./scripts/jsview-post-install.js",
7
7
  "jsview-install-local-packages": "./scripts/jsview-install-local-packages.js"
8
8
  },
9
9
  "scripts": {
10
- "fast-publish": "node ./scripts/deploy-update-version.js && npm publish --access=public --registry https://registry.npmjs.com",
11
- "fast-pack": "node ./scripts/deploy-update-version.js && node ./scripts/deploy-pre-pack.js"
10
+ "fast-publish": "node ./scripts/deploy-fast-publish.js",
11
+ "fast-pack": "node ./scripts/deploy-fast-pack.js"
12
12
  },
13
13
  "repository": "system/jsview-vue",
14
14
  "bugs": "http://gitlab.qcast.cn/system/jsview-vue/issues",
package/scripts/common.js CHANGED
@@ -1,7 +1,8 @@
1
1
  #!/usr/bin/env node
2
2
 
3
- const path = require("path");
4
3
  const fs = require("fs");
4
+ const path = require("path");
5
+ const readline = require('readline')
5
6
  const { execSync } = require('child_process');
6
7
 
7
8
  function updateVersion(projectDir, ignoreChanges)
@@ -37,6 +38,27 @@ function updateVersion(projectDir, ignoreChanges)
37
38
  console.info('\nUpdated version to ' + pkgPkgObj.version);
38
39
  }
39
40
 
41
+ async function syncReadIO(prompt) {
42
+ const input = readline.createInterface({
43
+ input: process.stdin,
44
+ output: process.stdout
45
+ });
46
+ input.on('SIGINT', function () {
47
+ console.error("Error: User cancelled.")
48
+ process.exit(1);
49
+ });
50
+
51
+ let ret;
52
+ input.question(prompt,
53
+ answer => {
54
+ input.close();
55
+ ret = answer;
56
+ });
57
+ for await (const line of input) {}
58
+
59
+ return ret;
60
+ }
61
+
40
62
  function cpSync(workDir, src, dest) {
41
63
  const exists = fs.existsSync(src);
42
64
  const stats = exists && fs.statSync(src);
@@ -87,7 +109,8 @@ function deleteFolderRecursive(path) {
87
109
  }
88
110
 
89
111
  module.exports = {
90
- updateVersion,
91
112
  cpSync,
92
- rmSync
113
+ rmSync,
114
+ syncReadIO,
115
+ updateVersion,
93
116
  }
@@ -3,8 +3,6 @@
3
3
  const { execSync } = require('child_process');
4
4
 
5
5
  function main() {
6
- console.log(process.argv)
7
-
8
6
  const options = {};
9
7
  options.projectDir = process.cwd();
10
8
 
@@ -1,18 +1,38 @@
1
1
  #!/usr/bin/env node
2
2
 
3
+ const readline = require('readline')
3
4
  const { execSync } = require('child_process');
5
+ const { syncReadIO } = require('./common');
4
6
 
5
- function main() {
6
- console.log(process.argv)
7
+ async function login() {
8
+ const password = await syncReadIO('\nPlease input password of qcast@npmjs.com: ');
9
+ if (!password) {
10
+ console.error("Error: Bad password.")
11
+ process.exit(1);
12
+ }
7
13
 
14
+ let cmdLine = 'npm-cli-login -u qcast -e support@qcast.cn -p ' + password;
15
+ console.info('Run [' + cmdLine + ']... ');
16
+ try {
17
+ ret = execSync(cmdLine, { stdio: 'inherit', stderr: 'inherit' });
18
+ } catch (err) {
19
+ console.error("Failed to exec npm-cli-login.")
20
+ console.error("If you are not you can install this command with `npm install -g npm-cli-login`.")
21
+ process.exit(1)
22
+ }
23
+ }
24
+
25
+ async function main() {
8
26
  const options = {};
9
27
  options.projectDir = process.cwd();
10
28
 
11
- let cmdLine = 'cd ' + options.projectDir + '&& node ./scripts/deploy-prepare.js';
29
+ cmdLine = 'cd ' + options.projectDir + '&& node ./scripts/deploy-prepare.js';
12
30
  console.info('Run [' + cmdLine + ']... ');
13
31
  execSync(cmdLine, { stdio: 'inherit', stderr: 'inherit' });
14
32
 
15
- cmdLine = 'cd ' + options.projectDir + '&& npm publish --access=public --registry https://registry.npmjs.com';
33
+ await login();
34
+
35
+ cmdLine = 'cd ' + options.projectDir + '&& npm publish --tag latest --access=public --registry https://registry.npmjs.com';
16
36
  console.info('Run [' + cmdLine + ']... ');
17
37
  execSync(cmdLine, { stdio: 'inherit', stderr: 'inherit' });
18
38
  }
@@ -2,9 +2,8 @@
2
2
 
3
3
  const fs = require('fs');
4
4
  const path = require('path');
5
- const readline = require('readline')
6
5
  const { execSync } = require('child_process');
7
- const { cpSync, updateVersion } = require('./common');
6
+ const { cpSync, syncReadIO, updateVersion } = require('./common');
8
7
 
9
8
  async function updateVersionWithPrompt() {
10
9
  const options = {};
@@ -14,27 +13,12 @@ async function updateVersionWithPrompt() {
14
13
  if (gitChanges) {
15
14
  console.log('Git changes:\n' + gitChanges);
16
15
 
17
- const input = readline.createInterface({
18
- input: process.stdin,
19
- output: process.stdout
20
- });
21
- input.on('SIGINT', function () {
16
+ const answer = await syncReadIO('Warning: Git working directory not clean, do you want to update version continue? [yes/NO]\n');
17
+ if (answer?.toLowerCase() === 'yes') {
18
+ updateVersion(options.projectDir, true);
19
+ } else {
22
20
  console.error("Error: User cancelled.")
23
21
  process.exit(1);
24
- });
25
-
26
- input.question('Warning: Git working directory not clean, do you want to update version continue? [yes/NO]\n',
27
- answer => {
28
- input.close();
29
- if (answer.toLowerCase() === 'yes') {
30
- updateVersion(options.projectDir, true);
31
- } else {
32
- console.error("Error: User cancelled.")
33
- process.exit(1);
34
- }
35
- });
36
- for await (const line of input) {
37
- return 0;
38
22
  }
39
23
  }
40
24
  }