Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add "exports" to the package.json to make self-referencing import… #239

Merged
merged 3 commits into from
Feb 23, 2023
Merged
Show file tree
Hide file tree
Changes from 2 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
3 changes: 3 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,9 @@
"engines": {
"node": ">=14.14.0"
},
"exports": {
"./package.json": "./package.json"
},
"license": "MIT",
"packageManager": "yarn@4.0.0-rc.15+sha224.7fa5c1d1875b041cea8fcbf9a364667e398825364bf5c5c8cd5f6601",
"devDependencies": {
Expand Down
3 changes: 2 additions & 1 deletion tests/_runCli.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import {PortablePath, npath} from '@yarnpkg/fslib';
import {spawn} from 'child_process';
import {dirname, join} from 'path';

export async function runCli(cwd: PortablePath, argv: Array<string>): Promise<{exitCode: number | null, stdout: string, stderr: string}> {
const out: Array<Buffer> = [];
Expand All @@ -8,7 +9,7 @@ export async function runCli(cwd: PortablePath, argv: Array<string>): Promise<{e
return new Promise((resolve, reject) => {
if (process.env.RUN_CLI_ID)
(process.env.RUN_CLI_ID as any)++;
const child = spawn(process.execPath, [`--no-warnings`, `-r`, require.resolve(`./recordRequests.js`), require.resolve(`corepack/dist/corepack.js`), ...argv], {
const child = spawn(process.execPath, [`--no-warnings`, `-r`, require.resolve(`./recordRequests.js`), join(dirname(require.resolve(`corepack/package.json`)), `dist/corepack.js`), ...argv], {
aduh95 marked this conversation as resolved.
Show resolved Hide resolved
cwd: npath.fromPortablePath(cwd),
env: process.env,
stdio: `pipe`,
Expand Down