diff --git a/.coderocket/source-manifest.json b/.coderocket/source-manifest.json index 332cfa6..264b93e 100644 --- a/.coderocket/source-manifest.json +++ b/.coderocket/source-manifest.json @@ -186,8 +186,10 @@ "packages/shared/src/registry-client.ts": "7df530f7e387cae02e65507f988f2a160c022718b1de14216e3f9cd3287c5567", "packages/cli/src/files.test.ts": "ef55cd1907caef21617c3038f7595172ad93401d890008949e2ab8eb02e2fb27", "packages/cli/src/files.ts": "985404aecfd7403888dec08e6f6ec898a69e488cd9f6ad2f4cbd6da8ea551806", - "packages/cli/src/index.ts": "76fcf339068da0e60347dce5f99292b88071c2764d12554afe067ad80a69f156", - "packages/mcp/src/index.ts": "4a0e87c85e7ac474e71e0120c2cdbac0c25e245b17161c66cff5ff1b40fbab7f", + "packages/cli/src/index.test.ts": "15987d857544a0654f12c18467c7c07c012ac8e0e7e603aa2aed44f98c85bf91", + "packages/cli/src/index.ts": "823f11f2ce5db9b89d7a56fe6e378440834d219c5a1c428aada07a2b79e08eb0", + "packages/mcp/src/index.test.ts": "80ab79875a2579115e3df6aeb6447831cd9ff2d065b7e58073cc2e21108a5c46", + "packages/mcp/src/index.ts": "bda52fa0962ff739426257fd831c2d648bfac8c3af72ef712b06c042d3d4dcc0", "packages/vue/preview/block-showcase.vue": "71bd423249576933dc04c3b88d7d7ab683c3b7b45dd5923ccf4a1a4e4c736ba4", "packages/vue/preview/entry.ts": "1b74ad013b28aa28d56a523edc8858af0085e76ad19c9ffa59a06b1543fbe0c6", "packages/vue/preview/examples.json": "9e5c96ceb122644ea94d34f818cdbf918d61e274c93cf25e6db3a18d70bccf79", @@ -197,8 +199,8 @@ "packages/vue/preview/showcase.test.ts": "65f5e46ebe8a6ca5508708c56ff16007f59cb31079a77f6f9e63df000b4e19f9", "packages/vue/preview/showcase.vue": "ab827ab0bd679b20d471d7064f743a00ebc8b0653e6defbbc82a442472b1f701", "docs/content/accessibility.mdx": "eb103c3bf4d03d3228d92defd5c71ea3d9ffb9fe91650fe27c14eca1e9efbbc5", - "docs/content/agents.mdx": "787d99787b6c6661dfe0c610c6da35957ee6a8dd4fdd5cca2ea80ce15f7fc5ee", - "docs/content/ai.mdx": "4ff4571a20ef220f19e125079853bb662337ae1c2dc9bd3589abd442ad654432", + "docs/content/agents.mdx": "75e96e3072695bb77060585f3dc90eae2b27b2e2d02cf60e9e34e10412f1a169", + "docs/content/ai.mdx": "6bbd0e7c211cb1f936b2f841d757806a550959a4e42f210097af627c9be0491c", "docs/content/blocks/api-keys.mdx": "1ccd554b28e71c818ad944226481628fa91b36ca2123aedc12a0a75b2e068306", "docs/content/blocks/app-header.mdx": "3ecb688f9b9b1ae0439e618f7cb3b76cb06862431c10c1fd401077702224546f", "docs/content/blocks/app-sidebar.mdx": "0263d60a4bb97e5b94b0c7dccf06d38134d2bb43fedf7944d2fcecff7abfbd59", @@ -279,8 +281,8 @@ "docs/content/components/toggle.mdx": "84fa1c518a88ff9e1276683d0073732686de3271885166033213da6fde1710f1", "docs/content/components/tooltip.mdx": "60693d1382c7f60021540f7ae989c5c84908777d61a357c3fe12dce96c412d9d", "docs/content/design-system.mdx": "08f98c614b81a9af0ebee612c7b011595804c13e7dd384470f9f144d9b24d7a6", - "docs/content/export.mdx": "765c2cb32bdca829913e6ef2c73decacce65744dcea661fc2bfc80e81612a1a0", - "docs/content/getting-started.mdx": "6506ddcecdfeb0dbad1c6c1454e6ff12950f07f09389ba1263bbf5c487db5ab0", + "docs/content/export.mdx": "812cc600e0b8f3ebd86dc93804130aa86fde0a6f3af9fb423ac39c6b1c98aff5", + "docs/content/getting-started.mdx": "b87890737c224ce7d317e931482134046b36b6aa179084fd60be06e03aaff38a", "docs/content/index.mdx": "ae34072fe5ead79b535bf786b2b389cb19bb9527402859d5182eeda4167d583d", "docs/content/meta.json": "251ece32eefc965e5a7b5aa64d4ac4e8903faa34eba63a9fef6facb4260daa57", "docs/content/pilot.mdx": "f3dc4791ae9a65ec640675871fe145422e6cc43cbd55c001d4e72b3e72341b9b", @@ -362,7 +364,7 @@ "docs/content/vue/components/toggle-group.mdx": "ef2059f704eac0a8f9a2e7a52a4f893b98e934897e2fd63cef21bdf1bd78e304", "docs/content/vue/components/toggle.mdx": "35df5e29a740a08d4fbc73a77e378c8708bfe3f0b5825c16a1decc22895ed49c", "docs/content/vue/components/tooltip.mdx": "894c79463d30026a04d50ac0c14adacd3161c5f7a2b8aaa5d17fc63d79691a8e", - "docs/content/vue/index.mdx": "3c4a1f898aff460de1d328448d8b648dec3d5b718997a6bef3e1ac58e6d05ff3", + "docs/content/vue/index.mdx": "f5e2b4fcc0a2831e3dacbb90e2f5443fe1993bb86a287dfa4e55976b3780a7aa", "docs/content/vue/meta.json": "71d940394ad01e98fc20342dfb2b439b5b43346a6f01a83186280e60dac8060c" } } diff --git a/.github/workflows/check.yml b/.github/workflows/check.yml index 124b828..87c0647 100644 --- a/.github/workflows/check.yml +++ b/.github/workflows/check.yml @@ -9,9 +9,14 @@ on: permissions: contents: read +concurrency: + group: public-core-${{ github.ref }} + cancel-in-progress: true + jobs: check: runs-on: ubuntu-latest + timeout-minutes: 20 steps: - uses: actions/checkout@v7 - uses: pnpm/action-setup@v6 @@ -22,5 +27,5 @@ jobs: - run: pnpm install --frozen-lockfile - run: pnpm check -# Publication is intentionally not automated. The historical datepicker release -# workflows are archived under legacy/, outside GitHub's active workflow directory. +# npm clients are released independently through publish-clients.yml. +# Legacy datepicker workflows remain archived under legacy/. diff --git a/.github/workflows/publish-clients.yml b/.github/workflows/publish-clients.yml new file mode 100644 index 0000000..9872a1a --- /dev/null +++ b/.github/workflows/publish-clients.yml @@ -0,0 +1,38 @@ +name: Publish npm clients + +on: + push: + tags: ["clients-v*"] + +permissions: + contents: read + +concurrency: + group: npm-clients + cancel-in-progress: false + +jobs: + publish: + runs-on: ubuntu-latest + timeout-minutes: 20 + permissions: + contents: read + id-token: write + steps: + - uses: actions/checkout@v7 + with: + fetch-depth: 0 + - uses: pnpm/action-setup@v6 + - uses: actions/setup-node@v7 + with: + node-version: "24" + registry-url: "https://registry.npmjs.org" + package-manager-cache: false + - name: Verify release tag and main ancestry + run: | + git merge-base --is-ancestor HEAD origin/main + node --input-type=module -e 'import {readFileSync} from "node:fs"; const version=process.env.GITHUB_REF_NAME.replace(/^clients-v/, ""); if (!/^\d+\.\d+\.\d+$/.test(version)) throw new Error("Use a stable clients-vX.Y.Z tag"); for (const name of ["cli", "mcp"]) if (JSON.parse(readFileSync(`packages/${name}/package.json`)).version !== version) throw new Error("Tag must match both client versions");' + - run: pnpm install --frozen-lockfile + - run: pnpm check + - name: Publish with npm trusted publishing + run: node tooling/publish-clients.mjs diff --git a/.gitignore b/.gitignore index aa8498d..739a396 100644 --- a/.gitignore +++ b/.gitignore @@ -13,3 +13,5 @@ coverage/ **/.vitepress/cache/ **/.vitepress/dist/ *.tsbuildinfo + +.release/ diff --git a/README.md b/README.md index f6053d4..1442a0a 100644 --- a/README.md +++ b/README.md @@ -1,10 +1,30 @@ -# CodeRocket UI — React and Vue component libraries +

+ + CodeRocket UI + +

+ +

CodeRocket UI

+ +

React and Vue components. Your design system. Source you own.

+ +

+ CLI on npm + MCP on npm + Public core checks + MIT license +

+ +

+ Open Studio · + React docs · + Vue docs · + Coding agents +

**Build a component library that looks like your product, with design rules your coding agents can use.** -CodeRocket UI combines **48 components and 26 interface blocks for both React and Vue**, a typed design-system model, and CLI/MCP integrations. Start from accessible primitives, customize shared tokens, and keep editable source in your application. The core is **MIT licensed**, written in **TypeScript**, and works **with or without Tailwind**. - -[Try the visual builder](https://ui.coderocket.app) · [React documentation](https://ui.coderocket.app/docs/components) · [Vue documentation](https://ui.coderocket.app/docs/vue/components) · [Request Pro access](https://ui.coderocket.app/contact?intent=pro) +CodeRocket UI combines React and Vue components, interface blocks, a typed design-system model, and CLI/MCP integrations. Start from accessible primitives, customize shared tokens, and keep editable source in your application. The open-source core is **MIT licensed**, written in **TypeScript**, and works **with or without Tailwind**. ## Two frameworks, one design system @@ -12,28 +32,57 @@ React uses Base UI. Vue uses native Vue single-file components and Reka UI. Both Use the components directly from this source workspace, or use the [hosted Studio](https://ui.coderocket.app/studio) to customize a library visually, review AI proposals and export its source. An account or AI provider is **not required** to use the open-source components locally. Svelte and SolidJS are planned, without announced release dates. +## Start with your own library + +1. Open [Studio](https://ui.coderocket.app/studio) and create a React or Vue library. +2. Customize its tokens, components and blocks. AI assistance is optional. +3. Save, then **Export** a ZIP or use **Connect** to install the source through the CLI. + +Exported components run locally without a CodeRocket connection. Follow the [React installation guide](https://ui.coderocket.app/docs/export) or [Vue and Nuxt guide](https://ui.coderocket.app/docs/vue) for dependencies and styles. + +### Install and update source with the CLI + +The CLI is available on npm as [`@coderocketapp/cli`](https://www.npmjs.com/package/@coderocketapp/cli). In Studio, open your saved library's **Connect** dialog and create a scoped connection token. Set `CODEROCKET_LIBRARY` and `CODEROCKET_TOKEN` in your environment, then run these commands from your application directory: + +```sh +npx @coderocketapp/cli@latest init +npx @coderocketapp/cli@latest list +npx @coderocketapp/cli@latest add button +npx @coderocketapp/cli@latest sync +``` + +The library selects React or Vue source automatically. `sync` preserves local changes and puts conflicting updates aside for review. Keep connection tokens out of version control. See the [CLI guide](packages/cli/README.md) for blocks, complete-library installation and local import analysis. + +### Give coding agents the same design rules + +[`@coderocketapp/mcp`](https://www.npmjs.com/package/@coderocketapp/mcp) exposes a saved library's design rules, components and blocks through a read-only MCP server. Follow the [MCP setup guide](packages/mcp/README.md) to connect a compatible coding agent. + +The CLI and MCP need no AI provider key. Agents can also use the [public Markdown documentation](docs/content), typed specifications and exported `AGENTS.md`. Review generated source before applying it to your application. + ## What is open source? | Package | What it provides | | --------------------------------------- | -------------------------------------------------------------------------------------------- | -| [`@coderocket/react`](packages/react) | 48 React components, Base UI primitives, compiled CSS and a composition renderer. | -| [`@coderocket/blocks`](packages/blocks) | 26 React interface blocks with typed application callbacks. | -| [`@coderocket/vue`](packages/vue) | 48 Vue components and 26 Vue blocks, Reka UI primitives, CSS and a composition renderer. | +| [`@coderocket/react`](packages/react) | React components, Base UI primitives, compiled CSS and a composition renderer. | +| [`@coderocket/blocks`](packages/blocks) | React interface blocks with typed application callbacks. | +| [`@coderocket/vue`](packages/vue) | Vue components and blocks, Reka UI primitives, CSS and a composition renderer. | | [`@coderocket/engine`](packages/engine) | Versioned design-system model, token validation, theme generation and reviewed token import. | | [`@coderocket/specs`](packages/specs) | Shared catalogue specifications and validated composition schemas. | | [`@coderocket/shared`](packages/shared) | Types and a read-only registry client for the integration tools. | -| [`@coderocket/cli`](packages/cli) | Local import analysis and installation/sync from a saved library, preserving local changes. | -| [`@coderocket/mcp`](packages/mcp) | A read-only MCP server exposing a saved library's rules and component sources. | +| [`@coderocketapp/cli`](packages/cli) | Local import analysis and installation/sync from a saved library, preserving local changes. | +| [`@coderocketapp/mcp`](packages/mcp) | A read-only MCP server exposing a saved library's rules and component sources. | + +**CLI and MCP are distributed on npm.** The component and model packages remain source workspaces: build them locally, or use Studio exports and the CLI to install editable component source. The `@coderocket/react` and `@coderocket/vue` workspace names do not imply npm availability. The [documentation source](docs/content) is public too. It is rendered at [ui.coderocket.app/docs](https://ui.coderocket.app/docs) by the separately maintained website. The hosted Studio, accounts, database, AI-provider integration and commercial operations remain private. Authentication, payments, email delivery and uploads are not bundled component backends: blocks expose callbacks for your own application. The CLI's registry commands and MCP need a saved library and scoped connection token, or a compatible registry server. -The catalogue is experimental. Review accessibility, behavior and framework integration in your application's context before release. +The catalogue is experimental during early access. Review accessibility, behavior and framework integration in your application's context before release. ## Build from source -Use Node.js 24+ and pnpm 12.4.2. **This is a source distribution**: workspace package names do not imply a public npm release. +Use the Node.js and pnpm versions declared in [`package.json`](package.json): ```sh git clone https://github.com/elreco/coderocket-ui.git @@ -44,7 +93,7 @@ pnpm check The checks validate and build the workspace and run its tests without contacting the Studio or an AI provider. The legacy datepicker is outside this pnpm workspace. -### React +### React workspace consumer Add `@coderocket/react` as a `workspace:*` dependency in a pnpm workspace consumer. Import its compiled styles once: @@ -61,7 +110,7 @@ export function App() { } ``` -### Vue +### Vue workspace consumer Add `@coderocket/vue` as a `workspace:*` dependency in a Vue workspace consumer: @@ -76,25 +125,19 @@ import "@coderocket/vue/styles.css"; ``` -See [development and integration](docs/DEVELOPMENT.md) for consumer dependencies, styles and framework differences. React 19.3 / Base UI 1.8 and Vue 3.5 / Reka UI 2.10 are the versions used by this source release. - -### Coding agents, CLI and MCP - -After building, run `node packages/cli/dist/index.mjs --help`. Follow the [CLI guide](packages/cli/README.md) for installation and sync, or the [MCP guide](packages/mcp/README.md) to expose a saved library to a compatible coding agent. The library's framework determines the returned source. No Gemini or other AI provider key is required by these clients. - -[Markdown documentation](docs/content), typed specifications and a read-only MCP interface help agents use the same components and design rules as developers. Generated source still needs review before application. +See [development and integration](docs/DEVELOPMENT.md) for consumer dependencies, styles and framework differences. ## From Vue Tailwind Datepicker This is the same repository, with its stars, issues and Git history. CodeRocket UI is its active successor; it is **not a drop-in replacement** for the old datepicker API. -**Vue Tailwind Datepicker is frozen and no longer maintained.** Its npm package, `@coderocketapp/vue-tailwind-datepicker`, remains available. Its source, original MIT attribution, changelog and documentation are preserved in [`legacy/vue-tailwind-datepicker`](legacy/vue-tailwind-datepicker). Existing applications can continue using their installed version; no automatic migration is required. No further legacy fixes or releases are planned. +**Vue Tailwind Datepicker is frozen and no longer maintained.** Its npm package, [`@coderocketapp/vue-tailwind-datepicker`](https://www.npmjs.com/package/@coderocketapp/vue-tailwind-datepicker), remains available. Its source, original MIT attribution, changelog and documentation are preserved in [`legacy/vue-tailwind-datepicker`](legacy/vue-tailwind-datepicker). Existing applications can continue using their installed version; no automatic migration is required. No further legacy fixes or releases are planned. For new work, explore the [Vue DatePicker](https://ui.coderocket.app/docs/vue/components/date-picker) or [React DatePicker](https://ui.coderocket.app/docs/components/date-picker). Read the [transition announcement](ANNOUNCEMENT.md) and [legacy documentation](https://vue-tailwind-datepicker.com) before migrating. ## Hosted access and Pro -The hosted editor, component catalogue and source export are free. Signed-in accounts receive **5 trial AI generations in total**. Pro adds **100 AI generations per UTC calendar month** during an agreed paid period, subject to the shared service limit. Price, payment and activation are arranged personally; there is no automatic billing or renewal. Manual editing and export remain usable without AI allowance. +The hosted editor, component catalogue and source export are free. AI assistance has usage limits; see [current access and allowances](https://ui.coderocket.app/docs/pilot). Pro price, payment and activation are arranged personally, with no automatic billing or renewal. Manual editing and export remain usable without AI allowance. [Request Pro or integration help](https://ui.coderocket.app/contact?intent=pro), or read [how access works](https://ui.coderocket.app/docs/pilot). Submitting a request does not charge you or activate paid access. GitHub stars and historical datepicker use are not permission for sales outreach. diff --git a/THIRD_PARTY_NOTICES.md b/THIRD_PARTY_NOTICES.md index b667880..292fb61 100644 --- a/THIRD_PARTY_NOTICES.md +++ b/THIRD_PARTY_NOTICES.md @@ -4,6 +4,6 @@ The active CodeRocket UI packages and public documentation are licensed under th The historical Vue Tailwind Datepicker source keeps its original [MIT license and Kenhyuwa attribution](legacy/vue-tailwind-datepicker/LICENSE). Moving that source does not remove or replace its license. Its original dependency manifests and lockfiles are preserved alongside it. -Third-party dependencies retain their own licenses. The active source uses React, React DOM, Base UI, Vue, Reka UI, Lucide, Zod and the Model Context Protocol SDK, among others. Dependency implementations are obtained through the package manager and are not relicensed by this repository. The public library build keeps runtime dependencies external. +Third-party dependencies retain their own licenses. The active source uses React, React DOM, Base UI, Vue, Reka UI, Lucide, Zod and the Model Context Protocol SDK, among others. Dependency implementations are obtained through the package manager and are not relicensed by this repository. The public library build keeps runtime dependencies external. The npm CLI and MCP clients bundle their runtime dependencies; each archive includes their full license texts in `THIRD_PARTY_NOTICES.md`. Documentation examples and interface blocks do not provide hosted authentication, billing or storage services. The hosted CodeRocket UI application is maintained separately and is not licensed by this repository's MIT license. diff --git a/docs/DEVELOPMENT.md b/docs/DEVELOPMENT.md index 6c522f1..b11d1c8 100644 --- a/docs/DEVELOPMENT.md +++ b/docs/DEVELOPMENT.md @@ -2,7 +2,7 @@ ## Build and test -Use Node.js 24+ and pnpm 12.4.2: +Use the Node.js and pnpm versions declared in [`package.json`](../package.json): ```sh pnpm install --frozen-lockfile @@ -13,7 +13,7 @@ pnpm check The build emits ES modules, TypeScript declarations and CSS. React entries retain the client boundary for frameworks such as Next.js. Vue single-file components are compiled for consumers. Runtime dependencies remain external. Tests cover date values, model validation, composition, framework behavior and the CLI's filesystem protection. -These are source workspaces, not an announcement of npm availability. Add a consumer inside this pnpm workspace with `workspace:*` dependencies, or build and package the required dependencies locally. The hosted Studio also exports standalone source you can copy into an existing application. +The component and model packages are source workspaces. Add a consumer inside this pnpm workspace with `workspace:*` dependencies, or build and package the required dependencies locally. The hosted Studio also exports standalone source you can copy into an existing application. The integration clients are distributed separately on npm as `@coderocketapp/cli` and `@coderocketapp/mcp`; see their [CLI](../packages/cli/README.md) and [MCP](../packages/mcp/README.md) guides. ## A local React consumer diff --git a/docs/RELEASING.md b/docs/RELEASING.md new file mode 100644 index 0000000..53c0acb --- /dev/null +++ b/docs/RELEASING.md @@ -0,0 +1,46 @@ +# Releasing CLI and MCP clients + +The public npm packages are `@coderocketapp/cli` and `@coderocketapp/mcp`. +The internal `@coderocket/*` manifests stay private to prevent accidentally +publishing source workspace dependencies. `pnpm clients:pack` builds standalone +public packages into `.release/`, with metadata, executable code and licenses only. + +## Validate a release + +1. Update `version` in both `packages/cli/package.json` and `packages/mcp/package.json` + to the same next version. Keep the Studio copies in sync. +2. Update the client READMEs for changed commands. Installation examples use + `@latest`; badges read their versions from npm. +3. Run `pnpm check`. This includes installation of both real archives in a clean + temporary application, CLI installation/sync conflict checks and an MCP session. +4. Review and merge the release into `main`. +5. Tag that commit `clients-vX.Y.Z`, using the version from the manifests, and push + that tag. The `Publish npm clients` workflow checks the tag, rebuilds, tests and + publishes both packages with provenance through npm trusted publishing. + +Publication is versioned independently from the legacy datepicker and does not +publish the hosted Studio or its server code. A retry verifies the integrity of any +already published version and skips it only when its bytes match exactly. + +## First publication and npm authentication + +Each package requires an npm trusted publisher for `elreco/coderocket-ui`, workflow +`publish-clients.yml`, with direct publishing allowed. No long-lived npm token is +stored in GitHub. Creating this relationship requires npm account authentication. +New package names must be published once before configuring their trusted publisher. + +After `pnpm clients:pack && pnpm clients:check`, a maintainer with npm write access +can publish the exact archives listed in `.release/manifest.json` using +`npm publish .release/ --access public --ignore-scripts` and complete npm's +interactive authentication. Then configure each package: + +```sh +npm trust github @coderocketapp/cli --repo elreco/coderocket-ui --file publish-clients.yml --allow-publish +npm trust github @coderocketapp/mcp --repo elreco/coderocket-ui --file publish-clients.yml --allow-publish +``` + +Verify package versions and install from npm in a fresh application before updating +production installation instructions. Future releases use the tag workflow. +Published versions are immutable: fix an issue in a new version instead of deleting +an existing release. The CLI's old quality-gate release remains accessible by its +original version; new releases provide CodeRocket UI library installation. diff --git a/docs/assets/brand/coderocket-mark.svg b/docs/assets/brand/coderocket-mark.svg new file mode 100644 index 0000000..5671d62 --- /dev/null +++ b/docs/assets/brand/coderocket-mark.svg @@ -0,0 +1,7 @@ + + + + + + + diff --git a/docs/content/agents.mdx b/docs/content/agents.mdx index bbff94a..7b264f5 100644 --- a/docs/content/agents.mdx +++ b/docs/content/agents.mdx @@ -5,30 +5,49 @@ description: Connect your project and give your coding agent the same components You can work entirely from an exported ZIP. Use a connection when you want your terminal or coding agent to read the latest saved version of a library. +The [MIT-licensed component source](https://github.com/elreco/coderocket-ui) is available without a CodeRocket account. The hosted registry used by the CLI and MCP requires an account, a saved library and a connection token. Installed source runs locally without a connection. + ## Create a connection 1. Save the library in the editor, then open **Connect**. 2. Name the connection for the machine or agent that will use it. -3. Choose **Create read-only connection** and copy the token shown once. +3. Choose **Create connection** and copy the token shown once. 4. Copy the generated setup commands or MCP configuration into your development environment. A connection can read only its library. It expires after 90 days and can be revoked from the same dialog. Put its token in your terminal or agent's protected environment; keep it out of source files, prompts and public URLs. ## Install with the CLI -The **Connect** dialog provides the CLI archive URL and complete commands for your library. Its commands use `npm exec --package -- coderocket …`, so a global installation is unnecessary. The table below abbreviates that prefix; use the full command from **Connect** and replace only its final arguments. +With **Node.js 24 or newer** installed, run the official npm package from your application folder. Copy your library ID from **Connect** and provide the token in your terminal environment: + +In bash or zsh, paste your connection token at the hidden prompt and press Enter: + +```bash +printf "Connection token: " +read -rs CODEROCKET_TOKEN +export CODEROCKET_TOKEN +printf "\n" +npx @coderocketapp/cli@latest init YOUR_LIBRARY_ID +npx @coderocketapp/cli@latest add button dialog +``` + +The CLI remembers the library in `.coderocket/manifest.json`; it never writes the token to project files. Keep `CODEROCKET_TOKEN` available for later commands, including in new terminals. You can instead set `CODEROCKET_LIBRARY` and run `npx @coderocketapp/cli@latest init` without a positional ID. No global installation is required. -| Command | Result | -| ------------------------------ | ---------------------------------------------------------- | -| `coderocket init` | Connect the current project to a saved library | -| `coderocket add button dialog` | Install the named components and required shared files | -| `coderocket add block-login` | Install a complete block | -| `coderocket add --all` | Install the full catalogue | -| `coderocket sync` | Update unchanged local files from the latest saved version | -| `coderocket import` | Write a local analysis report for importing project tokens | +| Command | Result | +| ------------------------------------------------- | ---------------------------------------------------------- | +| `npx @coderocketapp/cli@latest list` | List available components and blocks | +| `npx @coderocketapp/cli@latest add button dialog` | Install named components and their required shared files | +| `npx @coderocketapp/cli@latest add block-login` | Install a complete block | +| `npx @coderocketapp/cli@latest add --all` | Install the full catalogue | +| `npx @coderocketapp/cli@latest sync` | Update installed items from the latest saved version | +| `npx @coderocketapp/cli@latest import` | Write a local analysis report for importing project tokens | Install the listed runtime dependencies and import the generated styles once. See [export and installation](/docs/export) for React/Next.js, or [Vue and Nuxt setup](/docs/vue). The connection reads the framework from your saved library and serves the matching source and dependencies. +Commit `.coderocket/manifest.json` and `.coderocket/lock.json` with the installed source. The CLI writes integration instructions and agent rules to `.coderocket/README.md` and `.coderocket/AGENTS.md`. The `import` command analyzes local files without uploading them and does not require a token. + +`CODEROCKET_SERVER` defaults to `https://ui.coderocket.app`. If you use a different Studio deployment, set its origin in the environment before `init` and keep it set for subsequent commands. **Connect** includes that variable when needed. + ### Your local edits stay yours The CLI compares file hashes before applying an update. If it finds a local edit or deletion, it stops the installation and writes the proposed changes into a `.coderocket/review-*` folder. Review and merge those changes in your codebase; the CLI does not silently replace your work. @@ -39,7 +58,7 @@ Save changes in the editor before syncing. A connection reads saved versions, no Vue libraries use the CodeRocket CLI or MCP above. The instructions below target React projects. -Open **Connect → Use the shadcn registry** and copy the registry entry into your existing `components.json`. The configuration uses an authorization header from your environment to keep the library private. +Open **Connect → shadcn registry** and copy the registry entry into your existing `components.json`. The configuration uses an authorization header from your environment to keep the library private. You can then install a component through your configured registry: @@ -51,7 +70,24 @@ The local-change protection described above belongs to the CodeRocket CLI. When ## Connect an agent with MCP -Open **Connect → Connect a coding agent with MCP**. Copy the configuration to a compatible MCP client, storing the token in its protected environment settings. +Open **Connect → Coding agents · MCP** to copy the configuration for your saved library. Use Node.js 24 or newer and an MCP client that supports local stdio servers: + +```json +{ + "mcpServers": { + "coderocket": { + "command": "npx", + "args": ["-y", "@coderocketapp/mcp@latest"], + "env": { + "CODEROCKET_LIBRARY": "YOUR_LIBRARY_ID", + "CODEROCKET_TOKEN": "YOUR_CONNECTION_TOKEN" + } + } + } +} +``` + +Replace the placeholders in your client's private configuration and keep it outside version control. If the client has protected secret settings, provide `CODEROCKET_TOKEN` there and remove its entry from the JSON. Restart or reconnect the MCP server after configuration. The token is passed to the server as an environment variable. The connector gives your agent read access to: @@ -62,6 +98,8 @@ The connector gives your agent read access to: For example, you can ask an agent to “build a settings form using this library's input, select and button components.” The agent has the source and design context it needs to reuse your library. Design changes still happen in the editor, where you review and save them. +The MCP server reads the library; your agent uses its own tools and permissions to edit your application. If the token expires or is revoked, create a new connection for the same library, update the environment and reconnect. + ## Include your design rules Every source export includes `AGENTS.md` with the library's conventions. It asks agents to reuse existing controls, consume semantic tokens, and preserve keyboard and focus behavior. diff --git a/docs/content/ai.mdx b/docs/content/ai.mdx index 6c70c76..16414b0 100644 --- a/docs/content/ai.mdx +++ b/docs/content/ai.mdx @@ -42,3 +42,11 @@ The schema, tree and labels are checked before the preview. The editor then runs Accepted compositions include their structured specification, editable React or Vue source, an SSR smoke test and a Storybook story in the ZIP export. Connect the exported stories to your application's Storybook theme decorator. Run the tests and accessibility checks in that application before promoting an experimental component to production. The current generator assembles validated primitives. It does not execute arbitrary generated JavaScript or invent application backends. Unsupported behavior requires clarification and implementation in your own action callbacks. + +## Use your library with a coding agent + +To give your coding agent the saved design rules and catalogue, open **Connect → Coding agents · MCP**. The official npm server runs with `npx -y @coderocketapp/mcp@latest` and requires Node.js 24 or newer. Set `CODEROCKET_LIBRARY` and `CODEROCKET_TOKEN` in the MCP client's environment, using the library-scoped connection created in the Studio. Keep tokens out of prompts and source files. [Copy the complete MCP configuration](/docs/agents#connect-an-agent-with-mcp). + +The MCP server provides read-only access to the saved library. Your agent can fetch source and use its own tools to integrate it into your app. Save Studio changes before requesting an updated design. To install and sync from a terminal, use `npx @coderocketapp/cli@latest init YOUR_LIBRARY_ID` with the token in your environment, then `add` or `sync` as shown in the [CLI guide](/docs/agents#install-with-the-cli). + +Hosted connections require an account and a saved library. The public documentation and [MIT-licensed component source](https://github.com/elreco/coderocket-ui) can be used with an assistant without an account or connection token. diff --git a/docs/content/export.mdx b/docs/content/export.mdx index 8f1b434..85acc4e 100644 --- a/docs/content/export.mdx +++ b/docs/content/export.mdx @@ -7,6 +7,25 @@ Your export contains the components, blocks and theme from your saved library. T Vue libraries export native `.vue` components, Vue-specific CLI/MCP rules and the same theme files. Follow [Vue and Nuxt installation](/docs/vue). The React setup below applies to React libraries. +## Install through npm + +For ongoing updates, use the official CLI with Node.js 24 or newer. Save your library and create a token in **Connect**, then run these commands from your application folder with the library ID shown there: + +In bash or zsh, paste your connection token at the hidden prompt and press Enter: + +```bash +printf "Connection token: " +read -rs CODEROCKET_TOKEN +export CODEROCKET_TOKEN +printf "\n" +npx @coderocketapp/cli@latest init YOUR_LIBRARY_ID +npx @coderocketapp/cli@latest add button dialog +``` + +The CLI writes source and styles into your application and prints the runtime dependencies to install. Use `npx @coderocketapp/cli@latest list` to browse items and `npx @coderocketapp/cli@latest sync` after saving design changes. Keep the token in your environment. See [CLI and coding agents](/docs/agents) for local-edit protection, blocks and MCP setup. + +Hosted registry access needs an account, a saved library and its token. The [MIT-licensed component source](https://github.com/elreco/coderocket-ui) can be used without an account. The ZIP workflow below is also available for a saved Studio library. + ## Download Save your library and select **Export**. The archive includes: diff --git a/docs/content/getting-started.mdx b/docs/content/getting-started.mdx index f1a151e..7729a4e 100644 --- a/docs/content/getting-started.mdx +++ b/docs/content/getting-started.mdx @@ -7,6 +7,8 @@ For Vue, follow the [Vue setup guide](/docs/vue); the Studio workflow and AI too This walkthrough uses a React library called **Acme UI**. You can complete the design manually; AI is optional. +You can use the [MIT-licensed component source](https://github.com/elreco/coderocket-ui) without an account. This walkthrough uses the hosted Studio to save a customized library and install it through its private registry, which requires an account and a library connection token. + ## 1. Create your library [Create an account](/signup), confirm your email address, then open the editor. Your libraries are private to your account. @@ -42,15 +44,24 @@ Select **Save** to store the current design. **Version history** lets you restor If another session has changed the library, saving reports a conflict. Reload and inspect the newer version before continuing. -## 5. Export and render a component +## 5. Install and render a component + +Save any pending changes, then open **Connect** and choose **Create connection**. Copy the token shown once. With Node.js 24 or newer installed, run the official CLI from your application's folder using the library ID shown in **Connect**: -Save any pending changes, then choose **Export** and download the ZIP. Copy its `components/` and `styles/` folders into your React app, and install the runtime dependencies: +In bash or zsh, paste your connection token at the hidden prompt and press Enter: ```bash -npm install react@19.3.0 react-dom@19.3.0 @base-ui/react@1.8.0 lucide-react@1.47.0 +printf "Connection token: " +read -rs CODEROCKET_TOKEN +export CODEROCKET_TOKEN +printf "\n" +npx @coderocketapp/cli@latest init YOUR_LIBRARY_ID +npx @coderocketapp/cli@latest add button ``` -React and React DOM must use matching versions. Calendar and DatePicker require React 19.2 or newer; the current library is tested with 19.3. Lucide is used by the calendar, datepicker and blocks. +Keep your token in the terminal environment, outside source and version control. The CLI remembers the library ID in `.coderocket/manifest.json` and prints the required runtime dependencies; install those in your app. React and React DOM must use matching versions. See [CLI and coding agents](/docs/agents) for configuration and token renewal. + +You can also choose **Export** and copy the ZIP's `components/` and `styles/` folders into your app. Follow [export and installation](/docs/export) for that setup. Import the compiled styles once, then use the source directly: @@ -71,6 +82,16 @@ export default function App() { Your button uses the saved Acme UI theme. It renders from local source and CSS. Connect its `onClick` callback to your application when you add behavior. +Keep `CODEROCKET_TOKEN` set when using the CLI again. List available items, add more components, or save a new design in the Studio and sync it: + +```bash +npx @coderocketapp/cli@latest list +npx @coderocketapp/cli@latest add dialog +npx @coderocketapp/cli@latest sync +``` + +The CLI preserves locally edited files and places conflicting updates in a review folder. +