Reference
wf migrate
Carry a project forward: WebFluent 2 → 3, 3 → 4, 4 → 4.2 and 6 → 7, each step that applies
wf migrate [PATH] [options]
Writes: the project's source files.
Preview: --check says what it would do without doing it.
Carries a project written for an older WebFluent forward.
$ wf migrate --check
$ wf migrate
$ wf migrate --wfx
wf migrate makes four passes, in this order:
- 4.1 → 4.2, first, because 4.2 refuses
external. A remote module becomes ameta.scriptsentry. A local one becomes a plain script undersrc/, with its signatures as JSDoc, andX.f(…)becomesf(…). Anexternal elementcall becomesElement("tag", …). The pass lists every.jsalready undersrc/, since each now ships on every page. - 2 → 3 rewrites every
.wfundersrc/in place, with a note for anything that needed a decision. It changes spelling only: the migrated project builds to what it built before. - 3 → 4 changes what the compiler allows, so it runs over the project rather than the files. It adds every
envname your pages already read topublic_env, which preserves what the project did, and prints the list, because public means anyone who opens the site may read the value. It then names, with file and line, everything 4 refuses that 3 allowed: anon*attribute, ajavascript:ordata:URL. Those have no automatic rewrite, because the old value was a string of JavaScript or a link that ran one. Finally it lists the changes that need no edit: a store is built on first read rather than at boot, apersistvalue follows the site's other tabs, andWF.store/WF.hostwere renamed. - 6 → 7 applies every fix the findings 7.0 brings carry — the request forms 6.x had (
N08), what each declaration holds, returns and fails with (T25,T26,N03,T32,T31), the comparison a condition meant (T29), a splice or a unit (T34) — until nothing is left to fix, then lists every error a person decides, by place, and the changes that need no edit. With--checkit says what it would fix and writes nothing.
See also: Upgrading.
Options
| Option | Type | Meaning |
|---|---|---|
[PATH] | path | Project directory (default: current directory), or one .wf file |
--check | flag | Report what would change without writing anything |
--stdout | flag | Print the migrated text of one file to stdout instead of writing it |
--wfx | flag | Write the migrated files in the indented layout, as |