diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml new file mode 100644 index 0000000..919205e --- /dev/null +++ b/.github/workflows/publish.yml @@ -0,0 +1,19 @@ +name: Publish Package to npmjs +on: + release: + types: [created] +jobs: + build: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v3 + # Setup .npmrc file to publish to npm + - uses: actions/setup-node@v3 + with: + node-version: "16.x" + registry-url: "https://registry.npmjs.org" + - run: npm ci + - run: npm run build + - run: npm run release + env: + NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }} diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index 963a5eb..830e79d 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -9,8 +9,12 @@ jobs: ports: - 8124:8123 steps: - - name: Checkout 🛎️ - uses: actions/checkout@v3 + - uses: actions/checkout@v3 + # Setup .npmrc file to publish to npm + - uses: actions/setup-node@v3 + with: + node-version: "16.x" + registry-url: "https://registry.npmjs.org" - name: Tests run: | npm ci diff --git a/.gitignore b/.gitignore index 134a26d..43affff 100644 --- a/.gitignore +++ b/.gitignore @@ -3,4 +3,5 @@ node_modules/ *.exec.ts *.exec.json # *.exec.md -docs-ts-out/ \ No newline at end of file +docs-ts-out/ +dist/ \ No newline at end of file diff --git a/CHANGELOG.md b/CHANGELOG.md new file mode 100644 index 0000000..e69de29 diff --git a/LICENSE b/LICENSE new file mode 100644 index 0000000..6e641d6 --- /dev/null +++ b/LICENSE @@ -0,0 +1,21 @@ +MIT License + +Copyright (c) 2022 Lucas Ávila + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. \ No newline at end of file diff --git a/package-lock.json b/package-lock.json index fa5e6f0..c432b33 100644 --- a/package-lock.json +++ b/package-lock.json @@ -651,6 +651,22 @@ "strip-ansi": "^6.0.0", "terminal-link": "^2.0.0", "v8-to-istanbul": "^9.0.0" + }, + "dependencies": { + "glob": { + "version": "7.2.3", + "resolved": "https://registry.npmjs.org/glob/-/glob-7.2.3.tgz", + "integrity": "sha512-nFR0zLpU2YCaRxwoCJvL6UvCH2JFyFVIvwTLsIf21AuHlMskA1hhTdk+LlYJtOlYt9v6dvszD2BGRqBL+iQK9Q==", + "dev": true, + "requires": { + "fs.realpath": "^1.0.0", + "inflight": "^1.0.4", + "inherits": "2", + "minimatch": "^3.1.1", + "once": "^1.3.0", + "path-is-absolute": "^1.0.0" + } + } } }, "@jest/schemas": { @@ -993,6 +1009,16 @@ "@babel/types": "^7.3.0" } }, + "@types/glob": { + "version": "7.2.0", + "resolved": "https://registry.npmjs.org/@types/glob/-/glob-7.2.0.tgz", + "integrity": "sha512-ZUxbzKl0IfJILTS6t7ip5fQQM/J3TJYubDm3nMbgubNNYS62eXeUpoLUC8/7fJNiFYHTrGPQn7hspDUzIHX3UA==", + "dev": true, + "requires": { + "@types/minimatch": "*", + "@types/node": "*" + } + }, "@types/graceful-fs": { "version": "4.1.5", "resolved": "https://registry.npmjs.org/@types/graceful-fs/-/graceful-fs-4.1.5.tgz", @@ -1470,6 +1496,23 @@ "ssri": "^8.0.1", "tar": "^6.0.2", "unique-filename": "^1.1.1" + }, + "dependencies": { + "glob": { + "version": "7.2.3", + "resolved": "https://registry.npmjs.org/glob/-/glob-7.2.3.tgz", + "integrity": "sha512-nFR0zLpU2YCaRxwoCJvL6UvCH2JFyFVIvwTLsIf21AuHlMskA1hhTdk+LlYJtOlYt9v6dvszD2BGRqBL+iQK9Q==", + "dev": true, + "optional": true, + "requires": { + "fs.realpath": "^1.0.0", + "inflight": "^1.0.4", + "inherits": "2", + "minimatch": "^3.1.1", + "once": "^1.3.0", + "path-is-absolute": "^1.0.0" + } + } } }, "cacheable-request": { @@ -1966,6 +2009,20 @@ "integrity": "sha512-72fSenhMw2HZMTVHeCA9KCmpEIbzWiQsjN+BHcBbS9vr1mtt+vJjPdksIBNUmKAW8TFUDPJK5SUU3QhE9NEXDw==", "dev": true }, + "glob": { + "version": "7.2.3", + "resolved": "https://registry.npmjs.org/glob/-/glob-7.2.3.tgz", + "integrity": "sha512-nFR0zLpU2YCaRxwoCJvL6UvCH2JFyFVIvwTLsIf21AuHlMskA1hhTdk+LlYJtOlYt9v6dvszD2BGRqBL+iQK9Q==", + "dev": true, + "requires": { + "fs.realpath": "^1.0.0", + "inflight": "^1.0.4", + "inherits": "2", + "minimatch": "^3.1.1", + "once": "^1.3.0", + "path-is-absolute": "^1.0.0" + } + }, "has-flag": { "version": "3.0.0", "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-3.0.0.tgz", @@ -2439,17 +2496,36 @@ "dev": true }, "glob": { - "version": "7.2.3", - "resolved": "https://registry.npmjs.org/glob/-/glob-7.2.3.tgz", - "integrity": "sha512-nFR0zLpU2YCaRxwoCJvL6UvCH2JFyFVIvwTLsIf21AuHlMskA1hhTdk+LlYJtOlYt9v6dvszD2BGRqBL+iQK9Q==", + "version": "8.0.3", + "resolved": "https://registry.npmjs.org/glob/-/glob-8.0.3.tgz", + "integrity": "sha512-ull455NHSHI/Y1FqGaaYFaLGkNMMJbavMrEGFXG/PGrg6y7sutWHUHrz6gy6WEBH6akM1M414dWKCNs+IhKdiQ==", "dev": true, "requires": { "fs.realpath": "^1.0.0", "inflight": "^1.0.4", "inherits": "2", - "minimatch": "^3.1.1", - "once": "^1.3.0", - "path-is-absolute": "^1.0.0" + "minimatch": "^5.0.1", + "once": "^1.3.0" + }, + "dependencies": { + "brace-expansion": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-2.0.1.tgz", + "integrity": "sha512-XnAIvQ8eM+kC6aULx6wuQiwVsnzsi9d3WxzV3FpWTGA19F621kwdbsAcFKXgKUHZWsy+mY6iL1sHTxWEFCytDA==", + "dev": true, + "requires": { + "balanced-match": "^1.0.0" + } + }, + "minimatch": { + "version": "5.1.0", + "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-5.1.0.tgz", + "integrity": "sha512-9TPBGGak4nHfGZsPBohm9AWg6NoT7QTCehS3BIJABslyZbzxfV78QM2Y6+i741OPZIafFAaiiEMh5OyIrJPgtg==", + "dev": true, + "requires": { + "brace-expansion": "^2.0.1" + } + } } }, "glob-parent": { @@ -3183,6 +3259,20 @@ "integrity": "sha512-Cxwpt2SfTzTtXcfOlzGEee8O+c+MmUgGrNiBcXnuWxuFJHe6a5Hz7qwhwe5OgaSYI0IJvkLqWX1ASG+cJOkEiA==", "dev": true }, + "glob": { + "version": "7.2.3", + "resolved": "https://registry.npmjs.org/glob/-/glob-7.2.3.tgz", + "integrity": "sha512-nFR0zLpU2YCaRxwoCJvL6UvCH2JFyFVIvwTLsIf21AuHlMskA1hhTdk+LlYJtOlYt9v6dvszD2BGRqBL+iQK9Q==", + "dev": true, + "requires": { + "fs.realpath": "^1.0.0", + "inflight": "^1.0.4", + "inherits": "2", + "minimatch": "^3.1.1", + "once": "^1.3.0", + "path-is-absolute": "^1.0.0" + } + }, "jest-get-type": { "version": "28.0.2", "resolved": "https://registry.npmjs.org/jest-get-type/-/jest-get-type-28.0.2.tgz", @@ -3518,6 +3608,22 @@ "jest-util": "^28.1.1", "slash": "^3.0.0", "strip-bom": "^4.0.0" + }, + "dependencies": { + "glob": { + "version": "7.2.3", + "resolved": "https://registry.npmjs.org/glob/-/glob-7.2.3.tgz", + "integrity": "sha512-nFR0zLpU2YCaRxwoCJvL6UvCH2JFyFVIvwTLsIf21AuHlMskA1hhTdk+LlYJtOlYt9v6dvszD2BGRqBL+iQK9Q==", + "dev": true, + "requires": { + "fs.realpath": "^1.0.0", + "inflight": "^1.0.4", + "inherits": "2", + "minimatch": "^3.1.1", + "once": "^1.3.0", + "path-is-absolute": "^1.0.0" + } + } } }, "jest-snapshot": { @@ -4316,6 +4422,21 @@ "wide-align": "^1.1.5" } }, + "glob": { + "version": "7.2.3", + "resolved": "https://registry.npmjs.org/glob/-/glob-7.2.3.tgz", + "integrity": "sha512-nFR0zLpU2YCaRxwoCJvL6UvCH2JFyFVIvwTLsIf21AuHlMskA1hhTdk+LlYJtOlYt9v6dvszD2BGRqBL+iQK9Q==", + "dev": true, + "optional": true, + "requires": { + "fs.realpath": "^1.0.0", + "inflight": "^1.0.4", + "inherits": "2", + "minimatch": "^3.1.1", + "once": "^1.3.0", + "path-is-absolute": "^1.0.0" + } + }, "npmlog": { "version": "6.0.2", "resolved": "https://registry.npmjs.org/npmlog/-/npmlog-6.0.2.tgz", @@ -4932,6 +5053,22 @@ "dev": true, "requires": { "glob": "^7.1.3" + }, + "dependencies": { + "glob": { + "version": "7.2.3", + "resolved": "https://registry.npmjs.org/glob/-/glob-7.2.3.tgz", + "integrity": "sha512-nFR0zLpU2YCaRxwoCJvL6UvCH2JFyFVIvwTLsIf21AuHlMskA1hhTdk+LlYJtOlYt9v6dvszD2BGRqBL+iQK9Q==", + "dev": true, + "requires": { + "fs.realpath": "^1.0.0", + "inflight": "^1.0.4", + "inherits": "2", + "minimatch": "^3.1.1", + "once": "^1.3.0", + "path-is-absolute": "^1.0.0" + } + } } }, "run-parallel": { @@ -5277,6 +5414,22 @@ "@istanbuljs/schema": "^0.1.2", "glob": "^7.1.4", "minimatch": "^3.0.4" + }, + "dependencies": { + "glob": { + "version": "7.2.3", + "resolved": "https://registry.npmjs.org/glob/-/glob-7.2.3.tgz", + "integrity": "sha512-nFR0zLpU2YCaRxwoCJvL6UvCH2JFyFVIvwTLsIf21AuHlMskA1hhTdk+LlYJtOlYt9v6dvszD2BGRqBL+iQK9Q==", + "dev": true, + "requires": { + "fs.realpath": "^1.0.0", + "inflight": "^1.0.4", + "inherits": "2", + "minimatch": "^3.1.1", + "once": "^1.3.0", + "path-is-absolute": "^1.0.0" + } + } } }, "throat": { diff --git a/package.json b/package.json index c402801..5dcf57c 100644 --- a/package.json +++ b/package.json @@ -1,9 +1,15 @@ { "name": "sql-select-ts", - "version": "1.0.0", - "description": "", - "main": "index.js", + "version": "0.0.0", + "description": "A modern, database-agnostic, composable SELECT query builder with great typescript support.", + "main": "lib/index.js", + "module": "es6/index.js", + "typings": "lib/index.d.ts", "homepage": "https://lucasavila00.github.io/sql-select-ts/", + "repository": { + "type": "git", + "url": "https://github.com/lucasavila00/sql-select-ts.git" + }, "scripts": { "test": "jest", "clear_jest": "jest --clearCache", @@ -11,20 +17,23 @@ "prettier-check": "prettier --check \"src/**/*.{js,jsx,ts,tsx,json,css}\"", "static": "npm run prettier-check && npm run ts", "docs": "docs-ts", - "build": "tsc", "eval:transpile": "nodemon --quiet --watch ../lib/docs-eval -e md --exec \"ts-node\" --transpileOnly ./scripts/run-docs-eval.ts --transpileOnly", "eval:check": "nodemon --watch ../lib/docs-eval -e md --exec \"ts-node\" --transpileOnly ./scripts/run-docs-eval.ts --checkOnly", "eval": "concurrently --raw \"npm run eval:transpile\" \"npm run eval:check\"", "run-docs-eval": "ts-node ./scripts/run-docs-eval.ts", "fix-docs-ts": "ts-node ./scripts/copy-fix-docs-ts.ts", - "md": "npm run docs && npm run fix-docs-ts && npm run run-docs-eval" + "md": "npm run docs && npm run fix-docs-ts && npm run run-docs-eval", + "build": "rm -rf dist && tsc -p ./tsconfig.build.json && tsc -p ./tsconfig.build-es6.json && ts-node scripts/build", + "prepublishOnly": "ts-node scripts/pre-publish", + "release": "ts-node scripts/release" }, "keywords": [], - "author": "", - "license": "ISC", + "author": "Lucas Ávila", + "license": "MIT", "dependencies": {}, "devDependencies": { "@apla/clickhouse": "^1.6.4", + "@types/glob": "^7.2.0", "@types/jest": "^28.1.1", "@types/js-yaml": "^4.0.5", "@types/node": "^18.0.0", @@ -33,6 +42,7 @@ "concurrently": "^7.2.2", "docs-ts": "^0.6.10", "fp-ts": "^2.12.1", + "glob": "^8.0.3", "jest": "^28.1.1", "js-yaml": "^4.1.0", "nodemon": "^2.0.18", diff --git a/scripts/FileSystem.ts b/scripts/FileSystem.ts new file mode 100644 index 0000000..bc2465a --- /dev/null +++ b/scripts/FileSystem.ts @@ -0,0 +1,45 @@ +import * as TE from "fp-ts/lib/TaskEither"; +import { flow } from "fp-ts/lib/function"; +import * as fs from "fs"; +import G from "glob"; + +export interface FileSystem { + readonly readFile: (path: string) => TE.TaskEither; + readonly writeFile: ( + path: string, + content: string + ) => TE.TaskEither; + readonly copyFile: (from: string, to: string) => TE.TaskEither; + readonly glob: ( + pattern: string + ) => TE.TaskEither>; + readonly mkdir: (path: string) => TE.TaskEither; +} + +const readFile = TE.taskify( + //@ts-ignore + fs.readFile +); +const writeFile = TE.taskify( + fs.writeFile +); +const copyFile = TE.taskify< + fs.PathLike, + fs.PathLike, + NodeJS.ErrnoException, + void +>(fs.copyFile); +const glob = TE.taskify>(G); +const mkdirTE = TE.taskify(fs.mkdir); + +export const fileSystem: FileSystem = { + //@ts-ignore + readFile: (path) => readFile(path, "utf8"), + writeFile, + copyFile, + glob, + mkdir: flow( + mkdirTE, + TE.map(() => undefined) + ), +}; diff --git a/scripts/build.ts b/scripts/build.ts new file mode 100644 index 0000000..67d4a01 --- /dev/null +++ b/scripts/build.ts @@ -0,0 +1,99 @@ +import * as path from "path"; +import * as E from "fp-ts/lib/Either"; +import { pipe } from "fp-ts/lib/pipeable"; +import * as RTE from "fp-ts/lib/ReaderTaskEither"; +import * as A from "fp-ts/lib/ReadonlyArray"; +import * as TE from "fp-ts/lib/TaskEither"; +import { FileSystem, fileSystem } from "./FileSystem"; +import { run } from "./run"; + +interface Build extends RTE.ReaderTaskEither {} + +const OUTPUT_FOLDER = "dist"; +const PKG = "package.json"; + +export const copyPackageJson: Build = (C) => + pipe( + C.readFile(PKG), + TE.chain((s) => TE.fromEither(E.parseJSON(s, E.toError))), + TE.map((v) => { + const clone = Object.assign({}, v as any); + + delete clone.scripts; + delete clone.files; + delete clone.devDependencies; + + return clone; + }), + TE.chain((json) => + C.writeFile(path.join(OUTPUT_FOLDER, PKG), JSON.stringify(json, null, 2)) + ) + ); + +export const FILES: ReadonlyArray = [ + "CHANGELOG.md", + "LICENSE", + "README.md", +]; + +export const copyFiles: Build> = (C) => + A.readonlyArray.traverse(TE.taskEither)(FILES, (from) => + C.copyFile(from, path.resolve(OUTPUT_FOLDER, from)) + ); + +const traverse = A.readonlyArray.traverse(TE.taskEither); + +export const makeModules: Build = (C) => + pipe( + C.glob(`${OUTPUT_FOLDER}/lib/*.js`), + TE.map(getModules), + TE.chain((modules) => traverse(modules, makeSingleModule(C))), + TE.map(() => undefined) + ); + +function getModules(paths: ReadonlyArray): ReadonlyArray { + return paths + .map((filePath) => path.basename(filePath, ".js")) + .filter((x) => x !== "index"); +} + +function makeSingleModule( + C: FileSystem +): (module: string) => TE.TaskEither { + return (m) => + pipe( + C.mkdir(path.join(OUTPUT_FOLDER, m)), + TE.chain(() => makePkgJson(m)), + TE.chain((data) => + C.writeFile(path.join(OUTPUT_FOLDER, m, "package.json"), data) + ) + ); +} + +function makePkgJson(module: string): TE.TaskEither { + return pipe( + JSON.stringify( + { + main: `../lib/${module}.js`, + module: `../es6/${module}.js`, + typings: `../lib/${module}.d.ts`, + sideEffects: false, + }, + null, + 2 + ), + TE.right + ); +} + +const main: Build = pipe( + copyPackageJson, + RTE.chain(() => copyFiles), + RTE.chain(() => makeModules) +); + +run( + main({ + ...fileSystem, + }) +); diff --git a/scripts/pre-publish.ts b/scripts/pre-publish.ts new file mode 100644 index 0000000..e587530 --- /dev/null +++ b/scripts/pre-publish.ts @@ -0,0 +1,10 @@ +import { left } from "fp-ts/lib/TaskEither"; +import { run } from "./run"; + +const main = left( + new Error( + '"npm publish" can not be run from root, run "npm run release" instead' + ) +); + +run(main); diff --git a/scripts/release.ts b/scripts/release.ts new file mode 100644 index 0000000..949fbe9 --- /dev/null +++ b/scripts/release.ts @@ -0,0 +1,25 @@ +import { run } from "./run"; +import * as child_process from "child_process"; +import { left, right } from "fp-ts/lib/Either"; +import * as TE from "fp-ts/lib/TaskEither"; + +const DIST = "dist"; + +const exec = + (cmd: string, args?: child_process.ExecOptions): TE.TaskEither => + () => + new Promise((resolve) => { + child_process.exec(cmd, args, (err) => { + if (err !== null) { + return resolve(left(err)); + } + + return resolve(right(undefined)); + }); + }); + +export const main = exec("npm publish", { + cwd: DIST, +}); + +run(main); diff --git a/scripts/run.ts b/scripts/run.ts new file mode 100644 index 0000000..246d52a --- /dev/null +++ b/scripts/run.ts @@ -0,0 +1,21 @@ +import { fold } from "fp-ts/lib/Either"; +import { TaskEither } from "fp-ts/lib/TaskEither"; + +export function run(eff: TaskEither): void { + eff() + .then( + fold( + (e) => { + throw e; + }, + (_) => { + process.exitCode = 0; + } + ) + ) + .catch((e) => { + console.error(e); // tslint:disable-line no-console + + process.exitCode = 1; + }); +} diff --git a/tests/modules.d.ts b/tests/modules.d.ts index 3d3b21f..833545a 100644 --- a/tests/modules.d.ts +++ b/tests/modules.d.ts @@ -1,7 +1,7 @@ declare module "@apla/clickhouse" { import { Writable } from "stream"; - export type AplaQueryOptions = { + type AplaQueryOptions = { queryOptions?: { node?: string; force?: "true"; diff --git a/tsconfig.build-es6.json b/tsconfig.build-es6.json new file mode 100644 index 0000000..8ef6800 --- /dev/null +++ b/tsconfig.build-es6.json @@ -0,0 +1,7 @@ +{ + "extends": "./tsconfig.build.json", + "compilerOptions": { + "outDir": "./dist/es6", + "module": "es6" + } +} diff --git a/tsconfig.build.json b/tsconfig.build.json new file mode 100644 index 0000000..5ff2f51 --- /dev/null +++ b/tsconfig.build.json @@ -0,0 +1,7 @@ +{ + "extends": "./tsconfig.json", + "compilerOptions": { + "noEmit": false + }, + "include": ["./src"] +} diff --git a/tsconfig.json b/tsconfig.json index 0833121..4d8390a 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -1,104 +1,20 @@ { "compilerOptions": { - /* Visit https://aka.ms/tsconfig.json to read more about this file */ - - /* Projects */ - // "incremental": true, /* Enable incremental compilation */ - // "composite": true, /* Enable constraints that allow a TypeScript project to be used with project references. */ - // "tsBuildInfoFile": "./", /* Specify the folder for .tsbuildinfo incremental compilation files. */ - // "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": [ - "es2017", - "dom" - ] /* 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 TC39 stage 2 draft 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. */ - - /* Modules */ - "module": "commonjs" /* Specify what module code is generated. */, - // "rootDir": "./", /* Specify the root folder within your source files. */ - // "moduleResolution": "node", /* 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. */ - // "resolveJsonModule": true, /* Enable importing .json files */ - // "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. */ - // "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": "./dist" /* 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. */ - // "inlineSourceMap": true, /* Include sourcemap files inside the emitted JavaScript. */ - // "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. */ - // "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": 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. */, - "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 /* Type catch clause variables as 'unknown' instead of 'any'. */, - "alwaysStrict": true /* Ensure 'use strict' is always emitted. */, - "noUnusedLocals": true /* Enable error reporting when a local variables aren't read. */, - "noUnusedParameters": true /* Raise an error when a function parameter isn't read */, - "allowUnusedLabels": true /* Disable error reporting for unused labels. */, - "allowUnreachableCode": true /* Disable error reporting for unreachable code. */, - "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 /* Include 'undefined' in index signature results */, - "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 */, - - /* Completeness */ - // "skipDefaultLibCheck": true, /* Skip type checking .d.ts files that are included with TypeScript. */ - "skipLibCheck": true /* Skip type checking all .d.ts files. */ - } + "outDir": "./dist/lib", + "noEmit": true, + "declaration": true, + "esModuleInterop": true, + "module": "commonjs", + "noImplicitReturns": false, + "noUnusedLocals": true, + "noUnusedParameters": true, + "noFallthroughCasesInSwitch": true, + "strict": true, + "target": "es5", + "moduleResolution": "node", + "forceConsistentCasingInFileNames": true, + "stripInternal": true, + "lib": ["es2015", "ESNext.BigInt"] + }, + "include": ["./src", "./tests", "./scripts"] }