package/index.js 000644 0000004202 3560116604 010723 0 ustar 00 000000 000000 "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.resolvePackage = exports.readModulePackageJson = exports.createResolveLocationFn = exports.resolvePackageJsonLocation = exports.resolvePackageRoot = exports.resolvePackageCore = void 0; const upath2_1 = require("upath2"); const pkg_dir_1 = require("pkg-dir"); function resolvePackageCore(moduleName, options) { let entryPointLocation; try { entryPointLocation = require.resolve(moduleName, options); } catch (e) { entryPointLocation = require.resolve(moduleName + '/package.json', options); } const pkgRoot = (0, pkg_dir_1.sync)(entryPointLocation); return { name: moduleName, pkgRoot, entryPointLocation, }; } exports.resolvePackageCore = resolvePackageCore; function resolvePackageRoot(moduleName, options) { return resolvePackageCore(moduleName, options).pkgRoot; } exports.resolvePackageRoot = resolvePackageRoot; function resolvePackageJsonLocation(moduleName, options) { return (0, upath2_1.resolve)(resolvePackageCore(moduleName, options).pkgRoot, 'package.json'); } exports.resolvePackageJsonLocation = resolvePackageJsonLocation; function createResolveLocationFn(moduleName, options) { const { pkgRoot } = resolvePackageCore(moduleName, options); return (path, ...paths) => (0, upath2_1.resolve)(pkgRoot, path, ...paths); } exports.createResolveLocationFn = createResolveLocationFn; function readModulePackageJson(moduleName, options) { return require(resolvePackageJsonLocation(moduleName, options)); } exports.readModulePackageJson = readModulePackageJson; function resolvePackage(moduleName, options) { const _ = resolvePackageCore(moduleName, options); const { pkgRoot } = _; const pkgJsonLocation = (0, upath2_1.resolve)(pkgRoot, 'package.json'); return { ..._, pkg: require(pkgJsonLocation), pkgJsonLocation, resolveLocation(path, ...paths) { return (0, upath2_1.resolve)(pkgRoot, path, ...paths); }, }; } exports.resolvePackage = resolvePackage; exports.default = resolvePackage; //# sourceMappingURL=index.js.map package/package.json 000644 0000003636 3560116604 011556 0 ustar 00 000000 000000 { "name": "@yarn-tool/resolve-package", "version": "2.0.4", "description": "resolve package root and package.json paths , work on node 17 too", "keywords": [ "resolve", "package", "json", "root", "npm", "entry", "find", "up", "find-up", "findup", "look-up", "look", "file", "search", "match", "parent", "parents", "folder", "directory", "walk", "walking", "path" ], "homepage": "https://github.com/bluelovers/ws-yarn-workspaces/tree/master/packages/@yarn-tool/resolve-package#readme", "bugs": { "url": "https://github.com/bluelovers/ws-yarn-workspaces/issues" }, "repository": { "type": "git", "url": "git+https://github.com/bluelovers/ws-yarn-workspaces.git", "directory": "packages/@yarn-tool/resolve-package" }, "license": "ISC", "author": "", "main": "index.js", "scripts": { "coverage": "npx nyc yarn run test", "lint": "npx eslint **/*.ts", "test": "echo \"Error: no test specified\"", "test:jest": "jest --passWithNoTests", "test:jest:snapshot": "yarn run test:jest -- -u", "test:mocha": "npx mocha --require ts-node/register \"!(node_modules)/**/*.{test,spec}.{ts,tsx}\"", "test:snapshot": "yarn run test -- -u", "npm:publish": "npm publish", "preversion": "yarn run test", "prepublish:lockfile": "npx sync-lockfile .", "prepublishOnly": "echo prepublishOnly", "postpublish_": "git commit -m \"chore(release): publish\" .", "ncu": "npx yarn-tool ncu -u", "sort-package-json": "npx yarn-tool sort", "tsc:default": "tsc -p tsconfig.json", "tsc:esm": "tsc -p tsconfig.esm.json" }, "dependencies": { "pkg-dir": "<6 >=5", "tslib": ">=2", "upath2": "^3.1.15" }, "devDependencies": { "@ts-type/package-dts": "^2.0.5" }, "publishConfig": { "access": "public" }, "gitHead": "fccc2913440df31b04f2971e479fbe1d4c3a7a0c" } package/index.js.map 000644 0000006704 3560116604 011510 0 ustar 00 000000 000000 {"version":3,"file":"index.js","sourceRoot":"","sources":["index.ts"],"names":[],"mappings":";;;AAAA,mCAA0D;AAE1D,qCAAyC;AAUzC,SAAgB,kBAAkB,CAAC,UAAkB,EAAE,OAAkB;IAExE,IAAI,kBAA0B,CAAC;IAE/B,IACA;QACC,kBAAkB,GAAG,OAAO,CAAC,OAAO,CAAC,UAAU,EAAE,OAAO,CAAC,CAAC;KAC1D;IACD,OAAO,CAAC,EACR;QACC,kBAAkB,GAAG,OAAO,CAAC,OAAO,CAAC,UAAU,GAAG,eAAe,EAAE,OAAO,CAAC,CAAC;KAC5E;IAED,MAAM,OAAO,GAAG,IAAA,cAAM,EAAC,kBAAkB,CAAC,CAAC;IAE3C,OAAO;QACN,IAAI,EAAE,UAAU;QAChB,OAAO;QACP,kBAAkB;KAClB,CAAA;AACF,CAAC;AApBD,gDAoBC;AAED,SAAgB,kBAAkB,CAAC,UAAkB,EAAE,OAAkB;IAExE,OAAO,kBAAkB,CAAC,UAAU,EAAE,OAAO,CAAC,CAAC,OAAO,CAAA;AACvD,CAAC;AAHD,gDAGC;AAED,SAAgB,0BAA0B,CAAC,UAAkB,EAAE,OAAkB;IAEhF,OAAO,IAAA,gBAAO,EAAC,kBAAkB,CAAC,UAAU,EAAE,OAAO,CAAC,CAAC,OAAO,EAAE,cAAc,CAAC,CAAA;AAChF,CAAC;AAHD,gEAGC;AAED,SAAgB,uBAAuB,CAAC,UAAkB,EAAE,OAAkB;IAE7E,MAAM,EAAE,OAAO,EAAE,GAAG,kBAAkB,CAAC,UAAU,EAAE,OAAO,CAAC,CAAC;IAC5D,OAAO,CAAC,IAAY,EAAE,GAAG,KAAe,EAAE,EAAE,CAAC,IAAA,gBAAO,EAAC,OAAO,EAAE,IAAI,EAAE,GAAG,KAAK,CAAC,CAAA;AAC9E,CAAC;AAJD,0DAIC;AAED,SAAgB,qBAAqB,CAAyB,UAAkB,EAAE,OAAkB;IAEnG,OAAO,OAAO,CAAC,0BAA0B,CAAC,UAAU,EAAE,OAAO,CAAC,CAAC,CAAA;AAChE,CAAC;AAHD,sDAGC;AAED,SAAgB,cAAc,CAAyB,UAAkB,EAAE,OAAkB;IAE5F,MAAM,CAAC,GAAG,kBAAkB,CAAC,UAAU,EAAE,OAAO,CAAC,CAAC;IAClD,MAAM,EAAE,OAAO,EAAE,GAAG,CAAC,CAAC;IAEtB,MAAM,eAAe,GAAW,IAAA,gBAAO,EAAC,OAAO,EAAE,cAAc,CAAC,CAAC;IAEjE,OAAO;QACN,GAAG,CAAC;QACJ,GAAG,EAAE,OAAO,CAAC,eAAe,CAAa;QACzC,eAAe;QACf,eAAe,CAAC,IAAY,EAAE,GAAG,KAAe;YAE/C,OAAO,IAAA,gBAAO,EAAC,OAAO,EAAE,IAAI,EAAE,GAAG,KAAK,CAAC,CAAA;QACxC,CAAC;KACD,CAAA;AACF,CAAC;AAhBD,wCAgBC;AAED,kBAAe,cAAc,CAAA","sourcesContent":["import { dirname, normalize, sep, resolve } from 'upath2';\nimport type { IPackageJson } from '@ts-type/package-dts';\nimport { sync as pkgDir } from 'pkg-dir';\n\n/**\n * @see RequireResolve\n */\nexport interface IOptions\n{\n\tpaths?: string[];\n}\n\nexport function resolvePackageCore(moduleName: string, options?: IOptions)\n{\n\tlet entryPointLocation: string;\n\n\ttry\n\t{\n\t\tentryPointLocation = require.resolve(moduleName, options);\n\t}\n\tcatch (e)\n\t{\n\t\tentryPointLocation = require.resolve(moduleName + '/package.json', options);\n\t}\n\n\tconst pkgRoot = pkgDir(entryPointLocation);\n\n\treturn {\n\t\tname: moduleName,\n\t\tpkgRoot,\n\t\tentryPointLocation,\n\t}\n}\n\nexport function resolvePackageRoot(moduleName: string, options?: IOptions)\n{\n\treturn resolvePackageCore(moduleName, options).pkgRoot\n}\n\nexport function resolvePackageJsonLocation(moduleName: string, options?: IOptions)\n{\n\treturn resolve(resolvePackageCore(moduleName, options).pkgRoot, 'package.json')\n}\n\nexport function createResolveLocationFn(moduleName: string, options?: IOptions)\n{\n\tconst { pkgRoot } = resolvePackageCore(moduleName, options);\n\treturn (path: string, ...paths: string[]) => resolve(pkgRoot, path, ...paths)\n}\n\nexport function readModulePackageJson
(moduleName: string, options?: IOptions): P\n{\n\treturn require(resolvePackageJsonLocation(moduleName, options))\n}\n\nexport function resolvePackage
(moduleName: string, options?: IOptions)\n{\n\tconst _ = resolvePackageCore(moduleName, options);\n\tconst { pkgRoot } = _;\n\n\tconst pkgJsonLocation: string = resolve(pkgRoot, 'package.json');\n\n\treturn {\n\t\t..._,\n\t\tpkg: require(pkgJsonLocation) as any as P,\n\t\tpkgJsonLocation,\n\t\tresolveLocation(path: string, ...paths: string[])\n\t\t{\n\t\t\treturn resolve(pkgRoot, path, ...paths)\n\t\t},\n\t}\n}\n\nexport default resolvePackage\n"]} package/CHANGELOG.md 000644 0000040000 3560116604 011063 0 ustar 00 000000 000000 # Change Log All notable changes to this project will be documented in this file. See [Conventional Commits](https://conventionalcommits.org) for commit guidelines. ## [2.0.4](https://github.com/bluelovers/ws-yarn-workspaces/compare/@yarn-tool/resolve-package@2.0.3...@yarn-tool/resolve-package@2.0.4) (2022-09-06) ### 📚 Documentation * add directory ([442a552](https://github.com/bluelovers/ws-yarn-workspaces/commit/442a55232619f7fe2b9bad6f8eccfffc4f8f47d2)) ### 📌 Dependencies * update deps ([aeb5e41](https://github.com/bluelovers/ws-yarn-workspaces/commit/aeb5e416e8ea6c7d37ed7d38fedd6ff5c8c371df)) ### 🔖 Miscellaneous * . ([3a7fdc9](https://github.com/bluelovers/ws-yarn-workspaces/commit/3a7fdc924ada93b1d0ac0160f8d77e46ff060588)) ## [2.0.3](https://github.com/bluelovers/ws-yarn-workspaces/compare/@yarn-tool/resolve-package@2.0.2...@yarn-tool/resolve-package@2.0.3) (2022-08-26) ### 🔖 Miscellaneous * . ([157d5dc](https://github.com/bluelovers/ws-yarn-workspaces/commit/157d5dc8959261d9326f6e633987182898ae9670)) ## [2.0.2](https://github.com/bluelovers/ws-yarn-workspaces/compare/@yarn-tool/resolve-package@2.0.1...@yarn-tool/resolve-package@2.0.2) (2022-08-13) ### 💎 Styles * normalize deps semver ([245f3cf](https://github.com/bluelovers/ws-yarn-workspaces/commit/245f3cf34408c3c7e0628a6e18127122dd3e0f44)) ## [2.0.1](https://github.com/bluelovers/ws-yarn-workspaces/compare/@yarn-tool/resolve-package@2.0.0...@yarn-tool/resolve-package@2.0.1) (2022-08-13) ### 🚨 Tests * update jest.config.js and deps ([d1d501b](https://github.com/bluelovers/ws-yarn-workspaces/commit/d1d501ba059130bd8f90e6eaa266084110698011)) ### 📌 Dependencies * update deps ([58501f9](https://github.com/bluelovers/ws-yarn-workspaces/commit/58501f97494eb624779dffea7ac9d68e45e5e978)) * update deps ([c968045](https://github.com/bluelovers/ws-yarn-workspaces/commit/c96804598f63a5cd06507e3eaaa2e8b569b14b65)) * update deps ([a0b8755](https://github.com/bluelovers/ws-yarn-workspaces/commit/a0b875582efdc9829b0cdb6c9c819cace8b76e90)) # [2.0.0](https://github.com/bluelovers/ws-yarn-workspaces/compare/@yarn-tool/resolve-package@1.0.47...@yarn-tool/resolve-package@2.0.0) (2022-07-07) ### ♻️ Dependencies * update deps ([aff04a4](https://github.com/bluelovers/ws-yarn-workspaces/commit/aff04a47e24f963121cf893a03a5b92dfcb6b720)) ## [1.0.47](https://github.com/bluelovers/ws-yarn-workspaces/compare/@yarn-tool/resolve-package@1.0.46...@yarn-tool/resolve-package@1.0.47) (2022-05-11) ### ♻️ Chores * update deps ([6f226ac](https://github.com/bluelovers/ws-yarn-workspaces/commit/6f226acfd22f0b213eaa8a84886f8391284b1fcf)) ## [1.0.46](https://github.com/bluelovers/ws-yarn-workspaces/compare/@yarn-tool/resolve-package@1.0.45...@yarn-tool/resolve-package@1.0.46) (2022-03-14) **Note:** Version bump only for package @yarn-tool/resolve-package ## [1.0.45](https://github.com/bluelovers/ws-yarn-workspaces/compare/@yarn-tool/resolve-package@1.0.43...@yarn-tool/resolve-package@1.0.45) (2022-02-27) ### ♻️ Chores * **deps:** update deps ([109c9d1](https://github.com/bluelovers/ws-yarn-workspaces/commit/109c9d1b437063d069a9aaf5f5b9b15da4d5c76f)) ## [1.0.44](https://github.com/bluelovers/ws-yarn-workspaces/compare/@yarn-tool/resolve-package@1.0.43...@yarn-tool/resolve-package@1.0.44) (2022-02-27) ### ♻️ Chores * **deps:** update deps ([109c9d1](https://github.com/bluelovers/ws-yarn-workspaces/commit/109c9d1b437063d069a9aaf5f5b9b15da4d5c76f)) ## [1.0.43](https://github.com/bluelovers/ws-yarn-workspaces/compare/@yarn-tool/resolve-package@1.0.42...@yarn-tool/resolve-package@1.0.43) (2022-02-19) ### 🔖 Miscellaneous * Use `@types` packages as dev dependency ([37c495d](https://github.com/bluelovers/ws-yarn-workspaces/commit/37c495d4becddc788bd29e72e40a59a4fabcf7e3)) ## [1.0.42](https://github.com/bluelovers/ws-yarn-workspaces/compare/@yarn-tool/resolve-package@1.0.41...@yarn-tool/resolve-package@1.0.42) (2022-01-13) ### ♻️ Chores * **deps:** update deps ([7658604](https://github.com/bluelovers/ws-yarn-workspaces/commit/7658604e5cabfa61ed92c2579ecae3d37d3fd737)) ### 🔖 Miscellaneous * add `peerDependencies` to `@yarn-tool/resolve-package` ([16a5d39](https://github.com/bluelovers/ws-yarn-workspaces/commit/16a5d3909fff972c803dc25e4819c71eff53c00d)) ## [1.0.41](https://github.com/bluelovers/ws-yarn-workspaces/compare/@yarn-tool/resolve-package@1.0.40...@yarn-tool/resolve-package@1.0.41) (2021-12-31) ### 📦 Code Refactoring * code splitting ([3236306](https://github.com/bluelovers/ws-yarn-workspaces/commit/323630687dcfaa851cd65176d446d55f74a1dd3b)) ## [1.0.40](https://github.com/bluelovers/ws-yarn-workspaces/compare/@yarn-tool/resolve-package@1.0.39...@yarn-tool/resolve-package@1.0.40) (2021-12-06) ### ♻️ Chores * **deps:** update deps ([0377f3d](https://github.com/bluelovers/ws-yarn-workspaces/commit/0377f3da359fd07fb6cfaa86accaefaef993036c)) ## [1.0.39](https://github.com/bluelovers/ws-yarn-workspaces/compare/@yarn-tool/resolve-package@1.0.38...@yarn-tool/resolve-package@1.0.39) (2021-11-28) ### ♻️ Chores * **deps:** update deps ([35d2bc5](https://github.com/bluelovers/ws-yarn-workspaces/commit/35d2bc557a8f73fd8638b073dedc189e5423c52e)) ## [1.0.38](https://github.com/bluelovers/ws-yarn-workspaces/compare/@yarn-tool/resolve-package@1.0.37...@yarn-tool/resolve-package@1.0.38) (2021-11-23) ### 🐛 Bug Fixes * allow when entry file is not exists ([c0a2248](https://github.com/bluelovers/ws-yarn-workspaces/commit/c0a2248a0df93623a094ee41e765e611ae29397f)) ### ♻️ Chores * **deps:** update deps ([8d1f2fb](https://github.com/bluelovers/ws-yarn-workspaces/commit/8d1f2fbb2782cdcdcf72e56131ea047bc0c30298)) ### 🔖 Miscellaneous * update README.md ([89b5b2e](https://github.com/bluelovers/ws-yarn-workspaces/commit/89b5b2eb7dad4780971936171c732ff1fddd0ab0)) ## [1.0.37](https://github.com/bluelovers/ws-yarn-workspaces/compare/@yarn-tool/resolve-package@1.0.36...@yarn-tool/resolve-package@1.0.37) (2021-11-03) ### ✨ Features * split methods ([8c3871f](https://github.com/bluelovers/ws-yarn-workspaces/commit/8c3871f1c4a983d72b6a26bedc8e26bf323256d9)) ### BREAKING CHANGE * rename `pkgConfigLocation` => `pkgJsonLocation` ## [1.0.36](https://github.com/bluelovers/ws-yarn-workspaces/compare/@yarn-tool/resolve-package@1.0.35...@yarn-tool/resolve-package@1.0.36) (2021-11-03) ### 📦 Code Refactoring * avoid https://github.com/ezolenko/rollup-plugin-typescript2/issues/286 ([627d0cc](https://github.com/bluelovers/ws-yarn-workspaces/commit/627d0cc2a183a6be43a9d05c1ae6da3d8edd5e2e)) ## [1.0.35](https://github.com/bluelovers/ws-yarn-workspaces/compare/@yarn-tool/resolve-package@1.0.34...@yarn-tool/resolve-package@1.0.35) (2021-09-15) ### ♻️ Chores * **deps:** update deps ([21fdb59](https://github.com/bluelovers/ws-yarn-workspaces/commit/21fdb59f6c45c6beee68cd77259664b308fc7a38)) ## [1.0.34](https://github.com/bluelovers/ws-yarn-workspaces/compare/@yarn-tool/resolve-package@1.0.33...@yarn-tool/resolve-package@1.0.34) (2021-08-13) ### ♻️ Chores * **deps:** update deps ([cc53689](https://github.com/bluelovers/ws-yarn-workspaces/commit/cc53689dadd1334672807d4737c0e6400b15aba0)) ## [1.0.33](https://github.com/bluelovers/ws-yarn-workspaces/compare/@yarn-tool/resolve-package@1.0.32...@yarn-tool/resolve-package@1.0.33) (2021-07-23) ### ♻️ Chores * update deps ([e4d3819](https://github.com/bluelovers/ws-yarn-workspaces/commit/e4d3819baeacc944ddb39e3218f247edb17f0eb0)) ## [1.0.32](https://github.com/bluelovers/ws-yarn-workspaces/compare/@yarn-tool/resolve-package@1.0.30...@yarn-tool/resolve-package@1.0.32) (2021-07-16) ### ✨ Features * sort and update deps ([68b8088](https://github.com/bluelovers/ws-yarn-workspaces/commit/68b80888dade4eb368927afdd50066488014ecbd)) ### 🔖 Miscellaneous * . ([1ca3e67](https://github.com/bluelovers/ws-yarn-workspaces/commit/1ca3e671f12b47170bfdd2f38e9e515f3d63d961)) ## [1.0.31](https://github.com/bluelovers/ws-yarn-workspaces/compare/@yarn-tool/resolve-package@1.0.30...@yarn-tool/resolve-package@1.0.31) (2021-07-16) ### ✨ Features * sort and update deps ([68b8088](https://github.com/bluelovers/ws-yarn-workspaces/commit/68b80888dade4eb368927afdd50066488014ecbd)) ## [1.0.30](https://github.com/bluelovers/ws-yarn-workspaces/compare/@yarn-tool/resolve-package@1.0.28...@yarn-tool/resolve-package@1.0.30) (2021-07-11) ### 🛠 Build System * use tslib ([a172f5b](https://github.com/bluelovers/ws-yarn-workspaces/commit/a172f5b85b6b74256ebc8707435e0756adfd533a)) ### ♻️ Chores * **deps:** update deps ([c5a9fc4](https://github.com/bluelovers/ws-yarn-workspaces/commit/c5a9fc47e24cc599de16024f960b6dff12741d2f)) ### 🔖 Miscellaneous * . ([992892b](https://github.com/bluelovers/ws-yarn-workspaces/commit/992892bbf110cad2a8ee559521fc64506700e228)) ## [1.0.29](https://github.com/bluelovers/ws-yarn-workspaces/compare/@yarn-tool/resolve-package@1.0.28...@yarn-tool/resolve-package@1.0.29) (2021-07-11) ### 🛠 Build System * use tslib ([a172f5b](https://github.com/bluelovers/ws-yarn-workspaces/commit/a172f5b85b6b74256ebc8707435e0756adfd533a)) ### ♻️ Chores * **deps:** update deps ([c5a9fc4](https://github.com/bluelovers/ws-yarn-workspaces/commit/c5a9fc47e24cc599de16024f960b6dff12741d2f)) ## [1.0.28](https://github.com/bluelovers/ws-yarn-workspaces/compare/@yarn-tool/resolve-package@1.0.27...@yarn-tool/resolve-package@1.0.28) (2021-06-21) ### ♻️ Chores * **deps:** update deps ([32a3cff](https://github.com/bluelovers/ws-yarn-workspaces/commit/32a3cff85a28c9c7e26ab9e13860c025f9c32b1c)) ## [1.0.27](https://github.com/bluelovers/ws-yarn-workspaces/compare/@yarn-tool/resolve-package@1.0.26...@yarn-tool/resolve-package@1.0.27) (2021-06-02) ### ♻️ Chores * update deps ([4da6568](https://github.com/bluelovers/ws-yarn-workspaces/commit/4da65683a914d70a296533568d412df3f9a90e93)) ## [1.0.26](https://github.com/bluelovers/ws-yarn-workspaces/compare/@yarn-tool/resolve-package@1.0.25...@yarn-tool/resolve-package@1.0.26) (2021-02-12) ### ♻️ Chores * **deps:** update deps ([132ba9d](https://github.com/bluelovers/ws-yarn-workspaces/commit/132ba9d8373adf141fb1824ade9c252be9ee2fd9)) ## [1.0.25](https://github.com/bluelovers/ws-yarn-workspaces/compare/@yarn-tool/resolve-package@1.0.24...@yarn-tool/resolve-package@1.0.25) (2020-09-04) ### ♻️ Chores * **deps:** update deps ([34bfa51](https://github.com/bluelovers/ws-yarn-workspaces/commit/34bfa51ebe13e7d6b9289001c16cf3cfb33d477d)) ## [1.0.24](https://github.com/bluelovers/ws-yarn-workspaces/compare/@yarn-tool/resolve-package@1.0.23...@yarn-tool/resolve-package@1.0.24) (2020-08-09) ### ♻️ Chores * update deps ([51d69c2](https://github.com/bluelovers/ws-yarn-workspaces/commit/51d69c261f22c8b31b3a425a5ac5b3bfbc454310)) ## [1.0.23](https://github.com/bluelovers/ws-yarn-workspaces/compare/@yarn-tool/resolve-package@1.0.22...@yarn-tool/resolve-package@1.0.23) (2020-07-31) ### ♻️ Chores * update deps ([e51c85d](https://github.com/bluelovers/ws-yarn-workspaces/commit/e51c85d4bfa61af2686811b95502726bd48382c1)) ## [1.0.22](https://github.com/bluelovers/ws-yarn-workspaces/compare/@yarn-tool/resolve-package@1.0.21...@yarn-tool/resolve-package@1.0.22) (2020-07-28) ### ♻️ Chores * update deps ([a3e0d3b](https://github.com/bluelovers/ws-yarn-workspaces/commit/a3e0d3b656760823bbab877a61ac61ea3f8a00c5)) ## [1.0.21](https://github.com/bluelovers/ws-yarn-workspaces/compare/@yarn-tool/resolve-package@1.0.20...@yarn-tool/resolve-package@1.0.21) (2020-07-27) ### ♻️ Chores * update deps ([1364e2d](https://github.com/bluelovers/ws-yarn-workspaces/commit/1364e2dbef11e5ff81ac4f69b4fad219ecaf42fa)) ## [1.0.20](https://github.com/bluelovers/ws-yarn-workspaces/compare/@yarn-tool/resolve-package@1.0.19...@yarn-tool/resolve-package@1.0.20) (2020-07-26) ### ♻️ Chores * update deps ([4515021](https://github.com/bluelovers/ws-yarn-workspaces/commit/4515021e6d8f82a1d2fe9817c8f767def709e6eb)) ## [1.0.19](https://github.com/bluelovers/ws-yarn-workspaces/compare/@yarn-tool/resolve-package@1.0.18...@yarn-tool/resolve-package@1.0.19) (2020-07-24) ### ♻️ Chores * update deps ([77dd9df](https://github.com/bluelovers/ws-yarn-workspaces/commit/77dd9df0bda1c480c2910df46381b0bfb3b21871)) ## [1.0.18](https://github.com/bluelovers/ws-yarn-workspaces/compare/@yarn-tool/resolve-package@1.0.17...@yarn-tool/resolve-package@1.0.18) (2020-07-18) ### ♻️ Chores * update deps ([745269e](https://github.com/bluelovers/ws-yarn-workspaces/commit/745269e4d21dd25b298be7158ec7e87156c71976)) ## [1.0.17](https://github.com/bluelovers/ws-yarn-workspaces/compare/@yarn-tool/resolve-package@1.0.16...@yarn-tool/resolve-package@1.0.17) (2020-07-12) ### ♻️ Chores * update deps ([c0c96dc](https://github.com/bluelovers/ws-yarn-workspaces/commit/c0c96dcc7f9d6adc6cfd0b51e3cdcc03d75cf830)) ## [1.0.16](https://github.com/bluelovers/ws-yarn-workspaces/compare/@yarn-tool/resolve-package@1.0.15...@yarn-tool/resolve-package@1.0.16) (2020-07-05) ### ♻️ Chores * update deps ([cacabee](https://github.com/bluelovers/ws-yarn-workspaces/commit/cacabee52ec251987290f5c7c53cf474ceaae5b7)) ## [1.0.15](https://github.com/bluelovers/ws-yarn-workspaces/compare/@yarn-tool/resolve-package@1.0.14...@yarn-tool/resolve-package@1.0.15) (2020-06-27) ### ♻️ Chores * update deps ([e92cdb4](https://github.com/bluelovers/ws-yarn-workspaces/commit/e92cdb46b84fdf718a87731f4186e86cce78e216)) ## [1.0.14](https://github.com/bluelovers/ws-yarn-workspaces/compare/@yarn-tool/resolve-package@1.0.13...@yarn-tool/resolve-package@1.0.14) (2020-06-19) ### 🔖 Miscellaneous * . ([ea4320a](https://github.com/bluelovers/ws-yarn-workspaces/commit/ea4320a8885ccaa448e343856818d08cfc2f1992)) ## [1.0.13](https://github.com/bluelovers/ws-yarn-workspaces/compare/@yarn-tool/resolve-package@1.0.12...@yarn-tool/resolve-package@1.0.13) (2020-06-19) ### ♻️ Chores * **deps:** update deps ([9006155](https://github.com/bluelovers/ws-yarn-workspaces/commit/9006155c9ff4fb5367da3567456ae3b92bd3de30)) ## [1.0.12](https://github.com/bluelovers/ws-yarn-workspaces/compare/@yarn-tool/resolve-package@1.0.11...@yarn-tool/resolve-package@1.0.12) (2020-06-16) **Note:** Version bump only for package @yarn-tool/resolve-package ## [1.0.11](https://github.com/bluelovers/ws-yarn-workspaces/compare/@yarn-tool/resolve-package@1.0.10...@yarn-tool/resolve-package@1.0.11) (2020-06-13) **Note:** Version bump only for package @yarn-tool/resolve-package ## [1.0.10](https://github.com/bluelovers/ws-yarn-workspaces/compare/@yarn-tool/resolve-package@1.0.9...@yarn-tool/resolve-package@1.0.10) (2020-06-11) ### Bug Fixes * update @ts-type/package-dts ([b44d2aa](https://github.com/bluelovers/ws-yarn-workspaces/commit/b44d2aa80755e66f91cd9add9a420216d000a30e)) ## [1.0.9](https://github.com/bluelovers/ws-yarn-workspaces/compare/@yarn-tool/resolve-package@1.0.8...@yarn-tool/resolve-package@1.0.9) (2020-06-11) **Note:** Version bump only for package @yarn-tool/resolve-package ## [1.0.8](https://github.com/bluelovers/ws-yarn-workspaces/compare/@yarn-tool/resolve-package@1.0.7...@yarn-tool/resolve-package@1.0.8) (2020-06-11) ### Features * wrapDedupe ([d7e6ad8](https://github.com/bluelovers/ws-yarn-workspaces/commit/d7e6ad8479e712d4e9b5fb284dc177ece16a46bc)) ## [1.0.7](https://github.com/bluelovers/ws-yarn-workspaces/compare/@yarn-tool/resolve-package@1.0.6...@yarn-tool/resolve-package@1.0.7) (2020-06-09) **Note:** Version bump only for package @yarn-tool/resolve-package ## [1.0.6](https://github.com/bluelovers/ws-yarn-workspaces/compare/@yarn-tool/resolve-package@1.0.5...@yarn-tool/resolve-package@1.0.6) (2020-06-09) **Note:** Version bump only for package @yarn-tool/resolve-package ## [1.0.5](https://github.com/bluelovers/ws-yarn-workspaces/compare/@yarn-tool/resolve-package@1.0.4...@yarn-tool/resolve-package@1.0.5) (2020-06-06) **Note:** Version bump only for package @yarn-tool/resolve-package package/README.md 000644 0000000551 3560116604 010540 0 ustar 00 000000 000000 # README.md resolve package root and package.json paths , work on node 17 too ## install ```bash yarn add @yarn-tool/resolve-package yarn-tool add @yarn-tool/resolve-package yt add @yarn-tool/resolve-package ``` ```typescript import { resolvePackageJsonLocation } from '@yarn-tool/resolve-package' console.dir(resolvePackageJsonLocation('tslib')); ``` package/index.d.ts 000644 0000002041 3560116604 011156 0 ustar 00 000000 000000 import type { IPackageJson } from '@ts-type/package-dts'; /** * @see RequireResolve */ export interface IOptions { paths?: string[]; } export declare function resolvePackageCore(moduleName: string, options?: IOptions): { name: string; pkgRoot: string; entryPointLocation: string; }; export declare function resolvePackageRoot(moduleName: string, options?: IOptions): string; export declare function resolvePackageJsonLocation(moduleName: string, options?: IOptions): string; export declare function createResolveLocationFn(moduleName: string, options?: IOptions): (path: string, ...paths: string[]) => string; export declare function readModulePackageJson
(moduleName: string, options?: IOptions): P; export declare function resolvePackage
(moduleName: string, options?: IOptions): { pkg: P; pkgJsonLocation: string; resolveLocation(path: string, ...paths: string[]): string; name: string; pkgRoot: string; entryPointLocation: string; }; export default resolvePackage;