wexample-wex-addon-dev-javascript 7.13.1__tar.gz → 7.15.0__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.
Files changed (41) hide show
  1. {wexample_wex_addon_dev_javascript-7.13.1 → wexample_wex_addon_dev_javascript-7.15.0}/PKG-INFO +6 -6
  2. {wexample_wex_addon_dev_javascript-7.13.1 → wexample_wex_addon_dev_javascript-7.15.0}/README.md +3 -3
  3. {wexample_wex_addon_dev_javascript-7.13.1 → wexample_wex_addon_dev_javascript-7.15.0}/pyproject.toml +3 -3
  4. {wexample_wex_addon_dev_javascript-7.13.1 → wexample_wex_addon_dev_javascript-7.15.0}/src/wexample_wex_addon_dev_javascript/common/npm_registry_gateway.py +1 -1
  5. {wexample_wex_addon_dev_javascript-7.13.1 → wexample_wex_addon_dev_javascript-7.15.0}/src/wexample_wex_addon_dev_javascript/file/javascript_package_json_file.py +14 -19
  6. {wexample_wex_addon_dev_javascript-7.13.1 → wexample_wex_addon_dev_javascript-7.15.0}/src/wexample_wex_addon_dev_javascript/file/javascript_tsconfig_json_file.py +1 -1
  7. {wexample_wex_addon_dev_javascript-7.13.1 → wexample_wex_addon_dev_javascript-7.15.0}/src/wexample_wex_addon_dev_javascript/services/vite/commands/service/install.py +11 -9
  8. {wexample_wex_addon_dev_javascript-7.13.1 → wexample_wex_addon_dev_javascript-7.15.0}/src/wexample_wex_addon_dev_javascript/services/vite/commands/service/ready.py +4 -1
  9. {wexample_wex_addon_dev_javascript-7.13.1 → wexample_wex_addon_dev_javascript-7.15.0}/src/wexample_wex_addon_dev_javascript/workdir/javascript_package_workdir.py +28 -35
  10. {wexample_wex_addon_dev_javascript-7.13.1 → wexample_wex_addon_dev_javascript-7.15.0}/src/wexample_wex_addon_dev_javascript/workdir/javascript_workdir.py +1 -5
  11. {wexample_wex_addon_dev_javascript-7.13.1 → wexample_wex_addon_dev_javascript-7.15.0}/src/wexample_wex_addon_dev_javascript/__init__.py +0 -0
  12. {wexample_wex_addon_dev_javascript-7.13.1 → wexample_wex_addon_dev_javascript-7.15.0}/src/wexample_wex_addon_dev_javascript/__pycache__/__init__.py +0 -0
  13. {wexample_wex_addon_dev_javascript-7.13.1 → wexample_wex_addon_dev_javascript-7.15.0}/src/wexample_wex_addon_dev_javascript/common/__init__.py +0 -0
  14. {wexample_wex_addon_dev_javascript-7.13.1 → wexample_wex_addon_dev_javascript-7.15.0}/src/wexample_wex_addon_dev_javascript/config_value/__init__.py +0 -0
  15. {wexample_wex_addon_dev_javascript-7.13.1 → wexample_wex_addon_dev_javascript-7.15.0}/src/wexample_wex_addon_dev_javascript/config_value/javascript_package_readme_config_value.py +0 -0
  16. {wexample_wex_addon_dev_javascript-7.13.1 → wexample_wex_addon_dev_javascript-7.15.0}/src/wexample_wex_addon_dev_javascript/const/__init__.py +0 -0
  17. {wexample_wex_addon_dev_javascript-7.13.1 → wexample_wex_addon_dev_javascript-7.15.0}/src/wexample_wex_addon_dev_javascript/const/tags.py +0 -0
  18. {wexample_wex_addon_dev_javascript-7.13.1 → wexample_wex_addon_dev_javascript-7.15.0}/src/wexample_wex_addon_dev_javascript/file/__init__.py +0 -0
  19. {wexample_wex_addon_dev_javascript-7.13.1 → wexample_wex_addon_dev_javascript-7.15.0}/src/wexample_wex_addon_dev_javascript/javascript_addon_manager.py +0 -0
  20. {wexample_wex_addon_dev_javascript-7.13.1 → wexample_wex_addon_dev_javascript-7.15.0}/src/wexample_wex_addon_dev_javascript/py.typed +0 -0
  21. {wexample_wex_addon_dev_javascript-7.13.1 → wexample_wex_addon_dev_javascript-7.15.0}/src/wexample_wex_addon_dev_javascript/resources/.wex.yml +0 -0
  22. {wexample_wex_addon_dev_javascript-7.13.1 → wexample_wex_addon_dev_javascript-7.15.0}/src/wexample_wex_addon_dev_javascript/resources/package_publish.yml +0 -0
  23. {wexample_wex_addon_dev_javascript-7.13.1 → wexample_wex_addon_dev_javascript-7.15.0}/src/wexample_wex_addon_dev_javascript/services/__init__.py +0 -0
  24. {wexample_wex_addon_dev_javascript-7.13.1 → wexample_wex_addon_dev_javascript-7.15.0}/src/wexample_wex_addon_dev_javascript/services/node/__init__.py +0 -0
  25. {wexample_wex_addon_dev_javascript-7.13.1 → wexample_wex_addon_dev_javascript-7.15.0}/src/wexample_wex_addon_dev_javascript/services/node/docker/.wex.yml +0 -0
  26. {wexample_wex_addon_dev_javascript-7.13.1 → wexample_wex_addon_dev_javascript-7.15.0}/src/wexample_wex_addon_dev_javascript/services/node/docker/docker-compose.yml +0 -0
  27. {wexample_wex_addon_dev_javascript-7.13.1 → wexample_wex_addon_dev_javascript-7.15.0}/src/wexample_wex_addon_dev_javascript/services/node/service.yml +0 -0
  28. {wexample_wex_addon_dev_javascript-7.13.1 → wexample_wex_addon_dev_javascript-7.15.0}/src/wexample_wex_addon_dev_javascript/services/vite/__init__.py +0 -0
  29. {wexample_wex_addon_dev_javascript-7.13.1 → wexample_wex_addon_dev_javascript-7.15.0}/src/wexample_wex_addon_dev_javascript/services/vite/ai/__init__.py +0 -0
  30. {wexample_wex_addon_dev_javascript-7.13.1 → wexample_wex_addon_dev_javascript-7.15.0}/src/wexample_wex_addon_dev_javascript/services/vite/ai/agents/__init__.py +0 -0
  31. {wexample_wex_addon_dev_javascript-7.13.1 → wexample_wex_addon_dev_javascript-7.15.0}/src/wexample_wex_addon_dev_javascript/services/vite/ai/agents/main/__init__.py +0 -0
  32. {wexample_wex_addon_dev_javascript-7.13.1 → wexample_wex_addon_dev_javascript-7.15.0}/src/wexample_wex_addon_dev_javascript/services/vite/ai/agents/main/about-service.md +0 -0
  33. {wexample_wex_addon_dev_javascript-7.13.1 → wexample_wex_addon_dev_javascript-7.15.0}/src/wexample_wex_addon_dev_javascript/services/vite/ai/agents/main/agent.yml +0 -0
  34. {wexample_wex_addon_dev_javascript-7.13.1 → wexample_wex_addon_dev_javascript-7.15.0}/src/wexample_wex_addon_dev_javascript/services/vite/app_service.py +0 -0
  35. {wexample_wex_addon_dev_javascript-7.13.1 → wexample_wex_addon_dev_javascript-7.15.0}/src/wexample_wex_addon_dev_javascript/services/vite/commands/__init__.py +0 -0
  36. {wexample_wex_addon_dev_javascript-7.13.1 → wexample_wex_addon_dev_javascript-7.15.0}/src/wexample_wex_addon_dev_javascript/services/vite/commands/service/__init__.py +0 -0
  37. {wexample_wex_addon_dev_javascript-7.13.1 → wexample_wex_addon_dev_javascript-7.15.0}/src/wexample_wex_addon_dev_javascript/services/vite/docker/.wex.yml +0 -0
  38. {wexample_wex_addon_dev_javascript-7.13.1 → wexample_wex_addon_dev_javascript-7.15.0}/src/wexample_wex_addon_dev_javascript/services/vite/docker/docker-compose.yml +0 -0
  39. {wexample_wex_addon_dev_javascript-7.13.1 → wexample_wex_addon_dev_javascript-7.15.0}/src/wexample_wex_addon_dev_javascript/services/vite/service.yml +0 -0
  40. {wexample_wex_addon_dev_javascript-7.13.1 → wexample_wex_addon_dev_javascript-7.15.0}/src/wexample_wex_addon_dev_javascript/workdir/__init__.py +0 -0
  41. {wexample_wex_addon_dev_javascript-7.13.1 → wexample_wex_addon_dev_javascript-7.15.0}/src/wexample_wex_addon_dev_javascript/workdir/javascript_packages_suite_workdir.py +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: wexample-wex-addon-dev-javascript
3
- Version: 7.13.1
3
+ Version: 7.15.0
4
4
  Summary: Python dev addon for wex
5
5
  Author-Email: weeger <contact@wexample.com>
6
6
  License: MIT
@@ -13,8 +13,8 @@ Requires-Dist: attrs>=23.1.0
13
13
  Requires-Dist: cattrs>=23.1.0
14
14
  Requires-Dist: wexample-api>=6.6.0
15
15
  Requires-Dist: wexample-filestate-javascript>=6.5.0
16
- Requires-Dist: wexample-wex-addon-ai>=11.1.0
17
- Requires-Dist: wexample-wex-addon-app>=25.4.0
16
+ Requires-Dist: wexample-wex-addon-ai>=11.3.0
17
+ Requires-Dist: wexample-wex-addon-app>=26.1.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: 7.13.1
25
+ Version: 7.15.0
26
26
 
27
27
  Python dev addon for wex
28
28
 
@@ -106,8 +106,8 @@ Visit the [Wexample Suite documentation](https://docs.wexample.com) for the comp
106
106
  - cattrs: >=23.1.0
107
107
  - wexample-api: >=6.6.0
108
108
  - wexample-filestate-javascript: >=6.5.0
109
- - wexample-wex-addon-ai: >=11.1.0
110
- - wexample-wex-addon-app: >=25.4.0
109
+ - wexample-wex-addon-ai: >=11.3.0
110
+ - wexample-wex-addon-app: >=26.1.0
111
111
 
112
112
  ## Versioning & Compatibility Policy
113
113
 
@@ -1,6 +1,6 @@
1
1
  # wex_addon_dev_javascript
2
2
 
3
- Version: 7.13.1
3
+ Version: 7.15.0
4
4
 
5
5
  Python dev addon for wex
6
6
 
@@ -84,8 +84,8 @@ Visit the [Wexample Suite documentation](https://docs.wexample.com) for the comp
84
84
  - cattrs: >=23.1.0
85
85
  - wexample-api: >=6.6.0
86
86
  - wexample-filestate-javascript: >=6.5.0
87
- - wexample-wex-addon-ai: >=11.1.0
88
- - wexample-wex-addon-app: >=25.4.0
87
+ - wexample-wex-addon-ai: >=11.3.0
88
+ - wexample-wex-addon-app: >=26.1.0
89
89
 
90
90
  ## Versioning & Compatibility Policy
91
91
 
@@ -6,7 +6,7 @@ build-backend = "pdm.backend"
6
6
 
7
7
  [project]
8
8
  name = "wexample-wex-addon-dev-javascript"
9
- version = "7.13.1"
9
+ version = "7.15.0"
10
10
  description = "Python dev addon for wex"
11
11
  authors = [
12
12
  { name = "weeger", email = "contact@wexample.com" },
@@ -22,8 +22,8 @@ dependencies = [
22
22
  "cattrs>=23.1.0",
23
23
  "wexample-api>=6.6.0",
24
24
  "wexample-filestate-javascript>=6.5.0",
25
- "wexample-wex-addon-ai>=11.1.0",
26
- "wexample-wex-addon-app>=25.4.0",
25
+ "wexample-wex-addon-ai>=11.3.0",
26
+ "wexample-wex-addon-app>=26.1.0",
27
27
  ]
28
28
 
29
29
  [project.readme]
@@ -41,4 +41,4 @@ class NpmRegistryGateway(AbstractGateway):
41
41
  )
42
42
  if response is None or response.status_code != 200:
43
43
  return False
44
- return version in (response.json().get("versions") or {})
44
+ return version in response.json().get("versions", {})
@@ -69,7 +69,7 @@ class JavascriptPackageJsonFile(AppDependenciesConfigFileMixin, JsonFile):
69
69
 
70
70
  self._apply_default_publish_config(content)
71
71
 
72
- return super().dumps(content or {})
72
+ return super().dumps(content)
73
73
 
74
74
  def get_dependencies_versions(
75
75
  self, optional: bool = False, group: str = "dev"
@@ -101,34 +101,29 @@ class JavascriptPackageJsonFile(AppDependenciesConfigFileMixin, JsonFile):
101
101
  # Default strategy: publish built artifacts (dist) so consumers don't need
102
102
  # to transpile TS/ESM sources from node_modules.
103
103
  if exports is None and (files is None or (uses_src and not uses_dist)):
104
- content.setdefault("files", ["dist"])
105
- content.setdefault(
106
- "exports",
107
- {
104
+ if "files" not in content:
105
+ content["files"] = ["dist"]
106
+ if "exports" not in content:
107
+ content["exports"] = {
108
108
  "./*": {
109
109
  "types": "./dist/*.d.ts",
110
110
  "default": "./dist/*.js",
111
111
  }
112
- },
113
- )
114
- content.setdefault(
115
- "typesVersions",
116
- {
112
+ }
113
+ if "typesVersions" not in content:
114
+ content["typesVersions"] = {
117
115
  "*": {
118
116
  "*": ["dist/*"],
119
117
  }
120
- },
121
- )
118
+ }
122
119
  return
123
120
 
124
121
  if uses_src and not uses_dist:
125
- if files is None:
126
- content.setdefault("files", ["src"])
127
- content.setdefault(
128
- "typesVersions",
129
- {
122
+ if files is None and "files" not in content:
123
+ content["files"] = ["src"]
124
+ if "typesVersions" not in content:
125
+ content["typesVersions"] = {
130
126
  "*": {
131
127
  "*": ["src/*"],
132
128
  }
133
- },
134
- )
129
+ }
@@ -10,7 +10,7 @@ class JavascriptTsconfigJsonFile(JsonFile):
10
10
  content = content or self.read_parsed()
11
11
 
12
12
  compiler_options = content.get("compilerOptions")
13
- if compiler_options is None or not isinstance(compiler_options, dict):
13
+ if not isinstance(compiler_options, dict):
14
14
  compiler_options = {}
15
15
  content["compilerOptions"] = compiler_options
16
16
 
@@ -1,5 +1,6 @@
1
1
  from __future__ import annotations
2
2
 
3
+ import re
3
4
  from typing import TYPE_CHECKING
4
5
 
5
6
  from wexample_cli.const.tags import AudienceTag, EffectTag, ScopeTag
@@ -12,6 +13,9 @@ if TYPE_CHECKING:
12
13
  from wexample_cli.context.execution_context import ExecutionContext
13
14
  from wexample_wex_addon_app.service.app_service import AppService
14
15
 
16
+ _DEFINE_CONFIG_RE = re.compile(r"(defineConfig\(\s*\{)")
17
+ _VITE_CONFIG_NAMES = ("vite.config.ts", "vite.config.js")
18
+
15
19
 
16
20
  @command(
17
21
  type=COMMAND_TYPE_SERVICE,
@@ -30,11 +34,9 @@ def vite__service__install(
30
34
  context: ExecutionContext,
31
35
  service: AppService,
32
36
  ) -> None:
33
- import re
34
-
35
37
  app_path = service.app_workdir.get_path()
36
38
 
37
- for config_name in ["vite.config.ts", "vite.config.js"]:
39
+ for config_name in _VITE_CONFIG_NAMES:
38
40
  config_path = app_path / config_name
39
41
  if not config_path.exists():
40
42
  continue
@@ -52,16 +54,16 @@ def vite__service__install(
52
54
  "defineConfig()",
53
55
  "defineConfig({ vite: { server: { allowedHosts: true } } })",
54
56
  )
55
- elif re.search(r"defineConfig\(\s*\{", content):
56
- content = re.sub(
57
- r"(defineConfig\(\s*\{)",
57
+ else:
58
+ new_content, n = _DEFINE_CONFIG_RE.subn(
58
59
  r"\1 vite: { server: { allowedHosts: true } },",
59
60
  content,
60
61
  count=1,
61
62
  )
62
- else:
63
- context.io.log(f" {config_name}: unrecognized format, skipping")
64
- return
63
+ if not n:
64
+ context.io.log(f" {config_name}: unrecognized format, skipping")
65
+ return
66
+ content = new_content
65
67
 
66
68
  config_path.write_text(content)
67
69
  context.io.log(f" ✓ {config_name}: allowedHosts patched")
@@ -41,7 +41,10 @@ def vite__service__ready(
41
41
  runtime = service.app_workdir.get_runtime_config()
42
42
  app_project_name = runtime.search("app.project_name").get_str()
43
43
  container_name = f"{app_project_name}_vite"
44
- port = service.manifest.get("vars", {}).get("VITE_PORT", {}).get("default", "8080")
44
+ try:
45
+ port = service.manifest["vars"]["VITE_PORT"]["default"]
46
+ except (KeyError, TypeError):
47
+ port = "8080"
45
48
 
46
49
  result = subprocess.run(
47
50
  [
@@ -45,35 +45,33 @@ class JavascriptPackageWorkdir(JavascriptWorkdir):
45
45
  raw_value = super().prepare_value(raw_value=raw_value)
46
46
  children = raw_value["children"]
47
47
 
48
- children.extend(
49
- [
50
- {
51
- "name": ".github",
52
- "type": DiskItemType.DIRECTORY,
53
- "should_exist": True,
54
- "children": [
55
- {
56
- "name": "workflows",
57
- "type": DiskItemType.DIRECTORY,
58
- "should_exist": True,
59
- "children": [
60
- {
61
- "name": "publish.yml",
62
- "type": DiskItemType.FILE,
63
- "should_exist": True,
64
- "content": file_read(
65
- module_get_path(
66
- wexample_wex_addon_dev_javascript
67
- )
68
- / "resources"
69
- / "package_publish.yml"
70
- ),
71
- }
72
- ],
73
- }
74
- ],
75
- }
76
- ]
48
+ children.append(
49
+ {
50
+ "name": ".github",
51
+ "type": DiskItemType.DIRECTORY,
52
+ "should_exist": True,
53
+ "children": [
54
+ {
55
+ "name": "workflows",
56
+ "type": DiskItemType.DIRECTORY,
57
+ "should_exist": True,
58
+ "children": [
59
+ {
60
+ "name": "publish.yml",
61
+ "type": DiskItemType.FILE,
62
+ "should_exist": True,
63
+ "content": file_read(
64
+ module_get_path(
65
+ wexample_wex_addon_dev_javascript
66
+ )
67
+ / "resources"
68
+ / "package_publish.yml"
69
+ ),
70
+ }
71
+ ],
72
+ }
73
+ ],
74
+ }
77
75
  )
78
76
 
79
77
  return raw_value
@@ -107,12 +105,7 @@ class JavascriptPackageWorkdir(JavascriptWorkdir):
107
105
  check=False,
108
106
  capture=True,
109
107
  )
110
- ts_files = [
111
- f
112
- for f in changed_files.stdout.splitlines()
113
- if f.endswith(".ts") or f.endswith(".tsx")
114
- ]
115
- if not ts_files:
108
+ if not any(f.endswith((".ts", ".tsx")) for f in changed_files.stdout.splitlines()):
116
109
  self.log("Only non-TypeScript files changed in src/, treating as minor.")
117
110
  return UPGRADE_TYPE_INTERMEDIATE
118
111
 
@@ -47,11 +47,7 @@ class JavascriptWorkdir(WithAiWorkdirMixin, CodeBaseWorkdir):
47
47
 
48
48
  options = super().get_options_providers()
49
49
 
50
- options.extend(
51
- [
52
- JavascriptOptionsProvider,
53
- ]
54
- )
50
+ options.append(JavascriptOptionsProvider)
55
51
 
56
52
  return options
57
53