Skip to content

Commit 499fda4

Browse files
authored
create npm workspace for monorepo (#1093)
* create npm workspace for monorepo * Update Actions * add README
1 parent 17fb929 commit 499fda4

File tree

6 files changed

+74
-52
lines changed

6 files changed

+74
-52
lines changed

.github/workflows/cd.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -28,9 +28,9 @@ jobs:
2828
node-version: "lts/*"
2929
registry-url: "https://registry.npmjs.org"
3030
- run: npm ci
31-
- run: npm run build
32-
- run: npm publish
31+
- run: npm run build --workspaces --if-present
32+
- run: npm publish --workspaces
3333
if: "!github.event.release.prerelease"
3434
# npm requires explicitly specifying a "tag" like `next` if the semantic version is a prerelease like `2.0.0-alpha1`
35-
- run: npm publish --tag next
35+
- run: npm publish --workspaces --tag next
3636
if: github.event.release.prerelease

.github/workflows/docs.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,12 +29,12 @@ jobs:
2929
- name: Install
3030
run: npm ci
3131
- name: Generate docs
32-
run: npm run doc
32+
run: npm run doc --workspace packages/roslib
3333
- name: Upload static files as artifact
3434
id: deployment
3535
uses: actions/upload-pages-artifact@v4
3636
with:
37-
path: docs/
37+
path: packages/roslib/docs/
3838

3939
deploy:
4040
needs: build

.github/workflows/main.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -38,10 +38,10 @@ jobs:
3838
run: npm ci
3939

4040
- name: Build JavaScript library
41-
run: npm run build
41+
run: npm run build --workspaces --if-present
4242

4343
- name: Run tests
44-
run: npm test
44+
run: npm test --workspaces --if-present
4545

4646
docs:
4747
uses: ./.github/workflows/docs.yml

README.md

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
# Robot Web Tools JavaScript Client Libraries
2+
3+
This is the monorepo for RobotWebTools JavaScript client libraries.
4+
See the READMEs of individual packages for more information.
5+
6+
## Packages
7+
8+
- [roslibjs](./packages/roslib/README.md)

packages/roslib/package-lock.json renamed to package-lock.json

Lines changed: 53 additions & 45 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
{
2+
"name": "@robot-web-tools/workspace",
3+
"workspaces": [
4+
"packages/*"
5+
]
6+
}

0 commit comments

Comments
 (0)