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

feat(pnp): exports support #2431

Merged
merged 41 commits into from
Feb 26, 2021
Merged
Show file tree
Hide file tree
Changes from 37 commits
Commits
Show all changes
41 commits
Select commit Hold shift + click to select a range
abbd2ed
feat(pnp): exports support
paul-soporan Jan 11, 2021
e502810
fix(pnp): construct subpath correctly
paul-soporan Jan 11, 2021
6d9c9c3
fix(pnp): normalize subpath
paul-soporan Jan 11, 2021
34c2b51
chore: add basic test (originally written by bgotink)
paul-soporan Jan 11, 2021
71e9551
test: add another test
paul-soporan Jan 12, 2021
a88ef1d
refactor: rename resolveExports to resolveExport
paul-soporan Jan 12, 2021
58a2218
chore: update resolve.exports
paul-soporan Jan 12, 2021
4a4120e
test: add more tests
paul-soporan Jan 14, 2021
bd12ce0
refactor: add note about --conditions flag
paul-soporan Feb 2, 2021
d9369cb
Merge remote-tracking branch 'yarnpkg/master' into paul/exports
paul-soporan Feb 2, 2021
4126699
test: improve tests
paul-soporan Feb 2, 2021
5d41268
test: add tests for no known conditions error
paul-soporan Feb 2, 2021
6b3987f
test: add manifest test
paul-soporan Feb 2, 2021
ee4a789
test: add test for self-referencing
paul-soporan Feb 2, 2021
2a4f4eb
chore: update babel and jest
paul-soporan Feb 2, 2021
244e6df
refactor: wording
paul-soporan Feb 2, 2021
2b06727
Revert "chore: update babel and jest"
paul-soporan Feb 2, 2021
921bef6
chore: update hook
merceyz Feb 3, 2021
21a5d96
chore: versions
paul-soporan Feb 3, 2021
1416697
refactor: add options to resolveUnqualifiedExport
paul-soporan Feb 3, 2021
5a06310
chore: update pnp hook
paul-soporan Feb 3, 2021
228ec16
Merge branch 'master' into paul/exports
paul-soporan Feb 10, 2021
b44fe2a
fix: include packages that are discarded from lookup
paul-soporan Feb 10, 2021
ce66dec
test: check that resolveUnqualifiedExport is a method on the pnpapi
paul-soporan Feb 10, 2021
39aa7eb
fix: don't throw on missing manifest
paul-soporan Feb 10, 2021
ff48c1a
Merge remote-tracking branch 'origin/master' into paul/exports
arcanis Feb 13, 2021
4054545
Tolerates paths outside of the dependency tree
arcanis Feb 13, 2021
e7c61e5
Fixes tests
arcanis Feb 13, 2021
8df6be6
Adds support for publishConfig.exports
arcanis Feb 13, 2021
140c3ef
test: fix tests on windows
paul-soporan Feb 16, 2021
d830dcf
test: add more link: tests
paul-soporan Feb 16, 2021
3636c60
fix: support exports with pnpIgnorePatterns
paul-soporan Feb 17, 2021
3686eec
Merge branch 'master' into paul/exports
paul-soporan Feb 24, 2021
2599c10
fix: handle case when path is ignored
paul-soporan Feb 24, 2021
a34c2dc
refactor: don't expose resolveUnqualifiedExport
paul-soporan Feb 24, 2021
2ffd106
chore: update hook
paul-soporan Feb 24, 2021
732bcaa
test: add test for ignored path
paul-soporan Feb 24, 2021
8eaa65d
Update packages/acceptance-tests/pkg-tests-specs/sources/pnpapi.test.ts
paul-soporan Feb 25, 2021
5a13156
Merge remote-tracking branch 'origin/master' into paul/exports
arcanis Feb 26, 2021
da269b3
Reverts accidental comment
arcanis Feb 26, 2021
42a5e41
Adds back missing deps
arcanis Feb 26, 2021
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
2 changes: 1 addition & 1 deletion .github/workflows/integration-workflow.yml
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ jobs:
env:
TARGET_BRANCH: ${{github.event.pull_request.base.ref}}

- name: 'Check that the PnP hook is consistent with a fresh build (fix w/ "git merge master && yarn build:pnp:hook")'
- name: 'Check that the PnP hook is consistent with a fresh build (fix w/ "git merge master && yarn update:pnp:hook")'
run: |
if [[ $(git diff --name-only "$(git merge-base origin/"$TARGET_BRANCH" HEAD)" HEAD -- packages/yarnpkg-pnp/sources/hook.js | wc -l) -gt 0 ]]; then
node ./scripts/run-yarn.js build:pnp:hook
Expand Down
99,959 changes: 50,096 additions & 49,863 deletions .pnp.cjs

Large diffs are not rendered by default.

Binary file not shown.
26 changes: 26 additions & 0 deletions .yarn/versions/9f82aeec.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
releases:
"@yarnpkg/cli": minor
"@yarnpkg/plugin-node-modules": patch
"@yarnpkg/plugin-pack": minor
"@yarnpkg/plugin-pnp": minor
"@yarnpkg/pnp": minor

declined:
- "@yarnpkg/esbuild-plugin-pnp"
- "@yarnpkg/plugin-compat"
- "@yarnpkg/plugin-constraints"
- "@yarnpkg/plugin-dlx"
- "@yarnpkg/plugin-essentials"
- "@yarnpkg/plugin-init"
- "@yarnpkg/plugin-interactive-tools"
- "@yarnpkg/plugin-npm"
- "@yarnpkg/plugin-npm-cli"
- "@yarnpkg/plugin-patch"
- "@yarnpkg/plugin-stage"
- "@yarnpkg/plugin-typescript"
- "@yarnpkg/plugin-version"
- "@yarnpkg/plugin-workspace-tools"
- "@yarnpkg/builder"
- "@yarnpkg/core"
- "@yarnpkg/doctor"
- "@yarnpkg/pnpify"
15 changes: 12 additions & 3 deletions packages/acceptance-tests/pkg-tests-core/sources/utils/yarn.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import {DEFAULT_RC_FILENAME, Manifest} from '@yarnpkg/core';
import {PortablePath, ppath, Filename} from '@yarnpkg/fslib';
import {DEFAULT_RC_FILENAME, Manifest} from '@yarnpkg/core';
import {PortablePath, ppath, Filename, xfs} from '@yarnpkg/fslib';

import * as fsUtils from './fs';
import * as fsUtils from './fs';

export async function readConfiguration(dir: PortablePath, {filename = DEFAULT_RC_FILENAME}: {filename?: Filename} = {}) {
return await fsUtils.readSyml(ppath.join(dir, filename));
Expand All @@ -16,6 +16,15 @@ export async function readManifest(dir: PortablePath, {key, filename = Filename.
return key != null ? data?.[key] : data;
}

export async function writeManifest(dir: PortablePath, value: {[key: string]: any}, {filename = Filename.manifest}: {filename?: Filename} = {}) {
return await fsUtils.writeJson(ppath.join(dir, filename), value);
}

export async function writePackage(dir: PortablePath, manifest: {[key: string]: any}) {
await xfs.mkdirPromise(dir, {recursive: true});
await writeManifest(dir, manifest);
}

export function getPluginPath(dir: PortablePath, name: string) {
return ppath.join(dir, `.yarn/plugins/${name}.cjs` as PortablePath);
}
Loading