Skip to content

Commit

Permalink
feat: update to Yarn 4 (#29)
Browse files Browse the repository at this point in the history
  • Loading branch information
noahnu committed Nov 9, 2023
1 parent 4457bea commit 0989086
Show file tree
Hide file tree
Showing 20 changed files with 5,512 additions and 5,046 deletions.
1 change: 1 addition & 0 deletions .eslintignore
Original file line number Diff line number Diff line change
Expand Up @@ -2,3 +2,4 @@ coverage
website/node_modules
!.eslintrc.js
node_modules
bundles
4 changes: 4 additions & 0 deletions .eslintrc.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,10 @@
module.exports = {
root: true,
extends: ['@tophat/eslint-config/base', '@tophat/eslint-config/jest'],
parserOptions: {
project: ['./tsconfig.lint.json'],
tsconfigRootDir: __dirname,
},
rules: {
'prettier/prettier': [
'error',
Expand Down
40 changes: 6 additions & 34 deletions .github/workflows/pull-request.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,39 +11,9 @@ env:
ARTIFACT_DIR: ./artifacts

jobs:
commit-watch:
name: Run Commit Watch
runs-on: ubuntu-20.04
if: "github.event_name == 'pull_request' && !contains(github.event.head_commit.message, '[skip ci]')"
steps:
- uses: actions/checkout@v3
with:
ref: ${{ github.event.pull_request.head.sha }}
fetch-depth: 0
- uses: ./.github/actions/detect-env
- name: Setup Node.js
uses: actions/setup-node@v3
with:
node-version: ${{ env.NODE_VERSION }}
- name: Create artifacts directory
run: mkdir -p ${{ env.ARTIFACT_DIR }}
- name: Run Commit Watch
env:
COMMIT_WATCH_OUTPUT_DIR: ${{ env.ARTIFACT_DIR }}/
COMMITWATCH_GITHUB_TOKEN: ${{ secrets.GH_TOKEN }}
CI_REPO_OWNER: ${{ github.repository_owner }}
CI_REPO_NAME: ${{ github.event.repository.name }}
CI_COMMIT_SHA: ${{ github.event.pull_request.head.sha }}
CI_BASE_BRANCH: origin/${{ github.base_ref }}
run: yarn dlx commit-watch
- name: Upload Artifacts
uses: actions/upload-artifact@v2
with:
name: commit-watch-artifacts
path: ${{ env.ARTIFACT_DIR }}
linting:
name: Lint
runs-on: ubuntu-20.04
runs-on: ubuntu-latest
if: "!contains(github.event.head_commit.message, '[skip ci]')"
steps:
- uses: actions/checkout@v3
Expand All @@ -68,13 +38,15 @@ jobs:
run: yarn install --immutable
- name: Linting
run: yarn lint:ci
- name: Typecheck
run: yarn types
tests:
name: Tests
runs-on: ubuntu-20.04
runs-on: ubuntu-latest
if: "!contains(github.event.head_commit.message, '[skip ci]')"
strategy:
matrix:
node-version: [14, 16, 18]
node-version: [18]
steps:
- uses: actions/checkout@v3
with:
Expand Down Expand Up @@ -113,7 +85,7 @@ jobs:
path: ${{ env.ARTIFACT_DIR }}
build:
name: Build
runs-on: ubuntu-20.04
runs-on: ubuntu-latest
needs: [linting,tests]
if: "!contains(github.event.head_commit.message, '[skip ci]')"
steps:
Expand Down
783 changes: 0 additions & 783 deletions .yarn/releases/yarn-3.2.2.cjs

This file was deleted.

4 changes: 2 additions & 2 deletions .yarn/sdks/eslint/bin/eslint.js
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
#!/usr/bin/env node

const {existsSync} = require(`fs`);
const {createRequire, createRequireFromPath} = require(`module`);
const {createRequire} = require(`module`);
const {resolve} = require(`path`);

const relPnpApiPath = "../../../../.pnp.cjs";

const absPnpApiPath = resolve(__dirname, relPnpApiPath);
const absRequire = (createRequire || createRequireFromPath)(absPnpApiPath);
const absRequire = createRequire(absPnpApiPath);

if (existsSync(absPnpApiPath)) {
if (!process.versions.pnp) {
Expand Down
12 changes: 10 additions & 2 deletions .yarn/sdks/eslint/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,14 @@
{
"name": "eslint",
"version": "7.26.0-sdk",
"version": "8.53.0-sdk",
"main": "./lib/api.js",
"type": "commonjs"
"type": "commonjs",
"bin": {
"eslint": "./bin/eslint.js"
},
"exports": {
"./package.json": "./package.json",
".": "./lib/api.js",
"./use-at-your-own-risk": "./lib/unsupported-api.js"
}
}
20 changes: 20 additions & 0 deletions .yarn/sdks/prettier/bin/prettier.cjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
#!/usr/bin/env node

const {existsSync} = require(`fs`);
const {createRequire} = require(`module`);
const {resolve} = require(`path`);

const relPnpApiPath = "../../../../.pnp.cjs";

const absPnpApiPath = resolve(__dirname, relPnpApiPath);
const absRequire = createRequire(absPnpApiPath);

if (existsSync(absPnpApiPath)) {
if (!process.versions.pnp) {
// Setup the environment to be able to require prettier/bin/prettier.cjs
require(absPnpApiPath).setup();
}
}

// Defer to the real prettier/bin/prettier.cjs your application uses
module.exports = absRequire(`prettier/bin/prettier.cjs`);
20 changes: 20 additions & 0 deletions .yarn/sdks/prettier/index.cjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
#!/usr/bin/env node

const {existsSync} = require(`fs`);
const {createRequire} = require(`module`);
const {resolve} = require(`path`);

const relPnpApiPath = "../../../.pnp.cjs";

const absPnpApiPath = resolve(__dirname, relPnpApiPath);
const absRequire = createRequire(absPnpApiPath);

if (existsSync(absPnpApiPath)) {
if (!process.versions.pnp) {
// Setup the environment to be able to require prettier
require(absPnpApiPath).setup();
}
}

// Defer to the real prettier your application uses
module.exports = absRequire(`prettier`);
20 changes: 0 additions & 20 deletions .yarn/sdks/prettier/index.js

This file was deleted.

7 changes: 4 additions & 3 deletions .yarn/sdks/prettier/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
{
"name": "prettier",
"version": "2.2.1-sdk",
"main": "./index.js",
"type": "commonjs"
"version": "3.0.3-sdk",
"main": "./index.cjs",
"type": "commonjs",
"bin": "./bin/prettier.cjs"
}
4 changes: 2 additions & 2 deletions .yarn/sdks/typescript/bin/tsc
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
#!/usr/bin/env node

const {existsSync} = require(`fs`);
const {createRequire, createRequireFromPath} = require(`module`);
const {createRequire} = require(`module`);
const {resolve} = require(`path`);

const relPnpApiPath = "../../../../.pnp.cjs";

const absPnpApiPath = resolve(__dirname, relPnpApiPath);
const absRequire = (createRequire || createRequireFromPath)(absPnpApiPath);
const absRequire = createRequire(absPnpApiPath);

if (existsSync(absPnpApiPath)) {
if (!process.versions.pnp) {
Expand Down
4 changes: 2 additions & 2 deletions .yarn/sdks/typescript/bin/tsserver
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
#!/usr/bin/env node

const {existsSync} = require(`fs`);
const {createRequire, createRequireFromPath} = require(`module`);
const {createRequire} = require(`module`);
const {resolve} = require(`path`);

const relPnpApiPath = "../../../../.pnp.cjs";

const absPnpApiPath = resolve(__dirname, relPnpApiPath);
const absRequire = (createRequire || createRequireFromPath)(absPnpApiPath);
const absRequire = createRequire(absPnpApiPath);

if (existsSync(absPnpApiPath)) {
if (!process.versions.pnp) {
Expand Down
8 changes: 6 additions & 2 deletions .yarn/sdks/typescript/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,10 @@
{
"name": "typescript",
"version": "4.3.5-sdk",
"version": "5.2.2-sdk",
"main": "./lib/typescript.js",
"type": "commonjs"
"type": "commonjs",
"bin": {
"tsc": "./bin/tsc",
"tsserver": "./bin/tsserver"
}
}
4 changes: 2 additions & 2 deletions .yarnrc.yml
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
compressionLevel: mixed

npmRegistries:
//registry.npmjs.org/:
npmAuthToken: "${NPM_PUBLISH_TOKEN:-invalid}"

plugins:
- ./bundles/@yarnpkg/plugin-semver-up.js

yarnPath: .yarn/releases/yarn-3.2.2.cjs
6 changes: 3 additions & 3 deletions bundles/@yarnpkg/plugin-semver-up.js

Large diffs are not rendered by default.

69 changes: 35 additions & 34 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -18,58 +18,59 @@
"lint": "eslint .",
"lint:fix": "eslint . --fix",
"lint:ci": "eslint . --format junit --output-file ${ARTIFACT_DIR:-artifacts}/test_results/eslint/eslint.junit.xml",
"types": "tsc -p tsconfig.json --noEmit",
"build": "builder build plugin",
"prepack": "yarn build",
"contrib:add": "all-contributors add",
"contrib:generate": "all-contributors generate",
"contrib:check": "all-contributors check"
},
"devDependencies": {
"@babel/cli": "^7.17.10",
"@babel/core": "^7.18.5",
"@babel/plugin-transform-runtime": "^7.18.5",
"@babel/preset-env": "^7.18.2",
"@babel/preset-typescript": "^7.17.12",
"@babel/cli": "^7.23.0",
"@babel/core": "^7.23.3",
"@babel/plugin-transform-runtime": "^7.23.3",
"@babel/preset-env": "^7.23.3",
"@babel/preset-typescript": "^7.23.3",
"@commitlint/cli": "^11.0.0",
"@tophat/commitlint-config": "^0.3.7",
"@tophat/conventional-changelog-config": "^0.6.2",
"@tophat/eslint-config": "^3.1.0",
"@tophat/eslint-import-resolver-require": "^0.1.3",
"@tophat/commitlint-config": "^1.0.2",
"@tophat/conventional-changelog-config": "^1.0.1",
"@tophat/eslint-config": "^9.0.0",
"@tophat/eslint-import-resolver-require": "^1.0.0",
"@types/jest": "^28.1.2",
"@types/micromatch": "^4.0.2",
"@types/node": "^16.0.0",
"@types/semver": "^7.3.6",
"@typescript-eslint/eslint-plugin": "^5.28.0",
"@typescript-eslint/parser": "^5.28.0",
"@yarnpkg/builder": "^3.2.2",
"@yarnpkg/cli": "^3.2.1",
"@yarnpkg/core": "^3.2.2",
"@yarnpkg/fslib": "^2.6.2",
"@yarnpkg/libzip": "^2.2.4",
"@yarnpkg/plugin-essentials": "^3.2.1",
"@yarnpkg/plugin-git": "^2.6.1",
"@yarnpkg/plugin-npm": "^2.7.1",
"@yarnpkg/plugin-pack": "^3.1.2",
"@yarnpkg/sdks": "^3.0.0-rc.9",
"@typescript-eslint/eslint-plugin": "^6.10.0",
"@typescript-eslint/parser": "^6.10.0",
"@yarnpkg/builder": "^4.0.0",
"@yarnpkg/cli": "^4.0.1",
"@yarnpkg/core": "^4.0.1",
"@yarnpkg/fslib": "^3.0.1",
"@yarnpkg/libzip": "^3.0.0",
"@yarnpkg/plugin-essentials": "^4.0.1",
"@yarnpkg/plugin-git": "^3.0.0",
"@yarnpkg/plugin-npm": "^3.0.0",
"@yarnpkg/plugin-pack": "^4.0.0",
"@yarnpkg/sdks": "^3.0.0",
"all-contributors-cli": "^6.20.0",
"babel-jest": "^28.1.1",
"clipanion": "^3.0.1",
"clipanion": "^4.0.0-rc.2",
"commitizen": "^4.2.4",
"eslint": "^8.17.0",
"eslint-config-prettier": "^8.5.0",
"eslint-import-resolver-typescript": "^2.7.1",
"eslint-plugin-import": "^2.26.0",
"eslint-plugin-jest": "^26.5.3",
"eslint-plugin-jsx-a11y": "^6.5.1",
"eslint-plugin-prettier": "^4.0.0",
"eslint-plugin-react": "^7.30.0",
"eslint": "^8.53.0",
"eslint-config-prettier": "^9.0.0",
"eslint-import-resolver-typescript": "^3.6.1",
"eslint-plugin-import": "^2.29.0",
"eslint-plugin-jest": "^27.6.0",
"eslint-plugin-jsx-a11y": "^6.8.0",
"eslint-plugin-prettier": "^5.0.1",
"eslint-plugin-react": "^7.33.2",
"eslint-plugin-react-hooks": "^4.6.0",
"husky": "^6.0.0",
"jest": "^28.1.1",
"jest": "^29.7.0",
"jest-junit": "^13.2.0",
"lint-staged": "^11.0.0",
"prettier": "^2.2.1",
"typescript": "4.7.3",
"prettier": "^3.0.3",
"typescript": "5.2.2",
"yaml-validator": "^3.0.1"
},
"peerDependencies": {
Expand Down Expand Up @@ -97,5 +98,5 @@
"micromatch": "^4.0.5",
"semver": "^7.3.7"
},
"packageManager": "yarn@3.2.2"
"packageManager": "yarn@4.0.1"
}

0 comments on commit 0989086

Please sign in to comment.