@teambit/dependencies 1.0.409 → 1.0.411
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 +114 -114
- package/artifacts/schema.json +6 -1
- package/dist/dependents-cmd.d.ts +5 -0
- package/dist/dependents-cmd.js +16 -1
- package/dist/dependents-cmd.js.map +1 -1
- package/dist/files-dependency-builder/precinct/index.js.map +1 -1
- package/files-dependency-builder/precinct/index.ts +1 -1
- package/package.json +21 -21
- /package/dist/{preview-1726584693847.js → preview-1726715976656.js} +0 -0
|
@@ -1,18 +1,18 @@
|
|
|
1
1
|
<?xml version="1.0" encoding="UTF-8"?>
|
|
2
2
|
<testsuites tests="169" failures="0" errors="0" skipped="33">
|
|
3
|
-
<testsuite name="teambit.dependencies/dependencies@1.0.
|
|
4
|
-
<testcase classname="dist/dependencies.spec.js" name="should add the snap prefix" time="0.
|
|
5
|
-
<testcase classname="dist/dependencies-loader/package-to-definetly-typed.spec.js" name="should map to @types/testing-library__jest-dom" time="0.
|
|
3
|
+
<testsuite name="teambit.dependencies/dependencies@1.0.411" tests="169" failures="0" errors="0" skipped="33">
|
|
4
|
+
<testcase classname="dist/dependencies.spec.js" name="should add the snap prefix" time="0.001"/>
|
|
5
|
+
<testcase classname="dist/dependencies-loader/package-to-definetly-typed.spec.js" name="should map to @types/testing-library__jest-dom" time="0.001"/>
|
|
6
6
|
<testcase classname="dist/dependencies-loader/package-to-definetly-typed.spec.js" name="should map to @types/chai"/>
|
|
7
7
|
<testcase classname="dist/dependencies-loader/package-to-definetly-typed.spec.js" name="should map to @types/mocha"/>
|
|
8
|
-
<testcase classname="dist/dependencies-loader/package-to-definetly-typed.spec.js" name="should map to @types/classnames"
|
|
8
|
+
<testcase classname="dist/dependencies-loader/package-to-definetly-typed.spec.js" name="should map to @types/classnames"/>
|
|
9
9
|
<testcase classname="dist/dependencies-loader/package-to-definetly-typed.spec.js" name="should map to @types/cors"/>
|
|
10
|
-
<testcase classname="dist/dependencies-loader/package-to-definetly-typed.spec.js" name="should map to @types/cross-spawn"/>
|
|
10
|
+
<testcase classname="dist/dependencies-loader/package-to-definetly-typed.spec.js" name="should map to @types/cross-spawn" time="0.001"/>
|
|
11
11
|
<testcase classname="dist/dependencies-loader/package-to-definetly-typed.spec.js" name="should map to @types/didyoumean"/>
|
|
12
12
|
<testcase classname="dist/dependencies-loader/package-to-definetly-typed.spec.js" name="should map to @types/eslint"/>
|
|
13
13
|
<testcase classname="dist/dependencies-loader/package-to-definetly-typed.spec.js" name="should map to @types/express"/>
|
|
14
14
|
<testcase classname="dist/dependencies-loader/package-to-definetly-typed.spec.js" name="should map to @types/find-cache-dir"/>
|
|
15
|
-
<testcase classname="dist/dependencies-loader/package-to-definetly-typed.spec.js" name="should map to @types/find-root"
|
|
15
|
+
<testcase classname="dist/dependencies-loader/package-to-definetly-typed.spec.js" name="should map to @types/find-root"/>
|
|
16
16
|
<testcase classname="dist/dependencies-loader/package-to-definetly-typed.spec.js" name="should map to @types/history"/>
|
|
17
17
|
<testcase classname="dist/dependencies-loader/package-to-definetly-typed.spec.js" name="should map to @types/http-proxy-agent"/>
|
|
18
18
|
<testcase classname="dist/dependencies-loader/package-to-definetly-typed.spec.js" name="should map to @types/lodash"/>
|
|
@@ -21,7 +21,7 @@
|
|
|
21
21
|
<testcase classname="dist/dependencies-loader/package-to-definetly-typed.spec.js" name="should map to @types/lodash.head"/>
|
|
22
22
|
<testcase classname="dist/dependencies-loader/package-to-definetly-typed.spec.js" name="should map to @types/lodash.pick"/>
|
|
23
23
|
<testcase classname="dist/dependencies-loader/package-to-definetly-typed.spec.js" name="should map to @types/mdx-js__react"/>
|
|
24
|
-
<testcase classname="dist/dependencies-loader/package-to-definetly-typed.spec.js" name="should map to @types/memoizee"
|
|
24
|
+
<testcase classname="dist/dependencies-loader/package-to-definetly-typed.spec.js" name="should map to @types/memoizee"/>
|
|
25
25
|
<testcase classname="dist/dependencies-loader/package-to-definetly-typed.spec.js" name="should map to @types/mime"/>
|
|
26
26
|
<testcase classname="dist/dependencies-loader/package-to-definetly-typed.spec.js" name="should map to @types/mousetrap"/>
|
|
27
27
|
<testcase classname="dist/dependencies-loader/package-to-definetly-typed.spec.js" name="should map to @types/node"/>
|
|
@@ -32,7 +32,7 @@
|
|
|
32
32
|
<testcase classname="dist/dependencies-loader/package-to-definetly-typed.spec.js" name="should map to @types/react-tabs"/>
|
|
33
33
|
<testcase classname="dist/dependencies-loader/package-to-definetly-typed.spec.js" name="should map to @types/react-tooltip"/>
|
|
34
34
|
<testcase classname="dist/dependencies-loader/package-to-definetly-typed.spec.js" name="should map to @types/socket.io-client"/>
|
|
35
|
-
<testcase classname="dist/dependencies-loader/package-to-definetly-typed.spec.js" name="should map to @types/ua-parser-js"
|
|
35
|
+
<testcase classname="dist/dependencies-loader/package-to-definetly-typed.spec.js" name="should map to @types/ua-parser-js"/>
|
|
36
36
|
<testcase classname="dist/dependencies-loader/package-to-definetly-typed.spec.js" name="should map to @types/url-join"/>
|
|
37
37
|
<testcase classname="dist/dependencies-loader/package-to-definetly-typed.spec.js" name="should map to @types/url-parse"/>
|
|
38
38
|
<testcase classname="dist/dependencies-loader/package-to-definetly-typed.spec.js" name="should map to @types/webpack"/>
|
|
@@ -40,7 +40,7 @@
|
|
|
40
40
|
<testcase classname="dist/dependencies-loader/package-to-definetly-typed.spec.js" name="should map to @types/webpack-merge"/>
|
|
41
41
|
<testcase classname="dist/files-dependency-builder/build-tree.spec.js" name="when no files are passed should return an empty tree" time="0.001"/>
|
|
42
42
|
<testcase classname="dist/files-dependency-builder/build-tree.spec.js" name="when unsupported files are passed should return them with no dependencies" time="0.001"/>
|
|
43
|
-
<testcase classname="dist/files-dependency-builder/build-tree.spec.js" name="when supported and unsupported files are passed should return them all" time="0.
|
|
43
|
+
<testcase classname="dist/files-dependency-builder/build-tree.spec.js" name="when supported and unsupported files are passed should return them all" time="0.084"/>
|
|
44
44
|
<testcase classname="dist/files-dependency-builder/build-tree.spec.js" name="when a js file has parsing error it should add the file to the tree with the error instance">
|
|
45
45
|
<skipped/>
|
|
46
46
|
</testcase>
|
|
@@ -62,64 +62,143 @@
|
|
|
62
62
|
<testcase classname="dist/files-dependency-builder/build-tree.spec.js" name="it should add the missing package to the missing section in the tree">
|
|
63
63
|
<skipped/>
|
|
64
64
|
</testcase>
|
|
65
|
-
<testcase classname="dist/files-dependency-builder/build-tree.spec.js" name="should not throw an error and should remove itself from the dependencies files"/>
|
|
65
|
+
<testcase classname="dist/files-dependency-builder/build-tree.spec.js" name="should not throw an error and should remove itself from the dependencies files" time="0.001"/>
|
|
66
66
|
<testcase classname="dist/files-dependency-builder/build-tree.spec.js" name="should not recognize the cycle dependencies as link files">
|
|
67
67
|
<skipped/>
|
|
68
68
|
</testcase>
|
|
69
|
+
<testcase classname="dist/files-dependency-builder/filing-cabinet/index.spec.js" name="uses a generic resolve for unsupported file extensions" time="0.002"/>
|
|
70
|
+
<testcase classname="dist/files-dependency-builder/filing-cabinet/index.spec.js" name="reuses the ast when trying to determine the module type"/>
|
|
71
|
+
<testcase classname="dist/files-dependency-builder/filing-cabinet/index.spec.js" name="resolves the dependency successfully"/>
|
|
72
|
+
<testcase classname="dist/files-dependency-builder/filing-cabinet/index.spec.js" name="uses the filename to look for the module type" time="0.001"/>
|
|
73
|
+
<testcase classname="dist/files-dependency-builder/filing-cabinet/index.spec.js" name="assumes commonjs for es6 modules with no requirejs/webpack config">
|
|
74
|
+
<skipped/>
|
|
75
|
+
</testcase>
|
|
76
|
+
<testcase classname="dist/files-dependency-builder/filing-cabinet/index.spec.js" name="resolves files with the .jsx extension" time="0.004"/>
|
|
77
|
+
<testcase classname="dist/files-dependency-builder/filing-cabinet/index.spec.js" name="uses require's resolver">
|
|
78
|
+
<skipped/>
|
|
79
|
+
</testcase>
|
|
80
|
+
<testcase classname="dist/files-dependency-builder/filing-cabinet/index.spec.js" name="returns an empty string for an unresolved module" time="0.001"/>
|
|
81
|
+
<testcase classname="dist/files-dependency-builder/filing-cabinet/index.spec.js" name="adds the directory to the require resolution paths" time="0.001"/>
|
|
82
|
+
<testcase classname="dist/files-dependency-builder/filing-cabinet/index.spec.js" name="resolves a relative dependency about the filename" time="0.001"/>
|
|
83
|
+
<testcase classname="dist/files-dependency-builder/filing-cabinet/index.spec.js" name="resolves a .. dependency to its parent directory's index.js file" time="0.001"/>
|
|
84
|
+
<testcase classname="dist/files-dependency-builder/filing-cabinet/index.spec.js" name="resolves a dependency within a directory outside of the given file">
|
|
85
|
+
<skipped/>
|
|
86
|
+
</testcase>
|
|
87
|
+
<testcase classname="dist/files-dependency-builder/filing-cabinet/index.spec.js" name="resolves a node module with module entry in package.json">
|
|
88
|
+
<skipped/>
|
|
89
|
+
</testcase>
|
|
90
|
+
<testcase classname="dist/files-dependency-builder/filing-cabinet/index.spec.js" name="resolves a nested module" time="0.001"/>
|
|
91
|
+
<testcase classname="dist/files-dependency-builder/filing-cabinet/index.spec.js" name="resolves to the index.js file of a directory" time="0.001"/>
|
|
92
|
+
<testcase classname="dist/files-dependency-builder/filing-cabinet/index.spec.js" name="resolves implicit .jsx requires"/>
|
|
93
|
+
<testcase classname="dist/files-dependency-builder/filing-cabinet/index.spec.js" name="resolves implicit .scss requires"/>
|
|
94
|
+
<testcase classname="dist/files-dependency-builder/filing-cabinet/index.spec.js" name="resolves implicit .json requires"/>
|
|
95
|
+
<testcase classname="dist/files-dependency-builder/filing-cabinet/index.spec.js" name="resolves an import" time="0.001"/>
|
|
96
|
+
<testcase classname="dist/files-dependency-builder/filing-cabinet/index.spec.js" name="returns an empty result" time="0.001"/>
|
|
97
|
+
<testcase classname="dist/files-dependency-builder/filing-cabinet/index.spec.js" name="uses the sass resolver for .scss files"/>
|
|
98
|
+
<testcase classname="dist/files-dependency-builder/filing-cabinet/index.spec.js" name="uses the sass resolver for .sass files" time="0.001"/>
|
|
99
|
+
<testcase classname="dist/files-dependency-builder/filing-cabinet/index.spec.js" name="uses the stylus resolver"/>
|
|
100
|
+
<testcase classname="dist/files-dependency-builder/filing-cabinet/index.spec.js" name="resolves extensionless dependencies"/>
|
|
101
|
+
<testcase classname="dist/files-dependency-builder/filing-cabinet/index.spec.js" name="resolves dependencies with a less extension" time="0.001"/>
|
|
102
|
+
<testcase classname="dist/files-dependency-builder/filing-cabinet/index.spec.js" name="resolves dependencies with a css extension"/>
|
|
103
|
+
<testcase classname="dist/files-dependency-builder/filing-cabinet/index.spec.js" name="uses a generic resolve for unsupported file extensions"/>
|
|
104
|
+
<testcase classname="dist/files-dependency-builder/filing-cabinet/index.spec.js" name="supports passing env detectors"/>
|
|
105
|
+
<testcase classname="dist/files-dependency-builder/filing-cabinet/index.spec.js" name="registers a custom resolver for a given extension" time="0.103"/>
|
|
106
|
+
<testcase classname="dist/files-dependency-builder/filing-cabinet/index.spec.js" name="allows does not break default resolvers" time="0.001"/>
|
|
107
|
+
<testcase classname="dist/files-dependency-builder/filing-cabinet/index.spec.js" name="can be called multiple times"/>
|
|
108
|
+
<testcase classname="dist/files-dependency-builder/filing-cabinet/index.spec.js" name="does not add redundant extensions to supportedFileExtensions"/>
|
|
109
|
+
<testcase classname="dist/files-dependency-builder/filing-cabinet/index.spec.js" name="should resolve the dependency to a node_module package (using webpack under the hood)">
|
|
110
|
+
<skipped/>
|
|
111
|
+
</testcase>
|
|
112
|
+
<testcase classname="dist/files-dependency-builder/filing-cabinet/index.spec.js" name="should fallback to the node-module resolution">
|
|
113
|
+
<skipped/>
|
|
114
|
+
</testcase>
|
|
115
|
+
<testcase classname="dist/files-dependency-builder/filing-cabinet/index.spec.js" name="resolves an aliased path">
|
|
116
|
+
<skipped/>
|
|
117
|
+
</testcase>
|
|
118
|
+
<testcase classname="dist/files-dependency-builder/filing-cabinet/index.spec.js" name="resolves a non-aliased path">
|
|
119
|
+
<skipped/>
|
|
120
|
+
</testcase>
|
|
121
|
+
<testcase classname="dist/files-dependency-builder/filing-cabinet/index.spec.js" name="resolves a relative path">
|
|
122
|
+
<skipped/>
|
|
123
|
+
</testcase>
|
|
124
|
+
<testcase classname="dist/files-dependency-builder/filing-cabinet/index.spec.js" name="resolves an absolute path from a file within a subdirectory">
|
|
125
|
+
<skipped/>
|
|
126
|
+
</testcase>
|
|
127
|
+
<testcase classname="dist/files-dependency-builder/filing-cabinet/index.spec.js" name="resolves a path using resolve.root">
|
|
128
|
+
<skipped/>
|
|
129
|
+
</testcase>
|
|
130
|
+
<testcase classname="dist/files-dependency-builder/filing-cabinet/index.spec.js" name="resolves NPM module when using resolve.root">
|
|
131
|
+
<skipped/>
|
|
132
|
+
</testcase>
|
|
133
|
+
<testcase classname="dist/files-dependency-builder/filing-cabinet/index.spec.js" name="resolves NPM module when using resolve.modulesDirectories">
|
|
134
|
+
<skipped/>
|
|
135
|
+
</testcase>
|
|
136
|
+
<testcase classname="dist/files-dependency-builder/filing-cabinet/index.spec.js" name="resolves a path using resolve.modulesDirectories">
|
|
137
|
+
<skipped/>
|
|
138
|
+
</testcase>
|
|
139
|
+
<testcase classname="dist/files-dependency-builder/filing-cabinet/index.spec.js" name="resolves a path using webpack config that exports a function">
|
|
140
|
+
<skipped/>
|
|
141
|
+
</testcase>
|
|
142
|
+
<testcase classname="dist/files-dependency-builder/filing-cabinet/index.spec.js" name="resolves files with a .jsx extension">
|
|
143
|
+
<skipped/>
|
|
144
|
+
</testcase>
|
|
145
|
+
<testcase classname="dist/files-dependency-builder/filing-cabinet/index.spec.js" name="still works">
|
|
146
|
+
<skipped/>
|
|
147
|
+
</testcase>
|
|
69
148
|
<testcase classname="dist/files-dependency-builder/dependency-tree/index.spec.js" name="returns an empty object for a non-existent filename" time="0.001"/>
|
|
70
149
|
<testcase classname="dist/files-dependency-builder/dependency-tree/index.spec.js" name="handles nested tree structures" time="0.005"/>
|
|
71
|
-
<testcase classname="dist/files-dependency-builder/dependency-tree/index.spec.js" name="does not include files that are not real (#13)" time="0.
|
|
72
|
-
<testcase classname="dist/files-dependency-builder/dependency-tree/index.spec.js" name="does not choke on cyclic dependencies" time="0.
|
|
150
|
+
<testcase classname="dist/files-dependency-builder/dependency-tree/index.spec.js" name="does not include files that are not real (#13)" time="0.001"/>
|
|
151
|
+
<testcase classname="dist/files-dependency-builder/dependency-tree/index.spec.js" name="does not choke on cyclic dependencies" time="0.003"/>
|
|
73
152
|
<testcase classname="dist/files-dependency-builder/dependency-tree/index.spec.js" name="excludes Nodejs core modules by default" time="0.001"/>
|
|
74
153
|
<testcase classname="dist/files-dependency-builder/dependency-tree/index.spec.js" name="returns a list of absolutely pathed files"/>
|
|
75
|
-
<testcase classname="dist/files-dependency-builder/dependency-tree/index.spec.js" name="passes it through to precinct" time="0.
|
|
154
|
+
<testcase classname="dist/files-dependency-builder/dependency-tree/index.spec.js" name="passes it through to precinct" time="0.052"/>
|
|
76
155
|
<testcase classname="dist/files-dependency-builder/dependency-tree/index.spec.js" name="stores the invalid partials" time="0.001"/>
|
|
77
|
-
<testcase classname="dist/files-dependency-builder/dependency-tree/index.spec.js" name="does not store anything" time="0.
|
|
78
|
-
<testcase classname="dist/files-dependency-builder/dependency-tree/index.spec.js" name="stores the invalid ones" time="0.
|
|
156
|
+
<testcase classname="dist/files-dependency-builder/dependency-tree/index.spec.js" name="does not store anything" time="0.001"/>
|
|
157
|
+
<testcase classname="dist/files-dependency-builder/dependency-tree/index.spec.js" name="stores the invalid ones" time="0.003"/>
|
|
79
158
|
<testcase classname="dist/files-dependency-builder/dependency-tree/index.spec.js" name="should include the non-existent partial per file" time="0.002"/>
|
|
80
159
|
<testcase classname="dist/files-dependency-builder/dependency-tree/index.spec.js" name="throws if the filename is missing"/>
|
|
81
160
|
<testcase classname="dist/files-dependency-builder/dependency-tree/index.spec.js" name="throws if the root is missing"/>
|
|
82
|
-
<testcase classname="dist/files-dependency-builder/dependency-tree/index.spec.js" name="throws if a supplied filter is not a function"
|
|
83
|
-
<testcase classname="dist/files-dependency-builder/dependency-tree/index.spec.js" name="does not throw on the legacy `root` option"/>
|
|
161
|
+
<testcase classname="dist/files-dependency-builder/dependency-tree/index.spec.js" name="throws if a supplied filter is not a function"/>
|
|
162
|
+
<testcase classname="dist/files-dependency-builder/dependency-tree/index.spec.js" name="does not throw on the legacy `root` option" time="0.001"/>
|
|
84
163
|
<testcase classname="dist/files-dependency-builder/dependency-tree/index.spec.js" name="does not throw"/>
|
|
85
|
-
<testcase classname="dist/files-dependency-builder/dependency-tree/index.spec.js" name="returns no dependencies"
|
|
164
|
+
<testcase classname="dist/files-dependency-builder/dependency-tree/index.spec.js" name="returns no dependencies"/>
|
|
86
165
|
<testcase classname="dist/files-dependency-builder/dependency-tree/index.spec.js" name="returns the precomputed list of a cached entry point"/>
|
|
87
|
-
<testcase classname="dist/files-dependency-builder/dependency-tree/index.spec.js" name="returns an object form of the dependency tree for a file" time="0.
|
|
166
|
+
<testcase classname="dist/files-dependency-builder/dependency-tree/index.spec.js" name="returns an object form of the dependency tree for a file" time="0.002"/>
|
|
88
167
|
<testcase classname="dist/files-dependency-builder/dependency-tree/index.spec.js" name="returns an object form of the dependency tree for a file" time="0.002"/>
|
|
89
168
|
<testcase classname="dist/files-dependency-builder/dependency-tree/index.spec.js" name="resolves files that have jsx" time="0.001"/>
|
|
90
169
|
<testcase classname="dist/files-dependency-builder/dependency-tree/index.spec.js" name="resolves files with a jsx extension" time="0.002"/>
|
|
91
170
|
<testcase classname="dist/files-dependency-builder/dependency-tree/index.spec.js" name="resolves files that have es7" time="0.001"/>
|
|
92
171
|
<testcase classname="dist/files-dependency-builder/dependency-tree/index.spec.js" name="returns an object form of the dependency tree for a file" time="0.005"/>
|
|
93
172
|
<testcase classname="dist/files-dependency-builder/dependency-tree/index.spec.js" name="returns an object form of the dependency tree for a file" time="0.001"/>
|
|
94
|
-
<testcase classname="dist/files-dependency-builder/dependency-tree/index.spec.js" name="returns an object form of the dependency tree for a file" time="0.
|
|
95
|
-
<testcase classname="dist/files-dependency-builder/dependency-tree/index.spec.js" name="returns an object form of the dependency tree for a file" time="0.
|
|
173
|
+
<testcase classname="dist/files-dependency-builder/dependency-tree/index.spec.js" name="returns an object form of the dependency tree for a file" time="0.003"/>
|
|
174
|
+
<testcase classname="dist/files-dependency-builder/dependency-tree/index.spec.js" name="returns an object form of the dependency tree for a file" time="0.011"/>
|
|
96
175
|
<testcase classname="dist/files-dependency-builder/dependency-tree/index.spec.js" name="resolves unaliased modules">
|
|
97
176
|
<skipped/>
|
|
98
177
|
</testcase>
|
|
99
|
-
<testcase classname="dist/files-dependency-builder/dependency-tree/index.spec.js" name="uses the filter to determine if a file should be included in the results" time="0.
|
|
178
|
+
<testcase classname="dist/files-dependency-builder/dependency-tree/index.spec.js" name="uses the filter to determine if a file should be included in the results" time="0.003"/>
|
|
100
179
|
<testcase classname="dist/files-dependency-builder/dependency-tree/index.spec.js" name="includes the lazy dependency" time="0.001"/>
|
|
101
180
|
<testcase classname="dist/files-dependency-builder/dependency-tree/index.spec.js" name="includes the lazy dependency" time="0.001"/>
|
|
102
|
-
<testcase classname="dist/files-dependency-builder/dependency-tree/index.spec.js" name="includes the dynamic import" time="0.
|
|
181
|
+
<testcase classname="dist/files-dependency-builder/dependency-tree/index.spec.js" name="includes the dynamic import" time="0.001"/>
|
|
103
182
|
<testcase classname="dist/files-dependency-builder/dependency-tree/index.spec.js" name="should include it as a dependency and not throw an error" time="0.001"/>
|
|
104
183
|
<testcase classname="dist/files-dependency-builder/dependency-tree/index.spec.js" name="it includes the module entry as dependency">
|
|
105
184
|
<skipped/>
|
|
106
185
|
</testcase>
|
|
107
186
|
<testcase classname="dist/files-dependency-builder/dependency-tree/index.spec.js" name="retains the detective config in the clone" time="0.001"/>
|
|
108
|
-
<testcase classname="dist/files-dependency-builder/dependency-tree/index.spec.js" name="should not override the cache with wrong packages" time="0.
|
|
187
|
+
<testcase classname="dist/files-dependency-builder/dependency-tree/index.spec.js" name="should not override the cache with wrong packages" time="0.003"/>
|
|
109
188
|
<testcase classname="dist/files-dependency-builder/dependency-tree/index.spec.js" name="should not crash with "RangeError: Maximum call stack size exceeded" error" time="0.001"/>
|
|
110
189
|
<testcase classname="dist/files-dependency-builder/dependency-tree/index.spec.js" name="should not show missing dependencies" time="0.001"/>
|
|
111
|
-
<testcase classname="dist/files-dependency-builder/dependency-tree/index.spec.js" name="should not show missing dependencies when importing from https" time="0.
|
|
190
|
+
<testcase classname="dist/files-dependency-builder/dependency-tree/index.spec.js" name="should not show missing dependencies when importing from https" time="0.001"/>
|
|
112
191
|
<testcase classname="dist/files-dependency-builder/dependency-tree/index.spec.js" name="should not show missing dependencies when importing from http" time="0.001"/>
|
|
113
192
|
<testcase classname="dist/files-dependency-builder/precinct/index.spec.js" name="accepts an AST"/>
|
|
114
193
|
<testcase classname="dist/files-dependency-builder/precinct/index.spec.js" name="dangles off a given ast"/>
|
|
115
194
|
<testcase classname="dist/files-dependency-builder/precinct/index.spec.js" name="dangles off the parsed ast from a .js file" time="0.001"/>
|
|
116
195
|
<testcase classname="dist/files-dependency-builder/precinct/index.spec.js" name="dangles off the parsed ast from a scss detective" time="0.001"/>
|
|
117
|
-
<testcase classname="dist/files-dependency-builder/precinct/index.spec.js" name="dangles off the parsed ast from a sass detective" time="0.
|
|
118
|
-
<testcase classname="dist/files-dependency-builder/precinct/index.spec.js" name="grabs dependencies of amd modules"
|
|
196
|
+
<testcase classname="dist/files-dependency-builder/precinct/index.spec.js" name="dangles off the parsed ast from a sass detective" time="0.004"/>
|
|
197
|
+
<testcase classname="dist/files-dependency-builder/precinct/index.spec.js" name="grabs dependencies of amd modules"/>
|
|
119
198
|
<testcase classname="dist/files-dependency-builder/precinct/index.spec.js" name="grabs dependencies of commonjs modules" time="0.001"/>
|
|
120
|
-
<testcase classname="dist/files-dependency-builder/precinct/index.spec.js" name="grabs dependencies of es6 modules"
|
|
121
|
-
<testcase classname="dist/files-dependency-builder/precinct/index.spec.js" name="grabs dependencies of es6 modules with embedded jsx"/>
|
|
122
|
-
<testcase classname="dist/files-dependency-builder/precinct/index.spec.js" name="grabs dependencies of es6 modules with embedded es7"
|
|
199
|
+
<testcase classname="dist/files-dependency-builder/precinct/index.spec.js" name="grabs dependencies of es6 modules"/>
|
|
200
|
+
<testcase classname="dist/files-dependency-builder/precinct/index.spec.js" name="grabs dependencies of es6 modules with embedded jsx" time="0.001"/>
|
|
201
|
+
<testcase classname="dist/files-dependency-builder/precinct/index.spec.js" name="grabs dependencies of es6 modules with embedded es7"/>
|
|
123
202
|
<testcase classname="dist/files-dependency-builder/precinct/index.spec.js" name="throws errors of es6 modules with syntax errors" time="0.001"/>
|
|
124
203
|
<testcase classname="dist/files-dependency-builder/precinct/index.spec.js" name="grabs dependencies of css files">
|
|
125
204
|
<skipped/>
|
|
@@ -132,9 +211,9 @@
|
|
|
132
211
|
<skipped/>
|
|
133
212
|
</testcase>
|
|
134
213
|
<testcase classname="dist/files-dependency-builder/precinct/index.spec.js" name="throws errors of typescript modules with syntax errors"/>
|
|
135
|
-
<testcase classname="dist/files-dependency-builder/precinct/index.spec.js" name="supports the object form of type configuration"
|
|
214
|
+
<testcase classname="dist/files-dependency-builder/precinct/index.spec.js" name="supports the object form of type configuration"/>
|
|
136
215
|
<testcase classname="dist/files-dependency-builder/precinct/index.spec.js" name="yields no dependencies for es6 modules with no imports"/>
|
|
137
|
-
<testcase classname="dist/files-dependency-builder/precinct/index.spec.js" name="yields no dependencies for non-modules"
|
|
216
|
+
<testcase classname="dist/files-dependency-builder/precinct/index.spec.js" name="yields no dependencies for non-modules"/>
|
|
138
217
|
<testcase classname="dist/files-dependency-builder/precinct/index.spec.js" name="throw on unparsable .js files"/>
|
|
139
218
|
<testcase classname="dist/files-dependency-builder/precinct/index.spec.js" name="does not blow up when parsing a gruntfile #2" time="0.001"/>
|
|
140
219
|
<testcase classname="dist/files-dependency-builder/precinct/index.spec.js" name="returns the dependencies for the given filepath">
|
|
@@ -148,93 +227,14 @@
|
|
|
148
227
|
<testcase classname="dist/files-dependency-builder/precinct/index.spec.js" name="supports passing detective configuration">
|
|
149
228
|
<skipped/>
|
|
150
229
|
</testcase>
|
|
151
|
-
<testcase classname="dist/files-dependency-builder/precinct/index.spec.js" name="supports passing env detectors"/>
|
|
230
|
+
<testcase classname="dist/files-dependency-builder/precinct/index.spec.js" name="supports passing env detectors" time="0.001"/>
|
|
152
231
|
<testcase classname="dist/files-dependency-builder/precinct/index.spec.js" name="still does not filter out core module by default">
|
|
153
232
|
<skipped/>
|
|
154
233
|
</testcase>
|
|
155
|
-
<testcase classname="dist/files-dependency-builder/precinct/index.spec.js" name="passes amd config to the amd detective"/>
|
|
234
|
+
<testcase classname="dist/files-dependency-builder/precinct/index.spec.js" name="passes amd config to the amd detective" time="0.001"/>
|
|
156
235
|
<testcase classname="dist/files-dependency-builder/precinct/index.spec.js" name="returns both the commonjs and es6 dependencies" time="0.001"/>
|
|
157
236
|
<testcase classname="dist/files-dependency-builder/precinct/index.spec.js" name="returns both the commonjs and es6 dependencies"/>
|
|
158
|
-
<testcase classname="dist/files-dependency-builder/precinct/index.spec.js" name="grabs those lazy dependencies"
|
|
237
|
+
<testcase classname="dist/files-dependency-builder/precinct/index.spec.js" name="grabs those lazy dependencies"/>
|
|
159
238
|
<testcase classname="dist/files-dependency-builder/precinct/index.spec.js" name="grabs the lazy imports" time="0.001"/>
|
|
160
|
-
<testcase classname="dist/files-dependency-builder/filing-cabinet/index.spec.js" name="uses a generic resolve for unsupported file extensions" time="0.001"/>
|
|
161
|
-
<testcase classname="dist/files-dependency-builder/filing-cabinet/index.spec.js" name="reuses the ast when trying to determine the module type"/>
|
|
162
|
-
<testcase classname="dist/files-dependency-builder/filing-cabinet/index.spec.js" name="resolves the dependency successfully" time="0.001"/>
|
|
163
|
-
<testcase classname="dist/files-dependency-builder/filing-cabinet/index.spec.js" name="uses the filename to look for the module type" time="0.001"/>
|
|
164
|
-
<testcase classname="dist/files-dependency-builder/filing-cabinet/index.spec.js" name="assumes commonjs for es6 modules with no requirejs/webpack config">
|
|
165
|
-
<skipped/>
|
|
166
|
-
</testcase>
|
|
167
|
-
<testcase classname="dist/files-dependency-builder/filing-cabinet/index.spec.js" name="resolves files with the .jsx extension" time="0.001"/>
|
|
168
|
-
<testcase classname="dist/files-dependency-builder/filing-cabinet/index.spec.js" name="uses require's resolver">
|
|
169
|
-
<skipped/>
|
|
170
|
-
</testcase>
|
|
171
|
-
<testcase classname="dist/files-dependency-builder/filing-cabinet/index.spec.js" name="returns an empty string for an unresolved module"/>
|
|
172
|
-
<testcase classname="dist/files-dependency-builder/filing-cabinet/index.spec.js" name="adds the directory to the require resolution paths" time="0.001"/>
|
|
173
|
-
<testcase classname="dist/files-dependency-builder/filing-cabinet/index.spec.js" name="resolves a relative dependency about the filename"/>
|
|
174
|
-
<testcase classname="dist/files-dependency-builder/filing-cabinet/index.spec.js" name="resolves a .. dependency to its parent directory's index.js file" time="0.001"/>
|
|
175
|
-
<testcase classname="dist/files-dependency-builder/filing-cabinet/index.spec.js" name="resolves a dependency within a directory outside of the given file">
|
|
176
|
-
<skipped/>
|
|
177
|
-
</testcase>
|
|
178
|
-
<testcase classname="dist/files-dependency-builder/filing-cabinet/index.spec.js" name="resolves a node module with module entry in package.json">
|
|
179
|
-
<skipped/>
|
|
180
|
-
</testcase>
|
|
181
|
-
<testcase classname="dist/files-dependency-builder/filing-cabinet/index.spec.js" name="resolves a nested module" time="0.001"/>
|
|
182
|
-
<testcase classname="dist/files-dependency-builder/filing-cabinet/index.spec.js" name="resolves to the index.js file of a directory" time="0.001"/>
|
|
183
|
-
<testcase classname="dist/files-dependency-builder/filing-cabinet/index.spec.js" name="resolves implicit .jsx requires" time="0.001"/>
|
|
184
|
-
<testcase classname="dist/files-dependency-builder/filing-cabinet/index.spec.js" name="resolves implicit .scss requires" time="0.001"/>
|
|
185
|
-
<testcase classname="dist/files-dependency-builder/filing-cabinet/index.spec.js" name="resolves implicit .json requires"/>
|
|
186
|
-
<testcase classname="dist/files-dependency-builder/filing-cabinet/index.spec.js" name="resolves an import"/>
|
|
187
|
-
<testcase classname="dist/files-dependency-builder/filing-cabinet/index.spec.js" name="returns an empty result" time="0.001"/>
|
|
188
|
-
<testcase classname="dist/files-dependency-builder/filing-cabinet/index.spec.js" name="uses the sass resolver for .scss files" time="0.001"/>
|
|
189
|
-
<testcase classname="dist/files-dependency-builder/filing-cabinet/index.spec.js" name="uses the sass resolver for .sass files"/>
|
|
190
|
-
<testcase classname="dist/files-dependency-builder/filing-cabinet/index.spec.js" name="uses the stylus resolver"/>
|
|
191
|
-
<testcase classname="dist/files-dependency-builder/filing-cabinet/index.spec.js" name="resolves extensionless dependencies"/>
|
|
192
|
-
<testcase classname="dist/files-dependency-builder/filing-cabinet/index.spec.js" name="resolves dependencies with a less extension" time="0.001"/>
|
|
193
|
-
<testcase classname="dist/files-dependency-builder/filing-cabinet/index.spec.js" name="resolves dependencies with a css extension"/>
|
|
194
|
-
<testcase classname="dist/files-dependency-builder/filing-cabinet/index.spec.js" name="uses a generic resolve for unsupported file extensions" time="0.001"/>
|
|
195
|
-
<testcase classname="dist/files-dependency-builder/filing-cabinet/index.spec.js" name="supports passing env detectors"/>
|
|
196
|
-
<testcase classname="dist/files-dependency-builder/filing-cabinet/index.spec.js" name="registers a custom resolver for a given extension" time="0.001"/>
|
|
197
|
-
<testcase classname="dist/files-dependency-builder/filing-cabinet/index.spec.js" name="allows does not break default resolvers"/>
|
|
198
|
-
<testcase classname="dist/files-dependency-builder/filing-cabinet/index.spec.js" name="can be called multiple times" time="0.001"/>
|
|
199
|
-
<testcase classname="dist/files-dependency-builder/filing-cabinet/index.spec.js" name="does not add redundant extensions to supportedFileExtensions"/>
|
|
200
|
-
<testcase classname="dist/files-dependency-builder/filing-cabinet/index.spec.js" name="should resolve the dependency to a node_module package (using webpack under the hood)">
|
|
201
|
-
<skipped/>
|
|
202
|
-
</testcase>
|
|
203
|
-
<testcase classname="dist/files-dependency-builder/filing-cabinet/index.spec.js" name="should fallback to the node-module resolution">
|
|
204
|
-
<skipped/>
|
|
205
|
-
</testcase>
|
|
206
|
-
<testcase classname="dist/files-dependency-builder/filing-cabinet/index.spec.js" name="resolves an aliased path">
|
|
207
|
-
<skipped/>
|
|
208
|
-
</testcase>
|
|
209
|
-
<testcase classname="dist/files-dependency-builder/filing-cabinet/index.spec.js" name="resolves a non-aliased path">
|
|
210
|
-
<skipped/>
|
|
211
|
-
</testcase>
|
|
212
|
-
<testcase classname="dist/files-dependency-builder/filing-cabinet/index.spec.js" name="resolves a relative path">
|
|
213
|
-
<skipped/>
|
|
214
|
-
</testcase>
|
|
215
|
-
<testcase classname="dist/files-dependency-builder/filing-cabinet/index.spec.js" name="resolves an absolute path from a file within a subdirectory">
|
|
216
|
-
<skipped/>
|
|
217
|
-
</testcase>
|
|
218
|
-
<testcase classname="dist/files-dependency-builder/filing-cabinet/index.spec.js" name="resolves a path using resolve.root">
|
|
219
|
-
<skipped/>
|
|
220
|
-
</testcase>
|
|
221
|
-
<testcase classname="dist/files-dependency-builder/filing-cabinet/index.spec.js" name="resolves NPM module when using resolve.root">
|
|
222
|
-
<skipped/>
|
|
223
|
-
</testcase>
|
|
224
|
-
<testcase classname="dist/files-dependency-builder/filing-cabinet/index.spec.js" name="resolves NPM module when using resolve.modulesDirectories">
|
|
225
|
-
<skipped/>
|
|
226
|
-
</testcase>
|
|
227
|
-
<testcase classname="dist/files-dependency-builder/filing-cabinet/index.spec.js" name="resolves a path using resolve.modulesDirectories">
|
|
228
|
-
<skipped/>
|
|
229
|
-
</testcase>
|
|
230
|
-
<testcase classname="dist/files-dependency-builder/filing-cabinet/index.spec.js" name="resolves a path using webpack config that exports a function">
|
|
231
|
-
<skipped/>
|
|
232
|
-
</testcase>
|
|
233
|
-
<testcase classname="dist/files-dependency-builder/filing-cabinet/index.spec.js" name="resolves files with a .jsx extension">
|
|
234
|
-
<skipped/>
|
|
235
|
-
</testcase>
|
|
236
|
-
<testcase classname="dist/files-dependency-builder/filing-cabinet/index.spec.js" name="still works">
|
|
237
|
-
<skipped/>
|
|
238
|
-
</testcase>
|
|
239
239
|
</testsuite>
|
|
240
240
|
</testsuites>
|
package/artifacts/schema.json
CHANGED
|
@@ -20,6 +20,7 @@
|
|
|
20
20
|
"line": 3,
|
|
21
21
|
"character": 15
|
|
22
22
|
},
|
|
23
|
+
"signature": "class DependenciesMain",
|
|
23
24
|
"name": "DependenciesMain",
|
|
24
25
|
"exportNode": {
|
|
25
26
|
"__schema": "ClassSchema",
|
|
@@ -1446,6 +1447,7 @@
|
|
|
1446
1447
|
"line": 4,
|
|
1447
1448
|
"character": 10
|
|
1448
1449
|
},
|
|
1450
|
+
"signature": "class DetectorHook",
|
|
1449
1451
|
"name": "DetectorHook",
|
|
1450
1452
|
"exportNode": {
|
|
1451
1453
|
"__schema": "ClassSchema",
|
|
@@ -1601,6 +1603,7 @@
|
|
|
1601
1603
|
"line": 4,
|
|
1602
1604
|
"character": 24
|
|
1603
1605
|
},
|
|
1606
|
+
"signature": "interface DependencyDetector",
|
|
1604
1607
|
"name": "DependencyDetector",
|
|
1605
1608
|
"exportNode": {
|
|
1606
1609
|
"__schema": "InterfaceSchema",
|
|
@@ -1832,6 +1835,7 @@
|
|
|
1832
1835
|
"line": 4,
|
|
1833
1836
|
"character": 44
|
|
1834
1837
|
},
|
|
1838
|
+
"signature": "type FileContext = {\n ext: string;\n}",
|
|
1835
1839
|
"name": "FileContext",
|
|
1836
1840
|
"exportNode": {
|
|
1837
1841
|
"__schema": "TypeSchema",
|
|
@@ -1902,6 +1906,7 @@
|
|
|
1902
1906
|
"line": 6,
|
|
1903
1907
|
"character": 10
|
|
1904
1908
|
},
|
|
1909
|
+
"signature": "const DependenciesAspect: Aspect",
|
|
1905
1910
|
"name": "DependenciesAspect",
|
|
1906
1911
|
"exportNode": {
|
|
1907
1912
|
"__schema": "VariableLikeSchema",
|
|
@@ -4525,7 +4530,7 @@
|
|
|
4525
4530
|
"componentId": {
|
|
4526
4531
|
"scope": "teambit.dependencies",
|
|
4527
4532
|
"name": "dependencies",
|
|
4528
|
-
"version": "1.0.
|
|
4533
|
+
"version": "1.0.411"
|
|
4529
4534
|
},
|
|
4530
4535
|
"taggedModuleExports": []
|
|
4531
4536
|
}
|
package/dist/dependents-cmd.d.ts
CHANGED
|
@@ -11,4 +11,9 @@ export declare class DependentsCmd implements Command {
|
|
|
11
11
|
alias: string;
|
|
12
12
|
options: CommandOptions;
|
|
13
13
|
report([id]: [string]): Promise<string>;
|
|
14
|
+
json([id]: [string]): Promise<{
|
|
15
|
+
scopeDependents: any[];
|
|
16
|
+
workspaceDependents: any[];
|
|
17
|
+
id: string;
|
|
18
|
+
}>;
|
|
14
19
|
}
|
package/dist/dependents-cmd.js
CHANGED
|
@@ -26,6 +26,8 @@ function _template() {
|
|
|
26
26
|
return data;
|
|
27
27
|
}
|
|
28
28
|
function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
|
|
29
|
+
function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
30
|
+
function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
29
31
|
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; }
|
|
30
32
|
function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == typeof i ? i : i + ""; }
|
|
31
33
|
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); }
|
|
@@ -40,7 +42,7 @@ class DependentsCmd {
|
|
|
40
42
|
_defineProperty(this, "description", 'show dependents of the given component');
|
|
41
43
|
_defineProperty(this, "group", 'info');
|
|
42
44
|
_defineProperty(this, "alias", '');
|
|
43
|
-
_defineProperty(this, "options", []);
|
|
45
|
+
_defineProperty(this, "options", [['j', 'json', 'return the dependents in JSON format']]);
|
|
44
46
|
}
|
|
45
47
|
async report([id]) {
|
|
46
48
|
const results = await (0, _dependents().dependents)(id);
|
|
@@ -56,6 +58,19 @@ ${workspaceTable || '<none>'}
|
|
|
56
58
|
${_chalk().default.bold('Dependents originated from scope')}
|
|
57
59
|
${scopeTable || '<none>'}`;
|
|
58
60
|
}
|
|
61
|
+
async json([id]) {
|
|
62
|
+
const results = await (0, _dependents().dependents)(id);
|
|
63
|
+
const depInfoToString = depInfo => {
|
|
64
|
+
return _objectSpread(_objectSpread({}, depInfo), {}, {
|
|
65
|
+
id: depInfo.id.toString()
|
|
66
|
+
});
|
|
67
|
+
};
|
|
68
|
+
return {
|
|
69
|
+
scopeDependents: results.scopeDependents.map(depInfoToString),
|
|
70
|
+
workspaceDependents: results.workspaceDependents.map(depInfoToString),
|
|
71
|
+
id: results.id.toString()
|
|
72
|
+
};
|
|
73
|
+
}
|
|
59
74
|
}
|
|
60
75
|
exports.DependentsCmd = DependentsCmd;
|
|
61
76
|
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["_chalk","data","_interopRequireDefault","require","_dependents","_template","e","__esModule","default","
|
|
1
|
+
{"version":3,"names":["_chalk","data","_interopRequireDefault","require","_dependents","_template","e","__esModule","default","ownKeys","r","t","Object","keys","getOwnPropertySymbols","o","filter","getOwnPropertyDescriptor","enumerable","push","apply","_objectSpread","arguments","length","forEach","_defineProperty","getOwnPropertyDescriptors","defineProperties","defineProperty","_toPropertyKey","value","configurable","writable","i","_toPrimitive","Symbol","toPrimitive","call","TypeError","String","Number","DependentsCmd","constructor","name","description","report","id","results","dependents","scopeDependents","workspaceDependents","toString","toStringWithoutVersion","scopeTable","generateDependentsInfoTable","workspaceTable","chalk","bold","json","depInfoToString","depInfo","map","exports"],"sources":["dependents-cmd.ts"],"sourcesContent":["import chalk from 'chalk';\nimport { Command, CommandOptions } from '@teambit/cli';\nimport { dependents, DependentsResults } from './dependents';\nimport { generateDependentsInfoTable } from './template';\n\nexport class DependentsCmd implements Command {\n name = 'dependents <component-name>';\n helpUrl = 'reference/dependencies/inspecting-dependencies#review-dependents';\n arguments = [\n {\n name: 'component-name',\n description: 'component name or component id',\n },\n ];\n description = 'show dependents of the given component';\n group = 'info';\n alias = '';\n options = [['j', 'json', 'return the dependents in JSON format']] as CommandOptions;\n\n async report([id]: [string]) {\n const results: DependentsResults = await dependents(id);\n if (!results.scopeDependents.length && !results.workspaceDependents.length) {\n return `no dependents found for ${results.id.toString()}.\ntry running \"bit cat-component ${results.id.toStringWithoutVersion()}\" to see whether the component/version exists locally`;\n }\n const scopeTable = generateDependentsInfoTable(results.scopeDependents, results.id);\n const workspaceTable = generateDependentsInfoTable(results.workspaceDependents, results.id);\n return `${chalk.bold('Dependents originated from workspace')}\n${workspaceTable || '<none>'}\n\n${chalk.bold('Dependents originated from scope')}\n${scopeTable || '<none>'}`;\n }\n\n async json([id]: [string]) {\n const results: DependentsResults = await dependents(id);\n const depInfoToString = (depInfo) => {\n return {\n ...depInfo,\n id: depInfo.id.toString(),\n };\n };\n return {\n scopeDependents: results.scopeDependents.map(depInfoToString),\n workspaceDependents: results.workspaceDependents.map(depInfoToString),\n id: results.id.toString(),\n };\n }\n}\n"],"mappings":";;;;;;AAAA,SAAAA,OAAA;EAAA,MAAAC,IAAA,GAAAC,sBAAA,CAAAC,OAAA;EAAAH,MAAA,YAAAA,CAAA;IAAA,OAAAC,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AAEA,SAAAG,YAAA;EAAA,MAAAH,IAAA,GAAAE,OAAA;EAAAC,WAAA,YAAAA,C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
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["_fsExtra","data","_interopRequireDefault","require","_path","_module","_moduleDefinition","_nodeSourceWalk","_detectiveAmd","_detectiveStylus","_nodeDepsDetectors","_stylingDepsDetectors","_stylingDepsDetectors2","_stylingDepsDetectors3","_stylingDepsDetectors4","_typescriptDepsDetectors","_detectorHook","e","__esModule","default","jsExt","extToType","typeToDetective","css","detectiveCss","sass","detectiveSass","less","detectiveLess","scss","detectiveScss","stylus","detectiveStylus","ts","detectiveTypeScript","commonjs","detectiveEs6","es6","amd","detectiveAmd","debug","detectorHook","DetectorHook","assign","o1","o2","key","hasOwnProperty","getFileInfo","filename","ext","path","extname","content","fs","readFileSync","type","ast","getDetector","fileInfo","options","normalizedOptions","envDetectors","detector","isSupported","detect","detective","jsx","undefined","getJsDetector","includes","walker","Walker","parse","message","useContent","getModuleType","fromSource","normalizeDeps","deps","includeCore","normalizedDeps","Array","isArray","Object","keys","filter","d","isBuiltin","getDepsFromFile","startsWith","precinct","paperwork","_default","exports"],"sources":["index.ts"],"sourcesContent":["/**\n * this file had been forked from https://github.com/dependents/node-precinct\n */\nimport fs from 'fs-extra';\nimport path from 'path';\n\n// @ts-ignore we currently have @types/node as v12, and this is available > 16. once updated, remove the ts-ignore\nimport { isBuiltin } from 'module';\n\nimport getModuleType from 'module-definition';\nimport Walker from 'node-source-walk';\n\nimport detectiveAmd from 'detective-amd';\nimport detectiveStylus from 'detective-stylus';\n\nimport detectiveEs6 from '@teambit/node.deps-detectors.detective-es6';\nimport detectiveCss from '@teambit/styling.deps-detectors.detective-css';\nimport detectiveLess from '@teambit/styling.deps-detectors.detective-less';\nimport detectiveSass from '@teambit/styling.deps-detectors.detective-sass';\nimport detectiveScss from '@teambit/styling.deps-detectors.detective-scss';\nimport detectiveTypeScript from '@teambit/typescript.deps-detectors.detective-typescript';\n\nimport { DependencyDetector, DetectorHook } from '../detector-hook';\n\n/**\n * The file info object.\n * - `ext` is the file extension.\n * - `content` is the input file content.\n * - `type` is the parsed file type from ext or content.\n * - `ast` is the eventually consumed content by the corresponding detective.\n */\ntype FileInfo = {\n ext: string;\n content: string | object;\n type: string;\n ast: any;\n};\n\ntype Options = {\n envDetectors?: DependencyDetector[];\n useContent?: boolean;\n includeCore?: boolean;\n type?: string;\n [lang: string]: any;\n};\n\ntype BuiltinDeps = string[] | Record<string, any>;\ntype Detective = (fileContent: string | object, options?: any) => BuiltinDeps;\n\nconst jsExt = ['.js', '.jsx', '.cjs', '.mjs'];\n\nconst extToType = {\n '.css': 'css',\n '.sass': 'sass',\n '.less': 'less',\n '.scss': 'scss',\n '.styl': 'stylus',\n '.mts': 'ts',\n '.cts': 'ts',\n '.ts': 'ts',\n '.tsx': 'ts',\n};\n\nconst typeToDetective: Record<string, Detective> = {\n css: detectiveCss,\n sass: detectiveSass,\n less: detectiveLess,\n scss: detectiveScss,\n stylus: detectiveStylus,\n ts: detectiveTypeScript,\n commonjs: detectiveEs6,\n es6: detectiveEs6,\n amd: detectiveAmd,\n};\n\nconst debug = require('debug')('precinct');\n\nconst detectorHook = new DetectorHook();\n\nconst assign = (o1, o2) => {\n // eslint-disable-next-line\n for (const key in o2) {\n // eslint-disable-next-line\n if (o2.hasOwnProperty(key)) {\n o1[key] = o2[key];\n }\n }\n\n return o1;\n};\n\n/**\n * Get file info from the given file path.\n */\nconst getFileInfo = (filename: string): FileInfo => {\n const ext = path.extname(filename);\n const content = fs.readFileSync(filename, 'utf8');\n return {\n ext,\n content,\n // determined later\n type: '',\n // initialized with the content\n ast: content,\n };\n};\n\n/**\n * Get the non-JS detective for the given file info.\n * The type of the file would be determined as well.\n * Return undefined if no proper detective found, perhaps it's plain\n * JavaScript or unknown content. We can deal with it later.\n */\nconst getDetector = (fileInfo: FileInfo, options?: Options): Detective | undefined => {\n const { ext } = fileInfo;\n const normalizedOptions: Options = options || {};\n\n // from env detectors\n if (options?.envDetectors) {\n for (const detector of options.envDetectors) {\n if (detector.isSupported({ ext })) {\n fileInfo.type = detector.type || '';\n return detector.detect as Detective;\n }\n }\n }\n\n // from builtin detectors\n // - check `fileInfo.type` first to support `precinct(content, { type })`\n const type = fileInfo.type || extToType[ext];\n if (typeToDetective[type]) {\n const detective = typeToDetective[type];\n fileInfo.type = type;\n // special logic for tsx files\n if (ext === '.tsx') {\n if (!normalizedOptions.ts) normalizedOptions.ts = {};\n normalizedOptions.ts.jsx = true;\n }\n return detective;\n }\n\n // from global detector hook (legacy)\n if (detectorHook.isSupported(ext)) {\n const detector = detectorHook.getDetector(ext);\n if (detector) {\n fileInfo.type = ext;\n typeToDetective[ext] = detector.detect as Detective;\n return detector.detect as Detective;\n }\n }\n\n return undefined;\n};\n\n/**\n * Get the JS detective (amd/es6/cjs) for the given file info.\n * The type and ast of the file would be determined as well.\n */\nconst getJsDetector = (fileInfo: FileInfo, options?: Options): Detective | undefined => {\n if (!jsExt.includes(fileInfo.ext)) {\n return undefined;\n }\n\n if (typeof fileInfo.content !== 'object') {\n const walker = new Walker();\n try {\n fileInfo.ast = walker.parse(fileInfo.content);\n } catch (e: any) {\n debug('could not parse content: %s', e.message);\n throw e;\n }\n }\n\n const useContent = options?.useContent;\n const type = useContent ? getModuleType.fromSource(fileInfo.content) : getModuleType.fromSource(fileInfo.ast);\n const detector = typeToDetective[type];\n fileInfo.type = type;\n\n return detector;\n};\n\n/**\n * Normalize the deps into an array.\n */\nconst normalizeDeps = (deps: BuiltinDeps, includeCore?: boolean): string[] => {\n const normalizedDeps = Array.isArray(deps) ? deps : Object.keys(deps);\n return includeCore ? normalizedDeps : normalizedDeps.filter((d) => !isBuiltin(d));\n};\n\nconst getDepsFromFile = (filename: string, options?: Options): string[] => {\n const normalizedOptions: Options = assign({ includeCore: true }, options || {});\n const fileInfo = getFileInfo(filename);\n if (\n typeof fileInfo.content === 'string' &&\n (fileInfo.content.startsWith('// @bit-no-check') || fileInfo.content.startsWith('/* @bit-no-check'))\n ) {\n debug(`skipping file ${filename}, it has a @bit-no-check comment`);\n return [];\n }\n\n const detective = getDetector(fileInfo, normalizedOptions) || getJsDetector(fileInfo, normalizedOptions);\n if (!detective) {\n debug(`skipping unsupported file ${filename}`);\n return [];\n }\n debug('module type: ', fileInfo.type);\n\n const deps = detective(fileInfo.ast, normalizedOptions[fileInfo.type]);\n\n return normalizeDeps(deps, normalizedOptions?.includeCore);\n};\n\n/**\n * Finds the list of dependencies for the given file\n *\n * @param {String|Object} content - File's content or AST\n * @param {Object} [options]\n * @param {String} [options.type] - The type of content being passed in. Useful if you want to use a non-js detective\n * @return {String[]}\n */\n// eslint-disable-next-line complexity\nconst precinct = (content: string | object, options?: string | Options): BuiltinDeps => {\n // Legacy form backCompat where type was the second parameter\n const normalizedOptions: Options = typeof options === 'string' ? { type: options } : options || {};\n const type = normalizedOptions.type || '';\n\n debug('options given: ', normalizedOptions);\n\n const fileInfo: FileInfo = {\n content,\n ast: content,\n ext: type ? '' : '.js',\n type,\n };\n\n const detective = getDetector(fileInfo, normalizedOptions) || getJsDetector(fileInfo, normalizedOptions);\n if (!detective) {\n return [];\n }\n\n const deps = detective(fileInfo.ast, normalizedOptions[fileInfo.type]);\n // @ts-ignore\n precinct.ast = detective.ast || fileInfo.ast;\n\n return deps;\n};\n\nprecinct.paperwork = getDepsFromFile;\n\nexport default precinct;\n"],"mappings":";;;;;;AAGA,SAAAA,SAAA;EAAA,MAAAC,IAAA,GAAAC,sBAAA,CAAAC,OAAA;EAAAH,QAAA,YAAAA,CAAA;IAAA,OAAAC,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AACA,SAAAG,MAAA;EAAA,MAAAH,IAAA,GAAAC,sBAAA,CAAAC,OAAA;EAAAC,KAAA,YAAAA,CAAA;IAAA,OAAAH,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AAGA,SAAAI,QAAA;EAAA,MAAAJ,IAAA,GAAAE,OAAA;EAAAE,OAAA,YAAAA,CAAA;IAAA,OAAAJ,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AAEA,SAAAK,k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A3E,OAAA,GAEtBwE,QAAQ","ignoreList":[]}
|
|
1
|
+
{"version":3,"names":["_fsExtra","data","_interopRequireDefault","require","_path","_module","_moduleDefinition","_nodeSourceWalk","_detectiveAmd","_detectiveStylus","_nodeDepsDetectors","_stylingDepsDetectors","_stylingDepsDetectors2","_stylingDepsDetectors3","_stylingDepsDetectors4","_typescriptDepsDetectors","_detectorHook","e","__esModule","default","jsExt","extToType","typeToDetective","css","detectiveCss","sass","detectiveSass","less","detectiveLess","scss","detectiveScss","stylus","detectiveStylus","ts","detectiveTypeScript","commonjs","detectiveEs6","es6","amd","detectiveAmd","debug","detectorHook","DetectorHook","assign","o1","o2","key","hasOwnProperty","getFileInfo","filename","ext","path","extname","content","fs","readFileSync","type","ast","getDetector","fileInfo","options","normalizedOptions","envDetectors","detector","isSupported","detect","detective","jsx","undefined","getJsDetector","includes","walker","Walker","parse","message","useContent","getModuleType","fromSource","normalizeDeps","deps","includeCore","normalizedDeps","Array","isArray","Object","keys","filter","d","isBuiltin","getDepsFromFile","startsWith","precinct","paperwork","_default","exports"],"sources":["index.ts"],"sourcesContent":["/**\n * this file had been forked from https://github.com/dependents/node-precinct\n */\nimport fs from 'fs-extra';\nimport path from 'path';\n\n// @ts-ignore we currently have @types/node as v12, and this is available > 16. once updated, remove the ts-ignore\nimport { isBuiltin } from 'module';\n\nimport getModuleType from 'module-definition';\nimport Walker from 'node-source-walk';\n\nimport detectiveAmd from 'detective-amd';\nimport detectiveStylus from 'detective-stylus';\n\nimport detectiveEs6 from '@teambit/node.deps-detectors.detective-es6';\nimport detectiveCss from '@teambit/styling.deps-detectors.detective-css';\nimport detectiveLess from '@teambit/styling.deps-detectors.detective-less';\nimport detectiveSass from '@teambit/styling.deps-detectors.detective-sass';\nimport detectiveScss from '@teambit/styling.deps-detectors.detective-scss';\nimport detectiveTypeScript from '@teambit/typescript.deps-detectors.detective-typescript';\n\nimport { DependencyDetector, DetectorHook } from '../detector-hook';\n\n/**\n * The file info object.\n * - `ext` is the file extension.\n * - `content` is the input file content.\n * - `type` is the parsed file type from ext or content.\n * - `ast` is the eventually consumed content by the corresponding detective.\n */\ntype FileInfo = {\n ext: string;\n content: string | object;\n type: string;\n ast: any;\n};\n\ntype Options = {\n envDetectors?: DependencyDetector[];\n useContent?: boolean;\n includeCore?: boolean;\n type?: string;\n [lang: string]: any;\n};\n\ntype BuiltinDeps = string[] | Record<string, any>;\ntype Detective = (fileContent: string, options?: any) => BuiltinDeps;\n\nconst jsExt = ['.js', '.jsx', '.cjs', '.mjs'];\n\nconst extToType = {\n '.css': 'css',\n '.sass': 'sass',\n '.less': 'less',\n '.scss': 'scss',\n '.styl': 'stylus',\n '.mts': 'ts',\n '.cts': 'ts',\n '.ts': 'ts',\n '.tsx': 'ts',\n};\n\nconst typeToDetective: Record<string, Detective> = {\n css: detectiveCss,\n sass: detectiveSass,\n less: detectiveLess,\n scss: detectiveScss,\n stylus: detectiveStylus,\n ts: detectiveTypeScript,\n commonjs: detectiveEs6,\n es6: detectiveEs6,\n amd: detectiveAmd,\n};\n\nconst debug = require('debug')('precinct');\n\nconst detectorHook = new DetectorHook();\n\nconst assign = (o1, o2) => {\n // eslint-disable-next-line\n for (const key in o2) {\n // eslint-disable-next-line\n if (o2.hasOwnProperty(key)) {\n o1[key] = o2[key];\n }\n }\n\n return o1;\n};\n\n/**\n * Get file info from the given file path.\n */\nconst getFileInfo = (filename: string): FileInfo => {\n const ext = path.extname(filename);\n const content = fs.readFileSync(filename, 'utf8');\n return {\n ext,\n content,\n // determined later\n type: '',\n // initialized with the content\n ast: content,\n };\n};\n\n/**\n * Get the non-JS detective for the given file info.\n * The type of the file would be determined as well.\n * Return undefined if no proper detective found, perhaps it's plain\n * JavaScript or unknown content. We can deal with it later.\n */\nconst getDetector = (fileInfo: FileInfo, options?: Options): Detective | undefined => {\n const { ext } = fileInfo;\n const normalizedOptions: Options = options || {};\n\n // from env detectors\n if (options?.envDetectors) {\n for (const detector of options.envDetectors) {\n if (detector.isSupported({ ext })) {\n fileInfo.type = detector.type || '';\n return detector.detect as Detective;\n }\n }\n }\n\n // from builtin detectors\n // - check `fileInfo.type` first to support `precinct(content, { type })`\n const type = fileInfo.type || extToType[ext];\n if (typeToDetective[type]) {\n const detective = typeToDetective[type];\n fileInfo.type = type;\n // special logic for tsx files\n if (ext === '.tsx') {\n if (!normalizedOptions.ts) normalizedOptions.ts = {};\n normalizedOptions.ts.jsx = true;\n }\n return detective;\n }\n\n // from global detector hook (legacy)\n if (detectorHook.isSupported(ext)) {\n const detector = detectorHook.getDetector(ext);\n if (detector) {\n fileInfo.type = ext;\n typeToDetective[ext] = detector.detect as Detective;\n return detector.detect as Detective;\n }\n }\n\n return undefined;\n};\n\n/**\n * Get the JS detective (amd/es6/cjs) for the given file info.\n * The type and ast of the file would be determined as well.\n */\nconst getJsDetector = (fileInfo: FileInfo, options?: Options): Detective | undefined => {\n if (!jsExt.includes(fileInfo.ext)) {\n return undefined;\n }\n\n if (typeof fileInfo.content !== 'object') {\n const walker = new Walker();\n try {\n fileInfo.ast = walker.parse(fileInfo.content);\n } catch (e: any) {\n debug('could not parse content: %s', e.message);\n throw e;\n }\n }\n\n const useContent = options?.useContent;\n const type = useContent ? getModuleType.fromSource(fileInfo.content) : getModuleType.fromSource(fileInfo.ast);\n const detector = typeToDetective[type];\n fileInfo.type = type;\n\n return detector;\n};\n\n/**\n * Normalize the deps into an array.\n */\nconst normalizeDeps = (deps: BuiltinDeps, includeCore?: boolean): string[] => {\n const normalizedDeps = Array.isArray(deps) ? deps : Object.keys(deps);\n return includeCore ? normalizedDeps : normalizedDeps.filter((d) => !isBuiltin(d));\n};\n\nconst getDepsFromFile = (filename: string, options?: Options): string[] => {\n const normalizedOptions: Options = assign({ includeCore: true }, options || {});\n const fileInfo = getFileInfo(filename);\n if (\n typeof fileInfo.content === 'string' &&\n (fileInfo.content.startsWith('// @bit-no-check') || fileInfo.content.startsWith('/* @bit-no-check'))\n ) {\n debug(`skipping file ${filename}, it has a @bit-no-check comment`);\n return [];\n }\n\n const detective = getDetector(fileInfo, normalizedOptions) || getJsDetector(fileInfo, normalizedOptions);\n if (!detective) {\n debug(`skipping unsupported file ${filename}`);\n return [];\n }\n debug('module type: ', fileInfo.type);\n\n const deps = detective(fileInfo.ast, normalizedOptions[fileInfo.type]);\n\n return normalizeDeps(deps, normalizedOptions?.includeCore);\n};\n\n/**\n * Finds the list of dependencies for the given file\n *\n * @param {String|Object} content - File's content or AST\n * @param {Object} [options]\n * @param {String} [options.type] - The type of content being passed in. Useful if you want to use a non-js detective\n * @return {String[]}\n */\n// eslint-disable-next-line complexity\nconst precinct = (content: string | object, options?: string | Options): BuiltinDeps => {\n // Legacy form backCompat where type was the second parameter\n const normalizedOptions: Options = typeof options === 'string' ? { type: options } : options || {};\n const type = normalizedOptions.type || '';\n\n debug('options given: ', normalizedOptions);\n\n const fileInfo: FileInfo = {\n content,\n ast: content,\n ext: type ? '' : '.js',\n type,\n };\n\n const detective = getDetector(fileInfo, normalizedOptions) || getJsDetector(fileInfo, normalizedOptions);\n if (!detective) {\n return [];\n }\n\n const deps = detective(fileInfo.ast, normalizedOptions[fileInfo.type]);\n // @ts-ignore\n precinct.ast = detective.ast || fileInfo.ast;\n\n return deps;\n};\n\nprecinct.paperwork = getDepsFromFile;\n\nexport default precinct;\n"],"mappings":";;;;;;AAGA,SAAAA,SAAA;EAAA,MAAAC,IAAA,GAAAC,sBAAA,CAAAC,OAAA;EAAAH,QAAA,YAAAA,CAAA;IAAA,OAAAC,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AACA,SAAAG,MAAA;EAAA,MAAAH,IAAA,GAAAC,sBAAA,CAAAC,OAAA;EAAAC,KAAA,YAAAA,CAAA;IAAA,OAAAH,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AAGA,SAAAI,QAAA;EAAA,MAAAJ,IAAA,GAAAE,OAAA;EAAAE,OAAA,YAAAA,CAAA;IAAA,OAAAJ,IAAA;EAAA;EAAA,OAAAA,IAAA;A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A,GAAAC,OAAA,CAAA3E,OAAA,GAEtBwE,QAAQ","ignoreList":[]}
|
|
@@ -45,7 +45,7 @@ type Options = {
|
|
|
45
45
|
};
|
|
46
46
|
|
|
47
47
|
type BuiltinDeps = string[] | Record<string, any>;
|
|
48
|
-
type Detective = (fileContent: string
|
|
48
|
+
type Detective = (fileContent: string, options?: any) => BuiltinDeps;
|
|
49
49
|
|
|
50
50
|
const jsExt = ['.js', '.jsx', '.cjs', '.mjs'];
|
|
51
51
|
|
package/package.json
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@teambit/dependencies",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.411",
|
|
4
4
|
"homepage": "https://bit.cloud/teambit/dependencies/dependencies",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"componentId": {
|
|
7
7
|
"scope": "teambit.dependencies",
|
|
8
8
|
"name": "dependencies",
|
|
9
|
-
"version": "1.0.
|
|
9
|
+
"version": "1.0.411"
|
|
10
10
|
},
|
|
11
11
|
"dependencies": {
|
|
12
12
|
"archy": "1.0.0",
|
|
@@ -20,37 +20,37 @@
|
|
|
20
20
|
"fs-extra": "10.0.0",
|
|
21
21
|
"semver": "7.5.2",
|
|
22
22
|
"debug": "4.3.4",
|
|
23
|
+
"resolve-dependency-path": "2.0.0",
|
|
24
|
+
"stylus-lookup": "3.0.2",
|
|
23
25
|
"detective-amd": "3.0.1",
|
|
24
26
|
"detective-stylus": "1.0.0",
|
|
25
27
|
"module-definition": "3.3.1",
|
|
26
28
|
"node-source-walk": "4.2.0",
|
|
27
|
-
"resolve-dependency-path": "2.0.0",
|
|
28
|
-
"stylus-lookup": "3.0.2",
|
|
29
29
|
"@teambit/harmony": "0.4.6",
|
|
30
30
|
"@teambit/component-id": "1.2.0",
|
|
31
31
|
"@teambit/bit-error": "0.0.404",
|
|
32
32
|
"@teambit/component-version": "1.0.3",
|
|
33
|
+
"@teambit/styling.deps-lookups.lookup-styling": "0.0.4",
|
|
34
|
+
"@teambit/typescript.deps-lookups.lookup-typescript": "0.0.2",
|
|
33
35
|
"@teambit/node.deps-detectors.detective-es6": "0.0.5",
|
|
34
|
-
"@teambit/styling.deps-detectors.detective-css": "0.0.
|
|
35
|
-
"@teambit/styling.deps-detectors.detective-less": "0.0.
|
|
36
|
-
"@teambit/styling.deps-detectors.detective-sass": "0.0.
|
|
37
|
-
"@teambit/styling.deps-detectors.detective-scss": "0.0.
|
|
36
|
+
"@teambit/styling.deps-detectors.detective-css": "0.0.6",
|
|
37
|
+
"@teambit/styling.deps-detectors.detective-less": "0.0.6",
|
|
38
|
+
"@teambit/styling.deps-detectors.detective-sass": "0.0.9",
|
|
39
|
+
"@teambit/styling.deps-detectors.detective-scss": "0.0.9",
|
|
38
40
|
"@teambit/typescript.deps-detectors.detective-typescript": "0.0.6",
|
|
39
|
-
"@teambit/
|
|
40
|
-
"@teambit/
|
|
41
|
-
"@teambit/
|
|
42
|
-
"@teambit/graph": "1.0.409",
|
|
43
|
-
"@teambit/aspect-loader": "1.0.409",
|
|
41
|
+
"@teambit/cli": "0.0.988",
|
|
42
|
+
"@teambit/graph": "1.0.411",
|
|
43
|
+
"@teambit/aspect-loader": "1.0.411",
|
|
44
44
|
"@teambit/component-package-version": "0.0.434",
|
|
45
|
-
"@teambit/dependency-resolver": "1.0.
|
|
46
|
-
"@teambit/dev-files": "1.0.
|
|
47
|
-
"@teambit/scope": "1.0.
|
|
48
|
-
"@teambit/workspace": "1.0.
|
|
49
|
-
"@teambit/component.sources": "0.0.
|
|
45
|
+
"@teambit/dependency-resolver": "1.0.411",
|
|
46
|
+
"@teambit/dev-files": "1.0.411",
|
|
47
|
+
"@teambit/scope": "1.0.411",
|
|
48
|
+
"@teambit/workspace": "1.0.411",
|
|
49
|
+
"@teambit/component.sources": "0.0.30",
|
|
50
50
|
"@teambit/legacy.utils": "0.0.5",
|
|
51
51
|
"@teambit/toolbox.path.path": "0.0.4",
|
|
52
52
|
"@teambit/component-issues": "0.0.150",
|
|
53
|
-
"@teambit/legacy.bit-map": "0.0.
|
|
53
|
+
"@teambit/legacy.bit-map": "0.0.34",
|
|
54
54
|
"@teambit/toolbox.fs.extension-getter": "0.0.1",
|
|
55
55
|
"@teambit/toolbox.fs.last-modified": "0.0.1"
|
|
56
56
|
},
|
|
@@ -66,8 +66,8 @@
|
|
|
66
66
|
"@types/mocha": "9.1.0",
|
|
67
67
|
"@teambit/defender.fs.global-bit-temp-dir": "0.0.1",
|
|
68
68
|
"@teambit/harmony.envs.core-aspect-env": "0.0.47",
|
|
69
|
-
"@teambit/component.testing.mock-components": "0.0.
|
|
70
|
-
"@teambit/harmony.testing.load-aspect": "0.0.
|
|
69
|
+
"@teambit/component.testing.mock-components": "0.0.236",
|
|
70
|
+
"@teambit/harmony.testing.load-aspect": "0.0.231",
|
|
71
71
|
"@teambit/workspace.testing.mock-workspace": "0.0.27"
|
|
72
72
|
},
|
|
73
73
|
"peerDependencies": {
|
|
File without changes
|