Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

build: migrate to yarn v4 #157

Merged
merged 1 commit into from
Jan 4, 2024
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
22 changes: 20 additions & 2 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,29 +18,47 @@ jobs:
- macos-latest
- ubuntu-latest
- windows-latest
exclude:
- node: 16
os: windows-latest
runs-on: ${{ matrix.os }}
steps:
- name: Checkout Repo
uses: actions/checkout@v4

- name: Enable Corepack
run: corepack enable

- name: Setup Node.js ${{ matrix.node }}
uses: actions/setup-node@v4
with:
node-version: ${{ matrix.node }}
cache: yarn
env:
# https://github.com/actions/setup-node/issues/531#issuecomment-1819151412
SKIP_YARN_COREPACK_CHECK: 1
YARN_IGNORE_NODE: 1

- name: Install Dependencies
run: yarn --frozen-lockfile --ignore-engines
run: yarn --immutable
env:
SKIP_YARN_COREPACK_CHECK: 1
YARN_IGNORE_NODE: 1

- name: Build, Lint and Test
run: yarn cross-env SYNCKIT_TIMEOUT=10000 run-s build lint test
run: yarn cross-env SYNCKIT_TIMEOUT=10000 concurrently -r -m 1 yarn:build yarn:lint yarn:test
env:
EFF_NO_LINK_RULES: true
PARSER_NO_WATCH: true
SKIP_YARN_COREPACK_CHECK: 1
YARN_IGNORE_NODE: 1

- name: Benchmark
run: yarn benchmark
continue-on-error: ${{ matrix.node == 20 }}
env:
SKIP_YARN_COREPACK_CHECK: 1
YARN_IGNORE_NODE: 1

- name: Codecov
uses: codecov/codecov-action@v3
Expand Down
8 changes: 4 additions & 4 deletions .github/workflows/codeql.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: 'CodeQL'
name: CodeQL

on:
push:
Expand Down Expand Up @@ -30,15 +30,15 @@ jobs:
uses: actions/checkout@v4

- name: Initialize CodeQL
uses: github/codeql-action/init@v2
uses: github/codeql-action/init@v3
with:
languages: ${{ matrix.language }}
queries: +security-and-quality

- name: Autobuild
uses: github/codeql-action/autobuild@v2
uses: github/codeql-action/autobuild@v3

- name: Perform CodeQL Analysis
uses: github/codeql-action/analyze@v2
uses: github/codeql-action/analyze@v3
with:
category: '/language:${{ matrix.language }}'
9 changes: 6 additions & 3 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,14 +16,17 @@ jobs:
# This makes Actions fetch all Git history so that Changesets can generate changelogs with the correct commits
fetch-depth: 0

- name: Enable Corepack
run: corepack enable

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

- name: Install Dependencies
run: yarn --frozen-lockfile
run: yarn --immutable

- name: Build
run: yarn build
Expand All @@ -32,10 +35,10 @@ jobs:
id: changesets
uses: changesets/action@v1
with:
# This expects you to have a script called release which does a build for your packages and calls changeset publish
publish: npm run release
commit: 'chore: release synckit'
title: 'chore: release synckit'
version: yarn run version
publish: npm run release
env:
GITHUB_TOKEN: ${{ secrets.GH_TOKEN }}
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
.*cache
tmp*
.type-coverage
.yarn/*
!.yarn/plugins
coverage
lib
node_modules
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")}}})};
6 changes: 6 additions & 0 deletions .yarnrc.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
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"
2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -168,6 +168,8 @@ You can try it with running `yarn benchmark` by yourself. [Here](./benchmarks/be

## Backers

[![Backers](https://raw.githubusercontent.com/1stG/static/master/sponsors.svg)](https://github.com/sponsors/JounQin)

| 1stG | RxTS | UnTS |
| -------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------- |
| [![1stG Open Collective backers and sponsors](https://opencollective.com/1stG/individuals.svg)](https://opencollective.com/1stG) | [![RxTS Open Collective backers and sponsors](https://opencollective.com/rxts/individuals.svg)](https://opencollective.com/rxts) | [![UnTS Open Collective backers and sponsors](https://opencollective.com/unts/individuals.svg)](https://opencollective.com/unts) |
Expand Down
28 changes: 18 additions & 10 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
"author": "JounQin (https://www.1stG.me) <[email protected]>",
"funding": "https://opencollective.com/unts",
"license": "MIT",
"packageManager": "yarn@1.22.21",
"packageManager": "yarn@4.0.2",
"engines": {
"node": "^14.18.0 || >=16.0.0"
},
Expand All @@ -34,51 +34,59 @@
"synckit"
],
"scripts": {
"benchmark": "run-s benchmark:*",
"benchmark-export": "run-s benchmark-export:*",
"benchmark": "concurrently -r -m 1 'yarn:benchmark:*'",
"benchmark-export": "concurrently -r -m 1 'yarn:benchmark-export:*'",
"benchmark-export:cjs": "yarn benchmark:cjs > benchmarks/benchmark.cjs.txt",
"benchmark-export:esm": "yarn benchmark:esm> benchmarks/benchmark.esm.txt",
"benchmark:cjs": "node benchmarks/benchmark.cjs",
"benchmark:esm": "node benchmarks/benchmark.js",
"build": "run-p build:*",
"build": "concurrently -r 'yarn:build:*'",
"build:r": "r -f cjs",
"build:ts": "tsc -p src",
"lint": "run-p lint:*",
"lint": "concurrently -r 'yarn:lint:*'",
"lint:es": "eslint . --cache -f friendly --max-warnings 10",
"lint:tsc": "tsc --noEmit",
"prepare": "patch-package && simple-git-hooks && yarn-deduplicate --strategy fewer || exit 0",
"prepare": "patch-package && simple-git-hooks",
"release": "clean-pkg-json && changeset publish",
"test": "node --experimental-vm-modules node_modules/jest/bin/jest.js",
"typecov": "type-coverage"
"typecov": "type-coverage",
"version": "changeset version && yarn --no-immutable"
},
"dependencies": {
"@pkgr/core": "^0.1.0",
"tslib": "^2.6.2"
},
"devDependencies": {
"@1stg/lib-config": "^13.0.0",
"@1stg/common-config": "^10.0.0",
"@changesets/changelog-github": "^0.5.0",
"@changesets/cli": "^2.27.1",
"@commitlint/cli": "^18.4.3",
"@pkgr/rollup": "^5.0.0",
"@swc-node/register": "^1.6.8",
"@types/jest": "^29.5.11",
"@types/node": "^20.10.6",
"clean-pkg-json": "^1.2.0",
"concurrently": "^8.2.2",
"cross-env": "^7.0.3",
"deasync": "^0.1.29",
"esbuild-register": "^3.5.0",
"esbuild-runner": "^2.2.2",
"eslint": "^8.56.0",
"execa": "^8.0.1",
"jest": "^29.7.0",
"lint-staged": "^15.2.0",
"node-gyp": "^10.0.1",
"patch-package": "^8.0.0",
"prettier": "^3.1.1",
"simple-git-hooks": "^2.9.0",
"sync-threads": "^1.0.1",
"synckit": "link:.",
"ts-expect": "^1.3.0",
"ts-jest": "^29.1.1",
"ts-node": "^10.9.2",
"tsx": "^4.7.0",
"type-coverage": "^2.27.1",
"typescript": "^5.3.3",
"yarn-deduplicate": "^6.0.2"
"typescript": "^5.3.3"
},
"resolutions": {
"prettier": "^3.1.1",
Expand Down
Loading
Loading