Add @enonic-types/lib-xslt types package #151#152
Open
rymsha wants to merge 1 commit into
Open
Conversation
- 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 Report✅ All modified and coverable lines are covered by tests. 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. 🚀 New features to boost your workflow:
|
There was a problem hiding this comment.
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.tsambient module declaration for/lib/xsltwith a typedrender(view, model)API. - Added
types/package.jsonfor the new@enonic-types/lib-xsltnpm package. - Updated Gradle build and GitHub Actions workflow to assemble
build/typesand 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 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Publishes a TypeScript types package for lib-xslt so consumers get typed access to
/lib/xsltinstead of falling back to@ts-expect-erroron the import (e.g.app-sitemap-xml/src/main/resources/cms/controllers/sitemap/sitemap.ts:16today).Changes
types/index.d.ts— ambient module declaration for/lib/xslt(render(view, model)), signature verified againstsrc/main/resources/lib/xslt.jsand the underlyingXsltService/XsltProcessorJava beans.types/package.json—@enonic-types/lib-xsltmanifest (version substituted at build time).build.gradle—assembleTypesCopy task buildsbuild/typeswithproject.versioninjected;jar.dependsOn assembleTypes(mirrors lib-mustache's pattern; no node build needed for a pure-JS lib).enonic-gradle.yml—npmPublish: trueon build-and-publish +id-token: writefor OIDC trusted publishing.Verified locally:
./gradlew buildgreen;build/types/containsindex.d.ts+package.jsonwith the substituted version (3.1.0-SNAPSHOT).Note: the first publish of a brand-new
@enonic-types/lib-xsltneeds the npm trusted-publisher / package access configured org-side. Depends on enonic/release-tools#71 (publish-only npmPublish) — merged.Closes #151