Showing the changes to scripts/lib (1 of 71 files). Show all
Unified · Split
| @@ -1,7 +1,7 @@ | |||
| 1 | // @effect-diagnostics nodeBuiltinImport:off - Tests exercise root env file precedence directly. | 1 | // @effect-diagnostics nodeBuiltinImport:off - Tests exercise root env file precedence directly. |
| 2 | import { mkdtempSync, rmSync, writeFileSync } from "node:fs"; | 2 | import * as NodeFS from "node:fs"; |
| 3 | import { tmpdir } from "node:os"; | 3 | import * as NodeOS from "node:os"; |
| 4 | import { join } from "node:path"; | 4 | import * as NodePath from "node:path"; |
| 5 | import { afterEach, describe, expect, it } from "vite-plus/test"; | 5 | import { afterEach, describe, expect, it } from "vite-plus/test"; |
| 6 | 6 | ||
| 7 | import { loadRepoEnv, resolvePublicConfig } from "./public-config.ts"; | 7 | import { loadRepoEnv, resolvePublicConfig } from "./public-config.ts"; |
| @@ -10,7 +10,7 @@ const temporaryDirectories: string[] = []; · 2 unmodified lines | |||
| 10 | 10 | ||
| 11 | afterEach(() => { | 11 | afterEach(() => { |
| 12 | for (const directory of temporaryDirectories.splice(0)) { | 12 | for (const directory of temporaryDirectories.splice(0)) { |
| 13 | rmSync(directory, { recursive: true, force: true }); | 13 | NodeFS.rmSync(directory, { recursive: true, force: true }); |
| 14 | } | 14 | } |
| 15 | }); | 15 | }); |
| 16 | 16 | ||
| @@ -43,12 +43,12 @@ describe("loadRepoEnv", () => { · 26 unmodified lines | |||
| 43 | 43 | ||
| 44 | it("applies process, root local, and root precedence in that order", () => { | 44 | it("applies process, root local, and root precedence in that order", () => { |
| 45 | const repoRoot = makeTemporaryDirectory(); | 45 | const repoRoot = makeTemporaryDirectory(); |
| 46 | writeFileSync( | 46 | NodeFS.writeFileSync( |
| 47 | join(repoRoot, ".env"), | 47 | NodePath.join(repoRoot, ".env"), |
| 48 | "T3CODE_CLERK_PUBLISHABLE_KEY=pk_root\nT3CODE_CLERK_JWT_TEMPLATE=template_root\nT3CODE_CLERK_CLI_OAUTH_CLIENT_ID=oauth_root\nT3CODE_RELAY_URL=https://root.example.test\n", | 48 | "T3CODE_CLERK_PUBLISHABLE_KEY=pk_root\nT3CODE_CLERK_JWT_TEMPLATE=template_root\nT3CODE_CLERK_CLI_OAUTH_CLIENT_ID=oauth_root\nT3CODE_RELAY_URL=https://root.example.test\n", |
| 49 | ); | 49 | ); |
| 50 | writeFileSync( | 50 | NodeFS.writeFileSync( |
| 51 | join(repoRoot, ".env.local"), | 51 | NodePath.join(repoRoot, ".env.local"), |
| 52 | "T3CODE_CLERK_PUBLISHABLE_KEY=pk_local\nT3CODE_CLERK_JWT_TEMPLATE=template_local\nT3CODE_CLERK_CLI_OAUTH_CLIENT_ID=oauth_local\nT3CODE_RELAY_URL=https://local.example.test\n", | 52 | "T3CODE_CLERK_PUBLISHABLE_KEY=pk_local\nT3CODE_CLERK_JWT_TEMPLATE=template_local\nT3CODE_CLERK_CLI_OAUTH_CLIENT_ID=oauth_local\nT3CODE_RELAY_URL=https://local.example.test\n", |
| 53 | ); | 53 | ); |
| 54 | 54 | ||
| @@ -148,7 +148,7 @@ describe("loadRepoEnv", () => { · 93 unmodified lines | |||
| 148 | }); | 148 | }); |
| 149 | 149 | ||
| 150 | function makeTemporaryDirectory() { | 150 | function makeTemporaryDirectory() { |
| 151 | const directory = mkdtempSync(join(tmpdir(), "t3code-public-config-")); | 151 | const directory = NodeFS.mkdtempSync(NodePath.join(NodeOS.tmpdir(), "t3code-public-config-")); |
| 152 | temporaryDirectories.push(directory); | 152 | temporaryDirectories.push(directory); |
| 153 | return directory; | 153 | return directory; |
| 154 | } | 154 | } |