diff --git a/.gitignore b/.gitignore index 9fada2a..d08f26d 100644 --- a/.gitignore +++ b/.gitignore @@ -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 diff --git a/jest.config.cjs b/jest.config.cjs index 0b0c8ad..e23c919 100644 --- a/jest.config.cjs +++ b/jest.config.cjs @@ -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' diff --git a/package.json b/package.json index a3cf793..2a2f52d 100644 --- a/package.json +++ b/package.json @@ -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 ", "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" }, diff --git a/tsconfig.cjs.json b/tsconfig.cjs.json index e2ab742..2ea1dcf 100644 --- a/tsconfig.cjs.json +++ b/tsconfig.cjs.json @@ -4,7 +4,7 @@ "target": "ES2022", "module": "commonjs", "declaration": true, - "outDir": "./dist/cjs", + "outDir": "./", "esModuleInterop": true, "forceConsistentCasingInFileNames": true, "strict": true, diff --git a/tsconfig.esm.json b/tsconfig.esm.json index ba6c0ba..fca0472 100644 --- a/tsconfig.esm.json +++ b/tsconfig.esm.json @@ -5,7 +5,7 @@ "module": "ESNext", "declaration": true, "moduleResolution": "Node16", - "outDir": "./dist/esm", + "outDir": "./esm", "esModuleInterop": true, "forceConsistentCasingInFileNames": true, "strict": true,