vaadin / vaadin/docs

Clarify ciBuild, forceProductionBuild, and package.json workflow in the Vaadin Docs

Open
#4,853 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

flow
Dominant language
AsciiDoc
Stars
38
Forks
225
Avg merge
1d 4h
Merged PRs (30d)
170

Description

Problem

Documentation doesn't clearly explain the corelation between ciBuild, forceProductionBuild, package.json/package-lock.json, and when to use which approach.

Common misconception causing build failures

Issue observed:

Users configure production profile with ciBuild=true by default (as shown in various examples),
but this causes builds to fail on CI for simple projects that use default bundles.

Error message:

npm error `npm ci` can only install packages when your package.json and package-lock.json...
Root cause:
  • Simple projects (no @NpmPackage, no 3rd-party components) use default bundles
  • Default bundles don't generate package.json/package-lock.json
  • Production profile examples often include ciBuild=true
  • This causes npm ci to fail because required json files don't exist
What users need to understand:

ciBuild=true is not a universal production setting - it's only needed when you have custom npm dependencies.

Key clarifications needed:

When to use ciBuild
  • when package.json and package-lock.json are committed to repository
  • Trade off: Developer must run frontend build WITHOUT ciBuild locally first, then commit the updated json files
When NOT to use ciBuild
  • When using default bundles (json files aren't even generated in this case)
  • Don't include package.json/package-lock.json in repository if build uses default bundles
About forceProductionBuild
  • it is a workaround for when automatic detection fails
  • potentially need to update package-lock.json with ciBuild
  • makes builds always slow, but ensures robust builds
  • Not recommended as default: Only for catching issues early or working around detection problems
Important warnings
  • If CI runs npm install without package-lock.json → vulnerable to npm malware and random problems
  • Different npm versions (from different Node.js versions) can cause slightly different package-lock.json files
  • This can lead to merge conflicts even when dependencies haven't changed

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Locate the Vaadin Docs pages and examples that describe ciBuild, forceProductionBuild, default bundles, and package.json/package-lock.json workflows. Start by comparing those explanations with the reported npm ci failure. Done means the documentation clearly states when ciBuild is required or unnecessary, explains forceProductionBuild and its trade-offs, and covers the lockfile and npm-version warnings.

Written by the indexing model from the issue text.

Assessment

Domain
build-system, ci-cd, documentation
Issue type
Documentation
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.