Skip to content
Merged
Show file tree
Hide file tree
Changes from all 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
2 changes: 1 addition & 1 deletion .github/workflows/deploy-demo-preview-smart.yml
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,7 @@ jobs:
DEPLOY_PATH: ag-grid-react-components-pr-${{ github.event.pull_request.number }}
run: |
# Generate version info
node scripts/generate-version-info.js
node scripts/build/generate-version-info.js

# Build demo
PR_NUMBER=${{ github.event.pull_request.number }}
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/deploy-demo-preview.yml
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ jobs:
DEPLOY_PATH: ag-grid-react-components-pr-${{ github.event.pull_request.number }}
run: |
# Generate version info
node scripts/generate-version-info.js
node scripts/build/generate-version-info.js

# Build demo
PR_NUMBER=${{ github.event.pull_request.number }}
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/deploy-demo.yml
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ jobs:
VITE_BASE_PATH: /ag-grid-react-components/
run: |
# Generate version info
node scripts/generate-version-info.js
node scripts/build/generate-version-info.js

# Build demo
npm run build:demo
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/update-stackblitz-examples.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ jobs:
run: npm ci

- name: Generate examples
run: node scripts/create-stackblitz-examples.js
run: node scripts/build/create-stackblitz-examples.js

- name: Commit and push if changed
run: |
Expand Down
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -147,3 +147,6 @@ COALESCE_LABS_*.md
CLEANUP_*.md
R2_CLEANUP_*.md
test-framework-*.mdEXPOSED-CREDENTIALS-PRIVATE.txt

# Scripts archive (preserved but not in version control)
scripts-archive/
36 changes: 13 additions & 23 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,11 +13,11 @@
"scripts": {
"// Development": "Development commands",
"dev": "concurrently \"npm run frontend\" \"npm run api\"",
"frontend": "node scripts/generate-version-info.js && vite",
"frontend": "node scripts/build/generate-version-info.js && vite",
"api": "wrangler dev api/index.js --local --port 8787",
"demo": "node scripts/generate-version-info.js && vite",
"demo": "node scripts/build/generate-version-info.js && vite",
"build": "tsc -p tsconfig.build.json && vite build",
"build:demo": "node scripts/generate-version-info.js && vite build --config vite.config.demo.ts",
"build:demo": "node scripts/build/generate-version-info.js && vite build --config vite.config.demo.ts",
"preview": "vite preview",
"preview:demo": "vite preview --config vite.config.demo.ts",
"dev:safe": "npm run quality && npm run dev",
Expand All @@ -30,9 +30,9 @@
"test:e2e:ui": "playwright test --ui",
"test:e2e:debug": "playwright test --debug",
"test:e2e:headed": "playwright test --headed",
"test:browser": "node ./scripts/validate-demo.js",
"test:thorough": "node ./scripts/thorough-demo-check.js",
"test:filter-click": "node ./scripts/test-filter-click.js",
"test:browser": "node ./scripts/dev/validate-demo.js",
"test:thorough": "node ./scripts/dev/thorough-demo-check.js",
"test:filter-click": "node ./scripts/dev/test-filter-click.js",
"test:file": "vitest run",
"coverage:report": "npm run test:coverage && open coverage/index.html",
"// Code Quality": "Linting and formatting via Trunk",
Expand All @@ -46,31 +46,21 @@
"check": "trunk check --no-fix && npm run typecheck",
"quality": "trunk check --no-fix && npm run check:whitespace",
"pre-commit": "trunk fmt && npm run fix:whitespace && trunk check --fix && npm run typecheck && npm run check:codeql",
"pre-push": "./scripts/pre-push.sh",
"pre-push:quick": "./scripts/pre-push-quick.sh",
"check:codeql": "node scripts/check-codeql.js",
"check:whitespace": "./scripts/check-whitespace.sh",
"fix:whitespace": "./scripts/fix-whitespace.sh",
"pre-push": "./scripts/dev/pre-push.sh",
"pre-push:quick": "./scripts/dev/pre-push-quick.sh",
"check:codeql": "node scripts/quality/check-codeql.js",
"check:whitespace": "./scripts/quality/check-whitespace.sh",
"fix:whitespace": "./scripts/quality/fix-whitespace.sh",
"// Legacy commands": "Direct tool commands (prefer Trunk)",
"lint:direct": "eslint . --ext ts,tsx --report-unused-disable-directives --max-warnings 0",
"format:direct": "prettier --write .",
"// Utilities": "Helper commands",
"clean": "rm -rf dist coverage .parcel-cache playwright-report test-results",
"fresh": "npm run clean && npm install && npm run build",
"run-tsx": "node ./scripts/run-tsx.js",
"run-tsx": "node ./scripts/utils/run-tsx.js",
"bundle-size": "npm run build && echo '📦 Bundle Size:' && du -sh dist/* | sort -h",
"cleanup:pr-deployments": "node scripts/cleanup-merged-pr-deployments.js",
"// Project Management": "GitHub issues and project sync",
"bootstrap:project": "./scripts/bootstrap-all.sh",
"sync:labels": "node scripts/add-missing-labels.js",
"sync:project": "node scripts/bootstrap-project-sync.js",
"sync:project:all": "node scripts/bootstrap-project-sync-all.js",
"sync:pr-labels": "node scripts/sync-pr-labels-from-issues.js",
"sync:issue-status": "node scripts/sync-issue-status.js",
"// Project Management (archived)": "Scripts moved to scripts-archive/bot-automation/",
"// Milestone Management": "Release planning and tracking",
"milestone:create": "node scripts/create-milestone.js",
"milestone:assign": "node scripts/assign-to-milestone.js",
"milestone:overview": "node scripts/milestone-overview.js",
"milestone:list": "gh milestone list",
"// Git & Release": "Version control and publishing",
"commit": "cz",
Expand Down
154 changes: 76 additions & 78 deletions scripts/README.md
Original file line number Diff line number Diff line change
@@ -1,105 +1,103 @@
# Project Management Scripts
# Scripts Directory

This directory contains scripts for managing GitHub issues and project synchronization.
This directory contains scripts essential for the development and maintenance of ag-grid-react-components.

## 🚀 Quick Start
## Directory Structure

To bootstrap everything at once:
```
scripts/
├── dev/ # Development utilities
├── quality/ # Code quality tools
├── build/ # Build and release utilities
├── release/ # Release management
└── utils/ # Shared utilities
```

```bash
npm run bootstrap:project
```text
## Scripts by Category

Or run the shell script directly:
### Development Scripts (`/dev`)

```bash
./scripts/bootstrap-all.sh
```text
| Script | Purpose | Usage |
|--------|---------|-------|
| `pre-push.sh` | Comprehensive pre-push validation | Automatically run by git pre-push hook |
| `pre-push-quick.sh` | Quick pre-push validation (skips tests) | `npm run pre-push:quick` |
| `validate-demo.js` | Validates demo functionality | `npm run test:browser` |
| `thorough-demo-check.js` | Comprehensive demo validation | `npm run test:thorough` |
| `test-filter-click.js` | Tests filter click functionality | `npm run test:filter-click` |

## 📜 Available Scripts
### Code Quality Scripts (`/quality`)

### bootstrap-all.sh
Complete bootstrap that runs all scripts in the correct order:
1. Adds missing required labels to issues
2. Syncs project fields to issue labels
3. Triggers GitHub Actions for final sync
| Script | Purpose | Usage |
|--------|---------|-------|
| `check-whitespace.sh` | Checks for whitespace issues | `npm run check:whitespace` |
| `fix-whitespace.sh` | Fixes whitespace issues | `npm run fix:whitespace` |
| `check-codeql.js` | Validates CodeQL configuration | `npm run check:codeql` |
| `check-fonts.js` | Checks font usage in code blocks | Direct execution |
| `test-code-block-fonts.js` | Tests font rendering in code blocks | Direct execution |

### add-missing-labels.js
Ensures all issues have required labels:
- Adds default type label if missing (enhancement)
- Adds default priority label if missing (medium)
- Adds default area label if missing (components)
- Adds default status label if missing (needs-triage)
### Build Scripts (`/build`)

```bash
node scripts/add-missing-labels.js
```text
| Script | Purpose | Usage |
|--------|---------|-------|
| `generate-version-info.js` | Generates version info for demos | Automatically run during build |
| `generate-og-image.js` | Generates Open Graph images | Direct execution |
| `publish-local.sh` | Publishes package locally for testing | Direct execution |

### bootstrap-project-sync.js
Syncs all project field values to issue labels:
- Reads current project field values
- Updates issue labels to match
- Removes conflicting labels
- Handles all field types (Priority, Area, Type, Component, Status)
### Release Scripts (`/release`)

```bash
node scripts/bootstrap-project-sync.js
```text
| Script | Purpose | Usage |
|--------|---------|-------|
| `bump-version.js` | Bumps package version | Part of release workflow |
| `generate-changelog.js` | Generates changelog entries | Part of release workflow |
| `prepare-release.js` | Prepares release artifacts | Part of release workflow |

## 🔄 How Sync Works
### Utility Scripts (`/utils`)

1. **Project → Labels**: When you change a field in the project, labels update automatically
2. **Labels → Project**: When you change labels on an issue, project fields update automatically
3. **Bidirectional**: Changes in either place stay synchronized
| Script | Purpose | Usage |
|--------|---------|-------|
| `run-tsx.js` | Runs TypeScript files directly | `npm run run-tsx <file>` |
| `loader.js` | TypeScript loader for Node.js | Used by run-tsx.js |
| `ensure-project-root.mjs` | Ensures scripts run from project root | Imported by other scripts |

## 📋 Label Categories
## Script Requirements

### Required Labels (one from each)
- **Type**: bug, enhancement, documentation, question
- **Priority**: priority: critical/high/medium/low
- **Area**: area: components/demo/build/ci-cd/testing/docs
### Environment Variables

### Optional Labels
- **Status**: status: needs-triage/triaging/backlog/in-progress/in-review/done
- **Component**: component: date-filter/quick-filter-dropdown/active-filters/etc
Most scripts don't require environment variables, but some GitHub-related scripts (now archived) required:
- `GITHUB_TOKEN`: For GitHub API access
- `NODE_ENV`: Development/production environment

## 🛠️ Troubleshooting
### Dependencies

### "Command not found" error
Make sure you have Node.js installed and the GitHub CLI:
```bash
# Install GitHub CLI
brew install gh
Scripts assume the following tools are installed:
- Node.js (v18+)
- npm (v10+)
- Git
- GitHub CLI (`gh`) for release scripts

# Authenticate
gh auth login
```text
## Best Practices

### "GraphQL request failed" error
Your GitHub token might not have the right permissions:
```bash
# Check current auth status
gh auth status
1. **Always run scripts from project root**: Most scripts use `ensure-project-root.mjs` to enforce this
2. **Use npm scripts when available**: Prefer `npm run <script>` over direct execution
3. **Check script headers**: Each script has a header comment explaining its purpose
4. **Test locally first**: Especially for scripts that modify files or interact with GitHub

# Re-authenticate with proper scopes
gh auth login --scopes "repo,project"
```
## Archived Scripts

Many scripts have been moved to `scripts-archive/` (git-ignored) for historical reference:

### Issues not updating
1. Check that the issue is in the project
2. Verify field values are set in the project
3. Run `gh issue view <number>` to see current labels
- **Bot Automation** (`scripts-archive/bot-automation/`): GitHub project sync, bot workflows
- **One-Time Scripts** (`scripts-archive/one-time/`): Setup scripts, migrations, fixes

## 🤖 Automation
These scripts are preserved but not actively maintained. If you need functionality from an archived script, consider if it should be restored and updated.

After bootstrap, the system maintains itself:
- GitHub Actions run every 5 minutes
- Changes sync automatically
- Manual trigger available in Actions tab
## Adding New Scripts

## 📊 Monitoring
When adding new scripts:

View sync status:
- [GitHub Actions]([https://github.com/ryanrozich/ag-grid-react-components/action](https://github.com/ryanrozich/ag-grid-react-components/action)s)
- [Project Board]([https://github.com/users/ryanrozich/projects/](https://github.com/users/ryanrozich/projects/)1)
- [Issues List]([https://github.com/ryanrozich/ag-grid-react-components/issue](https://github.com/ryanrozich/ag-grid-react-components/issue)s)
1. Place in the appropriate subdirectory
2. Add a header comment with purpose and usage
3. Update this README
4. Consider if it needs to be added to package.json
5. Use `ensure-project-root.mjs` for scripts that modify files
6. Follow existing patterns for error handling and logging
98 changes: 0 additions & 98 deletions scripts/add-missing-labels.js

This file was deleted.

Loading
Loading