Skip to content

refactor: restructure into monorepo with packages/#276

Closed
MrTravisB wants to merge 50 commits into
developfrom
travis/monorepo_restructure_v2
Closed

refactor: restructure into monorepo with packages/#276
MrTravisB wants to merge 50 commits into
developfrom
travis/monorepo_restructure_v2

Conversation

@MrTravisB

@MrTravisB MrTravisB commented Feb 14, 2026

Copy link
Copy Markdown
Collaborator

Summary

This PR restructures Spark into a proper monorepo layout with separate packages and prepares the CLI for npm publishing, positioning the project for open-source release.

Changes

Structural Reorganization

  • Moved CLI from src/cli/ to packages/cli/
  • Moved Server from root-level server config to packages/server/
  • Moved Extension from extension/ to packages/extension/
  • Moved Core library from src/ to packages/core/

Import System Overhaul

  • Eliminated barrel imports: Removed re-export patterns in favor of direct imports
  • Added .js extensions: All relative imports now include explicit .js extensions for ESM compatibility
  • Workspace protocol: Cross-package dependencies use workspace:* protocol

Build Pipeline Fixes

  • Wrapped typecheck script in packages/core to run bundle:aria first (fixes typecheck on fresh checkout)
  • Aligned 11 dependency versions across all packages to newest versions
  • Removed ariaTree barrel export and consolidated exports into core.ts
  • Removed 28 unused dependencies from root package.json (kept only prettier)

CLI npm Package Preparation

  • CLI package configured as @spark/cli for npm publishing
  • Added proper package metadata (description, keywords, repository, license)
  • Updated documentation for npm installation workflow

New Monorepo Structure

spark/
├── packages/
│   ├── cli/              # CLI tool (@spark/cli)
│   ├── server/           # Server component
│   ├── extension/        # Browser extension
│   └── core/             # Core automation library
├── package.json          # Root workspace (prettier only)
├── pnpm-workspace.yaml   # Workspace definition
└── ...

Testing

  • All 971 tests pass across all packages
  • Format check passes
  • Typecheck passes for all 4 packages

Notes

This is a foundational restructuring with no functional changes to the automation logic. The monorepo layout enables independent versioning, clear separation of concerns, and preparation for npm workspace publishing.

@MrTravisB MrTravisB force-pushed the travis/monorepo_restructure_v2 branch from 833d6a6 to 5c39553 Compare February 17, 2026 19:23
- Add comprehensive CLI package.json scripts: build, build:cli-only, clean, typecheck, dev, test, test:watch
- Simplify root package.json exports using wildcard pattern instead of explicit file list
- Improves maintainability and reduces export configuration duplication
- Root package.json: Converted to workspace-only (removed build/test/typecheck scripts)
- packages/core: Added format, format:check, and check scripts
- packages/cli: Simplified build, added prebuild, format, and check scripts
- packages/server: Added prebuild, format, and check scripts
- packages/extension: Removed compile duplicate, added clean, prebuild, and standardized check
- Added .prettierignore files in core, cli, and extension packages to exclude generated and vendor files
- Add comprehensive CLI package.json scripts: build, build:cli-only, clean, typecheck, dev, test, test:watch
- Simplify root package.json exports using wildcard pattern instead of explicit file list
- Improves maintainability and reduces export configuration duplication
- Updated README.md to include npm installation instructions for end users (@tabstack/spark)
- Distinguished between external usage (npm) and developer setup (pnpm) in documentation
- Updated CLAUDE.md to document the new modular configuration system architecture
- Added config subcommands and XDG-compliant path information
- Added guidance on config file location (~/.config/spark/config.json)
Files were lost during rebase conflict resolution. Restored:
- src/browser/ariaTree/cssTokenizer.ts
- src/browser/ariaTree/domUtils.ts
- src/browser/ariaTree/roleUtils.ts
- src/browser/ariaTree/yamlUtils.ts
- tsconfig.json
- tsconfig.check.json

Also updated pnpm-lock.yaml and regenerated aria bundle.
- Moved src/browser/ariaTree/ to packages/core/src/browser/ariaTree/
- Updated scripts/bundle-aria-tree.ts paths to reference new location
- Remove root tsconfig files (packages have their own)
- Update root package.json to be workspace-only (private, no exports)
- Update workspace scripts to delegate to packages
- Fix server dependency: spark -> spark-core (workspace:*)
- Fix extension import: spark/ariaTree -> spark-core/ariaTree
- Add explicit ariaTree export to spark-core package
- Remove root from pnpm-workspace packages list
- Move scripts/bundle-aria-tree.ts to packages/core/scripts/
- Add bundle:aria script to core package.json
- Update core build to run bundle:aria first
- Remove bundle:aria from root package.json
- Add bundle.ts to .gitignore (auto-generated)
- Remove bundle.ts from git tracking
@MrTravisB MrTravisB force-pushed the travis/monorepo_restructure_v2 branch from ec1ad89 to dc264cb Compare February 18, 2026 02:03
@MrTravisB MrTravisB closed this Feb 19, 2026
@MrTravisB MrTravisB deleted the travis/monorepo_restructure_v2 branch February 19, 2026 08:55
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant