@dinoxx/dinox-cli 1.0.0

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.
Files changed (90) hide show
  1. package/README.md +294 -0
  2. package/dist/auth/userInfo.d.ts +14 -0
  3. package/dist/auth/userInfo.js +115 -0
  4. package/dist/cli.d.ts +2 -0
  5. package/dist/cli.js +32 -0
  6. package/dist/cliTypes.d.ts +6 -0
  7. package/dist/cliTypes.js +1 -0
  8. package/dist/commands/auth/index.d.ts +2 -0
  9. package/dist/commands/auth/index.js +193 -0
  10. package/dist/commands/boxes/index.d.ts +2 -0
  11. package/dist/commands/boxes/index.js +107 -0
  12. package/dist/commands/boxes/repo.d.ts +21 -0
  13. package/dist/commands/boxes/repo.js +154 -0
  14. package/dist/commands/config/index.d.ts +2 -0
  15. package/dist/commands/config/index.js +67 -0
  16. package/dist/commands/info/index.d.ts +2 -0
  17. package/dist/commands/info/index.js +20 -0
  18. package/dist/commands/notes/index.d.ts +2 -0
  19. package/dist/commands/notes/index.js +271 -0
  20. package/dist/commands/notes/repo.d.ts +70 -0
  21. package/dist/commands/notes/repo.js +674 -0
  22. package/dist/commands/notes/searchTime.d.ts +9 -0
  23. package/dist/commands/notes/searchTime.js +85 -0
  24. package/dist/commands/prompt/index.d.ts +2 -0
  25. package/dist/commands/prompt/index.js +51 -0
  26. package/dist/commands/prompt/repo.d.ts +6 -0
  27. package/dist/commands/prompt/repo.js +18 -0
  28. package/dist/commands/sync.d.ts +2 -0
  29. package/dist/commands/sync.js +68 -0
  30. package/dist/commands/tags/index.d.ts +2 -0
  31. package/dist/commands/tags/index.js +120 -0
  32. package/dist/commands/tags/repo.d.ts +14 -0
  33. package/dist/commands/tags/repo.js +247 -0
  34. package/dist/config/keys.d.ts +9 -0
  35. package/dist/config/keys.js +17 -0
  36. package/dist/config/paths.d.ts +4 -0
  37. package/dist/config/paths.js +39 -0
  38. package/dist/config/resolve.d.ts +2 -0
  39. package/dist/config/resolve.js +56 -0
  40. package/dist/config/serviceEndpoints.d.ts +3 -0
  41. package/dist/config/serviceEndpoints.js +3 -0
  42. package/dist/config/store.d.ts +5 -0
  43. package/dist/config/store.js +87 -0
  44. package/dist/config/types.d.ts +51 -0
  45. package/dist/config/types.js +1 -0
  46. package/dist/dinox.d.ts +2 -0
  47. package/dist/dinox.js +50 -0
  48. package/dist/powersync/connector.d.ts +21 -0
  49. package/dist/powersync/connector.js +58 -0
  50. package/dist/powersync/runtime.d.ts +37 -0
  51. package/dist/powersync/runtime.js +107 -0
  52. package/dist/powersync/schema/content.d.ts +76 -0
  53. package/dist/powersync/schema/content.js +76 -0
  54. package/dist/powersync/schema/index.d.ts +371 -0
  55. package/dist/powersync/schema/index.js +35 -0
  56. package/dist/powersync/schema/local.d.ts +68 -0
  57. package/dist/powersync/schema/local.js +83 -0
  58. package/dist/powersync/schema/note.d.ts +34 -0
  59. package/dist/powersync/schema/note.js +34 -0
  60. package/dist/powersync/schema/notesExtras.d.ts +62 -0
  61. package/dist/powersync/schema/notesExtras.js +71 -0
  62. package/dist/powersync/schema/projects.d.ts +101 -0
  63. package/dist/powersync/schema/projects.js +101 -0
  64. package/dist/powersync/schema/tags.d.ts +37 -0
  65. package/dist/powersync/schema/tags.js +37 -0
  66. package/dist/powersync/tokenIndex.d.ts +17 -0
  67. package/dist/powersync/tokenIndex.js +202 -0
  68. package/dist/powersync/uploader.d.ts +7 -0
  69. package/dist/powersync/uploader.js +134 -0
  70. package/dist/utils/argValue.d.ts +1 -0
  71. package/dist/utils/argValue.js +17 -0
  72. package/dist/utils/errors.d.ts +10 -0
  73. package/dist/utils/errors.js +17 -0
  74. package/dist/utils/id.d.ts +1 -0
  75. package/dist/utils/id.js +4 -0
  76. package/dist/utils/output.d.ts +2 -0
  77. package/dist/utils/output.js +10 -0
  78. package/dist/utils/redact.d.ts +1 -0
  79. package/dist/utils/redact.js +10 -0
  80. package/dist/utils/text.d.ts +1 -0
  81. package/dist/utils/text.js +35 -0
  82. package/dist/utils/time.d.ts +1 -0
  83. package/dist/utils/time.js +3 -0
  84. package/dist/utils/tiptapMarkdown.d.ts +6 -0
  85. package/dist/utils/tiptapMarkdown.js +149 -0
  86. package/dist/utils/tokenize.d.ts +1 -0
  87. package/dist/utils/tokenize.js +56 -0
  88. package/dist/utils/version.d.ts +1 -0
  89. package/dist/utils/version.js +21 -0
  90. package/package.json +63 -0
@@ -0,0 +1,56 @@
1
+ import { createRequire } from 'node:module';
2
+ const require = createRequire(import.meta.url);
3
+ let jiebaReady = false;
4
+ let jieba = null;
5
+ function ensureJiebaReady() {
6
+ if (!jieba) {
7
+ try {
8
+ jieba = require('nodejieba');
9
+ }
10
+ catch (error) {
11
+ const message = error instanceof Error ? error.message : String(error);
12
+ throw new Error(`Failed to load nodejieba module: ${message}`);
13
+ }
14
+ }
15
+ if (jiebaReady) {
16
+ return;
17
+ }
18
+ try {
19
+ jieba.load();
20
+ jiebaReady = true;
21
+ }
22
+ catch (error) {
23
+ const message = error instanceof Error ? error.message : String(error);
24
+ throw new Error(`Failed to initialize nodejieba: ${message}`);
25
+ }
26
+ }
27
+ function normalizeToken(token) {
28
+ const normalized = token.trim().toLowerCase();
29
+ if (!normalized) {
30
+ return '';
31
+ }
32
+ // Drop pure punctuation tokens.
33
+ if (/^[\p{P}\p{S}]+$/u.test(normalized)) {
34
+ return '';
35
+ }
36
+ return normalized;
37
+ }
38
+ export function tokenizeWithJieba(text, limit = 500) {
39
+ if (!text || limit <= 0) {
40
+ return [];
41
+ }
42
+ ensureJiebaReady();
43
+ const raw = jieba.cut(text, true);
44
+ const tokens = [];
45
+ for (const token of raw) {
46
+ const normalized = normalizeToken(token);
47
+ if (!normalized) {
48
+ continue;
49
+ }
50
+ tokens.push(normalized);
51
+ if (tokens.length >= limit) {
52
+ break;
53
+ }
54
+ }
55
+ return tokens;
56
+ }
@@ -0,0 +1 @@
1
+ export declare function getPackageVersion(): string;
@@ -0,0 +1,21 @@
1
+ import fs from 'node:fs';
2
+ import path from 'node:path';
3
+ import { fileURLToPath } from 'node:url';
4
+ function readPackageJson() {
5
+ const dirname = path.dirname(fileURLToPath(import.meta.url));
6
+ const pkgPath = path.resolve(dirname, '..', '..', 'package.json');
7
+ const raw = fs.readFileSync(pkgPath, 'utf8');
8
+ return JSON.parse(raw);
9
+ }
10
+ export function getPackageVersion() {
11
+ try {
12
+ const pkg = readPackageJson();
13
+ if (typeof pkg?.version === 'string' && pkg.version.trim()) {
14
+ return pkg.version.trim();
15
+ }
16
+ }
17
+ catch {
18
+ // ignore
19
+ }
20
+ return '0.0.0';
21
+ }
package/package.json ADDED
@@ -0,0 +1,63 @@
1
+ {
2
+ "name": "@dinoxx/dinox-cli",
3
+ "version": "1.0.0",
4
+ "description": "Dinox CLI",
5
+ "main": "dist/dinox.js",
6
+ "scripts": {
7
+ "build": "tsc -p tsconfig.json && node scripts/add-shebang.mjs",
8
+ "dev": "tsx src/dinox.ts",
9
+ "prepublishOnly": "npm run build",
10
+ "start": "node dist/dinox.js",
11
+ "test": "node --test --import tsx test/**/*.test.ts"
12
+ },
13
+ "keywords": [],
14
+ "author": "",
15
+ "license": "ISC",
16
+ "type": "module",
17
+ "bin": {
18
+ "dino": "dist/dinox.js",
19
+ "dinox": "dist/dinox.js"
20
+ },
21
+ "files": [
22
+ "dist"
23
+ ],
24
+ "publishConfig": {
25
+ "access": "public"
26
+ },
27
+ "engines": {
28
+ "node": ">=20"
29
+ },
30
+ "dependencies": {
31
+ "@powersync/common": "^1.0.0",
32
+ "@powersync/node": "^0.16.0",
33
+ "@tiptap/core": "^3.20.0",
34
+ "@tiptap/extension-image": "^3.20.0",
35
+ "@tiptap/extension-list": "^3.20.0",
36
+ "@tiptap/extension-table": "^3.20.0",
37
+ "@tiptap/extension-unique-id": "^3.20.0",
38
+ "@tiptap/markdown": "^3.20.0",
39
+ "@tiptap/starter-kit": "^3.20.0",
40
+ "better-sqlite3": "^12.6.2",
41
+ "commander": "^14.0.3",
42
+ "nodejieba": "^3.5.2",
43
+ "remark-gfm": "^4.0.1",
44
+ "remark-parse": "^11.0.0",
45
+ "remark-stringify": "^11.0.0",
46
+ "strip-markdown": "^6.0.0",
47
+ "unified": "^11.0.5",
48
+ "uuidv7": "^1.0.2",
49
+ "yaml": "^2.8.2"
50
+ },
51
+ "devDependencies": {
52
+ "@types/node": "^24.0.0",
53
+ "tsx": "^4.20.3",
54
+ "typescript": "^5.9.3"
55
+ },
56
+ "pnpm": {
57
+ "onlyBuiltDependencies": [
58
+ "better-sqlite3",
59
+ "esbuild",
60
+ "nodejieba"
61
+ ]
62
+ }
63
+ }