windmill-cli 1.856.0 → 1.858.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 (2) hide show
  1. package/esm/main.js +60 -7
  2. package/package.json +1 -1
package/esm/main.js CHANGED
@@ -16766,7 +16766,7 @@ var init_OpenAPI = __esm(() => {
16766
16766
  PASSWORD: undefined,
16767
16767
  TOKEN: getEnv3("WM_TOKEN"),
16768
16768
  USERNAME: undefined,
16769
- VERSION: "1.856.0",
16769
+ VERSION: "1.858.0",
16770
16770
  WITH_CREDENTIALS: true,
16771
16771
  interceptors: {
16772
16772
  request: new Interceptors,
@@ -20092,7 +20092,7 @@ var init_auth = __esm(async () => {
20092
20092
  });
20093
20093
 
20094
20094
  // src/core/constants.ts
20095
- var WM_FORK_PREFIX = "wm-fork", VERSION = "1.856.0";
20095
+ var WM_FORK_PREFIX = "wm-fork", VERSION = "1.858.0";
20096
20096
 
20097
20097
  // src/utils/resource_folders.ts
20098
20098
  import { existsSync } from "node:fs";
@@ -58855,7 +58855,7 @@ var init_openflow = __esm(() => {
58855
58855
  openflow_default = {
58856
58856
  openapi: "3.0.3",
58857
58857
  info: {
58858
- version: "1.856.0",
58858
+ version: "1.858.0",
58859
58859
  title: "OpenFlow Spec",
58860
58860
  contact: {
58861
58861
  name: "Ruben Fiszel",
@@ -88901,7 +88901,11 @@ The key must be a **string literal** — the graph parser is static and cannot f
88901
88901
  >
88902
88902
  > The one target ANY language may declare (except a dbt script, whose writes come from its manifest) is a **warehouse relation**: \`// materialize manual dbt://<warehouse>/<schema>/<name>\`, where \`<warehouse>\` is a warehouse the workspace configures under Settings → dbt. \`manual\` is the only mode it has — nothing generates warehouse DDL, so the node issues its own write (a postgresql \`CREATE TABLE\` / \`INSERT\`, an SDK load, …) and the annotation records the outcome. Use it on an ingestion node whose output a dbt project reads as a \`source\`: the declared relation and the dbt model land on ONE graph node, and a downstream \`// on dbt://<warehouse>/<schema>/<name>\` fires when the ingestion node completes.
88903
88903
 
88904
- A managed \`// materialize ducklake://<name>/<table>\` tells the runtime to write the node's output table **for you**: write the body as a single \`SELECT\` and the runtime wraps it in the create/replace — do **not** also write your own \`CREATE TABLE\` / \`INSERT\`. (The opposite holds for the \`dbt://\` target above: there the node writes its own DDL and the strategies below do not apply.) Write strategy:
88904
+ A managed \`// materialize ducklake://<name>/<table>\` tells the runtime to write the node's output table **for you**: write the body as a single \`SELECT\` and the runtime wraps it in the create/replace — do **not** also write your own \`CREATE TABLE\` / \`INSERT\`. (The opposite holds for the \`dbt://\` target above: there the node writes its own DDL and the strategies below do not apply.)
88905
+
88906
+ A target that names no table — \`// materialize\`, \`// materialize ducklake://<name>\`, or options alone such as \`// materialize key=id\` — writes the table named after the script: node \`f/shop/orders_daily\` materializes \`ducklake://main/orders_daily\` (characters other than letters, digits and \`_\` become \`_\`, and a name starting with a digit gets a leading \`_\`). Name the node after the table it produces and the bare form is enough; write the full target when the table's name differs from the node's, and use that same name in every downstream \`// on\` and read.
88907
+
88908
+ Write strategy:
88905
88909
 
88906
88910
  - no option → **replace** the whole table each run (full refresh; the only mode whose output columns may change);
88907
88911
  - \`// materialize <uri> append\` → INSERT-append rows (incremental);
@@ -88932,7 +88936,8 @@ On a node that materializes a DuckLake table, \`// measure <name> = <aggregate>
88932
88936
  2. Write each node as its own script. Default to \`duckdb\` materializing into DuckLake (see "Default to DuckDB + DuckLake" above); pick \`postgresql\`, \`bun\`, or \`python3\` only when that section says the work calls for it.
88933
88937
  3. Start each body with \`// pipeline\`, then the \`// on\` input declarations, then the transform that writes the output.
88934
88938
  4. **Chain nodes by asset URI**: read an upstream node's output asset, then \`// on <that-same-uri>\` in the downstream node so the edge forms. Reuse exact asset paths from existing nodes rather than inventing parallel ones.
88935
- 5. Don't deploy nodes unless the user asks to. A pipeline only "runs" once its scripts are deployed and their triggers exist.
88939
+ 5. Never guess the columns of a file or table you have not seen: read them first with a query that writes nothing, such as \`DESCRIBE SELECT * FROM read_csv('s3:///raw/orders/*.csv')\` or \`ATTACH 'ducklake://main' AS lake; DESCRIBE lake.orders\`, and use those exact column names. A test run of a node that materializes a table writes that table into the workspace's lake: test-run such a node only while its table does not exist yet, and ask before running one that would replace a table already there.
88940
+ 6. Don't deploy nodes unless the user asks to. A pipeline only "runs" once its scripts are deployed and their triggers exist.
88936
88941
 
88937
88942
  Locally:
88938
88943
 
@@ -88958,9 +88963,12 @@ Node \`f/sales/orders_daily\` (runs when \`orders\` is produced, writes a rollup
88958
88963
  -- pipeline
88959
88964
  -- on ducklake://main/orders
88960
88965
  -- materialize ducklake://main/orders_daily
88966
+ ATTACH 'ducklake://main' AS lake;
88961
88967
  SELECT date_trunc('day', ts) AS day, count(*) AS n
88962
- FROM ducklake.main.orders GROUP BY 1
88968
+ FROM lake.orders GROUP BY 1
88963
88969
  \`\`\`
88970
+
88971
+ A node reads a DuckLake table only through a lake it attaches itself (\`ATTACH 'ducklake://<name>' AS lake;\`, then \`lake.<table>\`); the materialize target is attached by the runtime under a name of its own, so \`ducklake.main.<table>\` does not resolve.
88964
88972
  `,
88965
88973
  datatables: `---
88966
88974
  name: datatables
@@ -100228,6 +100236,13 @@ function workspaceRoot() {
100228
100236
  const yaml = getWmillYamlPath();
100229
100237
  return yaml ? path27.dirname(yaml) : process26.cwd();
100230
100238
  }
100239
+ function withDefaultTable(m, scriptPath) {
100240
+ if (m.target_kind !== "ducklake" || /[/.]/.test(m.target_path))
100241
+ return m;
100242
+ const name = (scriptPath.split("/").pop() ?? "").trim().replace(/[^A-Za-z0-9_]/gu, "_");
100243
+ const table = /^[0-9]/.test(name) ? `_${name}` : name;
100244
+ return table ? { ...m, target_path: `${m.target_path}/${table}` } : m;
100245
+ }
100231
100246
  function wasmFnForLanguage(language) {
100232
100247
  switch (language) {
100233
100248
  case "bun":
@@ -100344,6 +100359,43 @@ var MUTE_ASSET_PREFIXES = [
100344
100359
  ["datatable://", "datatable"],
100345
100360
  ["volume://", "volume"]
100346
100361
  ];
100362
+ function recoverBareMaterialize(content) {
100363
+ for (const rawLine of content.split(`
100364
+ `)) {
100365
+ const line = rawLine.trimStart();
100366
+ if (line === "")
100367
+ continue;
100368
+ let rest;
100369
+ if (line.startsWith("//") || line.startsWith("--"))
100370
+ rest = line.slice(2);
100371
+ else if (line.startsWith("#"))
100372
+ rest = line.slice(1);
100373
+ else
100374
+ break;
100375
+ const m = rest.trim().match(/^materialize(?:\s+(.*))?$/);
100376
+ if (!m)
100377
+ continue;
100378
+ let tokens = (m[1] ?? "").split(/\s+/).filter((t) => t !== "");
100379
+ if (tokens[0] === "manual")
100380
+ return;
100381
+ const scd2Keyword = tokens[0] === "scd2";
100382
+ if (scd2Keyword)
100383
+ tokens = tokens.slice(1);
100384
+ const first = tokens[0] ?? "";
100385
+ const namesTarget = first.includes("://") || first !== "" && first !== "append" && first !== "history" && !first.includes("=");
100386
+ if (namesTarget)
100387
+ return;
100388
+ const key = tokens.find((t) => t.startsWith("key="))?.slice("key=".length);
100389
+ return {
100390
+ target_kind: "ducklake",
100391
+ target_path: "main",
100392
+ ...tokens.includes("append") ? { append: true } : {},
100393
+ ...key ? { unique_key: key } : {},
100394
+ ...scd2Keyword || tokens.includes("history") ? { scd2: true } : {}
100395
+ };
100396
+ }
100397
+ return;
100398
+ }
100347
100399
  function parseMuteAnnotations(content) {
100348
100400
  const muted = new Set;
100349
100401
  let muteAll = false;
@@ -100552,7 +100604,8 @@ async function buildLocalPipelineGraph(args) {
100552
100604
  const retry = normalizeRetry(out.retry);
100553
100605
  const nativeTriggers = recoverHeaderNativeTriggers(s.content, s.language);
100554
100606
  pipelineScripts.push(out.tag ? { ...s, tag: out.tag } : s);
100555
- const mat = out.materialize;
100607
+ const parsedMat = out.materialize ?? recoverBareMaterialize(s.content);
100608
+ const mat = parsedMat && withDefaultTable(parsedMat, s.path);
100556
100609
  const materialize_strategy = mat && !mat.manual ? mat.scd2 ? "scd2" : mat.append ? "append" : mat.unique_key ? "merge" : "replace" : undefined;
100557
100610
  runnables.push({
100558
100611
  path: s.path,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "windmill-cli",
3
- "version": "1.856.0",
3
+ "version": "1.858.0",
4
4
  "description": "CLI for Windmill",
5
5
  "license": "Apache 2.0",
6
6
  "type": "module",