Skip to content
Merged
Show file tree
Hide file tree
Changes from 3 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions deno.json
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,7 @@
"#src/": "./src/",
"#test/": "./test/",
"#cli/": "./cli/",
"#scripts/": "./scripts/",
"@libsql/client": "npm:@libsql/client@^0.17.2",
"fast-check": "npm:fast-check@^3.23.0",
"intl-messageformat": "npm:intl-messageformat@^10",
Expand Down
5 changes: 4 additions & 1 deletion e2e-payments/deno.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,10 @@
"e2e": "deno run -A src/main.ts"
},
"imports": {
"playwright": "npm:playwright@1.61.1"
"playwright": "npm:playwright@1.61.1",
"#scripts/": "../scripts/",
"#src/": "../src/",
"#e2e/": "./src/"
},
"compilerOptions": {
"strict": true,
Expand Down
2 changes: 1 addition & 1 deletion e2e-payments/src/browser.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
import { writeFile } from "node:fs/promises";
import { join } from "node:path";
import { type Browser, chromium, type Locator, type Page } from "playwright";
import { browserLaunchOptions } from "../../scripts/browser-options.ts";
import { browserLaunchOptions } from "#scripts/browser-options.ts";
import { config } from "./config.ts";
import { log } from "./log.ts";
import { repoRoot } from "./server.ts";
Expand Down
2 changes: 1 addition & 1 deletion e2e-payments/src/providers/card.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
*/

import type { Frame, Locator, Page } from "playwright";
import { log, warn } from "../log.ts";
import { log, warn } from "#e2e/log.ts";

const FILL_TIMEOUT = 8_000;

Expand Down
2 changes: 1 addition & 1 deletion e2e-payments/src/providers/index.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import type { ProviderName } from "../config.ts";
import type { ProviderName } from "#e2e/config.ts";
import { square } from "./square.ts";
import { stripe } from "./stripe.ts";
import { sumup } from "./sumup.ts";
Expand Down
8 changes: 4 additions & 4 deletions e2e-payments/src/providers/shared.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
/* jscpd:ignore-start */
import type { BrowserSession } from "../browser.ts";
import type { ProviderName } from "../config.ts";
import { config } from "../config.ts";
import { log } from "../log.ts";
import type { BrowserSession } from "#e2e/browser.ts";
import type { ProviderName } from "#e2e/config.ts";
import { config } from "#e2e/config.ts";
import { log } from "#e2e/log.ts";
import type { ConfigureProvider, PayHostedCheckout } from "./types.ts";

/* jscpd:ignore-end */
Expand Down
4 changes: 2 additions & 2 deletions e2e-payments/src/providers/square.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
import { readFileSync } from "node:fs";
import type { Page } from "playwright";
import { squareRequestInit } from "#shared/square.ts";
import { log } from "../log.ts";
import { sleep } from "../util.ts";
import { log } from "#e2e/log.ts";
import { sleep } from "#e2e/util.ts";
import { configureProvider, hostedCheckout } from "./shared.ts";
import type { HostedCheckoutContext, PaymentProvider } from "./types.ts";

Expand Down
2 changes: 1 addition & 1 deletion e2e-payments/src/providers/stripe.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/* jscpd:ignore-start */
import { log, warn } from "../log.ts";
import { log, warn } from "#e2e/log.ts";
import { clickFirst, fillFirst } from "./card.ts";
import { configureProvider, hostedCheckout } from "./shared.ts";
import type { PaymentProvider } from "./types.ts";
Expand Down
2 changes: 1 addition & 1 deletion e2e-payments/src/providers/sumup.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/* jscpd:ignore-start */
import type { Page } from "playwright";
import { log, warn } from "../log.ts";
import { log, warn } from "#e2e/log.ts";
import { clickFirst, fillCard, fillFirst, fillFrameInput } from "./card.ts";
import { configureProvider, hostedCheckout } from "./shared.ts";
import type { PaymentProvider } from "./types.ts";
Expand Down
4 changes: 2 additions & 2 deletions e2e-payments/src/providers/types.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
/* jscpd:ignore-start */
import type { Page } from "playwright";
import type { BrowserSession } from "../browser.ts";
import type { ProviderName } from "../config.ts";
import type { BrowserSession } from "#e2e/browser.ts";
import type { ProviderName } from "#e2e/config.ts";
/* jscpd:ignore-end */

/**
Expand Down
2 changes: 1 addition & 1 deletion scripts/bench/bundle-composition/model.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { decode } from "@jridgewell/sourcemap-codec";
import { utf8ByteLength } from "../../../src/shared/bytes.ts";
import { utf8ByteLength } from "#src/shared/bytes.ts";

export interface BundleSourceMap {
mappings: string;
Expand Down
19 changes: 11 additions & 8 deletions scripts/bench/bundle-composition/report.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,22 +7,25 @@
*/

import { stop, transform } from "esbuild";
import { utf8ByteLength } from "../../../src/shared/bytes.ts";
import { ASSETS } from "../../../src/shared/images/wasm-assets.ts";
import { minifyCss } from "../../css-minify.ts";
import { readStaticAssets } from "../../edge-bundle-lib.ts";
import { minifyCss } from "#scripts/css-minify.ts";
import { readStaticAssets } from "#scripts/edge-bundle-lib.ts";
import {
buildAssetPathsModule,
buildAssetsModule,
type PublishedAssetUrls,
} from "../../edge-bundle-modules.ts";
} from "#scripts/edge-bundle-modules.ts";
import {
ASSET_DEFS,
buildCdnAssets,
CDN_ASSET_DEFS,
} from "../../edge-cdn-assets.ts";
import { buildRemoteModule, wasmFilename } from "../../inline-jsquash-wasm.ts";
import { cleanCdnUrl } from "../../static-cdn.ts";
} from "#scripts/edge-cdn-assets.ts";
import {
buildRemoteModule,
wasmFilename,
} from "#scripts/inline-jsquash-wasm.ts";
import { cleanCdnUrl } from "#scripts/static-cdn.ts";
import { utf8ByteLength } from "#src/shared/bytes.ts";
import { ASSETS } from "#src/shared/images/wasm-assets.ts";
import { countJavaScriptAstNodes } from "./javascript-ast.ts";
import {
applicationArea,
Expand Down
2 changes: 1 addition & 1 deletion scripts/bench/cold-start/bundle-load.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
*/

import { encodeBase64 } from "jsr:@std/encoding@^1.0.0/base64";
import { buildEdgeBundle } from "../../edge-bundle-lib.ts";
import { buildEdgeBundle } from "#scripts/edge-bundle-lib.ts";
import { spawnChildJson } from "./spawn-child.ts";
import { median, stripBase64Payloads, strippedChars } from "./strip-lib.ts";
import {
Expand Down
2 changes: 1 addition & 1 deletion scripts/bench/cold-start/first-request-child.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ import {
type Transaction,
type TransactionMode,
} from "@libsql/client";
import { timedRunner } from "#scripts/timed-run.ts";
import { setDb } from "#shared/db/client.ts";
import { beginTransaction, wrapExecute } from "#shared/db/libsql-call.ts";
import { setSuppressDebugLogs } from "#shared/log-settings.ts";
Expand All @@ -23,7 +24,6 @@ import {
setBuildTimestampForTest,
} from "#shared/update.ts";
import { serveHandler } from "#src/serve-app.ts";
import { timedRunner } from "../../timed-run.ts";
import { serveAndDrain } from "./serve-request.ts";
import { requireBenchmarkCatalogue, requiredEnv } from "./support.ts";

Expand Down
2 changes: 1 addition & 1 deletion scripts/edge-bundle-lib.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ import { denoPlugins } from "@luca/esbuild-deno-loader";
import { fromFileUrl } from "@std/path";
import type { Plugin } from "esbuild";
import * as esbuild from "esbuild";
import { ASSETS } from "../src/shared/images/wasm-assets.ts";
import { ASSETS } from "#src/shared/images/wasm-assets.ts";
import { buildStaticAssets } from "./build-static-assets.ts";
import { minifyCss } from "./css-minify.ts";
import {
Expand Down
4 changes: 2 additions & 2 deletions scripts/edge-cdn-assets.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { CSS, JS, SVG, TEXT } from "../src/shared/content-types.ts";
import { ASSETS, readAsset } from "../src/shared/images/wasm-assets.ts";
import { CSS, JS, SVG, TEXT } from "#src/shared/content-types.ts";
import { ASSETS, readAsset } from "#src/shared/images/wasm-assets.ts";
import type { AssetDef } from "./edge-bundle-modules.ts";
import { wasmFilename } from "./inline-jsquash-wasm.ts";
import type { StaticCdnAsset } from "./static-cdn.ts";
Expand Down
2 changes: 1 addition & 1 deletion scripts/inline-jsquash-wasm.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import { encodeBase64 } from "jsr:@std/encoding@^1.0.0/base64";
import { fromFileUrl } from "@std/path";
import type { OnLoadResult, OnResolveResult, Plugin } from "esbuild";
import { map } from "#fp";
import { ASSETS, readAsset } from "../src/shared/images/wasm-assets.ts";
import { ASSETS, readAsset } from "#src/shared/images/wasm-assets.ts";
import { STATIC_CDN_REQUEST_TIMEOUT_MS } from "./static-cdn.ts";

type ExportAsset = Pick<(typeof ASSETS)[number], "exportName">;
Expand Down
2 changes: 1 addition & 1 deletion scripts/mutation/build-test-state.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { writeTestState } from "../../test/test-utils/test-state.ts";
import { writeTestState } from "#test/test-utils/test-state.ts";

const dir = Deno.args[0];
if (!dir) throw new Error("A test-state output directory is required.");
Expand Down
2 changes: 1 addition & 1 deletion scripts/mutation/child-process.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { extendedBy } from "#fp";
import { commandExitCode } from "../deno-command.ts";
import { commandExitCode } from "#scripts/deno-command.ts";

/** Run `deno <args>` to completion and return its exit code. An explicit env
* is the child's complete environment, so removing a parent variable works. */
Expand Down
8 changes: 4 additions & 4 deletions scripts/mutation/evaluate.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
import { resolve } from "@std/path";
import { withCleanup } from "../cleanup.ts";
import { dim, yellow } from "../precommit/colors.ts";
import { projectRoot } from "../project-root.ts";
import type { StaticAssetBuild } from "../static-assets/session.ts";
import { withCleanup } from "#scripts/cleanup.ts";
import { dim, yellow } from "#scripts/precommit/colors.ts";
import { projectRoot } from "#scripts/project-root.ts";
import type { StaticAssetBuild } from "#scripts/static-assets/session.ts";
import {
mutantTestEnv,
runTests,
Expand Down
8 changes: 4 additions & 4 deletions scripts/mutation/execution.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { TEST_STATE_DIR_ENV } from "../../test/test-utils/test-state-env.ts";
import { commandExitCode } from "../deno-command.ts";
import { projectRoot } from "../project-root.ts";
import { stripeMockEnv } from "../stripe-mock.ts";
import { commandExitCode } from "#scripts/deno-command.ts";
import { projectRoot } from "#scripts/project-root.ts";
import { stripeMockEnv } from "#scripts/stripe-mock.ts";
import { TEST_STATE_DIR_ENV } from "#test/test-utils/test-state-env.ts";
import { batchTestFiles } from "./batch.ts";
import { denoExitCode, envWith } from "./child-process.ts";
import type { Status } from "./summary.ts";
Expand Down
2 changes: 1 addition & 1 deletion scripts/mutation/generate.ts
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@

import { parseSync } from "npm:oxc-parser@0.132.0";
import { flatMap, unique } from "#fp";
import { lineColumnAt } from "../line-column.ts";
import { lineColumnAt } from "#scripts/line-column.ts";
import {
assignmentOperators,
assignmentOperatorsExhaustive,
Expand Down
6 changes: 3 additions & 3 deletions scripts/mutation/isolation-state.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,9 @@ import {
resolve,
SEPARATOR,
} from "@std/path";
import { openLockFile } from "../lock-file.ts";
import { rethrowUnlessNotFound } from "../not-found.ts";
import { projectRoot } from "../project-root.ts";
import { openLockFile } from "#scripts/lock-file.ts";
import { rethrowUnlessNotFound } from "#scripts/not-found.ts";
import { projectRoot } from "#scripts/project-root.ts";
import { denoExitCode } from "./child-process.ts";

export const MUTATION_RUNS_DIR = ".mutation-runs";
Expand Down
6 changes: 3 additions & 3 deletions scripts/mutation/isolation.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,14 +6,14 @@
*/

import { relative } from "@std/path";
import { errorMessage } from "#shared/error-message.ts";
import {
INHERIT_STDIO,
processExists,
stopProcess,
stopProcessNow,
} from "../process.ts";
import { projectRoot } from "../project-root.ts";
} from "#scripts/process.ts";
import { projectRoot } from "#scripts/project-root.ts";
import { errorMessage } from "#shared/error-message.ts";
import {
envWith,
offTerminationSignals,
Expand Down
4 changes: 2 additions & 2 deletions scripts/mutation/run-file.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { dim, green, red, yellow } from "../precommit/colors.ts";
import { write } from "../precommit/write.ts";
import { dim, green, red, yellow } from "#scripts/precommit/colors.ts";
import { write } from "#scripts/precommit/write.ts";
import { evaluateMutant, type FileMutationPlan } from "./evaluate.ts";
import { type StaticGate, type TestRunConfig, testEnv } from "./execution.ts";
import { type IgnoreList, isIgnored } from "./ignore.ts";
Expand Down
12 changes: 6 additions & 6 deletions scripts/mutation/runner.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,12 +13,12 @@
* detected).
*/

import { TEST_STATE_DIR_ENV } from "../../test/test-utils/test-state-env.ts";
import { dim, red, yellow } from "../precommit/colors.ts";
import { write } from "../precommit/write.ts";
import { projectRoot } from "../project-root.ts";
import type { StaticAssetBuild } from "../static-assets/session.ts";
import { withTestHarness } from "../test-harness.ts";
import { dim, red, yellow } from "#scripts/precommit/colors.ts";
import { write } from "#scripts/precommit/write.ts";
import { projectRoot } from "#scripts/project-root.ts";
import type { StaticAssetBuild } from "#scripts/static-assets/session.ts";
import { withTestHarness } from "#scripts/test-harness.ts";
import { TEST_STATE_DIR_ENV } from "#test/test-utils/test-state-env.ts";
import {
offTerminationSignals,
onTerminationSignals,
Expand Down
2 changes: 1 addition & 1 deletion scripts/mutation/state-graph.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@

import { fromFileUrl } from "@std/path";
import * as v from "valibot";
import { runCommand } from "../precommit/git.ts";
import { runCommand } from "#scripts/precommit/git.ts";

/** The module whose import graph produces the prebuilt test state. */
export const STATE_BUILDER_ROOT = "test/test-utils/test-state.ts";
Expand Down
4 changes: 2 additions & 2 deletions scripts/mutation/summary.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,8 @@
* running inside GitHub Actions.
*/

import { bold, dim, green, red, yellow } from "../precommit/colors.ts";
import { projectRoot } from "../project-root.ts";
import { bold, dim, green, red, yellow } from "#scripts/precommit/colors.ts";
import { projectRoot } from "#scripts/project-root.ts";
import type { Mutant } from "./generate.ts";
import type { MutationPhase, PhaseTiming } from "./phases.ts";

Expand Down
2 changes: 1 addition & 1 deletion scripts/mutation/test-map.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { isAbsolute, relative } from "node:path";
import { filter, map, sort } from "#fp";
import { projectRoot } from "../project-root.ts";
import { projectRoot } from "#scripts/project-root.ts";

export interface SourceTestTarget {
directTestFiles: string[];
Expand Down
4 changes: 2 additions & 2 deletions scripts/mutation/test-state.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { join } from "node:path";
import { TEST_STATE_DIR_ENV } from "../../test/test-utils/test-state-env.ts";
import { denoCommand, removeTree } from "../process.ts";
import { denoCommand, removeTree } from "#scripts/process.ts";
import { TEST_STATE_DIR_ENV } from "#test/test-utils/test-state-env.ts";

export interface MutantTestState {
cleanup(): Promise<void>;
Expand Down
2 changes: 1 addition & 1 deletion scripts/pr-queue/render.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
*/

import { sort } from "#fp";
import { bold, dim, green, red, yellow } from "../precommit/colors.ts";
import { bold, dim, green, red, yellow } from "#scripts/precommit/colors.ts";
import type { Bucket, PrSummary } from "./types.ts";

// Inputs are already stripped of control characters by `sanitizeSummary` and the
Expand Down
2 changes: 1 addition & 1 deletion scripts/precommit/git.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { INHERIT_STDIO } from "../process.ts";
import { INHERIT_STDIO } from "#scripts/process.ts";

export interface CommandResult {
code: number;
Expand Down
2 changes: 1 addition & 1 deletion scripts/precommit/runner.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { readStream } from "../stream-lines.ts";
import { readStream } from "#scripts/stream-lines.ts";
import { bold, dim, green, red, yellow } from "./colors.ts";
import { runCommand, runInteractiveCommand, splitCommand } from "./git.ts";
import { getMergeConflictWarning } from "./merge-warning.ts";
Expand Down
2 changes: 1 addition & 1 deletion scripts/precommit/steps.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { readSlowTestsReport } from "../test-durations.ts";
import { readSlowTestsReport } from "#scripts/test-durations.ts";
import { filterTestOutput, testProgressFromLine } from "./output.ts";

/**
Expand Down
2 changes: 1 addition & 1 deletion scripts/screenshots/server.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import {
type CleanupTask,
failAfterCleanups,
runCleanups,
} from "../cleanup.ts";
} from "#scripts/cleanup.ts";

export interface StartupCleanup {
add: (cleanup: CleanupTask) => void;
Expand Down
2 changes: 1 addition & 1 deletion scripts/static-assets/output-rollback.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import {
type CleanupTask,
failAfterCleanups,
removeIfPresent,
} from "../cleanup.ts";
} from "#scripts/cleanup.ts";
import { fileExists } from "./session.ts";

export const withGeneratedOutputRollback = async <Result>(
Expand Down
4 changes: 2 additions & 2 deletions scripts/static-assets/session.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import type { BuildOptions } from "esbuild";
import { runCleanups } from "../cleanup.ts";
import { rethrowUnlessNotFound } from "../not-found.ts";
import { runCleanups } from "#scripts/cleanup.ts";
import { rethrowUnlessNotFound } from "#scripts/not-found.ts";

export interface StaticBundle {
label: string;
Expand Down
8 changes: 4 additions & 4 deletions scripts/stripe-mock/install.ts
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
/* jscpd:ignore-start */
import { join } from "node:path";
import { withFileLock } from "#scripts/lock-file.ts";
import { rethrowUnlessNotFound } from "#scripts/not-found.ts";
import { removeTree } from "#scripts/process.ts";
import { projectRoot } from "#scripts/project-root.ts";
import { delay } from "#shared/now.ts";
import { withFileLock } from "../lock-file.ts";
import { rethrowUnlessNotFound } from "../not-found.ts";
import { removeTree } from "../process.ts";
import { projectRoot } from "../project-root.ts";

/* jscpd:ignore-end */

Expand Down
Loading