Skip to content
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.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
727 changes: 380 additions & 347 deletions .pnp.cjs

Large diffs are not rendered by default.

30 changes: 22 additions & 8 deletions .pnp.loader.mjs

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

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.
20 changes: 20 additions & 0 deletions .yarn/patches/supports-color-npm-7.1.0-df2ba1e338.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
diff --git a/index.js b/index.js
index dcaa45412304d464fe37e9ceab64ba68ac1a092a..dd6dd54a385e4b29902704749d8528e60160ed92 100644
--- a/index.js
+++ b/index.js
@@ -1,6 +1,5 @@
'use strict';
const os = require('os');
-const tty = require('tty');
const hasFlag = require('has-flag');

const {env} = process;
@@ -134,6 +133,6 @@ function getSupportLevel(stream) {

module.exports = {
supportsColor: getSupportLevel,
- stdout: translateLevel(supportsColor(true, tty.isatty(1))),
- stderr: translateLevel(supportsColor(true, tty.isatty(2)))
+ stdout: translateLevel(supportsColor(true, process.stdout)),
+ stderr: translateLevel(supportsColor(true, process.stderr))
};
29 changes: 29 additions & 0 deletions .yarn/versions/0eea1a66.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
releases:
"@yarnpkg/builder": major
"@yarnpkg/cli": major
"@yarnpkg/plugin-constraints": major
"@yarnpkg/plugin-essentials": major
"@yarnpkg/plugin-interactive-tools": major
"@yarnpkg/plugin-typescript": major
"@yarnpkg/plugin-workspace-tools": major
vscode-zipfs: major

declined:
- "@yarnpkg/plugin-compat"
- "@yarnpkg/plugin-dlx"
- "@yarnpkg/plugin-exec"
- "@yarnpkg/plugin-init"
- "@yarnpkg/plugin-nm"
- "@yarnpkg/plugin-npm-cli"
- "@yarnpkg/plugin-pack"
- "@yarnpkg/plugin-patch"
- "@yarnpkg/plugin-pnp"
- "@yarnpkg/plugin-pnpm"
- "@yarnpkg/plugin-stage"
- "@yarnpkg/plugin-version"
- "@yarnpkg/core"
- "@yarnpkg/doctor"
- "@yarnpkg/fslib"
- "@yarnpkg/libui"
- "@yarnpkg/pnp"
- "@yarnpkg/shell"
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
"@babel/preset-typescript": "^7.18.6",
"@types/jest": "^28.1.6",
"@types/micromatch": "^4.0.1",
"@types/node": "^18.17.15",
"@types/node": "^20.6.2",
"@types/react": "^16.8.0",
"@types/semver": "^7.1.0",
"@yarnpkg/cli": "workspace:^",
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
// Jest Snapshot v1, https://goo.gl/fbAQLP

exports[`Features Snapshotting should support running a snapshot (--version) 1`] = `
"4.0.0-rc.50.git.20230916.hash-ea9158fdf
"
`;

exports[`Features Snapshotting should support running a snapshot (install) 1`] = `
"➤ YN0000: · Yarn 4.0.0-rc.50.git.20230916.hash-ea9158fdf
➤ YN0000: ┌ Resolution step
➤ YN0085: │ + no-deps@npm:1.0.0
➤ YN0000: └ Completed
➤ YN0000: ┌ Fetch step
➤ YN0013: │ A package was added to the project (+ 0.78 KiB).
➤ YN0000: └ Completed
➤ YN0000: ┌ Link step
➤ YN0000: └ Completed
➤ YN0000: · Done
"
`;

exports[`Features Snapshotting should support running a snapshot (run) 1`] = `
"➤ YN0000: Done
"
`;
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
import {execUtils} from '@yarnpkg/core';

const BUNDLE_PATH = require.resolve(`${__dirname}/../../../../yarnpkg-cli/bundles/yarn.js`);

describe(`Features`, () => {
describe(`Snapshotting`, () => {
it(`should support building a snapshot`, makeTemporaryEnv({}, async ({path, run, source}) => {
await execUtils.execvp(`node`, [`--snapshot-blob`, `snapshot.blob`, `--build-snapshot`, BUNDLE_PATH], {
cwd: path,
});
}));

for (const args of [[`--version`], [`install`], [`run`]]) {
it(`should support running a snapshot (${args.join(` `)})`, makeTemporaryEnv({
dependencies: {
[`no-deps`]: `1.0.0`,
},
}, async ({path, run, source}) => {
await execUtils.execvp(`node`, [`--snapshot-blob`, `snapshot.blob`, `--build-snapshot`, BUNDLE_PATH], {
cwd: path,
});

const {stdout} = await run(...args, {
env: {
NODE_OPTIONS: `--snapshot-blob snapshot.blob`,
},
});

expect(stdout).toMatchSnapshot();
}));
}
});
});
2 changes: 1 addition & 1 deletion packages/docusaurus/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
"@types/three": "^0.144.0",
"@yarnpkg/cli": "workspace:^",
"@yarnpkg/parsers": "workspace:^",
"algoliasearch": "^4.14.2",
"algoliasearch": "^4.20.0",
"clipanion": "^4.0.0-rc.2",
"clsx": "^1.2.1",
"dompurify": "^3.0.5",
Expand Down
2 changes: 1 addition & 1 deletion packages/gatsby/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@
"@types/react": "^16.8.0",
"@types/react-helmet": "^6.1.0",
"@yarnpkg/monorepo": "workspace:^",
"algoliasearch": "^4.2.0",
"algoliasearch": "^4.20.0",
"ansi-html": "^0.0.7",
"buffer": "^5.6.0",
"bytes": "^3.1.0",
Expand Down
4 changes: 2 additions & 2 deletions packages/plugin-constraints/sources/tauModule.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ import {Project, structUtils} from '@yarnpkg/core';
import {PortablePath} from '@yarnpkg/fslib';
import getPath from 'lodash/get';
import pl from 'tau-prolog';
import vm from 'vm';

// eslint-disable-next-line @typescript-eslint/naming-convention
const {is_atom: isAtom, is_variable: isVariable, is_instantiated_list: isInstantiatedList} = pl.type;
Expand Down Expand Up @@ -136,7 +135,8 @@ const tauModule = new pl.type.Module(`constraints`, {
for (const [index, value] of (checkArgv.toJavaScript() as Array<string>).entries())
vars[`$${index}`] = value;

const result = vm.runInNewContext(checkCode.id, vars);
const {runInNewContext} = require(`vm`) as typeof import('vm');
const result = runInNewContext(checkCode.id, vars);

if (result) {
thread.success(point);
Expand Down
3 changes: 2 additions & 1 deletion packages/plugin-essentials/sources/commands/plugin/import.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@ import {PortablePath, npath, ppath, xfs}
import {Command, Option, Usage} from 'clipanion';
import semver from 'semver';
import {URL} from 'url';
import {runInNewContext} from 'vm';

import {getAvailablePlugins} from './list';

Expand Down Expand Up @@ -127,6 +126,8 @@ export async function savePlugin(pluginSpec: string, pluginBuffer: Buffer, {chec
const vmExports = {} as any;
const vmModule = {exports: vmExports};

const {runInNewContext} = require(`vm`) as typeof import('vm');

runInNewContext(pluginBuffer.toString(), {
module: vmModule,
exports: vmExports,
Expand Down
1 change: 0 additions & 1 deletion packages/plugin-interactive-tools/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@
},
"dependencies": {
"@yarnpkg/libui": "workspace:^",
"algoliasearch": "^4.2.0",
"clipanion": "^4.0.0-rc.2",
"diff": "^5.1.0",
"ink": "^3.0.8",
Expand Down
19 changes: 6 additions & 13 deletions packages/plugin-interactive-tools/sources/algolia.ts
Original file line number Diff line number Diff line change
@@ -1,14 +1,4 @@
import algoliasearch from 'algoliasearch';

const algolia = {
appId: `OFCNCOG2CU`,
apiKey: `6fe4476ee5a1832882e326b506d14126`,
indexName: `npm-search`,
};

const client = algoliasearch(algolia.appId, algolia.apiKey).initIndex(
algolia.indexName,
);
import {Configuration, httpUtils} from '@yarnpkg/core';

export interface AlgoliaPackage {
objectID: string;
Expand All @@ -32,9 +22,12 @@ export interface AlgoliaPackageOwner {

export const search = async (
query: string,
page: number = 0,
{configuration, page = 0}: {configuration: Configuration, page?: number},
) => {
const res = await client.search<AlgoliaPackage>(
const algoliaClient = httpUtils.createAlgoliaClient(configuration);
const index = algoliaClient.initIndex(`npm-search`);

const res = await index.search<AlgoliaPackage>(
query,
{
analyticsTags: [`yarn-plugin-interactive-tools`],
Expand Down
9 changes: 7 additions & 2 deletions packages/plugin-interactive-tools/sources/commands/search.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -191,15 +191,20 @@ export default class SearchCommand extends BaseCommand {
const fetchHits = async () => {
setPage(0);

const res = await search(query);
const res = await search(query, {
configuration,
});

if (res.query === query) {
setHits(res.hits);
}
};

const fetchNextPageHits = async () => {
const res = await search(query, page + 1);
const res = await search(query, {
configuration,
page: page + 1,
});

if (res.query === query && res.page - 1 === page) {
setPage(res.page);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import {suggestUtils}
import {Command, Usage} from 'clipanion';
import {diffWords} from 'diff';
import semver from 'semver';
import {WriteStream} from 'tty';
import type {WriteStream} from 'tty';

const SIMPLE_SEMVER = /^((?:[\^~]|>=?)?)([0-9]+)(\.[0-9]+)(\.[0-9]+)((?:-\S+)?)$/;

Expand Down
2 changes: 0 additions & 2 deletions packages/plugin-typescript/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@
"dependencies": {
"@yarnpkg/fslib": "workspace:^",
"@yarnpkg/plugin-pack": "workspace:^",
"algoliasearch": "^4.2.0",
"semver": "^7.1.2",
"tslib": "^2.4.0"
},
Expand All @@ -20,7 +19,6 @@
"@yarnpkg/plugin-essentials": "workspace:^"
},
"devDependencies": {
"@algolia/requester-common": "4.0.0-beta.14",
"@types/semver": "^7.1.0",
"@yarnpkg/builder": "workspace:^",
"@yarnpkg/cli": "workspace:^",
Expand Down
Loading