Maqed
Maqed
BABetter Auth
Created by Maqed on 4/19/2025 in #help
Trying to make my plugin work as npm package with bun
Probably the problem from link: functionality in my device. I published the package to npm & everything is working perfectly. Note: I had to add .npmignore file & exclude everything that is in .gitignore EXCEPT dist folder
14 replies
BABetter Auth
Created by Maqed on 4/19/2025 in #help
Trying to make my plugin work as npm package with bun
When I try to run
bun dev
bun dev
It always gives me this error: Cannot find module 'extended-organization/client' or its corresponding type declarations.ts(2307)
14 replies
BABetter Auth
Created by Maqed on 4/19/2025 in #help
Trying to make my plugin work as npm package with bun
No description
14 replies
BABetter Auth
Created by Maqed on 4/19/2025 in #help
Trying to make my plugin work as npm package with bun
No description
14 replies
BABetter Auth
Created by Maqed on 4/19/2025 in #help
Trying to make my plugin work as npm package with bun
It's still not working....
14 replies
BABetter Auth
Created by Maqed on 4/19/2025 in #help
Trying to make my plugin work as npm package with bun
I'll try using npm and pnpm and see what happens..
14 replies
BABetter Auth
Created by Maqed on 4/19/2025 in #help
Trying to make my plugin work as npm package with bun
extend organization plugin with more functionality
14 replies
BABetter Auth
Created by Maqed on 4/19/2025 in #help
Trying to make my plugin work as npm package with bun
I also tried to release it as an actual npm package not just a link but still not working
14 replies
BABetter Auth
Created by Maqed on 4/19/2025 in #help
Trying to make my plugin work as npm package with bun
build.config.ts
import { defineBuildConfig } from "unbuild";

export default defineBuildConfig({
declaration: true,
rollup: {
emitCJS: true,
inlineDependencies: true,
},
entries: ["./src/index", "./src/client"],
outDir: "dist",
clean: true,
failOnWarn: false,
});
import { defineBuildConfig } from "unbuild";

export default defineBuildConfig({
declaration: true,
rollup: {
emitCJS: true,
inlineDependencies: true,
},
entries: ["./src/index", "./src/client"],
outDir: "dist",
clean: true,
failOnWarn: false,
});
My folder structure ./root --/src ---/my-plugin.ts ---/client.ts ---/index.ts ---/other-files....
14 replies
BABetter Auth
Created by Maqed on 4/19/2025 in #help
Trying to make my plugin work as npm package with bun
Here is my configuration: package.json:
{
"name": "my-plugin",
"version": "0.0.1",
"module": "dist/index.mjs",
"main": "dist/index.cjs",
"types": "dist/index.d.ts",
"files": [
"dist"
],
"scripts": {
"test": "vitest",
"build": "unbuild",
"dev": "unbuild --watch",
"prepublishOnly": "npm run build",
"release": "release-it"
},
"exports": {
".": {
"types": "./dist/index.d.ts",
"import": "./dist/index.mjs",
"require": "./dist/index.cjs"
},
"./client": {
"types": "./dist/client.d.ts",
"import": "./dist/client.mjs",
"require": "./dist/client.cjs"
}
},
"typesVersions": {
"*": {
"*": [
"./dist/index.d.ts"
],
"client": [
"./dist/client.d.ts"
]
}
},
"peerDependencies": {
"better-auth": "^1.2.5"
},
"devDependencies": {
"@types/bun": "^1.2.8",
"bun-plugin-dts": "^0.3.0",
"release-it": "^19.0.1",
"typescript": "^5.0.0"
},
"dependencies": {
"unbuild": "^3.5.0",
"zod": "^3.24.2"
},
"publishConfig": {
"access": "public"
}
}
{
"name": "my-plugin",
"version": "0.0.1",
"module": "dist/index.mjs",
"main": "dist/index.cjs",
"types": "dist/index.d.ts",
"files": [
"dist"
],
"scripts": {
"test": "vitest",
"build": "unbuild",
"dev": "unbuild --watch",
"prepublishOnly": "npm run build",
"release": "release-it"
},
"exports": {
".": {
"types": "./dist/index.d.ts",
"import": "./dist/index.mjs",
"require": "./dist/index.cjs"
},
"./client": {
"types": "./dist/client.d.ts",
"import": "./dist/client.mjs",
"require": "./dist/client.cjs"
}
},
"typesVersions": {
"*": {
"*": [
"./dist/index.d.ts"
],
"client": [
"./dist/client.d.ts"
]
}
},
"peerDependencies": {
"better-auth": "^1.2.5"
},
"devDependencies": {
"@types/bun": "^1.2.8",
"bun-plugin-dts": "^0.3.0",
"release-it": "^19.0.1",
"typescript": "^5.0.0"
},
"dependencies": {
"unbuild": "^3.5.0",
"zod": "^3.24.2"
},
"publishConfig": {
"access": "public"
}
}
tsconfig.json
{
"compilerOptions": {
"esModuleInterop": true,
"skipLibCheck": true,
"target": "es2022",
"allowJs": true,
"resolveJsonModule": true,
"module": "ESNext",
"noEmit": true,
"moduleResolution": "Bundler",
"moduleDetection": "force",
"isolatedModules": true,
"verbatimModuleSyntax": true,
"strict": true,
"noImplicitOverride": true,
"noFallthroughCasesInSwitch": true
},
"exclude": ["node_modules", "dist"],
"include": ["src"]
}
{
"compilerOptions": {
"esModuleInterop": true,
"skipLibCheck": true,
"target": "es2022",
"allowJs": true,
"resolveJsonModule": true,
"module": "ESNext",
"noEmit": true,
"moduleResolution": "Bundler",
"moduleDetection": "force",
"isolatedModules": true,
"verbatimModuleSyntax": true,
"strict": true,
"noImplicitOverride": true,
"noFallthroughCasesInSwitch": true
},
"exclude": ["node_modules", "dist"],
"include": ["src"]
}
14 replies
BABetter Auth
Created by Maqed on 4/15/2025 in #help
updating schema field of type: string[] doesn't work.
Yeah
11 replies
BABetter Auth
Created by Maqed on 4/15/2025 in #help
updating schema field of type: string[] doesn't work.
Oops! nevermind the problem was from me I think
11 replies
BABetter Auth
Created by Maqed on 4/15/2025 in #help
updating schema field of type: string[] doesn't work.
11 replies
BABetter Auth
Created by Maqed on 4/15/2025 in #help
updating schema field of type: string[] doesn't work.
Sure!
11 replies
BABetter Auth
Created by Maqed on 4/15/2025 in #help
updating schema field of type: string[] doesn't work.
Yeah
11 replies
BABetter Auth
Created by Maqed on 4/15/2025 in #help
updating schema field of type: string[] doesn't work.
@admin Could anyone please help me. I've been stuck with this issue for a while.
11 replies
BABetter Auth
Created by Maqed on 4/12/2025 in #help
How can I get other plugin's option in my plugin?
How can I get or pass the options manually? should I just pass it like that:
organization({
ac,
roles: { member, admin, owner },
}),
myPlugin({
ac,
roles: { member, admin, owner },
})
organization({
ac,
roles: { member, admin, owner },
}),
myPlugin({
ac,
roles: { member, admin, owner },
})
7 replies
BABetter Auth
Created by Maqed on 4/12/2025 in #help
How can I get other plugin's option in my plugin?
I don't want the interface. I want the actual options itself. For example: I set up organization plugin with these options:
organization({
ac,
roles: { member, admin, owner },
}),
organization({
ac,
roles: { member, admin, owner },
}),
I want to access to access them in other plugin. How can I do such thing?
7 replies
BABetter Auth
Created by Maqed on 4/12/2025 in #help
How can I get member with user in adapter
Okay thank you!
5 replies
BABetter Auth
Created by Maqed on 4/12/2025 in #help
Error generating schema
Thank you so much for your help ❤️
11 replies