Loading...
Loading...
MUST be used when migrating a legacy Dune app to the new Flows app hosting infrastructure. Orchestrates the full migration: audits current state, updates app.json to appsApi infra, delegates auth wiring to setup-flows-auth, creates or updates manifest.json network permissions, and updates deploy scripts to @cognite/cli. Use this whenever a user says 'migrate to Flows', 'migrate to new infra', 'move from dune to flows', 'migrate legacy app', or wants to move their existing app to the new Flows app hosting.
npx skill4agent add cognitedata/builder-skills migrate-app-to-flowsappsApiapp.jsonpackage.jsonvite.config.tsmanifest.jsonMigration audit:
✗ app.json: missing infra field → will add "infra": "appsApi"
✗ Auth: DuneAuthProvider in use → will run setup-flows-auth
✗ manifest.json: missing → will create
✓ Deploy script: already uses @cognite/cliapp.jsoninfra"appsApi"{
"name": "My App",
"externalId": "my-app",
"versionTag": "0.0.1",
"infra": "appsApi",
"deployments": [...]
}setup-flows-authconnectToHostAppmanifest.jsonmanifest.json{
"manifestVersion": 1,
"permissions": {
"network": []
}
}grep -rn "fetch\|axios\|new XMLHttpRequest" src/ --include="*.ts" --include="*.tsx"networksourcesdirectives{
"manifestVersion": 1,
"permissions": {
"network": [
{
"sources": ["https://api.example.com", "https://maps.googleapis.com"],
"directives": ["connect-src"]
}
]
}
}sources"connect-src"fetchXMLHttpRequest"img-src""font-src""network": []dune deploynpx @cognite/dunepackage.json{
"scripts": {
"deploy": "npx @cognite/cli@latest apps deploy --interactive --published",
"deploy-preview": "npx @cognite/cli@latest apps deploy --interactive"
}
}startbuildtestgrep -rn "DuneAuthProvider\|useDune\|@cognite/dune" src/ vite.config.ts 2>/dev/nullMigration complete:
✓ app.json: infra set to "appsApi"
✓ Auth: setup-flows-auth applied
✓ manifest.json: network permissions set
✓ Deploy scripts: updated to @cognite/cli