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

chore: use prettier for formatting #6096

Open
wants to merge 8 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
20 changes: 0 additions & 20 deletions .editorconfig

This file was deleted.

13 changes: 9 additions & 4 deletions .eslintignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,12 @@
# Minimize the diff with upstream
packages/yarnpkg-pnp/sources/node/**
packages/yarnpkg-pnp/sources/loader/node-options*

# Keep the rest in sync with .prettierignore
/.yarn/**
/.pnp.*
/yarn.lock

/packages/yarnpkg-pnp/sources/hook.js
/packages/yarnpkg-pnp/sources/esm-loader/built-loader.js

Expand All @@ -21,7 +30,3 @@
/packages/gatsby/public/**
# Files generated by TypeDoc
/packages/gatsby/static/api/**

# Minimize the diff with upstream
packages/yarnpkg-pnp/sources/node/**
packages/yarnpkg-pnp/sources/loader/node-options*
30 changes: 16 additions & 14 deletions .eslintrc.js
Original file line number Diff line number Diff line change
@@ -1,20 +1,20 @@
module.exports = {
extends: [
require.resolve(`@yarnpkg/eslint-config`),
require.resolve(`@yarnpkg/eslint-config/react`),
],
extends: [require.resolve(`@yarnpkg/eslint-config`), require.resolve(`@yarnpkg/eslint-config/react`)],
overrides: [
{
files: [`!packages/*/sources/{index,Plugin}.ts`],
rules: {
'@typescript-eslint/naming-convention': [`error`, {
selector: `typeLike`,
format: [`PascalCase`],
custom: {
regex: `^Hooks$`,
match: false,
"@typescript-eslint/naming-convention": [
`error`,
{
selector: `typeLike`,
format: [`PascalCase`],
custom: {
regex: `^Hooks$`,
match: false,
},
},
}],
],
},
},
{
Expand All @@ -26,7 +26,8 @@ module.exports = {
},
],
rules: {
'no-restricted-properties': [2,
"no-restricted-properties": [
2,
{
object: `semver`,
property: `validRange`,
Expand All @@ -38,13 +39,14 @@ module.exports = {
message: `Use 'semverUtils.validRange' instead`,
},
],
'no-restricted-globals': [2,
"no-restricted-globals": [
2,
{
name: `fetch`,
message: `Use 'httpUtils' instead`,
},
],
'no-restricted-imports': [
"no-restricted-imports": [
`error`,
{
patterns: [
Expand Down
4 changes: 2 additions & 2 deletions .github/ISSUE_TEMPLATE/bug-report.yml
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ body:
});
```
validations:
required: true
required: true

- type: textarea
attributes:
Expand All @@ -55,7 +55,7 @@ body:
Yarn: 3.0.0-rc.5 - /path/to/yarn
npm: 6.14.11 - /path/to/npm
validations:
required: true
required: true

- type: textarea
attributes:
Expand Down
3 changes: 1 addition & 2 deletions .github/ISSUE_TEMPLATE/compatibility.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,7 @@ name: "\U0001F47E Compatibility"
about: For packages that don't work.
title: "[Compatibility]"
labels: compatibility
assignees: ''

assignees: ""
---

**DO NOT OPEN COMPATIBILITY ISSUES**
Expand Down
3 changes: 1 addition & 2 deletions .github/ISSUE_TEMPLATE/feature-request.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,7 @@ name: "\U0001F4AB Feature request"
about: Propose a concrete new feature
title: "[Feature]"
labels: enhancement
assignees: ''

assignees: ""
---

<!--
Expand Down
6 changes: 6 additions & 0 deletions .github/PULL_REQUEST_TEMPLATE.md
Original file line number Diff line number Diff line change
@@ -1,24 +1,30 @@
**What's the problem this PR addresses?**

<!-- Describe the rationale of your PR. -->
<!-- Link all issues that it closes. (Closes/Resolves #xxxx.) -->

...

**How did you fix it?**

<!-- A detailed description of your implementation. -->

...

**Checklist**

<!--- Don't worry if you miss something, chores are automatically tested. -->
<!--- This checklist exists to help you remember doing the chores when you submit a PR. -->
<!--- Put an `x` in all the boxes that apply. -->

- [ ] I have read the [Contributing Guide](https://yarnpkg.com/advanced/contributing).

<!-- See https://yarnpkg.com/advanced/contributing#preparing-your-pr-to-be-released for more details. -->
<!-- Check with `yarn version check` and fix with `yarn version check -i` -->

- [ ] I have set the packages that need to be released for my changes to be effective.

<!-- The "Testing chores" workflow validates that your PR follows our guidelines. -->
<!-- If it doesn't pass, click on it to see details as to what your PR might be missing. -->

- [ ] I will check that all automated PR checks pass before the PR gets reviewed.
10 changes: 5 additions & 5 deletions .github/actions/prepare/action.yml
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
inputs:
minify-bundle:
description: 'Whether to minify the bundle'
description: "Whether to minify the bundle"
required: false
default: 'false'
default: "false"
node-version:
description: 'The version of Node.js to use'
description: "The version of Node.js to use"
required: false
default: 'current'
default: "current"

runs:
using: composite
Expand All @@ -22,7 +22,7 @@ runs:
path: packages/yarnpkg-cli/bundles/yarn.js
key: cli-bundle-minified-${{ inputs.minify-bundle }}-${{ github.sha }}

- name: 'Build the standard bundle'
- name: "Build the standard bundle"
if: steps.cache-build.outputs.cache-hit != 'true'
run: |
node ./scripts/run-yarn.js build:cli ${{ inputs.minify-bundle == 'false' && '--no-minify' || '' }}
Expand Down
76 changes: 38 additions & 38 deletions .github/workflows/benchmark-workflow.yml
Original file line number Diff line number Diff line change
@@ -1,18 +1,18 @@
on:
schedule:
- cron: '0 2-23/4 * * *'
- cron: "0 2-23/4 * * *"
workflow_dispatch:
inputs:
sendReport:
description: 'Whether to send the stats to the Datadog dashboards'
description: "Whether to send the stats to the Datadog dashboards"
required: true
default: 'false'
default: "false"
hyperfineOptions:
description: 'Options passed to Hyperfine'
description: "Options passed to Hyperfine"
required: false
default: ''
default: ""

name: 'Performance tests'
name: "Performance tests"
jobs:
benchmark:
strategy:
Expand All @@ -29,44 +29,44 @@ jobs:
- npm
- pnpm

name: 'Benchmarking ${{matrix.benchmark[0]}} w/ ${{matrix.packageManager}}'
name: "Benchmarking ${{matrix.benchmark[0]}} w/ ${{matrix.packageManager}}"
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v3

- uses: ./.github/actions/prepare
with:
minify-bundle: true
- uses: ./.github/actions/prepare
with:
minify-bundle: true

- name: 'Install Hyperfine'
run: |
wget https://github.com/sharkdp/hyperfine/releases/download/v1.10.0/hyperfine_1.10.0_amd64.deb
sudo dpkg -i hyperfine_1.10.0_amd64.deb
- name: "Install Hyperfine"
run: |
wget https://github.com/sharkdp/hyperfine/releases/download/v1.10.0/hyperfine_1.10.0_amd64.deb
sudo dpkg -i hyperfine_1.10.0_amd64.deb

- name: 'Install the package manager'
run: |
case ${{matrix.packageManager}} in
npm)
npm install -g npm@^7;;
pnpm)
npm install -g pnpm;;
classic)
npm install -g yarn;;
esac
- name: "Install the package manager"
run: |
case ${{matrix.packageManager}} in
npm)
npm install -g npm@^7;;
pnpm)
npm install -g pnpm;;
classic)
npm install -g yarn;;
esac

- name: 'Creates a temporary directory'
run: |
BENCH_DIR=$(mktemp -d)
echo "BENCH_DIR=$BENCH_DIR" >> "$GITHUB_ENV"
- name: "Creates a temporary directory"
run: |
BENCH_DIR=$(mktemp -d)
echo "BENCH_DIR=$BENCH_DIR" >> "$GITHUB_ENV"

- name: 'Run the performance test'
run: |
bash scripts/bench-run.sh '${{matrix.packageManager}}' '${{matrix.benchmark[1]}}' "$BENCH_DIR"
- name: "Run the performance test"
run: |
bash scripts/bench-run.sh '${{matrix.packageManager}}' '${{matrix.benchmark[1]}}' "$BENCH_DIR"

if [[ '${{github.event.inputs.sendReport}}' != 'false' ]]; then
yarn node scripts/submit-bench-data.js '${{matrix.packageManager}}' '${{matrix.benchmark[1]}}' "$BENCH_DIR"
fi
env:
DD_API_KEY: ${{secrets.DD_API_KEY}}
HYPERFINE_OPTIONS: ${{github.event.inputs.hyperfineOptions}}
if [[ '${{github.event.inputs.sendReport}}' != 'false' ]]; then
yarn node scripts/submit-bench-data.js '${{matrix.packageManager}}' '${{matrix.benchmark[1]}}' "$BENCH_DIR"
fi
env:
DD_API_KEY: ${{secrets.DD_API_KEY}}
HYPERFINE_OPTIONS: ${{github.event.inputs.hyperfineOptions}}
10 changes: 5 additions & 5 deletions .github/workflows/debug.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,8 @@ jobs:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v3
- name: Setup upterm session
uses: lhotari/action-upterm@d23c2722bdab893785c9fbeae314cbf080645bd7
with:
limit-access-to-actor: true
- uses: actions/checkout@v3
- name: Setup upterm session
uses: lhotari/action-upterm@d23c2722bdab893785c9fbeae314cbf080645bd7
with:
limit-access-to-actor: true
58 changes: 29 additions & 29 deletions .github/workflows/e2e-cra-workflow.yml
Original file line number Diff line number Diff line change
@@ -1,50 +1,50 @@
#
on:
schedule:
- cron: '0 */4 * * *'
- cron: "0 */4 * * *"
push:
branches:
- master
- master
pull_request:
paths:
- .github/actions/prepare/action.yml
- .github/workflows/e2e-cra-workflow.yml
- scripts/e2e-setup-ci.sh
- .github/actions/prepare/action.yml
- .github/workflows/e2e-cra-workflow.yml
- scripts/e2e-setup-ci.sh

name: 'E2E CRA'
name: "E2E CRA"
jobs:
chore:
name: 'Validating Create-React-App'
name: "Validating Create-React-App"
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v3

- uses: ./.github/actions/prepare
- uses: ./.github/actions/prepare

- name: 'Running the integration test'
run: |
source scripts/e2e-setup-ci.sh
yarn dlx create-react-app my-cra && cd my-cra
- name: "Running the integration test"
run: |
source scripts/e2e-setup-ci.sh
yarn dlx create-react-app my-cra && cd my-cra

# TODO: Remove when create-react-app fixes their ESLint setup
yarn add -D eslint-config-react-app eslint
# TODO: Remove when create-react-app fixes their ESLint setup
yarn add -D eslint-config-react-app eslint

yarn build
yarn test
yarn build
yarn test

- name: 'Running the TypeScript integration test'
run: |
source scripts/e2e-setup-ci.sh
yarn dlx create-react-app my-cra-ts --template typescript && cd my-cra-ts
- name: "Running the TypeScript integration test"
run: |
source scripts/e2e-setup-ci.sh
yarn dlx create-react-app my-cra-ts --template typescript && cd my-cra-ts

# TODO: Remove when create-react-app fixes their ESLint setup
yarn add -D eslint-config-react-app eslint
# TODO: Remove when create-react-app fixes their ESLint setup
yarn add -D eslint-config-react-app eslint

# TODO: Remove when https://github.com/facebook/create-react-app/pull/11751 is released
yarn add -D @types/testing-library__jest-dom@5
# TODO: Remove when https://github.com/facebook/create-react-app/pull/11751 is released
yarn add -D @types/testing-library__jest-dom@5

yarn build
yarn test
if: |
success() || failure()
yarn build
yarn test
if: |
success() || failure()