-
-
Notifications
You must be signed in to change notification settings - Fork 3
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Monorepo with ESLint packages #8
Labels
Milestone
Comments
This was referenced Aug 15, 2019
Closed
Closed
Closed
Closed
arcticicestudio
added a commit
that referenced
this issue
Aug 15, 2019
Updated the `.gitattributes` (1) and `.gitignore` (2) configuration files to use the latest pattern. References: (1) https://git-scm.com/docs/gitattributes (2) https://git-scm.com/docs/gitignore Epic: GH-8 Resolves GH-9
arcticicestudio
added a commit
that referenced
this issue
Aug 15, 2019
Added a Git mailmap (1) file to link to in documentations to allow contributors to send mails regarding security issues. This prevents unnecessary overhead of updating all documents when new core team and members and contributors are added and additionally adds the main functionality of the file: Mapping commits when someone uses a different email address. References: (1) https://git-scm.com/docs/git-shortlog#_mapping_authors Epic: GH-8 Resolves GH-10
arcticicestudio
added a commit
that referenced
this issue
Aug 15, 2019
Integrated Prettier (1), the opinionated code formatter with support for many languages and integrations with most editors. It ensures that all outputted code conforms to a consistent style. >>> Configuration This is one of the main features of Prettier: It already provides the best and recommended style configurations of-out-the-box. The only option we will change is the print width (2). It is set to 80 by default which not up-to-date for modern screens (might only be relevant when working in terminals only like e.g. with Vim). It has been changed to 120 used by all of Arctic Ice Studio's style guides. The `prettier.config.js` configuration file is placed in the project root as well as the `.prettierignore` file to also define ignore pattern. >>> NPM script/task To allow to format all sources a `format:pretty` npm script/task has been added to be included in the main `format` script flow. >>> First Time Code Base Run The last task was to run Prettier for the first time on the entire code base. This revealed multiple style guide violations that were fixedf through Prettier and the configured linters of the project. >>> False-Positives To ensure incorrect examples of the style guide won't be fixed by Prettier, the affected lines have been excluded from Prettier by adding the `<!-- prettier-ignore -->` handle for HTML (3). Note that this also triggers `remark-lint` when added right above a code block (`no-missing-blank-lines`). This has been fixed by adding the `<!--lint disable no-missing-blank-lines-->` handle (4) as well. References: (1) https://prettier.io (2) https://prettier.io/docs/en/options.html#print-width (3) https://prettier.io/docs/en/ignore.html#html (4) https://github.com/remarkjs/remark-lint#configuring-remark-lint Epic: GH-8 Resolves GH-11
arcticicestudio
added a commit
that referenced
this issue
Aug 15, 2019
Integrated "lint-staged" (1) to run linters against staged Git files to prevent to add code that violates any style guide into the code base. >>> Configuration The configuration file `lint-staged.config.js` is placed in the project root and includes the command that should be run for matching file extensions (globs). It will include at least the three following entries with the same order as listed here: 1. `prettier --list-different` - Run Prettier (GH-11) against `*.{js,json,yml}` to ensure all files are formatted correctly. The `--list-different` prints the found files that are not conform to the Prettier configuration. 2. `eslint` - Run ESLint against `*.{js}` to ensure all JavaScript files are compliant to the style guide after being formatted with Prettier. 3. `remark --no-stdout` - Run remark-lint against `*.md` to ensure all Markdown files are compliant to the style guide. The `--no-stdout` flag suppresses the output of the parsed file content. References: (1) https://github.com/okonet/lint-staged Epic: GH-8 Must be resolved after GH-11 Resolves GH-12
arcticicestudio
added a commit
that referenced
this issue
Aug 15, 2019
Integrated Husky, the tool that make Git hooks easy and can prevent bad Git commits, pushes and more 🐶 *woof*! >>> Configuration The configuration file `.huskyrc.js` is placed in the project root and includes the command to run for any supported Git hook (2). It contains configs for the following hooks: - `pre-commit` - Run lint-staged (GH-12) before each commit (via `lint-staged` command) to ensure all staged files are compliant to all style guides. References: (1) https://github.com/typicode/husky (1) https://github.com/typicode/husky/blob/master/DOCS.md#supported-hooks Epic: GH-8 Must be resolved after GH-12 Resolves GH-13
arcticicestudio
added a commit
that referenced
this issue
Aug 15, 2019
The project repository documentations were not designed for a monorepo layout and have been updated including various badges provided by the great shields.io (1) project. Further documentations about the project architecture and technologies as well as guides for contributions to develop, run and maintain the project will stay within the packages itself. Minimal instructions might be added later on within a "Getting Starte" / "Quick Start" section. There are also various places that contain outdated documentations and metadata that have been updated too: - Updated outdated documentations and metadata like copyright comment headers. - Added GitHub user `svengreb` as core team maintainer to the CODEWONER file. - Added a new `.yarnrc` configuration file to set the `save-prefix` option in order to resolve always install and resolve exact dependency versions. - Updated project repository SVG assets using GitHub's new `sanitize=true` query parameter to allow rendering SVG's hosted within the repository and served via the `raw.githubusercontent` subdomain. - Added shields.io (1) badges for - latest GitHub release version and changelog - deployed ESLint package versions and statistics (downloads) References: (1) https://shields.io Epic: GH-8 Resolves GH-14
arcticicestudio
added a commit
that referenced
this issue
Aug 15, 2019
Added GitHub's feature to define multiple issue templates (1). The initial template file that has been used when the feature was introduced (2) is now used as a fallback/generic template to redirect to one of the other specific templates. The UI helps users to open a new issue in projects by prompting them to choose from multiple issue types. GitHub now also provides a way to define multiple pull request templates (3). See the GitHub Help (4) for more details about issue and pull request templates. References: (1) blog.github.com/2018-01-25-multiple-issue-and-pull-request-templates (2) blog.github.com/2016-02-17-issue-and-pull-request-templates (3) blog.github.com/2016-02-17-issue-and-pull-request-templates (4) help.github.com/articles/about-issue-and-pull-request-templates Epic: GH-8 Resolves GH-15
arcticicestudio
added a commit
that referenced
this issue
Aug 19, 2019
>> Previous Project State Previously this repository only contained the actual styleguide documentation while specific projects that implement the guidelines for linters and code style analyzer lived in separate repositories. This was the best approach for modularity and a small and clear code base, but it increased the maintenance overhead by 1(n) since changes to the development workflow or toolbox, general project documentations as well as dependency management required changes in every repository with dedicated tickets/issues and PRs. In particular, Node packages require frequent dependency management due to their fast development cycles to keep up-to-date with the latest package changes like (security) bug fixes. This styleguide is implemented by the `eslint-config-arcticicestudio-base` (1) and `eslint-config-arcticicestudio (2) Node packages that lived in their own repositories. The development workflow was clean using most of GitHub's awesome features like project boards, codeowner assignments, issue & PR automation and so on, but changes to one of them often required actions for the other package too since they are based on each other and they are using the same development tooling and documentation standards. >>> Monorepo Comparison Actually I'm not a supporter when it comes to monorepos (3) and next to the advantages a monorepo also comes with disadvantages: - No more scoped code - The developer experience with Git is clearly worse because commits can contains changes to multiple scopes of the code. Since there are only a "transparent separation" of code, that was previously located in a dedicated repository but is not aggregated into a parent (e.g. `packages`) with other modules, commits can now contain changes to multiple code scopes spread over the entire code base. - No more assignment of commits to single modules - Like described in the bullet point above, commit can contain changes to multiple modules, it is harder to detect which commit targeted a specific module. - Steeper learning curve for new contributors - In a dedicated repository that only hosts a specific module it is easier for new developers to contribute to the project, but in a monorepo (3) they might need to change code in multiple places within other modules or the root code/documentation of the entire project. - Uniform version number - In order to keep conform to SemVer (4), the entire project must use a uniform version number. This means that a module that has not been changed since the last version must also be incremented in order to keep compatible with the other modules. Using different version numbers prefixed/suffixed with an individual version number is a not go, increases the maintenance overhead and and drastically reduces the project overview and quality! This would result in multiple Git tags on the `master` branch as well as "empty" changelogs and release notes with placeholder logs that only refer to changes of other modules. >> Project Future Even though there are disadvantages (see section above), a monorepo makes sense only for specific project modules thar are slightly coupled and where using dedicated repositories only increases the maintenance overhead when changes must be reflected in multiple modules anyway. In order to reduce the maintenance overhead both Node packages, `eslint-config-arcticicestudio-base` (1) and `eslint-config-arcticicestudio` (2), have been migrated into this repository by adapting to Yarn workspaces (5) since they are slightly and dependent on each other anyway. This simplifies the development tooling setup and allows to use a unified documentation base as well as a smoother development and testing workflow. This change also implies that the root of the repository is now the main package for the entire project setup including shared development dependencies, tools and documentations while the packages only contain specific configurations and (dev)dependencies. >>> Scoped Packages Previously `eslint-config-arcticicestudio-base` (1) and `eslint-config-arcticicestudio` (2) were no scoped packages (6) but suffixed with `-arcticicestudio*`. To simplify the naming and improving the usage of user/organization specific packages both packages are now scoped to `@arcticicestudio` resulting in the new package names `@arcticicestudio/eslint-config-base` and `@arcticicestudio/eslint-config`. They can be used through ESLint's support for shared configuration with scoped packages (7). The previously released public versions have been deprecated using the `npm deprecate` command (8) where the provided message points out to migrate to the new scoped packages. >>> Versioning The style guide itself and all packages now use a "shared/fixed/locked" version. This helps all packages to keep in sync and ensure the compatibility with the latest style guide version. >>> Standard Setup In order to keep up-to-date with the latest project setup for all "Arctic Ice Studio" projects, the tools and documentations have been integrated and updated through the following tickets: - GH-9 (8e99240) "Git ignore and attribute pattern" - GH-10 (db2a43b) "Git mail mapping" - GH-11 (1025324) "Prettier" - GH-12 (c21a58a) "lint-staged" - GH-13 (b4cac34) "Husky" - GH-14 (be122b1) "General repository and package documentations and metadata" - GH-15 (c25d1ef) "GitHub issue and pull request templates" References: (1) https://www.npmjs.com/package/eslint-config-arcticicestudio-base (2) https://www.npmjs.com/package/eslint-config-arcticicestudio (3) https://trunkbaseddevelopment.com/monorepos/ (4) https://semver.org (5) https://yarnpkg.com/en/docs/workspaces (6) https://docs.npmjs.com/about-scopes (7) https://eslint.org/docs/developer-guide/shareable-configs#npm-scoped-modules (8) https://docs.npmjs.com/cli/deprecate Epic: GH-8 GH-8
arcticicestudio
added a commit
that referenced
this issue
Aug 19, 2019
>> Previous Project State Previously this repository only contained the actual styleguide documentation while specific projects that implement the guidelines for linters and code style analyzer lived in separate repositories. This was the best approach for modularity and a small and clear code base, but it increased the maintenance overhead by 1(n) since changes to the development workflow or toolbox, general project documentations as well as dependency management required changes in every repository with dedicated tickets/issues and PRs. In particular, Node packages require frequent dependency management due to their fast development cycles to keep up-to-date with the latest package changes like (security) bug fixes. This styleguide is implemented by the `eslint-config-arcticicestudio-base` (1) and `eslint-config-arcticicestudio (2) Node packages that lived in their own repositories. The development workflow was clean using most of GitHub's awesome features like project boards, codeowner assignments, issue & PR automation and so on, but changes to one of them often required actions for the other package too since they are based on each other and they are using the same development tooling and documentation standards. >>> Monorepo Comparison Actually I'm not a supporter when it comes to monorepos (3) and next to the advantages a monorepo also comes with disadvantages: - No more scoped code - The developer experience with Git is clearly worse because commits can contains changes to multiple scopes of the code. Since there are only a "transparent separation" of code, that was previously located in a dedicated repository but is not aggregated into a parent (e.g. `packages`) with other modules, commits can now contain changes to multiple code scopes spread over the entire code base. - No more assignment of commits to single modules - Like described in the bullet point above, commit can contain changes to multiple modules, it is harder to detect which commit targeted a specific module. - Steeper learning curve for new contributors - In a dedicated repository that only hosts a specific module it is easier for new developers to contribute to the project, but in a monorepo (3) they might need to change code in multiple places within other modules or the root code/documentation of the entire project. - Uniform version number - In order to keep conform to SemVer (4), the entire project must use a uniform version number. This means that a module that has not been changed since the last version must also be incremented in order to keep compatible with the other modules. Using different version numbers prefixed/suffixed with an individual version number is a not go, increases the maintenance overhead and and drastically reduces the project overview and quality! This would result in multiple Git tags on the `master` branch as well as "empty" changelogs and release notes with placeholder logs that only refer to changes of other modules. >> Project Future Even though there are disadvantages (see section above), a monorepo makes sense only for specific project modules thar are slightly coupled and where using dedicated repositories only increases the maintenance overhead when changes must be reflected in multiple modules anyway. In order to reduce the maintenance overhead both Node packages, `eslint-config-arcticicestudio-base` (1) and `eslint-config-arcticicestudio` (2), have been migrated into this repository by adapting to Yarn workspaces (5) since they are slightly and dependent on each other anyway. This simplifies the development tooling setup and allows to use a unified documentation base as well as a smoother development and testing workflow. This change also implies that the root of the repository is now the main package for the entire project setup including shared development dependencies, tools and documentations while the packages only contain specific configurations and (dev)dependencies. >>> Scoped Packages Previously `eslint-config-arcticicestudio-base` (1) and `eslint-config-arcticicestudio` (2) were no scoped packages (6) but suffixed with `-arcticicestudio*`. To simplify the naming and improving the usage of user/organization specific packages both packages are now scoped to `@arcticicestudio` resulting in the new package names `@arcticicestudio/eslint-config-base` and `@arcticicestudio/eslint-config`. They can be used through ESLint's support for shared configuration with scoped packages (7). The previously released public versions have been deprecated using the `npm deprecate` command (8) where the provided message points out to migrate to the new scoped packages. >>> Versioning The style guide itself and all packages now use a "shared/fixed/locked" version. This helps all packages to keep in sync and ensure the compatibility with the latest style guide version. >>> Standard Setup In order to keep up-to-date with the latest project setup for all "Arctic Ice Studio" projects, the tools and documentations have been integrated and updated through the following tickets: - GH-9 (8e99240) "Git ignore and attribute pattern" - GH-10 (db2a43b) "Git mail mapping" - GH-11 (1025324) "Prettier" - GH-12 (c21a58a) "lint-staged" - GH-13 (b4cac34) "Husky" - GH-14 (be122b1) "General repository and package documentations and metadata" - GH-15 (c25d1ef) "GitHub issue and pull request templates" References: (1) https://www.npmjs.com/package/eslint-config-arcticicestudio-base (2) https://www.npmjs.com/package/eslint-config-arcticicestudio (3) https://trunkbaseddevelopment.com/monorepos/ (4) https://semver.org (5) https://yarnpkg.com/en/docs/workspaces (6) https://docs.npmjs.com/about-scopes (7) https://eslint.org/docs/developer-guide/shareable-configs#npm-scoped-modules (8) https://docs.npmjs.com/cli/deprecate Epic: GH-8 GH-8
arcticicestudio
added a commit
that referenced
this issue
Aug 19, 2019
>> Previous Project State Previously this repository only contained the actual styleguide documentation while specific projects that implement the guidelines for linters and code style analyzer lived in separate repositories. This was the best approach for modularity and a small and clear code base, but it increased the maintenance overhead by 1(n) since changes to the development workflow or toolbox, general project documentations as well as dependency management required changes in every repository with dedicated tickets/issues and PRs. In particular, Node packages require frequent dependency management due to their fast development cycles to keep up-to-date with the latest package changes like (security) bug fixes. This styleguide is implemented by the `eslint-config-arcticicestudio-base` (1) and `eslint-config-arcticicestudio (2) Node packages that lived in their own repositories. The development workflow was clean using most of GitHub's awesome features like project boards, codeowner assignments, issue & PR automation and so on, but changes to one of them often required actions for the other package too since they are based on each other and they are using the same development tooling and documentation standards. >>> Monorepo Comparison Actually I'm not a supporter when it comes to monorepos (3) and next to the advantages a monorepo also comes with disadvantages: - No more scoped code - The developer experience with Git is clearly worse because commits can contains changes to multiple scopes of the code. Since there are only a "transparent separation" of code, that was previously located in a dedicated repository but is not aggregated into a parent (e.g. `packages`) with other modules, commits can now contain changes to multiple code scopes spread over the entire code base. - No more assignment of commits to single modules - Like described in the bullet point above, commit can contain changes to multiple modules, it is harder to detect which commit targeted a specific module. - Steeper learning curve for new contributors - In a dedicated repository that only hosts a specific module it is easier for new developers to contribute to the project, but in a monorepo (3) they might need to change code in multiple places within other modules or the root code/documentation of the entire project. - Uniform version number - In order to keep conform to SemVer (4), the entire project must use a uniform version number. This means that a module that has not been changed since the last version must also be incremented in order to keep compatible with the other modules. Using different version numbers prefixed/suffixed with an individual version number is a not go, increases the maintenance overhead and and drastically reduces the project overview and quality! This would result in multiple Git tags on the `master` branch as well as "empty" changelogs and release notes with placeholder logs that only refer to changes of other modules. >> Project Future Even though there are disadvantages (see section above), a monorepo makes sense only for specific project modules thar are slightly coupled and where using dedicated repositories only increases the maintenance overhead when changes must be reflected in multiple modules anyway. In order to reduce the maintenance overhead both Node packages, `eslint-config-arcticicestudio-base` (1) and `eslint-config-arcticicestudio` (2), have been migrated into this repository by adapting to Yarn workspaces (5) since they are slightly and dependent on each other anyway. This simplifies the development tooling setup and allows to use a unified documentation base as well as a smoother development and testing workflow. This change also implies that the root of the repository is now the main package for the entire project setup including shared development dependencies, tools and documentations while the packages only contain specific configurations and (dev)dependencies. >>> Scoped Packages Previously `eslint-config-arcticicestudio-base` (1) and `eslint-config-arcticicestudio` (2) were no scoped packages (6) but suffixed with `-arcticicestudio*`. To simplify the naming and improving the usage of user/organization specific packages both packages are now scoped to `@arcticicestudio` resulting in the new package names `@arcticicestudio/eslint-config-base` and `@arcticicestudio/eslint-config`. They can be used through ESLint's support for shared configuration with scoped packages (7). The previously released public versions have been deprecated using the `npm deprecate` command (8) where the provided message points out to migrate to the new scoped packages. >>> Versioning The style guide itself and all packages now use a "shared/fixed/locked" version. This helps all packages to keep in sync and ensure the compatibility with the latest style guide version. >>> Standard Setup In order to keep up-to-date with the latest project setup for all "Arctic Ice Studio" projects, the tools and documentations have been integrated and updated through the following tickets: - GH-9 (8e99240) "Git ignore and attribute pattern" - GH-10 (db2a43b) "Git mail mapping" - GH-11 (1025324) "Prettier" - GH-12 (c21a58a) "lint-staged" - GH-13 (b4cac34) "Husky" - GH-14 (be122b1) "General repository and package documentations and metadata" - GH-15 (c25d1ef) "GitHub issue and pull request templates" References: (1) https://www.npmjs.com/package/eslint-config-arcticicestudio-base (2) https://www.npmjs.com/package/eslint-config-arcticicestudio (3) https://trunkbaseddevelopment.com/monorepos/ (4) https://semver.org (5) https://yarnpkg.com/en/docs/workspaces (6) https://docs.npmjs.com/about-scopes (7) https://eslint.org/docs/developer-guide/shareable-configs#npm-scoped-modules (8) https://docs.npmjs.com/cli/deprecate Epic: GH-8 Resolves GH-8
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Current Project State
Currently this repository only contains the actual styleguide documentation while specific projects that implement the guidelines for linters and code style analyzer live in separate repositories. This is the best approach for modularity and a small and clear code base, but it increases the maintenance overhead by 1(n) since changes to the development workflow or toolbox, general project documentations as well as dependency management requires changes in every repository with dedicated tickets/issues and PRs. In particular, Node packages require frequent dependency management due to their fast development cycles to keep up-to-date with the latest package changes like (security) bug fixes.
This styleguide is currently implemented by the eslint-config-arcticicestudio-base and eslint-config-arcticicestudio Node packages living in their own repositories. The development workflow is clean using most of GitHub's awesome features like project boards, codeowner assignments, issue & PR automation and so on, but changes to one of them often requires actions for the other package too since they are based on each other and they are using the same development tooling and documentation standards.
Monorepo Comparison
Monorepos are a fantastic way to manage such a project structure, but there are also some points that must be taken into account:
packages
) with other modules, commits can now contain changes to multiple code scopes spread over the entire code base.Using different version numbers prefixed/suffixed with an individual version number is a not an option, increases the maintenance overhead and and drastically reduces the project overview and quality! This would result in multiple Git tags on the
main
branch as well as “empty” changelogs and release notes with placeholder logs that only refer to changes of other modules.Project Future
Even though a monorepo requires some special thoughts, it also comes with a lot of benefits and makes sense for specific project modules that are slightly coupled and where using dedicated repositories only increases the maintenance overhead when changes must be reflected in multiple modules anyway.
In order to reduce the maintenance overhead both Node packages, eslint-config-arcticicestudio-base and eslint-config-arcticicestudio, will be migrated into this repository by adapting to Yarn workspaces. This simplifies the development tooling setup and allows to use a unified documentation base as well as a smoother development and testing workflow.
This change also implies that the root of the repository will be the main package for the entire project setup including shared development dependencies, tools and documentations while the packages will only contain specific configurations and (dev)dependencies.
Scoped Packages
Currently eslint-config-arcticicestudio-base and eslint-config-arcticicestudio are no scoped packages but suffixed with
-arcticicestudio*
. To simplify the naming and improving the usage of user/organization specific packages both packages will be scoped to@arcticicestudio
resulting in the new names@arcticicestudio/eslint-config-base
and@arcticicestudio/eslint-config
. They can be used through ESLint's support for shared configuration with scoped packages.The currently released public versions will be deprecated using the
npm deprecate
command where the provided message will point out to migrate to the new scoped packages.Versioning
The style guide itself and all packages will use a shared/fixed/locked version. This helps all packages to keep in sync and ensure the compatibility with the latest style guide version.
Standard Setup
In order to keep up-to-date with the latest project setup for all Arctic Ice Studio projects, the tools and documentations will be integrated and updated through the following tickets:
The text was updated successfully, but these errors were encountered: