@teambit/dependencies 1.0.330 → 1.0.331
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/artifacts/__bit_junit.xml +203 -5
- package/artifacts/schema.json +2016 -1173
- package/dependencies-loader/apply-overrides.ts +3 -3
- package/dependencies-loader/auto-detect-deps.ts +16 -13
- package/dependencies-loader/dependencies-loader.ts +1 -1
- package/dist/dependencies-loader/apply-overrides.js +12 -5
- package/dist/dependencies-loader/apply-overrides.js.map +1 -1
- package/dist/dependencies-loader/auto-detect-deps.d.ts +4 -4
- package/dist/dependencies-loader/auto-detect-deps.js +14 -14
- package/dist/dependencies-loader/auto-detect-deps.js.map +1 -1
- package/dist/dependencies-loader/dependencies-loader.js +4 -4
- package/dist/dependencies-loader/dependencies-loader.js.map +1 -1
- package/dist/files-dependency-builder/build-tree.d.ts +11 -0
- package/dist/files-dependency-builder/build-tree.js +233 -0
- package/dist/files-dependency-builder/build-tree.js.map +1 -0
- package/dist/files-dependency-builder/build-tree.spec.d.ts +1 -0
- package/dist/files-dependency-builder/build-tree.spec.js +154 -0
- package/dist/files-dependency-builder/build-tree.spec.js.map +1 -0
- package/dist/files-dependency-builder/dependency-tree/Config.d.ts +4 -0
- package/dist/files-dependency-builder/dependency-tree/Config.js +74 -0
- package/dist/files-dependency-builder/dependency-tree/Config.js.map +1 -0
- package/dist/files-dependency-builder/dependency-tree/index.d.ts +15 -0
- package/dist/files-dependency-builder/dependency-tree/index.js +272 -0
- package/dist/files-dependency-builder/dependency-tree/index.js.map +1 -0
- package/dist/files-dependency-builder/dependency-tree/index.spec.d.ts +1 -0
- package/dist/files-dependency-builder/dependency-tree/index.spec.js +877 -0
- package/dist/files-dependency-builder/dependency-tree/index.spec.js.map +1 -0
- package/dist/files-dependency-builder/detectives/detective-css/index.d.ts +1 -0
- package/dist/files-dependency-builder/detectives/detective-css/index.js +18 -0
- package/dist/files-dependency-builder/detectives/detective-css/index.js.map +1 -0
- package/dist/files-dependency-builder/detectives/detective-es6/index.d.ts +1 -0
- package/dist/files-dependency-builder/detectives/detective-es6/index.js +18 -0
- package/dist/files-dependency-builder/detectives/detective-es6/index.js.map +1 -0
- package/dist/files-dependency-builder/detectives/detective-less/index.d.ts +1 -0
- package/dist/files-dependency-builder/detectives/detective-less/index.js +18 -0
- package/dist/files-dependency-builder/detectives/detective-less/index.js.map +1 -0
- package/dist/files-dependency-builder/detectives/detective-sass/index.d.ts +1 -0
- package/dist/files-dependency-builder/detectives/detective-sass/index.js +18 -0
- package/dist/files-dependency-builder/detectives/detective-sass/index.js.map +1 -0
- package/dist/files-dependency-builder/detectives/detective-scss/index.d.ts +1 -0
- package/dist/files-dependency-builder/detectives/detective-scss/index.js +18 -0
- package/dist/files-dependency-builder/detectives/detective-scss/index.js.map +1 -0
- package/dist/files-dependency-builder/detectives/detective-typescript/index.d.ts +1 -0
- package/dist/files-dependency-builder/detectives/detective-typescript/index.js +18 -0
- package/dist/files-dependency-builder/detectives/detective-typescript/index.js.map +1 -0
- package/dist/files-dependency-builder/detector-hook.d.ts +47 -0
- package/dist/files-dependency-builder/detector-hook.js +29 -0
- package/dist/files-dependency-builder/detector-hook.js.map +1 -0
- package/dist/files-dependency-builder/filing-cabinet/index.d.ts +17 -0
- package/dist/files-dependency-builder/filing-cabinet/index.js +140 -0
- package/dist/files-dependency-builder/filing-cabinet/index.js.map +1 -0
- package/dist/files-dependency-builder/filing-cabinet/index.spec.d.ts +1 -0
- package/dist/files-dependency-builder/filing-cabinet/index.spec.js +651 -0
- package/dist/files-dependency-builder/filing-cabinet/index.spec.js.map +1 -0
- package/dist/files-dependency-builder/fixtures/build-tree/a.d.ts +1 -0
- package/dist/files-dependency-builder/fixtures/build-tree/a.js +6 -0
- package/dist/files-dependency-builder/fixtures/build-tree/a.js.map +1 -0
- package/dist/files-dependency-builder/fixtures/build-tree/b.d.ts +1 -0
- package/dist/files-dependency-builder/fixtures/build-tree/b.js +6 -0
- package/dist/files-dependency-builder/fixtures/build-tree/b.js.map +1 -0
- package/dist/files-dependency-builder/fixtures/build-tree/not-link-file/file-a.d.ts +1 -0
- package/dist/files-dependency-builder/fixtures/build-tree/not-link-file/file-a.js +3 -0
- package/dist/files-dependency-builder/fixtures/build-tree/not-link-file/file-a.js.map +1 -0
- package/dist/files-dependency-builder/fixtures/build-tree/not-link-file/file-b.d.ts +1 -0
- package/dist/files-dependency-builder/fixtures/build-tree/not-link-file/file-b.js +3 -0
- package/dist/files-dependency-builder/fixtures/build-tree/not-link-file/file-b.js.map +1 -0
- package/dist/files-dependency-builder/fixtures/build-tree/not-link-file/file-c.d.ts +1 -0
- package/dist/files-dependency-builder/fixtures/build-tree/not-link-file/file-c.js +10 -0
- package/dist/files-dependency-builder/fixtures/build-tree/not-link-file/file-c.js.map +1 -0
- package/dist/files-dependency-builder/fixtures/build-tree/tree-shaking-cycle/foo.d.ts +1 -0
- package/dist/files-dependency-builder/fixtures/build-tree/tree-shaking-cycle/foo.js +3 -0
- package/dist/files-dependency-builder/fixtures/build-tree/tree-shaking-cycle/foo.js.map +1 -0
- package/dist/files-dependency-builder/fixtures/build-tree/tree-shaking-cycle/index.d.ts +1 -0
- package/dist/files-dependency-builder/fixtures/build-tree/tree-shaking-cycle/index.js +21 -0
- package/dist/files-dependency-builder/fixtures/build-tree/tree-shaking-cycle/index.js.map +1 -0
- package/dist/files-dependency-builder/fixtures/build-tree/tree-shaking-cycle/is-string.d.ts +2 -0
- package/dist/files-dependency-builder/fixtures/build-tree/tree-shaking-cycle/is-string.js +18 -0
- package/dist/files-dependency-builder/fixtures/build-tree/tree-shaking-cycle/is-string.js.map +1 -0
- package/dist/files-dependency-builder/fixtures/build-tree/tree-shaking-cycle/self-cycle.d.ts +2 -0
- package/dist/files-dependency-builder/fixtures/build-tree/tree-shaking-cycle/self-cycle.js +20 -0
- package/dist/files-dependency-builder/fixtures/build-tree/tree-shaking-cycle/self-cycle.js.map +1 -0
- package/dist/files-dependency-builder/fixtures/build-tree/unparsed.d.ts +0 -0
- package/dist/files-dependency-builder/fixtures/build-tree/unparsed.js +5 -0
- package/dist/files-dependency-builder/fixtures/build-tree/unparsed.js.map +1 -0
- package/dist/files-dependency-builder/fixtures/dependency-tree/amd/a.d.ts +0 -0
- package/dist/files-dependency-builder/fixtures/dependency-tree/amd/a.js +10 -0
- package/dist/files-dependency-builder/fixtures/dependency-tree/amd/a.js.map +1 -0
- package/dist/files-dependency-builder/fixtures/dependency-tree/amd/b.d.ts +0 -0
- package/dist/files-dependency-builder/fixtures/dependency-tree/amd/b.js +10 -0
- package/dist/files-dependency-builder/fixtures/dependency-tree/amd/b.js.map +1 -0
- package/dist/files-dependency-builder/fixtures/dependency-tree/amd/c.d.ts +0 -0
- package/dist/files-dependency-builder/fixtures/dependency-tree/amd/c.js +6 -0
- package/dist/files-dependency-builder/fixtures/dependency-tree/amd/c.js.map +1 -0
- package/dist/files-dependency-builder/fixtures/dependency-tree/commonjs/a.d.ts +1 -0
- package/dist/files-dependency-builder/fixtures/dependency-tree/commonjs/a.js +6 -0
- package/dist/files-dependency-builder/fixtures/dependency-tree/commonjs/a.js.map +1 -0
- package/dist/files-dependency-builder/fixtures/dependency-tree/commonjs/b.d.ts +1 -0
- package/dist/files-dependency-builder/fixtures/dependency-tree/commonjs/b.js +6 -0
- package/dist/files-dependency-builder/fixtures/dependency-tree/commonjs/b.js.map +1 -0
- package/dist/files-dependency-builder/fixtures/dependency-tree/commonjs/c.d.ts +1 -0
- package/dist/files-dependency-builder/fixtures/dependency-tree/commonjs/c.js +6 -0
- package/dist/files-dependency-builder/fixtures/dependency-tree/commonjs/c.js.map +1 -0
- package/dist/files-dependency-builder/fixtures/dependency-tree/onlyRealDeps/a.d.ts +1 -0
- package/dist/files-dependency-builder/fixtures/dependency-tree/onlyRealDeps/a.js +8 -0
- package/dist/files-dependency-builder/fixtures/dependency-tree/onlyRealDeps/a.js.map +1 -0
- package/dist/files-dependency-builder/fixtures/dependency-tree/webpack/aliased.d.ts +1 -0
- package/dist/files-dependency-builder/fixtures/dependency-tree/webpack/aliased.js +6 -0
- package/dist/files-dependency-builder/fixtures/dependency-tree/webpack/aliased.js.map +1 -0
- package/dist/files-dependency-builder/fixtures/dependency-tree/webpack/unaliased.d.ts +1 -0
- package/dist/files-dependency-builder/fixtures/dependency-tree/webpack/unaliased.js +6 -0
- package/dist/files-dependency-builder/fixtures/dependency-tree/webpack/unaliased.js.map +1 -0
- package/dist/files-dependency-builder/fixtures/filing-cabinet/ast.d.ts +221 -0
- package/dist/files-dependency-builder/fixtures/filing-cabinet/ast.js +259 -0
- package/dist/files-dependency-builder/fixtures/filing-cabinet/ast.js.map +1 -0
- package/dist/files-dependency-builder/fixtures/filing-cabinet/foo.d.ts +2 -0
- package/dist/files-dependency-builder/fixtures/filing-cabinet/foo.js +12 -0
- package/dist/files-dependency-builder/fixtures/filing-cabinet/foo.js.map +1 -0
- package/dist/files-dependency-builder/fixtures/filing-cabinet/foo.scss +1 -0
- package/dist/files-dependency-builder/fixtures/filing-cabinet/foo2.scss +0 -0
- package/dist/files-dependency-builder/fixtures/filing-cabinet/mockedJSFiles.d.ts +59 -0
- package/dist/files-dependency-builder/fixtures/filing-cabinet/mockedJSFiles.js +65 -0
- package/dist/files-dependency-builder/fixtures/filing-cabinet/mockedJSFiles.js.map +1 -0
- package/dist/files-dependency-builder/fixtures/filing-cabinet/root1/mod1.d.ts +1 -0
- package/dist/files-dependency-builder/fixtures/filing-cabinet/root1/mod1.js +5 -0
- package/dist/files-dependency-builder/fixtures/filing-cabinet/root1/mod1.js.map +1 -0
- package/dist/files-dependency-builder/fixtures/filing-cabinet/root2/mod2.d.ts +1 -0
- package/dist/files-dependency-builder/fixtures/filing-cabinet/root2/mod2.js +5 -0
- package/dist/files-dependency-builder/fixtures/filing-cabinet/root2/mod2.js.map +1 -0
- package/dist/files-dependency-builder/fixtures/filing-cabinet/webpack.config.d.ts +6 -0
- package/dist/files-dependency-builder/fixtures/filing-cabinet/webpack.config.js +12 -0
- package/dist/files-dependency-builder/fixtures/filing-cabinet/webpack.config.js.map +1 -0
- package/dist/files-dependency-builder/fixtures/missing-deps.d.ts +0 -0
- package/dist/files-dependency-builder/fixtures/missing-deps.js +5 -0
- package/dist/files-dependency-builder/fixtures/missing-deps.js.map +1 -0
- package/dist/files-dependency-builder/fixtures/precinct/Gruntfile.d.ts +2 -0
- package/dist/files-dependency-builder/fixtures/precinct/Gruntfile.js +24 -0
- package/dist/files-dependency-builder/fixtures/precinct/Gruntfile.js.map +1 -0
- package/dist/files-dependency-builder/fixtures/precinct/amd.d.ts +0 -0
- package/dist/files-dependency-builder/fixtures/precinct/amd.js +6 -0
- package/dist/files-dependency-builder/fixtures/precinct/amd.js.map +1 -0
- package/dist/files-dependency-builder/fixtures/precinct/bar.foo +1 -0
- package/dist/files-dependency-builder/fixtures/precinct/cjsExportLazy.d.ts +6 -0
- package/dist/files-dependency-builder/fixtures/precinct/cjsExportLazy.js +11 -0
- package/dist/files-dependency-builder/fixtures/precinct/cjsExportLazy.js.map +1 -0
- package/dist/files-dependency-builder/fixtures/precinct/commonjs.d.ts +1 -0
- package/dist/files-dependency-builder/fixtures/precinct/commonjs.js +7 -0
- package/dist/files-dependency-builder/fixtures/precinct/commonjs.js.map +1 -0
- package/dist/files-dependency-builder/fixtures/precinct/coreModules.d.ts +1 -0
- package/dist/files-dependency-builder/fixtures/precinct/coreModules.js +9 -0
- package/dist/files-dependency-builder/fixtures/precinct/coreModules.js.map +1 -0
- package/dist/files-dependency-builder/fixtures/precinct/es6.d.ts +1 -0
- package/dist/files-dependency-builder/fixtures/precinct/es6.js +15 -0
- package/dist/files-dependency-builder/fixtures/precinct/es6.js.map +1 -0
- package/dist/files-dependency-builder/fixtures/precinct/es6MixedExportLazy.d.ts +5 -0
- package/dist/files-dependency-builder/fixtures/precinct/es6MixedExportLazy.js +15 -0
- package/dist/files-dependency-builder/fixtures/precinct/es6MixedExportLazy.js.map +1 -0
- package/dist/files-dependency-builder/fixtures/precinct/es7.d.ts +1 -0
- package/dist/files-dependency-builder/fixtures/precinct/es7.js +7 -0
- package/dist/files-dependency-builder/fixtures/precinct/es7.js.map +1 -0
- package/dist/files-dependency-builder/fixtures/precinct/exampleAST.d.ts +24 -0
- package/dist/files-dependency-builder/fixtures/precinct/exampleAST.js +30 -0
- package/dist/files-dependency-builder/fixtures/precinct/exampleAST.js.map +1 -0
- package/dist/files-dependency-builder/fixtures/precinct/foo.foo +1 -0
- package/dist/files-dependency-builder/fixtures/precinct/styles.css +6 -0
- package/dist/files-dependency-builder/fixtures/precinct/styles.less +4 -0
- package/dist/files-dependency-builder/fixtures/precinct/styles.sass +2 -0
- package/dist/files-dependency-builder/fixtures/precinct/styles.scss +3 -0
- package/dist/files-dependency-builder/fixtures/precinct/styles.styl +5 -0
- package/dist/files-dependency-builder/fixtures/precinct/typescript.d.ts +0 -0
- package/dist/files-dependency-builder/fixtures/precinct/typescript.js +11 -0
- package/dist/files-dependency-builder/fixtures/precinct/typescript.js.map +1 -0
- package/dist/files-dependency-builder/fixtures/precinct/unparseable.d.ts +0 -0
- package/dist/files-dependency-builder/fixtures/precinct/unparseable.js +9 -0
- package/dist/files-dependency-builder/fixtures/precinct/unparseable.js.map +1 -0
- package/dist/files-dependency-builder/fixtures/unsupported-file.pdf +0 -0
- package/dist/files-dependency-builder/generate-tree-madge.d.ts +31 -0
- package/dist/files-dependency-builder/generate-tree-madge.js +196 -0
- package/dist/files-dependency-builder/generate-tree-madge.js.map +1 -0
- package/dist/files-dependency-builder/index.d.ts +3 -0
- package/dist/files-dependency-builder/index.js +34 -0
- package/dist/files-dependency-builder/index.js.map +1 -0
- package/dist/files-dependency-builder/missing-handler.d.ts +34 -0
- package/dist/files-dependency-builder/missing-handler.js +107 -0
- package/dist/files-dependency-builder/missing-handler.js.map +1 -0
- package/dist/files-dependency-builder/path-map.d.ts +20 -0
- package/dist/files-dependency-builder/path-map.js +46 -0
- package/dist/files-dependency-builder/path-map.js.map +1 -0
- package/dist/files-dependency-builder/precinct/index.d.ts +22 -0
- package/dist/files-dependency-builder/precinct/index.js +306 -0
- package/dist/files-dependency-builder/precinct/index.js.map +1 -0
- package/dist/files-dependency-builder/precinct/index.spec.d.ts +1 -0
- package/dist/files-dependency-builder/precinct/index.spec.js +300 -0
- package/dist/files-dependency-builder/precinct/index.spec.js.map +1 -0
- package/dist/files-dependency-builder/types/dependency-tree-type.d.ts +35 -0
- package/dist/files-dependency-builder/types/dependency-tree-type.js +34 -0
- package/dist/files-dependency-builder/types/dependency-tree-type.js.map +1 -0
- package/dist/files-dependency-builder/types/index.d.ts +0 -0
- package/dist/files-dependency-builder/types/index.js +7 -0
- package/dist/files-dependency-builder/types/index.js.map +1 -0
- package/dist/index.d.ts +1 -0
- package/dist/index.js +25 -0
- package/dist/index.js.map +1 -1
- package/dist/resolve-pkg-data.d.ts +23 -0
- package/dist/resolve-pkg-data.js +157 -0
- package/dist/resolve-pkg-data.js.map +1 -0
- package/files-dependency-builder/build-tree.spec.ts +130 -0
- package/files-dependency-builder/build-tree.ts +185 -0
- package/files-dependency-builder/dependency-tree/Config.ts +68 -0
- package/files-dependency-builder/dependency-tree/index.spec.ts +893 -0
- package/files-dependency-builder/dependency-tree/index.ts +244 -0
- package/files-dependency-builder/detectives/detective-css/index.ts +1 -0
- package/files-dependency-builder/detectives/detective-es6/index.ts +1 -0
- package/files-dependency-builder/detectives/detective-less/index.ts +1 -0
- package/files-dependency-builder/detectives/detective-sass/index.ts +1 -0
- package/files-dependency-builder/detectives/detective-scss/index.ts +1 -0
- package/files-dependency-builder/detectives/detective-typescript/index.ts +1 -0
- package/files-dependency-builder/detector-hook.ts +69 -0
- package/files-dependency-builder/filing-cabinet/index.spec.ts +718 -0
- package/files-dependency-builder/filing-cabinet/index.ts +119 -0
- package/files-dependency-builder/fixtures/build-tree/a.js +2 -0
- package/files-dependency-builder/fixtures/build-tree/b.js +2 -0
- package/files-dependency-builder/fixtures/build-tree/not-link-file/file-a.js +2 -0
- package/files-dependency-builder/fixtures/build-tree/not-link-file/file-b.js +4 -0
- package/files-dependency-builder/fixtures/build-tree/not-link-file/file-c.js +3 -0
- package/files-dependency-builder/fixtures/build-tree/tree-shaking-cycle/foo.js +2 -0
- package/files-dependency-builder/fixtures/build-tree/tree-shaking-cycle/index.js +2 -0
- package/files-dependency-builder/fixtures/build-tree/tree-shaking-cycle/is-string.js +3 -0
- package/files-dependency-builder/fixtures/build-tree/tree-shaking-cycle/self-cycle.js +3 -0
- package/files-dependency-builder/fixtures/build-tree/unparsed.js +2 -0
- package/files-dependency-builder/fixtures/dependency-tree/amd/a.js +6 -0
- package/files-dependency-builder/fixtures/dependency-tree/amd/b.js +6 -0
- package/files-dependency-builder/fixtures/dependency-tree/amd/c.js +2 -0
- package/files-dependency-builder/fixtures/dependency-tree/commonjs/a.js +2 -0
- package/files-dependency-builder/fixtures/dependency-tree/commonjs/b.js +3 -0
- package/files-dependency-builder/fixtures/dependency-tree/commonjs/c.js +3 -0
- package/files-dependency-builder/fixtures/dependency-tree/onlyRealDeps/a.js +4 -0
- package/files-dependency-builder/fixtures/dependency-tree/webpack/aliased.js +2 -0
- package/files-dependency-builder/fixtures/dependency-tree/webpack/unaliased.js +2 -0
- package/files-dependency-builder/fixtures/filing-cabinet/ast.js +266 -0
- package/files-dependency-builder/fixtures/filing-cabinet/foo.jsx +3 -0
- package/files-dependency-builder/fixtures/filing-cabinet/foo.scss +1 -0
- package/files-dependency-builder/fixtures/filing-cabinet/foo2.scss +0 -0
- package/files-dependency-builder/fixtures/filing-cabinet/mockedJSFiles.js +61 -0
- package/files-dependency-builder/fixtures/filing-cabinet/root1/mod1.js +1 -0
- package/files-dependency-builder/fixtures/filing-cabinet/root2/mod2.js +1 -0
- package/files-dependency-builder/fixtures/filing-cabinet/webpack.config.js +8 -0
- package/files-dependency-builder/fixtures/missing-deps.js +2 -0
- package/files-dependency-builder/fixtures/precinct/Gruntfile.js +22 -0
- package/files-dependency-builder/fixtures/precinct/amd.js +2 -0
- package/files-dependency-builder/fixtures/precinct/bar.foo +1 -0
- package/files-dependency-builder/fixtures/precinct/cjsExportLazy.js +7 -0
- package/files-dependency-builder/fixtures/precinct/commonjs.js +3 -0
- package/files-dependency-builder/fixtures/precinct/coreModules.js +5 -0
- package/files-dependency-builder/fixtures/precinct/es6.js +4 -0
- package/files-dependency-builder/fixtures/precinct/es6MixedExportLazy.js +7 -0
- package/files-dependency-builder/fixtures/precinct/es7.js +3 -0
- package/files-dependency-builder/fixtures/precinct/exampleAST.js +32 -0
- package/files-dependency-builder/fixtures/precinct/foo.foo +1 -0
- package/files-dependency-builder/fixtures/precinct/styles.css +6 -0
- package/files-dependency-builder/fixtures/precinct/styles.less +4 -0
- package/files-dependency-builder/fixtures/precinct/styles.sass +2 -0
- package/files-dependency-builder/fixtures/precinct/styles.scss +3 -0
- package/files-dependency-builder/fixtures/precinct/styles.styl +5 -0
- package/files-dependency-builder/fixtures/precinct/typescript.ts +8 -0
- package/files-dependency-builder/fixtures/precinct/unparseable.js +6 -0
- package/files-dependency-builder/fixtures/unsupported-file.pdf +0 -0
- package/files-dependency-builder/generate-tree-madge.ts +200 -0
- package/files-dependency-builder/index.ts +5 -0
- package/files-dependency-builder/missing-handler.ts +76 -0
- package/files-dependency-builder/path-map.ts +38 -0
- package/files-dependency-builder/precinct/index.spec.ts +342 -0
- package/files-dependency-builder/precinct/index.ts +250 -0
- package/files-dependency-builder/types/dependency-tree-type.ts +46 -0
- package/files-dependency-builder/types/index.ts +3 -0
- package/package.json +37 -13
- /package/dist/{preview-1720513025675.js → preview-1720667996237.js} +0 -0
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["module","exports","entry","resolve","alias","R"],"sources":["webpack.config.js"],"sourcesContent":["module.exports = {\n entry: './index.js',\n resolve: {\n alias: {\n R: './node_modules/resolve'\n }\n }\n};\n"],"mappings":";;AAAAA,MAAM,CAACC,OAAO,GAAG;EACfC,KAAK,EAAE,YAAY;EACnBC,OAAO,EAAE;IACPC,KAAK,EAAE;MACLC,CAAC,EAAE;IACL;EACF;AACF,CAAC","ignoreList":[]}
|
|
File without changes
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":[],"sources":["missing-deps.js"],"sourcesContent":["// const a = require('non-exist-package'); // missing package\n// const b = require('../non-exist-dep'); // missing dependency\n"],"mappings":"AAAA;AACA;AAAA","ignoreList":[]}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
// @bit-no-check
|
|
4
|
+
module.exports = function (grunt) {
|
|
5
|
+
grunt.initConfig({
|
|
6
|
+
jshint: {
|
|
7
|
+
files: ['Gruntfile.js', 'src/**/*.js', 'test/**/*.js'],
|
|
8
|
+
options: {
|
|
9
|
+
globals: {
|
|
10
|
+
jQuery: true
|
|
11
|
+
}
|
|
12
|
+
}
|
|
13
|
+
},
|
|
14
|
+
watch: {
|
|
15
|
+
files: ['<%= jshint.files %>'],
|
|
16
|
+
tasks: ['jshint']
|
|
17
|
+
}
|
|
18
|
+
});
|
|
19
|
+
grunt.loadNpmTasks('grunt-contrib-jshint');
|
|
20
|
+
grunt.loadNpmTasks('grunt-contrib-watch');
|
|
21
|
+
grunt.registerTask('default', ['jshint']);
|
|
22
|
+
};
|
|
23
|
+
|
|
24
|
+
//# sourceMappingURL=Gruntfile.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["module","exports","grunt","initConfig","jshint","files","options","globals","jQuery","watch","tasks","loadNpmTasks","registerTask"],"sources":["Gruntfile.js"],"sourcesContent":["// @bit-no-check\nmodule.exports = function(grunt) {\n grunt.initConfig({\n jshint: {\n files: ['Gruntfile.js', 'src/**/*.js', 'test/**/*.js'],\n options: {\n globals: {\n jQuery: true\n }\n }\n },\n watch: {\n files: ['<%= jshint.files %>'],\n tasks: ['jshint']\n }\n });\n\n grunt.loadNpmTasks('grunt-contrib-jshint');\n grunt.loadNpmTasks('grunt-contrib-watch');\n\n grunt.registerTask('default', ['jshint']);\n};\n"],"mappings":";;AAAA;AACAA,MAAM,CAACC,OAAO,GAAG,UAASC,KAAK,EAAE;EAC/BA,KAAK,CAACC,UAAU,CAAC;IACfC,MAAM,EAAE;MACNC,KAAK,EAAE,CAAC,cAAc,EAAE,aAAa,EAAE,cAAc,CAAC;MACtDC,OAAO,EAAE;QACPC,OAAO,EAAE;UACPC,MAAM,EAAE;QACV;MACF;IACF,CAAC;IACDC,KAAK,EAAE;MACLJ,KAAK,EAAE,CAAC,qBAAqB,CAAC;MAC9BK,KAAK,EAAE,CAAC,QAAQ;IAClB;EACF,CAAC,CAAC;EAEFR,KAAK,CAACS,YAAY,CAAC,sBAAsB,CAAC;EAC1CT,KAAK,CAACS,YAAY,CAAC,qBAAqB,CAAC;EAEzCT,KAAK,CAACU,YAAY,CAAC,SAAS,EAAE,CAAC,QAAQ,CAAC,CAAC;AAC3C,CAAC","ignoreList":[]}
|
|
File without changes
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["define","a","b"],"sources":["amd.js"],"sourcesContent":["// @bit-no-check\ndefine(['./a', './b'], function(a, b) {});\n"],"mappings":";;AAAA;AACAA,MAAM,CAAC,CAAC,KAAK,EAAE,KAAK,CAAC,EAAE,UAASC,CAAC,EAAEC,CAAC,EAAE,CAAC,CAAC,CAAC","ignoreList":[]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
keywords: foo foo foo
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["module","exports","amd","require","es6","foo","es7"],"sources":["cjsExportLazy.js"],"sourcesContent":["// @bit-no-check\nmodule.exports = function({\n // Just requiring any files that exist\n amd = require('./amd'),\n es6 = require('./es6').foo,\n es7 = require('./es7')\n}) {};\n"],"mappings":";;AAAA;AACAA,MAAM,CAACC,OAAO,GAAG,UAAS;EACxB;EACAC,GAAG,GAAGC,OAAO,CAAC,OAAO,CAAC;EACtBC,GAAG,GAAGD,OAAO,CAAC,OAAO,CAAC,CAACE,GAAG;EAC1BC,GAAG,GAAGH,OAAO,CAAC,OAAO;AACvB,CAAC,EAAE,CAAC,CAAC","ignoreList":[]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["a","require","b"],"sources":["commonjs.js"],"sourcesContent":["// @bit-no-check\nvar a = require('./a'),\n b = require('./b');\n"],"mappings":";;AAAA;AACA,IAAIA,CAAC,GAAGC,OAAO,CAAC,KAAK,CAAC;EACpBC,CAAC,GAAGD,OAAO,CAAC,KAAK,CAAC","ignoreList":[]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["assert","require","path","fs","nodeFs"],"sources":["coreModules.js"],"sourcesContent":["// @bit-no-check\nvar assert = require('assert');\nvar path = require('path');\nvar fs = require('fs');\nvar nodeFs = require('node:fs');\n"],"mappings":";;AAAA;AACA,IAAIA,MAAM,GAAGC,OAAO,CAAC,QAAQ,CAAC;AAC9B,IAAIC,IAAI,GAAGD,OAAO,CAAC,MAAM,CAAC;AAC1B,IAAIE,EAAE,GAAGF,OAAO,CAAC,IAAI,CAAC;AACtB,IAAIG,MAAM,GAAGH,OAAO,CAAC,SAAS,CAAC","ignoreList":[]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
function _lib() {
|
|
4
|
+
const data = require("lib");
|
|
5
|
+
_lib = function () {
|
|
6
|
+
return data;
|
|
7
|
+
};
|
|
8
|
+
return data;
|
|
9
|
+
}
|
|
10
|
+
// @bit-no-check
|
|
11
|
+
|
|
12
|
+
console.log((0, _lib().square)(11)); // 121
|
|
13
|
+
console.log((0, _lib().diag)(4, 3)); // 5
|
|
14
|
+
|
|
15
|
+
//# sourceMappingURL=es6.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["_lib","data","require","console","log","square","diag"],"sources":["es6.js"],"sourcesContent":["// @bit-no-check\nimport { square, diag } from 'lib';\nconsole.log(square(11)); // 121\nconsole.log(diag(4, 3)); // 5\n"],"mappings":";;AACA,SAAAA,KAAA;EAAA,MAAAC,IAAA,GAAAC,OAAA;EAAAF,IAAA,YAAAA,CAAA;IAAA,OAAAC,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AADA;;AAEAE,OAAO,CAACC,GAAG,CAAC,IAAAC,aAAM,EAAC,EAAE,CAAC,CAAC,CAAC,CAAC;AACzBF,OAAO,CAACC,GAAG,CAAC,IAAAE,WAAI,EAAC,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC,CAAC","ignoreList":[]}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.default = _default;
|
|
7
|
+
// @bit-no-check
|
|
8
|
+
function _default({
|
|
9
|
+
// Just requiring any files that exist
|
|
10
|
+
amd = require('./amd'),
|
|
11
|
+
es6 = require('./es6'),
|
|
12
|
+
es7 = require('./es7')
|
|
13
|
+
}) {}
|
|
14
|
+
|
|
15
|
+
//# sourceMappingURL=es6MixedExportLazy.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["_default","amd","require","es6","es7"],"sources":["es6MixedExportLazy.js"],"sourcesContent":["// @bit-no-check\nexport default function({\n // Just requiring any files that exist\n amd = require('./amd'),\n es6 = require('./es6'),\n es7 = require('./es7')\n}) {}\n"],"mappings":";;;;;;AAAA;AACe,SAAAA,SAAS;EACtB;EACAC,GAAG,GAAGC,OAAO,CAAC,OAAO,CAAC;EACtBC,GAAG,GAAGD,OAAO,CAAC,OAAO,CAAC;EACtBE,GAAG,GAAGF,OAAO,CAAC,OAAO;AACvB,CAAC,EAAE,CAAC","ignoreList":[]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["foo"],"sources":["es7.js"],"sourcesContent":["// @bit-no-check\nimport { square, diag } from 'lib';\nasync function foo() {}\n"],"mappings":";;AAAA;;AAEA,eAAeA,GAAGA,CAAA,EAAG,CAAC","ignoreList":[]}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
export let type: string;
|
|
2
|
+
export let body: {
|
|
3
|
+
type: string;
|
|
4
|
+
declarations: {
|
|
5
|
+
type: string;
|
|
6
|
+
id: {
|
|
7
|
+
type: string;
|
|
8
|
+
name: string;
|
|
9
|
+
};
|
|
10
|
+
init: {
|
|
11
|
+
type: string;
|
|
12
|
+
callee: {
|
|
13
|
+
type: string;
|
|
14
|
+
name: string;
|
|
15
|
+
};
|
|
16
|
+
arguments: {
|
|
17
|
+
type: string;
|
|
18
|
+
value: string;
|
|
19
|
+
raw: string;
|
|
20
|
+
}[];
|
|
21
|
+
};
|
|
22
|
+
}[];
|
|
23
|
+
kind: string;
|
|
24
|
+
}[];
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
module.exports = {
|
|
4
|
+
type: 'Program',
|
|
5
|
+
body: [{
|
|
6
|
+
type: 'VariableDeclaration',
|
|
7
|
+
declarations: [{
|
|
8
|
+
type: 'VariableDeclarator',
|
|
9
|
+
id: {
|
|
10
|
+
type: 'Identifier',
|
|
11
|
+
name: 'a'
|
|
12
|
+
},
|
|
13
|
+
init: {
|
|
14
|
+
type: 'CallExpression',
|
|
15
|
+
callee: {
|
|
16
|
+
type: 'Identifier',
|
|
17
|
+
name: 'require'
|
|
18
|
+
},
|
|
19
|
+
arguments: [{
|
|
20
|
+
type: 'Literal',
|
|
21
|
+
value: './a',
|
|
22
|
+
raw: './a'
|
|
23
|
+
}]
|
|
24
|
+
}
|
|
25
|
+
}],
|
|
26
|
+
kind: 'var'
|
|
27
|
+
}]
|
|
28
|
+
};
|
|
29
|
+
|
|
30
|
+
//# sourceMappingURL=exampleAST.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["module","exports","type","body","declarations","id","name","init","callee","arguments","value","raw","kind"],"sources":["exampleAST.js"],"sourcesContent":["module.exports = {\n type: 'Program',\n body: [\n {\n type: 'VariableDeclaration',\n declarations: [\n {\n type: 'VariableDeclarator',\n id: {\n type: 'Identifier',\n name: 'a'\n },\n init: {\n type: 'CallExpression',\n callee: {\n type: 'Identifier',\n name: 'require'\n },\n arguments: [\n {\n type: 'Literal',\n value: './a',\n raw: './a'\n }\n ]\n }\n }\n ],\n kind: 'var'\n }\n ]\n};\n"],"mappings":";;AAAAA,MAAM,CAACC,OAAO,GAAG;EACfC,IAAI,EAAE,SAAS;EACfC,IAAI,EAAE,CACJ;IACED,IAAI,EAAE,qBAAqB;IAC3BE,YAAY,EAAE,CACZ;MACEF,IAAI,EAAE,oBAAoB;MAC1BG,EAAE,EAAE;QACFH,IAAI,EAAE,YAAY;QAClBI,IAAI,EAAE;MACR,CAAC;MACDC,IAAI,EAAE;QACJL,IAAI,EAAE,gBAAgB;QACtBM,MAAM,EAAE;UACNN,IAAI,EAAE,YAAY;UAClBI,IAAI,EAAE;QACR,CAAC;QACDG,SAAS,EAAE,CACT;UACEP,IAAI,EAAE,SAAS;UACfQ,KAAK,EAAE,KAAK;UACZC,GAAG,EAAE;QACP,CAAC;MAEL;IACF,CAAC,CACF;IACDC,IAAI,EAAE;EACR,CAAC;AAEL,CAAC","ignoreList":[]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
There is no keywords matched.
|
|
File without changes
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
// import * as fs from 'fs';
|
|
2
|
+
// import { square, diag } from 'lib';
|
|
3
|
+
// import foo from './bar';
|
|
4
|
+
// import './my-module.js'; // Import a module for side-effects only
|
|
5
|
+
// import zip = require('./ZipCodeValidator'); // needed when importing a module using `export =` syntax
|
|
6
|
+
|
|
7
|
+
// console.log(square(11)); // 121
|
|
8
|
+
// console.log(diag(4, 3)); // 5
|
|
9
|
+
"use strict";
|
|
10
|
+
|
|
11
|
+
//# sourceMappingURL=typescript.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":[],"sources":["typescript.ts"],"sourcesContent":["// import * as fs from 'fs';\n// import { square, diag } from 'lib';\n// import foo from './bar';\n// import './my-module.js'; // Import a module for side-effects only\n// import zip = require('./ZipCodeValidator'); // needed when importing a module using `export =` syntax\n\n// console.log(square(11)); // 121\n// console.log(diag(4, 3)); // 5\n"],"mappings":"AAAA;AACA;AACA;AACA;AACA;;AAEA;AACA;AAAA","ignoreList":[]}
|
|
File without changes
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":[],"sources":["unparseable.js"],"sourcesContent":["// // @bit-no-check\n// {\n// \t\"very invalid\": \"javascript\",\n// \t\"this\", \"is actually json\",\n// \t\"But\" not even valid json.\n// }\n"],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AAAA","ignoreList":[]}
|
|
File without changes
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import { PathLinuxRelative } from '@teambit/toolbox.path.path';
|
|
2
|
+
/**
|
|
3
|
+
* Process absolute path and return a shorter one.
|
|
4
|
+
* @param {String} absPath
|
|
5
|
+
* @param {Object} cache
|
|
6
|
+
* @param {String} baseDir
|
|
7
|
+
* @return {String}
|
|
8
|
+
*/
|
|
9
|
+
export declare function processPath(absPath: any, cache: any, baseDir: any): any;
|
|
10
|
+
export type MadgeTree = {
|
|
11
|
+
[relativePath: string]: PathLinuxRelative[];
|
|
12
|
+
};
|
|
13
|
+
export type Missing = {
|
|
14
|
+
[absolutePath: string]: string[];
|
|
15
|
+
};
|
|
16
|
+
type GenerateTreeResults = {
|
|
17
|
+
madgeTree: MadgeTree;
|
|
18
|
+
skipped: Missing;
|
|
19
|
+
pathMap: any;
|
|
20
|
+
errors: {
|
|
21
|
+
[filePath: string]: Error;
|
|
22
|
+
};
|
|
23
|
+
};
|
|
24
|
+
/**
|
|
25
|
+
* Generate the tree from the given files
|
|
26
|
+
* @param {Array} files
|
|
27
|
+
* @param config
|
|
28
|
+
* @return {Object}
|
|
29
|
+
*/
|
|
30
|
+
export default function generateTree(files: string[] | undefined, config: any): GenerateTreeResults;
|
|
31
|
+
export {};
|
|
@@ -0,0 +1,196 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.default = generateTree;
|
|
7
|
+
exports.processPath = processPath;
|
|
8
|
+
function _os() {
|
|
9
|
+
const data = _interopRequireDefault(require("os"));
|
|
10
|
+
_os = function () {
|
|
11
|
+
return data;
|
|
12
|
+
};
|
|
13
|
+
return data;
|
|
14
|
+
}
|
|
15
|
+
function _path() {
|
|
16
|
+
const data = _interopRequireDefault(require("path"));
|
|
17
|
+
_path = function () {
|
|
18
|
+
return data;
|
|
19
|
+
};
|
|
20
|
+
return data;
|
|
21
|
+
}
|
|
22
|
+
function _dependencyTree() {
|
|
23
|
+
const data = _interopRequireDefault(require("./dependency-tree"));
|
|
24
|
+
_dependencyTree = function () {
|
|
25
|
+
return data;
|
|
26
|
+
};
|
|
27
|
+
return data;
|
|
28
|
+
}
|
|
29
|
+
function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
|
|
30
|
+
// most of the functions in this file were taken from the Madge project: https://github.com/pahen/madge
|
|
31
|
+
// reasons for not using Madge directly: 1) it has issues with TypeScript on Windows. 2) it has issues with tsx files
|
|
32
|
+
|
|
33
|
+
/**
|
|
34
|
+
* Check if running on Windows.
|
|
35
|
+
* @type {Boolean}
|
|
36
|
+
*/
|
|
37
|
+
const isWin = _os().default.platform() === 'win32';
|
|
38
|
+
|
|
39
|
+
/**
|
|
40
|
+
* Check if path is from NPM folder
|
|
41
|
+
* @param {String} path
|
|
42
|
+
* @return {Boolean}
|
|
43
|
+
*/
|
|
44
|
+
function isNpmPathFunc(pathStr) {
|
|
45
|
+
return pathStr.indexOf('node_modules') >= 0;
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
/**
|
|
49
|
+
* Sort tree.
|
|
50
|
+
* @param {Object} tree
|
|
51
|
+
* @return {Object}
|
|
52
|
+
*/
|
|
53
|
+
function sort(tree) {
|
|
54
|
+
return Object.keys(tree).sort().reduce((acc, id) => {
|
|
55
|
+
acc[id] = tree[id].sort();
|
|
56
|
+
return acc;
|
|
57
|
+
}, {});
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
/**
|
|
61
|
+
* Exclude modules from tree using RegExp.
|
|
62
|
+
* @param {Object} tree
|
|
63
|
+
* @param {Array} excludeRegExp
|
|
64
|
+
* @return {Object}
|
|
65
|
+
*/
|
|
66
|
+
function exclude(tree, excludeRegExp) {
|
|
67
|
+
const regExpList = excludeRegExp.map(re => new RegExp(re));
|
|
68
|
+
function regExpFilter(id) {
|
|
69
|
+
return regExpList.findIndex(regexp => regexp.test(id)) < 0;
|
|
70
|
+
}
|
|
71
|
+
return Object.keys(tree).filter(regExpFilter).reduce((acc, id) => {
|
|
72
|
+
acc[id] = tree[id].filter(regExpFilter);
|
|
73
|
+
return acc;
|
|
74
|
+
}, {});
|
|
75
|
+
}
|
|
76
|
+
|
|
77
|
+
/**
|
|
78
|
+
* Process absolute path and return a shorter one.
|
|
79
|
+
* @param {String} absPath
|
|
80
|
+
* @param {Object} cache
|
|
81
|
+
* @param {String} baseDir
|
|
82
|
+
* @return {String}
|
|
83
|
+
*/
|
|
84
|
+
function processPath(absPath, cache, baseDir) {
|
|
85
|
+
if (cache[absPath]) {
|
|
86
|
+
return cache[absPath];
|
|
87
|
+
}
|
|
88
|
+
let relPath = _path().default.relative(baseDir, absPath);
|
|
89
|
+
if (isWin) {
|
|
90
|
+
relPath = relPath.replace(/\\/g, '/');
|
|
91
|
+
}
|
|
92
|
+
cache[absPath] = relPath;
|
|
93
|
+
return relPath;
|
|
94
|
+
}
|
|
95
|
+
|
|
96
|
+
/**
|
|
97
|
+
* Convert deep tree produced by dependency-tree to a
|
|
98
|
+
* shallow (one level deep) tree used by madge.
|
|
99
|
+
* @param {Object} depTree
|
|
100
|
+
* @param {Object} tree
|
|
101
|
+
* @param {Object} pathCache
|
|
102
|
+
* @param {String} baseDir
|
|
103
|
+
* @return {Object}
|
|
104
|
+
*/
|
|
105
|
+
function convertTreePaths(depTree, pathCache, baseDir) {
|
|
106
|
+
const tree = {};
|
|
107
|
+
Object.keys(depTree).forEach(file => {
|
|
108
|
+
tree[processPath(file, pathCache, baseDir)] = depTree[file].map(d => processPath(d, pathCache, baseDir));
|
|
109
|
+
});
|
|
110
|
+
return tree;
|
|
111
|
+
}
|
|
112
|
+
|
|
113
|
+
// e.g. { 'index.ts': ['foo.ts', '../node_modules/react/index.js'] }
|
|
114
|
+
// all paths are normalized to Linux
|
|
115
|
+
|
|
116
|
+
// e.g. { '/tmp/workspace': ['lodash', 'underscore'] };
|
|
117
|
+
|
|
118
|
+
/**
|
|
119
|
+
* Generate the tree from the given files
|
|
120
|
+
* @param {Array} files
|
|
121
|
+
* @param config
|
|
122
|
+
* @return {Object}
|
|
123
|
+
*/
|
|
124
|
+
function generateTree(files = [], config) {
|
|
125
|
+
const depTree = {};
|
|
126
|
+
const nonExistent = {};
|
|
127
|
+
const npmPaths = {};
|
|
128
|
+
const pathCache = {};
|
|
129
|
+
const pathMap = [];
|
|
130
|
+
const errors = {};
|
|
131
|
+
files.forEach(file => {
|
|
132
|
+
if (depTree[file]) {
|
|
133
|
+
return;
|
|
134
|
+
}
|
|
135
|
+
const detective = config.detectiveOptions;
|
|
136
|
+
try {
|
|
137
|
+
const dependencyTreeResult = (0, _dependencyTree().default)({
|
|
138
|
+
filename: file,
|
|
139
|
+
directory: config.baseDir,
|
|
140
|
+
requireConfig: config.requireConfig,
|
|
141
|
+
webpackConfig: config.webpackConfig,
|
|
142
|
+
resolveConfig: config.resolveConfig,
|
|
143
|
+
visited: config.visited,
|
|
144
|
+
errors,
|
|
145
|
+
filter: (dependencyFilePath, traversedFilePath) => {
|
|
146
|
+
let dependencyFilterRes = true;
|
|
147
|
+
const isNpmPath = isNpmPathFunc(dependencyFilePath);
|
|
148
|
+
if (config.dependencyFilter) {
|
|
149
|
+
dependencyFilterRes = config.dependencyFilter(dependencyFilePath, traversedFilePath, config.baseDir);
|
|
150
|
+
}
|
|
151
|
+
if (config.includeNpm && isNpmPath) {
|
|
152
|
+
(npmPaths[traversedFilePath] = npmPaths[traversedFilePath] || []).push(dependencyFilePath);
|
|
153
|
+
}
|
|
154
|
+
return !isNpmPath && (dependencyFilterRes || dependencyFilterRes === undefined);
|
|
155
|
+
},
|
|
156
|
+
detective,
|
|
157
|
+
nonExistent,
|
|
158
|
+
pathMap,
|
|
159
|
+
cacheProjectAst: config.cacheProjectAst,
|
|
160
|
+
envDetectors: config.envDetectors
|
|
161
|
+
});
|
|
162
|
+
Object.assign(depTree, dependencyTreeResult);
|
|
163
|
+
} catch (err) {
|
|
164
|
+
errors[file] = err;
|
|
165
|
+
}
|
|
166
|
+
});
|
|
167
|
+
let tree = convertTreePaths(depTree, pathCache, config.baseDir);
|
|
168
|
+
|
|
169
|
+
// rename errors keys from absolute paths to relative paths
|
|
170
|
+
Object.keys(errors).forEach(file => {
|
|
171
|
+
const relativeFile = processPath(file, pathCache, config.baseDir);
|
|
172
|
+
if (relativeFile !== file) {
|
|
173
|
+
errors[relativeFile] = errors[file];
|
|
174
|
+
delete errors[file];
|
|
175
|
+
}
|
|
176
|
+
});
|
|
177
|
+
Object.keys(npmPaths).forEach(npmKey => {
|
|
178
|
+
const id = processPath(npmKey, pathCache, config.baseDir);
|
|
179
|
+
// a file might not be in the tree if it has errors or errors found with its parents
|
|
180
|
+
if (!tree[id]) return;
|
|
181
|
+
npmPaths[npmKey].forEach(npmPath => {
|
|
182
|
+
tree[id].push(processPath(npmPath, pathCache, config.baseDir));
|
|
183
|
+
});
|
|
184
|
+
});
|
|
185
|
+
if (config.excludeRegExp) {
|
|
186
|
+
tree = exclude(tree, config.excludeRegExp);
|
|
187
|
+
}
|
|
188
|
+
return {
|
|
189
|
+
madgeTree: sort(tree),
|
|
190
|
+
skipped: nonExistent,
|
|
191
|
+
pathMap,
|
|
192
|
+
errors
|
|
193
|
+
};
|
|
194
|
+
}
|
|
195
|
+
|
|
196
|
+
//# sourceMappingURL=generate-tree-madge.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["_os","data","_interopRequireDefault","require","_path","_dependencyTree","e","__esModule","default","isWin","os","platform","isNpmPathFunc","pathStr","indexOf","sort","tree","Object","keys","reduce","acc","id","exclude","excludeRegExp","regExpList","map","re","RegExp","regExpFilter","findIndex","regexp","test","filter","processPath","absPath","cache","baseDir","relPath","path","relative","replace","convertTreePaths","depTree","pathCache","forEach","file","d","generateTree","files","config","nonExistent","npmPaths","pathMap","errors","detective","detectiveOptions","dependencyTreeResult","dependencyTree","filename","directory","requireConfig","webpackConfig","resolveConfig","visited","dependencyFilePath","traversedFilePath","dependencyFilterRes","isNpmPath","dependencyFilter","includeNpm","push","undefined","cacheProjectAst","envDetectors","assign","err","relativeFile","npmKey","npmPath","madgeTree","skipped"],"sources":["generate-tree-madge.ts"],"sourcesContent":["// most of the functions in this file were taken from the Madge project: https://github.com/pahen/madge\n// reasons for not using Madge directly: 1) it has issues with TypeScript on Windows. 2) it has issues with tsx files\n\nimport os from 'os';\nimport path from 'path';\n\nimport dependencyTree from './dependency-tree';\nimport { PathLinuxRelative } from '@teambit/toolbox.path.path';\n\n/**\n * Check if running on Windows.\n * @type {Boolean}\n */\nconst isWin = os.platform() === 'win32';\n\n/**\n * Check if path is from NPM folder\n * @param {String} path\n * @return {Boolean}\n */\nfunction isNpmPathFunc(pathStr) {\n return pathStr.indexOf('node_modules') >= 0;\n}\n\n/**\n * Sort tree.\n * @param {Object} tree\n * @return {Object}\n */\nfunction sort(tree) {\n return Object.keys(tree)\n .sort()\n .reduce((acc, id) => {\n acc[id] = tree[id].sort();\n return acc;\n }, {});\n}\n\n/**\n * Exclude modules from tree using RegExp.\n * @param {Object} tree\n * @param {Array} excludeRegExp\n * @return {Object}\n */\nfunction exclude(tree, excludeRegExp) {\n const regExpList = excludeRegExp.map((re) => new RegExp(re));\n\n function regExpFilter(id) {\n return regExpList.findIndex((regexp) => regexp.test(id)) < 0;\n }\n\n return Object.keys(tree)\n .filter(regExpFilter)\n .reduce((acc, id) => {\n acc[id] = tree[id].filter(regExpFilter);\n return acc;\n }, {});\n}\n\n/**\n * Process absolute path and return a shorter one.\n * @param {String} absPath\n * @param {Object} cache\n * @param {String} baseDir\n * @return {String}\n */\nexport function processPath(absPath, cache, baseDir) {\n if (cache[absPath]) {\n return cache[absPath];\n }\n\n let relPath = path.relative(baseDir, absPath);\n\n if (isWin) {\n relPath = relPath.replace(/\\\\/g, '/');\n }\n\n cache[absPath] = relPath;\n\n return relPath;\n}\n\n/**\n * Convert deep tree produced by dependency-tree to a\n * shallow (one level deep) tree used by madge.\n * @param {Object} depTree\n * @param {Object} tree\n * @param {Object} pathCache\n * @param {String} baseDir\n * @return {Object}\n */\nfunction convertTreePaths(depTree, pathCache, baseDir) {\n const tree = {};\n Object.keys(depTree).forEach((file) => {\n tree[processPath(file, pathCache, baseDir)] = depTree[file].map((d) => processPath(d, pathCache, baseDir));\n });\n\n return tree;\n}\n\n// e.g. { 'index.ts': ['foo.ts', '../node_modules/react/index.js'] }\n// all paths are normalized to Linux\nexport type MadgeTree = { [relativePath: string]: PathLinuxRelative[] };\n\n// e.g. { '/tmp/workspace': ['lodash', 'underscore'] };\nexport type Missing = { [absolutePath: string]: string[] };\n\ntype GenerateTreeResults = {\n madgeTree: MadgeTree;\n skipped: Missing;\n pathMap: any;\n errors: { [filePath: string]: Error };\n};\n\n/**\n * Generate the tree from the given files\n * @param {Array} files\n * @param config\n * @return {Object}\n */\nexport default function generateTree(files: string[] = [], config): GenerateTreeResults {\n const depTree = {};\n const nonExistent = {};\n const npmPaths = {};\n const pathCache = {};\n const pathMap = [];\n const errors = {};\n\n files.forEach((file) => {\n if (depTree[file]) {\n return;\n }\n\n const detective = config.detectiveOptions;\n try {\n const dependencyTreeResult = dependencyTree({\n filename: file,\n directory: config.baseDir,\n requireConfig: config.requireConfig,\n webpackConfig: config.webpackConfig,\n resolveConfig: config.resolveConfig,\n visited: config.visited,\n errors,\n filter: (dependencyFilePath, traversedFilePath) => {\n let dependencyFilterRes = true;\n const isNpmPath = isNpmPathFunc(dependencyFilePath);\n\n if (config.dependencyFilter) {\n dependencyFilterRes = config.dependencyFilter(dependencyFilePath, traversedFilePath, config.baseDir);\n }\n\n if (config.includeNpm && isNpmPath) {\n (npmPaths[traversedFilePath] = npmPaths[traversedFilePath] || []).push(dependencyFilePath);\n }\n\n return !isNpmPath && (dependencyFilterRes || dependencyFilterRes === undefined);\n },\n detective,\n nonExistent,\n pathMap,\n cacheProjectAst: config.cacheProjectAst,\n envDetectors: config.envDetectors,\n });\n Object.assign(depTree, dependencyTreeResult);\n } catch (err: any) {\n errors[file] = err;\n }\n });\n\n let tree = convertTreePaths(depTree, pathCache, config.baseDir);\n\n // rename errors keys from absolute paths to relative paths\n Object.keys(errors).forEach((file) => {\n const relativeFile = processPath(file, pathCache, config.baseDir);\n if (relativeFile !== file) {\n errors[relativeFile] = errors[file];\n delete errors[file];\n }\n });\n\n Object.keys(npmPaths).forEach((npmKey) => {\n const id = processPath(npmKey, pathCache, config.baseDir);\n // a file might not be in the tree if it has errors or errors found with its parents\n if (!tree[id]) return;\n npmPaths[npmKey].forEach((npmPath) => {\n tree[id].push(processPath(npmPath, pathCache, config.baseDir));\n });\n });\n\n if (config.excludeRegExp) {\n tree = exclude(tree, config.excludeRegExp);\n }\n\n return {\n madgeTree: sort(tree),\n skipped: nonExistent,\n pathMap,\n errors,\n };\n}\n"],"mappings":";;;;;;;AAGA,SAAAA,IAAA;EAAA,MAAAC,IAAA,GAAAC,sBAAA,C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CAAC,CAACjC,OAAO,CAAEkC,OAAO,IAAK;MACpC9D,IAAI,CAACK,EAAE,CAAC,CAACiD,IAAI,CAACrC,WAAW,CAAC6C,OAAO,EAAEnC,SAAS,EAAEM,MAAM,CAACb,OAAO,CAAC,CAAC;IAChE,CAAC,CAAC;EACJ,CAAC,CAAC;EAEF,IAAIa,MAAM,CAAC1B,aAAa,EAAE;IACxBP,IAAI,GAAGM,OAAO,CAACN,IAAI,EAAEiC,MAAM,CAAC1B,aAAa,CAAC;EAC5C;EAEA,OAAO;IACLwD,SAAS,EAAEhE,IAAI,CAACC,IAAI,CAAC;IACrBgE,OAAO,EAAE9B,WAAW;IACpBE,OAAO;IACPC;EACF,CAAC;AACH","ignoreList":[]}
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
Object.defineProperty(exports, "getDependenciesFromSource", {
|
|
7
|
+
enumerable: true,
|
|
8
|
+
get: function () {
|
|
9
|
+
return _precinct().default;
|
|
10
|
+
}
|
|
11
|
+
});
|
|
12
|
+
Object.defineProperty(exports, "getDependencyTree", {
|
|
13
|
+
enumerable: true,
|
|
14
|
+
get: function () {
|
|
15
|
+
return _buildTree().getDependencyTree;
|
|
16
|
+
}
|
|
17
|
+
});
|
|
18
|
+
function _buildTree() {
|
|
19
|
+
const data = require("./build-tree");
|
|
20
|
+
_buildTree = function () {
|
|
21
|
+
return data;
|
|
22
|
+
};
|
|
23
|
+
return data;
|
|
24
|
+
}
|
|
25
|
+
function _precinct() {
|
|
26
|
+
const data = _interopRequireDefault(require("./precinct"));
|
|
27
|
+
_precinct = function () {
|
|
28
|
+
return data;
|
|
29
|
+
};
|
|
30
|
+
return data;
|
|
31
|
+
}
|
|
32
|
+
function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
|
|
33
|
+
|
|
34
|
+
//# sourceMappingURL=index.js.map
|