| ... | @@ -40,6 +40,7 @@ it.layer(NodeServices.layer)("cli config resolution", (it) => { | ... | @@ -40,6 +40,7 @@ it.layer(NodeServices.layer)("cli config resolution", (it) => { |
| 40 | port: Option.none(), | 40 | port: Option.none(), |
| 41 | host: Option.none(), | 41 | host: Option.none(), |
| 42 | baseDir: Option.none(), | 42 | baseDir: Option.none(), |
| | 43 | cwd: Option.none(), |
| 43 | devUrl: Option.none(), | 44 | devUrl: Option.none(), |
| 44 | noBrowser: Option.none(), | 45 | noBrowser: Option.none(), |
| 45 | authToken: Option.none(), | 46 | authToken: Option.none(), |
| ... | @@ -102,6 +103,7 @@ it.layer(NodeServices.layer)("cli config resolution", (it) => { | ... | @@ -102,6 +103,7 @@ it.layer(NodeServices.layer)("cli config resolution", (it) => { |
| 102 | port: Option.some(8788), | 103 | port: Option.some(8788), |
| 103 | host: Option.some("127.0.0.1"), | 104 | host: Option.some("127.0.0.1"), |
| 104 | baseDir: Option.some(baseDir), | 105 | baseDir: Option.some(baseDir), |
| | 106 | cwd: Option.none(), |
| 105 | devUrl: Option.some(new URL("http://127.0.0.1:4173")), | 107 | devUrl: Option.some(new URL("http://127.0.0.1:4173")), |
| 106 | noBrowser: Option.some(true), | 108 | noBrowser: Option.some(true), |
| 107 | authToken: Option.some("flag-token"), | 109 | authToken: Option.some("flag-token"), |
| ... | @@ -178,6 +180,7 @@ it.layer(NodeServices.layer)("cli config resolution", (it) => { | ... | @@ -178,6 +180,7 @@ it.layer(NodeServices.layer)("cli config resolution", (it) => { |
| 178 | port: Option.none(), | 180 | port: Option.none(), |
| 179 | host: Option.none(), | 181 | host: Option.none(), |
| 180 | baseDir: Option.none(), | 182 | baseDir: Option.none(), |
| | 183 | cwd: Option.none(), |
| 181 | devUrl: Option.none(), | 184 | devUrl: Option.none(), |
| 182 | noBrowser: Option.none(), | 185 | noBrowser: Option.none(), |
| 183 | authToken: Option.none(), | 186 | authToken: Option.none(), |
| ... | @@ -228,6 +231,7 @@ it.layer(NodeServices.layer)("cli config resolution", (it) => { | ... | @@ -228,6 +231,7 @@ it.layer(NodeServices.layer)("cli config resolution", (it) => { |
| 228 | const fs = yield* FileSystem.FileSystem; | 231 | const fs = yield* FileSystem.FileSystem; |
| 229 | const path = yield* Path.Path; | 232 | const path = yield* Path.Path; |
| 230 | const baseDir = yield* fs.makeTempDirectoryScoped({ prefix: "t3-cli-config-dirs-" }); | 233 | const baseDir = yield* fs.makeTempDirectoryScoped({ prefix: "t3-cli-config-dirs-" }); |
| | 234 | const customCwd = path.join(baseDir, "nested", "project"); |
| 231 | | 235 | |
| 232 | const resolved = yield* resolveServerConfig( | 236 | const resolved = yield* resolveServerConfig( |
| 233 | { | 237 | { |
| ... | @@ -235,6 +239,7 @@ it.layer(NodeServices.layer)("cli config resolution", (it) => { | ... | @@ -235,6 +239,7 @@ it.layer(NodeServices.layer)("cli config resolution", (it) => { |
| 235 | port: Option.some(4888), | 239 | port: Option.some(4888), |
| 236 | host: Option.none(), | 240 | host: Option.none(), |
| 237 | baseDir: Option.some(baseDir), | 241 | baseDir: Option.some(baseDir), |
| | 242 | cwd: Option.some(customCwd), |
| 238 | devUrl: Option.some(new URL("http://127.0.0.1:5173")), | 243 | devUrl: Option.some(new URL("http://127.0.0.1:5173")), |
| 239 | noBrowser: Option.none(), | 244 | noBrowser: Option.none(), |
| 240 | authToken: Option.none(), | 245 | authToken: Option.none(), |
| ... | @@ -253,6 +258,7 @@ it.layer(NodeServices.layer)("cli config resolution", (it) => { | ... | @@ -253,6 +258,7 @@ it.layer(NodeServices.layer)("cli config resolution", (it) => { |
| 253 | ); | 258 | ); |
| 254 | | 259 | |
| 255 | for (const directory of [ | 260 | for (const directory of [ |
| | 261 | customCwd, |
| 256 | resolved.stateDir, | 262 | resolved.stateDir, |
| 257 | resolved.logsDir, | 263 | resolved.logsDir, |
| 258 | resolved.providerLogsDir, | 264 | resolved.providerLogsDir, |
| ... | @@ -264,6 +270,7 @@ it.layer(NodeServices.layer)("cli config resolution", (it) => { | ... | @@ -264,6 +270,7 @@ it.layer(NodeServices.layer)("cli config resolution", (it) => { |
| 264 | ]) { | 270 | ]) { |
| 265 | expect(yield* fs.exists(directory)).toBe(true); | 271 | expect(yield* fs.exists(directory)).toBe(true); |
| 266 | } | 272 | } |
| | 273 | expect(resolved.cwd).toBe(path.resolve(customCwd)); |
| 267 | }), | 274 | }), |
| 268 | ); | 275 | ); |
| 269 | | 276 | |
| ... | @@ -290,6 +297,7 @@ it.layer(NodeServices.layer)("cli config resolution", (it) => { | ... | @@ -290,6 +297,7 @@ it.layer(NodeServices.layer)("cli config resolution", (it) => { |
| 290 | port: Option.some(8788), | 297 | port: Option.some(8788), |
| 291 | host: Option.some("127.0.0.1"), | 298 | host: Option.some("127.0.0.1"), |
| 292 | baseDir: Option.none(), | 299 | baseDir: Option.none(), |
| | 300 | cwd: Option.none(), |
| 293 | devUrl: Option.some(new URL("http://127.0.0.1:4173")), | 301 | devUrl: Option.some(new URL("http://127.0.0.1:4173")), |
| 294 | noBrowser: Option.none(), | 302 | noBrowser: Option.none(), |
| 295 | authToken: Option.some("flag-token"), | 303 | authToken: Option.some("flag-token"), |
| ... | @@ -360,6 +368,7 @@ it.layer(NodeServices.layer)("cli config resolution", (it) => { | ... | @@ -360,6 +368,7 @@ it.layer(NodeServices.layer)("cli config resolution", (it) => { |
| 360 | port: Option.some(4888), | 368 | port: Option.some(4888), |
| 361 | host: Option.none(), | 369 | host: Option.none(), |
| 362 | baseDir: Option.some(baseDir), | 370 | baseDir: Option.some(baseDir), |
| | 371 | cwd: Option.none(), |
| 363 | devUrl: Option.none(), | 372 | devUrl: Option.none(), |
| 364 | noBrowser: Option.none(), | 373 | noBrowser: Option.none(), |
| 365 | authToken: Option.none(), | 374 | authToken: Option.none(), |