dependency-cruiser

Validate and visualize dependencies. Your rules. JavaScript, TypeScript, CoffeeScript. ES6, CommonJS, AMD.

MIT License

Downloads
1.5M
Stars
4.9K
Committers
47

Bot releases are hidden (Show)

dependency-cruiser -

Published by sverweij over 3 years ago

🌟 features

  • dd40f692 feature(parse): adds swc as an alternative to the acorn and tsc parsers (#451) (also 🚀 performance improvement...)
  • 19a73ba6 feature(validate): adds a dependents count more than check (#450)

📖 documentation

  • 1596a778 bufgfix(doc): correct some typos

👷 maintenance

  • 5892678a build(npm): ⬆️ @babel/core, @typescript-eslint/eslint-plugin, @typescript-eslint/parser, ajv, eslint, semver, svelte
dependency-cruiser -

Published by sverweij over 3 years ago

🌟 Features

  • 59fdb491 feature(validate): adds a dependents count validation (#449) - thanks @davidparkagoda for the suggestion and the first validation!
  • 641a7c25 feature(enrich): adds dependents to each module (#446)

With these changes you can now define rules on the number of dependents a module must have. E.g. with this rule in the forbidden section, you can ensure modules in the shared folder are used at least twice (and if it drops below that you can move them to the sole dependent or remove the module altogether):

// ...
  {
    name: "no-unshared-in-shared",
    from: { 
      path: "^src",
      pathNot: "^src/shared"
    },
    module: {
      path: "^src/shared",
      numberOfDependentsLessThan: 2
    }
  },
// ...

You can read more about it in the rules reference on dependents rules and in the illustrated recipes.

🐛 Bugfixes

  • ce5342f5 bugfix(doc): corrects a typo (#447)

🧑‍🏭 Maintenance

  • e0e9f69b/ 4f470be3 build(npm): @typescript-eslint/eslint-plugin, @typescript-eslint/parser, ajv, chai, commander, eslint, eslint-plugin-unicorn, mocha, tsconfig-paths-webpack-plugin
  • 577d8c41 chore: removes a superfluous file
dependency-cruiser -

Published by sverweij over 3 years ago

📖 documentation

  • 7e5cb504 doc: adds some 'recipes' to the tutorial (#444)

👷 maintenance

  • 490664da build(npm): ⬆️ ajv, semver-try-require, @babe/core, @babe/plygin-transform-modules-commonjs, @babel/preset-typescript, @typescript-eslint/eslint-plugin, @typescript-eslint/parser, acorn, ajv, eslint, eslint-plugin-mocha, mocha, svelte, typescript
dependency-cruiser -

Published by sverweij over 3 years ago

🐛 bugfixes

  • c17007a2 bugfix(enrich): adds support for capturing groups on 'reachable' rules (#443)

👷‍♀️ maintenance

  • 6df6dab2 build(npm): ⬆️ ajv, lodash, @babel/core, @babel/preset-typescript, eslint-config-moving-meadow, eslint-plugin-unicorn
dependency-cruiser -

Published by sverweij over 3 years ago

🚀 performance improvements

  • c6a0d0fc perf(enrich): stop searching for reachables when one is found

🐛 bug fixes

  • 8918dfe7 bugfix(package.json): fixes typo in a run script
  • 4f2f02fd bugfix(plugin): make local plugins work better on on windows (#441)

👷 maintenance

  • 2a55d637 refactor(config-utl): replaces _.isEqual with util.isDeepStrictEqual
  • c33e2120 build(npm): ⬆️ ajv, commander, handlebars, @babe/core, @babel/preset-typescript, @typescript-eslint/eslint-plugin, @typescript-eslint/parser, eslint, eslint-plugin-unicorn, mocha, svelte, typescript
dependency-cruiser -

Published by sverweij over 3 years ago

🌟 features

  • feature: adds plumbing for reporter plugins (#439)
    This adds the possibility to have depcruise and depcruise-fmt use a reporter that is not shipped with dependency-cruiser via a simple plugin system. See the PR and the FAQ entry for details.

🐛 bugfixes

  • bugfix(extract): makes baseDir option usable from API and config (#438) - thanks @gaggle for the pull request!

📖 documentation

  • doc(real-world-samples): make the react graph easier to reproduce

👷 maintenance

  • test: adds non-regresion test for #437
dependency-cruiser -

Published by sverweij over 3 years ago

🐛 bugfixes

  • bugfix(report/dot): fixes bug where multiple runs leak theme modules (#437) (thanks @gaggle for the PR!)
  • bugfix(report): adds 'flat' as a reporter options type to the json schema and typescript definitions

📖 documentation

  • doc: adds a separate entry to the FAQ on seemingly partialy cruised (TypeScipt) graphs
  • doc: updates the state-machine-cat real world sample

🔧 maintenance

  • build(npm): ⬆️ acorn, acorn-loose, acorn-walk, ajv, json5, @babel/core, @babel/plugin-transform-modules-commonjs, @babel/preset-typescript, @typescript-eslint/eslint-plugin, @typescript-eslint/parser, eslint, lint-staged, svelte
dependency-cruiser -

Published by sverweij over 3 years ago

🌟 features

  • feature(render): adds a 'flat' graph reporter (#432)

🐛 bugfixes

  • Two fixes that makes using babel with TypeScript possible (with @babel/config-typescript) - thanks to @lwolle for providing the reproduction repo to test this against!

    • refactor(transpile): also pass a filename to the transpilers (#428)
    • bugfix(babel): re-add presets to config after running babel.loadConfig (#431)
      (this is a workaround on what seems like an unexpected side-effect of the babel-api, that might warrant an upstream fix)
  • bugfix(parse): for the typescript-via-acorn route pass jsx'ness of the original source (#433)

🏗️ maintenance

  • build(npm): ⬆️ @typescript-eslint/eslint-plugin, @typescript-eslint/parser, eslint-config-prettier, eslint-plugin-unicorn
dependency-cruiser -

Published by sverweij over 3 years ago

🚀 performance improvements

  • perf: limit external manifest resolution to positively external modules only (#425)

🐛 bug fixes

  • bugfix(main): relax the check to load tsconfig-paths-plugin (#427) (thanks @fabb and @lwolle for filing the (clear and complete) issues this fix solves and for validating it as a fix!)
  • bugfix(babel): also pass a filename to babel when parsing a babel config (#423) (thanks to @lwolle for filing the issue)

🧑‍🏭 regular maintenance

  • build(npm): ⬆️ @typescript-eslint/eslint-plugin, @typescript-eslint/parser, commander, eslint, eslint-plugin-unicorn
dependency-cruiser -

Published by sverweij almost 4 years ago

🚀 performance improvements

  • perf: restricts requiring init-config (+ inquirer) to when it's necessary (#420)
    (saves ~100ms in start-up time on a 2,6 GHz Quad-Core i7 running macOS with an ssd, likely more on similar windows machines, judging runs of the ci ~400ms)
dependency-cruiser -

Published by sverweij almost 4 years ago

🚀 performance improvements

  • perf(resolve): only load tsconfig-paths-plugin when there's at least one defined path (#419)

🔧 maintenance

  • build(npm): ⬆️ acorn-walk, @typescript-eslint/eslint-plugin, @typescript-eslint/parser, svelte
dependency-cruiser -

Published by sverweij almost 4 years ago

🐛 bugfixes

  • bugfix(init): explicitly pass no params to ts config detector (#417) - thanks @bx-ali for raising the issue!!
dependency-cruiser -

Published by sverweij almost 4 years ago

🚀 performance improvements

In order of impact:

  • build(npm): ⬇️ enhanced-resolve to 5.1.0 (#415)
    With version 5.2.0 (and up) dependency-cruiser is significantly slower than with earlier versions of the 5 major. The self cruise with her 5.2.0 takes ~8s, with 5.1.0 it takes ~3s. Might be worth it to issue a PR on enhanced-resolve to remedy that. Until then dc will be using 5.1.0.
  • perf(resolve): limits the #times external manifests are retrieved (#413)
  • perf(resolve): only read license/ deprecation when used in rule set (#412)
  • perf(resolve): reduces #extensions enhanced-resolve tries for manifest resolution
  • perf(resolve): only calculate exoticRequire strings once

📖 documentation

  • doc(samples): updates the config for react and yarn(berry)

⛏️ maintenance

  • build(npm): ⬆️ @typescript-eslint/eslint-plugin, @typescript-eslint/parser, ajv, eslint, eslint-config-moving-meadow, eslint-plugin-unicorn, svelte
  • refactor: removes use of pnp-webpack-plugin (#414)
  • chore: happy 2021
dependency-cruiser -

Published by sverweij almost 4 years ago

🐛 bugfixes

  • bugfix(babel): gives babel plugins a filename to work with (#411) (thanks to @mesteche for raising the issue & testing the fix!)
  • bugfix(types): makes corections and additions to the ICruiseOptions interface

👩‍🏭 refactoring

  • refactor(init): types the init config slightly better
dependency-cruiser -

Published by sverweij almost 4 years ago

☄️ performance improvements

  • refactor(extract): excludes excludable file name patterns earlier (#408)
    In cases where your exclude/ doNotFollow patterns happen to match the arguments to the depcruise command this can reduce running time, sometimes quite dramatically so. Thanks to @curledUpSheep for noticing and proposing & testing the improvement.

🎄 documentation

  • doc(config): adds declaration to types & tools dc configs

🎅 maintenance

  • chore(ci): reduce the scanned extensions in dc's ow config to the ones actually used
  • bugfix(init): correct typo's in template
dependency-cruiser -

Published by sverweij almost 4 years ago

🌟 Features

  • feature(resolve): improves support for package entry points (#407)
  • feature(init): types the generated .dependency-cruiser.js
    Newly generated .dependency-cruiser.js get a comment on top that declares the type of the exported object. In editors that support this, this will grow you code completion for the configuration.

You can use this type declaration in your own .dependency-cruiser.js configurations too:

/** @type {import('dependency-cruiser').IConfiguration} */
module.exports = {
  forbidden: [
    ...
  ],
  options: {
    ...
  }
}

If you're using a .json configuration - if you point it to the location of the schema (with the "$schema" attribute at root level)
it'll get you code completion as well

 {
   "$schema": "https://raw.githubusercontent.com/sverweij/dependency-cruiser/master/src/schema/configuration.schema.json",
   "forbidden": [
     ...
   ],
   "options": {
     ...
   }
}

Do upgrade to 9.21.0 for this to work, though.

👷‍♀️ Maintenance

  • build(npm): ⬆️ @typescript-eslint/eslint-plugin, @typescript-eslint/parser, ajv, commander, eslint, eslint-config-prettier, eslint-plugin-unicorn, enhanced-resolve

Where is version 9.20.0?

20 has proven to be an unlucky number this year, so we skipped it.

dependency-cruiser -

Published by sverweij almost 4 years ago

🐛 bugfixes

  • bugfix(doc): fixes links in pull request template
  • bugfix(extract): filter invalid symlinks (#405) (thanks to @dword-design for detecting the issue and fixing it!!)

⚒️ maintenance

  • build(npm): ⬆️ @babel/core, @typescript-eslint/eslint-plugin, @typescript-eslint/parser, typescript
dependency-cruiser -

Published by sverweij almost 4 years ago

🌟 features

  • feature(cli): adds showing % complete in cli-feedback (#403)
  • refactor(cli): exposes config extraction to the outside world (#402)
    this uses the exports feature which means two things:
    • if you want to use the newly exposed config extraction functions (e.g. the one defined in dependency-cruiser/config-utl/extract-ts-config), you need to be on a fairly recent version of node; ^12.19 || >=14.17
    • deep imports from dependency-cruiser's code base (that were never supported in the first place) won't work anymore.

🧰 maintenance

  • build(npm): ⬆️ @typescript-eslint/eslint-plugin, @typescript-eslint/parser, enhanced-resolve, eslint, eslint-config-prettier, lint-staged, semver, svelte
dependency-cruiser -

Published by sverweij almost 4 years ago

🌟 features

  • feature: adds support for svelte single file components (#393) - thanks @truongsinh for starting of the pull request!

🛠️ maintenance

  • build(npm): ⬆️ @babel/core, @typescript-eslint/eslint-plugin, @typescript-eslint/parser, enhanced-resolve, eslint, lint-staged, prettier, svelte, typescript
  • chore: replaces solution to automatically mark/ close stale issues (#401)
dependency-cruiser -

Published by sverweij almost 4 years ago

🐛 bugfixes

  • bugfix(validate): also correctly validate situations where 'moreThanOneDependencyType' equals false (#400) - thanks to @lo1tuma for raising the issue and validating the fix)
  • bugfix(extract): use acorn-jsx for parsing jsx (instead of acorn + acorn-loose) (#396) - thanks to @audunsol for raising the issue and the detailed feedback on the fix)

🔧 maintenance

  • refactor(enrich): put summarization in separate folder (#397)
  • build(npm): removes redundant /'s from the files config