🎉 initiate project *astro_rewrite*
This commit is contained in:
parent
ffd4d5e86c
commit
2ba37bfbe3
8658 changed files with 2268794 additions and 2538 deletions
11
node_modules/micromark-extension-mdxjs/index.d.ts
generated
vendored
Normal file
11
node_modules/micromark-extension-mdxjs/index.d.ts
generated
vendored
Normal file
|
|
@ -0,0 +1,11 @@
|
|||
/**
|
||||
* @param {Options} [options]
|
||||
* @returns {Extension}
|
||||
*/
|
||||
export function mdxjs(
|
||||
options?:
|
||||
| import('./node_modules/micromark-extension-mdx-expression/dev/lib/syntax.js').Options
|
||||
| undefined
|
||||
): Extension
|
||||
export type Extension = import('micromark-util-types').Extension
|
||||
export type Options = import('micromark-extension-mdx-expression').Options
|
||||
39
node_modules/micromark-extension-mdxjs/index.js
generated
vendored
Normal file
39
node_modules/micromark-extension-mdxjs/index.js
generated
vendored
Normal file
|
|
@ -0,0 +1,39 @@
|
|||
/**
|
||||
* @typedef {import('micromark-extension-mdx-expression').Options} Options
|
||||
* @typedef {import('micromark-util-types').Extension} Extension
|
||||
*/
|
||||
|
||||
import {Parser} from 'acorn'
|
||||
import acornJsx from 'acorn-jsx'
|
||||
import {mdxExpression} from 'micromark-extension-mdx-expression'
|
||||
import {mdxJsx} from 'micromark-extension-mdx-jsx'
|
||||
import {mdxMd} from 'micromark-extension-mdx-md'
|
||||
import {mdxjsEsm} from 'micromark-extension-mdxjs-esm'
|
||||
import {combineExtensions} from 'micromark-util-combine-extensions'
|
||||
|
||||
/**
|
||||
* Create an extension for `micromark` to enable MDX syntax.
|
||||
*
|
||||
* @param {Options | null | undefined} [options]
|
||||
* Configuration (optional).
|
||||
* @returns {Extension}
|
||||
* Extension for `micromark` that can be passed in `extensions` to enable MDX
|
||||
* syntax.
|
||||
*/
|
||||
export function mdxjs(options) {
|
||||
const settings = Object.assign(
|
||||
{
|
||||
acorn: Parser.extend(acornJsx()),
|
||||
acornOptions: {ecmaVersion: 2020, sourceType: 'module'},
|
||||
addResult: true
|
||||
},
|
||||
options
|
||||
)
|
||||
|
||||
return combineExtensions([
|
||||
mdxjsEsm(settings),
|
||||
mdxExpression(settings),
|
||||
mdxJsx(settings),
|
||||
mdxMd
|
||||
])
|
||||
}
|
||||
22
node_modules/micromark-extension-mdxjs/license
generated
vendored
Normal file
22
node_modules/micromark-extension-mdxjs/license
generated
vendored
Normal file
|
|
@ -0,0 +1,22 @@
|
|||
(The MIT License)
|
||||
|
||||
Copyright (c) 2020 Titus Wormer <tituswormer@gmail.com>
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining
|
||||
a copy of this software and associated documentation files (the
|
||||
'Software'), to deal in the Software without restriction, including
|
||||
without limitation the rights to use, copy, modify, merge, publish,
|
||||
distribute, sublicense, and/or sell copies of the Software, and to
|
||||
permit persons to whom the Software is furnished to do so, subject to
|
||||
the following conditions:
|
||||
|
||||
The above copyright notice and this permission notice shall be
|
||||
included in all copies or substantial portions of the Software.
|
||||
|
||||
THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND,
|
||||
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
||||
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
|
||||
IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
|
||||
CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
|
||||
TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
|
||||
SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
||||
1
node_modules/micromark-extension-mdxjs/node_modules/.bin/acorn
generated
vendored
Symbolic link
1
node_modules/micromark-extension-mdxjs/node_modules/.bin/acorn
generated
vendored
Symbolic link
|
|
@ -0,0 +1 @@
|
|||
../../../acorn/bin/acorn
|
||||
88
node_modules/micromark-extension-mdxjs/package.json
generated
vendored
Normal file
88
node_modules/micromark-extension-mdxjs/package.json
generated
vendored
Normal file
|
|
@ -0,0 +1,88 @@
|
|||
{
|
||||
"name": "micromark-extension-mdxjs",
|
||||
"version": "1.0.1",
|
||||
"description": "micromark extension to support MDX.js",
|
||||
"license": "MIT",
|
||||
"keywords": [
|
||||
"micromark",
|
||||
"micromark-extension",
|
||||
"mdx",
|
||||
"mdxjs",
|
||||
"esm",
|
||||
"jsx",
|
||||
"expression",
|
||||
"markdown",
|
||||
"unified"
|
||||
],
|
||||
"repository": "micromark/micromark-extension-mdxjs",
|
||||
"bugs": "https://github.com/micromark/micromark-extension-mdxjs/issues",
|
||||
"funding": {
|
||||
"type": "opencollective",
|
||||
"url": "https://opencollective.com/unified"
|
||||
},
|
||||
"author": "Titus Wormer <tituswormer@gmail.com> (https://wooorm.com)",
|
||||
"contributors": [
|
||||
"Titus Wormer <tituswormer@gmail.com> (https://wooorm.com)"
|
||||
],
|
||||
"sideEffects": false,
|
||||
"type": "module",
|
||||
"main": "index.js",
|
||||
"types": "index.d.ts",
|
||||
"files": [
|
||||
"index.d.ts",
|
||||
"index.js"
|
||||
],
|
||||
"dependencies": {
|
||||
"acorn": "^8.0.0",
|
||||
"acorn-jsx": "^5.0.0",
|
||||
"micromark-extension-mdx-expression": "^1.0.0",
|
||||
"micromark-extension-mdx-jsx": "^1.0.0",
|
||||
"micromark-extension-mdx-md": "^1.0.0",
|
||||
"micromark-extension-mdxjs-esm": "^1.0.0",
|
||||
"micromark-util-combine-extensions": "^1.0.0",
|
||||
"micromark-util-types": "^1.0.0"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@types/node": "^20.0.0",
|
||||
"c8": "^7.0.0",
|
||||
"micromark": "^3.0.0",
|
||||
"prettier": "^2.0.0",
|
||||
"remark-cli": "^11.0.0",
|
||||
"remark-preset-wooorm": "^9.0.0",
|
||||
"type-coverage": "^2.0.0",
|
||||
"typescript": "^5.0.0",
|
||||
"xo": "^0.54.0"
|
||||
},
|
||||
"scripts": {
|
||||
"prepack": "npm run build && npm run format",
|
||||
"build": "tsc --build --clean && tsc --build && type-coverage",
|
||||
"format": "remark . -qfo && prettier . -w --loglevel warn && xo --fix",
|
||||
"test-api-prod": "node --conditions production test.js",
|
||||
"test-api-dev": "node --conditions development test.js",
|
||||
"test-api": "npm run test-api-dev && npm run test-api-prod",
|
||||
"test-coverage": "c8 --100 --reporter lcov npm run test-api",
|
||||
"test": "npm run build && npm run format && npm run test-coverage"
|
||||
},
|
||||
"prettier": {
|
||||
"tabWidth": 2,
|
||||
"useTabs": false,
|
||||
"singleQuote": true,
|
||||
"bracketSpacing": false,
|
||||
"semi": false,
|
||||
"trailingComma": "none"
|
||||
},
|
||||
"xo": {
|
||||
"prettier": true
|
||||
},
|
||||
"remarkConfig": {
|
||||
"plugins": [
|
||||
"preset-wooorm"
|
||||
]
|
||||
},
|
||||
"typeCoverage": {
|
||||
"atLeast": 100,
|
||||
"detail": true,
|
||||
"strict": true,
|
||||
"ignoreCatch": true
|
||||
}
|
||||
}
|
||||
291
node_modules/micromark-extension-mdxjs/readme.md
generated
vendored
Normal file
291
node_modules/micromark-extension-mdxjs/readme.md
generated
vendored
Normal file
|
|
@ -0,0 +1,291 @@
|
|||
# micromark-extension-mdxjs
|
||||
|
||||
[![Build][build-badge]][build]
|
||||
[![Coverage][coverage-badge]][coverage]
|
||||
[![Downloads][downloads-badge]][downloads]
|
||||
[![Size][size-badge]][size]
|
||||
[![Sponsors][sponsors-badge]][collective]
|
||||
[![Backers][backers-badge]][collective]
|
||||
[![Chat][chat-badge]][chat]
|
||||
|
||||
[micromark][] extensions to support [MDX][mdxjs].
|
||||
|
||||
## Contents
|
||||
|
||||
* [What is this?](#what-is-this)
|
||||
* [When to use this](#when-to-use-this)
|
||||
* [Install](#install)
|
||||
* [Use](#use)
|
||||
* [API](#api)
|
||||
* [`mdxjs(options?)`](#mdxjsoptions)
|
||||
* [`Options`](#options)
|
||||
* [Authoring](#authoring)
|
||||
* [Syntax](#syntax)
|
||||
* [Errors](#errors)
|
||||
* [Types](#types)
|
||||
* [Compatibility](#compatibility)
|
||||
* [Security](#security)
|
||||
* [Related](#related)
|
||||
* [Contribute](#contribute)
|
||||
* [License](#license)
|
||||
|
||||
## What is this?
|
||||
|
||||
This package contains an extension that adds support for the syntax enabled
|
||||
by [MDX][mdxjs] to [`micromark`][micromark].
|
||||
This extension is used inside MDX.
|
||||
It supports export/imports, expressions, JSX, and turns some markdown features
|
||||
off.
|
||||
|
||||
## When to use this
|
||||
|
||||
This project is useful when you want to support MDX.
|
||||
|
||||
You can use this extension when you are working with [`micromark`][micromark].
|
||||
|
||||
This package is aware of JavaScript syntax.
|
||||
If you want to be unaware of JavaScript, for example because expressions can
|
||||
include Rust or variables or whatnot, use
|
||||
[`micromark-extension-mdx`][micromark-extension-mdx].
|
||||
|
||||
Alternatively, you can also use the underlying syntax extensions separately:
|
||||
|
||||
* [`micromark-extension-mdx-expression`][micromark-extension-mdx-expression]
|
||||
— support MDX expressions
|
||||
* [`micromark-extension-mdx-jsx`][micromark-extension-mdx-jsx]
|
||||
— support MDX JSX
|
||||
* [`micromark-extension-mdx-md`][micromark-extension-mdx-md]
|
||||
— turn some CommonMark features off
|
||||
* [`micromark-extension-mdxjs-esm`][micromark-extension-mdxjs-esm]
|
||||
— support MDX export/imports
|
||||
|
||||
When you need a syntax tree, combine this package with
|
||||
[`mdast-util-mdx`][mdast-util-mdx].
|
||||
|
||||
All these packages are used in [`remark-mdx`][remark-mdx], which focusses on
|
||||
making it easier to transform content by abstracting these internals away.
|
||||
|
||||
## Install
|
||||
|
||||
This package is [ESM only][esm].
|
||||
In Node.js (version 16+), install with [npm][]:
|
||||
|
||||
```sh
|
||||
npm install micromark-extension-mdxjs
|
||||
```
|
||||
|
||||
In Deno with [`esm.sh`][esmsh]:
|
||||
|
||||
```js
|
||||
import {mdxjs} from 'https://esm.sh/micromark-extension-mdxjs@1'
|
||||
```
|
||||
|
||||
In browsers with [`esm.sh`][esmsh]:
|
||||
|
||||
```html
|
||||
<script type="module">
|
||||
import {mdxjs} from 'https://esm.sh/micromark-extension-mdxjs@1?bundle'
|
||||
</script>
|
||||
```
|
||||
|
||||
## Use
|
||||
|
||||
```js
|
||||
import {micromark} from 'micromark'
|
||||
import {mdxjs} from 'micromark-extension-mdxjs'
|
||||
|
||||
const output = micromark('import a from "b"\n\na <b /> c {1 + 1} d', {
|
||||
extensions: [mdxjs()]
|
||||
})
|
||||
|
||||
console.log(output)
|
||||
```
|
||||
|
||||
Yields:
|
||||
|
||||
```html
|
||||
<p>a c d</p>
|
||||
```
|
||||
|
||||
…which is useless: go to a syntax tree with
|
||||
[`mdast-util-from-markdown`][mdast-util-from-markdown] and
|
||||
[`mdast-util-mdx`][mdast-util-mdx] instead.
|
||||
|
||||
## API
|
||||
|
||||
This package exports the identifiers [`mdxjs`][api-mdxjs].
|
||||
There is no default export.
|
||||
|
||||
The separate extensions support the [`development` condition][development].
|
||||
Run `node --conditions development module.js` to get instrumented dev code.
|
||||
Without this condition, production code is loaded.
|
||||
|
||||
### `mdxjs(options?)`
|
||||
|
||||
Create an extension for `micromark` to enable MDX syntax.
|
||||
|
||||
###### Parameters
|
||||
|
||||
* `options` ([`Options`][api-options], optional)
|
||||
— configuration; passed to all extensions
|
||||
|
||||
###### Returns
|
||||
|
||||
Extension for `micromark` that can be passed in `extensions` to enable MDX
|
||||
syntax ([`Extension`][micromark-extension]).
|
||||
|
||||
### `Options`
|
||||
|
||||
Configuration (TypeScript type).
|
||||
|
||||
###### Type
|
||||
|
||||
```ts
|
||||
export type {Options} from 'micromark-extension-mdx-expression'
|
||||
```
|
||||
|
||||
See [`Options`][micromark-extension-mdx-expression-options].
|
||||
|
||||
## Authoring
|
||||
|
||||
For recommendations on how to author MDX, see each corresponding readme:
|
||||
|
||||
* [expressions](https://github.com/micromark/micromark-extension-mdx-expression/tree/main/packages/micromark-extension-mdx-expression#authoring)
|
||||
* [JSX](https://github.com/micromark/micromark-extension-mdx-jsx#authoring)
|
||||
* [ESM](https://github.com/micromark/micromark-extension-mdxjs-esm#authoring)
|
||||
* [CommonMark features not in MDX](https://github.com/micromark/micromark-extension-mdx-md#authoring)
|
||||
|
||||
## Syntax
|
||||
|
||||
For info on the syntax of these features, see each corresponding readme:
|
||||
|
||||
* [expressions](https://github.com/micromark/micromark-extension-mdx-expression/tree/main/packages/micromark-extension-mdx-expression#syntax)
|
||||
* [JSX](https://github.com/micromark/micromark-extension-mdx-jsx#syntax)
|
||||
* [ESM](https://github.com/micromark/micromark-extension-mdxjs-esm#syntax)
|
||||
* CommonMark features not in MDX: n/a
|
||||
|
||||
## Errors
|
||||
|
||||
For info on what errors are thrown, see each corresponding readme:
|
||||
|
||||
* [expressions](https://github.com/micromark/micromark-extension-mdx-expression/tree/main/packages/micromark-extension-mdx-expression#errors)
|
||||
* [JSX](https://github.com/micromark/micromark-extension-mdx-jsx#errors)
|
||||
* [ESM](https://github.com/micromark/micromark-extension-mdxjs-esm#errors)
|
||||
* CommonMark features not in MDX: n/a
|
||||
|
||||
## Types
|
||||
|
||||
This package is fully typed with [TypeScript][].
|
||||
It exports the additional type [`Options`][api-options].
|
||||
|
||||
## Compatibility
|
||||
|
||||
Projects maintained by the unified collective are compatible with all maintained
|
||||
versions of Node.js.
|
||||
As of now, that is Node.js 16+.
|
||||
Our projects sometimes work with older versions, but this is not guaranteed.
|
||||
|
||||
These extensions work with `micromark` version 3+.
|
||||
|
||||
## Security
|
||||
|
||||
This package is safe.
|
||||
|
||||
## Related
|
||||
|
||||
* [`micromark-extension-mdx`][micromark-extension-mdx]
|
||||
— support MDX unaware of JS
|
||||
* [`mdast-util-mdx`][mdast-util-mdx]
|
||||
— support MDX in mdast
|
||||
* [`remark-mdx`][remark-mdx]
|
||||
— support MDX syntax in remark
|
||||
|
||||
## Contribute
|
||||
|
||||
See [`contributing.md` in `micromark/.github`][contributing] for ways to get
|
||||
started.
|
||||
See [`support.md`][support] for ways to get help.
|
||||
|
||||
This project has a [code of conduct][coc].
|
||||
By interacting with this repository, organization, or community you agree to
|
||||
abide by its terms.
|
||||
|
||||
## License
|
||||
|
||||
[MIT][license] © [Titus Wormer][author]
|
||||
|
||||
<!-- Definitions -->
|
||||
|
||||
[build-badge]: https://github.com/micromark/micromark-extension-mdxjs/workflows/main/badge.svg
|
||||
|
||||
[build]: https://github.com/micromark/micromark-extension-mdxjs/actions
|
||||
|
||||
[coverage-badge]: https://img.shields.io/codecov/c/github/micromark/micromark-extension-mdxjs.svg
|
||||
|
||||
[coverage]: https://codecov.io/github/micromark/micromark-extension-mdxjs
|
||||
|
||||
[downloads-badge]: https://img.shields.io/npm/dm/micromark-extension-mdxjs.svg
|
||||
|
||||
[downloads]: https://www.npmjs.com/package/micromark-extension-mdxjs
|
||||
|
||||
[size-badge]: https://img.shields.io/bundlephobia/minzip/micromark-extension-mdxjs.svg
|
||||
|
||||
[size]: https://bundlephobia.com/result?p=micromark-extension-mdxjs
|
||||
|
||||
[sponsors-badge]: https://opencollective.com/unified/sponsors/badge.svg
|
||||
|
||||
[backers-badge]: https://opencollective.com/unified/backers/badge.svg
|
||||
|
||||
[collective]: https://opencollective.com/unified
|
||||
|
||||
[chat-badge]: https://img.shields.io/badge/chat-discussions-success.svg
|
||||
|
||||
[chat]: https://github.com/micromark/micromark/discussions
|
||||
|
||||
[npm]: https://docs.npmjs.com/cli/install
|
||||
|
||||
[esmsh]: https://esm.sh
|
||||
|
||||
[license]: license
|
||||
|
||||
[author]: https://wooorm.com
|
||||
|
||||
[contributing]: https://github.com/micromark/.github/blob/main/contributing.md
|
||||
|
||||
[support]: https://github.com/micromark/.github/blob/main/support.md
|
||||
|
||||
[coc]: https://github.com/micromark/.github/blob/main/code-of-conduct.md
|
||||
|
||||
[esm]: https://gist.github.com/sindresorhus/a39789f98801d908bbc7ff3ecc99d99c
|
||||
|
||||
[typescript]: https://www.typescriptlang.org
|
||||
|
||||
[development]: https://nodejs.org/api/packages.html#packages_resolving_user_conditions
|
||||
|
||||
[micromark]: https://github.com/micromark/micromark
|
||||
|
||||
[micromark-extension]: https://github.com/micromark/micromark#syntaxextension
|
||||
|
||||
[micromark-extension-mdx]: https://github.com/micromark/micromark-extension-mdx
|
||||
|
||||
[micromark-extension-mdx-expression]: https://github.com/micromark/micromark-extension-mdx-expression
|
||||
|
||||
[micromark-extension-mdx-jsx]: https://github.com/micromark/micromark-extension-mdx-jsx
|
||||
|
||||
[micromark-extension-mdx-md]: https://github.com/micromark/micromark-extension-mdx-md
|
||||
|
||||
[micromark-extension-mdxjs-esm]: https://github.com/micromark/micromark-extension-mdxjs-esm
|
||||
|
||||
[mdast-util-from-markdown]: https://github.com/syntax-tree/mdast-util-from-markdown
|
||||
|
||||
[mdast-util-mdx]: https://github.com/syntax-tree/mdast-util-mdx
|
||||
|
||||
[remark-mdx]: https://mdxjs.com/packages/remark-mdx/
|
||||
|
||||
[mdxjs]: https://mdxjs.com
|
||||
|
||||
[api-mdxjs]: #mdxjsoptions
|
||||
|
||||
[api-options]: #options
|
||||
|
||||
[micromark-extension-mdx-expression-options]: https://github.com/micromark/micromark-extension-mdx-expression/blob/main/packages/micromark-extension-mdx-expression/readme.md#options
|
||||
Loading…
Add table
Add a link
Reference in a new issue