Skip to content

Commit

Permalink
build: sync ECMA and Node target (yarnpkg#3293)
Browse files Browse the repository at this point in the history
* chore: update node target

* chore: lint after ECMA version change

* chore: lint whole codebase

* docs: add missing types packages

* docs: set target to `ESNext`

* docs: fix linting

* chore: versions

* chore: update hook

* chore: update patch

* chore: lint after rebase

* chore: lint

* chore: update after merge

* chore: update `resolve` patch

* chore: regenerate `fsevents` patch

* chore: force git to use `LF`

* chore: revert fsevents changes

* chore: update the worker

* chore: versions

* chore: update eslint

* fix(eslint): enforce single quotes for imports

* chore: versions

* test: add missing `tslib` dependency

* chore: mark generated files as binary

* chore: lint after merge

* chore: versions

Co-authored-by: Yarn Bot <[email protected]>
  • Loading branch information
merceyz and yarnbot authored Sep 12, 2021
1 parent 6360d15 commit d545400
Show file tree
Hide file tree
Showing 164 changed files with 960 additions and 1,169 deletions.
6 changes: 6 additions & 0 deletions .eslintignore
Original file line number Diff line number Diff line change
Expand Up @@ -8,3 +8,9 @@

/packages/yarnpkg-core/sources/worker-zip/index.js
/packages/yarnpkg-cli/bundles/yarn.js

/packages/*/lib/**
/packages/*/bin/**
/packages/*/build/**
/packages/**/*fixtures*/**
packages/yarnpkg-libzip/artifacts/**
2 changes: 1 addition & 1 deletion .eslintrc.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,5 +5,5 @@ module.exports = {
],
ignorePatterns: [
`packages/plugin-compat/extra/fsevents/fsevents-*.js`,
]
],
};
12 changes: 8 additions & 4 deletions .gitattributes
Original file line number Diff line number Diff line change
@@ -1,10 +1,14 @@
# This line does two things:
# - enable git's CRLF -> LF modification
# - forces git to use LF
# - tell git to guess whether files are text or binary
* text=auto
* text=auto eol=lf

# Mark .pnp.cjs as binary to prevent git from trying to merge it
/.pnp.* binary linguist-generated
# Mark generated files as binary to prevent git from trying to merge them
/.pnp.* binary linguist-generated
packages/yarnpkg-pnp/sources/hook.js binary linguist-generated
packages/yarnpkg-core/sources/worker-zip/index.js binary linguist-generated
packages/yarnpkg-libzip/sources/libzipAsync.js binary linguist-generated
packages/yarnpkg-libzip/sources/libzipSync.js binary linguist-generated

# Set the language for these files to json5 to ensure GitHub doesn't show the comments as errors
/.vscode/*.json linguist-language=JSON5
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/integration-workflow.yml
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ jobs:

- name: 'Check that the Zip worker is consistent with a fresh build (fix w/ "git merge master && yarn update:zip:worker")'
run: |
if [[ $(git diff --name-only "$(git merge-base origin/"$TARGET_BRANCH" HEAD)" HEAD -- packages/yarnpkg-core/sources/worker-zip/index.js | wc -l) -gt 0 ]]; then
if [[ $(git diff --name-only "$(git merge-base origin/"$TARGET_BRANCH" HEAD)" HEAD -- 'packages/yarnpkg-{fslib,libzip,core}/sources/**/*' | wc -l) -gt 0 ]]; then
node ./scripts/run-yarn.js build:zip:worker
[[ $(git diff --name-only packages/yarnpkg-core/sources/worker-zip/index.js | wc -l) -eq 0 ]]
fi
Expand Down
662 changes: 252 additions & 410 deletions .pnp.cjs

Large diffs are not rendered by default.

Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
40 changes: 40 additions & 0 deletions .yarn/versions/bb53227a.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
releases:
"@yarnpkg/builder": minor
"@yarnpkg/cli": minor
"@yarnpkg/core": minor
"@yarnpkg/eslint-config": minor
"@yarnpkg/fslib": minor
"@yarnpkg/libui": minor
"@yarnpkg/plugin-compat": minor
"@yarnpkg/plugin-essentials": minor
"@yarnpkg/plugin-file": minor
"@yarnpkg/plugin-interactive-tools": minor
"@yarnpkg/plugin-link": minor
"@yarnpkg/plugin-npm": minor
"@yarnpkg/plugin-typescript": minor
"@yarnpkg/pnp": minor
"@yarnpkg/shell": minor
vscode-zipfs: minor

declined:
- "@yarnpkg/esbuild-plugin-pnp"
- "@yarnpkg/plugin-constraints"
- "@yarnpkg/plugin-dlx"
- "@yarnpkg/plugin-exec"
- "@yarnpkg/plugin-git"
- "@yarnpkg/plugin-github"
- "@yarnpkg/plugin-http"
- "@yarnpkg/plugin-init"
- "@yarnpkg/plugin-nm"
- "@yarnpkg/plugin-npm-cli"
- "@yarnpkg/plugin-pack"
- "@yarnpkg/plugin-patch"
- "@yarnpkg/plugin-pnp"
- "@yarnpkg/plugin-stage"
- "@yarnpkg/plugin-version"
- "@yarnpkg/plugin-workspace-tools"
- "@yarnpkg/doctor"
- "@yarnpkg/json-proxy"
- "@yarnpkg/nm"
- "@yarnpkg/pnpify"
- "@yarnpkg/sdks"
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@
"@yarnpkg/sdks": "workspace:*",
"babel-jest": "^26.0.1",
"clipanion": "^3.0.1",
"eslint": "^6.8.0",
"eslint": "^7.32.0",
"github-api": "^3.2.2",
"jest": "^26.0.1",
"jest-environment-node": "^26.0.1",
Expand Down Expand Up @@ -74,7 +74,7 @@
"build:plugin-commands": "node ./scripts/gen-plugin-commands.js > packages/yarnpkg-cli/sources/pluginCommands.ts",
"build:compile": "rm -rf \"$0\"/lib && mkdir -p \"$0\"/lib && rsync -a --include '*.d.ts' --exclude '*.ts' --exclude '*.tsx' \"$0\"/sources/ \"$0\"/lib/ && node scripts/compile \"$@\"",
"build:compile-inline": "find \"$0\"/sources -name '*.js' && babel \"$0\"/sources --out-dir \"$0\"/sources --extensions .ts,.tsx",
"test:lint": "eslint --max-warnings 0 \"packages/**/@(sources|tests)/**/!(libzip).@(tsx|ts|js)\"",
"test:lint": "eslint --max-warnings 0 \"./**/*.@(tsx|ts|js)\"",
"test:unit": "jest",
"typecheck:all": "tsc --noEmit"
},
Expand Down
3 changes: 2 additions & 1 deletion packages/acceptance-tests/pkg-tests-core/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,8 @@
"semver": "^7.1.2",
"serve-static": "^1.14.1",
"super-resolve": "^1.0.0",
"tar-fs": "^1.16.0"
"tar-fs": "^1.16.0",
"tslib": "^1.13.0"
},
"repository": {
"type": "git",
Expand Down
3 changes: 3 additions & 0 deletions packages/acceptance-tests/pkg-tests-core/sources/index.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
import './utils/makeTemporaryEnv';
// eslint-disable-next-line arca/newline-after-import-section
import './utils/makeTemporaryMonorepoEnv';

// eslint-disable-next-line arca/import-ordering
import * as exec from './utils/exec';
import * as fs from './utils/fs';
import * as misc from './utils/misc';
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -443,7 +443,7 @@ describe(`Basic tests`, () => {
await run(`install`);

await expect(xfs.existsPromise(`${path}/node_modules/no-deps`)).resolves.toEqual(true);
}
)
},
),
);
});
Original file line number Diff line number Diff line change
Expand Up @@ -233,7 +233,7 @@ describe(`Commands`, () => {
makeTemporaryEnv({}, async ({path, run, source}) => {
await run(`add`, `no-deps`);
await expect(
run(`add`, `no-deps`, `-D`)
run(`add`, `no-deps`, `-D`),
).rejects.toThrowError(/already listed as a regular dependency/);
}),
);
Expand All @@ -243,7 +243,7 @@ describe(`Commands`, () => {
makeTemporaryEnv({}, async ({path, run, source}) => {
await run(`add`, `no-deps`);
await expect(
run(`add`, `no-deps`, `-P`)
run(`add`, `no-deps`, `-P`),
).rejects.toThrowError(/already listed as a regular dependency/);
}),
);
Expand All @@ -253,7 +253,7 @@ describe(`Commands`, () => {
makeTemporaryEnv({}, async ({path, run, source}) => {
await run(`add`, `no-deps`, `-P`);
await expect(
run(`add`, `no-deps`)
run(`add`, `no-deps`),
).rejects.toThrowError(/already listed as a peer dependency/);
}),
);
Expand Down Expand Up @@ -312,7 +312,7 @@ describe(`Commands`, () => {
[`no-deps`]: `workspace:packages/no-deps`,
},
});
})
}),
);

test(
Expand All @@ -335,7 +335,7 @@ describe(`Commands`, () => {
[`no-deps`]: `workspace:1.0.0`,
},
});
})
}),
);

test(
Expand All @@ -357,7 +357,7 @@ describe(`Commands`, () => {
[`no-deps`]: `workspace:^`,
},
});
})
}),
);

test(
Expand All @@ -379,7 +379,7 @@ describe(`Commands`, () => {
[`no-deps`]: `workspace:~`,
},
});
})
}),
);

test(
Expand All @@ -401,7 +401,7 @@ describe(`Commands`, () => {
[`no-deps`]: `workspace:*`,
},
});
})
}),
);

test(
Expand All @@ -424,7 +424,7 @@ describe(`Commands`, () => {
[`no-deps`]: `workspace:^`,
},
});
})
}),
);

test(
Expand All @@ -447,7 +447,7 @@ describe(`Commands`, () => {
[`no-deps`]: `workspace:~`,
},
});
})
}),
);

test(
Expand All @@ -470,7 +470,7 @@ describe(`Commands`, () => {
[`no-deps`]: `workspace:*`,
},
});
})
}),
);

test(
Expand All @@ -485,7 +485,7 @@ describe(`Commands`, () => {
[`no-deps`]: `^2.0.0`,
},
});
})
}),
);

test(`it should clean the cache when cache lives inside the project`, makeTemporaryEnv({
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ describe(`Commands`, () => {
await expect(run(`dedupe`, `--check`)).rejects.toMatchObject({
stdout: expect.stringContaining(`2 packages can be deduped using the highest strategy`),
});
})
}),
);

describe(`strategies`, () => {
Expand Down Expand Up @@ -49,7 +49,7 @@ describe(`Commands`, () => {
},
},
});
})
}),
);

it(
Expand Down Expand Up @@ -80,7 +80,7 @@ describe(`Commands`, () => {
},
},
});
})
}),
);
});
});
Expand Down Expand Up @@ -110,7 +110,7 @@ describe(`Commands`, () => {
},
},
});
})
}),
);

it(
Expand All @@ -137,7 +137,7 @@ describe(`Commands`, () => {
},
},
});
})
}),
);

it(
Expand All @@ -164,7 +164,7 @@ describe(`Commands`, () => {
},
},
});
})
}),
);

it(
Expand All @@ -191,7 +191,7 @@ describe(`Commands`, () => {
},
},
});
})
}),
);
});

Expand All @@ -209,7 +209,7 @@ describe(`Commands`, () => {
await expect(run(`dedupe`, `--check`)).rejects.toMatchObject({
code: 1,
});
})
}),
);

it(
Expand All @@ -224,7 +224,7 @@ describe(`Commands`, () => {
await expect(run(`dedupe`, `--check`)).resolves.toMatchObject({
code: 0,
});
})
}),
);
});

Expand All @@ -247,7 +247,7 @@ describe(`Commands`, () => {
});

expect.assertions(1);
})
}),
);

test(
Expand All @@ -262,7 +262,7 @@ describe(`Commands`, () => {
await expect(run(`dedupe`, `--check`, `--strategy`, `highest`)).rejects.toMatchObject({
code: 1,
});
})
}),
);
});
});
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ describe(`Commands`, () => {
await expect(run(`dlx`, `-q`, `@private/has-bin-entry`)).resolves.toMatchObject({
stdout: `1.0.0\n`,
});
})
}),
);

test(
Expand All @@ -105,7 +105,7 @@ describe(`Commands`, () => {
await expect(run(`dlx`, `-q`, `@private/has-bin-entry`)).resolves.toMatchObject({
stdout: `1.0.0\n`,
});
})
}),
);

test(
Expand All @@ -128,7 +128,7 @@ describe(`Commands`, () => {
await expect(run(`dlx`, `-q`, `@private/has-bin-entry`)).resolves.toMatchObject({
stdout: `1.0.0\n`,
});
})
}),
);

test(
Expand All @@ -150,7 +150,7 @@ describe(`Commands`, () => {
await expect(run(`dlx`, `-q`, `@private/has-bin-entry`)).resolves.toMatchObject({
stdout: `1.0.0\n`,
});
})
}),
);
});
});
Loading

0 comments on commit d545400

Please sign in to comment.