Skip to content

Fix npm source package missing files and add darwin-x64 binary packages - #1411

Merged
frankslin merged 2 commits into
BYVoid:masterfrom
frankslin:fix-npm-package
Jul 8, 2026
Merged

frankslin merged 2 commits into
BYVoid:masterfrom
frankslin:fix-npm-package

Conversation

@frankslin

Copy link
Copy Markdown
Collaborator

Fix issue #1409: npm install of opencc fell back to a source build on platforms without a prebuilt binary (such as Intel Mac) and failed because the npm tarball was missing files required by the node-gyp build.

claude and others added 2 commits July 8, 2026 12:04
Fix issue BYVoid#1409: npm install of opencc fell back to a source build on
platforms without a prebuilt binary (such as Intel Mac) and failed because
the npm tarball was missing files required by the node-gyp build. Bump npm
packages to 1.4.1; the package-lock.json will be regenerated with integrity
hashes once the platform-specific scoped packages are published at 1.4.1.

Detailed Changes:
- **package.json**:
  - Add missing source files to the "files" whitelist:
    src/ConfigBasedConverter.hpp, src/PipelineConverter.cpp/.hpp,
    src/SingleStageConverter.cpp/.hpp, src/opencc_config_schema.inc.
  - Add @opencc/opencc-darwin-x64 optional dependency; bump versions to 1.4.1.
- **scripts/verify-node-main-package.js**:
  - Verify at prepack that every file in the gyp source list and its
    #include closure is covered by the "files" whitelist, so future source
    files cannot be silently dropped from the tarball again.
  - Expect the new darwin-x64 scoped package.
- **plugins/jieba/node**:
  - Add @opencc/opencc-jieba-darwin-x64 optional dependency and expected
    scoped package; bump versions to 1.4.1.
- **.github/workflows/release-npm-binaries.yml**:
  - Add darwin-x64 (macos-15-intel) matrix entries to both binary publish jobs.
- **.github/workflows/nodejs.yml**:
  - Add pack-source-install job that installs the packed npm tarball with
    --omit=optional on ubuntu / macOS ARM / macOS Intel, forcing the
    node-gyp source build path that issue BYVoid#1409 hit, plus a conversion
    smoke test.
  - Add macos-15-intel to the build-and-test matrix.
- **NEWS.md**: Add 1.4.1 release notes.
Keep the BYVoid#1409 fix (files whitelist, include-closure prepack check, CI
source-build tests) but defer the 1.4.1 release: revert package versions
to 1.4.0, restore package-lock.json, drop the not-yet-published
@opencc/opencc-darwin-x64 and @opencc/opencc-jieba-darwin-x64 optional
dependencies (no 1.4.0 exists on npm, so keeping them would break
npm install) and their verify-script expectations, and remove the 1.4.1
NEWS entry.

Revert this commit when cutting the next release.
@frankslin
frankslin merged commit 00b3ba1 into BYVoid:master Jul 8, 2026
38 checks passed
@frankslin
frankslin deleted the fix-npm-package branch July 8, 2026 19:39
frankslin added a commit that referenced this pull request Jul 8, 2026
…es (#1411)

* Fix npm source package missing files and add darwin-x64 binary packages

Fix issue #1409: npm install of opencc fell back to a source build on
platforms without a prebuilt binary (such as Intel Mac) and failed because
the npm tarball was missing files required by the node-gyp build. Bump npm
packages to 1.4.1; the package-lock.json will be regenerated with integrity
hashes once the platform-specific scoped packages are published at 1.4.1.

Detailed Changes:
- **package.json**:
  - Add missing source files to the "files" whitelist:
    src/ConfigBasedConverter.hpp, src/PipelineConverter.cpp/.hpp,
    src/SingleStageConverter.cpp/.hpp, src/opencc_config_schema.inc.
  - Add @opencc/opencc-darwin-x64 optional dependency; bump versions to 1.4.1.
- **scripts/verify-node-main-package.js**:
  - Verify at prepack that every file in the gyp source list and its
    #include closure is covered by the "files" whitelist, so future source
    files cannot be silently dropped from the tarball again.
  - Expect the new darwin-x64 scoped package.
- **plugins/jieba/node**:
  - Add @opencc/opencc-jieba-darwin-x64 optional dependency and expected
    scoped package; bump versions to 1.4.1.
- **.github/workflows/release-npm-binaries.yml**:
  - Add darwin-x64 (macos-15-intel) matrix entries to both binary publish jobs.
- **.github/workflows/nodejs.yml**:
  - Add pack-source-install job that installs the packed npm tarball with
    --omit=optional on ubuntu / macOS ARM / macOS Intel, forcing the
    node-gyp source build path that issue #1409 hit, plus a conversion
    smoke test.
  - Add macos-15-intel to the build-and-test matrix.
- **NEWS.md**: Add 1.4.1 release notes.

* Temporarily roll back npm version bump to 1.4.0

Keep the #1409 fix (files whitelist, include-closure prepack check, CI
source-build tests) but defer the 1.4.1 release: revert package versions
to 1.4.0, restore package-lock.json, drop the not-yet-published
@opencc/opencc-darwin-x64 and @opencc/opencc-jieba-darwin-x64 optional
dependencies (no 1.4.0 exists on npm, so keeping them would break
npm install) and their verify-script expectations, and remove the 1.4.1
NEWS entry.

Revert this commit when cutting the next release.

---------

Co-authored-by: Claude <noreply@anthropic.com>
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