Skip to content

Commit 0c81951

Browse files
ryanrozichclaude
andcommitted
chore: reorganize and clean up scripts directory
- Reorganized scripts into logical subdirectories: - dev/ - Development utilities (pre-push, demo validation) - quality/ - Code quality tools (whitespace, codeql, fonts) - build/ - Build utilities (version info, og-image, stackblitz) - release/ - Release management scripts - utils/ - Shared utilities (run-tsx, ensure-project-root) - Archived unused scripts to scripts-archive/ (git-ignored): - bot-automation/ - GitHub project sync and bot workflows - one-time/ - Setup scripts, migrations, and fixes - Updated all script references in: - package.json npm scripts - GitHub workflows - Created comprehensive scripts/README.md documenting all scripts - Removed duplicate scripts and consolidated functionality 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <noreply@anthropic.com>
1 parent c6a2b74 commit 0c81951

File tree

92 files changed

+110
-11029
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

92 files changed

+110
-11029
lines changed

.github/workflows/deploy-demo-preview-smart.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -104,7 +104,7 @@ jobs:
104104
DEPLOY_PATH: ag-grid-react-components-pr-${{ github.event.pull_request.number }}
105105
run: |
106106
# Generate version info
107-
node scripts/generate-version-info.js
107+
node scripts/build/generate-version-info.js
108108
109109
# Build demo
110110
PR_NUMBER=${{ github.event.pull_request.number }}

.github/workflows/deploy-demo-preview.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ jobs:
4747
DEPLOY_PATH: ag-grid-react-components-pr-${{ github.event.pull_request.number }}
4848
run: |
4949
# Generate version info
50-
node scripts/generate-version-info.js
50+
node scripts/build/generate-version-info.js
5151
5252
# Build demo
5353
PR_NUMBER=${{ github.event.pull_request.number }}

.github/workflows/deploy-demo.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ jobs:
3838
VITE_BASE_PATH: /ag-grid-react-components/
3939
run: |
4040
# Generate version info
41-
node scripts/generate-version-info.js
41+
node scripts/build/generate-version-info.js
4242
4343
# Build demo
4444
npm run build:demo

.github/workflows/update-stackblitz-examples.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ jobs:
2727
run: npm ci
2828

2929
- name: Generate examples
30-
run: node scripts/create-stackblitz-examples.js
30+
run: node scripts/build/create-stackblitz-examples.js
3131

3232
- name: Commit and push if changed
3333
run: |

.gitignore

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -147,3 +147,6 @@ COALESCE_LABS_*.md
147147
CLEANUP_*.md
148148
R2_CLEANUP_*.md
149149
test-framework-*.mdEXPOSED-CREDENTIALS-PRIVATE.txt
150+
151+
# Scripts archive (preserved but not in version control)
152+
scripts-archive/

package.json

Lines changed: 13 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -13,11 +13,11 @@
1313
"scripts": {
1414
"// Development": "Development commands",
1515
"dev": "concurrently \"npm run frontend\" \"npm run api\"",
16-
"frontend": "node scripts/generate-version-info.js && vite",
16+
"frontend": "node scripts/build/generate-version-info.js && vite",
1717
"api": "wrangler dev api/index.js --local --port 8787",
18-
"demo": "node scripts/generate-version-info.js && vite",
18+
"demo": "node scripts/build/generate-version-info.js && vite",
1919
"build": "tsc -p tsconfig.build.json && vite build",
20-
"build:demo": "node scripts/generate-version-info.js && vite build --config vite.config.demo.ts",
20+
"build:demo": "node scripts/build/generate-version-info.js && vite build --config vite.config.demo.ts",
2121
"preview": "vite preview",
2222
"preview:demo": "vite preview --config vite.config.demo.ts",
2323
"dev:safe": "npm run quality && npm run dev",
@@ -30,9 +30,9 @@
3030
"test:e2e:ui": "playwright test --ui",
3131
"test:e2e:debug": "playwright test --debug",
3232
"test:e2e:headed": "playwright test --headed",
33-
"test:browser": "node ./scripts/validate-demo.js",
34-
"test:thorough": "node ./scripts/thorough-demo-check.js",
35-
"test:filter-click": "node ./scripts/test-filter-click.js",
33+
"test:browser": "node ./scripts/dev/validate-demo.js",
34+
"test:thorough": "node ./scripts/dev/thorough-demo-check.js",
35+
"test:filter-click": "node ./scripts/dev/test-filter-click.js",
3636
"test:file": "vitest run",
3737
"coverage:report": "npm run test:coverage && open coverage/index.html",
3838
"// Code Quality": "Linting and formatting via Trunk",
@@ -46,31 +46,21 @@
4646
"check": "trunk check --no-fix && npm run typecheck",
4747
"quality": "trunk check --no-fix && npm run check:whitespace",
4848
"pre-commit": "trunk fmt && npm run fix:whitespace && trunk check --fix && npm run typecheck && npm run check:codeql",
49-
"pre-push": "./scripts/pre-push.sh",
50-
"pre-push:quick": "./scripts/pre-push-quick.sh",
51-
"check:codeql": "node scripts/check-codeql.js",
52-
"check:whitespace": "./scripts/check-whitespace.sh",
53-
"fix:whitespace": "./scripts/fix-whitespace.sh",
49+
"pre-push": "./scripts/dev/pre-push.sh",
50+
"pre-push:quick": "./scripts/dev/pre-push-quick.sh",
51+
"check:codeql": "node scripts/quality/check-codeql.js",
52+
"check:whitespace": "./scripts/quality/check-whitespace.sh",
53+
"fix:whitespace": "./scripts/quality/fix-whitespace.sh",
5454
"// Legacy commands": "Direct tool commands (prefer Trunk)",
5555
"lint:direct": "eslint . --ext ts,tsx --report-unused-disable-directives --max-warnings 0",
5656
"format:direct": "prettier --write .",
5757
"// Utilities": "Helper commands",
5858
"clean": "rm -rf dist coverage .parcel-cache playwright-report test-results",
5959
"fresh": "npm run clean && npm install && npm run build",
60-
"run-tsx": "node ./scripts/run-tsx.js",
60+
"run-tsx": "node ./scripts/utils/run-tsx.js",
6161
"bundle-size": "npm run build && echo '📦 Bundle Size:' && du -sh dist/* | sort -h",
62-
"cleanup:pr-deployments": "node scripts/cleanup-merged-pr-deployments.js",
63-
"// Project Management": "GitHub issues and project sync",
64-
"bootstrap:project": "./scripts/bootstrap-all.sh",
65-
"sync:labels": "node scripts/add-missing-labels.js",
66-
"sync:project": "node scripts/bootstrap-project-sync.js",
67-
"sync:project:all": "node scripts/bootstrap-project-sync-all.js",
68-
"sync:pr-labels": "node scripts/sync-pr-labels-from-issues.js",
69-
"sync:issue-status": "node scripts/sync-issue-status.js",
62+
"// Project Management (archived)": "Scripts moved to scripts-archive/bot-automation/",
7063
"// Milestone Management": "Release planning and tracking",
71-
"milestone:create": "node scripts/create-milestone.js",
72-
"milestone:assign": "node scripts/assign-to-milestone.js",
73-
"milestone:overview": "node scripts/milestone-overview.js",
7464
"milestone:list": "gh milestone list",
7565
"// Git & Release": "Version control and publishing",
7666
"commit": "cz",

scripts/README.md

Lines changed: 76 additions & 78 deletions
Original file line numberDiff line numberDiff line change
@@ -1,105 +1,103 @@
1-
# Project Management Scripts
1+
# Scripts Directory
22

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

5-
## 🚀 Quick Start
5+
## Directory Structure
66

7-
To bootstrap everything at once:
7+
```
8+
scripts/
9+
├── dev/ # Development utilities
10+
├── quality/ # Code quality tools
11+
├── build/ # Build and release utilities
12+
├── release/ # Release management
13+
└── utils/ # Shared utilities
14+
```
815

9-
```bash
10-
npm run bootstrap:project
11-
```text
16+
## Scripts by Category
1217

13-
Or run the shell script directly:
18+
### Development Scripts (`/dev`)
1419

15-
```bash
16-
./scripts/bootstrap-all.sh
17-
```text
20+
| Script | Purpose | Usage |
21+
|--------|---------|-------|
22+
| `pre-push.sh` | Comprehensive pre-push validation | Automatically run by git pre-push hook |
23+
| `pre-push-quick.sh` | Quick pre-push validation (skips tests) | `npm run pre-push:quick` |
24+
| `validate-demo.js` | Validates demo functionality | `npm run test:browser` |
25+
| `thorough-demo-check.js` | Comprehensive demo validation | `npm run test:thorough` |
26+
| `test-filter-click.js` | Tests filter click functionality | `npm run test:filter-click` |
1827

19-
## 📜 Available Scripts
28+
### Code Quality Scripts (`/quality`)
2029

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

27-
### add-missing-labels.js
28-
Ensures all issues have required labels:
29-
- Adds default type label if missing (enhancement)
30-
- Adds default priority label if missing (medium)
31-
- Adds default area label if missing (components)
32-
- Adds default status label if missing (needs-triage)
38+
### Build Scripts (`/build`)
3339

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

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

45-
```bash
46-
node scripts/bootstrap-project-sync.js
47-
```text
48+
| Script | Purpose | Usage |
49+
|--------|---------|-------|
50+
| `bump-version.js` | Bumps package version | Part of release workflow |
51+
| `generate-changelog.js` | Generates changelog entries | Part of release workflow |
52+
| `prepare-release.js` | Prepares release artifacts | Part of release workflow |
4853

49-
## 🔄 How Sync Works
54+
### Utility Scripts (`/utils`)
5055

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

55-
## 📋 Label Categories
62+
## Script Requirements
5663

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

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

66-
## 🛠️ Troubleshooting
70+
### Dependencies
6771

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

74-
# Authenticate
75-
gh auth login
76-
```text
78+
## Best Practices
7779

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

84-
# Re-authenticate with proper scopes
85-
gh auth login --scopes "repo,project"
86-
```
85+
## Archived Scripts
86+
87+
Many scripts have been moved to `scripts-archive/` (git-ignored) for historical reference:
8788

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

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

95-
After bootstrap, the system maintains itself:
96-
- GitHub Actions run every 5 minutes
97-
- Changes sync automatically
98-
- Manual trigger available in Actions tab
94+
## Adding New Scripts
9995

100-
## 📊 Monitoring
96+
When adding new scripts:
10197

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

scripts/add-missing-labels.js

Lines changed: 0 additions & 98 deletions
This file was deleted.

0 commit comments

Comments
 (0)