diff options
author | khoden <khoden@yandex-team.com> | 2024-12-11 20:01:09 +0300 |
---|---|---|
committer | khoden <khoden@yandex-team.com> | 2024-12-11 20:51:56 +0300 |
commit | 33b2328129ae04e3fb67acc7ead17bb3eaff34f4 (patch) | |
tree | f56671fb08f14e824b2d40026f335e4fe7174c56 /build | |
parent | 94ab0c6de193610cab2990bdc4bcbeb8befbae43 (diff) | |
download | ydb-33b2328129ae04e3fb67acc7ead17bb3eaff34f4.tar.gz |
nots/*: Поддержка пиров из pnpm.overrides (Experiment)
Конфигурирование, сборка, последующая работа показывает, что все работает, как задумано (в этом конкретном кейсе точно).
```
~/arcadia/devtools/dummy_arcadia/typescript/pnpm_overrides -nots-support-pnpm-overrides took 3s
at 15:29:04 f ❯ notsl build -- -n
Building devtools/dummy_arcadia/typescript/pnpm_overrides…
Warn[-WUserWarn]: in $S/devtools/frontend_build_platform/nots/builder/ya.make: Using branch nots/builder
Ok
~/arcadia/devtools/dummy_arcadia/typescript/pnpm_overrides -nots-support-pnpm-overrides took 6s
at 15:30:05 f ❯ notsl start
> @yandex-int/pnpm-overrides-demo@ start /Users/khoden/arcadia/devtools/dummy_arcadia/typescript/pnpm_overrides
> ya tool nots node build/index.js
from fake_lodash
Previous line should be 'from fake_lodash'
```
commit_hash:650c69f1fe38483cda5922ecd8cd813fffdf5bcd
Diffstat (limited to 'build')
-rw-r--r-- | build/plugins/lib/nots/package_manager/base/package_json.py | 13 |
1 files changed, 9 insertions, 4 deletions
diff --git a/build/plugins/lib/nots/package_manager/base/package_json.py b/build/plugins/lib/nots/package_manager/base/package_json.py index 4fcb22e3ca..3840657992 100644 --- a/build/plugins/lib/nots/package_manager/base/package_json.py +++ b/build/plugins/lib/nots/package_manager/base/package_json.py @@ -1,9 +1,9 @@ import json +import logging import os from six import iteritems -import logging from .utils import build_pj_path @@ -19,7 +19,8 @@ class PackageJson(object): DEV_DEP_KEY = "devDependencies" PEER_DEP_KEY = "peerDependencies" OPT_DEP_KEY = "optionalDependencies" - DEP_KEYS = (DEP_KEY, DEV_DEP_KEY, PEER_DEP_KEY, OPT_DEP_KEY) + PNPM_OVERRIDES_KEY = "pnpm.overrides" + DEP_KEYS = (DEP_KEY, DEV_DEP_KEY, PEER_DEP_KEY, OPT_DEP_KEY, PNPM_OVERRIDES_KEY) WORKSPACE_SCHEMA = "workspace:" @@ -93,12 +94,16 @@ class PackageJson(object): def dependencies_iter(self): for key in self.DEP_KEYS: - deps = self.data.get(key) + if key == self.PNPM_OVERRIDES_KEY: + deps = self.data.get("pnpm", {}).get("overrides", {}) + else: + deps = self.data.get(key) + if not deps: continue for name, spec in iteritems(deps): - yield (name, spec) + yield name, spec def has_dependencies(self): first_dep = next(self.dependencies_iter(), None) |