Skip to content

Commit 5529bce

Browse files
committed
refactor: adopt monorepo structure
This adopts Lerna to assist with building a monorepo. I looked at pnpm and Yarn workspaces too--while these do some monorepo things, both are more primitive (and can actually be used by) Lerna, so I just stuck with that. As referenced in the issue, with this change the `protocol` gets symlinked into the other packages locally. I removed the separate generator package so that the `protocol` produces all the things it needs without having an extra dependency. Then, when we want to publish, one can `npm run version -- <version>`, which will run `lerna version` to update the version of all packages and push their tags. Packages get published from the Github workflow. Fixes #260
1 parent ef6c096 commit 5529bce

25 files changed

+13143
-2701
lines changed

.github/workflows/ci.yml

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
name: CI
2+
on: push
3+
4+
jobs:
5+
build:
6+
runs-on: ubuntu-latest
7+
steps:
8+
- uses: actions/checkout@v2
9+
- uses: actions/setup-node@v2
10+
with:
11+
node-version: ^16
12+
- run: npm ci
13+
- run: npm run compile
14+
- run: npm test
15+
16+
publish:
17+
runs-on: ubuntu-latest
18+
needs: build
19+
if: startsWith(github.ref, 'refs/tags/v')
20+
steps:
21+
- uses: actions/checkout@v2
22+
- uses: actions/setup-node@v2
23+
with:
24+
node-version: ^16
25+
- run: npm ci
26+
- run: npm run compile
27+
- run: npm test
28+
- run: npx [email protected] publish from-git
29+
env:
30+
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}

.gitignore

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,4 +29,5 @@ node_modules
2929
npm-debug.log
3030

3131
test.json
32-
debugProtocol2.d.ts
32+
debugProtocol2.d.ts
33+
*.tgz

0 commit comments

Comments
 (0)