windmill-cli 1.585.0 → 1.586.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.
@@ -32,7 +32,7 @@ export const OpenAPI = {
32
32
  PASSWORD: undefined,
33
33
  TOKEN: getEnv("WM_TOKEN"),
34
34
  USERNAME: undefined,
35
- VERSION: '1.585.0',
35
+ VERSION: '1.586.0',
36
36
  WITH_CREDENTIALS: true,
37
37
  interceptors: {
38
38
  request: new Interceptors(),
@@ -98,7 +98,9 @@ export async function handleFile(path, workspace, alreadySynced, message, opts,
98
98
  let outputFiles = [];
99
99
  if (codebase.customBundler) {
100
100
  log.info(`Using custom bundler ${codebase.customBundler} for ${path}`);
101
- bundleContent = execSync(codebase.customBundler + " " + path, { maxBuffer: 1024 * 1024 * 50 }).toString();
101
+ bundleContent = execSync(codebase.customBundler + " " + path, {
102
+ maxBuffer: 1024 * 1024 * 50,
103
+ }).toString();
102
104
  log.info("Custom bundler executed for " + path);
103
105
  }
104
106
  else {
@@ -115,7 +117,7 @@ export async function handleFile(path, workspace, alreadySynced, message, opts,
115
117
  inject: codebase.inject,
116
118
  define: codebase.define,
117
119
  loader: codebase.loader ?? { ".node": "file" },
118
- outdir: '/',
120
+ outdir: "/",
119
121
  platform: "node",
120
122
  packages: "bundle",
121
123
  target: format == "cjs" ? "node20.15.1" : "esnext",
@@ -127,12 +129,14 @@ export async function handleFile(path, workspace, alreadySynced, message, opts,
127
129
  }
128
130
  if (outputFiles.length > 1) {
129
131
  const archiveNpm = await import("@ayonli/jsext/archive");
130
- log.info(`Found multiple output files for ${path}, creating a tarball... ${outputFiles.map((file) => file.path).join(", ")}`);
132
+ log.info(`Found multiple output files for ${path}, creating a tarball... ${outputFiles
133
+ .map((file) => file.path)
134
+ .join(", ")}`);
131
135
  forceTar = true;
132
136
  const startTime = performance.now();
133
137
  const tarball = new archiveNpm.Tarball();
134
138
  const mainPath = path.split(SEP).pop()?.split(".")[0] + ".js";
135
- const content = outputFiles.find((file) => file.path == "/" + mainPath)?.text ?? '';
139
+ const content = outputFiles.find((file) => file.path == "/" + mainPath)?.text ?? "";
136
140
  log.info(`Main content: ${content.length}chars`);
137
141
  tarball.append(new File([content], "main.js", { type: "text/plain" }));
138
142
  for (const file of outputFiles) {
@@ -175,7 +179,7 @@ export async function handleFile(path, workspace, alreadySynced, message, opts,
175
179
  workspaceRemote: workspace,
176
180
  schemaOnly: codebase ? true : undefined,
177
181
  globalDeps,
178
- codebases
182
+ codebases,
179
183
  }
180
184
  : undefined))?.payload;
181
185
  const workspaceId = workspace.workspaceId;
@@ -242,6 +246,7 @@ export async function handleFile(path, workspace, alreadySynced, message, opts,
242
246
  timeout: typed?.timeout,
243
247
  on_behalf_of_email: typed?.on_behalf_of_email,
244
248
  };
249
+ // console.log(requestBodyCommon.codebase);
245
250
  // log.info(JSON.stringify(requestBodyCommon, null, 2))
246
251
  // log.info(JSON.stringify(opts, null, 2))
247
252
  if (remote) {
package/esm/src/main.js CHANGED
@@ -38,7 +38,7 @@ export { flow, app, script, workspace, resource, resourceType, user, variable, h
38
38
  // console.error(JSON.stringify(event.error, null, 4));
39
39
  // }
40
40
  // });
41
- export const VERSION = "1.585.0";
41
+ export const VERSION = "1.586.0";
42
42
  export const WM_FORK_PREFIX = "wm-fork";
43
43
  const command = new Command()
44
44
  .name("wmill")
@@ -4,24 +4,33 @@ export function listSyncCodebases(options) {
4
4
  const res = [];
5
5
  const nb_codebase = options?.codebases?.length ?? 0;
6
6
  if (nb_codebase > 0) {
7
- log.info(`Found ${nb_codebase} codebases: ${options?.codebases?.map((c) => c.relative_path).join(", ")}`);
7
+ log.info(`Found ${nb_codebase} codebases: ${options?.codebases
8
+ ?.map((c) => c.relative_path)
9
+ .join(", ")}`);
8
10
  }
9
11
  for (const codebase of options?.codebases ?? []) {
10
12
  let _digest = undefined;
11
13
  let alreadyPrinted = false;
14
+ let hasAssets = false;
12
15
  const getDigest = async (forceTar) => {
13
- if (_digest == undefined || forceTar) {
16
+ if (_digest == undefined) {
14
17
  _digest = await digestDir(codebase.relative_path, JSON.stringify(codebase));
15
- if (forceTar || (Array.isArray(codebase.assets) && codebase.assets.length > 0)) {
16
- _digest += ".tar";
18
+ if (codebase.format == "esm") {
19
+ _digest += ".esm";
17
20
  }
18
21
  if (!alreadyPrinted) {
19
22
  alreadyPrinted = true;
20
23
  log.info(`Codebase ${codebase.relative_path}, digest: ${_digest}`);
21
24
  }
25
+ hasAssets =
26
+ Array.isArray(codebase.assets) && codebase.assets.length > 0;
27
+ }
28
+ if (forceTar || hasAssets) {
29
+ return _digest + ".tar";
30
+ }
31
+ else {
22
32
  return _digest;
23
33
  }
24
- return _digest;
25
34
  };
26
35
  res.push({ ...codebase, getDigest });
27
36
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "windmill-cli",
3
- "version": "1.585.0",
3
+ "version": "1.586.0",
4
4
  "description": "CLI for Windmill",
5
5
  "repository": {
6
6
  "type": "git",
@@ -32,7 +32,7 @@
32
32
  "esbuild": "*",
33
33
  "express": "*",
34
34
  "get-port": "7.1.0",
35
- "jszip": "3.7.1",
35
+ "jszip": "3.8.0",
36
36
  "minimatch": "*",
37
37
  "open": "*",
38
38
  "ws": "*",
@@ -1 +1 @@
1
- {"version":3,"file":"script.d.ts","sourceRoot":"","sources":["../../../../src/src/commands/script/script.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,aAAa,EAAE,MAAM,gBAAgB,CAAC;AAG/C,OAAO,EAEL,OAAO,EAQR,MAAM,kBAAkB,CAAC;AAW1B,OAAO,EAAE,SAAS,EAAE,MAAM,2BAA2B,CAAC;AAKtD,OAAO,EACL,0BAA0B,EAC1B,cAAc,EAGf,MAAM,8BAA8B,CAAC;AACtC,OAAO,EAIL,KAAK,EAEN,MAAM,iBAAiB,CAAC;AAQzB,OAAO,EAAE,YAAY,EAAqB,MAAM,yBAAyB,CAAC;AAO1E,MAAM,WAAW,UAAU;IACzB,WAAW,CAAC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AAG,MAAM,CAO1D;AAuCD,wBAAsB,OAAO,CAAC,KAAK,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,CAAC,CAiBzE;AA8CD,wBAAsB,SAAS,CAAC,SAAS,EAAE,MAAM,EAAE,EAAE,EAAE,MAAM,iBA6E5D;AAuED,MAAM,MAAM,UAAU,GAAG,GAAG,CAC1B,0BAA0B,EAC1B,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CACvB,CAAC;AAEF,wBAAsB,cAAc,IAAI,OAAO,CAAC,UAAU,CAAC,CA4B1D;AAuGD,QAAA,MAAM,OAAO;;;;;;;;;;;;;;;;;;;;oBA8CqB,CAAC;AAEnC,eAAe,OAAO,CAAC"}
@@ -22,7 +22,7 @@ import { pull as hubPull } from "./commands/hub/hub.js";
22
22
  import { pull, push } from "./commands/sync/sync.js";
23
23
  import { add as workspaceAdd } from "./commands/workspace/workspace.js";
24
24
  export { flow, app, script, workspace, resource, resourceType, user, variable, hub, folder, schedule, trigger, sync, gitsyncSettings, instance, dev, hubPull, pull, push, workspaceAdd, };
25
- export declare const VERSION = "1.585.0";
25
+ export declare const VERSION = "1.586.0";
26
26
  export declare const WM_FORK_PREFIX = "wm-fork";
27
27
  declare const command: Command<{
28
28
  workspace?: (import("../deps/jsr.io/@windmill-labs/cliffy-command/1.0.0-rc.5/mod.js").StringType & string) | undefined;
@@ -1 +1 @@
1
- {"version":3,"file":"codebase.d.ts","sourceRoot":"","sources":["../../../src/src/utils/codebase.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,WAAW,EAAE,MAAM,iBAAiB,CAAC;AAIxD,MAAM,MAAM,YAAY,GAAG,QAAQ,GAAG;IAAE,SAAS,EAAE,CAAC,QAAQ,CAAC,EAAE,OAAO,KAAK,OAAO,CAAC,MAAM,CAAC,CAAA;CAAE,CAAC;AAC7F,wBAAgB,iBAAiB,CAC/B,OAAO,EAAE,WAAW,GACnB,YAAY,EAAE,CA8BhB"}
1
+ {"version":3,"file":"codebase.d.ts","sourceRoot":"","sources":["../../../src/src/utils/codebase.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,WAAW,EAAE,MAAM,iBAAiB,CAAC;AAIxD,MAAM,MAAM,YAAY,GAAG,QAAQ,GAAG;IACpC,SAAS,EAAE,CAAC,QAAQ,CAAC,EAAE,OAAO,KAAK,OAAO,CAAC,MAAM,CAAC,CAAC;CACpD,CAAC;AACF,wBAAgB,iBAAiB,CAAC,OAAO,EAAE,WAAW,GAAG,YAAY,EAAE,CA0CtE"}