jsql-neo 6.5.3 → 6.5.4

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
@@ -3,7 +3,7 @@
3
3
  > **One engine to rule them all** — a Rust-powered embedded database that speaks your language:
4
4
  > MySQL, PostgreSQL, MongoDB, Redis, SQL, TypeScript, **and the browser**.
5
5
 
6
- > **v6.5.3** — stable release · [github.com/vexify-org/JSQL-neo](https://github.com/vexify-org/JSQL-neo) · [jsql.vexify.top](https://jsql.vexify.top)
6
+ > **v6.5.4** — stable release · [github.com/vexify-org/JSQL-neo](https://github.com/vexify-org/JSQL-neo) · [jsql.vexify.top](https://jsql.vexify.top)
7
7
 
8
8
  ![Engines](https://img.shields.io/badge/engines-Native%20%7C%20WASM%20%7C%20Pure%20JS-7ee787)
9
9
  ![MySQL](https://img.shields.io/badge/protocol-MySQL%20compatible-1f6feb)
package/bin/jsql CHANGED
@@ -201,40 +201,40 @@ const cli = yaggs({ pkg: require('../package.json') })
201
201
  if (argv.reset) sn.setStarred(false);
202
202
  const c = sn.readConfig();
203
203
  if (c.starred) {
204
- console.log('Already confirmed starred (config: ' + sn.configPath() + ')');
205
- console.log('Run with --reset to re-check.');
204
+ console.log(`Already confirmed starred 已确认过: ${sn.configPath()}`);
205
+ console.log('Run with --reset to re-check · 用 --reset 重新检查');
206
206
  return;
207
207
  }
208
- console.log('Opening browser to confirm your star…');
208
+ console.log('Opening browser to confirm your star… 正在打开浏览器确认');
209
209
  const nonceUrl = sn.startOauthCheck(); // 打开浏览器 + 后台轮询写回 ~/.jsqlmr
210
210
  if (!process.stdout.isTTY) console.log(' ' + nonceUrl);
211
- console.log('After you authorize, this config is updated: ' + sn.configPath());
212
- console.log('Waiting for authorization (up to 3 minutes)…');
211
+ console.log(`Authorization updates this config 授权后写入配置: ${sn.configPath()}`);
212
+ console.log('Waiting for authorization (up to 3 minutes)… 等待授权(最多 3 分钟)…');
213
213
  // startOauthCheck 的定时器是 unref 的,命令必须自己前台等,否则接不到结果
214
214
  const res = sn.waitForResult(nonceUrl, 180000);
215
215
  const status = res && res.status;
216
216
  if (status === 'starred') {
217
217
  sn.setStarred(true);
218
- console.log(`Confirmed: ${res.login} has starred ${res.repo}. Thanks!`);
218
+ console.log(`Confirmed: ${res.login} starred ${res.repo} — thanks! 已确认,谢谢!`);
219
219
  return;
220
220
  }
221
221
  if (status === 'not-starred') {
222
- console.log(`Authorization finished, but ${res.login} has not starred ${res.repo} yet.`);
223
- console.log(`Star it at ${sn.URL} then run \`jsql star\` again.`);
222
+ console.log(`Not starred yet 还没 star: ${res.login} has not starred ${res.repo}`);
223
+ console.log(`Star it at ${sn.URL}, then run \`jsql star\` again · 点星后重跑 \`jsql star\``);
224
224
  return;
225
225
  }
226
226
  if (status === 'denied' || status === 'error') {
227
- // 这不是「没 star」,是授权本身没走通(code 过期、链接被重复打开、被拒绝)。
228
- // 老实现这里会把 login/repo 打印成 undefined,并让用户去 star —— 误导。
229
- console.log(`Authorization ${status === 'denied' ? 'was declined' : 'failed'}: ${res.error || 'unknown reason'}`);
230
- console.log('The link is single-use. Run `jsql star` again to get a fresh one.');
227
+ // 这不是「没 star」,是授权本身没走通(code 过期、链接被重复打开、被拒绝)
228
+ const why = status === 'denied' ? 'declined 被拒绝' : 'failed 失败';
229
+ console.log(`Authorization ${why}: ${res.error || 'unknown reason'}`);
230
+ console.log('The link is single-use — run `jsql star` again · 链接一次性,请重跑 `jsql star`');
231
231
  return;
232
232
  }
233
233
  if (status === 'expired') {
234
- console.log('The link expired. Run `jsql star` again to retry.');
234
+ console.log('The link expired 链接已过期 — run `jsql star` again · 请重跑');
235
235
  return;
236
236
  }
237
- console.log('Timed out. Run `jsql star` again to retry.');
237
+ console.log('Timed out 已超时 — run `jsql star` again · 请重跑');
238
238
  })
239
239
  .command('bench', 'Insert + query benchmark against a data directory', (sub) => {
240
240
  sub.option('n', { type: 'number', description: 'Number of rows (default 10000)' });
package/index.js CHANGED
@@ -1,5 +1,5 @@
1
1
  /**
2
- * JSQL-NEO v6.5.3 — Rust-Powered Embedded Database (WASM + HTTP)
2
+ * JSQL-NEO v6.5.4 — Rust-Powered Embedded Database (WASM + HTTP)
3
3
  *
4
4
  * @example
5
5
  * const jsql = require('jsql-neo');
package/lib/star-nag.js CHANGED
@@ -208,7 +208,7 @@ function nag(opts = {}) {
208
208
  }
209
209
 
210
210
  out.write(`\n If JSQL-NEO saved you time, a star helps others find it: ${URL}\n`);
211
- out.write(` Run \`jsql star\` to confirm and stop seeing this (or set JSQL_NO_STAR_NAG=1 to hide)\n\n`);
211
+ out.write(` 如果帮到了你,点个 star;运行 \`jsql star\` 确认 · JSQL_NO_STAR_NAG=1 关闭提示\n\n`);
212
212
 
213
213
  // 只记录「有没有 star」,不再写 lastNagAt —— 没有节流,写它没有意义。
214
214
  return true;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "jsql-neo",
3
- "version": "6.5.3",
3
+ "version": "6.5.4",
4
4
  "description": "JSQL-NEO — Rust-powered embedded database with WASM, REST API, B-Tree indexes, WAL, crash recovery",
5
5
  "main": "index.js",
6
6
  "types": "index.d.ts",
@@ -89,13 +89,13 @@ async function main() {
89
89
  console.log('\n--- 假 result.php 驱动真实 CLI ---');
90
90
  const cases = [
91
91
  ['done + starred', { state: 'done', result: { starred: true, login: 'octocat', repo: 'vexify-org/JSQL-neo' } },
92
- 'Confirmed: octocat has starred vexify-org/JSQL-neo. Thanks!'],
92
+ 'Confirmed: octocat starred vexify-org/JSQL-neo'],
93
93
  ['done + 未 star', { state: 'done', result: { starred: false, login: 'octocat', repo: 'vexify-org/JSQL-neo' } },
94
- 'Authorization finished, but octocat has not starred vexify-org/JSQL-neo yet.'],
94
+ 'Not starred yet 还没 star: octocat has not starred vexify-org/JSQL-neo'],
95
95
  ['denied', { state: 'denied', result: { error: 'access_denied' } },
96
- 'Authorization was declined: access_denied'],
96
+ 'Authorization declined 被拒绝: access_denied'],
97
97
  ['error(code 过期/复用)', { state: 'error', result: { error: 'The code passed is incorrect or expired.' } },
98
- 'Authorization failed: The code passed is incorrect or expired.'],
98
+ 'Authorization failed 失败: The code passed is incorrect or expired.'],
99
99
  ];
100
100
  for (const [name, resp, expect] of cases) {
101
101
  scenario = resp; pollsLeft = 0; after = null;
@@ -111,8 +111,8 @@ async function main() {
111
111
  pollsLeft = 2;
112
112
  after = { state: 'done', result: { starred: true, login: 'octocat', repo: 'vexify-org/JSQL-neo' } };
113
113
  const out = await runCli(path.join(mrDir, 'slow'));
114
- ok('等完 pending 后正确确认', out.includes('Confirmed: octocat has starred vexify-org/JSQL-neo. Thanks!'), out.trim().slice(0, 200));
115
- ok('全程没有误判成完成', !/Authorization finished/.test(out), out.trim().slice(0, 200));
114
+ ok('等完 pending 后正确确认', out.includes('Confirmed: octocat starred vexify-org/JSQL-neo'), out.trim().slice(0, 200));
115
+ ok('全程没有误判成完成', !/Not starred yet/.test(out), out.trim().slice(0, 200));
116
116
  ok('全程没有 undefined', !/undefined/.test(out), out.trim().slice(0, 200));
117
117
  }
118
118