Releases: sverweij/dependency-cruiser
Releases · sverweij/dependency-cruiser
v1.15.2
v1.15.1
- 🐥 expands the group matching introduced in v1.15.0 to more than one group (e.g. in
"([^\\.])/(.+)$"
stuff before the slash is available in$1
, after the slash in$2
- and the whole match is available in$0
. - 📖 splits the rules documentation in a tutorial and a reference.
- 📖 expands documentation on group matching with the expansion to > 1 group.
- ⬆️ upgrades ajv (json schema validator) and eslint
v1.15.0
- 🐣 include support for matching groups:
- Sometimes you'll want to use a part of the path the 'from' part of your rule matched and use it in the 'to' part. E.g. when you want to prevent stuff in the same folder to be matched.
- To achieve this you'll need to do two things:
- In the
to
of your rule:
Make sure the part of thepath
you want to be matched is between brackets.
Like so:"^src/([^/]+)/.+"
- In the
from
part of your rule:
You can reference the part matched between brackets by using$1
inpath
andpathNot
rules. Like so:"pathNot": "^src/$1/.+"
.
- In the
- See group matching in the rules guide for a little more information.
- 🔧 with the introduction of 'matching groups', the
ownFolder
attribute is deprecated. 'matching groups' offer more flexibility and more straightforward semantics, while they can achieve the same. - 🐛 pathNot attributes with scary regular expressions now get flagged as well (path attributes already had this)
v1.14.0
- 🐣 Adds a
--init-rules
option. This creates a .dependency-cruiser.json with some useful rules in it to the current folder and exits. See below for the 'starter kit' rules. - 📖 improves the intro text of the
--info
option a bit - 👷 tell bithound it's ok that we do have typescript and coffee-script in our dependencies, but nowhere in a direct require or import - as we're using a different construct there
The rules:
Rule | Description |
---|---|
not-to-test |
Don't allow dependencies from outside the test folder to test |
not-to-spec |
Don't allow dependencies to (typescript/ javascript/ coffeescript) spec files |
no-deprecated-core |
Warn about dependencies on deprecated core modules. |
not-to-unresolvable |
Don't allow dependencies on modules dependency-cruiser can't resolve to files on disk (which probably means they don't exist) |
not-to-dev-dep |
Don't allow dependencies from src/app/lib to a development only package |
no-non-package-json |
Don't allow dependencies to packages not in package.json (except from within node_modules) |
optional-deps-used |
Inform about the use of dependencies labeled as 'optional' (so you can ensure their imports a are sufficiently managed) |
peer-deps-used |
Warn about the use of a peer dependency (peer dependencies are deprecated with the advent of npm 3 - and probably gone with version 4). |
no-duplicate-dep-types |
Warn if a dependency occurs in your package.json more than once (technically: has more than one dependency type) |
v1.13.0
- 🐣 adds a
moreThanOneDependencyType
property to the validation rule format so it is possible to check on "multiple inclusions" (e.g. both independencies
and indevDependencies
) see rules.md#more-than-one-dependencytype-per-dependency for an example. - 🐣 modules that can't be followed any further grow a
dependencyTypes
when they're on a 'from' side in the output object - ⬆️ js-makedepend
v1.12.0
🐣 check against dependencies in package.json
- Adds a 'dependencyTypes' array to the extraction output format that
describes whether the dependency is e.g. a dependency or devDependency
in package.json, a core module, local one, could not be determined,
... - Adds a 'dependencyTypes' array to the validation rules definition. The
associated rule checks if there is an intersection between the
dependencyTypes array defined in the rules file and the one in the 'to'
of the output object. - Deprecates the 'coreModule' attribute - the dependencyTypes contains
the same information and the format is more elegant and flexible.Deprecated means: will definitely be gone in version v2.0.0 and higher.
🔧 Other stuff
- When displaying transpiler info (
depcruise --info
) dependency-cruiser
now takes the current version of the transpiler into account in determining availability - Adds the checks against package.json to dependency-cruisers own dependency-cruiser
rules. - ⬆️ ajv
v1.11.0
- 🔧 make adding new (alt-js) languages easier; sorta pluggable.
- 🐣 adds support for LiveScript in this fashion. Works if
livescript
is available - but if it isn't dependency-cruiser will happily chug along on the other supported languages (currently javascript, typescript and coffee script) - 🐣 add a
--info
command line option that shows what alt-js/ transpilers dependency-cruiser thinks are supported. - ⬆️ ajv, lodash and some dev dependencies