Our Solid 2 migration assistant started with two YAML workflows totaling 953 lines, plus a Node launcher. The launcher checked project dependencies; the workflows ran the rules and collected findings.
Workflow v2 makes TypeScript the default for new workflows. In the assistant's TypeScript port, the workflow itself can skip projects that don't use Solid, choose files for each stage, or ask before rewriting.
Put the migration's decisions next to its steps
The Solid migration assistant checks a Solid 1.9 app against Solid 2. It has 44 analysis rules and 9 rewrites. YAML already supports conditions, approvals, and file selectors. What changed here is where the assistant makes its decisions:
- Should this run at all? Skip projects that don't depend on
solid-js, and stop on projects already on Solid 2. - Which files need which rules? Scan for
solid-js/storebefore running the store rules. - Should it rewrite now? If a dependency has no known Solid 2 release, pause and let the user decide before applying rewrites.
On resume, the workflow makes those decisions again using saved results from matching, completed steps. If the run paused for approval, it can reuse the dependency check and file scan instead of repeating them.
Before and after: what the assistant does
Here's what moved from the launcher and the YAML into the TypeScript workflow:
What the assistant does | Before: YAML and a Node launcher | After: TypeScript workflow |
Where is the workflow logic? | 953 lines across two YAML files, not counting the launcher | Dependency checks and rule selection are in workflow.ts |
When does it stop or ask for approval? | The launcher reports dependency issues before calling the workflow | The workflow can skip the project or pause for a decision before rewriting files |
Which files are scanned? | All rules use the same set of source files | Each stage chooses its own files. On Tasks.md, store rules ran on 1 of 20 source files; router rules ran on 2. |
The example project is Tasks.md, an open-source Solid task board.
When is a port worth it?
If all you need is to rename an import, keep a standalone transform. If you already have a YAML workflow that runs a fixed set of rules and does what you need, you don't have to port it just to write those same steps in TypeScript.
The Solid assistant is different: the result of the file scan tells the workflow where to run the store rules. The dependency check tells it whether to ask before rewriting. Those are good reasons to put the decisions in the workflow.
API example: return findings from a transform
The Solid port still collects findings in a shared store. For a new v2 workflow, a JSSG transform can return its findings directly instead:
// Inside a read-only transform:
return { edit: null, data: findings };The step returns those results in result.data as { file, data } entries. The workflow can merge or deduplicate them without a shared lock. If you switch an existing analyzer to this pattern, compare the reports on the same checkout: a matching source diff doesn't tell you whether the findings match.
What happens to workflow.yaml?
TypeScript is the default for new workflows. V2 can translate workflow.yaml in memory, including ${{ state.* }} references in the YAML. That's separate from a transform calling the old shared-state API. If your transforms use that API, check the migration guide and test the workflow on the CLI version you plan to use.
If you want to edit a workflow in TypeScript, run the YAML on v2 and compare its output with your 1.x run on the same starting revision. Then run codemod workflow upgrade ./my-package --dry-run to inspect the conversion, followed by codemod workflow upgrade ./my-package --keep-yaml to write workflow.ts alongside the original. Run the TypeScript version explicitly on a fresh copy of the same revision and compare the diff and report before changing the workflow logic.
Try a read-only TypeScript workflow
Workflow v2 is in alpha. The command below pins codemod@2.0.0-alpha.4; codemod@latest is still the 1.x CLI.
Save this as workflow.ts in a Git checkout with src/ files. It counts files that mention "solid-js/store" or 'solid-js/store' without changing any source files.
import { forEachFile, step } from "codemod/workflow";
export default async function main() {
const scanned = await step(
"Find files that mention solid-js/store",
forEachFile({ include: ["src/**/*.{js,jsx,ts,tsx}"] }, (file) =>
/["']solid-js\/store["']/.test(file.text) ? file.path : undefined,
),
);
console.log(`Files mentioning solid-js/store: ${scanned.outputs.length}`);
}Commit workflow.ts first: the CLI won't run on a checkout with uncommitted changes. Then run it from the checkout:
npx codemod@2.0.0-alpha.4 workflow run -w ./workflow.ts --target .If just one file mentions the package, you'll see Files mentioning solid-js/store: 1 in the run log. No source files are changed.
Related: The new Codemod CLI, jssg.