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

feat: remove rollup #450

Merged
merged 6 commits into from
Mar 14, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
2 changes: 1 addition & 1 deletion index.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,4 @@
* SPDX-License-Identifier: MPL-2.0
*/

export * from './dist/index'
export * from './dist/index.js'
13,847 changes: 1,549 additions & 12,298 deletions package-lock.json

Large diffs are not rendered by default.

19 changes: 6 additions & 13 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,21 +12,21 @@
"./rsc": "./rsc.js"
},
"dependencies": {
"@babel/code-frame": "^7.23.5",
"@mdx-js/mdx": "^3.0.1",
"@mdx-js/react": "^3.0.1",
"unist-util-remove": "^3.1.0",
"vfile": "^6.0.1",
"vfile-matter": "^5.0.0"
},
"peerDependencies": {
"react": ">=16.x <=18.x",
"react-dom": ">=16.x <=18.x"
},
"devDependencies": {
"@babel/code-frame": "^7.16.0",
"@changesets/changelog-github": "^0.5.0",
"@changesets/cli": "^2.27.1",
"@hashicorp/remark-plugins": "^3.2.1",
"@rollup/plugin-commonjs": "^21.0.1",
"@rollup/plugin-json": "^4.1.0",
"@rollup/plugin-node-resolve": "^13.0.6",
"@rollup/plugin-typescript": "^8.3.0",
"@types/babel__code-frame": "^7.0.3",
"@types/cross-spawn": "^6.0.2",
"@types/node": "^18.11.9",
Expand All @@ -46,10 +46,8 @@
"react-dom": "^18.2.0",
"release": "^6.3.0",
"rmfr": "^2.0.0",
"rollup": "^2.59.0",
"serve-handler": "^6.1.3",
"tree-kill": "^1.2.2",
"tslib": "^2.3.1",
"typescript": "^5.4.2",
"vitest": "^1.3.1"
},
Expand All @@ -66,10 +64,6 @@
"next.js"
],
"license": "MPL-2.0",
"peerDependencies": {
"react": ">=16.x <=18.x",
"react-dom": ">=16.x <=18.x"
},
"engines": {
"node": ">=14",
"npm": ">=7"
Expand All @@ -79,8 +73,7 @@
"url": "git+https://github.com/hashicorp/next-mdx-remote.git"
},
"scripts": {
"build": "rm -rf ./dist && rollup -c rollup.config.js",
"postbuild": "cp ./src/jsx-runtime.cjs dist",
"build": "rm -rf ./dist && tsc -p .",
"lint": "prettier --write \"./**/*.{js,jsx,json}\"",
"release:major": "release major && npm publish",
"release:minor": "release minor && npm publish",
Expand Down
92 changes: 0 additions & 92 deletions rollup.config.js

This file was deleted.

2 changes: 1 addition & 1 deletion rsc.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,4 @@
* SPDX-License-Identifier: MPL-2.0
*/

export * from './dist/rsc'
export * from './dist/rsc.js'
2 changes: 1 addition & 1 deletion serialize.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,4 @@
* SPDX-License-Identifier: MPL-2.0
*/

export * from './dist/serialize'
export * from './dist/serialize.js'
4 changes: 2 additions & 2 deletions src/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,11 @@
* SPDX-License-Identifier: MPL-2.0
*/

import './idle-callback-polyfill'
import './idle-callback-polyfill.js'
import React, { useEffect, useState, useMemo } from 'react'
import { jsxRuntime } from './jsx-runtime.cjs'
import * as mdx from '@mdx-js/react'
import type { MDXRemoteSerializeResult } from './types'
import type { MDXRemoteSerializeResult } from './types.js'

// requestIdleCallback types found here: https://github.com/microsoft/TypeScript/issues/21309
type RequestIdleCallbackHandle = number
Expand Down
8 changes: 0 additions & 8 deletions src/jsx-runtime.cjs.d.ts

This file was deleted.

2 changes: 1 addition & 1 deletion src/plugins/remove-imports-exports.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
*/

import { remove } from 'unist-util-remove'
import { Plugin } from 'unified'
import type { Plugin } from 'unified'

/**
* remark plugin which removes all import and export statements
Expand Down
4 changes: 2 additions & 2 deletions src/rsc.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,10 @@

import React from 'react'
import { jsxRuntime } from './jsx-runtime.cjs'
import type { MDXRemoteSerializeResult, SerializeOptions } from './types'
import type { MDXRemoteSerializeResult, SerializeOptions } from './types.js'
import { VFileCompatible } from 'vfile'
import { MDXProvider } from '@mdx-js/react'
import { serialize } from './serialize'
import { serialize } from './serialize.js'

export type MDXRemoteProps = {
source: VFileCompatible
Expand Down
6 changes: 3 additions & 3 deletions src/serialize.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,11 @@ import { compile, CompileOptions } from '@mdx-js/mdx'
import { VFile, VFileCompatible } from 'vfile'
import { matter } from 'vfile-matter'

import { createFormattedMDXError } from './format-mdx-error'
import { removeImportsExportsPlugin } from './plugins/remove-imports-exports'
import { createFormattedMDXError } from './format-mdx-error.js'
import { removeImportsExportsPlugin } from './plugins/remove-imports-exports.js'

// types
import type { MDXRemoteSerializeResult, SerializeOptions } from './types'
import type { MDXRemoteSerializeResult, SerializeOptions } from './types.js'

function getCompileOptions(
mdxOptions: SerializeOptions['mdxOptions'] = {},
Expand Down
8 changes: 4 additions & 4 deletions tsconfig.json
Original file line number Diff line number Diff line change
@@ -1,18 +1,18 @@
{
"compilerOptions": {
"target": "ESNext",
"module": "esnext",
"module": "NodeNext",
"lib": ["es6", "dom"],
"allowJs": true,
"skipLibCheck": true,
"strict": true,
"forceConsistentCasingInFileNames": true,
"moduleResolution": "node",
"esModuleInterop": true,
"jsx": "react",
"declaration": true,
"declarationDir": "./dist",
"outDir": "./dist"
"outDir": "./dist",
"rootDir": "./src"
},
"include": ["./src", "types.d.ts", "__tests__", "global.d.ts"]
"include": ["./src"]
}
Loading