Skip to content

Commit aeb9e78

Browse files
committed
1.0.0-gamma.9: recognize exported Astro ZIPs (from 0a7c7fe)
1 parent e56cbaf commit aeb9e78

7 files changed

Lines changed: 39 additions & 6 deletions

File tree

‎.claude-plugin/marketplace.json‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
"source": "./",
1515
"displayName": "html2wp — HTML to WordPress",
1616
"description": "BETA. Convert a static HTML site into a standalone WordPress block theme, verified against the original at three viewport widths — and reviewed by you before handover. The conversion runs through a verified Astro 5 build, so the Astro project is a real output too — compared pixel by pixel against the source before anything WordPress-shaped is generated.",
17-
"version": "1.0.0-gamma.8",
17+
"version": "1.0.0-gamma.9",
1818
"author": {
1919
"name": "BELNEM s.r.o.",
2020
"email": "hello@html2wp.dev",

‎.claude-plugin/plugin.json‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
"name": "html2wp",
33
"displayName": "html2wp — HTML to WordPress",
44
"description": "BETA. Convert a static HTML site — or anything that builds to one (Lovable, Bolt, v0, Next export) — into a standalone WordPress block theme: verified pixel by pixel, pages, blog, forms, menus, SEO and redirects, with no plugin required and verification gates at every stage. Two modes: Full (every gate repaired until green, then your own page-by-page review) and Flash (every stage once, no repair loop, the gates reported). The gates catch most fidelity drift, not all of it.",
5-
"version": "1.0.0-gamma.8",
5+
"version": "1.0.0-gamma.9",
66
"author": {
77
"name": "BELNEM s.r.o.",
88
"email": "hello@html2wp.dev",

‎.codex-plugin/plugin.json‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "html2wp",
3-
"version": "1.0.0-gamma.8",
3+
"version": "1.0.0-gamma.9",
44
"description": "Convert static HTML or buildable web projects into verified, editable WordPress block themes.",
55
"author": {
66
"name": "BELNEM s.r.o.",

‎VERSION‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
1.0.0-gamma.8
1+
1.0.0-gamma.9

‎skills/html2wp/VERSION‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
1.0.0-gamma.8
1+
1.0.0-gamma.9

‎skills/html2wp/assets/scripts/detect-project.py‎

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -88,7 +88,9 @@ def html2wp_astro(root, package):
8888
fragments, its built site and the converter's report."""
8989
return (depends(package, "astro")
9090
and any((root / c).is_file() for c in ASTRO_CONFIGS[:3])
91-
and (root / "src/fragments/bodies").is_dir()
91+
# All-self-contained exports keep pages in public/. Their empty
92+
# fragments directory is intentionally absent from the ZIP.
93+
and ((root / "src/fragments/bodies").is_dir() or (root / "public/index.html").is_file())
9294
and (root / "dist/index.html").is_file()
9395
and (root / ASTRO_REPORT).is_file())
9496

‎skills/html2wp/assets/scripts/test-detect-project.py‎

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,9 @@
2222
import sys
2323
import tempfile
2424
import unittest
25+
import zipfile
2526
from pathlib import Path
27+
from lib.theme_state import zip_astro_project
2628

2729
SCRIPT = Path(__file__).with_name('detect-project.py')
2830
spec = importlib.util.spec_from_file_location('detect_project', SCRIPT)
@@ -88,6 +90,35 @@ def test_an_html2wp_astro_export_is_prepared_by_copying(self):
8890
import shutil
8991
shutil.rmtree(ws, ignore_errors=True)
9092

93+
def test_self_contained_export_survives_zip_roundtrip(self):
94+
with tempfile.TemporaryDirectory() as tmp:
95+
base = Path(tmp)
96+
project = write(base / 'astro-project', {
97+
'package.json': pkg(deps={'astro': '5.18.2'}, build='astro build'),
98+
'astro.config.mjs': 'export default {}',
99+
'public/index.html': '<main>Home</main>',
100+
'public/about.html': '<main>About</main>',
101+
'dist/index.html': '<main>Home</main>',
102+
'dist/about.html': '<main>About</main>',
103+
})
104+
(project / 'src/fragments/bodies').mkdir(parents=True)
105+
(base / 'astro-report.json').write_text('{"pages":[],"warnings":[]}')
106+
archive = base / 'export.zip'
107+
self.assertTrue(zip_astro_project(project, archive, 'site-astro'))
108+
with zipfile.ZipFile(archive) as zf:
109+
zf.extractall(base / 'upload')
110+
imported = base / 'upload/site-astro'
111+
self.assertFalse((imported / 'src/fragments/bodies').exists())
112+
found = dp.detect(base / 'upload')
113+
self.assertEqual((found['kind'], found['pages']), ('html2wp-astro', 2))
114+
workspace = base / 'workspace'
115+
dp.prepare_astro_export(imported, workspace)
116+
self.assertEqual((workspace / 'astro-project/public/about.html').read_text(), '<main>About</main>')
117+
self.assertEqual((workspace / 'static-src/about.html').read_text(), '<main>About</main>')
118+
self.assertTrue((workspace / '.astro-project-imported').is_file())
119+
(imported / '.html2wp/astro-report.json').unlink()
120+
self.assertEqual(dp.detect(imported)['kind'], 'static-site')
121+
91122
def test_a_buildable_app_is_a_web_app_and_tanstack_is_named(self):
92123
write(self.root, {'package.json': pkg(deps={'@tanstack/react-start': '1', 'react': '19'})})
93124
found = self.kind()

0 commit comments

Comments
 (0)