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 issue templates, reference codesandbox starters #16

Merged
merged 19 commits into from
Nov 17, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
19 commits
Select commit Hold shift + click to select a range
f6ef57b
migrate issue templates to issue forms
ChristianMurphy Nov 16, 2021
434228b
remove electron versions from issue form
ChristianMurphy Nov 16, 2021
6dd9e54
sort yarn versions in issue form
ChristianMurphy Nov 16, 2021
da489bd
sort npm versions in issue form
ChristianMurphy Nov 16, 2021
f5f7d65
correct capitization of webpack in issue form
ChristianMurphy Nov 16, 2021
5b00a76
Add remix to build tools in issue form
ChristianMurphy Nov 16, 2021
0de46eb
add sandbox templates to repository
ChristianMurphy Nov 16, 2021
d08bf8c
add extension to imports in sandbox starter, remove unneeded escapes
ChristianMurphy Nov 16, 2021
7891ea3
customize html template in sandbox template
ChristianMurphy Nov 16, 2021
f1382be
update evaluate example to use async api and a custom react hook
ChristianMurphy Nov 16, 2021
01d7be6
allow accessing all exports from useMDX hook
ChristianMurphy Nov 16, 2021
18af9a8
remove mdx loader sandbox for now
ChristianMurphy Nov 16, 2021
7880923
add next js example
ChristianMurphy Nov 16, 2021
5da7df5
link to mdx compile and run with next.js
ChristianMurphy Nov 16, 2021
90417dd
replace next js with compile and run, with next js example with mdx l…
ChristianMurphy Nov 17, 2021
9441f68
show import and jsx syntax in examples, update next config
ChristianMurphy Nov 17, 2021
253d547
add note to update dependencies
ChristianMurphy Nov 17, 2021
0776279
add node js evaluate example
ChristianMurphy Nov 17, 2021
327de5e
update color in sandbox
ChristianMurphy Nov 17, 2021
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
41 changes: 0 additions & 41 deletions .github/ISSUE_TEMPLATE/1-bug.md

This file was deleted.

145 changes: 145 additions & 0 deletions .github/ISSUE_TEMPLATE/1-bug.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,145 @@
name: 🐛 Bug report
description: Describe a problem

body:
- type: markdown
attributes:
value: |
Some general tips:

- Is this really a problem?
- Is this a problem here?
- Can this be solved in a different way?

- type: checkboxes
id: initial-checklist
attributes:
label: Initial checklist
options:
- label: I read the [support docs](https://mdxjs.com/support)
required: true
- label: I read the [contributing guide](https://mdxjs.com/contributing)
required: true
- label: I agree to follow the [code of conduct](https://github.com/mdx-js/.github/blob/HEAD/code-of-conduct.md)
required: true
- label: I searched [issues](https://github.com/search?q=user%3Amdx-js&type=Issues) and couldn’t find anything (or linked relevant results below)
required: true

- type: input
id: affected-versions
attributes:
label: Affected packages and versions
description: Please test using the latest version of the relevant packages to make sure your issue has not already been fixed.
validations:
required: true

- type: input
id: runnable-example
attributes:
label: Link to runnable example
description: |
Link to repository or sandbox with runnable example of the issue.

Some CodeSandbox starters:
- [MDX Loader with Next.js](https://codesandbox.io/s/github/mdx-js/.github/sandbox-templates/mdx-loader-next)
- [MDX Evaluate with Node.js](https://codesandbox.io/s/github/mdx-js/.github/sandbox-templates/mdx-evaulate-node)
- [MDX Evaluate with Create React App](https://codesandbox.io/s/github/mdx-js/.github/sandbox-templates/mdx-evaluate-create-react-app)

Alternatively, use the next section *Steps to reproduce*.
validations:
required: false

- type: textarea
id: steps-to-reproduce
attributes:
label: Steps to reproduce
description: How did this happen? Please provide a [minimal, reproducible example](https://stackoverflow.com/help/minimal-reproducible-example).
validations:
required: true

- type: textarea
id: expected-behavior
attributes:
label: Expected behavior
description: What should happen?
validations:
required: true

- type: textarea
id: actual-behavior
attributes:
label: Actual behavior
description: What happens instead?
validations:
required: true

- type: dropdown
id: javascript-runtime
attributes:
label: Runtime
description: |
What JavaScript runtime are you using to build or run the code?
**Note**: for ECMASCript modules (ESM) in Node, at minimum Node.js 12.20, 14.14, or 16.0 is required.
multiple: true
options:
- Node v17
- Node v16
- Node v14
- Node v12
- Deno
- Electron
- Other (please specify in steps to reproduce)
validations:
required: false

- type: dropdown
id: package-manager
attributes:
label: Package manager
description: What package manager are you using?
multiple: true
options:
- npm v8
- npm v6
- yarn v2
- yarn v1
- pnpm
- Other (please specify in steps to reproduce)
validations:
required: false

- type: dropdown
id: operating-system
attributes:
label: OS
description: What operating system are you using?
multiple: true
options:
- Windows
- Linux
- macOS
- Other (please specify in steps to reproduce)
validations:
required: false

- type: dropdown
id: build-tools
attributes:
label: Build and bundle tools
description: What, if any, tools are used to build or bundle the project?
multiple: true
options:
- webpack
- Rollup
- esbuild
- Parcel
- Create React App
- Gatsby
- Next.js
ChristianMurphy marked this conversation as resolved.
Show resolved Hide resolved
- Remix
- Docusaurus
- Snowpack
- Vite
- Other (please specify in steps to reproduce)
validations:
required: false
31 changes: 0 additions & 31 deletions .github/ISSUE_TEMPLATE/2-feature.md

This file was deleted.

49 changes: 49 additions & 0 deletions .github/ISSUE_TEMPLATE/2-feature.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
name: 🚀 Feature request
description: Suggest an idea

body:
- type: markdown
attributes:
value: |
Some general tips:

- Is this really a problem?
- Is this a problem here?

- type: checkboxes
id: initial-checklist
attributes:
label: Initial checklist
options:
- label: I read the [support docs](https://mdxjs.com/support)
required: true
- label: I read the [contributing guide](https://mdxjs.com/contributing)
required: true
- label: I agree to follow the [code of conduct](https://github.com/mdx-js/.github/blob/HEAD/code-of-conduct.md)
required: true
- label: I searched [issues](https://github.com/search?q=user%3Amdx-js&type=Issues) and couldn’t find anything (or linked relevant results below)
required: true

- type: textarea
id: problem
attributes:
label: Problem
description: Please describe the problem you are trying to solve here.
validations:
required: true

- type: textarea
id: solution
attributes:
label: Solution
description: What should happen? Please describe the desired behavior.
validations:
required: true

- type: textarea
id: alternatives
attributes:
label: Alternatives
description: What are the alternative solutions? Can this be solved in a different way?
validations:
required: true
27 changes: 27 additions & 0 deletions sandbox-templates/mdx-evaluate-create-react-app/package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
{
"name": "mdx-evaluate-create-react-app",
"version": "1.0.0",
"license": "MIT",
"private": true,
"dependencies": {
"@mdx-js/mdx": "2.0.0-rc.2",
"react": "17.0.2",
ChristianMurphy marked this conversation as resolved.
Show resolved Hide resolved
"react-dom": "17.0.2",
"react-scripts": "5.0.0-next.47"
},
"devDependencies": {
"@babel/runtime": "7.13.8",
"typescript": "4.1.3"
},
"scripts": {
"start": "react-scripts start",
"build": "react-scripts build",
"test": "react-scripts test --env=jsdom"
},
"browserslist": [
">0.2%",
"not dead",
"not ie <= 11",
"not op_mini all"
]
}
14 changes: 14 additions & 0 deletions sandbox-templates/mdx-evaluate-create-react-app/public/index.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
<!doctype html>
<html>
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>MDX + CRA</title>
</head>
<body>
<noscript>
You need to enable JavaScript to run this app.
</noscript>
<div id="root"></div>
</body>
</html>
31 changes: 31 additions & 0 deletions sandbox-templates/mdx-evaluate-create-react-app/src/App.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
// ⚠️ Important! Please make sure the dependencies are up to date.
// You can refresh them in the Dependencies section (left-bottom on CodeSandbox)

import { useEffect, useState } from "react";
wooorm marked this conversation as resolved.
Show resolved Hide resolved
import * as runtime from "react/jsx-runtime";
ChristianMurphy marked this conversation as resolved.
Show resolved Hide resolved
import { evaluate } from "@mdx-js/mdx";

const mdxContent = `
export const planet = 'World'

# Hello, {planet}!

* list
* item
`;

function useMDX(content) {
ChristianMurphy marked this conversation as resolved.
Show resolved Hide resolved
const [exports, setExports] = useState({ default: runtime.Fragment });

useEffect(() => {
evaluate(mdxContent, { ...runtime }).then((exports) => setExports(exports));
}, [content]);

return exports;
}

export default function App() {
const exports = useMDX(mdxContent);
const Content = exports.default;
return <Content />;
}
12 changes: 12 additions & 0 deletions sandbox-templates/mdx-evaluate-create-react-app/src/index.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
import { StrictMode } from "react";
import ReactDOM from "react-dom";

import App from "./App.js";

const rootElement = document.getElementById("root");
ReactDOM.render(
<StrictMode>
<App />
</StrictMode>,
rootElement
);
17 changes: 17 additions & 0 deletions sandbox-templates/mdx-evaulate-node/index.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
// ⚠️ Important! Please make sure the dependencies are up to date.
// You can refresh them in the Dependencies section (left-bottom on CodeSandbox)

import http from "node:http";
import * as runtime from "react/jsx-runtime.js";
import ReactDom from "react-dom/server.js";
import { evaluate } from "@mdx-js/mdx";

// Note: refresh the pane on the right to see changes.

http
.createServer(async function (_, res) {
const content = "Hi <span style={{color: 'tomato'}}>there</span>!";
const { default: Content } = await evaluate(content, runtime);
ReactDom.renderToNodeStream(Content()).pipe(res);
})
.listen(8080);
16 changes: 16 additions & 0 deletions sandbox-templates/mdx-evaulate-node/package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
{
"name": "node-http-server",
"version": "1.0.0",
"license": "MIT",
"private": true,
"type": "module",
"scripts": {
"start": "nodemon index.js"
},
"dependencies": {
"@mdx-js/mdx": "2.0.0-rc.2",
"nodemon": "2.0.15",
"react": "17.0.2",
"react-dom": "17.0.2"
}
}
Loading