wexample-wex-addon-dev-javascript 8.0.0__py3-none-any.whl → 8.1.1__py3-none-any.whl
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/config_value/javascript_package_readme_config_value.py +5 -2
- wexample_wex_addon_dev_javascript/formatter/__init__.py +0 -0
- wexample_wex_addon_dev_javascript/formatter/javascript_code_formatter.py +43 -0
- wexample_wex_addon_dev_javascript/javascript_addon_manager.py +32 -2
- wexample_wex_addon_dev_javascript/resources/design_rules/javascript_code.md +17 -0
- wexample_wex_addon_dev_javascript/resources/writing_rules/javascript_code.md +26 -0
- wexample_wex_addon_dev_javascript/services/node/commands/service/refresh_lock.py +7 -2
- wexample_wex_addon_dev_javascript-8.1.1.dist-info/METADATA +309 -0
- {wexample_wex_addon_dev_javascript-8.0.0.dist-info → wexample_wex_addon_dev_javascript-8.1.1.dist-info}/RECORD +11 -7
- wexample_wex_addon_dev_javascript-8.0.0.dist-info/METADATA +0 -475
- {wexample_wex_addon_dev_javascript-8.0.0.dist-info → wexample_wex_addon_dev_javascript-8.1.1.dist-info}/WHEEL +0 -0
- {wexample_wex_addon_dev_javascript-8.0.0.dist-info → wexample_wex_addon_dev_javascript-8.1.1.dist-info}/entry_points.txt +0 -0
|
@@ -10,5 +10,8 @@ from wexample_wex_addon_app.config_value.app_readme_config_value import (
|
|
|
10
10
|
class JavascriptPackageReadmeContentConfigValue(AppReadmeConfigValue):
|
|
11
11
|
"""README generation for Javascript packages."""
|
|
12
12
|
|
|
13
|
-
def _get_app_description(self) -> str:
|
|
14
|
-
return
|
|
13
|
+
def _get_app_description(self) -> str | None:
|
|
14
|
+
return (
|
|
15
|
+
self.workdir.get_app_config().get("description")
|
|
16
|
+
or super()._get_app_description()
|
|
17
|
+
)
|
|
File without changes
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
from __future__ import annotations
|
|
2
|
+
|
|
3
|
+
from typing import TYPE_CHECKING, ClassVar
|
|
4
|
+
|
|
5
|
+
from wexample_helpers.decorator.base_class import base_class
|
|
6
|
+
from wexample_wex_addon_ai.formatter.abstract_formatter import AbstractFormatter
|
|
7
|
+
|
|
8
|
+
if TYPE_CHECKING:
|
|
9
|
+
from pathlib import Path
|
|
10
|
+
|
|
11
|
+
|
|
12
|
+
@base_class
|
|
13
|
+
class JavascriptCodeFormatter(AbstractFormatter):
|
|
14
|
+
"""TypeScript and JavaScript shipped by an npm package, under its `src/`.
|
|
15
|
+
|
|
16
|
+
Covers both extensions because the packages are TypeScript sources published as
|
|
17
|
+
ESM, and a `.js` under `src/` is the same code with the types left out. Build
|
|
18
|
+
output, tests and config files answer elsewhere.
|
|
19
|
+
"""
|
|
20
|
+
|
|
21
|
+
FORMATTER_NAME: ClassVar[str] = "javascript-code"
|
|
22
|
+
SOURCE_SUFFIXES: ClassVar[set[str]] = {".ts", ".tsx", ".js", ".jsx", ".mts", ".cts"}
|
|
23
|
+
|
|
24
|
+
def get_design_rules(self) -> str:
|
|
25
|
+
return self.read_resource("design_rules", "javascript_code.md")
|
|
26
|
+
|
|
27
|
+
def get_writing_rules(self) -> str:
|
|
28
|
+
return self.read_resource("writing_rules", "javascript_code.md")
|
|
29
|
+
|
|
30
|
+
def matches_path(self, path: Path) -> bool:
|
|
31
|
+
"""A source file under the `src/` of a directory holding a `package.json`.
|
|
32
|
+
|
|
33
|
+
`node_modules` is excluded outright: every dependency in it carries its own
|
|
34
|
+
`package.json` and would otherwise match exactly like the package that
|
|
35
|
+
installed it.
|
|
36
|
+
"""
|
|
37
|
+
if path.suffix not in self.SOURCE_SUFFIXES or "node_modules" in path.parts:
|
|
38
|
+
return False
|
|
39
|
+
|
|
40
|
+
for parent in path.parents:
|
|
41
|
+
if parent.name == "src" and (parent.parent / "package.json").exists():
|
|
42
|
+
return True
|
|
43
|
+
return False
|
|
@@ -1,7 +1,37 @@
|
|
|
1
1
|
from __future__ import annotations
|
|
2
2
|
|
|
3
|
+
from typing import TYPE_CHECKING
|
|
4
|
+
|
|
5
|
+
from wexample_wex_addon_ai.formatter.formatter_contributing_addon_mixin import (
|
|
6
|
+
FormatterContributingAddonMixin,
|
|
7
|
+
)
|
|
3
8
|
from wexample_wex_core.common.abstract_addon_manager import AbstractAddonManager
|
|
4
9
|
|
|
10
|
+
if TYPE_CHECKING:
|
|
11
|
+
from wexample_wex_addon_ai.formatter.abstract_formatter import AbstractFormatter
|
|
12
|
+
|
|
13
|
+
|
|
14
|
+
class JavascriptAddonManager(FormatterContributingAddonMixin, AbstractAddonManager):
|
|
15
|
+
def get_formatter_classes(self) -> list[type[AbstractFormatter]]:
|
|
16
|
+
from wexample_wex_addon_dev_javascript.formatter.javascript_code_formatter import (
|
|
17
|
+
JavascriptCodeFormatter,
|
|
18
|
+
)
|
|
19
|
+
|
|
20
|
+
return [JavascriptCodeFormatter]
|
|
21
|
+
|
|
22
|
+
def get_workdir_types(self) -> dict[str, type]:
|
|
23
|
+
from wexample_wex_addon_dev_javascript.workdir.javascript_package_workdir import (
|
|
24
|
+
JavascriptPackageWorkdir,
|
|
25
|
+
)
|
|
26
|
+
from wexample_wex_addon_dev_javascript.workdir.javascript_packages_suite_workdir import (
|
|
27
|
+
JavascriptPackagesSuiteWorkdir,
|
|
28
|
+
)
|
|
29
|
+
from wexample_wex_addon_dev_javascript.workdir.javascript_workdir import (
|
|
30
|
+
JavascriptWorkdir,
|
|
31
|
+
)
|
|
5
32
|
|
|
6
|
-
|
|
7
|
-
|
|
33
|
+
return {
|
|
34
|
+
"javascript": JavascriptWorkdir,
|
|
35
|
+
"javascript-package": JavascriptPackageWorkdir,
|
|
36
|
+
"javascript-packages-suite": JavascriptPackagesSuiteWorkdir,
|
|
37
|
+
}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
This file is design rules for TypeScript shipped by an npm package, under its `src/`.
|
|
2
|
+
Decide the layout below before opening an editor — by the time a file is being written,
|
|
3
|
+
its path is already a decision made.
|
|
4
|
+
|
|
5
|
+
- One class per file, one file per class, and the file name is the class name in
|
|
6
|
+
PascalCase — `Common/AsyncConstructor.ts` holds `AsyncConstructor` and nothing else.
|
|
7
|
+
The class is the file's `export default`.
|
|
8
|
+
- Helper functions are grouped by the type they act on, one file per type, named after
|
|
9
|
+
it: `Helper/Array.ts`, `Helper/String.ts`, `Helper/Dom.ts`. They are named exports,
|
|
10
|
+
never a default, and each name is prefixed with the file's subject —
|
|
11
|
+
`arrayShallowCopy`, `stringToKebabCase`. The prefix is what makes the import readable
|
|
12
|
+
at the call site, where the file name is no longer visible.
|
|
13
|
+
- Kinds live apart, each in its own directory under `src/`: classes in `Common/`, helper
|
|
14
|
+
functions in `Helper/`. A class dropped next to the helpers because it serves them is
|
|
15
|
+
the case to move.
|
|
16
|
+
- No barrel files. Import from the module that defines the symbol, so that a consumer
|
|
17
|
+
bundling one helper does not pull the package in.
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
This file is TypeScript shipped by an npm package, under its `src/`. The file's path is
|
|
2
|
+
already decided by the time these rules apply — see
|
|
3
|
+
`ai::design/rules --formatter javascript-code` for the layout decisions that come before
|
|
4
|
+
it.
|
|
5
|
+
|
|
6
|
+
- Code, names, comments and doc comments are in English, whatever language the
|
|
7
|
+
conversation is held in.
|
|
8
|
+
- Relative imports carry the `.js` extension even though the source is `.ts` —
|
|
9
|
+
`import { functionIsType } from '../Helper/Function.js'`. The packages publish native
|
|
10
|
+
ESM, where the specifier is resolved as written at runtime and an extensionless path
|
|
11
|
+
has nothing to resolve.
|
|
12
|
+
- The packages compile under `strict`, so every parameter and every return is typed, and
|
|
13
|
+
`any` is a decision to justify rather than a default. Prefer a generic that keeps the
|
|
14
|
+
caller's type (`<T>(array: T[]): T[]`) over widening to `unknown[]` and casting back.
|
|
15
|
+
- A `try` is occasional and justified: it catches a failure somewhere that knows what to do
|
|
16
|
+
about it. Wrapping a call defensively, or writing a `catch` that swallows and a `finally`
|
|
17
|
+
that lets the failure pass, turns a bug into a wrong result reported nowhere. Let it
|
|
18
|
+
throw — a stack trace at the point of failure is worth more than a silent fallback
|
|
19
|
+
discovered three layers later.
|
|
20
|
+
- Defensive code goes the same way: a guard against a state that cannot happen, a `typeof`
|
|
21
|
+
check on something the type already guarantees, a `?.` or `|| fallback` on a value that
|
|
22
|
+
is never missing. Validate at the boundary — user input, an external API, a parsed
|
|
23
|
+
payload — and trust what our own code hands you.
|
|
24
|
+
- Comment only what the code cannot say: a constraint, an invariant, the reason a
|
|
25
|
+
surprising line is the way it is. A comment that no longer matches the code it
|
|
26
|
+
describes is deleted, not updated around.
|
|
@@ -20,7 +20,8 @@ if TYPE_CHECKING:
|
|
|
20
20
|
@option(
|
|
21
21
|
name="npm_packages",
|
|
22
22
|
type=str,
|
|
23
|
-
required=
|
|
23
|
+
required=False,
|
|
24
|
+
default="",
|
|
24
25
|
description="Space-separated npm package names whose constraint changed in package.json",
|
|
25
26
|
)
|
|
26
27
|
@command(
|
|
@@ -38,7 +39,7 @@ if TYPE_CHECKING:
|
|
|
38
39
|
def node__service__refresh_lock(
|
|
39
40
|
context: ExecutionContext,
|
|
40
41
|
service: AppService,
|
|
41
|
-
npm_packages: str,
|
|
42
|
+
npm_packages: str = "",
|
|
42
43
|
) -> None:
|
|
43
44
|
"""Generic javascript lock refresh, reusable by any service whose
|
|
44
45
|
container runs the app's javascript toolchain.
|
|
@@ -47,6 +48,10 @@ def node__service__refresh_lock(
|
|
|
47
48
|
Yarn classic has no lock-only mode, so node_modules is (re)installed
|
|
48
49
|
along the way — harmless inside the app container.
|
|
49
50
|
"""
|
|
51
|
+
# The hook reaches every service, carrying only the manifests that moved.
|
|
52
|
+
if not npm_packages:
|
|
53
|
+
return
|
|
54
|
+
|
|
50
55
|
script = f"""
|
|
51
56
|
set -e
|
|
52
57
|
cd {APP_DIR}
|
|
@@ -0,0 +1,309 @@
|
|
|
1
|
+
Metadata-Version: 2.1
|
|
2
|
+
Name: wexample-wex-addon-dev-javascript
|
|
3
|
+
Version: 8.1.1
|
|
4
|
+
Summary: Extends wex with JavaScript support: enforces JS/TS project layout and symlinks local npm packages into node_modules
|
|
5
|
+
Author-Email: weeger <contact@wexample.com>
|
|
6
|
+
License: MIT
|
|
7
|
+
Classifier: Programming Language :: Python :: 3
|
|
8
|
+
Classifier: License :: OSI Approved :: MIT License
|
|
9
|
+
Classifier: Operating System :: OS Independent
|
|
10
|
+
Project-URL: homepage, https://github.com/wexample/python-wex-dev-python
|
|
11
|
+
Requires-Python: >=3.10
|
|
12
|
+
Requires-Dist: attrs>=23.1.0
|
|
13
|
+
Requires-Dist: cattrs>=23.1.0
|
|
14
|
+
Requires-Dist: wexample-api>=6.8.0
|
|
15
|
+
Requires-Dist: wexample-filestate-javascript>=6.6.0
|
|
16
|
+
Requires-Dist: wexample-wex-addon-ai>=14.0.0
|
|
17
|
+
Requires-Dist: wexample-wex-addon-app>=31.0.0
|
|
18
|
+
Provides-Extra: dev
|
|
19
|
+
Requires-Dist: pytest; extra == "dev"
|
|
20
|
+
Requires-Dist: pytest-cov; extra == "dev"
|
|
21
|
+
Description-Content-Type: text/markdown
|
|
22
|
+
|
|
23
|
+
# wex_addon_dev_javascript
|
|
24
|
+
|
|
25
|
+
Version: 8.1.1
|
|
26
|
+
|
|
27
|
+
`wex-addon-dev-javascript` extends wex for JavaScript and TypeScript developers: it enforces a standard project layout — requiring `package.json`, `tsconfig.json`, `.npmrc`, `src/`, `tests/`, and the corresponding `.gitignore` rules — and in local environments symlinks locally-developed npm packages directly into a running container's `node_modules/` so monorepo packages resolve without a registry publish cycle. It also contributes a `node` service and a `vite` service, each backed by Docker Compose, where the vite service patches `allowedHosts` in `vite.config.ts` for reverse-proxy use and the node service handles lockfile refresh, annotated-tag release, and registry polling for npm package suites managed through wex.
|
|
28
|
+
|
|
29
|
+
## Table of Contents
|
|
30
|
+
|
|
31
|
+
- [Installation](#installation)
|
|
32
|
+
- [Quickstart](#quickstart)
|
|
33
|
+
- [Tests](#tests)
|
|
34
|
+
- [Architecture](#architecture)
|
|
35
|
+
- [Integration in the Suite](#integration-in-the-suite)
|
|
36
|
+
- [Dependencies](#dependencies)
|
|
37
|
+
- [Versioning & Compatibility Policy](#versioning--compatibility-policy)
|
|
38
|
+
- [License](#license)
|
|
39
|
+
- [About us](#about-us)
|
|
40
|
+
- [Known Limitations & Roadmap](#known-limitations--roadmap)
|
|
41
|
+
- [Status & Compatibility](#status--compatibility)
|
|
42
|
+
- [Useful Links](#useful-links)
|
|
43
|
+
- [Migration Notes](#migration-notes)
|
|
44
|
+
|
|
45
|
+
## Installation
|
|
46
|
+
|
|
47
|
+
```bash
|
|
48
|
+
pip install wexample-wex-addon-dev-javascript
|
|
49
|
+
```
|
|
50
|
+
|
|
51
|
+
Requires Python >=3.10.
|
|
52
|
+
|
|
53
|
+
## Quickstart
|
|
54
|
+
|
|
55
|
+
Install the package:
|
|
56
|
+
|
|
57
|
+
```bash
|
|
58
|
+
pip install wexample-wex-addon-dev-javascript
|
|
59
|
+
```
|
|
60
|
+
|
|
61
|
+
The public entry point is `JavascriptAddonManager`, defined in src/wexample_wex_addon_dev_javascript/javascript_addon_manager.py:
|
|
62
|
+
|
|
63
|
+
```python
|
|
64
|
+
from wexample_wex_addon_dev_javascript.javascript_addon_manager import JavascriptAddonManager
|
|
65
|
+
```
|
|
66
|
+
|
|
67
|
+
Pass it to the kernel's `setup()` call to register the JavaScript addon slot:
|
|
68
|
+
|
|
69
|
+
```python
|
|
70
|
+
from wexample_wex_core.common.kernel import Kernel
|
|
71
|
+
|
|
72
|
+
kernel = Kernel()
|
|
73
|
+
kernel.setup(addons=[JavascriptAddonManager])
|
|
74
|
+
```
|
|
75
|
+
|
|
76
|
+
After `setup()` returns, the kernel recognises three workdir types: `javascript`, `javascript-package`, and `javascript-packages-suite`. Any workdir resolved against a directory holding a `package.json` will be matched to the appropriate class.
|
|
77
|
+
|
|
78
|
+
The addon also contributes four service commands to the `node` and `vite` namespaces. Wire locally-developed npm packages into a running container's `node_modules/` — replacing the registry copy with a live symlink — with:
|
|
79
|
+
|
|
80
|
+
```bash
|
|
81
|
+
wex node::service/install_local
|
|
82
|
+
```
|
|
83
|
+
|
|
84
|
+
Refresh the lockfile in the container after a `package.json` dependency change (the command detects whether the project uses npm, pnpm, or Yarn from whichever lockfile is present):
|
|
85
|
+
|
|
86
|
+
```bash
|
|
87
|
+
wex node::service/refresh_lock --npm_packages "@vendor/my-lib"
|
|
88
|
+
```
|
|
89
|
+
|
|
90
|
+
Patch `vite.config.ts` so the Vite dev server accepts requests from any host — required when the service runs behind a reverse proxy:
|
|
91
|
+
|
|
92
|
+
```bash
|
|
93
|
+
wex vite::service/install
|
|
94
|
+
```
|
|
95
|
+
|
|
96
|
+
Check whether the Vite dev server inside its container is responding:
|
|
97
|
+
|
|
98
|
+
```bash
|
|
99
|
+
wex vite::service/ready
|
|
100
|
+
```
|
|
101
|
+
|
|
102
|
+
## Tests
|
|
103
|
+
|
|
104
|
+
This project uses `pytest` for testing and `pytest-cov` for code coverage analysis.
|
|
105
|
+
|
|
106
|
+
### Installation
|
|
107
|
+
|
|
108
|
+
First, install the required testing dependencies:
|
|
109
|
+
```bash
|
|
110
|
+
.venv/bin/python -m pip install pytest pytest-cov
|
|
111
|
+
```
|
|
112
|
+
|
|
113
|
+
### Basic Usage
|
|
114
|
+
|
|
115
|
+
Run all tests with coverage:
|
|
116
|
+
```bash
|
|
117
|
+
.venv/bin/python -m pytest --cov --cov-report=html
|
|
118
|
+
```
|
|
119
|
+
|
|
120
|
+
### Common Commands
|
|
121
|
+
```bash
|
|
122
|
+
# Run tests with coverage for a specific module
|
|
123
|
+
.venv/bin/python -m pytest --cov=your_module
|
|
124
|
+
|
|
125
|
+
# Show which lines are not covered
|
|
126
|
+
.venv/bin/python -m pytest --cov=your_module --cov-report=term-missing
|
|
127
|
+
|
|
128
|
+
# Generate an HTML coverage report
|
|
129
|
+
.venv/bin/python -m pytest --cov=your_module --cov-report=html
|
|
130
|
+
|
|
131
|
+
# Combine terminal and HTML reports
|
|
132
|
+
.venv/bin/python -m pytest --cov=your_module --cov-report=term-missing --cov-report=html
|
|
133
|
+
|
|
134
|
+
# Run specific test file with coverage
|
|
135
|
+
.venv/bin/python -m pytest tests/test_file.py --cov=your_module --cov-report=term-missing
|
|
136
|
+
```
|
|
137
|
+
|
|
138
|
+
### Viewing HTML Reports
|
|
139
|
+
|
|
140
|
+
After generating an HTML report, open `htmlcov/index.html` in your browser to view detailed line-by-line coverage information.
|
|
141
|
+
|
|
142
|
+
### Coverage Threshold
|
|
143
|
+
|
|
144
|
+
To enforce a minimum coverage percentage:
|
|
145
|
+
```bash
|
|
146
|
+
.venv/bin/python -m pytest --cov=your_module --cov-fail-under=80
|
|
147
|
+
```
|
|
148
|
+
|
|
149
|
+
This will cause the test suite to fail if coverage drops below 80%.
|
|
150
|
+
|
|
151
|
+
## Architecture
|
|
152
|
+
|
|
153
|
+
The addon is a pure Python package that extends wex with JavaScript and TypeScript support. It has four layers: an addon manager that registers workdir types, a workdir hierarchy that enforces project layout and owns the release lifecycle, a file layer that controls what `package.json` and `tsconfig.json` contain when written to disk, and a service layer that contributes `node` and `vite` Docker service definitions with their commands.
|
|
154
|
+
|
|
155
|
+
### Entry point
|
|
156
|
+
|
|
157
|
+
src/wexample_wex_addon_dev_javascript/javascript_addon_manager.py is the only class the host kernel needs. It extends `AbstractAddonManager` and returns three workdir types from `get_workdir_types()`:
|
|
158
|
+
|
|
159
|
+
| key | class |
|
|
160
|
+
|---|---|
|
|
161
|
+
| `javascript` | `JavascriptWorkdir` |
|
|
162
|
+
| `javascript-package` | `JavascriptPackageWorkdir` |
|
|
163
|
+
| `javascript-packages-suite` | `JavascriptPackagesSuiteWorkdir` |
|
|
164
|
+
|
|
165
|
+
The kernel resolves a directory to the right class by matching that key against the workdir type declared in the project's wex config.
|
|
166
|
+
|
|
167
|
+
### Workdir layer
|
|
168
|
+
|
|
169
|
+
The three classes form a linear inheritance chain.
|
|
170
|
+
|
|
171
|
+
#### `JavascriptWorkdir`
|
|
172
|
+
|
|
173
|
+
src/wexample_wex_addon_dev_javascript/workdir/javascript_workdir.py is the base. It extends `CodeBaseWorkdir` (from `wexample-wex-addon-app`) and `WithAiWorkdirMixin`. Its `prepare_value()` declares the required filesystem layout that wex will enforce: `package.json`, `tsconfig.json`, `.npmrc`, a `src/` tree, a `tests/` tree, and `.gitignore` rules covering `node_modules/`, `dist/`, `build/`, `.npm`, and `.eslintcache`. JS/TS files under `src/` and `tests/` are captured by a `ChildrenFilterOption` that matches `*.js|jsx|ts|tsx` and applies the `BiomeOption` from `wexample-filestate-javascript`. The class also appends `JavascriptOptionsProvider` to the options chain and returns a `JavascriptPackageJsonFile` from `get_app_config_file()`.
|
|
174
|
+
|
|
175
|
+
#### `JavascriptPackageWorkdir`
|
|
176
|
+
|
|
177
|
+
src/wexample_wex_addon_dev_javascript/workdir/javascript_package_workdir.py extends `JavascriptWorkdir` and adds everything a publishable npm package needs.
|
|
178
|
+
|
|
179
|
+
**Naming.** `get_project_name()` returns `@{vendor}/{kebab-case-name}`, giving packages their scoped npm identity.
|
|
180
|
+
|
|
181
|
+
**Layout addition.** `prepare_value()` appends `.github/workflows/publish.yml` to the enforced file tree. The content is read from the bundled resource src/wexample_wex_addon_dev_javascript/resources/package_publish.yml — a GitHub Actions workflow that publishes to npm on any `v*` tag push.
|
|
182
|
+
|
|
183
|
+
**Release lifecycle.** `release()` runs three steps in order:
|
|
184
|
+
1. `_refresh_lockfile()` — detects which lockfile is present (`package-lock.json`, `pnpm-lock.yaml`, or `yarn.lock`) and runs the matching lock-only refresh command on the host machine.
|
|
185
|
+
2. `super().release()` — inherited bump, commit, and publish flow; `_publish()` overrides the publish step to create an annotated git tag (`v{version}`) and push it to the configured deployment remote, which triggers the CI workflow above.
|
|
186
|
+
3. `_wait_for_registry()` — polls `NpmRegistryGateway.has_version()` every 30 s for up to 20 minutes before the suite loop advances to the next dependent package.
|
|
187
|
+
|
|
188
|
+
**Version bump classification.** `_classify_version_bump()` inspects the git diff of `src/` since the last tag: no changes → minor bump; whitespace-only diff → minor; non-TypeScript files only → intermediate; any `.ts`/`.tsx` change → major.
|
|
189
|
+
|
|
190
|
+
#### `JavascriptPackagesSuiteWorkdir`
|
|
191
|
+
|
|
192
|
+
src/wexample_wex_addon_dev_javascript/workdir/javascript_packages_suite_workdir.py extends `FrameworkPackageSuiteWorkdir`. It discovers child packages by looking for directories inside `npm/` that contain a `package.json`, and resolves each child as a `JavascriptPackageWorkdir`.
|
|
193
|
+
|
|
194
|
+
### File layer
|
|
195
|
+
|
|
196
|
+
#### `NodePackageJsonFile`
|
|
197
|
+
|
|
198
|
+
src/wexample_wex_addon_dev_javascript/file/node_package_json_file.py composes `AppDependenciesConfigFileMixin` with `JsonFile`. It exposes the dependency-manifest API (`add_dependency`, `add_dependency_from_string`, `get_dependencies_versions`) and reads `dependencies` plus `peerDependencies` as the set of declared runtime constraints. Any workdir that ships a `package.json` — including polyglot app manifests — can attach this class.
|
|
199
|
+
|
|
200
|
+
#### `JavascriptPackageJsonFile`
|
|
201
|
+
|
|
202
|
+
src/wexample_wex_addon_dev_javascript/file/javascript_package_json_file.py extends `NodePackageJsonFile`. Its `dumps()` stamps `name`, `version`, and `repository` from the parent workdir before delegating to the JSON serialiser. It also calls `_apply_default_publish_config()`, which sets `type: "module"`, ensures `publishConfig.access` defaults to `"public"`, and — when neither `exports` nor a `dist`-targeting `files` array is already present — injects a default `exports` map (`"./*": { types: "./dist/*.d.ts", default: "./dist/*.js" }`), a `files: ["dist"]` list, and a `typesVersions` block so consumers can import without transpiling sources.
|
|
203
|
+
|
|
204
|
+
#### `JavascriptTsconfigJsonFile`
|
|
205
|
+
|
|
206
|
+
src/wexample_wex_addon_dev_javascript/file/javascript_tsconfig_json_file.py extends `JsonFile`. Its `dumps()` fills in `compilerOptions` defaults (`target: ES2020`, `module: NodeNext`, `moduleResolution: NodeNext`, `rootDir: src`, `outDir: dist`, `declaration: true`, `declarationMap: true`, `sourceMap: true`, `strict: false`, `esModuleInterop: true`, `skipLibCheck: true`, `forceConsistentCasingInFileNames: true`) and sets `include: ["src"]`, `exclude: ["dist", "node_modules", "tests"]`. All defaults use `setdefault`, so anything already in the file is left untouched.
|
|
207
|
+
|
|
208
|
+
### Service layer
|
|
209
|
+
|
|
210
|
+
Two service namespaces ship as self-contained directories, each containing a `service.yml`, a `docker/docker-compose.yml`, and a `commands/service/` package.
|
|
211
|
+
|
|
212
|
+
#### `vite` service
|
|
213
|
+
|
|
214
|
+
Defined in src/wexample_wex_addon_dev_javascript/services/vite/service.yml. The container (`${APP_PROJECT_NAME}_vite`) runs `oven/bun:latest`, mounts the app path to `/app`, persists `node_modules` in a named volume `vite_node_modules`, and starts with `bun install --no-cache && bun run dev --host`. The exposed port is controlled by the `VITE_PORT` var (default `8080`), which the compose file also passes to `nginx-proxy` via `VIRTUAL_PORT`.
|
|
215
|
+
|
|
216
|
+
src/wexample_wex_addon_dev_javascript/services/vite/app_service.py composes the base `AppService` with `AgentContributingServiceMixin`, which makes the AI agent declared in src/wexample_wex_addon_dev_javascript/services/vite/ai/agents/main/agent.yml discoverable by `wex talk`. The agent's system prompt lives in src/wexample_wex_addon_dev_javascript/services/vite/ai/agents/main/about-service.md.
|
|
217
|
+
|
|
218
|
+
**`vite::service/install`** — src/wexample_wex_addon_dev_javascript/services/vite/commands/service/install.py patches `vite.config.ts` or `vite.config.js` to add `server: { allowedHosts: true }` inside `defineConfig`. It handles two shapes: a bare `defineConfig()` call and a `defineConfig({ ... })` block. The patch is idempotent (skips if `allowedHosts` is already present).
|
|
219
|
+
|
|
220
|
+
**`vite::service/ready`** — src/wexample_wex_addon_dev_javascript/services/vite/commands/service/ready.py reads `app.project_name` from the runtime config, resolves the container name as `{project_name}_vite`, reads `VITE_PORT` from the service manifest vars, then runs `docker exec {container} bun -e "await fetch('http://localhost:{port}')"` and returns a `BooleanResponse`.
|
|
221
|
+
|
|
222
|
+
#### `node` service
|
|
223
|
+
|
|
224
|
+
Defined in src/wexample_wex_addon_dev_javascript/services/node/service.yml. The container (`${APP_PROJECT_NAME}_node`) runs `node:20-alpine`, mounts the app path to `/var/www/html`, and stays alive with `tail -f /dev/null` so subsequent `docker exec` calls can run inside it.
|
|
225
|
+
|
|
226
|
+
**`node::service/install_local`** — src/wexample_wex_addon_dev_javascript/services/node/commands/service/install_local.py reads the `local_packages.javascript` key from the runtime config (a map of vendor names to package directories). It builds a shell script that first installs the full `node_modules` tree (using whichever of yarn, pnpm, or npm the project's lockfile identifies), then iterates every directory under `/var/www/javascript-dev/{vendor}/`, reads its `package.json` to get the `name` field, removes the corresponding entry from `node_modules/`, and replaces it with a symlink to the local source. The script runs inside the service container via `docker exec`.
|
|
227
|
+
|
|
228
|
+
**`node::service/refresh_lock`** — src/wexample_wex_addon_dev_javascript/services/node/commands/service/refresh_lock.py accepts a `--npm_packages` option listing the changed packages (for logging), then runs a lockfile-only install inside the container: `yarn install` if `yarn.lock` is present, `pnpm install --lockfile-only` if `pnpm-lock.yaml`, or `npm install --package-lock-only` if `package-lock.json`.
|
|
229
|
+
|
|
230
|
+
### Common utilities
|
|
231
|
+
|
|
232
|
+
src/wexample_wex_addon_dev_javascript/common/npm_registry_gateway.py is a thin HTTP client over `AbstractGateway`. Its single public method `has_version(package, version)` fetches `/{encoded_package_name}` from the configured registry URL, parses the JSON manifest, and returns `True` if `version` appears in the `versions` map. It accepts an optional `token` for Bearer auth on private registries. `JavascriptPackageWorkdir._wait_for_registry()` calls it in a polling loop with a 30-second delay and a 40-attempt ceiling (20 minutes total).
|
|
233
|
+
|
|
234
|
+
### Constants
|
|
235
|
+
|
|
236
|
+
src/wexample_wex_addon_dev_javascript/const/tags.py declares `DomainTag` with three values — `domain:dev-server`, `domain:frontend`, `domain:service` — which the service commands attach via the `@command(tags=[...])` decorator. Tags govern how `wex talk` and automated agents filter and describe available commands.
|
|
237
|
+
|
|
238
|
+
## Integration in the Suite
|
|
239
|
+
|
|
240
|
+
This package is part of the Wexample Suite — a collection of high-quality, modular tools designed to work seamlessly together across multiple languages and environments.
|
|
241
|
+
|
|
242
|
+
### Related Packages
|
|
243
|
+
|
|
244
|
+
The suite includes packages for configuration management, file handling, prompts, and more. Each package can be used independently or as part of the integrated suite.
|
|
245
|
+
|
|
246
|
+
Visit the [Wexample Suite documentation](https://docs.wexample.com) for the complete package ecosystem.
|
|
247
|
+
|
|
248
|
+
## Dependencies
|
|
249
|
+
|
|
250
|
+
- attrs: >=23.1.0
|
|
251
|
+
- cattrs: >=23.1.0
|
|
252
|
+
- wexample-api: >=6.8.0
|
|
253
|
+
- wexample-filestate-javascript: >=6.6.0
|
|
254
|
+
- wexample-wex-addon-ai: >=14.0.0
|
|
255
|
+
- wexample-wex-addon-app: >=31.0.0
|
|
256
|
+
|
|
257
|
+
## Versioning & Compatibility Policy
|
|
258
|
+
|
|
259
|
+
Wexample packages follow **Semantic Versioning** (SemVer):
|
|
260
|
+
|
|
261
|
+
- **MAJOR**: Breaking changes
|
|
262
|
+
- **MINOR**: New features, backward compatible
|
|
263
|
+
- **PATCH**: Bug fixes, backward compatible
|
|
264
|
+
|
|
265
|
+
We maintain backward compatibility within major versions and provide clear migration guides for breaking changes.
|
|
266
|
+
|
|
267
|
+
## License
|
|
268
|
+
|
|
269
|
+
This project is licensed under the MIT License - see the [LICENSE](LICENSE) file for details.
|
|
270
|
+
|
|
271
|
+
Free to use in both personal and commercial projects.
|
|
272
|
+
|
|
273
|
+
## About us
|
|
274
|
+
|
|
275
|
+
[Wexample](https://wexample.com) stands as a cornerstone of the digital ecosystem — a collective of seasoned engineers, researchers, and creators driven by a relentless pursuit of technological excellence. More than a media platform, it has grown into a vibrant community where innovation meets craftsmanship, and where every line of code reflects a commitment to clarity, durability, and shared intelligence.
|
|
276
|
+
|
|
277
|
+
This packages suite embodies this spirit. Trusted by professionals and enthusiasts alike, it delivers a consistent, high-quality foundation for modern development — open, elegant, and battle-tested. Its reputation is built on years of collaboration, refinement, and rigorous attention to detail, making it a natural choice for those who demand both robustness and beauty in their tools.
|
|
278
|
+
|
|
279
|
+
Wexample cultivates a culture of mastery. Each package, each contribution carries the mark of a community that values precision, ethics, and innovation — a community proud to shape the future of digital craftsmanship.
|
|
280
|
+
|
|
281
|
+
## Known Limitations & Roadmap
|
|
282
|
+
|
|
283
|
+
Current limitations and planned features are tracked in the GitHub issues.
|
|
284
|
+
|
|
285
|
+
See the [project roadmap](https://github.com/wexample/python-wex_addon_dev_javascript/issues) for upcoming features and improvements.
|
|
286
|
+
|
|
287
|
+
## Status & Compatibility
|
|
288
|
+
|
|
289
|
+
**Maturity**: Production-ready
|
|
290
|
+
|
|
291
|
+
**Python Support**: >=3.10
|
|
292
|
+
|
|
293
|
+
**OS Support**: Linux, macOS, Windows
|
|
294
|
+
|
|
295
|
+
**Status**: Actively maintained
|
|
296
|
+
|
|
297
|
+
## Useful Links
|
|
298
|
+
|
|
299
|
+
- **Homepage**: https://github.com/wexample/python-wex-addon-dev-javascript
|
|
300
|
+
- **Documentation**: [docs.wexample.com](https://docs.wexample.com)
|
|
301
|
+
- **Issue Tracker**: https://github.com/wexample/python-wex-addon-dev-javascript/issues
|
|
302
|
+
- **Discussions**: https://github.com/wexample/python-wex-addon-dev-javascript/discussions
|
|
303
|
+
- **PyPI**: [pypi.org/project/wexample-wex-addon-dev-javascript](https://pypi.org/project/wexample-wex-addon-dev-javascript/)
|
|
304
|
+
|
|
305
|
+
## Migration Notes
|
|
306
|
+
|
|
307
|
+
When upgrading between major versions, refer to the migration guides in the documentation.
|
|
308
|
+
|
|
309
|
+
Breaking changes are clearly documented with upgrade paths and examples.
|
|
@@ -1,28 +1,32 @@
|
|
|
1
|
-
wexample_wex_addon_dev_javascript-8.
|
|
2
|
-
wexample_wex_addon_dev_javascript-8.
|
|
3
|
-
wexample_wex_addon_dev_javascript-8.
|
|
1
|
+
wexample_wex_addon_dev_javascript-8.1.1.dist-info/METADATA,sha256=dRqpOZNuc8ztuJRMPSz-m5Uiid6YTmwrFXyc2Sn6oG4,18012
|
|
2
|
+
wexample_wex_addon_dev_javascript-8.1.1.dist-info/WHEEL,sha256=VP-D4TPS230sME9Z3vb3INXvo1yt0924YRm5AOsk_dE,90
|
|
3
|
+
wexample_wex_addon_dev_javascript-8.1.1.dist-info/entry_points.txt,sha256=6OYgBcLyFCUgeqLgnvMyOJxPCWzgy7se4rLPKtNonMs,34
|
|
4
4
|
wexample_wex_addon_dev_javascript/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
5
5
|
wexample_wex_addon_dev_javascript/__pycache__/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
6
6
|
wexample_wex_addon_dev_javascript/common/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
7
7
|
wexample_wex_addon_dev_javascript/common/npm_registry_gateway.py,sha256=fdmsO6DZVvAQw1o3QmtjLBq0Dr1i_EAfnKvxQx5VdIw,1657
|
|
8
8
|
wexample_wex_addon_dev_javascript/config_value/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
9
|
-
wexample_wex_addon_dev_javascript/config_value/javascript_package_readme_config_value.py,sha256=
|
|
9
|
+
wexample_wex_addon_dev_javascript/config_value/javascript_package_readme_config_value.py,sha256=FaYjL6A6Zv8sYnz4cWqD4DsrNO9EMYvSi1-8GCbmNvs,522
|
|
10
10
|
wexample_wex_addon_dev_javascript/const/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
11
11
|
wexample_wex_addon_dev_javascript/const/tags.py,sha256=qirMGuj7UqenempTZeQfJfMa_bC7mt-yLD_BkLnMnKE,307
|
|
12
12
|
wexample_wex_addon_dev_javascript/file/__init__.py,sha256=U4S_2y3zgLZVfMenHRaJFBW8yqh2mUBuI291LGQVOJ8,35
|
|
13
13
|
wexample_wex_addon_dev_javascript/file/javascript_package_json_file.py,sha256=yn1ltv3oBYNg1OvUytJ4PEzH8FSJS2KcIKK8y-cMrl4,2906
|
|
14
14
|
wexample_wex_addon_dev_javascript/file/javascript_tsconfig_json_file.py,sha256=a2vfYgB7gbiIiGljU_QA6extFJPyNM6rlhhAS3YoeCs,1395
|
|
15
15
|
wexample_wex_addon_dev_javascript/file/node_package_json_file.py,sha256=SC6Mh--avdxVfDYK_UBGb_LLR_Ivn8Gyc-c9VFy6sXc,2491
|
|
16
|
-
wexample_wex_addon_dev_javascript/
|
|
16
|
+
wexample_wex_addon_dev_javascript/formatter/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
17
|
+
wexample_wex_addon_dev_javascript/formatter/javascript_code_formatter.py,sha256=6TLrynxXH-P0kHiW6FmgROA8fG2Ik03Pn4JV9dctDuE,1618
|
|
18
|
+
wexample_wex_addon_dev_javascript/javascript_addon_manager.py,sha256=zateyPGxtR4eOdjstfLI6MfTagEOWAAeb2CZqF_qMVo,1387
|
|
17
19
|
wexample_wex_addon_dev_javascript/py.typed,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
18
20
|
wexample_wex_addon_dev_javascript/resources/.wex.yml,sha256=JdIF6nGkFcfi76yZYGlXxeWfOK4eAUSV_gAn6i3hk2w,32
|
|
21
|
+
wexample_wex_addon_dev_javascript/resources/design_rules/javascript_code.md,sha256=_X6_j1SS2yoMegK3n1R_dORtBT3__NYQCY1PD-Ssb2o,1159
|
|
19
22
|
wexample_wex_addon_dev_javascript/resources/package_publish.yml,sha256=Omw0Ww4I7jsi2uLSNApRR-Ujt6M_56IsXDyDT7hVncc,421
|
|
23
|
+
wexample_wex_addon_dev_javascript/resources/writing_rules/javascript_code.md,sha256=nzoIZ65UTiwSwst0NoulyE29AfnGCjbOakuPbmeaakI,1808
|
|
20
24
|
wexample_wex_addon_dev_javascript/services/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
21
25
|
wexample_wex_addon_dev_javascript/services/node/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
22
26
|
wexample_wex_addon_dev_javascript/services/node/commands/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
23
27
|
wexample_wex_addon_dev_javascript/services/node/commands/service/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
24
28
|
wexample_wex_addon_dev_javascript/services/node/commands/service/install_local.py,sha256=DtR5jrC2H_7h-TU1NhcH4TzzrqZ8_p7DMCfSQ7_GzsE,2773
|
|
25
|
-
wexample_wex_addon_dev_javascript/services/node/commands/service/refresh_lock.py,sha256=
|
|
29
|
+
wexample_wex_addon_dev_javascript/services/node/commands/service/refresh_lock.py,sha256=qlGmvYxjnXxrr1DILjBBLfp9kTruuBe-5SYEzxvVNIA,2204
|
|
26
30
|
wexample_wex_addon_dev_javascript/services/node/docker/.wex.yml,sha256=JdIF6nGkFcfi76yZYGlXxeWfOK4eAUSV_gAn6i3hk2w,32
|
|
27
31
|
wexample_wex_addon_dev_javascript/services/node/docker/docker-compose.yml,sha256=GF22uk3PDtywP_GAF0RbfJ7lQ5P5nuuwJQE9ohwQh28,362
|
|
28
32
|
wexample_wex_addon_dev_javascript/services/node/service.yml,sha256=jPLW-E4ymVaEnTwdTjVvTJNx04pwMGN4twxeOuN37mo,95
|
|
@@ -44,4 +48,4 @@ wexample_wex_addon_dev_javascript/workdir/__init__.py,sha256=47DEQpj8HBSa-_TImW-
|
|
|
44
48
|
wexample_wex_addon_dev_javascript/workdir/javascript_package_workdir.py,sha256=aUO2RdXlExfwIlnSexWGwc-Oh7QBMKKNv6sPgCIev2Q,9302
|
|
45
49
|
wexample_wex_addon_dev_javascript/workdir/javascript_packages_suite_workdir.py,sha256=b0QoTWlNYOYfpqEb8vYzL4WRoY0WwBhYOFUoRc4oySI,928
|
|
46
50
|
wexample_wex_addon_dev_javascript/workdir/javascript_workdir.py,sha256=oKBj-tOV-EH9kqiXnKUE7sKLKU4v0ta4IQr-zLEWgFI,5272
|
|
47
|
-
wexample_wex_addon_dev_javascript-8.
|
|
51
|
+
wexample_wex_addon_dev_javascript-8.1.1.dist-info/RECORD,,
|
|
@@ -1,475 +0,0 @@
|
|
|
1
|
-
Metadata-Version: 2.1
|
|
2
|
-
Name: wexample-wex-addon-dev-javascript
|
|
3
|
-
Version: 8.0.0
|
|
4
|
-
Summary: Python dev addon for wex
|
|
5
|
-
Author-Email: weeger <contact@wexample.com>
|
|
6
|
-
License: MIT
|
|
7
|
-
Classifier: Programming Language :: Python :: 3
|
|
8
|
-
Classifier: License :: OSI Approved :: MIT License
|
|
9
|
-
Classifier: Operating System :: OS Independent
|
|
10
|
-
Project-URL: homepage, https://github.com/wexample/python-wex-dev-python
|
|
11
|
-
Requires-Python: >=3.10
|
|
12
|
-
Requires-Dist: attrs>=23.1.0
|
|
13
|
-
Requires-Dist: cattrs>=23.1.0
|
|
14
|
-
Requires-Dist: wexample-api>=6.8.0
|
|
15
|
-
Requires-Dist: wexample-filestate-javascript>=6.6.0
|
|
16
|
-
Requires-Dist: wexample-wex-addon-ai>=12.1.0
|
|
17
|
-
Requires-Dist: wexample-wex-addon-app>=29.0.0
|
|
18
|
-
Provides-Extra: dev
|
|
19
|
-
Requires-Dist: pytest; extra == "dev"
|
|
20
|
-
Requires-Dist: pytest-cov; extra == "dev"
|
|
21
|
-
Description-Content-Type: text/markdown
|
|
22
|
-
|
|
23
|
-
# wex_addon_dev_javascript
|
|
24
|
-
|
|
25
|
-
Version: 8.0.0
|
|
26
|
-
|
|
27
|
-
Python dev addon for wex
|
|
28
|
-
|
|
29
|
-
## Table of Contents
|
|
30
|
-
|
|
31
|
-
- [Tests](#tests)
|
|
32
|
-
- [Suite Integration](#suite-integration)
|
|
33
|
-
- [Dependencies](#dependencies)
|
|
34
|
-
- [Versioning](#versioning)
|
|
35
|
-
- [License](#license)
|
|
36
|
-
- [Suite Integration](#suite-integration)
|
|
37
|
-
- [Suite Signature](#suite-signature)
|
|
38
|
-
- [Introduction](#introduction)
|
|
39
|
-
- [Roadmap](#roadmap)
|
|
40
|
-
- [Status Compatibility](#status-compatibility)
|
|
41
|
-
- [Useful Links](#useful-links)
|
|
42
|
-
- [Migration Notes](#migration-notes)
|
|
43
|
-
|
|
44
|
-
## Tests
|
|
45
|
-
|
|
46
|
-
This project uses `pytest` for testing and `pytest-cov` for code coverage analysis.
|
|
47
|
-
|
|
48
|
-
### Installation
|
|
49
|
-
|
|
50
|
-
First, install the required testing dependencies:
|
|
51
|
-
```bash
|
|
52
|
-
.venv/bin/python -m pip install pytest pytest-cov
|
|
53
|
-
```
|
|
54
|
-
|
|
55
|
-
### Basic Usage
|
|
56
|
-
|
|
57
|
-
Run all tests with coverage:
|
|
58
|
-
```bash
|
|
59
|
-
.venv/bin/python -m pytest --cov --cov-report=html
|
|
60
|
-
```
|
|
61
|
-
|
|
62
|
-
### Common Commands
|
|
63
|
-
```bash
|
|
64
|
-
# Run tests with coverage for a specific module
|
|
65
|
-
.venv/bin/python -m pytest --cov=your_module
|
|
66
|
-
|
|
67
|
-
# Show which lines are not covered
|
|
68
|
-
.venv/bin/python -m pytest --cov=your_module --cov-report=term-missing
|
|
69
|
-
|
|
70
|
-
# Generate an HTML coverage report
|
|
71
|
-
.venv/bin/python -m pytest --cov=your_module --cov-report=html
|
|
72
|
-
|
|
73
|
-
# Combine terminal and HTML reports
|
|
74
|
-
.venv/bin/python -m pytest --cov=your_module --cov-report=term-missing --cov-report=html
|
|
75
|
-
|
|
76
|
-
# Run specific test file with coverage
|
|
77
|
-
.venv/bin/python -m pytest tests/test_file.py --cov=your_module --cov-report=term-missing
|
|
78
|
-
```
|
|
79
|
-
|
|
80
|
-
### Viewing HTML Reports
|
|
81
|
-
|
|
82
|
-
After generating an HTML report, open `htmlcov/index.html` in your browser to view detailed line-by-line coverage information.
|
|
83
|
-
|
|
84
|
-
### Coverage Threshold
|
|
85
|
-
|
|
86
|
-
To enforce a minimum coverage percentage:
|
|
87
|
-
```bash
|
|
88
|
-
.venv/bin/python -m pytest --cov=your_module --cov-fail-under=80
|
|
89
|
-
```
|
|
90
|
-
|
|
91
|
-
This will cause the test suite to fail if coverage drops below 80%.
|
|
92
|
-
|
|
93
|
-
## Integration in the Suite
|
|
94
|
-
|
|
95
|
-
This package is part of the Wexample Suite — a collection of high-quality, modular tools designed to work seamlessly together across multiple languages and environments.
|
|
96
|
-
|
|
97
|
-
### Related Packages
|
|
98
|
-
|
|
99
|
-
The suite includes packages for configuration management, file handling, prompts, and more. Each package can be used independently or as part of the integrated suite.
|
|
100
|
-
|
|
101
|
-
Visit the [Wexample Suite documentation](https://docs.wexample.com) for the complete package ecosystem.
|
|
102
|
-
|
|
103
|
-
## Dependencies
|
|
104
|
-
|
|
105
|
-
- attrs: >=23.1.0
|
|
106
|
-
- cattrs: >=23.1.0
|
|
107
|
-
- wexample-api: >=6.8.0
|
|
108
|
-
- wexample-filestate-javascript: >=6.6.0
|
|
109
|
-
- wexample-wex-addon-ai: >=12.1.0
|
|
110
|
-
- wexample-wex-addon-app: >=29.0.0
|
|
111
|
-
|
|
112
|
-
## Versioning & Compatibility Policy
|
|
113
|
-
|
|
114
|
-
Wexample packages follow **Semantic Versioning** (SemVer):
|
|
115
|
-
|
|
116
|
-
- **MAJOR**: Breaking changes
|
|
117
|
-
- **MINOR**: New features, backward compatible
|
|
118
|
-
- **PATCH**: Bug fixes, backward compatible
|
|
119
|
-
|
|
120
|
-
We maintain backward compatibility within major versions and provide clear migration guides for breaking changes.
|
|
121
|
-
|
|
122
|
-
## License
|
|
123
|
-
|
|
124
|
-
This project is licensed under the MIT License - see the [LICENSE](LICENSE) file for details.
|
|
125
|
-
|
|
126
|
-
Free to use in both personal and commercial projects.
|
|
127
|
-
|
|
128
|
-
## Integration in the Suite
|
|
129
|
-
|
|
130
|
-
This package is part of the Wexample Suite — a collection of high-quality, modular tools designed to work seamlessly together across multiple languages and environments.
|
|
131
|
-
|
|
132
|
-
### Related Packages
|
|
133
|
-
|
|
134
|
-
The suite includes packages for configuration management, file handling, prompts, and more. Each package can be used independently or as part of the integrated suite.
|
|
135
|
-
|
|
136
|
-
Visit the [Wexample Suite documentation](https://docs.wexample.com) for the complete package ecosystem.
|
|
137
|
-
|
|
138
|
-
# About us
|
|
139
|
-
|
|
140
|
-
[Wexample](https://wexample.com) stands as a cornerstone of the digital ecosystem — a collective of seasoned engineers, researchers, and creators driven by a relentless pursuit of technological excellence. More than a media platform, it has grown into a vibrant community where innovation meets craftsmanship, and where every line of code reflects a commitment to clarity, durability, and shared intelligence.
|
|
141
|
-
|
|
142
|
-
This packages suite embodies this spirit. Trusted by professionals and enthusiasts alike, it delivers a consistent, high-quality foundation for modern development — open, elegant, and battle-tested. Its reputation is built on years of collaboration, refinement, and rigorous attention to detail, making it a natural choice for those who demand both robustness and beauty in their tools.
|
|
143
|
-
|
|
144
|
-
Wexample cultivates a culture of mastery. Each package, each contribution carries the mark of a community that values precision, ethics, and innovation — a community proud to shape the future of digital craftsmanship.
|
|
145
|
-
|
|
146
|
-
# wex_addon_dev_javascript
|
|
147
|
-
|
|
148
|
-
Version: 7.4.3
|
|
149
|
-
|
|
150
|
-
Python dev addon for wex
|
|
151
|
-
|
|
152
|
-
## Table of Contents
|
|
153
|
-
|
|
154
|
-
- [Tests](#tests)
|
|
155
|
-
- [Suite Integration](#suite-integration)
|
|
156
|
-
- [Dependencies](#dependencies)
|
|
157
|
-
- [Versioning](#versioning)
|
|
158
|
-
- [License](#license)
|
|
159
|
-
- [Suite Integration](#suite-integration)
|
|
160
|
-
- [Suite Signature](#suite-signature)
|
|
161
|
-
- [Introduction](#introduction)
|
|
162
|
-
- [Roadmap](#roadmap)
|
|
163
|
-
- [Status Compatibility](#status-compatibility)
|
|
164
|
-
- [Useful Links](#useful-links)
|
|
165
|
-
- [Migration Notes](#migration-notes)
|
|
166
|
-
|
|
167
|
-
## Tests
|
|
168
|
-
|
|
169
|
-
This project uses `pytest` for testing and `pytest-cov` for code coverage analysis.
|
|
170
|
-
|
|
171
|
-
### Installation
|
|
172
|
-
|
|
173
|
-
First, install the required testing dependencies:
|
|
174
|
-
```bash
|
|
175
|
-
.venv/bin/python -m pip install pytest pytest-cov
|
|
176
|
-
```
|
|
177
|
-
|
|
178
|
-
### Basic Usage
|
|
179
|
-
|
|
180
|
-
Run all tests with coverage:
|
|
181
|
-
```bash
|
|
182
|
-
.venv/bin/python -m pytest --cov --cov-report=html
|
|
183
|
-
```
|
|
184
|
-
|
|
185
|
-
### Common Commands
|
|
186
|
-
```bash
|
|
187
|
-
# Run tests with coverage for a specific module
|
|
188
|
-
.venv/bin/python -m pytest --cov=your_module
|
|
189
|
-
|
|
190
|
-
# Show which lines are not covered
|
|
191
|
-
.venv/bin/python -m pytest --cov=your_module --cov-report=term-missing
|
|
192
|
-
|
|
193
|
-
# Generate an HTML coverage report
|
|
194
|
-
.venv/bin/python -m pytest --cov=your_module --cov-report=html
|
|
195
|
-
|
|
196
|
-
# Combine terminal and HTML reports
|
|
197
|
-
.venv/bin/python -m pytest --cov=your_module --cov-report=term-missing --cov-report=html
|
|
198
|
-
|
|
199
|
-
# Run specific test file with coverage
|
|
200
|
-
.venv/bin/python -m pytest tests/test_file.py --cov=your_module --cov-report=term-missing
|
|
201
|
-
```
|
|
202
|
-
|
|
203
|
-
### Viewing HTML Reports
|
|
204
|
-
|
|
205
|
-
After generating an HTML report, open `htmlcov/index.html` in your browser to view detailed line-by-line coverage information.
|
|
206
|
-
|
|
207
|
-
### Coverage Threshold
|
|
208
|
-
|
|
209
|
-
To enforce a minimum coverage percentage:
|
|
210
|
-
```bash
|
|
211
|
-
.venv/bin/python -m pytest --cov=your_module --cov-fail-under=80
|
|
212
|
-
```
|
|
213
|
-
|
|
214
|
-
This will cause the test suite to fail if coverage drops below 80%.
|
|
215
|
-
|
|
216
|
-
## Integration in the Suite
|
|
217
|
-
|
|
218
|
-
This package is part of the Wexample Suite — a collection of high-quality, modular tools designed to work seamlessly together across multiple languages and environments.
|
|
219
|
-
|
|
220
|
-
### Related Packages
|
|
221
|
-
|
|
222
|
-
The suite includes packages for configuration management, file handling, prompts, and more. Each package can be used independently or as part of the integrated suite.
|
|
223
|
-
|
|
224
|
-
Visit the [Wexample Suite documentation](https://docs.wexample.com) for the complete package ecosystem.
|
|
225
|
-
|
|
226
|
-
## Dependencies
|
|
227
|
-
|
|
228
|
-
- attrs: >=23.1.0
|
|
229
|
-
- cattrs: >=23.1.0
|
|
230
|
-
- wexample-filestate-javascript: >=6.1.0
|
|
231
|
-
- wexample-wex-addon-app: >=16.6.0
|
|
232
|
-
|
|
233
|
-
## Versioning & Compatibility Policy
|
|
234
|
-
|
|
235
|
-
Wexample packages follow **Semantic Versioning** (SemVer):
|
|
236
|
-
|
|
237
|
-
- **MAJOR**: Breaking changes
|
|
238
|
-
- **MINOR**: New features, backward compatible
|
|
239
|
-
- **PATCH**: Bug fixes, backward compatible
|
|
240
|
-
|
|
241
|
-
We maintain backward compatibility within major versions and provide clear migration guides for breaking changes.
|
|
242
|
-
|
|
243
|
-
## License
|
|
244
|
-
|
|
245
|
-
This project is licensed under the MIT License - see the [LICENSE](LICENSE) file for details.
|
|
246
|
-
|
|
247
|
-
Free to use in both personal and commercial projects.
|
|
248
|
-
|
|
249
|
-
## Integration in the Suite
|
|
250
|
-
|
|
251
|
-
This package is part of the Wexample Suite — a collection of high-quality, modular tools designed to work seamlessly together across multiple languages and environments.
|
|
252
|
-
|
|
253
|
-
### Related Packages
|
|
254
|
-
|
|
255
|
-
The suite includes packages for configuration management, file handling, prompts, and more. Each package can be used independently or as part of the integrated suite.
|
|
256
|
-
|
|
257
|
-
Visit the [Wexample Suite documentation](https://docs.wexample.com) for the complete package ecosystem.
|
|
258
|
-
|
|
259
|
-
# About us
|
|
260
|
-
|
|
261
|
-
[Wexample](https://wexample.com) stands as a cornerstone of the digital ecosystem — a collective of seasoned engineers, researchers, and creators driven by a relentless pursuit of technological excellence. More than a media platform, it has grown into a vibrant community where innovation meets craftsmanship, and where every line of code reflects a commitment to clarity, durability, and shared intelligence.
|
|
262
|
-
|
|
263
|
-
This packages suite embodies this spirit. Trusted by professionals and enthusiasts alike, it delivers a consistent, high-quality foundation for modern development — open, elegant, and battle-tested. Its reputation is built on years of collaboration, refinement, and rigorous attention to detail, making it a natural choice for those who demand both robustness and beauty in their tools.
|
|
264
|
-
|
|
265
|
-
Wexample cultivates a culture of mastery. Each package, each contribution carries the mark of a community that values precision, ethics, and innovation — a community proud to shape the future of digital craftsmanship.
|
|
266
|
-
|
|
267
|
-
# wex_addon_dev_javascript
|
|
268
|
-
|
|
269
|
-
Version: 0.1.1
|
|
270
|
-
|
|
271
|
-
Python dev addon for wex
|
|
272
|
-
|
|
273
|
-
## Table of Contents
|
|
274
|
-
|
|
275
|
-
- [Tests](#tests)
|
|
276
|
-
- [Suite Integration](#suite-integration)
|
|
277
|
-
- [Dependencies](#dependencies)
|
|
278
|
-
- [Versioning](#versioning)
|
|
279
|
-
- [License](#license)
|
|
280
|
-
- [Suite Integration](#suite-integration)
|
|
281
|
-
- [Suite Signature](#suite-signature)
|
|
282
|
-
- [Roadmap](#roadmap)
|
|
283
|
-
- [Status Compatibility](#status-compatibility)
|
|
284
|
-
- [Useful Links](#useful-links)
|
|
285
|
-
- [Migration Notes](#migration-notes)
|
|
286
|
-
|
|
287
|
-
## Tests
|
|
288
|
-
|
|
289
|
-
This project uses `pytest` for testing and `pytest-cov` for code coverage analysis.
|
|
290
|
-
|
|
291
|
-
### Installation
|
|
292
|
-
|
|
293
|
-
First, install the required testing dependencies:
|
|
294
|
-
```bash
|
|
295
|
-
.venv/bin/python -m pip install pytest pytest-cov
|
|
296
|
-
```
|
|
297
|
-
|
|
298
|
-
### Basic Usage
|
|
299
|
-
|
|
300
|
-
Run all tests with coverage:
|
|
301
|
-
```bash
|
|
302
|
-
.venv/bin/python -m pytest --cov --cov-report=html
|
|
303
|
-
```
|
|
304
|
-
|
|
305
|
-
### Common Commands
|
|
306
|
-
```bash
|
|
307
|
-
# Run tests with coverage for a specific module
|
|
308
|
-
.venv/bin/python -m pytest --cov=your_module
|
|
309
|
-
|
|
310
|
-
# Show which lines are not covered
|
|
311
|
-
.venv/bin/python -m pytest --cov=your_module --cov-report=term-missing
|
|
312
|
-
|
|
313
|
-
# Generate an HTML coverage report
|
|
314
|
-
.venv/bin/python -m pytest --cov=your_module --cov-report=html
|
|
315
|
-
|
|
316
|
-
# Combine terminal and HTML reports
|
|
317
|
-
.venv/bin/python -m pytest --cov=your_module --cov-report=term-missing --cov-report=html
|
|
318
|
-
|
|
319
|
-
# Run specific test file with coverage
|
|
320
|
-
.venv/bin/python -m pytest tests/test_file.py --cov=your_module --cov-report=term-missing
|
|
321
|
-
```
|
|
322
|
-
|
|
323
|
-
### Viewing HTML Reports
|
|
324
|
-
|
|
325
|
-
After generating an HTML report, open `htmlcov/index.html` in your browser to view detailed line-by-line coverage information.
|
|
326
|
-
|
|
327
|
-
### Coverage Threshold
|
|
328
|
-
|
|
329
|
-
To enforce a minimum coverage percentage:
|
|
330
|
-
```bash
|
|
331
|
-
.venv/bin/python -m pytest --cov=your_module --cov-fail-under=80
|
|
332
|
-
```
|
|
333
|
-
|
|
334
|
-
This will cause the test suite to fail if coverage drops below 80%.
|
|
335
|
-
|
|
336
|
-
## Integration in the Suite
|
|
337
|
-
|
|
338
|
-
This package is part of the Wexample Suite — a collection of high-quality, modular tools designed to work seamlessly together across multiple languages and environments.
|
|
339
|
-
|
|
340
|
-
### Related Packages
|
|
341
|
-
|
|
342
|
-
The suite includes packages for configuration management, file handling, prompts, and more. Each package can be used independently or as part of the integrated suite.
|
|
343
|
-
|
|
344
|
-
Visit the [Wexample Suite documentation](https://docs.wexample.com) for the complete package ecosystem.
|
|
345
|
-
|
|
346
|
-
## Dependencies
|
|
347
|
-
|
|
348
|
-
- attrs: >=23.1.0
|
|
349
|
-
- cattrs: >=23.1.0
|
|
350
|
-
- wexample-filestate-javascript: >=0.1.0
|
|
351
|
-
- wexample-wex-addon-app: >=1.1.0
|
|
352
|
-
|
|
353
|
-
## Versioning & Compatibility Policy
|
|
354
|
-
|
|
355
|
-
Wexample packages follow **Semantic Versioning** (SemVer):
|
|
356
|
-
|
|
357
|
-
- **MAJOR**: Breaking changes
|
|
358
|
-
- **MINOR**: New features, backward compatible
|
|
359
|
-
- **PATCH**: Bug fixes, backward compatible
|
|
360
|
-
|
|
361
|
-
We maintain backward compatibility within major versions and provide clear migration guides for breaking changes.
|
|
362
|
-
|
|
363
|
-
## License
|
|
364
|
-
|
|
365
|
-
This project is licensed under the MIT License - see the [LICENSE](LICENSE) file for details.
|
|
366
|
-
|
|
367
|
-
Free to use in both personal and commercial projects.
|
|
368
|
-
|
|
369
|
-
## Integration in the Suite
|
|
370
|
-
|
|
371
|
-
This package is part of the Wexample Suite — a collection of high-quality, modular tools designed to work seamlessly together across multiple languages and environments.
|
|
372
|
-
|
|
373
|
-
### Related Packages
|
|
374
|
-
|
|
375
|
-
The suite includes packages for configuration management, file handling, prompts, and more. Each package can be used independently or as part of the integrated suite.
|
|
376
|
-
|
|
377
|
-
Visit the [Wexample Suite documentation](https://docs.wexample.com) for the complete package ecosystem.
|
|
378
|
-
|
|
379
|
-
# About us
|
|
380
|
-
|
|
381
|
-
[Wexample](https://wexample.com) stands as a cornerstone of the digital ecosystem — a collective of seasoned engineers, researchers, and creators driven by a relentless pursuit of technological excellence. More than a media platform, it has grown into a vibrant community where innovation meets craftsmanship, and where every line of code reflects a commitment to clarity, durability, and shared intelligence.
|
|
382
|
-
|
|
383
|
-
This packages suite embodies this spirit. Trusted by professionals and enthusiasts alike, it delivers a consistent, high-quality foundation for modern development — open, elegant, and battle-tested. Its reputation is built on years of collaboration, refinement, and rigorous attention to detail, making it a natural choice for those who demand both robustness and beauty in their tools.
|
|
384
|
-
|
|
385
|
-
Wexample cultivates a culture of mastery. Each package, each contribution carries the mark of a community that values precision, ethics, and innovation — a community proud to shape the future of digital craftsmanship.
|
|
386
|
-
|
|
387
|
-
## Known Limitations & Roadmap
|
|
388
|
-
|
|
389
|
-
Current limitations and planned features are tracked in the GitHub issues.
|
|
390
|
-
|
|
391
|
-
See the [project roadmap](https://github.com/wexample/python-wex_addon_dev_javascript/issues) for upcoming features and improvements.
|
|
392
|
-
|
|
393
|
-
## Status & Compatibility
|
|
394
|
-
|
|
395
|
-
**Maturity**: Production-ready
|
|
396
|
-
|
|
397
|
-
**Python Support**: >=3.10
|
|
398
|
-
|
|
399
|
-
**OS Support**: Linux, macOS, Windows
|
|
400
|
-
|
|
401
|
-
**Status**: Actively maintained
|
|
402
|
-
|
|
403
|
-
## Useful Links
|
|
404
|
-
|
|
405
|
-
- **Homepage**: https://github.com/wexample/python-wex-addon-dev-javascript
|
|
406
|
-
- **Documentation**: [docs.wexample.com](https://docs.wexample.com)
|
|
407
|
-
- **Issue Tracker**: https://github.com/wexample/python-wex-addon-dev-javascript/issues
|
|
408
|
-
- **Discussions**: https://github.com/wexample/python-wex-addon-dev-javascript/discussions
|
|
409
|
-
- **PyPI**: [pypi.org/project/wex_addon_dev_javascript](https://pypi.org/project/wex_addon_dev_javascript/)
|
|
410
|
-
|
|
411
|
-
## Migration Notes
|
|
412
|
-
|
|
413
|
-
When upgrading between major versions, refer to the migration guides in the documentation.
|
|
414
|
-
|
|
415
|
-
Breaking changes are clearly documented with upgrade paths and examples.
|
|
416
|
-
|
|
417
|
-
## Known Limitations & Roadmap
|
|
418
|
-
|
|
419
|
-
Current limitations and planned features are tracked in the GitHub issues.
|
|
420
|
-
|
|
421
|
-
See the [project roadmap](https://github.com/wexample/python-wex_addon_dev_javascript/issues) for upcoming features and improvements.
|
|
422
|
-
|
|
423
|
-
## Status & Compatibility
|
|
424
|
-
|
|
425
|
-
**Maturity**: Production-ready
|
|
426
|
-
|
|
427
|
-
**Python Support**: >=3.10
|
|
428
|
-
|
|
429
|
-
**OS Support**: Linux, macOS, Windows
|
|
430
|
-
|
|
431
|
-
**Status**: Actively maintained
|
|
432
|
-
|
|
433
|
-
## Useful Links
|
|
434
|
-
|
|
435
|
-
- **Homepage**: https://github.com/wexample/python-wex-addon-dev-javascript
|
|
436
|
-
- **Documentation**: [docs.wexample.com](https://docs.wexample.com)
|
|
437
|
-
- **Issue Tracker**: https://github.com/wexample/python-wex-addon-dev-javascript/issues
|
|
438
|
-
- **Discussions**: https://github.com/wexample/python-wex-addon-dev-javascript/discussions
|
|
439
|
-
- **PyPI**: [pypi.org/project/wex_addon_dev_javascript](https://pypi.org/project/wex_addon_dev_javascript/)
|
|
440
|
-
|
|
441
|
-
## Migration Notes
|
|
442
|
-
|
|
443
|
-
When upgrading between major versions, refer to the migration guides in the documentation.
|
|
444
|
-
|
|
445
|
-
Breaking changes are clearly documented with upgrade paths and examples.
|
|
446
|
-
|
|
447
|
-
## Known Limitations & Roadmap
|
|
448
|
-
|
|
449
|
-
Current limitations and planned features are tracked in the GitHub issues.
|
|
450
|
-
|
|
451
|
-
See the [project roadmap](https://github.com/wexample/python-wex_addon_dev_javascript/issues) for upcoming features and improvements.
|
|
452
|
-
|
|
453
|
-
## Status & Compatibility
|
|
454
|
-
|
|
455
|
-
**Maturity**: Production-ready
|
|
456
|
-
|
|
457
|
-
**Python Support**: >=3.10
|
|
458
|
-
|
|
459
|
-
**OS Support**: Linux, macOS, Windows
|
|
460
|
-
|
|
461
|
-
**Status**: Actively maintained
|
|
462
|
-
|
|
463
|
-
## Useful Links
|
|
464
|
-
|
|
465
|
-
- **Homepage**: https://github.com/wexample/python-wex-addon-dev-javascript
|
|
466
|
-
- **Documentation**: [docs.wexample.com](https://docs.wexample.com)
|
|
467
|
-
- **Issue Tracker**: https://github.com/wexample/python-wex-addon-dev-javascript/issues
|
|
468
|
-
- **Discussions**: https://github.com/wexample/python-wex-addon-dev-javascript/discussions
|
|
469
|
-
- **PyPI**: [pypi.org/project/wex_addon_dev_javascript](https://pypi.org/project/wex_addon_dev_javascript/)
|
|
470
|
-
|
|
471
|
-
## Migration Notes
|
|
472
|
-
|
|
473
|
-
When upgrading between major versions, refer to the migration guides in the documentation.
|
|
474
|
-
|
|
475
|
-
Breaking changes are clearly documented with upgrade paths and examples.
|
|
File without changes
|