windmill-cli 1.563.3 → 1.563.4
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/esm/gen/core/OpenAPI.js +1 -1
- package/esm/src/commands/flow/flow.js +1 -1
- package/esm/src/main.js +1 -1
- package/esm/src/utils/metadata.js +27 -6
- package/package.json +1 -1
- package/types/src/main.d.ts +1 -1
- package/types/src/utils/metadata.d.ts +1 -0
- package/types/src/utils/metadata.d.ts.map +1 -1
package/esm/gen/core/OpenAPI.js
CHANGED
|
@@ -171,7 +171,7 @@ async function generateLocks(opts, folder) {
|
|
|
171
171
|
const candidate = await generateFlowLockInternal(folder, true, workspace, opts, undefined, undefined, useRawReqs);
|
|
172
172
|
if (candidate) {
|
|
173
173
|
hasAny = true;
|
|
174
|
-
log.info(colors.
|
|
174
|
+
log.info(colors.yellow.bold(`~ ${candidate}`));
|
|
175
175
|
}
|
|
176
176
|
}
|
|
177
177
|
if (hasAny) {
|
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.563.
|
|
41
|
+
export const VERSION = "1.563.4";
|
|
42
42
|
export const WM_FORK_PREFIX = "wm-fork";
|
|
43
43
|
const command = new Command()
|
|
44
44
|
.name("wmill")
|
|
@@ -5,8 +5,8 @@ import { defaultScriptMetadata, } from "../../bootstrap/script_bootstrap.js";
|
|
|
5
5
|
import { languagesWithRawReqsSupport, } from "./script_common.js";
|
|
6
6
|
import { inferContentTypeFromFilePath } from "./script_common.js";
|
|
7
7
|
import { exts, findGlobalDeps } from "../commands/script/script.js";
|
|
8
|
-
import { FSFSElement, findCodebase, yamlOptions } from "../commands/sync/sync.js";
|
|
9
|
-
import { generateHash, readInlinePathSync, getHeaders, writeIfChanged } from "./utils.js";
|
|
8
|
+
import { FSFSElement, findCodebase, yamlOptions, } from "../commands/sync/sync.js";
|
|
9
|
+
import { generateHash, readInlinePathSync, getHeaders, writeIfChanged, } from "./utils.js";
|
|
10
10
|
import { replaceInlineScripts } from "../../windmill-utils-internal/src/inline-scripts/replacer.js";
|
|
11
11
|
import { extractInlineScripts as extractInlineScriptsForFlows } from "../../windmill-utils-internal/src/inline-scripts/extractor.js";
|
|
12
12
|
import { argSigToJsonSchemaType } from "../../windmill-utils-internal/src/parse/parse-schema.js";
|
|
@@ -110,14 +110,14 @@ export async function generateFlowLockInternal(folder, dryRun, workspace, opts,
|
|
|
110
110
|
//removeChangedLocks
|
|
111
111
|
flowValue.value = await updateFlow(workspace, flowValue.value, remote_path, rawReqs);
|
|
112
112
|
const inlineScripts = extractInlineScriptsForFlows(flowValue.value.modules, {}, SEP, opts.defaultTs);
|
|
113
|
-
inlineScripts
|
|
114
|
-
.forEach((s) => {
|
|
113
|
+
inlineScripts.forEach((s) => {
|
|
115
114
|
writeIfChanged(dntShim.Deno.cwd() + SEP + folder + SEP + s.path, s.content);
|
|
116
115
|
});
|
|
117
116
|
// Overwrite `flow.yaml` with the new lockfile references
|
|
118
117
|
writeIfChanged(dntShim.Deno.cwd() + SEP + folder + SEP + "flow.yaml", yamlStringify(flowValue));
|
|
119
118
|
}
|
|
120
119
|
hashes = await generateFlowHash(rawReqs, folder, opts.defaultTs);
|
|
120
|
+
await clearGlobalLock(folder);
|
|
121
121
|
for (const [path, hash] of Object.entries(hashes)) {
|
|
122
122
|
await updateMetadataGlobalLock(folder, hash, path);
|
|
123
123
|
}
|
|
@@ -442,7 +442,7 @@ export async function inferSchema(language, content, currentSchema, path) {
|
|
|
442
442
|
else if (language === "ruby") {
|
|
443
443
|
const { parse_ruby } = await import("../../wasm/ruby/windmill_parser_wasm.js");
|
|
444
444
|
inferedSchema = JSON.parse(parse_ruby(content));
|
|
445
|
-
// for related places search: ADD_NEW_LANG
|
|
445
|
+
// for related places search: ADD_NEW_LANG
|
|
446
446
|
}
|
|
447
447
|
else {
|
|
448
448
|
throw new Error("Invalid language: " + language);
|
|
@@ -606,6 +606,27 @@ export async function checkifMetadataUptodate(path, hash, conf, subpath) {
|
|
|
606
606
|
export async function generateScriptHash(rawReqs, scriptContent, newMetadataContent) {
|
|
607
607
|
return await generateHash((rawReqs ?? "") + scriptContent + newMetadataContent);
|
|
608
608
|
}
|
|
609
|
+
export async function clearGlobalLock(path) {
|
|
610
|
+
const conf = await readLockfile();
|
|
611
|
+
if (!conf?.locks) {
|
|
612
|
+
conf.locks = {};
|
|
613
|
+
}
|
|
614
|
+
const isV2 = conf?.version == "v2";
|
|
615
|
+
if (isV2) {
|
|
616
|
+
// Remove the specific v2 lock entry
|
|
617
|
+
const key = v2LockPath(path);
|
|
618
|
+
if (conf.locks) {
|
|
619
|
+
Object.keys(conf.locks).forEach((k) => {
|
|
620
|
+
if (conf.locks) {
|
|
621
|
+
if (k.startsWith(key)) {
|
|
622
|
+
delete conf.locks[k];
|
|
623
|
+
}
|
|
624
|
+
}
|
|
625
|
+
});
|
|
626
|
+
}
|
|
627
|
+
await dntShim.Deno.writeTextFile(WMILL_LOCKFILE, yamlStringify(conf, yamlOptions));
|
|
628
|
+
}
|
|
629
|
+
}
|
|
609
630
|
export async function updateMetadataGlobalLock(path, hash, subpath) {
|
|
610
631
|
const conf = await readLockfile();
|
|
611
632
|
if (!conf?.locks) {
|
|
@@ -613,7 +634,7 @@ export async function updateMetadataGlobalLock(path, hash, subpath) {
|
|
|
613
634
|
}
|
|
614
635
|
const isV2 = conf?.version == "v2";
|
|
615
636
|
if (isV2) {
|
|
616
|
-
conf.locks[v2LockPath(path,
|
|
637
|
+
conf.locks[v2LockPath(path, subpath)] = hash;
|
|
617
638
|
}
|
|
618
639
|
else {
|
|
619
640
|
if (subpath) {
|
package/package.json
CHANGED
package/types/src/main.d.ts
CHANGED
|
@@ -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.563.
|
|
25
|
+
export declare const VERSION = "1.563.4";
|
|
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;
|
|
@@ -47,6 +47,7 @@ interface Lock {
|
|
|
47
47
|
export declare function readLockfile(): Promise<Lock>;
|
|
48
48
|
export declare function checkifMetadataUptodate(path: string, hash: string, conf: Lock | undefined, subpath?: string): Promise<boolean>;
|
|
49
49
|
export declare function generateScriptHash(rawReqs: string | undefined, scriptContent: string, newMetadataContent: string): Promise<string>;
|
|
50
|
+
export declare function clearGlobalLock(path: string): Promise<void>;
|
|
50
51
|
export declare function updateMetadataGlobalLock(path: string, hash: string, subpath?: string): Promise<void>;
|
|
51
52
|
export {};
|
|
52
53
|
//# sourceMappingURL=metadata.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"metadata.d.ts","sourceRoot":"","sources":["../../../src/src/utils/metadata.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,aAAa,EAAE,MAAM,aAAa,CAAC;AAa5C,OAAO,EAAE,SAAS,EAAE,MAAM,oCAAoC,CAAC;AAC/D,OAAO,EAGL,cAAc,EACf,MAAM,oBAAoB,CAAC;AAE5B,OAAO,EAAE,UAAU,EAAwB,MAAM,8BAA8B,CAAC;
|
|
1
|
+
{"version":3,"file":"metadata.d.ts","sourceRoot":"","sources":["../../../src/src/utils/metadata.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,aAAa,EAAE,MAAM,aAAa,CAAC;AAa5C,OAAO,EAAE,SAAS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