1
1
mirror of https://github.com/mdx-js/mdx.git synced 2024-10-26 16:20:29 +03:00
Commit Graph

372 Commits

Author SHA1 Message Date
Titus
ef41677798
Update dev-dependencies (#1892)
Closes GH-1839.
Closes GH-1855.
Closes GH-1868.
2022-01-09 11:38:27 +01:00
renovate[bot]
cb49ac0995
Update ahooks (#1858)
Co-authored-by: Renovate Bot <bot@renovateapp.com>
2021-12-16 20:25:22 +01:00
renovate[bot]
4f5cd79edb
Update puppeteer-core (#1859)
Co-authored-by: Renovate Bot <bot@renovateapp.com>
2021-12-16 20:24:53 +01:00
renovate[bot]
2886882e9d
Update puppeteer-core (#1841)
Co-authored-by: Renovate Bot <bot@renovateapp.com>
2021-12-03 14:37:54 +01:00
renovate[bot]
f75f7ba23e
Update lint-staged (#1840)
Co-authored-by: Renovate Bot <bot@renovateapp.com>
2021-12-03 14:37:29 +01:00
renovate[bot]
ddcbb7bfc2
Update esbuild (#1838)
Co-authored-by: Renovate Bot <bot@renovateapp.com>
2021-12-03 14:37:00 +01:00
Titus
2c27b0b64a
Update dev-dependencies (#1832)
Reviewed-by: Christian Murphy <christian.murphy.42@gmail.com>
2021-12-03 13:53:50 +01:00
Titus
2f96fbae3c
Add better errors when referencing missing components (#1811)
Previously, React or other JSX runtimes threw rather hard to read errors
when a component was undefined (because it wasn’t imported, passed, or
provided), essentially only pointing to *something* missing.
Now we throw proper errors when a component is missing at runtime,
including what exact component (or object) is undefined.

In addition, this adds a `development` option, which defaults to
`false` but can be configured explicitly or turned on with
`NODE_ENV=development`.
When it’s `true`, the exact place that references the missing component
or object, and which file did that, is included in the error message.

Related-to: mdx-js/mdx#1775.
Backports: wooorm/xdm@62e6f30.
2021-11-13 10:28:46 +01:00
Titus
2393084548
Update dev-dependencies (#1809) 2021-11-13 09:30:29 +01:00
Titus
00b1db10d7
Add support for React 18 (#1808)
Reviewed-by: Christian Murphy <christian.murphy.42@gmail.com>
2021-11-10 17:09:37 +01:00
renovate[bot]
7319e36154
chore(deps): update dependency xo to ^0.46.0 (#1789)
Co-authored-by: Renovate Bot <bot@renovateapp.com>

Reviewed-by: Christian Murphy <christian.murphy.42@gmail.com>
Reviewed-by: Titus Wormer <tituswormer@gmail.com>
2021-11-10 08:57:13 +01:00
Christian Murphy
f97ec0084e
Add debounce to playground (#1758)
Reviewed-by: Titus Wormer <tituswormer@gmail.com>
2021-10-20 07:47:12 +02:00
Titus
8f6d67ac5f
Improve site based on reviews (#1753) 2021-10-19 14:31:56 +02:00
Titus
dce2b4c760
Add proper authors, modified/published dates to site (#1727) 2021-10-09 15:30:28 +02:00
Titus
f55fae2109
Fix casing of file names
Also show swallowed errors on Vercel/Linux
2021-10-07 17:50:53 +02:00
Titus
b4df392166
Add filename, language, copy button to code blocks (#1723) 2021-10-07 15:12:58 +02:00
Titus
fcdd6debce
Miscellaneous cleaning tasks (#1721) 2021-10-07 08:55:27 +02:00
Titus
29630e029e
Add support for GFM footnotes (#1710) 2021-10-04 09:10:49 +02:00
Titus
6a852e0cbb
Update xo (#1709) 2021-10-04 09:04:03 +02:00
Titus
d17f09e4b5
Add readmes of packages to website (#1698) 2021-09-28 14:23:18 +02:00
Titus
5aca847ad1
Update core of readmes (#1694) 2021-09-27 20:20:59 +02:00
Titus
2736d079f4
Add @mdx-js/register (#1689) 2021-09-27 13:17:11 +02:00
Titus
ff19baad5b
Add @mdx-js/node-loader (#1690) 2021-09-27 12:17:37 +02:00
Titus
edc67ac70b
Add @mdx-js/esbuild (#1688) 2021-09-27 11:40:58 +02:00
Titus
97967e919f
Add @mdx-js/rollup (#1687) 2021-09-27 10:50:57 +02:00
Titus
5a21115d1f
Add tests to reach 100% coverage (#1686) 2021-09-27 10:24:05 +02:00
Titus
e2d2dda277
Remove unused and update existing dependencies (#1683) 2021-09-26 18:18:32 +02:00
Titus
822fb99bc1
Use xo (#1682) 2021-09-26 18:02:09 +02:00
Titus
70742c9ff1
Remove examples from monorepo (#1681) 2021-09-26 17:39:27 +02:00
Titus
2b806ae902
Miscellaneous cleaning tasks (#1677)
* Add `remark-cli`, `prettier` back
* Update license years
* Reorder `package.json`
* Update `.gitignore`
* Update `.editorconfig`
* Remove `.gitattributes`
* Remove unneeded babel files
2021-09-24 12:58:28 +02:00
Titus
6029a14f24
Use symlinked monorepo packages again (#1673) 2021-09-22 15:50:46 +02:00
Titus
2bb13da51b
Remove deprecated packages, examples from source (#1672) 2021-09-22 15:06:46 +02:00
Titus
e40233f149
Deprecate @mdx-js/runtime (#1671)
`@mdx-js/mdx` can now evaluate MDX with any runtime, supporting async plugins,
and returning exported values.

This also removes `dtslint` from dev-dependencies.
2021-09-22 14:14:58 +02:00
Titus
7ae2ce24c3
Deprecate babel-plugin-remove-export-keywords (#1670) 2021-09-22 13:27:56 +02:00
Titus
57e637cf55
Update @mdx-js/mdx (#1669)
* Import xdm’s core into `@mdx-js/mdx`
* Tons of fixes and updates and a couiple of changes that will be
  tested and documented later
* Use ESM
* Add JSDoc based types
2021-09-22 12:02:09 +02:00
Titus
22c40f78b3
Update package lock (#1668) 2021-09-22 09:34:24 +02:00
Titus
6fbaaf5558
Update @mdx-js/vue (#1662)
* Use ESM
* Add JSDoc based types (and improve the types a bunch)
* Rewrite to use modern Vue features such as reactive provide/inject
  and fragments
* Remove `mdx` export, which is no longer needed
* Use `xdm` for a second
2021-09-18 10:34:17 +02:00
Titus
0262e20259
Update @mdx-js/preact (#1660)
* Use ESM
* Add JSDoc based types (and improve the types a bunch)
* Mark `MDXContext` and `withMDXComponents` exports as deprecated
  (they still work)
* Remove `mdx` export, which is no longer needed
* Use `xdm` for a second
2021-09-16 11:45:23 +02:00
Titus
897a6b23a7
Update @mdx-js/react (#1659) 2021-09-16 10:59:04 +02:00
Titus
a9ee3f248b
Update @mdx-js/loader (#1657)
* Use ESM (with CJS wrapper, which is a requirement for webpack currently)
* Add JSDoc based types
* Use webpack 5
* Add preact, vue tests, which it now supports
* Switch to xdm for second — will switch back to `@mdx-js/mdx` when that’s migrated
2021-09-15 11:17:01 +02:00
Titus
36cb41bc6c
Improve Vercel build (#1656) 2021-09-15 09:36:52 +02:00
Titus
952f6dc524
Replace yarn, lerna with npm (#1654)
* yarn is having problems hoisting dependencies
* workspaces are built into npm now
* GHA + npm have some fancy caching mechanisms

Reviewed-by: Christian Murphy <christian.murphy.42@gmail.com>

Related-to: GH-1015.
2021-09-14 19:23:08 +02:00
Titus
d8b666e5cd
Fix a couple bugs on the site (#1653) 2021-09-14 11:14:10 +02:00
Titus
6079c3118a
Reduce incorrect peer- and unneeded dependencies (#1652)
* Add some peer dependencies
* Add references to `razzle-plugin-mdx`, `react-static-plugin-mdx`
* Add references to website instead of `shortcodes`, `syntax-highlighting` examples
* Soft deprecate `create-mdx`
2021-09-13 20:41:31 +02:00
Titus
9a0fe3ae5a
Fix code-style instead of turning off rules (#1651)
Co-authored-by: Christian Murphy <christian.murphy.42@gmail.com>
2021-09-13 19:02:37 +02:00
Titus
0373d4eb7b
Remove unneeded resolutions (#1649) 2021-09-13 17:27:59 +02:00
Titus
b0005adae5
Deprecate gatsby-theme-mdx, fix gatsby example (#1637) 2021-09-13 11:49:56 +02:00
Titus
917c9e1440
Add new, RSC + MDX based website (#1640)
* uses xdm for now, will switch to mdx-js/mdx when it has the features
* rsc is the future
* extremely optimized implementation, rich metadata, sitemap, rss feed
* improved playground(s)
* no framework, which makes sure we don’t favor one company over another
* currently a lot of new direct dependencies and custom code, which will
  presumably become less so when RSC hits mainstream as either someone
  else will build stuff that does things like this, or perhaps I will
  externalize it.
2021-09-13 10:53:41 +02:00
Jack Bates
6a27dbd6a9
Add test-types script back (#1622)
Reviewed-by: JounQin <admin@1stg.me>
Reviewed-by: Christian Murphy <christian.murphy.42@gmail.com>
2021-09-12 21:24:58 +02:00
Jack Bates
f5dbe506b3
Update Parcel guide (#1626)
Reviewed-by: Titus Wormer <tituswormer@gmail.com>
Reviewed-by: Christian Murphy <christian.murphy.42@gmail.com>
Reviewed-by: JounQin <admin@1stg.me>
2021-09-10 10:29:18 +02:00
Titus
f6ca5bf6ac
Update dev-dependencies, examples (#1634) 2021-09-08 12:43:04 +02:00
Titus
3dc4af961b
Refactor to unlock dependencies (#1631) 2021-09-08 09:16:14 +02:00
renovate[bot]
f9de13ed14
chore(deps): update dependency eslint-config-xo to ^0.38.0 (#1581)
Co-authored-by: Renovate Bot <bot@renovateapp.com>
Co-authored-by: Titus Wormer <tituswormer@gmail.com>
2021-09-07 21:43:04 +02:00
Titus
a3ccc0d986
Replace jest, tape w/ uvu, c8 (#1630)
* There was a weird error locally, it failed CI
  (https://github.com/mdx-js/mdx/pull/1567/checks?check_run_id=3531074413),
  and it’s not good at supporting ESM
* uvu, c8 and esbuild are extremely fast
* Remove `microbundle` as well, we can support ESM later

Closes GH-1567.
2021-09-07 16:49:25 +02:00
renovate[bot]
7fec3d9790
chore(deps): update dependency lint-staged to v11 (#1542)
Co-authored-by: Renovate Bot <bot@renovateapp.com>
2021-09-07 09:24:46 +02:00
Jack Bates
a76e15fd93
Don't run lerna publish from root lifecycle (#1616) 2021-08-28 11:46:34 -07:00
JounQin
5025349229
chore: upgrade eslint-plugin-mdx, reenable rule validate-links (#1594) 2021-07-15 09:06:53 +08:00
JounQin
09ba5d0415
fix: lint issues, add types back (#1514)
* fix: lint issues, add types back

* chore: patch microbundle temporarily

* chore: remove unnecessary ignore patterns

* chore: lock typescript-eslint version due to gatsby
2021-04-08 01:15:26 +08:00
JounQin
4700f396a2
docs: generate website documents correctly for 2.0 (#1494)
Co-authored-by: Christian Murphy <christian.murphy.42@gmail.com>
2021-03-26 10:18:36 +08:00
JounQin
8ce7929f9b
build: fix docs build step, migrate now.sh to vercel (#1470) 2021-03-02 21:08:56 +08:00
Titus
c1269258e1
Update CRA guide
Create React App is the most looked at resource by users here on GitHub.
But it’s suggesting an old, unmaintained, and buggy way to use MDX.

This instead updates the guide to use our maintained projects, without
having to eject from CRA.

As CRA itself is an ever-changing “init” tool, which can support MDX by
following a couple steps, I don’t think it’s wise to have an example in
the project: we want folks to do `npx create-react-app ...`, not clone
our custom example.

Not having CRA checked in also makes for a faster `yarn install`.

Perhaps developing our own [CRA
template](https://create-react-app.dev/docs/custom-templates) might be
nice for the future, but for now I’ve kept it at an up to date and
working guide.

Related to GH-1015.
Related to GH-1388.

Closes GH-365.
Closes GH-589.
Closes GH-1422.

Reviewed-by: Christian Murphy <christian.murphy.42@gmail.com>
2020-12-29 21:02:22 +01:00
Titus
6f3dc9cb35
Update examples, react
* Update `react`, `react-dom`
* Clean Next, Razzle, Vue examples
* Update parcel example, parcel plugin, run tests
* Prefer `.mdx` extension over `.md`
* This does not yet touch CRA
* It’s impossible to get Gatsby working in our workspace (they fork MDX but resolve from their dependency on old MDX)
* I can’t get webpack 5 working either

Related to GH-1292.
Closes GH-1415.

Reviewed-by: Christian Murphy <christian.murphy.42@gmail.com>
2020-12-28 14:54:45 +01:00
Titus
9ce3619de9
Update dependencies, dev-dependencies
This updates the dependencies and dev-dependencies in `packages/`.
Unfortunately, either updating to webpack 5 or updating to react 17 crash the
webpack loader with a react error, with an [invalid hook call
warning](https://reactjs.org/warnings/invalid-hook-call-warning.html) for
`useMDXComponents`:

<dafdf6d70a/packages/react/src/context.js (L15)>

Which might have to do with the magic of shortcodes (#1385), or something else,
I have no clue.

Furthermore, this loosens package dependencies instead of locking them,
which relates to GH-865, GH-1015, and GH-1267.
It was a long and divided discussion before and the reason for changing now is:
While the package currently doesn’t break easily (it was mentioned that unlocking
packages might cause that), we are currently *locked* on security vulnerabilities.
We’re not getting any patches, and MDX isn’t released that frequently or
maintained that actively, so MDX users are stuck.
If folks want to lock: npm and yarn have package locks.

Closes GH-1267.
Closes GH-1375.
Closes GH-1392.
2020-12-20 10:13:34 +01:00
Titus
2529cd7343
Remove code for deprecated packages
Closes GH-1393.

Reviewed-by: Christian Murphy <christian.murphy.42@gmail.com>
2020-12-19 13:14:46 +01:00
Titus Wormer
846ee6600e Remove formatting of .mdx files for now 2020-12-17 20:01:33 +01:00
Titus
9f5a91d8f9
Fix tests on next
Closes GH-1349.

Reviewed-by: John Otander <johnotander@gmail.com>
Reviewed-by: Christian Murphy <christian.murphy.42@gmail.com>
2020-11-24 16:37:12 +01:00
Titus
e7e9d464c7
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 <christian.murphy.42@gmail.com>
2020-11-19 16:33:27 +01:00
Christopher Biscardi
8b4723f7eb
modernize 2.0 preact build (#1269)
This sets us up to modernize all of our builds by implementing microbundle on the preact package. This produces a commonjs build that is left as main because that's what people currently expect, an es build that gets used by webpack, etc under the module key, and a true es modern build that will get used conditionally by node v14 native esm when `import` is used. When `require` is used in v14, the commonjs build gets used.
2020-09-18 10:08:46 -07:00
John Otander
f59b174e82
Make type test run in their own action, closes #1172 (#1179) 2020-07-22 20:16:22 -06:00
John Otander
0da2fcff87 Specify pre-dist-tag 2020-07-22 13:16:39 -06:00
John Otander
3ca8e0a333
Fix linting (#1161)
* Fix linting

* Fix error in remark formatter
2020-07-17 15:10:55 -06:00
John Otander
db93304676
Improve export name extraction for shortcode generation (#1160)
* Improve export name extraction

Many different types of export syntax wasn't supported,
primarily destructuring for objects and arrays. This adds
export extraction to the import name extraction step so
we can more accurately determine what shortcodes to
generate.

* Place gatsby-plugin-mdx in the root for now, seems to not be resolving properly

* Fix linting

* Make null handling more clear

* Fix handling of null specifiers

* Move dep to proper place
2020-07-17 14:24:53 -06:00
John Otander
ea9970ab63 Bump deps, fix core-js version in babel configs 2020-07-16 10:42:53 -06:00
John Otander
569f82f6ee Make preid next to match dist tag 2020-05-21 08:08:42 -06:00
John Otander
65af47c7e2 Break three main tests into their own scripts 2020-05-20 16:13:16 -06:00
John Otander
dc1c541a5c Fix package deps in root 2020-05-20 16:06:46 -06:00
Christian Murphy
4bf052c414
types: add typescript typings for @mdx-js/mdx, @mdx-js/react, @mdx-js/runtime, and @mdx-js/vue (#1079) 2020-05-20 16:05:19 -06:00
Titus
9d30680002
Rewrite how MDX is parsed (#1039)
* Move `remark-mdx*` packages to `remark-mdxjs`

* Rename

* Add `remark-mdx`

* Add tests

* Ignore `remark-mdx`

* Remove husky for now

* done

* Update comment syntax in the docs

* Add back all file extensions for eslint

* Remove comments for now and eslint-mdx temporarily

* Remove comments for now, add redirect to mdx-provider in docs

* Missed a merge conflict

* Fix eslint

Co-authored-by: John Otander <johnotander@gmail.com>
2020-05-20 12:15:41 -06:00
John Otander
183c426909 Bump last remaining deps 2020-05-20 11:26:12 -06:00
renovate[bot]
ce87ec4114
chore(deps): update dependency jest to v26 (#1066)
Co-authored-by: Renovate Bot <bot@renovateapp.com>
2020-05-20 11:22:47 -06:00
renovate[bot]
6f0321c796
chore(deps): update dependency eslint-plugin-react to v7.20.0 (#1071)
Co-authored-by: Renovate Bot <bot@renovateapp.com>
2020-05-20 11:16:58 -06:00
renovate[bot]
ca22e8367b
chore(deps): update dependency vfile to v4.1.1 (#1074)
Co-authored-by: Renovate Bot <bot@renovateapp.com>
2020-05-20 11:16:11 -06:00
renovate[bot]
2764473b90
chore(deps): update dependency eslint to v7 (#1065)
Co-authored-by: Renovate Bot <bot@renovateapp.com>
2020-05-20 11:15:56 -06:00
renovate[bot]
20d8641d18
chore(deps): update dependency lerna to v3.21.0 (#1072)
Co-authored-by: Renovate Bot <bot@renovateapp.com>
2020-05-20 11:14:59 -06:00
renovate[bot]
cb5e305dce
chore(deps): update dependency typescript to v3.9.3 (#1073)
Co-authored-by: Renovate Bot <bot@renovateapp.com>
2020-05-20 11:13:06 -06:00
renovate[bot]
595fe0041b
chore(deps): update dependency @vue/test-utils to v1.0.3 (#1062)
Co-authored-by: Renovate Bot <bot@renovateapp.com>
2020-05-20 11:12:04 -06:00
renovate[bot]
4e607bcab6
chore(deps): update babel monorepo to v7.9.6 (#1056)
Co-authored-by: Renovate Bot <bot@renovateapp.com>
2020-05-20 11:03:46 -06:00
renovate[bot]
3f94d5ef4d
Update gatsby monorepo (#1036)
Co-authored-by: Renovate Bot <bot@renovateapp.com>
2020-04-29 06:38:52 -06:00
renovate[bot]
9b4f192afd
Update dependency webpack to v4.43.0 (#1035)
Co-authored-by: Renovate Bot <bot@renovateapp.com>
2020-04-28 11:27:44 -06:00
renovate[bot]
d24fa5f24d
Update dependency remark-parse to v8.0.2 (#1034)
Co-authored-by: Renovate Bot <bot@renovateapp.com>
2020-04-28 11:27:27 -06:00
renovate[bot]
3f4f6dd8c0
Update dependency prettier to v2.0.5 (#1032)
Co-authored-by: Renovate Bot <bot@renovateapp.com>
2020-04-28 11:26:20 -06:00
renovate[bot]
b9ac8faa87
Update dependency eslint-config-prettier to v6.11.0 (#1031)
Co-authored-by: Renovate Bot <bot@renovateapp.com>
2020-04-28 11:26:07 -06:00
Christopher Biscardi
47b2c624dc
Vue, rebased (#1029)
* feat(vue): implemented context for vue

* test(vue): documented vue tests

* bump vue versions, fix loader test, get example app running with MDX and MDXProvider

* Update examples/vue/package.json

* Update examples/vue/package.json

* Update package.json

* Update packages/vue-loader/package.json

* Update packages/vue-loader/package.json

* Update packages/vue/package.json

Co-authored-by: codebender828 <jbakebwa@163.com>
Co-authored-by: John Otander <johnotander@gmail.com>
2020-04-27 14:01:04 -06:00
renovate[bot]
a40dca952b
chore(deps): update dependency lint-staged to v10.1.7 (#998)
Co-authored-by: Renovate Bot <bot@renovateapp.com>
2020-04-22 13:28:50 -06:00
renovate[bot]
6e3d1682cf
fix(deps): update gatsby monorepo (#1021)
Co-authored-by: Renovate Bot <bot@renovateapp.com>
2020-04-22 13:28:23 -06:00
JounQin
4cd76addcf
feat: bump all (dev)Dependencies, update related usages (#1023)
* feat: bump all (dev)Dependencies, update related usages

* ci: drop node 8

* chore: revert unexpected md changes
2020-04-22 12:33:43 -06:00
renovate[bot]
5ce610db13
Update gatsby monorepo (#996)
Co-authored-by: Renovate Bot <bot@renovateapp.com>
2020-04-14 12:02:18 -06:00
renovate[bot]
6251c5bb35
Update dependency webpack to v4.42.1 (#1005)
Co-authored-by: Renovate Bot <bot@renovateapp.com>
2020-04-13 07:46:18 -06:00
renovate[bot]
86256e8881
Update dependency remark-math to v2.0.1 (#999)
Co-authored-by: Renovate Bot <bot@renovateapp.com>
2020-04-13 07:45:59 -06:00
renovate[bot]
7f20a3021d
chore(deps): update dependency eslint-config-prettier to v6.10.1 (#984)
Co-authored-by: Renovate Bot <bot@renovateapp.com>
2020-03-26 13:10:58 -06:00