This is a monorepo template that supports both NX or Lerna.
This repository is structured as a monorepo, meaning it hosts and manages multiple packages in the same repository. The packages are located under the packages/
directory.
To get started with this project, follow these steps:
- Clone the repository:
git clone <repository-url>
- Install dependencies:
npm install
- Bootstrap the packages:
npx lerna bootstrap
Run the script ./new-package.sh my-package this will create the new package for you on packages with needed changes. if you need additional steps excep the basic ones, go ahread and dd them nanualy to this newly created package.
To add a new TypeScript package to this monorepo, follow these steps:
- Navigate to the
packages/
directory. - Create a new directory for your package:
mkdir <package-name>
- Navigate into the new package directory:
cd <package-name>
- Initialize a new package:
npm init -y
- Update the
name
field in the generatedpackage.json
to match the format@<namespace>/<package-name>
- Install TypeScript and other necessary dependencies:
npm install typescript ts-node @types/node --save-dev
- Create a
tsconfig.json
file for TypeScript configuration. - Add any other dependencies your package needs:
npm install <dependency>
- Link the packages together:
npx lerna bootstrap
Remember to replace <package-name>
with the name of your package and <namespace>
with the namespace for your project (usually the project name). Also, replace <dependency>
with any dependencies your package needs.
In order to Understand if there are changes on the packages we use simple script within scripts/affected.ts Make sure to us ethe right version of it (NX/Lerna)
this script will check if pacakges updated since the last succesfull workflow.
This repository includes basic CI-CD Flows.
Simple CI process which will be triggered on every Push and will run basic operations to code base (npm install + build + lint + test)
A workflow that provides the developers the ability to test their module before publishing a concrete version.
How to use?
Once PR is ready for testing, developer can trigger manual action "PreRelease" to build the package and publish it to the Private Github NPM registry with temporary version for testing.
Once done the package will be found on the repo packages view with the new versione-template/assets/86892806/ff99f66e-4f0e-49c3-be5e-e2be35a68264">
How to Consume?
npm install @elementor/[email protected]
These workflows reponsible for acting when PR merged to master. the workflows will do the following:
- Bump the package version and Create a new release
- Publish a new Package to the github NPM Pri
This project is licensed under the MIT License - see the LICENSE.md
file for details