Alex Styl
12/23/2025, 8:35 AMArtem Kobzar
12/23/2025, 8:38 AMhfhbd
12/23/2025, 9:23 AMapi?hfhbd
12/23/2025, 9:24 AMAlex Styl
12/23/2025, 9:27 AMEdoardo Luppi
12/23/2025, 9:39 AMpackage.json correctly populated with the library's JS dependencies, and the lockfile upgrade process should pick them up.CLOVIS
12/23/2025, 9:41 AMDoes the Kotlin JS library usesThis shouldn't matter, both?api
api and implementation should declare a transitive dependency that the end-user downloads. Only compileOnly doesn't do that, but KGP will error out if you try to.Edoardo Luppi
12/23/2025, 9:42 AMapi does not matter in a K/JS context when you use npm(...).Alex Styl
12/23/2025, 9:51 AMThis is kinda impossible to do. If your dependency is using an external JS package, that will get included with your final bundle.first things first. my main thing here is to not force the consumers of my library to manually add dependencies just to use my library
Alex Styl
12/23/2025, 9:51 AMAlex Styl
12/23/2025, 9:57 AMEdoardo Luppi
12/23/2025, 9:59 AMAlex Styl
12/23/2025, 10:20 AMimport * as UnifiedSdk from 'unified';
which is a package the library usesAlex Styl
12/23/2025, 10:26 AMapi. It definitely doesn't copy over the dependencies.
Tried deleting node_modules on the consumer project, then gradle sync and the dependencies from the library are never installed in node_modulesEdoardo Luppi
12/23/2025, 10:26 AMAlex Styl
12/23/2025, 10:27 AMEdoardo Luppi
12/23/2025, 10:29 AMkotlinUpgradeYarnLock and see if the versioned lockfile changes first. And then you can run kotlinNpmInstallAlex Styl
12/23/2025, 10:31 AMkotlinUpgradeYarnLock on the consumer does update the lock file and I can see the missing dep in there. doing kotlinNpmInstall does not add the missing package in the node modules thoAlex Styl
12/23/2025, 10:31 AMEdoardo Luppi
12/23/2025, 10:39 AMpackage.json file at the root of the *-js.klib. Try to check if it's indeed there.Alex Styl
12/23/2025, 10:42 AMBut the key is your library should have awhat is klib? never seen thatfile at the root of thepackage.json. Try to check if it's indeed there.*-js.klib
Edoardo Luppi
12/23/2025, 10:43 AMEdoardo Luppi
12/23/2025, 10:44 AMAlex Styl
12/23/2025, 10:45 AMAlex Styl
12/23/2025, 10:47 AMpackage.json with minimal setup. the package.json has a script which builds the kotlin/js consumer. that kotlin js is the one using the library:
{
"name": "backend",
"version": "1.0.0",
"description": "",
"type": "module",
"scripts": {
"tailwind": "npx tailwindcss -i styles.css -o public/css/output.css",
"watch-tailwind": "npx tailwindcss -i styles.css -o public/css/output.css --watch",
"watch-kotlin": "./gradlew backend:jsNodeDevelopmentLibraryDistribution -t --quiet",
"watch-backend": "bun run --insecure --watch dist/backend/alexstyl-backend.mjs",
"dev": "concurrently \"bun run watch-backend\" \"bun run watch-kotlin\" \"bun run watch-tailwind\" \"bun run dev-stripe\"",
"prod": "bun i && pm2 start ecosystem.config.cjs",
"build": "./gradlew jsNodeDevelopmentLibraryDistribution --quiet",
"dev-stripe": "stripe listen --forward-to localhost:3000/api/stripe-webhook"
},
"dependencies": {
"tailwindcss": "^3.4.1",
"@tailwindcss/line-clamp": "^0.4.4",
"@tailwindcss/typography": "^0.5.13"
},
"devDependencies": {
"concurrently": "^8.2.2",
"dotenv-cli": "^10.0.0",
"postcss-import": "^16.1.1"
}
}Alex Styl
12/23/2025, 10:47 AMdist/Alex Styl
12/23/2025, 10:47 AMEdoardo Luppi
12/23/2025, 10:48 AMthe consumer project is a node js project.Ah well, that changes quite a lot everything. I thought the consumer was a Kotlin project too.
Alex Styl
12/23/2025, 10:49 AMAlex Styl
12/23/2025, 10:55 AM./gradlew kotlinNpmInstall that installs app npm packages. at build/node_modules.
But i specify a custom distrbution path, it just doesn't install anythingAlex Styl
12/23/2025, 10:55 AMoutputDirectory in kotlin/js/nodejs/distribution within build.gradle.ktsEdoardo Luppi
12/23/2025, 10:56 AMAlex Styl
12/23/2025, 11:07 AMbuild/js/node_modules never gets createdAlex Styl
12/23/2025, 11:45 AMAlex Styl
12/23/2025, 11:46 AM[Kotlin] is the right project for it, but no other made senseEdoardo Luppi
12/23/2025, 11:47 AMAlex Styl
12/23/2025, 12:23 PMAlex Styl
12/23/2025, 12:25 PMEdoardo Luppi
12/23/2025, 1:32 PMAlex Styl
12/23/2025, 3:40 PMAlex Styl
12/23/2025, 3:40 PMEdoardo Luppi
12/23/2025, 3:42 PMthe issue has both library and consumer to try it outI think you've set the visibility to JetBrains-only tho.
Alex Styl
12/23/2025, 3:46 PMEdoardo Luppi
12/23/2025, 3:47 PM