Skip to content

Commit b49b5ee

Browse files
committed
vibed up a sweet halifax theme
Signed-off-by: kpenfound <kyle@dagger.io>
1 parent 43011b2 commit b49b5ee

File tree

7 files changed

+82
-36
lines changed

7 files changed

+82
-36
lines changed

.dagger/debugger.go

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,8 +21,9 @@ func (g *Greetings) DebugTests(
2121
// Check if backend is broken
2222
if _, berr := g.Backend.CheckDirectory(ctx, g.Backend.Source()); berr != nil {
2323
ws := dag.Workspace(
24-
g.Backend.Source(),
24+
g.Source,
2525
g.Backend.AsWorkspaceCheckable(),
26+
".",
2627
)
2728
env := dag.Env().
2829
WithWorkspaceInput("workspace", ws, "workspace to read, write, and test code").
@@ -39,8 +40,9 @@ func (g *Greetings) DebugTests(
3940
// Check if frontend is broken
4041
if _, ferr := g.Frontend.CheckDirectory(ctx, g.Frontend.Source()); ferr != nil {
4142
ws := dag.Workspace(
42-
g.Frontend.Source(),
43+
g.Source,
4344
g.Frontend.AsWorkspaceCheckable(),
45+
"website",
4446
)
4547
env := dag.Env().
4648
WithWorkspaceInput("workspace", ws, "workspace to read, write, and test code").

.dagger/develop.go

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@ func (g *Greetings) Develop(
2424
g.Source,
2525
// FIXME: no great way to determine which checker without submodule or self calls
2626
g.Backend.AsWorkspaceCheckable(),
27+
".",
2728
)
2829

2930
env := dag.Env().
@@ -117,6 +118,7 @@ func (g *Greetings) DevelopFeedback(
117118
source,
118119
// FIXME: no great way to determine which checker without submodule or self calls
119120
g.Backend.AsWorkspaceCheckable(),
121+
".",
120122
)
121123

122124
env := dag.Env().

.dagger/review.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,7 @@ func (g *Greetings) DevelopReview(
2828
source,
2929
// FIXME: no great way to determine which checker without submodule or self calls
3030
g.Backend.AsWorkspaceCheckable(),
31+
".",
3132
)
3233

3334
env := dag.Env().

.dagger/workspace/main.go

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,8 @@ type Checkable interface {
1616

1717
// Place to do work and check it
1818
type Workspace struct {
19-
Work *dagger.Directory
19+
Work *dagger.Directory
20+
CheckDirectory string
2021
// +private
2122
Start *dagger.Directory
2223
// +private
@@ -28,11 +29,14 @@ func New(
2829
source *dagger.Directory,
2930
// Checker to use for testing
3031
checker Checkable,
32+
// Path to execute checker on
33+
checkDirectory string,
3134
) *Workspace {
3235
return &Workspace{
33-
Start: source,
34-
Work: source,
35-
Checker: checker,
36+
Start: source,
37+
Work: source,
38+
Checker: checker,
39+
CheckDirectory: checkDirectory,
3640
}
3741
}
3842

@@ -76,7 +80,7 @@ func (w *Workspace) Tree(ctx context.Context) (string, error) {
7680

7781
// Run the tests in the workspace
7882
func (w *Workspace) Check(ctx context.Context) (string, error) {
79-
return w.Checker.CheckDirectory(ctx, w.Work)
83+
return w.Checker.CheckDirectory(ctx, w.Work.Directory(w.CheckDirectory))
8084
}
8185

8286
// Show the changes made to the workspace so far in unified diff format

dagger.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "greetings",
3-
"engineVersion": "v0.18.12",
3+
"engineVersion": "v0.18.16",
44
"sdk": {
55
"source": "go"
66
},

website/cypress/e2e/greeting_test.cy.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,19 +3,19 @@
33
describe("Greetings API", () => {
44
it("should display a greeting", () => {
55
cy.visit("/");
6-
cy.get("h1").should("contain", "Greetings Daggernauts");
6+
cy.get("h1").should("contain", "Greetings Halifax!");
77
});
88

99
it("should change the greeting when the button is clicked", () => {
1010
cy.visit("/");
1111
cy.get("#greetingDisplay").should(
1212
"contain",
13-
"Click the button to see a greeting!",
13+
"Click the button to see a Maritime greeting!",
1414
);
1515
cy.get("#randomGreetingButton").click();
1616
cy.get("#greetingDisplay").should(
1717
"not.contain",
18-
"Click the button to see a greeting!",
18+
"Click the button to see a Maritime greeting!",
1919
);
2020
});
2121
});

website/index.html

Lines changed: 62 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -1,32 +1,69 @@
1-
<!DOCTYPE html>
1+
<!doctype html>
22
<html lang="en">
3-
<head>
4-
<meta charset="UTF-8">
5-
<meta name="viewport" content="width=device-width, initial-scale=1.0">
6-
<title>Greetings App</title>
7-
<link href="https://cdn.jsdelivr.net/npm/tailwindcss@2.2.19/dist/tailwind.min.css" rel="stylesheet">
8-
</head>
9-
<body class="bg-purple-900 text-white font-sans flex flex-col items-center justify-center min-h-screen">
3+
<head>
4+
<meta charset="UTF-8" />
5+
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
6+
<title>Halifax Harbour Greetings</title>
7+
<link
8+
href="https://cdn.jsdelivr.net/npm/tailwindcss@2.2.19/dist/tailwind.min.css"
9+
rel="stylesheet"
10+
/>
11+
<style>
12+
.maritime-gradient {
13+
background: linear-gradient(
14+
135deg,
15+
#1e3a8a 0%,
16+
#0369a1 50%,
17+
#059669 100%
18+
);
19+
}
20+
.harbor-blue {
21+
background-color: #1e40af;
22+
}
23+
.lighthouse-beacon {
24+
animation: pulse 2s infinite;
25+
}
26+
</style>
27+
</head>
28+
<body
29+
class="maritime-gradient text-white font-sans flex flex-col items-center justify-center min-h-screen"
30+
>
1031
<div class="container mx-auto px-4 py-8 max-w-screen-md">
11-
<h1 class="text-3xl font-bold mb-4">Greetings Daggernauts</h1>
12-
<div id="greetingDisplay" class="greeting bg-purple-700 rounded shadow p-4 min-h-20 flex items-center justify-center">
13-
Click the button to see a greeting!
14-
</div>
15-
<button id="randomGreetingButton" class="bg-purple-500 hover:bg-purple-400 text-white font-bold py-2 px-4 rounded mt-4">👋</button>
32+
<h1 class="text-3xl font-bold mb-2">🌊 Halifax Harbour Greetings ⚓</h1>
33+
<p class="text-blue-200 mb-4 text-center">
34+
Welcome to the Atlantic's finest port city!
35+
</p>
36+
<div
37+
id="greetingDisplay"
38+
class="greeting harbor-blue rounded-lg shadow-lg p-6 min-h-20 flex items-center justify-center border-2 border-blue-300"
39+
>
40+
Click the button to receive a Maritime welcome!
41+
</div>
42+
<button
43+
id="randomGreetingButton"
44+
class="bg-teal-600 hover:bg-teal-500 text-white font-bold py-3 px-6 rounded-lg mt-4 lighthouse-beacon shadow-lg transition-all duration-200 hover:shadow-xl"
45+
>
46+
🦞 Ahoy!
47+
</button>
1648
</div>
1749

1850
<script>
19-
async function getRandomGreeting() {
20-
try {
21-
const response = await fetch('http://localhost:8080/random');
22-
const data = await response.json();
23-
document.getElementById('greetingDisplay').textContent = data.greeting;
24-
} catch (error) {
25-
console.error('Error fetching greeting:', error);
26-
document.getElementById('greetingDisplay').textContent = 'Error fetching greeting';
27-
} }
51+
async function getRandomGreeting() {
52+
try {
53+
const response = await fetch("http://localhost:8080/random");
54+
const data = await response.json();
55+
document.getElementById("greetingDisplay").textContent =
56+
data.greeting;
57+
} catch (error) {
58+
console.error("Error fetching greeting:", error);
59+
document.getElementById("greetingDisplay").textContent =
60+
"Error fetching greeting";
61+
}
62+
}
2863

29-
document.getElementById('randomGreetingButton').addEventListener('click', getRandomGreeting);
64+
document
65+
.getElementById("randomGreetingButton")
66+
.addEventListener("click", getRandomGreeting);
3067
</script>
31-
</body>
32-
</html>
68+
</body>
69+
</html>

0 commit comments

Comments
 (0)