Skip to content

Commit

Permalink
more necessary config changes to build properly with tsc as esm modul…
Browse files Browse the repository at this point in the history
…e instead of commonjs
  • Loading branch information
chuckbergeron committed May 9, 2023
1 parent 80387d1 commit eb8dee4
Show file tree
Hide file tree
Showing 8 changed files with 171 additions and 6,148 deletions.
2 changes: 2 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
"module": "dist/v5-utils-js.esm.js",
"main": "dist/index.js",
"typings": "dist/index.d.ts",
"type": "module",
"files": [
"dist",
"src"
Expand All @@ -32,6 +33,7 @@
"@pooltogether/contract-list-schema": "^0.1.4",
"ethereum-multicall": "^2.17.0",
"ethers": "^5.5.1",
"graphql": "^16.6.0",
"graphql-request": "^6.0.0",
"lodash": "^4.17.21",
"tsc": "^2.0.4",
Expand Down
3 changes: 0 additions & 3 deletions src/index.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,3 @@
import * as compute from "./compute";
import * as utils from "./utils";
export * from "./compute";
export * from "./utils";
export * from "./types";
export { compute, utils };
2 changes: 1 addition & 1 deletion src/utils/constants.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,5 +5,5 @@ const CHAIN_ID = {

export const TWAB_CONTROLLER_SUBGRAPH_URIS = {
[CHAIN_ID.goerli]: `https://api.thegraph.com/subgraphs/name/pooltogether/v5-eth-goerli-twab-controller`,
[CHAIN_ID.mumbai]: `https://api.thegraph.com/subgraphs/name/pooltogether/v5-polygon-mumbai-twab-controller`
[CHAIN_ID.mumbai]: `https://api.thegraph.com/subgraphs/name/pooltogether/v5-polygon-mumbai-twab-control`
};
1 change: 1 addition & 0 deletions test/compute/computeDrawWinners.test.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
export {};
48 changes: 48 additions & 0 deletions test/compute/computeDrawWinners.test.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions test/compute/computeDrawWinners.test.js.map

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

73 changes: 27 additions & 46 deletions tsconfig.json
Original file line number Diff line number Diff line change
@@ -1,47 +1,28 @@
{
// see https://www.typescriptlang.org/tsconfig to better understand tsconfigs
"include": [
"./src",
"types"
],
"exclude": [
"dist",
"node_modules"
],
"typedocOptions": {
"entryPoints": ["./src/index.ts"],
"out": "docs",
"readme": "DOCUMENTATION.md",
},
"compilerOptions": {
"outDir": "./dist",
"resolveJsonModule": true,
"module": "esnext",
"lib": ["dom", "esnext"],
"importHelpers": true,
// output .d.ts declaration files for consumers
"declaration": true,
// output .js.map sourcemap files for consumers
"sourceMap": true,
// match output dir to input dir. e.g. dist/index instead of dist/src/index
"rootDir": "./src",
// stricter type-checking for stronger correctness. Recommended by TS
"strict": true,
// linter checks for common issues
"noImplicitReturns": true,
"noFallthroughCasesInSwitch": true,
// noUnused* overlap with @typescript-eslint/no-unused-vars, can disable if duplicative
"noUnusedLocals": true,
"noUnusedParameters": true,
// use Node's module resolution algorithm, instead of the legacy TS one
"moduleResolution": "node",
// transpile JSX to React.createElement
"jsx": "react",
// interop between ESM and CJS modules. Recommended by TS
"esModuleInterop": true,
// significant perf increase by skipping checking .d.ts files, particularly those in node_modules. Recommended by TS
"skipLibCheck": true,
// error out if import and file system have a casing mismatch. Recommended by TS
"forceConsistentCasingInFileNames": true
}
}
"compilerOptions": {
"outDir": "./dist",
"module": "ESNext",
"declaration": true,
"noImplicitAny": false,
"removeComments": true,
"noLib": false,
"emitDecoratorMetadata": true,
"experimentalDecorators": true,
"resolveJsonModule": true,
"esModuleInterop": true,
"moduleResolution": "node",
"target": "es6",
"sourceMap": true,
"lib": [
"es6",
"dom"
],
},
"include": [
"./src"
],
"exclude": [
"dist",
"node_modules"
]
}
Loading

0 comments on commit eb8dee4

Please sign in to comment.