Skip to content

Commit

Permalink
get rid of dist
Browse files Browse the repository at this point in the history
  • Loading branch information
Ad96el committed Oct 10, 2023
1 parent 271277c commit 2d13285
Show file tree
Hide file tree
Showing 5 changed files with 41 additions and 25 deletions.
11 changes: 10 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,7 +1,16 @@
/node_modules
yarn.lock
yarn-error.log
/dist
/esm
/getExtension
/cli
/messaging
/quote
/types
/utils
/wellKnownDidConfiguration
/index.js
/index.d.ts


*.js
Expand Down
4 changes: 2 additions & 2 deletions jest.config.cjs
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,13 @@ module.exports = {
preset: 'ts-jest',
testEnvironment: 'node',
clearMocks: true,
resolver: 'ts-jest-resolver',
resolver: 'ts-jest-resolver',
// Parachain block time is 12s
testTimeout: 12000,
collectCoverageFrom: ['**/*/src/**/*.ts'],
rootDir: 'src',
coverageDirectory: 'coverage',
moduleDirectories: [ 'dist', 'node_modules'],
moduleDirectories: [ 'esm', 'node_modules'],
globals: {
'ts-jest': {
tsconfig: 'tsconfig.cjs.json'
Expand Down
47 changes: 27 additions & 20 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,49 +1,56 @@
{
"name": "@kiltprotocol/kilt-extension-api",
"version": "0.1.0",
"main": "./dist/cjs/index.js",
"types": "./dist/cjs/index.d.ts",
"main": "./index.js",
"types": "./index.d.ts",
"type": "module",
"exports": {
".": {
"import": "./dist/esm/index.js",
"require": "./dist/cjs/index.js",
"default": "./dist/cjs/index.js"
"import": "./esm/index.js",
"require": "./index.js",
"default": "./index.js"
},
"./wellKnownDidConfiguration": {
"import": "./dist/esm/wellKnownDidConfiguration/index.js",
"require": "./dist/cjs/wellKnownDidConfiguration/index.js",
"default": "./dist/cjs/wellKnownDidConfiguration/index.js"
"import": "./esm/wellKnownDidConfiguration/index.js",
"require": "./wellKnownDidConfiguration/index.js",
"default": "./wellKnownDidConfiguration/index.js"
},
"./types": {
"import": "./dist/esm/types/index.js",
"require": "./dist/cjs/types/index.js",
"default": "./dist/cjs/types/index.js"
"import": "./esm/types/index.js",
"require": "./types/index.js",
"default": "./types/index.js"
},
"./messaging": {
"import": "./dist/esm/messaging/index.js",
"require": "./dist/cjs/messaging/index.js",
"default": "./dist/cjs/messaging/index.js"
"import": "./esm/messaging/index.js",
"require": "./messaging/index.js",
"default": "./messaging/index.js"
},
"./quote": {
"import": "./dist/esm/quote/index.js",
"require": "./dist/cjs/quote/index.js",
"default": "./dist/cjs/quote/index.js"
"import": "./esm/quote/index.js",
"require": "./quote/index.js",
"default": "./quote/index.js"
}
},
"files": [
"LICENSE",
"README.md",
"package.json",
"dist"
"esm",
"getExtension",
"messaging",
"quote",
"index.js",
"index.d.ts",
"cli",
"wellKnownDidConfiguration"
],
"author": "KILT <[email protected]>",
"license": "BSD-4-Clause",
"scripts": {
"lint": "eslint --ext .ts .",
"build": "yarn build:cjs && yarn build:esm",
"build:cjs": "tsc -p tsconfig.cjs.json && echo '{\"type\": \"commonjs\"}' > dist/cjs/package.json",
"build:esm": "tsc -p tsconfig.esm.json && echo '{\"type\": \"module\"}' > dist/esm/package.json",
"build:cjs": "tsc -p tsconfig.cjs.json",
"build:esm": "tsc -p tsconfig.esm.json && echo '{\"type\": \"module\"}' > esm/package.json",
"clean": "exec git clean -xf -e 'node_modules' '*'",
"test": "jest test --no-cache"
},
Expand Down
2 changes: 1 addition & 1 deletion tsconfig.cjs.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
"target": "ES2022",
"module": "commonjs",
"declaration": true,
"outDir": "./dist/cjs",
"outDir": "./",
"esModuleInterop": true,
"forceConsistentCasingInFileNames": true,
"strict": true,
Expand Down
2 changes: 1 addition & 1 deletion tsconfig.esm.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
"module": "ESNext",
"declaration": true,
"moduleResolution": "Node16",
"outDir": "./dist/esm",
"outDir": "./esm",
"esModuleInterop": true,
"forceConsistentCasingInFileNames": true,
"strict": true,
Expand Down

0 comments on commit 2d13285

Please sign in to comment.