Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

JS publication has strange Kotlin version in package.json #68

Closed
lamba92 opened this issue Oct 7, 2019 · 6 comments

Comments

@lamba92
Copy link

@lamba92 lamba92 commented Oct 7, 2019

{
  "main": "klock-root-klock.js",
  "dependencies": {
    "kotlin": "%%%KOTLIN_VERSION!!!"
  },
  "name": "klock-root-klock",
  "version": "0.0.0-VERSION"
}

Breaks multiplatform build when targetting Kotlin/JS and adding some dependencies from NPM using the 1.3.40+ Kotlin MPP/JS Gradle Plugins. Of course if only importing from Maven the package.json does not comes into play and the issue is not present.
Trying to build the library even without NPM imports triggers the error as well.

Here's a project to reproduce the bug.

@soywiz

This comment has been minimized.

Copy link
Member

@soywiz soywiz commented Oct 9, 2019

Can't reproduce:

npm i @korlibs/klock-locale
cat node_modules/@korlibs/klock-locale/package.json

...

  "dependencies": {
    "@korlibs/klock": "1.7.3",
    "kotlin": "1.3.50"
  },

KOTLIN_VERSION is replaced here: https://github.com/korlibs/klock/blob/master/build.gradle#L29

soywiz added a commit that referenced this issue Oct 9, 2019
@soywiz

This comment has been minimized.

Copy link
Member

@soywiz soywiz commented Oct 9, 2019

I have never used npm with Kotlin. I have tried this:
1677313

But maybe your usecase need the package.json to be part of the jar file? In which case I should process the package.json before generating the .jar file, or not including it at all?

@lamba92

This comment has been minimized.

Copy link
Author

@lamba92 lamba92 commented Oct 9, 2019

I actually just need to output a JS library from a multiplatform project that imports Klock. When doing so that error happens. The new Kotlin/JS plugin uses NPM and the package.json to fetch all dependencies that are both on Maven and NPM.

If you fork the project i linked above, just by trying to sync it with IntelliJ the error should happen. I think the problem may rely in the Maven publication, not the NPM one.

@lamba92

This comment has been minimized.

Copy link
Author

@lamba92 lamba92 commented Oct 9, 2019

I think the problem may rely in the Maven publication, not the NPM one.

Indeed here if you download klock-js-1.7.3.jar you can easily check inside that the package.json file contains the token of the token %%%KOTLIN_VERSION!!!.

@soywiz soywiz closed this in 51e08cc Oct 9, 2019
@lamba92

This comment has been minimized.

Copy link
Author

@lamba92 lamba92 commented Oct 9, 2019

May I ask when you plan to publish the fixed package?

@soywiz

This comment has been minimized.

Copy link
Member

@soywiz soywiz commented Oct 9, 2019

Once travis publishes it: https://travis-ci.org/korlibs/klock/builds/595570937

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
2 participants
You can’t perform that action at this time.