feat(npm): Add npm package distribution support
Added npm package wrapper to enable installation via npm while maintaining the Deno binary distribution model. New Files: - package.json: npm package configuration with binary wrapper - bin/spark-wrapper.js: Detects platform and executes correct binary - scripts/install-binary.js: Downloads appropriate binary on npm install - .npmignore: Excludes source files from npm package - npmextra.json: npm extra configuration Updated: - readme.md: Added npm installation instructions How It Works: 1. User runs: npm install -g @serve.zone/spark 2. Postinstall script (install-binary.js) downloads the correct pre-compiled binary for the user's platform from Gitea releases 3. Binary is cached in dist/binaries/ 4. Wrapper script (spark-wrapper.js) executes the binary when user runs 'spark' command Supported via npm: - Linux (x64, ARM64) - macOS (Intel, Apple Silicon) - Windows (x64) This maintains the benefits of Deno compilation (no runtime deps) while providing familiar npm-based installation for users who prefer it.
This commit is contained in:
55
.npmignore
Normal file
55
.npmignore
Normal file
@@ -0,0 +1,55 @@
|
||||
# Source code (not needed for binary distribution)
|
||||
/ts/
|
||||
/test/
|
||||
mod.ts
|
||||
*.ts
|
||||
!*.d.ts
|
||||
|
||||
# Development files
|
||||
.git/
|
||||
.gitea/
|
||||
.claude/
|
||||
.serena/
|
||||
.nogit/
|
||||
.github/
|
||||
deno.json
|
||||
deno.lock
|
||||
tsconfig.json
|
||||
|
||||
# Scripts not needed for npm
|
||||
/scripts/compile-all.sh
|
||||
install.sh
|
||||
uninstall.sh
|
||||
test.simple.ts
|
||||
|
||||
# Documentation files not needed for npm package
|
||||
readme.plan.md
|
||||
readme.hints.md
|
||||
npm-publish-instructions.md
|
||||
docs/
|
||||
|
||||
# IDE and editor files
|
||||
.vscode/
|
||||
.idea/
|
||||
*.swp
|
||||
*.swo
|
||||
*~
|
||||
.DS_Store
|
||||
|
||||
# Keep only the install-binary.js in scripts/
|
||||
/scripts/*
|
||||
!/scripts/install-binary.js
|
||||
|
||||
# Exclude all dist directory (binaries will be downloaded during install)
|
||||
/dist/
|
||||
|
||||
# Logs and temporary files
|
||||
*.log
|
||||
npm-debug.log*
|
||||
yarn-debug.log*
|
||||
yarn-error.log*
|
||||
|
||||
# Other
|
||||
node_modules/
|
||||
.env
|
||||
.env.*
|
||||
Reference in New Issue
Block a user