itw-python-builder 0.1.27__tar.gz → 0.1.29__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.27 → itw_python_builder-0.1.29}/PKG-INFO +1 -1
- {itw_python_builder-0.1.27 → itw_python_builder-0.1.29}/itw_python_builder/ssr_tasks.py +24 -2
- {itw_python_builder-0.1.27 → itw_python_builder-0.1.29}/itw_python_builder/tasks.py +6 -0
- {itw_python_builder-0.1.27 → itw_python_builder-0.1.29}/itw_python_builder.egg-info/PKG-INFO +1 -1
- {itw_python_builder-0.1.27 → itw_python_builder-0.1.29}/pyproject.toml +1 -1
- {itw_python_builder-0.1.27 → itw_python_builder-0.1.29}/LICENSE +0 -0
- {itw_python_builder-0.1.27 → itw_python_builder-0.1.29}/README.md +0 -0
- {itw_python_builder-0.1.27 → itw_python_builder-0.1.29}/itw_python_builder/.pylintrc +0 -0
- {itw_python_builder-0.1.27 → itw_python_builder-0.1.29}/itw_python_builder/__init__.py +0 -0
- {itw_python_builder-0.1.27 → itw_python_builder-0.1.29}/itw_python_builder/cli.py +0 -0
- {itw_python_builder-0.1.27 → itw_python_builder-0.1.29}/itw_python_builder/templates/server.sitemap.snippet.ts +0 -0
- {itw_python_builder-0.1.27 → itw_python_builder-0.1.29}/itw_python_builder/templates/sitemap.routes.ts +0 -0
- {itw_python_builder-0.1.27 → itw_python_builder-0.1.29}/itw_python_builder/utils.py +0 -0
- {itw_python_builder-0.1.27 → itw_python_builder-0.1.29}/itw_python_builder/version.py +0 -0
- {itw_python_builder-0.1.27 → itw_python_builder-0.1.29}/itw_python_builder.egg-info/SOURCES.txt +0 -0
- {itw_python_builder-0.1.27 → itw_python_builder-0.1.29}/itw_python_builder.egg-info/dependency_links.txt +0 -0
- {itw_python_builder-0.1.27 → itw_python_builder-0.1.29}/itw_python_builder.egg-info/entry_points.txt +0 -0
- {itw_python_builder-0.1.27 → itw_python_builder-0.1.29}/itw_python_builder.egg-info/requires.txt +0 -0
- {itw_python_builder-0.1.27 → itw_python_builder-0.1.29}/itw_python_builder.egg-info/top_level.txt +0 -0
- {itw_python_builder-0.1.27 → itw_python_builder-0.1.29}/setup.cfg +0 -0
|
@@ -13,6 +13,7 @@ on which Angular SSR setup the project ended up with:
|
|
|
13
13
|
modern application builder (Angular 17+, fresh `ng add @angular/ssr`)
|
|
14
14
|
→ ng build --configuration=X
|
|
15
15
|
"""
|
|
16
|
+
import json
|
|
16
17
|
import os
|
|
17
18
|
import re
|
|
18
19
|
from pathlib import Path
|
|
@@ -22,6 +23,17 @@ from invoke import task, Context
|
|
|
22
23
|
from itw_python_builder.utils import detect_project_type, _read_package_name, is_ssr_project
|
|
23
24
|
|
|
24
25
|
|
|
26
|
+
def _angular_major_version() -> int:
|
|
27
|
+
"""Read @angular/core's major version from package.json. Returns 0 if not found."""
|
|
28
|
+
pkg_path = os.path.join(os.getcwd(), 'package.json')
|
|
29
|
+
with open(pkg_path, 'r', encoding='utf-8') as fp:
|
|
30
|
+
data = json.load(fp)
|
|
31
|
+
deps = {**data.get('dependencies', {}), **data.get('devDependencies', {})}
|
|
32
|
+
spec = deps.get('@angular/core', '')
|
|
33
|
+
match = re.match(r'[\^~>=<]*(\d+)', spec)
|
|
34
|
+
return int(match.group(1)) if match else 0
|
|
35
|
+
|
|
36
|
+
|
|
25
37
|
TEMPLATES_DIR = Path(__file__).parent / 'templates'
|
|
26
38
|
|
|
27
39
|
SITEMAP_IMPORT_LINE = "import {sitemapEntries} from './src/sitemap.routes';"
|
|
@@ -39,8 +51,18 @@ def _load_template(name: str) -> str:
|
|
|
39
51
|
|
|
40
52
|
|
|
41
53
|
def _run_ng_add_ssr(ctx: Context) -> None:
|
|
42
|
-
|
|
43
|
-
|
|
54
|
+
"""Run `ng add @angular/ssr` with flags appropriate to the project's Angular version.
|
|
55
|
+
|
|
56
|
+
Angular 18 and earlier: no `--server-routing` flag (schematic rejects it).
|
|
57
|
+
Angular 19+: pass `--server-routing=false` to keep the classic setup, matching
|
|
58
|
+
the layout itw expects (single `server` target, not the new server router).
|
|
59
|
+
"""
|
|
60
|
+
major = _angular_major_version()
|
|
61
|
+
flags = '--skip-confirmation'
|
|
62
|
+
if major >= 19:
|
|
63
|
+
flags += ' --server-routing=false'
|
|
64
|
+
print(f'[itw] Running `ng add @angular/ssr` (Angular {major}, this may take a minute)...')
|
|
65
|
+
ctx.run(f'npx ng add @angular/ssr {flags}')
|
|
44
66
|
|
|
45
67
|
|
|
46
68
|
def _install_ngx_seo_helper(ctx: Context) -> None:
|
|
@@ -66,12 +66,18 @@ def package_dist(ctx: Context) -> None:
|
|
|
66
66
|
ctx.run('tar -czf dist.tar.gz -C dist .')
|
|
67
67
|
|
|
68
68
|
|
|
69
|
+
_GITLAB_API_HOST_MAP = {
|
|
70
|
+
'git.it-works.io': 'gitlab.it-works.io',
|
|
71
|
+
}
|
|
72
|
+
|
|
73
|
+
|
|
69
74
|
def upload_dist(ctx: Context, version) -> None:
|
|
70
75
|
"""Upload dist.tar.gz to this project's GitLab Generic Package Registry under <version>/."""
|
|
71
76
|
from urllib.parse import quote
|
|
72
77
|
if not os.environ.get('GITLAB_TOKEN'):
|
|
73
78
|
raise RuntimeError('GITLAB_TOKEN not set; run `itw login` first.')
|
|
74
79
|
host, path = _parse_gitlab_remote(ctx)
|
|
80
|
+
host = _GITLAB_API_HOST_MAP.get(host, host)
|
|
75
81
|
encoded = quote(path, safe='')
|
|
76
82
|
url = f'https://{host}/api/v4/projects/{encoded}/packages/generic/frontend/{version}/dist.tar.gz'
|
|
77
83
|
print(f'[itw] Uploading dist.tar.gz → {url}')
|
|
@@ -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.29"
|
|
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
|
{itw_python_builder-0.1.27 → itw_python_builder-0.1.29}/itw_python_builder.egg-info/SOURCES.txt
RENAMED
|
File without changes
|
|
File without changes
|
{itw_python_builder-0.1.27 → itw_python_builder-0.1.29}/itw_python_builder.egg-info/entry_points.txt
RENAMED
|
File without changes
|
{itw_python_builder-0.1.27 → itw_python_builder-0.1.29}/itw_python_builder.egg-info/requires.txt
RENAMED
|
File without changes
|
{itw_python_builder-0.1.27 → itw_python_builder-0.1.29}/itw_python_builder.egg-info/top_level.txt
RENAMED
|
File without changes
|
|
File without changes
|