Skip to content

Commit

Permalink
chore: move to yarn 2 #56
Browse files Browse the repository at this point in the history
  • Loading branch information
regevbr committed Apr 15, 2020
1 parent ae24721 commit f5038e3
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 16 deletions.
10 changes: 1 addition & 9 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,15 +27,7 @@ jobs:
matrix:
os: [ubuntu-latest, macos-latest, windows-latest]
node-version: [10.x, 12.x]
exclude:
- os: macos-latest
node-version: 10.x
- os: macos-latest
node-version: 13.x
- os: windows-latest
node-version: 10.x
- os: windows-latest
node-version: 13.x

steps:

- name: Echo env variables
Expand Down
12 changes: 5 additions & 7 deletions tools/plugin-pnp.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,3 @@
const fs = require(`fs`);
const path = require(`path`);

const origStr = ` function findPackageLocator(location) {
let relativeLocation = normalizePath(fslib_2.ppath.relative(runtimeState.basePath, location));`;
const fixedStr = ` function findPackageLocator(location) {
Expand All @@ -15,13 +12,14 @@ const fixedStr = ` function findPackageLocator(location) {

module.exports = {
name: `plugin-pnp`,
factory: () => ({
factory: (require) => ({
hooks: {
afterAllInstalled(project) {
const pnpFile = path.join(project.cwd, `.pnp.js`);
const pnpContent = fs.readFileSync(pnpFile, `utf-8`);
const fs = require('@yarnpkg/fslib');
const pnpFile = fs.ppath.join(project.cwd, `.pnp.js`);
const pnpContent = fs.xfs.readFileSync(pnpFile, `utf-8`);
const fixed = pnpContent.replace(origStr, fixedStr);
fs.writeFileSync(pnpFile, fixed, `utf-8`);
fs.xfs.writeFileSync(pnpFile, fixed, `utf-8`);
},
},
}),
Expand Down

0 comments on commit f5038e3

Please sign in to comment.