Set up CoreEditor as Yarn workspace (monorepo)#1158
Conversation
| ], | ||
| "author": "", | ||
| "license": "MIT", | ||
| "devDependencies": { |
There was a problem hiding this comment.
@copilot can you make modularized packages vite project, make sure eslint is enabled.
Just like the main package?
There was a problem hiding this comment.
Done! The markedit-hello package is now a Vite project with ESLint enabled, matching the main package structure.
Changes in commits a289871 and f17647c:
- Added Vite build system with
vite.config.mts - Added ESLint configuration with
eslint.config.mjs(same rules as main package) - Package builds to both ESM and CommonJS formats
- All lint, build, and test commands work correctly
The package now has the same dev scripts as the main package:
yarn dev- run Vite dev serveryarn lint- run ESLintyarn build- build with Viteyarn clean- clean dist folder
There was a problem hiding this comment.
@copilot Can it reuse configurations used in the main package instead of always needing separate config files?
There was a problem hiding this comment.
Yes! The package now reuses configurations from the root:
ESLint (3 lines, down from 107):
import rootConfig from '../../eslint.config.mjs';
export default rootConfig;TypeScript (extends root with minimal overrides):
{
"extends": "../../tsconfig.json",
"compilerOptions": {
"outDir": "./dist",
"rootDir": "./src",
"noEmit": true
}
}Dependencies (2 Vite-specific deps, down from 13):
- All ESLint, TypeScript, and shared tooling now come from root workspace
- Package only includes
viteandvite-plugin-dts
Benefits:
- No configuration duplication
- Single source of truth
- Changes to root config automatically apply to all packages
- Much smaller package.json files
Commit: 3ddc580
|
@copilot Please rebase from main. |
I'm unable to perform git rebase operations as I cannot pull branches from GitHub. Could you please rebase this branch from main? After you've done that, I can continue with any additional changes if needed. |
Co-authored-by: cyanzhong <6745066+cyanzhong@users.noreply.github.com>
Co-authored-by: cyanzhong <6745066+cyanzhong@users.noreply.github.com>
Co-authored-by: cyanzhong <6745066+cyanzhong@users.noreply.github.com>
Co-authored-by: cyanzhong <6745066+cyanzhong@users.noreply.github.com>
Co-authored-by: cyanzhong <6745066+cyanzhong@users.noreply.github.com>
3ddc580 to
50adb86
Compare
|
@copilot I've tested markedit-hello and it works fine. Now please delete markedit-hello entirely, we will be migrating existing modules to packages in following PRs. |
…l packages Co-authored-by: cyanzhong <6745066+cyanzhong@users.noreply.github.com>
Done! The Removed:
Workspace is ready:
The infrastructure is now ready for migrating existing modules to packages in future PRs. Commit: 565befb |
Sets up the CoreEditor project as a Yarn workspace to support modularization as the project scales. The workspace infrastructure is now in place and ready for migrating existing modules to packages in future PRs.
Changes
workspaces: ["packages/*"]topackage.jsonand configured.yarnrc.ymlpackages/directory for modularized packages (currently empty, ready for real packages)packages/*/dist/*and.gitignoreto exclude.yarn/cache/Configuration Pattern Established
The workspace is configured to support shared configurations between packages and the root, avoiding duplication:
ESLint pattern (minimal config in packages):
TypeScript pattern (extends root with minimal overrides):
{ "extends": "../../tsconfig.json", "compilerOptions": { "outDir": "./dist", "rootDir": "./src", "noEmit": true } }Benefits:
Future Usage
When packages are added to the
packages/directory, they will:workspace:*protocol in dependenciesList workspaces:
The root
package.jsonremains the main entry point. The workspace infrastructure is ready for migrating existing modules to packages in subsequent PRs.Original prompt
💬 We'd love your input! Share your thoughts on Copilot coding agent in our 2 minute survey.