From 0aff756fc2fc9c0d6fee5ea5467d985e72855a17 Mon Sep 17 00:00:00 2001 From: larry1123 Date: Thu, 8 Sep 2022 05:51:39 -0400 Subject: [PATCH 01/11] Add `export` fields to manifests to prevent deep imports Also made sure to export some utils that may not have been exported before. --- .yarn/versions/eceb2ca1.yml | 41 +++++++++++++++++++ .../pkg-tests-core/package.json | 4 ++ .../pkg-tests-specs/package.json | 4 ++ packages/eslint-config/package.json | 4 ++ packages/plugin-compat/package.json | 13 +++++- packages/plugin-constraints/package.json | 18 +++++++- packages/plugin-dlx/package.json | 18 +++++++- packages/plugin-essentials/package.json | 18 +++++++- packages/plugin-exec/package.json | 13 +++++- packages/plugin-exec/sources/index.ts | 2 + packages/plugin-file/package.json | 13 +++++- packages/plugin-file/sources/index.ts | 4 ++ packages/plugin-git/package.json | 13 +++++- packages/plugin-git/sources/index.ts | 2 + packages/plugin-github/package.json | 13 +++++- packages/plugin-github/sources/index.ts | 4 ++ packages/plugin-http/package.json | 13 +++++- packages/plugin-http/sources/index.ts | 3 ++ packages/plugin-init/package.json | 18 +++++++- .../plugin-interactive-tools/package.json | 18 +++++++- packages/plugin-link/package.json | 13 +++++- packages/plugin-link/sources/index.ts | 5 +++ packages/plugin-nm/package.json | 13 +++++- packages/plugin-nm/sources/index.ts | 4 ++ packages/plugin-npm-cli/package.json | 18 +++++++- packages/plugin-npm-cli/sources/index.ts | 3 ++ packages/plugin-npm/package.json | 13 +++++- packages/plugin-npm/sources/index.ts | 5 +++ packages/plugin-pack/package.json | 18 +++++++- packages/plugin-patch/package.json | 18 +++++++- packages/plugin-patch/sources/index.ts | 2 + packages/plugin-pnp/package.json | 18 +++++++- packages/plugin-pnpm/package.json | 13 +++++- packages/plugin-pnpm/sources/index.ts | 2 + packages/plugin-stage/package.json | 18 +++++++- packages/plugin-stage/sources/index.ts | 3 ++ packages/plugin-typescript/package.json | 13 +++++- packages/plugin-version/package.json | 18 +++++++- packages/plugin-workspace-tools/package.json | 18 +++++++- packages/yarnpkg-builder/package.json | 18 +++++++- packages/yarnpkg-cli/package.json | 13 +++++- packages/yarnpkg-core/package.json | 13 +++++- packages/yarnpkg-core/sources/index.ts | 2 + packages/yarnpkg-doctor/package.json | 13 +++++- packages/yarnpkg-extensions/package.json | 13 +++++- packages/yarnpkg-fslib/package.json | 13 +++++- packages/yarnpkg-libzip/package.json | 32 ++++++++++++++- packages/yarnpkg-nm/package.json | 13 +++++- packages/yarnpkg-parsers/package.json | 13 +++++- packages/yarnpkg-pnp/package.json | 13 +++++- packages/yarnpkg-pnpify/package.json | 28 ++++++++++++- .../yarnpkg-pnpify/sources/NodeModulesFS.ts | 2 +- packages/yarnpkg-pnpify/sources/utils.ts | 5 +++ packages/yarnpkg-sdks/package.json | 23 ++++++++++- packages/yarnpkg-shell/package.json | 18 +++++++- 55 files changed, 646 insertions(+), 37 deletions(-) create mode 100644 .yarn/versions/eceb2ca1.yml create mode 100644 packages/yarnpkg-pnpify/sources/utils.ts diff --git a/.yarn/versions/eceb2ca1.yml b/.yarn/versions/eceb2ca1.yml new file mode 100644 index 000000000000..fd499634edba --- /dev/null +++ b/.yarn/versions/eceb2ca1.yml @@ -0,0 +1,41 @@ +releases: + "@yarnpkg/builder": major + "@yarnpkg/cli": major + "@yarnpkg/core": major + "@yarnpkg/doctor": major + "@yarnpkg/eslint-config": minor + "@yarnpkg/extensions": major + "@yarnpkg/fslib": major + "@yarnpkg/libzip": major + "@yarnpkg/nm": major + "@yarnpkg/parsers": major + "@yarnpkg/plugin-compat": major + "@yarnpkg/plugin-constraints": major + "@yarnpkg/plugin-dlx": major + "@yarnpkg/plugin-essentials": major + "@yarnpkg/plugin-exec": major + "@yarnpkg/plugin-file": major + "@yarnpkg/plugin-git": major + "@yarnpkg/plugin-github": major + "@yarnpkg/plugin-http": major + "@yarnpkg/plugin-init": major + "@yarnpkg/plugin-interactive-tools": major + "@yarnpkg/plugin-link": major + "@yarnpkg/plugin-nm": major + "@yarnpkg/plugin-npm": major + "@yarnpkg/plugin-npm-cli": major + "@yarnpkg/plugin-pack": major + "@yarnpkg/plugin-patch": major + "@yarnpkg/plugin-pnp": major + "@yarnpkg/plugin-pnpm": major + "@yarnpkg/plugin-stage": major + "@yarnpkg/plugin-typescript": major + "@yarnpkg/plugin-version": major + "@yarnpkg/plugin-workspace-tools": major + "@yarnpkg/pnp": major + "@yarnpkg/pnpify": major + "@yarnpkg/sdks": major + "@yarnpkg/shell": major + +declined: + - vscode-zipfs diff --git a/packages/acceptance-tests/pkg-tests-core/package.json b/packages/acceptance-tests/pkg-tests-core/package.json index ad66da649092..d31e1c123560 100644 --- a/packages/acceptance-tests/pkg-tests-core/package.json +++ b/packages/acceptance-tests/pkg-tests-core/package.json @@ -3,6 +3,10 @@ "private": true, "license": "BSD-2-Clause", "main": "./sources/index.ts", + "exports": { + ".": "./sources/index.ts", + "./package.json": "./package.json" + }, "devDependencies": { "@types/finalhandler": "1.1.0", "@types/invariant": "^2.2.30", diff --git a/packages/acceptance-tests/pkg-tests-specs/package.json b/packages/acceptance-tests/pkg-tests-specs/package.json index 5030c59895c5..0f72a76826b0 100644 --- a/packages/acceptance-tests/pkg-tests-specs/package.json +++ b/packages/acceptance-tests/pkg-tests-specs/package.json @@ -3,6 +3,10 @@ "private": true, "license": "BSD-2-Clause", "main": "./sources/index.js", + "exports": { + ".": "./sources/index.ts", + "./package.json": "./package.json" + }, "repository": { "type": "git", "url": "ssh://git@github.com/yarnpkg/berry.git", diff --git a/packages/eslint-config/package.json b/packages/eslint-config/package.json index e9d4387cd56b..fff2af1865d3 100644 --- a/packages/eslint-config/package.json +++ b/packages/eslint-config/package.json @@ -2,6 +2,10 @@ "name": "@yarnpkg/eslint-config", "version": "1.0.0-rc.18", "license": "BSD-2-Clause", + "exports": { + ".": "./index.js", + "./react": "./react.js" + }, "dependencies": { "@rushstack/eslint-patch": "^1.1.0", "@typescript-eslint/eslint-plugin": "^5.3.1", diff --git a/packages/plugin-compat/package.json b/packages/plugin-compat/package.json index f402e030dcaa..846de2fe02a7 100644 --- a/packages/plugin-compat/package.json +++ b/packages/plugin-compat/package.json @@ -4,6 +4,10 @@ "stableVersion": "3.1.4", "license": "BSD-2-Clause", "main": "./sources/index.ts", + "exports": { + ".": "./sources/index.ts", + "./package.json": "./package.json" + }, "peerDependencies": { "@yarnpkg/core": "workspace:^", "@yarnpkg/plugin-patch": "workspace:^" @@ -36,7 +40,14 @@ }, "publishConfig": { "main": "./lib/index.js", - "typings": "./lib/index.d.ts" + "types": "./lib/index.d.ts", + "exports": { + ".": { + "types": "./lib/index.d.ts", + "require": "./lib/index.js" + }, + "./package.json": "./package.json" + } }, "files": [ "/lib/**/*" diff --git a/packages/plugin-constraints/package.json b/packages/plugin-constraints/package.json index 0480f00f9e88..081fb7f9299f 100644 --- a/packages/plugin-constraints/package.json +++ b/packages/plugin-constraints/package.json @@ -9,6 +9,11 @@ "directory": "packages/plugin-constraints" }, "main": "./sources/index.ts", + "exports": { + ".": "./sources/index.ts", + "./command/*": "./sources/commands/*.ts", + "./package.json": "./package.json" + }, "dependencies": { "@yarnpkg/fslib": "workspace:^", "clipanion": "^3.2.0-rc.10", @@ -32,7 +37,18 @@ }, "publishConfig": { "main": "./lib/index.js", - "typings": "./lib/index.d.ts" + "types": "./lib/index.d.ts", + "exports": { + ".": { + "types": "./lib/index.d.ts", + "require": "./lib/index.js" + }, + "./command/*": { + "types": "./lib/commands/*.d.ts", + "require": "./lib/commands/*.js" + }, + "./package.json": "./package.json" + } }, "files": [ "/lib/**/*" diff --git a/packages/plugin-dlx/package.json b/packages/plugin-dlx/package.json index 9622252b9298..1aa4368ff1ae 100644 --- a/packages/plugin-dlx/package.json +++ b/packages/plugin-dlx/package.json @@ -4,6 +4,11 @@ "stableVersion": "3.1.3", "license": "BSD-2-Clause", "main": "./sources/index.ts", + "exports": { + ".": "./sources/index.ts", + "./command/*": "./sources/commands/*.ts", + "./package.json": "./package.json" + }, "dependencies": { "@yarnpkg/fslib": "workspace:^", "clipanion": "^3.2.0-rc.10", @@ -28,7 +33,18 @@ }, "publishConfig": { "main": "./lib/index.js", - "typings": "./lib/index.d.ts" + "types": "./lib/index.d.ts", + "exports": { + ".": { + "types": "./lib/index.d.ts", + "require": "./lib/index.js" + }, + "./command/*": { + "types": "./lib/commands/*.d.ts", + "require": "./lib/commands/*.js" + }, + "./package.json": "./package.json" + } }, "files": [ "/lib/**/*" diff --git a/packages/plugin-essentials/package.json b/packages/plugin-essentials/package.json index 79d5a22074bc..3b4f9b70ea60 100644 --- a/packages/plugin-essentials/package.json +++ b/packages/plugin-essentials/package.json @@ -3,6 +3,11 @@ "version": "4.0.0-rc.18", "license": "BSD-2-Clause", "main": "./sources/index.ts", + "exports": { + ".": "./sources/index.ts", + "./command/*": "./sources/commands/*.ts", + "./package.json": "./package.json" + }, "dependencies": { "@yarnpkg/fslib": "workspace:^", "@yarnpkg/parsers": "workspace:^", @@ -39,7 +44,18 @@ }, "publishConfig": { "main": "./lib/index.js", - "typings": "./lib/index.d.ts" + "types": "./lib/index.d.ts", + "exports": { + ".": { + "types": "./lib/index.d.ts", + "require": "./lib/index.js" + }, + "./command/*": { + "types": "./lib/commands/*.d.ts", + "require": "./lib/commands/*.js" + }, + "./package.json": "./package.json" + } }, "files": [ "/lib/**/*" diff --git a/packages/plugin-exec/package.json b/packages/plugin-exec/package.json index 291e19931a4f..23b3160fe0fd 100644 --- a/packages/plugin-exec/package.json +++ b/packages/plugin-exec/package.json @@ -3,6 +3,10 @@ "version": "3.0.0-rc.18", "license": "BSD-2-Clause", "main": "./sources/index.ts", + "exports": { + ".": "./sources/index.ts", + "./package.json": "./package.json" + }, "dependencies": { "@yarnpkg/fslib": "workspace:^", "tslib": "^2.4.0" @@ -25,7 +29,14 @@ }, "publishConfig": { "main": "./lib/index.js", - "typings": "./lib/index.d.ts" + "types": "./lib/index.d.ts", + "exports": { + ".": { + "types": "./lib/index.d.ts", + "require": "./lib/index.js" + }, + "./package.json": "./package.json" + } }, "files": [ "/lib/**/*" diff --git a/packages/plugin-exec/sources/index.ts b/packages/plugin-exec/sources/index.ts index d2460af5862e..8e33cdd20256 100644 --- a/packages/plugin-exec/sources/index.ts +++ b/packages/plugin-exec/sources/index.ts @@ -6,6 +6,8 @@ import * as execUtils from './execUtils'; export type {ExecEnv}; export {execUtils}; +export {ExecFetcher}; +export {ExecResolver}; const plugin: Plugin = { fetchers: [ diff --git a/packages/plugin-file/package.json b/packages/plugin-file/package.json index 56ffd9b9015d..48c292d5187c 100644 --- a/packages/plugin-file/package.json +++ b/packages/plugin-file/package.json @@ -3,6 +3,10 @@ "version": "3.0.0-rc.18", "license": "BSD-2-Clause", "main": "./sources/index.ts", + "exports": { + ".": "./sources/index.ts", + "./package.json": "./package.json" + }, "dependencies": { "@yarnpkg/fslib": "workspace:^", "tslib": "^2.4.0" @@ -24,7 +28,14 @@ }, "publishConfig": { "main": "./lib/index.js", - "typings": "./lib/index.d.ts" + "types": "./lib/index.d.ts", + "exports": { + ".": { + "types": "./lib/index.d.ts", + "require": "./lib/index.js" + }, + "./package.json": "./package.json" + } }, "files": [ "/lib/**/*" diff --git a/packages/plugin-file/sources/index.ts b/packages/plugin-file/sources/index.ts index b779fddb2408..2cc391d86e5c 100644 --- a/packages/plugin-file/sources/index.ts +++ b/packages/plugin-file/sources/index.ts @@ -7,6 +7,10 @@ import {TarballFileResolver} from './TarballFileResolver'; import * as fileUtils from './fileUtils'; export {fileUtils}; +export {FileFetcher}; +export {FileResolver}; +export {TarballFileFetcher}; +export {TarballFileResolver}; const plugin: Plugin = { fetchers: [ diff --git a/packages/plugin-git/package.json b/packages/plugin-git/package.json index 585401b2de9f..7c1b07f1d30f 100644 --- a/packages/plugin-git/package.json +++ b/packages/plugin-git/package.json @@ -3,6 +3,10 @@ "version": "3.0.0-rc.18", "license": "BSD-2-Clause", "main": "./sources/index.ts", + "exports": { + ".": "./sources/index.ts", + "./package.json": "./package.json" + }, "dependencies": { "@types/semver": "^7.1.0", "@yarnpkg/fslib": "workspace:^", @@ -31,7 +35,14 @@ }, "publishConfig": { "main": "./lib/index.js", - "typings": "./lib/index.d.ts" + "types": "./lib/index.d.ts", + "exports": { + ".": { + "types": "./lib/index.d.ts", + "require": "./lib/index.js" + }, + "./package.json": "./package.json" + } }, "files": [ "/lib/**/*" diff --git a/packages/plugin-git/sources/index.ts b/packages/plugin-git/sources/index.ts index c89f04909f77..7d5afab95c23 100644 --- a/packages/plugin-git/sources/index.ts +++ b/packages/plugin-git/sources/index.ts @@ -60,6 +60,8 @@ const plugin: Plugin = { }; export {gitUtils}; +export {GitFetcher}; +export {GitResolver}; // eslint-disable-next-line arca/no-default-export export default plugin; diff --git a/packages/plugin-github/package.json b/packages/plugin-github/package.json index 3b4b929e82d7..7f64a1967b6d 100644 --- a/packages/plugin-github/package.json +++ b/packages/plugin-github/package.json @@ -3,6 +3,10 @@ "version": "3.0.0-rc.18", "license": "BSD-2-Clause", "main": "./sources/index.ts", + "exports": { + ".": "./sources/index.ts", + "./package.json": "./package.json" + }, "dependencies": { "@yarnpkg/fslib": "workspace:^", "tslib": "^2.4.0" @@ -27,7 +31,14 @@ }, "publishConfig": { "main": "./lib/index.js", - "typings": "./lib/index.d.ts" + "types": "./lib/index.d.ts", + "exports": { + ".": { + "types": "./lib/index.d.ts", + "require": "./lib/index.js" + }, + "./package.json": "./package.json" + } }, "files": [ "/lib/**/*" diff --git a/packages/plugin-github/sources/index.ts b/packages/plugin-github/sources/index.ts index 15cf15e09a73..e36c7b3d8405 100644 --- a/packages/plugin-github/sources/index.ts +++ b/packages/plugin-github/sources/index.ts @@ -2,6 +2,10 @@ import {Plugin} from '@yarnpkg/core'; import {Hooks as GitHooks} from '@yarnpkg/plugin-git'; import {GithubFetcher} from './GithubFetcher'; +import * as githubUtils from './githubUtils'; + +export {githubUtils}; +export {GithubFetcher}; const plugin: Plugin = { hooks: { diff --git a/packages/plugin-http/package.json b/packages/plugin-http/package.json index b80b59cc9823..bbd10ec6e8c7 100644 --- a/packages/plugin-http/package.json +++ b/packages/plugin-http/package.json @@ -3,6 +3,10 @@ "version": "3.0.0-rc.18", "license": "BSD-2-Clause", "main": "./sources/index.ts", + "exports": { + ".": "./sources/index.ts", + "./package.json": "./package.json" + }, "dependencies": { "tslib": "^2.4.0" }, @@ -23,7 +27,14 @@ }, "publishConfig": { "main": "./lib/index.js", - "typings": "./lib/index.d.ts" + "types": "./lib/index.d.ts", + "exports": { + ".": { + "types": "./lib/index.d.ts", + "require": "./lib/index.js" + }, + "./package.json": "./package.json" + } }, "files": [ "/lib/**/*" diff --git a/packages/plugin-http/sources/index.ts b/packages/plugin-http/sources/index.ts index 4a327d5fbe19..19796d2d934a 100644 --- a/packages/plugin-http/sources/index.ts +++ b/packages/plugin-http/sources/index.ts @@ -3,6 +3,9 @@ import {Plugin} from '@yarnpkg/core'; import {TarballHttpFetcher} from './TarballHttpFetcher'; import {TarballHttpResolver} from './TarballHttpResolver'; +export {TarballHttpFetcher}; +export {TarballHttpResolver}; + const plugin: Plugin = { fetchers: [ TarballHttpFetcher, diff --git a/packages/plugin-init/package.json b/packages/plugin-init/package.json index bf66370d3f26..902ad07a6097 100644 --- a/packages/plugin-init/package.json +++ b/packages/plugin-init/package.json @@ -3,6 +3,11 @@ "version": "4.0.0-rc.18", "license": "BSD-2-Clause", "main": "./sources/index.ts", + "exports": { + ".": "./sources/index.ts", + "./command/*": "./sources/commands/*.ts", + "./package.json": "./package.json" + }, "dependencies": { "@yarnpkg/fslib": "workspace:^", "clipanion": "^3.2.0-rc.10", @@ -27,7 +32,18 @@ }, "publishConfig": { "main": "./lib/index.js", - "typings": "./lib/index.d.ts" + "types": "./lib/index.d.ts", + "exports": { + ".": { + "types": "./lib/index.d.ts", + "require": "./lib/index.js" + }, + "./command/*": { + "types": "./lib/commands/*.d.ts", + "require": "./lib/commands/*.js" + }, + "./package.json": "./package.json" + } }, "files": [ "/lib/**/*" diff --git a/packages/plugin-interactive-tools/package.json b/packages/plugin-interactive-tools/package.json index 939c000dc9cb..4ecf00ebea89 100644 --- a/packages/plugin-interactive-tools/package.json +++ b/packages/plugin-interactive-tools/package.json @@ -4,6 +4,11 @@ "stableVersion": "3.1.4", "license": "BSD-2-Clause", "main": "./sources/index.ts", + "exports": { + ".": "./sources/index.ts", + "./command/*": "./sources/commands/*.ts", + "./package.json": "./package.json" + }, "dependencies": { "@yarnpkg/libui": "workspace:^", "algoliasearch": "^4.2.0", @@ -40,7 +45,18 @@ }, "publishConfig": { "main": "./lib/index.js", - "typings": "./lib/index.d.ts" + "types": "./lib/index.d.ts", + "exports": { + ".": { + "types": "./lib/index.d.ts", + "require": "./lib/index.js" + }, + "./command/*": { + "types": "./lib/commands/*.d.ts", + "require": "./lib/commands/*.js" + }, + "./package.json": "./package.json" + } }, "files": [ "/lib/**/*" diff --git a/packages/plugin-link/package.json b/packages/plugin-link/package.json index 30ab8d5a4c0f..95c3d0f2d271 100644 --- a/packages/plugin-link/package.json +++ b/packages/plugin-link/package.json @@ -3,6 +3,10 @@ "version": "3.0.0-rc.18", "license": "BSD-2-Clause", "main": "./sources/index.ts", + "exports": { + ".": "./sources/index.ts", + "./package.json": "./package.json" + }, "dependencies": { "@yarnpkg/fslib": "workspace:^", "tslib": "^2.4.0" @@ -24,7 +28,14 @@ }, "publishConfig": { "main": "./lib/index.js", - "typings": "./lib/index.d.ts" + "types": "./lib/index.d.ts", + "exports": { + ".": { + "types": "./lib/index.d.ts", + "require": "./lib/index.js" + }, + "./package.json": "./package.json" + } }, "files": [ "/lib/**/*" diff --git a/packages/plugin-link/sources/index.ts b/packages/plugin-link/sources/index.ts index cbcbb988526e..a8fe4aa78c14 100644 --- a/packages/plugin-link/sources/index.ts +++ b/packages/plugin-link/sources/index.ts @@ -5,6 +5,11 @@ import {LinkResolver} from './LinkResolver'; import {RawLinkFetcher} from './RawLinkFetcher'; import {RawLinkResolver} from './RawLinkResolver'; +export {LinkFetcher}; +export {LinkResolver}; +export {RawLinkFetcher}; +export {RawLinkResolver}; + const plugin: Plugin = { fetchers: [ RawLinkFetcher, diff --git a/packages/plugin-nm/package.json b/packages/plugin-nm/package.json index 1d5218473b4f..bbc4b4458a94 100644 --- a/packages/plugin-nm/package.json +++ b/packages/plugin-nm/package.json @@ -2,6 +2,10 @@ "name": "@yarnpkg/plugin-nm", "license": "BSD-2-Clause", "main": "./sources/index.ts", + "exports": { + ".": "./sources/index.ts", + "./package.json": "./package.json" + }, "dependencies": { "@yarnpkg/fslib": "workspace:^", "@yarnpkg/libzip": "workspace:^", @@ -37,7 +41,14 @@ }, "publishConfig": { "main": "./lib/index.js", - "typings": "./lib/index.d.ts" + "types": "./lib/index.d.ts", + "exports": { + ".": { + "types": "./lib/index.d.ts", + "require": "./lib/index.js" + }, + "./package.json": "./package.json" + } }, "files": [ "/lib/**/*" diff --git a/packages/plugin-nm/sources/index.ts b/packages/plugin-nm/sources/index.ts index 53f33c79b3fb..4e053cee8adb 100644 --- a/packages/plugin-nm/sources/index.ts +++ b/packages/plugin-nm/sources/index.ts @@ -6,6 +6,10 @@ import {NodeModulesLinker, NodeModulesMode} from './NodeModulesLinker'; import {getGlobalHardlinksStore} from './NodeModulesLinker'; import {PnpLooseLinker} from './PnpLooseLinker'; +export {NodeModulesLinker}; +export {NodeModulesMode}; +export {PnpLooseLinker}; + declare module '@yarnpkg/core' { interface ConfigurationValueMap { nmHoistingLimits: NodeModulesHoistingLimits; diff --git a/packages/plugin-npm-cli/package.json b/packages/plugin-npm-cli/package.json index 16ffe4d6aae2..802eafe3072e 100644 --- a/packages/plugin-npm-cli/package.json +++ b/packages/plugin-npm-cli/package.json @@ -3,6 +3,11 @@ "version": "4.0.0-rc.18", "license": "BSD-2-Clause", "main": "./sources/index.ts", + "exports": { + ".": "./sources/index.ts", + "./command/*": "./sources/commands/*.ts", + "./package.json": "./package.json" + }, "dependencies": { "@yarnpkg/fslib": "workspace:^", "clipanion": "^3.2.0-rc.10", @@ -38,7 +43,18 @@ }, "publishConfig": { "main": "./lib/index.js", - "typings": "./lib/index.d.ts" + "types": "./lib/index.d.ts", + "exports": { + ".": { + "types": "./lib/index.d.ts", + "require": "./lib/index.js" + }, + "./command/*": { + "types": "./lib/commands/*.d.ts", + "require": "./lib/commands/*.js" + }, + "./package.json": "./package.json" + } }, "files": [ "/lib/**/*" diff --git a/packages/plugin-npm-cli/sources/index.ts b/packages/plugin-npm-cli/sources/index.ts index 9256b0537b53..0a2a14e3f1fb 100644 --- a/packages/plugin-npm-cli/sources/index.ts +++ b/packages/plugin-npm-cli/sources/index.ts @@ -9,6 +9,9 @@ import npmTagAdd from './commands/npm/tag/add'; import npmTagList from './commands/npm/tag/list'; import npmTagRemove from './commands/npm/tag/remove'; import npmWhoami from './commands/npm/whoami'; +import * as npmAuditUtils from './npmAuditUtils'; + +export {npmAuditUtils}; declare module '@yarnpkg/core' { interface ConfigurationValueMap { diff --git a/packages/plugin-npm/package.json b/packages/plugin-npm/package.json index a2dd92e550eb..e50163c413b7 100644 --- a/packages/plugin-npm/package.json +++ b/packages/plugin-npm/package.json @@ -3,6 +3,10 @@ "version": "3.0.0-rc.18", "license": "BSD-2-Clause", "main": "./sources/index.ts", + "exports": { + ".": "./sources/index.ts", + "./package.json": "./package.json" + }, "dependencies": { "@yarnpkg/fslib": "workspace:^", "enquirer": "^2.3.6", @@ -31,7 +35,14 @@ }, "publishConfig": { "main": "./lib/index.js", - "typings": "./lib/index.d.ts" + "types": "./lib/index.d.ts", + "exports": { + ".": { + "types": "./lib/index.d.ts", + "require": "./lib/index.js" + }, + "./package.json": "./package.json" + } }, "files": [ "/lib/**/*" diff --git a/packages/plugin-npm/sources/index.ts b/packages/plugin-npm/sources/index.ts index ec0bee623991..64a60d2885a0 100644 --- a/packages/plugin-npm/sources/index.ts +++ b/packages/plugin-npm/sources/index.ts @@ -12,6 +12,11 @@ import * as npmPublishUtils from './npmPublis export {npmConfigUtils}; export {npmHttpUtils}; export {npmPublishUtils}; +export {NpmHttpFetcher}; +export {NpmRemapResolver}; +export {NpmSemverFetcher}; +export {NpmSemverResolver}; +export {NpmTagResolver}; export interface Hooks { /** diff --git a/packages/plugin-pack/package.json b/packages/plugin-pack/package.json index 914da4c00fc0..4771193e16f4 100644 --- a/packages/plugin-pack/package.json +++ b/packages/plugin-pack/package.json @@ -3,6 +3,11 @@ "version": "4.0.0-rc.18", "license": "BSD-2-Clause", "main": "./sources/index.ts", + "exports": { + ".": "./sources/index.ts", + "./command/*": "./sources/commands/*.ts", + "./package.json": "./package.json" + }, "dependencies": { "@yarnpkg/fslib": "workspace:^", "clipanion": "^3.2.0-rc.10", @@ -32,7 +37,18 @@ }, "publishConfig": { "main": "./lib/index.js", - "typings": "./lib/index.d.ts" + "types": "./lib/index.d.ts", + "exports": { + ".": { + "types": "./lib/index.d.ts", + "require": "./lib/index.js" + }, + "./command/*": { + "types": "./lib/commands/*.d.ts", + "require": "./lib/commands/*.js" + }, + "./package.json": "./package.json" + } }, "files": [ "/lib/**/*" diff --git a/packages/plugin-patch/package.json b/packages/plugin-patch/package.json index 85bcf27d8ef2..28de9976a3b7 100644 --- a/packages/plugin-patch/package.json +++ b/packages/plugin-patch/package.json @@ -4,6 +4,11 @@ "stableVersion": "3.2.2", "license": "BSD-2-Clause", "main": "./sources/index.ts", + "exports": { + ".": "./sources/index.ts", + "./command/*": "./sources/commands/*.ts", + "./package.json": "./package.json" + }, "dependencies": { "@yarnpkg/fslib": "workspace:^", "@yarnpkg/libzip": "workspace:^", @@ -29,7 +34,18 @@ }, "publishConfig": { "main": "./lib/index.js", - "typings": "./lib/index.d.ts" + "types": "./lib/index.d.ts", + "exports": { + ".": { + "types": "./lib/index.d.ts", + "require": "./lib/index.js" + }, + "./command/*": { + "types": "./lib/commands/*.d.ts", + "require": "./lib/commands/*.js" + }, + "./package.json": "./package.json" + } }, "files": [ "/lib/**/*" diff --git a/packages/plugin-patch/sources/index.ts b/packages/plugin-patch/sources/index.ts index 816826ba03f8..e60d0cee6919 100644 --- a/packages/plugin-patch/sources/index.ts +++ b/packages/plugin-patch/sources/index.ts @@ -8,6 +8,8 @@ import Patch from './commands/patch'; import * as patchUtils from './patchUtils'; export {patchUtils}; +export {PatchFetcher}; +export {PatchResolver}; export interface Hooks { /** diff --git a/packages/plugin-pnp/package.json b/packages/plugin-pnp/package.json index c95e02dfabbf..bd51786611b7 100644 --- a/packages/plugin-pnp/package.json +++ b/packages/plugin-pnp/package.json @@ -4,6 +4,11 @@ "stableVersion": "3.2.2", "license": "BSD-2-Clause", "main": "./sources/index.ts", + "exports": { + ".": "./sources/index.ts", + "./command/*": "./sources/commands/*.ts", + "./package.json": "./package.json" + }, "dependencies": { "@types/semver": "^7.1.0", "@yarnpkg/fslib": "workspace:^", @@ -34,7 +39,18 @@ }, "publishConfig": { "main": "./lib/index.js", - "typings": "./lib/index.d.ts" + "types": "./lib/index.d.ts", + "exports": { + ".": { + "types": "./lib/index.d.ts", + "require": "./lib/index.js" + }, + "./command/*": { + "types": "./lib/commands/*.d.ts", + "require": "./lib/commands/*.js" + }, + "./package.json": "./package.json" + } }, "files": [ "/lib/**/*" diff --git a/packages/plugin-pnpm/package.json b/packages/plugin-pnpm/package.json index d6f69e6dec04..1498c2122b78 100644 --- a/packages/plugin-pnpm/package.json +++ b/packages/plugin-pnpm/package.json @@ -3,6 +3,10 @@ "version": "2.0.0-rc.18", "license": "BSD-2-Clause", "main": "./sources/index.ts", + "exports": { + ".": "./sources/index.ts", + "./package.json": "./package.json" + }, "dependencies": { "@yarnpkg/fslib": "workspace:^", "@yarnpkg/plugin-pnp": "workspace:^", @@ -30,7 +34,14 @@ }, "publishConfig": { "main": "./lib/index.js", - "typings": "./lib/index.d.ts" + "types": "./lib/index.d.ts", + "exports": { + ".": { + "types": "./lib/index.d.ts", + "require": "./lib/index.js" + }, + "./package.json": "./package.json" + } }, "files": [ "/lib/**/*" diff --git a/packages/plugin-pnpm/sources/index.ts b/packages/plugin-pnpm/sources/index.ts index 332dd5bc9e82..a4a33ab3affd 100644 --- a/packages/plugin-pnpm/sources/index.ts +++ b/packages/plugin-pnpm/sources/index.ts @@ -2,6 +2,8 @@ import {Plugin} from '@yarnpkg/core'; import {PnpmLinker} from './PnpmLinker'; +export {PnpmLinker}; + const plugin: Plugin = { linkers: [ PnpmLinker, diff --git a/packages/plugin-stage/package.json b/packages/plugin-stage/package.json index 20e37ab73872..041e300176e7 100644 --- a/packages/plugin-stage/package.json +++ b/packages/plugin-stage/package.json @@ -3,6 +3,11 @@ "version": "4.0.0-rc.18", "license": "BSD-2-Clause", "main": "./sources/index.ts", + "exports": { + ".": "./sources/index.ts", + "./command/*": "./sources/commands/*.ts", + "./package.json": "./package.json" + }, "dependencies": { "@yarnpkg/fslib": "workspace:^", "clipanion": "^3.2.0-rc.10", @@ -28,7 +33,18 @@ }, "publishConfig": { "main": "./lib/index.js", - "typings": "./lib/index.d.ts" + "types": "./lib/index.d.ts", + "exports": { + ".": { + "types": "./lib/index.d.ts", + "require": "./lib/index.js" + }, + "./command/*": { + "types": "./lib/commands/*.d.ts", + "require": "./lib/commands/*.js" + }, + "./package.json": "./package.json" + } }, "files": [ "/lib/**/*" diff --git a/packages/plugin-stage/sources/index.ts b/packages/plugin-stage/sources/index.ts index b3424d76db96..4088f5b96e67 100644 --- a/packages/plugin-stage/sources/index.ts +++ b/packages/plugin-stage/sources/index.ts @@ -2,6 +2,9 @@ import {Plugin, Project} from '@yarnpkg/core'; import {PortablePath} from '@yarnpkg/fslib'; import stage from './commands/stage'; +import * as stageUtils from './stageUtils'; + +export {stageUtils}; export interface Hooks { populateYarnPaths?: ( diff --git a/packages/plugin-typescript/package.json b/packages/plugin-typescript/package.json index 6a54ee41a618..a3fc63e68ba5 100644 --- a/packages/plugin-typescript/package.json +++ b/packages/plugin-typescript/package.json @@ -3,6 +3,10 @@ "version": "4.0.0-rc.18", "license": "BSD-2-Clause", "main": "./sources/index.ts", + "exports": { + ".": "./sources/index.ts", + "./package.json": "./package.json" + }, "dependencies": { "@yarnpkg/fslib": "workspace:^", "@yarnpkg/plugin-pack": "workspace:^", @@ -34,7 +38,14 @@ }, "publishConfig": { "main": "./lib/index.js", - "typings": "./lib/index.d.ts" + "types": "./lib/index.d.ts", + "exports": { + ".": { + "types": "./lib/index.d.ts", + "require": "./lib/index.js" + }, + "./package.json": "./package.json" + } }, "files": [ "/lib/**/*" diff --git a/packages/plugin-version/package.json b/packages/plugin-version/package.json index d0229a947e02..1fe8039b17e3 100644 --- a/packages/plugin-version/package.json +++ b/packages/plugin-version/package.json @@ -3,6 +3,11 @@ "version": "4.0.0-rc.18", "license": "BSD-2-Clause", "main": "./sources/index.ts", + "exports": { + ".": "./sources/index.ts", + "./command/*": "./sources/commands/*.ts", + "./package.json": "./package.json" + }, "dependencies": { "@yarnpkg/fslib": "workspace:^", "@yarnpkg/libui": "workspace:^", @@ -39,7 +44,18 @@ }, "publishConfig": { "main": "./lib/index.js", - "typings": "./lib/index.d.ts" + "types": "./lib/index.d.ts", + "exports": { + ".": { + "types": "./lib/index.d.ts", + "require": "./lib/index.js" + }, + "./command/*": { + "types": "./lib/commands/*.d.ts", + "require": "./lib/commands/*.js" + }, + "./package.json": "./package.json" + } }, "files": [ "/lib/**/*" diff --git a/packages/plugin-workspace-tools/package.json b/packages/plugin-workspace-tools/package.json index f428519d6ff0..4a9ebba61bfc 100644 --- a/packages/plugin-workspace-tools/package.json +++ b/packages/plugin-workspace-tools/package.json @@ -4,6 +4,11 @@ "stableVersion": "3.1.3", "license": "BSD-2-Clause", "main": "./sources/index.ts", + "exports": { + ".": "./sources/index.ts", + "./command/*": "./sources/commands/*.ts", + "./package.json": "./package.json" + }, "dependencies": { "@yarnpkg/fslib": "workspace:^", "clipanion": "^3.2.0-rc.10", @@ -35,7 +40,18 @@ }, "publishConfig": { "main": "./lib/index.js", - "typings": "./lib/index.d.ts" + "types": "./lib/index.d.ts", + "exports": { + ".": { + "types": "./lib/index.d.ts", + "require": "./lib/index.js" + }, + "./command/*": { + "types": "./lib/commands/*.d.ts", + "require": "./lib/commands/*.js" + }, + "./package.json": "./package.json" + } }, "files": [ "/lib/**/*" diff --git a/packages/yarnpkg-builder/package.json b/packages/yarnpkg-builder/package.json index 2ab81fdf66f2..f3dbc43e32b8 100644 --- a/packages/yarnpkg-builder/package.json +++ b/packages/yarnpkg-builder/package.json @@ -4,6 +4,11 @@ "stableVersion": "3.2.3", "license": "BSD-2-Clause", "bin": "./sources/boot-cli-dev.js", + "exports": { + "./cli": "./sources/boot-cli-dev.js", + "./command/*": "./sources/commands/*.ts", + "./package.json": "./package.json" + }, "dependencies": { "@yarnpkg/cli": "workspace:^", "@yarnpkg/core": "workspace:^", @@ -25,7 +30,18 @@ "release": "yarn npm publish" }, "publishConfig": { - "bin": "./lib/cli.js" + "bin": "./lib/cli.js", + "exports": { + "./command/*": { + "types": "./lib/commands/*.d.ts", + "require": "./lib/commands/*.js" + }, + "./cli": { + "types": "./lib/cli.d.ts", + "require": "./lib/cli.js" + }, + "./package.json": "./package.json" + } }, "files": [ "/lib/**/*" diff --git a/packages/yarnpkg-cli/package.json b/packages/yarnpkg-cli/package.json index bdd4bdb8a0f7..841390504b93 100644 --- a/packages/yarnpkg-cli/package.json +++ b/packages/yarnpkg-cli/package.json @@ -4,6 +4,10 @@ "stableVersion": "3.2.2", "license": "BSD-2-Clause", "main": "./sources/index.ts", + "exports": { + ".": "./sources/index.ts", + "./package.json": "./package.json" + }, "dependencies": { "@yarnpkg/core": "workspace:^", "@yarnpkg/fslib": "workspace:^", @@ -60,7 +64,14 @@ "publishConfig": { "main": "./lib/index.js", "types": "./lib/index.d.ts", - "bin": null + "bin": null, + "exports": { + ".": { + "types": "./lib/index.d.ts", + "require": "./lib/index.js" + }, + "./package.json": "./package.json" + } }, "files": [ "/lib/**/*", diff --git a/packages/yarnpkg-core/package.json b/packages/yarnpkg-core/package.json index e2a712bea703..dd224a236f76 100644 --- a/packages/yarnpkg-core/package.json +++ b/packages/yarnpkg-core/package.json @@ -4,6 +4,10 @@ "stableVersion": "3.2.3", "license": "BSD-2-Clause", "main": "./sources/index.ts", + "exports": { + ".": "./sources/index.ts", + "./package.json": "./package.json" + }, "sideEffects": false, "dependencies": { "@arcanis/slice-ansi": "^1.1.1", @@ -61,7 +65,14 @@ }, "publishConfig": { "main": "./lib/index.js", - "types": "./lib/index.d.ts" + "types": "./lib/index.d.ts", + "exports": { + ".": { + "types": "./lib/index.d.ts", + "require": "./lib/index.js" + }, + "./package.json": "./package.json" + } }, "files": [ "/lib/**/*" diff --git a/packages/yarnpkg-core/sources/index.ts b/packages/yarnpkg-core/sources/index.ts index 5634b455ec77..21c0f74aac96 100644 --- a/packages/yarnpkg-core/sources/index.ts +++ b/packages/yarnpkg-core/sources/index.ts @@ -19,8 +19,10 @@ export type {ConfigurationValueMap, ConfigurationDefinitionMap} export type {Fetcher, FetchOptions, FetchResult, MinimalFetchOptions} from './Fetcher'; export {BuildType} from './Installer'; export type {Installer, BuildDirective, InstallStatus, InstallPackageExtraApi, FinalizeInstallStatus} from './Installer'; +export {LegacyMigrationResolver} from './LegacyMigrationResolver'; export {LightReport} from './LightReport'; export type {Linker, LinkOptions, MinimalLinkOptions} from './Linker'; +export {LockfileResolver} from './LockfileResolver'; export {Manifest} from './Manifest'; export type {AllDependencies, HardDependencies, DependencyMeta, PeerDependencyMeta} from './Manifest'; export {MessageName, parseMessageName, stringifyMessageName} from './MessageName'; diff --git a/packages/yarnpkg-doctor/package.json b/packages/yarnpkg-doctor/package.json index f6e196bfa941..79d746136b84 100644 --- a/packages/yarnpkg-doctor/package.json +++ b/packages/yarnpkg-doctor/package.json @@ -3,6 +3,10 @@ "version": "4.0.0-rc.18", "license": "BSD-2-Clause", "bin": "./sources/boot-cli-dev.js", + "exports": { + "./cli": "./sources/boot-cli-dev.js", + "./package.json": "./package.json" + }, "dependencies": { "@yarnpkg/cli": "workspace:^", "@yarnpkg/core": "workspace:^", @@ -23,7 +27,14 @@ "prepack": "run build:compile \"$(pwd)\"" }, "publishConfig": { - "bin": "./lib/cli.js" + "bin": "./lib/cli.js", + "exports": { + "./cli": { + "types": "./lib/cli.d.ts", + "require": "./lib/cli.js" + }, + "./package.json": "./package.json" + } }, "files": [ "/lib/**/*" diff --git a/packages/yarnpkg-extensions/package.json b/packages/yarnpkg-extensions/package.json index 351a0394fd6c..373e0185982f 100644 --- a/packages/yarnpkg-extensions/package.json +++ b/packages/yarnpkg-extensions/package.json @@ -4,6 +4,10 @@ "stableVersion": "1.1.0", "license": "BSD-2-Clause", "main": "./sources/index.ts", + "exports": { + ".": "./sources/index.ts", + "./package.json": "./package.json" + }, "peerDependencies": { "@yarnpkg/core": "workspace:^" }, @@ -21,7 +25,14 @@ }, "publishConfig": { "main": "./lib/index.js", - "typings": "./lib/index.d.ts" + "types": "./lib/index.d.ts", + "exports": { + ".": { + "types": "./lib/index.d.ts", + "require": "./lib/index.js" + }, + "./package.json": "./package.json" + } }, "files": [ "/lib/**/*" diff --git a/packages/yarnpkg-fslib/package.json b/packages/yarnpkg-fslib/package.json index c1f9e11f0a3c..69e3b68c2233 100644 --- a/packages/yarnpkg-fslib/package.json +++ b/packages/yarnpkg-fslib/package.json @@ -4,6 +4,10 @@ "stableVersion": "2.7.0", "license": "BSD-2-Clause", "main": "./sources/index.ts", + "exports": { + ".": "./sources/index.ts", + "./package.json": "./package.json" + }, "sideEffects": false, "dependencies": { "@yarnpkg/libzip": "workspace:^", @@ -18,7 +22,14 @@ }, "publishConfig": { "main": "./lib/index.js", - "typings": "./lib/index.d.ts" + "types": "./lib/index.d.ts", + "exports": { + ".": { + "types": "./lib/index.d.ts", + "require": "./lib/index.js" + }, + "./package.json": "./package.json" + } }, "files": [ "/lib/**/*" diff --git a/packages/yarnpkg-libzip/package.json b/packages/yarnpkg-libzip/package.json index bf5ad88ad88c..ca696dfd62fc 100644 --- a/packages/yarnpkg-libzip/package.json +++ b/packages/yarnpkg-libzip/package.json @@ -4,6 +4,15 @@ "license": "BSD-2-Clause", "main": "./sources/sync.ts", "browser": "./sources/async.ts", + "exports": { + ".": { + "node": "./sources/sync.ts", + "browser": "./sources/async.ts" + }, + "./sync": "./sources/sync.ts", + "./async": "./sources/async.ts", + "./package.json": "./package.json" + }, "scripts": { "build:libzip:wasm": "cd ./artifacts && ./build.sh", "postpack": "rm -rf lib", @@ -12,7 +21,28 @@ }, "publishConfig": { "main": "./lib/sync.js", - "browser": "./lib/async.js" + "browser": "./lib/async.js", + "exports": { + ".": { + "node": { + "types": "./lib/sync.d.ts", + "require": "./lib/sync.js" + }, + "browser": { + "types": "./lib/async.d.ts", + "require": "./lib/async.js" + } + }, + "./sync": { + "types": "./lib/sync.d.ts", + "require": "./lib/sync.js" + }, + "./async": { + "types": "./lib/async.d.ts", + "require": "./lib/async.js" + }, + "./package.json": "./package.json" + } }, "files": [ "/lib/**/*" diff --git a/packages/yarnpkg-nm/package.json b/packages/yarnpkg-nm/package.json index aa969a1382d3..72f187e82db9 100644 --- a/packages/yarnpkg-nm/package.json +++ b/packages/yarnpkg-nm/package.json @@ -4,6 +4,10 @@ "license": "BSD-2-Clause", "main": "./sources/index.ts", "types": "./sources/index.ts", + "exports": { + ".": "./sources/index.ts", + "./package.json": "./package.json" + }, "sideEffects": false, "dependencies": { "@yarnpkg/core": "workspace:^", @@ -20,7 +24,14 @@ }, "publishConfig": { "main": "./lib/index.js", - "types": "./lib/index.d.ts" + "types": "./lib/index.d.ts", + "exports": { + ".": { + "types": "./lib/index.d.ts", + "require": "./lib/index.js" + }, + "./package.json": "./package.json" + } }, "files": [ "/lib/**/*" diff --git a/packages/yarnpkg-parsers/package.json b/packages/yarnpkg-parsers/package.json index 6993ce205ec8..85fa1df9b274 100644 --- a/packages/yarnpkg-parsers/package.json +++ b/packages/yarnpkg-parsers/package.json @@ -3,6 +3,10 @@ "version": "3.0.0-rc.18", "license": "BSD-2-Clause", "main": "./sources/index.ts", + "exports": { + ".": "./sources/index.ts", + "./package.json": "./package.json" + }, "dependencies": { "js-yaml": "^3.10.0", "tslib": "^2.4.0" @@ -23,7 +27,14 @@ }, "publishConfig": { "main": "./lib/index.js", - "typings": "./lib/index.d.ts" + "types": "./lib/index.d.ts", + "exports": { + ".": { + "types": "./lib/index.d.ts", + "require": "./lib/index.js" + }, + "./package.json": "./package.json" + } }, "files": [ "/lib/**/*" diff --git a/packages/yarnpkg-pnp/package.json b/packages/yarnpkg-pnp/package.json index 9ff1e134e994..108b54dc3133 100644 --- a/packages/yarnpkg-pnp/package.json +++ b/packages/yarnpkg-pnp/package.json @@ -4,6 +4,10 @@ "stableVersion": "3.2.2", "license": "BSD-2-Clause", "main": "./sources/index.ts", + "exports": { + ".": "./sources/index.ts", + "./package.json": "./package.json" + }, "dependencies": { "@types/node": "^18.7.6", "@yarnpkg/fslib": "workspace:^" @@ -29,7 +33,14 @@ }, "publishConfig": { "main": "./lib/index.js", - "types": "./lib/index.d.ts" + "types": "./lib/index.d.ts", + "exports": { + ".": { + "types": "./lib/index.d.ts", + "require": "./lib/index.js" + }, + "./package.json": "./package.json" + } }, "files": [ "/lib/**/*" diff --git a/packages/yarnpkg-pnpify/package.json b/packages/yarnpkg-pnpify/package.json index 3faf7b15367e..916149e3eab4 100644 --- a/packages/yarnpkg-pnpify/package.json +++ b/packages/yarnpkg-pnpify/package.json @@ -6,6 +6,13 @@ "main": "./sources/index.ts", "bin": "./sources/boot-cli-dev.js", "types": "./sources/index.ts", + "exports": { + ".": "./sources/index.ts", + "./utils": "./sources/utils.ts", + "./command/*": "./sources/commands/*.ts", + "./cli": "./sources/cli.ts", + "./package.json": "./package.json" + }, "sideEffects": false, "dependencies": { "@yarnpkg/core": "workspace:^", @@ -27,7 +34,26 @@ "publishConfig": { "main": "./lib/index.js", "bin": "./lib/cli.js", - "types": "./lib/index.d.ts" + "types": "./lib/index.d.ts", + "exports": { + ".": { + "types": "./lib/index.d.ts", + "require": "./lib/index.js" + }, + "./utils": { + "types": "./lib/utils.d.ts", + "require": "./lib/utils.js" + }, + "./command/*": { + "types": "./lib/commands/*.d.ts", + "require": "./lib/commands/*.js" + }, + "./cli": { + "types": "./lib/cli.d.ts", + "require": "./lib/cli.js" + }, + "./package.json": "./package.json" + } }, "files": [ "/lib/**/*", diff --git a/packages/yarnpkg-pnpify/sources/NodeModulesFS.ts b/packages/yarnpkg-pnpify/sources/NodeModulesFS.ts index f1f7e24ff8eb..9b15ce341296 100644 --- a/packages/yarnpkg-pnpify/sources/NodeModulesFS.ts +++ b/packages/yarnpkg-pnpify/sources/NodeModulesFS.ts @@ -36,7 +36,7 @@ export class NodeModulesFS extends ProxiedFS { } } -interface PortableNodeModulesFSOptions extends NodeModulesTreeOptions { +export interface PortableNodeModulesFSOptions extends NodeModulesTreeOptions { baseFs?: FakeFS; pnpifyFs?: boolean; } diff --git a/packages/yarnpkg-pnpify/sources/utils.ts b/packages/yarnpkg-pnpify/sources/utils.ts new file mode 100644 index 000000000000..11c3a713757b --- /dev/null +++ b/packages/yarnpkg-pnpify/sources/utils.ts @@ -0,0 +1,5 @@ +export {patchFs} from './index'; +export type {ResolvedPath} from './resolveNodeModulesPath'; +export {resolveNodeModulesPath} from './resolveNodeModulesPath'; +export type {NodeModulesFSOptions, PortableNodeModulesFSOptions} from './NodeModulesFS'; +export {NodeModulesFS, PortableNodeModulesFS} from './NodeModulesFS'; diff --git a/packages/yarnpkg-sdks/package.json b/packages/yarnpkg-sdks/package.json index 2d99bce7ef19..7081d88eccbb 100644 --- a/packages/yarnpkg-sdks/package.json +++ b/packages/yarnpkg-sdks/package.json @@ -5,6 +5,12 @@ "main": "./sources/index.ts", "bin": "./sources/boot-cli-dev.js", "types": "./sources/index.ts", + "exports": { + ".": "./sources/index.ts", + "./command/*": "./sources/commands/*.ts", + "./cli": "./sources/boot-cli-dev.js", + "./package.json": "./package.json" + }, "sideEffects": false, "dependencies": { "@yarnpkg/core": "workspace:^", @@ -30,7 +36,22 @@ "publishConfig": { "main": "./lib/index.js", "bin": "./lib/cli.js", - "types": "./lib/index.d.ts" + "types": "./lib/index.d.ts", + "exports": { + ".": { + "types": "./lib/index.d.ts", + "require": "./lib/index.js" + }, + "./command/*": { + "types": "./lib/commands/*.d.ts", + "require": "./lib/commands/*.js" + }, + "./cli": { + "types": "./lib/cli.d.ts", + "require": "./lib/cli.js" + }, + "./package.json": "./package.json" + } }, "files": [ "/lib/**/*" diff --git a/packages/yarnpkg-shell/package.json b/packages/yarnpkg-shell/package.json index 0d15f6b458c9..685ffefba0b6 100644 --- a/packages/yarnpkg-shell/package.json +++ b/packages/yarnpkg-shell/package.json @@ -5,6 +5,11 @@ "license": "BSD-2-Clause", "main": "./sources/index.ts", "bin": "./sources/boot-cli-dev.js", + "exports": { + ".": "./sources/index.ts", + "./cli": "./sources/boot-cli-dev.js", + "./package.json": "./package.json" + }, "dependencies": { "@yarnpkg/fslib": "workspace:^", "@yarnpkg/parsers": "workspace:^", @@ -30,7 +35,18 @@ "publishConfig": { "main": "./lib/index.js", "bin": "./lib/cli.js", - "typings": "./lib/index.d.ts" + "types": "./lib/index.d.ts", + "exports": { + ".": { + "types": "./lib/index.d.ts", + "require": "./lib/index.js" + }, + "./cli": { + "types": "./lib/cli.d.ts", + "require": "./lib/cli.js" + }, + "./package.json": "./package.json" + } }, "files": [ "/lib/**/*" From c51cc09ed1475d540f193aa107934b7c396f1c8e Mon Sep 17 00:00:00 2001 From: larry1123 Date: Thu, 8 Sep 2022 06:10:08 -0400 Subject: [PATCH 02/11] fix test polyfills from failing to resolve --- jest.config.js | 2 +- packages/yarnpkg-cli/package.json | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/jest.config.js b/jest.config.js index 1740eccb33d5..100247ad7bf7 100644 --- a/jest.config.js +++ b/jest.config.js @@ -6,6 +6,6 @@ module.exports = { `/packages/gatsby/.cache`, `/packages/plugin-compat`, ], - setupFiles: [require.resolve(`@yarnpkg/cli/sources/polyfills.ts`)], + setupFiles: [require.resolve(`@yarnpkg/cli/polyfills`)], testTimeout: 50000, }; diff --git a/packages/yarnpkg-cli/package.json b/packages/yarnpkg-cli/package.json index 841390504b93..dbf9eca729f6 100644 --- a/packages/yarnpkg-cli/package.json +++ b/packages/yarnpkg-cli/package.json @@ -6,6 +6,7 @@ "main": "./sources/index.ts", "exports": { ".": "./sources/index.ts", + "./polyfills": "./sources/polyfills.ts", "./package.json": "./package.json" }, "dependencies": { From a4bbd11e4a6052ccba4b134d827f1399f8528647 Mon Sep 17 00:00:00 2001 From: larry1123 Date: Thu, 8 Sep 2022 06:58:21 -0400 Subject: [PATCH 03/11] fix two test files that were not importing right. --- packages/plugin-npm-cli/tests/npmAuditUtils.test.js | 4 +++- packages/plugin-npm/tests/npmHttpUtils.test.js | 4 ++-- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/packages/plugin-npm-cli/tests/npmAuditUtils.test.js b/packages/plugin-npm-cli/tests/npmAuditUtils.test.js index c58b35818c57..4cbe65778a01 100644 --- a/packages/plugin-npm-cli/tests/npmAuditUtils.test.js +++ b/packages/plugin-npm-cli/tests/npmAuditUtils.test.js @@ -1,4 +1,6 @@ -import {allSeverities, isError, getReportTree, getRequires, getDependencies} from '@yarnpkg/plugin-npm-cli/sources/npmAuditUtils'; +import {npmAuditUtils} from '@yarnpkg/plugin-npm-cli'; + +const {allSeverities, isError, getReportTree, getRequires, getDependencies} = npmAuditUtils; describe(`npmAuditUtils`, () => { // Severity levels diff --git a/packages/plugin-npm/tests/npmHttpUtils.test.js b/packages/plugin-npm/tests/npmHttpUtils.test.js index 77cf08a840ba..1e6137228de2 100644 --- a/packages/plugin-npm/tests/npmHttpUtils.test.js +++ b/packages/plugin-npm/tests/npmHttpUtils.test.js @@ -1,5 +1,5 @@ import {httpUtils} from '@yarnpkg/core'; -import {get} from '@yarnpkg/plugin-npm/sources/npmHttpUtils'; +import {npmHttpUtils} from '@yarnpkg/plugin-npm'; import {makeConfiguration} from './_makeConfiguration'; @@ -19,7 +19,7 @@ describe(`npmHttpUtils.get`, () => { it(`should craft the final path correctly (${registry} + ${path} = ${expected})`, async () => { const configuration = await makeConfiguration(); - await get(path, { + await npmHttpUtils.get(path, { configuration, registry, }); From 21c6fc0b0f752d22b502a947df6c6726d6602e28 Mon Sep 17 00:00:00 2001 From: larry1123 Date: Thu, 8 Sep 2022 10:26:38 -0400 Subject: [PATCH 04/11] temp workaround to rollup not supporting the exports right --- packages/yarnpkg-libzip/package.json | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/packages/yarnpkg-libzip/package.json b/packages/yarnpkg-libzip/package.json index ca696dfd62fc..5f9f7251b927 100644 --- a/packages/yarnpkg-libzip/package.json +++ b/packages/yarnpkg-libzip/package.json @@ -7,7 +7,8 @@ "exports": { ".": { "node": "./sources/sync.ts", - "browser": "./sources/async.ts" + "browser": "./sources/async.ts", + "default": "./sources/sync.ts" }, "./sync": "./sources/sync.ts", "./async": "./sources/async.ts", From c4c6a57b7e975d4e6fb4545a799a64f8c0557248 Mon Sep 17 00:00:00 2001 From: larry1123 Date: Thu, 8 Sep 2022 10:57:08 -0400 Subject: [PATCH 05/11] fix gatsby build --- .../gatsby/gatsby-plugin-yarn-introspection/gatsby-node.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/packages/gatsby/gatsby-plugin-yarn-introspection/gatsby-node.js b/packages/gatsby/gatsby-plugin-yarn-introspection/gatsby-node.js index b6661975b4f6..3cd43a7a2a8b 100644 --- a/packages/gatsby/gatsby-plugin-yarn-introspection/gatsby-node.js +++ b/packages/gatsby/gatsby-plugin-yarn-introspection/gatsby-node.js @@ -19,8 +19,9 @@ exports.sourceNodes = async ({actions, createNodeId, createContentDigest}, opts) } }); + const monorepoRoot = require.resolve(`@yarnpkg/monorepo/package.json`).replace(`/package.json`, ``); const data = await execute([ - require.resolve(`@yarnpkg/monorepo/packages/yarnpkg-core/sources/Plugin.ts`), + require.resolve(`${monorepoRoot}/packages/yarnpkg-core/sources/Plugin.ts`), ...indexList, ]); From 0bcd5879aeb5198cb42772efdf88408c7154ea8b Mon Sep 17 00:00:00 2001 From: larry1123 Date: Thu, 8 Sep 2022 11:10:08 -0400 Subject: [PATCH 06/11] workaround for `pnp-esm.test.ts` failing to import --- packages/yarnpkg-pnp/package.json | 1 + 1 file changed, 1 insertion(+) diff --git a/packages/yarnpkg-pnp/package.json b/packages/yarnpkg-pnp/package.json index 108b54dc3133..f04f9882571e 100644 --- a/packages/yarnpkg-pnp/package.json +++ b/packages/yarnpkg-pnp/package.json @@ -6,6 +6,7 @@ "main": "./sources/index.ts", "exports": { ".": "./sources/index.ts", + "./sources/esm-loader/loaderFlags": "./sources/esm-loader/loaderFlags.ts", "./package.json": "./package.json" }, "dependencies": { From 576c09a2dac84603b5c89e0b7ed61c79c537aace Mon Sep 17 00:00:00 2001 From: larry1123 Date: Thu, 8 Sep 2022 11:28:01 -0400 Subject: [PATCH 07/11] fix imports in `prunedNativeDeps.test.ts` --- .../sources/features/prunedNativeDeps.test.ts | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/packages/acceptance-tests/pkg-tests-specs/sources/features/prunedNativeDeps.test.ts b/packages/acceptance-tests/pkg-tests-specs/sources/features/prunedNativeDeps.test.ts index 58b1fa7838c3..a364ea492c8e 100644 --- a/packages/acceptance-tests/pkg-tests-specs/sources/features/prunedNativeDeps.test.ts +++ b/packages/acceptance-tests/pkg-tests-specs/sources/features/prunedNativeDeps.test.ts @@ -1,5 +1,7 @@ -import {Filename, PortablePath, ppath, xfs} from '@yarnpkg/fslib'; -import {RequestType, startRegistryRecording} from 'pkg-tests-core/sources/utils/tests'; +import {Filename, PortablePath, ppath, xfs} from '@yarnpkg/fslib'; +import {tests} from 'pkg-tests-core'; + +const {RequestType, startRegistryRecording} = tests; export {}; From 856428a7bbd832e7c33d7fc1352076b861900ac7 Mon Sep 17 00:00:00 2001 From: larry1123 Date: Thu, 8 Sep 2022 11:53:40 -0400 Subject: [PATCH 08/11] fix `test-typescript-patch.js` make the `gatsby-node.js` fix more simple. --- .../gatsby-node.js | 3 +-- scripts/test-typescript-patch.js | 15 +++++++++------ 2 files changed, 10 insertions(+), 8 deletions(-) diff --git a/packages/gatsby/gatsby-plugin-yarn-introspection/gatsby-node.js b/packages/gatsby/gatsby-plugin-yarn-introspection/gatsby-node.js index 3cd43a7a2a8b..ee694d36b50b 100644 --- a/packages/gatsby/gatsby-plugin-yarn-introspection/gatsby-node.js +++ b/packages/gatsby/gatsby-plugin-yarn-introspection/gatsby-node.js @@ -19,9 +19,8 @@ exports.sourceNodes = async ({actions, createNodeId, createContentDigest}, opts) } }); - const monorepoRoot = require.resolve(`@yarnpkg/monorepo/package.json`).replace(`/package.json`, ``); const data = await execute([ - require.resolve(`${monorepoRoot}/packages/yarnpkg-core/sources/Plugin.ts`), + require.resolve(path.resolve(packageDirectory, `yarnpkg-core/sources/Plugin.ts`)), ...indexList, ]); diff --git a/scripts/test-typescript-patch.js b/scripts/test-typescript-patch.js index 0cd49f43617f..0277099c7bde 100644 --- a/scripts/test-typescript-patch.js +++ b/scripts/test-typescript-patch.js @@ -16,14 +16,17 @@ const compilerOptions = ts.parseJsonSourceFileConfigFileContent( const compilerHost = ts.createCompilerHost(compilerOptions); const program = ts.createProgram(compilerOptions.fileNames, compilerOptions, compilerHost); const moduleSpecifierResolutionHost = ts.createModuleSpecifierResolutionHost(program, compilerHost); -const rootSourceFile = program.getSourceFile(require.resolve(`@yarnpkg/core/sources/Project.ts`)); + +const yarnCorePkgDir = require.resolve(`@yarnpkg/core/package.json`).replace(`/package.json`, ``); +const fslibPkgDir = require.resolve(`@yarnpkg/fslib/package.json`).replace(`/package.json`, ``); +const rootSourceFile = program.getSourceFile(require.resolve(`${yarnCorePkgDir}/sources/Project.ts`)); const TESTS = [ - [`@yarnpkg/core/sources/Configuration.ts`, `./Configuration`], - [`@yarnpkg/fslib/README.md`, `@yarnpkg/fslib/README.md`], - [`@yarnpkg/fslib/package.json`, `@yarnpkg/fslib/package.json`], - [`@yarnpkg/fslib/sources/ZipFS.ts`, `@yarnpkg/fslib/sources/ZipFS`], - [`@yarnpkg/fslib/sources/index.ts`, `@yarnpkg/fslib`], + [`${yarnCorePkgDir}/sources/Configuration.ts`, `./Configuration`], + [`${fslibPkgDir}/README.md`, `@yarnpkg/fslib/README.md`], + [`${fslibPkgDir}/package.json`, `@yarnpkg/fslib/package.json`], + [`${fslibPkgDir}/sources/ZipFS.ts`, `@yarnpkg/fslib/sources/ZipFS`], + [`${fslibPkgDir}/sources/index.ts`, `@yarnpkg/fslib`], ]; for (const [test, expected] of TESTS) { From b2c2ad167ec125f051d927cd6b7156bcdbf6448b Mon Sep 17 00:00:00 2001 From: larry1123 Date: Thu, 8 Sep 2022 14:54:55 -0400 Subject: [PATCH 09/11] removed `./command/*` from exports removed `./sync` and `./async` from `@yarnpkg/libzip` Normalized some Command Class names. --- packages/plugin-constraints/package.json | 5 - packages/plugin-constraints/sources/index.ts | 20 +- packages/plugin-dlx/package.json | 5 - packages/plugin-dlx/sources/index.ts | 13 +- packages/plugin-essentials/package.json | 5 - .../sources/commands/plugin/import.ts | 2 +- .../sources/commands/plugin/import/sources.ts | 2 +- .../sources/commands/plugin/list.ts | 2 +- .../sources/commands/plugin/runtime.ts | 2 +- .../sources/commands/rebuild.ts | 2 +- .../sources/commands/runIndex.ts | 2 +- packages/plugin-essentials/sources/index.ts | 186 +++++++++++------- packages/plugin-init/package.json | 5 - packages/plugin-init/sources/index.ts | 6 +- .../plugin-interactive-tools/package.json | 5 - .../plugin-interactive-tools/sources/index.ts | 13 +- packages/plugin-npm-cli/package.json | 5 - .../sources/commands/npm/audit.ts | 2 +- .../sources/commands/npm/info.ts | 2 +- packages/plugin-npm-cli/sources/index.ts | 45 +++-- packages/plugin-pack/package.json | 5 - packages/plugin-pack/sources/index.ts | 5 +- packages/plugin-patch/package.json | 5 - packages/plugin-patch/sources/index.ts | 12 +- packages/plugin-pnp/package.json | 5 - packages/plugin-pnp/sources/index.ts | 5 +- packages/plugin-stage/package.json | 5 - packages/plugin-stage/sources/index.ts | 5 +- packages/plugin-version/package.json | 5 - packages/plugin-version/sources/index.ts | 15 +- packages/plugin-workspace-tools/package.json | 5 - .../sources/commands/focus.ts | 2 +- .../plugin-workspace-tools/sources/index.ts | 13 +- packages/yarnpkg-builder/package.json | 8 +- packages/yarnpkg-builder/sources/index.ts | 7 + packages/yarnpkg-libzip/package.json | 19 +- packages/yarnpkg-pnpify/package.json | 5 - packages/yarnpkg-pnpify/sources/utils.ts | 6 + packages/yarnpkg-sdks/package.json | 5 - packages/yarnpkg-sdks/sources/index.ts | 2 + 40 files changed, 234 insertions(+), 234 deletions(-) create mode 100644 packages/yarnpkg-builder/sources/index.ts diff --git a/packages/plugin-constraints/package.json b/packages/plugin-constraints/package.json index 081fb7f9299f..305980098e60 100644 --- a/packages/plugin-constraints/package.json +++ b/packages/plugin-constraints/package.json @@ -11,7 +11,6 @@ "main": "./sources/index.ts", "exports": { ".": "./sources/index.ts", - "./command/*": "./sources/commands/*.ts", "./package.json": "./package.json" }, "dependencies": { @@ -43,10 +42,6 @@ "types": "./lib/index.d.ts", "require": "./lib/index.js" }, - "./command/*": { - "types": "./lib/commands/*.d.ts", - "require": "./lib/commands/*.js" - }, "./package.json": "./package.json" } }, diff --git a/packages/plugin-constraints/sources/index.ts b/packages/plugin-constraints/sources/index.ts index 1b6aacc7b7ca..1a6fc318c0df 100644 --- a/packages/plugin-constraints/sources/index.ts +++ b/packages/plugin-constraints/sources/index.ts @@ -1,9 +1,13 @@ -import {Plugin, SettingsType} from '@yarnpkg/core'; -import {PortablePath} from '@yarnpkg/fslib'; +import {Plugin, SettingsType} from '@yarnpkg/core'; +import {PortablePath} from '@yarnpkg/fslib'; -import queryConstraints from './commands/constraints/query'; -import sourceConstraints from './commands/constraints/source'; -import constraints from './commands/constraints'; +import ConstraintsQueryCommand from './commands/constraints/query'; +import ConstraintsSourceCommand from './commands/constraints/source'; +import ConstraintsCheckCommand from './commands/constraints'; + +export {ConstraintsQueryCommand}; +export {ConstraintsSourceCommand}; +export {ConstraintsCheckCommand}; declare module '@yarnpkg/core' { interface ConfigurationValueMap { @@ -20,9 +24,9 @@ const plugin: Plugin = { }, }, commands: [ - queryConstraints, - sourceConstraints, - constraints, + ConstraintsQueryCommand, + ConstraintsSourceCommand, + ConstraintsCheckCommand, ], }; diff --git a/packages/plugin-dlx/package.json b/packages/plugin-dlx/package.json index 1aa4368ff1ae..bd9c66bdb883 100644 --- a/packages/plugin-dlx/package.json +++ b/packages/plugin-dlx/package.json @@ -6,7 +6,6 @@ "main": "./sources/index.ts", "exports": { ".": "./sources/index.ts", - "./command/*": "./sources/commands/*.ts", "./package.json": "./package.json" }, "dependencies": { @@ -39,10 +38,6 @@ "types": "./lib/index.d.ts", "require": "./lib/index.js" }, - "./command/*": { - "types": "./lib/commands/*.d.ts", - "require": "./lib/commands/*.js" - }, "./package.json": "./package.json" } }, diff --git a/packages/plugin-dlx/sources/index.ts b/packages/plugin-dlx/sources/index.ts index e33e447a410f..ee250b91adf6 100644 --- a/packages/plugin-dlx/sources/index.ts +++ b/packages/plugin-dlx/sources/index.ts @@ -1,12 +1,15 @@ -import {Plugin} from '@yarnpkg/core'; +import {Plugin} from '@yarnpkg/core'; -import create from './commands/create'; -import dlx from './commands/dlx'; +import CreateCommand from './commands/create'; +import DlxCommand from './commands/dlx'; + +export {CreateCommand}; +export {DlxCommand}; const plugin: Plugin = { commands: [ - create, - dlx, + CreateCommand, + DlxCommand, ], }; diff --git a/packages/plugin-essentials/package.json b/packages/plugin-essentials/package.json index 3b4f9b70ea60..5d48c6ed985c 100644 --- a/packages/plugin-essentials/package.json +++ b/packages/plugin-essentials/package.json @@ -5,7 +5,6 @@ "main": "./sources/index.ts", "exports": { ".": "./sources/index.ts", - "./command/*": "./sources/commands/*.ts", "./package.json": "./package.json" }, "dependencies": { @@ -50,10 +49,6 @@ "types": "./lib/index.d.ts", "require": "./lib/index.js" }, - "./command/*": { - "types": "./lib/commands/*.d.ts", - "require": "./lib/commands/*.js" - }, "./package.json": "./package.json" } }, diff --git a/packages/plugin-essentials/sources/commands/plugin/import.ts b/packages/plugin-essentials/sources/commands/plugin/import.ts index 7ef3f475c6f3..6220cc7f3985 100644 --- a/packages/plugin-essentials/sources/commands/plugin/import.ts +++ b/packages/plugin-essentials/sources/commands/plugin/import.ts @@ -10,7 +10,7 @@ import {runInNewContext} import {getAvailablePlugins} from './list'; // eslint-disable-next-line arca/no-default-export -export default class PluginDlCommand extends BaseCommand { +export default class PluginImportCommand extends BaseCommand { static paths = [ [`plugin`, `import`], ]; diff --git a/packages/plugin-essentials/sources/commands/plugin/import/sources.ts b/packages/plugin-essentials/sources/commands/plugin/import/sources.ts index d19aa7b06cfc..2cb55a8b0268 100644 --- a/packages/plugin-essentials/sources/commands/plugin/import/sources.ts +++ b/packages/plugin-essentials/sources/commands/plugin/import/sources.ts @@ -14,7 +14,7 @@ const buildWorkflow = ({pluginName, noMinify}: {noMinify: boolean, pluginName: s ]; // eslint-disable-next-line arca/no-default-export -export default class PluginDlSourcesCommand extends BaseCommand { +export default class PluginImportSourcesCommand extends BaseCommand { static paths = [ [`plugin`, `import`, `from`, `sources`], ]; diff --git a/packages/plugin-essentials/sources/commands/plugin/list.ts b/packages/plugin-essentials/sources/commands/plugin/list.ts index ecb3d73d908a..83a0c3559006 100644 --- a/packages/plugin-essentials/sources/commands/plugin/list.ts +++ b/packages/plugin-essentials/sources/commands/plugin/list.ts @@ -15,7 +15,7 @@ export async function getAvailablePlugins(configuration: Configuration, version: } // eslint-disable-next-line arca/no-default-export -export default class PluginDlCommand extends BaseCommand { +export default class PluginListCommand extends BaseCommand { static paths = [ [`plugin`, `list`], ]; diff --git a/packages/plugin-essentials/sources/commands/plugin/runtime.ts b/packages/plugin-essentials/sources/commands/plugin/runtime.ts index fd94ad41688c..5fc56308dc48 100644 --- a/packages/plugin-essentials/sources/commands/plugin/runtime.ts +++ b/packages/plugin-essentials/sources/commands/plugin/runtime.ts @@ -3,7 +3,7 @@ import {Configuration, StreamReport} from '@yarnpkg/core'; import {Command, Option, Usage} from 'clipanion'; // eslint-disable-next-line arca/no-default-export -export default class PluginListCommand extends BaseCommand { +export default class PluginRuntimeCommand extends BaseCommand { static paths = [ [`plugin`, `runtime`], ]; diff --git a/packages/plugin-essentials/sources/commands/rebuild.ts b/packages/plugin-essentials/sources/commands/rebuild.ts index 3c90705961ae..a8c130c3936e 100644 --- a/packages/plugin-essentials/sources/commands/rebuild.ts +++ b/packages/plugin-essentials/sources/commands/rebuild.ts @@ -4,7 +4,7 @@ import {ThrowReport, structUtils, Project} from '@yarnpkg/core'; import {Command, Option, Usage} from 'clipanion'; // eslint-disable-next-line arca/no-default-export -export default class RunCommand extends BaseCommand { +export default class RebuildCommand extends BaseCommand { static paths = [ [`rebuild`], ]; diff --git a/packages/plugin-essentials/sources/commands/runIndex.ts b/packages/plugin-essentials/sources/commands/runIndex.ts index 2432af0897de..3d09493e3638 100644 --- a/packages/plugin-essentials/sources/commands/runIndex.ts +++ b/packages/plugin-essentials/sources/commands/runIndex.ts @@ -4,7 +4,7 @@ import {miscUtils} from '@yarnpkg/core'; import {inspect} from 'util'; // eslint-disable-next-line arca/no-default-export -export default class RunCommand extends BaseCommand { +export default class RunIndexCommand extends BaseCommand { static paths = [ [`run`], ]; diff --git a/packages/plugin-essentials/sources/index.ts b/packages/plugin-essentials/sources/index.ts index 8142e5c54a72..3214bb817664 100644 --- a/packages/plugin-essentials/sources/index.ts +++ b/packages/plugin-essentials/sources/index.ts @@ -2,49 +2,83 @@ import {Descriptor, Plugin, SettingsType, Package, formatUtils} from '@yarnpkg/c import {Workspace} from '@yarnpkg/core'; import {isCI} from 'ci-info'; -import add from './commands/add'; -import bin from './commands/bin'; -import cleanCache from './commands/cache/clean'; -import getConfig from './commands/config/get'; -import setConfig from './commands/config/set'; -import unsetConfig from './commands/config/unset'; -import config from './commands/config'; -import dedupe from './commands/dedupe'; -import clipanionEntry from './commands/entries/clipanion'; -import helpEntry from './commands/entries/help'; -import runEntry from './commands/entries/run'; -import versionEntry from './commands/entries/version'; -import exec from './commands/exec'; -import explainPeerRequirements from './commands/explain/peerRequirements'; -import explain from './commands/explain'; -import info from './commands/info'; -import install from './commands/install'; -import link from './commands/link'; -import node from './commands/node'; -import pluginImportSources from './commands/plugin/import/sources'; -import pluginImport from './commands/plugin/import'; -import pluginList from './commands/plugin/list'; -import pluginRemove from './commands/plugin/remove'; -import pluginRuntime from './commands/plugin/runtime'; -import rebuild from './commands/rebuild'; -import remove from './commands/remove'; -import runIndex from './commands/runIndex'; -import run from './commands/run'; -import setResolutionPolicy from './commands/set/resolution'; -import setVersionFromSources from './commands/set/version/sources'; -import setVersionPolicy from './commands/set/version'; -import unlink from './commands/unlink'; -import up from './commands/up'; -import why from './commands/why'; -import listWorkspaces from './commands/workspaces/list'; -import workspace from './commands/workspace'; +import AddCommand from './commands/add'; +import BinCommand from './commands/bin'; +import CacheCleanCommand from './commands/cache/clean'; +import ConfigGetCommand from './commands/config/get'; +import ConfigSetCommand from './commands/config/set'; +import ConfigUnsetCommand from './commands/config/unset'; +import ConfigCommand from './commands/config'; +import DedupeCommand from './commands/dedupe'; +import ClipanionCommand from './commands/entries/clipanion'; +import HelpCommand from './commands/entries/help'; +import EntryCommand from './commands/entries/run'; +import VersionCommand from './commands/entries/version'; +import ExecCommand from './commands/exec'; +import ExplainPeerRequirementsCommand from './commands/explain/peerRequirements'; +import ExplainCommand from './commands/explain'; +import InfoCommand from './commands/info'; +import YarnCommand from './commands/install'; +import LinkCommand from './commands/link'; +import NodeCommand from './commands/node'; +import PluginImportSourcesCommand from './commands/plugin/import/sources'; +import PluginImportCommand from './commands/plugin/import'; +import PluginListCommand from './commands/plugin/list'; +import PluginRemoveCommand from './commands/plugin/remove'; +import PluginRuntimeCommand from './commands/plugin/runtime'; +import RebuildCommand from './commands/rebuild'; +import RemoveCommand from './commands/remove'; +import RunIndexCommand from './commands/runIndex'; +import RunCommand from './commands/run'; +import SetResolutionCommand from './commands/set/resolution'; +import SetVersionSourcesCommand from './commands/set/version/sources'; +import SetVersionCommand from './commands/set/version'; +import UnlinkCommand from './commands/unlink'; +import UpCommand from './commands/up'; +import WhyCommand from './commands/why'; +import WorkspacesListCommand from './commands/workspaces/list'; +import WorkspaceCommand from './commands/workspace'; import * as dedupeUtils from './dedupeUtils'; import * as suggestUtils from './suggestUtils'; -export { - dedupeUtils, - suggestUtils, -}; +export {AddCommand}; +export {BinCommand}; +export {CacheCleanCommand}; +export {ConfigGetCommand}; +export {ConfigSetCommand}; +export {ConfigUnsetCommand}; +export {ConfigCommand}; +export {DedupeCommand}; +export {ClipanionCommand}; +export {HelpCommand}; +export {EntryCommand}; +export {VersionCommand}; +export {ExecCommand}; +export {ExplainPeerRequirementsCommand}; +export {ExplainCommand}; +export {InfoCommand}; +export {YarnCommand}; +export {LinkCommand}; +export {NodeCommand}; +export {PluginImportSourcesCommand}; +export {PluginImportCommand}; +export {PluginListCommand}; +export {PluginRemoveCommand}; +export {PluginRuntimeCommand}; +export {RebuildCommand}; +export {RemoveCommand}; +export {RunIndexCommand}; +export {RunCommand}; +export {SetResolutionCommand}; +export {SetVersionSourcesCommand}; +export {SetVersionCommand}; +export {UnlinkCommand}; +export {UpCommand}; +export {WhyCommand}; +export {WorkspacesListCommand}; +export {WorkspaceCommand}; +export {dedupeUtils}; +export {suggestUtils}; export interface Hooks { /** @@ -134,42 +168,42 @@ const plugin: Plugin = { }, }, commands: [ - cleanCache, - getConfig, - setConfig, - unsetConfig, - setResolutionPolicy, - setVersionFromSources, - setVersionPolicy, - listWorkspaces, - clipanionEntry, - helpEntry, - runEntry, - versionEntry, - add, - bin, - config, - dedupe, - exec, - explainPeerRequirements, - explain, - info, - install, - link, - unlink, - node, - pluginImportSources, - pluginImport, - pluginRemove, - pluginList, - pluginRuntime, - rebuild, - remove, - runIndex, - run, - up, - why, - workspace, + CacheCleanCommand, + ConfigGetCommand, + ConfigSetCommand, + ConfigUnsetCommand, + SetResolutionCommand, + SetVersionSourcesCommand, + SetVersionCommand, + WorkspacesListCommand, + ClipanionCommand, + HelpCommand, + EntryCommand, + VersionCommand, + AddCommand, + BinCommand, + ConfigCommand, + DedupeCommand, + ExecCommand, + ExplainPeerRequirementsCommand, + ExplainCommand, + InfoCommand, + YarnCommand, + LinkCommand, + UnlinkCommand, + NodeCommand, + PluginImportSourcesCommand, + PluginImportCommand, + PluginRemoveCommand, + PluginListCommand, + PluginRuntimeCommand, + RebuildCommand, + RemoveCommand, + RunIndexCommand, + RunCommand, + UpCommand, + WhyCommand, + WorkspaceCommand, ], }; diff --git a/packages/plugin-init/package.json b/packages/plugin-init/package.json index 902ad07a6097..8cca9b614b2e 100644 --- a/packages/plugin-init/package.json +++ b/packages/plugin-init/package.json @@ -5,7 +5,6 @@ "main": "./sources/index.ts", "exports": { ".": "./sources/index.ts", - "./command/*": "./sources/commands/*.ts", "./package.json": "./package.json" }, "dependencies": { @@ -38,10 +37,6 @@ "types": "./lib/index.d.ts", "require": "./lib/index.js" }, - "./command/*": { - "types": "./lib/commands/*.d.ts", - "require": "./lib/commands/*.js" - }, "./package.json": "./package.json" } }, diff --git a/packages/plugin-init/sources/index.ts b/packages/plugin-init/sources/index.ts index f52a9f3d801c..9d8f755a76be 100644 --- a/packages/plugin-init/sources/index.ts +++ b/packages/plugin-init/sources/index.ts @@ -1,6 +1,8 @@ import {Plugin, SettingsType} from '@yarnpkg/core'; -import init from './commands/init'; +import InitCommand from './commands/init'; + +export {InitCommand}; declare module '@yarnpkg/core' { interface ConfigurationValueMap { @@ -35,7 +37,7 @@ const plugin: Plugin = { }, }, commands: [ - init, + InitCommand, ], }; diff --git a/packages/plugin-interactive-tools/package.json b/packages/plugin-interactive-tools/package.json index 4ecf00ebea89..fbbc12c4c272 100644 --- a/packages/plugin-interactive-tools/package.json +++ b/packages/plugin-interactive-tools/package.json @@ -6,7 +6,6 @@ "main": "./sources/index.ts", "exports": { ".": "./sources/index.ts", - "./command/*": "./sources/commands/*.ts", "./package.json": "./package.json" }, "dependencies": { @@ -51,10 +50,6 @@ "types": "./lib/index.d.ts", "require": "./lib/index.js" }, - "./command/*": { - "types": "./lib/commands/*.d.ts", - "require": "./lib/commands/*.js" - }, "./package.json": "./package.json" } }, diff --git a/packages/plugin-interactive-tools/sources/index.ts b/packages/plugin-interactive-tools/sources/index.ts index 4a0628105930..196225866354 100644 --- a/packages/plugin-interactive-tools/sources/index.ts +++ b/packages/plugin-interactive-tools/sources/index.ts @@ -1,12 +1,15 @@ -import {Plugin} from '@yarnpkg/core'; +import {Plugin} from '@yarnpkg/core'; -import search from './commands/search'; -import upgradeInteractive from './commands/upgrade-interactive'; +import SearchCommand from './commands/search'; +import UpgradeInteractiveCommand from './commands/upgrade-interactive'; + +export {SearchCommand}; +export {UpgradeInteractiveCommand}; const plugin: Plugin = { commands: [ - search, - upgradeInteractive, + SearchCommand, + UpgradeInteractiveCommand, ], }; diff --git a/packages/plugin-npm-cli/package.json b/packages/plugin-npm-cli/package.json index 802eafe3072e..5e14cfbd7a2e 100644 --- a/packages/plugin-npm-cli/package.json +++ b/packages/plugin-npm-cli/package.json @@ -5,7 +5,6 @@ "main": "./sources/index.ts", "exports": { ".": "./sources/index.ts", - "./command/*": "./sources/commands/*.ts", "./package.json": "./package.json" }, "dependencies": { @@ -49,10 +48,6 @@ "types": "./lib/index.d.ts", "require": "./lib/index.js" }, - "./command/*": { - "types": "./lib/commands/*.d.ts", - "require": "./lib/commands/*.js" - }, "./package.json": "./package.json" } }, diff --git a/packages/plugin-npm-cli/sources/commands/npm/audit.ts b/packages/plugin-npm-cli/sources/commands/npm/audit.ts index bd8bb3990f24..0b0358f7cec4 100644 --- a/packages/plugin-npm-cli/sources/commands/npm/audit.ts +++ b/packages/plugin-npm-cli/sources/commands/npm/audit.ts @@ -9,7 +9,7 @@ import * as npmAuditTypes import * as npmAuditUtils from '../../npmAuditUtils'; // eslint-disable-next-line arca/no-default-export -export default class AuditCommand extends BaseCommand { +export default class NpmAuditCommand extends BaseCommand { static paths = [ [`npm`, `audit`], ]; diff --git a/packages/plugin-npm-cli/sources/commands/npm/info.ts b/packages/plugin-npm-cli/sources/commands/npm/info.ts index 8f8efd7212c3..c18c3e4566a4 100644 --- a/packages/plugin-npm-cli/sources/commands/npm/info.ts +++ b/packages/plugin-npm-cli/sources/commands/npm/info.ts @@ -27,7 +27,7 @@ interface PackageInformation extends CombinedPackument { } // eslint-disable-next-line arca/no-default-export -export default class InfoCommand extends BaseCommand { +export default class NpmInfoCommand extends BaseCommand { static paths = [ [`npm`, `info`], ]; diff --git a/packages/plugin-npm-cli/sources/index.ts b/packages/plugin-npm-cli/sources/index.ts index 0a2a14e3f1fb..36a1ae049596 100644 --- a/packages/plugin-npm-cli/sources/index.ts +++ b/packages/plugin-npm-cli/sources/index.ts @@ -1,17 +1,26 @@ import {Plugin, SettingsType} from '@yarnpkg/core'; -import npmAudit from './commands/npm/audit'; -import npmInfo from './commands/npm/info'; -import npmLogin from './commands/npm/login'; -import npmLogout from './commands/npm/logout'; -import npmPublish from './commands/npm/publish'; -import npmTagAdd from './commands/npm/tag/add'; -import npmTagList from './commands/npm/tag/list'; -import npmTagRemove from './commands/npm/tag/remove'; -import npmWhoami from './commands/npm/whoami'; +import NpmAuditCommand from './commands/npm/audit'; +import NpmInfoCommand from './commands/npm/info'; +import NpmLoginCommand from './commands/npm/login'; +import NpmLogoutCommand from './commands/npm/logout'; +import NpmPublishCommand from './commands/npm/publish'; +import NpmTagAddCommand from './commands/npm/tag/add'; +import NpmTagListCommand from './commands/npm/tag/list'; +import NpmTagRemoveCommand from './commands/npm/tag/remove'; +import NpmWhoamiCommand from './commands/npm/whoami'; import * as npmAuditUtils from './npmAuditUtils'; export {npmAuditUtils}; +export {NpmAuditCommand}; +export {NpmInfoCommand}; +export {NpmLoginCommand}; +export {NpmLogoutCommand}; +export {NpmPublishCommand}; +export {NpmTagAddCommand}; +export {NpmTagListCommand}; +export {NpmTagRemoveCommand}; +export {NpmWhoamiCommand}; declare module '@yarnpkg/core' { interface ConfigurationValueMap { @@ -42,15 +51,15 @@ const plugin: Plugin = { }, }, commands: [ - npmAudit, - npmInfo, - npmLogin, - npmLogout, - npmPublish, - npmTagAdd, - npmTagList, - npmTagRemove, - npmWhoami, + NpmAuditCommand, + NpmInfoCommand, + NpmLoginCommand, + NpmLogoutCommand, + NpmPublishCommand, + NpmTagAddCommand, + NpmTagListCommand, + NpmTagRemoveCommand, + NpmWhoamiCommand, ], }; diff --git a/packages/plugin-pack/package.json b/packages/plugin-pack/package.json index 4771193e16f4..ee57d49af9d3 100644 --- a/packages/plugin-pack/package.json +++ b/packages/plugin-pack/package.json @@ -5,7 +5,6 @@ "main": "./sources/index.ts", "exports": { ".": "./sources/index.ts", - "./command/*": "./sources/commands/*.ts", "./package.json": "./package.json" }, "dependencies": { @@ -43,10 +42,6 @@ "types": "./lib/index.d.ts", "require": "./lib/index.js" }, - "./command/*": { - "types": "./lib/commands/*.d.ts", - "require": "./lib/commands/*.js" - }, "./package.json": "./package.json" } }, diff --git a/packages/plugin-pack/sources/index.ts b/packages/plugin-pack/sources/index.ts index 0bd76598a8aa..f46f577687b1 100644 --- a/packages/plugin-pack/sources/index.ts +++ b/packages/plugin-pack/sources/index.ts @@ -1,9 +1,10 @@ import {Hooks as CoreHooks, Plugin, Workspace, structUtils} from '@yarnpkg/core'; import {MessageName, ReportError} from '@yarnpkg/core'; -import pack from './commands/pack'; +import PackCommand from './commands/pack'; import * as packUtils from './packUtils'; +export {PackCommand}; export {packUtils}; export interface Hooks { @@ -91,7 +92,7 @@ const plugin: Plugin = { beforeWorkspacePacking, }, commands: [ - pack, + PackCommand, ], }; diff --git a/packages/plugin-patch/package.json b/packages/plugin-patch/package.json index 28de9976a3b7..a1662c48ec0e 100644 --- a/packages/plugin-patch/package.json +++ b/packages/plugin-patch/package.json @@ -6,7 +6,6 @@ "main": "./sources/index.ts", "exports": { ".": "./sources/index.ts", - "./command/*": "./sources/commands/*.ts", "./package.json": "./package.json" }, "dependencies": { @@ -40,10 +39,6 @@ "types": "./lib/index.d.ts", "require": "./lib/index.js" }, - "./command/*": { - "types": "./lib/commands/*.d.ts", - "require": "./lib/commands/*.js" - }, "./package.json": "./package.json" } }, diff --git a/packages/plugin-patch/sources/index.ts b/packages/plugin-patch/sources/index.ts index e60d0cee6919..6545a68a06bd 100644 --- a/packages/plugin-patch/sources/index.ts +++ b/packages/plugin-patch/sources/index.ts @@ -3,13 +3,15 @@ import {PortablePath} from '@yarnpkg/fslib'; import {PatchFetcher} from './PatchFetcher'; import {PatchResolver} from './PatchResolver'; -import PatchCommit from './commands/patchCommit'; -import Patch from './commands/patch'; +import PatchCommitCommand from './commands/patchCommit'; +import PatchCommand from './commands/patch'; import * as patchUtils from './patchUtils'; -export {patchUtils}; export {PatchFetcher}; export {PatchResolver}; +export {PatchCommitCommand}; +export {PatchCommand}; +export {patchUtils}; export interface Hooks { /** @@ -44,8 +46,8 @@ const plugin: Plugin = { }, }, commands: [ - PatchCommit, - Patch, + PatchCommitCommand, + PatchCommand, ], fetchers: [ PatchFetcher, diff --git a/packages/plugin-pnp/package.json b/packages/plugin-pnp/package.json index bd51786611b7..9f070a3a2b7c 100644 --- a/packages/plugin-pnp/package.json +++ b/packages/plugin-pnp/package.json @@ -6,7 +6,6 @@ "main": "./sources/index.ts", "exports": { ".": "./sources/index.ts", - "./command/*": "./sources/commands/*.ts", "./package.json": "./package.json" }, "dependencies": { @@ -45,10 +44,6 @@ "types": "./lib/index.d.ts", "require": "./lib/index.js" }, - "./command/*": { - "types": "./lib/commands/*.d.ts", - "require": "./lib/commands/*.js" - }, "./package.json": "./package.json" } }, diff --git a/packages/plugin-pnp/sources/index.ts b/packages/plugin-pnp/sources/index.ts index 49d35f585b3a..a97c66cc6509 100644 --- a/packages/plugin-pnp/sources/index.ts +++ b/packages/plugin-pnp/sources/index.ts @@ -5,10 +5,11 @@ import semver from 'semver'; import {pathToFileURL} from 'url'; import {PnpLinker} from './PnpLinker'; -import unplug from './commands/unplug'; +import UnplugCommand from './commands/unplug'; import * as jsInstallUtils from './jsInstallUtils'; import * as pnpUtils from './pnpUtils'; +export {UnplugCommand}; export {jsInstallUtils}; export {pnpUtils}; @@ -123,7 +124,7 @@ const plugin: Plugin = { PnpLinker, ], commands: [ - unplug, + UnplugCommand, ], }; diff --git a/packages/plugin-stage/package.json b/packages/plugin-stage/package.json index 041e300176e7..51c468cb3dd8 100644 --- a/packages/plugin-stage/package.json +++ b/packages/plugin-stage/package.json @@ -5,7 +5,6 @@ "main": "./sources/index.ts", "exports": { ".": "./sources/index.ts", - "./command/*": "./sources/commands/*.ts", "./package.json": "./package.json" }, "dependencies": { @@ -39,10 +38,6 @@ "types": "./lib/index.d.ts", "require": "./lib/index.js" }, - "./command/*": { - "types": "./lib/commands/*.d.ts", - "require": "./lib/commands/*.js" - }, "./package.json": "./package.json" } }, diff --git a/packages/plugin-stage/sources/index.ts b/packages/plugin-stage/sources/index.ts index 4088f5b96e67..3fba68f89b44 100644 --- a/packages/plugin-stage/sources/index.ts +++ b/packages/plugin-stage/sources/index.ts @@ -1,9 +1,10 @@ import {Plugin, Project} from '@yarnpkg/core'; import {PortablePath} from '@yarnpkg/fslib'; -import stage from './commands/stage'; +import StageCommand from './commands/stage'; import * as stageUtils from './stageUtils'; +export {StageCommand}; export {stageUtils}; export interface Hooks { @@ -15,7 +16,7 @@ export interface Hooks { const plugin: Plugin = { commands: [ - stage, + StageCommand, ], }; diff --git a/packages/plugin-version/package.json b/packages/plugin-version/package.json index 1fe8039b17e3..6914e1bac3ef 100644 --- a/packages/plugin-version/package.json +++ b/packages/plugin-version/package.json @@ -5,7 +5,6 @@ "main": "./sources/index.ts", "exports": { ".": "./sources/index.ts", - "./command/*": "./sources/commands/*.ts", "./package.json": "./package.json" }, "dependencies": { @@ -50,10 +49,6 @@ "types": "./lib/index.d.ts", "require": "./lib/index.js" }, - "./command/*": { - "types": "./lib/commands/*.d.ts", - "require": "./lib/commands/*.js" - }, "./package.json": "./package.json" } }, diff --git a/packages/plugin-version/sources/index.ts b/packages/plugin-version/sources/index.ts index cbaa8cb3a8e5..d5e32ddaa1bf 100644 --- a/packages/plugin-version/sources/index.ts +++ b/packages/plugin-version/sources/index.ts @@ -1,11 +1,14 @@ import {Plugin, SettingsType} from '@yarnpkg/core'; import {PortablePath} from '@yarnpkg/fslib'; -import versionApply from './commands/version/apply'; -import versionCheck from './commands/version/check'; -import version from './commands/version'; +import VersionApplyCommand from './commands/version/apply'; +import VersionCheckCommand from './commands/version/check'; +import VersionCommand from './commands/version'; import * as versionUtils from './versionUtils'; +export {VersionApplyCommand}; +export {VersionCheckCommand}; +export {VersionCommand}; export {versionUtils}; declare module '@yarnpkg/core' { @@ -29,9 +32,9 @@ const plugin: Plugin = { }, }, commands: [ - versionApply, - versionCheck, - version, + VersionApplyCommand, + VersionCheckCommand, + VersionCommand, ], }; diff --git a/packages/plugin-workspace-tools/package.json b/packages/plugin-workspace-tools/package.json index 4a9ebba61bfc..f6918271d87f 100644 --- a/packages/plugin-workspace-tools/package.json +++ b/packages/plugin-workspace-tools/package.json @@ -6,7 +6,6 @@ "main": "./sources/index.ts", "exports": { ".": "./sources/index.ts", - "./command/*": "./sources/commands/*.ts", "./package.json": "./package.json" }, "dependencies": { @@ -46,10 +45,6 @@ "types": "./lib/index.d.ts", "require": "./lib/index.js" }, - "./command/*": { - "types": "./lib/commands/*.d.ts", - "require": "./lib/commands/*.js" - }, "./package.json": "./package.json" } }, diff --git a/packages/plugin-workspace-tools/sources/commands/focus.ts b/packages/plugin-workspace-tools/sources/commands/focus.ts index 8cb29e81a1cb..2c76cef014f5 100644 --- a/packages/plugin-workspace-tools/sources/commands/focus.ts +++ b/packages/plugin-workspace-tools/sources/commands/focus.ts @@ -4,7 +4,7 @@ import {structUtils} from ' import {Command, Option, Usage} from 'clipanion'; // eslint-disable-next-line arca/no-default-export -export default class WorkspacesFocus extends BaseCommand { +export default class WorkspacesFocusCommand extends BaseCommand { static paths = [ [`workspaces`, `focus`], ]; diff --git a/packages/plugin-workspace-tools/sources/index.ts b/packages/plugin-workspace-tools/sources/index.ts index deb2c38fe453..cb1096b9faa0 100644 --- a/packages/plugin-workspace-tools/sources/index.ts +++ b/packages/plugin-workspace-tools/sources/index.ts @@ -1,12 +1,15 @@ -import {Plugin} from '@yarnpkg/core'; +import {Plugin} from '@yarnpkg/core'; -import focus from './commands/focus'; -import foreach from './commands/foreach'; +import WorkspacesFocusCommand from './commands/focus'; +import WorkspacesForeachCommand from './commands/foreach'; + +export {WorkspacesFocusCommand}; +export {WorkspacesForeachCommand}; const plugin: Plugin = { commands: [ - focus, - foreach, + WorkspacesFocusCommand, + WorkspacesForeachCommand, ], }; diff --git a/packages/yarnpkg-builder/package.json b/packages/yarnpkg-builder/package.json index f3dbc43e32b8..626ae6d2bc92 100644 --- a/packages/yarnpkg-builder/package.json +++ b/packages/yarnpkg-builder/package.json @@ -5,8 +5,8 @@ "license": "BSD-2-Clause", "bin": "./sources/boot-cli-dev.js", "exports": { + ".": "./sources/index.ts", "./cli": "./sources/boot-cli-dev.js", - "./command/*": "./sources/commands/*.ts", "./package.json": "./package.json" }, "dependencies": { @@ -32,9 +32,9 @@ "publishConfig": { "bin": "./lib/cli.js", "exports": { - "./command/*": { - "types": "./lib/commands/*.d.ts", - "require": "./lib/commands/*.js" + ".": { + "types": "./lib/index.d.ts", + "require": "./lib/index.js" }, "./cli": { "types": "./lib/cli.d.ts", diff --git a/packages/yarnpkg-builder/sources/index.ts b/packages/yarnpkg-builder/sources/index.ts new file mode 100644 index 000000000000..dadf4d428794 --- /dev/null +++ b/packages/yarnpkg-builder/sources/index.ts @@ -0,0 +1,7 @@ +import BuildBundleCommand from './commands/build/bundle'; +import BuildPluginCommand from './commands/build/plugin'; +import NewPluginCommand from './commands/new/plugin'; + +export {BuildBundleCommand}; +export {BuildPluginCommand}; +export {NewPluginCommand}; diff --git a/packages/yarnpkg-libzip/package.json b/packages/yarnpkg-libzip/package.json index 5f9f7251b927..81dea9b843f4 100644 --- a/packages/yarnpkg-libzip/package.json +++ b/packages/yarnpkg-libzip/package.json @@ -6,12 +6,9 @@ "browser": "./sources/async.ts", "exports": { ".": { - "node": "./sources/sync.ts", "browser": "./sources/async.ts", "default": "./sources/sync.ts" }, - "./sync": "./sources/sync.ts", - "./async": "./sources/async.ts", "./package.json": "./package.json" }, "scripts": { @@ -25,23 +22,15 @@ "browser": "./lib/async.js", "exports": { ".": { - "node": { - "types": "./lib/sync.d.ts", - "require": "./lib/sync.js" - }, "browser": { "types": "./lib/async.d.ts", "require": "./lib/async.js" + }, + "default": { + "types": "./lib/sync.d.ts", + "require": "./lib/sync.js" } }, - "./sync": { - "types": "./lib/sync.d.ts", - "require": "./lib/sync.js" - }, - "./async": { - "types": "./lib/async.d.ts", - "require": "./lib/async.js" - }, "./package.json": "./package.json" } }, diff --git a/packages/yarnpkg-pnpify/package.json b/packages/yarnpkg-pnpify/package.json index 916149e3eab4..45d7f23a6a5c 100644 --- a/packages/yarnpkg-pnpify/package.json +++ b/packages/yarnpkg-pnpify/package.json @@ -9,7 +9,6 @@ "exports": { ".": "./sources/index.ts", "./utils": "./sources/utils.ts", - "./command/*": "./sources/commands/*.ts", "./cli": "./sources/cli.ts", "./package.json": "./package.json" }, @@ -44,10 +43,6 @@ "types": "./lib/utils.d.ts", "require": "./lib/utils.js" }, - "./command/*": { - "types": "./lib/commands/*.d.ts", - "require": "./lib/commands/*.js" - }, "./cli": { "types": "./lib/cli.d.ts", "require": "./lib/cli.js" diff --git a/packages/yarnpkg-pnpify/sources/utils.ts b/packages/yarnpkg-pnpify/sources/utils.ts index 11c3a713757b..3a44e34e0e2d 100644 --- a/packages/yarnpkg-pnpify/sources/utils.ts +++ b/packages/yarnpkg-pnpify/sources/utils.ts @@ -1,3 +1,9 @@ +import RunCommand from './commands/RunCommand'; +import SdkCommand from './commands/SdkCommand'; + +export {RunCommand}; +export {SdkCommand}; + export {patchFs} from './index'; export type {ResolvedPath} from './resolveNodeModulesPath'; export {resolveNodeModulesPath} from './resolveNodeModulesPath'; diff --git a/packages/yarnpkg-sdks/package.json b/packages/yarnpkg-sdks/package.json index 7081d88eccbb..0424bde50ca6 100644 --- a/packages/yarnpkg-sdks/package.json +++ b/packages/yarnpkg-sdks/package.json @@ -7,7 +7,6 @@ "types": "./sources/index.ts", "exports": { ".": "./sources/index.ts", - "./command/*": "./sources/commands/*.ts", "./cli": "./sources/boot-cli-dev.js", "./package.json": "./package.json" }, @@ -42,10 +41,6 @@ "types": "./lib/index.d.ts", "require": "./lib/index.js" }, - "./command/*": { - "types": "./lib/commands/*.d.ts", - "require": "./lib/commands/*.js" - }, "./cli": { "types": "./lib/cli.d.ts", "require": "./lib/cli.js" diff --git a/packages/yarnpkg-sdks/sources/index.ts b/packages/yarnpkg-sdks/sources/index.ts index 25bc9dd64220..ca7cdccb1ea3 100644 --- a/packages/yarnpkg-sdks/sources/index.ts +++ b/packages/yarnpkg-sdks/sources/index.ts @@ -1,3 +1,5 @@ +import SdkCommand from './commands/SdkCommand'; import * as sdkUtils from './sdkUtils'; +export {SdkCommand}; export {sdkUtils}; From e99ee1f0c78e2ca3f1b41fa26a1d4ad76262a613 Mon Sep 17 00:00:00 2001 From: larry1123 Date: Thu, 8 Sep 2022 15:47:06 -0400 Subject: [PATCH 10/11] remove `types` condition from `exports` export the command from `@yarnpkg/shell` --- .yarn/versions/eceb2ca1.yml | 4 +--- packages/plugin-compat/package.json | 5 +---- packages/plugin-constraints/package.json | 5 +---- packages/plugin-dlx/package.json | 5 +---- packages/plugin-essentials/package.json | 5 +---- packages/plugin-exec/package.json | 5 +---- packages/plugin-file/package.json | 5 +---- packages/plugin-git/package.json | 5 +---- packages/plugin-github/package.json | 5 +---- packages/plugin-http/package.json | 5 +---- packages/plugin-init/package.json | 5 +---- packages/plugin-interactive-tools/package.json | 5 +---- packages/plugin-link/package.json | 5 +---- packages/plugin-nm/package.json | 5 +---- packages/plugin-npm-cli/package.json | 5 +---- packages/plugin-npm/package.json | 5 +---- packages/plugin-pack/package.json | 5 +---- packages/plugin-patch/package.json | 5 +---- packages/plugin-pnp/package.json | 5 +---- packages/plugin-pnpm/package.json | 5 +---- packages/plugin-stage/package.json | 5 +---- packages/plugin-typescript/package.json | 5 +---- packages/plugin-version/package.json | 5 +---- packages/plugin-workspace-tools/package.json | 5 +---- packages/yarnpkg-builder/package.json | 10 ++-------- packages/yarnpkg-cli/package.json | 5 +---- packages/yarnpkg-core/package.json | 5 +---- packages/yarnpkg-doctor/package.json | 5 +---- packages/yarnpkg-extensions/package.json | 5 +---- packages/yarnpkg-fslib/package.json | 5 +---- packages/yarnpkg-libzip/package.json | 10 ++-------- packages/yarnpkg-nm/package.json | 5 +---- packages/yarnpkg-parsers/package.json | 5 +---- packages/yarnpkg-pnp/package.json | 5 +---- packages/yarnpkg-pnpify/package.json | 15 +++------------ packages/yarnpkg-sdks/package.json | 10 ++-------- packages/yarnpkg-shell/package.json | 10 ++-------- packages/yarnpkg-shell/sources/index.ts | 5 ++++- 38 files changed, 47 insertions(+), 172 deletions(-) diff --git a/.yarn/versions/eceb2ca1.yml b/.yarn/versions/eceb2ca1.yml index fd499634edba..6653417d8c54 100644 --- a/.yarn/versions/eceb2ca1.yml +++ b/.yarn/versions/eceb2ca1.yml @@ -36,6 +36,4 @@ releases: "@yarnpkg/pnpify": major "@yarnpkg/sdks": major "@yarnpkg/shell": major - -declined: - - vscode-zipfs + vscode-zipfs: patch diff --git a/packages/plugin-compat/package.json b/packages/plugin-compat/package.json index 846de2fe02a7..ff92d21f6ef5 100644 --- a/packages/plugin-compat/package.json +++ b/packages/plugin-compat/package.json @@ -42,10 +42,7 @@ "main": "./lib/index.js", "types": "./lib/index.d.ts", "exports": { - ".": { - "types": "./lib/index.d.ts", - "require": "./lib/index.js" - }, + ".": "./lib/index.js", "./package.json": "./package.json" } }, diff --git a/packages/plugin-constraints/package.json b/packages/plugin-constraints/package.json index 305980098e60..89464b047cee 100644 --- a/packages/plugin-constraints/package.json +++ b/packages/plugin-constraints/package.json @@ -38,10 +38,7 @@ "main": "./lib/index.js", "types": "./lib/index.d.ts", "exports": { - ".": { - "types": "./lib/index.d.ts", - "require": "./lib/index.js" - }, + ".": "./lib/index.js", "./package.json": "./package.json" } }, diff --git a/packages/plugin-dlx/package.json b/packages/plugin-dlx/package.json index bd9c66bdb883..356c32e8e500 100644 --- a/packages/plugin-dlx/package.json +++ b/packages/plugin-dlx/package.json @@ -34,10 +34,7 @@ "main": "./lib/index.js", "types": "./lib/index.d.ts", "exports": { - ".": { - "types": "./lib/index.d.ts", - "require": "./lib/index.js" - }, + ".": "./lib/index.js", "./package.json": "./package.json" } }, diff --git a/packages/plugin-essentials/package.json b/packages/plugin-essentials/package.json index 5d48c6ed985c..32ca5a97ed9a 100644 --- a/packages/plugin-essentials/package.json +++ b/packages/plugin-essentials/package.json @@ -45,10 +45,7 @@ "main": "./lib/index.js", "types": "./lib/index.d.ts", "exports": { - ".": { - "types": "./lib/index.d.ts", - "require": "./lib/index.js" - }, + ".": "./lib/index.js", "./package.json": "./package.json" } }, diff --git a/packages/plugin-exec/package.json b/packages/plugin-exec/package.json index 23b3160fe0fd..a703c1fdfa51 100644 --- a/packages/plugin-exec/package.json +++ b/packages/plugin-exec/package.json @@ -31,10 +31,7 @@ "main": "./lib/index.js", "types": "./lib/index.d.ts", "exports": { - ".": { - "types": "./lib/index.d.ts", - "require": "./lib/index.js" - }, + ".": "./lib/index.js", "./package.json": "./package.json" } }, diff --git a/packages/plugin-file/package.json b/packages/plugin-file/package.json index 48c292d5187c..ec59fbe09731 100644 --- a/packages/plugin-file/package.json +++ b/packages/plugin-file/package.json @@ -30,10 +30,7 @@ "main": "./lib/index.js", "types": "./lib/index.d.ts", "exports": { - ".": { - "types": "./lib/index.d.ts", - "require": "./lib/index.js" - }, + ".": "./lib/index.js", "./package.json": "./package.json" } }, diff --git a/packages/plugin-git/package.json b/packages/plugin-git/package.json index 7c1b07f1d30f..d5db13f4992e 100644 --- a/packages/plugin-git/package.json +++ b/packages/plugin-git/package.json @@ -37,10 +37,7 @@ "main": "./lib/index.js", "types": "./lib/index.d.ts", "exports": { - ".": { - "types": "./lib/index.d.ts", - "require": "./lib/index.js" - }, + ".": "./lib/index.js", "./package.json": "./package.json" } }, diff --git a/packages/plugin-github/package.json b/packages/plugin-github/package.json index 7f64a1967b6d..44f323f2ce20 100644 --- a/packages/plugin-github/package.json +++ b/packages/plugin-github/package.json @@ -33,10 +33,7 @@ "main": "./lib/index.js", "types": "./lib/index.d.ts", "exports": { - ".": { - "types": "./lib/index.d.ts", - "require": "./lib/index.js" - }, + ".": "./lib/index.js", "./package.json": "./package.json" } }, diff --git a/packages/plugin-http/package.json b/packages/plugin-http/package.json index bbd10ec6e8c7..0a74350622dd 100644 --- a/packages/plugin-http/package.json +++ b/packages/plugin-http/package.json @@ -29,10 +29,7 @@ "main": "./lib/index.js", "types": "./lib/index.d.ts", "exports": { - ".": { - "types": "./lib/index.d.ts", - "require": "./lib/index.js" - }, + ".": "./lib/index.js", "./package.json": "./package.json" } }, diff --git a/packages/plugin-init/package.json b/packages/plugin-init/package.json index 8cca9b614b2e..7e69580c1c4a 100644 --- a/packages/plugin-init/package.json +++ b/packages/plugin-init/package.json @@ -33,10 +33,7 @@ "main": "./lib/index.js", "types": "./lib/index.d.ts", "exports": { - ".": { - "types": "./lib/index.d.ts", - "require": "./lib/index.js" - }, + ".": "./lib/index.js", "./package.json": "./package.json" } }, diff --git a/packages/plugin-interactive-tools/package.json b/packages/plugin-interactive-tools/package.json index fbbc12c4c272..3b3a4fb3171d 100644 --- a/packages/plugin-interactive-tools/package.json +++ b/packages/plugin-interactive-tools/package.json @@ -46,10 +46,7 @@ "main": "./lib/index.js", "types": "./lib/index.d.ts", "exports": { - ".": { - "types": "./lib/index.d.ts", - "require": "./lib/index.js" - }, + ".": "./lib/index.js", "./package.json": "./package.json" } }, diff --git a/packages/plugin-link/package.json b/packages/plugin-link/package.json index 95c3d0f2d271..f47e0a78e767 100644 --- a/packages/plugin-link/package.json +++ b/packages/plugin-link/package.json @@ -30,10 +30,7 @@ "main": "./lib/index.js", "types": "./lib/index.d.ts", "exports": { - ".": { - "types": "./lib/index.d.ts", - "require": "./lib/index.js" - }, + ".": "./lib/index.js", "./package.json": "./package.json" } }, diff --git a/packages/plugin-nm/package.json b/packages/plugin-nm/package.json index bbc4b4458a94..2c6412667492 100644 --- a/packages/plugin-nm/package.json +++ b/packages/plugin-nm/package.json @@ -43,10 +43,7 @@ "main": "./lib/index.js", "types": "./lib/index.d.ts", "exports": { - ".": { - "types": "./lib/index.d.ts", - "require": "./lib/index.js" - }, + ".": "./lib/index.js", "./package.json": "./package.json" } }, diff --git a/packages/plugin-npm-cli/package.json b/packages/plugin-npm-cli/package.json index 5e14cfbd7a2e..0917b18bacfb 100644 --- a/packages/plugin-npm-cli/package.json +++ b/packages/plugin-npm-cli/package.json @@ -44,10 +44,7 @@ "main": "./lib/index.js", "types": "./lib/index.d.ts", "exports": { - ".": { - "types": "./lib/index.d.ts", - "require": "./lib/index.js" - }, + ".": "./lib/index.js", "./package.json": "./package.json" } }, diff --git a/packages/plugin-npm/package.json b/packages/plugin-npm/package.json index e50163c413b7..0eb74af33f5a 100644 --- a/packages/plugin-npm/package.json +++ b/packages/plugin-npm/package.json @@ -37,10 +37,7 @@ "main": "./lib/index.js", "types": "./lib/index.d.ts", "exports": { - ".": { - "types": "./lib/index.d.ts", - "require": "./lib/index.js" - }, + ".": "./lib/index.js", "./package.json": "./package.json" } }, diff --git a/packages/plugin-pack/package.json b/packages/plugin-pack/package.json index ee57d49af9d3..e49d57ee417c 100644 --- a/packages/plugin-pack/package.json +++ b/packages/plugin-pack/package.json @@ -38,10 +38,7 @@ "main": "./lib/index.js", "types": "./lib/index.d.ts", "exports": { - ".": { - "types": "./lib/index.d.ts", - "require": "./lib/index.js" - }, + ".": "./lib/index.js", "./package.json": "./package.json" } }, diff --git a/packages/plugin-patch/package.json b/packages/plugin-patch/package.json index a1662c48ec0e..65a2a7e0633e 100644 --- a/packages/plugin-patch/package.json +++ b/packages/plugin-patch/package.json @@ -35,10 +35,7 @@ "main": "./lib/index.js", "types": "./lib/index.d.ts", "exports": { - ".": { - "types": "./lib/index.d.ts", - "require": "./lib/index.js" - }, + ".": "./lib/index.js", "./package.json": "./package.json" } }, diff --git a/packages/plugin-pnp/package.json b/packages/plugin-pnp/package.json index 9f070a3a2b7c..dfa1ff0e3cda 100644 --- a/packages/plugin-pnp/package.json +++ b/packages/plugin-pnp/package.json @@ -40,10 +40,7 @@ "main": "./lib/index.js", "types": "./lib/index.d.ts", "exports": { - ".": { - "types": "./lib/index.d.ts", - "require": "./lib/index.js" - }, + ".": "./lib/index.js", "./package.json": "./package.json" } }, diff --git a/packages/plugin-pnpm/package.json b/packages/plugin-pnpm/package.json index 1498c2122b78..1028cc94bee9 100644 --- a/packages/plugin-pnpm/package.json +++ b/packages/plugin-pnpm/package.json @@ -36,10 +36,7 @@ "main": "./lib/index.js", "types": "./lib/index.d.ts", "exports": { - ".": { - "types": "./lib/index.d.ts", - "require": "./lib/index.js" - }, + ".": "./lib/index.js", "./package.json": "./package.json" } }, diff --git a/packages/plugin-stage/package.json b/packages/plugin-stage/package.json index 51c468cb3dd8..d178b6f1c717 100644 --- a/packages/plugin-stage/package.json +++ b/packages/plugin-stage/package.json @@ -34,10 +34,7 @@ "main": "./lib/index.js", "types": "./lib/index.d.ts", "exports": { - ".": { - "types": "./lib/index.d.ts", - "require": "./lib/index.js" - }, + ".": "./lib/index.js", "./package.json": "./package.json" } }, diff --git a/packages/plugin-typescript/package.json b/packages/plugin-typescript/package.json index a3fc63e68ba5..169537b61f4b 100644 --- a/packages/plugin-typescript/package.json +++ b/packages/plugin-typescript/package.json @@ -40,10 +40,7 @@ "main": "./lib/index.js", "types": "./lib/index.d.ts", "exports": { - ".": { - "types": "./lib/index.d.ts", - "require": "./lib/index.js" - }, + ".": "./lib/index.js", "./package.json": "./package.json" } }, diff --git a/packages/plugin-version/package.json b/packages/plugin-version/package.json index 6914e1bac3ef..accc32cf6083 100644 --- a/packages/plugin-version/package.json +++ b/packages/plugin-version/package.json @@ -45,10 +45,7 @@ "main": "./lib/index.js", "types": "./lib/index.d.ts", "exports": { - ".": { - "types": "./lib/index.d.ts", - "require": "./lib/index.js" - }, + ".": "./lib/index.js", "./package.json": "./package.json" } }, diff --git a/packages/plugin-workspace-tools/package.json b/packages/plugin-workspace-tools/package.json index f6918271d87f..a6723493fecc 100644 --- a/packages/plugin-workspace-tools/package.json +++ b/packages/plugin-workspace-tools/package.json @@ -41,10 +41,7 @@ "main": "./lib/index.js", "types": "./lib/index.d.ts", "exports": { - ".": { - "types": "./lib/index.d.ts", - "require": "./lib/index.js" - }, + ".": "./lib/index.js", "./package.json": "./package.json" } }, diff --git a/packages/yarnpkg-builder/package.json b/packages/yarnpkg-builder/package.json index 626ae6d2bc92..d2f76b4a454a 100644 --- a/packages/yarnpkg-builder/package.json +++ b/packages/yarnpkg-builder/package.json @@ -32,14 +32,8 @@ "publishConfig": { "bin": "./lib/cli.js", "exports": { - ".": { - "types": "./lib/index.d.ts", - "require": "./lib/index.js" - }, - "./cli": { - "types": "./lib/cli.d.ts", - "require": "./lib/cli.js" - }, + ".": "./lib/index.js", + "./cli": "./lib/cli.js", "./package.json": "./package.json" } }, diff --git a/packages/yarnpkg-cli/package.json b/packages/yarnpkg-cli/package.json index dbf9eca729f6..b7df3c498263 100644 --- a/packages/yarnpkg-cli/package.json +++ b/packages/yarnpkg-cli/package.json @@ -67,10 +67,7 @@ "types": "./lib/index.d.ts", "bin": null, "exports": { - ".": { - "types": "./lib/index.d.ts", - "require": "./lib/index.js" - }, + ".": "./lib/index.js", "./package.json": "./package.json" } }, diff --git a/packages/yarnpkg-core/package.json b/packages/yarnpkg-core/package.json index dd224a236f76..8e4116ae353c 100644 --- a/packages/yarnpkg-core/package.json +++ b/packages/yarnpkg-core/package.json @@ -67,10 +67,7 @@ "main": "./lib/index.js", "types": "./lib/index.d.ts", "exports": { - ".": { - "types": "./lib/index.d.ts", - "require": "./lib/index.js" - }, + ".": "./lib/index.js", "./package.json": "./package.json" } }, diff --git a/packages/yarnpkg-doctor/package.json b/packages/yarnpkg-doctor/package.json index 79d746136b84..da3ed19af03a 100644 --- a/packages/yarnpkg-doctor/package.json +++ b/packages/yarnpkg-doctor/package.json @@ -29,10 +29,7 @@ "publishConfig": { "bin": "./lib/cli.js", "exports": { - "./cli": { - "types": "./lib/cli.d.ts", - "require": "./lib/cli.js" - }, + "./cli": "./lib/cli.js", "./package.json": "./package.json" } }, diff --git a/packages/yarnpkg-extensions/package.json b/packages/yarnpkg-extensions/package.json index 373e0185982f..2df2e2b206dc 100644 --- a/packages/yarnpkg-extensions/package.json +++ b/packages/yarnpkg-extensions/package.json @@ -27,10 +27,7 @@ "main": "./lib/index.js", "types": "./lib/index.d.ts", "exports": { - ".": { - "types": "./lib/index.d.ts", - "require": "./lib/index.js" - }, + ".": "./lib/index.js", "./package.json": "./package.json" } }, diff --git a/packages/yarnpkg-fslib/package.json b/packages/yarnpkg-fslib/package.json index 69e3b68c2233..5acf34183034 100644 --- a/packages/yarnpkg-fslib/package.json +++ b/packages/yarnpkg-fslib/package.json @@ -24,10 +24,7 @@ "main": "./lib/index.js", "types": "./lib/index.d.ts", "exports": { - ".": { - "types": "./lib/index.d.ts", - "require": "./lib/index.js" - }, + ".": "./lib/index.js", "./package.json": "./package.json" } }, diff --git a/packages/yarnpkg-libzip/package.json b/packages/yarnpkg-libzip/package.json index 81dea9b843f4..afe12ec462b3 100644 --- a/packages/yarnpkg-libzip/package.json +++ b/packages/yarnpkg-libzip/package.json @@ -22,14 +22,8 @@ "browser": "./lib/async.js", "exports": { ".": { - "browser": { - "types": "./lib/async.d.ts", - "require": "./lib/async.js" - }, - "default": { - "types": "./lib/sync.d.ts", - "require": "./lib/sync.js" - } + "browser": "./lib/async.js", + "default": "./lib/sync.js" }, "./package.json": "./package.json" } diff --git a/packages/yarnpkg-nm/package.json b/packages/yarnpkg-nm/package.json index 72f187e82db9..0683b0a078fd 100644 --- a/packages/yarnpkg-nm/package.json +++ b/packages/yarnpkg-nm/package.json @@ -26,10 +26,7 @@ "main": "./lib/index.js", "types": "./lib/index.d.ts", "exports": { - ".": { - "types": "./lib/index.d.ts", - "require": "./lib/index.js" - }, + ".": "./lib/index.js", "./package.json": "./package.json" } }, diff --git a/packages/yarnpkg-parsers/package.json b/packages/yarnpkg-parsers/package.json index 85fa1df9b274..8b2cf8af658e 100644 --- a/packages/yarnpkg-parsers/package.json +++ b/packages/yarnpkg-parsers/package.json @@ -29,10 +29,7 @@ "main": "./lib/index.js", "types": "./lib/index.d.ts", "exports": { - ".": { - "types": "./lib/index.d.ts", - "require": "./lib/index.js" - }, + ".": "./lib/index.js", "./package.json": "./package.json" } }, diff --git a/packages/yarnpkg-pnp/package.json b/packages/yarnpkg-pnp/package.json index f04f9882571e..800f379f687b 100644 --- a/packages/yarnpkg-pnp/package.json +++ b/packages/yarnpkg-pnp/package.json @@ -36,10 +36,7 @@ "main": "./lib/index.js", "types": "./lib/index.d.ts", "exports": { - ".": { - "types": "./lib/index.d.ts", - "require": "./lib/index.js" - }, + ".": "./lib/index.js", "./package.json": "./package.json" } }, diff --git a/packages/yarnpkg-pnpify/package.json b/packages/yarnpkg-pnpify/package.json index 45d7f23a6a5c..83a2224e865c 100644 --- a/packages/yarnpkg-pnpify/package.json +++ b/packages/yarnpkg-pnpify/package.json @@ -35,18 +35,9 @@ "bin": "./lib/cli.js", "types": "./lib/index.d.ts", "exports": { - ".": { - "types": "./lib/index.d.ts", - "require": "./lib/index.js" - }, - "./utils": { - "types": "./lib/utils.d.ts", - "require": "./lib/utils.js" - }, - "./cli": { - "types": "./lib/cli.d.ts", - "require": "./lib/cli.js" - }, + ".": "./lib/index.js", + "./utils": "./lib/utils.js", + "./cli": "./lib/cli.js", "./package.json": "./package.json" } }, diff --git a/packages/yarnpkg-sdks/package.json b/packages/yarnpkg-sdks/package.json index 0424bde50ca6..2343f1851dd1 100644 --- a/packages/yarnpkg-sdks/package.json +++ b/packages/yarnpkg-sdks/package.json @@ -37,14 +37,8 @@ "bin": "./lib/cli.js", "types": "./lib/index.d.ts", "exports": { - ".": { - "types": "./lib/index.d.ts", - "require": "./lib/index.js" - }, - "./cli": { - "types": "./lib/cli.d.ts", - "require": "./lib/cli.js" - }, + ".": "./lib/index.js", + "./cli": "./lib/cli.js", "./package.json": "./package.json" } }, diff --git a/packages/yarnpkg-shell/package.json b/packages/yarnpkg-shell/package.json index 685ffefba0b6..d3ba234bfbc0 100644 --- a/packages/yarnpkg-shell/package.json +++ b/packages/yarnpkg-shell/package.json @@ -37,14 +37,8 @@ "bin": "./lib/cli.js", "types": "./lib/index.d.ts", "exports": { - ".": { - "types": "./lib/index.d.ts", - "require": "./lib/index.js" - }, - "./cli": { - "types": "./lib/cli.d.ts", - "require": "./lib/cli.js" - }, + ".": "./lib/index.js", + "./cli": "./lib/cli.js", "./package.json": "./package.json" } }, diff --git a/packages/yarnpkg-shell/sources/index.ts b/packages/yarnpkg-shell/sources/index.ts index f7d4d1dbcf03..412ea2726df3 100644 --- a/packages/yarnpkg-shell/sources/index.ts +++ b/packages/yarnpkg-shell/sources/index.ts @@ -6,6 +6,7 @@ import {homedir} import {PassThrough, Readable, Writable} from 'stream'; import {promisify} from 'util'; +import EntryCommand from './commands/entry'; import {ShellError} from './errors'; import * as globUtils from './globUtils'; import {createOutputStreamsWithPrefix, makeBuiltin, makeProcess} from './pipe'; @@ -13,7 +14,9 @@ import {Handle, ProcessImplementation, ProtectedStream, Stdio, start, Pipe} const setTimeoutPromise = promisify(setTimeout); -export {globUtils, ShellError}; +export {EntryCommand}; +export {ShellError}; +export {globUtils}; export type Glob = globUtils.Glob; From bd59b290483332308bf7ac9b82c0220015698bab Mon Sep 17 00:00:00 2001 From: larry1123 Date: Thu, 8 Sep 2022 15:56:50 -0400 Subject: [PATCH 11/11] remove `types` in root and `publishConfig` Typescript can find the type definition files without these helpers. --- packages/plugin-compat/package.json | 1 - packages/plugin-constraints/package.json | 1 - packages/plugin-dlx/package.json | 1 - packages/plugin-essentials/package.json | 1 - packages/plugin-exec/package.json | 1 - packages/plugin-file/package.json | 1 - packages/plugin-git/package.json | 1 - packages/plugin-github/package.json | 1 - packages/plugin-http/package.json | 1 - packages/plugin-init/package.json | 1 - packages/plugin-interactive-tools/package.json | 1 - packages/plugin-link/package.json | 1 - packages/plugin-nm/package.json | 1 - packages/plugin-npm-cli/package.json | 1 - packages/plugin-npm/package.json | 1 - packages/plugin-pack/package.json | 1 - packages/plugin-patch/package.json | 1 - packages/plugin-pnp/package.json | 1 - packages/plugin-pnpm/package.json | 1 - packages/plugin-stage/package.json | 1 - packages/plugin-typescript/package.json | 1 - packages/plugin-version/package.json | 1 - packages/plugin-workspace-tools/package.json | 1 - packages/yarnpkg-cli/package.json | 1 - packages/yarnpkg-core/package.json | 1 - packages/yarnpkg-extensions/package.json | 1 - packages/yarnpkg-fslib/package.json | 1 - packages/yarnpkg-nm/package.json | 2 -- packages/yarnpkg-parsers/package.json | 1 - packages/yarnpkg-pnp/package.json | 1 - packages/yarnpkg-pnpify/package.json | 2 -- packages/yarnpkg-sdks/package.json | 2 -- packages/yarnpkg-shell/package.json | 1 - 33 files changed, 36 deletions(-) diff --git a/packages/plugin-compat/package.json b/packages/plugin-compat/package.json index ff92d21f6ef5..d3f6352b39a2 100644 --- a/packages/plugin-compat/package.json +++ b/packages/plugin-compat/package.json @@ -40,7 +40,6 @@ }, "publishConfig": { "main": "./lib/index.js", - "types": "./lib/index.d.ts", "exports": { ".": "./lib/index.js", "./package.json": "./package.json" diff --git a/packages/plugin-constraints/package.json b/packages/plugin-constraints/package.json index 89464b047cee..02f1b12120da 100644 --- a/packages/plugin-constraints/package.json +++ b/packages/plugin-constraints/package.json @@ -36,7 +36,6 @@ }, "publishConfig": { "main": "./lib/index.js", - "types": "./lib/index.d.ts", "exports": { ".": "./lib/index.js", "./package.json": "./package.json" diff --git a/packages/plugin-dlx/package.json b/packages/plugin-dlx/package.json index 356c32e8e500..b6fefefffc29 100644 --- a/packages/plugin-dlx/package.json +++ b/packages/plugin-dlx/package.json @@ -32,7 +32,6 @@ }, "publishConfig": { "main": "./lib/index.js", - "types": "./lib/index.d.ts", "exports": { ".": "./lib/index.js", "./package.json": "./package.json" diff --git a/packages/plugin-essentials/package.json b/packages/plugin-essentials/package.json index 32ca5a97ed9a..51679bbb6550 100644 --- a/packages/plugin-essentials/package.json +++ b/packages/plugin-essentials/package.json @@ -43,7 +43,6 @@ }, "publishConfig": { "main": "./lib/index.js", - "types": "./lib/index.d.ts", "exports": { ".": "./lib/index.js", "./package.json": "./package.json" diff --git a/packages/plugin-exec/package.json b/packages/plugin-exec/package.json index a703c1fdfa51..e62a4c8fd8e7 100644 --- a/packages/plugin-exec/package.json +++ b/packages/plugin-exec/package.json @@ -29,7 +29,6 @@ }, "publishConfig": { "main": "./lib/index.js", - "types": "./lib/index.d.ts", "exports": { ".": "./lib/index.js", "./package.json": "./package.json" diff --git a/packages/plugin-file/package.json b/packages/plugin-file/package.json index ec59fbe09731..8fdc9250d386 100644 --- a/packages/plugin-file/package.json +++ b/packages/plugin-file/package.json @@ -28,7 +28,6 @@ }, "publishConfig": { "main": "./lib/index.js", - "types": "./lib/index.d.ts", "exports": { ".": "./lib/index.js", "./package.json": "./package.json" diff --git a/packages/plugin-git/package.json b/packages/plugin-git/package.json index d5db13f4992e..1cd68235dd62 100644 --- a/packages/plugin-git/package.json +++ b/packages/plugin-git/package.json @@ -35,7 +35,6 @@ }, "publishConfig": { "main": "./lib/index.js", - "types": "./lib/index.d.ts", "exports": { ".": "./lib/index.js", "./package.json": "./package.json" diff --git a/packages/plugin-github/package.json b/packages/plugin-github/package.json index 44f323f2ce20..201f5f58b9c2 100644 --- a/packages/plugin-github/package.json +++ b/packages/plugin-github/package.json @@ -31,7 +31,6 @@ }, "publishConfig": { "main": "./lib/index.js", - "types": "./lib/index.d.ts", "exports": { ".": "./lib/index.js", "./package.json": "./package.json" diff --git a/packages/plugin-http/package.json b/packages/plugin-http/package.json index 0a74350622dd..1ca10debf851 100644 --- a/packages/plugin-http/package.json +++ b/packages/plugin-http/package.json @@ -27,7 +27,6 @@ }, "publishConfig": { "main": "./lib/index.js", - "types": "./lib/index.d.ts", "exports": { ".": "./lib/index.js", "./package.json": "./package.json" diff --git a/packages/plugin-init/package.json b/packages/plugin-init/package.json index 7e69580c1c4a..66c760837bab 100644 --- a/packages/plugin-init/package.json +++ b/packages/plugin-init/package.json @@ -31,7 +31,6 @@ }, "publishConfig": { "main": "./lib/index.js", - "types": "./lib/index.d.ts", "exports": { ".": "./lib/index.js", "./package.json": "./package.json" diff --git a/packages/plugin-interactive-tools/package.json b/packages/plugin-interactive-tools/package.json index 3b3a4fb3171d..d311d7509cb8 100644 --- a/packages/plugin-interactive-tools/package.json +++ b/packages/plugin-interactive-tools/package.json @@ -44,7 +44,6 @@ }, "publishConfig": { "main": "./lib/index.js", - "types": "./lib/index.d.ts", "exports": { ".": "./lib/index.js", "./package.json": "./package.json" diff --git a/packages/plugin-link/package.json b/packages/plugin-link/package.json index f47e0a78e767..ece1a1d3011b 100644 --- a/packages/plugin-link/package.json +++ b/packages/plugin-link/package.json @@ -28,7 +28,6 @@ }, "publishConfig": { "main": "./lib/index.js", - "types": "./lib/index.d.ts", "exports": { ".": "./lib/index.js", "./package.json": "./package.json" diff --git a/packages/plugin-nm/package.json b/packages/plugin-nm/package.json index 2c6412667492..e0cd5b2f0016 100644 --- a/packages/plugin-nm/package.json +++ b/packages/plugin-nm/package.json @@ -41,7 +41,6 @@ }, "publishConfig": { "main": "./lib/index.js", - "types": "./lib/index.d.ts", "exports": { ".": "./lib/index.js", "./package.json": "./package.json" diff --git a/packages/plugin-npm-cli/package.json b/packages/plugin-npm-cli/package.json index 0917b18bacfb..bff78382073a 100644 --- a/packages/plugin-npm-cli/package.json +++ b/packages/plugin-npm-cli/package.json @@ -42,7 +42,6 @@ }, "publishConfig": { "main": "./lib/index.js", - "types": "./lib/index.d.ts", "exports": { ".": "./lib/index.js", "./package.json": "./package.json" diff --git a/packages/plugin-npm/package.json b/packages/plugin-npm/package.json index 0eb74af33f5a..24321516db18 100644 --- a/packages/plugin-npm/package.json +++ b/packages/plugin-npm/package.json @@ -35,7 +35,6 @@ }, "publishConfig": { "main": "./lib/index.js", - "types": "./lib/index.d.ts", "exports": { ".": "./lib/index.js", "./package.json": "./package.json" diff --git a/packages/plugin-pack/package.json b/packages/plugin-pack/package.json index e49d57ee417c..d506a11d1966 100644 --- a/packages/plugin-pack/package.json +++ b/packages/plugin-pack/package.json @@ -36,7 +36,6 @@ }, "publishConfig": { "main": "./lib/index.js", - "types": "./lib/index.d.ts", "exports": { ".": "./lib/index.js", "./package.json": "./package.json" diff --git a/packages/plugin-patch/package.json b/packages/plugin-patch/package.json index 65a2a7e0633e..b41cf18fb69c 100644 --- a/packages/plugin-patch/package.json +++ b/packages/plugin-patch/package.json @@ -33,7 +33,6 @@ }, "publishConfig": { "main": "./lib/index.js", - "types": "./lib/index.d.ts", "exports": { ".": "./lib/index.js", "./package.json": "./package.json" diff --git a/packages/plugin-pnp/package.json b/packages/plugin-pnp/package.json index dfa1ff0e3cda..d09569bab0a5 100644 --- a/packages/plugin-pnp/package.json +++ b/packages/plugin-pnp/package.json @@ -38,7 +38,6 @@ }, "publishConfig": { "main": "./lib/index.js", - "types": "./lib/index.d.ts", "exports": { ".": "./lib/index.js", "./package.json": "./package.json" diff --git a/packages/plugin-pnpm/package.json b/packages/plugin-pnpm/package.json index 1028cc94bee9..fd13720a5d86 100644 --- a/packages/plugin-pnpm/package.json +++ b/packages/plugin-pnpm/package.json @@ -34,7 +34,6 @@ }, "publishConfig": { "main": "./lib/index.js", - "types": "./lib/index.d.ts", "exports": { ".": "./lib/index.js", "./package.json": "./package.json" diff --git a/packages/plugin-stage/package.json b/packages/plugin-stage/package.json index d178b6f1c717..48eb2e82c463 100644 --- a/packages/plugin-stage/package.json +++ b/packages/plugin-stage/package.json @@ -32,7 +32,6 @@ }, "publishConfig": { "main": "./lib/index.js", - "types": "./lib/index.d.ts", "exports": { ".": "./lib/index.js", "./package.json": "./package.json" diff --git a/packages/plugin-typescript/package.json b/packages/plugin-typescript/package.json index 169537b61f4b..78949f9e1f02 100644 --- a/packages/plugin-typescript/package.json +++ b/packages/plugin-typescript/package.json @@ -38,7 +38,6 @@ }, "publishConfig": { "main": "./lib/index.js", - "types": "./lib/index.d.ts", "exports": { ".": "./lib/index.js", "./package.json": "./package.json" diff --git a/packages/plugin-version/package.json b/packages/plugin-version/package.json index accc32cf6083..e416e046fba0 100644 --- a/packages/plugin-version/package.json +++ b/packages/plugin-version/package.json @@ -43,7 +43,6 @@ }, "publishConfig": { "main": "./lib/index.js", - "types": "./lib/index.d.ts", "exports": { ".": "./lib/index.js", "./package.json": "./package.json" diff --git a/packages/plugin-workspace-tools/package.json b/packages/plugin-workspace-tools/package.json index a6723493fecc..0112e7d4677c 100644 --- a/packages/plugin-workspace-tools/package.json +++ b/packages/plugin-workspace-tools/package.json @@ -39,7 +39,6 @@ }, "publishConfig": { "main": "./lib/index.js", - "types": "./lib/index.d.ts", "exports": { ".": "./lib/index.js", "./package.json": "./package.json" diff --git a/packages/yarnpkg-cli/package.json b/packages/yarnpkg-cli/package.json index b7df3c498263..e8e2c4c9dbba 100644 --- a/packages/yarnpkg-cli/package.json +++ b/packages/yarnpkg-cli/package.json @@ -64,7 +64,6 @@ }, "publishConfig": { "main": "./lib/index.js", - "types": "./lib/index.d.ts", "bin": null, "exports": { ".": "./lib/index.js", diff --git a/packages/yarnpkg-core/package.json b/packages/yarnpkg-core/package.json index 8e4116ae353c..68cc94f03db7 100644 --- a/packages/yarnpkg-core/package.json +++ b/packages/yarnpkg-core/package.json @@ -65,7 +65,6 @@ }, "publishConfig": { "main": "./lib/index.js", - "types": "./lib/index.d.ts", "exports": { ".": "./lib/index.js", "./package.json": "./package.json" diff --git a/packages/yarnpkg-extensions/package.json b/packages/yarnpkg-extensions/package.json index 2df2e2b206dc..7482685f0cce 100644 --- a/packages/yarnpkg-extensions/package.json +++ b/packages/yarnpkg-extensions/package.json @@ -25,7 +25,6 @@ }, "publishConfig": { "main": "./lib/index.js", - "types": "./lib/index.d.ts", "exports": { ".": "./lib/index.js", "./package.json": "./package.json" diff --git a/packages/yarnpkg-fslib/package.json b/packages/yarnpkg-fslib/package.json index 5acf34183034..345d3e38d8a5 100644 --- a/packages/yarnpkg-fslib/package.json +++ b/packages/yarnpkg-fslib/package.json @@ -22,7 +22,6 @@ }, "publishConfig": { "main": "./lib/index.js", - "types": "./lib/index.d.ts", "exports": { ".": "./lib/index.js", "./package.json": "./package.json" diff --git a/packages/yarnpkg-nm/package.json b/packages/yarnpkg-nm/package.json index 0683b0a078fd..760d5399554c 100644 --- a/packages/yarnpkg-nm/package.json +++ b/packages/yarnpkg-nm/package.json @@ -3,7 +3,6 @@ "version": "4.0.0-rc.18", "license": "BSD-2-Clause", "main": "./sources/index.ts", - "types": "./sources/index.ts", "exports": { ".": "./sources/index.ts", "./package.json": "./package.json" @@ -24,7 +23,6 @@ }, "publishConfig": { "main": "./lib/index.js", - "types": "./lib/index.d.ts", "exports": { ".": "./lib/index.js", "./package.json": "./package.json" diff --git a/packages/yarnpkg-parsers/package.json b/packages/yarnpkg-parsers/package.json index 8b2cf8af658e..583d5e180b9c 100644 --- a/packages/yarnpkg-parsers/package.json +++ b/packages/yarnpkg-parsers/package.json @@ -27,7 +27,6 @@ }, "publishConfig": { "main": "./lib/index.js", - "types": "./lib/index.d.ts", "exports": { ".": "./lib/index.js", "./package.json": "./package.json" diff --git a/packages/yarnpkg-pnp/package.json b/packages/yarnpkg-pnp/package.json index 800f379f687b..3aec9a564b15 100644 --- a/packages/yarnpkg-pnp/package.json +++ b/packages/yarnpkg-pnp/package.json @@ -34,7 +34,6 @@ }, "publishConfig": { "main": "./lib/index.js", - "types": "./lib/index.d.ts", "exports": { ".": "./lib/index.js", "./package.json": "./package.json" diff --git a/packages/yarnpkg-pnpify/package.json b/packages/yarnpkg-pnpify/package.json index 83a2224e865c..11ae20c52eec 100644 --- a/packages/yarnpkg-pnpify/package.json +++ b/packages/yarnpkg-pnpify/package.json @@ -5,7 +5,6 @@ "license": "BSD-2-Clause", "main": "./sources/index.ts", "bin": "./sources/boot-cli-dev.js", - "types": "./sources/index.ts", "exports": { ".": "./sources/index.ts", "./utils": "./sources/utils.ts", @@ -33,7 +32,6 @@ "publishConfig": { "main": "./lib/index.js", "bin": "./lib/cli.js", - "types": "./lib/index.d.ts", "exports": { ".": "./lib/index.js", "./utils": "./lib/utils.js", diff --git a/packages/yarnpkg-sdks/package.json b/packages/yarnpkg-sdks/package.json index 2343f1851dd1..d1334c33846b 100644 --- a/packages/yarnpkg-sdks/package.json +++ b/packages/yarnpkg-sdks/package.json @@ -4,7 +4,6 @@ "license": "BSD-2-Clause", "main": "./sources/index.ts", "bin": "./sources/boot-cli-dev.js", - "types": "./sources/index.ts", "exports": { ".": "./sources/index.ts", "./cli": "./sources/boot-cli-dev.js", @@ -35,7 +34,6 @@ "publishConfig": { "main": "./lib/index.js", "bin": "./lib/cli.js", - "types": "./lib/index.d.ts", "exports": { ".": "./lib/index.js", "./cli": "./lib/cli.js", diff --git a/packages/yarnpkg-shell/package.json b/packages/yarnpkg-shell/package.json index d3ba234bfbc0..d945df723904 100644 --- a/packages/yarnpkg-shell/package.json +++ b/packages/yarnpkg-shell/package.json @@ -35,7 +35,6 @@ "publishConfig": { "main": "./lib/index.js", "bin": "./lib/cli.js", - "types": "./lib/index.d.ts", "exports": { ".": "./lib/index.js", "./cli": "./lib/cli.js",