Skip to content

Commit

Permalink
build: migrate to yarn v4 (#46)
Browse files Browse the repository at this point in the history
  • Loading branch information
JounQin authored Dec 7, 2023
1 parent 6fb3dcb commit 8a7c548
Show file tree
Hide file tree
Showing 19 changed files with 21,338 additions and 15,825 deletions.
2 changes: 1 addition & 1 deletion .codesandbox/ci.json
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
{
"node": "16",
"node": "18",
"sandboxes": []
}
20 changes: 9 additions & 11 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,33 +10,31 @@ jobs:
strategy:
matrix:
node:
- 16
- 18
- 20
os:
- macos-latest
- windows-latest
# - windows-latest
- ubuntu-latest
runs-on: ${{ matrix.os }}
steps:
- name: Checkout Repo
uses: actions/checkout@v3
uses: actions/checkout@v4

- name: Setup pnpm
uses: pnpm/action-setup@v2
with:
version: latest
- name: Enable Corepack
run: corepack enable

- 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: Install Dependencies
run: pnpm i
run: yarn --immutable

- name: Build, Lint and Test
run: pnpm run-s build lint test typecov
run: yarn run-s build lint test typecov
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
@@ -1,10 +1,12 @@
name: 'CodeQL'
name: CodeQL

on:
push:
branches: ['main']
branches:
- main
pull_request:
branches: ['main']
branches:
- main
schedule:
- cron: '38 16 * * 3'

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
11 changes: 7 additions & 4 deletions .github/workflows/pkg-size.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,12 +12,15 @@ jobs:

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

- name: Setup Node.js
uses: actions/setup-node@v3
- name: Enable Corepack
run: corepack enable

- name: Setup Node.js LTS
uses: actions/setup-node@v4
with:
node-version: 16
node-version: lts/*

- name: Package Size Report
uses: pkg-size/action@v1
Expand Down
20 changes: 9 additions & 11 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,31 +11,29 @@ 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
with:
version: latest
- name: Enable Corepack
run: corepack enable

- name: Setup Node.js 16
- name: Setup Node.js LTS
uses: actions/setup-node@v3
with:
node-version: 16
cache: pnpm
node-version: lts/*
cache: yarn

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

- name: Create Release Pull Request or Publish to npm
id: changesets
uses: changesets/action@v1
with:
publish: pnpm release
version: pnpm run version
publish: yarn release
version: yarn run version
commit: 'chore: release package(s)'
title: 'chore: release package(s)'
env:
Expand Down
6 changes: 3 additions & 3 deletions .github/workflows/vercel.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,14 +10,14 @@ jobs:
deploy:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4

- name: Check Branch
id: branch
if: ${{ github.ref == 'refs/heads/main' }}
run: |
echo "::set-output name=args::--prod"
echo "::set-output name=comment::false"
echo "args=--prod" >> $GITHUB_OUTPUT
echo "comment=false" >> $GITHUB_OUTPUT
- name: Deploy
uses: amondnet/vercel-action@v25
Expand Down
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@
.*cache
.type-coverage
.vercel
.yarn/*
!.yarn/plugins
coverage
lib
node_modules
18 changes: 0 additions & 18 deletions .npmrc

This file was deleted.

1 change: 1 addition & 0 deletions .prettierignore
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
.type-coverage
.vercel
.yarn
coverage
dist
/auto-imports.d.ts
Expand Down
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
*.ts
*.tsbuildinfo
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
84 changes: 49 additions & 35 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,64 +10,74 @@
"workspaces": [
"packages/*"
],
"packageManager": "[email protected]",
"packageManager": "[email protected]",
"scripts": {
"build": "run-p build:*",
"build": "run-p 'build:*'",
"build:r": "r -f cjs",
"build:tsc": "tsc -b",
"clean": "rimraf packages/**/{lib,*.tsbuildinfo}",
"clean": "rimraf -g 'packages/**/{lib,*.tsbuildinfo}'",
"dev": "vite dev",
"lint": "run-p lint:*",
"lint": "run-p 'lint:*'",
"lint:es": "eslint . --cache -f friendly",
"lint:style": "stylelint . --cache",
"lint:tsc": "tsc --noEmit",
"postversion": "pnpm i --no-frozen-lockfile",
"prepare": "simple-git-hooks",
"prerelease": "pnpm build",
"prevercel-build": "pnpm build",
"release": "changeset publish",
"release": "yarn build && changeset publish",
"serve": "sirv dist -s",
"test": "vitest run --coverage",
"typecov": "type-coverage",
"vercel-build": "vite build",
"version": "changeset version"
"vercel-build": "yarn build && vite build",
"version": "changeset version && yarn --no-immutable"
},
"devDependencies": {
"@1stg/app-config": "^8.0.1",
"@1stg/lib-config": "^11.0.1",
"@changesets/changelog-github": "^0.4.8",
"@changesets/cli": "^2.26.1",
"@mdx-js/rollup": "^2.3.0",
"@types/node": "^18.15.11",
"@types/react": "^18.0.33",
"@types/react-dom": "^18.0.11",
"@types/web": "^0.0.99",
"@vitejs/plugin-react-swc": "^3.3.0",
"@vitest/coverage-istanbul": "^0.29.8",
"github-markdown-css": "^5.2.0",
"pkg": "workspace:*",
"@1stg/app-config": "^9.0.0",
"@1stg/lib-config": "^12.0.0",
"@changesets/changelog-github": "^0.5.0",
"@changesets/cli": "^2.27.1",
"@commitlint/cli": "^18.4.3",
"@mdx-js/rollup": "^3.0.0",
"@pkgr/rollup": "^4.1.3",
"@types/node": "^18.19.3",
"@types/react": "^18.2.42",
"@types/react-dom": "^18.2.17",
"@types/web": "^0.0.125",
"@vitejs/plugin-react-swc": "^3.5.0",
"@vitest/coverage-istanbul": "^1.0.2",
"eslint": "^8.55.0",
"github-markdown-css": "^5.4.0",
"lint-staged": "^15.2.0",
"npm-run-all": "^4.1.5",
"pkg": "link:packages/pkg",
"react": "^18.2.0",
"react-dom": "^18.2.0",
"react-router-dom": "^6.10.0",
"remark-gfm": "^3.0.1",
"sass": "^1.61.0",
"react-router-dom": "^6.20.1",
"remark-gfm": "^4.0.0",
"rimraf": "^5.0.5",
"sass": "^1.69.5",
"simple-git-hooks": "^2.9.0",
"sirv-cli": "^2.0.2",
"tsx": "^3.12.6",
"type-coverage": "^2.25.0",
"typescript": "^5.0.4",
"unplugin-auto-import": "^0.15.2",
"vite": "^4.2.1",
"vitest": "^0.29.8"
"stylelint": "^15.11.0",
"tsx": "^4.6.1",
"type-coverage": "^2.27.0",
"typescript": "^5.3.3",
"unplugin-auto-import": "^0.17.2",
"vite": "^5.0.6",
"vitest": "^1.0.2"
},
"resolutions": {
"prettier": "^2.8.7"
"@commitlint/cli": "^18.4.3",
"esbuild": "^0.19.8",
"lint-staged": "^15.2.0",
"prettier": "^2.8.8",
"rollup": "^4.6.1"
},
"commitlint": {
"extends": "@1stg"
},
"eslintConfig": {
"extends": "@1stg",
"rules": {
"markup/markup": "off",
"react/react-in-jsx-scope": "off"
}
},
Expand All @@ -77,7 +87,7 @@
"lib",
"/packages/**/CHANGELOG.md",
"/auto-imports.d.ts",
"/pnpm-lock.yaml",
"/yarn-lock.yaml",
"!/.github",
"!/.*.cjs"
],
Expand All @@ -93,7 +103,11 @@
]
},
"stylelint": {
"extends": "@1stg/stylelint-config"
"extends": "@1stg/stylelint-config",
"rules": {
"scss/at-import-no-partial-leading-underscore": null,
"scss/load-no-partial-leading-underscore": true
}
},
"typeCoverage": {
"atLeast": 100,
Expand Down
2 changes: 1 addition & 1 deletion packages/pkg/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
"lib"
],
"dependencies": {
"tslib": "^2.5.0"
"tslib": "^2.6.2"
},
"publishConfig": {
"access": "public",
Expand Down
Loading

0 comments on commit 8a7c548

Please sign in to comment.