create-interview-cockpit 0.17.3 → 0.19.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.
@@ -1,6 +1,8 @@
1
1
  import { useState } from "react";
2
2
  import { useStore } from "../store";
3
- import { parseInfraLabWorkspace } from "../infraLab";
3
+ import { DOCKER_DEEP_DIVE_LAB, parseInfraLabWorkspace } from "../infraLab";
4
+ import { DEFAULT_GHA_LAB, parseGhaLabWorkspace } from "../githubActionsLab";
5
+ import { ENTERPRISE_LOCAL_AUTH_LAB } from "../enterpriseLocalLab";
4
6
  import {
5
7
  parseFrontendLabWorkspace,
6
8
  ISOLATED_MODULE_FEDERATION_LAB,
@@ -8,6 +10,7 @@ import {
8
10
  NEXTJS_MF_RUNTIME_LAB,
9
11
  NEXTJS_MULTI_ZONES_LAB,
10
12
  NEXTJS_MF_RUNTIME_API_LAB,
13
+ NEXTJS_BFF_AUTH_CLIENT_LAB,
11
14
  RSPACK_SHELL_LAB,
12
15
  } from "../reactLab";
13
16
  import { BROWSER_SECURITY_TEMPLATES } from "../browserSecurityTemplates";
@@ -29,6 +32,7 @@ import {
29
32
  Network,
30
33
  Shield,
31
34
  PenLine,
35
+ GitBranch,
32
36
  } from "lucide-react";
33
37
 
34
38
  // ─── Helpers ─────────────────────────────────────────────
@@ -41,6 +45,7 @@ const LAB_ORIGINS = new Set([
41
45
  "nextjs",
42
46
  "module-federation",
43
47
  "canvas",
48
+ "github-actions",
44
49
  ]);
45
50
 
46
51
  function isLabFile(cf: ContextFile) {
@@ -196,6 +201,7 @@ export default function LabsPanel() {
196
201
  currentQuestion,
197
202
  openSandbox,
198
203
  openInfraLab,
204
+ openGhaLab,
199
205
  openReactLab,
200
206
  openNextLab,
201
207
  openModuleFederationLab,
@@ -302,6 +308,18 @@ export default function LabsPanel() {
302
308
  if (parsed) openInfraLab(parsed, cf.id);
303
309
  };
304
310
 
311
+ const openGhaFile = async (cf: ContextFile) => {
312
+ try {
313
+ const raw = await fetch(`/api/context-files/${cf.id}/content`)
314
+ .then((r) => r.json())
315
+ .then((d) => d.content as string);
316
+ const parsed = parseGhaLabWorkspace(raw);
317
+ if (parsed) openGhaLab(parsed, cf.id);
318
+ } catch {
319
+ /* ignore */
320
+ }
321
+ };
322
+
305
323
  const openReactFile = async (cf: ContextFile) => {
306
324
  try {
307
325
  const raw = await fetch(`/api/context-files/${cf.id}/content`)
@@ -606,13 +624,50 @@ export default function LabsPanel() {
606
624
  iconColor="text-cyan-400/70"
607
625
  origin="infra"
608
626
  emptyText="Save an infra lab to reopen it here"
609
- onNewLab={() => openInfraLab()}
610
- newLabTitle="Open Infrastructure Lab"
627
+ newLabMenu={[
628
+ {
629
+ label: "AWS LocalStack S3",
630
+ description:
631
+ "Terraform AWS provider pointed at local emulation",
632
+ onClick: () => openInfraLab(),
633
+ },
634
+ {
635
+ label: "Docker Deep Dive",
636
+ description:
637
+ "Dockerfile + Compose + Node API + Redis, with command-line practice",
638
+ onClick: () => openInfraLab(DOCKER_DEEP_DIVE_LAB),
639
+ },
640
+ {
641
+ label: "Enterprise BFF Docker Stack",
642
+ description:
643
+ "Terraform deploys NestJS BFF, OIDC mock, Redis & claims API",
644
+ onClick: () => openInfraLab(ENTERPRISE_LOCAL_AUTH_LAB),
645
+ },
646
+ ]}
611
647
  onOpen={openInfraFile}
612
648
  openTitle="Open in Infrastructure Lab"
613
649
  accentClass="text-cyan-200"
614
650
  bgClass="bg-cyan-500/10 border border-cyan-500/20"
615
651
  />
652
+ <Section
653
+ title="GitHub Actions"
654
+ icon={GitBranch}
655
+ iconColor="text-amber-400/70"
656
+ origin="github-actions"
657
+ emptyText="Save a GitHub Actions lab to reopen it here"
658
+ newLabMenu={[
659
+ {
660
+ label: "Workflows + Composite Action",
661
+ description:
662
+ "Multi-job CI workflow with a local composite action and a matrix build",
663
+ onClick: () => openGhaLab(DEFAULT_GHA_LAB),
664
+ },
665
+ ]}
666
+ onOpen={openGhaFile}
667
+ openTitle="Open in GitHub Actions Lab"
668
+ accentClass="text-amber-200"
669
+ bgClass="bg-amber-500/10 border border-amber-500/20"
670
+ />
616
671
  <Section
617
672
  title="React Labs"
618
673
  icon={Atom}
@@ -632,8 +687,19 @@ export default function LabsPanel() {
632
687
  iconColor="text-violet-400/70"
633
688
  origin="nextjs"
634
689
  emptyText="Save a Next.js lab to reopen it here"
635
- onNewLab={() => openNextLab()}
636
- newLabTitle="Open Next.js Lab"
690
+ newLabMenu={[
691
+ {
692
+ label: "Blank App Router",
693
+ description: "Standard Next.js App Router practice lab",
694
+ onClick: () => openNextLab(),
695
+ },
696
+ {
697
+ label: "BFF Auth Client",
698
+ description:
699
+ "Next.js shell that signs in through the local Terraform-deployed BFF",
700
+ onClick: () => openNextLab(NEXTJS_BFF_AUTH_CLIENT_LAB),
701
+ },
702
+ ]}
637
703
  onOpen={openNextFile}
638
704
  openTitle="Open in Next.js Lab"
639
705
  accentClass="text-violet-200"