From c34492085e3bd12774a9720d0fbb72aa9a3d9945 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Allen=20Zhang=20=28=E5=BC=A0=E6=B6=9B=29?= Date: Tue, 16 Jan 2024 19:44:22 +0800 Subject: [PATCH] upd --- tools/data-migration/.gitignore | 3 + tools/data-migration/data/coverages.json | 0 tools/data-migration/package-lock.json | 322 +++++++++++++++++++ tools/data-migration/package.json | 22 ++ tools/data-migration/prisma/schema.prisma | 94 ++++++ tools/data-migration/scripts/sys-coverage.ts | 36 +++ tools/data-migration/tsconfig.json | 109 +++++++ 7 files changed, 586 insertions(+) create mode 100644 tools/data-migration/.gitignore create mode 100644 tools/data-migration/data/coverages.json create mode 100644 tools/data-migration/package-lock.json create mode 100644 tools/data-migration/package.json create mode 100644 tools/data-migration/prisma/schema.prisma create mode 100644 tools/data-migration/scripts/sys-coverage.ts create mode 100644 tools/data-migration/tsconfig.json diff --git a/tools/data-migration/.gitignore b/tools/data-migration/.gitignore new file mode 100644 index 00000000..11ddd8db --- /dev/null +++ b/tools/data-migration/.gitignore @@ -0,0 +1,3 @@ +node_modules +# Keep environment variables out of version control +.env diff --git a/tools/data-migration/data/coverages.json b/tools/data-migration/data/coverages.json new file mode 100644 index 00000000..e69de29b diff --git a/tools/data-migration/package-lock.json b/tools/data-migration/package-lock.json new file mode 100644 index 00000000..9d309fdb --- /dev/null +++ b/tools/data-migration/package-lock.json @@ -0,0 +1,322 @@ +{ + "name": "data-migration", + "version": "1.0.0", + "lockfileVersion": 3, + "requires": true, + "packages": { + "": { + "name": "data-migration", + "version": "1.0.0", + "license": "ISC", + "dependencies": { + "@prisma/client": "^5.8.1" + }, + "devDependencies": { + "@types/node": "^20.11.4", + "prisma": "^5.8.1", + "ts-node": "^10.9.2", + "typescript": "^5.3.3" + } + }, + "node_modules/@cspotcode/source-map-support": { + "version": "0.8.1", + "resolved": "http://registry.npm.release.ctripcorp.com/@cspotcode/source-map-support/download/@cspotcode/source-map-support-0.8.1.tgz", + "integrity": "sha1-AGKcNaaI4FqIsc2mhPudXnPwAKE=", + "dev": true, + "license": "MIT", + "dependencies": { + "@jridgewell/trace-mapping": "0.3.9" + }, + "engines": { + "node": ">=12" + } + }, + "node_modules/@jridgewell/resolve-uri": { + "version": "3.1.1", + "resolved": "http://registry.npm.release.ctripcorp.com/@jridgewell/resolve-uri/download/@jridgewell/resolve-uri-3.1.1.tgz", + "integrity": "sha1-wIZ5Bj8nlhWjMmWDujqQ0dgsxyE=", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=6.0.0" + } + }, + "node_modules/@jridgewell/sourcemap-codec": { + "version": "1.4.15", + "resolved": "http://registry.npm.release.ctripcorp.com/@jridgewell/sourcemap-codec/download/@jridgewell/sourcemap-codec-1.4.15.tgz", + "integrity": "sha1-18bmdVx4VnqVHgSrUu8P0m3lnzI=", + "dev": true, + "license": "MIT" + }, + "node_modules/@jridgewell/trace-mapping": { + "version": "0.3.9", + "resolved": "http://registry.npm.release.ctripcorp.com/@jridgewell/trace-mapping/download/@jridgewell/trace-mapping-0.3.9.tgz", + "integrity": "sha1-ZTT9WTOlO6fL86F2FeJzoNEnP/k=", + "dev": true, + "license": "MIT", + "dependencies": { + "@jridgewell/resolve-uri": "^3.0.3", + "@jridgewell/sourcemap-codec": "^1.4.10" + } + }, + "node_modules/@prisma/client": { + "version": "5.8.1", + "resolved": "http://registry.npm.release.ctripcorp.com/@prisma/client/download/@prisma/client-5.8.1.tgz", + "integrity": "sha1-eBXsUcDKKm3iGcAueEZwGuO68kA=", + "hasInstallScript": true, + "license": "Apache-2.0", + "engines": { + "node": ">=16.13" + }, + "peerDependencies": { + "prisma": "*" + }, + "peerDependenciesMeta": { + "prisma": { + "optional": true + } + } + }, + "node_modules/@prisma/debug": { + "version": "5.8.1", + "resolved": "http://registry.npm.release.ctripcorp.com/@prisma/debug/download/@prisma/debug-5.8.1.tgz", + "integrity": "sha1-cE2qNpGbD8TSJyYOzr+hyUsVWwc=", + "devOptional": true, + "license": "Apache-2.0" + }, + "node_modules/@prisma/engines": { + "version": "5.8.1", + "resolved": "http://registry.npm.release.ctripcorp.com/@prisma/engines/download/@prisma/engines-5.8.1.tgz", + "integrity": "sha1-uFB1H1v31eVwuf4Wzv3Csf0sAsM=", + "devOptional": true, + "hasInstallScript": true, + "license": "Apache-2.0", + "dependencies": { + "@prisma/debug": "5.8.1", + "@prisma/engines-version": "5.8.1-1.78caf6feeaed953168c64e15a249c3e9a033ebe2", + "@prisma/fetch-engine": "5.8.1", + "@prisma/get-platform": "5.8.1" + } + }, + "node_modules/@prisma/engines-version": { + "version": "5.8.1-1.78caf6feeaed953168c64e15a249c3e9a033ebe2", + "resolved": "http://registry.npm.release.ctripcorp.com/@prisma/engines-version/download/@prisma/engines-version-5.8.1-1.78caf6feeaed953168c64e15a249c3e9a033ebe2.tgz", + "integrity": "sha1-9gCkWvxM8MA1a27ZCt1gUPo/Mjk=", + "devOptional": true, + "license": "Apache-2.0" + }, + "node_modules/@prisma/fetch-engine": { + "version": "5.8.1", + "resolved": "http://registry.npm.release.ctripcorp.com/@prisma/fetch-engine/download/@prisma/fetch-engine-5.8.1.tgz", + "integrity": "sha1-OLuS8fvTZpNAo8xJ/OQDq032cd0=", + "devOptional": true, + "license": "Apache-2.0", + "dependencies": { + "@prisma/debug": "5.8.1", + "@prisma/engines-version": "5.8.1-1.78caf6feeaed953168c64e15a249c3e9a033ebe2", + "@prisma/get-platform": "5.8.1" + } + }, + "node_modules/@prisma/get-platform": { + "version": "5.8.1", + "resolved": "http://registry.npm.release.ctripcorp.com/@prisma/get-platform/download/@prisma/get-platform-5.8.1.tgz", + "integrity": "sha1-jNRQtlpSpabtWy9SRXE2pJLA8lE=", + "devOptional": true, + "license": "Apache-2.0", + "dependencies": { + "@prisma/debug": "5.8.1" + } + }, + "node_modules/@tsconfig/node10": { + "version": "1.0.9", + "resolved": "http://registry.npm.release.ctripcorp.com/@tsconfig/node10/download/@tsconfig/node10-1.0.9.tgz", + "integrity": "sha1-30kH/AeohpImN7FeAtTOvEwAIbI=", + "dev": true, + "license": "MIT" + }, + "node_modules/@tsconfig/node12": { + "version": "1.0.11", + "resolved": "http://registry.npm.release.ctripcorp.com/@tsconfig/node12/download/@tsconfig/node12-1.0.11.tgz", + "integrity": "sha1-7j3vHyfZ7WbaxuRqKVz/sBUuBY0=", + "dev": true, + "license": "MIT" + }, + "node_modules/@tsconfig/node14": { + "version": "1.0.3", + "resolved": "http://registry.npm.release.ctripcorp.com/@tsconfig/node14/download/@tsconfig/node14-1.0.3.tgz", + "integrity": "sha1-5DhjFihPALmENb9A9y91oJ2r9sE=", + "dev": true, + "license": "MIT" + }, + "node_modules/@tsconfig/node16": { + "version": "1.0.4", + "resolved": "http://registry.npm.release.ctripcorp.com/@tsconfig/node16/download/@tsconfig/node16-1.0.4.tgz", + "integrity": "sha1-C5LcwMwcgfbzBqOB8o4xsaVlNuk=", + "dev": true, + "license": "MIT" + }, + "node_modules/@types/node": { + "version": "20.11.4", + "resolved": "http://registry.npm.release.ctripcorp.com/@types/node/download/@types/node-20.11.4.tgz", + "integrity": "sha1-xySl1nIxgq91i5G5lCCTNvRDnLc=", + "dev": true, + "license": "MIT", + "dependencies": { + "undici-types": "~5.26.4" + } + }, + "node_modules/acorn": { + "version": "8.11.3", + "resolved": "http://registry.npm.release.ctripcorp.com/acorn/download/acorn-8.11.3.tgz", + "integrity": "sha1-ceCxThOk7BYHJLOPt7DyM7G4HXo=", + "dev": true, + "license": "MIT", + "bin": { + "acorn": "bin/acorn" + }, + "engines": { + "node": ">=0.4.0" + } + }, + "node_modules/acorn-walk": { + "version": "8.3.2", + "resolved": "http://registry.npm.release.ctripcorp.com/acorn-walk/download/acorn-walk-8.3.2.tgz", + "integrity": "sha1-dwOvlBXxttuTFdaJVQOGLiMdNKo=", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=0.4.0" + } + }, + "node_modules/arg": { + "version": "4.1.3", + "resolved": "http://registry.npm.release.ctripcorp.com/arg/download/arg-4.1.3.tgz", + "integrity": "sha1-Jp/HrVuOQstjyJbVZmAXJhwUQIk=", + "dev": true, + "license": "MIT" + }, + "node_modules/create-require": { + "version": "1.1.1", + "resolved": "http://registry.npm.release.ctripcorp.com/create-require/download/create-require-1.1.1.tgz", + "integrity": "sha1-wdfo8eX2z8n/ZfnNNS03NIdWwzM=", + "dev": true, + "license": "MIT" + }, + "node_modules/diff": { + "version": "4.0.2", + "resolved": "http://registry.npm.release.ctripcorp.com/diff/download/diff-4.0.2.tgz", + "integrity": "sha1-YPOuy4nV+uUgwRqhnvwruYKq3n0=", + "dev": true, + "license": "BSD-3-Clause", + "engines": { + "node": ">=0.3.1" + } + }, + "node_modules/make-error": { + "version": "1.3.6", + "resolved": "http://registry.npm.release.ctripcorp.com/make-error/download/make-error-1.3.6.tgz", + "integrity": "sha1-LrLjfqm2fEiR9oShOUeZr0hM96I=", + "dev": true, + "license": "ISC" + }, + "node_modules/prisma": { + "version": "5.8.1", + "resolved": "http://registry.npm.release.ctripcorp.com/prisma/download/prisma-5.8.1.tgz", + "integrity": "sha1-HxAXk6iDHAcZ377V+FqW6kiIydM=", + "devOptional": true, + "hasInstallScript": true, + "license": "Apache-2.0", + "dependencies": { + "@prisma/engines": "5.8.1" + }, + "bin": { + "prisma": "build/index.js" + }, + "engines": { + "node": ">=16.13" + } + }, + "node_modules/ts-node": { + "version": "10.9.2", + "resolved": "http://registry.npm.release.ctripcorp.com/ts-node/download/ts-node-10.9.2.tgz", + "integrity": "sha1-cPAhyeGFvM3Kgg4m3EE4BcEBxx8=", + "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/typescript": { + "version": "5.3.3", + "resolved": "http://registry.npm.release.ctripcorp.com/typescript/download/typescript-5.3.3.tgz", + "integrity": "sha1-s85roljnLmMFumb1ybRSqu4//jc=", + "dev": true, + "license": "Apache-2.0", + "bin": { + "tsc": "bin/tsc", + "tsserver": "bin/tsserver" + }, + "engines": { + "node": ">=14.17" + } + }, + "node_modules/undici-types": { + "version": "5.26.5", + "resolved": "http://registry.npm.release.ctripcorp.com/undici-types/download/undici-types-5.26.5.tgz", + "integrity": "sha1-vNU5iT0AtW6WT9JlekhmsiGmVhc=", + "dev": true, + "license": "MIT" + }, + "node_modules/v8-compile-cache-lib": { + "version": "3.0.1", + "resolved": "http://registry.npm.release.ctripcorp.com/v8-compile-cache-lib/download/v8-compile-cache-lib-3.0.1.tgz", + "integrity": "sha1-Yzbo1xllyz01obu3hoRFp8BSZL8=", + "dev": true, + "license": "MIT" + }, + "node_modules/yn": { + "version": "3.1.1", + "resolved": "http://registry.npm.release.ctripcorp.com/yn/download/yn-3.1.1.tgz", + "integrity": "sha1-HodAGgnXZ8HV6rJqbkwYUYLS61A=", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=6" + } + } + } +} diff --git a/tools/data-migration/package.json b/tools/data-migration/package.json new file mode 100644 index 00000000..55539178 --- /dev/null +++ b/tools/data-migration/package.json @@ -0,0 +1,22 @@ +{ + "name": "data-migration", + "version": "1.0.0", + "description": "", + "main": "index.js", + "scripts": { + "test": "echo \"Error: no test specified\" && exit 1", + "generate": "npx prisma generate" + }, + "keywords": [], + "author": "", + "license": "ISC", + "devDependencies": { + "@types/node": "^20.11.4", + "prisma": "^5.8.1", + "ts-node": "^10.9.2", + "typescript": "^5.3.3" + }, + "dependencies": { + "@prisma/client": "^5.8.1" + } +} diff --git a/tools/data-migration/prisma/schema.prisma b/tools/data-migration/prisma/schema.prisma new file mode 100644 index 00000000..0263249a --- /dev/null +++ b/tools/data-migration/prisma/schema.prisma @@ -0,0 +1,94 @@ +datasource db { + provider = "postgresql" + url = env("DATABASE_URL") +} + +generator client { + provider = "prisma-client-js" + binaryTargets = ["native", "debian-openssl-1.1.x"] +} + +model User { + id Int @id + username String + password String + nickname String + avatar String + refreshToken String @map("refresh_token") + accessToken String @map("access_token") + email String + createdAt DateTime @default(now()) @map("created_at") @db.Timestamp(3) + + @@map("user") +} + +// 确认数据结构,Coverage使用随机生成的id,不使用自增id。 +// 取消task,使用consumer消费者模式聚合数据 +// commitSha => sha +model Coverage { + id String @id @default(cuid()) + key String? + sha String @map("sha") + branch String + ip String + device String + compareTarget String @map("compare_target") + projectID String @map("project_id") + instrumentCwd String? @map("instrument_cwd") + reporter Int + reportID String @map("report_id") + covType String @map("cov_type") + relationID String @map("relation_id") + createdAt DateTime @default(now()) @map("created_at") @db.Timestamp(3) + consumer Int // 1: 未消费, 2: 已消费 + + @@map("coverage") +} + +model Project { + id String @id + name String + pathWithNamespace String @map("path_with_namespace") + description String + createdAt DateTime @default(now()) @map("created_at") @db.Timestamp(3) + + @@map("project") +} + +model Summary { + id String @id @default(cuid()) + total Int + covered Int + skipped Int + + metricType String @map("metric_type") + + covType String @map("cov_type") + + reportID String @map("report_id") + + sha String @map("sha") + + createdAt DateTime @default(now()) @map("created_at") @db.Timestamp(3) + + @@map("summary") +} + +model Codechange { + id String @id @default(cuid()) + projectID String @map("project_id") + + compareTarget String @map("compare_target") + + sha String @map("sha") + + path String + + additions Int[] + + deletions Int[] + + createdAt DateTime @default(now()) @map("created_at") @db.Timestamp(3) + + @@map("codechange") +} diff --git a/tools/data-migration/scripts/sys-coverage.ts b/tools/data-migration/scripts/sys-coverage.ts new file mode 100644 index 00000000..ed7b29c8 --- /dev/null +++ b/tools/data-migration/scripts/sys-coverage.ts @@ -0,0 +1,36 @@ +import { PrismaClient } from '@prisma/client' +import data from '../data/coverages.json' +const prisma = new PrismaClient() + +async function main() { + const coverages = await prisma.coverage.createMany({ + data: data.map((cov) => { + return { + branch: cov.branch, + device: cov.device, + instrumentCwd: cov.instrument_cwd, + ip: cov.ip, + reporter: cov.reporter, + relationID: cov.relation_id, + projectID: cov.project_id, + reportID: cov.report_id, + sha: cov.commit_sha, + compareTarget: cov.compare_target, + covType: cov.cov_type, + consumer: 2, + createdAt: cov.created_at, + } + }), + }) + console.log(coverages) +} + +main() + .then(async () => { + await prisma.$disconnect() + }) + .catch(async (e) => { + console.error(e) + await prisma.$disconnect() + process.exit(1) + }) diff --git a/tools/data-migration/tsconfig.json b/tools/data-migration/tsconfig.json new file mode 100644 index 00000000..2f558361 --- /dev/null +++ b/tools/data-migration/tsconfig.json @@ -0,0 +1,109 @@ +{ + "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. */ + // "tsBuildInfoFile": "./.tsbuildinfo", /* Specify the path to .tsbuildinfo incremental compilation file. */ + // "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": "es2016", /* Set the JavaScript language version for emitted JavaScript and include compatible library declarations. */ + // "lib": [], /* 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. */ + // "jsxFactory": "", /* Specify the JSX factory function used when targeting React JSX emit, e.g. 'React.createElement' or 'h'. */ + // "jsxFragmentFactory": "", /* Specify the JSX Fragment reference used for fragments when targeting React JSX emit e.g. 'React.Fragment' or 'Fragment'. */ + // "jsxImportSource": "", /* Specify module specifier used to import the JSX factory functions when using 'jsx: react-jsx*'. */ + // "reactNamespace": "", /* Specify the object invoked for 'createElement'. This only applies when targeting 'react' JSX emit. */ + // "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. */ + // "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'. */ + // "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. */ + // "allowImportingTsExtensions": true, /* Allow imports to include TypeScript file extensions. Requires '--moduleResolution bundler' and either '--noEmit' or '--emitDeclarationOnly' to be set. */ + // "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": true, /* Enable importing .json files. */ + // "allowArbitraryExtensions": true, /* Enable importing files with any extension, provided a declaration file is present. */ + // "noResolve": true, /* Disallow 'import's, 'require's 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. */ + // "emitDeclarationOnly": true, /* Only output d.ts files and not JavaScript files. */ + // "sourceMap": true, /* Create source map files for emitted JavaScript files. */ + // "inlineSourceMap": true, /* Include sourcemap files inside the emitted JavaScript. */ + // "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": "./", /* Specify an output folder for all emitted files. */ + // "removeComments": true, /* Disable emitting comments. */ + // "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. */ + // "sourceRoot": "", /* Specify the root path for debuggers to find the reference source code. */ + // "mapRoot": "", /* Specify the location where debugger should locate map files instead of generated locations. */ + // "inlineSources": true, /* Include source code in the sourcemaps inside the emitted JavaScript. */ + // "emitBOM": true, /* Emit a UTF-8 Byte Order Mark (BOM) in the beginning of output files. */ + // "newLine": "crlf", /* Set the newline character for emitting files. */ + // "stripInternal": true, /* Disable emitting declarations that have '@internal' in their JSDoc comments. */ + // "noEmitHelpers": true, /* Disable generating custom helper functions like '__extends' in compiled output. */ + // "noEmitOnError": true, /* Disable emitting files if any type checking errors are reported. */ + // "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. */ + // "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. */ + + /* Type Checking */ + "strict": false, /* 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. */ + // "strictBindCallApply": true, /* Check that the arguments for 'bind', 'call', and 'apply' methods match the original function. */ + // "strictPropertyInitialization": true, /* Check for class properties that are declared but not set in the constructor. */ + // "noImplicitThis": true, /* Enable error reporting when 'this' is given the type 'any'. */ + // "useUnknownInCatchVariables": true, /* Default catch clause variables as 'unknown' instead of 'any'. */ + // "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'. */ + // "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. */ + // "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. */ + } +}