question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. ItΒ collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Do we want to generate MDX and test files for all generated files?

See original GitHub issue

Right now only the Component generator creates MDX and test files along side the actual component JS file. Do we want to create them for Pages, Cells, Services, etc?

If we do create them for Services we’ll probably want to start putting them in a subdirectory just like we do for components. Otherwise we’re going to have a LOT of files in that one directory.

.
β”œβ”€β”€ prisma
β”‚   β”œβ”€β”€ dev.db
β”‚   β”œβ”€β”€ migrations
β”‚   β”œβ”€β”€ schema.prisma
β”‚   └── seeds.js
└── src
    β”œβ”€β”€ functions
    β”‚   └── graphql.js
    β”œβ”€β”€ graphql
    β”‚   β”œβ”€β”€ contacts.sdl.js
    β”‚   └── posts.sdl.js
    └── services
        β”œβ”€β”€ contacts
        β”‚   β”œβ”€β”€ contacts.js
        β”‚   β”œβ”€β”€ contacts.mdx
        β”‚   └── contacts.test.js
        └── posts
            β”œβ”€β”€ posts.js
            β”œβ”€β”€ posts.mdx
            └── posts.test.js

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Comments:11 (11 by maintainers)

github_iconTop GitHub Comments

1reaction
mojombocommented, Feb 22, 2020

I would add test files, but not mdx files right now. Rob is right that it’s important to get people into the β€œeverything in one directory” mindset right away, and we can put simple test stubs in there without causing any problems. I expect we’ll get some proper testing methodology going soon after we launch, it’s high priority. I would also NOT produce mdx files for anything right now. When we integrate Storybook, we can add mdx in all the right places.

0reactions
cannikincommented, Feb 22, 2020

Created #137 to handle this. Closing this one, we can revisit MDX files in the future.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Generated mdx file
This library encourages your applications to be more accessible and allows you to get your tests closer to using your components the way...
Read more >
Tested live documentation is a thing with MDX, Docz and ...
I will place my spec files right in components folder to be next to the source code Button.jsx and its documentation Button.mdx files....
Read more >
Build a MDX-powered blog with Contentlayer and Next
In this article, we'll learn how to use Next.js and Contentlayer to create a static MDX blogging site in this tutorial. We'll discuss...
Read more >
Use MDX in Next.js to Dynamically Create Pages for a Blog
Learn how to source MDX content in Next.js to dynamically create pages for a blog.
Read more >
How to Source MDX Content in Next.js to Dynamically ...
To learn how to add MDX to a project, we're going first source a few MDX files, using blog posts as an example,...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found