Skip to content

Commit 1192978

Browse files
committed
-
1 parent b1f3b3b commit 1192978

34 files changed

Lines changed: 2272 additions & 360 deletions

apps/cli/src/commands/pipelines.ts

Lines changed: 6 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { PipelabContext, setupConfigFile, deleteConfigFile } from "@pipelab/core-node";
1+
import { PipelabContext, setupProjectsConfigFile, deletePipelineConfigFileByName } from "@pipelab/core-node";
22
import { FileRepo, SaveLocation } from "@pipelab/shared";
33
import { readFile, unlink, readdir } from "node:fs/promises";
44
import { getDefaultUserDataPath } from "../paths";
@@ -9,7 +9,7 @@ export async function listPipelinesCommand(options: { userData?: string }) {
99
const context = new PipelabContext({ userDataPath });
1010

1111
try {
12-
const projectsConfig = await setupConfigFile<FileRepo>("projects", { context });
12+
const projectsConfig = await setupProjectsConfigFile(context);
1313
const repo = await projectsConfig.getConfig();
1414

1515
if (!repo.pipelines || repo.pipelines.length === 0) {
@@ -73,7 +73,7 @@ export async function showPipelineCommand(
7373
const context = new PipelabContext({ userDataPath });
7474

7575
try {
76-
const projectsConfig = await setupConfigFile<FileRepo>("projects", { context });
76+
const projectsConfig = await setupProjectsConfigFile(context);
7777
const repo = await projectsConfig.getConfig();
7878

7979
const pipeline = repo.pipelines?.find(
@@ -217,7 +217,7 @@ export async function deletePipelineCommand(
217217
const context = new PipelabContext({ userDataPath });
218218

219219
try {
220-
const projectsConfig = await setupConfigFile<FileRepo>("projects", { context });
220+
const projectsConfig = await setupProjectsConfigFile(context);
221221
const repo = await projectsConfig.getConfig();
222222

223223
if (!repo.pipelines) {
@@ -239,12 +239,10 @@ export async function deletePipelineCommand(
239239
// 1. Delete internal file if applicable
240240
if (pipeline.type === "internal") {
241241
try {
242-
await deleteConfigFile(pipeline.configName, context);
242+
await deletePipelineConfigFileByName(pipeline.configName, context);
243243
console.log(`Deleted pipeline file: ${pipeline.configName}.json`);
244244
} catch (e: any) {
245-
if (e.code !== "ENOENT") {
246-
console.warn(`Warning: Could not delete pipeline file: ${e.message}`);
247-
}
245+
console.warn(`Warning: Could not delete pipeline file: ${e.message}`);
248246
}
249247
}
250248

apps/cli/src/commands/setup.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import * as p from "@clack/prompts";
22
import { setTimeout } from "node:timers/promises";
33
import { PipelabContext } from "@pipelab/core-node";
4-
import { setupConfigFile } from "@pipelab/core-node";
4+
import { setupSettingsConfigFile } from "@pipelab/core-node";
55
import { AppConfig } from "@pipelab/shared";
66
import { getDefaultUserDataPath } from "../paths";
77

@@ -43,7 +43,7 @@ export async function setupCommand(options: { userData?: string }) {
4343
}
4444

4545
// 2. Configuration
46-
const settings = await setupConfigFile<AppConfig>("settings", { context });
46+
const settings = await setupSettingsConfigFile(context);
4747
const config = await settings.getConfig();
4848

4949
const configChanges = await p.group({

apps/ui/src/App.vue

Lines changed: 13 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,7 @@
2828
</transition>
2929
<DevBenefitsOverride v-if="!isDisconnected" />
3030
<WebFilePicker v-if="!isDisconnected" />
31+
<MigrationModal v-if="isMigrationModalVisible" v-model:visible="isMigrationModalVisible" />
3132
<Toast />
3233
</div>
3334
</template>
@@ -50,6 +51,8 @@ import DevBenefitsOverride from "./components/DevBenefitsOverride.vue";
5051
import WebFilePicker from "./components/WebFilePicker.vue";
5152
import Dialog from "primevue/dialog";
5253
import Toast from "primevue/toast";
54+
import MigrationModal from "./components/MigrationModal.vue";
55+
import { useAPI } from "./composables/api";
5356
import { websocketManager } from "./composables/websocket-manager";
5457
import { useWebSocketAPI } from "./composables/websocket-client";
5558
@@ -73,6 +76,12 @@ const isServerReady = ref(false);
7376
const isUpgradeDialogVisible = ref(false);
7477
const minimumLoadingTimeReached = ref(false);
7578
79+
const isMigrationModalVisible = ref(false);
80+
const openMigrationModal = () => {
81+
isMigrationModalVisible.value = true;
82+
};
83+
provide("openMigrationModal", openMigrationModal);
84+
7685
const isDisconnected = computed(
7786
() =>
7887
isInitialized.value &&
@@ -241,14 +250,16 @@ onMounted(async () => {
241250

242251
<style lang="scss">
243252
.app,
244-
.layout,
245-
.content {
253+
.layout {
246254
height: 100%;
247255
overflow: hidden;
248256
}
249257
250258
.content {
251259
display: flex;
260+
position: relative;
261+
flex: 1;
262+
min-height: 0;
252263
253264
.main {
254265
flex: 1;

0 commit comments

Comments
 (0)