diff --git a/jest.config.js b/jest.config.js deleted file mode 100644 index 25b5e108..00000000 --- a/jest.config.js +++ /dev/null @@ -1,6 +0,0 @@ -module.exports = { - preset: "ts-jest", - testEnvironment: "node", - verbose: true, - clearMocks: true, -}; diff --git a/jest.config.ts b/jest.config.ts new file mode 100644 index 00000000..5d302a41 --- /dev/null +++ b/jest.config.ts @@ -0,0 +1,22 @@ +import type { JestConfigWithTsJest } from "ts-jest"; + +const jestConfig: JestConfigWithTsJest = { + preset: "ts-jest", + testEnvironment: "node", + verbose: true, + clearMocks: true, + extensionsToTreatAsEsm: [".ts"], + moduleNameMapper: { + "^(\\.{1,2}/.*)\\.js$": "$1", + }, + transform: { + "^.+\\.tsx?$": [ + "ts-jest", + { + useESM: true, + }, + ], + }, +}; + +export default jestConfig; diff --git a/package-lock.json b/package-lock.json index 67dafd5c..2d3e127c 100644 --- a/package-lock.json +++ b/package-lock.json @@ -23,7 +23,7 @@ "npmlog": "^6.0.2", "pkginfo": "^0.4.1", "promptly": "^3.2.0", - "semver": "^7.5.4", + "semver": "^7.6.3", "ts-custom-error": "^3.3.1", "ts-results-es": "^4.1.0", "update-notifier": "^5.1.0", @@ -50,6 +50,7 @@ "@types/pkginfo": "^0.4.1", "@types/promptly": "^3.0.3", "@types/request": "^2.48.12", + "@types/semver": "^7.5.8", "@types/update-notifier": "^5.1.0", "@typescript-eslint/eslint-plugin": "^6.8.0", "@typescript-eslint/parser": "^6.8.0", @@ -64,6 +65,7 @@ "rimraf": "^5.0.5", "semantic-release": "^22.0.12", "ts-jest": "^29.1.2", + "ts-node": "^10.9.2", "typescript": "^5.5.4" }, "engines": { @@ -698,6 +700,30 @@ "commander": "9.5.x" } }, + "node_modules/@cspotcode/source-map-support": { + "version": "0.8.1", + "resolved": "https://registry.npmjs.org/@cspotcode/source-map-support/-/source-map-support-0.8.1.tgz", + "integrity": "sha512-IchNf6dN4tHoMFIn/7OE8LWZ19Y6q/67Bmf6vnGREv8RSbBVb9LPJxEcnwrcwX6ixSvaiGoomAUvu4YSxXrVgw==", + "dev": true, + "license": "MIT", + "dependencies": { + "@jridgewell/trace-mapping": "0.3.9" + }, + "engines": { + "node": ">=12" + } + }, + "node_modules/@cspotcode/source-map-support/node_modules/@jridgewell/trace-mapping": { + "version": "0.3.9", + "resolved": "https://registry.npmjs.org/@jridgewell/trace-mapping/-/trace-mapping-0.3.9.tgz", + "integrity": "sha512-3Belt6tdc8bPgAtbcmdtNJlirVoTmEb5e2gC94PnkwEW9jI6CAHUeoG85tjWP5WquqfavoMtMwiG4P926ZKKuQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "@jridgewell/resolve-uri": "^3.0.3", + "@jridgewell/sourcemap-codec": "^1.4.10" + } + }, "node_modules/@es-joy/jsdoccomment": { "version": "0.46.0", "resolved": "https://registry.npmjs.org/@es-joy/jsdoccomment/-/jsdoccomment-0.46.0.tgz", @@ -2468,6 +2494,34 @@ "node": ">= 10" } }, + "node_modules/@tsconfig/node10": { + "version": "1.0.11", + "resolved": "https://registry.npmjs.org/@tsconfig/node10/-/node10-1.0.11.tgz", + "integrity": "sha512-DcRjDCujK/kCk/cUe8Xz8ZSpm8mS3mNNpta+jGCA6USEDfktlNvm1+IuZ9eTcDbNk41BHwpHHeW+N1lKCz4zOw==", + "dev": true, + "license": "MIT" + }, + "node_modules/@tsconfig/node12": { + "version": "1.0.11", + "resolved": "https://registry.npmjs.org/@tsconfig/node12/-/node12-1.0.11.tgz", + "integrity": "sha512-cqefuRsh12pWyGsIoBKJA9luFu3mRxCA+ORZvA4ktLSzIuCUtWVxGIuXigEwO5/ywWFMZ2QEGKWvkZG1zDMTag==", + "dev": true, + "license": "MIT" + }, + "node_modules/@tsconfig/node14": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/@tsconfig/node14/-/node14-1.0.3.tgz", + "integrity": "sha512-ysT8mhdixWK6Hw3i1V2AeRqZ5WfXg1G43mqoYlM2nc6388Fq5jcXyr5mRsqViLx/GJYdoL0bfXD8nmF+Zn/Iow==", + "dev": true, + "license": "MIT" + }, + "node_modules/@tsconfig/node16": { + "version": "1.0.4", + "resolved": "https://registry.npmjs.org/@tsconfig/node16/-/node16-1.0.4.tgz", + "integrity": "sha512-vxhUy4J8lyeyinH7Azl1pdd43GJhZH/tP2weN8TntQblOY+A0XbT8DJk1/oCPuOOyg/Ja757rG0CgHcWC8OfMA==", + "dev": true, + "license": "MIT" + }, "node_modules/@types/babel__core": { "version": "7.20.5", "resolved": "https://registry.npmjs.org/@types/babel__core/-/babel__core-7.20.5.tgz", @@ -2718,7 +2772,8 @@ "version": "7.5.8", "resolved": "https://registry.npmjs.org/@types/semver/-/semver-7.5.8.tgz", "integrity": "sha512-I8EUhyrgfLrcTkzV3TSsGyl1tSuPrEDzr0yd5m90UgNxQkyDXULk3b6MlQqTCpZpNtWe1K0hzclnZkTcLBe2UQ==", - "dev": true + "dev": true, + "license": "MIT" }, "node_modules/@types/ssri": { "version": "7.1.5", @@ -2996,6 +3051,19 @@ "acorn": "^6.0.0 || ^7.0.0 || ^8.0.0" } }, + "node_modules/acorn-walk": { + "version": "8.3.4", + "resolved": "https://registry.npmjs.org/acorn-walk/-/acorn-walk-8.3.4.tgz", + "integrity": "sha512-ueEepnujpqee2o5aIYnvHU6C0A42MNdsIDeqy5BydrkuC5R1ZuUFnm27EeFJGoEHJQgn3uleRvmTXaJgfXbt4g==", + "dev": true, + "license": "MIT", + "dependencies": { + "acorn": "^8.11.0" + }, + "engines": { + "node": ">=0.4.0" + } + }, "node_modules/agent-base": { "version": "6.0.2", "resolved": "https://registry.npmjs.org/agent-base/-/agent-base-6.0.2.tgz", @@ -3184,6 +3252,13 @@ "node": ">= 6" } }, + "node_modules/arg": { + "version": "4.1.3", + "resolved": "https://registry.npmjs.org/arg/-/arg-4.1.3.tgz", + "integrity": "sha512-58S9QDqG0Xx27YwPSt9fJxivjYl432YCwfDMfZ+71RAqUrZef7LrKQZ3LHLOwCS4FLNBplP533Zx895SeOCHvA==", + "dev": true, + "license": "MIT" + }, "node_modules/argparse": { "version": "2.0.1", "resolved": "https://registry.npmjs.org/argparse/-/argparse-2.0.1.tgz", @@ -4242,6 +4317,13 @@ "node": "^14.15.0 || ^16.10.0 || >=18.0.0" } }, + "node_modules/create-require": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/create-require/-/create-require-1.1.1.tgz", + "integrity": "sha512-dcKFX3jn0MpIaXjisoRvexIJVEKzaq7z2rZKxf+MSr9TkdmHmsU4m2lcLojrj/FHl8mk5VxMmYA+ftRkP/3oKQ==", + "dev": true, + "license": "MIT" + }, "node_modules/cross-env": { "version": "7.0.3", "resolved": "https://registry.npmjs.org/cross-env/-/cross-env-7.0.3.tgz", @@ -4383,6 +4465,16 @@ "node": ">=8" } }, + "node_modules/diff": { + "version": "4.0.2", + "resolved": "https://registry.npmjs.org/diff/-/diff-4.0.2.tgz", + "integrity": "sha512-58lmxKSA4BNyLz+HHMUzlOEpg09FV+ev6ZMe3vJihgdxzgcwZ8VoEEPmALCZG9LmqfVoNMMKpttIYTVG6uDY7A==", + "dev": true, + "license": "BSD-3-Clause", + "engines": { + "node": ">=0.3.1" + } + }, "node_modules/diff-sequences": { "version": "29.6.3", "resolved": "https://registry.npmjs.org/diff-sequences/-/diff-sequences-29.6.3.tgz", @@ -12607,6 +12699,7 @@ "version": "7.6.3", "resolved": "https://registry.npmjs.org/semver/-/semver-7.6.3.tgz", "integrity": "sha512-oVekP1cKtI+CTDvHWYFUcMtsK/00wmAEfyqKfNdARm8u1wNVhSgaX7A8d4UuIlUI5e84iEwOhs7ZPYRmzU9U6A==", + "license": "ISC", "bin": { "semver": "bin/semver.js" }, @@ -13485,6 +13578,50 @@ "node": ">=12" } }, + "node_modules/ts-node": { + "version": "10.9.2", + "resolved": "https://registry.npmjs.org/ts-node/-/ts-node-10.9.2.tgz", + "integrity": "sha512-f0FFpIdcHgn8zcPSbf1dRevwt047YMnaiJM3u2w2RewrB+fob/zePZcrOyQoLMMO7aBIddLcQIEK5dYjkLnGrQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "@cspotcode/source-map-support": "^0.8.0", + "@tsconfig/node10": "^1.0.7", + "@tsconfig/node12": "^1.0.7", + "@tsconfig/node14": "^1.0.0", + "@tsconfig/node16": "^1.0.2", + "acorn": "^8.4.1", + "acorn-walk": "^8.1.1", + "arg": "^4.1.0", + "create-require": "^1.1.0", + "diff": "^4.0.1", + "make-error": "^1.1.1", + "v8-compile-cache-lib": "^3.0.1", + "yn": "3.1.1" + }, + "bin": { + "ts-node": "dist/bin.js", + "ts-node-cwd": "dist/bin-cwd.js", + "ts-node-esm": "dist/bin-esm.js", + "ts-node-script": "dist/bin-script.js", + "ts-node-transpile-only": "dist/bin-transpile.js", + "ts-script": "dist/bin-script-deprecated.js" + }, + "peerDependencies": { + "@swc/core": ">=1.2.50", + "@swc/wasm": ">=1.2.50", + "@types/node": "*", + "typescript": ">=2.7" + }, + "peerDependenciesMeta": { + "@swc/core": { + "optional": true + }, + "@swc/wasm": { + "optional": true + } + } + }, "node_modules/ts-results-es": { "version": "4.2.0", "resolved": "https://registry.npmjs.org/ts-results-es/-/ts-results-es-4.2.0.tgz", @@ -13820,6 +13957,13 @@ "resolved": "https://registry.npmjs.org/util-deprecate/-/util-deprecate-1.0.2.tgz", "integrity": "sha512-EPD5q1uXyFxJpCrLnCc1nHnq3gOa6DZBocAIiI2TaSCA7VCJ1UJDMagCzIkXNsUYfD1daK//LTEQ8xiIbrHtcw==" }, + "node_modules/v8-compile-cache-lib": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/v8-compile-cache-lib/-/v8-compile-cache-lib-3.0.1.tgz", + "integrity": "sha512-wa7YjyUGfNZngI/vtK0UHAN+lgDCxBPCylVXGp0zu59Fz5aiGtNXaq3DhIov063MorB+VfufLh3JlF2KdTK3xg==", + "dev": true, + "license": "MIT" + }, "node_modules/v8-to-istanbul": { "version": "9.3.0", "resolved": "https://registry.npmjs.org/v8-to-istanbul/-/v8-to-istanbul-9.3.0.tgz", @@ -14163,6 +14307,16 @@ "node": ">=12" } }, + "node_modules/yn": { + "version": "3.1.1", + "resolved": "https://registry.npmjs.org/yn/-/yn-3.1.1.tgz", + "integrity": "sha512-Ux4ygGWsu2c7isFWe8Yu1YluJmqVhxqK2cLXNQA5AcC3QfbGNpM7fu0Y8b/z16pXLnFxZYvWhd3fhBY9DLmC6Q==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=6" + } + }, "node_modules/yocto-queue": { "version": "0.1.0", "resolved": "https://registry.npmjs.org/yocto-queue/-/yocto-queue-0.1.0.tgz", diff --git a/package.json b/package.json index bb898ad5..8e5c258c 100644 --- a/package.json +++ b/package.json @@ -6,6 +6,7 @@ "engines": { "node": ">=18" }, + "type": "module", "scripts": { "test:e2e": "jest --testMatch \"**/e2e/**/*.test.ts\" --runInBand", "test:integration": "jest --testMatch \"**/integration/**/*.test.ts\" --runInBand", @@ -49,6 +50,7 @@ "@types/pkginfo": "^0.4.1", "@types/promptly": "^3.0.3", "@types/request": "^2.48.12", + "@types/semver": "^7.5.8", "@types/update-notifier": "^5.1.0", "@typescript-eslint/eslint-plugin": "^6.8.0", "@typescript-eslint/parser": "^6.8.0", @@ -63,6 +65,7 @@ "rimraf": "^5.0.5", "semantic-release": "^22.0.12", "ts-jest": "^29.1.2", + "ts-node": "^10.9.2", "typescript": "^5.5.4" }, "dependencies": { @@ -80,7 +83,7 @@ "npmlog": "^6.0.2", "pkginfo": "^0.4.1", "promptly": "^3.2.0", - "semver": "^7.5.4", + "semver": "^7.6.3", "ts-custom-error": "^3.3.1", "ts-results-es": "^4.1.0", "update-notifier": "^5.1.0", diff --git a/src/app/add-dependencies.ts b/src/app/add-dependencies.ts index 847371e0..52411a3b 100644 --- a/src/app/add-dependencies.ts +++ b/src/app/add-dependencies.ts @@ -1,58 +1,58 @@ import { CustomError } from "ts-custom-error"; import { Err, Result } from "ts-results-es"; -import { logResolvedDependency } from "../cli/dependency-logging"; -import { PackumentNotFoundError } from "../domain/common-errors"; +import { logResolvedDependency } from "../cli/dependency-logging.js"; +import { PackumentNotFoundError } from "../domain/common-errors.js"; import { type FailedNode, NodeType, traverseDependencyGraph, -} from "../domain/dependency-graph"; +} from "../domain/dependency-graph.js"; import { type AddResult, addProjectDependency, -} from "../domain/dependency-management"; -import { DomainName } from "../domain/domain-name"; +} from "../domain/dependency-management.js"; +import { DomainName } from "../domain/domain-name.js"; import { type EditorVersion, type ReleaseVersion, compareEditorVersion, -} from "../domain/editor-version"; -import { partialApply } from "../domain/fp-utils"; -import type { DebugLog } from "../domain/logging"; -import { tryGetTargetEditorVersionFor } from "../domain/package-manifest"; +} from "../domain/editor-version.js"; +import { partialApply } from "../domain/fp-utils.js"; +import type { DebugLog } from "../domain/logging.js"; +import { tryGetTargetEditorVersionFor } from "../domain/package-manifest.js"; import { type PackageSpec, type VersionReference, makePackageSpec, splitPackageSpec, -} from "../domain/package-spec"; -import { PackageUrl } from "../domain/package-url"; -import type { ResolvePackumentVersionError } from "../domain/packument"; +} from "../domain/package-spec.js"; +import { PackageUrl } from "../domain/package-url.js"; +import type { ResolvePackumentVersionError } from "../domain/packument.js"; import { type UnityProjectManifest, addTestable, hasDependency, mapScopedRegistry, -} from "../domain/project-manifest"; -import { recordEntries } from "../domain/record-utils"; -import { type Registry } from "../domain/registry"; -import { type RegistryUrl, unityRegistryUrl } from "../domain/registry-url"; +} from "../domain/project-manifest.js"; +import { recordEntries } from "../domain/record-utils.js"; +import { type Registry } from "../domain/registry.js"; +import { type RegistryUrl, unityRegistryUrl } from "../domain/registry-url.js"; import { addScope, makeEmptyScopedRegistryFor, -} from "../domain/scoped-registry"; -import { SemanticVersion } from "../domain/semantic-version"; -import { isZod } from "../domain/zod-utils"; -import type { ReadTextFile, WriteTextFile } from "../io/fs"; -import { type GetRegistryPackument } from "../io/registry"; -import type { CheckUrlExists } from "../io/www"; -import { loadProjectManifestUsing } from "./get-dependencies"; +} from "../domain/scoped-registry.js"; +import { SemanticVersion } from "../domain/semantic-version.js"; +import { isZod } from "../domain/zod-utils.js"; +import type { ReadTextFile, WriteTextFile } from "../io/fs.js"; +import { type GetRegistryPackument } from "../io/registry.js"; +import type { CheckUrlExists } from "../io/www.js"; +import { loadProjectManifestUsing } from "./get-dependencies.js"; import { type ResolvedPackumentVersion, fetchRegistryPackumentVersionUsing, -} from "./get-registry-packument-version"; -import { resolveDependenciesUsing } from "./resolve-dependencies"; -import { saveProjectManifestUsing } from "./write-dependencies"; +} from "./get-registry-packument-version.js"; +import { resolveDependenciesUsing } from "./resolve-dependencies.js"; +import { saveProjectManifestUsing } from "./write-dependencies.js"; /** * Error that is thrown when a package should be added that is incompatible diff --git a/src/app/built-in-package-check.ts b/src/app/built-in-package-check.ts index 7dc0314b..aaabb7c3 100644 --- a/src/app/built-in-package-check.ts +++ b/src/app/built-in-package-check.ts @@ -1,9 +1,9 @@ -import { DomainName } from "../domain/domain-name"; -import { packumentHasVersion } from "../domain/packument"; -import { unityRegistry } from "../domain/registry"; -import { SemanticVersion } from "../domain/semantic-version"; -import type { GetRegistryPackument } from "../io/registry"; -import { CheckUrlExists } from "../io/www"; +import { DomainName } from "../domain/domain-name.js"; +import { packumentHasVersion } from "../domain/packument.js"; +import { unityRegistry } from "../domain/registry.js"; +import { SemanticVersion } from "../domain/semantic-version.js"; +import type { GetRegistryPackument } from "../io/registry.js"; +import { CheckUrlExists } from "../io/www.js"; /** * Gets the documentation page url for a package. diff --git a/src/app/builtin-packages.ts b/src/app/builtin-packages.ts index a6dbd9f2..7cb6cc9e 100644 --- a/src/app/builtin-packages.ts +++ b/src/app/builtin-packages.ts @@ -1,15 +1,15 @@ import path from "path"; import { CustomError } from "ts-custom-error"; import { AsyncResult } from "ts-results-es"; -import { DomainName } from "../domain/domain-name"; -import { ReleaseVersion } from "../domain/editor-version"; -import { assertIsNodeError } from "../domain/error-type-guards"; -import { resultifyAsyncOp } from "../domain/result-utils"; +import { DomainName } from "../domain/domain-name.js"; +import { ReleaseVersion } from "../domain/editor-version.js"; +import { assertIsNodeError } from "../domain/error-type-guards.js"; +import { resultifyAsyncOp } from "../domain/result-utils.js"; import { GetEditorInstallPathError, tryGetEditorInstallPath, -} from "../domain/special-paths"; -import type { GetDirectoriesIn } from "../io/fs"; +} from "../domain/special-paths.js"; +import type { GetDirectoriesIn } from "../io/fs.js"; /** * Error for when an editor-version is not installed. diff --git a/src/app/determine-editor-version.ts b/src/app/determine-editor-version.ts index 16914482..bd783b89 100644 --- a/src/app/determine-editor-version.ts +++ b/src/app/determine-editor-version.ts @@ -1,14 +1,14 @@ import { CustomError } from "ts-custom-error"; -import { ReleaseVersion } from "../domain/editor-version"; -import { assertIsError } from "../domain/error-type-guards"; -import { partialApply } from "../domain/fp-utils"; -import { DebugLog } from "../domain/logging"; +import { ReleaseVersion } from "../domain/editor-version.js"; +import { assertIsError } from "../domain/error-type-guards.js"; +import { partialApply } from "../domain/fp-utils.js"; +import { DebugLog } from "../domain/logging.js"; import { projectVersionTxtPathFor, tryParseProjectVersionTxt, validateProjectVersion, -} from "../domain/project-version-txt"; -import { type ReadTextFile } from "../io/fs"; +} from "../domain/project-version-txt.js"; +import { type ReadTextFile } from "../io/fs.js"; export class ProjectVersionMissingError extends CustomError { public constructor(public readonly expectedPath: string) { diff --git a/src/app/get-dependencies.ts b/src/app/get-dependencies.ts index dd9a8819..270f10e6 100644 --- a/src/app/get-dependencies.ts +++ b/src/app/get-dependencies.ts @@ -1,12 +1,12 @@ import { CustomError } from "ts-custom-error"; -import { assertIsError } from "../domain/error-type-guards"; -import type { DebugLog } from "../domain/logging"; +import { assertIsError } from "../domain/error-type-guards.js"; +import type { DebugLog } from "../domain/logging.js"; import { type UnityProjectManifest, manifestPathFor, parseProjectManifest, -} from "../domain/project-manifest"; -import type { ReadTextFile } from "../io/fs"; +} from "../domain/project-manifest.js"; +import type { ReadTextFile } from "../io/fs.js"; export class ManifestMissingError extends CustomError { public constructor(public expectedPath: string) { diff --git a/src/app/get-latest-version.ts b/src/app/get-latest-version.ts index 30d5bf34..6594af79 100644 --- a/src/app/get-latest-version.ts +++ b/src/app/get-latest-version.ts @@ -1,8 +1,8 @@ -import { DomainName } from "../domain/domain-name"; -import { tryResolvePackumentVersion } from "../domain/packument"; -import { Registry } from "../domain/registry"; -import { SemanticVersion } from "../domain/semantic-version"; -import type { GetRegistryPackument } from "../io/registry"; +import { DomainName } from "../domain/domain-name.js"; +import { tryResolvePackumentVersion } from "../domain/packument.js"; +import { Registry } from "../domain/registry.js"; +import { SemanticVersion } from "../domain/semantic-version.js"; +import type { GetRegistryPackument } from "../io/registry.js"; /** * Gets the latest published version of a package from a npm registry. diff --git a/src/app/get-registry-auth.ts b/src/app/get-registry-auth.ts index cb0ced97..20fd6599 100644 --- a/src/app/get-registry-auth.ts +++ b/src/app/get-registry-auth.ts @@ -1,18 +1,18 @@ import type { AuthOptions } from "npm-registry-fetch"; -import { decodeBase64 } from "../domain/base64"; -import { partialApply } from "../domain/fp-utils"; -import { DebugLog } from "../domain/logging"; -import { Registry } from "../domain/registry"; +import { decodeBase64 } from "../domain/base64.js"; +import { partialApply } from "../domain/fp-utils.js"; +import { DebugLog } from "../domain/logging.js"; +import { Registry } from "../domain/registry.js"; import { openupmRegistryUrl, RegistryUrl, unityRegistryUrl, -} from "../domain/registry-url"; -import { trySplitAtFirstOccurrenceOf } from "../domain/string-utils"; -import type { UpmConfig, UpmConfigEntry } from "../domain/upm-config"; -import { removeExplicitUndefined } from "../domain/zod-utils"; -import { type ReadTextFile } from "../io/fs"; -import { loadUpmConfigUsing } from "./get-upm-config"; +} from "../domain/registry-url.js"; +import { trySplitAtFirstOccurrenceOf } from "../domain/string-utils.js"; +import type { UpmConfig, UpmConfigEntry } from "../domain/upm-config.js"; +import { removeExplicitUndefined } from "../domain/zod-utils.js"; +import { type ReadTextFile } from "../io/fs.js"; +import { loadUpmConfigUsing } from "./get-upm-config.js"; /** * Checks whether a registry requires authentication. This just checks whether diff --git a/src/app/get-registry-packument-version.ts b/src/app/get-registry-packument-version.ts index facb3009..78edcac7 100644 --- a/src/app/get-registry-packument-version.ts +++ b/src/app/get-registry-packument-version.ts @@ -1,17 +1,17 @@ import { AsyncResult, Err } from "ts-results-es"; -import { PackumentNotFoundError } from "../domain/common-errors"; -import { DomainName } from "../domain/domain-name"; -import { ResolvableVersion } from "../domain/package-spec"; +import { PackumentNotFoundError } from "../domain/common-errors.js"; +import { DomainName } from "../domain/domain-name.js"; +import { ResolvableVersion } from "../domain/package-spec.js"; import { ResolvePackumentVersionError, tryResolvePackumentVersion, UnityPackument, UnityPackumentVersion, -} from "../domain/packument"; -import { Registry } from "../domain/registry"; -import { RegistryUrl } from "../domain/registry-url"; -import { resultifyAsyncOp } from "../domain/result-utils"; -import type { GetRegistryPackument } from "../io/registry"; +} from "../domain/packument.js"; +import { Registry } from "../domain/registry.js"; +import { RegistryUrl } from "../domain/registry-url.js"; +import { resultifyAsyncOp } from "../domain/result-utils.js"; +import type { GetRegistryPackument } from "../io/registry.js"; /** * A successfully resolved packument-version. diff --git a/src/app/get-upm-config.ts b/src/app/get-upm-config.ts index 9f6e47c0..fd162bde 100644 --- a/src/app/get-upm-config.ts +++ b/src/app/get-upm-config.ts @@ -1,5 +1,5 @@ -import { parseUpmConfig, type UpmConfig } from "../domain/upm-config"; -import { ReadTextFile } from "../io/fs"; +import { parseUpmConfig, type UpmConfig } from "../domain/upm-config.js"; +import { ReadTextFile } from "../io/fs.js"; /** * Loads an upm-config file. diff --git a/src/app/login.ts b/src/app/login.ts index c8c44701..7212f3a7 100644 --- a/src/app/login.ts +++ b/src/app/login.ts @@ -1,11 +1,11 @@ import type { AuthOptions } from "npm-registry-fetch"; -import { partialApply } from "../domain/fp-utils"; -import { DebugLog } from "../domain/logging"; -import { RegistryUrl } from "../domain/registry-url"; -import { type ReadTextFile, type WriteTextFile } from "../io/fs"; -import type { GetAuthToken } from "../io/registry"; -import { saveNpmAuthTokenUsing } from "./put-npm-auth-token"; -import { putRegistryAuthUsing } from "./put-registry-auth"; +import { partialApply } from "../domain/fp-utils.js"; +import { DebugLog } from "../domain/logging.js"; +import { RegistryUrl } from "../domain/registry-url.js"; +import { type ReadTextFile, type WriteTextFile } from "../io/fs.js"; +import type { GetAuthToken } from "../io/registry.js"; +import { saveNpmAuthTokenUsing } from "./put-npm-auth-token.js"; +import { putRegistryAuthUsing } from "./put-registry-auth.js"; /** * Logs a user into a package registry. Supports both basic and diff --git a/src/app/put-npm-auth-token.ts b/src/app/put-npm-auth-token.ts index dc572f0d..bf2192ca 100644 --- a/src/app/put-npm-auth-token.ts +++ b/src/app/put-npm-auth-token.ts @@ -6,10 +6,10 @@ import { serializeNpmrc, setToken, type Npmrc, -} from "../domain/npmrc"; -import { RegistryUrl } from "../domain/registry-url"; -import { type ReadTextFile, type WriteTextFile } from "../io/fs"; -import type { AuthToken } from "../domain/auth"; +} from "../domain/npmrc.js"; +import { RegistryUrl } from "../domain/registry-url.js"; +import { type ReadTextFile, type WriteTextFile } from "../io/fs.js"; +import type { AuthToken } from "../domain/auth.js"; /** * Stores an auth token in the users `.npmrc` for npm authentication. diff --git a/src/app/put-registry-auth.ts b/src/app/put-registry-auth.ts index 53aa7d3d..04be2e4f 100644 --- a/src/app/put-registry-auth.ts +++ b/src/app/put-registry-auth.ts @@ -1,12 +1,12 @@ import type { AuthOptions } from "npm-registry-fetch"; -import { encodeBase64 } from "../domain/base64"; -import { partialApply } from "../domain/fp-utils"; -import { RegistryUrl } from "../domain/registry-url"; -import type { UpmConfig, UpmConfigEntry } from "../domain/upm-config"; -import { removeExplicitUndefined } from "../domain/zod-utils"; -import { type ReadTextFile, type WriteTextFile } from "../io/fs"; -import { loadUpmConfigUsing } from "./get-upm-config"; -import { saveUpmConfigFileUsing } from "./write-upm-config"; +import { encodeBase64 } from "../domain/base64.js"; +import { partialApply } from "../domain/fp-utils.js"; +import { RegistryUrl } from "../domain/registry-url.js"; +import type { UpmConfig, UpmConfigEntry } from "../domain/upm-config.js"; +import { removeExplicitUndefined } from "../domain/zod-utils.js"; +import { type ReadTextFile, type WriteTextFile } from "../io/fs.js"; +import { loadUpmConfigUsing } from "./get-upm-config.js"; +import { saveUpmConfigFileUsing } from "./write-upm-config.js"; function mergeEntries( oldEntry: UpmConfigEntry | null, diff --git a/src/app/query-registries.ts b/src/app/query-registries.ts index f8e2241a..912dcda1 100644 --- a/src/app/query-registries.ts +++ b/src/app/query-registries.ts @@ -1,5 +1,5 @@ -import { Registry } from "../domain/registry"; -import { RegistryUrl } from "../domain/registry-url"; +import { Registry } from "../domain/registry.js"; +import { RegistryUrl } from "../domain/registry-url.js"; /** * A value that was resolved from a remote registry. diff --git a/src/app/remove-dependencies.ts b/src/app/remove-dependencies.ts index c54f6481..4adb0c4a 100644 --- a/src/app/remove-dependencies.ts +++ b/src/app/remove-dependencies.ts @@ -1,17 +1,17 @@ import { AsyncResult } from "ts-results-es"; -import { PackumentNotFoundError } from "../domain/common-errors"; -import { tryRemoveProjectDependencies } from "../domain/dependency-management"; -import { DomainName } from "../domain/domain-name"; -import { partialApply } from "../domain/fp-utils"; -import { DebugLog } from "../domain/logging"; +import { PackumentNotFoundError } from "../domain/common-errors.js"; +import { tryRemoveProjectDependencies } from "../domain/dependency-management.js"; +import { DomainName } from "../domain/domain-name.js"; +import { partialApply } from "../domain/fp-utils.js"; +import { DebugLog } from "../domain/logging.js"; import { UnityProjectManifest, type DependencyVersion, -} from "../domain/project-manifest"; -import { resultifyAsyncOp } from "../domain/result-utils"; -import { type ReadTextFile, type WriteTextFile } from "../io/fs"; -import { loadProjectManifestUsing } from "./get-dependencies"; -import { saveProjectManifestUsing } from "./write-dependencies"; +} from "../domain/project-manifest.js"; +import { resultifyAsyncOp } from "../domain/result-utils.js"; +import { type ReadTextFile, type WriteTextFile } from "../io/fs.js"; +import { loadProjectManifestUsing } from "./get-dependencies.js"; +import { saveProjectManifestUsing } from "./write-dependencies.js"; /** * Contains information about a package that was removed from a project. diff --git a/src/app/resolve-dependencies.ts b/src/app/resolve-dependencies.ts index 73899eac..a5f76bd5 100644 --- a/src/app/resolve-dependencies.ts +++ b/src/app/resolve-dependencies.ts @@ -1,4 +1,4 @@ -import { PackumentNotFoundError } from "../domain/common-errors"; +import { PackumentNotFoundError } from "../domain/common-errors.js"; import { DependencyGraph, makeGraphFromSeed, @@ -6,19 +6,19 @@ import { markFailed, markRemoteResolved, tryGetNextUnresolved, -} from "../domain/dependency-graph"; -import { DomainName } from "../domain/domain-name"; -import { partialApply } from "../domain/fp-utils"; +} from "../domain/dependency-graph.js"; +import { DomainName } from "../domain/domain-name.js"; +import { partialApply } from "../domain/fp-utils.js"; import { ResolvePackumentVersionError, tryResolvePackumentVersion, -} from "../domain/packument"; -import { Registry } from "../domain/registry"; -import { RegistryUrl } from "../domain/registry-url"; -import { SemanticVersion } from "../domain/semantic-version"; -import type { GetRegistryPackument } from "../io/registry"; -import { type CheckUrlExists } from "../io/www"; -import { checkIsBuiltInPackageUsing } from "./built-in-package-check"; +} from "../domain/packument.js"; +import { Registry } from "../domain/registry.js"; +import { RegistryUrl } from "../domain/registry-url.js"; +import { SemanticVersion } from "../domain/semantic-version.js"; +import type { GetRegistryPackument } from "../io/registry.js"; +import { type CheckUrlExists } from "../io/www.js"; +import { checkIsBuiltInPackageUsing } from "./built-in-package-check.js"; /** * Resolves all dependencies for a package. diff --git a/src/app/search-packages.ts b/src/app/search-packages.ts index eb36f17d..30832e53 100644 --- a/src/app/search-packages.ts +++ b/src/app/search-packages.ts @@ -1,11 +1,11 @@ -import { assertIsError } from "../domain/error-type-guards"; -import { DebugLog } from "../domain/logging"; -import { Registry } from "../domain/registry"; +import { assertIsError } from "../domain/error-type-guards.js"; +import { DebugLog } from "../domain/logging.js"; +import { Registry } from "../domain/registry.js"; import { GetAllRegistryPackuments, type SearchRegistry, -} from "../io/registry"; -import { type SearchedPackument } from "../domain/packument"; +} from "../io/registry.js"; +import { type SearchedPackument } from "../domain/packument.js"; /** * A function for searching packages in a registry. diff --git a/src/app/write-dependencies.ts b/src/app/write-dependencies.ts index 932066ab..4e43d8ef 100644 --- a/src/app/write-dependencies.ts +++ b/src/app/write-dependencies.ts @@ -2,8 +2,8 @@ import { manifestPathFor, serializeProjectManifest, UnityProjectManifest, -} from "../domain/project-manifest"; -import { WriteTextFile } from "../io/fs"; +} from "../domain/project-manifest.js"; +import { WriteTextFile } from "../io/fs.js"; /** * Function for replacing the project manifest for a Unity project. diff --git a/src/app/write-upm-config.ts b/src/app/write-upm-config.ts index 3d5eda9a..40996a38 100644 --- a/src/app/write-upm-config.ts +++ b/src/app/write-upm-config.ts @@ -1,5 +1,5 @@ -import { type UpmConfig, serializeUpmConfig } from "../domain/upm-config"; -import type { WriteTextFile } from "../io/fs"; +import { type UpmConfig, serializeUpmConfig } from "../domain/upm-config.js"; +import type { WriteTextFile } from "../io/fs.js"; /** * Save the upm config by overwriting the `.upmconfig.toml` file. diff --git a/src/cli/cmd-add.ts b/src/cli/cmd-add.ts index fbf1c792..883ef04c 100644 --- a/src/cli/cmd-add.ts +++ b/src/cli/cmd-add.ts @@ -1,26 +1,26 @@ import { Argument, Command, Option } from "@commander-js/extra-typings"; import { Logger } from "npmlog"; -import { addDependenciesUsing } from "../app/add-dependencies"; -import { determineEditorVersionUsing } from "../app/determine-editor-version"; -import { loadRegistryAuthUsing } from "../app/get-registry-auth"; -import { partialApply } from "../domain/fp-utils"; -import { DebugLog } from "../domain/logging"; -import { makePackageSpec } from "../domain/package-spec"; -import { recordEntries } from "../domain/record-utils"; -import { unityRegistry } from "../domain/registry"; -import { openupmRegistryUrl } from "../domain/registry-url"; -import { getHomePathFromEnv } from "../domain/special-paths"; -import { getUserUpmConfigPathFor } from "../domain/upm-config"; -import type { ReadTextFile, WriteTextFile } from "../io/fs"; -import type { GetRegistryPackument } from "../io/registry"; -import type { CheckUrlExists } from "../io/www"; -import { eachValue } from "./cli-parsing"; -import { withErrorLogger } from "./error-logging"; -import { primaryRegistriesUrlOpt } from "./opt-registry"; -import { systemUserOpt } from "./opt-system-user"; -import { upstreamOpt } from "./opt-upstream"; -import { workDirOpt } from "./opt-wd"; -import { mustBePackageSpec } from "./validators"; +import { addDependenciesUsing } from "../app/add-dependencies.js"; +import { determineEditorVersionUsing } from "../app/determine-editor-version.js"; +import { loadRegistryAuthUsing } from "../app/get-registry-auth.js"; +import { partialApply } from "../domain/fp-utils.js"; +import { DebugLog } from "../domain/logging.js"; +import { makePackageSpec } from "../domain/package-spec.js"; +import { recordEntries } from "../domain/record-utils.js"; +import { unityRegistry } from "../domain/registry.js"; +import { openupmRegistryUrl } from "../domain/registry-url.js"; +import { getHomePathFromEnv } from "../domain/special-paths.js"; +import { getUserUpmConfigPathFor } from "../domain/upm-config.js"; +import type { ReadTextFile, WriteTextFile } from "../io/fs.js"; +import type { GetRegistryPackument } from "../io/registry.js"; +import type { CheckUrlExists } from "../io/www.js"; +import { eachValue } from "./cli-parsing.js"; +import { withErrorLogger } from "./error-logging.js"; +import { primaryRegistriesUrlOpt } from "./opt-registry.js"; +import { systemUserOpt } from "./opt-system-user.js"; +import { upstreamOpt } from "./opt-upstream.js"; +import { workDirOpt } from "./opt-wd.js"; +import { mustBePackageSpec } from "./validators.js"; const packageSpecsArg = new Argument( "", diff --git a/src/cli/cmd-deps.ts b/src/cli/cmd-deps.ts index c5d78217..6cadf0cf 100644 --- a/src/cli/cmd-deps.ts +++ b/src/cli/cmd-deps.ts @@ -2,29 +2,29 @@ import { Argument, Command, Option } from "@commander-js/extra-typings"; import chalk from "chalk"; import { Logger } from "npmlog"; import os from "os"; -import { fetchLatestPackumentVersionUsing } from "../app/get-latest-version"; -import { loadRegistryAuthUsing } from "../app/get-registry-auth"; -import { queryAllRegistriesLazy } from "../app/query-registries"; -import { resolveDependenciesUsing } from "../app/resolve-dependencies"; -import { PackumentNotFoundError } from "../domain/common-errors"; -import { partialApply } from "../domain/fp-utils"; -import { DebugLog } from "../domain/logging"; -import { makePackageSpec, splitPackageSpec } from "../domain/package-spec"; -import { PackageUrl } from "../domain/package-url"; -import { unityRegistry } from "../domain/registry"; -import { SemanticVersion } from "../domain/semantic-version"; -import { getHomePathFromEnv } from "../domain/special-paths"; -import { getUserUpmConfigPathFor } from "../domain/upm-config"; -import { isZod } from "../domain/zod-utils"; -import type { ReadTextFile } from "../io/fs"; -import type { GetRegistryPackument } from "../io/registry"; -import type { CheckUrlExists } from "../io/www"; -import { stringifyDependencyGraph } from "./dependency-logging"; -import { withErrorLogger } from "./error-logging"; -import { primaryRegistryUrlOpt } from "./opt-registry"; -import { systemUserOpt } from "./opt-system-user"; -import { ResultCodes } from "./result-codes"; -import { mustBePackageSpec } from "./validators"; +import { fetchLatestPackumentVersionUsing } from "../app/get-latest-version.js"; +import { loadRegistryAuthUsing } from "../app/get-registry-auth.js"; +import { queryAllRegistriesLazy } from "../app/query-registries.js"; +import { resolveDependenciesUsing } from "../app/resolve-dependencies.js"; +import { PackumentNotFoundError } from "../domain/common-errors.js"; +import { partialApply } from "../domain/fp-utils.js"; +import { DebugLog } from "../domain/logging.js"; +import { makePackageSpec, splitPackageSpec } from "../domain/package-spec.js"; +import { PackageUrl } from "../domain/package-url.js"; +import { unityRegistry } from "../domain/registry.js"; +import { SemanticVersion } from "../domain/semantic-version.js"; +import { getHomePathFromEnv } from "../domain/special-paths.js"; +import { getUserUpmConfigPathFor } from "../domain/upm-config.js"; +import { isZod } from "../domain/zod-utils.js"; +import type { ReadTextFile } from "../io/fs.js"; +import type { GetRegistryPackument } from "../io/registry.js"; +import type { CheckUrlExists } from "../io/www.js"; +import { stringifyDependencyGraph } from "./dependency-logging.js"; +import { withErrorLogger } from "./error-logging.js"; +import { primaryRegistryUrlOpt } from "./opt-registry.js"; +import { systemUserOpt } from "./opt-system-user.js"; +import { ResultCodes } from "./result-codes.js"; +import { mustBePackageSpec } from "./validators.js"; const packageSpecArg = new Argument( "", diff --git a/src/cli/cmd-login.ts b/src/cli/cmd-login.ts index cff08c9d..ebdc4695 100644 --- a/src/cli/cmd-login.ts +++ b/src/cli/cmd-login.ts @@ -1,21 +1,21 @@ import { Command, Option } from "@commander-js/extra-typings"; import { Logger } from "npmlog"; -import { loginUsing } from "../app/login"; -import { partialApply } from "../domain/fp-utils"; -import type { DebugLog } from "../domain/logging"; -import { getHomePathFromEnv } from "../domain/special-paths"; -import { getUserUpmConfigPathFor } from "../domain/upm-config"; -import type { ReadTextFile, WriteTextFile } from "../io/fs"; -import type { GetAuthToken } from "../io/registry"; -import { withErrorLogger } from "./error-logging"; -import { systemUserOpt } from "./opt-system-user"; +import { loginUsing } from "../app/login.js"; +import { partialApply } from "../domain/fp-utils.js"; +import type { DebugLog } from "../domain/logging.js"; +import { getHomePathFromEnv } from "../domain/special-paths.js"; +import { getUserUpmConfigPathFor } from "../domain/upm-config.js"; +import type { ReadTextFile, WriteTextFile } from "../io/fs.js"; +import type { GetAuthToken } from "../io/registry.js"; +import { withErrorLogger } from "./error-logging.js"; +import { systemUserOpt } from "./opt-system-user.js"; import { promptEmail, promptPassword, promptRegistryUrl, promptUsername, -} from "./prompts"; -import { mustBeRegistryUrl } from "./validators"; +} from "./prompts.js"; +import { mustBeRegistryUrl } from "./validators.js"; const usernameOpt = new Option("-u, --username ", "username").default( null diff --git a/src/cli/cmd-ls.ts b/src/cli/cmd-ls.ts index 59d4fdc8..4b800a34 100644 --- a/src/cli/cmd-ls.ts +++ b/src/cli/cmd-ls.ts @@ -1,13 +1,13 @@ import { Command } from "@commander-js/extra-typings"; import { Logger } from "npmlog"; -import { loadProjectManifestUsing } from "../app/get-dependencies"; -import { partialApply } from "../domain/fp-utils"; -import type { DebugLog } from "../domain/logging"; -import { makePackageSpec } from "../domain/package-spec"; -import { recordEntries } from "../domain/record-utils"; -import type { ReadTextFile } from "../io/fs"; -import { withErrorLogger } from "./error-logging"; -import { workDirOpt } from "./opt-wd"; +import { loadProjectManifestUsing } from "../app/get-dependencies.js"; +import { partialApply } from "../domain/fp-utils.js"; +import type { DebugLog } from "../domain/logging.js"; +import { makePackageSpec } from "../domain/package-spec.js"; +import { recordEntries } from "../domain/record-utils.js"; +import type { ReadTextFile } from "../io/fs.js"; +import { withErrorLogger } from "./error-logging.js"; +import { workDirOpt } from "./opt-wd.js"; /** * Makes the `openupm ls` cli command with the given dependencies. diff --git a/src/cli/cmd-remove.ts b/src/cli/cmd-remove.ts index fe30b0cf..3a0c5d57 100644 --- a/src/cli/cmd-remove.ts +++ b/src/cli/cmd-remove.ts @@ -1,15 +1,15 @@ import { Argument, Command } from "@commander-js/extra-typings"; import { Logger } from "npmlog"; -import { removeDependenciesUsing } from "../app/remove-dependencies"; -import { partialApply } from "../domain/fp-utils"; -import type { DebugLog } from "../domain/logging"; -import { makePackageSpec } from "../domain/package-spec"; -import type { ReadTextFile, WriteTextFile } from "../io/fs"; -import { eachValue } from "./cli-parsing"; -import { logError, withErrorLogger } from "./error-logging"; -import { workDirOpt } from "./opt-wd"; -import { ResultCodes } from "./result-codes"; -import { mustBeDomainName } from "./validators"; +import { removeDependenciesUsing } from "../app/remove-dependencies.js"; +import { partialApply } from "../domain/fp-utils.js"; +import type { DebugLog } from "../domain/logging.js"; +import { makePackageSpec } from "../domain/package-spec.js"; +import type { ReadTextFile, WriteTextFile } from "../io/fs.js"; +import { eachValue } from "./cli-parsing.js"; +import { logError, withErrorLogger } from "./error-logging.js"; +import { workDirOpt } from "./opt-wd.js"; +import { ResultCodes } from "./result-codes.js"; +import { mustBeDomainName } from "./validators.js"; const packageNamesArg = new Argument( "", diff --git a/src/cli/cmd-search.ts b/src/cli/cmd-search.ts index 2a0feaeb..467d5969 100644 --- a/src/cli/cmd-search.ts +++ b/src/cli/cmd-search.ts @@ -1,19 +1,19 @@ import { Command } from "@commander-js/extra-typings"; import { Logger } from "npmlog"; import * as os from "os"; -import { loadRegistryAuthUsing } from "../app/get-registry-auth"; -import { searchPackagesUsing } from "../app/search-packages"; -import { partialApply } from "../domain/fp-utils"; -import { DebugLog } from "../domain/logging"; -import { getHomePathFromEnv } from "../domain/special-paths"; -import { getUserUpmConfigPathFor } from "../domain/upm-config"; -import type { ReadTextFile } from "../io/fs"; -import type { GetAllRegistryPackuments, SearchRegistry } from "../io/registry"; -import { withErrorLogger } from "./error-logging"; -import { primaryRegistryUrlOpt } from "./opt-registry"; -import { systemUserOpt } from "./opt-system-user"; -import { formatAsTable } from "./output-formatting"; -import { ResultCodes } from "./result-codes"; +import { loadRegistryAuthUsing } from "../app/get-registry-auth.js"; +import { searchPackagesUsing } from "../app/search-packages.js"; +import { partialApply } from "../domain/fp-utils.js"; +import { DebugLog } from "../domain/logging.js"; +import { getHomePathFromEnv } from "../domain/special-paths.js"; +import { getUserUpmConfigPathFor } from "../domain/upm-config.js"; +import type { ReadTextFile } from "../io/fs.js"; +import type { GetAllRegistryPackuments, SearchRegistry } from "../io/registry.js"; +import { withErrorLogger } from "./error-logging.js"; +import { primaryRegistryUrlOpt } from "./opt-registry.js"; +import { systemUserOpt } from "./opt-system-user.js"; +import { formatAsTable } from "./output-formatting.js"; +import { ResultCodes } from "./result-codes.js"; /** * Makes the `openupm search` cli command with the given dependencies. diff --git a/src/cli/cmd-view.ts b/src/cli/cmd-view.ts index 72bfca3d..3a0f10ff 100644 --- a/src/cli/cmd-view.ts +++ b/src/cli/cmd-view.ts @@ -1,24 +1,24 @@ import { Command } from "@commander-js/extra-typings"; import { Logger } from "npmlog"; import { EOL } from "os"; -import { loadRegistryAuthUsing } from "../app/get-registry-auth"; -import { queryAllRegistriesLazy } from "../app/query-registries"; -import { PackumentNotFoundError } from "../domain/common-errors"; -import { partialApply } from "../domain/fp-utils"; -import type { DebugLog } from "../domain/logging"; -import { hasVersion, splitPackageSpec } from "../domain/package-spec"; -import { unityRegistry } from "../domain/registry"; -import { getHomePathFromEnv } from "../domain/special-paths"; -import { getUserUpmConfigPathFor } from "../domain/upm-config"; -import type { ReadTextFile } from "../io/fs"; -import type { GetRegistryPackument } from "../io/registry"; -import { withErrorLogger } from "./error-logging"; -import { primaryRegistryUrlOpt } from "./opt-registry"; -import { systemUserOpt } from "./opt-system-user"; -import { upstreamOpt } from "./opt-upstream"; -import { formatPackumentInfo } from "./output-formatting"; -import { ResultCodes } from "./result-codes"; -import { mustBePackageSpec } from "./validators"; +import { loadRegistryAuthUsing } from "../app/get-registry-auth.js"; +import { queryAllRegistriesLazy } from "../app/query-registries.js"; +import { PackumentNotFoundError } from "../domain/common-errors.js"; +import { partialApply } from "../domain/fp-utils.js"; +import type { DebugLog } from "../domain/logging.js"; +import { hasVersion, splitPackageSpec } from "../domain/package-spec.js"; +import { unityRegistry } from "../domain/registry.js"; +import { getHomePathFromEnv } from "../domain/special-paths.js"; +import { getUserUpmConfigPathFor } from "../domain/upm-config.js"; +import type { ReadTextFile } from "../io/fs.js"; +import type { GetRegistryPackument } from "../io/registry.js"; +import { withErrorLogger } from "./error-logging.js"; +import { primaryRegistryUrlOpt } from "./opt-registry.js"; +import { systemUserOpt } from "./opt-system-user.js"; +import { upstreamOpt } from "./opt-upstream.js"; +import { formatPackumentInfo } from "./output-formatting.js"; +import { ResultCodes } from "./result-codes.js"; +import { mustBePackageSpec } from "./validators.js"; /** * Makes the `openupm view` cli command with the given dependencies. diff --git a/src/cli/dependency-logging.ts b/src/cli/dependency-logging.ts index 6d953f21..a8dbc969 100644 --- a/src/cli/dependency-logging.ts +++ b/src/cli/dependency-logging.ts @@ -1,5 +1,5 @@ import { Chalk } from "chalk"; -import { PackumentNotFoundError } from "../domain/common-errors"; +import { PackumentNotFoundError } from "../domain/common-errors.js"; import { DependencyGraph, FailedNode, @@ -7,20 +7,20 @@ import { NodeType, ResolvedNode, tryGetGraphNode, -} from "../domain/dependency-graph"; -import { DomainName } from "../domain/domain-name"; +} from "../domain/dependency-graph.js"; +import { DomainName } from "../domain/domain-name.js"; import { makePackageSpec, PackageSpec, -} from "../domain/package-spec"; +} from "../domain/package-spec.js"; import { ResolvePackumentVersionError, VersionNotFoundError, -} from "../domain/packument"; -import { RegistryUrl, unityRegistryUrl } from "../domain/registry-url"; -import { SemanticVersion } from "../domain/semantic-version"; -import { DebugLog } from "../domain/logging"; -import { recordEntries } from "../domain/record-utils"; +} from "../domain/packument.js"; +import { RegistryUrl, unityRegistryUrl } from "../domain/registry-url.js"; +import { SemanticVersion } from "../domain/semantic-version.js"; +import { DebugLog } from "../domain/logging.js"; +import { recordEntries } from "../domain/record-utils.js"; /** * Logs information about a resolved dependency to a logger. diff --git a/src/cli/error-logging.ts b/src/cli/error-logging.ts index 33561639..d3e1ce9d 100644 --- a/src/cli/error-logging.ts +++ b/src/cli/error-logging.ts @@ -5,36 +5,36 @@ import { PackageIncompatibleError, UnresolvedDependenciesError, type UnresolvedDependency, -} from "../app/add-dependencies"; -import { EditorNotInstalledError } from "../app/builtin-packages"; +} from "../app/add-dependencies.js"; +import { EditorNotInstalledError } from "../app/builtin-packages.js"; import { ProjectVersionMalformedError, ProjectVersionMissingError, -} from "../app/determine-editor-version"; +} from "../app/determine-editor-version.js"; import { ManifestMalformedError, ManifestMissingError, -} from "../app/get-dependencies"; +} from "../app/get-dependencies.js"; import { EditorVersionNotSupportedError, PackumentNotFoundError, -} from "../domain/common-errors"; -import { stringifyEditorVersion } from "../domain/editor-version"; +} from "../domain/common-errors.js"; +import { stringifyEditorVersion } from "../domain/editor-version.js"; import { NoStableError, NoVersionsError, VersionNotFoundError, type ResolvePackumentVersionError, -} from "../domain/packument"; -import { recordEntries } from "../domain/record-utils"; +} from "../domain/packument.js"; +import { recordEntries } from "../domain/record-utils.js"; import { NoHomePathError, OSNotSupportedError, VersionNotSupportedOnOsError, -} from "../domain/special-paths"; -import { NoSystemUserProfilePath } from "../domain/upm-config"; -import { RegistryAuthenticationError } from "../io/common-errors"; -import { ResultCodes } from "./result-codes"; +} from "../domain/special-paths.js"; +import { NoSystemUserProfilePath } from "../domain/upm-config.js"; +import { RegistryAuthenticationError } from "../io/common-errors.js"; +import { ResultCodes } from "./result-codes.js"; function errorMessageFor(error: ResolvePackumentVersionError): string { if (error instanceof PackumentNotFoundError) return "package not found"; diff --git a/src/cli/index.ts b/src/cli/index.ts index cc88b197..40f566e9 100644 --- a/src/cli/index.ts +++ b/src/cli/index.ts @@ -2,23 +2,23 @@ import { createCommand, Option } from "@commander-js/extra-typings"; import chalk from "chalk"; import type { Logger } from "npmlog"; import pkginfo from "pkginfo"; -import type { DebugLog } from "../domain/logging"; -import { getHomePathFromEnv } from "../domain/special-paths"; -import { readTextFile, writeTextFile } from "../io/fs"; +import type { DebugLog } from "../domain/logging.js"; +import { getHomePathFromEnv } from "../domain/special-paths.js"; +import { readTextFile, writeTextFile } from "../io/fs.js"; import { type GetAllRegistryPackuments, type GetAuthToken, type GetRegistryPackument, type SearchRegistry, -} from "../io/registry"; -import { fetchCheckUrlExists } from "../io/www"; -import { makeAddCmd } from "./cmd-add"; -import { makeDepsCmd } from "./cmd-deps"; -import { makeLoginCmd } from "./cmd-login"; -import { makeLsCmd } from "./cmd-ls"; -import { makeRemoveCmd } from "./cmd-remove"; -import { makeSearchCmd } from "./cmd-search"; -import { makeViewCmd } from "./cmd-view"; +} from "../io/registry.js"; +import { fetchCheckUrlExists } from "../io/www.js"; +import { makeAddCmd } from "./cmd-add.js"; +import { makeDepsCmd } from "./cmd-deps.js"; +import { makeLoginCmd } from "./cmd-login.js"; +import { makeLsCmd } from "./cmd-ls.js"; +import { makeRemoveCmd } from "./cmd-remove.js"; +import { makeSearchCmd } from "./cmd-search.js"; +import { makeViewCmd } from "./cmd-view.js"; const verboseOpt = new Option( "-v, --verbose", diff --git a/src/cli/opt-registry.ts b/src/cli/opt-registry.ts index 3a13d99d..4e61d5dd 100644 --- a/src/cli/opt-registry.ts +++ b/src/cli/opt-registry.ts @@ -1,7 +1,7 @@ import { Option } from "@commander-js/extra-typings"; -import { openupmRegistryUrl } from "../domain/registry-url"; -import { eachValue } from "./cli-parsing"; -import { mustBeRegistryUrl } from "./validators"; +import { openupmRegistryUrl } from "../domain/registry-url.js"; +import { eachValue } from "./cli-parsing.js"; +import { mustBeRegistryUrl } from "./validators.js"; /** * CLI option for the primary registry from which to resolve packages. diff --git a/src/cli/output-formatting.ts b/src/cli/output-formatting.ts index 19b41010..f2fd9956 100644 --- a/src/cli/output-formatting.ts +++ b/src/cli/output-formatting.ts @@ -5,8 +5,8 @@ import { tryGetLatestVersion, UnityPackument, VersionedPackument, -} from "../domain/packument"; -import { recordKeys } from "../domain/record-utils"; +} from "../domain/packument.js"; +import { recordKeys } from "../domain/record-utils.js"; /** * A type describing the minimum required properties of a packument diff --git a/src/cli/prompts.ts b/src/cli/prompts.ts index 3665c4fb..981b9682 100644 --- a/src/cli/prompts.ts +++ b/src/cli/prompts.ts @@ -1,5 +1,5 @@ import promptly from "promptly"; -import { RegistryUrl } from "../domain/registry-url"; +import { RegistryUrl } from "../domain/registry-url.js"; /** * Prompts the user for their username. diff --git a/src/cli/validators.ts b/src/cli/validators.ts index 800c65cc..c2493fee 100644 --- a/src/cli/validators.ts +++ b/src/cli/validators.ts @@ -1,9 +1,9 @@ -import { DomainName } from "../domain/domain-name"; +import { DomainName } from "../domain/domain-name.js"; // eslint-disable-next-line @typescript-eslint/no-unused-vars -import { isPackageSpec, type PackageSpec } from "../domain/package-spec"; -import { coerceRegistryUrl } from "../domain/registry-url"; -import { isZod } from "../domain/zod-utils"; -import { mustBeParsable, mustSatisfy } from "./cli-parsing"; +import { isPackageSpec, type PackageSpec } from "../domain/package-spec.js"; +import { coerceRegistryUrl } from "../domain/registry-url.js"; +import { isZod } from "../domain/zod-utils.js"; +import { mustBeParsable, mustSatisfy } from "./cli-parsing.js"; /** * {@link CliValueParser} for checking that a string is a {@link PackageSpec}. diff --git a/src/domain/common-errors.ts b/src/domain/common-errors.ts index 20af5776..48a56a71 100644 --- a/src/domain/common-errors.ts +++ b/src/domain/common-errors.ts @@ -1,6 +1,6 @@ import { CustomError } from "ts-custom-error"; -import type { DomainName } from "./domain-name"; -import type { EditorVersion } from "./editor-version"; +import type { DomainName } from "./domain-name.js"; +import type { EditorVersion } from "./editor-version.js"; /** * Error for when the packument was not found. diff --git a/src/domain/dependency-graph.ts b/src/domain/dependency-graph.ts index d5e9b398..b56e8053 100644 --- a/src/domain/dependency-graph.ts +++ b/src/domain/dependency-graph.ts @@ -1,8 +1,8 @@ -import { DomainName } from "./domain-name"; -import { ResolvePackumentVersionError } from "./packument"; -import { recordEntries } from "./record-utils"; -import { RegistryUrl } from "./registry-url"; -import { SemanticVersion } from "./semantic-version"; +import { DomainName } from "./domain-name.js"; +import { ResolvePackumentVersionError } from "./packument.js"; +import { recordEntries } from "./record-utils.js"; +import { RegistryUrl } from "./registry-url.js"; +import { SemanticVersion } from "./semantic-version.js"; export enum NodeType { Unresolved, diff --git a/src/domain/dependency-management.ts b/src/domain/dependency-management.ts index 6036641e..7833c2d5 100644 --- a/src/domain/dependency-management.ts +++ b/src/domain/dependency-management.ts @@ -1,7 +1,7 @@ import { Err, Ok, type Result } from "ts-results-es"; -import { PackumentNotFoundError } from "./common-errors"; -import type { DomainName } from "./domain-name"; -import { omitKey } from "./object-utils"; +import { PackumentNotFoundError } from "./common-errors.js"; +import type { DomainName } from "./domain-name.js"; +import { omitKey } from "./object-utils.js"; import { type DependencyVersion, type UnityProjectManifest, @@ -10,7 +10,7 @@ import { removeScopeFromAllScopedRegistries, removeTestable, setDependency, -} from "./project-manifest"; +} from "./project-manifest.js"; /** * A package that was removed from the manifest. */ diff --git a/src/domain/error-type-guards.ts b/src/domain/error-type-guards.ts index e0483e82..5248bdad 100644 --- a/src/domain/error-type-guards.ts +++ b/src/domain/error-type-guards.ts @@ -1,5 +1,5 @@ import { AssertionError } from "assert"; -import { HttpErrorLike } from "../io/common-errors"; +import { HttpErrorLike } from "../io/common-errors.js"; /** * Type guard for checking if a value is an {@link Error}. diff --git a/src/domain/npmrc.ts b/src/domain/npmrc.ts index fa60b3d2..3c45849d 100644 --- a/src/domain/npmrc.ts +++ b/src/domain/npmrc.ts @@ -1,7 +1,7 @@ import path from "path"; -import type { AuthToken } from "./auth"; -import { RegistryUrl } from "./registry-url"; -import { splitLines } from "./string-utils"; +import type { AuthToken } from "./auth.js"; +import { RegistryUrl } from "./registry-url.js"; +import { splitLines } from "./string-utils.js"; /** * The content lines of a npmrc file. diff --git a/src/domain/package-id.ts b/src/domain/package-id.ts index da23b921..ebc47ff2 100644 --- a/src/domain/package-id.ts +++ b/src/domain/package-id.ts @@ -1,7 +1,7 @@ -import { DomainName } from "./domain-name"; -import { SemanticVersion } from "./semantic-version"; -import { trySplitAtFirstOccurrenceOf } from "./string-utils"; -import { isZod } from "./zod-utils"; +import { DomainName } from "./domain-name.js"; +import { SemanticVersion } from "./semantic-version.js"; +import { trySplitAtFirstOccurrenceOf } from "./string-utils.js"; +import { isZod } from "./zod-utils.js"; /** * Represents a package at a specific version. The version is here is a diff --git a/src/domain/package-manifest.ts b/src/domain/package-manifest.ts index b854c6d2..a05c21ac 100644 --- a/src/domain/package-manifest.ts +++ b/src/domain/package-manifest.ts @@ -1,10 +1,10 @@ -import { DomainName } from "./domain-name"; -import { SemanticVersion } from "./semantic-version"; +import { DomainName } from "./domain-name.js"; +import { SemanticVersion } from "./semantic-version.js"; import { Maintainer } from "@npm/types"; -import { recordEntries } from "./record-utils"; -import { EditorVersion, tryParseEditorVersion } from "./editor-version"; +import { recordEntries } from "./record-utils.js"; +import { EditorVersion, tryParseEditorVersion } from "./editor-version.js"; -import { MalformedPackumentError } from "./common-errors"; +import { MalformedPackumentError } from "./common-errors.js"; type MajorMinor = `${number}.${number}`; diff --git a/src/domain/package-spec.ts b/src/domain/package-spec.ts index b2307fcb..8c3b6648 100644 --- a/src/domain/package-spec.ts +++ b/src/domain/package-spec.ts @@ -1,9 +1,9 @@ import assert from "assert"; -import { DomainName } from "./domain-name"; -import { PackageUrl } from "./package-url"; -import { SemanticVersion } from "./semantic-version"; -import { trySplitAtFirstOccurrenceOf } from "./string-utils"; -import { assertZod, isZod } from "./zod-utils"; +import { DomainName } from "./domain-name.js"; +import { PackageUrl } from "./package-url.js"; +import { SemanticVersion } from "./semantic-version.js"; +import { trySplitAtFirstOccurrenceOf } from "./string-utils.js"; +import { assertZod, isZod } from "./zod-utils.js"; /** * The "latest" tag string. Specifies that the latest version is requested. diff --git a/src/domain/packument.ts b/src/domain/packument.ts index d74a4593..84bb12de 100644 --- a/src/domain/packument.ts +++ b/src/domain/packument.ts @@ -1,16 +1,16 @@ import { Dist } from "@npm/types"; import { CustomError } from "ts-custom-error"; import { Err, Ok, Result } from "ts-results-es"; -import { PackumentNotFoundError } from "./common-errors"; -import { DomainName } from "./domain-name"; -import { UnityPackageManifest } from "./package-manifest"; +import { PackumentNotFoundError } from "./common-errors.js"; +import { DomainName } from "./domain-name.js"; +import { UnityPackageManifest } from "./package-manifest.js"; import { ResolvableVersion, type LatestTag, type StableTag, -} from "./package-spec"; -import { recordKeys } from "./record-utils"; -import { compareVersions, isStable, SemanticVersion } from "./semantic-version"; +} from "./package-spec.js"; +import { recordKeys } from "./record-utils.js"; +import { compareVersions, isStable, SemanticVersion } from "./semantic-version.js"; /** * Contains information about a specific version of a package. This is based on diff --git a/src/domain/project-manifest.ts b/src/domain/project-manifest.ts index 8846b729..ba410489 100644 --- a/src/domain/project-manifest.ts +++ b/src/domain/project-manifest.ts @@ -1,12 +1,12 @@ import path from "node:path"; import { z } from "zod"; -import { DomainName } from "./domain-name"; -import { PackageUrl } from "./package-url"; -import { removeRecordKey } from "./record-utils"; -import { RegistryUrl } from "./registry-url"; -import { ScopedRegistry } from "./scoped-registry"; -import { SemanticVersion } from "./semantic-version"; -import { removeTrailingSlash } from "./string-utils"; +import { DomainName } from "./domain-name.js"; +import { PackageUrl } from "./package-url.js"; +import { removeRecordKey } from "./record-utils.js"; +import { RegistryUrl } from "./registry-url.js"; +import { ScopedRegistry } from "./scoped-registry.js"; +import { SemanticVersion } from "./semantic-version.js"; +import { removeTrailingSlash } from "./string-utils.js"; /** * The version of a dependency in a manifest. diff --git a/src/domain/project-version-txt.ts b/src/domain/project-version-txt.ts index dcfd561f..b7e9788e 100644 --- a/src/domain/project-version-txt.ts +++ b/src/domain/project-version-txt.ts @@ -5,7 +5,7 @@ import { isRelease, tryParseEditorVersion, type ReleaseVersion, -} from "./editor-version"; +} from "./editor-version.js"; /** * Constructs the path to a ProjectVersion.txt file based on the path to diff --git a/src/domain/registry-url.ts b/src/domain/registry-url.ts index 08e1c39a..07b575a1 100644 --- a/src/domain/registry-url.ts +++ b/src/domain/registry-url.ts @@ -1,5 +1,5 @@ import { z } from "zod"; -import { removeTrailingSlash } from "./string-utils"; +import { removeTrailingSlash } from "./string-utils.js"; /** * Schema for {@link RegistryUrl}. diff --git a/src/domain/registry.ts b/src/domain/registry.ts index 1f50b55a..26447f03 100644 --- a/src/domain/registry.ts +++ b/src/domain/registry.ts @@ -1,5 +1,5 @@ import npmFetch, { type AuthOptions } from "npm-registry-fetch"; -import { RegistryUrl, unityRegistryUrl } from "./registry-url"; +import { RegistryUrl, unityRegistryUrl } from "./registry-url.js"; /** * Represents a remote npm-registry. diff --git a/src/domain/scoped-registry.ts b/src/domain/scoped-registry.ts index 1f8d4f41..0e60f509 100644 --- a/src/domain/scoped-registry.ts +++ b/src/domain/scoped-registry.ts @@ -1,5 +1,5 @@ -import { RegistryUrl } from "./registry-url"; -import { DomainName } from "./domain-name"; +import { RegistryUrl } from "./registry-url.js"; +import { DomainName } from "./domain-name.js"; /** * Contains information about a scoped registry. diff --git a/src/domain/semantic-version.ts b/src/domain/semantic-version.ts index 3d262775..ee93465f 100644 --- a/src/domain/semantic-version.ts +++ b/src/domain/semantic-version.ts @@ -1,4 +1,4 @@ -import semver from "semver/preload"; +import semver from "semver"; import { z } from "zod"; /** diff --git a/src/domain/special-paths.ts b/src/domain/special-paths.ts index d19f1cc0..6edaee5c 100644 --- a/src/domain/special-paths.ts +++ b/src/domain/special-paths.ts @@ -1,14 +1,14 @@ import os from "os"; import { CustomError } from "ts-custom-error"; import { Err, Ok, Result } from "ts-results-es"; -import { EditorVersionNotSupportedError } from "./common-errors"; +import { EditorVersionNotSupportedError } from "./common-errors.js"; import { compareEditorVersion, EditorVersion, makeEditorVersion, ReleaseVersion, stringifyEditorVersion, -} from "./editor-version"; +} from "./editor-version.js"; /** * Error for when a specific OS does not support a specific editor-version. diff --git a/src/domain/upm-config.ts b/src/domain/upm-config.ts index fb56d92b..b8a326b8 100644 --- a/src/domain/upm-config.ts +++ b/src/domain/upm-config.ts @@ -2,11 +2,11 @@ import TOML from "@iarna/toml"; import path from "path"; import { CustomError } from "ts-custom-error"; import { z } from "zod"; -import { Base64 } from "./base64"; +import { Base64 } from "./base64.js"; import { type RemoveExplicitUndefined, removeExplicitUndefined, -} from "./zod-utils"; +} from "./zod-utils.js"; /** * The file name for upm config files. diff --git a/src/index.ts b/src/index.ts index 43f3044e..a1da304f 100644 --- a/src/index.ts +++ b/src/index.ts @@ -2,15 +2,15 @@ import npmlog from "npmlog"; import updateNotifier from "update-notifier"; -import pkg from "../package.json"; -import { makeOpenupmCli } from "./cli"; -import type { DebugLog } from "./domain/logging"; +import pkg from "../package.json" with { type: "json" }; +import { makeOpenupmCli } from "./cli/index.js"; +import type { DebugLog } from "./domain/logging.js"; import { getAllRegistryPackumentsUsing, getAuthTokenUsing, getRegistryPackumentUsing, searchRegistryUsing, -} from "./io/registry"; +} from "./io/registry.js"; // Composition root diff --git a/src/io/common-errors.ts b/src/io/common-errors.ts index ae5ae192..ef078cfe 100644 --- a/src/io/common-errors.ts +++ b/src/io/common-errors.ts @@ -1,6 +1,6 @@ import { CustomError } from "ts-custom-error"; -import { RegistryUrl } from "../domain/registry-url"; -import { isHttpError } from "../domain/error-type-guards"; +import { RegistryUrl } from "../domain/registry-url.js"; +import { isHttpError } from "../domain/error-type-guards.js"; /** * Error for when authentication with a registry failed. diff --git a/src/io/fs.ts b/src/io/fs.ts index 4f7c92f5..a544b706 100644 --- a/src/io/fs.ts +++ b/src/io/fs.ts @@ -1,7 +1,7 @@ import fse from "fs-extra"; import fs from "fs/promises"; import path from "path"; -import { assertIsNodeError } from "../domain/error-type-guards"; +import { assertIsNodeError } from "../domain/error-type-guards.js"; /** * Function for loading the content of a text file. diff --git a/src/io/registry.ts b/src/io/registry.ts index 6d5ef723..93ada1bd 100644 --- a/src/io/registry.ts +++ b/src/io/registry.ts @@ -1,17 +1,17 @@ import npmSearch from "libnpmsearch"; import { loginCouch } from "npm-profile"; import npmFetch from "npm-registry-fetch"; -import type { AuthToken } from "../domain/auth"; -import { DomainName } from "../domain/domain-name"; -import { assertIsError, assertIsHttpError } from "../domain/error-type-guards"; -import { DebugLog } from "../domain/logging"; -import type { SearchedPackument, UnityPackument } from "../domain/packument"; -import { makeNpmFetchOptions, Registry } from "../domain/registry"; -import type { RegistryUrl } from "../domain/registry-url"; +import type { AuthToken } from "../domain/auth.js"; +import { DomainName } from "../domain/domain-name.js"; +import { assertIsError, assertIsHttpError } from "../domain/error-type-guards.js"; +import { DebugLog } from "../domain/logging.js"; +import type { SearchedPackument, UnityPackument } from "../domain/packument.js"; +import { makeNpmFetchOptions, Registry } from "../domain/registry.js"; +import type { RegistryUrl } from "../domain/registry-url.js"; import { makeRegistryInteractionError, RegistryAuthenticationError, -} from "./common-errors"; +} from "./common-errors.js"; type AllPackuments = Readonly<{ // eslint-disable-next-line jsdoc/require-jsdoc diff --git a/test/common/data-packument.ts b/test/common/data-packument.ts index ab154f11..6bf5c6f3 100644 --- a/test/common/data-packument.ts +++ b/test/common/data-packument.ts @@ -1,11 +1,11 @@ import assert from "assert"; -import { DomainName } from "../../src/domain/domain-name"; +import { DomainName } from "../../src/domain/domain-name.js"; import { UnityPackument, UnityPackumentVersion, -} from "../../src/domain/packument"; -import { SemanticVersion } from "../../src/domain/semantic-version"; -import { isZod } from "../../src/domain/zod-utils"; +} from "../../src/domain/packument.js"; +import { SemanticVersion } from "../../src/domain/semantic-version.js"; +import { isZod } from "../../src/domain/zod-utils.js"; /** * Builder class for {@link UnityPackumentVersion}. diff --git a/test/common/data-project-manifest.ts b/test/common/data-project-manifest.ts index cd1a1746..82527ac6 100644 --- a/test/common/data-project-manifest.ts +++ b/test/common/data-project-manifest.ts @@ -1,6 +1,6 @@ import { AssertionError } from "assert"; -import { DomainName } from "../../src/domain/domain-name"; -import { PackageUrl } from "../../src/domain/package-url"; +import { DomainName } from "../../src/domain/domain-name.js"; +import { PackageUrl } from "../../src/domain/package-url.js"; import { addTestable, emptyProjectManifest, @@ -8,11 +8,11 @@ import { setDependency, UnityProjectManifest, type DependencyVersion, -} from "../../src/domain/project-manifest"; -import { addScope, makeScopedRegistry } from "../../src/domain/scoped-registry"; -import { SemanticVersion } from "../../src/domain/semantic-version"; -import { assertZod, isZod } from "../../src/domain/zod-utils"; -import { someRegistryUrl } from "./data-registry"; +} from "../../src/domain/project-manifest.js"; +import { addScope, makeScopedRegistry } from "../../src/domain/scoped-registry.js"; +import { SemanticVersion } from "../../src/domain/semantic-version.js"; +import { assertZod, isZod } from "../../src/domain/zod-utils.js"; +import { someRegistryUrl } from "./data-registry.js"; function assertIsDependencyVersion(x: unknown): asserts x is DependencyVersion { if (!isZod(x, SemanticVersion) && !isZod(x, PackageUrl)) diff --git a/test/common/data-registry.ts b/test/common/data-registry.ts index be1cd80e..72edb3e2 100644 --- a/test/common/data-registry.ts +++ b/test/common/data-registry.ts @@ -1,5 +1,5 @@ -import type { Registry } from "../../src/domain/registry"; -import { RegistryUrl } from "../../src/domain/registry-url"; +import type { Registry } from "../../src/domain/registry.js"; +import { RegistryUrl } from "../../src/domain/registry-url.js"; /** * Some registry url for testing. diff --git a/test/e2e/add.test.ts b/test/e2e/add.test.ts index 45bb1908..c44c9ce1 100644 --- a/test/e2e/add.test.ts +++ b/test/e2e/add.test.ts @@ -1,11 +1,11 @@ -import { ResultCodes } from "../../src/cli/result-codes"; -import { emptyProjectManifest } from "../../src/domain/project-manifest"; -import { RegistryUrl } from "../../src/domain/registry-url"; -import { getProjectManifest } from "./check/project-manifest"; -import { runOpenupm } from "./run"; -import { prepareHomeDirectory } from "./setup/directories"; -import { prepareUnityProject } from "./setup/project"; -import { e2eTestRegistryUrl } from "./setup/test-registry"; +import { ResultCodes } from "../../src/cli/result-codes.js"; +import { emptyProjectManifest } from "../../src/domain/project-manifest.js"; +import { RegistryUrl } from "../../src/domain/registry-url.js"; +import { getProjectManifest } from "./check/project-manifest.js"; +import { runOpenupm } from "./run.js"; +import { prepareHomeDirectory } from "./setup/directories.js"; +import { prepareUnityProject } from "./setup/project.js"; +import { e2eTestRegistryUrl } from "./setup/test-registry.js"; describe("add packages", () => { type SuccessfulAddCase = { diff --git a/test/e2e/check/project-manifest.ts b/test/e2e/check/project-manifest.ts index e2fb795f..8094ee00 100644 --- a/test/e2e/check/project-manifest.ts +++ b/test/e2e/check/project-manifest.ts @@ -1,8 +1,8 @@ -import { loadProjectManifestUsing } from "../../../src/app/get-dependencies"; -import { partialApply } from "../../../src/domain/fp-utils"; -import { noopLogger } from "../../../src/domain/logging"; -import { UnityProjectManifest } from "../../../src/domain/project-manifest"; -import { readTextFile } from "../../../src/io/fs"; +import { loadProjectManifestUsing } from "../../../src/app/get-dependencies.js"; +import { partialApply } from "../../../src/domain/fp-utils.js"; +import { noopLogger } from "../../../src/domain/logging.js"; +import { UnityProjectManifest } from "../../../src/domain/project-manifest.js"; +import { readTextFile } from "../../../src/io/fs.js"; const loadProjectManifest = partialApply( loadProjectManifestUsing, diff --git a/test/e2e/deps.test.ts b/test/e2e/deps.test.ts index a14a7e85..cd9e8ab8 100644 --- a/test/e2e/deps.test.ts +++ b/test/e2e/deps.test.ts @@ -1,6 +1,6 @@ -import { ResultCodes } from "../../src/cli/result-codes"; -import { runOpenupm } from "./run"; -import { prepareHomeDirectory } from "./setup/directories"; +import { ResultCodes } from "../../src/cli/result-codes.js"; +import { runOpenupm } from "./run.js"; +import { prepareHomeDirectory } from "./setup/directories.js"; describe("print package dependencies", () => { it("should print dependencies for an openupm package with version", async () => { diff --git a/test/e2e/help.test.ts b/test/e2e/help.test.ts index d84fac9b..2049d2ec 100644 --- a/test/e2e/help.test.ts +++ b/test/e2e/help.test.ts @@ -1,5 +1,5 @@ -import { runOpenupm } from "./run"; -import { prepareHomeDirectory } from "./setup/directories"; +import { runOpenupm } from "./run.js"; +import { prepareHomeDirectory } from "./setup/directories.js"; describe("help", () => { it("should show help when running with no commands", async () => { diff --git a/test/e2e/ls.test.ts b/test/e2e/ls.test.ts index 8062e9e5..a43473c8 100644 --- a/test/e2e/ls.test.ts +++ b/test/e2e/ls.test.ts @@ -1,8 +1,8 @@ -import { ResultCodes } from "../../src/cli/result-codes"; -import { buildProjectManifest } from "../common/data-project-manifest"; -import { runOpenupm } from "./run"; -import { prepareHomeDirectory } from "./setup/directories"; -import { prepareUnityProject } from "./setup/project"; +import { ResultCodes } from "../../src/cli/result-codes.js"; +import { buildProjectManifest } from "../common/data-project-manifest.js"; +import { runOpenupm } from "./run.js"; +import { prepareHomeDirectory } from "./setup/directories.js"; +import { prepareUnityProject } from "./setup/project.js"; describe("list installed packages", () => { test("should list installed packages", async () => { diff --git a/test/e2e/remove.test.ts b/test/e2e/remove.test.ts index b897de49..9c958ef0 100644 --- a/test/e2e/remove.test.ts +++ b/test/e2e/remove.test.ts @@ -1,11 +1,11 @@ -import { ResultCodes } from "../../src/cli/result-codes"; -import { emptyProjectManifest } from "../../src/domain/project-manifest"; -import { buildProjectManifest } from "../common/data-project-manifest"; -import { someRegistryUrl } from "../common/data-registry"; -import { getProjectManifest } from "./check/project-manifest"; -import { runOpenupm } from "./run"; -import { prepareHomeDirectory } from "./setup/directories"; -import { prepareUnityProject } from "./setup/project"; +import { ResultCodes } from "../../src/cli/result-codes.js"; +import { emptyProjectManifest } from "../../src/domain/project-manifest.js"; +import { buildProjectManifest } from "../common/data-project-manifest.js"; +import { someRegistryUrl } from "../common/data-registry.js"; +import { getProjectManifest } from "./check/project-manifest.js"; +import { runOpenupm } from "./run.js"; +import { prepareHomeDirectory } from "./setup/directories.js"; +import { prepareUnityProject } from "./setup/project.js"; describe("remove packages", () => { it("should not accept package reference with version", async () => { diff --git a/test/e2e/search.test.ts b/test/e2e/search.test.ts index 09a98ac6..80e52f21 100644 --- a/test/e2e/search.test.ts +++ b/test/e2e/search.test.ts @@ -1,6 +1,6 @@ -import { ResultCodes } from "../../src/cli/result-codes"; -import { runOpenupm } from "./run"; -import { prepareHomeDirectory } from "./setup/directories"; +import { ResultCodes } from "../../src/cli/result-codes.js"; +import { runOpenupm } from "./run.js"; +import { prepareHomeDirectory } from "./setup/directories.js"; describe("cmd-search", () => { it("should print packument information", async () => { diff --git a/test/e2e/setup/project.ts b/test/e2e/setup/project.ts index ff87042f..945c8d44 100644 --- a/test/e2e/setup/project.ts +++ b/test/e2e/setup/project.ts @@ -1,15 +1,15 @@ import fse from "fs-extra"; import path from "path"; import yaml from "yaml"; -import { partialApply } from "../../../src/domain/fp-utils"; +import { partialApply } from "../../../src/domain/fp-utils.js"; import { emptyProjectManifest, UnityProjectManifest, -} from "../../../src/domain/project-manifest"; -import { projectVersionTxtPathFor } from "../../../src/domain/project-version-txt"; -import { saveProjectManifestUsing } from "../../../src/app/write-dependencies"; -import { writeTextFile } from "../../../src/io/fs"; -import { dropDirectory } from "./directories"; +} from "../../../src/domain/project-manifest.js"; +import { projectVersionTxtPathFor } from "../../../src/domain/project-version-txt.js"; +import { saveProjectManifestUsing } from "../../../src/app/write-dependencies.js"; +import { writeTextFile } from "../../../src/io/fs.js"; +import { dropDirectory } from "./directories.js"; const writeProjectManifest = partialApply( saveProjectManifestUsing, diff --git a/test/e2e/setup/test-registry.ts b/test/e2e/setup/test-registry.ts index b041c969..33989b3a 100644 --- a/test/e2e/setup/test-registry.ts +++ b/test/e2e/setup/test-registry.ts @@ -1,4 +1,4 @@ -import { RegistryUrl } from "../../../src/domain/registry-url"; +import { RegistryUrl } from "../../../src/domain/registry-url.js"; /** * Registry url of the local e2e test package registry. diff --git a/test/e2e/unknown.test.ts b/test/e2e/unknown.test.ts index 6bae5e6b..0a0ea26f 100644 --- a/test/e2e/unknown.test.ts +++ b/test/e2e/unknown.test.ts @@ -1,5 +1,5 @@ -import { runOpenupm } from "./run"; -import { prepareHomeDirectory } from "./setup/directories"; +import { runOpenupm } from "./run.js"; +import { prepareHomeDirectory } from "./setup/directories.js"; describe("unknown command", () => { it("should warn of unknown command", async () => { diff --git a/test/e2e/version.test.ts b/test/e2e/version.test.ts index 601a1fec..65cae04b 100644 --- a/test/e2e/version.test.ts +++ b/test/e2e/version.test.ts @@ -1,6 +1,6 @@ -import { runOpenupm } from "./run"; -import pkgJson from "../../package.json"; -import { prepareHomeDirectory } from "./setup/directories"; +import pkgJson from "../../package.json" with { type: "json" }; +import { runOpenupm } from "./run.js"; +import { prepareHomeDirectory } from "./setup/directories.js"; describe("version", () => { it("should print current version", async () => { diff --git a/test/e2e/view.test.ts b/test/e2e/view.test.ts index 56d1610b..51a54950 100644 --- a/test/e2e/view.test.ts +++ b/test/e2e/view.test.ts @@ -1,6 +1,6 @@ -import { ResultCodes } from "../../src/cli/result-codes"; -import { runOpenupm } from "./run"; -import { prepareHomeDirectory } from "./setup/directories"; +import { ResultCodes } from "../../src/cli/result-codes.js"; +import { runOpenupm } from "./run.js"; +import { prepareHomeDirectory } from "./setup/directories.js"; describe("view packages", () => { it("should fail if package version was specified", async () => { diff --git a/test/integration/app/add-dependencies.test.ts b/test/integration/app/add-dependencies.test.ts index 49b74a0d..cf052efc 100644 --- a/test/integration/app/add-dependencies.test.ts +++ b/test/integration/app/add-dependencies.test.ts @@ -4,30 +4,30 @@ import { CompatibilityCheckFailedError, PackageIncompatibleError, UnresolvedDependenciesError, -} from "../../../src/app/add-dependencies"; -import { PackumentNotFoundError } from "../../../src/domain/common-errors"; -import type { AddResult } from "../../../src/domain/dependency-management"; -import { DomainName } from "../../../src/domain/domain-name"; -import { makeEditorVersion } from "../../../src/domain/editor-version"; -import { partialApply } from "../../../src/domain/fp-utils"; -import { noopLogger } from "../../../src/domain/logging"; -import { emptyProjectManifest } from "../../../src/domain/project-manifest"; -import { unityRegistry } from "../../../src/domain/registry"; -import { unityRegistryUrl } from "../../../src/domain/registry-url"; -import { SemanticVersion } from "../../../src/domain/semantic-version"; -import { getRegistryPackumentUsing } from "../../../src/io/registry"; -import { fetchCheckUrlExists } from "../../../src/io/www"; -import { buildPackument } from "../../common/data-packument"; -import { buildProjectManifest } from "../../common/data-project-manifest"; +} from "../../../src/app/add-dependencies.js"; +import { PackumentNotFoundError } from "../../../src/domain/common-errors.js"; +import type { AddResult } from "../../../src/domain/dependency-management.js"; +import { DomainName } from "../../../src/domain/domain-name.js"; +import { makeEditorVersion } from "../../../src/domain/editor-version.js"; +import { partialApply } from "../../../src/domain/fp-utils.js"; +import { noopLogger } from "../../../src/domain/logging.js"; +import { emptyProjectManifest } from "../../../src/domain/project-manifest.js"; +import { unityRegistry } from "../../../src/domain/registry.js"; +import { unityRegistryUrl } from "../../../src/domain/registry-url.js"; +import { SemanticVersion } from "../../../src/domain/semantic-version.js"; +import { getRegistryPackumentUsing } from "../../../src/io/registry.js"; +import { fetchCheckUrlExists } from "../../../src/io/www.js"; +import { buildPackument } from "../../common/data-packument.js"; +import { buildProjectManifest } from "../../common/data-project-manifest.js"; import { otherRegistry, otherRegistryUrl, someRegistry, someRegistryUrl, -} from "../../common/data-registry"; -import { makeMockLogger } from "../../common/log.mock"; -import { MockFs } from "../fs.mock"; -import { mockRegistryPackuments } from "../registry.mock"; +} from "../../common/data-registry.js"; +import { makeMockLogger } from "../../common/log.mock.js"; +import { MockFs } from "../fs.mock.js"; +import { mockRegistryPackuments } from "../registry.mock.js"; describe("add dependencies", () => { const someVersion = SemanticVersion.parse("1.0.0"); diff --git a/test/integration/app/resolve-dependencies.test.ts b/test/integration/app/resolve-dependencies.test.ts index 089f1919..f3a20c5b 100644 --- a/test/integration/app/resolve-dependencies.test.ts +++ b/test/integration/app/resolve-dependencies.test.ts @@ -1,23 +1,23 @@ import nock from "nock"; -import { resolveDependenciesUsing } from "../../../src/app/resolve-dependencies"; -import { PackumentNotFoundError } from "../../../src/domain/common-errors"; +import { resolveDependenciesUsing } from "../../../src/app/resolve-dependencies.js"; +import { PackumentNotFoundError } from "../../../src/domain/common-errors.js"; import { NodeType, tryGetGraphNode, -} from "../../../src/domain/dependency-graph"; -import { DomainName } from "../../../src/domain/domain-name"; -import { partialApply } from "../../../src/domain/fp-utils"; -import { noopLogger } from "../../../src/domain/logging"; -import { VersionNotFoundError } from "../../../src/domain/packument"; -import { Registry } from "../../../src/domain/registry"; -import { unityRegistryUrl } from "../../../src/domain/registry-url"; -import { SemanticVersion } from "../../../src/domain/semantic-version"; -import { getRegistryPackumentUsing } from "../../../src/io/registry"; -import { fetchCheckUrlExists } from "../../../src/io/www"; -import { buildPackument } from "../../common/data-packument"; -import { someRegistryUrl } from "../../common/data-registry"; -import { mockUnityDocPages } from "../docs.mock"; -import { mockRegistryPackuments } from "../registry.mock"; +} from "../../../src/domain/dependency-graph.js"; +import { DomainName } from "../../../src/domain/domain-name.js"; +import { partialApply } from "../../../src/domain/fp-utils.js"; +import { noopLogger } from "../../../src/domain/logging.js"; +import { VersionNotFoundError } from "../../../src/domain/packument.js"; +import { Registry } from "../../../src/domain/registry.js"; +import { unityRegistryUrl } from "../../../src/domain/registry-url.js"; +import { SemanticVersion } from "../../../src/domain/semantic-version.js"; +import { getRegistryPackumentUsing } from "../../../src/io/registry.js"; +import { fetchCheckUrlExists } from "../../../src/io/www.js"; +import { buildPackument } from "../../common/data-packument.js"; +import { someRegistryUrl } from "../../common/data-registry.js"; +import { mockUnityDocPages } from "../docs.mock.js"; +import { mockRegistryPackuments } from "../registry.mock.js"; describe("dependency resolving", () => { const sources: Registry[] = [ diff --git a/test/integration/docs.mock.ts b/test/integration/docs.mock.ts index f2e818ce..4d8a7ef1 100644 --- a/test/integration/docs.mock.ts +++ b/test/integration/docs.mock.ts @@ -1,5 +1,5 @@ import nock from "nock"; -import type { DomainName } from "../../src/domain/domain-name"; +import type { DomainName } from "../../src/domain/domain-name.js"; /** * Mocks which packages have an entry on the Unity documentation. diff --git a/test/integration/fs.mock.ts b/test/integration/fs.mock.ts index cb6cd82e..f22a877f 100644 --- a/test/integration/fs.mock.ts +++ b/test/integration/fs.mock.ts @@ -3,21 +3,21 @@ import path from "path"; import { stringifyEditorVersion, type ReleaseVersion, -} from "../../src/domain/editor-version"; +} from "../../src/domain/editor-version.js"; import { emptyProjectManifest, manifestPathFor, parseProjectManifest, serializeProjectManifest, type UnityProjectManifest, -} from "../../src/domain/project-manifest"; -import { projectVersionTxtPathFor } from "../../src/domain/project-version-txt"; +} from "../../src/domain/project-manifest.js"; +import { projectVersionTxtPathFor } from "../../src/domain/project-version-txt.js"; import { serializeUpmConfig, upmConfigFileName, type UpmConfig, -} from "../../src/domain/upm-config"; -import type { ReadTextFile, WriteTextFile } from "../../src/io/fs"; +} from "../../src/domain/upm-config.js"; +import type { ReadTextFile, WriteTextFile } from "../../src/io/fs.js"; type TextFileMap = Record; diff --git a/test/integration/io/common-errors.test.ts b/test/integration/io/common-errors.test.ts index b91a0087..8ae9cef1 100644 --- a/test/integration/io/common-errors.test.ts +++ b/test/integration/io/common-errors.test.ts @@ -2,8 +2,8 @@ import { makeRegistryInteractionError, HttpErrorLike, RegistryAuthenticationError, -} from "../../../src/io/common-errors"; -import { someRegistryUrl } from "../../common/data-registry"; +} from "../../../src/io/common-errors.js"; +import { someRegistryUrl } from "../../common/data-registry.js"; describe("common error utilities", () => { describe("make registry interaction errors", () => { diff --git a/test/integration/io/fs.test.ts b/test/integration/io/fs.test.ts index 99c066bc..142103f8 100644 --- a/test/integration/io/fs.test.ts +++ b/test/integration/io/fs.test.ts @@ -5,8 +5,8 @@ import { getDirectoriesInFs, readTextFile, writeTextFile, -} from "../../../src/io/fs"; -import { makeNodeError } from "./node-error.mock"; +} from "../../../src/io/fs.js"; +import { makeNodeError } from "./node-error.mock.js"; describe("fs io", () => { describe("directory io", () => { diff --git a/test/integration/io/registry.test.ts b/test/integration/io/registry.test.ts index 47fea43e..1b9fbb65 100644 --- a/test/integration/io/registry.test.ts +++ b/test/integration/io/registry.test.ts @@ -1,15 +1,15 @@ import { default as npmSearch, default as search } from "libnpmsearch"; import npmFetch from "npm-registry-fetch"; -import { noopLogger } from "../../../src/domain/logging"; +import { noopLogger } from "../../../src/domain/logging.js"; import { HttpErrorLike, RegistryAuthenticationError, -} from "../../../src/io/common-errors"; +} from "../../../src/io/common-errors.js"; import { getAllRegistryPackumentsUsing, searchRegistryUsing, -} from "../../../src/io/registry"; -import { someRegistry } from "../../common/data-registry"; +} from "../../../src/io/registry.js"; +import { someRegistry } from "../../common/data-registry.js"; jest.mock("npm-registry-fetch"); jest.mock("libnpmsearch"); diff --git a/test/integration/registry.mock.ts b/test/integration/registry.mock.ts index 56c6ccad..c24c3ccb 100644 --- a/test/integration/registry.mock.ts +++ b/test/integration/registry.mock.ts @@ -1,6 +1,6 @@ import nock from "nock"; -import type { UnityPackument } from "../../src/domain/packument"; -import type { RegistryUrl } from "../../src/domain/registry-url"; +import type { UnityPackument } from "../../src/domain/packument.js"; +import type { RegistryUrl } from "../../src/domain/registry-url.js"; /** * Mocks which packuments exist on a remote package registry. diff --git a/test/unit/app/get-registry-auth.test.ts b/test/unit/app/get-registry-auth.test.ts index 5cde1883..00a6901f 100644 --- a/test/unit/app/get-registry-auth.test.ts +++ b/test/unit/app/get-registry-auth.test.ts @@ -2,13 +2,13 @@ import { importNpmAuth, isNonAuthUrl, tryGetAuthEntry, -} from "../../../src/app/get-registry-auth"; -import { Base64 } from "../../../src/domain/base64"; +} from "../../../src/app/get-registry-auth.js"; +import { Base64 } from "../../../src/domain/base64.js"; import { openupmRegistryUrl, unityRegistryUrl, -} from "../../../src/domain/registry-url"; -import { someRegistryUrl } from "../../common/data-registry"; +} from "../../../src/domain/registry-url.js"; +import { someRegistryUrl } from "../../common/data-registry.js"; describe("get registry auth from upm config", () => { const someEmail = "user@mail.com"; diff --git a/test/unit/app/put-registry-auth.test.ts b/test/unit/app/put-registry-auth.test.ts index 31583ec4..32c8c4a6 100644 --- a/test/unit/app/put-registry-auth.test.ts +++ b/test/unit/app/put-registry-auth.test.ts @@ -1,7 +1,7 @@ -import { putRegistryAuthIntoUpmConfig } from "../../../src/app/put-registry-auth"; -import { Base64 } from "../../../src/domain/base64"; -import type { UpmConfig } from "../../../src/domain/upm-config"; -import { someRegistryUrl } from "../../common/data-registry"; +import { putRegistryAuthIntoUpmConfig } from "../../../src/app/put-registry-auth.js"; +import { Base64 } from "../../../src/domain/base64.js"; +import type { UpmConfig } from "../../../src/domain/upm-config.js"; +import { someRegistryUrl } from "../../common/data-registry.js"; describe("put registry auth into upm config", () => { const someEmail = "user@mail.com"; diff --git a/test/unit/app/query-registries.test.ts b/test/unit/app/query-registries.test.ts index f9152f73..82ef4b22 100644 --- a/test/unit/app/query-registries.test.ts +++ b/test/unit/app/query-registries.test.ts @@ -1,6 +1,6 @@ -import { queryAllRegistriesLazy } from "../../../src/app/query-registries"; -import { Registry } from "../../../src/domain/registry"; -import { otherRegistry, someRegistry } from "../../common/data-registry"; +import { queryAllRegistriesLazy } from "../../../src/app/query-registries.js"; +import { Registry } from "../../../src/domain/registry.js"; +import { otherRegistry, someRegistry } from "../../common/data-registry.js"; describe("sources", () => { describe("query registries lazy", () => { diff --git a/test/unit/cli/dependency-logging.test.ts b/test/unit/cli/dependency-logging.test.ts index 392c453a..d3681958 100644 --- a/test/unit/cli/dependency-logging.test.ts +++ b/test/unit/cli/dependency-logging.test.ts @@ -3,15 +3,15 @@ import { markBuiltInResolved, markFailed, markRemoteResolved, -} from "../../../src/domain/dependency-graph"; -import { stringifyDependencyGraph } from "../../../src/cli/dependency-logging"; -import { makePackageSpec } from "../../../src/domain/package-spec"; -import { someRegistryUrl } from "../../common/data-registry"; -import { PackumentNotFoundError } from "../../../src/domain/common-errors"; -import { unityRegistryUrl } from "../../../src/domain/registry-url"; -import { VersionNotFoundError } from "../../../src/domain/packument"; -import { DomainName } from "../../../src/domain/domain-name"; -import { SemanticVersion } from "../../../src/domain/semantic-version"; +} from "../../../src/domain/dependency-graph.js"; +import { stringifyDependencyGraph } from "../../../src/cli/dependency-logging.js"; +import { makePackageSpec } from "../../../src/domain/package-spec.js"; +import { someRegistryUrl } from "../../common/data-registry.js"; +import { PackumentNotFoundError } from "../../../src/domain/common-errors.js"; +import { unityRegistryUrl } from "../../../src/domain/registry-url.js"; +import { VersionNotFoundError } from "../../../src/domain/packument.js"; +import { DomainName } from "../../../src/domain/domain-name.js"; +import { SemanticVersion } from "../../../src/domain/semantic-version.js"; describe("dependency-logging", () => { describe("graph", () => { diff --git a/test/unit/domain/base64.test.ts b/test/unit/domain/base64.test.ts index a98d7200..457db931 100644 --- a/test/unit/domain/base64.test.ts +++ b/test/unit/domain/base64.test.ts @@ -1,4 +1,4 @@ -import { decodeBase64, encodeBase64 } from "../../../src/domain/base64"; +import { decodeBase64, encodeBase64 } from "../../../src/domain/base64.js"; import fc from "fast-check"; describe("base 64", () => { diff --git a/test/unit/domain/dependency-graph.test.ts b/test/unit/domain/dependency-graph.test.ts index 37a44633..d21c18ef 100644 --- a/test/unit/domain/dependency-graph.test.ts +++ b/test/unit/domain/dependency-graph.test.ts @@ -1,5 +1,5 @@ -import { DomainName } from "../../../src/domain/domain-name"; -import { SemanticVersion } from "../../../src/domain/semantic-version"; +import { DomainName } from "../../../src/domain/domain-name.js"; +import { SemanticVersion } from "../../../src/domain/semantic-version.js"; import { graphNodeCount, makeGraphFromSeed, @@ -10,9 +10,9 @@ import { traverseDependencyGraph, tryGetGraphNode, tryGetNextUnresolved, -} from "../../../src/domain/dependency-graph"; -import { someRegistryUrl } from "../../common/data-registry"; -import { PackumentNotFoundError } from "../../../src/domain/common-errors"; +} from "../../../src/domain/dependency-graph.js"; +import { someRegistryUrl } from "../../common/data-registry.js"; +import { PackumentNotFoundError } from "../../../src/domain/common-errors.js"; describe("dependency graph", () => { const somePackage = DomainName.parse("com.some.package"); diff --git a/test/unit/domain/dependency-management.test.ts b/test/unit/domain/dependency-management.test.ts index b95731c6..1325525b 100644 --- a/test/unit/domain/dependency-management.test.ts +++ b/test/unit/domain/dependency-management.test.ts @@ -1,27 +1,27 @@ import fc from "fast-check"; -import { PackumentNotFoundError } from "../../../src/domain/common-errors"; +import { PackumentNotFoundError } from "../../../src/domain/common-errors.js"; import { addProjectDependency, AddResult, tryRemoveProjectDependencies, tryRemoveProjectDependency, -} from "../../../src/domain/dependency-management"; -import { DomainName } from "../../../src/domain/domain-name"; +} from "../../../src/domain/dependency-management.js"; +import { DomainName } from "../../../src/domain/domain-name.js"; import { hasDependency, mapScopedRegistry, removeDependency, -} from "../../../src/domain/project-manifest"; -import { recordKeys } from "../../../src/domain/record-utils"; -import { RegistryUrl } from "../../../src/domain/registry-url"; -import { makeScopedRegistry } from "../../../src/domain/scoped-registry"; -import { arbDomainName } from "./domain-name.arb"; +} from "../../../src/domain/project-manifest.js"; +import { recordKeys } from "../../../src/domain/record-utils.js"; +import { RegistryUrl } from "../../../src/domain/registry-url.js"; +import { makeScopedRegistry } from "../../../src/domain/scoped-registry.js"; +import { arbDomainName } from "./domain-name.arb.js"; import { abrDependencyVersion, arbManifest, arbManifestWithDependencyCount, arbNonEmptyManifest, -} from "./project-manifest.arb"; +} from "./project-manifest.arb.js"; describe("dependency management", () => { describe("remove single", () => { diff --git a/test/unit/domain/domain-name.arb.ts b/test/unit/domain/domain-name.arb.ts index 51bb8cb5..bec3d9e5 100644 --- a/test/unit/domain/domain-name.arb.ts +++ b/test/unit/domain/domain-name.arb.ts @@ -1,5 +1,5 @@ import fc from "fast-check"; -import { DomainName } from "../../../src/domain/domain-name"; +import { DomainName } from "../../../src/domain/domain-name.js"; /** * Single char string [A-Z]. diff --git a/test/unit/domain/domain-name.test.ts b/test/unit/domain/domain-name.test.ts index f63de14e..bc883820 100644 --- a/test/unit/domain/domain-name.test.ts +++ b/test/unit/domain/domain-name.test.ts @@ -1,5 +1,5 @@ -import { isZod } from "../../../src/domain/zod-utils"; -import { DomainName } from "../../../src/domain/domain-name"; +import { isZod } from "../../../src/domain/zod-utils.js"; +import { DomainName } from "../../../src/domain/domain-name.js"; describe("domain-name", () => { describe("validation", () => { diff --git a/test/unit/domain/editor-version.test.ts b/test/unit/domain/editor-version.test.ts index c1bcbf47..323e7ea4 100644 --- a/test/unit/domain/editor-version.test.ts +++ b/test/unit/domain/editor-version.test.ts @@ -1,7 +1,7 @@ import { compareEditorVersion, tryParseEditorVersion, -} from "../../../src/domain/editor-version"; +} from "../../../src/domain/editor-version.js"; import assert from "assert"; diff --git a/test/unit/domain/npmrc.test.ts b/test/unit/domain/npmrc.test.ts index 3ee2811c..e88e5e5b 100644 --- a/test/unit/domain/npmrc.test.ts +++ b/test/unit/domain/npmrc.test.ts @@ -3,9 +3,9 @@ import { emptyNpmrc, getHomeNpmrcPath, setToken, -} from "../../../src/domain/npmrc"; +} from "../../../src/domain/npmrc.js"; -import { someRegistryUrl } from "../../common/data-registry"; +import { someRegistryUrl } from "../../common/data-registry.js"; const exampleToken = "123-456-789"; const normalizedRegistryUrl = `${someRegistryUrl.substring( diff --git a/test/unit/domain/object-utils.test.ts b/test/unit/domain/object-utils.test.ts index dacdc96f..91a61da9 100644 --- a/test/unit/domain/object-utils.test.ts +++ b/test/unit/domain/object-utils.test.ts @@ -1,4 +1,4 @@ -import { omitKey } from "../../../src/domain/object-utils"; +import { omitKey } from "../../../src/domain/object-utils.js"; describe("object utils", () => { describe("omit key", () => { diff --git a/test/unit/domain/package-id.test.ts b/test/unit/domain/package-id.test.ts index eeb36753..ec2bc95b 100644 --- a/test/unit/domain/package-id.test.ts +++ b/test/unit/domain/package-id.test.ts @@ -1,6 +1,6 @@ -import { isPackageId } from "../../../src/domain/package-id"; +import { isPackageId } from "../../../src/domain/package-id.js"; import fc from "fast-check"; -import { arbDomainName } from "./domain-name.arb"; +import { arbDomainName } from "./domain-name.arb.js"; describe("package-id", () => { describe("validate", () => { diff --git a/test/unit/domain/package-manifest.test.ts b/test/unit/domain/package-manifest.test.ts index 34924213..e724b6d2 100644 --- a/test/unit/domain/package-manifest.test.ts +++ b/test/unit/domain/package-manifest.test.ts @@ -1,9 +1,9 @@ -import { MalformedPackumentError } from "../../../src/domain/common-errors"; -import { makeEditorVersion } from "../../../src/domain/editor-version"; +import { MalformedPackumentError } from "../../../src/domain/common-errors.js"; +import { makeEditorVersion } from "../../../src/domain/editor-version.js"; import { dependenciesOf, tryGetTargetEditorVersionFor, -} from "../../../src/domain/package-manifest"; +} from "../../../src/domain/package-manifest.js"; describe("package manifest", () => { describe("get dependency list", () => { diff --git a/test/unit/domain/package-spec.test.ts b/test/unit/domain/package-spec.test.ts index 26fa2bf3..04a6498f 100644 --- a/test/unit/domain/package-spec.test.ts +++ b/test/unit/domain/package-spec.test.ts @@ -3,10 +3,10 @@ import { isPackageSpec, makePackageSpec, splitPackageSpec, -} from "../../../src/domain/package-spec"; -import { arbDomainName } from "./domain-name.arb"; -import { arbPackageUrl } from "./package-url.arb"; -import { arbSemanticVersion } from "./semantic-version.arb"; +} from "../../../src/domain/package-spec.js"; +import { arbDomainName } from "./domain-name.arb.js"; +import { arbPackageUrl } from "./package-url.arb.js"; +import { arbSemanticVersion } from "./semantic-version.arb.js"; describe("package-spec", () => { describe("validation", () => { diff --git a/test/unit/domain/package-url.arb.ts b/test/unit/domain/package-url.arb.ts index a99f8950..9c322297 100644 --- a/test/unit/domain/package-url.arb.ts +++ b/test/unit/domain/package-url.arb.ts @@ -1,6 +1,6 @@ import fc from "fast-check"; -import { PackageUrl } from "../../../src/domain/package-url"; -import { arbDomainName } from "./domain-name.arb"; +import { PackageUrl } from "../../../src/domain/package-url.js"; +import { arbDomainName } from "./domain-name.arb.js"; /** * Arbitrary {@link PackageUrl} with `http` protocol. diff --git a/test/unit/domain/package-url.test.ts b/test/unit/domain/package-url.test.ts index 834cc06f..9659a5d6 100644 --- a/test/unit/domain/package-url.test.ts +++ b/test/unit/domain/package-url.test.ts @@ -1,7 +1,7 @@ -import { PackageUrl } from "../../../src/domain/package-url"; +import { PackageUrl } from "../../../src/domain/package-url.js"; import fc from "fast-check"; -import { arbDomainName } from "./domain-name.arb"; -import { isZod } from "../../../src/domain/zod-utils"; +import { arbDomainName } from "./domain-name.arb.js"; +import { isZod } from "../../../src/domain/zod-utils.js"; describe("package-url", () => { describe("validation", () => { diff --git a/test/unit/domain/packument.test.ts b/test/unit/domain/packument.test.ts index 285f11ca..4536cbd9 100644 --- a/test/unit/domain/packument.test.ts +++ b/test/unit/domain/packument.test.ts @@ -1,5 +1,5 @@ import { Ok } from "ts-results-es"; -import { DomainName } from "../../../src/domain/domain-name"; +import { DomainName } from "../../../src/domain/domain-name.js"; import { NoStableError, NoVersionsError, @@ -8,9 +8,9 @@ import { tryGetPackumentVersion, tryResolvePackumentVersion, VersionNotFoundError, -} from "../../../src/domain/packument"; -import { SemanticVersion } from "../../../src/domain/semantic-version"; -import { buildPackument } from "../../common/data-packument"; +} from "../../../src/domain/packument.js"; +import { SemanticVersion } from "../../../src/domain/semantic-version.js"; +import { buildPackument } from "../../common/data-packument.js"; describe("packument", () => { describe("get latest version", () => { diff --git a/test/unit/domain/project-manifest.arb.ts b/test/unit/domain/project-manifest.arb.ts index 4d563bb7..db3618fc 100644 --- a/test/unit/domain/project-manifest.arb.ts +++ b/test/unit/domain/project-manifest.arb.ts @@ -2,11 +2,11 @@ import fc, { type Arbitrary } from "fast-check"; import { type DependencyVersion, type UnityProjectManifest, -} from "../../../src/domain/project-manifest"; -import { UnityProjectManifestBuilder } from "../../common/data-project-manifest"; -import { arbDomainName } from "./domain-name.arb"; -import { arbPackageUrl } from "./package-url.arb"; -import { arbSemanticVersion } from "./semantic-version.arb"; +} from "../../../src/domain/project-manifest.js"; +import { UnityProjectManifestBuilder } from "../../common/data-project-manifest.js"; +import { arbDomainName } from "./domain-name.arb.js"; +import { arbPackageUrl } from "./package-url.arb.js"; +import { arbSemanticVersion } from "./semantic-version.arb.js"; /** * Arbitrary {@link abrDependencyVersion}. diff --git a/test/unit/domain/project-manifest.test.ts b/test/unit/domain/project-manifest.test.ts index 7e7feaa9..10ae40d8 100644 --- a/test/unit/domain/project-manifest.test.ts +++ b/test/unit/domain/project-manifest.test.ts @@ -1,6 +1,6 @@ import fc from "fast-check"; import path from "path"; -import { DomainName } from "../../../src/domain/domain-name"; +import { DomainName } from "../../../src/domain/domain-name.js"; import { addTestable, emptyProjectManifest, @@ -17,16 +17,16 @@ import { setScopedRegistry, tryGetScopedRegistryByUrl, type UnityProjectManifest, -} from "../../../src/domain/project-manifest"; -import { RegistryUrl } from "../../../src/domain/registry-url"; +} from "../../../src/domain/project-manifest.js"; +import { RegistryUrl } from "../../../src/domain/registry-url.js"; import { addScope, makeScopedRegistry, -} from "../../../src/domain/scoped-registry"; -import { SemanticVersion } from "../../../src/domain/semantic-version"; -import { buildProjectManifest } from "../../common/data-project-manifest"; -import { someRegistryUrl } from "../../common/data-registry"; -import { arbDomainName } from "./domain-name.arb"; +} from "../../../src/domain/scoped-registry.js"; +import { SemanticVersion } from "../../../src/domain/semantic-version.js"; +import { buildProjectManifest } from "../../common/data-project-manifest.js"; +import { someRegistryUrl } from "../../common/data-registry.js"; +import { arbDomainName } from "./domain-name.arb.js"; describe("project-manifest", () => { describe("set dependency", () => { diff --git a/test/unit/domain/project-version-txt.test.ts b/test/unit/domain/project-version-txt.test.ts index 6f294258..6f2955ce 100644 --- a/test/unit/domain/project-version-txt.test.ts +++ b/test/unit/domain/project-version-txt.test.ts @@ -1,8 +1,8 @@ -import { makeEditorVersion } from "../../../src/domain/editor-version"; +import { makeEditorVersion } from "../../../src/domain/editor-version.js"; import { tryParseProjectVersionTxt, validateProjectVersion, -} from "../../../src/domain/project-version-txt"; +} from "../../../src/domain/project-version-txt.js"; describe("ProjectVersion.txt", () => { describe("parsing", () => { diff --git a/test/unit/domain/registry-url.test.ts b/test/unit/domain/registry-url.test.ts index 3ed8e930..bc38de14 100644 --- a/test/unit/domain/registry-url.test.ts +++ b/test/unit/domain/registry-url.test.ts @@ -1,5 +1,5 @@ -import { coerceRegistryUrl, RegistryUrl } from "../../../src/domain/registry-url"; -import { isZod } from "../../../src/domain/zod-utils"; +import { coerceRegistryUrl, RegistryUrl } from "../../../src/domain/registry-url.js"; +import { isZod } from "../../../src/domain/zod-utils.js"; describe("registry-url", () => { describe("validation", () => { diff --git a/test/unit/domain/registry.test.ts b/test/unit/domain/registry.test.ts index 181e52a0..e69e668f 100644 --- a/test/unit/domain/registry.test.ts +++ b/test/unit/domain/registry.test.ts @@ -1,6 +1,6 @@ import type { AuthOptions } from "npm-registry-fetch"; -import { makeNpmFetchOptions, Registry } from "../../../src/domain/registry"; -import { someRegistryUrl } from "../../common/data-registry"; +import { makeNpmFetchOptions, Registry } from "../../../src/domain/registry.js"; +import { someRegistryUrl } from "../../common/data-registry.js"; describe("npm registry", () => { describe("make fetch options from registry object", () => { diff --git a/test/unit/domain/scoped-registry.test.ts b/test/unit/domain/scoped-registry.test.ts index 21207ee4..6247e68b 100644 --- a/test/unit/domain/scoped-registry.test.ts +++ b/test/unit/domain/scoped-registry.test.ts @@ -4,12 +4,12 @@ import { makeEmptyScopedRegistryFor, makeScopedRegistry, removeScope, -} from "../../../src/domain/scoped-registry"; -import { DomainName } from "../../../src/domain/domain-name"; +} from "../../../src/domain/scoped-registry.js"; +import { DomainName } from "../../../src/domain/domain-name.js"; import fc from "fast-check"; -import { arbDomainName } from "./domain-name.arb"; -import { someRegistryUrl } from "../../common/data-registry"; -import { unityRegistryUrl } from "../../../src/domain/registry-url"; +import { arbDomainName } from "./domain-name.arb.js"; +import { someRegistryUrl } from "../../common/data-registry.js"; +import { unityRegistryUrl } from "../../../src/domain/registry-url.js"; describe("scoped-registry", () => { describe("construction", () => { diff --git a/test/unit/domain/semantic-version.arb.ts b/test/unit/domain/semantic-version.arb.ts index da6e51f5..e45c9097 100644 --- a/test/unit/domain/semantic-version.arb.ts +++ b/test/unit/domain/semantic-version.arb.ts @@ -1,5 +1,5 @@ import fc from "fast-check"; -import { SemanticVersion } from "../../../src/domain/semantic-version"; +import { SemanticVersion } from "../../../src/domain/semantic-version.js"; const segment = fc.integer({ min: 0, max: 10 }); diff --git a/test/unit/domain/semantic-version.test.ts b/test/unit/domain/semantic-version.test.ts index a6bc8cdd..d463f14a 100644 --- a/test/unit/domain/semantic-version.test.ts +++ b/test/unit/domain/semantic-version.test.ts @@ -1,5 +1,5 @@ -import { SemanticVersion } from "../../../src/domain/semantic-version"; -import { isZod } from "../../../src/domain/zod-utils"; +import { SemanticVersion } from "../../../src/domain/semantic-version.js"; +import { isZod } from "../../../src/domain/zod-utils.js"; describe("semantic-version", () => { describe("validate", () => { diff --git a/test/unit/domain/special-paths.test.ts b/test/unit/domain/special-paths.test.ts index 2833cc7b..dbc630c3 100644 --- a/test/unit/domain/special-paths.test.ts +++ b/test/unit/domain/special-paths.test.ts @@ -1,15 +1,15 @@ import os from "os"; import path from "path"; import { Ok } from "ts-results-es"; -import { EditorVersionNotSupportedError } from "../../../src/domain/common-errors"; -import { makeEditorVersion } from "../../../src/domain/editor-version"; +import { EditorVersionNotSupportedError } from "../../../src/domain/common-errors.js"; +import { makeEditorVersion } from "../../../src/domain/editor-version.js"; import { getHomePathFromEnv, NoHomePathError, OSNotSupportedError, tryGetEditorInstallPath, VersionNotSupportedOnOsError, -} from "../../../src/domain/special-paths"; +} from "../../../src/domain/special-paths.js"; describe("special-paths", () => { describe("home from env", () => { diff --git a/test/unit/domain/string-utils.test.ts b/test/unit/domain/string-utils.test.ts index b80988cf..a6b0f058 100644 --- a/test/unit/domain/string-utils.test.ts +++ b/test/unit/domain/string-utils.test.ts @@ -1,4 +1,4 @@ -import { splitLines } from "../../../src/domain/string-utils"; +import { splitLines } from "../../../src/domain/string-utils.js"; describe("string utils", () => { describe("split into lines", () => { diff --git a/test/unit/domain/upm-config.test.ts b/test/unit/domain/upm-config.test.ts index 5387a62c..5e565f15 100644 --- a/test/unit/domain/upm-config.test.ts +++ b/test/unit/domain/upm-config.test.ts @@ -4,8 +4,8 @@ import { getUserUpmConfigPathFor, NoSystemUserProfilePath, parseUpmConfig, -} from "../../../src/domain/upm-config"; -import { someRegistryUrl } from "../../common/data-registry"; +} from "../../../src/domain/upm-config.js"; +import { someRegistryUrl } from "../../common/data-registry.js"; describe("upm config", () => { describe("get user config path", () => { diff --git a/test/unit/domain/zod-utils.ts b/test/unit/domain/zod-utils.ts index f5e9e62a..2ad798d0 100644 --- a/test/unit/domain/zod-utils.ts +++ b/test/unit/domain/zod-utils.ts @@ -1,4 +1,4 @@ -import { removeExplicitUndefined } from "../../../src/domain/zod-utils"; +import { removeExplicitUndefined } from "../../../src/domain/zod-utils.js"; describe("zod utils", () => { describe("remove explicit undefined", () => { diff --git a/tsconfig.json b/tsconfig.json index 6ae47ed5..df733155 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -1,7 +1,7 @@ { + "$schema": "https://json.schemastore.org/tsconfig", "compilerOptions": { /* Visit https://aka.ms/tsconfig to read more about this file */ - /* Projects */ // "incremental": true, /* Save .tsbuildinfo files to allow for incremental compilation of projects. */ // "composite": true, /* Enable constraints that allow a TypeScript project to be used with project references. */ @@ -9,10 +9,11 @@ // "disableSourceOfProjectReferenceRedirect": true, /* Disable preferring source files instead of declaration files when referencing composite projects. */ // "disableSolutionSearching": true, /* Opt a project out of multi-project reference checking when editing. */ // "disableReferencedProjectLoad": true, /* Reduce the number of projects loaded automatically by TypeScript. */ - /* Language and Environment */ - "target": "ES2022", /* Set the JavaScript language version for emitted JavaScript and include compatible library declarations. */ - "lib": ["ES2023"], /* Specify a set of bundled library declaration files that describe the target runtime environment. */ + "target": "ES2023", /* Set the JavaScript language version for emitted JavaScript and include compatible library declarations. */ + "lib": [ + "ES2023" + ], /* Specify a set of bundled library declaration files that describe the target runtime environment. */ // "jsx": "preserve", /* Specify what JSX code is generated. */ // "experimentalDecorators": true, /* Enable experimental support for legacy experimental decorators. */ // "emitDecoratorMetadata": true, /* Emit design-type metadata for decorated declarations in source files. */ @@ -23,17 +24,17 @@ // "noLib": true, /* Disable including any library files, including the default lib.d.ts. */ // "useDefineForClassFields": true, /* Emit ECMAScript-standard-compliant class fields. */ // "moduleDetection": "auto", /* Control what method is used to detect module-format JS files. */ - /* Modules */ - "module": "commonjs", /* Specify what module code is generated. */ + "module": "NodeNext", /* Specify what module code is generated. */ // "rootDir": "./", /* Specify the root folder within your source files. */ // "moduleResolution": "node10", /* Specify how TypeScript looks up a file from a given module specifier. */ // "baseUrl": "./", /* Specify the base directory to resolve non-relative module names. */ // "paths": {}, /* Specify a set of entries that re-map imports to additional lookup locations. */ // "rootDirs": [], /* Allow multiple folders to be treated as one when resolving modules. */ - "typeRoots": [ /* Specify multiple folders that act like './node_modules/@types'. */ - "./src/types", "./node_modules/@types" - ], + "typeRoots": [ /* Specify multiple folders that act like './node_modules/@types'. */ + "./src/types", + "./node_modules/@types" + ], // "types": [], /* Specify type package names to be included without being referenced in a source file. */ // "allowUmdGlobalAccess": true, /* Allow accessing UMD globals from modules. */ // "moduleSuffixes": [], /* List of file name suffixes to search when resolving a module. */ @@ -41,15 +42,13 @@ // "resolvePackageJsonExports": true, /* Use the package.json 'exports' field when resolving package imports. */ // "resolvePackageJsonImports": true, /* Use the package.json 'imports' field when resolving imports. */ // "customConditions": [], /* Conditions to set in addition to the resolver-specific defaults when resolving imports. */ - "resolveJsonModule": false, /* Enable importing .json files. */ + "resolveJsonModule": false, /* Enable importing .json files. */ // "allowArbitraryExtensions": true, /* Enable importing files with any extension, provided a declaration file is present. */ // "noResolve": true, /* Disallow 'imports, 'requires or 's from expanding the number of files TypeScript should add to a project. */ - /* JavaScript Support */ // "allowJs": true, /* Allow JavaScript files to be a part of your program. Use the 'checkJS' option to get errors from these files. */ // "checkJs": true, /* Enable error reporting in type-checked JavaScript files. */ // "maxNodeModuleJsDepth": 1, /* Specify the maximum folder depth used for checking JavaScript files from 'node_modules'. Only applicable with 'allowJs'. */ - /* Emit */ // "declaration": true, /* Generate .d.ts files from TypeScript and JavaScript files in your project. */ // "declarationMap": true, /* Create sourcemaps for d.ts files. */ @@ -59,7 +58,7 @@ // "outFile": "./", /* Specify a file that bundles all outputs into one JavaScript file. If 'declaration' is true, also designates a file that bundles all .d.ts output. */ // "outDir": "./lib", /* Specify an output folder for all emitted files. */ // "removeComments": true, /* Disable emitting comments. */ - "noEmit": true, /* Disable emitting files from a compilation. */ + "noEmit": true, /* Disable emitting files from a compilation. */ // "importHelpers": true, /* Allow importing helper functions from tslib once per project, instead of including them per-file. */ // "importsNotUsedAsValues": "remove", /* Specify emit/checking behavior for imports that are only used for types. */ // "downlevelIteration": true, /* Emit more compliant, but verbose and less performant JavaScript for iteration. */ @@ -74,17 +73,15 @@ // "preserveConstEnums": true, /* Disable erasing 'const enum' declarations in generated code. */ // "declarationDir": "./", /* Specify the output directory for generated declaration files. */ // "preserveValueImports": true, /* Preserve unused imported values in the JavaScript output that would otherwise be removed. */ - /* Interop Constraints */ // "isolatedModules": true, /* Ensure that each file can be safely transpiled without relying on other imports. */ // "verbatimModuleSyntax": true, /* Do not transform or elide any imports or exports not marked as type-only, ensuring they are written in the output file's format based on the 'module' setting. */ // "allowSyntheticDefaultImports": true, /* Allow 'import x from y' when a module doesn't have a default export. */ - "esModuleInterop": true, /* Emit additional JavaScript to ease support for importing CommonJS modules. This enables 'allowSyntheticDefaultImports' for type compatibility. */ + "esModuleInterop": true, /* Emit additional JavaScript to ease support for importing CommonJS modules. This enables 'allowSyntheticDefaultImports' for type compatibility. */ // "preserveSymlinks": true, /* Disable resolving symlinks to their realpath. This correlates to the same flag in node. */ - "forceConsistentCasingInFileNames": true, /* Ensure that casing is correct in imports. */ - + "forceConsistentCasingInFileNames": true, /* Ensure that casing is correct in imports. */ /* Type Checking */ - "strict": true, /* Enable all strict type-checking options. */ + "strict": true, /* Enable all strict type-checking options. */ // "noImplicitAny": true, /* Enable error reporting for expressions and declarations with an implied 'any' type. */ // "strictNullChecks": true, /* When type checking, take into account 'null' and 'undefined'. */ // "strictFunctionTypes": true, /* When assigning functions, check to ensure parameters and the return values are subtype-compatible. */ @@ -95,21 +92,23 @@ // "alwaysStrict": true, /* Ensure 'use strict' is always emitted. */ // "noUnusedLocals": true, /* Enable error reporting when local variables aren't read. */ // "noUnusedParameters": true, /* Raise an error when a function parameter isn't read. */ - "exactOptionalPropertyTypes": true, /* Interpret optional property types as written, rather than adding 'undefined'. */ + "exactOptionalPropertyTypes": true, /* Interpret optional property types as written, rather than adding 'undefined'. */ // "noImplicitReturns": true, /* Enable error reporting for codepaths that do not explicitly return in a function. */ // "noFallthroughCasesInSwitch": true, /* Enable error reporting for fallthrough cases in switch statements. */ - "noUncheckedIndexedAccess": true, /* Add 'undefined' to a type when accessed using an index. */ + "noUncheckedIndexedAccess": true, /* Add 'undefined' to a type when accessed using an index. */ // "noImplicitOverride": true, /* Ensure overriding members in derived classes are marked with an override modifier. */ // "noPropertyAccessFromIndexSignature": true, /* Enforces using indexed accessors for keys declared using an indexed type. */ // "allowUnusedLabels": true, /* Disable error reporting for unused labels. */ // "allowUnreachableCode": true, /* Disable error reporting for unreachable code. */ - /* Completeness */ // "skipDefaultLibCheck": true, /* Skip type checking .d.ts files that are included with TypeScript. */ - "skipLibCheck": true /* Skip type checking all .d.ts files. */ + "skipLibCheck": true /* Skip type checking all .d.ts files. */ }, "include": [ "./src/**/*", "./test/**/*" - ] -} + ], + "ts-node": { + "esm": true + } +} \ No newline at end of file