wexample-wex-addon-dev-javascript 8.13.10__tar.gz → 8.14.1__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {wexample_wex_addon_dev_javascript-8.13.10 → wexample_wex_addon_dev_javascript-8.14.1}/PKG-INFO +3 -3
- {wexample_wex_addon_dev_javascript-8.13.10 → wexample_wex_addon_dev_javascript-8.14.1}/README.md +1 -1
- {wexample_wex_addon_dev_javascript-8.13.10 → wexample_wex_addon_dev_javascript-8.14.1}/pyproject.toml +2 -2
- {wexample_wex_addon_dev_javascript-8.13.10 → wexample_wex_addon_dev_javascript-8.14.1}/src/wexample_wex_addon_dev_javascript/file/node_package_json_file.py +87 -27
- wexample_wex_addon_dev_javascript-8.14.1/tests/file/__init__.py +0 -0
- wexample_wex_addon_dev_javascript-8.14.1/tests/file/test_node_package_json_lock_off_registry.py +51 -0
- {wexample_wex_addon_dev_javascript-8.13.10 → wexample_wex_addon_dev_javascript-8.14.1}/src/wexample_wex_addon_dev_javascript/__init__.py +0 -0
- {wexample_wex_addon_dev_javascript-8.13.10 → wexample_wex_addon_dev_javascript-8.14.1}/src/wexample_wex_addon_dev_javascript/common/__init__.py +0 -0
- {wexample_wex_addon_dev_javascript-8.13.10 → wexample_wex_addon_dev_javascript-8.14.1}/src/wexample_wex_addon_dev_javascript/common/npm_registry_gateway.py +0 -0
- {wexample_wex_addon_dev_javascript-8.13.10 → wexample_wex_addon_dev_javascript-8.14.1}/src/wexample_wex_addon_dev_javascript/config_value/__init__.py +0 -0
- {wexample_wex_addon_dev_javascript-8.13.10 → wexample_wex_addon_dev_javascript-8.14.1}/src/wexample_wex_addon_dev_javascript/config_value/javascript_package_readme_config_value.py +0 -0
- {wexample_wex_addon_dev_javascript-8.13.10 → wexample_wex_addon_dev_javascript-8.14.1}/src/wexample_wex_addon_dev_javascript/const/__init__.py +0 -0
- {wexample_wex_addon_dev_javascript-8.13.10 → wexample_wex_addon_dev_javascript-8.14.1}/src/wexample_wex_addon_dev_javascript/const/registry.py +0 -0
- {wexample_wex_addon_dev_javascript-8.13.10 → wexample_wex_addon_dev_javascript-8.14.1}/src/wexample_wex_addon_dev_javascript/const/tags.py +0 -0
- {wexample_wex_addon_dev_javascript-8.13.10 → wexample_wex_addon_dev_javascript-8.14.1}/src/wexample_wex_addon_dev_javascript/file/__init__.py +0 -0
- {wexample_wex_addon_dev_javascript-8.13.10 → wexample_wex_addon_dev_javascript-8.14.1}/src/wexample_wex_addon_dev_javascript/file/javascript_package_json_file.py +0 -0
- {wexample_wex_addon_dev_javascript-8.13.10 → wexample_wex_addon_dev_javascript-8.14.1}/src/wexample_wex_addon_dev_javascript/file/javascript_package_lock_json_file.py +0 -0
- {wexample_wex_addon_dev_javascript-8.13.10 → wexample_wex_addon_dev_javascript-8.14.1}/src/wexample_wex_addon_dev_javascript/file/javascript_tsconfig_json_file.py +0 -0
- {wexample_wex_addon_dev_javascript-8.13.10 → wexample_wex_addon_dev_javascript-8.14.1}/src/wexample_wex_addon_dev_javascript/formatter/__init__.py +0 -0
- {wexample_wex_addon_dev_javascript-8.13.10 → wexample_wex_addon_dev_javascript-8.14.1}/src/wexample_wex_addon_dev_javascript/formatter/javascript_code_formatter.py +0 -0
- {wexample_wex_addon_dev_javascript-8.13.10 → wexample_wex_addon_dev_javascript-8.14.1}/src/wexample_wex_addon_dev_javascript/javascript_addon_manager.py +0 -0
- {wexample_wex_addon_dev_javascript-8.13.10 → wexample_wex_addon_dev_javascript-8.14.1}/src/wexample_wex_addon_dev_javascript/py.typed +0 -0
- {wexample_wex_addon_dev_javascript-8.13.10 → wexample_wex_addon_dev_javascript-8.14.1}/src/wexample_wex_addon_dev_javascript/resources/.wex.yml +0 -0
- {wexample_wex_addon_dev_javascript-8.13.10 → wexample_wex_addon_dev_javascript-8.14.1}/src/wexample_wex_addon_dev_javascript/resources/design_rules/javascript_code.md +0 -0
- {wexample_wex_addon_dev_javascript-8.13.10 → wexample_wex_addon_dev_javascript-8.14.1}/src/wexample_wex_addon_dev_javascript/resources/package_gitlab_ci.yml +0 -0
- {wexample_wex_addon_dev_javascript-8.13.10 → wexample_wex_addon_dev_javascript-8.14.1}/src/wexample_wex_addon_dev_javascript/resources/package_publish.yml +0 -0
- {wexample_wex_addon_dev_javascript-8.13.10 → wexample_wex_addon_dev_javascript-8.14.1}/src/wexample_wex_addon_dev_javascript/resources/writing_rules/javascript_code.md +0 -0
- {wexample_wex_addon_dev_javascript-8.13.10 → wexample_wex_addon_dev_javascript-8.14.1}/src/wexample_wex_addon_dev_javascript/services/__init__.py +0 -0
- {wexample_wex_addon_dev_javascript-8.13.10 → wexample_wex_addon_dev_javascript-8.14.1}/src/wexample_wex_addon_dev_javascript/services/node/__init__.py +0 -0
- {wexample_wex_addon_dev_javascript-8.13.10 → wexample_wex_addon_dev_javascript-8.14.1}/src/wexample_wex_addon_dev_javascript/services/node/commands/__init__.py +0 -0
- {wexample_wex_addon_dev_javascript-8.13.10 → wexample_wex_addon_dev_javascript-8.14.1}/src/wexample_wex_addon_dev_javascript/services/node/commands/service/__init__.py +0 -0
- {wexample_wex_addon_dev_javascript-8.13.10 → wexample_wex_addon_dev_javascript-8.14.1}/src/wexample_wex_addon_dev_javascript/services/node/commands/service/install_local.py +0 -0
- {wexample_wex_addon_dev_javascript-8.13.10 → wexample_wex_addon_dev_javascript-8.14.1}/src/wexample_wex_addon_dev_javascript/services/node/commands/service/refresh_lock.py +0 -0
- {wexample_wex_addon_dev_javascript-8.13.10 → wexample_wex_addon_dev_javascript-8.14.1}/src/wexample_wex_addon_dev_javascript/services/node/docker/.wex.yml +0 -0
- {wexample_wex_addon_dev_javascript-8.13.10 → wexample_wex_addon_dev_javascript-8.14.1}/src/wexample_wex_addon_dev_javascript/services/node/docker/docker-compose.yml +0 -0
- {wexample_wex_addon_dev_javascript-8.13.10 → wexample_wex_addon_dev_javascript-8.14.1}/src/wexample_wex_addon_dev_javascript/services/node/service.yml +0 -0
- {wexample_wex_addon_dev_javascript-8.13.10 → wexample_wex_addon_dev_javascript-8.14.1}/src/wexample_wex_addon_dev_javascript/services/vite/__init__.py +0 -0
- {wexample_wex_addon_dev_javascript-8.13.10 → wexample_wex_addon_dev_javascript-8.14.1}/src/wexample_wex_addon_dev_javascript/services/vite/ai/__init__.py +0 -0
- {wexample_wex_addon_dev_javascript-8.13.10 → wexample_wex_addon_dev_javascript-8.14.1}/src/wexample_wex_addon_dev_javascript/services/vite/ai/agents/__init__.py +0 -0
- {wexample_wex_addon_dev_javascript-8.13.10 → wexample_wex_addon_dev_javascript-8.14.1}/src/wexample_wex_addon_dev_javascript/services/vite/ai/agents/main/__init__.py +0 -0
- {wexample_wex_addon_dev_javascript-8.13.10 → wexample_wex_addon_dev_javascript-8.14.1}/src/wexample_wex_addon_dev_javascript/services/vite/ai/agents/main/about-service.md +0 -0
- {wexample_wex_addon_dev_javascript-8.13.10 → wexample_wex_addon_dev_javascript-8.14.1}/src/wexample_wex_addon_dev_javascript/services/vite/ai/agents/main/agent.yml +0 -0
- {wexample_wex_addon_dev_javascript-8.13.10 → wexample_wex_addon_dev_javascript-8.14.1}/src/wexample_wex_addon_dev_javascript/services/vite/app_service.py +0 -0
- {wexample_wex_addon_dev_javascript-8.13.10 → wexample_wex_addon_dev_javascript-8.14.1}/src/wexample_wex_addon_dev_javascript/services/vite/commands/__init__.py +0 -0
- {wexample_wex_addon_dev_javascript-8.13.10 → wexample_wex_addon_dev_javascript-8.14.1}/src/wexample_wex_addon_dev_javascript/services/vite/commands/service/__init__.py +0 -0
- {wexample_wex_addon_dev_javascript-8.13.10 → wexample_wex_addon_dev_javascript-8.14.1}/src/wexample_wex_addon_dev_javascript/services/vite/commands/service/install.py +0 -0
- {wexample_wex_addon_dev_javascript-8.13.10 → wexample_wex_addon_dev_javascript-8.14.1}/src/wexample_wex_addon_dev_javascript/services/vite/commands/service/ready.py +0 -0
- {wexample_wex_addon_dev_javascript-8.13.10 → wexample_wex_addon_dev_javascript-8.14.1}/src/wexample_wex_addon_dev_javascript/services/vite/docker/.wex.yml +0 -0
- {wexample_wex_addon_dev_javascript-8.13.10 → wexample_wex_addon_dev_javascript-8.14.1}/src/wexample_wex_addon_dev_javascript/services/vite/docker/docker-compose.yml +0 -0
- {wexample_wex_addon_dev_javascript-8.13.10 → wexample_wex_addon_dev_javascript-8.14.1}/src/wexample_wex_addon_dev_javascript/services/vite/service.yml +0 -0
- {wexample_wex_addon_dev_javascript-8.13.10 → wexample_wex_addon_dev_javascript-8.14.1}/src/wexample_wex_addon_dev_javascript/workdir/__init__.py +0 -0
- {wexample_wex_addon_dev_javascript-8.13.10 → wexample_wex_addon_dev_javascript-8.14.1}/src/wexample_wex_addon_dev_javascript/workdir/javascript_package_workdir.py +0 -0
- {wexample_wex_addon_dev_javascript-8.13.10 → wexample_wex_addon_dev_javascript-8.14.1}/src/wexample_wex_addon_dev_javascript/workdir/javascript_packages_suite_workdir.py +0 -0
- {wexample_wex_addon_dev_javascript-8.13.10 → wexample_wex_addon_dev_javascript-8.14.1}/src/wexample_wex_addon_dev_javascript/workdir/javascript_workdir.py +0 -0
- {wexample_wex_addon_dev_javascript-8.13.10 → wexample_wex_addon_dev_javascript-8.14.1}/tests/.gitkeep +0 -0
{wexample_wex_addon_dev_javascript-8.13.10 → wexample_wex_addon_dev_javascript-8.14.1}/PKG-INFO
RENAMED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.1
|
|
2
2
|
Name: wexample-wex-addon-dev-javascript
|
|
3
|
-
Version: 8.
|
|
3
|
+
Version: 8.14.1
|
|
4
4
|
Summary: Extends wex with JavaScript support: enforces JS/TS project layout and symlinks local npm packages into node_modules
|
|
5
5
|
Author-Email: weeger <contact@wexample.com>
|
|
6
6
|
License: MIT
|
|
@@ -14,7 +14,7 @@ Requires-Dist: cattrs>=23.1.0
|
|
|
14
14
|
Requires-Dist: wexample-api>=6.8.0
|
|
15
15
|
Requires-Dist: wexample-filestate-javascript>=6.8.0
|
|
16
16
|
Requires-Dist: wexample-wex-addon-ai>=19.1.0
|
|
17
|
-
Requires-Dist: wexample-wex-addon-app>=35.
|
|
17
|
+
Requires-Dist: wexample-wex-addon-app>=35.7.0
|
|
18
18
|
Provides-Extra: dev
|
|
19
19
|
Requires-Dist: pytest; extra == "dev"
|
|
20
20
|
Requires-Dist: pytest-cov; extra == "dev"
|
|
@@ -22,7 +22,7 @@ Description-Content-Type: text/markdown
|
|
|
22
22
|
|
|
23
23
|
# wex_addon_dev_javascript
|
|
24
24
|
|
|
25
|
-
Version: 8.
|
|
25
|
+
Version: 8.14.1
|
|
26
26
|
|
|
27
27
|
Extends wex with JavaScript support: enforces JS/TS project layout and symlinks local npm packages into node_modules
|
|
28
28
|
|
|
@@ -6,7 +6,7 @@ build-backend = "pdm.backend"
|
|
|
6
6
|
|
|
7
7
|
[project]
|
|
8
8
|
name = "wexample-wex-addon-dev-javascript"
|
|
9
|
-
version = "8.
|
|
9
|
+
version = "8.14.1"
|
|
10
10
|
description = "Extends wex with JavaScript support: enforces JS/TS project layout and symlinks local npm packages into node_modules"
|
|
11
11
|
authors = [
|
|
12
12
|
{ name = "weeger", email = "contact@wexample.com" },
|
|
@@ -23,7 +23,7 @@ dependencies = [
|
|
|
23
23
|
"wexample-api>=6.8.0",
|
|
24
24
|
"wexample-filestate-javascript>=6.8.0",
|
|
25
25
|
"wexample-wex-addon-ai>=19.1.0",
|
|
26
|
-
"wexample-wex-addon-app>=35.
|
|
26
|
+
"wexample-wex-addon-app>=35.7.0",
|
|
27
27
|
]
|
|
28
28
|
|
|
29
29
|
[project.readme]
|
|
@@ -19,6 +19,20 @@ class NodePackageJsonFile(AppDependenciesConfigFileMixin, JsonFile):
|
|
|
19
19
|
app manifest.
|
|
20
20
|
"""
|
|
21
21
|
|
|
22
|
+
@staticmethod
|
|
23
|
+
def _yarn_lock_block_names(block: str) -> set[str]:
|
|
24
|
+
"""The packages a yarn.lock entry is for, read off its header line:
|
|
25
|
+
`"@scope/name@^1", "@scope/name@>=1.2":`."""
|
|
26
|
+
header = next(
|
|
27
|
+
(line for line in block.splitlines() if line and not line.startswith(("#", " "))),
|
|
28
|
+
"",
|
|
29
|
+
)
|
|
30
|
+
return {
|
|
31
|
+
part.strip().strip('"').rsplit("@", 1)[0]
|
|
32
|
+
for part in header.rstrip(":").split(",")
|
|
33
|
+
if "@" in part.strip().strip('"')[1:]
|
|
34
|
+
}
|
|
35
|
+
|
|
22
36
|
def add_dependency(
|
|
23
37
|
self,
|
|
24
38
|
operator: str = "",
|
|
@@ -66,6 +80,20 @@ class NodePackageJsonFile(AppDependenciesConfigFileMixin, JsonFile):
|
|
|
66
80
|
|
|
67
81
|
return True
|
|
68
82
|
|
|
83
|
+
def forget_lock_entries(self, package_names: list[str]) -> None:
|
|
84
|
+
# Yarn classic keeps a locked package where it was resolved, whatever
|
|
85
|
+
# the .npmrc says now: only an entry it no longer has is resolved again.
|
|
86
|
+
lock = self.get_path().parent / "yarn.lock"
|
|
87
|
+
if not lock.is_file():
|
|
88
|
+
return
|
|
89
|
+
forgotten = set(package_names)
|
|
90
|
+
blocks = lock.read_text().split("\n\n")
|
|
91
|
+
lock.write_text(
|
|
92
|
+
"\n\n".join(
|
|
93
|
+
block for block in blocks if not self._yarn_lock_block_names(block) & forgotten
|
|
94
|
+
)
|
|
95
|
+
)
|
|
96
|
+
|
|
69
97
|
def get_dependencies_versions(
|
|
70
98
|
self, optional: bool = False, group: str = "dev"
|
|
71
99
|
) -> dict[str, str]:
|
|
@@ -79,24 +107,57 @@ class NodePackageJsonFile(AppDependenciesConfigFileMixin, JsonFile):
|
|
|
79
107
|
def get_dev_dependencies_versions(self) -> dict[str, str]:
|
|
80
108
|
return self.read_config().search(path="devDependencies").to_dict_or_none() or {}
|
|
81
109
|
|
|
82
|
-
def
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
110
|
+
def get_lock_entries_off_registry(self, package_names: list[str]) -> list[str]:
|
|
111
|
+
from urllib.parse import urlparse
|
|
112
|
+
|
|
113
|
+
lock = self.get_path().parent / "yarn.lock"
|
|
114
|
+
scopes = self._get_registry_scopes()
|
|
115
|
+
if not scopes or not lock.is_file():
|
|
116
|
+
return []
|
|
117
|
+
wanted = set(package_names)
|
|
118
|
+
off: set[str] = set()
|
|
119
|
+
for block in lock.read_text().split("\n\n"):
|
|
120
|
+
resolved = re.search(r'^\s+resolved\s+"([^"]+)"', block, re.M)
|
|
121
|
+
for name in self._yarn_lock_block_names(block) & wanted:
|
|
122
|
+
registry = scopes.get(name.split("/", 1)[0])
|
|
123
|
+
if (
|
|
124
|
+
registry
|
|
125
|
+
and resolved
|
|
126
|
+
and urlparse(resolved.group(1)).netloc != urlparse(registry).netloc
|
|
127
|
+
):
|
|
128
|
+
off.add(name)
|
|
129
|
+
return sorted(off)
|
|
130
|
+
|
|
131
|
+
def get_registry_version(self, package_name: str) -> str | None:
|
|
132
|
+
"""The latest version of a package of a scope the .npmrc beside this
|
|
133
|
+
manifest sends to a registry of ours (`@scope:registry=…`), read from
|
|
134
|
+
that registry; None when it serves none."""
|
|
86
135
|
import json
|
|
87
136
|
import urllib.error
|
|
88
137
|
import urllib.parse
|
|
89
138
|
import urllib.request
|
|
90
139
|
|
|
91
|
-
|
|
92
|
-
if not
|
|
140
|
+
registry = self._get_registry_scopes().get(package_name.split("/", 1)[0])
|
|
141
|
+
if not registry:
|
|
93
142
|
return None
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
143
|
+
try:
|
|
144
|
+
with urllib.request.urlopen(
|
|
145
|
+
urllib.request.Request(
|
|
146
|
+
registry + urllib.parse.quote(package_name, safe="@"),
|
|
147
|
+
headers=self._forge_headers(registry),
|
|
148
|
+
),
|
|
149
|
+
timeout=15,
|
|
150
|
+
) as answer:
|
|
151
|
+
return json.load(answer).get("dist-tags", {}).get("latest")
|
|
152
|
+
except urllib.error.HTTPError as error:
|
|
153
|
+
if error.code == 404:
|
|
154
|
+
return None
|
|
155
|
+
raise
|
|
156
|
+
|
|
157
|
+
def get_registry_versions(self) -> dict[str, str] | None:
|
|
158
|
+
"""The latest version of each dependency our registries serve.
|
|
159
|
+
Linked or local dependencies are not versions."""
|
|
160
|
+
if not self._get_registry_scopes():
|
|
100
161
|
return None
|
|
101
162
|
|
|
102
163
|
versions: dict[str, str] = {}
|
|
@@ -105,22 +166,9 @@ class NodePackageJsonFile(AppDependenciesConfigFileMixin, JsonFile):
|
|
|
105
166
|
**self.get_dev_dependencies_versions(),
|
|
106
167
|
}
|
|
107
168
|
for name, specifier in dependencies.items():
|
|
108
|
-
|
|
109
|
-
if not registry or re.match(r"^(link|file|portal|workspace):", specifier):
|
|
169
|
+
if re.match(r"^(link|file|portal|workspace):", specifier):
|
|
110
170
|
continue
|
|
111
|
-
|
|
112
|
-
with urllib.request.urlopen(
|
|
113
|
-
urllib.request.Request(
|
|
114
|
-
registry + urllib.parse.quote(name, safe="@"),
|
|
115
|
-
headers=self._forge_headers(registry),
|
|
116
|
-
),
|
|
117
|
-
timeout=15,
|
|
118
|
-
) as answer:
|
|
119
|
-
latest = json.load(answer).get("dist-tags", {}).get("latest")
|
|
120
|
-
except urllib.error.HTTPError as error:
|
|
121
|
-
if error.code == 404:
|
|
122
|
-
continue
|
|
123
|
-
raise
|
|
171
|
+
latest = self.get_registry_version(name)
|
|
124
172
|
if latest:
|
|
125
173
|
versions[name] = latest
|
|
126
174
|
return versions
|
|
@@ -144,3 +192,15 @@ class NodePackageJsonFile(AppDependenciesConfigFileMixin, JsonFile):
|
|
|
144
192
|
if token and match and urlparse(url).hostname == match.group(1):
|
|
145
193
|
return {"Authorization": f"Bearer {token}"}
|
|
146
194
|
return {}
|
|
195
|
+
|
|
196
|
+
def _get_registry_scopes(self) -> dict[str, str]:
|
|
197
|
+
"""The registry of ours each scope goes to, per the .npmrc beside
|
|
198
|
+
this manifest (`@scope:registry=…`)."""
|
|
199
|
+
npmrc = self.get_path().parent / ".npmrc"
|
|
200
|
+
scopes: dict[str, str] = {}
|
|
201
|
+
if npmrc.is_file():
|
|
202
|
+
for line in npmrc.read_text().splitlines():
|
|
203
|
+
match = re.match(r"^\s*(@[^:\s]+):registry\s*=\s*(\S+)", line)
|
|
204
|
+
if match:
|
|
205
|
+
scopes[match.group(1)] = match.group(2).rstrip("/") + "/"
|
|
206
|
+
return scopes
|
|
File without changes
|
wexample_wex_addon_dev_javascript-8.14.1/tests/file/test_node_package_json_lock_off_registry.py
ADDED
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
from __future__ import annotations
|
|
2
|
+
|
|
3
|
+
from types import SimpleNamespace
|
|
4
|
+
|
|
5
|
+
from wexample_wex_addon_dev_javascript.file.node_package_json_file import (
|
|
6
|
+
NodePackageJsonFile,
|
|
7
|
+
)
|
|
8
|
+
|
|
9
|
+
LOCK = '''# THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY.
|
|
10
|
+
# yarn lockfile v1
|
|
11
|
+
|
|
12
|
+
|
|
13
|
+
"@acme/date@>=2.0.0", "@acme/date@^2.0.1":
|
|
14
|
+
version "2.0.1"
|
|
15
|
+
resolved "https://gitlab.example.com/api/v4/projects/7/packages/npm/@acme/date/-/@acme/date-2.0.1.tgz#aa"
|
|
16
|
+
|
|
17
|
+
"@acme/helpers@>=5.0.0":
|
|
18
|
+
version "5.0.6"
|
|
19
|
+
resolved "https://registry.yarnpkg.com/@acme/helpers/-/helpers-5.0.6.tgz#bb"
|
|
20
|
+
|
|
21
|
+
lodash@^4.17.0:
|
|
22
|
+
version "4.17.21"
|
|
23
|
+
resolved "https://registry.yarnpkg.com/lodash/-/lodash-4.17.21.tgz#cc"
|
|
24
|
+
'''
|
|
25
|
+
|
|
26
|
+
|
|
27
|
+
def test_a_scoped_package_resolved_from_npmjs_is_off_registry(tmp_path) -> None:
|
|
28
|
+
manifest = _manifest(tmp_path)
|
|
29
|
+
assert NodePackageJsonFile.get_lock_entries_off_registry(
|
|
30
|
+
manifest, ["@acme/date", "@acme/helpers"]
|
|
31
|
+
) == ["@acme/helpers"]
|
|
32
|
+
|
|
33
|
+
|
|
34
|
+
def test_forgetting_drops_the_entry_and_keeps_the_rest(tmp_path) -> None:
|
|
35
|
+
manifest = _manifest(tmp_path)
|
|
36
|
+
NodePackageJsonFile.forget_lock_entries(manifest, ["@acme/helpers"])
|
|
37
|
+
lock = (tmp_path / "yarn.lock").read_text()
|
|
38
|
+
assert "@acme/helpers" not in lock
|
|
39
|
+
assert '"@acme/date@>=2.0.0"' in lock and "lodash@^4.17.0:" in lock
|
|
40
|
+
assert lock.startswith("# THIS IS AN AUTOGENERATED FILE")
|
|
41
|
+
|
|
42
|
+
|
|
43
|
+
def _manifest(tmp_path) -> SimpleNamespace:
|
|
44
|
+
(tmp_path / "yarn.lock").write_text(LOCK)
|
|
45
|
+
(tmp_path / ".npmrc").write_text(
|
|
46
|
+
"@acme:registry=https://gitlab.example.com/api/v4/groups/acme/-/packages/npm/\n"
|
|
47
|
+
)
|
|
48
|
+
manifest = SimpleNamespace(get_path=lambda: tmp_path / "package.json")
|
|
49
|
+
manifest._get_registry_scopes = lambda: NodePackageJsonFile._get_registry_scopes(manifest)
|
|
50
|
+
manifest._yarn_lock_block_names = NodePackageJsonFile._yarn_lock_block_names
|
|
51
|
+
return manifest
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|