Summary
Prerequisite for #488. Convert the libscope repo to an npm workspaces monorepo so that sub-packages can be developed, built, and published independently from a single repository.
Problem / Motivation
Before any individual package can be extracted (#488), the repo needs the workspaces infrastructure in place. Without it, cross-package imports won't resolve during development and CI won't know how to build each package independently.
Proposed Solution
- Add an npm workspaces config to the root
package.json pointing at each packages/* directory
- Create a
packages/ directory and stub out a package.json for each planned sub-package
- Set up a root-level
tsconfig.json with project references so tsc can build packages in dependency order
- Configure CI to run lint, typecheck, test, and build across all workspaces
- Shared dev tooling (eslint, prettier, vitest config) stays at the root and is inherited by packages
Acceptance Criteria
Out of Scope
- Actually moving code into packages — that happens in the individual package extraction issues
- Changing any public API surface
- Turborepo or other build orchestration beyond npm workspaces (can be added later if build times warrant it)
Technical Notes
- npm workspaces requires npm ≥7 / Node ≥15; CI already runs Node 20+, so no constraint there
- TypeScript project references (
composite: true, references: [] in tsconfig) will be needed per package for incremental builds
- The existing root
tsconfig.json should become the base config; each package extends it
Summary
Prerequisite for #488. Convert the libscope repo to an npm workspaces monorepo so that sub-packages can be developed, built, and published independently from a single repository.
Problem / Motivation
Before any individual package can be extracted (#488), the repo needs the workspaces infrastructure in place. Without it, cross-package imports won't resolve during development and CI won't know how to build each package independently.
Proposed Solution
package.jsonpointing at eachpackages/*directorypackages/directory and stub out apackage.jsonfor each planned sub-packagetsconfig.jsonwith project references sotsccan build packages in dependency orderAcceptance Criteria
package.jsonhas aworkspacesfield covering allpackages/*entriesnpm installfrom the root installs all workspace dependencies and symlinks cross-package deps correctlypackage.jsonwith correctname,main,types, andexportsfieldsnpm run buildfrom the root builds all packages in dependency order without errorslibscopeCLI and all current tests continue to pass unchangedOut of Scope
Technical Notes
composite: true,references: []in tsconfig) will be needed per package for incremental buildstsconfig.jsonshould become the base config; each package extends it