Skip to content

Commit f705a84

Browse files
committed
refactor: Move to ESM
ldap plugin is now transpiled to ESM. Fix some unhandled "undefined" issues and checks. Update all packages. Add semantic release.
1 parent 23ab8ea commit f705a84

6 files changed

Lines changed: 2652 additions & 98 deletions

File tree

.gitignore

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
11
node_modules/
2-
lib/
2+
dist/

README.md

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
## Installation
44

55
```
6-
npm i @openinc/parse-server-ldap
6+
pnpm i @openinc/parse-server-ldap
77
```
88

99
## Usage
@@ -21,6 +21,19 @@ const init = async () => {
2121
module.exports.init = init;
2222
```
2323

24+
or as ESM:
25+
26+
```js
27+
import { init as initLDAP } from "@openinc/parse-server-ldap";
28+
29+
const init = async () => {
30+
console.log("Init LDAP Plugin.");
31+
initLDAP(Parse);
32+
};
33+
34+
module.exports.init = init;
35+
```
36+
2437
## Configuration
2538

2639
1. Before using you should create a column (type string) in the **\_User** table in parse. The name of the column should be equal to `PARSE_LDAP_PARSE_LDAP_DN_ATTRIBUTE`.

package.json

Lines changed: 49 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -2,26 +2,66 @@
22
"name": "@openinc/parse-server-ldap",
33
"version": "0.6.7",
44
"description": "Parse Server Cloud Code to authenticate with LDAP/AD",
5+
"packageManager": "pnpm@10.11.1",
6+
"type": "module",
57
"keywords": [
68
"parse",
79
"ldap"
810
],
9-
"main": "lib/index.js",
11+
"repository": {
12+
"type": "git",
13+
"url": "git+https://github.com/open-inc/node-parse-server-ldap.git"
14+
},
15+
"main": "dist/index.js",
1016
"license": "MIT",
17+
"release": {
18+
"branches": [
19+
"master"
20+
],
21+
"repositoryUrl": "https://github.com/open-inc/node-parse-server-ldap.git",
22+
"plugins": [
23+
"@semantic-release/commit-analyzer",
24+
"@semantic-release/release-notes-generator",
25+
"@semantic-release/changelog",
26+
"@semantic-release/npm",
27+
"@semantic-release/github",
28+
"semantic-release-export-data"
29+
],
30+
"prepare": [
31+
"@semantic-release/changelog",
32+
"@semantic-release/npm",
33+
{
34+
"path": "@semantic-release/git",
35+
"assets": [
36+
"package.json",
37+
"pnpm-lock.json",
38+
"CHANGELOG.md"
39+
],
40+
"message": "chore(release): Release ${nextRelease.version} \n\n${nextRelease.notes}"
41+
}
42+
]
43+
},
1144
"scripts": {
12-
"build": "tsc",
13-
"prepublish": "pnpm run build"
45+
"build": "tsc"
1446
},
1547
"dependencies": {
16-
"ldapts": "4.2.6"
48+
"ldapts": "8.0.1",
49+
"semantic-release": "^24.2.5"
1750
},
1851
"devDependencies": {
52+
"@types/node": "^22.15.29",
1953
"@types/parse": "^3.0.9",
20-
"typescript": "^5.4.5"
54+
"typescript": "^5.8.3",
55+
"semantic-release-export-data": "^1.1.0",
56+
"@semantic-release/changelog": "^6.0.3",
57+
"@semantic-release/commit-analyzer": "^13.0.1",
58+
"@semantic-release/exec": "^7.1.0",
59+
"@semantic-release/git": "^10.0.1",
60+
"@semantic-release/github": "^11.0.3",
61+
"@semantic-release/npm": "^12.0.1",
62+
"@semantic-release/release-notes-generator": "^14.0.3"
2163
},
2264
"prettier": {
2365
"printWidth": 120
24-
},
25-
"type": "commonjs",
26-
"packageManager": "pnpm@9.4.0"
27-
}
66+
}
67+
}

0 commit comments

Comments
 (0)