cloudcc-cli 1.2.0 → 1.2.2

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/cookies.html ADDED
@@ -0,0 +1 @@
1
+ 1.2.1
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "cloudcc-cli",
3
- "version": "1.2.0",
3
+ "version": "1.2.2",
4
4
  "description": "cloudcc-cli",
5
5
  "keywords": [
6
6
  "cloudcc",
@@ -19,7 +19,8 @@
19
19
  "cloudccBuildTag": "bin/buildtag.js"
20
20
  },
21
21
  "scripts": {
22
- "publish-lib": "npm publish --registry https://registry.npmjs.org"
22
+ "cc-pull": "git fetch --tags -f && git pull",
23
+ "publish-lib": "npm publish --registry https://registry.npmjs.org && curl https://npmmirror.com/sync/cloudcc-cli"
23
24
  },
24
25
  "dependencies": {
25
26
  "axios": "^0.21.4",
@@ -25,7 +25,8 @@ class Creator {
25
25
  let res = await checkUpdate();
26
26
  if (!res) {
27
27
  console.log()
28
- console.log(chalk.green('欢迎使用Cloudcc-CLI'));
28
+ console.log(chalk.green('欢迎使用CloudCC-CLI'));
29
+ console.log()
29
30
  this.ask().then(answers => {
30
31
  this.options = Object.assign({}, this.options, answers);
31
32
  console.log(this.options);
@@ -48,7 +48,6 @@ class Publish {
48
48
  */
49
49
  async init() {
50
50
  // 检查cli版本,提示用户更新:false:不更新,true:更新
51
- // let update = false
52
51
  let update = await checkUpdate();
53
52
  if (!update) {
54
53
  // 1:版本发布信息,包含发布版本类型信息
@@ -96,13 +95,14 @@ class Publish {
96
95
 
97
96
  // 4:如果存在多语言配置,则更新多语言
98
97
  if (projectConfig.config && projectConfig.config["language-config"]) {
98
+ // 获得命令行多语言参数
99
99
  let i18n = this.args.get("language")
100
- // 如果不存在language那么需要询问是否需要发布版本
100
+ // 如果存在命令行参数,那么获取,否则询问
101
101
  if (!i18n) {
102
- // 询问是否更新多语言
103
102
  i18n = await askI18n()
104
103
  }
105
- if (i18n.checked === '1') {
104
+ // 如果选择为1,那么下载多语言
105
+ if ('1' === i18n || '1' === i18n.checked) {
106
106
  let laguage = projectConfig.config["language-config"]
107
107
  // 执行更新多语言文件
108
108
  await updatei18n(laguage)
@@ -19,7 +19,7 @@ const { notifyFeishu, notifyDingDing } = require("../utils/notifyIM")
19
19
  // 时间库
20
20
  const dayjs = require("dayjs")
21
21
  /**
22
- * 项目打包发布脚本
22
+ * H5项目打包发布脚本
23
23
  */
24
24
  class Publish {
25
25
  constructor() {
@@ -44,7 +44,6 @@ class Publish {
44
44
  */
45
45
  async init() {
46
46
  // 检查cli版本,提示用户更新:false:不更新,true:更新
47
- // let update = false
48
47
  let update = await checkUpdate();
49
48
  if (!update) {
50
49
  // 1:版本发布信息,包含发布版本类型信息
@@ -111,6 +110,7 @@ class Publish {
111
110
  console.log();
112
111
  // 打包命令
113
112
  try {
113
+ // /Applications/HBuilderX.app/Contents/MacOS/cli macos路径
114
114
  exec('cli.exe publish --platform h5 --project ' + projectConfig.name);
115
115
  console.log(chalk.green('编译成功!'));
116
116
  console.log();
package/template/httpjs CHANGED
@@ -1,6 +1,6 @@
1
- import VueCookies from "vue-cookies";
2
1
  import axios from 'axios'
3
2
  import packageJson from '../package.json'
3
+ import * as CCDK from "cloudcc-ccdk/lib/ccdk.min.js";
4
4
  const service = axios.create({
5
5
  timeout: 60000, // request timeout
6
6
  headers: {
@@ -8,10 +8,10 @@ const service = axios.create({
8
8
  },
9
9
  })
10
10
 
11
- // request interceptor
11
+ // request interceptor
12
12
  service.interceptors.request.use(
13
13
  config => {
14
- config.headers.accessToken = VueCookies.get("JSESSIONID")
14
+ config.headers.accessToken = CCDK.CCToken.getToken()
15
15
  return config
16
16
  },
17
17
  error => {
@@ -39,7 +39,7 @@ const formateData = data => {
39
39
  head: {
40
40
  appType: packageJson.name,
41
41
  appVersion: packageJson.version,
42
- accessToken: VueCookies.get("JSESSIONID")
42
+ accessToken: CCDK.CCToken.getToken()
43
43
  },
44
44
  body: {
45
45
  ...data
package/template/index.js CHANGED
@@ -24,6 +24,10 @@ module.exports = function (creator, options, callback) {
24
24
  name, description
25
25
  })
26
26
 
27
+ creator.copyTpl('package-lockjson', path.join(projectPath, "package-lock.json"), {
28
+ name, description
29
+ })
30
+
27
31
  creator.copyTpl('vueconfigjs', path.join(projectPath, "vue.config.js"))
28
32
 
29
33
  creator.copyTpl('babelconfigjs', path.join(projectPath, "babel.config.js"))
package/template/indexvue CHANGED
@@ -36,7 +36,6 @@ export default {
36
36
  bizType: "基础组件",
37
37
  compDesc: "常用的操作按钮。",
38
38
  /* 组件分类:
39
- * public: 公开组件(其他组织可见)
40
39
  * private:私有组件(自己组织可见)
41
40
  * beta:组件测试版本
42
41
  */