github cloudflare/workers-sdk @cloudflare/autoconfig@0.8.3

latest releases: @cloudflare/pages-shared@0.13.205, @cloudflare/workers-auth@0.15.3, @cloudflare/cli-shared-helpers@0.3.0...
4 hours ago

Patch Changes

  • #16369 ec0bea4 Thanks @MattieTK! - Stop autoconfig in non-interactive runs when a project root holds both static files and a Pages functions directory

    When a project without a detected framework has a functions directory, autoconfig asks whether it is a Cloudflare Pages project. Non-interactive runs (CI and coding agents) assume it is not and continue as a static site. When the static files are in the project root, that deploys the root as static assets, and the Pages Functions (the project's API routes) are not deployed.

    In that case autoconfig now stops with an error explaining that Pages Functions cannot be migrated automatically yet. For Pages Functions it suggests moving the static files into a subdirectory and deploying with wrangler pages deploy, or migrating the Functions to a Worker; for a functions directory that is not Pages Functions, it suggests moving the static files into a subdirectory or adding a configuration file. Projects whose static files are already in a subdirectory, projects detected as Pages or with a detected framework, and interactive runs where the user answers the prompt are unaffected.

  • #16367 b4653b4 Thanks @MattieTK! - Write a protective .assetsignore when autoconfig uses the project root as the static assets directory

    Autoconfig is meant to write an .assetsignore when the project root itself is the assets directory, so that local files are not uploaded as public assets. The check compared the detected output directory, which is relative ("."), with the absolute project path, so it never matched and no .assetsignore was written. A static project with an index.html at its root (for example after wrangler setup or a zero-config wrangler deploy) then uploaded files such as .env, .dev.vars, .git and node_modules as public assets.

    The check now resolves the assets directory that the generated configuration uses and compares it with the project root, so frameworks that set their own build output directory (such as Nuxt or SvelteKit) do not get an unused root .assetsignore. The generated .assetsignore also covers what a Cloudflare Pages upload skips, alongside the existing .wrangler, .dev.vars* and .env* entries: /_worker.js, /_routes.json and /functions at the root (so nested paths such as blog/functions/index.html are still uploaded), node_modules, .git and .DS_Store at any depth, and .npmrc. If an existing .assetsignore only lists a narrower pattern such as .env, .env* is added so that files like .env.production are skipped too. When the project root of an assets-only project contains a Pages functions directory or _worker.js, autoconfig now warns that it will not be deployed, since it is excluded from the assets and not run as server code.

  • Updated dependencies [b4653b4, 8b64bec]:

    • @cloudflare/cli-shared-helpers@0.3.0
    • @cloudflare/workers-utils@0.50.1
    • @cloudflare/config@0.29.0

Don't miss a new workers-sdk release

NewReleases is sending notifications on new releases.