itwillwork / ostap Goto Github PK
View Code? Open in Web Editor NEWCLI tool that fast checks if your bundle contains multiple versions of the same package, only by looking in package.json.
CLI tool that fast checks if your bundle contains multiple versions of the same package, only by looking in package.json.
It will be better to use default path for ./package.json
and show error if file was not found in same folder
$ ostap -s
to avoid error like this:
error: missing required args for command `<file>`
Hi,
I tried it with command ostap ./package.json -d
After 2 mins the app crashed with an error below
⠴ analyzing source dependencies tree
<--- Last few GCs --->
[23721:0x102881000] 51029 ms: Mark-sweep 1331.5 (1448.2) -> 1321.4 (1450.2) MB, 468.9 / 0.0 ms (average mu = 0.190, current mu = 0.111) allocation failure scavenge might not succeed
[23721:0x102881000] 52341 ms: Mark-sweep 1334.2 (1450.2) -> 1324.0 (1453.2) MB, 1241.9 / 0.0 ms (average mu = 0.096, current mu = 0.053) allocation failure scavenge might not succeed
<--- JS stacktrace --->
==== JS stack trace =========================================
0: ExitFrame [pc: 0x14e6b774fc7d]
1: StubFrame [pc: 0x14e6b770fcbc]
Security context: 0x0acdb881d9d1 <JSObject>
2: /* anonymous */(aka /* anonymous */) [0xacdc08ca9b1] [/usr/local/lib/node_modules/ostap/node_modules/dependencies-tree-builder/src/tree_factory.js:~18] [pc=0x14e6b79bb9f4](this=0x0acd713825b1 <undefined>,0x0acdc08ca991 <JSArray[2]>)
3: /* anonymous */ [0xacdc08ea5c9](this=0x0acdec8845f9 <JSGlobal Object>,0x0ac...
FATAL ERROR: Ineffective mark-compacts near heap limit Allocation failed - JavaScript heap out of memory
Writing Node.js report to file: report.20190329.100318.23721.0.001.json
Node.js report completed
1: 0x10006778e node::Abort() [/usr/local/bin/node]
2: 0x100067ede node::errors::TryCatchScope::~TryCatchScope() [/usr/local/bin/node]
3: 0x1001b5ec7 v8::Utils::ReportOOMFailure(v8::internal::Isolate*, char const*, bool) [/usr/local/bin/node]
4: 0x1001b5e64 v8::internal::V8::FatalProcessOutOfMemory(v8::internal::Isolate*, char const*, bool) [/usr/local/bin/node]
5: 0x1005bcda2 v8::internal::Heap::FatalProcessOutOfMemory(char const*) [/usr/local/bin/node]
6: 0x1005bf2d3 v8::internal::Heap::CheckIneffectiveMarkCompact(unsigned long, double) [/usr/local/bin/node]
7: 0x1005bb808 v8::internal::Heap::PerformGarbageCollection(v8::internal::GarbageCollector, v8::GCCallbackFlags) [/usr/local/bin/node]
8: 0x1005b99c5 v8::internal::Heap::CollectGarbage(v8::internal::AllocationSpace, v8::internal::GarbageCollectionReason, v8::GCCallbackFlags) [/usr/local/bin/node]
9: 0x1005c626c v8::internal::Heap::AllocateRawWithLightRetry(int, v8::internal::AllocationSpace, v8::internal::AllocationAlignment) [/usr/local/bin/node]
10: 0x1005c62ef v8::internal::Heap::AllocateRawWithRetryOrFail(int, v8::internal::AllocationSpace, v8::internal::AllocationAlignment) [/usr/local/bin/node]
11: 0x1005954e4 v8::internal::Factory::NewFillerObject(int, bool, v8::internal::AllocationSpace) [/usr/local/bin/node]
12: 0x100847d84 v8::internal::Runtime_AllocateInNewSpace(int, v8::internal::Object**, v8::internal::Isolate*) [/usr/local/bin/node]
13: 0x14e6b774fc7d
[1] 23721 abort ostap ./package.json -d
Crash report:
report.20190329.101907.26595.0.001.json.zip
It will be very helpful!
Just tried this using Node.js v7.9.0
$ ostap ./package.json -d
/home/dli/.config/yarn/global/node_modules/ostap/cli.js:89
let options = { ...DEFAULT_OPTIONS };
^^^
SyntaxError: Unexpected token ...
at createScript (vm.js:53:10)
at Object.runInThisContext (vm.js:95:10)
at Module._compile (module.js:543:28)
at Object.Module._extensions..js (module.js:580:10)
at Module.load (module.js:488:32)
at tryModuleLoad (module.js:447:12)
at Function.Module._load (module.js:439:3)
at Module.runMain (module.js:605:10)
at run (bootstrap_node.js:423:7)
at startup (bootstrap_node.js:147:9)
Working fine with the latest version of Node.js (v11.11.0
)
$ nvm use node
Now using node v11.11.0 (npm v6.7.0)
d4nyll:~/projects/conversation-service/service$ ostap ./package.json -d
✔ source tree: zero duplicates
🎉 well done! zero duplicates
✔ done, 0.859s
✔ optimal tree: zero duplicates
well done, not found duplicates
bye
It'll be a good idea to specify engines
in your package.json
to indicated the supported versions of Node.js
Hi! Tried just launch in my project and got following error with infinity process
↵ SIGINT(2) ostap ./package.json
✔ source tree: 1 duplicates found, and they have 1 copies
⠋ optimizing... ERROR
processing error
TypeError: Cannot read property 'data' of undefined
⠸ optimizing...
Macbook Pro OS Mojave 10.14.4
iTerm 2 with oh-my-zsh
Hello.
Some problem with CRA + Typescript analyzing :(
My package.json
:
{
"name": "app-frontend",
"version": "0.1.0",
"private": true,
"dependencies": {
"@fortawesome/fontawesome-svg-core": "^1.2.17",
"@fortawesome/free-brands-svg-icons": "^5.8.1",
"@fortawesome/free-solid-svg-icons": "^5.8.1",
"@fortawesome/react-fontawesome": "^0.1.4",
"@types/yup": "^0.26.12",
"animate.css": "^3.7.0",
"axios": "^0.18.0",
"formik": "^1.5.1",
"react": "^16.8.6",
"react-dom": "^16.8.6",
"react-router-dom": "^5.0.0",
"react-scripts": "2.1.8",
"stickyfilljs": "^2.1.0",
"webfontloader": "^1.6.28",
"yup": "^0.27.0"
},
"devDependencies": {
"@types/jest": "24.0.11",
"@types/node": "11.11.6",
"@types/react": "16.8.8",
"@types/react-dom": "16.8.3",
"@types/react-router": "^4.4.5",
"@types/react-router-dom": "^4.3.1",
"@types/webfontloader": "^1.6.29",
"node-sass": "^4.11.0",
"prettier": "^1.16.4",
"typescript": "3.3.4000"
},
"scripts": {
"start": "react-scripts start",
"build": "react-scripts build",
"test": "react-scripts test"
},
"eslintConfig": {
"extends": "react-app"
},
"browserslist": [
">1%",
"not dead",
"not ie <= 11",
"not op_mini all"
]
}
When I run ostap
for my package.json
:
$ ostap ./package.json -s
⠏ analyzing source dependencies tree
CLI is freezed and after ~3 min, I see:
<--- Last few GCs --->
[4750:0x105000c00] 42294 ms: Mark-sweep 1323.6 (1452.3) -> 1312.5 (1453.8) MB, 570.0 / 0.0 ms (average mu = 0.144, current mu = 0.059) allocation failure scavenge might not succeed
[4750:0x105000c00] 42887 ms: Mark-sweep 1325.9 (1453.8) -> 1315.8 (1455.3) MB, 550.9 / 0.0 ms (average mu = 0.108, current mu = 0.071) allocation failure scavenge might not succeed
<--- JS stacktrace --->
==== JS stack trace =========================================
0: ExitFrame [pc: 0x267e188dbe3d]
1: StubFrame [pc: 0x267e188934b0]
Security context: 0x1a5e2609e6e1 <JSObject>
2: /* anonymous */(aka /* anonymous */) [0x1a5ec8816a69] [/usr/local/lib/node_modules/ostap/node_modules/dependencies-tree-builder/src/tree_factory.js:~18] [pc=0x267e18e4613b](this=0x1a5ed69826f1 <undefined>,/* anonymous */=0x1a5ed6982801 <the_hole>)
3: /* anonymous */ [0x1a5ec8816df9](this=0x1a5e1a51ad11 <JSGlob...
FATAL ERROR: Ineffective mark-compacts near heap limit Allocation failed - JavaScript heap out of memory
1: 0x1000387af node::Abort() [/usr/local/opt/node@10/bin/node]
2: 0x100038980 node::FatalTryCatch::~FatalTryCatch() [/usr/local/opt/node@10/bin/node]
3: 0x10016eee3 v8::Utils::ReportOOMFailure(v8::internal::Isolate*, char const*, bool) [/usr/local/opt/node@10/bin/node]
4: 0x10016ee84 v8::internal::V8::FatalProcessOutOfMemory(v8::internal::Isolate*, char const*, bool) [/usr/local/opt/node@10/bin/node]
5: 0x10041fdf4 v8::internal::Heap::UpdateSurvivalStatistics(int) [/usr/local/opt/node@10/bin/node]
6: 0x1004219c3 v8::internal::Heap::CheckIneffectiveMarkCompact(unsigned long, double) [/usr/local/opt/node@10/bin/node]
7: 0x10041f0ff v8::internal::Heap::PerformGarbageCollection(v8::internal::GarbageCollector, v8::GCCallbackFlags) [/usr/local/opt/node@10/bin/node]
8: 0x10041df4c v8::internal::Heap::CollectGarbage(v8::internal::AllocationSpace, v8::internal::GarbageCollectionReason, v8::GCCallbackFlags) [/usr/local/opt/node@10/bin/node]
9: 0x10042642f v8::internal::Heap::AllocateRawWithLigthRetry(int, v8::internal::AllocationSpace, v8::internal::AllocationAlignment) [/usr/local/opt/node@10/bin/node]
10: 0x10042673c v8::internal::Heap::AllocateRawWithRetryOrFail(int, v8::internal::AllocationSpace, v8::internal::AllocationAlignment) [/usr/local/opt/node@10/bin/node]
11: 0x100406cef v8::internal::Factory::NewFillerObject(int, bool, v8::internal::AllocationSpace) [/usr/local/opt/node@10/bin/node]
12: 0x1005e000e v8::internal::Runtime_AllocateInNewSpace(int, v8::internal::Object**, v8::internal::Isolate*) [/usr/local/opt/node@10/bin/node]
13: 0x267e188dbe3d
14: 0x267e188934b0
15: 0x267e18e4613b
I have macOS 10.13.6 and Node.js 10.15.2.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.