@hypequery/cli 0.0.0-canary-20261022063821 → 0.0.0-canary-20261022065415
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.
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"dev.d.ts","sourceRoot":"","sources":["../../src/commands/dev.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"dev.d.ts","sourceRoot":"","sources":["../../src/commands/dev.ts"],"names":[],"mappings":"AAmCA,MAAM,WAAW,UAAU;IACzB,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,KAAK,CAAC,EAAE,OAAO,CAAC;IAChB,KAAK,CAAC,EAAE,OAAO,CAAC;IAChB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,IAAI,CAAC,EAAE,OAAO,CAAC;IACf,IAAI,CAAC,EAAE,OAAO,CAAC;IACf,IAAI,CAAC,EAAE,MAAM,CAAC;CACf;AAED,wBAAsB,UAAU,CAAC,IAAI,CAAC,EAAE,MAAM,EAAE,OAAO,GAAE,UAAe,iBA8OvE"}
|
package/dist/commands/dev.js
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { loadServeDev } from '../utils/load-serve-dev.js';
|
|
1
2
|
import { exitWith, finishAndExit } from '../utils/command-exit.js';
|
|
2
3
|
import { telemetryErrorCode } from '../utils/telemetry/error-code.js';
|
|
3
4
|
import { DevSession } from '../utils/telemetry/dev-session.js';
|
|
@@ -69,6 +70,9 @@ export async function devCommand(file, options = {}) {
|
|
|
69
70
|
const dbSpinner = ora('Connecting to ClickHouse...').start();
|
|
70
71
|
let loading = true;
|
|
71
72
|
try {
|
|
73
|
+
// Before the API module: it imports @hypequery/serve itself, and failing
|
|
74
|
+
// there would hide which package to install.
|
|
75
|
+
const { serveDev } = await loadServeDev();
|
|
72
76
|
// Load the API module
|
|
73
77
|
const api = await loadApiModule(queriesFile);
|
|
74
78
|
loading = false;
|
|
@@ -92,7 +96,6 @@ export async function devCommand(file, options = {}) {
|
|
|
92
96
|
logger.success(`Registered ${queryCount} ${queryCount === 1 ? 'query' : 'queries'}`);
|
|
93
97
|
logger.newline();
|
|
94
98
|
// Start the server
|
|
95
|
-
const { serveDev } = await import('@hypequery/serve/dev');
|
|
96
99
|
currentServer = await serveDev(api, {
|
|
97
100
|
port: options.port,
|
|
98
101
|
hostname: options.hostname,
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* `@hypequery/serve` is an optional peer: projects that only generate clients
|
|
3
|
+
* (a React app, for example) should not have server packages installed for them.
|
|
4
|
+
*/
|
|
5
|
+
export declare function loadServeDev(load?: () => Promise<typeof import('@hypequery/serve/dev')>): Promise<typeof import('@hypequery/serve/dev')>;
|
|
6
|
+
//# sourceMappingURL=load-serve-dev.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"load-serve-dev.d.ts","sourceRoot":"","sources":["../../src/utils/load-serve-dev.ts"],"names":[],"mappings":"AAAA;;;GAGG;AACH,wBAAsB,YAAY,CAChC,IAAI,GAAE,MAAM,OAAO,CAAC,cAAc,sBAAsB,CAAC,CAAwC,GAChG,OAAO,CAAC,cAAc,sBAAsB,CAAC,CAAC,CAYhD"}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* `@hypequery/serve` is an optional peer: projects that only generate clients
|
|
3
|
+
* (a React app, for example) should not have server packages installed for them.
|
|
4
|
+
*/
|
|
5
|
+
export async function loadServeDev(load = () => import('@hypequery/serve/dev')) {
|
|
6
|
+
try {
|
|
7
|
+
return await load();
|
|
8
|
+
}
|
|
9
|
+
catch (error) {
|
|
10
|
+
const code = error.code;
|
|
11
|
+
const message = error instanceof Error ? error.message : '';
|
|
12
|
+
// Only serve itself: a module serve fails to find is a different problem.
|
|
13
|
+
if ((code === 'ERR_MODULE_NOT_FOUND' || code === 'MODULE_NOT_FOUND') && message.includes("'@hypequery/serve")) {
|
|
14
|
+
throw new Error('hypequery dev needs @hypequery/serve. Install it: npm install @hypequery/serve');
|
|
15
|
+
}
|
|
16
|
+
throw error;
|
|
17
|
+
}
|
|
18
|
+
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@hypequery/cli",
|
|
3
|
-
"version": "0.0.0-canary-
|
|
3
|
+
"version": "0.0.0-canary-20261022065415",
|
|
4
4
|
"description": "CLI for scaffolding type-safe ClickHouse analytics, semantic datasets, React manifests, and deployments",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"clickhouse",
|
|
@@ -30,19 +30,22 @@
|
|
|
30
30
|
"open": "^10.0.0",
|
|
31
31
|
"ora": "^8.0.1",
|
|
32
32
|
"prompts": "^2.4.2",
|
|
33
|
-
"@hypequery/deployment": "0.0.0-canary-
|
|
34
|
-
"@hypequery/protocol": "0.0.0-canary-
|
|
33
|
+
"@hypequery/deployment": "0.0.0-canary-20261022065415",
|
|
34
|
+
"@hypequery/protocol": "0.0.0-canary-20261022065415"
|
|
35
35
|
},
|
|
36
36
|
"optionalDependencies": {
|
|
37
37
|
"@napi-rs/keyring": "2.1.1"
|
|
38
38
|
},
|
|
39
39
|
"peerDependencies": {
|
|
40
|
-
"@hypequery/mcp": "0.0.0-canary-
|
|
41
|
-
"@hypequery/serve": "0.0.0-canary-
|
|
40
|
+
"@hypequery/mcp": "0.0.0-canary-20261022065415",
|
|
41
|
+
"@hypequery/serve": "0.0.0-canary-20261022065415"
|
|
42
42
|
},
|
|
43
43
|
"peerDependenciesMeta": {
|
|
44
44
|
"@hypequery/mcp": {
|
|
45
45
|
"optional": true
|
|
46
|
+
},
|
|
47
|
+
"@hypequery/serve": {
|
|
48
|
+
"optional": true
|
|
46
49
|
}
|
|
47
50
|
},
|
|
48
51
|
"devDependencies": {
|
|
@@ -51,8 +54,8 @@
|
|
|
51
54
|
"@vitest/coverage-v8": "^5.0.4",
|
|
52
55
|
"typescript": "^6.0.3",
|
|
53
56
|
"vitest": "^5.0.4",
|
|
54
|
-
"@hypequery/mcp": "0.0.0-canary-
|
|
55
|
-
"@hypequery/serve": "0.0.0-canary-
|
|
57
|
+
"@hypequery/mcp": "0.0.0-canary-20261022065415",
|
|
58
|
+
"@hypequery/serve": "0.0.0-canary-20261022065415"
|
|
56
59
|
},
|
|
57
60
|
"repository": {
|
|
58
61
|
"type": "git",
|