Skip to content

Commit

Permalink
fix: publish cjs and esm modules (#229)
Browse files Browse the repository at this point in the history
  • Loading branch information
magicmatatjahu authored Jun 8, 2021
1 parent e5a1be4 commit 829c523
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 8 deletions.
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@ This package is under development and it has not reached version 1.0.0 yet, whic
- [Customization](#customization)
- [Development](#development)
- [Contributing](#contributing)
- [Contributors ✨](#contributors-%E2%9C%A8)

<!-- tocstop -->

Expand Down
13 changes: 9 additions & 4 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,9 @@
"author": {
"name": "The AsyncAPI maintainers"
},
"main": "lib/index.js",
"types": "lib/index.d.ts",
"main": "lib/cjs/index.js",
"module": "lib/esm/index.js",
"types": "lib/types/index.d.ts",
"files": [
"/lib",
"./README.md",
Expand Down Expand Up @@ -57,18 +58,22 @@
"scripts": {
"start": "tsc --watch",
"build": "tsc",
"build:prod": "npm run build:cjs && npm run build:esm && npm run build:types",
"build:cjs": "tsc",
"build:esm": "tsc --project tsconfig.json --module ESNext --outDir ./lib/esm",
"build:types": "tsc --project tsconfig.json --declaration --emitDeclarationOnly --declarationMap --outDir ./lib/types",
"test": "cross-env CI=true jest --coverage --testPathIgnorePatterns ./test/blackbox",
"test:blackbox": "cross-env CI=true jest ./test/blackbox",
"test:watch": "jest --watch",
"docs": "npm run docs:markdown",
"docs:markdown": "jsdoc2md lib/index.js -f lib/**/*.js > API.md",
"docs:markdown": "jsdoc2md lib/cjs/index.js -f lib/cjs/**/*.js > API.md",
"lint": "eslint --max-warnings 0 --config .eslintrc .",
"lint:fix": "eslint --max-warnings 0 --config .eslintrc . --fix",
"get:version": "echo $npm_package_version",
"get:name": "echo $npm_package_name",
"release": "semantic-release",
"generate:readme:toc": "markdown-toc -i README.md",
"generate:assets": "npm run build && npm run docs",
"generate:assets": "npm run build:prod && npm run docs && npm run generate:readme:toc",
"bump:version": "npm --no-git-tag-version --allow-same-version version $VERSION",
"prepublishOnly": "npm run build"
},
Expand Down
8 changes: 4 additions & 4 deletions tsconfig.json
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
{
"compilerOptions": {
"outDir": "./lib",
"outDir": "./lib/cjs",
"baseUrl": "./src",
"declaration": true,
"declaration": false,
"target": "es6",
"lib": [
"esnext"
Expand All @@ -15,7 +15,7 @@
"strict": true,
"forceConsistentCasingInFileNames": true,
"noFallthroughCasesInSwitch": true,
"module": "commonjs",
"module": "CommonJS",
"moduleResolution": "node",
"resolveJsonModule": true,
"isolatedModules": true
Expand All @@ -24,4 +24,4 @@
"src/**/*.ts",
],
"exclude": ["node_modules", "lib"]
}
}

0 comments on commit 829c523

Please sign in to comment.