Commit Graph
3 Commits
Author SHA1 Message Date
Oskar Kwaśniewski c3109278ee docs: make guides easier to read and cut robotic phrasing (#2310) 2026-11-26 15:23:53 +01:00
Donny/강동윤andClaude Opus 5.5 64d5be8bb2 feat(init): detect a Next.js app and write a config that starts it (#2085)
* feat(init): detect a Next.js app and write a config that starts it

In a Next.js app, init wrote the same placeholder target as anywhere
else: APP_URL with a localhost:3000 default and app.command only as a
comment, so the user had to find out how to start the app and edit the
config before the first run.

init now detects Next.js from package.json (next in dependencies or
devDependencies) and writes a web target that runs the app's own
scripts with the project's package manager: the dev script with
reuseExisting locally, on http://localhost:<port> with the port from
the dev script's --port or -p (else 3000), never 127.0.0.1, which does
not hydrate on next dev. When build and start scripts serve on the same
port, CI runs start on the production build, and a pipeline from --ci
runs the build script before e2e run, also on a later run over an
existing config that runs start. init prints what it found and no
longer asks for APP_URL. An app it cannot start (no dev script, a port
that is not a number) keeps today's target with a warning. The
detectors are a list, so Vite or Astro can follow the same shape.

Refs ENG-1387

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* docs(init): say once that init writes the Next.js target

The Next.js guide said twice that init writes the target, and the CLI
reference repeated the Next.js section in the wizard list. Merge each
into one place, name the PORT= variable init also reads, and drop the
"same files as before" changelog phrase from the reference page.

Refs ENG-1387

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* fix(init): read the Next.js port from the next command only

init read a --port, -p, or PORT= from anywhere in the dev script, so
`node scripts/preflight.js -p 8080 && next dev` wrote
http://localhost:8080 while Next.js listened on 3000. Read the port
from the command that runs next, and keep the APP_URL target with a
warning when another command in the script sets a port, since it may or
may not reach the server.

Refs ENG-1387

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* fix(init): build the app for an existing config that serves start on any port

A later `init --ci` over an existing config added the build step only
when the dev and start scripts listen on the same port, the condition
for the target init writes itself. A config that runs `npm run start`
in CI on another port than dev got a job that starts next start with no
production build. Add the build step whenever the config runs the start
script and the app has build and start scripts.

Refs ENG-1387

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

---------

Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-23 12:21:42 +01:00
Donny/강동윤andClaude Sonnet 5.5 d88aa99e0f docs: add a Next.js guide page (#1952)
* docs: add a Next.js guide page

One page takes a Next.js developer from `e2e init` to CI: `next dev`
locally and `next start` on the build in CI from one config, the port,
`reuseExisting`, and the Next.js problems (`allowedDevOrigins` on
127.0.0.1, the route announcer that `getByRole('alert')` also matches, a
webpack watcher that reads `.e2e/`), plus the `create-next-app` starter
and the Vercel template. The hydration accordion moves here from web.mdx;
web, cache, and example-projects link to the page, with ja and zh
translations, and the e2e skill's setup reference carries the same
guidance.

Refs ENG-1378

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* docs: move the Next.js page into a Frameworks group

Next.js is not a platform like web, mobile, or desktop, so the page moves
to docs/frameworks/nextjs.mdx under a new Frameworks navigation group. The
web page no longer points at it from the app URL paragraph.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>

---------

Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-20 10:14:53 +00:00