https://kotlinlang.org logo
Join SlackCommunities
Powered by
# npm-publish
  • b

    Big Chungus

    06/27/2022, 7:15 PM
    npm-publish@3.0.1 is out with kotlin 1.7.0 support
  • b

    Big Chungus

    10/20/2022, 9:31 PM
    Hi all. With kotlin 1.8 around the corner, I'm planning plugin dependency versions refresh. As part of that I'd like to include some more polish to hopefully make the plugin require less configurations for kjs projects. To help me with that, I'd appreciate if you could share your cases where you've had to customise the default configuration of the plugin after applying it to your kjs project and why. Much appreciated!
    m
    • 2
    • 2
  • b

    Big Chungus

    11/07/2022, 10:49 PM
    npm-publish@3.1.0 is out with updated dependencies and gradle configuration cache support.
    🙌 1
  • b

    Big Chungus

    11/19/2022, 3:47 PM
    We've hit 69 stars. Nice!
    🌟 1
  • b

    Big Chungus

    12/15/2022, 11:39 PM
    I've made a sample project for GitHub packges publishing setup in case anyone is not sure how to get that working: https://github.com/mpetuska/npm-publish/tree/master/samples/publish-to-github-packages Happy to make more samples like this to cover other use-cases, just let me know.
  • b

    Big Chungus

    12/29/2022, 11:50 AM
    npm-publish@3.2.0 is out with kotlin 1.8 support and various bugfixes.
    ⚠️ DO NOT UPGRADE IF YOU'RE USING KOTLIN < 1.8.0 ⚠️
  • a

    andylamax

    12/29/2022, 9:25 PM
    What are the reasons that npm-publish@3.2.0 had to ditch all previous versions of kotlin??
    b
    • 2
    • 4
  • b

    Big Chungus

    12/30/2022, 10:28 AM
    Changes in kgp dependency resolution
  • a

    andylamax

    01/23/2023, 2:15 PM
    Hi, I am having problems updating to 3.2.0. I already migrated my project to kotlin 1.8.0, But i get an error like so
    Copy code
    build/tmp/publicPackageJson/package.json (No such file or directory)
    Putting an empty
    package.json
    results also in the error
    Copy code
    Configuration cache state could not be cached: field '__extraDependencies$npm_publish_gradle_plugin__' from type 'dev.petuska.npm.publish.task.NpmAssembleTask': error writing value of type 'org.gradle.api.internal.provider.DefaultListProperty'
    > Cannot invoke "com.google.gson.JsonObject.getAsJsonObject(String)" because "json" is null
    any known workarrounds??
    b
    • 2
    • 4
  • l

    Lynnea Tan

    01/24/2023, 12:51 AM
    Hey folks! I'm trying to use the npm plugin to publish our kmp project to NPM and I was wondering if there was a way to configure the
    publishJsPackageToNpmjsRegistry
    task to not fail a build?
    b
    • 2
    • 3
  • b

    Big Chungus

    02/15/2023, 10:53 PM
    npm-publish@3.2.1 is out 🎉 Not many changes this time around: • Kotlin 1.8.10 • Gradle 7.6 • Removed gson dependency
    🙌 1
  • m

    Mark Vogel

    02/25/2023, 12:56 AM
    I'm having an issue that every time I build I get the error:
    Copy code
    Could not determine the dependencies of task ':multiplatform:assembleJsPackage'.
    > Cannot query the value of this provider because it has no value available.
    I've narrowed it down to
    npmPublish
    , if I remove the plugin the issue goes away (but then I can't do what I need) It seems to possibly has something to do with the
    binaries.library()
    vs
    binaries.executable()
    . Is there something I'm obviously doing wrong? Appreciate the help!
    👀 1
    b
    • 2
    • 9
  • b

    Big Chungus

    03/06/2023, 8:10 AM
    @YentaBot
  • y

    YentaBot

    03/06/2023, 8:10 AM
    Hello! I'm a bot which answers questions based on historical messages in Slack Now that I've been added to this channel, I'll begin reading all the history and you can ask me questions, which I'll try my best to answer. Ask me a question by beginning a message with
    @yentabot
    You can also emoji-react to a message with ❓ or 🤖. Feel free to give me feedback by replying to my answers in a thread or leaving emoji-reacts to my answers.
  • y

    YentaBot

    03/06/2023, 8:11 AM
    Hi! I'm still going through my installation process for your workspace. Give me 60 seconds and ask me again.
  • a

    andylamax

    03/23/2023, 1:37 PM
    @YentaBot how do I publish to a custom npm registry?
    👀 1
    y
    b
    • 3
    • 3
  • a

    andylamax

    04/12/2023, 8:14 AM
    I am not sure if its the plugin or Veddaccio is playing games with me. I have been consistently getting
    Copy code
    npm notice total files:   278                                     
    npm notice 
    npm notice Publishing to <http://aa.bb.cc.dd/>
    npm ERR! code E400
    npm ERR! 400 Bad Request - PUT <http://aa.bb.cc.dd/@picortex%2freact> - unsupported registry call
    
    npm ERR! A complete log of this run can be found in:
    npm ERR!     /home/andylamax/.npm/_logs/2023-04-12T08_12_29_107Z-debug-0.log
    Tried with npm publish 3.2.0 and 3.2.1 all with the same error
    b
    • 2
    • 1
  • b

    Big Chungus

    04/30/2023, 9:18 AM
    npm-publish@3.3.0 is out. This is mainly a maintenance release upgrading tooling versions with a few new features added on top.
    🙌 1
  • r

    Robert Jaros

    05/01/2023, 8:56 AM
    Hi I've upgraded npm-publish to 3.3.0 and my build fails with an error:
    Copy code
    > Task :kvision-assets:publishKvisionAssetsPackageToNpmjsRegistry FAILED
    npm ERR! code EUSAGE
    npm ERR! 
    npm ERR! Publish a package
    npm ERR! 
    npm ERR! Usage:
    npm ERR! npm publish <package-spec>
    npm ERR! 
    npm ERR! Options:
    npm ERR! [--tag <tag>] [--access <restricted|public>] [--dry-run] [--otp <otp>]
    npm ERR! [-w|--workspace <workspace-name> [-w|--workspace <workspace-name> ...]]
    npm ERR! [-ws|--workspaces] [--include-workspace-root]
    npm ERR! 
    npm ERR! Run "npm help publish" for more info
    
    npm ERR! A complete log of this run can be found in:
    npm ERR!     /home/rjaros/.npm/_logs/2023-05-01T08_38_33_017Z-debug-0.log
    
    FAILURE: Build failed with an exception.
    
    * What went wrong:
    Execution failed for task ':kvision-assets:publishKvisionAssetsPackageToNpmjsRegistry'.
    > Process 'command '/opt/rjaros/.gradle/nodejs/node-v18.12.1-linux-x64/bin/node'' finished with non-zero exit value 1
    b
    • 2
    • 5
  • a

    andylamax

    07/09/2023, 10:20 AM
    Hi, I've upgraded to 3.3.1 and my build fails with an error
    Copy code
    Configuration cache state could not be cached: field `__extraDependencies$npm_publish_gradle_plugin__` of task `:picortex-sdk-react:assembleJsPackage` of type `dev.petuska.npm.publish.task.NpmAssembleTask`: error writing value of type 'org.gradle.api.internal.provider.DefaultListProperty'
    > Unable to process file: /media/andylamax/Auxilliary/Workspace/PiCortex/home/picortex/sdk/react/build/tmp/jsPublicPackageJson/package.json
    This all happens during configuration phase (before execution phase)
    b
    • 2
    • 6
  • a

    andylamax

    07/09/2023, 11:00 AM
    Any plans on making npm-publish support configuration cache?? Suprisingly, version 3.2.0 works with warnings
  • b

    Big Chungus

    07/21/2023, 3:17 PM
    npm-publish@3.4.0 is now out with kotlin 1.9 and gradle configuration cache support - enjoy.
    🎉 1
    K 4
    a
    • 2
    • 8
  • m

    Matt Nelson

    12/20/2023, 9:34 PM
    Hey @Big Chungus, is there a way to express in a
    package.json
    that some files within the package are "optional" and able to be excluded (or is that even something that needs to be done)? Looking to achieve the same sort of functionality that Java/Android app's have with the ability to exclude resources (such as android's
    packagingOptions
    gradle dsl). Is this something I need to define in the npm publication's
    package.json
    ? e.g. I publish https://www.npmjs.com/package/kmp-tor-binary-resources?activeTab=code It contains pre-built native binaries for many platforms and architectures. But want to be able to selectively
    exclude
    files within the
    io/matthewnelson/kmp/tor/binary/native
    directory for platforms that my node application won't be running on.
    b
    • 2
    • 8
  • b

    Big Chungus

    12/27/2023, 6:05 PM
    npm-publish@3.4.2 is out with version bumps and esm support patch for KGP < 1.9.10
  • r

    Robert Jaros

    12/29/2023, 9:32 AM
    I had a strange issue with the plugin when changing the
    files {}
    included in the npm module. It seems like the plugin uses some gradle cache, and it always includes the previous set of files in addition to new ones. I've tried cleaning and rebuilding the project without any change. I finally set
    org.gradle.caching=false
    property, rebuild and it worked ok.
    b
    • 2
    • 3
  • l

    Laxystem

    02/12/2024, 8:27 PM
    Is npm-publish only available on GitHub packages? They require you to use a GitHub token, which I would rather not...
    r
    b
    • 3
    • 4
  • l

    Laxystem

    02/12/2024, 8:51 PM
    Question, is npm-publish compatible with Kotlin/WasmJs? Currently, it creates the following error:
    Copy code
    Failed to apply plugin class 'org.gradle.language.base.plugins.LifecycleBasePlugin'.
    > Cannot add task 'assemble' as a task with that name already exists.
    b
    • 2
    • 5
  • r

    Robert Jaros

    01/22/2025, 4:56 PM
    Hello, after upgrading Gradle to 8.12 the plugin doesn't work for me with the following message:
    Copy code
    FAILURE: Build failed with an exception.
    
    * What went wrong:
    A problem was found with the configuration of task ':kilua-assets:assembleAaaKiluaAssetsPackage' (type 'NpmAssembleTask').
      - Method 'action' is private and annotated with @TaskAction.
        
        Reason: Annotations on private methods are ignored.
        
        Possible solutions:
          1. Make the method public.
          2. Annotate the public version of the method.
        
        For more information, please refer to <https://docs.gradle.org/8.12/userguide/validation_problems.html#private_method_must_not_be_annotated> in the Gradle documentation.
    @Big Chungus
    b
    m
    • 3
    • 12
  • r

    Robert Jaros

    04/11/2025, 7:00 AM
    Hello, after migration to Gradle 8.13 and Kotlin 2.1.20 I have this error message with `3.5.3`:
    Copy code
    FAILURE: Build failed with an exception.
    
    * What went wrong:
    Some problems were found with the configuration of task ':kvision-assets:publishZzzKvisionAssetsPackageToNpmjsRegistry' (type 'NpmPublishTask').
      - In plugin 'dev.petuska.npm.publish' type 'dev.petuska.npm.publish.task.NpmPublishTask' property 'node' doesn't have a configured value.
        
        Reason: This property isn't marked as optional and no value has been configured.
        
        Possible solutions:
          1. Assign a value to 'node'.
          2. Mark property 'node' as optional.
        
        For more information, please refer to <https://docs.gradle.org/8.13/userguide/validation_problems.html#value_not_set> in the Gradle documentation.
      - In plugin 'dev.petuska.npm.publish' type 'dev.petuska.npm.publish.task.NpmPublishTask' property 'nodeHome' doesn't have a configured value.
        
        Reason: This property isn't marked as optional and no value has been configured.
        
        Possible solutions:
          1. Assign a value to 'nodeHome'.
          2. Mark property 'nodeHome' as optional.
        
        For more information, please refer to <https://docs.gradle.org/8.13/userguide/validation_problems.html#value_not_set> in the Gradle documentation.
      - In plugin 'dev.petuska.npm.publish' type 'dev.petuska.npm.publish.task.NpmPublishTask' property 'npm' doesn't have a configured value.
        
        Reason: This property isn't marked as optional and no value has been configured.
        
        Possible solutions:
          1. Assign a value to 'npm'.
          2. Mark property 'npm' as optional.
        
        For more information, please refer to <https://docs.gradle.org/8.13/userguide/validation_problems.html#value_not_set> in the Gradle documentation.
    @Big Chungus
  • m

    Márton Matusek

    04/24/2025, 12:17 PM
    Hi Everyone, Is there an official alternative/solution to npm-publish? I saw it is archived now. What is the official way of publishing a Kotlin JS lib as an npm package?