@@ -38,8 +38,8 @@ export class AtomicServer {
38
38
async ci ( @argument ( ) netlifyAuthToken : Secret ) : Promise < string > {
39
39
await Promise . all ( [
40
40
this . docsPublish ( netlifyAuthToken ) ,
41
- this . lintBrowser ( ) ,
42
- this . testBrowser ( ) ,
41
+ this . jsLint ( ) ,
42
+ this . jsTest ( ) ,
43
43
this . endToEnd ( netlifyAuthToken ) ,
44
44
this . rustTest ( ) ,
45
45
this . rustClippy ( ) ,
@@ -50,31 +50,17 @@ export class AtomicServer {
50
50
}
51
51
52
52
@func ( )
53
- buildBrowser ( ) : Container {
54
- const source = this . source . directory ( "browser" ) ;
55
- const depsContainer = this . getDeps ( source . directory ( "." ) ) ;
56
-
57
- const buildContainer = depsContainer
58
- . withWorkdir ( "/app" )
59
- . withExec ( [ "pnpm" , "run" , "build" ] ) ;
60
-
61
- return buildContainer ;
62
- }
63
-
64
- @func ( )
65
- async lintBrowser ( ) : Promise < string > {
66
- const source = this . source . directory ( "browser" ) ;
67
- const depsContainer = this . getDeps ( source . directory ( "." ) ) ;
53
+ async jsLint ( ) : Promise < string > {
54
+ const depsContainer = this . jsBuild ( ) ;
68
55
return depsContainer
69
56
. withWorkdir ( "/app" )
70
57
. withExec ( [ "pnpm" , "run" , "lint" ] )
71
58
. stdout ( ) ;
72
59
}
73
60
74
61
@func ( )
75
- async testBrowser ( ) : Promise < string > {
76
- const source = this . source . directory ( "browser" ) ;
77
- const depsContainer = this . getDeps ( source . directory ( "." ) ) ;
62
+ async jsTest ( ) : Promise < string > {
63
+ const depsContainer = this . jsBuild ( ) ;
78
64
return depsContainer
79
65
. withWorkdir ( "/app" )
80
66
. withExec ( [ "pnpm" , "run" , "test" ] )
@@ -126,7 +112,7 @@ export class AtomicServer {
126
112
}
127
113
@func ( )
128
114
typedocPublish ( @argument ( ) netlifyAuthToken : Secret ) : Promise < string > {
129
- const browserDir = this . buildBrowser ( ) ;
115
+ const browserDir = this . jsBuild ( ) ;
130
116
return browserDir
131
117
. withWorkdir ( "/app" )
132
118
. withSecretVariable ( "NETLIFY_AUTH_TOKEN" , netlifyAuthToken )
@@ -135,7 +121,9 @@ export class AtomicServer {
135
121
}
136
122
137
123
@func ( )
138
- private getDeps ( source : Directory ) : Container {
124
+ private jsBuild ( ) : Container {
125
+ const source = this . source . directory ( "browser" ) ;
126
+
139
127
// Create a container with PNPM installed
140
128
const pnpmContainer = dag
141
129
. container ( )
@@ -167,7 +155,10 @@ export class AtomicServer {
167
155
] ) ;
168
156
169
157
// Copy the source so installed dependencies persist in the container
170
- return depsContainer . withDirectory ( "/app" , source ) ;
158
+ const sourceContainer = depsContainer . withDirectory ( "/app" , source ) ;
159
+
160
+ // Build all packages since they may depend on each other's built artifacts
161
+ return sourceContainer . withExec ( [ "pnpm" , "run" , "build" ] ) ;
171
162
}
172
163
173
164
@func ( )
@@ -198,7 +189,13 @@ export class AtomicServer {
198
189
. withWorkdir ( "/code" )
199
190
. withExec ( [ "cargo" , "fetch" ] ) ;
200
191
201
- return sourceContainer
192
+ const browserDir = this . jsBuild ( ) . directory ( "/app/data-browser/dist" ) ;
193
+ const containerWithAssets = sourceContainer . withDirectory (
194
+ "/code/server/assets_tmp" ,
195
+ browserDir
196
+ ) ;
197
+
198
+ return containerWithAssets
202
199
. withExec ( [ "cargo" , "build" , "--release" ] )
203
200
. withExec ( [ "./target/release/atomic-server" , "--version" ] )
204
201
. withExec ( [
0 commit comments