You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+2-2Lines changed: 2 additions & 2 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -34,13 +34,13 @@ To understand more about the structure and the design of the Toolkit check out t
34
34
35
35
## Setup & Development
36
36
37
-
This project uses [`lerna`](https://npm.im/lerna) as a tool to manage the monorepo. If you are unfamiliar with the tool, start by checking out the the [lerna docs](https://lerna.js.org/).
37
+
This project uses [`npm` workspaces](https://docs.npmjs.com/cli/v8/using-npm/workspaces) as a tool to manage the monorepo. If you are unfamiliar with the tool, start by checking out the the [`npm` docs](https://docs.npmjs.com/cli/v7/using-npm/workspaces) and make sure you use at least npm version 8 or newer (`npm install -g npm@8`).
Copy file name to clipboardExpand all lines: docs/CONTRIBUTING.md
+21-48Lines changed: 21 additions & 48 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -2,7 +2,7 @@
2
2
3
3
## About the Project
4
4
5
-
This project is a "monorepo" meaning it contains several Node.js packages in one repository. The code for all packages are in the [`packages/`](../packages) directory. We are using a tool called [Lerna](https://lerna.js.org) to manage those multiple packages.
5
+
This project is a "monorepo" meaning it contains several Node.js packages in one repository. The code for all packages are in the [`packages/`](../packages) directory. We are using a concept called [`npm` workspaces](https://docs.npmjs.com/cli/v8/using-npm/workspaces) to manage those multiple packages and a tool called [`changesets`](https://github.com/changesets/changesets) to handle the versioning and releasing.
6
6
7
7
## Before you contribute
8
8
@@ -14,10 +14,10 @@ If you are planning to contribute something that does not have an open issue yet
14
14
15
15
## Requirements
16
16
17
-
Make sure you have Node.js 12 or newer installed. Due to compatibility with Twilio
18
-
Functions this project has to support at least Node.js 12.0.0.
17
+
Make sure you have Node.js 14 or newer installed. Due to compatibility with Twilio
18
+
Functions this project has to support at least Node.js 14.0.0.
19
19
20
-
We are using the npm CLI to manage our project. You should be able to use yarn but you might hit some issues.
20
+
We are using the npm CLI to manage our project. You'll need at least `npm` version 8 or newer.
21
21
22
22
## Setup your local project
23
23
@@ -32,79 +32,52 @@ npm run bootstrap
32
32
33
33
## Contributing
34
34
35
-
1. Perform changes. Check out [Working with Lerna](#working-with-lerna) for more info
35
+
1. Perform changes. Check out [Working with Workspaces](#working-with-workspaces) for more info
36
36
2. Make sure tests pass by running `npm test`
37
37
3. Stage the files you changed by running `git add` with the files you changed.
38
-
4. Run `git commit` to kick off validation and enter your commit message. We are using [conventional commits](https://www.conventionalcommits.org/en/) for this project. When you run `npm run cm` it will trigger [`commitizen`](https://npm.im/commitizen) to assist you with your commit message.
39
-
5. Submit a Pull Request
38
+
4. If you have a customer facing change make sure to run `npm run changeset` at the root of the project, select what type of version change it is and which packages are impacted and describe the change. Check out ["How we version"](#how-we-version) for more details.
39
+
5. Run `git commit` to kick off validation and enter your commit message. We are using [conventional commits](https://www.conventionalcommits.org/en/) for this project. When you run `npm run cm` it will trigger [`commitizen`](https://npm.im/commitizen) to assist you with your commit message.
40
+
6. Push your changes and submit a Pull Request
40
41
41
42
**Working on your first Pull Request?** You can learn how from this _free_ series [How to Contribute to an Open Source Project on GitHub](https://egghead.io/series/how-to-contribute-to-an-open-source-project-on-github)
42
43
43
44
## For Maintainers: Releasing
44
45
45
-
This project uses [`lerna version`](https://www.npmjs.com/package/@lerna/version) to create new releases for any package needed, create the respective git tag and update the necessary `CHANGELOG.md` files. We always pass certain flags, so please use it via `npm run release`. Here are the steps you need to run to release a new version:
46
+
Version bumps are handled automatically by [this GitHub Action](../.github/workflows/on-merge-main.yml) whenever changes have been merged to `main`. If the automation will detect any changeset files inside the `.changeset` directory it will either open a new Pull Request to bump the version or force-push to the currently open Pull Request. In order to release to `npm` you'll have to merge that Pull Request which will automatically kick off the release.
46
47
47
-
### Pre-release version (from `main` or any `features/*` branch):
48
+
##How we version
48
49
49
-
For example to release a new pre-release version containing `beta` and releasing it as `next`:
50
+
All packages that are part of this project follow the [SemVer convention](https://semver.org/). Specifically this means the following version changes apply for the following changes:
51
+
-`no change` (no changeset) - Changes in `devDependencies`, changes at the root of the project that don't result in a compilation output change, test changes, documentation changes, etc.
52
+
-`patch` - Any changes that do not add new features such as bug fixes that are not altering the behavior
53
+
-`minor` - New features that are additive and are not breaking current behavior
54
+
-`major` - Any changes that are breaking changes incl. dropping support for features or arguments or drastic changes in behavior
50
55
51
-
```bash
52
-
npm run release -- --conventional-prerelease --exact --preid beta
53
-
git push origin main --follow-tags
54
-
npm run npm:publish -- --otp=<OTP> --dist-tag next
55
-
```
56
-
57
-
If you want to turn a prerelease into a permanent version you can use:
58
-
59
-
```bash
60
-
npm run release -- --conventional-commits --conventional-graduate
61
-
git push origin main --follow-tags
62
-
npm run npm:publish -- --otp=<OTP>
63
-
```
64
-
65
-
### Normal release (from `main` branch):
66
-
67
-
For a normal release `standard-version` will detect the version increment automatically. Run:
68
-
69
-
```bash
70
-
npm run release
71
-
git push origin main --follow-tags
72
-
npm run npm:publish -- --otp=<OTP>
73
-
```
74
-
75
-
To ship a specific version instead (like a forced minor bump) you can run:
76
-
77
-
```bash
78
-
npm run release -- minor
79
-
git push origin main --follow-tags
80
-
npm run npm:publish -- --otp=<OTP>
81
-
```
82
-
83
-
## Working with Lerna
56
+
## Working with Workspaces
84
57
85
58
### Linking Packages
86
59
87
-
Lerna will automatically link together the different dependencies that are part of the project. You can run `npm run bootstrap` to create the links.
60
+
npm will automatically link together the different dependencies that are part of the project when you run `npm install` at the root.
88
61
89
62
### Installing Dependencies
90
63
91
64
Dev dependencies should ideally be installed at the top level using `npm install --save-dev`. If you want to execute a binary from a dependency in a particular package you should install it in that particular package instead.
92
65
93
-
Installing dependencies for packages can be done in two ways. You can either use the [`lerna add` command](https://github.com/lerna/lerna/tree/master/commands/add) or using `npm install` inside the respective package.
66
+
Installing dependencies for packages can be done in two ways. You can either use the `npm install <package-name> -w <package-to-install-dependency-in>` command (ex. `npm install lodash -w @twilio-labs/serverless-api`) or using `npm install` inside the respective package.
94
67
95
68
The later might be the more intuitive one but it might cause some bootstraping issues.
96
69
97
70
### Running Scripts
98
71
99
72
Scripts that are on the top level can be run via `npm run <script>`.
100
73
101
-
If you want to run a script in every individual package where it is defined you can run: [`lerna run <script>`](https://github.com/lerna/lerna/tree/master/commands/run).
74
+
If you want to run a script in every individual package where it is defined you can run: [`npm run <script> --workspaces --if-present`](https://docs.npmjs.com/cli/v8/using-npm/workspaces?v=true#running-commands-in-the-context-of-workspaces).
102
75
103
-
To execute any bash command inside every package you can use [`lerna exec`](https://github.com/lerna/lerna/tree/master/commands/exec).
76
+
To execute any bash command inside every package you can use [`npm exec`](https://docs.npmjs.com/cli/v8/commands/npm-exec).
104
77
105
78
### Resetting dependencies
106
79
107
-
You can run `lerna clean` to delete all `node_modules` folder. To reinstall them run `npm run bootstrap`
80
+
You can run `npm run reset` to delete all `node_modules` folder. To reinstall them run `npm install`
Copy file name to clipboardExpand all lines: packages/README.md
+1-1Lines changed: 1 addition & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1,6 +1,6 @@
1
1
# Packages Overview
2
2
3
-
This repository is structured as a monorepo using [Lerna](https://lerna.js.org) and contains multiple packages:
3
+
This repository is structured as a monorepo using [`npm` workspaces](https://docs.npmjs.com/cli/v8/using-npm/workspaces) and contains multiple packages:
0 commit comments