Skip to content

Commit

Permalink
chore: Upgrade repo infrastructure (#215)
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
  • Loading branch information
patricklafrance authored Dec 11, 2024
1 parent b7d90da commit d6dfe8f
Show file tree
Hide file tree
Showing 75 changed files with 5,618 additions and 5,675 deletions.
5 changes: 5 additions & 0 deletions .changeset/fifty-owls-compare.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@workleap/eslint-plugin": patch
---

Move some deprecated rules from `@typescript-eslint/eslint-plugin` to `@stylistic/eslint-plugin-ts`.
5 changes: 5 additions & 0 deletions .changeset/serious-mugs-love.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@workleap/webpack-configs": patch
---

Fixed typings.
1 change: 0 additions & 1 deletion .eslintignore
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
**/dist/*
node_modules
pnpm-lock.yaml
*.md
Expand Down
50 changes: 29 additions & 21 deletions .github/workflows/changeset.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,45 +18,53 @@ jobs:

steps:
- name: Checkout
uses: actions/checkout@v3
uses: actions/checkout@v4
with:
fetch-depth: 0

- name: Install Node.js
uses: actions/setup-node@v3

- name: Install pnpm
uses: pnpm/action-setup@v2
id: pnpm-install
uses: pnpm/action-setup@v4
with:
version: 9.*
run_install: false

- name: Get pnpm store directory
id: pnpm-cache
shell: bash
run: |
echo "STORE_PATH=$(pnpm store path)" >> $GITHUB_OUTPUT
- 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: Setup pnpm cache
uses: actions/cache@v3
- name: Restore Turborepo cache
id: cache-turborepo-restore
uses: actions/cache/restore@v4
with:
path: ${{ steps.pnpm-cache.outputs.STORE_PATH }}
key: ${{ runner.os }}-pnpm-store-${{ hashFiles('**/pnpm-lock.yaml') }}
key: ${{ runner.os }}-turborepo-${{ github.sha }}
restore-keys: |
${{ runner.os }}-pnpm-store-
${{ runner.os }}-turborepo-
path: .turbo

- name: Install Dependencies
run: pnpm i --frozen-lockfile
- 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: Create release Pull Request or publish to NPM
uses: changesets/action@v1
with:
commit: "ci(changesets): version packages"
title: "Changeset: New Version"
# This expects you to have a script called release which does a build for your packages and calls changeset publish
publish: pnpm run ci-release
publish: pnpm publish-pkg
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
NPM_TOKEN: ${{ secrets.WORKLEAP_NPM_TOKEN }}

54 changes: 28 additions & 26 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 @@ -23,45 +23,47 @@ jobs:
- 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: ">=20.0.0"
node-version: ">=22.0.0"
check-latest: true
cache: pnpm
cache-dependency-path: pnpm-lock.yaml

- uses: pnpm/action-setup@v3
name: Install pnpm
id: pnpm-install
with:
version: 9.*
run_install: false

- name: Get pnpm store directory
id: pnpm-cache
shell: bash
run: |
echo "STORE_PATH=$(pnpm store path)" >> $GITHUB_OUTPUT
- name: Install dependencies
run: pnpm install --frozen-lockfile

- name: Setup pnpm cache
uses: actions/cache@v4
- name: Restore Turborepo cache
id: cache-turborepo-restore
uses: actions/cache/restore@v4
with:
path: ${{ steps.pnpm-cache.outputs.STORE_PATH }}
key: ${{ runner.os }}-pnpm-store-${{ hashFiles('**/pnpm-lock.yaml') }}
key: ${{ runner.os }}-turborepo-${{ github.sha }}
restore-keys: |
${{ runner.os }}-pnpm-store-
${{ runner.os }}-turborepo-
path: .turbo

- name: Install dependencies
run: pnpm i --frozen-lockfile
- name: Lint packages & sample
run: pnpm lint

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

- name: Build sample
run: pnpm build-sample

- name: Lint packages & sample
run: pnpm lint

- 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
38 changes: 7 additions & 31 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,35 +1,11 @@
# See https://help.github.com/articles/ignoring-files/ for more about ignoring files.

# rider / intellij
.idea

# dependencies
node_modules
.pnp
.pnp.js

# testing
coverage

# next.js
.next/
out/
build
dist
.pnpm-debug.log*
.netlify
.turbo
.rslib
.retype

# misc
# Mac
.DS_Store
*.pem

# debug
npm-debug.log*
yarn-debug.log*
yarn-error.log*
.pnpm-debug.log*

# local env files
.env.local
.env.development.local
.env.test.local
.env.production.local

dist
31 changes: 31 additions & 0 deletions .syncpackrc.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
// @ts-check

/** @type {import("syncpack").RcFile} */
export default {
"lintFormatting": false,
"dependencyTypes": ["prod", "dev"],
"semverGroups": [
{
"range": "^",
"dependencyTypes": ["prod"],
"dependencies": ["**"],
"packages": ["@workleap/**"]
},
{
"range": "",
"dependencyTypes": ["prod", "dev"],
"dependencies": ["**"],
"packages": ["**"],
"label": "packages version should be pinned"
},
],
"versionGroups": [
{
"dependencyTypes": ["prod", "dev"],
"preferVersion": "highestSemver",
"dependencies": ["**"],
"packages": ["**"],
"label": "packages should have a single version across the repository"
}
]
};
5 changes: 3 additions & 2 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
Expand Up @@ -33,13 +33,14 @@

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

// ESLint extension
"eslint.validate": [
"javascript",
"javascriptreact",
"yaml"
]
]
}
Loading

0 comments on commit d6dfe8f

Please sign in to comment.