mirror of
https://github.com/wu736139669/hapi.git
synced 2026-08-07 06:52:28 +00:00
feat: add npx/bunx binary distribution support
Adds infrastructure for distributing Hapi via npm as a scoped package
(@twsxtd/hapi) with platform-specific optional dependencies. This enables
installation via `npx @twsxtd/hapi` or `bunx @twsxtd/hapi`.
- Add bin/hapi.js wrapper script for platform detection and binary selection
- Create npm/ directory structure for platform-specific packages (darwin-{arm64,x64},
linux-{arm64,x64}, win32-x64)
- Add scripts/prepare-npm-packages.ts to generate platform-specific package.json files
and copy binaries to npm packages
- Add scripts/publish-npm.ts for automated publishing of platform packages
- Update package.json with new scoped name, bin entry, optionalDependencies, and
prepack/publish scripts
- Update .gitignore to ignore generated npm packages and build outputs
- Update .npmignore to only include bin/hapi.js wrapper, excluding source and build files
This commit is contained in:
+25
-5
@@ -1,6 +1,26 @@
|
||||
# Exclude unpacked binaries from npm package
|
||||
tools/unpacked/
|
||||
# npm package only needs bin/hapi.js (defined in package.json "files" field)
|
||||
# This file is kept for documentation purposes
|
||||
|
||||
# Keep these for npm package
|
||||
# tools/archives/
|
||||
# tools/licenses/
|
||||
# Source code (not needed - binary distribution)
|
||||
src/
|
||||
scripts/
|
||||
tools/
|
||||
demo-project/
|
||||
|
||||
# Build outputs
|
||||
dist-exe/
|
||||
npm/
|
||||
|
||||
# Config files
|
||||
*.md
|
||||
!README.md
|
||||
.github/
|
||||
.release-it.*
|
||||
bunfig.toml
|
||||
tsconfig.json
|
||||
.env*
|
||||
|
||||
# Test files
|
||||
**/*.test.ts
|
||||
**/__fixtures__/
|
||||
**/__tests__/
|
||||
|
||||
Reference in New Issue
Block a user