Skip to content

Commit

Permalink
feat: migrate to yarn v4
Browse files Browse the repository at this point in the history
  • Loading branch information
JounQin committed Nov 7, 2023
1 parent 9438588 commit bccd955
Show file tree
Hide file tree
Showing 19 changed files with 21,795 additions and 16,255 deletions.
19 changes: 8 additions & 11 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@ jobs:
strategy:
matrix:
node:
- 16
- 18
- 20
os:
Expand All @@ -20,24 +19,22 @@ jobs:
runs-on: ${{ matrix.os }}
steps:
- name: Checkout Repo
uses: actions/checkout@v3

- name: Setup pnpm
uses: pnpm/action-setup@v2
with:
version: latest
uses: actions/checkout@v4

- name: Setup Node.js ${{ matrix.node }}
uses: actions/setup-node@v3
uses: actions/setup-node@v4
with:
node-version: ${{ matrix.node }}
cache: pnpm
cache: yarn

- name: Enable Corepack
run: corepack enable

- name: Install Dependencies
run: pnpm i
run: yarn --immutable

- name: Build, Lint and Test
run: pnpm run-s build lint test
run: yarn run-s build lint test
env:
EFF_NO_LINK_RULES: true
PARSER_NO_WATCH: true
Expand Down
13 changes: 8 additions & 5 deletions .github/workflows/codeql.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,13 @@ name: 'CodeQL'

on:
push:
branches: ['main']
branches:
- main
pull_request:
branches: ['main']
branches:
- main
schedule:
- cron: '49 1 * * 3'
- cron: '0 1 * * 3'

jobs:
analyze:
Expand All @@ -20,11 +22,12 @@ jobs:
strategy:
fail-fast: false
matrix:
language: [javascript]
language:
- javascript

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

- name: Initialize CodeQL
uses: github/codeql-action/init@v2
Expand Down
22 changes: 10 additions & 12 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,30 +11,28 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: Checkout Repo
uses: actions/checkout@v3
uses: actions/checkout@v4
with:
# This makes Actions fetch all Git history so that Changesets can generate changelogs with the correct commits
fetch-depth: 0

- name: Setup pnpm
uses: pnpm/action-setup@v2
- name: Setup Node.js 20
uses: actions/setup-node@v4
with:
version: latest
node-version: 20
cache: yarn

- name: Setup Node.js 16
uses: actions/setup-node@v3
with:
node-version: 16
cache: pnpm
- name: Enable Corepack
run: corepack enable

- name: Install Dependencies
run: pnpm i
run: yarn --immutable

- name: Create Release Pull Request or Publish to npm
uses: changesets/action@v1
with:
publish: pnpm release
version: pnpm run version
publish: yarn build && yarn changeset publish
version: yarn changeset version
commit: 'chore: release lib-boilerplate'
title: 'chore: release lib-boilerplate'
env:
Expand Down
20 changes: 9 additions & 11 deletions .github/workflows/size-limit.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,24 +9,22 @@ jobs:
size-limit:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4

- name: Setup pnpm
uses: pnpm/action-setup@v2
- name: Setup Node.js 20
uses: actions/setup-node@v4
with:
version: latest
node-version: 20
cache: yarn

- name: Setup Node.js 16
uses: actions/setup-node@v3
with:
node-version: 16
cache: pnpm
- name: Enable Corepack
run: corepack enable

- name: Install Dependencies
run: pnpm i
run: yarn --immutable

- uses: andresz1/size-limit-action@v1
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
skip_step: install
script: pnpm size-limit --json
script: yarn size-limit --json
2 changes: 1 addition & 1 deletion .github/workflows/vercel.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ jobs:
deploy:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4

- name: Check Branch
id: branch
Expand Down
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
.*cache
.type-coverage
.vercel
.yarn/*
!.yarn/plugins
coverage
dist
lib
Expand Down
14 changes: 0 additions & 14 deletions .npmrc

This file was deleted.

2 changes: 1 addition & 1 deletion .prettierignore
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
.type-coverage
.vercel
.yarn
coverage
dist
lib
/auto-imports.d.ts
/pnpm-lock.yaml
1 change: 1 addition & 0 deletions .stylelintignore
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ dist
lib
LICENSE
*.json
*.lock
*.log
*.patch
*.ts
Expand Down
1 change: 1 addition & 0 deletions .yarn/plugins/plugin-prepare-lifecycle.cjs
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
module.exports={name:"plugin-prepare-lifecycle",factory:e=>({hooks:{afterAllInstalled(r){if(!r.topLevelWorkspace.manifest.scripts.get("prepare"))return;e("@yarnpkg/shell").execute("yarn prepare")}}})};
8 changes: 8 additions & 0 deletions .yarnrc.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
compressionLevel: mixed

nodeLinker: node-modules

plugins:
- checksum: 37b2361b1502b2054e6779788c0e9bdd6a90ce49852a8cad2feda79b0614ec94f06fb6e78951f5f95429c610d7934dd077caa47413a0227378a102c55161616d
path: .yarn/plugins/plugin-prepare-lifecycle.cjs
spec: "https://github.com/un-es/yarn-plugin-prepare-lifecycle/releases/download/v0.0.1/index.js"
1 change: 1 addition & 0 deletions auto-imports.d.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
/* eslint-disable */
/* prettier-ignore */
// @ts-nocheck
// noinspection JSUnusedGlobalSymbols
// Generated by unplugin-auto-import
export {}
declare global {
Expand Down
2 changes: 1 addition & 1 deletion docs/vite.config.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import mdx from '@mdx-js/rollup'
import { react } from '@vitejs/plugin-react-swc'
import react from '@vitejs/plugin-react-swc'
import rehypeSlug from 'rehype-slug'
import remarkGfm from 'remark-gfm'
import { defineConfig } from 'vite'
Expand Down
77 changes: 37 additions & 40 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,72 +1,74 @@
{
"name": "lib-boilerplate",
"version": "0.0.2",
"version": "0.1.0",
"type": "module",
"description": "A simple library boilerplate.",
"repository": "git+https://github.com/un-ts/lib-boilerplate.git",
"author": "JounQin (https://www.1stG.me) <[email protected]>",
"funding": "https://opencollective.com/unts",
"license": "MIT",
"packageManager": "[email protected].1",
"packageManager": "[email protected].1",
"engines": {
"node": ">=16.0.0"
"node": ">=18.0.0"
},
"exports": "./src/index.ts",
"files": [
"lib",
"!**/*.tsbuildinfo"
],
"scripts": {
"build": "run-p build:*",
"build": "run-p 'build:*'",
"build:r": "r -f cjs",
"build:tsc": "tsc -p src",
"dev": "vitest",
"docs:build": "vite build docs",
"docs:build": "vite build docs --emptyOutDir",
"docs:dev": "vite docs",
"lint": "run-p lint:*",
"lint": "run-p 'lint:*'",
"lint:es": "eslint . --cache -f friendly --max-warnings 10",
"lint:style": "stylelint . --cache",
"lint:tsc": "tsc --noEmit",
"postversion": "pnpm i --no-frozen-lockfile",
"prepare": "simple-git-hooks",
"prerelease": "pnpm build",
"release": "changeset publish",
"serve": "vite preview docs",
"test": "vitest run --coverage",
"typecov": "type-coverage",
"vercel-build": "pnpm docs:build",
"version": "changeset version"
"vercel-build": "yarn docs:build"
},
"dependencies": {
"tslib": "^2.5.0"
"tslib": "^2.6.2"
},
"devDependencies": {
"@1stg/app-config": "^8.1.0",
"@1stg/lib-config": "^11.1.0",
"@1stg/app-config": "^9.0.0",
"@1stg/lib-config": "^12.0.0",
"@changesets/changelog-github": "^0.4.8",
"@changesets/cli": "^2.26.1",
"@mdx-js/rollup": "^2.3.0",
"@size-limit/preset-small-lib": "^8.2.4",
"@types/mdx": "^2.0.5",
"@types/node": "^18.16.3",
"@types/react": "^18.2.0",
"@types/react-dom": "^18.2.1",
"@types/web": "^0.0.99",
"@vitejs/plugin-react-swc": "^3.3.0",
"@vitest/coverage-istanbul": "^0.30.1",
"github-markdown-css": "^5.2.0",
"lib-boilerplate": "link:.",
"@changesets/cli": "^2.26.2",
"@mdx-js/rollup": "^3.0.0",
"@pkgr/rollup": "^4.1.3",
"@size-limit/preset-small-lib": "^10.0.2",
"@types/mdx": "^2.0.9",
"@types/node": "^20.8.10",
"@types/react": "^18.2.36",
"@types/react-dom": "^18.2.14",
"@types/web": "^0.0.119",
"@vitejs/plugin-react-swc": "^3.4.1",
"@vitest/coverage-v8": "^0.34.6",
"commitlint": "^18.2.0",
"eslint": "^8.53.0",
"github-markdown-css": "^5.4.0",
"lint-staged": "^13.3.0",
"npm-run-all": "^4.1.5",
"react": "^18.2.0",
"react-dom": "^18.2.0",
"react-router-dom": "^6.11.0",
"rehype-slug": "^5.1.0",
"remark-gfm": "^3.0.1",
"size-limit": "^8.2.4",
"type-coverage": "^2.25.0",
"typescript": "~5.0.4",
"unplugin-auto-import": "^0.15.3",
"vite": "^4.3.4",
"vitest": "^0.30.1"
"react-router-dom": "^6.18.0",
"rehype-slug": "^6.0.0",
"remark-gfm": "^4.0.0",
"simple-git-hooks": "^2.9.0",
"size-limit": "^10.0.2",
"stylelint": "^15.11.0",
"type-coverage": "^2.27.0",
"typescript": "^5.2.2",
"unplugin-auto-import": "^0.16.7",
"vite": "^4.5.0",
"vitest": "^0.34.6"
},
"publishConfig": {
"main": "./lib/index.cjs",
Expand All @@ -78,11 +80,6 @@
},
"types": "./lib/index.d.ts"
},
"pnpm": {
"patchedDependencies": {
"@vitejs/[email protected]": "patches/@[email protected]"
}
},
"size-limit": [
{
"path": "lib/index.js"
Expand Down
30 changes: 0 additions & 30 deletions patches/@[email protected]

This file was deleted.

Loading

0 comments on commit bccd955

Please sign in to comment.