Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

BUG: hidden app roots (v2) #107

Merged
merged 59 commits into from
Mar 26, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
59 commits
Select commit Hold shift + click to select a range
1d01023
Add regression test fixture. Still need regression test.
ryan-roemer Feb 26, 2019
12a6b6b
Add regression tests
ryan-roemer Feb 26, 2019
4146d0b
Remove unneeded alias
ryan-roemer Feb 26, 2019
b702591
Remove unneeded resolve too
ryan-roemer Feb 26, 2019
b31f0ea
Fix lint
ryan-roemer Feb 26, 2019
85189a4
Fix fixture pkg.main
ryan-roemer Feb 27, 2019
fe90927
WIP: Start enhancing regression test and debugging.
ryan-roemer Feb 27, 2019
4312602
WIP: Fix fixture stuff and get new error for 'yarn test' to run next
ryan-roemer Feb 27, 2019
1d42e9b
Get tests back to passing state with skips, etc.
ryan-roemer Feb 27, 2019
b948902
Add more regression test skeletons
ryan-roemer Feb 27, 2019
ec38037
WIP: Getting closer to cache-based solution
ryan-roemer Mar 14, 2019
6268b19
Cleanup up and comment out WIP bugfix work for clean push.
ryan-roemer Mar 14, 2019
af184c8
Experiment: Remove rootPath parameter
ryan-roemer Mar 14, 2019
a4601a5
Add unit test for readPackages
ryan-roemer Mar 15, 2019
23c748c
Start adding _findPackage tests and remove resolves
ryan-roemer Mar 15, 2019
db2d2ec
Add serial promise utility.
ryan-roemer Mar 15, 2019
cf71cb8
Switch to serial traversal
ryan-roemer Mar 15, 2019
c8b6357
More comments
ryan-roemer Mar 15, 2019
564c598
more envvar
ryan-roemer Mar 15, 2019
0ae24a2
Get tests up and running with manually hacked in extra project root
ryan-roemer Mar 15, 2019
7d8eb96
Various cleanup
ryan-roemer Mar 15, 2019
be36368
Start adding tests for _packageRoots
ryan-roemer Mar 16, 2019
0a61c7c
Add failing test
ryan-roemer Mar 16, 2019
6f6f879
Add more notes
ryan-roemer Mar 16, 2019
a251bda
more notes
ryan-roemer Mar 16, 2019
2dc042a
WIP/experiment with tempPotentialAppRoots
ryan-roemer Mar 16, 2019
c4dd88a
WIP: More notes
ryan-roemer Mar 16, 2019
f554117
Clean up _packageRoots
ryan-roemer Mar 18, 2019
57a37fe
Refactor _packageRoots to be async
ryan-roemer Mar 18, 2019
5b926ef
Introspect potential roots for package.json
ryan-roemer Mar 18, 2019
2a671a8
Refactor to better names
ryan-roemer Mar 18, 2019
871bba1
Note about mocking
ryan-roemer Mar 18, 2019
8d05fda
Make test win compatible
ryan-roemer Mar 18, 2019
b334b96
Continue base refactoring / test work
ryan-roemer Mar 18, 2019
a610b95
Actually handle hidden application roots
ryan-roemer Mar 18, 2019
7840c9f
Implement start of fix (unsorted still).
ryan-roemer Mar 18, 2019
fd73d27
Add skipped failing test
ryan-roemer Mar 18, 2019
6511703
More todo notes
ryan-roemer Mar 18, 2019
88c9566
Fix duplicate hidden roots issue
ryan-roemer Mar 18, 2019
c4d3260
Update travis urls post-migration
ryan-roemer Mar 19, 2019
09d208d
WIP for new app roots failing thing.
ryan-roemer Mar 19, 2019
1047361
More notes
ryan-roemer Mar 19, 2019
a14c567
WIP: Normalize root paths, and check everything for package.json
ryan-roemer Mar 20, 2019
f6b2bde
WIP: Add more normalization and lint stuff
ryan-roemer Mar 20, 2019
300b1a2
Only add unique modules to versions output
ryan-roemer Mar 20, 2019
64fa435
Start adding tests and cleaning up TODOs
ryan-roemer Mar 21, 2019
7415d52
Clean up TODOs
ryan-roemer Mar 21, 2019
dd6763a
More TODO cleanup
ryan-roemer Mar 21, 2019
592a36c
More cleanup
ryan-roemer Mar 21, 2019
54c49a5
more cleanup
ryan-roemer Mar 21, 2019
25a6f8a
Move webpack token removal
ryan-roemer Mar 21, 2019
32caab0
WIP: Broken. More common path work.
ryan-roemer Mar 22, 2019
3e3a381
Switch package roots to common root.
ryan-roemer Mar 24, 2019
275afad
Add commonRoot meta
ryan-roemer Mar 24, 2019
e102e43
Implement test
ryan-roemer Mar 24, 2019
373be80
Clean up todos
ryan-roemer Mar 24, 2019
b3567ef
Fix test
ryan-roemer Mar 25, 2019
1741c97
Add warning guardrails for expect vs actual matched sources for dupli…
ryan-roemer Mar 25, 2019
18bd729
Make tests windows friendly
ryan-roemer Mar 25, 2019
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 13 additions & 7 deletions HISTORY.md
Original file line number Diff line number Diff line change
@@ -1,21 +1,27 @@
History
=======

## UNRELEASED

* Add `commonRoot` to `versions` metadata to indicate what installed paths are relative to.
* BUG: Detect hidden application roots for things like `yarn` workspaces that are completely flattened.
[#103](https://github.com/FormidableLabs/inspectpack/issues/103)

## 4.1.2

- BUG: Use `name` field to better process `identifier` to remove things like
* BUG: Use `name` field to better process `identifier` to remove things like
`/PATH/TO/node_modules/font-awesome/font-awesome.css 0"`. May result in some
`baseName`s being identical despite different `identifier`s because of
loaders and generated code.

## 4.1.1

- BUG: A loader in the `identifier` field would incorrectly have all modules inferred "as a `node_modules` file", even if not. Implements a naive loader stripping heuristic to correctly assess if `node_modules` or real application source.
- Optimizes internal calls to `_isNodeModules()` from 2 to 1 for better performance.
* BUG: A loader in the `identifier` field would incorrectly have all modules inferred "as a `node_modules` file", even if not. Implements a naive loader stripping heuristic to correctly assess if `node_modules` or real application source.
* Optimizes internal calls to `_isNodeModules()` from 2 to 1 for better performance.

## 4.1.0

- Add `emitHandler` option to `DuplicatesPlugin` to allow customized output.
* Add `emitHandler` option to `DuplicatesPlugin` to allow customized output.

## 4.0.1

Expand All @@ -29,7 +35,7 @@ History
* `--action=versions`:
* _Reports_: The `tsv` and `text` reports have now changed to reflect
dependencies hierarchies as _installed_ (e.g., `scoped@1.2.3 ->
flattened-foo@1.1.1 -> @scope/foo@1.1.1`) to a semever range meaning
flattened-foo@1.1.1 -> @scope/foo@1.1.1`) to a semver range meaning
something like as _depended_ (e.g., `scoped@1.2.3 -> flattened-foo@^1.1.0
-> @scope/foo@^1.1.1`). We expect that this change will provide much more
useful information as to how and why your dependency graph impacts what is
Expand Down Expand Up @@ -57,9 +63,9 @@ History

### Miscellaneous

- Updated README.md with note that `--action=versions` is not filtered to only
* Updated README.md with note that `--action=versions` is not filtered to only
packages that would have files show up in the `--action=duplicates` report.
- Update `--action=versions` logic to explicitly use `semver-compare` for sort
* Update `--action=versions` logic to explicitly use `semver-compare` for sort
order.

## 3.0.0
Expand Down
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -486,8 +486,8 @@ Other tools that inspect Webpack bundles:

[npm_img]: https://badge.fury.io/js/inspectpack.svg
[npm_site]: http://badge.fury.io/js/inspectpack
[trav_img]: https://api.travis-ci.org/FormidableLabs/inspectpack.svg
[trav_site]: https://travis-ci.org/FormidableLabs/inspectpack
[trav_img]: https://api.travis-ci.com/FormidableLabs/inspectpack.svg
[trav_site]: https://travis-ci.com/FormidableLabs/inspectpack
[appveyor_img]: https://ci.appveyor.com/api/projects/status/github/formidablelabs/inspectpack?branch=master&svg=true
[appveyor_site]: https://ci.appveyor.com/project/FormidableLabs/inspectpack
[cov]: https://codecov.io
Expand Down
6 changes: 6 additions & 0 deletions src/lib/actions/base.ts
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,9 @@ export const _isNodeModules = (name: string): boolean => nodeModulesParts(name).
// First, strip off anything before a `?` and `!`:
// - `REMOVE?KEEP`
// - `REMOVE!KEEP`
//
// TODO(106): Revise code and tests for `fullPath`.
// https://github.com/FormidableLabs/inspectpack/issues/106
export const _normalizeWebpackPath = (identifier: string, name?: string): string => {
const bangLastIdx = identifier.lastIndexOf("!");
const questionLastIdx = identifier.lastIndexOf("?");
Expand All @@ -63,6 +66,9 @@ export const _normalizeWebpackPath = (identifier: string, name?: string): string
candidate = candidate.substr(prefixEnd + 1);
}

// Naive heuristic: remove known starting webpack tokens.
candidate = candidate.replace(/^(multi |ignored )/, "");

// Assume a normalized then truncate to name if applicable.
//
// E.g.,
Expand Down
Loading