-
Notifications
You must be signed in to change notification settings - Fork 76
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix(build): include default export to work around some bundler issues (…
…#205) * fix(build): include default export to work around some bundler issues fixes #186 * chore(build): upgrade linters * chore: specify extension for relative imports
- Loading branch information
Showing
14 changed files
with
2,726 additions
and
6,135 deletions.
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
import typescriptEslint from "@typescript-eslint/eslint-plugin"; | ||
import jest from "eslint-plugin-jest"; | ||
import globals from "globals"; | ||
import tsParser from "@typescript-eslint/parser"; | ||
import path from "node:path"; | ||
import { fileURLToPath } from "node:url"; | ||
import js from "@eslint/js"; | ||
import { FlatCompat } from "@eslint/eslintrc"; | ||
|
||
const __filename = fileURLToPath(import.meta.url); | ||
const __dirname = path.dirname(__filename); | ||
const compat = new FlatCompat({ | ||
baseDirectory: __dirname, | ||
recommendedConfig: js.configs.recommended, | ||
allConfig: js.configs.all | ||
}); | ||
|
||
export default [...compat.extends( | ||
"eslint:recommended", | ||
"plugin:@typescript-eslint/recommended", | ||
"plugin:prettier/recommended", | ||
), { | ||
plugins: { | ||
"@typescript-eslint": typescriptEslint, | ||
jest, | ||
}, | ||
|
||
languageOptions: { | ||
globals: { | ||
...globals.node, | ||
...jest.environments.globals.globals, | ||
}, | ||
|
||
parser: tsParser, | ||
ecmaVersion: 2020, | ||
sourceType: "module", | ||
}, | ||
|
||
rules: {}, | ||
}]; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
import { defaults } from 'jest-config' | ||
|
||
// @type {import('jest-config').InitialOptions} | ||
const config = { | ||
rootDir: './', | ||
moduleFileExtensions: [...defaults.moduleFileExtensions, 'mts'], | ||
collectCoverage: false, | ||
collectCoverageFrom: [ | ||
'packages/**/src/**/*.ts', | ||
'!**/examples/**', | ||
'!packages/cli/**', | ||
'!**/types/**', | ||
'!**/build/**', | ||
'!**/node_modules/**', | ||
'!packages/test-react-app/**', | ||
'!packages/test-utils/**', | ||
], | ||
coverageReporters: ['json'], | ||
coverageDirectory: './coverage', | ||
coverageProvider: 'v8', | ||
testMatch: ['**/__tests__/**/*.test.ts'], | ||
automock: false, | ||
// // typescript 5 removes the need to specify relative imports as .js, so we should no longer need this workaround | ||
// // but webpack still requires .js specifiers, so we are keeping it for now | ||
moduleNameMapper: { | ||
'^(\\.{1,2}/.*)\\.js$': '$1', | ||
}, | ||
transform: { | ||
'^.+\\.m?tsx?$': [ | ||
'ts-jest', | ||
{ | ||
useESM: true, | ||
}, | ||
], | ||
}, | ||
extensionsToTreatAsEsm: ['.ts'], | ||
testEnvironment: 'node', | ||
} | ||
|
||
export default config |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -14,16 +14,6 @@ | |
"require": "./lib/index.js" | ||
} | ||
}, | ||
"typesVersions": { | ||
"*": { | ||
"lib/index.d.ts": [ | ||
"lib/index.d.ts" | ||
], | ||
"*": [ | ||
"./lib/index.d.js" | ||
] | ||
} | ||
}, | ||
"repository": { | ||
"type": "git", | ||
"url": "[email protected]:decentralized-identity/ethr-did-resolver.git" | ||
|
@@ -36,7 +26,7 @@ | |
], | ||
"author": "Pelle Braendgaard", | ||
"contributors": [ | ||
"Mircea Nistor <[email protected]>" | ||
"Mircea Nistor" | ||
], | ||
"license": "Apache-2.0", | ||
"keywords": [ | ||
|
@@ -66,42 +56,32 @@ | |
"prepublishOnly": "yarn test:ci && yarn format && yarn lint", | ||
"release": "semantic-release --debug" | ||
}, | ||
"jest": { | ||
"clearMocks": true, | ||
"collectCoverageFrom": [ | ||
"src/**/*.{ts,tsx}", | ||
"!src/**/*.d.ts", | ||
"!**/node_modules/**", | ||
"!**/__tests__/**" | ||
], | ||
"testEnvironment": "node", | ||
"testMatch": [ | ||
"**/__tests__/**/*.test.[jt]s" | ||
] | ||
}, | ||
"devDependencies": { | ||
"@babel/core": "7.25.2", | ||
"@babel/preset-env": "7.25.4", | ||
"@babel/preset-typescript": "7.24.7", | ||
"@eslint/eslintrc": "^3.1.0", | ||
"@eslint/js": "^9.11.1", | ||
"@ethers-ext/provider-ganache": "6.0.0-beta.2", | ||
"@semantic-release/changelog": "6.0.3", | ||
"@semantic-release/git": "10.0.1", | ||
"@types/jest": "29.5.12", | ||
"@typescript-eslint/eslint-plugin": "6.21.0", | ||
"@typescript-eslint/parser": "6.21.0", | ||
"@typescript-eslint/eslint-plugin": "8.7.0", | ||
"@typescript-eslint/parser": "8.7.0", | ||
"babel-jest": "29.7.0", | ||
"eslint": "8.57.0", | ||
"eslint-config-prettier": "9.1.0", | ||
"eslint-plugin-jest": "27.9.0", | ||
"eslint-plugin-jest": "28.8.3", | ||
"eslint-plugin-prettier": "5.2.1", | ||
"jest": "29.7.0", | ||
"microbundle": "0.15.1", | ||
"prettier": "3.3.3", | ||
"semantic-release": "22.0.12", | ||
"ts-jest": "^29.2.5", | ||
"typescript": "5.5.4" | ||
}, | ||
"dependencies": { | ||
"did-resolver": "^4.1.0", | ||
"ethers": "^6.8.1" | ||
} | ||
}, | ||
"packageManager": "[email protected]" | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.