Scratch's shared configuration files for Renovate
While Renovate supports JSON5 in some contexts, the configuration files in this repository are in strict JSON format. See renovatebot/renovate#7674 for more information.
Use the extends
array within your Renovate configuration file to extend one of these configurations. For example:
extends: ["github>scratch-renovate-config"]
Name | File |
---|---|
github>scratchfoundation/scratch-renovate-config:base |
base.json |
github>scratchfoundation/scratch-renovate-config |
default.json |
github>scratchfoundation/scratch-renovate-config:js-lib |
js-lib.json |
github>scratchfoundation/scratch-renovate-config:js-lib-bundled |
js-lib-bundled.json |
github>scratchfoundation/scratch-renovate-config:js-app |
js-app.json |
github>scratchfoundation/scratch-renovate-config:conservative |
conservative.json |
This applies basic configuration without any automatic merge rules. It's intended to be used by the other configurations in this repository, not by itself.
The common configuration in this file includes:
- set time zone to Scratch time (
America/New_York
) - remove concurrent PR limit
- enable "semantic commit" rules:
- use
fix
fordependencies
- use
chore
fordevDependencies
- use
- require 3 "stability days" before automatically merging non-LLK dependencies
- this configuration does not enable automatic merges but does preconfigure this setting
- label all Renovate PRs with
dependencies
- add the
security
label for any PR associated with a GitHub Security Vulnerability
- add the
- separate major updates from minor/patch updates: if both are available, open two separate PRs
This enables automatic merging of minor and patch releases. Dependencies outside of the LLK organization are subject
to the "stability days" settings from base.json
. This can be used directly, but the js-lib
and js-app
configurations may be more appropriate.
These build on the default.json
configuration and enables pinning according to the recommendations found
here. In short, js-lib
enables pinning of only devDependencies
and js-app
enables pinning of all except peerDependencies
. These are intended to be the Scratch versions of
Renovate's built-in config:js-lib
and config:js-app
presets.
The js-lib-bundled
configuration is a variant of js-lib
designed for libraries that use a bundler (webpack
,
etc.) to build their npm package. It treats lockFileMaintenance
PRs as fix
instead of chore
. For rationale, see
the "About Pinning" section below.
This legacy configuration enables automatic merging of major and minor releases for only LLK dependencies.
See Renovate's documentation for more information.
The js-lib
and js-app
configurations enable pinning of dependencies according to Renovate's recommendations:
devDependencies
are pinned to exact versions everywheredependencies
are pinned to exact versions forjs-app
but use^x.y.z
in repos usingjs-lib
Together, this means that non-dev dependencies of our libraries are pinned at the app level only.
More specifically, suppose scratch-vm
uses a library foo
as a dependency
(not devDependency
), and foo
updates from 1.0.0
to 1.1.0
. Suppose neither scratch-gui
nor scratch-www
use foo
as a direct dependency.
scratch-vm
, wherefoo
is listed as^1.0.0
, will receive alockFileMaintenance
PR to updatefoo
.- For a "normal" npm module, this PR would be unable to affect user-visible behavior, because it will not affect
package.json
or any other file. - Since
scratch-vm
useswebpack
, dependencies likefoo
are likely to be included in the build output, thus this PR could cause user-visible behavior changes.- If
scratch-vm
's build output is used by an app, thenscratch-vm
'slockFileMaintenance
PR could cause user-visible behavior changes in that app, implying that this should cause ascratch-vm
release. - If the app uses
scratch-vm
's source instead of its build output, thenscratch-vm
'slockFileMaintenance
PR cannot cause user-visible behavior changes in the app, implying that this should not cause ascratch-vm
release.
- If
- For a "normal" npm module, this PR would be unable to affect user-visible behavior, because it will not affect
scratch-www
will also receive alockFileMaintenance
PR to updatefoo
.foo
is not listed inscratch-www
'spackage.json
, so this PR won't affect that file.- If
scratch-www
usesscratch-vm
's build output, thenscratch-www
'slockFileMaintenance
PR will not cause user-visible behavior changes inscratch-www
. The app would receive any user-facing impact from thefoo
update whenscratch-www
updates itsscratch-vm
dependency. - If
scratch-www
usesscratch-vm
's source, thenscratch-www
'slockFileMaintenance
PR will cause user-visible behavior changes inscratch-www
. The app could receive some user-facing impact from thefoo
update here and some from thescratch-vm
update, or only one or the other.
In other words, by using webpack
(or any bundler) at the library level, we have made it difficult to predict the
effects of a lockFileMaintenance
PR and blurred the meaning of dependencies
vs. devDependencies
. Ideally, we
should use webpack
only at the app level; combined with Renovate's pinning recommendations, this would mean that
library lockFileMaintenance
changes could never affect user-visible behavior at the app level. Only app
lockFileMaintenance
changes could affect user-visible behavior. For now, marking lockFileMaintenance
PRs as fix
seems the safest option.
Before submitting a pull request, please validate your changes:
npx --package=renovate@latest renovate-config-validator *.json