Skip to content

Commit

Permalink
fix: esm in version 0.0.7 (#45)
Browse files Browse the repository at this point in the history
* fix: esm in version 0.0.7

* feat: lint
  • Loading branch information
lotharking authored Oct 18, 2024
1 parent df649a1 commit ce4f5c4
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 5 deletions.
3 changes: 0 additions & 3 deletions jest.config.base.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,6 @@ const config: Config.InitialOptions = {
},
],
},
moduleNameMapper: {
'@li0ard/tsemrtd': '<rootDir>/src/esm/bundle.js',
},
}

export default config
4 changes: 3 additions & 1 deletion packages/mrtd/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,9 @@
},
"scripts": {
"deps": "rm -f src/esm/bundle.js && esbuild --platform=node src/esm/index.ts --bundle --outfile=src/esm/bundle.js",
"build": "yarn run clean && yarn run compile && yarn run deps",
"prebuild": "yarn run deps",
"copy-esm": "cp src/esm/bundle.js build/esm/",
"build": "yarn run clean && yarn run compile && yarn run copy-esm",
"clean": "rimraf -rf ./build",
"compile": "tsc -p tsconfig.build.json",
"prepublishOnly": "yarn run build",
Expand Down
5 changes: 4 additions & 1 deletion packages/mrtd/src/models/EMrtdData.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import type tsemrtd from '@li0ard/tsemrtd'
import type { SecurityInfos } from '@li0ard/tsemrtd/dist/asn1/eac'
import type { CSCAMasterList } from '@li0ard/tsemrtd/dist/asn1/pkd'
import type {
Expand All @@ -11,7 +12,9 @@ import type {
} from '@li0ard/tsemrtd/dist/consts/interfaces'
import type { SubjectPublicKeyInfo } from '@peculiar/asn1-x509'

import { COM, DG1, DG2, DG3, DG4, DG5, DG7, DG11, DG12, DG14, DG15, SOD, PKD } from '../esm'
/* eslint-disable @typescript-eslint/no-var-requires */
const { COM, DG1, DG2, DG3, DG4, DG5, DG7, DG11, DG12, DG14, DG15, SOD, PKD } =
require('../esm/bundle.js') as typeof tsemrtd

import { EMrtdDataGroup } from './EMrtdDataGroup'

Expand Down

0 comments on commit ce4f5c4

Please sign in to comment.