Fix npm publish failures from Deno/TypeScript import incompatibility#64
Merged
kayodebristol merged 9 commits intomainfrom Jan 26, 2026
Merged
Fix npm publish failures from Deno/TypeScript import incompatibility#64kayodebristol merged 9 commits intomainfrom
kayodebristol merged 9 commits intomainfrom
Conversation
Co-authored-by: kayodebristol <3579196+kayodebristol@users.noreply.github.com>
Co-authored-by: kayodebristol <3579196+kayodebristol@users.noreply.github.com>
Co-authored-by: kayodebristol <3579196+kayodebristol@users.noreply.github.com>
Co-authored-by: kayodebristol <3579196+kayodebristol@users.noreply.github.com>
Co-authored-by: kayodebristol <3579196+kayodebristol@users.noreply.github.com>
Copilot
AI
changed the title
[WIP] Fix publish to NPM errors and implement tests for validation
Fix npm publish failures from Deno/TypeScript import incompatibility
Jan 26, 2026
Contributor
There was a problem hiding this comment.
Pull request overview
This PR fixes npm publish failures caused by incompatibility between Deno's requirement for .ts extensions in imports and TypeScript's prohibition of them in compiled files. The solution uses Deno's --sloppy-imports flag to enable Node.js-style module resolution.
Changes:
- Added
--sloppy-importsflag to the test command to allow Deno to resolve extensionless imports - Created a comprehensive pre-publish validation script that checks TypeScript compilation, Deno type-checking, required files, tests, and package size
- Integrated validation into the CI/CD release workflow to prevent publish failures
- Added detailed documentation explaining the problem, solution, and troubleshooting steps
Reviewed changes
Copilot reviewed 4 out of 4 changed files in this pull request and generated 3 comments.
| File | Description |
|---|---|
| package.json | Added --sloppy-imports to test command and new validate-publish script |
| scripts/validate-npm-publish.js | New validation script with comprehensive pre-publish checks for npm packages |
| .github/workflows/release.yml | Added validation step before npm publish in release workflow |
| docs/NPM_PUBLISH_VALIDATION.md | Documentation explaining the dual-ecosystem import issue and validation system |
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: kayodebristol <3579196+kayodebristol@users.noreply.github.com>
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.
Fix Publish to NPM errors and implement test to validate publish to NPM before release
Summary
This PR fixes TypeScript import errors preventing npm publishing and implements a comprehensive pre-publish validation system with robust error handling and cross-platform compatibility.
Problem
The npm publish workflow failed with:
Root cause: Conflict between TypeScript (Node.js) and Deno import conventions:
.tsextensions in imports.tsextensions by defaultnpm publish, tests run with Deno and fail on missing extensionsSolution
1. Fixed Deno Type-Checking ✅
File:
package.json--sloppy-importsflag tonpm testcommand2. Created Pre-Publish Validation Script ✅
File:
scripts/validate-npm-publish.jsFeatures:
Validations:
--sloppy-imports) on all tsconfig.json filesError Handling (based on code review):
path.delimiterDeno Type Checking Coverage:
Usage:
npm run validate-publish3. Updated Release Workflow ✅
File:
.github/workflows/release.yml4. Comprehensive Documentation ✅
File:
docs/NPM_PUBLISH_VALIDATION.mdCode Review Improvements
All feedback addressed:
path.delimiterfor PATH manipulationTesting
--sloppy-importsFiles Changed
package.json- Added--sloppy-importsandvalidate-publishscriptscripts/validate-npm-publish.js- New validation script.github/workflows/release.yml- Added validation stepdocs/NPM_PUBLISH_VALIDATION.md- New documentationImpact
Original prompt
💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.