@placti/cli
v1.0.18
Published
CLI for building and deploying Placti federated remotes
Downloads
105
Readme
@placti/cli
CLI for building and deploying Placti federated remotes to S3/Garage.
Native Federation and esbuild are bundled — partners only need @placti/cli.
Install
npm i -D @placti/cliFederation config (required)
Create federation-config.json in the project root (FederationConfig: name + exposes):
{
"name": "myPartnerRemote",
"exposes": { "./App": "./src/remote.tsx" },
"shared": {},
"features": { "ignoreUnusedDeps": true }
}name must match remoteConfig.name when the feature is registered on Placti. It becomes the S3/Garage bucket name on deploy.
Commands
placti build-react
placti build-react [--dist ./dist] [--ts-config tsconfig.json]
placti build-react --watch
placti build-react --serve [--port 4202]Reads federation-config.json, runs Native Federation + esbuild, writes dist/remoteEntry.json + chunks.
--watch— rebuild on change (process stays alive)--serve— servedist/over HTTP (implies--watch); use behind a local reverse-proxy that maps/remote/{name}/latest/*to this port
placti deploy
placti deploy \
--release v1.2.3 \
--endpoint https://storage.platform.example.com \
--access-key $PLACTI_ACCESS_KEY \
--secret-key $PLACTI_SECRET_KEYRemote name / bucket come from remoteEntry.json in the dist directory (no --name).
--dist points at the folder that contains remoteEntry.json. React remotes use the default ./dist. Angular CLI output is nested — pass the browser folder:
placti deploy --dist dist/angular-remote/browser --release v1.2.3 ...Versioned releases upload to releases/{release}/ then swap latest/.
Mutable preview channel (does not touch latest/):
placti deploy --release preview ...Wipes preview/ in the bucket and uploads the new dist there. Point a feature URL at /remote/{name}/preview/remoteEntry.json when you want that channel (not wired into Placti seeding by default).
Env equivalents: PLACTI_RELEASE, PLACTI_ENDPOINT, PLACTI_ACCESS_KEY, PLACTI_SECRET_KEY, PLACTI_REGION.
Use --dry-run to validate and preview without uploading.
Programmatic usage
import { buildRemote } from '@placti/cli/build';
import { deploy } from '@placti/cli/deploy';