Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 18 additions & 0 deletions .changeset/config.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
{
"$schema": "https://unpkg.com/@changesets/config@3.1.1/schema.json",
"changelog": [
"@svitejs/changesets-changelog-github-compact",
{ "repo": "jsrepojs/example-monorepo" }
],
"commit": false,
"fixed": [],
"linked": [],
"access": "public",
"baseBranch": "main",
"updateInternalDependencies": "patch",
"ignore": [],
"privatePackages": {
"tag": true,
"version": true
}
}
6 changes: 6 additions & 0 deletions .changeset/poor-jobs-buy.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
---
"mono-one": patch
"mono-two": patch
---

chore: initial release
55 changes: 55 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
name: Release

on:
push:
branches:
- main

concurrency: ${{ github.workflow }}-${{ github.ref }}

jobs:
release:
name: Release
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: pnpm/action-setup@v4
- uses: actions/setup-node@v4
with:
node-version: 20
cache: pnpm

- name: Install dependencies
run: pnpm install

- name: Create Release Pull Request
id: changesets
uses: changesets/action@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

- name: Check if @example/mono-one was published
id: mono_one_published
run: |
echo '${{ steps.changesets.outputs.publishedPackages }}' | \
jq -e '.[] | select(.name == "mono-one")' > /dev/null && \
echo "was_published=true" >> $GITHUB_OUTPUT || \
echo "was_published=false" >> $GITHUB_OUTPUT
shell: bash

- name: Check if @example/mono-two was published
id: mono_two_published
run: |
echo '${{ steps.changesets.outputs.publishedPackages }}' | \
jq -e '.[] | select(.name == "mono-two")' > /dev/null && \
echo "was_published=true" >> $GITHUB_OUTPUT || \
echo "was_published=false" >> $GITHUB_OUTPUT
shell: bash

- name: Publish mono-one
if: steps.mono_one_published.outputs.was_published == 'true'
run: pnpm release:mono-one

- name: Publish mono-two
if: steps.mono_two_published.outputs.was_published == 'true'
run: pnpm release:mono-two
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
node_modules
5 changes: 5 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,2 +1,7 @@
# example-monorepo

An example of how to release multiple registries to jsrepo.com from the same repository.

## registries
- [@example/mono-one](https://www.jsrepo.com/@example/mono-one)
- [@example/mono-two](https://www.jsrepo.com/@example/mono-two)
30 changes: 30 additions & 0 deletions biome.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
{
"$schema": "https://biomejs.dev/schemas/1.9.4/schema.json",
"vcs": {
"enabled": false,
"clientKind": "git",
"useIgnoreFile": false
},
"files": {
"ignoreUnknown": false,
"ignore": []
},
"formatter": {
"enabled": true,
"indentStyle": "tab"
},
"organizeImports": {
"enabled": true
},
"linter": {
"enabled": true,
"rules": {
"recommended": true
}
},
"javascript": {
"formatter": {
"quoteStyle": "double"
}
}
}
28 changes: 28 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
{
"name": "example-monorepo",
"version": "0.0.0",
"description": "",
"main": "index.js",
"scripts": {
"format": "biome format --write",
"lint": "biome lint --write",
"check": "biome check",
"build:mono-one": "pnpm jsrepo build --no-output --preview --cwd ./registries/mono-one",
"release:mono-one": "pnpm -F mono-one release:registry",
"build:mono-two": "pnpm jsrepo build --no-output --preview --cwd ./registries/mono-two",
"release:mono-two": "pnpm -F mono-two release:registry",
"build:registries": "pnpm build:mono-one && pnpm build:mono-two"
},
"keywords": [],
"author": "",
"license": "ISC",
"packageManager": "pnpm@10.8.1",
"devDependencies": {
"@biomejs/biome": "^1.9.4",
"@changesets/cli": "^2.29.3",
"@svitejs/changesets-changelog-github-compact": "^1.2.0",
"concurrently": "^9.1.2",
"jsrepo": "^2.0.2",
"typescript": "^5.8.3"
}
}
Loading