{"id":20484642,"url":"https://github.com/SAP-archive/ecmascript-monorepo-template","last_synced_at":"2025-05-09T03:30:29.368Z","repository":{"id":37471029,"uuid":"304108660","full_name":"SAP-samples/ecmascript-monorepo-template","owner":"SAP-samples","description":"An opinionated template for an ECMAScript mono-repo structure and dev flows.","archived":false,"fork":false,"pushed_at":"2023-05-02T11:58:32.000Z","size":1302,"stargazers_count":3,"open_issues_count":36,"forks_count":4,"subscribers_count":7,"default_branch":"main","last_synced_at":"2024-05-09T12:41:26.582Z","etag":null,"topics":["ecmascript","javascript","monorepo","typescript"],"latest_commit_sha":null,"homepage":"","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/SAP-samples.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null}},"created_at":"2020-10-14T18:57:57.000Z","updated_at":"2022-05-24T02:58:36.000Z","dependencies_parsed_at":"2023-01-20T21:05:53.677Z","dependency_job_id":"27a54a91-3dfd-4675-b80a-bb73befd337a","html_url":"https://github.com/SAP-samples/ecmascript-monorepo-template","commit_stats":null,"previous_names":[],"tags_count":2,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/SAP-samples%2Fecmascript-monorepo-template","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/SAP-samples%2Fecmascript-monorepo-template/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/SAP-samples%2Fecmascript-monorepo-template/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/SAP-samples%2Fecmascript-monorepo-template/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/SAP-samples","download_url":"https://codeload.github.com/SAP-samples/ecmascript-monorepo-template/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":224809383,"owners_count":17373603,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["ecmascript","javascript","monorepo","typescript"],"created_at":"2024-11-15T16:24:41.753Z","updated_at":"2025-05-09T03:30:23.685Z","avatar_url":"https://github.com/SAP-samples.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"[![CircleCI](https://circleci.com/gh/SAP-samples/ecmascript-monorepo-template.svg?style=svg)](https://circleci.com/gh/SAP-samples/ecmascript-monorepo-template)\n[![Coverage Status](https://coveralls.io/repos/github/SAP-samples/ecmascript-monorepo-template/badge.svg?branch=main)](https://coveralls.io/github/SAP-samples/ecmascript-monorepo-template?branch=main)\n[![Language grade: JavaScript](https://img.shields.io/lgtm/grade/javascript/g/SAP-samples/ecmascript-monorepo-template.svg?logo=lgtm\u0026logoWidth=18)](https://lgtm.com/projects/g/SAP-samples/ecmascript-monorepo-template/context:javascript)\n[![styled with prettier](https://img.shields.io/badge/styled_with-prettier-ff69b4.svg)](https://github.com/prettier/prettier)\n[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)\n[![DependentBot](https://api.dependabot.com/badges/status?host=github\u0026repo=SAP-samples/ecmascript-monorepo-template)](https://dependabot.com/)\n[![REUSE status](https://api.reuse.software/badge/github.com/SAP-samples/ecmascript-monorepo-template)](https://api.reuse.software/info/github.com/SAP-samples/ecmascript-monorepo-template)\n\n# ECMAScript Monorepo Template\n\n## Description\n\nAn **opinionated** template for [Monorepo](https://github.com/babel/babel/blob/master/doc/design/monorepo.md)\nand best practices for ECMAScript eco-system technologies and projects.\n\nThis repo contains several [sub-packages](./packages) each demonstrating\nbest practices in different ECMAScript related technology / scenario.\n\n## Sub-packages\n\n- [NPM JavaScript Library](./packages/npm_package_javascript_library)\n- [NPM TypeScript Library](./packages/npm_package_typescript_library)\n- [VSCode Simple Extension](./packages/vscode_simple_ext)\n- [Vue Frontend with RPC calls](./packages/vue_frontend_rpc)\n\n## Requirements\n\n- [Yarn 1](https://classic.yarnpkg.com/lang/en/)\n- [A Long Term Support version of node.js](https://nodejs.org/en/about/releases/)\n\n## How to use this repository\n\nThis repository is meant to be used as a starting point when creating a new monorepo project.\nThe consumption process is currently a **manual** step by step guide.\n\n### Common Modifications\n\n1. Clone/Copy/[Download][download] this repo.\n\n1. Choose which of the [sub-packages](./packages) templates are relevant to you, and delete the others.\n   - Note that some sub-packages depend on other sub-packages.\n1. Change the `name` fields of the remaining `packages/*/package.json` files to fit your new project.\n\n1. Delete the **contents** of the README.md files in both the root and the sub-packages.\n\n1. Reset the `version` field in the [lerna.json](./lerna.json) to your project's **initial** version number.\n\n   - Normally `0.1.0` or `0.0.1`.\n\n1. Adjust **coverage thresholds** in the [nyc.config.js](./nyc.config.js).\n   - By default, these are set to **100%**.\n1. Adjust [CONTRIBUTING.md code coverage section](./CONTRIBUTING.md#code-coverage).\n   - To align with the **coverage thresholds** defined in the [nyc.config.js](./nyc.config.js).\n   - Modify the `cla-assistant` link in the [CONTRIBUTING.md legal section](./CONTRIBUTING.md#legal).\n1. Update the Legal Related files (copyrights/notices/disclaimer).\n   - [./.reuse/dep5](./.reuse/dep5)\n   - [./LICENSES](./LICENSES)\n   - [./LICENSE](./LICENSE)\n\n[download]: https://github.com/SAP-samples/ecmascript-monorepo-template/archive/main.zip\n\n### Modifications dependent on selected sub-packages.\n\n1. If you kept VSCode extension templates, also adjust the `displayName` and `publisher` fields\n   in their `package.json` files to fit your new project.\n1. If you have not kept any VSCode extensions in your monorepo, remove the [root vscode webpack config](./webpack.config.vscode.base.js).\n\n1. Adjust the [circle-ci config.yml](./.circleci/config.yml).\n   There are three possible sections that may need to be removed (and their references):\n\n   - `deploy-npm` --\u003e if your project should not deploy any npm library to npmjs.com.\n   - `prepare-vsix` and `deploy-gh-releases` --\u003e if your project does not include VSCode extensions.\n\n1. Adjust the [.eslintrc.js](./.eslintrc.js) configuration.\n\n   - Remove `overrides` sections for no longer relevant file types:\n     - `[\"*.ts\"]` --\u003e if your monorepo does not contain any TypeScript sources (including `.d.ts` files).\n     - `[\"*.vue\"]` --\u003e if your monorepo does not contain any vue frontend projects.\n   - Remove `dev-depedencies` from the [root package.json](./package.json)\n     - `@typescript-eslint/*` --\u003e if your monorepo does not contain any TypeScript projects.\n     - `eslint-plugin-vue` --\u003e if your monorepo does not contain any vue frontend projects.\n\n1. Adjust root TypeScript configurations.\n\n   - Remove sub-project references that no longer exist from [root ./tsconfig.json](./tsconfig.json).\n   - If there are no references left in this file, and you do not plan on adding TypeScript projects\n     to your monorepo:\n     - Delete the [root ./tsconfig.json](./tsconfig.json).\n     - Delete the [root ./tsconfig.base.json](./tsconfig.base.json).\n     - Remove the `compile` and `compile:watch` scripts from the [root package.json](./packages).\n\n1. Adjust lint-staged configurations.\n   - Look for the `lint-staged` field and its keys in the [root package.json](./package.json).\n   - Remove file patterns that your repo no longer contains (or is expected to contain).\n     - For example if your monorepo does not contain a Vue frontend sub-package, you may remove the `vue` suffixes.\n\n### Final steps and testing dev flows.\n\nIn your terminal, navigate to root of the monorepo and:\n\n1. execute `yarn` to update the [yarn.lock](./yarn.lock) file.\n1. execute `yarn run ci` to test the full build flow.\n\nYou may now commit/push your new mono-repo template project to your new git repo and start coding.\n\n## How to obtain support\n\nPlease open an [issue](https://github.com/SAP-samples/ecmascript-monorepo-template/issues) on Github.\n\n## Contributing\n\nContributions are most welcome.\n\n- Please see the [Contributing Guide](./CONTRIBUTING.md) for docs about development flows.\n- Before implementing a major contribution please open an issue to discuss your contribution first.\n- Last but not least, please consider how your changes would affect **both** the:\n  - Root level dev flows (e.g needed adjustment for linting/formatting).\n  - Root level [usage/consumption instructions](./README.md#how-to-use-this-repository).\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FSAP-archive%2Fecmascript-monorepo-template","html_url":"https://awesome.ecosyste.ms/projects/github.com%2FSAP-archive%2Fecmascript-monorepo-template","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FSAP-archive%2Fecmascript-monorepo-template/lists"}