Skip to content

Commit 36886b9

Browse files
committed
Add lint and test for JS
1 parent a869a93 commit 36886b9

File tree

1 file changed

+25
-1
lines changed

1 file changed

+25
-1
lines changed

.dagger/src/index.ts

Lines changed: 25 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,9 @@ export class AtomicServer {
6565
}
6666

6767
@func()
68-
buildJS(@argument({ defaultPath: "/browser" }) source: Directory): Container {
68+
buildBrowser(
69+
@argument({ defaultPath: "/browser" }) source: Directory
70+
): Container {
6971
const depsContainer = this.getDeps(source.directory("."));
7072

7173
const buildContainer = depsContainer
@@ -75,6 +77,28 @@ export class AtomicServer {
7577
return buildContainer;
7678
}
7779

80+
@func()
81+
async lintBrowser(
82+
@argument({ defaultPath: "/browser" }) source: Directory
83+
): Promise<string> {
84+
const depsContainer = this.getDeps(source.directory("."));
85+
return depsContainer
86+
.withWorkdir("/app")
87+
.withExec(["pnpm", "run", "lint"])
88+
.stdout();
89+
}
90+
91+
@func()
92+
async testBrowser(
93+
@argument({ defaultPath: "/browser" }) source: Directory
94+
): Promise<string> {
95+
const depsContainer = this.getDeps(source.directory("."));
96+
return depsContainer
97+
.withWorkdir("/app")
98+
.withExec(["pnpm", "run", "test"])
99+
.stdout();
100+
}
101+
78102
@func()
79103
private getDeps(source: Directory): Container {
80104
// Create a container with PNPM installed

0 commit comments

Comments
 (0)