@malloy-publisher/create-malloy-package 0.0.3 → 0.0.6
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/dist/index.js +34 -1
- package/package.json +3 -3
- package/templates/AGENTS.md +3 -1
package/dist/index.js
CHANGED
|
@@ -246,6 +246,27 @@ function toMalloyIdentifier(name) {
|
|
|
246
246
|
return identifier;
|
|
247
247
|
}
|
|
248
248
|
|
|
249
|
+
// src/node_version.ts
|
|
250
|
+
var MIN_NODE_MAJOR = 20;
|
|
251
|
+
var REQUIRED_NODE_RANGE = `>=${MIN_NODE_MAJOR}`;
|
|
252
|
+
function nodeVersionWarning(versions) {
|
|
253
|
+
if (versions.bunVersion) {
|
|
254
|
+
return;
|
|
255
|
+
}
|
|
256
|
+
const match = /^v?(\d+)\./.exec(versions.nodeVersion.trim());
|
|
257
|
+
if (!match || Number(match[1]) >= MIN_NODE_MAJOR) {
|
|
258
|
+
return;
|
|
259
|
+
}
|
|
260
|
+
return [
|
|
261
|
+
`! Node.js ${MIN_NODE_MAJOR} or newer is required to run Publisher. This shell is running Node.js ${versions.nodeVersion}.`,
|
|
262
|
+
` The workspace is scaffolded and correct, but Publisher will not work on this Node:`,
|
|
263
|
+
` upgrade before running npm start.`,
|
|
264
|
+
` nvm: nvm install ${MIN_NODE_MAJOR} && nvm use ${MIN_NODE_MAJOR}`,
|
|
265
|
+
` mise: mise use -g node@${MIN_NODE_MAJOR} then open a new shell`
|
|
266
|
+
].join(`
|
|
267
|
+
`);
|
|
268
|
+
}
|
|
269
|
+
|
|
249
270
|
// src/registry_check.ts
|
|
250
271
|
import * as http from "node:http";
|
|
251
272
|
import * as https from "node:https";
|
|
@@ -644,7 +665,7 @@ var MCP_PORT = 4040;
|
|
|
644
665
|
var ALT_PUBLISHER_PORT = PUBLISHER_PORT + 100;
|
|
645
666
|
var ALT_MCP_PORT = MCP_PORT + 100;
|
|
646
667
|
var BIND_HOST = "127.0.0.1";
|
|
647
|
-
var SERVER_VERSION = "0.0.
|
|
668
|
+
var SERVER_VERSION = "0.0.237";
|
|
648
669
|
function startCommandFor(envName) {
|
|
649
670
|
return `npx -y @malloy-publisher/server@${SERVER_VERSION} --server_root . ` + `--config ./publisher.config.json --host ${BIND_HOST} ` + `--watch-env ${envName}`;
|
|
650
671
|
}
|
|
@@ -1385,6 +1406,9 @@ function workspacePackageJson(cwd, result) {
|
|
|
1385
1406
|
name: toNpmName(path3.basename(path3.resolve(cwd))),
|
|
1386
1407
|
version: "0.1.0",
|
|
1387
1408
|
private: true,
|
|
1409
|
+
engines: {
|
|
1410
|
+
node: REQUIRED_NODE_RANGE
|
|
1411
|
+
},
|
|
1388
1412
|
scripts: {
|
|
1389
1413
|
start: result.startCommand,
|
|
1390
1414
|
reset: result.resetCommand
|
|
@@ -1565,6 +1589,15 @@ async function run(name, options) {
|
|
|
1565
1589
|
if (warning) {
|
|
1566
1590
|
process.stdout.write(`
|
|
1567
1591
|
${yellow(warning)}
|
|
1592
|
+
`);
|
|
1593
|
+
}
|
|
1594
|
+
const nodeWarning = nodeVersionWarning({
|
|
1595
|
+
nodeVersion: process.version,
|
|
1596
|
+
bunVersion: process.versions.bun
|
|
1597
|
+
});
|
|
1598
|
+
if (nodeWarning) {
|
|
1599
|
+
process.stdout.write(`
|
|
1600
|
+
${yellow(nodeWarning)}
|
|
1568
1601
|
`);
|
|
1569
1602
|
}
|
|
1570
1603
|
} catch (err) {
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@malloy-publisher/create-malloy-package",
|
|
3
3
|
"description": "Scaffold a Malloy Publisher package and a local agent workspace, so one command takes you from nothing to an agent that can query your data.",
|
|
4
|
-
"version": "0.0.
|
|
4
|
+
"version": "0.0.6",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"type": "module",
|
|
7
7
|
"engines": {
|
|
@@ -45,12 +45,12 @@
|
|
|
45
45
|
"test:e2e": "bun test --timeout 180000 tests/e2e"
|
|
46
46
|
},
|
|
47
47
|
"dependencies": {
|
|
48
|
-
"@malloy-publisher/skills": "^0.1.
|
|
48
|
+
"@malloy-publisher/skills": "^0.1.4",
|
|
49
49
|
"commander": "^12.1.0"
|
|
50
50
|
},
|
|
51
51
|
"devDependencies": {
|
|
52
52
|
"@eslint/js": "^8.57.0",
|
|
53
|
-
"@malloydata/malloy": "^0.0.
|
|
53
|
+
"@malloydata/malloy": "^0.0.427",
|
|
54
54
|
"@modelcontextprotocol/sdk": "^1.13.2",
|
|
55
55
|
"@types/bun": "^1.2.21",
|
|
56
56
|
"@types/node": "^24.10.0",
|
package/templates/AGENTS.md
CHANGED
|
@@ -143,7 +143,9 @@ against the model, so it takes the snippet as a required `source` argument; it r
|
|
|
143
143
|
the model file's own errors too),
|
|
144
144
|
`malloy_reloadPackage` (pick up on-disk model edits with no restart, and surface a
|
|
145
145
|
watch-mode recompile that failed), and
|
|
146
|
-
`malloy_searchDocs
|
|
146
|
+
`malloy_searchDocs`, and `malloy_searchDatabaseSchema` (find the tables in a database
|
|
147
|
+
connection by plain-English description, for modelling data that is not in this package
|
|
148
|
+
yet; it returns each table's columns and the `source:` line to start from). {{mcpNote}}
|
|
147
149
|
|
|
148
150
|
REST, for a script or a check that does not need an agent: every model is queryable at
|
|
149
151
|
`POST /api/v0/environments/<env>/packages/<package>/models/<model>/query`, and after a
|