-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #102 from Pagebakers/fix/node-resolve-esm
fix: rename esm to .mjs and add exports
- Loading branch information
Showing
2 changed files
with
23 additions
and
4 deletions.
There are no files selected for viewing
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 |
---|---|---|
|
@@ -2,16 +2,29 @@ | |
"name": "permitio", | ||
"version": "2.5.2", | ||
"description": "Node.js client library for the Permit.io full-stack permissions platform", | ||
"type": "commonjs", | ||
"main": "build/main/index.js", | ||
"typings": "build/main/index.d.ts", | ||
"module": "build/module/index.js", | ||
"repository": "https://github.com/permitio/permit-node", | ||
"module": "build/module/index.mjs", | ||
"exports": { | ||
".": { | ||
"types": "./build/module/index.d.ts", | ||
"import": "./build/module/index.mjs", | ||
"require": "./build/main/index.js" | ||
}, | ||
"./build/main/*": "./build/main/*", | ||
"./build/module/*": "./build/module/*" | ||
}, | ||
"repository": { | ||
"type": "git", | ||
"url": "git+https://github.com/permitio/permit-node.git" | ||
}, | ||
"license": "MIT", | ||
"keywords": [], | ||
"scripts": { | ||
"build": "run-p build:*", | ||
"build:main": "tsc -p tsconfig.json", | ||
"build:module": "tsc -p tsconfig.module.json", | ||
"build:module": "tsc -p tsconfig.module.json && yarn rename:esm", | ||
"fix": "run-s fix:*", | ||
"fix:prettier": "prettier --config .prettierrc \"src/**/*.{ts,css,less,scss,js}\" --write", | ||
"fix:lint": "eslint src --ext .ts --fix", | ||
|
@@ -33,6 +46,7 @@ | |
"docs": "typedoc", | ||
"docs:watch": "typedoc --watch", | ||
"version": "2.5.2", | ||
"rename:esm": "/bin/zsh ./scripts/rename-mjs.sh", | ||
"reset-hard": "git clean -dfx && git reset --hard && yarn", | ||
"prepare": "npm run build && husky install", | ||
"prepare-release": "run-s reset-hard test cov:check doc:html version doc:publish", | ||
|
@@ -119,5 +133,6 @@ | |
"exclude": [ | ||
"**/*.spec.js" | ||
] | ||
} | ||
}, | ||
"packageManager": "[email protected]+sha512.a6b2f7906b721bba3d67d4aff083df04dad64c399707841b7acf00f6b133b7ac24255f2652fa22ae3534329dc6180534e98d17432037ff6fd140556e2bb3137e" | ||
} |
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,4 @@ | ||
for file in ./build/module/**/*.js; do | ||
sed -i '' "s/\.js'/\.mjs'/g" "$file" | ||
mv "$file" "${file%.js}.mjs" | ||
done |