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

add build & runtime debug logging #1321

Closed
wants to merge 3 commits into from

Conversation

axe312ger
Copy link
Contributor

Description

Adds support for the debug module to the project.

Via DEBUG=docz* you now get:

  • While building:
    • The actual file matching patterns applied
    • The matched files from these patterns
    • The list of filtered components
  • In Browser:
    • A list of components available in state
    • The pattern matched for locating the correct component

It simplifies the component matching in the Props component as well.

Post merge todos:

@axe312ger
Copy link
Contributor Author

@rakannimer I struggle to run the e2e tests in dev mode on my machine. Do i need to start the basic example as server or sth?

rakannimer
rakannimer previously approved these changes Dec 16, 2019
@rakannimer rakannimer dismissed their stale review December 16, 2019 07:34

failing tests

@rakannimer
Copy link
Contributor

rakannimer commented Dec 16, 2019

It looks like the props are not being rendered properly in the basic example, it seems something broke in the docz package here : https://github.com/doczjs/docz/pull/1321/files#diff-5cc2196461930cb24939fb44764d656bL121

How are e2e-tests failing on your setup ? Did you try running

yarn packages && node other-packages/e2e-tests/index.js

You can also try running the basic example with the dev-env by running :

yarn
cd dev-env/basic
yarn
node dev.js

The alert props should be missing if the test output is correct.

@axe312ger
Copy link
Contributor Author

Both fail 😅

yarn packages && node other-packages/index.js
...
docz-core: Test Suites: 4 passed, 4 total
docz-core: Tests:       16 passed, 16 total
docz-core: Snapshots:   0 total
docz-core: Time:        6.546s, estimated 8s
docz-core: Ran all test suites.
docz-core: ⚠  warning   No cache was found with your props definitions
docz-core: ⚠  warning   We'll parse your components to get props from them
docz-core: ⚠  warning   Depending on your components, this could take while...
lerna success run Ran npm script 'test' in 4 packages in 8.1s:
lerna success - docz-core
lerna success - rehype-docz
lerna success - remark-docz
lerna success - babel-plugin-export-metadata
✨  Done in 43.03s.
internal/modules/cjs/loader.js:716
    throw err;
    ^

Error: Cannot find module '/Users/bene/dev/opensource/docz/other-packages/index.js'
    at Function.Module._resolveFilename (internal/modules/cjs/loader.js:713:15)
    at Function.Module._load (internal/modules/cjs/loader.js:618:27)
    at Function.Module.runMain (internal/modules/cjs/loader.js:931:10)
    at internal/main/run_main_module.js:17:11 {
  code: 'MODULE_NOT_FOUND',
  requireStack: []
}

You can also try running the basic example with the dev-env by running :

yarn
cd dev-env/basic
yarn
node dev.js
[2019-12-16 11:20:52] waiting for changes...

Building app

 ERROR #10123  CONFIG

We encountered an error while trying to load your site's gatsby-config. Please fix the error and try again.



  TypeError: mergeWith is not a function

@axe312ger
Copy link
Contributor Author

when executing e2e-tests:

$ node index.js
Running npx verdaccio
Waiting for Verdaccio to boot
npm ERR! code ECONNREFUSED
npm ERR! errno ECONNREFUSED
npm ERR! FetchError: request to http://localhost:4873/verdaccio failed, reason: connect ECONNREFUSED 127.0.0.1:4873
npm ERR!     at ClientRequest.<anonymous> (/Users/bene/.nvm/versions/node/v12.8.1/lib/node_modules/npm/node_modules/node-fetch-npm/src/index.js:68:14)
npm ERR!     at ClientRequest.emit (events.js:203:13)
npm ERR!     at Socket.socketErrorListener (_http_client.js:399:9)
npm ERR!     at Socket.emit (events.js:203:13)
npm ERR!     at emitErrorNT (internal/streams/destroy.js:91:8)
npm ERR!     at emitErrorAndCloseNT (internal/streams/destroy.js:59:3)
npm ERR!     at processTicksAndRejections (internal/process/task_queues.js:77:11)
npm ERR!  FetchError: request to http://localhost:4873/verdaccio failed, reason: connect ECONNREFUSED 127.0.0.1:4873
npm ERR!     at ClientRequest.<anonymous> (/Users/bene/.nvm/versions/node/v12.8.1/lib/node_modules/npm/node_modules/node-fetch-npm/src/index.js:68:14)
npm ERR!     at ClientRequest.emit (events.js:203:13)
npm ERR!     at Socket.socketErrorListener (_http_client.js:399:9)
npm ERR!     at Socket.emit (events.js:203:13)
npm ERR!     at emitErrorNT (internal/streams/destroy.js:91:8)
npm ERR!     at emitErrorAndCloseNT (internal/streams/destroy.js:59:3)
npm ERR!     at processTicksAndRejections (internal/process/task_queues.js:77:11) {
npm ERR!   message: 'request to http://localhost:4873/verdaccio failed, reason: connect ECONNREFUSED 127.0.0.1:4873',
npm ERR!   type: 'system',
npm ERR!   errno: 'ECONNREFUSED',
npm ERR!   code: 'ECONNREFUSED',
npm ERR!   stack: 'FetchError: request to http://localhost:4873/verdaccio failed, reason: connect ECONNREFUSED 127.0.0.1:4873\n' +
npm ERR!     '    at ClientRequest.<anonymous> (/Users/bene/.nvm/versions/node/v12.8.1/lib/node_modules/npm/node_modules/node-fetch-npm/src/index.js:68:14)\n' +
npm ERR!     '    at ClientRequest.emit (events.js:203:13)\n' +
npm ERR!     '    at Socket.socketErrorListener (_http_client.js:399:9)\n' +
npm ERR!     '    at Socket.emit (events.js:203:13)\n' +
npm ERR!     '    at emitErrorNT (internal/streams/destroy.js:91:8)\n' +
npm ERR!     '    at emitErrorAndCloseNT (internal/streams/destroy.js:59:3)\n' +
npm ERR!     '    at processTicksAndRejections (internal/process/task_queues.js:77:11)'
npm ERR! }
npm ERR!
npm ERR! If you are behind a proxy, please make sure that the
npm ERR! 'proxy' config is set properly.  See: 'npm help config'

@rakannimer
Copy link
Contributor

Could you pull from master and try running the dev-env again ? There was an outdated dependency that should be fixed now.

Not sure what's happening when you're running e2e-tests 🤔

@axe312ger
Copy link
Contributor Author

Nice thanks! The basic demo is running now! Can reproduce the issue. Will check and push a fix :)

debug(keys)

const found = keys.find(key => {
return !!matchingPatterns.find(pattern => key.includes(pattern))

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

CircleCI is probably breaking here. I would recommend checking the PR again and analyzing where exactly it is breaking.

@axe312ger
Copy link
Contributor Author

axe312ger commented Feb 18, 2020

Hey there.

I moved on and I am no more using docz in my projects. Therefore I have no time to work on this PR anymore.

Feel free to take it over, otherwise just close it

@stale
Copy link

stale bot commented Apr 18, 2020

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

@stale stale bot added the stale label Apr 18, 2020
@stale stale bot closed this Apr 25, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants