Skip to content

Commit e7e9d46

Browse files
authored
Fix Vue, document and test rest
* Update readmes * Fix code style * Add 100% coverage to renderers, babel plugins, loaders, runtime * Add todos inline for potentially broken things * Fix Vue to have tests, support properties, support Vue components * Soft deprecate `@mdx-js/util`, `@mdx-js/test-util`, `babel-plugin-html-attributes-to-jsx`: their contents weren’t used or not reused * Set up tests in each package, to allow for different test methods (e.g., vue, remark-mdx) * Stop locking dev-dependencies * Move several dev-dependencies from the root `package.json` to the places that depend on them * Remove unused dev-dependencies * Remove unused `yarn.lock`s in non-root * Use `microbundle` for preact, react, and vue * Fix installing, building, formatting, and testing * Fix actions Closes GH-1338. Reviewed-by: Christian Murphy <[email protected]>
1 parent e194fc1 commit e7e9d46

File tree

96 files changed

+4112
-21962
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

96 files changed

+4112
-21962
lines changed

.eslintignore

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,8 +18,7 @@ packages/gatsby-theme-mdx/src/components/search.js
1818

1919
packages/remark-mdx
2020

21-
# tmp
21+
# To do: Vue should be checked.
2222
examples/vue
23-
packages/vue
2423

2524
readme.md

.eslintrc.yml

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -43,15 +43,13 @@ settings:
4343
version: 16.3.2
4444

4545
overrides:
46-
- files: '*.md'
47-
extends: plugin:mdx/recommended
48-
4946
- files: '*.mdx'
5047
extends:
5148
- plugin:mdx/recommended
5249
- plugin:mdx/overrides
5350
rules:
5451
import/no-extraneous-dependencies: 0
52+
prettier/prettier: 0
5553

5654
- files:
5755
- '**/test/**/*.js'

.github/workflows/ci.yml

Lines changed: 8 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -7,46 +7,25 @@ jobs:
77
name: Build and Test on ${{ matrix.os }} with Node.js ${{ matrix.node }}
88
strategy:
99
matrix:
10-
os: [ubuntu-latest, windows-latest]
11-
node: [10, 14]
10+
os:
11+
- ubuntu-latest
12+
- windows-latest
13+
node:
14+
- 10
15+
- 14
1216
runs-on: ${{ matrix.os }}
1317
steps:
1418
- uses: actions/checkout@v2
15-
1619
- uses: actions/setup-node@v2-beta
1720
with:
1821
node-version: ${{ matrix.node }}
19-
20-
- name: Setup yarn
21-
if: matrix.os != 'windows-latest'
22-
run: |
23-
curl -o- -L https://yarnpkg.com/install.sh | bash
24-
export PATH="$HOME/.yarn/bin:$PATH"
25-
26-
- name: Get yarn cache directory path
27-
id: yarn-cache-dir-path
28-
run: echo "::set-output name=dir::$(yarn cache dir)"
29-
30-
- uses: actions/cache@v2
31-
id: yarn-cache # use this to check for `cache-hit` (`steps.yarn-cache.outputs.cache-hit != 'true'`)
32-
with:
33-
path: ${{ steps.yarn-cache-dir-path.outputs.dir }}
34-
key: ${{ runner.os }}-${{ matrix.node }}-yarn-${{ hashFiles('**/yarn.lock') }}
35-
restore-keys: |
36-
${{ runner.os }}-${{ matrix.node }}-yarn-
37-
38-
- name: Install Dependencies
22+
- name: Install
3923
run: yarn --frozen-lockfile
4024
env:
4125
CI: 'true'
42-
43-
- name: Build
44-
if: matrix.os != 'windows-latest'
45-
run: yarn build
46-
4726
- name: Test
4827
run: yarn test
49-
28+
# To do: macos isn’t used anymore
5029
- name: Publish CI tag to npm
5130
if: matrix.node == 12 && matrix.os == 'macOS-latest' && github.event_name == 'push' && github.ref == 'refs/heads/master'
5231
run: |

.github/workflows/lint.yml

Lines changed: 0 additions & 27 deletions
This file was deleted.

.github/workflows/types.yml

Lines changed: 0 additions & 42 deletions
This file was deleted.

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,3 +15,4 @@ public
1515
.npmrc
1616
.nyc_output/
1717
coverage/
18+
.yarn

.remarkrc.js

Lines changed: 1 addition & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,22 +1,10 @@
1-
const unified = require('unified')
2-
const english = require('retext-english')
3-
const wooorm = require('retext-preset-wooorm')
4-
51
module.exports = {
62
plugins: [
73
'./packages/remark-mdx',
84
'./packages/remark-mdxjs',
95
'preset-wooorm',
106
'preset-prettier',
11-
[
12-
'retext',
13-
unified()
14-
.use(english)
15-
.use(wooorm)
16-
.use({
17-
plugins: [[require('retext-sentence-spacing'), false]]
18-
})
19-
],
7+
['retext', false],
208
['validate-links', false]
219
]
2210
}

docs/advanced/typescript.mdx

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,6 @@ improve the developer experience for TypeScript users.
1313
- `@mdx-js/react`
1414
- `@mdx-js/runtime`
1515
- `@mdx-js/vue`
16-
- `@mdx-js/util`
1716
- `remark-mdx`
1817
- `remark-mdx-remove-exports`
1918
- `remark-mdx-remove-imports`
@@ -26,15 +25,15 @@ Include types, no additional setup needed.
2625

2726
### React and Webpack
2827

29-
Add an _mdx.d.ts_ file with the below content, and ensure it is included by the _tsconfig.json_.
28+
Add an `mdx.d.ts` file with the below content, and ensure it is included by the `tsconfig.json`.
3029

3130
```tsx
3231
/// <reference types="@mdx-js/loader" />
3332
```
3433

3534
### Vue and Webpack
3635

37-
Add an _mdx.d.ts_ file with the below content, and ensure it is included by the _tsconfig.json_.
36+
Add an `mdx.d.ts` file with the below content, and ensure it is included by the `tsconfig.json`.
3837

3938
```tsx
4039
/// <reference types="@mdx-js/vue-loader" />

0 commit comments

Comments
 (0)