@jayfong/x-server 2.11.2 → 2.12.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.
@@ -66,7 +66,7 @@ class DeployUtil {
66
66
  });
67
67
  await ssh.execCommand((0, _vtils.dedent)`
68
68
  set -ex
69
- curl --header "Content-Type: application/json" \\
69
+ curl --silent --header "Content-Type: application/json" \\
70
70
  --request "POST" \\
71
71
  --data ${JSON.stringify(JSON.stringify({
72
72
  token: options.token,
@@ -44,7 +44,7 @@ class EnvUtil {
44
44
  envs.push({
45
45
  key: key,
46
46
  value: this.normalizeValue(envObj[key]),
47
- comment: ((_src$match = src.match(new RegExp(`#\\s*(.+?)\\s*[\\r\\n]+\\s*${(0, _vtils.escapeRegExp)(key)}:`))) == null ? void 0 : _src$match[1]) || ''
47
+ comment: ((_src$match = src.match(new RegExp(`((#\\s*(.+?)\\s*[\\r\\n]+)+)\\s*${(0, _vtils.escapeRegExp)(key)}:`))) == null ? void 0 : _src$match[1].replace(/^#/gm, '').trim()) || ''
48
48
  });
49
49
  });
50
50
  } else {
@@ -166,10 +166,16 @@ class EnvUtil {
166
166
  return (0, _vtils.dedent)`
167
167
  declare namespace NodeJS {
168
168
  interface ProcessEnv {
169
- /** 当前环境 */
169
+ /**
170
+ * 当前环境
171
+ */
170
172
  NODE_ENV: 'development' | 'production';
171
173
  ${envs.map(env => (0, _vtils.dedent)`
172
- ${env.comment ? `/** ${env.comment} */` : ''}
174
+ ${env.comment ? (0, _vtils.dedent)`
175
+ /**
176
+ ${env.comment.split(/[\r\n]+/g).map(line => `* ${line.trim()}`).join('\n*\n')}
177
+ */
178
+ ` : ''}
173
179
  ${env.key}: ${// TODO: 优化类型推断
174
180
  Array.isArray(env.value) ? `Array<${typeof env.value[0]}>` : typeof env.value};
175
181
  `).join('\n')}
@@ -54,7 +54,7 @@ export class DeployUtil {
54
54
  });
55
55
  await ssh.execCommand(dedent`
56
56
  set -ex
57
- curl --header "Content-Type: application/json" \\
57
+ curl --silent --header "Content-Type: application/json" \\
58
58
  --request "POST" \\
59
59
  --data ${JSON.stringify(JSON.stringify({
60
60
  token: options.token,
@@ -33,7 +33,7 @@ export class EnvUtil {
33
33
  envs.push({
34
34
  key: key,
35
35
  value: this.normalizeValue(envObj[key]),
36
- comment: ((_src$match = src.match(new RegExp(`#\\s*(.+?)\\s*[\\r\\n]+\\s*${escapeRegExp(key)}:`))) == null ? void 0 : _src$match[1]) || ''
36
+ comment: ((_src$match = src.match(new RegExp(`((#\\s*(.+?)\\s*[\\r\\n]+)+)\\s*${escapeRegExp(key)}:`))) == null ? void 0 : _src$match[1].replace(/^#/gm, '').trim()) || ''
37
37
  });
38
38
  });
39
39
  } else {
@@ -152,10 +152,16 @@ export class EnvUtil {
152
152
  return dedent`
153
153
  declare namespace NodeJS {
154
154
  interface ProcessEnv {
155
- /** 当前环境 */
155
+ /**
156
+ * 当前环境
157
+ */
156
158
  NODE_ENV: 'development' | 'production';
157
159
  ${envs.map(env => dedent`
158
- ${env.comment ? `/** ${env.comment} */` : ''}
160
+ ${env.comment ? dedent`
161
+ /**
162
+ ${env.comment.split(/[\r\n]+/g).map(line => `* ${line.trim()}`).join('\n*\n')}
163
+ */
164
+ ` : ''}
159
165
  ${env.key}: ${// TODO: 优化类型推断
160
166
  Array.isArray(env.value) ? `Array<${typeof env.value[0]}>` : typeof env.value};
161
167
  `).join('\n')}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@jayfong/x-server",
3
- "version": "2.11.2",
3
+ "version": "2.12.1",
4
4
  "license": "ISC",
5
5
  "sideEffects": false,
6
6
  "main": "lib/_cjs/index.js",