@onequery/cli 0.1.12 → 0.1.13-darwin-x64

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 (135) hide show
  1. package/package.json +15 -22
  2. package/vendor/x86_64-apple-darwin/onequery/onequery +0 -0
  3. package/vendor/x86_64-apple-darwin/runtime/migrations/20260327065242_curious_nightmare.sql +403 -0
  4. package/vendor/x86_64-apple-darwin/runtime/migrations/20260403103652_slippery_hellfire_club.sql +8 -0
  5. package/vendor/x86_64-apple-darwin/runtime/migrations/20260403112219_gigantic_namora.sql +1 -0
  6. package/vendor/x86_64-apple-darwin/runtime/migrations/meta/20260327065242_snapshot.json +2817 -0
  7. package/vendor/x86_64-apple-darwin/runtime/migrations/meta/20260403103652_snapshot.json +2864 -0
  8. package/vendor/x86_64-apple-darwin/runtime/migrations/meta/20260403112219_snapshot.json +2870 -0
  9. package/vendor/x86_64-apple-darwin/runtime/migrations/meta/_journal.json +27 -0
  10. package/vendor/x86_64-apple-darwin/runtime/pglite/initdb.wasm +0 -0
  11. package/vendor/x86_64-apple-darwin/runtime/pglite/pglite.data +0 -0
  12. package/vendor/x86_64-apple-darwin/runtime/pglite/pglite.wasm +0 -0
  13. package/vendor/x86_64-apple-darwin/runtime/sql-parser/sql_parser_wasm_bg.wasm +0 -0
  14. package/vendor/x86_64-apple-darwin/runtime/web/assets/CompositeItem-BV7KhPQk.js +1 -0
  15. package/vendor/x86_64-apple-darwin/runtime/web/assets/CompositeList-CX7HHxYw.js +1 -0
  16. package/vendor/x86_64-apple-darwin/runtime/web/assets/DialogTitle-Cn3YIuqm.js +1 -0
  17. package/vendor/x86_64-apple-darwin/runtime/web/assets/IconArrowRight-DsOD7mDl.js +1 -0
  18. package/vendor/x86_64-apple-darwin/runtime/web/assets/IconCheck-Gc24xPT2.js +1 -0
  19. package/vendor/x86_64-apple-darwin/runtime/web/assets/IconChevronDown-B-39MA7-.js +1 -0
  20. package/vendor/x86_64-apple-darwin/runtime/web/assets/IconCoins-C7Nn0L6R.js +1 -0
  21. package/vendor/x86_64-apple-darwin/runtime/web/assets/IconHistory-BqAd-xl2.js +1 -0
  22. package/vendor/x86_64-apple-darwin/runtime/web/assets/IconLoader2-B3B6M8nQ.js +1 -0
  23. package/vendor/x86_64-apple-darwin/runtime/web/assets/IconPlus-C3-kRhGX.js +1 -0
  24. package/vendor/x86_64-apple-darwin/runtime/web/assets/IconX-BQkA009b.js +1 -0
  25. package/vendor/x86_64-apple-darwin/runtime/web/assets/Separator-vw4jPN_6.js +1 -0
  26. package/vendor/x86_64-apple-darwin/runtime/web/assets/_authenticated-DJH6Owd6.js +1 -0
  27. package/vendor/x86_64-apple-darwin/runtime/web/assets/_org_slug-t8njJSRM.js +1 -0
  28. package/vendor/x86_64-apple-darwin/runtime/web/assets/api-base-url-DIb6qukm.js +1 -0
  29. package/vendor/x86_64-apple-darwin/runtime/web/assets/api-client-w1GRwBWy.js +1 -0
  30. package/vendor/x86_64-apple-darwin/runtime/web/assets/api-error-KjK7uFAE.js +1 -0
  31. package/vendor/x86_64-apple-darwin/runtime/web/assets/api-paths-ClEWWGwS.js +1 -0
  32. package/vendor/x86_64-apple-darwin/runtime/web/assets/app-routes-DdRvA1bK.js +1 -0
  33. package/vendor/x86_64-apple-darwin/runtime/web/assets/audit-CAeeKPUc.js +1 -0
  34. package/vendor/x86_64-apple-darwin/runtime/web/assets/auth-bootstrap-query-CCHARugg.js +1 -0
  35. package/vendor/x86_64-apple-darwin/runtime/web/assets/auth-client-BlMeXgb4.js +3 -0
  36. package/vendor/x86_64-apple-darwin/runtime/web/assets/avatar-DzUYMSvr.js +1 -0
  37. package/vendor/x86_64-apple-darwin/runtime/web/assets/badge-DHOXVqXh.js +1 -0
  38. package/vendor/x86_64-apple-darwin/runtime/web/assets/budget-CE3OLAEo.js +1 -0
  39. package/vendor/x86_64-apple-darwin/runtime/web/assets/callback-D_3GlDIq.js +1 -0
  40. package/vendor/x86_64-apple-darwin/runtime/web/assets/card-Bsy6azfK.js +1 -0
  41. package/vendor/x86_64-apple-darwin/runtime/web/assets/checkbox-L6MjK5Df.js +1 -0
  42. package/vendor/x86_64-apple-darwin/runtime/web/assets/compiler-runtime-DCc3R3Xn.js +1 -0
  43. package/vendor/x86_64-apple-darwin/runtime/web/assets/connect-database-DAnInWdw.js +1 -0
  44. package/vendor/x86_64-apple-darwin/runtime/web/assets/create-org-BDN7Ze49.js +1 -0
  45. package/vendor/x86_64-apple-darwin/runtime/web/assets/createReactComponent-_L2mp4Ui.js +1 -0
  46. package/vendor/x86_64-apple-darwin/runtime/web/assets/data-source-connection-form-ONh7pXjs.js +173 -0
  47. package/vendor/x86_64-apple-darwin/runtime/web/assets/device-l9BPI_cB.js +1 -0
  48. package/vendor/x86_64-apple-darwin/runtime/web/assets/dropdown-menu-CJmPwTHM.js +1 -0
  49. package/vendor/x86_64-apple-darwin/runtime/web/assets/empty-COnWCwda.js +1 -0
  50. package/vendor/x86_64-apple-darwin/runtime/web/assets/getDisabledMountTransitionStyles-BYKRz4ha.js +1 -0
  51. package/vendor/x86_64-apple-darwin/runtime/web/assets/getPseudoElementBounds-InhM-dWf.js +12 -0
  52. package/vendor/x86_64-apple-darwin/runtime/web/assets/home-d16NH6V1.js +1 -0
  53. package/vendor/x86_64-apple-darwin/runtime/web/assets/index-FAyK3-UK.css +2 -0
  54. package/vendor/x86_64-apple-darwin/runtime/web/assets/index-s4tWF5Zs.js +10 -0
  55. package/vendor/x86_64-apple-darwin/runtime/web/assets/input-DZ9QHu2b.js +1 -0
  56. package/vendor/x86_64-apple-darwin/runtime/web/assets/integrations-Cn7TfyS_.js +1 -0
  57. package/vendor/x86_64-apple-darwin/runtime/web/assets/inter-cyrillic-ext-wght-normal-BOeWTOD4.woff2 +0 -0
  58. package/vendor/x86_64-apple-darwin/runtime/web/assets/inter-cyrillic-wght-normal-DqGufNeO.woff2 +0 -0
  59. package/vendor/x86_64-apple-darwin/runtime/web/assets/inter-greek-ext-wght-normal-DlzME5K_.woff2 +0 -0
  60. package/vendor/x86_64-apple-darwin/runtime/web/assets/inter-greek-wght-normal-CkhJZR-_.woff2 +0 -0
  61. package/vendor/x86_64-apple-darwin/runtime/web/assets/inter-latin-ext-wght-normal-DO1Apj_S.woff2 +0 -0
  62. package/vendor/x86_64-apple-darwin/runtime/web/assets/inter-latin-wght-normal-Dx4kXJAl.woff2 +0 -0
  63. package/vendor/x86_64-apple-darwin/runtime/web/assets/inter-vietnamese-wght-normal-CBcvBZtf.woff2 +0 -0
  64. package/vendor/x86_64-apple-darwin/runtime/web/assets/invite._invitationId-D-E3kJtE.js +1 -0
  65. package/vendor/x86_64-apple-darwin/runtime/web/assets/jsx-runtime-DG_AJzB_.js +1 -0
  66. package/vendor/x86_64-apple-darwin/runtime/web/assets/label-CWOhoN_L.js +1 -0
  67. package/vendor/x86_64-apple-darwin/runtime/web/assets/link-Cgvqhh5w.js +1 -0
  68. package/vendor/x86_64-apple-darwin/runtime/web/assets/matchContext-CDajBC0L.js +1 -0
  69. package/vendor/x86_64-apple-darwin/runtime/web/assets/organization-permissions-BQQ5PJbI.js +1 -0
  70. package/vendor/x86_64-apple-darwin/runtime/web/assets/organization-query-keys-Nzs4DYGL.js +1 -0
  71. package/vendor/x86_64-apple-darwin/runtime/web/assets/query-timing-LGzitMXx.js +1 -0
  72. package/vendor/x86_64-apple-darwin/runtime/web/assets/queryOptions-BHw87wTZ.js +1 -0
  73. package/vendor/x86_64-apple-darwin/runtime/web/assets/removable-BfDesq3B.js +1 -0
  74. package/vendor/x86_64-apple-darwin/runtime/web/assets/routes-CNkIdK2C.js +1 -0
  75. package/vendor/x86_64-apple-darwin/runtime/web/assets/schemas-B9l2tHsR.js +39 -0
  76. package/vendor/x86_64-apple-darwin/runtime/web/assets/select-CxmfKkmB.js +1 -0
  77. package/vendor/x86_64-apple-darwin/runtime/web/assets/separator-BQc-hryc.js +1 -0
  78. package/vendor/x86_64-apple-darwin/runtime/web/assets/settings-5_Ep5M2N.js +1 -0
  79. package/vendor/x86_64-apple-darwin/runtime/web/assets/signin-ChcFNGS0.js +1 -0
  80. package/vendor/x86_64-apple-darwin/runtime/web/assets/src-DCIPwIx0.js +1 -0
  81. package/vendor/x86_64-apple-darwin/runtime/web/assets/table-DCvfJyLS.js +1 -0
  82. package/vendor/x86_64-apple-darwin/runtime/web/assets/team-Caa3U_wR.js +1 -0
  83. package/vendor/x86_64-apple-darwin/runtime/web/assets/textarea-DiU04l_U.js +1 -0
  84. package/vendor/x86_64-apple-darwin/runtime/web/assets/theme-toggle-BkEieJhS.js +1 -0
  85. package/vendor/x86_64-apple-darwin/runtime/web/assets/use-optimistic-mutation-C-XAzox1.js +1 -0
  86. package/vendor/x86_64-apple-darwin/runtime/web/assets/useBaseQuery-Dv5PJNro.js +1 -0
  87. package/vendor/x86_64-apple-darwin/runtime/web/assets/useBaseUiId-BLFGpnYJ.js +1 -0
  88. package/vendor/x86_64-apple-darwin/runtime/web/assets/useCompositeItem-DkdkBgiU.js +1 -0
  89. package/vendor/x86_64-apple-darwin/runtime/web/assets/useControlled-C1S7R-1A.js +1 -0
  90. package/vendor/x86_64-apple-darwin/runtime/web/assets/useQuery-psyE-Rnz.js +1 -0
  91. package/vendor/x86_64-apple-darwin/runtime/web/assets/useRender-DFMo54_d.js +1 -0
  92. package/vendor/x86_64-apple-darwin/runtime/web/assets/useRouterState-DpT8luFk.js +1 -0
  93. package/vendor/x86_64-apple-darwin/runtime/web/assets/useSuspenseQuery-CkRx89e-.js +1 -0
  94. package/vendor/x86_64-apple-darwin/runtime/web/assets/useValueChanged-CqxkrqWn.js +1 -0
  95. package/vendor/x86_64-apple-darwin/runtime/web/assets/utils-C8DGLIgm.js +1 -0
  96. package/vendor/x86_64-apple-darwin/runtime/web/assets/xstate-react.esm-BlF76DuP.js +1 -0
  97. package/vendor/x86_64-apple-darwin/runtime/web/assets/zod-D1Kv9xc5.js +1 -0
  98. package/vendor/x86_64-apple-darwin/runtime/web/images/amplitude/step1_settings_sidebar.png +0 -0
  99. package/vendor/x86_64-apple-darwin/runtime/web/images/amplitude/step2_projects.png +0 -0
  100. package/vendor/x86_64-apple-darwin/runtime/web/images/amplitude/step3_project_keys.png +0 -0
  101. package/vendor/x86_64-apple-darwin/runtime/web/images/amplitude/step4_api_keys.png +0 -0
  102. package/vendor/x86_64-apple-darwin/runtime/web/images/bigquery/step1_service_accounts.png +0 -0
  103. package/vendor/x86_64-apple-darwin/runtime/web/images/bigquery/step2_bigquery_roles.png +0 -0
  104. package/vendor/x86_64-apple-darwin/runtime/web/images/bigquery/step3_add_key_menu.png +0 -0
  105. package/vendor/x86_64-apple-darwin/runtime/web/images/bigquery/step4_create_json_key.png +0 -0
  106. package/vendor/x86_64-apple-darwin/runtime/web/images/ga4/step1_service_accounts.png +0 -0
  107. package/vendor/x86_64-apple-darwin/runtime/web/images/ga4/step2_create_json_key.png +0 -0
  108. package/vendor/x86_64-apple-darwin/runtime/web/images/ga4/step3_add_user_viewer.png +0 -0
  109. package/vendor/x86_64-apple-darwin/runtime/web/images/ga4/step4_property_details.png +0 -0
  110. package/vendor/x86_64-apple-darwin/runtime/web/images/github-token-guide/step1_signin.png +0 -0
  111. package/vendor/x86_64-apple-darwin/runtime/web/images/github-token-guide/step2_new_fine_grained_token_sanitized.png +0 -0
  112. package/vendor/x86_64-apple-darwin/runtime/web/images/github-token-guide/step3_permissions_configured_sanitized.png +0 -0
  113. package/vendor/x86_64-apple-darwin/runtime/web/images/github-token-guide/step4_token_created_sanitized.png +0 -0
  114. package/vendor/x86_64-apple-darwin/runtime/web/images/mixpanel/step1_service_accounts.png +0 -0
  115. package/vendor/x86_64-apple-darwin/runtime/web/images/mixpanel/step2_create_service_account.png +0 -0
  116. package/vendor/x86_64-apple-darwin/runtime/web/images/mixpanel/step3_credentials.png +0 -0
  117. package/vendor/x86_64-apple-darwin/runtime/web/images/mixpanel/step4_project_settings.png +0 -0
  118. package/vendor/x86_64-apple-darwin/runtime/web/images/postgresql/step1_create_user.png +0 -0
  119. package/vendor/x86_64-apple-darwin/runtime/web/images/postgresql/step2_connection.png +0 -0
  120. package/vendor/x86_64-apple-darwin/runtime/web/images/rds/step1_connect.png +0 -0
  121. package/vendor/x86_64-apple-darwin/runtime/web/images/rds/step2_create_user.png +0 -0
  122. package/vendor/x86_64-apple-darwin/runtime/web/images/rds/step3_grant.png +0 -0
  123. package/vendor/x86_64-apple-darwin/runtime/web/images/rds/step4_info.png +0 -0
  124. package/vendor/x86_64-apple-darwin/runtime/web/images/sentry/step1_personal_tokens.png +0 -0
  125. package/vendor/x86_64-apple-darwin/runtime/web/images/sentry/step2_create_token_permissions.png +0 -0
  126. package/vendor/x86_64-apple-darwin/runtime/web/images/sentry/step3_organization_slug.png +0 -0
  127. package/vendor/x86_64-apple-darwin/runtime/web/images/sentry/step4_project_slug.png +0 -0
  128. package/vendor/x86_64-apple-darwin/runtime/web/index.html +47 -0
  129. package/vendor/x86_64-apple-darwin/runtime/web/linear.svg +1 -0
  130. package/vendor/x86_64-apple-darwin/runtime/web/onequery.svg +14 -0
  131. package/vendor/x86_64-apple-darwin/server/onequery-server +0 -0
  132. package/bin/onequery.js +0 -286
  133. package/bin/package-constants.d.ts +0 -81
  134. package/bin/package-constants.js +0 -222
  135. package/runtime-bundle.json +0 -57
package/bin/onequery.js DELETED
@@ -1,286 +0,0 @@
1
- #!/usr/bin/env node
2
-
3
- import { spawn } from "node:child_process";
4
- import {
5
- chmodSync,
6
- existsSync,
7
- readFileSync,
8
- readdirSync,
9
- statSync,
10
- } from "node:fs";
11
- import { createRequire } from "node:module";
12
- import path from "node:path";
13
- import { fileURLToPath } from "node:url";
14
-
15
- import {
16
- CLI_BINARY_NAME,
17
- CLI_PACKAGE_NAME,
18
- PLATFORM_PACKAGE_BY_TARGET,
19
- binaryNameForPlatform,
20
- resolveTargetTriple,
21
- resolveTargetTripleCandidates,
22
- } from "./package-constants.js";
23
-
24
- const __filename = fileURLToPath(import.meta.url);
25
- const __dirname = path.dirname(__filename);
26
- const require = createRequire(import.meta.url);
27
- const runtimeBundleSpec = readRuntimeBundleSpec(resolveRuntimeBundleSpecPath());
28
-
29
- const { platform, arch } = process;
30
- const targetTriple = resolveTargetTriple(platform, arch);
31
- const targetTripleCandidates = resolveTargetTripleCandidates(platform, arch);
32
- const binaryName = binaryNameForPlatform(platform, CLI_BINARY_NAME);
33
-
34
- // CONTEXT: platform packages are installed through npm alias names so the
35
- // launcher resolves the alias folder, not the underlying published package id.
36
- const localVendorRoot = path.join(__dirname, "..", "vendor");
37
- const resolvedVendor = resolveVendorPayload({
38
- binaryName,
39
- localVendorRoot,
40
- runtimeBundleSpec,
41
- targetTripleCandidates,
42
- });
43
-
44
- if (!resolvedVendor) {
45
- const preferredPackage = PLATFORM_PACKAGE_BY_TARGET[targetTriple];
46
- const packageManager = detectPackageManager();
47
- const reinstallCommand =
48
- packageManager === "bun"
49
- ? `bun install -g ${CLI_PACKAGE_NAME}@latest`
50
- : `npm install -g ${CLI_PACKAGE_NAME}@latest`;
51
-
52
- if (preferredPackage) {
53
- throw new Error(
54
- `Missing optional dependency ${preferredPackage}. Reinstall OneQuery CLI: ${reinstallCommand}`
55
- );
56
- }
57
-
58
- throw new Error(`Unsupported target triple: ${targetTriple}`);
59
- }
60
-
61
- const { binaryPath, bundleRoot, serverBinaryDir } = resolvedVendor;
62
-
63
- if (platform !== "win32") {
64
- ensureExecutable(binaryPath);
65
- ensureExecutablesInDir(serverBinaryDir);
66
- }
67
-
68
- const child = spawn(binaryPath, process.argv.slice(2), {
69
- env: {
70
- ...process.env,
71
- [runtimeBundleSpec.runtimeRootEnvVar]:
72
- process.env[runtimeBundleSpec.runtimeRootEnvVar] ?? bundleRoot,
73
- },
74
- stdio: "inherit",
75
- });
76
-
77
- child.on("error", (error) => {
78
- console.error(error);
79
- process.exit(1);
80
- });
81
-
82
- const forwardSignal = (signal) => {
83
- if (child.killed) {
84
- return;
85
- }
86
-
87
- try {
88
- child.kill(signal);
89
- } catch {
90
- // Ignore forwarding failures if the child already exited.
91
- }
92
- };
93
-
94
- ["SIGINT", "SIGTERM", "SIGHUP"].forEach((signal) => {
95
- process.on(signal, () => forwardSignal(signal));
96
- });
97
-
98
- const childResult = await new Promise((resolve) => {
99
- child.on("exit", (code, signal) => {
100
- if (signal) {
101
- resolve({ signal, type: "signal" });
102
- return;
103
- }
104
-
105
- resolve({ exitCode: code ?? 1, type: "code" });
106
- });
107
- });
108
-
109
- if (childResult.type === "signal") {
110
- process.kill(process.pid, childResult.signal);
111
- } else {
112
- process.exit(childResult.exitCode);
113
- }
114
-
115
- function detectPackageManager() {
116
- const userAgent = process.env.npm_config_user_agent ?? "";
117
- if (/\bbun\//.test(userAgent)) {
118
- return "bun";
119
- }
120
-
121
- const execPath = process.env.npm_execpath ?? "";
122
- if (execPath.includes("bun")) {
123
- return "bun";
124
- }
125
-
126
- if (
127
- __dirname.includes(".bun/install/global") ||
128
- __dirname.includes(".bun\\install\\global")
129
- ) {
130
- return "bun";
131
- }
132
-
133
- return userAgent ? "npm" : null;
134
- }
135
-
136
- function resolveVendorPayload({
137
- binaryName,
138
- localVendorRoot,
139
- runtimeBundleSpec,
140
- targetTripleCandidates,
141
- }) {
142
- for (const candidateTargetTriple of targetTripleCandidates) {
143
- const localBundle = resolveBundlePaths({
144
- binaryName,
145
- bundleRoot: path.join(localVendorRoot, candidateTargetTriple),
146
- runtimeBundleSpec,
147
- });
148
-
149
- const platformPackage = PLATFORM_PACKAGE_BY_TARGET[candidateTargetTriple];
150
- if (platformPackage) {
151
- try {
152
- const packageJsonPath = require.resolve(
153
- `${platformPackage}/package.json`
154
- );
155
- const resolvedVendorRoot = path.join(
156
- path.dirname(packageJsonPath),
157
- "vendor"
158
- );
159
- const packagedBundle = resolveBundlePaths({
160
- binaryName,
161
- bundleRoot: path.join(resolvedVendorRoot, candidateTargetTriple),
162
- runtimeBundleSpec,
163
- });
164
- if (packagedBundle) {
165
- return {
166
- ...packagedBundle,
167
- };
168
- }
169
- } catch {
170
- // Keep checking fallback targets and local vendor payloads.
171
- }
172
- }
173
-
174
- if (localBundle) {
175
- return {
176
- ...localBundle,
177
- };
178
- }
179
- }
180
-
181
- return null;
182
- }
183
-
184
- function resolveBundlePaths({ binaryName, bundleRoot, runtimeBundleSpec }) {
185
- const binaryPath = path.join(
186
- bundleRoot,
187
- runtimeBundleSpec.directories.cli.relativePath,
188
- binaryName
189
- );
190
- if (!existsSync(binaryPath)) {
191
- return null;
192
- }
193
-
194
- return {
195
- binaryPath,
196
- bundleRoot,
197
- serverBinaryDir: path.join(
198
- bundleRoot,
199
- runtimeBundleSpec.directories.server.relativePath
200
- ),
201
- };
202
- }
203
-
204
- function resolveRuntimeBundleSpecPath() {
205
- const packagedSpecPath = path.join(__dirname, "..", "runtime-bundle.json");
206
- if (existsSync(packagedSpecPath)) {
207
- return packagedSpecPath;
208
- }
209
-
210
- // Comment: local workspace execution reads the canonical bundle spec from the
211
- // repo; published npm packages ship the same file at the package root.
212
- return path.join(
213
- __dirname,
214
- "..",
215
- "..",
216
- "..",
217
- "packages",
218
- "base",
219
- "src",
220
- "runtime-bundle.json"
221
- );
222
- }
223
-
224
- function readRuntimeBundleSpec(specPath) {
225
- let parsed;
226
- try {
227
- parsed = JSON.parse(readFileSync(specPath, "utf8"));
228
- } catch (error) {
229
- throw new Error(
230
- `Failed to read runtime bundle spec at ${specPath}: ${error instanceof Error ? error.message : String(error)}`,
231
- { cause: error }
232
- );
233
- }
234
-
235
- const runtimeRootEnvVar = readNonEmptyString(parsed?.runtimeRootEnvVar);
236
- const cliRelativePath = readNonEmptyString(
237
- parsed?.directories?.cli?.relativePath
238
- );
239
- const serverRelativePath = readNonEmptyString(
240
- parsed?.directories?.server?.relativePath
241
- );
242
- if (!runtimeRootEnvVar || !cliRelativePath || !serverRelativePath) {
243
- throw new Error(`Invalid runtime bundle spec at ${specPath}.`);
244
- }
245
-
246
- return {
247
- directories: {
248
- cli: {
249
- relativePath: cliRelativePath,
250
- },
251
- server: {
252
- relativePath: serverRelativePath,
253
- },
254
- },
255
- runtimeRootEnvVar,
256
- };
257
- }
258
-
259
- function readNonEmptyString(value) {
260
- return typeof value === "string" && value.length > 0 ? value : null;
261
- }
262
-
263
- function ensureExecutable(filePath) {
264
- const currentMode = statSync(filePath).mode & 0o777;
265
- if ((currentMode & 0o111) !== 0) {
266
- return;
267
- }
268
-
269
- // CONTEXT: npm tarballs store vendored native binaries without execute bits,
270
- // so restore the expected mode before spawning the packaged CLI binary.
271
- chmodSync(filePath, currentMode | 0o755);
272
- }
273
-
274
- function ensureExecutablesInDir(dirPath) {
275
- if (!existsSync(dirPath)) {
276
- return;
277
- }
278
-
279
- for (const entry of readdirSync(dirPath, { withFileTypes: true })) {
280
- if (!entry.isFile()) {
281
- continue;
282
- }
283
-
284
- ensureExecutable(path.join(dirPath, entry.name));
285
- }
286
- }
@@ -1,81 +0,0 @@
1
- export type TargetTriple =
2
- | "x86_64-unknown-linux-musl"
3
- | "aarch64-unknown-linux-musl"
4
- | "x86_64-apple-darwin"
5
- | "aarch64-apple-darwin"
6
- | "x86_64-pc-windows-msvc"
7
- | "aarch64-pc-windows-msvc"
8
- | "x86_64-unknown-linux-gnu"
9
- | "aarch64-unknown-linux-gnu";
10
-
11
- export type NpmTargetTriple = Exclude<
12
- TargetTriple,
13
- "x86_64-unknown-linux-gnu" | "aarch64-unknown-linux-gnu"
14
- >;
15
-
16
- export type RuntimePlatform = "linux" | "android" | "darwin" | "win32";
17
- export type RuntimeArch = "x64" | "arm64";
18
-
19
- export type PlatformPackage = {
20
- optionalDependencyName: string;
21
- npmTag: string;
22
- targetTriple: NpmTargetTriple;
23
- os: "linux" | "darwin" | "win32";
24
- cpu: RuntimeArch;
25
- };
26
-
27
- export type ReleasePlatformPackage = {
28
- optionalDependencyName: string | null;
29
- npmTag: string;
30
- targetTriple: TargetTriple;
31
- os: "linux" | "darwin" | "win32";
32
- cpu: RuntimeArch;
33
- };
34
-
35
- export type ServerBuildPlan = {
36
- compileTarget: string;
37
- filename: string;
38
- };
39
-
40
- export const CLI_PACKAGE_NAME: "@onequery/cli";
41
- export const CLI_BINARY_NAME: "onequery";
42
- export const CLI_SERVER_BINARY_NAME: "onequery-server";
43
- export const CLI_SERVER_MUSL_BINARY_NAME: "onequery-server-musl";
44
- export const CLI_NPM_TARBALL_PREFIX: "onequery-npm";
45
- export const CLI_NPM_STAGE_DIR_PREFIX: `${typeof CLI_NPM_TARBALL_PREFIX}-stage-`;
46
- export const CLI_NPM_PACK_DIR_PREFIX: `${typeof CLI_NPM_TARBALL_PREFIX}-pack-`;
47
- export const CLI_STAGE_PACKAGE_DIR_PREFIX: "onequery-cli-";
48
-
49
- export const PLATFORM_PACKAGES: Record<string, PlatformPackage>;
50
- export const EXTRA_RELEASE_PLATFORM_PACKAGES: Record<
51
- string,
52
- ReleasePlatformPackage
53
- >;
54
- export const RELEASE_PLATFORM_PACKAGES: Record<string, ReleasePlatformPackage>;
55
- export const PLATFORM_PACKAGE_BY_TARGET: Record<NpmTargetTriple, string>;
56
-
57
- export function serverBuildsForTargetTriple(
58
- targetTriple: TargetTriple
59
- ): ServerBuildPlan[];
60
-
61
- export function packageStagingDirPrefix(packageName: string): string;
62
-
63
- export function binaryNameForPlatform(
64
- platform: RuntimePlatform | string,
65
- baseName: string
66
- ): string;
67
-
68
- export function binaryNameForTargetTriple(
69
- targetTriple: TargetTriple | string,
70
- baseName: string
71
- ): string;
72
-
73
- export function resolveTargetTripleCandidates(
74
- platform: RuntimePlatform | string,
75
- arch: RuntimeArch | string
76
- ): TargetTriple[];
77
-
78
- export function resolveTargetTriple(
79
- platform: RuntimePlatform | string,
80
- arch: RuntimeArch | string
81
- ): TargetTriple;
@@ -1,222 +0,0 @@
1
- export const CLI_PACKAGE_NAME = "@onequery/cli";
2
- export const CLI_BINARY_NAME = "onequery";
3
- export const CLI_SERVER_BINARY_NAME = "onequery-server";
4
- export const CLI_SERVER_MUSL_BINARY_NAME = "onequery-server-musl";
5
- export const CLI_NPM_TARBALL_PREFIX = "onequery-npm";
6
- export const CLI_NPM_STAGE_DIR_PREFIX = `${CLI_NPM_TARBALL_PREFIX}-stage-`;
7
- export const CLI_NPM_PACK_DIR_PREFIX = `${CLI_NPM_TARBALL_PREFIX}-pack-`;
8
- export const CLI_STAGE_PACKAGE_DIR_PREFIX = "onequery-cli-";
9
-
10
- export const PLATFORM_PACKAGES = {
11
- "cli-darwin-arm64": {
12
- optionalDependencyName: "onequery-darwin-arm64",
13
- npmTag: "darwin-arm64",
14
- targetTriple: "aarch64-apple-darwin",
15
- os: "darwin",
16
- cpu: "arm64",
17
- },
18
- "cli-darwin-x64": {
19
- optionalDependencyName: "onequery-darwin-x64",
20
- npmTag: "darwin-x64",
21
- targetTriple: "x86_64-apple-darwin",
22
- os: "darwin",
23
- cpu: "x64",
24
- },
25
- "cli-linux-arm64": {
26
- optionalDependencyName: "onequery-linux-arm64",
27
- npmTag: "linux-arm64",
28
- targetTriple: "aarch64-unknown-linux-musl",
29
- os: "linux",
30
- cpu: "arm64",
31
- },
32
- "cli-linux-x64": {
33
- optionalDependencyName: "onequery-linux-x64",
34
- npmTag: "linux-x64",
35
- targetTriple: "x86_64-unknown-linux-musl",
36
- os: "linux",
37
- cpu: "x64",
38
- },
39
- "cli-win32-arm64": {
40
- optionalDependencyName: "onequery-win32-arm64",
41
- npmTag: "win32-arm64",
42
- targetTriple: "aarch64-pc-windows-msvc",
43
- os: "win32",
44
- cpu: "arm64",
45
- },
46
- "cli-win32-x64": {
47
- optionalDependencyName: "onequery-win32-x64",
48
- npmTag: "win32-x64",
49
- targetTriple: "x86_64-pc-windows-msvc",
50
- os: "win32",
51
- cpu: "x64",
52
- },
53
- };
54
-
55
- export const EXTRA_RELEASE_PLATFORM_PACKAGES = {
56
- // COMMENT: Keep GNU Linux release tarballs available on GitHub Releases
57
- // without adding glibc-specific optional dependencies to the npm install
58
- // path. The launcher falls back to these local vendor payloads when present.
59
- "cli-linux-arm64-gnu": {
60
- optionalDependencyName: null,
61
- npmTag: "linux-arm64-gnu",
62
- targetTriple: "aarch64-unknown-linux-gnu",
63
- os: "linux",
64
- cpu: "arm64",
65
- },
66
- "cli-linux-x64-gnu": {
67
- optionalDependencyName: null,
68
- npmTag: "linux-x64-gnu",
69
- targetTriple: "x86_64-unknown-linux-gnu",
70
- os: "linux",
71
- cpu: "x64",
72
- },
73
- };
74
-
75
- export const RELEASE_PLATFORM_PACKAGES = {
76
- ...PLATFORM_PACKAGES,
77
- ...EXTRA_RELEASE_PLATFORM_PACKAGES,
78
- };
79
-
80
- export const PLATFORM_PACKAGE_BY_TARGET = Object.fromEntries(
81
- Object.values(PLATFORM_PACKAGES).map((platformPackage) => [
82
- platformPackage.targetTriple,
83
- platformPackage.optionalDependencyName,
84
- ])
85
- );
86
-
87
- export function serverBuildsForTargetTriple(targetTriple) {
88
- switch (targetTriple) {
89
- case "aarch64-apple-darwin":
90
- return [
91
- {
92
- compileTarget: "bun-darwin-arm64",
93
- filename: CLI_SERVER_BINARY_NAME,
94
- },
95
- ];
96
- case "aarch64-unknown-linux-musl":
97
- return [
98
- {
99
- compileTarget: "bun-linux-arm64",
100
- filename: CLI_SERVER_BINARY_NAME,
101
- },
102
- {
103
- compileTarget: "bun-linux-arm64-musl",
104
- filename: CLI_SERVER_MUSL_BINARY_NAME,
105
- },
106
- ];
107
- case "aarch64-unknown-linux-gnu":
108
- return [
109
- {
110
- compileTarget: "bun-linux-arm64",
111
- filename: CLI_SERVER_BINARY_NAME,
112
- },
113
- ];
114
- case "aarch64-pc-windows-msvc":
115
- return [
116
- {
117
- compileTarget: "bun-windows-arm64",
118
- filename: binaryNameForTargetTriple(
119
- targetTriple,
120
- CLI_SERVER_BINARY_NAME
121
- ),
122
- },
123
- ];
124
- case "x86_64-apple-darwin":
125
- return [
126
- {
127
- compileTarget: "bun-darwin-x64",
128
- filename: CLI_SERVER_BINARY_NAME,
129
- },
130
- ];
131
- case "x86_64-unknown-linux-musl":
132
- return [
133
- {
134
- compileTarget: "bun-linux-x64",
135
- filename: CLI_SERVER_BINARY_NAME,
136
- },
137
- {
138
- compileTarget: "bun-linux-x64-musl",
139
- filename: CLI_SERVER_MUSL_BINARY_NAME,
140
- },
141
- ];
142
- case "x86_64-unknown-linux-gnu":
143
- return [
144
- {
145
- compileTarget: "bun-linux-x64",
146
- filename: CLI_SERVER_BINARY_NAME,
147
- },
148
- ];
149
- case "x86_64-pc-windows-msvc":
150
- return [
151
- {
152
- compileTarget: "bun-windows-x64",
153
- filename: binaryNameForTargetTriple(
154
- targetTriple,
155
- CLI_SERVER_BINARY_NAME
156
- ),
157
- },
158
- ];
159
- default:
160
- throw new Error(`Unsupported server target triple '${targetTriple}'.`);
161
- }
162
- }
163
-
164
- export function packageStagingDirPrefix(packageName) {
165
- return `${CLI_STAGE_PACKAGE_DIR_PREFIX}${packageName}-`;
166
- }
167
-
168
- export function binaryNameForPlatform(platform, baseName) {
169
- return platform === "win32" ? `${baseName}.exe` : baseName;
170
- }
171
-
172
- export function binaryNameForTargetTriple(targetTriple, baseName) {
173
- return targetTriple.includes("-windows-") ? `${baseName}.exe` : baseName;
174
- }
175
-
176
- export function resolveTargetTripleCandidates(platform, arch) {
177
- switch (platform) {
178
- case "linux":
179
- case "android": {
180
- switch (arch) {
181
- case "x64":
182
- return ["x86_64-unknown-linux-musl", "x86_64-unknown-linux-gnu"];
183
- case "arm64":
184
- return ["aarch64-unknown-linux-musl", "aarch64-unknown-linux-gnu"];
185
- default:
186
- break;
187
- }
188
- break;
189
- }
190
- case "darwin": {
191
- switch (arch) {
192
- case "x64":
193
- return ["x86_64-apple-darwin"];
194
- case "arm64":
195
- return ["aarch64-apple-darwin"];
196
- default:
197
- break;
198
- }
199
- break;
200
- }
201
- case "win32": {
202
- switch (arch) {
203
- case "x64":
204
- return ["x86_64-pc-windows-msvc"];
205
- case "arm64":
206
- return ["aarch64-pc-windows-msvc"];
207
- default:
208
- break;
209
- }
210
- break;
211
- }
212
- default: {
213
- break;
214
- }
215
- }
216
-
217
- throw new Error(`Unsupported platform: ${platform} (${arch})`);
218
- }
219
-
220
- export function resolveTargetTriple(platform, arch) {
221
- return resolveTargetTripleCandidates(platform, arch)[0];
222
- }
@@ -1,57 +0,0 @@
1
- {
2
- "manifestVersion": 1,
3
- "runtimeRootEnvVar": "ONEQUERY_RUNTIME_ROOT",
4
- "directories": {
5
- "cli": {
6
- "relativePath": "onequery"
7
- },
8
- "server": {
9
- "relativePath": "server"
10
- }
11
- },
12
- "runtimeEntries": {
13
- "migrations": {
14
- "relativePath": "runtime/migrations"
15
- },
16
- "webDist": {
17
- "relativePath": "runtime/web",
18
- "requiredFile": "index.html"
19
- }
20
- },
21
- "runtimeAssetFamilies": {
22
- "pglite": {
23
- "buildOwnerPackage": "@onequery/db",
24
- "buildSource": {
25
- "kind": "package-entrypoint-directory",
26
- "packageSpecifier": "@electric-sql/pglite"
27
- },
28
- "files": {
29
- "pgliteWasm": {
30
- "filename": "pglite.wasm"
31
- },
32
- "initdbWasm": {
33
- "filename": "initdb.wasm"
34
- },
35
- "fsBundle": {
36
- "filename": "pglite.data"
37
- }
38
- },
39
- "packagedPath": "runtime/pglite"
40
- },
41
- "sqlParser": {
42
- "buildOwnerPackage": "@onequery/server",
43
- "buildSource": {
44
- "kind": "resolved-specifier-map",
45
- "specifiersByFileRole": {
46
- "wasm": "@casual-simulation/sql-parser/pkg/sql_parser_wasm_bg.wasm"
47
- }
48
- },
49
- "files": {
50
- "wasm": {
51
- "filename": "sql_parser_wasm_bg.wasm"
52
- }
53
- },
54
- "packagedPath": "runtime/sql-parser"
55
- }
56
- }
57
- }