@nipe-solutions/flex-layout-codemod 2.0.0-beta.1 → 2.0.0-beta.3

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.
package/CHANGELOG.md CHANGED
@@ -1,5 +1,26 @@
1
1
  # Changelog
2
2
 
3
+ ## 2.0.0-beta.3
4
+
5
+ ### Minor Changes
6
+
7
+ - ca82744: Expand the documentation site into a comprehensive migration reference with production-verified CLI, diagnostic, compatibility, report, and transformation contracts. Add review-first workflow guidance, target-specific explorers and examples, responsive documentation navigation, and keyboard-accessible code regions.
8
+
9
+ ## 2.0.0-beta.2
10
+
11
+ ### Minor Changes
12
+
13
+ - 89c6f92: Make migration planning the default, require `--write` to apply project changes, and publish schema-2 reports with explicit execution and application state.
14
+ - 77391e3: Launch the public documentation site and browser-only single-template migration playground, and point package metadata to the production documentation homepage.
15
+ - f058c0b: Add opt-in Tailwind conversion for the archived orientation breakpoints and project-configured print fallback behavior.
16
+ - 40e3719: Add an explicit native CSS target that updates templates and one owned companion stylesheet as a recoverable transaction.
17
+ - 029562c: Add opt-in migration of safe literal responsive image sources to native picture markup with atomic template validation and report-based review locations.
18
+ - 6f8ef7a: Convert literal Angular Flex-Layout Grid directives, including standard responsive aliases, when Tailwind compiler output and element ownership prove an exact migration.
19
+
20
+ ### Patch Changes
21
+
22
+ - 4715a71: Add an executable compatibility inventory and rewrite beta onboarding around safe previews, pinned team installation, exact support boundaries, and copyable CLI workflows.
23
+
3
24
  ## 2.0.0-beta.1
4
25
 
5
26
  ### Minor Changes
package/README.md CHANGED
@@ -1,100 +1,56 @@
1
1
  # Angular Flex-Layout Codemod
2
2
 
3
- A safety-first codemod for migrating projects away from the archived Angular Flex-Layout library.
3
+ Angular Flex-Layout Codemod is a review-first CLI for migrating supported Angular Flex-Layout template directives to Tailwind CSS v4 or native CSS. Version 2 remains a prerelease.
4
4
 
5
- Version 2 remains a prerelease under active development. It does not claim production-ready conversion coverage. See the [compatibility reference](docs/compatibility.md) for the current directive-by-directive status and safety limitations.
5
+ > Plan first. Review unresolved cases. Write only when you are ready.
6
6
 
7
- Install a published v2 beta as a development dependency with `npm install --save-dev @nipe-solutions/flex-layout-codemod@beta`. Maintainers should follow the reviewed [release process](docs/architecture/release-process.md); merging a version pull request does not publish the package.
7
+ The codemod changes only cases for which it can produce a supported equivalent. When it cannot prove that boundary, it leaves the source in place and reports a diagnostic instead of guessing.
8
8
 
9
- ## Current scope
9
+ Read the [detailed documentation](https://angular-flex-layout-codemod.nipesolutions.com/docs), or try a single template in the separate [browser playground](https://angular-flex-layout-codemod.nipesolutions.com/#playground).
10
10
 
11
- The v2 engine parses templates with the Angular compiler and applies validated source-range edits. It preserves comments, control-flow syntax, interpolation, line endings, and all unrelated source text instead of serializing the template as generic HTML.
11
+ ## Requirements and installation
12
12
 
13
- The current prerelease converts documented static inputs and literal responsive inputs using the standard Angular Flex-Layout viewport aliases (`xs` through `xl`, `lt-*`, and `gt-*`) to exact Tailwind CSS v4 arbitrary media variants. For example, `fxLayout.sm="row"` becomes `[@media_screen_and_(min-width:_600px)_and_(max-width:_959.98px)]:flex-row` alongside the other layout utilities. Dynamic bindings, orientation, print, and custom breakpoints, unsupported directives, and responsive families with conflicting overlapping values remain unchanged with structured review results. Ambiguous behavior is never approximated silently.
13
+ The CLI requires Node.js 24 or newer. Install the current beta as an exact development dependency so your package manifest and lockfile retain the reviewed version:
14
14
 
15
- Literal responsive `ngClass.<alias>` and `ngStyle.<alias>` values use the same 13-alias boundary. Class values are split with Angular `NgClass`'s ECMAScript-whitespace rule and convert only when every token is in the compiler-proven built-in Tailwind CSS v4 surface, retains the host element as its CSS target, and can be emitted byte-for-byte for Tailwind's raw template scanner. Style declarations convert to arbitrary-property utilities only when Flex-Layout's quote removal, semicolon splitting, exact-key application order, Angular unit handling, CSS priority, fallback ownership, and responsive precedence can be represented exactly. Distinct exact ordinary keys that apply to the same CSS property, including `font-size` and `font-size.px`, are preserved because their result can depend on `NgStyle` activation history. Unsuffixed `ngClass` and `ngStyle` siblings are treated as replaceable fallback authorities rather than silently left as always-active values.
16
-
17
- ```html
18
- <!-- input -->
19
- <div ngClass.sm="flex items-center"></div>
20
- <div ngStyle.lt-md="font-size.px: 14; color: #334155"></div>
21
-
22
- <!-- output -->
23
- <div
24
- class="[@media_screen_and_(min-width:_600px)_and_(max-width:_959.98px)]:flex [@media_screen_and_(min-width:_600px)_and_(max-width:_959.98px)]:items-center"
25
- ></div>
26
- <div
27
- class="[@media_screen_and_(max-width:_959.98px)]:[font-size:14px] [@media_screen_and_(max-width:_959.98px)]:[color:#334155]"
28
- ></div>
29
- ```
30
-
31
- Application classes, project plugin utilities, custom-theme-dependent candidates such as `bg-brand-500`, unsafe style values, bindings, interpolation, and deprecated `class.<alias>` or `style.<alias>` selectors remain in place with review diagnostics. The current mode does not inspect project styles or Tailwind configuration and does not generate a companion stylesheet.
32
-
33
- Existing literal classes use a broader conservative ownership check than generated-candidate admission. Compiler-modeled Tailwind utilities contribute every stable declaration they emit, including inferred arbitrary text sizes, directional border style/width pairs, and shadow color custom properties. A recognized pinned Tailwind utility whose complete property set is not modeled is treated as an unknown CSS authority and blocks an intersecting conversion instead of being silently ignored; ordinary application classes such as `card` remain additive.
34
-
35
- Literal `fxShow` and `fxHide` inputs are converted when the element's complete display behavior is provable. The conversion follows Angular Flex-Layout coercion: `fxShow="false"` hides, `fxHide="false"` shows, and other literal strings, including `"0"`, are truthy before `fxHide` inversion. Literal values use Angular-decoded text, so an entity-spelled value such as `fals&#101;` has the same semantics as `false`. Hiding uses `hidden`; a responsive shown state after base hiding restores only a display value proven by a converted `fxLayout` or one unambiguous base Tailwind display utility.
36
-
37
- ```html
38
- <!-- input -->
39
- <div fxLayout="column" fxShow="false" fxShow.sm></div>
40
-
41
- <!-- output -->
42
- <div
43
- class="flex flex-col box-border hidden [@media_screen_and_(min-width:_600px)_and_(max-width:_959.98px)]:flex"
44
- ></div>
15
+ ```bash
16
+ npm install --save-dev --save-exact @nipe-solutions/flex-layout-codemod@beta
45
17
  ```
46
18
 
47
- The complete visibility family is preserved when it contains a binding or interpolation, an orientation, print, or custom alias, conflicting overlapping states, an unverified restoration display, a partially overlapping responsive layout display without safe ownership, or an unsafe class/style interaction. A literal or bound style that can control `display` always blocks conversion. An unresolved responsive class or style authority also preserves related visibility output when it may control `display`. A bound class blocks a family that needs generated classes, but does not block an all-shown no-op whose attributes can simply be removed. See the [compatibility reference](docs/compatibility.md) and [visibility architecture](docs/architecture/visibility-semantics.md) for the exact boundary.
19
+ See [Installation and requirements](https://angular-flex-layout-codemod.nipesolutions.com/docs/installation) for the project-baseline checklist.
48
20
 
49
- ## CLI workflow
21
+ ## Plan, review, write
50
22
 
51
- Run the codemod for one Angular template or a directory:
23
+ Create a plan and an optional JSON report without changing project templates or stylesheets:
52
24
 
53
25
  ```bash
54
- flex-layout-codemod ./src --target tailwind --output ./migrated-src
26
+ npx flex-layout-codemod ./src --report ./reports/flex-layout.json
55
27
  ```
56
28
 
57
- Preview the same migration plan without writing templates, while also creating a JSON report:
29
+ Review the proposed output and every unresolved diagnostic. The report is the command's intentional filesystem output in plan mode.
58
30
 
59
- ```bash
60
- flex-layout-codemod ./src --target tailwind --output ./migrated-src --dry-run --report ./reports/flex-layout.json
61
- ```
62
-
63
- Only changed `.html` files are written during a real migration. For a single-file input, the planned output path must end in `.html` (case-insensitive); omitting `--output` keeps the default in-place behavior. For a folder input, `--output` remains a directory and each derived template output retains its `.html` path. `--dry-run` applies and validates edits in memory but does not write template output or create its missing parent directories. A requested `--report <path>` is an explicit reporting side effect and is still written atomically during a dry-run. The report path must be nonblank and end in `.json` (case-insensitive). Migratable inputs and planned template outputs exclusively use `.html`, so this structural rule prevents report collisions while allowing reports anywhere, including inside input or output trees. Invalid output and report paths are rejected before migration without creating output or report directories.
64
-
65
- Unresolved `review`, `unsupported`, or `invalid` results are strict by default. To preserve the same diagnostics and migration output while accepting unresolved work in automation, use:
31
+ Apply the reviewed Tailwind CSS plan explicitly:
66
32
 
67
33
  ```bash
68
- flex-layout-codemod ./src --dry-run --allow-unresolved
34
+ npx flex-layout-codemod ./src --target tailwind --write
69
35
  ```
70
36
 
71
- The CLI uses these exit codes:
72
-
73
- | Code | Meaning |
74
- | ---: | -------------------------------------------------------------------------------------- |
75
- | `0` | Migration completed with no unresolved results, or `--allow-unresolved` accepted them. |
76
- | `1` | Configuration, parsing, template I/O, report writing, or an internal invariant failed. |
77
- | `2` | Migration completed safely, but unresolved results remain in strict mode. |
78
-
79
- JSON reports use schema version `1`. Report paths use forward slashes and are relative to the input root; a single-file input is represented by its basename, never an absolute checkout path. Files are path-sorted, results retain source order, and the summary is derived from those file results.
37
+ For native CSS output, target limits, output paths, and recovery behavior, follow the [migration workflow](https://angular-flex-layout-codemod.nipesolutions.com/docs/workflow). Keep the migration on a clean branch and review the resulting diff and application tests.
80
38
 
81
- Each non-parse report result represents one source directive occurrence. Measure responsive class and style adoption by counting `ngClass`, `ngStyle`, `class`, and `style` results by status in a representative migration report. This occurrence ratio is an inventory of the scanned templates, not a claim that the same percentage of an application or its runtime behavior was converted.
39
+ ## Documentation
82
40
 
83
- Use version control and review the generated diff before replacing application templates. Native CSS output remains outside the current scope.
41
+ - [Migration guide](https://angular-flex-layout-codemod.nipesolutions.com/docs)
42
+ - [Compatibility by target and directive](https://angular-flex-layout-codemod.nipesolutions.com/docs/compatibility)
43
+ - [Diagnostics and remediation](https://angular-flex-layout-codemod.nipesolutions.com/docs/diagnostics)
44
+ - [Complete CLI reference](https://angular-flex-layout-codemod.nipesolutions.com/docs/cli)
45
+ - [JSON reports and CI](https://angular-flex-layout-codemod.nipesolutions.com/docs/reports)
46
+ - [Safety, transactions, and recovery](https://angular-flex-layout-codemod.nipesolutions.com/docs/safety)
84
47
 
85
- The TypeScript extension API changed in v2: mutable Cheerio converters were replaced by immutable `ConversionAdapter` plans and structured `ConversionResult` values. These prerelease APIs may continue to evolve before v2 is stable.
48
+ ## Contributing and support
86
49
 
87
- ## Development
88
-
89
- The repository requires Node.js 24 and npm 11.
90
-
91
- ```bash
92
- npm ci
93
- npm run verify
94
- ```
50
+ Read [CONTRIBUTING.md](CONTRIBUTING.md) before opening a pull request. Use [GitHub Issues](https://github.com/NIPE-Solutions/flex-layout-migrator/issues) for reproducible, redacted migration cases. Report vulnerabilities only through [GitHub private vulnerability reporting](https://github.com/NIPE-Solutions/flex-layout-migrator/security/advisories/new); see [SECURITY.md](SECURITY.md) and [support guidance](docs/SUPPORT.md).
95
51
 
96
- See [CONTRIBUTING.md](CONTRIBUTING.md) before opening a pull request. Security reports belong in [GitHub private vulnerability reporting](https://github.com/NIPE-Solutions/flex-layout-migrator/security/advisories/new); other support routes are documented in [docs/SUPPORT.md](docs/SUPPORT.md).
52
+ Maintainers should follow the reviewed [release process](docs/architecture/release-process.md).
97
53
 
98
54
  ## License
99
55
 
100
- MIT
56
+ [MIT](LICENSE)