Skip to content

Commit 8bc2c25

Browse files
Merge branch 'master' into joverbye-dedupe-optimisation
2 parents 2577eed + 8452bc2 commit 8bc2c25

File tree

20 files changed

+633
-428
lines changed

20 files changed

+633
-428
lines changed

.pnp.cjs

Lines changed: 7 additions & 5 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

.yarn/versions/78344001.yml

Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
releases:
2+
"@yarnpkg/fslib": patch
3+
4+
declined:
5+
- "@yarnpkg/plugin-catalog"
6+
- "@yarnpkg/plugin-compat"
7+
- "@yarnpkg/plugin-constraints"
8+
- "@yarnpkg/plugin-dlx"
9+
- "@yarnpkg/plugin-essentials"
10+
- "@yarnpkg/plugin-exec"
11+
- "@yarnpkg/plugin-file"
12+
- "@yarnpkg/plugin-git"
13+
- "@yarnpkg/plugin-github"
14+
- "@yarnpkg/plugin-init"
15+
- "@yarnpkg/plugin-jsr"
16+
- "@yarnpkg/plugin-link"
17+
- "@yarnpkg/plugin-nm"
18+
- "@yarnpkg/plugin-npm"
19+
- "@yarnpkg/plugin-npm-cli"
20+
- "@yarnpkg/plugin-pack"
21+
- "@yarnpkg/plugin-patch"
22+
- "@yarnpkg/plugin-pnp"
23+
- "@yarnpkg/plugin-pnpm"
24+
- "@yarnpkg/plugin-stage"
25+
- "@yarnpkg/plugin-typescript"
26+
- "@yarnpkg/plugin-version"
27+
- "@yarnpkg/plugin-workspace-tools"
28+
- vscode-zipfs
29+
- "@yarnpkg/builder"
30+
- "@yarnpkg/cli"
31+
- "@yarnpkg/core"
32+
- "@yarnpkg/doctor"
33+
- "@yarnpkg/libzip"
34+
- "@yarnpkg/nm"
35+
- "@yarnpkg/pnp"
36+
- "@yarnpkg/pnpify"
37+
- "@yarnpkg/sdks"
38+
- "@yarnpkg/shell"

packages/acceptance-tests/pkg-tests-core/sources/utils/tests.ts

Lines changed: 8 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -479,16 +479,14 @@ export const startPackageServer = ({type}: {type: keyof typeof packageServerUrls
479479
const packageVersionEntry = packageEntry.get(version);
480480
invariant(packageVersionEntry, `This can only exist`);
481481

482-
const data = JSON.stringify({
483-
[version as string]: Object.assign({}, packageVersionEntry!.packageJson, {
484-
dist: {
485-
shasum: await getPackageArchiveHash(name, version),
486-
tarball: (localName === `unconventional-tarball` || localName === `private-unconventional-tarball`)
487-
? (await getPackageHttpArchivePath(name, version)).replace(`/-/`, `/tralala/`)
488-
: await getPackageHttpArchivePath(name, version),
489-
},
490-
}),
491-
});
482+
const data = JSON.stringify(Object.assign({}, packageVersionEntry!.packageJson, {
483+
dist: {
484+
shasum: await getPackageArchiveHash(name, version),
485+
tarball: (localName === `unconventional-tarball` || localName === `private-unconventional-tarball`)
486+
? (await getPackageHttpArchivePath(name, version)).replace(`/-/`, `/tralala/`)
487+
: await getPackageHttpArchivePath(name, version),
488+
},
489+
}));
492490

493491
response.writeHead(200, {[`Content-Type`]: `application/json`});
494492
response.end(data);

packages/berry-cli/bin/berry.js

Lines changed: 191 additions & 191 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

packages/docusaurus/docs/features/constraints.mdx

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -133,6 +133,10 @@ This code ensures that no two workspaces in your project can list the same packa
133133
/** @type {import('@yarnpkg/types')} */
134134
const {defineConfig} = require(`@yarnpkg/types`);
135135

136+
/**
137+
* @typedef {import('@yarnpkg/types').Yarn.Constraints.Context} Context
138+
*/
139+
136140
/**
137141
* This rule will enforce that a workspace MUST depend on the same version of
138142
* a dependency as the one used by the other workspaces.

packages/docusaurus/package.json

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,8 @@
66
"build": "docusaurus build",
77
"swizzle": "docusaurus swizzle",
88
"clear": "docusaurus clear",
9-
"serve": "docusaurus serve"
9+
"serve": "docusaurus serve",
10+
"test:schema": "run test:unit packages/docusaurus"
1011
},
1112
"dependencies": {
1213
"@docusaurus/core": "^3.7.0",
@@ -79,6 +80,7 @@
7980
"@docusaurus/types": "^3.7.0",
8081
"@types/dompurify": "^3",
8182
"@types/git-url-parse": "^9.0.0",
83+
"@types/jest": "^28.1.6",
8284
"@types/markdown-it": "^12.2.3",
8385
"@types/marked": "^5.0.0",
8486
"@types/mdast": "^4.0.3",
@@ -91,6 +93,7 @@
9193
"@types/resolve": "^1.20.0",
9294
"@types/semver": "^7.1.0",
9395
"@types/three": "^0.144.0",
96+
"ajv": "^8.17.1",
9497
"clipanion": "^4.0.0-rc.2",
9598
"mdast-util-mdx-jsx": "^3.0.0",
9699
"unified": "^11.0.4"

packages/docusaurus/static/configuration/yarnrc.json

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -273,7 +273,7 @@
273273
"httpTimeout": {
274274
"_package": "@yarnpkg/core",
275275
"title": "Amount of time to wait before cancelling pending HTTP requests.",
276-
"type": "mixed",
276+
"type": ["number", "string"],
277277
"oneOf": [
278278
{ "type": "number" },
279279
{ "type": "string", "pattern": "^(\\d*\\.?\\d+)(ms|s|m|h|d|w)?$" }
@@ -487,7 +487,7 @@
487487
"_package": "@yarnpkg/core",
488488
"title": "Minimum age of a package version according to the publish date on the npm registry to be considered for installation.",
489489
"description": "If a package version is newer than the minimal age gate, it will not be considered for installation. This can be used to reduce the likelihood of installing compromised packages, or to avoid relying on packages that could still be unpublished (e.g. the npm registry has specific rules for packages less than 3 days old).",
490-
"type": "mixed",
490+
"type": ["number", "string"],
491491
"oneOf": [
492492
{ "type": "number" },
493493
{ "type": "string", "pattern": "^(\\d*\\.?\\d+)(ms|s|m|h|d|w)?$" }
@@ -861,7 +861,7 @@
861861
"_package": "@yarnpkg/core",
862862
"title": "Define the minimal amount of time between two telemetry events.",
863863
"description": "By default we only send one request per week, making it impossible for us to track your usage with a lower granularity.",
864-
"type": "mixed",
864+
"type": ["number", "string"],
865865
"oneOf": [
866866
{ "type": "number" },
867867
{ "type": "string", "pattern": "^(\\d*\\.?\\d+)(ms|s|m|h|d|w)?$" }
Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
import Ajv2019 from 'ajv/dist/2019';
2+
import draft2019Schema from 'ajv/dist/refs/json-schema-2019-09/schema.json';
3+
4+
import manifestSchema from '../static/configuration/manifest.json';
5+
import yarnRcSchema from '../static/configuration/yarnrc.json';
6+
7+
const ajv = new Ajv2019();
8+
const validate = ajv.compile(draft2019Schema);
9+
10+
describe(`manifest.json`, () => {
11+
it(`is a valid JSON Schema`, () => {
12+
const result = validate(manifestSchema);
13+
expect(validate.errors).toBeNull();
14+
expect(result).toBe(true);
15+
});
16+
});
17+
18+
describe(`yarnrc.json`, () => {
19+
it(`is a valid JSON Schema`, () => {
20+
const result = validate(yarnRcSchema);
21+
expect(validate.errors).toBeNull();
22+
expect(result).toBe(true);
23+
});
24+
});

packages/plugin-git/package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@yarnpkg/plugin-git",
3-
"version": "3.1.3",
3+
"version": "3.1.4",
44
"license": "BSD-2-Clause",
55
"main": "./sources/index.ts",
66
"exports": {
@@ -45,5 +45,5 @@
4545
"engines": {
4646
"node": ">=18.12.0"
4747
},
48-
"stableVersion": "3.1.3"
48+
"stableVersion": "3.1.4"
4949
}

packages/plugin-git/sources/gitUtils.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -259,7 +259,7 @@ export async function clone(url: string, configuration: Configuration) {
259259
const directory = await xfs.mktempPromise();
260260
const execOpts = {cwd: directory, env: makeGitEnvironment()};
261261

262-
await git(`cloning the repository`, [`clone`, `-c core.autocrlf=false`, normalizedRepoUrl, npath.fromPortablePath(directory)], execOpts, {configuration, normalizedRepoUrl});
262+
await git(`cloning the repository`, [`clone`, `-c`, `core.autocrlf=false`, normalizedRepoUrl, npath.fromPortablePath(directory)], execOpts, {configuration, normalizedRepoUrl});
263263
await git(`switching branch`, [`checkout`, `${request}`], execOpts, {configuration, normalizedRepoUrl});
264264

265265
return directory;

0 commit comments

Comments
 (0)