dependency-cruiser 13.1.1 → 13.1.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "dependency-cruiser",
3
- "version": "13.1.1",
3
+ "version": "13.1.2",
4
4
  "description": "Validate and visualize dependencies. With your rules. JavaScript, TypeScript, CoffeeScript. ES6, CommonJS, AMD.",
5
5
  "keywords": [
6
6
  "static analysis",
@@ -159,7 +159,7 @@
159
159
  "enhanced-resolve": "5.15.0",
160
160
  "figures": "5.0.0",
161
161
  "glob": "10.3.3",
162
- "handlebars": "4.7.7",
162
+ "handlebars": "4.7.8",
163
163
  "ignore": "5.2.4",
164
164
  "indent-string": "5.0.0",
165
165
  "interpret": "^3.1.1",
@@ -173,41 +173,40 @@
173
173
  "semver-try-require": "6.2.3",
174
174
  "teamcity-service-messages": "0.1.14",
175
175
  "tsconfig-paths-webpack-plugin": "4.1.0",
176
- "watskeburt": "0.11.6",
176
+ "watskeburt": "0.12.1",
177
177
  "wrap-ansi": "8.1.0"
178
178
  },
179
179
  "devDependencies": {
180
180
  "@babel/core": "7.22.9",
181
181
  "@babel/plugin-transform-modules-commonjs": "7.22.5",
182
182
  "@babel/preset-typescript": "7.22.5",
183
- "@swc/core": "1.3.69",
184
- "@types/lodash": "4.14.195",
185
- "@types/node": "20.4.2",
183
+ "@swc/core": "1.3.74",
184
+ "@types/lodash": "4.14.196",
185
+ "@types/node": "20.4.7",
186
186
  "@types/prompts": "2.4.4",
187
- "@typescript-eslint/eslint-plugin": "6.0.0",
188
- "@typescript-eslint/parser": "6.0.0",
187
+ "@typescript-eslint/eslint-plugin": "6.2.1",
188
+ "@typescript-eslint/parser": "6.2.1",
189
189
  "@vue/compiler-sfc": "3.3.4",
190
- "c8": "8.0.0",
190
+ "c8": "8.0.1",
191
191
  "chai": "4.3.7",
192
- "chai-json-schema": "1.5.1",
193
192
  "coffeescript": "2.7.0",
194
- "eslint": "8.45.0",
193
+ "eslint": "8.46.0",
195
194
  "eslint-config-moving-meadow": "4.0.2",
196
- "eslint-config-prettier": "8.8.0",
195
+ "eslint-config-prettier": "8.10.0",
197
196
  "eslint-plugin-budapestian": "5.0.1",
198
197
  "eslint-plugin-eslint-comments": "3.2.0",
199
- "eslint-plugin-import": "2.27.5",
198
+ "eslint-plugin-import": "2.28.0",
200
199
  "eslint-plugin-mocha": "10.1.0",
201
200
  "eslint-plugin-node": "11.1.0",
202
201
  "eslint-plugin-security": "1.7.1",
203
- "eslint-plugin-unicorn": "^47.0.0",
202
+ "eslint-plugin-unicorn": "^48.0.1",
204
203
  "husky": "8.0.3",
205
204
  "intercept-stdout": "0.1.2",
206
205
  "lint-staged": "13.2.3",
207
206
  "mocha": "10.2.0",
208
207
  "normalize-newline": "4.1.0",
209
208
  "npm-run-all": "4.1.5",
210
- "prettier": "3.0.0",
209
+ "prettier": "3.0.1",
211
210
  "proxyquire": "2.1.3",
212
211
  "shx": "0.3.4",
213
212
  "svelte": "3.59.1",
@@ -1 +1 @@
1
- var Handlebars=require("handlebars/runtime"),template=Handlebars.template,templates=Handlebars.templates=Handlebars.templates||{};templates["config.js.template.hbs"]=template({1:function(e,n,t,o,s){var i,r=null!=n?n:e.nullContext||{},a=e.hooks.helperMissing,l="function",c=e.escapeExpression,e=e.lookupProperty||function(e,n){if(Object.prototype.hasOwnProperty.call(e,n))return e[n]};return" 'extends': '"+c(typeof(i=null!=(i=e(t,"preset")||(null!=n?e(n,"preset"):n))?i:a)==l?i.call(r,{name:"preset",hash:{},data:s,loc:{start:{line:4,column:14},end:{line:4,column:24}}}):i)+"',\n /*\n the '"+c(typeof(i=null!=(i=e(t,"preset")||(null!=n?e(n,"preset"):n))?i:a)==l?i.call(r,{name:"preset",hash:{},data:s,loc:{start:{line:6,column:10},end:{line:6,column:20}}}):i)+"' preset\n contains these rules:\n no-circular - flags all circular dependencies\n no-orphans - flags orphan modules (except typescript .d.ts files)\n no-deprecated-core - flags dependencies on deprecated node 'core' modules\n no-deprecated-npm - flags dependencies on deprecated npm modules\n no-non-package-json - flags (npm) dependencies that don't occur in package.json\n not-to-unresolvable - flags dependencies that can't be resolved`\n no-duplicate-dep-types - flags dependencies that occur more than once in package.json\n\n If you need to, you can override these rules. E.g. to ignore the\n no-duplicate-dep-types rule, you can set its severity to \"ignore\" by\n adding this to the 'forbidden' section:\n {\n name: 'no-duplicate-dep-types',\n severity: 'ignore'\n }\n\n Also, by default, the preset does not follow any external modules (things in\n node_modules or in yarn's plug'n'play magic). If you want to have that\n differently, just override it the options.doNotFollow key.\n */\n forbidden: [\n"},3:function(e,n,t,o,s){return" forbidden: [\n /* rules from the 'recommended' preset: */\n {\n name: 'no-circular',\n severity: 'warn',\n comment:\n 'This dependency is part of a circular relationship. You might want to revise ' +\n 'your solution (i.e. use dependency inversion, make sure the modules have a single responsibility) ',\n from: {},\n to: {\n circular: true\n }\n },\n {\n name: 'no-orphans',\n comment:\n \"This is an orphan module - it's likely not used (anymore?). Either use it or \" +\n \"remove it. If it's logical this module is an orphan (i.e. it's a config file), \" +\n \"add an exception for it in your dependency-cruiser configuration. By default \" +\n \"this rule does not scrutinize dot-files (e.g. .eslintrc.js), TypeScript declaration \" +\n \"files (.d.ts), tsconfig.json and some of the babel and webpack configs.\",\n severity: 'warn',\n from: {\n orphan: true,\n pathNot: [\n '(^|/)\\\\.[^/]+\\\\.(js|cjs|mjs|ts|json)$', // dot files\n '\\\\.d\\\\.ts$', // TypeScript declaration files\n '(^|/)tsconfig\\\\.json$', // TypeScript config\n '(^|/)(babel|webpack)\\\\.config\\\\.(js|cjs|mjs|ts|json)$' // other configs\n ]\n },\n to: {},\n },\n {\n name: 'no-deprecated-core',\n comment:\n 'A module depends on a node core module that has been deprecated. Find an alternative - these are ' +\n \"bound to exist - node doesn't deprecate lightly.\",\n severity: 'warn',\n from: {},\n to: {\n dependencyTypes: [\n 'core'\n ],\n path: [\n '^(v8\\/tools\\/codemap)$',\n '^(v8\\/tools\\/consarray)$',\n '^(v8\\/tools\\/csvparser)$',\n '^(v8\\/tools\\/logreader)$',\n '^(v8\\/tools\\/profile_view)$',\n '^(v8\\/tools\\/profile)$',\n '^(v8\\/tools\\/SourceMap)$',\n '^(v8\\/tools\\/splaytree)$',\n '^(v8\\/tools\\/tickprocessor-driver)$',\n '^(v8\\/tools\\/tickprocessor)$',\n '^(node-inspect\\/lib\\/_inspect)$',\n '^(node-inspect\\/lib\\/internal\\/inspect_client)$',\n '^(node-inspect\\/lib\\/internal\\/inspect_repl)$',\n '^(async_hooks)$',\n '^(punycode)$',\n '^(domain)$',\n '^(constants)$',\n '^(sys)$',\n '^(_linklist)$',\n '^(_stream_wrap)$'\n ],\n }\n },\n {\n name: 'not-to-deprecated',\n comment:\n 'This module uses a (version of an) npm module that has been deprecated. Either upgrade to a later ' +\n 'version of that module, or find an alternative. Deprecated modules are a security risk.',\n severity: 'warn',\n from: {},\n to: {\n dependencyTypes: [\n 'deprecated'\n ]\n }\n },\n {\n name: 'no-non-package-json',\n severity: 'error',\n comment:\n \"This module depends on an npm package that isn't in the 'dependencies' section of your package.json. \" +\n \"That's problematic as the package either (1) won't be available on live (2 - worse) will be \" +\n \"available on live with an non-guaranteed version. Fix it by adding the package to the dependencies \" +\n \"in your package.json.\",\n from: {},\n to: {\n dependencyTypes: [\n 'npm-no-pkg',\n 'npm-unknown'\n ]\n }\n },\n {\n name: 'not-to-unresolvable',\n comment:\n \"This module depends on a module that cannot be found ('resolved to disk'). If it's an npm \" +\n 'module: add it to your package.json. In all other cases you likely already know what to do.',\n severity: 'error',\n from: {},\n to: {\n couldNotResolve: true\n }\n },\n {\n name: 'no-duplicate-dep-types',\n comment:\n \"Likely this module depends on an external ('npm') package that occurs more than once \" +\n \"in your package.json i.e. bot as a devDependencies and in dependencies. This will cause \" +\n \"maintenance problems later on.\",\n severity: 'warn',\n from: {},\n to: {\n moreThanOneDependencyType: true,\n // as it's pretty common to have a type import be a type only import \n // _and_ (e.g.) a devDependency - don't consider type-only dependency\n // types for this rule\n dependencyTypesNot: [\"type-only\"]\n }\n },\n\n /* rules you might want to tweak for your specific situation: */\n"},5:function(e,n,t,o,s){var i,r=null!=n?n:e.nullContext||{},a=e.hooks.helperMissing,l="function",c=e.escapeExpression,e=e.lookupProperty||function(e,n){if(Object.prototype.hasOwnProperty.call(e,n))return e[n]};return" {\n name: 'not-to-test',\n comment:\n \"This module depends on code within a folder that should only contain tests. As tests don't \" +\n \"implement functionality this is odd. Either you're writing a test outside the test folder \" +\n \"or there's something in the test folder that isn't a test.\",\n severity: 'error',\n from: {\n pathNot: '"+c(typeof(i=null!=(i=e(t,"testLocationRE")||(null!=n?e(n,"testLocationRE"):n))?i:a)==l?i.call(r,{name:"testLocationRE",hash:{},data:s,loc:{start:{line:166,column:18},end:{line:166,column:36}}}):i)+"'\n },\n to: {\n path: '"+c(typeof(i=null!=(i=e(t,"testLocationRE")||(null!=n?e(n,"testLocationRE"):n))?i:a)==l?i.call(r,{name:"testLocationRE",hash:{},data:s,loc:{start:{line:169,column:15},end:{line:169,column:33}}}):i)+"'\n }\n },\n"},7:function(e,n,t,o,s){return" tsPreCompilationDeps: true,\n"},9:function(e,n,t,o,s){return" // tsPreCompilationDeps: false,\n"},11:function(e,n,t,o,s){return" combinedDependencies: true,\n"},13:function(e,n,t,o,s){return" // combinedDependencies: false,\n"},15:function(e,n,t,o,s){var i=e.lookupProperty||function(e,n){if(Object.prototype.hasOwnProperty.call(e,n))return e[n]};return" tsConfig: {\n fileName: '"+e.escapeExpression("function"==typeof(t=null!=(t=i(t,"tsConfig")||(null!=n?i(n,"tsConfig"):n))?t:e.hooks.helperMissing)?t.call(null!=n?n:e.nullContext||{},{name:"tsConfig",hash:{},data:s,loc:{start:{line:316,column:17},end:{line:316,column:29}}}):t)+"'\n },\n"},17:function(e,n,t,o,s){var i=e.lookupProperty||function(e,n){if(Object.prototype.hasOwnProperty.call(e,n))return e[n]};return null!=(t=i(t,"if").call(null!=n?n:e.nullContext||{},null!=n?i(n,"useJsConfig"):n,{name:"if",hash:{},fn:e.program(18,s,0),inverse:e.program(20,s,0),data:s,loc:{start:{line:319,column:6},end:{line:327,column:13}}}))?t:""},18:function(e,n,t,o,s){var i=e.lookupProperty||function(e,n){if(Object.prototype.hasOwnProperty.call(e,n))return e[n]};return" tsConfig: {\n fileName: '"+e.escapeExpression("function"==typeof(t=null!=(t=i(t,"jsConfig")||(null!=n?i(n,"jsConfig"):n))?t:e.hooks.helperMissing)?t.call(null!=n?n:e.nullContext||{},{name:"jsConfig",hash:{},data:s,loc:{start:{line:321,column:17},end:{line:321,column:29}}}):t)+"'\n },\n"},20:function(e,n,t,o,s){return" // tsConfig: {\n // fileName: './tsconfig.json'\n // },\n"},22:function(e,n,t,o,s){var i=e.lookupProperty||function(e,n){if(Object.prototype.hasOwnProperty.call(e,n))return e[n]};return" webpackConfig: {\n fileName: '"+e.escapeExpression("function"==typeof(t=null!=(t=i(t,"webpackConfig")||(null!=n?i(n,"webpackConfig"):n))?t:e.hooks.helperMissing)?t.call(null!=n?n:e.nullContext||{},{name:"webpackConfig",hash:{},data:s,loc:{start:{line:342,column:17},end:{line:342,column:34}}}):t)+"',\n // env: {},\n // arguments: {},\n },\n"},24:function(e,n,t,o,s){return" // webpackConfig: {\n // fileName: './webpack.config.js',\n // env: {},\n // arguments: {},\n // },\n"},26:function(e,n,t,o,s){var i=e.lookupProperty||function(e,n){if(Object.prototype.hasOwnProperty.call(e,n))return e[n]};return" babelConfig: {\n fileName: '"+e.escapeExpression("function"==typeof(t=null!=(t=i(t,"babelConfig")||(null!=n?i(n,"babelConfig"):n))?t:e.hooks.helperMissing)?t.call(null!=n?n:e.nullContext||{},{name:"babelConfig",hash:{},data:s,loc:{start:{line:362,column:17},end:{line:362,column:32}}}):t)+"'\n },\n"},28:function(e,n,t,o,s){return" // babelConfig: {\n // fileName: './.babelrc'\n // },\n"},30:function(e,n,t,o,s){var i=e.lookupProperty||function(e,n){if(Object.prototype.hasOwnProperty.call(e,n))return e[n]};return" extensions: "+(null!=(i="function"==typeof(t=null!=(t=i(t,"resolutionExtensionsAsString")||(null!=n?i(n,"resolutionExtensionsAsString"):n))?t:e.hooks.helperMissing)?t.call(null!=n?n:e.nullContext||{},{name:"resolutionExtensionsAsString",hash:{},data:s,loc:{start:{line:412,column:18},end:{line:412,column:52}}}):t)?i:"")+",\n"},32:function(e,n,t,o,s){return' // extensions: [".js", ".jsx", ".ts", ".tsx", ".d.ts"],\n'},34:function(e,n,t,o,s){return' mainFields: ["main", "types"],\n'},36:function(e,n,t,o,s){return' // mainFields: ["main", "types"],\n'},compiler:[8,">= 4.3.0"],main:function(e,n,t,o,s){var i=null!=n?n:e.nullContext||{},r=e.hooks.helperMissing,a="function",l=e.escapeExpression,c=e.lookupProperty||function(e,n){if(Object.prototype.hasOwnProperty.call(e,n))return e[n]},p="/** @type {import('dependency-cruiser').IConfiguration} */\nmodule.exports = {\n"+(null!=(h=c(t,"if").call(i,null!=n?c(n,"preset"):n,{name:"if",hash:{},fn:e.program(1,s,0),inverse:e.program(3,s,0),data:s,loc:{start:{line:3,column:0},end:{line:156,column:7}}}))?h:""),u=null!=(u=c(t,"hasTestsOutsideSource")||(null!=n?c(n,"hasTestsOutsideSource"):n))?u:r,d={name:"hasTestsOutsideSource",hash:{},fn:e.program(5,s,0),inverse:e.noop,data:s,loc:{start:{line:157,column:4},end:{line:172,column:30}}},h=typeof u==a?u.call(i,d):u;return null!=(h=c(t,"hasTestsOutsideSource")?h:e.hooks.blockHelperMissing.call(n,h,d))&&(p+=h),p+" {\n name: 'not-to-spec',\n comment:\n 'This module depends on a spec (test) file. The sole responsibility of a spec file is to test code. ' +\n \"If there's something in a spec that's of use to other modules, it doesn't have that single \" +\n 'responsibility anymore. Factor it out into (e.g.) a separate utility/ helper or a mock.',\n severity: 'error',\n from: {},\n to: {\n path: '\\\\.(spec|test)\\\\.(js|mjs|cjs|ts|ls|coffee|litcoffee|coffee\\\\.md)$'\n }\n },\n {\n name: 'not-to-dev-dep',\n severity: 'error',\n comment:\n \"This module depends on an npm package from the 'devDependencies' section of your \" +\n 'package.json. It looks like something that ships to production, though. To prevent problems ' +\n \"with npm packages that aren't there on production declare it (only!) in the 'dependencies'\" +\n 'section of your package.json. If this module is development only - add it to the ' +\n 'from.pathNot re of the not-to-dev-dep rule in the dependency-cruiser configuration',\n from: {\n path: '"+l(typeof(u=null!=(u=c(t,"sourceLocationRE")||(null!=n?c(n,"sourceLocationRE"):n))?u:r)==a?u.call(i,{name:"sourceLocationRE",hash:{},data:s,loc:{start:{line:195,column:15},end:{line:195,column:35}}}):u)+"',\n pathNot: '\\\\.(spec|test)\\\\.(js|mjs|cjs|ts|ls|coffee|litcoffee|coffee\\\\.md)$'\n },\n to: {\n dependencyTypes: [\n 'npm-dev'\n ]\n }\n },\n {\n name: 'optional-deps-used',\n severity: 'info',\n comment:\n \"This module depends on an npm package that is declared as an optional dependency \" +\n \"in your package.json. As this makes sense in limited situations only, it's flagged here. \" +\n \"If you're using an optional dependency here by design - add an exception to your\" +\n \"dependency-cruiser configuration.\",\n from: {},\n to: {\n dependencyTypes: [\n 'npm-optional'\n ]\n }\n },\n {\n name: 'peer-deps-used',\n comment:\n \"This module depends on an npm package that is declared as a peer dependency \" +\n \"in your package.json. This makes sense if your package is e.g. a plugin, but in \" +\n \"other cases - maybe not so much. If the use of a peer dependency is intentional \" +\n \"add an exception to your dependency-cruiser configuration.\",\n severity: 'warn',\n from: {},\n to: {\n dependencyTypes: [\n 'npm-peer'\n ]\n }\n }\n ],\n options: {\n\n /* conditions specifying which files not to follow further when encountered:\n - path: a regular expression to match\n - dependencyTypes: see https://github.com/sverweij/dependency-cruiser/blob/main/doc/rules-reference.md#dependencytypes-and-dependencytypesnot\n for a complete list\n */\n doNotFollow: {\n path: 'node_modules'\n },\n\n /* conditions specifying which dependencies to exclude\n - path: a regular expression to match\n - dynamic: a boolean indicating whether to ignore dynamic (true) or static (false) dependencies.\n leave out if you want to exclude neither (recommended!)\n */\n // exclude : {\n // path: '',\n // dynamic: true\n // },\n\n /* pattern specifying which files to include (regular expression)\n dependency-cruiser will skip everything not matching this pattern\n */\n // includeOnly : '',\n\n /* dependency-cruiser will include modules matching against the focus\n regular expression in its output, as well as their neighbours (direct\n dependencies and dependents)\n */\n // focus : '',\n\n /* list of module systems to cruise */\n // moduleSystems: ['amd', 'cjs', 'es6', 'tsd'],\n\n /* prefix for links in html and svg output (e.g. 'https://github.com/you/yourrepo/blob/develop/'\n to open it on your online repo or `vscode://file/${process.cwd()}/` to \n open it in visual studio code),\n */\n // prefix: '',\n\n /* false (the default): ignore dependencies that only exist before typescript-to-javascript compilation\n true: also detect dependencies that only exist before typescript-to-javascript compilation\n \"specify\": for each dependency identify whether it only exists before compilation or also after\n */\n"+(null!=(h=c(t,"if").call(i,null!=n?c(n,"tsPreCompilationDeps"):n,{name:"if",hash:{},fn:e.program(7,s,0),inverse:e.program(9,s,0),data:s,loc:{start:{line:280,column:4},end:{line:284,column:11}}}))?h:"")+' \n /* \n list of extensions to scan that aren\'t javascript or compile-to-javascript. \n Empty by default. Only put extensions in here that you want to take into\n account that are _not_ parsable. \n */\n // extraExtensionsToScan: [".json", ".jpg", ".png", ".svg", ".webp"],\n\n /* if true combines the package.jsons found from the module up to the base\n folder the cruise is initiated from. Useful for how (some) mono-repos\n manage dependencies & dependency definitions.\n */\n'+(null!=(h=c(t,"if").call(i,null!=n?c(n,"combinedDependencies"):n,{name:"if",hash:{},fn:e.program(11,s,0),inverse:e.program(13,s,0),data:s,loc:{start:{line:297,column:4},end:{line:301,column:11}}}))?h:"")+"\n /* if true leave symlinks untouched, otherwise use the realpath */\n // preserveSymlinks: false,\n\n /* TypeScript project file ('tsconfig.json') to use for\n (1) compilation and\n (2) resolution (e.g. with the paths property)\n\n The (optional) fileName attribute specifies which file to take (relative to\n dependency-cruiser's current working directory). When not provided\n defaults to './tsconfig.json'.\n */\n"+(null!=(h=c(t,"if").call(i,null!=n?c(n,"useTsConfig"):n,{name:"if",hash:{},fn:e.program(15,s,0),inverse:e.program(17,s,0),data:s,loc:{start:{line:314,column:4},end:{line:328,column:11}}}))?h:"")+"\n /* Webpack configuration to use to get resolve options from.\n\n The (optional) fileName attribute specifies which file to take (relative\n to dependency-cruiser's current working directory. When not provided defaults\n to './webpack.conf.js'.\n\n The (optional) `env` and `arguments` attributes contain the parameters to be passed if\n your webpack config is a function and takes them (see webpack documentation\n for details)\n */\n"+(null!=(h=c(t,"if").call(i,null!=n?c(n,"useWebpackConfig"):n,{name:"if",hash:{},fn:e.program(22,s,0),inverse:e.program(24,s,0),data:s,loc:{start:{line:340,column:4},end:{line:352,column:11}}}))?h:"")+"\n /* Babel config ('.babelrc', '.babelrc.json', '.babelrc.json5', ...) to use\n for compilation (and whatever other naughty things babel plugins do to\n source code). This feature is well tested and usable, but might change\n behavior a bit over time (e.g. more precise results for used module \n systems) without dependency-cruiser getting a major version bump.\n */\n"+(null!=(h=c(t,"if").call(i,null!=n?c(n,"useBabelConfig"):n,{name:"if",hash:{},fn:e.program(26,s,0),inverse:e.program(28,s,0),data:s,loc:{start:{line:360,column:4},end:{line:368,column:11}}}))?h:"")+"\n /* List of strings you have in use in addition to cjs/ es6 requires\n & imports to declare module dependencies. Use this e.g. if you've\n re-declared require, use a require-wrapper or use window.require as\n a hack.\n */\n // exoticRequireStrings: [],\n /* options to pass on to enhanced-resolve, the package dependency-cruiser\n uses to resolve module references to disk. You can set most of these\n options in a webpack.conf.js - this section is here for those\n projects that don't have a separate webpack config file.\n\n Note: settings in webpack.conf.js override the ones specified here.\n */\n enhancedResolveOptions: {\n /* List of strings to consider as 'exports' fields in package.json. Use\n ['exports'] when you use packages that use such a field and your environment\n supports it (e.g. node ^12.19 || >=14.7 or recent versions of webpack).\n\n If you have an `exportsFields` attribute in your webpack config, that one\n will have precedence over the one specified here.\n */ \n exportsFields: [\"exports\"],\n /* List of conditions to check for in the exports field. e.g. use ['imports']\n if you're only interested in exposed es6 modules, ['require'] for commonjs,\n or all conditions at once `(['import', 'require', 'node', 'default']`)\n if anything goes for you. Only works when the 'exportsFields' array is\n non-empty.\n\n If you have a 'conditionNames' attribute in your webpack config, that one will\n have precedence over the one specified here.\n */\n conditionNames: [\"import\", \"require\", \"node\", \"default\"],\n /*\n The extensions, by default are the same as the ones dependency-cruiser\n can access (run `npx depcruise --info` to see which ones that are in\n _your_ environment. If that list is larger than what you need (e.g. \n it contains .js, .jsx, .ts, .tsx, .cts, .mts - but you don't use \n TypeScript you can pass just the extensions you actually use (e.g. \n [\".js\", \".jsx\"]). This can speed up the most expensive step in \n dependency cruising (module resolution) quite a bit.\n */\n"+(null!=(h=c(t,"if").call(i,null!=n?c(n,"specifyResolutionExtensions"):n,{name:"if",hash:{},fn:e.program(30,s,0),inverse:e.program(32,s,0),data:s,loc:{start:{line:411,column:6},end:{line:415,column:13}}}))?h:"")+' /* \n If your TypeScript project makes use of types specified in \'types\'\n fields in package.jsons of external dependencies, specify "types"\n in addition to "main" in here, so enhanced-resolve (the resolver\n dependency-cruiser uses) knows to also look there. You can also do\n this if you\'re not sure, but still use TypeScript. In a future version\n of dependency-cruiser this will likely become the default.\n */\n'+(null!=(h=c(t,"if").call(i,null!=n?c(n,"usesTypeScript"):n,{name:"if",hash:{},fn:e.program(34,s,0),inverse:e.program(36,s,0),data:s,loc:{start:{line:424,column:6},end:{line:428,column:13}}}))?h:"")+' },\n reporterOptions: {\n dot: {\n /* pattern of modules that can be consolidated in the detailed\n graphical dependency graph. The default pattern in this configuration\n collapses everything in node_modules to one folder deep so you see\n the external modules, but not the innards your app depends upon.\n */\n collapsePattern: \'node_modules/(@[^/]+/[^/]+|[^/]+)\',\n\n /* Options to tweak the appearance of your graph.See\n https://github.com/sverweij/dependency-cruiser/blob/main/doc/options-reference.md#reporteroptions\n for details and some examples. If you don\'t specify a theme\n don\'t worry - dependency-cruiser will fall back to the default one.\n */\n // theme: {\n // graph: {\n // /* use splines: "ortho" for straight lines. Be aware though\n // graphviz might take a long time calculating ortho(gonal)\n // routings.\n // */\n // splines: "true"\n // },\n // modules: [\n // {\n // criteria: { matchesFocus: true },\n // attributes: {\n // fillcolor: "lime",\n // penwidth: 2,\n // },\n // },\n // {\n // criteria: { matchesFocus: false },\n // attributes: {\n // fillcolor: "lightgrey",\n // },\n // },\n // {\n // criteria: { matchesReaches: true },\n // attributes: {\n // fillcolor: "lime",\n // penwidth: 2,\n // },\n // },\n // {\n // criteria: { matchesReaches: false },\n // attributes: {\n // fillcolor: "lightgrey",\n // },\n // },\n // {\n // criteria: { source: "^src/model" },\n // attributes: { fillcolor: "#ccccff" }\n // },\n // {\n // criteria: { source: "^src/view" },\n // attributes: { fillcolor: "#ccffcc" }\n // },\n // ],\n // dependencies: [\n // {\n // criteria: { "rules[0].severity": "error" },\n // attributes: { fontcolor: "red", color: "red" }\n // },\n // {\n // criteria: { "rules[0].severity": "warn" },\n // attributes: { fontcolor: "orange", color: "orange" }\n // },\n // {\n // criteria: { "rules[0].severity": "info" },\n // attributes: { fontcolor: "blue", color: "blue" }\n // },\n // {\n // criteria: { resolved: "^src/model" },\n // attributes: { color: "#0000ff77" }\n // },\n // {\n // criteria: { resolved: "^src/view" },\n // attributes: { color: "#00770077" }\n // }\n // ]\n // }\n },\n archi: {\n /* pattern of modules that can be consolidated in the high level\n graphical dependency graph. If you use the high level graphical\n dependency graph reporter (`archi`) you probably want to tweak\n this collapsePattern to your situation.\n */\n collapsePattern: \'^(packages|src|lib|app|bin|test(s?)|spec(s?))/[^/]+|node_modules/(@[^/]+/[^/]+|[^/]+)\',\n\n /* Options to tweak the appearance of your graph.See\n https://github.com/sverweij/dependency-cruiser/blob/main/doc/options-reference.md#reporteroptions\n for details and some examples. If you don\'t specify a theme\n for \'archi\' dependency-cruiser will use the one specified in the\n dot section (see above), if any, and otherwise use the default one.\n */\n // theme: {\n // },\n },\n "text": {\n "highlightFocused": true\n },\n }\n }\n};\n// generated: dependency-cruiser@'+l(typeof(u=null!=(u=c(t,"version")||(null!=n?c(n,"version"):n))?u:r)==a?u.call(i,{name:"version",hash:{},data:s,loc:{start:{line:535,column:33},end:{line:535,column:44}}}):u)+" on "+l(typeof(u=null!=(u=c(t,"date")||(null!=n?c(n,"date"):n))?u:r)==a?u.call(i,{name:"date",hash:{},data:s,loc:{start:{line:535,column:48},end:{line:535,column:56}}}):u)+"\n"},useData:!0});
1
+ var Handlebars=require("handlebars/runtime"),template=Handlebars.template,templates=Handlebars.templates=Handlebars.templates||{};templates["config.js.template.hbs"]=template({1:function(e,n,t,o,s){var i,r=null!=n?n:e.nullContext||{},a=e.hooks.helperMissing,l="function",c=e.escapeExpression,e=e.lookupProperty||function(e,n){if(Object.prototype.hasOwnProperty.call(e,n))return e[n]};return" {\n name: 'not-to-test',\n comment:\n \"This module depends on code within a folder that should only contain tests. As tests don't \" +\n \"implement functionality this is odd. Either you're writing a test outside the test folder \" +\n \"or there's something in the test folder that isn't a test.\",\n severity: 'error',\n from: {\n pathNot: '"+c(typeof(i=null!=(i=e(t,"testLocationRE")||(null!=n?e(n,"testLocationRE"):n))?i:a)==l?i.call(r,{name:"testLocationRE",hash:{},data:s,loc:{start:{line:137,column:18},end:{line:137,column:36}}}):i)+"'\n },\n to: {\n path: '"+c(typeof(i=null!=(i=e(t,"testLocationRE")||(null!=n?e(n,"testLocationRE"):n))?i:a)==l?i.call(r,{name:"testLocationRE",hash:{},data:s,loc:{start:{line:140,column:15},end:{line:140,column:33}}}):i)+"'\n }\n },\n"},3:function(e,n,t,o,s){return" tsPreCompilationDeps: true,\n"},5:function(e,n,t,o,s){return" // tsPreCompilationDeps: false,\n"},7:function(e,n,t,o,s){return" combinedDependencies: true,\n"},9:function(e,n,t,o,s){return" // combinedDependencies: false,\n"},11:function(e,n,t,o,s){var i=e.lookupProperty||function(e,n){if(Object.prototype.hasOwnProperty.call(e,n))return e[n]};return" tsConfig: {\n fileName: '"+e.escapeExpression("function"==typeof(t=null!=(t=i(t,"tsConfig")||(null!=n?i(n,"tsConfig"):n))?t:e.hooks.helperMissing)?t.call(null!=n?n:e.nullContext||{},{name:"tsConfig",hash:{},data:s,loc:{start:{line:287,column:17},end:{line:287,column:29}}}):t)+"'\n },\n"},13:function(e,n,t,o,s){var i=e.lookupProperty||function(e,n){if(Object.prototype.hasOwnProperty.call(e,n))return e[n]};return null!=(t=i(t,"if").call(null!=n?n:e.nullContext||{},null!=n?i(n,"useJsConfig"):n,{name:"if",hash:{},fn:e.program(14,s,0),inverse:e.program(16,s,0),data:s,loc:{start:{line:290,column:6},end:{line:298,column:13}}}))?t:""},14:function(e,n,t,o,s){var i=e.lookupProperty||function(e,n){if(Object.prototype.hasOwnProperty.call(e,n))return e[n]};return" tsConfig: {\n fileName: '"+e.escapeExpression("function"==typeof(t=null!=(t=i(t,"jsConfig")||(null!=n?i(n,"jsConfig"):n))?t:e.hooks.helperMissing)?t.call(null!=n?n:e.nullContext||{},{name:"jsConfig",hash:{},data:s,loc:{start:{line:292,column:17},end:{line:292,column:29}}}):t)+"'\n },\n"},16:function(e,n,t,o,s){return" // tsConfig: {\n // fileName: './tsconfig.json'\n // },\n"},18:function(e,n,t,o,s){var i=e.lookupProperty||function(e,n){if(Object.prototype.hasOwnProperty.call(e,n))return e[n]};return" webpackConfig: {\n fileName: '"+e.escapeExpression("function"==typeof(t=null!=(t=i(t,"webpackConfig")||(null!=n?i(n,"webpackConfig"):n))?t:e.hooks.helperMissing)?t.call(null!=n?n:e.nullContext||{},{name:"webpackConfig",hash:{},data:s,loc:{start:{line:313,column:17},end:{line:313,column:34}}}):t)+"',\n // env: {},\n // arguments: {},\n },\n"},20:function(e,n,t,o,s){return" // webpackConfig: {\n // fileName: './webpack.config.js',\n // env: {},\n // arguments: {},\n // },\n"},22:function(e,n,t,o,s){var i=e.lookupProperty||function(e,n){if(Object.prototype.hasOwnProperty.call(e,n))return e[n]};return" babelConfig: {\n fileName: '"+e.escapeExpression("function"==typeof(t=null!=(t=i(t,"babelConfig")||(null!=n?i(n,"babelConfig"):n))?t:e.hooks.helperMissing)?t.call(null!=n?n:e.nullContext||{},{name:"babelConfig",hash:{},data:s,loc:{start:{line:333,column:17},end:{line:333,column:32}}}):t)+"'\n },\n"},24:function(e,n,t,o,s){return" // babelConfig: {\n // fileName: './.babelrc'\n // },\n"},26:function(e,n,t,o,s){var i=e.lookupProperty||function(e,n){if(Object.prototype.hasOwnProperty.call(e,n))return e[n]};return" extensions: "+(null!=(i="function"==typeof(t=null!=(t=i(t,"resolutionExtensionsAsString")||(null!=n?i(n,"resolutionExtensionsAsString"):n))?t:e.hooks.helperMissing)?t.call(null!=n?n:e.nullContext||{},{name:"resolutionExtensionsAsString",hash:{},data:s,loc:{start:{line:383,column:18},end:{line:383,column:52}}}):t)?i:"")+",\n"},28:function(e,n,t,o,s){return' // extensions: [".js", ".jsx", ".ts", ".tsx", ".d.ts"],\n'},30:function(e,n,t,o,s){return' mainFields: ["main", "types"],\n'},32:function(e,n,t,o,s){return' // mainFields: ["main", "types"],\n'},compiler:[8,">= 4.3.0"],main:function(e,n,t,o,s){var i=null!=n?n:e.nullContext||{},r=e.hooks.helperMissing,a="function",l=e.escapeExpression,c=e.lookupProperty||function(e,n){if(Object.prototype.hasOwnProperty.call(e,n))return e[n]},p="/** @type {import('dependency-cruiser').IConfiguration} */\nmodule.exports = {\n forbidden: [\n {\n name: 'no-circular',\n severity: 'warn',\n comment:\n 'This dependency is part of a circular relationship. You might want to revise ' +\n 'your solution (i.e. use dependency inversion, make sure the modules have a single responsibility) ',\n from: {},\n to: {\n circular: true\n }\n },\n {\n name: 'no-orphans',\n comment:\n \"This is an orphan module - it's likely not used (anymore?). Either use it or \" +\n \"remove it. If it's logical this module is an orphan (i.e. it's a config file), \" +\n \"add an exception for it in your dependency-cruiser configuration. By default \" +\n \"this rule does not scrutinize dot-files (e.g. .eslintrc.js), TypeScript declaration \" +\n \"files (.d.ts), tsconfig.json and some of the babel and webpack configs.\",\n severity: 'warn',\n from: {\n orphan: true,\n pathNot: [\n '(^|/)\\\\.[^/]+\\\\.(js|cjs|mjs|ts|json)$', // dot files\n '\\\\.d\\\\.ts$', // TypeScript declaration files\n '(^|/)tsconfig\\\\.json$', // TypeScript config\n '(^|/)(babel|webpack)\\\\.config\\\\.(js|cjs|mjs|ts|json)$' // other configs\n ]\n },\n to: {},\n },\n {\n name: 'no-deprecated-core',\n comment:\n 'A module depends on a node core module that has been deprecated. Find an alternative - these are ' +\n \"bound to exist - node doesn't deprecate lightly.\",\n severity: 'warn',\n from: {},\n to: {\n dependencyTypes: [\n 'core'\n ],\n path: [\n '^(v8\\/tools\\/codemap)$',\n '^(v8\\/tools\\/consarray)$',\n '^(v8\\/tools\\/csvparser)$',\n '^(v8\\/tools\\/logreader)$',\n '^(v8\\/tools\\/profile_view)$',\n '^(v8\\/tools\\/profile)$',\n '^(v8\\/tools\\/SourceMap)$',\n '^(v8\\/tools\\/splaytree)$',\n '^(v8\\/tools\\/tickprocessor-driver)$',\n '^(v8\\/tools\\/tickprocessor)$',\n '^(node-inspect\\/lib\\/_inspect)$',\n '^(node-inspect\\/lib\\/internal\\/inspect_client)$',\n '^(node-inspect\\/lib\\/internal\\/inspect_repl)$',\n '^(async_hooks)$',\n '^(punycode)$',\n '^(domain)$',\n '^(constants)$',\n '^(sys)$',\n '^(_linklist)$',\n '^(_stream_wrap)$'\n ],\n }\n },\n {\n name: 'not-to-deprecated',\n comment:\n 'This module uses a (version of an) npm module that has been deprecated. Either upgrade to a later ' +\n 'version of that module, or find an alternative. Deprecated modules are a security risk.',\n severity: 'warn',\n from: {},\n to: {\n dependencyTypes: [\n 'deprecated'\n ]\n }\n },\n {\n name: 'no-non-package-json',\n severity: 'error',\n comment:\n \"This module depends on an npm package that isn't in the 'dependencies' section of your package.json. \" +\n \"That's problematic as the package either (1) won't be available on live (2 - worse) will be \" +\n \"available on live with an non-guaranteed version. Fix it by adding the package to the dependencies \" +\n \"in your package.json.\",\n from: {},\n to: {\n dependencyTypes: [\n 'npm-no-pkg',\n 'npm-unknown'\n ]\n }\n },\n {\n name: 'not-to-unresolvable',\n comment:\n \"This module depends on a module that cannot be found ('resolved to disk'). If it's an npm \" +\n 'module: add it to your package.json. In all other cases you likely already know what to do.',\n severity: 'error',\n from: {},\n to: {\n couldNotResolve: true\n }\n },\n {\n name: 'no-duplicate-dep-types',\n comment:\n \"Likely this module depends on an external ('npm') package that occurs more than once \" +\n \"in your package.json i.e. bot as a devDependencies and in dependencies. This will cause \" +\n \"maintenance problems later on.\",\n severity: 'warn',\n from: {},\n to: {\n moreThanOneDependencyType: true,\n // as it's pretty common to have a type import be a type only import \n // _and_ (e.g.) a devDependency - don't consider type-only dependency\n // types for this rule\n dependencyTypesNot: [\"type-only\"]\n }\n },\n\n /* rules you might want to tweak for your specific situation: */\n",u=null!=(u=c(t,"hasTestsOutsideSource")||(null!=n?c(n,"hasTestsOutsideSource"):n))?u:r,d={name:"hasTestsOutsideSource",hash:{},fn:e.program(1,s,0),inverse:e.noop,data:s,loc:{start:{line:128,column:4},end:{line:143,column:30}}},h=typeof u==a?u.call(i,d):u;return null!=(h=c(t,"hasTestsOutsideSource")?h:e.hooks.blockHelperMissing.call(n,h,d))&&(p+=h),p+" {\n name: 'not-to-spec',\n comment:\n 'This module depends on a spec (test) file. The sole responsibility of a spec file is to test code. ' +\n \"If there's something in a spec that's of use to other modules, it doesn't have that single \" +\n 'responsibility anymore. Factor it out into (e.g.) a separate utility/ helper or a mock.',\n severity: 'error',\n from: {},\n to: {\n path: '\\\\.(spec|test)\\\\.(js|mjs|cjs|ts|ls|coffee|litcoffee|coffee\\\\.md)$'\n }\n },\n {\n name: 'not-to-dev-dep',\n severity: 'error',\n comment:\n \"This module depends on an npm package from the 'devDependencies' section of your \" +\n 'package.json. It looks like something that ships to production, though. To prevent problems ' +\n \"with npm packages that aren't there on production declare it (only!) in the 'dependencies'\" +\n 'section of your package.json. If this module is development only - add it to the ' +\n 'from.pathNot re of the not-to-dev-dep rule in the dependency-cruiser configuration',\n from: {\n path: '"+l(typeof(u=null!=(u=c(t,"sourceLocationRE")||(null!=n?c(n,"sourceLocationRE"):n))?u:r)==a?u.call(i,{name:"sourceLocationRE",hash:{},data:s,loc:{start:{line:166,column:15},end:{line:166,column:35}}}):u)+"',\n pathNot: '\\\\.(spec|test)\\\\.(js|mjs|cjs|ts|ls|coffee|litcoffee|coffee\\\\.md)$'\n },\n to: {\n dependencyTypes: [\n 'npm-dev'\n ]\n }\n },\n {\n name: 'optional-deps-used',\n severity: 'info',\n comment:\n \"This module depends on an npm package that is declared as an optional dependency \" +\n \"in your package.json. As this makes sense in limited situations only, it's flagged here. \" +\n \"If you're using an optional dependency here by design - add an exception to your\" +\n \"dependency-cruiser configuration.\",\n from: {},\n to: {\n dependencyTypes: [\n 'npm-optional'\n ]\n }\n },\n {\n name: 'peer-deps-used',\n comment:\n \"This module depends on an npm package that is declared as a peer dependency \" +\n \"in your package.json. This makes sense if your package is e.g. a plugin, but in \" +\n \"other cases - maybe not so much. If the use of a peer dependency is intentional \" +\n \"add an exception to your dependency-cruiser configuration.\",\n severity: 'warn',\n from: {},\n to: {\n dependencyTypes: [\n 'npm-peer'\n ]\n }\n }\n ],\n options: {\n\n /* conditions specifying which files not to follow further when encountered:\n - path: a regular expression to match\n - dependencyTypes: see https://github.com/sverweij/dependency-cruiser/blob/main/doc/rules-reference.md#dependencytypes-and-dependencytypesnot\n for a complete list\n */\n doNotFollow: {\n path: 'node_modules'\n },\n\n /* conditions specifying which dependencies to exclude\n - path: a regular expression to match\n - dynamic: a boolean indicating whether to ignore dynamic (true) or static (false) dependencies.\n leave out if you want to exclude neither (recommended!)\n */\n // exclude : {\n // path: '',\n // dynamic: true\n // },\n\n /* pattern specifying which files to include (regular expression)\n dependency-cruiser will skip everything not matching this pattern\n */\n // includeOnly : '',\n\n /* dependency-cruiser will include modules matching against the focus\n regular expression in its output, as well as their neighbours (direct\n dependencies and dependents)\n */\n // focus : '',\n\n /* list of module systems to cruise */\n // moduleSystems: ['amd', 'cjs', 'es6', 'tsd'],\n\n /* prefix for links in html and svg output (e.g. 'https://github.com/you/yourrepo/blob/develop/'\n to open it on your online repo or `vscode://file/${process.cwd()}/` to \n open it in visual studio code),\n */\n // prefix: '',\n\n /* false (the default): ignore dependencies that only exist before typescript-to-javascript compilation\n true: also detect dependencies that only exist before typescript-to-javascript compilation\n \"specify\": for each dependency identify whether it only exists before compilation or also after\n */\n"+(null!=(h=c(t,"if").call(i,null!=n?c(n,"tsPreCompilationDeps"):n,{name:"if",hash:{},fn:e.program(3,s,0),inverse:e.program(5,s,0),data:s,loc:{start:{line:251,column:4},end:{line:255,column:11}}}))?h:"")+' \n /* \n list of extensions to scan that aren\'t javascript or compile-to-javascript. \n Empty by default. Only put extensions in here that you want to take into\n account that are _not_ parsable. \n */\n // extraExtensionsToScan: [".json", ".jpg", ".png", ".svg", ".webp"],\n\n /* if true combines the package.jsons found from the module up to the base\n folder the cruise is initiated from. Useful for how (some) mono-repos\n manage dependencies & dependency definitions.\n */\n'+(null!=(h=c(t,"if").call(i,null!=n?c(n,"combinedDependencies"):n,{name:"if",hash:{},fn:e.program(7,s,0),inverse:e.program(9,s,0),data:s,loc:{start:{line:268,column:4},end:{line:272,column:11}}}))?h:"")+"\n /* if true leave symlinks untouched, otherwise use the realpath */\n // preserveSymlinks: false,\n\n /* TypeScript project file ('tsconfig.json') to use for\n (1) compilation and\n (2) resolution (e.g. with the paths property)\n\n The (optional) fileName attribute specifies which file to take (relative to\n dependency-cruiser's current working directory). When not provided\n defaults to './tsconfig.json'.\n */\n"+(null!=(h=c(t,"if").call(i,null!=n?c(n,"useTsConfig"):n,{name:"if",hash:{},fn:e.program(11,s,0),inverse:e.program(13,s,0),data:s,loc:{start:{line:285,column:4},end:{line:299,column:11}}}))?h:"")+"\n /* Webpack configuration to use to get resolve options from.\n\n The (optional) fileName attribute specifies which file to take (relative\n to dependency-cruiser's current working directory. When not provided defaults\n to './webpack.conf.js'.\n\n The (optional) `env` and `arguments` attributes contain the parameters to be passed if\n your webpack config is a function and takes them (see webpack documentation\n for details)\n */\n"+(null!=(h=c(t,"if").call(i,null!=n?c(n,"useWebpackConfig"):n,{name:"if",hash:{},fn:e.program(18,s,0),inverse:e.program(20,s,0),data:s,loc:{start:{line:311,column:4},end:{line:323,column:11}}}))?h:"")+"\n /* Babel config ('.babelrc', '.babelrc.json', '.babelrc.json5', ...) to use\n for compilation (and whatever other naughty things babel plugins do to\n source code). This feature is well tested and usable, but might change\n behavior a bit over time (e.g. more precise results for used module \n systems) without dependency-cruiser getting a major version bump.\n */\n"+(null!=(h=c(t,"if").call(i,null!=n?c(n,"useBabelConfig"):n,{name:"if",hash:{},fn:e.program(22,s,0),inverse:e.program(24,s,0),data:s,loc:{start:{line:331,column:4},end:{line:339,column:11}}}))?h:"")+"\n /* List of strings you have in use in addition to cjs/ es6 requires\n & imports to declare module dependencies. Use this e.g. if you've\n re-declared require, use a require-wrapper or use window.require as\n a hack.\n */\n // exoticRequireStrings: [],\n /* options to pass on to enhanced-resolve, the package dependency-cruiser\n uses to resolve module references to disk. You can set most of these\n options in a webpack.conf.js - this section is here for those\n projects that don't have a separate webpack config file.\n\n Note: settings in webpack.conf.js override the ones specified here.\n */\n enhancedResolveOptions: {\n /* List of strings to consider as 'exports' fields in package.json. Use\n ['exports'] when you use packages that use such a field and your environment\n supports it (e.g. node ^12.19 || >=14.7 or recent versions of webpack).\n\n If you have an `exportsFields` attribute in your webpack config, that one\n will have precedence over the one specified here.\n */ \n exportsFields: [\"exports\"],\n /* List of conditions to check for in the exports field. e.g. use ['imports']\n if you're only interested in exposed es6 modules, ['require'] for commonjs,\n or all conditions at once `(['import', 'require', 'node', 'default']`)\n if anything goes for you. Only works when the 'exportsFields' array is\n non-empty.\n\n If you have a 'conditionNames' attribute in your webpack config, that one will\n have precedence over the one specified here.\n */\n conditionNames: [\"import\", \"require\", \"node\", \"default\"],\n /*\n The extensions, by default are the same as the ones dependency-cruiser\n can access (run `npx depcruise --info` to see which ones that are in\n _your_ environment. If that list is larger than what you need (e.g. \n it contains .js, .jsx, .ts, .tsx, .cts, .mts - but you don't use \n TypeScript you can pass just the extensions you actually use (e.g. \n [\".js\", \".jsx\"]). This can speed up the most expensive step in \n dependency cruising (module resolution) quite a bit.\n */\n"+(null!=(h=c(t,"if").call(i,null!=n?c(n,"specifyResolutionExtensions"):n,{name:"if",hash:{},fn:e.program(26,s,0),inverse:e.program(28,s,0),data:s,loc:{start:{line:382,column:6},end:{line:386,column:13}}}))?h:"")+' /* \n If your TypeScript project makes use of types specified in \'types\'\n fields in package.jsons of external dependencies, specify "types"\n in addition to "main" in here, so enhanced-resolve (the resolver\n dependency-cruiser uses) knows to also look there. You can also do\n this if you\'re not sure, but still use TypeScript. In a future version\n of dependency-cruiser this will likely become the default.\n */\n'+(null!=(h=c(t,"if").call(i,null!=n?c(n,"usesTypeScript"):n,{name:"if",hash:{},fn:e.program(30,s,0),inverse:e.program(32,s,0),data:s,loc:{start:{line:395,column:6},end:{line:399,column:13}}}))?h:"")+' },\n reporterOptions: {\n dot: {\n /* pattern of modules that can be consolidated in the detailed\n graphical dependency graph. The default pattern in this configuration\n collapses everything in node_modules to one folder deep so you see\n the external modules, but not the innards your app depends upon.\n */\n collapsePattern: \'node_modules/(@[^/]+/[^/]+|[^/]+)\',\n\n /* Options to tweak the appearance of your graph.See\n https://github.com/sverweij/dependency-cruiser/blob/main/doc/options-reference.md#reporteroptions\n for details and some examples. If you don\'t specify a theme\n don\'t worry - dependency-cruiser will fall back to the default one.\n */\n // theme: {\n // graph: {\n // /* use splines: "ortho" for straight lines. Be aware though\n // graphviz might take a long time calculating ortho(gonal)\n // routings.\n // */\n // splines: "true"\n // },\n // modules: [\n // {\n // criteria: { matchesFocus: true },\n // attributes: {\n // fillcolor: "lime",\n // penwidth: 2,\n // },\n // },\n // {\n // criteria: { matchesFocus: false },\n // attributes: {\n // fillcolor: "lightgrey",\n // },\n // },\n // {\n // criteria: { matchesReaches: true },\n // attributes: {\n // fillcolor: "lime",\n // penwidth: 2,\n // },\n // },\n // {\n // criteria: { matchesReaches: false },\n // attributes: {\n // fillcolor: "lightgrey",\n // },\n // },\n // {\n // criteria: { source: "^src/model" },\n // attributes: { fillcolor: "#ccccff" }\n // },\n // {\n // criteria: { source: "^src/view" },\n // attributes: { fillcolor: "#ccffcc" }\n // },\n // ],\n // dependencies: [\n // {\n // criteria: { "rules[0].severity": "error" },\n // attributes: { fontcolor: "red", color: "red" }\n // },\n // {\n // criteria: { "rules[0].severity": "warn" },\n // attributes: { fontcolor: "orange", color: "orange" }\n // },\n // {\n // criteria: { "rules[0].severity": "info" },\n // attributes: { fontcolor: "blue", color: "blue" }\n // },\n // {\n // criteria: { resolved: "^src/model" },\n // attributes: { color: "#0000ff77" }\n // },\n // {\n // criteria: { resolved: "^src/view" },\n // attributes: { color: "#00770077" }\n // }\n // ]\n // }\n },\n archi: {\n /* pattern of modules that can be consolidated in the high level\n graphical dependency graph. If you use the high level graphical\n dependency graph reporter (`archi`) you probably want to tweak\n this collapsePattern to your situation.\n */\n collapsePattern: \'^(packages|src|lib|app|bin|test(s?)|spec(s?))/[^/]+|node_modules/(@[^/]+/[^/]+|[^/]+)\',\n\n /* Options to tweak the appearance of your graph.See\n https://github.com/sverweij/dependency-cruiser/blob/main/doc/options-reference.md#reporteroptions\n for details and some examples. If you don\'t specify a theme\n for \'archi\' dependency-cruiser will use the one specified in the\n dot section (see above), if any, and otherwise use the default one.\n */\n // theme: {\n // },\n },\n "text": {\n "highlightFocused": true\n },\n }\n }\n};\n// generated: dependency-cruiser@'+l(typeof(u=null!=(u=c(t,"version")||(null!=n?c(n,"version"):n))?u:r)==a?u.call(i,{name:"version",hash:{},data:s,loc:{start:{line:506,column:33},end:{line:506,column:44}}}):u)+" on "+l(typeof(u=null!=(u=c(t,"date")||(null!=n?c(n,"date"):n))?u:r)==a?u.call(i,{name:"date",hash:{},data:s,loc:{start:{line:506,column:48},end:{line:506,column:56}}}):u)+"\n"},useData:!0});
@@ -46,14 +46,6 @@ function getOneShotConfig(pOneShotConfigId) {
46
46
  };
47
47
  /** @type {Map<import("./types").OneShotConfigIDType, import("./types").IPartialInitConfig>} */
48
48
  const lOneShotConfigs = new Map([
49
- [
50
- "preset",
51
- {
52
- configType: "preset",
53
- preset: "dependency-cruiser/configs/recommended-strict",
54
- ...lBaseConfig,
55
- },
56
- ],
57
49
  ["yes", lBaseConfig],
58
50
  [
59
51
  "experimental-scripts",
@@ -19,9 +19,9 @@ function usesTypeScript(pInitOptions, pExtensions) {
19
19
  pInitOptions.tsPreCompilationDeps ||
20
20
  (pExtensions || []).some((pExtension) =>
21
21
  [".ts", ".tsx", ".d.ts", ".mts", ".d.mts", ".cts", ".d.cts"].includes(
22
- pExtension
23
- )
24
- )
22
+ pExtension,
23
+ ),
24
+ ),
25
25
  );
26
26
  }
27
27
 
@@ -46,15 +46,14 @@ function populate(pInitOptions) {
46
46
  const lReturnValue = {
47
47
  version: meta.version,
48
48
  date: new Date().toJSON(),
49
- configType: "self-contained",
50
49
  ...pInitOptions,
51
50
  sourceLocation: toSourceLocationArray(
52
- pInitOptions.sourceLocation || getSourceFolderCandidates()
51
+ pInitOptions.sourceLocation || getSourceFolderCandidates(),
53
52
  ),
54
53
  testLocation: pInitOptions.isMonoRepo
55
54
  ? []
56
55
  : toSourceLocationArray(
57
- pInitOptions.testLocation || getTestFolderCandidates()
56
+ pInitOptions.testLocation || getTestFolderCandidates(),
58
57
  ),
59
58
  };
60
59
  const lExtensions = getExtensions(lReturnValue);
@@ -73,16 +72,12 @@ function populate(pInitOptions) {
73
72
  */
74
73
  export default function normalizeInitOptions(pInitOptions) {
75
74
  let lReturnValue = populate(pInitOptions);
76
-
77
- if (lReturnValue.configType === "preset" && !lReturnValue.preset) {
78
- lReturnValue.preset = "dependency-cruiser/configs/recommended-warn-only";
79
- }
80
75
  if (!has(lReturnValue, "hasTestsOutsideSource")) {
81
76
  lReturnValue.hasTestsOutsideSource =
82
77
  !pInitOptions.isMonoRepo &&
83
78
  !hasTestsWithinSource(
84
79
  lReturnValue.testLocation,
85
- lReturnValue.sourceLocation
80
+ lReturnValue.sourceLocation,
86
81
  );
87
82
  }
88
83
  return lReturnValue;
@@ -1,6 +1,4 @@
1
- export type OneShotConfigIDType = "preset" | "yes" | "experimental-scripts";
2
-
3
- export type ConfigTypeType = "preset" | "self-contained";
1
+ export type OneShotConfigIDType = "yes" | "experimental-scripts";
4
2
 
5
3
  export interface IInitConfig {
6
4
  /**
@@ -92,15 +90,6 @@ export interface IInitConfig {
92
90
  * (Formatted) date this config is created
93
91
  */
94
92
  date: string;
95
- /**
96
- * Whether to use one of the presets (`preset`) or be self contained
97
- * (`self-contained`)
98
- */
99
- configType: ConfigTypeType;
100
- /**
101
- * For configType === "preset", the name of the preset
102
- */
103
- preset?: string;
104
93
  }
105
94
 
106
95
  export type IPartialInitConfig = Partial<IInitConfig>;
@@ -1,3 +1,12 @@
1
+ // @ts-check
2
+ /**
3
+ * @param {string[]} pArrayOfStrings
4
+ * @returns string
5
+ */
1
6
  export function folderNameArrayToRE(pArrayOfStrings) {
2
- return `^(${pArrayOfStrings.join("|")})`;
7
+ const lFoldersInARE = pArrayOfStrings
8
+ .map((pName) => pName.replace(/\\/g, "\\\\").replace(/\./g, "\\."))
9
+ .join("|");
10
+
11
+ return `^(${lFoldersInARE})`;
3
12
  }
@@ -66,13 +66,13 @@ export function compileRunScripts(pInitOptions) {
66
66
  const lTestLocations = (pInitOptions.testLocation || []).join(" ");
67
67
 
68
68
  lReturnValue = {
69
- depcruise: `depcruise ${lSourceLocations} ${lTestLocations} --config`,
70
- "depcruise:graph": `depcruise ${lSourceLocations} --include-only '${lSourceLocationRE}' --config --output-type dot | dot -T svg | depcruise-wrap-stream-in-html > dependency-graph.html`,
71
- "depcruise:graph:dev": `depcruise ${lSourceLocations} --include-only '${lSourceLocationRE}' --prefix vscode://file/$(pwd)/ --config --output-type dot | dot -T svg | depcruise-wrap-stream-in-html | browser`,
72
- "depcruise:graph:archi": `depcruise ${lSourceLocations} --include-only '${lSourceLocationRE}' --config --output-type archi | dot -T svg | depcruise-wrap-stream-in-html > high-level-dependency-graph.html`,
73
- "depcruise:html": `depcruise ${lSourceLocations} ${lTestLocations} --progress --config --output-type err-html --output-to dependency-violation-report.html`,
74
- "depcruise:text": `depcruise ${lSourceLocations} ${lTestLocations} --progress --config --output-type text`,
75
- "depcruise:focus": `depcruise ${lSourceLocations} ${lTestLocations} --progress --config --output-type text --focus`,
69
+ depcruise: `depcruise ${lSourceLocations} ${lTestLocations}`,
70
+ "depcruise:graph": `depcruise ${lSourceLocations} --include-only '${lSourceLocationRE}' --output-type dot | dot -T svg | depcruise-wrap-stream-in-html > dependency-graph.html`,
71
+ "depcruise:graph:dev": `depcruise ${lSourceLocations} --include-only '${lSourceLocationRE}' --prefix vscode://file/$(pwd)/ --output-type dot | dot -T svg | depcruise-wrap-stream-in-html | browser`,
72
+ "depcruise:graph:archi": `depcruise ${lSourceLocations} --include-only '${lSourceLocationRE}' --output-type archi | dot -T svg | depcruise-wrap-stream-in-html > high-level-dependency-graph.html`,
73
+ "depcruise:html": `depcruise ${lSourceLocations} ${lTestLocations} --progress --output-type err-html --output-to dependency-violation-report.html`,
74
+ "depcruise:text": `depcruise ${lSourceLocations} ${lTestLocations} --progress --output-type text`,
75
+ "depcruise:focus": `depcruise ${lSourceLocations} ${lTestLocations} --progress --output-type text --focus`,
76
76
  };
77
77
  }
78
78
 
@@ -118,28 +118,33 @@ export function addRunScriptsToManifest(pManifest, pAdditionalRunScripts) {
118
118
  function getSuccessMessage(pDestinationManifestFileName) {
119
119
  const lExplanationIndent = 6;
120
120
 
121
- return EXPERIMENTAL_SCRIPT_DOC.reduce((pAll, pScript) => {
122
- return `${pAll}${
123
- `\n ${chalk.green(figures.play)} ${pScript.headline}` +
124
- `\n${wrapAndIndent(`${pScript.description}`, lExplanationIndent)}\n\n`
125
- }`;
126
- }, ` ${chalk.green(figures.tick)} Run scripts added to '${pDestinationManifestFileName}':\n`);
121
+ return EXPERIMENTAL_SCRIPT_DOC.reduce(
122
+ (pAll, pScript) => {
123
+ return `${pAll}${
124
+ `\n ${chalk.green(figures.play)} ${pScript.headline}` +
125
+ `\n${wrapAndIndent(`${pScript.description}`, lExplanationIndent)}\n\n`
126
+ }`;
127
+ },
128
+ ` ${chalk.green(
129
+ figures.tick,
130
+ )} Run scripts added to '${pDestinationManifestFileName}':\n`,
131
+ );
127
132
  }
128
133
 
129
134
  export function writeRunScriptsToManifest(
130
135
  pNormalizedInitOptions,
131
136
  pManifest = readManifest(),
132
- pDestinationManifestFileName = PACKAGE_MANIFEST
137
+ pDestinationManifestFileName = PACKAGE_MANIFEST,
133
138
  ) {
134
139
  const lUpdatedManifest = addRunScriptsToManifest(
135
140
  pManifest,
136
- compileRunScripts(pNormalizedInitOptions)
141
+ compileRunScripts(pNormalizedInitOptions),
137
142
  );
138
143
 
139
144
  writeFileSync(
140
145
  pDestinationManifestFileName,
141
146
  JSON.stringify(lUpdatedManifest, null, " "),
142
- "utf8"
147
+ "utf8",
143
148
  );
144
149
 
145
150
  process.stdout.write(getSuccessMessage(pDestinationManifestFileName));
@@ -16,7 +16,7 @@ export function detectPreCompilationNess(pTSDependencies, pJSDependencies) {
16
16
  return pTSDependencies.map((pTSDependency) =>
17
17
  pJSDependencies.some(dependenciesEqual(pTSDependency))
18
18
  ? { ...pTSDependency, preCompilationOnly: false }
19
- : { ...pTSDependency, preCompilationOnly: true }
19
+ : { ...pTSDependency, preCompilationOnly: true },
20
20
  );
21
21
  }
22
22
 
@@ -39,8 +39,8 @@ export function detectPreCompilationNess(pTSDependencies, pJSDependencies) {
39
39
  export function extractModuleAttributes(pString) {
40
40
  let lReturnValue = { module: pString };
41
41
  const lModuleAttributes = pString.match(
42
- // eslint-disable-next-line security/detect-unsafe-regex, unicorn/no-unsafe-regex
43
- /^((node:|file:|data:)(([^,]+),)?)(.+)$/
42
+ // eslint-disable-next-line security/detect-unsafe-regex
43
+ /^((node:|file:|data:)(([^,]+),)?)(.+)$/,
44
44
  );
45
45
  const lProtocolPosition = 2;
46
46
  const lMimeTypePosition = 4;
@@ -19,7 +19,7 @@ function parseAttributes(pString) {
19
19
  lAttributes[pAttribute] = true;
20
20
  } else {
21
21
  lAttributes[pAttribute.slice(0, lEqualsSignIndex)] = "'\"".includes(
22
- pAttribute[lEqualsSignIndex + 1]
22
+ pAttribute[lEqualsSignIndex + 1],
23
23
  )
24
24
  ? pAttribute.slice(lEqualsSignIndex + 2, -1)
25
25
  : pAttribute.slice(lEqualsSignIndex + 1);
@@ -51,7 +51,7 @@ function getSourceReplacer(pTranspiler, pTranspilerOptions) {
51
51
  return `<script${lAttributes}>${pTranspiler(
52
52
  pSource,
53
53
  "dummy-filename",
54
- composeTranspilerOptions(pTranspilerOptions)
54
+ composeTranspilerOptions(pTranspilerOptions),
55
55
  )}</script>`;
56
56
  } else {
57
57
  return pMatch;
@@ -72,13 +72,13 @@ function styleReplacer(pMatch, pAttributes) {
72
72
  export default function preProcess(
73
73
  pSource,
74
74
  pTranspilerWrapper,
75
- pTranspilerOptions
75
+ pTranspilerOptions,
76
76
  ) {
77
77
  // regexes from
78
78
  // github.com/sveltejs/svelte/blob/67dea941bb1e61f0912ebd2257666b899c1ccefa/src/compiler/preprocess/index.ts#L165
79
- // eslint-disable-next-line security/detect-unsafe-regex, unicorn/no-unsafe-regex
79
+ // eslint-disable-next-line security/detect-unsafe-regex
80
80
  const lScriptRegex = /<script(\s[^]*?)?(?:>([^]*?)<\/script>|\/>)/gi;
81
- // eslint-disable-next-line security/detect-unsafe-regex, unicorn/no-unsafe-regex
81
+ // eslint-disable-next-line security/detect-unsafe-regex
82
82
  const lStyleRegex = /<style(\s[^]*?)?(?:>([^]*?)<\/style>|\/>)/gi;
83
83
 
84
84
  if (pTranspilerWrapper.isAvailable) {
@@ -86,7 +86,7 @@ export default function preProcess(
86
86
  pSource
87
87
  .replace(
88
88
  lScriptRegex,
89
- getSourceReplacer(pTranspilerWrapper.transpile, pTranspilerOptions)
89
+ getSourceReplacer(pTranspilerWrapper.transpile, pTranspilerOptions),
90
90
  )
91
91
  // we don't regard styling in our dependency analysis, so we can remove
92
92
  // styles that (our instance of) svelte doesn't have pre-processors
package/src/meta.js CHANGED
@@ -1,7 +1,7 @@
1
1
  /* generated - don't edit */
2
2
 
3
3
  module.exports = {
4
- version: "13.1.1",
4
+ version: "13.1.2",
5
5
  engines: {
6
6
  node: "^16.14||>=18",
7
7
  },
@@ -1,7 +1,7 @@
1
1
  import { anonymizePathElement } from "./anonymize-path-element.mjs";
2
2
 
3
3
  export const WHITELIST_RE =
4
- // eslint-disable-next-line security/detect-unsafe-regex, unicorn/no-unsafe-regex
4
+ // eslint-disable-next-line security/detect-unsafe-regex
5
5
  /^(|[.]+|~|bin|apps?|cli|src|libs?|configs?|components?|fixtures?|helpers?|i18n|index\.(jsx?|[mc]js|d\.ts|tsx?|vue|coffee|ls)|_?_?mocks?_?_?|node_modules|packages?|package\.json|scripts?|services?|sources?|specs?|_?_?tests?_?_?|types?|uti?ls?)$/;
6
6
 
7
7
  /**
@@ -24,12 +24,12 @@ export const WHITELIST_RE =
24
24
  export function anonymizePath(
25
25
  pPath,
26
26
  pWordList = [],
27
- pWhiteListRE = WHITELIST_RE
27
+ pWhiteListRE = WHITELIST_RE,
28
28
  ) {
29
29
  return pPath
30
30
  .split("/")
31
31
  .map((pPathElement) =>
32
- anonymizePathElement(pPathElement, pWordList, pWhiteListRE)
32
+ anonymizePathElement(pPathElement, pWordList, pWhiteListRE),
33
33
  )
34
34
  .join("/");
35
35
  }