- Node.js >= 22.12.0
- pnpm >= 9.9.0
- Git
-
Clone the repository
-
Install dependencies:
pnpm i
-
Build
pnpm run build
-
Run local xyd
XYD_DEV_MODE=1 pnpm run dev
pnpm run dev: Runs the main development build using Lerna watch modepnpm run build: Builds all packagespnpm run clean: Cleans build artifacts
The project uses pnpm workspaces for package management. When adding new dependencies:
-
For package-specific dependencies:
pnpm add <package> --filter <package-name>
-
For workspace dependencies:
pnpm add <package> --filter <package-name> --workspace
The project uses Changesets for version management. To create a new version:
-
Create a new changeset:
pnpm changeset
-
Follow the prompts to select packages and version changes
-
Commit the changeset file
-
Create a new version:
pnpm changeset version
-
Build Issues
- Run
pnpm cleanto clear build artifacts - Ensure all dependencies are installed correctly
- Check for TypeScript errors
- Run
-
Style Development
- If styles aren't updating, try stopping and restarting the dev:styles server
- Check the browser console for any errors
- Ensure the correct packages are being watched
-
Package Dependencies
- If packages aren't linking correctly, try running
pnpm installagain - Check for circular dependencies in package.json files
- If packages aren't linking correctly, try running
- Create a new branch for your feature
- Make your changes
- Run tests and ensure code quality checks pass
- Create a pull request
- Wait for review and approval
Install packages
pnpm i
Clear
./clear.sh
Clear verdaccio
./clear-verdaccio.sh
Start packages development mode
pnpm run dev
Build CLI in dev mode
pnpm run build
Run dev mode for style packages
pnpm run dev:styles
Login to local verdaccio
npm login --registry http://localhost:4873 (test, test)
Install xyd-js cli from verdaccio
npm_config_registry=http://localhost:4873 bun add -g xyd-js
npm_config_registry=http://localhost:4873 npm i -g xyd-js
npm_config_registry=http://localhost:4873 pnpm add -g xyd-js
Build xyd from using verdaccio packages
npm_config_registry=http://localhost:4873 xyd build
Run xyd-js cli in dev mode
XYD_DEV_MODE=1 XYD_NODE_PM=pnpm xyd
npm cache cleaning
rm -rf $HOME/.npm/_cacache
run local xyd cli server
npm_config_registry=http://localhost:4873 xyd
With local npm registry
npm_config_registry=http://localhost:4873 pnpm run test:e2e ./__tests__/e2e/<PATH>
run changeset
changeset
changeset version update
changeset version
changeset pre version
changeset pre enter <RELEASE>
changeset publish
pnpm changeset publish --otp=<OTP_CODE>
npm uninstall -g xyd-js
npm_config_registry=http://localhost:4873 pnpm changeset publish
``
deprecate package
```bash
pnpm deprecate <PACKAGE> "<MESSAGE>"mark package version as latest
npm dist-tag add <PACKAGE>@<VERSION> latestXYD_DEV_MODE=1 - Enable dev modeFor developing documentation locally without building the CLI package:
-
First, build project:
pnpm run build
-
Run the development server directly:
node packages/xyd-cli/dist/index.js
Important: The working directory (CWD) when running the development server must be the directory where your documentation files are located. For example, if your docs are in
docs/, you should run the command from that directory:cd docs node packages/xyd-cli/dist/index.js
This approach is equivalent to running xyd dev but allows for better integration with the development environment, especially for Hot Module Replacement (HMR) when making changes to styles or components.
When developing documents, you can use the following environment flags:
XYD_DEV_MODE=1: Enables development modeXYD_VERBOSE=1: Enables verbose output and debug loggingXYD_NODE_PM=pnpm|bun|npm: Specifies which package manager to use (auto-detects if not set)