@arcote.tech/arc-cli
v0.4.7
Published
CLI tool for Arc framework
Downloads
385
Readme
@arcote.tech/cli
CLI tool for Arc framework.
Installation
bun install -g @arcote.tech/cliOr use it directly with npx:
npx @arcote.tech/cli devUsage
Development Mode
Run the development mode to watch and build your Arc packages:
arc devThis will:
- Find all
arc.config.tsfiles in your workspace - Generate client-specific TypeScript definitions based on the clients specified in the config
- Build each client using Bun with the appropriate define constants
- Watch for changes and rebuild automatically
- Generate TypeScript declaration files
Configuration
Create an arc.config.json file in your package:
{
"file": "index.ts",
"outDir": "dist",
"clients": ["browser", "mobile app", "server", "api"]
}The CLI will generate the following constants for each client:
BROWSER(true/false)NOT_ON_BROWSER(true/false)ONLY_BROWSER(true/false)
And similarly for other clients, with spaces converted to underscores:
MOBILE_APPNOT_ON_MOBILE_APPONLY_MOBILE_APP- etc.
These constants can be used in your code to conditionally include or exclude code for specific clients:
export const myFeature = context().pipe([
NOT_ON_BROWSER && myBrowserSpecificFeature,
API_ONLY && myApiOnlyFeature,
]);