@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":["_defenderFs","data","require","_assert","_interopRequireDefault","_path","_rewire","_sinon","_fsExtra","_precinct","_Config","e","__esModule","default","UNIT_TEST_DIR","path","join","BIT_TEMP_ROOT","expect","dependencyTreeRewired","rewire","dependencyTree","fixtures","resolve","__dirname","mockfs","obj","Object","entries","forEach","key","value","fs","mkdirSync","recursive","file","content","filePath","writeFileSync","cleanUnitDir","removeSync","describe","timeout","testTreesForFormat","format","ext","it","root","filename","normalize","tree","assert","aSubTree","ok","filesInSubTree","keys","equal","length","mockStylus","mockSass","mockLess","mockcommonjs","mockes6","mockTS","afterEach","imaginary","directory","subTree","bTree","cTree","some","dep","indexOf","spy","sinon","callCount","_getDependencies","restore","node","nodes","process","cwd","precinct","detectiveConfig","amd","skipLazyLoaded","detective","calledWith","nonExistent","beforeEach","_directory","_revert","__set__","throws","undefined","filter","doesNotThrow","_spy","cache","pathMap","dependencies","visited","includes","skip","_root","_webpackConfig","_testResolution","name","results","toList","webpackConfig","moduleFile","has3rdPartyDep","es6","mixedImports","node_modules","nodeModulesConfig","entry","config","Config","clone","deepEqual","fooFile","barFile","bazFile","to","deep","baseFile","indexFile","be","missing"],"sources":["index.spec.ts"],"sourcesContent":["import { BIT_TEMP_ROOT } from '@teambit/defender.fs.global-bit-temp-dir';\nimport assert from 'assert';\nimport path from 'path';\nimport rewire from 'rewire';\nimport sinon from 'sinon';\nimport fs from 'fs-extra';\n\nimport precinct from '../precinct';\nimport Config from './Config';\n\nconst UNIT_TEST_DIR = path.join(BIT_TEMP_ROOT, 'unit-test');\nconst expect = require('chai').expect;\n\nconst dependencyTreeRewired = rewire('./');\nconst dependencyTree = dependencyTreeRewired.default;\nconst fixtures = path.resolve(`${__dirname}/../fixtures/dependency-tree`);\n\nfunction mockfs(obj: any) {\n Object.entries(obj).forEach(([key, value]) => {\n fs.mkdirSync(key, { recursive: true });\n // @ts-ignore\n Object.entries(value).forEach(([file, content]) => {\n const filePath = path.join(key, file);\n fs.writeFileSync(filePath, content as string);\n });\n });\n}\n\nfunction cleanUnitDir() {\n fs.removeSync(UNIT_TEST_DIR);\n}\n\ndescribe('dependencyTree', function () {\n // @ts-ignore\n this.timeout(8000);\n function testTreesForFormat(format, ext = '.js') {\n it('returns an object form of the dependency tree for a file', () => {\n const root = `${UNIT_TEST_DIR}/${format}`;\n const filename = path.normalize(`${root}/a${ext}`);\n\n const tree = dependencyTree({ filename, root });\n\n assert(tree instanceof Object);\n\n const aSubTree = tree[filename];\n\n assert.ok(aSubTree instanceof Object);\n const filesInSubTree = Object.keys(aSubTree);\n\n assert.equal(filesInSubTree.length, 2);\n });\n }\n\n function mockStylus() {\n mockfs({\n [`${UNIT_TEST_DIR}/stylus`]: {\n 'a.styl': `\n @import \"b\"\n @require \"c.styl\"\n `,\n 'b.styl': '@import \"c\"',\n 'c.styl': '',\n },\n });\n }\n\n function mockSass() {\n mockfs({\n [`${UNIT_TEST_DIR}/sass`]: {\n 'a.scss': `\n @import \"_b\";\n @import \"_c.scss\";\n `,\n '_b.scss': 'body { color: blue; }',\n '_c.scss': 'body { color: pink; }',\n },\n });\n }\n\n function mockLess() {\n mockfs({\n [`${UNIT_TEST_DIR}/less`]: {\n 'a.less': `\n @import \"b.css\";\n @import \"c.less\";\n `,\n 'b.css': 'body { color: blue; }',\n 'c.less': 'body { color: pink; }',\n },\n });\n }\n\n function mockcommonjs() {\n mockfs({\n [`${UNIT_TEST_DIR}/commonjs`]: {\n 'a.js': `\n var b = require('./b');\n var c = require('./c');\n `,\n 'b.js': `\n var path = require('path');\n module.exports = {};\n `,\n 'c.js': `\n var fs = require('fs');\n module.exports = {};\n `,\n },\n });\n }\n\n function mockes6() {\n mockfs({\n [`${UNIT_TEST_DIR}/es6`]: {\n 'a.js': `\n import b from './b';\n import c from './c';\n `,\n 'b.js': 'export default () => {};',\n 'c.js': 'export default () => {};',\n 'jsx.js': \"import c from './c';\\n export default <jsx />;\",\n 'foo.jsx': \"import React from 'react';\\n import b from './b';\\n export default <jsx />;\",\n 'es7.js': \"import c from './c';\\n export default async function foo() {};\",\n },\n });\n }\n\n function mockTS() {\n mockfs({\n [`${UNIT_TEST_DIR}/ts`]: {\n 'a.ts': `\n import b from './b';\n import c from './c';\n `,\n 'b.ts': 'export default () => {};',\n 'c.ts': 'export default () => {};',\n },\n });\n }\n\n afterEach(() => {\n // mockfs.restore();\n cleanUnitDir();\n });\n\n it('returns an empty object for a non-existent filename', () => {\n mockfs({\n imaginary: {},\n });\n\n const root = `${UNIT_TEST_DIR}/imaginary`;\n const filename = `${root}/notafile.js`;\n const tree = dependencyTree({ filename, root });\n\n assert(tree instanceof Object);\n assert(!Object.keys(tree).length);\n });\n\n it('handles nested tree structures', () => {\n const directory = `${UNIT_TEST_DIR}/extended`;\n\n mockfs({\n [directory]: {\n 'a.js': `\n var b = require('./b');\n var c = require('./c');`,\n 'b.js': `\n var d = require('./d');\n var e = require('./e');`,\n 'c.js': `\n var f = require('./f');\n var g = require('./g');`,\n 'd.js': '',\n 'e.js': '',\n 'f.js': '',\n 'g.js': '',\n },\n });\n\n const filename = path.normalize(`${directory}/a.js`);\n const tree = dependencyTree({ filename, directory });\n assert(tree[filename] instanceof Object);\n\n // b and c\n const subTree = tree[filename];\n assert.equal(subTree.length, 2);\n\n const bTree = tree[path.normalize(`${directory}/b.js`)];\n const cTree = tree[path.normalize(`${directory}/c.js`)];\n // d and e\n assert.equal(bTree.length, 2);\n // f ang g\n assert.equal(cTree.length, 2);\n });\n\n it('does not include files that are not real (#13)', () => {\n mockfs({\n [`${UNIT_TEST_DIR}/onlyRealDeps`]: {\n 'a.js': 'var notReal = require(\"./notReal\");',\n },\n });\n\n const directory = `${UNIT_TEST_DIR}/onlyRealDeps`;\n const filename = path.normalize(`${directory}/a.js`);\n\n const tree = dependencyTree({ filename, directory });\n const subTree = tree[filename];\n\n assert.ok(!Object.keys(subTree).some((dep) => dep.indexOf('notReal') !== -1));\n });\n\n it('does not choke on cyclic dependencies', () => {\n mockfs({\n [`${UNIT_TEST_DIR}/cyclic`]: {\n 'a.js': 'var b = require(\"./b\");',\n 'b.js': 'var a = require(\"./a\");',\n },\n });\n\n const directory = `${UNIT_TEST_DIR}/cyclic`;\n const filename = path.normalize(`${directory}/a.js`);\n\n const spy = sinon.spy(dependencyTreeRewired, '_getDependencies');\n\n const tree = dependencyTreeRewired.default({ filename, directory });\n\n assert(spy.callCount === 2);\n assert(Object.keys(tree[filename]).length);\n\n dependencyTreeRewired._getDependencies.restore();\n });\n\n it('excludes Nodejs core modules by default', () => {\n const directory = `${fixtures}/commonjs`;\n const filename = path.normalize(`${directory}/b.js`);\n\n const tree = dependencyTree({ filename, directory });\n assert(Object.keys(tree[filename]).length === 0);\n assert(Object.keys(tree)[0].indexOf('b.js') !== -1);\n });\n\n it('returns a list of absolutely pathed files', () => {\n const directory = `${UNIT_TEST_DIR}/commonjs`;\n const filename = `${directory}/b.js`;\n\n const tree = dependencyTree({ filename, directory });\n // eslint-disable-next-line\n for (const node in tree.nodes) {\n assert(node.indexOf(process.cwd()) !== -1);\n }\n });\n\n describe('when given a detective configuration', () => {\n it('passes it through to precinct', () => {\n const spy = sinon.spy(precinct, 'paperwork');\n const directory = path.normalize(`${fixtures}/onlyRealDeps`);\n const filename = path.normalize(`${directory}/a.js`);\n const detectiveConfig = {\n amd: {\n skipLazyLoaded: true,\n },\n };\n\n dependencyTree({\n filename,\n directory,\n detective: detectiveConfig,\n });\n\n assert.ok(spy.calledWith(filename, detectiveConfig));\n spy.restore();\n });\n });\n\n describe('when given a list to store non existent partials', () => {\n describe('and the file contains no valid partials', () => {\n it('stores the invalid partials', () => {\n mockfs({\n [`${UNIT_TEST_DIR}/onlyRealDeps`]: {\n 'a.js': 'var notReal = require(\"./notReal\");',\n },\n });\n\n const directory = path.normalize(`${UNIT_TEST_DIR}/onlyRealDeps`);\n const filename = path.normalize(`${directory}/a.js`);\n const nonExistent = [];\n\n dependencyTree({ filename, directory, nonExistent });\n\n assert.equal(Object.keys(nonExistent).length, 1);\n assert.equal(nonExistent[filename][0], './notReal');\n });\n });\n\n describe('and the file contains all valid partials', () => {\n it('does not store anything', () => {\n mockfs({\n [`${UNIT_TEST_DIR}/onlyRealDeps`]: {\n 'a.js': 'var b = require(\"./b\");',\n 'b.js': 'export default 1;',\n },\n });\n\n const directory = `${UNIT_TEST_DIR}/onlyRealDeps`;\n const filename = `${directory}/a.js`;\n const nonExistent = [];\n\n dependencyTree({ filename, directory, nonExistent });\n\n assert.equal(nonExistent.length, 0);\n });\n });\n\n describe('and the file contains a mix of invalid and valid partials', () => {\n it('stores the invalid ones', () => {\n mockfs({\n [`${UNIT_TEST_DIR}/onlyRealDeps`]: {\n 'a.js': 'var b = require(\"./b\");',\n 'b.js': 'var c = require(\"./c\"); export default 1;',\n 'c.js': 'var crap = require(\"./notRealMan\");',\n },\n });\n\n const directory = path.normalize(`${UNIT_TEST_DIR}/onlyRealDeps`);\n const filename = path.normalize(`${directory}/a.js`);\n const nonExistent = [];\n\n dependencyTree({ filename, directory, nonExistent });\n\n assert.equal(Object.keys(nonExistent).length, 1);\n assert.equal(nonExistent[path.normalize(`${directory}/c.js`)][0], './notRealMan');\n });\n });\n\n describe('and there is more than one reference to the invalid partial', () => {\n it('should include the non-existent partial per file', () => {\n mockfs({\n [`${UNIT_TEST_DIR}/onlyRealDeps`]: {\n 'a.js': 'var b = require(\"./b\");\\nvar crap = require(\"./notRealMan\");',\n 'b.js': 'var c = require(\"./c\"); export default 1;',\n 'c.js': 'var crap = require(\"./notRealMan\");',\n },\n });\n\n const directory = path.normalize(`${UNIT_TEST_DIR}/onlyRealDeps`);\n const filename = path.normalize(`${directory}/a.js`);\n const nonExistent = [];\n\n dependencyTree({ filename, directory, nonExistent });\n\n assert.equal(Object.keys(nonExistent).length, 2);\n assert.equal(nonExistent[filename][0], './notRealMan');\n assert.equal(nonExistent[path.normalize(`${directory}/c.js`)][0], './notRealMan');\n });\n });\n });\n\n describe('throws', () => {\n beforeEach(() => {\n // @ts-ignore\n this._directory = `${UNIT_TEST_DIR}/commonjs`;\n // @ts-ignore\n this._revert = dependencyTreeRewired.__set__('traverse', () => []);\n });\n\n afterEach(() => {\n // @ts-ignore\n this._revert();\n });\n\n it('throws if the filename is missing', () => {\n assert.throws(() => {\n dependencyTree({\n filename: undefined,\n // @ts-ignore\n directory: this._directory,\n });\n });\n });\n\n it('throws if the root is missing', () => {\n assert.throws(() => {\n dependencyTree({ filename: undefined });\n });\n });\n\n it('throws if a supplied filter is not a function', () => {\n assert.throws(() => {\n const directory = `${UNIT_TEST_DIR}/onlyRealDeps`;\n const filename = `${directory}/a.js`;\n\n dependencyTree({\n filename,\n directory,\n filter: 'foobar',\n });\n });\n });\n\n it('does not throw on the legacy `root` option', () => {\n assert.doesNotThrow(() => {\n const directory = `${UNIT_TEST_DIR}/onlyRealDeps`;\n const filename = `${directory}/a.js`;\n\n dependencyTree({\n filename,\n root: directory,\n });\n });\n });\n });\n\n describe('on file error', () => {\n beforeEach(() => {\n // @ts-ignore\n this._directory = `${UNIT_TEST_DIR}/commonjs`;\n });\n\n it('does not throw', () => {\n assert.doesNotThrow(() => {\n dependencyTree({\n filename: 'foo',\n // @ts-ignore\n directory: this._directory,\n });\n });\n });\n\n it('returns no dependencies', () => {\n // @ts-ignore\n const tree = dependencyTree({ filename: 'foo', directory: this._directory });\n assert(!tree.length);\n });\n });\n\n describe('memoization (#2)', () => {\n beforeEach(() => {\n // @ts-ignore\n this._spy = sinon.spy(dependencyTreeRewired, '_getDependencies');\n });\n\n afterEach(() => {\n dependencyTreeRewired._getDependencies.restore();\n });\n\n it('returns the precomputed list of a cached entry point', () => {\n const filename = `${UNIT_TEST_DIR}/amd/a.js`;\n const directory = `${UNIT_TEST_DIR}/amd`;\n\n const cache = {\n // Shouldn't process the first file's tree\n [filename]: { pathMap: { dependencies: [] } },\n };\n\n const tree = dependencyTree({\n filename,\n directory,\n visited: cache,\n });\n\n assert(!tree.length);\n });\n });\n\n describe('module formats', () => {\n describe('commonjs', () => {\n beforeEach(() => {\n // @ts-ignore\n this._directory = path.normalize(`${UNIT_TEST_DIR}/es6`);\n mockcommonjs();\n });\n\n testTreesForFormat('commonjs');\n });\n\n describe('es6', () => {\n beforeEach(() => {\n // @ts-ignore\n this._directory = path.normalize(`${UNIT_TEST_DIR}/es6`);\n mockes6();\n });\n\n testTreesForFormat('es6');\n\n it('resolves files that have jsx', () => {\n // @ts-ignore\n const filename = path.normalize(`${this._directory}/jsx.js`);\n const tree = dependencyTree({\n filename,\n // @ts-ignore\n directory: this._directory,\n });\n // @ts-ignore\n assert.ok(tree[filename].includes(path.normalize(`${this._directory}/c.js`)));\n });\n\n it('resolves files with a jsx extension', () => {\n // @ts-ignore\n const filename = path.normalize(`${this._directory}/foo.jsx`);\n const tree = dependencyTree({\n filename,\n // @ts-ignore\n directory: this._directory,\n });\n // @ts-ignore\n assert.ok(tree[filename].includes(path.normalize(`${this._directory}/b.js`)));\n });\n\n it('resolves files that have es7', () => {\n // @ts-ignore\n const filename = path.normalize(`${this._directory}/es7.js`);\n const tree = dependencyTree({\n filename,\n // @ts-ignore\n directory: this._directory,\n });\n // @ts-ignore\n assert.ok(tree[filename].includes(path.normalize(`${this._directory}/c.js`)));\n });\n });\n\n describe('sass', () => {\n beforeEach(() => {\n mockSass();\n });\n\n testTreesForFormat('sass', '.scss');\n });\n\n describe('stylus', () => {\n beforeEach(() => {\n mockStylus();\n });\n\n testTreesForFormat('stylus', '.styl');\n });\n\n describe('less', () => {\n beforeEach(() => {\n mockLess();\n });\n\n testTreesForFormat('less', '.less');\n });\n\n describe('typescript', () => {\n beforeEach(() => {\n mockTS();\n });\n\n testTreesForFormat('ts', '.ts');\n });\n });\n\n // skipping the webpack unit tests for now as it's not easy to wire up all the files together.\n // originally, in dependency-tree, the webpack.config.js is in the same directory of the index.js.\n // doing the same here will be confusing. instead, we have already e2e-tests in bit legacy of custom\n // module resolution, which takes advantage of the webpack config.\n describe.skip('webpack', () => {\n beforeEach(() => {\n // Note: not mocking because webpack's resolver needs a real project with dependencies;\n // otherwise, we'd have to mock a ton of files.\n // @ts-ignore\n this._root = path.join(UNIT_TEST_DIR, '../');\n // @ts-ignore\n this._webpackConfig = `${this._root}/webpack.config.js`;\n // @ts-ignore\n this._testResolution = (name) => {\n const results = dependencyTree.toList({\n filename: `${UNIT_TEST_DIR}/webpack/${name}.js`,\n // @ts-ignore\n directory: this._root,\n // @ts-ignore\n webpackConfig: this._webpackConfig,\n filter: (filename) => filename.indexOf('filing-cabinet') !== -1,\n });\n assert.ok(results.some((filename) => filename.indexOf('node_modules/filing-cabinet') !== -1));\n };\n });\n\n it('resolves unaliased modules', () => {\n // @ts-ignore\n this.timeout(5000);\n // @ts-ignore\n this._testResolution('unaliased');\n });\n });\n\n describe('when a filter function is supplied', () => {\n it('uses the filter to determine if a file should be included in the results', () => {\n const directory = path.normalize(`${fixtures}/onlyRealDeps`);\n const filename = path.normalize(`${directory}/a.js`);\n\n const tree = dependencyTree({\n filename,\n directory,\n // Skip all 3rd party deps\n filter: (filePath, moduleFile) => {\n assert.ok(require.resolve('debug'));\n assert.ok(moduleFile.includes(path.normalize('onlyRealDeps/a.js')));\n return filePath.indexOf('node_modules') === -1;\n },\n });\n\n const subTree = tree[filename];\n assert.ok(Object.keys(tree).length);\n\n const has3rdPartyDep = Object.keys(subTree).some((dep) => dep === require.resolve('debug'));\n assert.ok(!has3rdPartyDep);\n });\n });\n\n describe('when given a CJS file with lazy requires', () => {\n beforeEach(() => {\n mockfs({\n [`${UNIT_TEST_DIR}/cjs`]: {\n 'foo.js': 'module.exports = function(bar = require(\"./bar\")) {};',\n 'bar.js': 'module.exports = 1;',\n },\n });\n });\n\n it('includes the lazy dependency', () => {\n const directory = `${UNIT_TEST_DIR}/cjs`;\n const filename = path.normalize(`${directory}/foo.js`);\n\n const tree = dependencyTree({ filename, directory });\n assert.ok(tree[filename].includes(path.normalize(`${directory}/bar.js`)));\n });\n });\n\n describe('when given an es6 file using CJS lazy requires', () => {\n beforeEach(() => {\n mockfs({\n [`${UNIT_TEST_DIR}/es6`]: {\n 'foo.js': 'export default function(bar = require(\"./bar\")) {};',\n 'bar.js': 'export default 1;',\n },\n });\n });\n\n describe('and mixedImport mode is turned on', () => {\n it('includes the lazy dependency', () => {\n const directory = `${UNIT_TEST_DIR}/es6`;\n const filename = path.normalize(`${directory}/foo.js`);\n\n const tree = dependencyTree({\n filename,\n directory,\n detective: {\n es6: {\n mixedImports: true,\n },\n },\n });\n\n assert.ok(tree[filename].includes(path.normalize(`${directory}/bar.js`)));\n });\n });\n });\n\n describe('when given an es6 file using dynamic imports', () => {\n beforeEach(() => {\n mockfs({\n [`${UNIT_TEST_DIR}/es6`]: {\n 'foo.js': 'import(\"./bar\");',\n 'bar.js': 'export default 1;',\n },\n });\n });\n\n it('includes the dynamic import', () => {\n const directory = path.normalize(`${UNIT_TEST_DIR}/es6`);\n const filename = path.normalize(`${directory}/foo.js`);\n\n const tree = dependencyTree({\n filename,\n directory,\n });\n\n const subTree = tree[filename];\n\n assert.ok(!(`${directory}/bar.js` in subTree));\n });\n });\n\n describe('when a dependency of the main file is not supported', () => {\n beforeEach(() => {\n mockfs({\n [`${UNIT_TEST_DIR}/baz`]: {\n 'foo.js': 'require(\"./bar.json\");',\n 'bar.json': '{ \"main\": \"I\\'m a simple JSON object\" }',\n },\n });\n });\n\n it('should include it as a dependency and not throw an error', () => {\n const directory = path.normalize(`${UNIT_TEST_DIR}/baz`);\n const filename = path.normalize(`${directory}/foo.js`);\n\n const tree = dependencyTree({\n filename,\n directory,\n });\n\n assert.ok(`${directory}/bar.json` in tree);\n });\n });\n\n // nodeModulesConfig is a feature added to dependency-tree and filing-cabinet to support\n // \"module\" attribute of package.json, see here what this attribute is good for:\n // https://github.com/rollup/rollup/wiki/pkg.module\n // the commit of supporting it in filing-cabinet is here: https://github.com/dependents/node-filing-cabinet/commit/abef861a5a725b29c2342d01de94c6e2dd881aa0\n describe.skip('when given a CJS file with module property in package.json', () => {\n beforeEach(() => {\n mockfs({\n [`${UNIT_TEST_DIR}/es6`]: {\n 'module.entry.js': 'import * as module from \"module.entry\"',\n node_modules: {\n 'module.entry': {\n 'index.main.js': 'module.exports = () => {};',\n 'index.module.js': 'module.exports = () => {};',\n 'package.json': '{ \"main\": \"index.main.js\", \"module\": \"index.module.js\" }',\n },\n },\n },\n });\n });\n\n it('it includes the module entry as dependency', () => {\n const directory = `${UNIT_TEST_DIR}/es6`;\n const filename = `${directory}/module.entry.js`;\n\n const tree = dependencyTree({\n filename,\n directory,\n nodeModulesConfig: {\n entry: 'module',\n },\n });\n const subTree = tree[filename];\n\n assert.ok(`${directory}/node_modules/module.entry/index.module.js` in subTree);\n });\n });\n\n describe('Config', () => {\n describe('when cloning', () => {\n describe('and a detective config was set', () => {\n it('retains the detective config in the clone', () => {\n const detectiveConfig = {\n es6: {\n mixedImports: true,\n },\n };\n\n const config = new Config({\n detectiveConfig,\n filename: 'foo',\n directory: 'bar',\n });\n\n const clone = config.clone();\n\n assert.deepEqual(clone.detectiveConfig, detectiveConfig);\n });\n });\n });\n });\n\n describe('when a dependency has missing packages and is retrieved from the cache (visited)', () => {\n beforeEach(() => {\n mockfs({\n [`${UNIT_TEST_DIR}/baz`]: {\n 'foo.js': 'require(\"non-exist-foo-pkg\");',\n 'bar.js': 'require(\"./foo\"); require(\"non-exist-bar-pkg\")',\n 'baz.js': 'require(\"./foo\"); require(\"./bar\"); require(\"non-exist-baz-pkg\")',\n },\n });\n });\n\n it('should not override the cache with wrong packages', () => {\n const directory = path.normalize(`${UNIT_TEST_DIR}/baz`);\n const fooFile = path.normalize(`${directory}/foo.js`);\n const barFile = path.normalize(`${directory}/bar.js`);\n const bazFile = path.normalize(`${directory}/baz.js`);\n const nonExistent = {};\n const config = {\n directory,\n nonExistent,\n visited: {},\n };\n\n // @ts-ignore AUTO-ADDED-AFTER-MIGRATION-PLEASE-FIX!\n config.filename = fooFile;\n dependencyTree(config);\n expect(nonExistent[fooFile]).to.deep.equal(['non-exist-foo-pkg']);\n\n // @ts-ignore AUTO-ADDED-AFTER-MIGRATION-PLEASE-FIX!\n config.filename = barFile;\n dependencyTree(config);\n expect(nonExistent[fooFile]).to.deep.equal(['non-exist-foo-pkg']);\n expect(nonExistent[barFile]).to.deep.equal(['non-exist-bar-pkg']);\n\n // @ts-ignore AUTO-ADDED-AFTER-MIGRATION-PLEASE-FIX!\n config.filename = bazFile;\n dependencyTree(config);\n expect(nonExistent[fooFile]).to.deep.equal(['non-exist-foo-pkg']);\n expect(nonExistent[barFile]).to.deep.equal(['non-exist-bar-pkg']);\n expect(nonExistent[bazFile]).to.deep.equal(['non-exist-baz-pkg']);\n });\n });\n describe('passing css files and then javascript files', () => {\n beforeEach(() => {\n mockfs({\n [`${UNIT_TEST_DIR}/baz`]: {\n 'base.scss': 'li {} a {}', // don't change the content. it crash only with this for some reason\n 'index.jsx': \"require('some-module');\",\n },\n });\n });\n it('should not crash with \"RangeError: Maximum call stack size exceeded\" error', () => {\n const directory = path.normalize(`${UNIT_TEST_DIR}/baz`);\n const baseFile = path.normalize(`${directory}/base.scss`);\n const indexFile = path.normalize(`${directory}/index.jsx`);\n const config = {\n directory,\n };\n\n // @ts-ignore AUTO-ADDED-AFTER-MIGRATION-PLEASE-FIX!\n config.filename = baseFile;\n dependencyTree(config);\n\n // @ts-ignore AUTO-ADDED-AFTER-MIGRATION-PLEASE-FIX!\n config.filename = indexFile;\n const dependencies = dependencyTree(config);\n expect(dependencies).to.be.ok;\n });\n });\n describe('files with dynamic import', () => {\n it('should not show missing dependencies', () => {\n mockfs({\n [`${UNIT_TEST_DIR}/dynamic`]: {\n 'foo.js': 'const a = \"./b\"; import(a); require(a);',\n },\n });\n const directory = path.normalize(`${UNIT_TEST_DIR}/dynamic`);\n const filename = path.normalize(`${directory}/foo.js`);\n const visited = {};\n\n dependencyTree({\n filename,\n directory,\n visited,\n });\n expect(visited[filename].missing).to.be.undefined;\n });\n });\n describe('files with import from cdn (http, https)', () => {\n it('should not show missing dependencies when importing from https', () => {\n mockfs({\n [`${UNIT_TEST_DIR}/cdn`]: {\n 'foo.js': 'import { a } from \"https://unpkg.com\";',\n },\n });\n const directory = path.normalize(`${UNIT_TEST_DIR}/cdn`);\n const filename = path.normalize(`${directory}/foo.js`);\n const visited = {};\n dependencyTree({\n filename,\n directory,\n visited,\n });\n expect(visited[filename].missing).to.be.undefined;\n });\n it('should not show missing dependencies when importing from http', () => {\n mockfs({\n [`${UNIT_TEST_DIR}/cdn`]: {\n 'bar.js': 'const b = require(\"http://pkg.com\");',\n },\n });\n const directory = path.normalize(`${UNIT_TEST_DIR}/cdn`);\n const filename = path.normalize(`${directory}/bar.js`);\n const visited = {};\n dependencyTree({\n filename,\n directory,\n visited,\n });\n expect(visited[filename].missing).to.be.undefined;\n });\n });\n});\n"],"mappings":";;AAAA,SAAAA,YAAA;EAAA,MAAAC,IAAA,GAAAC,OAAA;EAAAF,WAAA,YAAAA,CAAA;IAAA,OAAAC,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AACA,SAAAE,QAAA;EAAA,MAAAF,IAAA,GAAAG,sBAAA,CAAAF,OAAA;EAAAC,OAAA,YAAAA,CAAA;IAAA,OAAAF,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AACA,SAAAI,MAAA;EAAA,MAAAJ,IAAA,GAAAG,sBAAA,CAAAF,OAAA;EAAAG,KAAA,YAAAA,CAAA;IAAA,OAAAJ,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AACA,SAAAK,QAAA;EAAA,MAAAL,IAAA,GAAAG,sBAAA,CAAAF,OAAA;EAAAI,OAAA,YAAAA,CAAA;IAAA,OAAAL,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AACA,SAAAM,OAAA;EAAA,MAAAN,IAAA,GAAAG,sBAAA,CAAAF,OAAA;EAAAK,MAAA,YAAAA,CAAA;IAAA,OAAAN,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AACA,SAAAO,SAAA;EAAA,MAAAP,IAAA,GAAAG,sBAAA,CAAAF,OAAA;EAAAM,QAAA,YAAAA,CAAA;IAAA,OAAAP,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AAEA,SAAAQ,UAAA;EAAA,MAAAR,IAAA,GAAAG,sBAAA,CAAAF,OAAA;EAAAO,SAAA,YAAAA,CAAA;IAAA,OAAAR,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AACA,SAAAS,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,EAAE,MAAM;MACxErB,MAAM,CAAC;QACL,CAAC,GAAGX,aAAa,MAAM,GAAG;UACxB,QAAQ,EAAE;QACZ;MACF,CAAC,CAAC;MACF,MAAMoD,SAAS,GAAGnD,eAAI,CAACkC,SAAS,CAAC,GAAGnC,aAAa,MAAM,CAAC;MACxD,MAAMkC,QAAQ,GAAGjC,eAAI,CAACkC,SAAS,CAAC,GAAGiB,SAAS,SAAS,CAAC;MACtD,MAAMmC,OAAO,GAAG,CAAC,CAAC;MAClBhF,cAAc,CAAC;QACb2B,QAAQ;QACRkB,SAAS;QACTmC;MACF,CAAC,CAAC;MACFnF,MAAM,CAACmF,OAAO,CAACrD,QAAQ,CAAC,CAACkF,OAAO,CAAC,CAACL,EAAE,CAACI,EAAE,CAACnC,SAAS;IACnD,CAAC,CAAC;EACJ,CAAC,CAAC;AACJ,CAAC,CAAC","ignoreList":[]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from '@teambit/styling.deps-detectors.detective-css';
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
var _stylingDepsDetectors = require("@teambit/styling.deps-detectors.detective-css");
|
|
7
|
+
Object.keys(_stylingDepsDetectors).forEach(function (key) {
|
|
8
|
+
if (key === "default" || key === "__esModule") return;
|
|
9
|
+
if (key in exports && exports[key] === _stylingDepsDetectors[key]) return;
|
|
10
|
+
Object.defineProperty(exports, key, {
|
|
11
|
+
enumerable: true,
|
|
12
|
+
get: function () {
|
|
13
|
+
return _stylingDepsDetectors[key];
|
|
14
|
+
}
|
|
15
|
+
});
|
|
16
|
+
});
|
|
17
|
+
|
|
18
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["_stylingDepsDetectors","require","Object","keys","forEach","key","exports","defineProperty","enumerable","get"],"sources":["index.ts"],"sourcesContent":["export * from '@teambit/styling.deps-detectors.detective-css';\n"],"mappings":";;;;;AAAA,IAAAA,qBAAA,GAAAC,OAAA;AAAAC,MAAA,CAAAC,IAAA,CAAAH,qBAAA,EAAAI,OAAA,WAAAC,GAAA;EAAA,IAAAA,GAAA,kBAAAA,GAAA;EAAA,IAAAA,GAAA,IAAAC,OAAA,IAAAA,OAAA,CAAAD,GAAA,MAAAL,qBAAA,CAAAK,GAAA;EAAAH,MAAA,CAAAK,cAAA,CAAAD,OAAA,EAAAD,GAAA;IAAAG,UAAA;IAAAC,GAAA,WAAAA,CAAA;MAAA,OAAAT,qBAAA,CAAAK,GAAA;IAAA;EAAA;AAAA","ignoreList":[]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from '@teambit/node.deps-detectors.detective-es6';
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
var _nodeDepsDetectors = require("@teambit/node.deps-detectors.detective-es6");
|
|
7
|
+
Object.keys(_nodeDepsDetectors).forEach(function (key) {
|
|
8
|
+
if (key === "default" || key === "__esModule") return;
|
|
9
|
+
if (key in exports && exports[key] === _nodeDepsDetectors[key]) return;
|
|
10
|
+
Object.defineProperty(exports, key, {
|
|
11
|
+
enumerable: true,
|
|
12
|
+
get: function () {
|
|
13
|
+
return _nodeDepsDetectors[key];
|
|
14
|
+
}
|
|
15
|
+
});
|
|
16
|
+
});
|
|
17
|
+
|
|
18
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["_nodeDepsDetectors","require","Object","keys","forEach","key","exports","defineProperty","enumerable","get"],"sources":["index.ts"],"sourcesContent":["export * from '@teambit/node.deps-detectors.detective-es6';\n"],"mappings":";;;;;AAAA,IAAAA,kBAAA,GAAAC,OAAA;AAAAC,MAAA,CAAAC,IAAA,CAAAH,kBAAA,EAAAI,OAAA,WAAAC,GAAA;EAAA,IAAAA,GAAA,kBAAAA,GAAA;EAAA,IAAAA,GAAA,IAAAC,OAAA,IAAAA,OAAA,CAAAD,GAAA,MAAAL,kBAAA,CAAAK,GAAA;EAAAH,MAAA,CAAAK,cAAA,CAAAD,OAAA,EAAAD,GAAA;IAAAG,UAAA;IAAAC,GAAA,WAAAA,CAAA;MAAA,OAAAT,kBAAA,CAAAK,GAAA;IAAA;EAAA;AAAA","ignoreList":[]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from '@teambit/styling.deps-detectors.detective-less';
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
var _stylingDepsDetectors = require("@teambit/styling.deps-detectors.detective-less");
|
|
7
|
+
Object.keys(_stylingDepsDetectors).forEach(function (key) {
|
|
8
|
+
if (key === "default" || key === "__esModule") return;
|
|
9
|
+
if (key in exports && exports[key] === _stylingDepsDetectors[key]) return;
|
|
10
|
+
Object.defineProperty(exports, key, {
|
|
11
|
+
enumerable: true,
|
|
12
|
+
get: function () {
|
|
13
|
+
return _stylingDepsDetectors[key];
|
|
14
|
+
}
|
|
15
|
+
});
|
|
16
|
+
});
|
|
17
|
+
|
|
18
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["_stylingDepsDetectors","require","Object","keys","forEach","key","exports","defineProperty","enumerable","get"],"sources":["index.ts"],"sourcesContent":["export * from '@teambit/styling.deps-detectors.detective-less';\n"],"mappings":";;;;;AAAA,IAAAA,qBAAA,GAAAC,OAAA;AAAAC,MAAA,CAAAC,IAAA,CAAAH,qBAAA,EAAAI,OAAA,WAAAC,GAAA;EAAA,IAAAA,GAAA,kBAAAA,GAAA;EAAA,IAAAA,GAAA,IAAAC,OAAA,IAAAA,OAAA,CAAAD,GAAA,MAAAL,qBAAA,CAAAK,GAAA;EAAAH,MAAA,CAAAK,cAAA,CAAAD,OAAA,EAAAD,GAAA;IAAAG,UAAA;IAAAC,GAAA,WAAAA,CAAA;MAAA,OAAAT,qBAAA,CAAAK,GAAA;IAAA;EAAA;AAAA","ignoreList":[]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from '@teambit/styling.deps-detectors.detective-sass';
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
var _stylingDepsDetectors = require("@teambit/styling.deps-detectors.detective-sass");
|
|
7
|
+
Object.keys(_stylingDepsDetectors).forEach(function (key) {
|
|
8
|
+
if (key === "default" || key === "__esModule") return;
|
|
9
|
+
if (key in exports && exports[key] === _stylingDepsDetectors[key]) return;
|
|
10
|
+
Object.defineProperty(exports, key, {
|
|
11
|
+
enumerable: true,
|
|
12
|
+
get: function () {
|
|
13
|
+
return _stylingDepsDetectors[key];
|
|
14
|
+
}
|
|
15
|
+
});
|
|
16
|
+
});
|
|
17
|
+
|
|
18
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["_stylingDepsDetectors","require","Object","keys","forEach","key","exports","defineProperty","enumerable","get"],"sources":["index.ts"],"sourcesContent":["export * from '@teambit/styling.deps-detectors.detective-sass';\n"],"mappings":";;;;;AAAA,IAAAA,qBAAA,GAAAC,OAAA;AAAAC,MAAA,CAAAC,IAAA,CAAAH,qBAAA,EAAAI,OAAA,WAAAC,GAAA;EAAA,IAAAA,GAAA,kBAAAA,GAAA;EAAA,IAAAA,GAAA,IAAAC,OAAA,IAAAA,OAAA,CAAAD,GAAA,MAAAL,qBAAA,CAAAK,GAAA;EAAAH,MAAA,CAAAK,cAAA,CAAAD,OAAA,EAAAD,GAAA;IAAAG,UAAA;IAAAC,GAAA,WAAAA,CAAA;MAAA,OAAAT,qBAAA,CAAAK,GAAA;IAAA;EAAA;AAAA","ignoreList":[]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from '@teambit/styling.deps-detectors.detective-scss';
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
var _stylingDepsDetectors = require("@teambit/styling.deps-detectors.detective-scss");
|
|
7
|
+
Object.keys(_stylingDepsDetectors).forEach(function (key) {
|
|
8
|
+
if (key === "default" || key === "__esModule") return;
|
|
9
|
+
if (key in exports && exports[key] === _stylingDepsDetectors[key]) return;
|
|
10
|
+
Object.defineProperty(exports, key, {
|
|
11
|
+
enumerable: true,
|
|
12
|
+
get: function () {
|
|
13
|
+
return _stylingDepsDetectors[key];
|
|
14
|
+
}
|
|
15
|
+
});
|
|
16
|
+
});
|
|
17
|
+
|
|
18
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["_stylingDepsDetectors","require","Object","keys","forEach","key","exports","defineProperty","enumerable","get"],"sources":["index.ts"],"sourcesContent":["export * from '@teambit/styling.deps-detectors.detective-scss';\n"],"mappings":";;;;;AAAA,IAAAA,qBAAA,GAAAC,OAAA;AAAAC,MAAA,CAAAC,IAAA,CAAAH,qBAAA,EAAAI,OAAA,WAAAC,GAAA;EAAA,IAAAA,GAAA,kBAAAA,GAAA;EAAA,IAAAA,GAAA,IAAAC,OAAA,IAAAA,OAAA,CAAAD,GAAA,MAAAL,qBAAA,CAAAK,GAAA;EAAAH,MAAA,CAAAK,cAAA,CAAAD,OAAA,EAAAD,GAAA;IAAAG,UAAA;IAAAC,GAAA,WAAAA,CAAA;MAAA,OAAAT,qBAAA,CAAAK,GAAA;IAAA;EAAA;AAAA","ignoreList":[]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from '@teambit/typescript.deps-detectors.detective-typescript';
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
var _typescriptDepsDetectors = require("@teambit/typescript.deps-detectors.detective-typescript");
|
|
7
|
+
Object.keys(_typescriptDepsDetectors).forEach(function (key) {
|
|
8
|
+
if (key === "default" || key === "__esModule") return;
|
|
9
|
+
if (key in exports && exports[key] === _typescriptDepsDetectors[key]) return;
|
|
10
|
+
Object.defineProperty(exports, key, {
|
|
11
|
+
enumerable: true,
|
|
12
|
+
get: function () {
|
|
13
|
+
return _typescriptDepsDetectors[key];
|
|
14
|
+
}
|
|
15
|
+
});
|
|
16
|
+
});
|
|
17
|
+
|
|
18
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["_typescriptDepsDetectors","require","Object","keys","forEach","key","exports","defineProperty","enumerable","get"],"sources":["index.ts"],"sourcesContent":["export * from '@teambit/typescript.deps-detectors.detective-typescript';\n"],"mappings":";;;;;AAAA,IAAAA,wBAAA,GAAAC,OAAA;AAAAC,MAAA,CAAAC,IAAA,CAAAH,wBAAA,EAAAI,OAAA,WAAAC,GAAA;EAAA,IAAAA,GAAA,kBAAAA,GAAA;EAAA,IAAAA,GAAA,IAAAC,OAAA,IAAAA,OAAA,CAAAD,GAAA,MAAAL,wBAAA,CAAAK,GAAA;EAAAH,MAAA,CAAAK,cAAA,CAAAD,OAAA,EAAAD,GAAA;IAAAG,UAAA;IAAAC,GAAA,WAAAA,CAAA;MAAA,OAAAT,wBAAA,CAAAK,GAAA;IAAA;EAAA;AAAA","ignoreList":[]}
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
export type FileContext = {
|
|
2
|
+
/**
|
|
3
|
+
* extension of the file. (e.g. `.js`, '.jsx', '.ts', etc.)
|
|
4
|
+
*/
|
|
5
|
+
ext: string;
|
|
6
|
+
};
|
|
7
|
+
export type DependencyContext = {
|
|
8
|
+
/**
|
|
9
|
+
* name of the dependency.
|
|
10
|
+
* e.g. `lodash` in `import _ from 'lodash'`
|
|
11
|
+
*/
|
|
12
|
+
dependency: string;
|
|
13
|
+
/**
|
|
14
|
+
* name of the file.
|
|
15
|
+
*/
|
|
16
|
+
filename: string;
|
|
17
|
+
/**
|
|
18
|
+
* directory of the file.
|
|
19
|
+
*/
|
|
20
|
+
directory: string;
|
|
21
|
+
};
|
|
22
|
+
export interface DependencyDetector {
|
|
23
|
+
/**
|
|
24
|
+
* determine whether to apply on given file.
|
|
25
|
+
*/
|
|
26
|
+
isSupported(context: FileContext): boolean;
|
|
27
|
+
/**
|
|
28
|
+
* determine what type of content the detector is for.
|
|
29
|
+
* by default, the type is the extension name of the file (without the dot)
|
|
30
|
+
* if no type provided.
|
|
31
|
+
*/
|
|
32
|
+
type?: string;
|
|
33
|
+
/**
|
|
34
|
+
* detect file dependencies. list of file dependencies of the module.
|
|
35
|
+
*/
|
|
36
|
+
detect(fileContent: string): string[];
|
|
37
|
+
/**
|
|
38
|
+
* resolve the imported file location
|
|
39
|
+
* @param file
|
|
40
|
+
*/
|
|
41
|
+
dependencyLookup?(file: DependencyContext): string;
|
|
42
|
+
}
|
|
43
|
+
export declare class DetectorHook {
|
|
44
|
+
static hooks: DependencyDetector[];
|
|
45
|
+
isSupported(ext: string): boolean;
|
|
46
|
+
getDetector(ext: string): DependencyDetector | undefined;
|
|
47
|
+
}
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.DetectorHook = void 0;
|
|
7
|
+
function _defineProperty(e, r, t) { return (r = _toPropertyKey(r)) in e ? Object.defineProperty(e, r, { value: t, enumerable: !0, configurable: !0, writable: !0 }) : e[r] = t, e; }
|
|
8
|
+
function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == typeof i ? i : i + ""; }
|
|
9
|
+
function _toPrimitive(t, r) { if ("object" != typeof t || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != typeof i) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
|
|
10
|
+
class DetectorHook {
|
|
11
|
+
isSupported(ext) {
|
|
12
|
+
return !!DetectorHook.hooks.find(hook => {
|
|
13
|
+
return hook.isSupported({
|
|
14
|
+
ext
|
|
15
|
+
});
|
|
16
|
+
});
|
|
17
|
+
}
|
|
18
|
+
getDetector(ext) {
|
|
19
|
+
return DetectorHook.hooks.find(hook => {
|
|
20
|
+
return hook.isSupported({
|
|
21
|
+
ext
|
|
22
|
+
});
|
|
23
|
+
});
|
|
24
|
+
}
|
|
25
|
+
}
|
|
26
|
+
exports.DetectorHook = DetectorHook;
|
|
27
|
+
_defineProperty(DetectorHook, "hooks", []);
|
|
28
|
+
|
|
29
|
+
//# sourceMappingURL=detector-hook.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["DetectorHook","isSupported","ext","hooks","find","hook","getDetector","exports","_defineProperty"],"sources":["detector-hook.ts"],"sourcesContent":["export type FileContext = {\n /**\n * extension of the file. (e.g. `.js`, '.jsx', '.ts', etc.)\n */\n ext: string;\n};\n\nexport type DependencyContext = {\n /**\n * name of the dependency.\n * e.g. `lodash` in `import _ from 'lodash'`\n */\n dependency: string;\n\n /**\n * name of the file.\n */\n filename: string;\n\n /**\n * directory of the file.\n */\n directory: string;\n};\n\nexport interface DependencyDetector {\n /**\n * determine whether to apply on given file.\n */\n isSupported(context: FileContext): boolean;\n\n /**\n * determine what type of content the detector is for.\n * by default, the type is the extension name of the file (without the dot)\n * if no type provided.\n */\n type?: string;\n\n /**\n * detect file dependencies. list of file dependencies of the module.\n */\n detect(fileContent: string): string[];\n\n /**\n * resolve the imported file location\n * @param file\n */\n dependencyLookup?(file: DependencyContext): string;\n}\n\nexport class DetectorHook {\n static hooks: DependencyDetector[] = [];\n\n isSupported(ext: string): boolean {\n return !!DetectorHook.hooks.find((hook) => {\n return hook.isSupported({\n ext,\n });\n });\n }\n\n getDetector(ext: string): DependencyDetector | undefined {\n return DetectorHook.hooks.find((hook) => {\n return hook.isSupported({\n ext,\n });\n });\n }\n}\n"],"mappings":";;;;;;;;;AAkDO,MAAMA,YAAY,CAAC;EAGxBC,WAAWA,CAACC,GAAW,EAAW;IAChC,OAAO,CAAC,CAACF,YAAY,CAACG,KAAK,CAACC,IAAI,CAAEC,IAAI,IAAK;MACzC,OAAOA,IAAI,CAACJ,WAAW,CAAC;QACtBC;MACF,CAAC,CAAC;IACJ,CAAC,CAAC;EACJ;EAEAI,WAAWA,CAACJ,GAAW,EAAkC;IACvD,OAAOF,YAAY,CAACG,KAAK,CAACC,IAAI,CAAEC,IAAI,IAAK;MACvC,OAAOA,IAAI,CAACJ,WAAW,CAAC;QACtBC;MACF,CAAC,CAAC;IACJ,CAAC,CAAC;EACJ;AACF;AAACK,OAAA,CAAAP,YAAA,GAAAA,YAAA;AAAAQ,eAAA,CAlBYR,YAAY,WACc,EAAE","ignoreList":[]}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { DependencyDetector } from '../detector-hook';
|
|
2
|
+
type Options = {
|
|
3
|
+
dependency: string;
|
|
4
|
+
filename: string;
|
|
5
|
+
directory: string;
|
|
6
|
+
config: Record<string, any>;
|
|
7
|
+
webpackConfig?: Record<string, any>;
|
|
8
|
+
configPath?: string;
|
|
9
|
+
resolveConfig?: Record<string, any>;
|
|
10
|
+
isScript?: boolean;
|
|
11
|
+
ast?: string;
|
|
12
|
+
ext?: string;
|
|
13
|
+
content?: string;
|
|
14
|
+
envDetectors?: DependencyDetector[];
|
|
15
|
+
};
|
|
16
|
+
export default function cabinet(options: Options): any;
|
|
17
|
+
export {};
|
|
@@ -0,0 +1,140 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.default = cabinet;
|
|
7
|
+
function _path() {
|
|
8
|
+
const data = _interopRequireDefault(require("path"));
|
|
9
|
+
_path = function () {
|
|
10
|
+
return data;
|
|
11
|
+
};
|
|
12
|
+
return data;
|
|
13
|
+
}
|
|
14
|
+
function _resolveDependencyPath() {
|
|
15
|
+
const data = _interopRequireDefault(require("resolve-dependency-path"));
|
|
16
|
+
_resolveDependencyPath = function () {
|
|
17
|
+
return data;
|
|
18
|
+
};
|
|
19
|
+
return data;
|
|
20
|
+
}
|
|
21
|
+
function _stylusLookup() {
|
|
22
|
+
const data = _interopRequireDefault(require("stylus-lookup"));
|
|
23
|
+
_stylusLookup = function () {
|
|
24
|
+
return data;
|
|
25
|
+
};
|
|
26
|
+
return data;
|
|
27
|
+
}
|
|
28
|
+
function _typescriptDepsLookups() {
|
|
29
|
+
const data = require("@teambit/typescript.deps-lookups.lookup-typescript");
|
|
30
|
+
_typescriptDepsLookups = function () {
|
|
31
|
+
return data;
|
|
32
|
+
};
|
|
33
|
+
return data;
|
|
34
|
+
}
|
|
35
|
+
function _stylingDepsLookups() {
|
|
36
|
+
const data = require("@teambit/styling.deps-lookups.lookup-styling");
|
|
37
|
+
_stylingDepsLookups = function () {
|
|
38
|
+
return data;
|
|
39
|
+
};
|
|
40
|
+
return data;
|
|
41
|
+
}
|
|
42
|
+
function _detectorHook() {
|
|
43
|
+
const data = require("../detector-hook");
|
|
44
|
+
_detectorHook = function () {
|
|
45
|
+
return data;
|
|
46
|
+
};
|
|
47
|
+
return data;
|
|
48
|
+
}
|
|
49
|
+
function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
|
|
50
|
+
// @flow
|
|
51
|
+
|
|
52
|
+
/**
|
|
53
|
+
* this file had been forked from https://github.com/dependents/node-filing-cabinet
|
|
54
|
+
*/
|
|
55
|
+
|
|
56
|
+
const debug = require('debug')('cabinet');
|
|
57
|
+
const defaultLookups = {
|
|
58
|
+
'.js': _typescriptDepsLookups().lookupJavaScript,
|
|
59
|
+
'.cjs': _typescriptDepsLookups().lookupJavaScript,
|
|
60
|
+
'.mjs': _typescriptDepsLookups().lookupJavaScript,
|
|
61
|
+
'.jsx': _typescriptDepsLookups().lookupJavaScript,
|
|
62
|
+
'.ts': _typescriptDepsLookups().lookupTypeScript,
|
|
63
|
+
'.tsx': _typescriptDepsLookups().lookupTypeScript,
|
|
64
|
+
'.cts': _typescriptDepsLookups().lookupTypeScript,
|
|
65
|
+
'.mts': _typescriptDepsLookups().lookupTypeScript,
|
|
66
|
+
'.scss': _stylingDepsLookups().lookupStyling,
|
|
67
|
+
'.sass': _stylingDepsLookups().lookupStyling,
|
|
68
|
+
'.styl': _stylusLookup().default,
|
|
69
|
+
'.less': _stylingDepsLookups().lookupStyling
|
|
70
|
+
};
|
|
71
|
+
function cabinet(options) {
|
|
72
|
+
const detectorHook = new (_detectorHook().DetectorHook)();
|
|
73
|
+
const {
|
|
74
|
+
dependency,
|
|
75
|
+
filename
|
|
76
|
+
} = options;
|
|
77
|
+
const ext = options.ext || _path().default.extname(filename);
|
|
78
|
+
debug(`working on a dependency "${dependency}" of a file "${filename}"`);
|
|
79
|
+
let resolver = defaultLookups[ext];
|
|
80
|
+
if (!resolver) {
|
|
81
|
+
debug('using generic resolver');
|
|
82
|
+
resolver = _resolveDependencyPath().default;
|
|
83
|
+
}
|
|
84
|
+
if (ext === '.css' && dependency.startsWith('~')) resolver = _stylingDepsLookups().lookupStyling;
|
|
85
|
+
const detector = detectorHook.getDetector(ext);
|
|
86
|
+
if (detector) {
|
|
87
|
+
// test if the new detector API has a dependency lookup.
|
|
88
|
+
if (detector.dependencyLookup) {
|
|
89
|
+
resolver = detector.dependencyLookup;
|
|
90
|
+
} else {
|
|
91
|
+
// otherwise use TypeScript as the default resolver.
|
|
92
|
+
resolver = _typescriptDepsLookups().lookupTypeScript;
|
|
93
|
+
}
|
|
94
|
+
}
|
|
95
|
+
if (options?.envDetectors) {
|
|
96
|
+
for (const envDetector of options.envDetectors) {
|
|
97
|
+
if (envDetector.isSupported({
|
|
98
|
+
ext
|
|
99
|
+
}) && envDetector.dependencyLookup) {
|
|
100
|
+
resolver = envDetector.dependencyLookup;
|
|
101
|
+
}
|
|
102
|
+
}
|
|
103
|
+
}
|
|
104
|
+
debug(`found a resolver ${resolver.name} for ${ext}`);
|
|
105
|
+
let result = resolver(options);
|
|
106
|
+
const dependencyExt = _path().default.extname(dependency);
|
|
107
|
+
if (!result && dependencyExt && dependencyExt !== ext) {
|
|
108
|
+
resolver = defaultLookups[dependencyExt];
|
|
109
|
+
if (resolver) {
|
|
110
|
+
// todo: this strategy probably fails often. if, for example, a dependency A.js inside B.ts
|
|
111
|
+
// was not found using the ts resolve, it tries the js resolver, however, parsing the ts file
|
|
112
|
+
// with js parser, won't work most of the time. A better approach would be to fix the
|
|
113
|
+
// original resolver.
|
|
114
|
+
debug(`dependency has a different extension (${dependencyExt}) than the original file (${ext}), trying to use its resolver instead`);
|
|
115
|
+
try {
|
|
116
|
+
result = resolver(options);
|
|
117
|
+
} catch (err) {
|
|
118
|
+
debug(`unable to use the resolver of ${dependencyExt} for ${filename}. got an error ${err.message}`);
|
|
119
|
+
}
|
|
120
|
+
}
|
|
121
|
+
}
|
|
122
|
+
debug(`resolved path for ${dependency}: ${result}`);
|
|
123
|
+
return result;
|
|
124
|
+
}
|
|
125
|
+
module.exports.supportedFileExtensions = Object.keys(defaultLookups);
|
|
126
|
+
|
|
127
|
+
/**
|
|
128
|
+
* Register a custom lookup resolver for a file extension
|
|
129
|
+
*
|
|
130
|
+
* @param {String} extension - The file extension that should use the resolver
|
|
131
|
+
* @param {Function} lookupStrategy - A resolver of dependency paths
|
|
132
|
+
*/
|
|
133
|
+
module.exports.register = function (extension, lookupStrategy) {
|
|
134
|
+
defaultLookups[extension] = lookupStrategy;
|
|
135
|
+
if (this.supportedFileExtensions.indexOf(extension) === -1) {
|
|
136
|
+
this.supportedFileExtensions.push(extension);
|
|
137
|
+
}
|
|
138
|
+
};
|
|
139
|
+
|
|
140
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["_path","data","_interopRequireDefault","require","_resolveDependencyPath","_stylusLookup","_typescriptDepsLookups","_stylingDepsLookups","_detectorHook","e","__esModule","default","debug","defaultLookups","lookupJavaScript","lookupTypeScript","lookupStyling","stylusLookup","cabinet","options","detectorHook","DetectorHook","dependency","filename","ext","path","extname","resolver","resolveDependencyPath","startsWith","detector","getDetector","dependencyLookup","envDetectors","envDetector","isSupported","name","result","dependencyExt","err","message","module","exports","supportedFileExtensions","Object","keys","register","extension","lookupStrategy","indexOf","push"],"sources":["index.ts"],"sourcesContent":["// @flow\n\n/**\n * this file had been forked from https://github.com/dependents/node-filing-cabinet\n */\nimport path from 'path';\nimport resolveDependencyPath from 'resolve-dependency-path';\nimport stylusLookup from 'stylus-lookup';\n\nimport { lookupJavaScript, lookupTypeScript } from '@teambit/typescript.deps-lookups.lookup-typescript';\nimport { lookupStyling } from '@teambit/styling.deps-lookups.lookup-styling';\n\nimport { DependencyDetector, DetectorHook } from '../detector-hook';\n\nconst debug = require('debug')('cabinet');\n\nconst defaultLookups = {\n '.js': lookupJavaScript,\n '.cjs': lookupJavaScript,\n '.mjs': lookupJavaScript,\n '.jsx': lookupJavaScript,\n '.ts': lookupTypeScript,\n '.tsx': lookupTypeScript,\n '.cts': lookupTypeScript,\n '.mts': lookupTypeScript,\n '.scss': lookupStyling,\n '.sass': lookupStyling,\n '.styl': stylusLookup,\n '.less': lookupStyling,\n};\n\ntype Options = {\n dependency: string; // previous name was \"partial\"\n filename: string;\n directory: string;\n config: Record<string, any>;\n webpackConfig?: Record<string, any>;\n configPath?: string;\n resolveConfig?: Record<string, any>;\n isScript?: boolean; // relevant for Vue files\n ast?: string;\n ext?: string;\n content?: string;\n envDetectors?: DependencyDetector[];\n};\n\nexport default function cabinet(options: Options) {\n const detectorHook = new DetectorHook();\n const { dependency, filename } = options;\n const ext = options.ext || path.extname(filename);\n debug(`working on a dependency \"${dependency}\" of a file \"${filename}\"`);\n\n let resolver = defaultLookups[ext];\n\n if (!resolver) {\n debug('using generic resolver');\n resolver = resolveDependencyPath;\n }\n if (ext === '.css' && dependency.startsWith('~')) resolver = lookupStyling;\n\n const detector = detectorHook.getDetector(ext);\n if (detector) {\n // test if the new detector API has a dependency lookup.\n if (detector.dependencyLookup) {\n resolver = detector.dependencyLookup;\n } else {\n // otherwise use TypeScript as the default resolver.\n resolver = lookupTypeScript;\n }\n }\n\n if (options?.envDetectors) {\n for (const envDetector of options.envDetectors) {\n if (envDetector.isSupported({ ext }) && envDetector.dependencyLookup) {\n resolver = envDetector.dependencyLookup;\n }\n }\n }\n\n debug(`found a resolver ${resolver.name} for ${ext}`);\n\n let result = resolver(options);\n const dependencyExt = path.extname(dependency);\n if (!result && dependencyExt && dependencyExt !== ext) {\n resolver = defaultLookups[dependencyExt];\n if (resolver) {\n // todo: this strategy probably fails often. if, for example, a dependency A.js inside B.ts\n // was not found using the ts resolve, it tries the js resolver, however, parsing the ts file\n // with js parser, won't work most of the time. A better approach would be to fix the\n // original resolver.\n debug(\n `dependency has a different extension (${dependencyExt}) than the original file (${ext}), trying to use its resolver instead`\n );\n try {\n result = resolver(options);\n } catch (err: any) {\n debug(`unable to use the resolver of ${dependencyExt} for ${filename}. got an error ${err.message}`);\n }\n }\n }\n debug(`resolved path for ${dependency}: ${result}`);\n return result;\n}\n\nmodule.exports.supportedFileExtensions = Object.keys(defaultLookups);\n\n/**\n * Register a custom lookup resolver for a file extension\n *\n * @param {String} extension - The file extension that should use the resolver\n * @param {Function} lookupStrategy - A resolver of dependency paths\n */\nmodule.exports.register = function (extension, lookupStrategy) {\n defaultLookups[extension] = lookupStrategy;\n\n if (this.supportedFileExtensions.indexOf(extension) === -1) {\n this.supportedFile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