|
|
||
|---|---|---|
| scripts | ||
| src | ||
| tests | ||
| .gitignore | ||
| CHANGELOG.md | ||
| LICENSE | ||
| package.json | ||
| README.md | ||
| tsconfig.build.json | ||
| tsconfig.json | ||
Introduction
This package contains common TypeScript utilities and types used across the Vode App codebase.
Table of Contents
Quick Start
# remove dist/ and tsconfig.build.tsbuildinfo
bun run clean
# remove dist/ only
bun run clean:dist
# remove tsconfig.build.tsbuildinfo only
bun run clean:tsbuildinfo
# compile + bundle
bun run build
# run tests
bun run tests
# run src/dev.ts in watch mode
bun run dev
Publish - see Publish.
Documentation
<DOCUMENTATION>
Asset Resolution
<!-- Remove this section if the library has no runtime assets. Replace @scope/lib-name throughout with the actual package name. -->
Assets are placed under assets/@scope/lib-name/ (scoped to the package name to prevent collisions). They are resolved at runtime via import.meta.url and loaded with fetch() (browser) or readFile (Node). assets/ must be listed in files in package.json.
import.meta.url is reliable when the library is loaded as a discrete module (from CDN or node_modules/). When the consumer bundles the library, they must copy the assets — see below.
For consumers bundling this library
Copy node_modules/@scope/lib-name/assets/ into your build output alongside the bundle, preserving the relative path. No code configuration is required — only the file copy.
DevOps
Change Management
- Create a new branch for the change.
- Make the changes and commit.
- Bump the version in
package.json. - Add an entry for the new version in
CHANGELOG.md. - Pull request the branch.
- After merge, run
bun run build. - Publish.
Publish
See the following sources to configure the target registry and authentication.
⚠️ Package Scope and the authentication for the target registry must be aligned.
npmjs.org
Publish to the public npm registry.
# authenticate
npm login
# publish
bun publish --registry https://registry.npmjs.org/ --access public
Custom registry
# placeholder:
# <SCOPE_WITHOUT_AT: <SCOPE_WITHOUT_AT>
# <REGISTRY_URL: <REGISTRY_URL>
# <BUN_PUBLISH_AUTH_TOKEN: <BUN_PUBLISH_AUTH_TOKEN>
~/.bunfig.toml or bunfig.toml:
[install.scopes]
"<SCOPE_WITHOUT_AT>" = { url = "<REGISTRY_URL>", token = "$BUN_PUBLISH_AUTH_TOKEN" }
# authenticate
$env:BUN_PUBLISH_AUTH_TOKEN = "<BUN_PUBLISH_AUTH_TOKEN>"
# publish
bun publish