From f81ff0ac74f9169b49891a795c69c6b2326dbf5f Mon Sep 17 00:00:00 2001 From: Bhsd <55071315+bhsd-harry@users.noreply.github.com> Date: Thu, 19 Dec 2024 18:44:54 +0800 Subject: [PATCH] fix: export ESM --- build.sh | 3 ++- extensions/typings.d.ts | 2 +- package.json | 1 + 3 files changed, 4 insertions(+), 2 deletions(-) diff --git a/build.sh b/build.sh index 7d6acc3a..3f7dc979 100644 --- a/build.sh +++ b/build.sh @@ -1,10 +1,11 @@ #!/usr/local/bin/bash rm -rf dist/ -tsc && npm run declaration +tsc && npm run declaration && npx esbuild ./util/sharable.ts --charset=utf8 --target=es2023 --format=esm --outfile=dist/util/sharable.mjs if [[ $? -eq 0 ]] then mv dist/util/sharable.d.ts . rm dist/internal.js dist/[abptu]*/*.d.ts + cp sharable.d.ts dist/util/sharable.d.mts mv sharable.d.ts dist/util/ bash sed.sh -i '/export declare const /,$d' dist/mixin/*.d.ts echo 'declare global { type Acceptable = unknown; }' >> dist/index.d.ts diff --git a/extensions/typings.d.ts b/extensions/typings.d.ts index 96e0f323..63dfa4a3 100644 --- a/extensions/typings.d.ts +++ b/extensions/typings.d.ts @@ -3,7 +3,7 @@ import type { } from '@codemirror/lint'; import type {editor} from 'monaco-editor'; import type {CodeJar} from 'codejar-async'; -import type {Config, LintError, AST} from '../base'; +import type {Config, LintError, AST} from 'wikiparser-node'; export type { AST, diff --git a/package.json b/package.json index 2e935aa7..80d28e72 100644 --- a/package.json +++ b/package.json @@ -17,6 +17,7 @@ "/errors/README", "/printed/README", "/bundle/bundle.*.js", + "/extensions/typings.d.ts", "/extensions/dist/", "/extensions/*.css", "!/extensions/dist/gh-page.js",