Skip to content

Comments

test: add dist/package.json postbuild test and packaging/CI fixes#6

Merged
selfagency merged 9 commits intomasterfrom
feature/dist-package-postbuild
Feb 22, 2026
Merged

test: add dist/package.json postbuild test and packaging/CI fixes#6
selfagency merged 9 commits intomasterfrom
feature/dist-package-postbuild

Conversation

@selfagency
Copy link
Owner

@selfagency selfagency commented Feb 22, 2026

Summary of changes made in this branch:

  • build: add postbuild script (scripts/write-dist-package.js) that writes a minimal dist/package.json pointing at the bundled ESM/CJS outputs and types (main/module/types/exports). Replaced an earlier .mjs implementation with an ESM .js script.
  • test: add tests/dist-package.test.ts which runs the build and asserts dist/package.json is created with correct fields.
  • chore: add CHANGELOG.md documenting the recent packaging and test changes.
  • ci: switch GitHub Actions CI to use pnpm (pnpm/action-setup@v4) and actions/setup-node@v6 with node 22 and pnpm cache; install with pnpm install --frozen-lockfile and run tests with pnpm test. Specified pnpm version in the action (version: '8').
  • build: run and verify tsup build produced dist/index.js, dist/index.cjs, and typings.
  • src: remove unsupported /u flags from regex literals in src/mappings.ts to avoid TypeScript errors with current target.
  • src: fix runtime interop of windows-1252 by switching to a namespace import in src/index.ts so encode/decode are available under ESM/TS.
  • tests: migrate tests to TypeScript and Vitest; add a robust verifier test that parses the i18nqa UTF-8 debug chart and a committed snapshot tests/fixtures/utf8-debug.html for CI stability.

What I verified locally:

  • All Vitest tests pass.
  • tsup build completes and dist artifacts exist (index.js, index.cjs, index.d.ts).
  • The postbuild script writes a correct dist/package.json and the new test asserts that.
  • CI workflow file updated to use pnpm and includes version: '8' for pnpm/action-setup.

If you'd like I can: update the PR reviewers/assignees, bump package version and prepare a release, or revert any of the changes.

@socket-security
Copy link

socket-security bot commented Feb 22, 2026

Review the following changes in direct dependencies. Learn more about Socket for GitHub.

Diff Package Supply Chain
Security
Vulnerability Quality Maintenance License
Added@​types/​he@​1.2.31001007180100
Addedesbuild@​0.27.3911007390100
Addedvitest@​4.0.18961007999100
Updated@​types/​node@​10.17.21 ⏵ 25.3.010010081 +296 +1100
Updatedwindows-1252@​1.0.0 ⏵ 3.0.497 +210094 -682 +2100
Addedtsup@​8.5.1981009584100
Addedoxfmt@​0.34.0901008996100
Updatedtypescript@​4.2.2 ⏵ 5.9.3100 +110090 -1010090 +10
Addedoxlint@​1.49.0921009196100
Addedoxlint-tsgolint@​0.14.2991009796100

View full report

@socket-security
Copy link

socket-security bot commented Feb 22, 2026

Warning

Review the following alerts detected in dependencies.

According to your organization's Security Policy, it is recommended to resolve "Warn" alerts. Learn more about Socket for GitHub.

Action Severity Alert  (click "▶" to expand/collapse)
Warn High
Obfuscated code: npm oxlint is 97.0% likely obfuscated

Confidence: 0.97

Location: Package overview

From: package.jsonnpm/oxlint@1.49.0

ℹ Read more on: This package | This alert | What is obfuscated code?

Next steps: Take a moment to review the security alert above. Review the linked package source code to understand the potential risk. Ensure the package is not malicious before proceeding. If you're unsure how to proceed, reach out to your security team or ask the Socket team for help at support@socket.dev.

Suggestion: Packages should not obfuscate their code. Consider not using packages with obfuscated code.

Mark the package as acceptable risk. To ignore this alert only in this pull request, reply with the comment @SocketSecurity ignore npm/oxlint@1.49.0. You can also ignore all packages with @SocketSecurity ignore-all. To ignore an alert for all future pull requests, use Socket's Dashboard to change the triage state of this alert.

View full report

@selfagency selfagency marked this pull request as ready for review February 22, 2026 01:40
@selfagency selfagency changed the title test: add dist/package.json postbuild test test: add dist/package.json postbuild test and packaging/CI fixes Feb 22, 2026
@selfagency selfagency merged commit 1faf74a into master Feb 22, 2026
3 checks passed
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.

1 participant