@thewhateverapp/whateverpack-cli
v0.3.1
Published
CLI tool for staging whateverpack bundler with custom dependencies
Maintainers
Readme
@thewhateverapp/whateverpack-cli
CLI tool for staging whateverpack bundler with custom dependencies tied to the main repo's git hash.
Installation
# Global installation
npm install -g @thewhateverapp/whateverpack-cli
# Or use with npx
npx @thewhateverapp/whateverpack-cliUsage
Stage Command
Build and upload whateverpack to R2 with current git hash:
# From main repo root
whateverpack stage
# With custom options
whateverpack stage --hash abc123 --production
whateverpack stage --dry-runOptions:
-h, --hash <hash>- Override git hash (defaults to current commit)-p, --production- Upload to production path (default: staging)-m, --manifest-path <path>- Path to .whateverpack.json (default: .whateverpack.json)-w, --whateverpack-path <path>- Path to whateverpack repository-b, --bucket <bucket>- R2 bucket name (default: static)-d, --dry-run- Perform a dry run without uploading
Output:
Bundler URL: https://static.thewhatever.app/whateverpack/staging/{hash}/bundler/index.html
Manifest URL: https://static.thewhatever.app/whateverpack/staging/{hash}/manifest.jsonValidate Command
Validate .whateverpack.json manifest:
whateverpack validate
whateverpack validate --manifest-path custom-manifest.jsonManifest Format
Create a .whateverpack.json file in your repo root:
{
"version": "1.0.0",
"dependencies": {
"react": "^18.2.0",
"react-dom": "^18.2.0",
"framer-motion": "^10.16.0",
"lucide-react": "^0.468.0",
"@thewhateverapp/tile-sdk": "latest",
"@thewhateverapp/platform": "latest"
},
"vendor": {
"core": {
"priority": 0,
"lazy": false,
"packages": ["react", "react-dom", "react-dom/client", "react/jsx-runtime"]
},
"sdk": {
"priority": 1,
"lazy": false,
"packages": ["@thewhateverapp/tile-sdk", "@thewhateverapp/platform"]
},
"ui": {
"priority": 2,
"lazy": true,
"packages": ["framer-motion", "lucide-react"]
}
}
}Fields:
version- Manifest version (optional, default: "1.0.0")dependencies- NPM packages and versions to bundlevendor- Vendor bundle groups (optional, will use defaults if not specified)
Vendor Groups:
priority- Loading order (0 = first)lazy- Load on-demand (true) or eagerly (false)packages- List of package names to include in this group
Environment Variables
WHATEVERPACK_STATIC_BUCKET- R2 bucket name for uploads (default: static)WHATEVERPACK_BUNDLER_URL- Override bundler URL for testingWHATEVERPACK_MANIFEST_URL- Override manifest URL for testing
Workflow
- Update dependencies in
.whateverpack.json - Stage the build:
whateverpack stage - Test with tile-preview:
export WHATEVERPACK_BUNDLER_URL="https://static.thewhatever.app/whateverpack/staging/{hash}/bundler/index.html" export WHATEVERPACK_MANIFEST_URL="https://static.thewhatever.app/whateverpack/staging/{hash}/manifest.json" - Promote to production:
whateverpack stage --production - Commit changes to main repo
License
PROPRIETARY
