itw-python-builder 0.1.29__tar.gz → 0.1.30__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.
- {itw_python_builder-0.1.29 → itw_python_builder-0.1.30}/PKG-INFO +1 -1
- {itw_python_builder-0.1.29 → itw_python_builder-0.1.30}/itw_python_builder/ssr_tasks.py +34 -7
- {itw_python_builder-0.1.29 → itw_python_builder-0.1.30}/itw_python_builder.egg-info/PKG-INFO +1 -1
- {itw_python_builder-0.1.29 → itw_python_builder-0.1.30}/pyproject.toml +1 -1
- {itw_python_builder-0.1.29 → itw_python_builder-0.1.30}/LICENSE +0 -0
- {itw_python_builder-0.1.29 → itw_python_builder-0.1.30}/README.md +0 -0
- {itw_python_builder-0.1.29 → itw_python_builder-0.1.30}/itw_python_builder/.pylintrc +0 -0
- {itw_python_builder-0.1.29 → itw_python_builder-0.1.30}/itw_python_builder/__init__.py +0 -0
- {itw_python_builder-0.1.29 → itw_python_builder-0.1.30}/itw_python_builder/cli.py +0 -0
- {itw_python_builder-0.1.29 → itw_python_builder-0.1.30}/itw_python_builder/tasks.py +0 -0
- {itw_python_builder-0.1.29 → itw_python_builder-0.1.30}/itw_python_builder/templates/server.sitemap.snippet.ts +0 -0
- {itw_python_builder-0.1.29 → itw_python_builder-0.1.30}/itw_python_builder/templates/sitemap.routes.ts +0 -0
- {itw_python_builder-0.1.29 → itw_python_builder-0.1.30}/itw_python_builder/utils.py +0 -0
- {itw_python_builder-0.1.29 → itw_python_builder-0.1.30}/itw_python_builder/version.py +0 -0
- {itw_python_builder-0.1.29 → itw_python_builder-0.1.30}/itw_python_builder.egg-info/SOURCES.txt +0 -0
- {itw_python_builder-0.1.29 → itw_python_builder-0.1.30}/itw_python_builder.egg-info/dependency_links.txt +0 -0
- {itw_python_builder-0.1.29 → itw_python_builder-0.1.30}/itw_python_builder.egg-info/entry_points.txt +0 -0
- {itw_python_builder-0.1.29 → itw_python_builder-0.1.30}/itw_python_builder.egg-info/requires.txt +0 -0
- {itw_python_builder-0.1.29 → itw_python_builder-0.1.30}/itw_python_builder.egg-info/top_level.txt +0 -0
- {itw_python_builder-0.1.29 → itw_python_builder-0.1.30}/setup.cfg +0 -0
|
@@ -34,6 +34,20 @@ def _angular_major_version() -> int:
|
|
|
34
34
|
return int(match.group(1)) if match else 0
|
|
35
35
|
|
|
36
36
|
|
|
37
|
+
def _angular_core_installed_version() -> str:
|
|
38
|
+
"""Return the exact installed @angular/core version from node_modules, or '' if not found.
|
|
39
|
+
|
|
40
|
+
Used to pin `ng add @angular/ssr@<this>` so platform-server's strict peer-deps
|
|
41
|
+
(which demand the same patch across all @angular/* packages) align with what's
|
|
42
|
+
already installed — no need for --legacy-peer-deps or --force.
|
|
43
|
+
"""
|
|
44
|
+
pkg_path = os.path.join(os.getcwd(), 'node_modules', '@angular', 'core', 'package.json')
|
|
45
|
+
if not os.path.isfile(pkg_path):
|
|
46
|
+
return ''
|
|
47
|
+
with open(pkg_path, 'r', encoding='utf-8') as fp:
|
|
48
|
+
return json.load(fp).get('version', '')
|
|
49
|
+
|
|
50
|
+
|
|
37
51
|
TEMPLATES_DIR = Path(__file__).parent / 'templates'
|
|
38
52
|
|
|
39
53
|
SITEMAP_IMPORT_LINE = "import {sitemapEntries} from './src/sitemap.routes';"
|
|
@@ -51,18 +65,31 @@ def _load_template(name: str) -> str:
|
|
|
51
65
|
|
|
52
66
|
|
|
53
67
|
def _run_ng_add_ssr(ctx: Context) -> None:
|
|
54
|
-
"""Run `ng add @angular/ssr`
|
|
55
|
-
|
|
56
|
-
Angular
|
|
57
|
-
|
|
58
|
-
|
|
68
|
+
"""Run `ng add @angular/ssr` pinned to the project's installed @angular/core patch.
|
|
69
|
+
|
|
70
|
+
Angular's @angular/platform-server (pulled in by @angular/ssr) has strict
|
|
71
|
+
peer-dependencies — every patch version demands the exact same patch across
|
|
72
|
+
all @angular/* packages. Without pinning, `ng add` grabs the latest patch and
|
|
73
|
+
breaks any project not on that exact patch. Pinning to the installed core
|
|
74
|
+
version aligns everything cleanly without bypassing npm's resolver.
|
|
75
|
+
|
|
76
|
+
Flags:
|
|
77
|
+
- Angular 18 and earlier: no `--server-routing` flag (schematic rejects it).
|
|
78
|
+
- Angular 19+: pass `--server-routing=false` to keep the classic setup,
|
|
79
|
+
matching the layout itw expects (single `server` target, not the new
|
|
80
|
+
server router).
|
|
59
81
|
"""
|
|
60
82
|
major = _angular_major_version()
|
|
83
|
+
installed_core = _angular_core_installed_version()
|
|
84
|
+
if installed_core:
|
|
85
|
+
package_spec = f'@angular/ssr@{installed_core}'
|
|
86
|
+
else:
|
|
87
|
+
package_spec = '@angular/ssr'
|
|
61
88
|
flags = '--skip-confirmation'
|
|
62
89
|
if major >= 19:
|
|
63
90
|
flags += ' --server-routing=false'
|
|
64
|
-
print(f'[itw] Running `ng add
|
|
65
|
-
ctx.run(f'npx ng add
|
|
91
|
+
print(f'[itw] Running `ng add {package_spec}` (Angular {major}, this may take a minute)...')
|
|
92
|
+
ctx.run(f'npx ng add {package_spec} {flags}')
|
|
66
93
|
|
|
67
94
|
|
|
68
95
|
def _install_ngx_seo_helper(ctx: Context) -> None:
|
|
@@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta"
|
|
|
4
4
|
|
|
5
5
|
[project]
|
|
6
6
|
name = "itw_python_builder"
|
|
7
|
-
version = "0.1.
|
|
7
|
+
version = "0.1.30"
|
|
8
8
|
description = "Standardized Django deployment pipeline with Docker, testing, and SonarQube integration"
|
|
9
9
|
readme = "README.md"
|
|
10
10
|
requires-python = ">=3.10"
|
|
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
|
{itw_python_builder-0.1.29 → itw_python_builder-0.1.30}/itw_python_builder.egg-info/SOURCES.txt
RENAMED
|
File without changes
|
|
File without changes
|
{itw_python_builder-0.1.29 → itw_python_builder-0.1.30}/itw_python_builder.egg-info/entry_points.txt
RENAMED
|
File without changes
|
{itw_python_builder-0.1.29 → itw_python_builder-0.1.30}/itw_python_builder.egg-info/requires.txt
RENAMED
|
File without changes
|
{itw_python_builder-0.1.29 → itw_python_builder-0.1.30}/itw_python_builder.egg-info/top_level.txt
RENAMED
|
File without changes
|
|
File without changes
|