Skip to content

Commit

Permalink
chore(yarn): migrate to yarn 2
Browse files Browse the repository at this point in the history
  • Loading branch information
leguellec committed Aug 21, 2020
1 parent 4d385e7 commit b02b498
Show file tree
Hide file tree
Showing 29 changed files with 124,174 additions and 6,398 deletions.
58 changes: 37 additions & 21 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,29 +4,45 @@
name: Node.js CI

on:
push:
branches: [ master ]
pull_request:
branches: [ master ]
push:
branches: [master]
pull_request:
branches: [master]

jobs:
build:
build:
runs-on: ubuntu-latest

runs-on: ubuntu-latest
strategy:
matrix:
node-version: [10.x, 12.x, 14.x]
cucumber-version: [4.x, 5.x, 6.x]

strategy:
matrix:
node-version: [10.x, 12.x, 14.x]
cucumber-version: [4.x, 5.x, 6.x]
steps:
- uses: actions/checkout@v2
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v1
with:
node-version: ${{ matrix.node-version }}
- run: yarn add -P cucumber@${{ matrix.cucumber-version }}
- run: yarn run lint
- run: yarn run check-fmt
- run: yarn run test-cover
- run: yarn run examples --tags @offline
- name: Coveralls Parallel
env:
COVERALLS_FLAG_NAME: run-${{ matrix.node-version }}-${{ matrix.cucumber-version }}
uses: coverallsapp/github-action@v1.1.1
with:
github-token: ${{ secrets.github_token }}
parallel: true

steps:
- uses: actions/checkout@v2
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v1
with:
node-version: ${{ matrix.node-version }}
- run: yarn add cucumber${{ matrix.cucumber-version }}
- run: yarn run lint
- run: yarn run check-fmt
- run: yarn run test-cover
- run: yarn run examples -- --tags @offline
coverall:
needs: build
runs-on: ubuntu-latest
steps:
- name: Coveralls Finished
uses: coverallsapp/github-action@v1.1.1
with:
github-token: ${{ secrets.github_token }}
parallel-finished: true
9 changes: 9 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -41,3 +41,12 @@ bin
_doc
/examples/features/file_system/files/generated
/examples/features/file_system/files/deeply
.vscode

# yarn
.yarn/*
!.yarn/releases
!.yarn/plugins
!.yarn/sdks
!.yarn/versions
.pnp.*
4 changes: 4 additions & 0 deletions .npmignore
Original file line number Diff line number Diff line change
Expand Up @@ -41,3 +41,7 @@ Makefile
.lintstagedrc
.huskyrc
.travis.yml
.yarn
.pnp.*
jest.config.js
.yarnrc.yml
17 changes: 0 additions & 17 deletions .travis.yml

This file was deleted.

115,636 changes: 115,636 additions & 0 deletions .yarn/releases/yarn-berry.js

Large diffs are not rendered by default.

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

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

const relPnpApiPath = '../../../../.pnp.js'

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

if (existsSync(absPnpApiPath)) {
if (!process.versions.pnp) {
// Setup the environment to be able to require eslint/lib/api.js
require(absPnpApiPath).setup()
}
}

// Defer to the real eslint/lib/api.js your application uses
module.exports = absRequire(`eslint/lib/api.js`)
6 changes: 6 additions & 0 deletions .yarn/sdks/eslint/package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
{
"name": "eslint",
"version": "7.7.0-pnpify",
"main": "./lib/api.js",
"type": "commonjs"
}
5 changes: 5 additions & 0 deletions .yarn/sdks/integrations.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
# This file is automatically generated by PnPify.
# Manual changes will be lost!

integrations:
- vscode
20 changes: 20 additions & 0 deletions .yarn/sdks/prettier/index.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
#!/usr/bin/env node

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

const relPnpApiPath = '../../../.pnp.js'

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

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

// Defer to the real prettier/index.js your application uses
module.exports = absRequire(`prettier/index.js`)
6 changes: 6 additions & 0 deletions .yarn/sdks/prettier/package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
{
"name": "prettier",
"version": "2.0.5-pnpify",
"main": "./index.js",
"type": "commonjs"
}
1 change: 1 addition & 0 deletions .yarnrc.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
yarnPath: ".yarn/releases/yarn-berry.js"
6 changes: 3 additions & 3 deletions examples/features/cli/yarn.feature
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@
Feature: yarn CLI

Scenario: Running an invalid command
When I run command yarn invalid
Then exit code should be 1
And stderr should contain Command "invalid" not found.
When I run command node -z
Then exit code should be 9
And stderr should contain node: bad option: -z

Scenario: Getting info about installed yarn version
When I run command yarn --version
Expand Down
3 changes: 3 additions & 0 deletions jest.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
module.exports = {
coveragePathIgnorePatterns: ['/node_modules/', '/tests/'],
}
6 changes: 3 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
],
"license": "MIT",
"engines": {
"node": ">=8.12.0"
"node": ">=10"
},
"engineStrict": true,
"dependencies": {
Expand Down Expand Up @@ -64,8 +64,8 @@
"cucumber": ">=4.0.0 <7.0.0"
},
"scripts": {
"test": "jest --verbose tests",
"test-cover": "jest --verbose --coverage",
"test": "jest --verbose --colors tests",
"test-cover": "jest --verbose --colors --coverage",
"coverage": "cat ./coverage/lcov.info | coveralls",
"fmt": "prettier --print-width 100 --tab-width=4 --single-quote --bracket-spacing --no-semi --color --write \"{src,tests,scripts}/**/*.js\"",
"check-fmt": "prettier --print-width 100 --tab-width=4 --single-quote --bracket-spacing --no-semi --list-different \"{src,tests,scripts}/**/*.js\"",
Expand Down
14 changes: 12 additions & 2 deletions tests/extensions/fixtures/fixtures_loader.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -142,12 +142,22 @@ test('load valid .js fixture file', () => {

test('load non existing .js fixture file', () => {
expect.assertions(1)

const cwd = process.cwd()
return fixturesLoader.loadModule('noent.js').catch((err) => {
expect(err.message).toEqual(
[
'An error occurred while loading fixture file: noent.js',
`error: Cannot find module '../../../noent.js' from 'src/extensions/fixtures/fixtures_loader.js'`,
'error: Qualified path resolution failed - none of the candidates can be found on the disk.',
'',
`Source path: ${cwd}/noent.js`,
`Rejected candidate: ${cwd}/noent.js`,
`Rejected candidate: ${cwd}/noent.js.js`,
`Rejected candidate: ${cwd}/noent.js.json`,
`Rejected candidate: ${cwd}/noent.js.jsx`,
`Rejected candidate: ${cwd}/noent.js.ts`,
`Rejected candidate: ${cwd}/noent.js.tsx`,
`Rejected candidate: ${cwd}/noent.js.node`,
'',
].join('\n')
)
})
Expand Down
121 changes: 0 additions & 121 deletions tests/extensions/snapshot/cmd.test.js

This file was deleted.

0 comments on commit b02b498

Please sign in to comment.