Skip to content

Commit

Permalink
chore: Refactor monorepo tooling and add Rsbuild configs packages (#225)
Browse files Browse the repository at this point in the history
* More stuff

* More stuff

* More stuff

* More stuff

* More stuff

* More stuff

* More stuff

* More stuff

* More stuff

* More stuff

* More stuff

* More stuff

* More stuff

* More stuff

* More stuff

* More stuff

* More stuff

* More stuff

* More stuff

* More stuff

* More stuff

* More stuff

* More stuff

* More stuff

* More stuff

* More stuff

* More stuff

* More stuff

* More stuff

* More stuff

* More stuff

* More stuff

* More stuff

* More stuff

* More stuff

* More stuff

* Minor fixes

* More stuff

* More stuff

* More stuff

* More stuff

* More stuff
  • Loading branch information
patricklafrance authored Dec 16, 2024
1 parent 183c978 commit 4eb46d6
Show file tree
Hide file tree
Showing 476 changed files with 18,529 additions and 8,715 deletions.
2 changes: 1 addition & 1 deletion .changeset/config.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
"access": "restricted",
"baseBranch": "main",
"updateInternalDependencies": "patch",
"ignore": ["@basic/*", "@endpoints/*"],
"ignore": ["@basic/*", "@basic-webpack/*", "@basic-mix/*", "@endpoints/*"],
"___experimentalUnsafeOptions_WILL_CHANGE_IN_PATCH": {
"onlyUpdatePeerDependentsWhenOutOfRange": true
}
Expand Down
5 changes: 5 additions & 0 deletions .changeset/old-mugs-tease.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@squide/firefly-webpack-configs": patch
---

Added additional shared dependencies for Honeycomb.
5 changes: 5 additions & 0 deletions .changeset/olive-waves-sin.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@squide/firefly-rsbuild-configs": major
---

New Rsbuild shared configs adapted for Squide firefly apps.
5 changes: 5 additions & 0 deletions .changeset/plenty-walls-glow.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@squide/react-router": patch
---

Fixed an error message.
5 changes: 5 additions & 0 deletions .changeset/wicked-spiders-cover.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@squide/firefly-honeycomb": major
---

Added "@opentelemetry/instrumentation-fetch" and "@opentelemetry/sdk-trace-web" as peerDependencies.
2 changes: 0 additions & 2 deletions .eslintignore
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
**/dist/*
**/__snapshots__/*
node_modules
*.md
*.yml
Expand Down
30 changes: 19 additions & 11 deletions .github/workflows/changeset.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,32 +23,40 @@ jobs:
fetch-depth: 0

- name: Install pnpm
uses: pnpm/action-setup@v3
uses: pnpm/action-setup@v4
with:
version: 9
run_install: false

- name: Install Node.js
uses: actions/setup-node@v4
with:
node-version: ">=21.1.0"
check-latest: true,
node-version: ">=22.0.0"
check-latest: true
cache: pnpm
cache-dependency-path: pnpm-lock.yaml

- name: Install Dependencies
run: pnpm install --frozen-lockfile

- name: Cache turborepo
uses: actions/cache@v4
- name: Restore Turborepo cache
id: cache-turborepo-restore
uses: actions/cache/restore@v4
with:
path: node_modules/.cache/turbo
key: ${{ runner.os }}-turbo-${{ github.sha }}
key: ${{ runner.os }}-turborepo-${{ github.sha }}
restore-keys: |
${{ runner.os }}-turbo-
save-always: true
${{ runner.os }}-turborepo-
path: .turbo

- name: Build packages
run: pnpm ci-build
run: pnpm build-pkg

- name: Save Turborepo cache
id: cache-turborepo-save
if: always() && steps.cache-turborepo-restore.outputs.cache-hit != 'true'
uses: actions/cache/save@v4
with:
key: ${{ steps.cache-turborepo-restore.outputs.cache-primary-key }}
path: .turbo

- name: Create release Pull Request or publish to NPM
uses: changesets/action@v1
Expand Down
69 changes: 29 additions & 40 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
name: CI

# Pnpm setup based on https://github.com/pnpm/action-setup#use-cache-to-reduce-installation-time
# PNPM setup based on https://github.com/pnpm/action-setup#use-cache-to-reduce-installation-time

on:
push:
Expand All @@ -24,66 +24,55 @@ jobs:
uses: actions/checkout@v4

- name: Install pnpm
uses: pnpm/action-setup@v3
uses: pnpm/action-setup@v4
with:
version: 9
run_install: false

- name: Install Node.js
uses: actions/setup-node@v4
with:
node-version: ">=21.1.0"
node-version: ">=22.0.0"
check-latest: true
cache: pnpm
cache-dependency-path: pnpm-lock.yaml

- name: Install dependencies
run: pnpm install --frozen-lockfile

- name: Cache Turborepo
uses: actions/cache@v4
- name: Restore Turborepo cache
id: cache-turborepo-restore
uses: actions/cache/restore@v4
with:
path: node_modules/.cache/turbo
key: ${{ runner.os }}-turbo-${{ github.sha }}
key: ${{ runner.os }}-turborepo-${{ github.sha }}
restore-keys: |
${{ runner.os }}-turbo-
save-always: true
${{ runner.os }}-turborepo-
path: .turbo

- name: Cache ESLint
uses: actions/cache@v4
with:
path: node_modules/.cache/eslint
key: ${{ runner.os }}-eslint-${{ github.sha }}
restore-keys: |
${{ runner.os }}-eslint-
save-always: true

- name: Cache Knip
uses: actions/cache@v4
with:
path: node_modules/.cache/knip
key: ${{ runner.os }}-knip-${{ github.sha }}
restore-keys: |
${{ runner.os }}-knip-
save-always: true

- name: Cache Jest
uses: actions/cache@v4
with:
path: packages/**/node_modules/.cache/jest
key: ${{ runner.os }}-jest-${{ hashFiles('packages/**/node_modules/.cache/jest') }}
save-always: true
- name: Lint packages & samples
run: pnpm lint

- name: Build packages
run: pnpm ci-build
run: pnpm build-pkg

- name: Build basic sample
run: pnpm ci-build-basic
run: pnpm build-basic

- name: Build endpoints sample
run: pnpm ci-build-endpoints
- name: Build basic webpack sample
run: pnpm build-basic-webpack

- name: Lint packages & samples
run: pnpm lint
- name: Build basic mix sample
run: pnpm build-basic-mix

- name: Build endpoints sample
run: pnpm build-endpoints

- name: Test packages
run: pnpm test

- name: Save Turborepo cache
id: cache-turborepo-save
if: always() && steps.cache-turborepo-restore.outputs.cache-hit != 'true'
uses: actions/cache/save@v4
with:
key: ${{ steps.cache-turborepo-restore.outputs.cache-primary-key }}
path: .turbo
63 changes: 63 additions & 0 deletions .github/workflows/pr-pkg.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,63 @@
name: Publish PR packages

# PNPM setup based on https://github.com/pnpm/action-setup#use-cache-to-reduce-installation-time

on:
push:
branches: ["main"]
pull_request:
branches: ["main"]

env:
CI: true

concurrency:
group: pr-pkg-${{ github.ref }}
cancel-in-progress: true

jobs:
build:
runs-on: ubuntu-latest

steps:
- name: Checkout
uses: actions/checkout@v4

- name: Install pnpm
uses: pnpm/action-setup@v4
with:
run_install: false

- name: Install Node.js
uses: actions/setup-node@v4
with:
node-version: ">=22.0.0"
check-latest: true
cache: pnpm
cache-dependency-path: pnpm-lock.yaml

- name: Install dependencies
run: pnpm install --frozen-lockfile

- name: Restore Turborepo cache
id: cache-turborepo-restore
uses: actions/cache/restore@v4
with:
key: ${{ runner.os }}-turborepo-${{ github.sha }}
restore-keys: |
${{ runner.os }}-turborepo-
path: .turbo

- name: Build packages
run: pnpm build-pkg

- name: Save Turborepo cache
id: cache-turborepo-save
if: always() && steps.cache-turborepo-restore.outputs.cache-hit != 'true'
uses: actions/cache/save@v4
with:
key: ${{ steps.cache-turborepo-restore.outputs.cache-primary-key }}
path: .turbo

- name: Publish PR packages
run: pnpm publish-pr-pkg
6 changes: 5 additions & 1 deletion .github/workflows/retype-action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,13 @@ jobs:
steps:
- uses: actions/checkout@v4

- uses: actions/setup-dotnet@v1
with:
dotnet-version: 7.0.x

- uses: retypeapp/action-build@latest
with:
license: ${{ secrets.RETYPE_API_KEY }}
license: ${{ secrets.RETYPE_API_KEY }}

- uses: retypeapp/action-github-pages@latest
with:
Expand Down
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ dist
.pnpm-debug.log*
.netlify
.turbo
.rslib
.retype

# Mac
Expand Down
42 changes: 42 additions & 0 deletions .syncpackrc.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
// @ts-check

/** @type {import("syncpack").RcFile} */
export default {
"lintFormatting": false,
"dependencyTypes": ["prod", "dev"],
"semverGroups": [
{
"dependencies": ["useless-lib"],
"packages": ["**"],
"isIgnored": true
},
{
"range": "^",
"dependencyTypes": ["prod"],
"dependencies": ["**"],
"packages": ["@squide/firefly-rsbuild-configs", "@squide/firefly-webpack-configs"],
"label": "config packages dependencies version should be ranged"
},
{
"range": "",
"dependencyTypes": ["prod", "dev"],
"dependencies": ["**"],
"packages": ["**"],
"label": "packages version should be pinned"
},
],
"versionGroups": [
{
"dependencies": ["useless-lib"],
"packages": ["**"],
"isIgnored": true
},
{
"dependencyTypes": ["prod", "dev"],
"preferVersion": "highestSemver",
"dependencies": ["**"],
"packages": ["**"],
"label": "packages should have a single version across the repository"
}
]
};
3 changes: 2 additions & 1 deletion .vscode/settings.json
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@

// Settings for third parties that are frequently used
"files.associations": {
"*.snap": "javascriptreact"
"*.snap": "javascriptreact",
"turbo.json": "jsonc"
}
}
Loading

0 comments on commit 4eb46d6

Please sign in to comment.