Skip to content
Merged
Show file tree
Hide file tree
Changes from 5 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
60 changes: 60 additions & 0 deletions .github/workflows/composer_build_and_test.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,60 @@
# Copyright 2025 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# https://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

name: Composer build and test

on:
push:
paths:
- 'tools/composer/**'
- '.github/workflows/composer_build_and_test.yml'
pull_request:
paths:
- 'tools/composer/**'
- '.github/workflows/composer_build_and_test.yml'

jobs:
build-and-test:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v4

- name: Install pnpm
uses: pnpm/action-setup@v4
with:
version: 10

- name: Set up Node.js
uses: actions/setup-node@v4
with:
node-version: '20'
cache: 'pnpm'
cache-dependency-path: 'tools/composer/pnpm-lock.yaml'

- name: Install dependencies
working-directory: ./tools/composer
run: pnpm install

- name: Lint
working-directory: ./tools/composer
run: pnpm lint

- name: Build
working-directory: ./tools/composer
run: pnpm build

- name: Test
working-directory: ./tools/composer
run: pnpm test
File renamed without changes.
2 changes: 1 addition & 1 deletion a2ui-composer/AGENTS.md → tools/composer/AGENTS.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# Repository Guidelines

## Build, Test, and Development Commands
Run `pnpm install` once, then `pnpm dev` for the web server (Next.js watches on port 3000). Build artifacts with `pnpm build`;
Run `pnpm install` once, then `pnpm dev` for the web server (Next.js watches on port 3001). Build artifacts with `pnpm build`;

## Coding Style & Naming Conventions
TypeScript and modern React are mandatory; prefer function components and colocate UI logic in `app/components`. Follow Prettier's defaults (two-space indentation, single quotes) by running `pnpm format` before commits. Component files use PascalCase (e.g., `AgentPanel.tsx`); hooks and utilities use camelCase in `*.ts`. The shared ESLint preset (`packages/eslint-config`) enforces `turbo/no-undeclared-env-vars`, so surface new env variables via typed helpers.
Expand Down
27 changes: 24 additions & 3 deletions a2ui-composer/README.md → tools/composer/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,31 @@ Just ask the composer to build you a widget, have it make any changes you want,


## Running the composer
You need a `GEMINI_API_KEY` or `OPENAI_API_KEY` in `apps/widget-builder/.env.local`.
You need a `GOOGLE_GENERATIVE_AI_API_KEY` (or `GEMINI_API_KEY`) or `OPENAI_API_KEY` in a `.env.local` file in this directory.

Then, just install, build, and run!
Example `.env.local`:
```env
GOOGLE_GENERATIVE_AI_API_KEY=your_gemini_api_key_here
# OR
GEMINI_API_KEY=your_gemini_api_key_here
# OR
OPENAI_API_KEY=your_openai_api_key_here
```
pnpm i && pnpm build

Then, just install and run!
```bash
pnpm i
pnpm dev
```

## Testing
To run the tests:
```bash
pnpm test
```

To run tests in watch mode:
```bash
pnpm test:watch
```

File renamed without changes.
File renamed without changes.
File renamed without changes
File renamed without changes.
File renamed without changes.
10 changes: 9 additions & 1 deletion a2ui-composer/package.json → tools/composer/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,8 @@
"build": "next build",
"start": "next start",
"lint": "eslint",
"test": "vitest run",
"test:watch": "vitest",
"format": "prettier --write \"**/*.{ts,tsx,md}\""
},
"dependencies": {
Expand Down Expand Up @@ -37,21 +39,27 @@
"@eslint/js": "^9.34.0",
"@next/eslint-plugin-next": "^15.5.0",
"@tailwindcss/postcss": "^4",
"@testing-library/jest-dom": "^6.9.1",
"@testing-library/react": "^16.3.2",
"@testing-library/user-event": "^14.6.1",
"@types/node": "^20",
"@types/react": "19.2.3",
"@types/react-dom": "19.2.3",
"@types/uuid": "^11.0.0",
"@vitejs/plugin-react": "^5.1.4",
"eslint": "^9.34.0",
"eslint-config-prettier": "^10.1.1",
"eslint-plugin-only-warn": "^1.1.0",
"eslint-plugin-react": "^7.37.5",
"eslint-plugin-react-hooks": "^5.2.0",
"eslint-plugin-turbo": "^2.5.0",
"globals": "^16.3.0",
"jsdom": "^28.1.0",
"prettier": "^3.7.4",
"tailwindcss": "^4",
"tw-animate-css": "^1.4.0",
"typescript": "^5.9.2",
"typescript-eslint": "^8.40.0"
"typescript-eslint": "^8.40.0",
"vitest": "^4.0.18"
}
}
Loading
Loading