Skip to content

Add @enonic-types/lib-xslt types package #151#152

Open
rymsha wants to merge 1 commit into
masterfrom
add-types-package-151
Open

Add @enonic-types/lib-xslt types package #151#152
rymsha wants to merge 1 commit into
masterfrom
add-types-package-151

Conversation

@rymsha

@rymsha rymsha commented Jul 1, 2026

Copy link
Copy Markdown
Contributor

Publishes a TypeScript types package for lib-xslt so consumers get typed access to /lib/xslt instead of falling back to @ts-expect-error on the import (e.g. app-sitemap-xml/src/main/resources/cms/controllers/sitemap/sitemap.ts:16 today).

Changes

  • types/index.d.ts — ambient module declaration for /lib/xslt (render(view, model)), signature verified against src/main/resources/lib/xslt.js and the underlying XsltService/XsltProcessor Java beans.
  • types/package.json@enonic-types/lib-xslt manifest (version substituted at build time).
  • build.gradleassembleTypes Copy task builds build/types with project.version injected; jar.dependsOn assembleTypes (mirrors lib-mustache's pattern; no node build needed for a pure-JS lib).
  • enonic-gradle.ymlnpmPublish: true on build-and-publish + id-token: write for OIDC trusted publishing.

Verified locally: ./gradlew build green; build/types/ contains index.d.ts + package.json with the substituted version (3.1.0-SNAPSHOT).

Note: the first publish of a brand-new @enonic-types/lib-xslt needs the npm trusted-publisher / package access configured org-side. Depends on enonic/release-tools#71 (publish-only npmPublish) — merged.

Closes #151

- types/index.d.ts: ambient module declaration for /lib/xslt
  (render(view, model)), typed against the real API.
- types/package.json: @enonic-types/lib-xslt manifest with version
  substituted at build time.
- build.gradle: assembleTypes Copy task produces build/types with
  project.version injected; jar.dependsOn assembleTypes.
- enonic-gradle.yml: npmPublish: true on build-and-publish +
  id-token: write for OIDC trusted publishing.

Closes #151
@codecov

codecov Bot commented Jul 1, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 74.82%. Comparing base (5286ab2) to head (ed8b5d0).

Additional details and impacted files
@@            Coverage Diff            @@
##             master     #152   +/-   ##
=========================================
  Coverage     74.82%   74.82%           
  Complexity       86       86           
=========================================
  Files            19       19           
  Lines           294      294           
  Branches         16       16           
=========================================
  Hits            220      220           
  Misses           70       70           
  Partials          4        4           

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR adds and publishes a dedicated TypeScript types package (@enonic-types/lib-xslt) so TypeScript consumers can import /lib/xslt with proper typing support, and updates the build + CI workflow to assemble and publish those types via npm trusted publishing.

Changes:

  • Added types/index.d.ts ambient module declaration for /lib/xslt with a typed render(view, model) API.
  • Added types/package.json for the new @enonic-types/lib-xslt npm package.
  • Updated Gradle build and GitHub Actions workflow to assemble build/types and enable npm publishing via OIDC.

Reviewed changes

Copilot reviewed 2 out of 4 changed files in this pull request and generated 1 comment.

File Description
types/package.json Defines the @enonic-types/lib-xslt npm types package metadata and dependency on @enonic-types/core.
types/index.d.ts Provides the ambient TypeScript module declaration for /lib/xslt.
build.gradle Adds an assembleTypes task to produce build/types and wires it into the build.
.github/workflows/enonic-gradle.yml Enables npm publishing and adds workflow permissions for OIDC trusted publishing.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment on lines +5 to +7
permissions:
id-token: write # Required for npm OIDC / trusted publishing
contents: write
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.

Create @enonic-types/lib-xslt types package

2 participants