Commit 5f9d14b
authored
Decoupling (#89)
* refactor: scaffold build system for configurator decoupling
Add build script that reassembles configurator.html from src/ parts.
Currently a trivial split (CSS, HTML skeleton, JS monolith) that
produces a byte-identical output to the original. This establishes
the round-trip verification baseline for subsequent extraction phases.
* refactor: extract i18n, service definitions, and template generators
Split the monolithic JS into separate files:
- src/js/i18n/all.js — translations + engine (~2,463 lines)
- src/js/services/registry.js — event names, sources, permissions (~185 lines)
- src/js/deploy/template-main.js — CFN template generator (~3,113 lines)
- src/js/deploy/template-org.js — org/per-account templates (~229 lines)
- src/js/deploy/instructions.js — instructions generator (~83 lines)
- src/js/deploy/script-deploy.js — deploy.sh generator (~1,084 lines)
Build output remains byte-identical to the original.
* refactor: extract constants and clean up structure
Split constants (TEMPLATE_VERSION, VERSION_HISTORY, renderVersionHistory)
into src/js/constants.js. Remaining flow logic stays in app-pre.js for
now — per-flow splitting will be done in a subsequent pass.
Current structure:
- src/css/styles.css (183 lines)
- src/html/configurator.html (964 lines)
- src/js/constants.js (345 lines)
- src/js/app-pre.js (1,786 lines) — all flow logic
- src/js/i18n/all.js (2,463 lines) — translations + engine
- src/js/services/registry.js (185 lines)
- src/js/deploy/template-main.js (3,113 lines)
- src/js/deploy/instructions.js (83 lines)
- src/js/deploy/template-org.js (229 lines)
- src/js/deploy/script-deploy.js (1,084 lines)
- src/js/app-post.js (92 lines) — output/download
Build output remains byte-identical to the original.
* refactor: split flow logic into per-flow modules
Split app-pre.js into:
- src/js/shared/ui.js (40 lines) — selectMode, step navigation
- src/js/editor/editor-flow.js (795 lines) — editor flow
- src/js/upgrade/upgrade-flow.js (124 lines) — upgrade flow
- src/js/delete/delete-flow.js (408 lines) — delete flow
- src/js/deploy/deploy-flow.js (419 lines) — deploy flow UI
Output is functionally identical (same byte count, all functions
present). Function order differs from the original since the
interleaved flows are now grouped by module.
* refactor: split i18n into per-locale files, extract Lambda Python
- Split i18n/all.js into 7 locale files + engine.js
- Extract Lambda Python handler (2,082 lines) to src/templates/lambda-handler.py
- Rename app-post.js → app.js
Build output is functionally identical (all functions and i18n keys
present, 216 bytes larger due to variable wrapper declarations).
* refactor: split service registry into per-service modules
Break the monolithic ALL_EVENT_NAMES/ALL_SOURCES/TAGGING_PERMISSIONS
arrays into ~80 per-service files (e.g., ec2.js, rds.js, s3.js).
Each file declares its source, events, and permissions.
index.js aggregates them into the three flat arrays.
Build script auto-discovers service files via directory listing.
Adding a new service = drop a new .js file in src/js/services/.
Includes README.md documenting the per-service format.
* chore: clean up pycache from templates
* test: add vitest unit tests and build verification
- scripts/verify-build.js — 13 sanity checks on built HTML
- tests/unit/services.test.js — 10 tests (service module format, no duplicate sources)
- tests/unit/i18n.test.js — 13 tests (locale files, engine functions)
- tests/unit/build.test.js — 7 tests (built output completeness)
- tests/unit/lambda.test.js — 5 tests (Python handler structure)
- vitest.config.js + package.json scripts (build, test, verify)
35 tests, all passing.
* chore: add CI workflow, update E2E path, replace root configurator
- .github/workflows/build.yml — test → build → verify on PRs,
auto-commit built output on main
- Update generate_deploy_sh.js to use build/configurator.html
- Replace root configurator.html with redirect to build/
* refactor: wire Lambda Python into build, update README
- template-main.js now uses ${LAMBDA_HANDLER_CODE} placeholder
(3,113 → 1,032 lines; Python lives in src/templates/lambda-handler.py)
- Build script reads .py, indents for YAML, injects into JS bundle
- README updated: paths, Components table, new Development section
- All 35 tests passing, build verification clean
* fix(ci): update lint scripts to read build/configurator.html
All lint scripts and workflows now read from build/configurator.html
instead of the root (which is now a redirect). Added Node.js setup +
build step to 6 lint jobs so the built file exists before linting.
* fix(ci): single build job with artifact sharing in lint workflow
Replace 6 redundant per-job builds with one shared build-configurator
job. Lint jobs that need build/configurator.html now declare
needs: build-configurator and download the artifact.
* fix(ci): add build step to E2E workflow
E2E workflow now builds configurator.html from src/ before
Playwright generates deploy.sh. Ensures E2E always tests the
current source, not a potentially stale committed build.
* fix(ci): update sync-check to scan full file for permissions
After per-service split, permissions are in individual service module
objects rather than a single TAGGING_PERMISSIONS array. Updated
sync-check.py to scan the entire built HTML for IAM action patterns
instead of searching only within the TAGGING_PERMISSIONS block.
* docs: update all references from configurator.html to build/
Updated OVERVIEW.md, INSTRUCTIONS.md, LIMITATIONS.md, README.md,
VERSIONING.md, and design-reconciliation.md. CHANGELOG.md left
unchanged (historical references).
* docs: add DEVELOPMENT.md with source structure and extension guide
Covers directory layout, build process, and how to add new services,
locales, flows, and modify the Lambda handler.
* docs: remove services/README.md, consolidate in DEVELOPMENT.md
* chore: use CSS/JS comments for build placeholders
Avoids false editor errors from HTML comments inside style/script tags.
* refactor: output built configurator.html to repo root
Move build output from build/configurator.html back to the root so
customers find it in the same place as before. Delete build/ directory.
Updated: build.js, verify-build.js, build.test.js, generate_deploy_sh.js,
all lint scripts, all workflows, all docs, .gitignore.
* feat: add build-yaml.js, wire E2E to use generated YAML
Add scripts/build-yaml.js that calls the same generateMainTemplate()
to produce standalone YAML. Accepts --config JSON and --output path.
E2E scope tests and deploy-single now generate their own YAML via
build-yaml.js instead of deploying map2-auto-tagger-optimized.yaml.
Each test bakes its specific config (MPE, VPC IDs, dates) directly.
The standalone YAML and sync-check are kept for now — once E2E passes
with the new path, they can be removed in a follow-up commit.
* refactor: delete standalone YAML, wire all lint to generated output
Delete map2-auto-tagger-optimized.yaml, sync-check.py, and
.github/sync/ (canonical permissions file). All lint jobs now
depend on build-configurator and use the generated configurator.yaml.
One source of truth (src/), two build outputs (HTML + YAML),
zero drift possible.
* fix(ci): resolve duplicate 'with' key in lint.yml
The download-artifact insertion collided with a checkout step that
had fetch-depth: 0, producing two 'with:' blocks on the same step.
* fix(ci): cfn-lint ignore warnings, fix generate_iam.py canonical source
- cfn-lint: add -I W to ignore warnings (unused params expected with
baked values in generated YAML)
- generate_iam.py: load_canonical() now extracts permissions from
configurator.yaml instead of the deleted tagging-permissions.txt
* fix(ci): allow cfn-lint exit code 4 (warnings only)
* fix: add missing DeadLetterConfig and UUID strip in peer detector
Bug 1: AutoTaggerFunction was missing DeadLetterConfig pointing to
EventDLQ. Pre-existing gap between standalone YAML and configurator,
now fixed in template-main.js.
Bug 2: UUID strip regex was lost during lambda-handler.py extraction.
StackSet instance stacks have a UUID suffix that must be stripped
before comparing MPE IDs in the peer detector.1 parent 5e5c1d2 commit 5f9d14b
135 files changed
Lines changed: 13575 additions & 5058 deletions
File tree
- .github
- scripts
- sync
- workflows
- docs
- scripts
- src
- css
- html
- js
- delete
- deploy
- editor
- i18n
- services
- upgrade
- templates
- tests/unit
Some content is hidden
Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
20 | 20 | | |
21 | 21 | | |
22 | 22 | | |
23 | | - | |
| 23 | + | |
24 | 24 | | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
43 | 43 | | |
44 | 44 | | |
45 | 45 | | |
46 | | - | |
| 46 | + | |
47 | 47 | | |
48 | 48 | | |
49 | 49 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
5 | 5 | | |
6 | 6 | | |
7 | 7 | | |
8 | | - | |
| 8 | + | |
9 | 9 | | |
10 | 10 | | |
11 | 11 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
2 | 2 | | |
3 | 3 | | |
4 | | - | |
| 4 | + | |
5 | 5 | | |
6 | 6 | | |
7 | 7 | | |
8 | 8 | | |
9 | 9 | | |
10 | | - | |
| 10 | + | |
11 | 11 | | |
12 | 12 | | |
13 | 13 | | |
| |||
23 | 23 | | |
24 | 24 | | |
25 | 25 | | |
26 | | - | |
| 26 | + | |
27 | 27 | | |
28 | 28 | | |
29 | 29 | | |
| |||
37 | 37 | | |
38 | 38 | | |
39 | 39 | | |
40 | | - | |
41 | | - | |
| 40 | + | |
| 41 | + | |
42 | 42 | | |
43 | 43 | | |
44 | 44 | | |
| |||
57 | 57 | | |
58 | 58 | | |
59 | 59 | | |
60 | | - | |
| 60 | + | |
61 | 61 | | |
62 | 62 | | |
63 | 63 | | |
| |||
117 | 117 | | |
118 | 118 | | |
119 | 119 | | |
120 | | - | |
121 | | - | |
| 120 | + | |
| 121 | + | |
| 122 | + | |
| 123 | + | |
| 124 | + | |
122 | 125 | | |
123 | 126 | | |
124 | 127 | | |
| |||
143 | 146 | | |
144 | 147 | | |
145 | 148 | | |
146 | | - | |
| 149 | + | |
147 | 150 | | |
148 | 151 | | |
149 | 152 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
31 | 31 | | |
32 | 32 | | |
33 | 33 | | |
34 | | - | |
| 34 | + | |
35 | 35 | | |
36 | 36 | | |
37 | 37 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
30 | 30 | | |
31 | 31 | | |
32 | 32 | | |
33 | | - | |
| 33 | + | |
34 | 34 | | |
35 | 35 | | |
36 | 36 | | |
| |||
44 | 44 | | |
45 | 45 | | |
46 | 46 | | |
47 | | - | |
| 47 | + | |
48 | 48 | | |
49 | 49 | | |
50 | 50 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
19 | 19 | | |
20 | 20 | | |
21 | 21 | | |
22 | | - | |
| 22 | + | |
23 | 23 | | |
24 | 24 | | |
25 | 25 | | |
| |||
34 | 34 | | |
35 | 35 | | |
36 | 36 | | |
37 | | - | |
| 37 | + | |
38 | 38 | | |
39 | 39 | | |
40 | 40 | | |
| |||
99 | 99 | | |
100 | 100 | | |
101 | 101 | | |
102 | | - | |
| 102 | + | |
103 | 103 | | |
104 | 104 | | |
105 | 105 | | |
| |||
0 commit comments