cloudcc-cli 1.7.5 → 1.7.7

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
@@ -1,3 +1,18 @@
1
+ # ReleaseV1.7.7
2
+ #### 发布日期:2025-1-14
3
+ #### 发布范围:全量
4
+ #### 发布内容
5
+ * 优化
6
+ * 调整time到调度。
7
+
8
+ # ReleaseV1.7.6
9
+ #### 发布日期:2025-1-14
10
+ #### 发布范围:全量
11
+ #### 发布内容
12
+ * 优化
13
+ * 调整发布类获取token的逻辑。
14
+ * 调整发布组件截取data内容的逻辑。
15
+
1
16
  # ReleaseV1.7.5
2
17
  #### 发布日期:2025-1-13
3
18
  #### 发布范围:全量
package/bin/cc.js CHANGED
@@ -28,9 +28,10 @@ cc.plugin = require("../src/plugin/index")
28
28
 
29
29
  cc.classes = require("../src/classes/index")
30
30
 
31
- cc.timer = require("../src/timer/index")
31
+ cc.schedule = require("../src/timer/index")
32
32
 
33
33
  cc.triggers = require("../src/triggers/index")
34
+ cc.timer = require("../src/timer/index")
34
35
 
35
36
  cc.script = require("../src/script/index")
36
37
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "cloudcc-cli",
3
- "version": "1.7.5",
3
+ "version": "1.7.7",
4
4
  "description": "cloudcc-cli",
5
5
  "keywords": [
6
6
  "cloudcc",
package/src/object/get.js CHANGED
@@ -2,8 +2,7 @@ const { getBusToken } = require("../../utils/utils")
2
2
  const { postNormal } = require("../../utils/http")
3
3
 
4
4
 
5
- async function get(path = process.cwd()) {
6
-
5
+ async function get(path) {
7
6
  if (await getBusToken(path)) {
8
7
  let res = await postNormal(global.setupSvc + "/api/customObject/standardObjList")
9
8
  console.log(JSON.stringify(res.data))
@@ -4,7 +4,7 @@ const inquirer = require("inquirer")
4
4
  const { checkUpdate } = require("../../utils/checkVersion")
5
5
  const temp = `<template>
6
6
  <div class="cc-container">
7
- <div>Hello CloudCC</div>
7
+ <div>hello World</div>
8
8
  </div>
9
9
  </template>
10
10
 
@@ -9,16 +9,16 @@ const chalk = require("chalk")
9
9
  async function create(name) {
10
10
  const temp = `<template>
11
11
  <div class="cc-container">
12
- <div>{{ CloudCC }}</div>
12
+ <div>Hello</div>
13
13
  </div>
14
14
  </template>
15
15
 
16
16
  <script>
17
17
  export default {
18
18
  data() {
19
- return {
20
- CloudCC: "Hello CloudCC",
21
- };
19
+ return {
20
+ isLock: false,
21
+ }
22
22
  },
23
23
  };
24
24
  </script>
@@ -91,24 +91,9 @@ class Builder {
91
91
  console.log(chalk.yellow("Warning: The scoped attribute is missing in style, which may cause global style pollution. It is recommended to fix it。"));
92
92
  console.log()
93
93
  }
94
- vueData = vueData.match(/data\s*\(\s*\)\s*{\s*return\s*({[\s\S]*?})\s*;?\s*}/);
95
- if (vueData && vueData.length > 0) {
96
- vueData = vueData[1]
97
- }
98
- let data = {};
99
-
100
- try {
101
- data = eval(`(${vueData})`) || {};
102
- } catch (err) {
103
- console.log();
104
- console.log(chalk.red(
105
- "Error: Failed to parse data() in component. \n" +
106
- "Please check if there are any reference type variable in your data(). \n" +
107
- "Suggestion: Initialize external variables in created() lifecycle hook instead."
108
- ));
109
- console.log();
110
- return;
111
- }
94
+ vueData = vueData.split(/data\s*\(\s*\)/)[1].split(/isLock\s*:/)[0] + "isLock:false,};}";
95
+ vueData = "function data()" + vueData;
96
+ const data = eval(`(${vueData})`)()
112
97
 
113
98
  if (!data.propObj) {
114
99
  data.propObj = {};
@@ -12,7 +12,7 @@ async function create(argvs) {
12
12
  fs.mkdirSync(filePath, { recursive: true })
13
13
  const fileTmp =
14
14
  `function main($CCDK, obj){
15
- console.log("Hello CloudCC")
15
+ console.log("hello World")
16
16
  }`
17
17
  fs.writeFileSync(path.join(filePath, body.scriptName + ".js"), fileTmp)
18
18
  fs.writeFileSync(path.join(filePath, "config.json"), JSON.stringify(body))
@@ -6,11 +6,11 @@ const chalk = require("chalk")
6
6
  async function create(name) {
7
7
  let res = await checkUpdate();
8
8
  if (!res) {
9
- const timerPath = path.join(process.cwd(), "timer/" + name);
9
+ const timerPath = path.join(process.cwd(), "schedule/" + name);
10
10
  try {
11
11
  fs.mkdirSync(timerPath, { recursive: true })
12
12
  const javaTmp = `// @SOURCE_CONTENT_START
13
- System.out.print("hello CloudCC");
13
+ System.out.print("hello World");
14
14
  // @SOURCE_CONTENT_END`
15
15
  fs.writeFileSync(path.join(timerPath, name + ".java"), javaTmp)
16
16
  fs.writeFileSync(path.join(timerPath, "config.json"), `{"name":"${name}","version":"3"}`)
@@ -12,7 +12,7 @@ async function publish(name) {
12
12
  console.log();
13
13
  console.log(chalk.green('Posting, please wait...'));
14
14
  console.log();
15
- const timerPath = path.join(process.cwd(), `timer/${name}/`);
15
+ const timerPath = path.join(process.cwd(), `schedule/${name}/`);
16
16
  let fullContent = fs.readFileSync(timerPath + `${name}.java`, 'utf8');
17
17
 
18
18
  // 提取标记之间的内容
@@ -11,7 +11,7 @@ async function create(argvs) {
11
11
  try {
12
12
  fs.mkdirSync(triggersPath, { recursive: true })
13
13
  const javaTmp = `// @SOURCE_CONTENT_START
14
- System.out.print("hello CloudCC");
14
+ System.out.print("hello World");
15
15
  // @SOURCE_CONTENT_END`
16
16
  fs.writeFileSync(path.join(triggersPath, body.name + ".java"), javaTmp)
17
17
  fs.writeFileSync(path.join(triggersPath, "config.json"), JSON.stringify(body))
package/template/Appvue CHANGED
@@ -1,6 +1,6 @@
1
1
  <template>
2
2
  <div class="cc-container">
3
- <div>Hello CloudCC</div>
3
+ <div>hello World</div>
4
4
  </div>
5
5
  </template>
6
6
 
package/template/indexvue CHANGED
@@ -1,10 +1,10 @@
1
1
  <template>
2
- <div class="cc-container">
3
- <div>Hello CloudCC</div>
4
- </div>
5
- </template>
2
+ <div class="cc-container" >
3
+ <div>hello World </div>
4
+ </div>
5
+ </template>
6
6
 
7
- <script>
7
+ <script>
8
8
  export default {
9
9
  data() {
10
10
  return {
@@ -21,9 +21,9 @@ export default {
21
21
  },
22
22
  };
23
23
  </script>
24
- <style lang="scss" scoped>
25
- .cc-container {
26
- text-align: center;
24
+ < style lang = "scss" scoped >
25
+ .cc - container {
26
+ text - align: center;
27
27
  padding: 8px;
28
28
  background: goldenrod;
29
29
  }
package/utils/utils.js CHANGED
@@ -20,7 +20,7 @@ async function getBaseUrl(devConfig) {
20
20
  return;
21
21
  }
22
22
 
23
- if ('private' == devConfig.version) {
23
+ if (devConfig.baseUrl) {
24
24
  global.apiSvc = devConfig.baseUrl + (devConfig.apiSvcPrefix || "/apitfs")
25
25
  global.setupSvc = devConfig.baseUrl + (devConfig.setupSvcPrefix || "/setup")
26
26
  } else {
@@ -52,7 +52,6 @@ async function getBusToken(path = process.cwd()) {
52
52
  const cacheKey = devConfig.secretKey;
53
53
  const now = Date.now();
54
54
  const oneHour = 60 * 60 * 1000;
55
-
56
55
  // Check if cache is valid
57
56
  if (cache[cacheKey] &&
58
57
  cache[cacheKey].token &&
@@ -86,6 +85,8 @@ async function getBusToken(path = process.cwd()) {
86
85
  };
87
86
  writeCache(cache);
88
87
  return res.data.accessToken;
88
+ } else {
89
+ console.log(chalk.red(res.returnInfo));
89
90
  }
90
91
  return false;
91
92
  }