Skip to content

Comments

Integrate Kotlin multiplatform build with NPM publishing workflow#12

Closed
Copilot wants to merge 4 commits intocopilot/fix-68751953-ec1b-4f7f-baaf-bea86fb34a74from
copilot/fix-2b72f72c-a0f4-4b43-9a99-cdd1eb0ac6cf
Closed

Integrate Kotlin multiplatform build with NPM publishing workflow#12
Copilot wants to merge 4 commits intocopilot/fix-68751953-ec1b-4f7f-baaf-bea86fb34a74from
copilot/fix-2b72f72c-a0f4-4b43-9a99-cdd1eb0ac6cf

Conversation

Copy link
Contributor

Copilot AI commented Sep 29, 2025

This PR integrates the existing Kotlin multiplatform build system with the NPM publishing workflow to ensure proper dependency order and unified CI/CD pipeline.

Problem

The repository has both Kotlin/JS code (compiled to JavaScript for Node.js) and TypeScript NPM packages, but they were built independently. The NPM publish workflow in .github/workflows/publish-npm.yml didn't include the Kotlin build step, meaning the Kotlin core library wasn't being built before the TypeScript packages that depend on it.

Solution

Workflow Integration

Updated both publish and QA workflows to include Kotlin build steps:

  • Added Java 11 setup for Kotlin compilation
  • Integrated ./gradlew jsJar before TypeScript builds
  • Enhanced QA reporting to include Kotlin build and test status
  • Added proper error handling and artifact collection

Build Pipeline

Created unified npm scripts that handle both Kotlin and TypeScript:

npm run build:kotlin  # Builds Kotlin/JS and creates NPM package
npm run build         # Builds entire project (Kotlin + TypeScript)
npm run test:kotlin   # Runs Kotlin/JS tests
npm run test          # Runs all tests (Kotlin + TypeScript)

Publishing Order

Modified the version script to publish packages in proper dependency order:

  1. @litlfred/fmlrunner-core (Kotlin/JS core)
  2. fmlrunner (main TypeScript library)
  3. fmlrunner-rest, fmlrunner-mcp (dependent packages)

Package Configuration

Updated packages/fmlrunner-kotlin-core/package.json to:

  • Build Kotlin/JS output and copy to dist/ folder
  • Configure main entry point to generated JavaScript module
  • Include only necessary files in NPM package

Verification

The integration works correctly as verified by:

# Kotlin package builds successfully
$ npm run build:kotlin
# Generates dist/fmlrunner.js and dependencies

# Publishing dry-run shows correct order
$ npm run publish:dry-run
Publishing fmlrunner-kotlin-core...
Publishing fmlrunner core library...
Publishing fmlrunner-rest...

Benefits

  • Unified Development: Single npm commands control entire project build
  • Automated CI/CD: Kotlin quality checks integrated into existing pipeline
  • Proper Dependencies: Ensures Kotlin core is built before dependent packages
  • Production Ready: Complete integration ready for release workflows

The integration maintains existing developer workflows while adding seamless Kotlin support, ensuring the Kotlin core library is always built and published before the NPM packages that consume it.

Warning

Firewall rules blocked me from connecting to one or more addresses (expand for details)

I tried to connect to the following addresses, but was blocked by firewall rules:

  • scarf.sh
    • Triggering command: node ./report.js (dns block)

If you need me to access, download, or install something from one of these locations, you can either:

Original prompt

This section details on the original issue you should resolve

<issue_title>integrate kotlin and npm build workflows</issue_title>
<issue_description>there is a npm publish workflow
.github/workflows/publish-npm.yml
that should happen after the kotlin node target is built. please propose an integration/workflow plan between them
build off of copilot/fix-68751953-ec1b-4f7f-baaf-bea86fb34a74</issue_description>

Comments on the Issue (you are @copilot in this section)

Fixes #10

✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.

Copilot AI and others added 3 commits September 29, 2025 18:52
Co-authored-by: litlfred <662242+litlfred@users.noreply.github.com>
Co-authored-by: litlfred <662242+litlfred@users.noreply.github.com>
Co-authored-by: litlfred <662242+litlfred@users.noreply.github.com>
Copilot AI changed the title [WIP] integrate kotlin and npm build workflows Integrate Kotlin multiplatform build with NPM publishing workflow Sep 29, 2025
Copilot AI requested a review from litlfred September 29, 2025 19:01
@litlfred
Copy link
Owner

see upstream changes to main for complete move from typescript to kotlin. please update and merge upstream. REMOVE ALL TYPESCRIPT @copilot

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants