windmill-cli 1.638.1 → 1.638.3
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
CHANGED
|
@@ -62,36 +62,35 @@ async function initAction(opts) {
|
|
|
62
62
|
!opts.useDefault;
|
|
63
63
|
const shouldSkip = opts.bindProfile != true &&
|
|
64
64
|
(opts.useDefault || !dntShim.Deno.stdin.isTerminal());
|
|
65
|
-
if (shouldSkip) {
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
log.info(colors.yellow(`Active workspace profile: ${colors.bold(activeWorkspace.name)}`));
|
|
72
|
-
log.info(colors.yellow(` ${activeWorkspace.workspaceId} on ${activeWorkspace.remote}`));
|
|
73
|
-
}
|
|
74
|
-
if (shouldBind ||
|
|
75
|
-
(shouldPrompt &&
|
|
76
|
-
(await Confirm.prompt({
|
|
77
|
-
message: "Bind workspace profile to current Git branch?",
|
|
78
|
-
default: true,
|
|
79
|
-
})))) {
|
|
80
|
-
// Update the config with workspace binding
|
|
81
|
-
const currentConfig = await import("../../core/conf.js").then((m) => m.readConfigFile());
|
|
82
|
-
if (!currentConfig.gitBranches) {
|
|
83
|
-
currentConfig.gitBranches = {};
|
|
65
|
+
if (!shouldSkip) {
|
|
66
|
+
// Show workspace info if we're binding or prompting
|
|
67
|
+
if (shouldBind || shouldPrompt) {
|
|
68
|
+
log.info(colors.yellow(`\nCurrent Git branch: ${colors.bold(currentBranch)}`));
|
|
69
|
+
log.info(colors.yellow(`Active workspace profile: ${colors.bold(activeWorkspace.name)}`));
|
|
70
|
+
log.info(colors.yellow(` ${activeWorkspace.workspaceId} on ${activeWorkspace.remote}`));
|
|
84
71
|
}
|
|
85
|
-
if (
|
|
86
|
-
|
|
72
|
+
if (shouldBind ||
|
|
73
|
+
(shouldPrompt &&
|
|
74
|
+
(await Confirm.prompt({
|
|
75
|
+
message: "Bind workspace profile to current Git branch?",
|
|
76
|
+
default: true,
|
|
77
|
+
})))) {
|
|
78
|
+
// Update the config with workspace binding
|
|
79
|
+
const currentConfig = await import("../../core/conf.js").then((m) => m.readConfigFile());
|
|
80
|
+
if (!currentConfig.gitBranches) {
|
|
81
|
+
currentConfig.gitBranches = {};
|
|
82
|
+
}
|
|
83
|
+
if (!currentConfig.gitBranches[currentBranch]) {
|
|
84
|
+
currentConfig.gitBranches[currentBranch] = { overrides: {} };
|
|
85
|
+
}
|
|
86
|
+
log.info(`binding branch ${currentBranch} to workspace ${activeWorkspace.name} on ${activeWorkspace.remote}`);
|
|
87
|
+
currentConfig.gitBranches[currentBranch].baseUrl =
|
|
88
|
+
activeWorkspace.remote;
|
|
89
|
+
currentConfig.gitBranches[currentBranch].workspaceId =
|
|
90
|
+
activeWorkspace.workspaceId;
|
|
91
|
+
await dntShim.Deno.writeTextFile("wmill.yaml", yamlStringify(currentConfig));
|
|
92
|
+
log.info(colors.green(`✓ Bound branch '${currentBranch}' to workspace '${activeWorkspace.name}'`));
|
|
87
93
|
}
|
|
88
|
-
log.info(`binding branch ${currentBranch} to workspace ${activeWorkspace.name} on ${activeWorkspace.remote}`);
|
|
89
|
-
currentConfig.gitBranches[currentBranch].baseUrl =
|
|
90
|
-
activeWorkspace.remote;
|
|
91
|
-
currentConfig.gitBranches[currentBranch].workspaceId =
|
|
92
|
-
activeWorkspace.workspaceId;
|
|
93
|
-
await dntShim.Deno.writeTextFile("wmill.yaml", yamlStringify(currentConfig));
|
|
94
|
-
log.info(colors.green(`✓ Bound branch '${currentBranch}' to workspace '${activeWorkspace.name}'`));
|
|
95
94
|
}
|
|
96
95
|
}
|
|
97
96
|
}
|
|
@@ -106,67 +105,68 @@ async function initAction(opts) {
|
|
|
106
105
|
if (!activeWorkspace) {
|
|
107
106
|
log.info("No workspace configured. Using default settings.");
|
|
108
107
|
log.info("You can configure a workspace later with 'wmill workspace add'");
|
|
109
|
-
return;
|
|
110
108
|
}
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
settings.git_sync
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
109
|
+
else {
|
|
110
|
+
await requireLogin(opts);
|
|
111
|
+
const workspace = await resolveWorkspace(opts);
|
|
112
|
+
const wmill = await import("../../../gen/services.gen.js");
|
|
113
|
+
const settings = await wmill.getSettings({
|
|
114
|
+
workspace: workspace.workspaceId,
|
|
115
|
+
});
|
|
116
|
+
if (settings.git_sync?.repositories &&
|
|
117
|
+
settings.git_sync.repositories.length > 0) {
|
|
118
|
+
let useBackendSettings = opts.useBackend;
|
|
119
|
+
// If repository is specified, implicitly use backend settings
|
|
120
|
+
if (opts.repository && !opts.useDefault) {
|
|
121
|
+
useBackendSettings = true;
|
|
122
|
+
}
|
|
123
|
+
if (useBackendSettings === undefined) {
|
|
124
|
+
// Interactive prompt
|
|
125
|
+
const { Select } = await import("../../../deps.js");
|
|
126
|
+
const choice = await Select.prompt({
|
|
127
|
+
message: "Git-sync settings found on backend. What would you like to do?",
|
|
128
|
+
options: [
|
|
129
|
+
{
|
|
130
|
+
name: "Use backend git-sync settings",
|
|
131
|
+
value: "backend",
|
|
132
|
+
},
|
|
133
|
+
{
|
|
134
|
+
name: "Use default settings",
|
|
135
|
+
value: "default",
|
|
136
|
+
},
|
|
137
|
+
{
|
|
138
|
+
name: "Cancel",
|
|
139
|
+
value: "cancel",
|
|
140
|
+
},
|
|
141
|
+
],
|
|
142
|
+
});
|
|
143
|
+
if (choice === "cancel") {
|
|
144
|
+
// Clean up the created files
|
|
145
|
+
try {
|
|
146
|
+
await dntShim.Deno.remove("wmill.yaml");
|
|
147
|
+
await dntShim.Deno.remove("wmill-lock.yaml");
|
|
148
|
+
}
|
|
149
|
+
catch (e) {
|
|
150
|
+
// Ignore cleanup errors
|
|
151
|
+
}
|
|
152
|
+
log.info("Init cancelled");
|
|
153
|
+
dntShim.Deno.exit(0);
|
|
152
154
|
}
|
|
153
|
-
|
|
154
|
-
|
|
155
|
+
useBackendSettings = choice === "backend";
|
|
156
|
+
}
|
|
157
|
+
if (useBackendSettings) {
|
|
158
|
+
log.info("Applying git-sync settings from backend...");
|
|
159
|
+
// Import and run the pull git-sync settings logic
|
|
160
|
+
const { pullGitSyncSettings } = await import("../gitsync-settings/gitsync-settings.js");
|
|
161
|
+
await pullGitSyncSettings({
|
|
162
|
+
...opts,
|
|
163
|
+
repository: opts.repository,
|
|
164
|
+
jsonOutput: false,
|
|
165
|
+
diff: false,
|
|
166
|
+
replace: true, // Auto-replace when using backend settings during init
|
|
167
|
+
});
|
|
168
|
+
log.info(colors.green("Git-sync settings applied from backend"));
|
|
155
169
|
}
|
|
156
|
-
useBackendSettings = choice === "backend";
|
|
157
|
-
}
|
|
158
|
-
if (useBackendSettings) {
|
|
159
|
-
log.info("Applying git-sync settings from backend...");
|
|
160
|
-
// Import and run the pull git-sync settings logic
|
|
161
|
-
const { pullGitSyncSettings } = await import("../gitsync-settings/gitsync-settings.js");
|
|
162
|
-
await pullGitSyncSettings({
|
|
163
|
-
...opts,
|
|
164
|
-
repository: opts.repository,
|
|
165
|
-
jsonOutput: false,
|
|
166
|
-
diff: false,
|
|
167
|
-
replace: true, // Auto-replace when using backend settings during init
|
|
168
|
-
});
|
|
169
|
-
log.info(colors.green("Git-sync settings applied from backend"));
|
|
170
170
|
}
|
|
171
171
|
}
|
|
172
172
|
}
|
package/esm/src/main.js
CHANGED
|
@@ -47,7 +47,7 @@ export { flow, app, script, workspace, resource, resourceType, user, variable, h
|
|
|
47
47
|
// console.error(JSON.stringify(event.error, null, 4));
|
|
48
48
|
// }
|
|
49
49
|
// });
|
|
50
|
-
export const VERSION = "1.638.
|
|
50
|
+
export const VERSION = "1.638.3";
|
|
51
51
|
// Re-exported from constants.ts to maintain backwards compatibility
|
|
52
52
|
export { WM_FORK_PREFIX } from "./core/constants.js";
|
|
53
53
|
const command = new Command()
|
package/package.json
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"init.d.ts","sourceRoot":"","sources":["../../../../src/src/commands/init/init.ts"],"names":[],"mappings":"AACA,OAAO,EAAU,OAAO,EAA+B,MAAM,kBAAkB,CAAC;AAqBhF,MAAM,WAAW,WAAW;IAC1B,UAAU,CAAC,EAAE,OAAO,CAAC;IACrB,UAAU,CAAC,EAAE,OAAO,CAAC;IACrB,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,KAAK,CAAC,EAAE,OAAO,CAAC;IAChB,SAAS,CAAC,EAAE,OAAO,CAAC;IACpB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,WAAW,CAAC,EAAE,OAAO,CAAC;CACvB;
|
|
1
|
+
{"version":3,"file":"init.d.ts","sourceRoot":"","sources":["../../../../src/src/commands/init/init.ts"],"names":[],"mappings":"AACA,OAAO,EAAU,OAAO,EAA+B,MAAM,kBAAkB,CAAC;AAqBhF,MAAM,WAAW,WAAW;IAC1B,UAAU,CAAC,EAAE,OAAO,CAAC;IACrB,UAAU,CAAC,EAAE,OAAO,CAAC;IACrB,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,KAAK,CAAC,EAAE,OAAO,CAAC;IAChB,SAAS,CAAC,EAAE,OAAO,CAAC;IACpB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,WAAW,CAAC,EAAE,OAAO,CAAC;CACvB;AAmTD,QAAA,MAAM,OAAO;;;;;;;;;;;;;;;;;;mBAae,CAAC;AAE7B,eAAe,OAAO,CAAC"}
|
package/types/src/main.d.ts
CHANGED
|
@@ -23,7 +23,7 @@ import { pull as hubPull } from "./commands/hub/hub.js";
|
|
|
23
23
|
import { pull, push } from "./commands/sync/sync.js";
|
|
24
24
|
import { add as workspaceAdd } from "./commands/workspace/workspace.js";
|
|
25
25
|
export { flow, app, script, workspace, resource, resourceType, user, variable, hub, folder, schedule, trigger, sync, lint, gitsyncSettings, instance, dev, hubPull, pull, push, workspaceAdd, };
|
|
26
|
-
export declare const VERSION = "1.638.
|
|
26
|
+
export declare const VERSION = "1.638.3";
|
|
27
27
|
export { WM_FORK_PREFIX } from "./core/constants.js";
|
|
28
28
|
declare const command: Command<{
|
|
29
29
|
workspace?: (import("../deps/jsr.io/@windmill-labs/cliffy-command/1.0.0-rc.5/mod.js").StringType & string) | undefined;
|