Skip to content

Commit 4ae799c

Browse files
committed
.
0 parents  commit 4ae799c

File tree

12 files changed

+647
-0
lines changed

12 files changed

+647
-0
lines changed

.editorconfig

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
root = true
2+
3+
[*]
4+
indent_style = space
5+
indent_size = 2
6+
end_of_line = lf
7+
charset = utf-8
8+
trim_trailing_whitespace = true
9+
insert_final_newline = true

.github/workflows/main.yml

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
name: main
2+
on:
3+
- pull_request
4+
- push
5+
jobs:
6+
main:
7+
name: ${{matrix.node}}
8+
runs-on: ubuntu-latest
9+
steps:
10+
- uses: actions/checkout@v2
11+
- uses: dcodeIO/setup-node-nvm@master
12+
with:
13+
node-version: ${{matrix.node}}
14+
- run: npm install
15+
- run: npm test
16+
- uses: codecov/codecov-action@v1
17+
strategy:
18+
matrix:
19+
node:
20+
- lts/dubnium
21+
- node

.gitignore

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
.nyc_output/
2+
coverage/
3+
node_modules/
4+
*.log
5+
.DS_Store
6+
yarn.lock

.npmrc

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
package-lock=false

.prettierignore

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
coverage/
2+
*.json
3+
*.md

from-markdown.js

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
exports.enter = {mdxjsEsm: enterMdxjsEsm}
2+
exports.exit = {mdxjsEsm: exitMdxjsEsm, mdxjsEsmData: exitMdxjsEsmData}
3+
4+
function enterMdxjsEsm(token) {
5+
this.enter({type: 'mdxjsEsm', value: ''}, token)
6+
this.buffer() // Capture EOLs
7+
}
8+
9+
function exitMdxjsEsm(token) {
10+
var value = this.resume()
11+
var node = this.exit(token)
12+
13+
node.value = value
14+
15+
if (token.estree) {
16+
node.data = {estree: token.estree}
17+
}
18+
}
19+
20+
function exitMdxjsEsmData(token) {
21+
this.config.enter.data.call(this, token)
22+
this.config.exit.data.call(this, token)
23+
}

index.js

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
exports.fromMarkdown = require('./from-markdown')
2+
exports.toMarkdown = require('./to-markdown')

license

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
(The MIT License)
2+
3+
Copyright (c) 2020 Titus Wormer <tituswormer@gmail.com>
4+
5+
Permission is hereby granted, free of charge, to any person obtaining
6+
a copy of this software and associated documentation files (the
7+
'Software'), to deal in the Software without restriction, including
8+
without limitation the rights to use, copy, modify, merge, publish,
9+
distribute, sublicense, and/or sell copies of the Software, and to
10+
permit persons to whom the Software is furnished to do so, subject to
11+
the following conditions:
12+
13+
The above copyright notice and this permission notice shall be
14+
included in all copies or substantial portions of the Software.
15+
16+
THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND,
17+
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
18+
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
19+
IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
20+
CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
21+
TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
22+
SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

package.json

Lines changed: 79 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,79 @@
1+
{
2+
"name": "mdast-util-mdxjs-esm",
3+
"version": "0.0.0",
4+
"description": "mdast extension to parse and serialize MDX.js ESM (import/exports)",
5+
"license": "MIT",
6+
"keywords": [
7+
"unist",
8+
"mdast",
9+
"mdast-util",
10+
"util",
11+
"utility",
12+
"markdown",
13+
"markup",
14+
"mdx",
15+
"mdxjs",
16+
"esm",
17+
"import",
18+
"export",
19+
"extension"
20+
],
21+
"repository": "syntax-tree/mdast-util-mdxjs-esm",
22+
"bugs": "https://github.com/syntax-tree/mdast-util-mdxjs-esm/issues",
23+
"funding": {
24+
"type": "opencollective",
25+
"url": "https://opencollective.com/unified"
26+
},
27+
"author": "Titus Wormer <tituswormer@gmail.com> (https://wooorm.com)",
28+
"contributors": [
29+
"Titus Wormer <tituswormer@gmail.com> (https://wooorm.com)"
30+
],
31+
"files": [
32+
"from-markdown.js",
33+
"index.js",
34+
"to-markdown.js"
35+
],
36+
"dependencies": {},
37+
"devDependencies": {
38+
"acorn": "^8.0.0",
39+
"mdast-util-from-markdown": "^0.8.0",
40+
"mdast-util-to-markdown": "^0.5.0",
41+
"micromark-extension-mdxjs-esm": "^0.1.0",
42+
"nyc": "^15.0.0",
43+
"prettier": "^2.0.0",
44+
"remark-cli": "^9.0.0",
45+
"remark-preset-wooorm": "^8.0.0",
46+
"tape": "^5.0.0",
47+
"unist-util-remove-position": "^3.0.0",
48+
"xo": "^0.35.0"
49+
},
50+
"scripts": {
51+
"format": "remark . -qfo && prettier . -w --loglevel warn && xo --fix",
52+
"test-api": "node test",
53+
"test-coverage": "nyc --reporter lcov tape test.js",
54+
"test": "npm run format && npm run test-coverage"
55+
},
56+
"nyc": {
57+
"check-coverage": true,
58+
"lines": 100,
59+
"functions": 100,
60+
"branches": 100
61+
},
62+
"prettier": {
63+
"tabWidth": 2,
64+
"useTabs": false,
65+
"singleQuote": true,
66+
"bracketSpacing": false,
67+
"semi": false,
68+
"trailingComma": "none"
69+
},
70+
"xo": {
71+
"prettier": true,
72+
"esnext": false
73+
},
74+
"remarkConfig": {
75+
"plugins": [
76+
"preset-wooorm"
77+
]
78+
}
79+
}

0 commit comments

Comments
 (0)