Skip to content

Commit

Permalink
patch: fix tsconfig.json again for esm
Browse files Browse the repository at this point in the history
  • Loading branch information
LumaKernel committed Jan 28, 2024
1 parent 3c80383 commit 918b2bc
Show file tree
Hide file tree
Showing 28 changed files with 68 additions and 68 deletions.
20 changes: 10 additions & 10 deletions scripts/debug-render-example.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,20 +5,20 @@ import * as path from "node:path";

import remarkFrontmatter from "remark-frontmatter";

import rehypeAddSlug from "../src/rehype-add-slug";
import rehypeReplaceText from "../src/rehype-replace-text";
import rehypeKatex from "../src/rehype-katex";
import rehypeWrap from "../src/rehype-wrap";
import rehypeCounter from "../src/rehype-counter";
import rehypeCleanInternal from "../src/rehype-clean-internal";
import rehypeAddSlug from "../src/rehype-add-slug.js";
import rehypeReplaceText from "../src/rehype-replace-text.js";
import rehypeKatex from "../src/rehype-katex.js";
import rehypeWrap from "../src/rehype-wrap.js";
import rehypeCounter from "../src/rehype-counter.js";
import rehypeCleanInternal from "../src/rehype-clean-internal.js";
// import rehypeDebug from "../src/rehype-debug";
// import remarkDebug from "../src/remark-debug";
import remarkTerm from "../src/remark-term";
import remarkMeta from "../src/remark-meta";
import rehypeSave from "../src/rehype-save";
import remarkTerm from "../src/remark-term.js";
import remarkMeta from "../src/remark-meta.js";
import rehypeSave from "../src/rehype-save.js";
import remarkMath from "remark-math";

import * as prompt from "prompt";
import prompt from "prompt";

const projectRoot = path.resolve(__dirname, "..");
const exampleDir = path.resolve(projectRoot, "examples/render/input");
Expand Down
4 changes: 2 additions & 2 deletions scripts/debug-term.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { fromMarkdown } from "mdast-util-from-markdown";
import { inspect } from "node:util";
import { lumaTerm } from "../src/luma-term/micromark-extension";
import { lumaTermFromMarkdown } from "../src/luma-term/from-markdown-extension";
import { lumaTerm } from "../src/luma-term/micromark-extension.js";
import { lumaTermFromMarkdown } from "../src/luma-term/from-markdown-extension.js";

const buf = `
# Hello
Expand Down
2 changes: 1 addition & 1 deletion src/lib/__tests__/to-slug.spec.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { toSlug } from "../to-slug";
import { toSlug } from "../to-slug.js";
import { describe, expect, it } from "vitest";

describe("toSlug", () => {
Expand Down
2 changes: 1 addition & 1 deletion src/lib/term/__tests__/detect.spec.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { extractTerms } from "../detect";
import { extractTerms } from "../detect.js";
import { describe, expect, it } from "vitest";

describe("extractTerms", () => {
Expand Down
2 changes: 1 addition & 1 deletion src/luma-counter/from-markdown-extension.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { type Extension as FromMarkdownExtension } from "mdast-util-from-markdown";
import type { Extension as FromMarkdownExtension } from "mdast-util-from-markdown";

export const lumaCounterFromMarkdown: FromMarkdownExtension = {
enter: {
Expand Down
2 changes: 1 addition & 1 deletion src/luma-save/from-markdown-extension.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { type Extension as FromMarkdownExtension } from "mdast-util-from-markdown";
import type { Extension as FromMarkdownExtension } from "mdast-util-from-markdown";

export const lumaSaveFromMarkdown: FromMarkdownExtension = {
enter: {
Expand Down
4 changes: 2 additions & 2 deletions src/luma-term/from-markdown-extension.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { type Extension as FromMarkdownExtension } from "mdast-util-from-markdown";
import { lumaTermAttributes } from "./constants";
import type { Extension as FromMarkdownExtension } from "mdast-util-from-markdown";
import { lumaTermAttributes } from "./constants.js";

export const lumaTermFromMarkdown: FromMarkdownExtension = {
enter: {
Expand Down
8 changes: 4 additions & 4 deletions src/rehype-add-slug.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
import { toText } from "hast-util-to-text";
import { toSlug } from "./lib/to-slug";
import { STEP_OVER, visit } from "./util/visit";
import { estreeJsonParseOf } from "./util/estree-json-parse-of";
import { Toc, TocHeading } from "./types";
import { toSlug } from "./lib/to-slug.js";
import { STEP_OVER, visit } from "./util/visit.js";
import { estreeJsonParseOf } from "./util/estree-json-parse-of.js";
import type { Toc, TocHeading } from "./types.js";
import type { ElementContent } from "hast";

type Root = import("hast").Root;
Expand Down
2 changes: 1 addition & 1 deletion src/rehype-clean-internal.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { DELETE, visit } from "./util/visit";
import { DELETE, visit } from "./util/visit.js";

type Root = import("hast").Root;

Expand Down
10 changes: 5 additions & 5 deletions src/rehype-counter.ts
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
import { MdxJsxFlowElementHast } from "mdast-util-mdx-jsx";
import { visit } from "./util/visit";
import { getAttrByName } from "./util/util-mdast";
import { estreeJsonParseOf } from "./util/estree-json-parse-of";
import { lumaCounter } from "./luma-counter/micromark-extension";
import { lumaCounterFromMarkdown } from "./luma-counter/from-markdown-extension";
import { visit } from "./util/visit.js";
import { getAttrByName } from "./util/util-mdast.js";
import { estreeJsonParseOf } from "./util/estree-json-parse-of.js";
import { lumaCounter } from "./luma-counter/micromark-extension.js";
import { lumaCounterFromMarkdown } from "./luma-counter/from-markdown-extension.js";

type Root = import("hast").Root;

Expand Down
2 changes: 1 addition & 1 deletion src/rehype-debug.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { visit, STEP_OVER } from "./util/visit";
import { visit, STEP_OVER } from "./util/visit.js";
import { inspect } from "node:util";

type Root = import("hast").Root;
Expand Down
16 changes: 8 additions & 8 deletions src/rehype-katex.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,16 +4,16 @@ import type {
} from "mdast-util-mdx-jsx";
import type { MdxFlowExpressionHast } from "mdast-util-mdx-expression";
import type { Expression } from "estree";
import { DELETE, REPLACE, STEP_OVER, visit } from "./util/visit";
import { DELETE, REPLACE, STEP_OVER, visit } from "./util/visit.js";
import { toText } from "hast-util-to-text";
import { getAttrByName } from "./util/util-mdast";
import { estreeDeclareSymbol } from "./util/rehype-katex/estree-declare-symbol";
import { estreeResetCtx } from "./util/rehype-katex/estree-ctx-reset";
import { estreeDeleteCtx } from "./util/rehype-katex/estree-ctx-delete";
import { estreePushCtx } from "./util/rehype-katex/estree-ctx-push";
import { estreeCtxValue } from "./util/rehype-katex/estree-ctx-value";
import { getAttrByName } from "./util/util-mdast.js";
import { estreeDeclareSymbol } from "./util/rehype-katex/estree-declare-symbol.js";
import { estreeResetCtx } from "./util/rehype-katex/estree-ctx-reset.js";
import { estreeDeleteCtx } from "./util/rehype-katex/estree-ctx-delete.js";
import { estreePushCtx } from "./util/rehype-katex/estree-ctx-push.js";
import { estreeCtxValue } from "./util/rehype-katex/estree-ctx-value.js";
import type { Element } from "hast";
import { getClasses } from "./util/get-classes";
import { getClasses } from "./util/get-classes.js";

type Root = import("hast").Root;

Expand Down
4 changes: 2 additions & 2 deletions src/rehype-replace-text.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { replaceJapanesePunctuation } from "./lib/replace-japanese-punctuation";
import { visit, STEP_OVER } from "./util/visit";
import { replaceJapanesePunctuation } from "./lib/replace-japanese-punctuation.js";
import { visit, STEP_OVER } from "./util/visit.js";

type Root = import("hast").Root;

Expand Down
8 changes: 4 additions & 4 deletions src/rehype-save.ts
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
import { lumaSave } from "./luma-save/micromark-extension";
import { lumaSave } from "./luma-save/micromark-extension.js";
import type {
MdxJsxFlowElement,
MdxJsxFlowElementHast,
} from "mdast-util-mdx-jsx";
import { lumaSaveFromMarkdown } from "./luma-save/from-markdown-extension";
import { DELETE, REPLACE, STEP_OVER, visit } from "./util/visit";
import { estreeJsonParseOf } from "./util/estree-json-parse-of";
import { lumaSaveFromMarkdown } from "./luma-save/from-markdown-extension.js";
import { DELETE, REPLACE, STEP_OVER, visit } from "./util/visit.js";
import { estreeJsonParseOf } from "./util/estree-json-parse-of.js";

type Root = import("hast").Root;

Expand Down
6 changes: 3 additions & 3 deletions src/rehype-wrap.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { EXIT, visit } from "./util/visit";
import { EXIT, visit } from "./util/visit.js";
import type { MdxJsxFlowElement } from "mdast-util-mdx-jsx";
import { getAttrByName } from "./util/util-mdast";
import { estreeJsonParseOf } from "./util/estree-json-parse-of";
import { getAttrByName } from "./util/util-mdast.js";
import { estreeJsonParseOf } from "./util/estree-json-parse-of.js";

type Root = import("hast").Root;

Expand Down
2 changes: 1 addition & 1 deletion src/remark-debug.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { visit, STEP_OVER } from "./util/visit";
import { visit, STEP_OVER } from "./util/visit.js";
import { inspect } from "node:util";

type Root = import("mdast").Root;
Expand Down
4 changes: 2 additions & 2 deletions src/remark-meta.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { getMdastMeta } from "./util/util-mdast-meta";
import { estreeJsonParseOf } from "./util/estree-json-parse-of";
import { getMdastMeta } from "./util/util-mdast-meta.js";
import { estreeJsonParseOf } from "./util/estree-json-parse-of.js";

type Root = import("mdast").Root;

Expand Down
16 changes: 8 additions & 8 deletions src/remark-term.ts
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
import type { MdxJsxFlowElement } from "mdast-util-mdx-jsx";

import { lumaTerm } from "./luma-term/micromark-extension";
import { lumaTermFromMarkdown } from "./luma-term/from-markdown-extension";
import { getMdastMeta } from "./util/util-mdast-meta";
import { mapIntersection } from "./lib/map-util";
import { setAttr, getAttrByName } from "./util/util-mdast";
import { lumaTermAttributes } from "./luma-term/constants";
import { STEP_OVER, visit } from "./util/visit";
import { estreeJsonParseOf } from "./util/estree-json-parse-of";
import { lumaTerm } from "./luma-term/micromark-extension.js";
import { lumaTermFromMarkdown } from "./luma-term/from-markdown-extension.js";
import { getMdastMeta } from "./util/util-mdast-meta.js";
import { mapIntersection } from "./lib/map-util.js";
import { setAttr, getAttrByName } from "./util/util-mdast.js";
import { lumaTermAttributes } from "./luma-term/constants.js";
import { STEP_OVER, visit } from "./util/visit.js";
import { estreeJsonParseOf } from "./util/estree-json-parse-of.js";

type Root = import("mdast").Root;

Expand Down
2 changes: 1 addition & 1 deletion src/util/estree-json-parse-of.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import type { Program } from "@mdx-js/mdx/lib/core";
import type { Program } from "estree";

export const estreeJsonParseOf = (value: unknown): Program => {
return {
Expand Down
2 changes: 1 addition & 1 deletion src/util/rehype-katex/estree-ctx-delete.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import type { Program } from "@mdx-js/mdx/lib/core";
import type { Program } from "estree";

export const estreeDeleteCtx = (varName: string): Program => {
return {
Expand Down
2 changes: 1 addition & 1 deletion src/util/rehype-katex/estree-ctx-push-const.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import type { Program } from "@mdx-js/mdx/lib/core";
import type { Program } from "estree";

export const estreePushCtxConst = (varName: string, v: string): Program => {
return {
Expand Down
2 changes: 1 addition & 1 deletion src/util/rehype-katex/estree-ctx-push.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import type { Program } from "@mdx-js/mdx/lib/core";
import type { Program } from "estree";
import type { Expression } from "estree";

export const estreePushCtx = (varName: string, expr: Expression): Program => {
Expand Down
2 changes: 1 addition & 1 deletion src/util/rehype-katex/estree-ctx-reset.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import type { Program } from "@mdx-js/mdx/lib/core";
import type { Program } from "estree";

export const estreeResetCtx = (varName: string): Program => {
return {
Expand Down
2 changes: 1 addition & 1 deletion src/util/rehype-katex/estree-ctx-value.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import type { Program } from "@mdx-js/mdx/lib/core";
import type { Program } from "estree";

export const estreeCtxValue = (varName: string): Program => {
return {
Expand Down
2 changes: 1 addition & 1 deletion src/util/rehype-katex/estree-declare-symbol.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import type { Program } from "@mdx-js/mdx/lib/core";
import type { Program } from "estree";

export const estreeDeclareSymbol = (varName: string): Program => {
return {
Expand Down
2 changes: 1 addition & 1 deletion src/util/rehype-katex/estree-var.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import type { Program } from "@mdx-js/mdx/lib/core";
import type { Program } from "estree";

export const estreeVar = (varName: string): Program => {
return {
Expand Down
2 changes: 1 addition & 1 deletion src/util/util-mdast-meta.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { visit, STEP_OVER } from "./visit";
import { visit, STEP_OVER } from "./visit.js";
import type { Node } from "unist";
import * as YAML from "yaml";

Expand Down
4 changes: 2 additions & 2 deletions tsconfig.json
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
{
"compilerOptions": {
"strict": true,
"module": "ESNext",
"moduleResolution": "Node",
"module": "NodeNext",
"moduleResolution": "NodeNext",
"skipLibCheck": true,
"target": "ES2022",
"outDir": "dist",
Expand Down

0 comments on commit 918b2bc

Please sign in to comment.