Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -74,4 +74,4 @@ jobs:

- name: Publish tagged version
if: steps.release.outputs.tag != ''
run: npm publish --tag ${{ steps.release.outputs.tag }}
run: npm publish --tag ${{ steps.release.outputs.tag }}
8 changes: 4 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -27,10 +27,10 @@ console.log(usdc.addresses[1]); // Ethereum mainnet address

## What's Exported

| Module | Description |
|--------|-------------|
| `networks` | Chain ID constants for testnets and mainnets, chain metadata |
| `tokens` | `TOKEN_SYMBOLS_MAP` — token name, symbol, decimals, per-chain addresses, coingeckoId |
| Module | Description |
| ---------- | ------------------------------------------------------------------------------------ |
| `networks` | Chain ID constants for testnets and mainnets, chain metadata |
| `tokens` | `TOKEN_SYMBOLS_MAP` — token name, symbol, decimals, per-chain addresses, coingeckoId |

## Development

Expand Down
17 changes: 8 additions & 9 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@across-protocol/constants",
"version": "3.1.107",
"version": "3.1.108",
"description": "Export commonly re-used values for Across repositories",
"repository": {
"type": "git",
Expand All @@ -23,10 +23,9 @@
"prettier": "prettier .",
"eslint": "eslint .",
"prepare": "yarn build",
"build": "yarn run clean && yarn run build:cjs && yarn run build:esm && yarn run build:types",
"build:cjs": "tsc --project tsconfig.json --module commonjs --outDir ./dist/cjs --removeComments --verbatimModuleSyntax false && echo > ./dist/cjs/package.json '{\"type\":\"commonjs\"}'",
"build:esm": "tsc --project tsconfig.json --module es2015 --outDir ./dist/esm && echo > ./dist/esm/package.json '{\"type\":\"module\",\"sideEffects\":false}'",
"build:types": "tsc --project tsconfig.json --module esnext --declarationDir ./dist/types --emitDeclarationOnly --declaration --declarationMap",
"build": "yarn run clean && yarn run build:cjs && yarn run build:esm",
"build:cjs": "tsc --project tsconfig.cjs.json && echo > ./dist/cjs/package.json '{\"type\":\"commonjs\"}'",
"build:esm": "tsc --project tsconfig.json",
"clean": "rm -rf ./dist"
},
"devDependencies": {
Expand All @@ -45,13 +44,13 @@
},
"main": "./dist/cjs/index.js",
"module": "./dist/esm/index.js",
"types": "./dist/types/index.d.ts",
"typings": "./dist/types/index.d.ts",
"types": "./dist/esm/index.d.ts",
"typings": "./dist/esm/index.d.ts",
"exports": {
".": {
"require": "./dist/cjs/index.js",
"types": "./dist/esm/index.d.ts",
"import": "./dist/esm/index.js",
"types": "./dist/types/index.d.ts"
"require": "./dist/cjs/index.js"
},
"./dist/cjs/*": {
"require": "./dist/cjs/*.js",
Expand Down
4 changes: 2 additions & 2 deletions src/index.ts
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
export * from "./networks";
export * from "./tokens";
export * from "./networks.js";
export * from "./tokens.js";
2 changes: 1 addition & 1 deletion src/tokens.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { CHAIN_IDs } from "./networks";
import { CHAIN_IDs } from "./networks.js";

// Information for the supported tokens on each chain.
// NOTE: All addresses should be checksummed
Expand Down
11 changes: 11 additions & 0 deletions tsconfig.cjs.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
{
"extends": "./tsconfig.json",
"compilerOptions": {
"module": "commonjs",
"moduleResolution": "node",
"verbatimModuleSyntax": false,
"outDir": "./dist/cjs",
"removeComments": true,
"ignoreDeprecations": "6.0"
}
}
22 changes: 6 additions & 16 deletions tsconfig.json
Original file line number Diff line number Diff line change
@@ -1,31 +1,21 @@
{
"compilerOptions": {
"module": "CommonJS",
"target": "ES2024",
// output .d.ts declaration files for consumers
"target": "ES2022",
"module": "nodenext",
"moduleResolution": "nodenext",
"verbatimModuleSyntax": true,
"declaration": true,
// output .js.map sourcemap files for consumers
"declarationMap": true,
"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",
"ignoreDeprecations": "6.0",
// 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,
// output to dist folder
"outDir": "./dist"
"outDir": "./dist/esm"
}
}