Managing large monorepos is hard. This makes it easier to standardize them.
yarn add monorepolint
or
npm install monorepolint
Good for CI.
monorepolint check
or use the shortcut (which i will only use now):
mrl check
mrl check --verbose
mrl check --fix
For now, look at .monorepolint.config.ts in this repo.
Sample:
module.exports = {
checks: {
":standard-tsconfig": [
{
template: {
compilerOptions: {
target: "es5",
module: "commonjs",
lib: ["es2015"],
declaration: true,
declarationMap: true,
sourceMap: true,
outDir: "./build",
rootDir: "./src",
composite: true,
importHelpers: true,
strict: true,
noUnusedLocals: true,
noUnusedParameters: true,
noImplicitReturns: true,
noFallthroughCasesInSwitch: true,
allowSyntheticDefaultImports: true,
esModuleInterop: true
}
}
}
],
":file-contents": [
{
options: "jest.config.js",
templateFile: "./templates/jest.config.js"
}
],
":package-script": [
{
options: {
clean: "rm -rf build",
"compile:typescript": "../../node_modules/.bin/tsc",
"lint:typescript":
"../../node_modules/.bin/tslint --config ../../tslint.json --project .",
"test:watch":
"../../node_modules/.bin/jest --colors --passWithNoTests --watch",
test: "../../node_modules/.bin/jest --colors --passWithNoTests"
}
}
],
":package-order": [
{
options: [
"name",
"version",
"author",
"url",
"license",
"private",
"main",
"typings",
"style",
"sideEffects",
"workspaces",
"husky",
"lint-staged",
"scripts",
"dependencies",
"peerDependencies",
"devDependencies",
"publishConfig",
"gitHead"
],
includeWorkspaceRoot: true
}
],
":alphabetical-dependencies": {}
}
};
-
Get in there:
yarn yarn compile:watch
-
Edit your files
-
Test your changes:
yarn ci
-
Submit a pull request
-
Run this command:
sudo gem install --pre github_changelog_generator
yarn run changelog
- Submit a pull request
The way yarn workspaces function, in order to get the right symlinks in node_modules/@monorepolint/whatever
you need to run yarn
again.