Skip to content

Commit

Permalink
fix(harper.js): properly export types from harper-wasm
Browse files Browse the repository at this point in the history
  • Loading branch information
elijah-potter committed Jan 13, 2025
1 parent b5c2dc6 commit aad7519
Show file tree
Hide file tree
Showing 7 changed files with 76 additions and 86 deletions.
2 changes: 1 addition & 1 deletion packages/harper.js/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
"playwright": "^1.49.1",
"typescript": "~5.6.2",
"vite": "^5.1.8",
"vite-plugin-dts": "^4.3.0",
"vite-plugin-dts": "^4.5.0",
"vite-plugin-virtual": "^0.3.0",
"vitest": "^2.1.8"
},
Expand Down
8 changes: 0 additions & 8 deletions packages/harper.js/src/main.test.ts

This file was deleted.

9 changes: 2 additions & 7 deletions packages/harper.js/src/main.ts
Original file line number Diff line number Diff line change
@@ -1,15 +1,10 @@
import type { Lint, Span, Suggestion } from 'wasm';
import { SuggestionKind } from 'wasm';
import Linter from './Linter';
import LocalLinter from './LocalLinter';
import WorkerLinter from './WorkerLinter';

export { LocalLinter, WorkerLinter };
export { LocalLinter, WorkerLinter, SuggestionKind };
export type { Linter, Lint, Span, Suggestion };

export enum SuggestionKind {
Replace = 0,
Remove = 1,
InsertAfter = 2
}

export type LintConfig = Record<string, boolean | undefined>;
5 changes: 4 additions & 1 deletion packages/harper.js/tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,10 @@
"noUnusedLocals": true,
"noUnusedParameters": true,
"noFallthroughCasesInSwitch": true,
"types": ["vite/client"]
"types": ["vite/client"],
"paths": {
"wasm": ["../../harper-wasm/pkg"]
}
},
"include": ["src"]
}
2 changes: 1 addition & 1 deletion packages/harper.js/vite.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ export default defineConfig({
},
base: './',
plugins: [
dts({ rollupTypes: true, tsconfigPath: './tsconfig.json' }),
dts({ rollupTypes: true, tsconfigPath: './tsconfig.json', bundledPackages: ['wasm'] }),
virtual({
'virtual:wasm': `import wasmUri from 'wasm/harper_wasm_bg.wasm?inline'; export default wasmUri`
})
Expand Down
2 changes: 1 addition & 1 deletion packages/web/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
},
"devDependencies": {
"@sveltejs/adapter-node": "^3.0.3",
"@sveltejs/kit": "^2.0.0",
"@sveltejs/kit": "^2.15.2",
"@sveltejs/vite-plugin-svelte": "^5.0.3",
"@types/reveal.js": "^5.0.3",
"autoprefixer": "^10.4.16",
Expand Down
134 changes: 67 additions & 67 deletions packages/yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -1814,33 +1814,33 @@
resolved "https://registry.yarnpkg.com/@lukeed/csprng/-/csprng-1.1.0.tgz#1e3e4bd05c1cc7a0b2ddbd8a03f39f6e4b5e6cfe"
integrity sha512-Z7C/xXCiGWsg0KuKsHTKJxbWhpI3Vs5GwLfOean7MGyVFGqdRgBbAjOCh6u4bbjPc/8MJ2pZmK/0DLdCbivLDA==

"@microsoft/api-extractor-model@7.30.1":
version "7.30.1"
resolved "https://registry.yarnpkg.com/@microsoft/api-extractor-model/-/api-extractor-model-7.30.1.tgz#719e2ab8afe8fe3a5dd65aaa8783dbba90f7c802"
integrity sha512-CTS2PlASJHxVY8hqHORVb1HdECWOEMcMnM6/kDkPr0RZapAFSIHhg9D4jxuE8g+OWYHtPc10LCpmde5pylTRlA==
"@microsoft/api-extractor-model@7.30.2":
version "7.30.2"
resolved "https://registry.yarnpkg.com/@microsoft/api-extractor-model/-/api-extractor-model-7.30.2.tgz#9c0b2446f6bbcdd0159e16b0e8f8694d645ce257"
integrity sha512-3/t2F+WhkJgBzSNwlkTIL0tBgUoBqDqL66pT+nh2mPbM0NIDGVGtpqbGWPgHIzn/mn7kGS/Ep8D8po58e8UUIw==
dependencies:
"@microsoft/tsdoc" "~0.15.1"
"@microsoft/tsdoc-config" "~0.17.1"
"@rushstack/node-core-library" "5.10.1"
"@rushstack/node-core-library" "5.10.2"

"@microsoft/api-extractor@^7.47.11":
version "7.48.1"
resolved "https://registry.yarnpkg.com/@microsoft/api-extractor/-/api-extractor-7.48.1.tgz#792197cfc5113cd2efc04524c065d682ef58d2ba"
integrity sha512-HN9Osa1WxqLM66RaqB5nPAadx+nTIQmY/XtkFdaJvusjG8Tus++QqZtD7KPZDSkhEMGHsYeSyeU8qUzCDUXPjg==
"@microsoft/api-extractor@^7.49.1":
version "7.49.1"
resolved "https://registry.yarnpkg.com/@microsoft/api-extractor/-/api-extractor-7.49.1.tgz#e525cadfa09a9d376fd05e8b9415f6bc6260f01a"
integrity sha512-jRTR/XbQF2kb+dYn8hfYSicOGA99+Fo00GrsdMwdfE3eIgLtKdH6Qa2M3wZV9S2XmbgCaGX1OdPtYctbfu5jQg==
dependencies:
"@microsoft/api-extractor-model" "7.30.1"
"@microsoft/api-extractor-model" "7.30.2"
"@microsoft/tsdoc" "~0.15.1"
"@microsoft/tsdoc-config" "~0.17.1"
"@rushstack/node-core-library" "5.10.1"
"@rushstack/node-core-library" "5.10.2"
"@rushstack/rig-package" "0.5.3"
"@rushstack/terminal" "0.14.4"
"@rushstack/ts-command-line" "4.23.2"
"@rushstack/terminal" "0.14.5"
"@rushstack/ts-command-line" "4.23.3"
lodash "~4.17.15"
minimatch "~3.0.3"
resolve "~1.22.1"
semver "~7.5.4"
source-map "~0.6.1"
typescript "5.4.2"
typescript "5.7.2"

"@microsoft/tsdoc-config@~0.17.1":
version "0.17.1"
Expand Down Expand Up @@ -2022,7 +2022,7 @@
estree-walker "^2.0.2"
picomatch "^2.3.1"

"@rollup/pluginutils@^5.1.3":
"@rollup/pluginutils@^5.1.3", "@rollup/pluginutils@^5.1.4":
version "5.1.4"
resolved "https://registry.yarnpkg.com/@rollup/pluginutils/-/pluginutils-5.1.4.tgz#bb94f1f9eaaac944da237767cdfee6c5b2262d4a"
integrity sha512-USm05zrsFxYLPdWWq+K3STlWiT/3ELn3RcV5hJMghpeAIhxfsUIg6mt12CBJBInWMV4VneoV7SfGv8xIwo2qNQ==
Expand Down Expand Up @@ -2206,10 +2206,10 @@
resolved "https://registry.yarnpkg.com/@rollup/rollup-win32-x64-msvc/-/rollup-win32-x64-msvc-4.28.1.tgz#4dff5c4259ebe6c5b4a8f2c5bc3829b7a8447ff0"
integrity sha512-ZvK2jBafvttJjoIdKm/Q/Bh7IJ1Ose9IBOwpOXcOvW3ikGTQGmKDgxTC6oCAzW6PynbkKP8+um1du81XJHZ0JA==

"@rushstack/node-core-library@5.10.1":
version "5.10.1"
resolved "https://registry.yarnpkg.com/@rushstack/node-core-library/-/node-core-library-5.10.1.tgz#14c10c918ed12da003c21af9d5bf0e76633215d2"
integrity sha512-BSb/KcyBHmUQwINrgtzo6jiH0HlGFmrUy33vO6unmceuVKTEyL2q+P0fQq2oB5hvXVWOEUhxB2QvlkZluvUEmg==
"@rushstack/node-core-library@5.10.2":
version "5.10.2"
resolved "https://registry.yarnpkg.com/@rushstack/node-core-library/-/node-core-library-5.10.2.tgz#8d12bc5bd9244ea57f441877246efb0a1b7b7df6"
integrity sha512-xOF/2gVJZTfjTxbo4BDj9RtQq/HFnrrKdtem4JkyRLnwsRz2UDTg8gA1/et10fBx5RxmZD9bYVGST69W8ME5OQ==
dependencies:
ajv "~8.13.0"
ajv-draft-04 "~1.0.0"
Expand All @@ -2228,20 +2228,20 @@
resolve "~1.22.1"
strip-json-comments "~3.1.1"

"@rushstack/terminal@0.14.4":
version "0.14.4"
resolved "https://registry.yarnpkg.com/@rushstack/terminal/-/terminal-0.14.4.tgz#37e160b0878a324cf3e0fecab25fe48a030e29ed"
integrity sha512-NxACqERW0PHq8Rpq1V6v5iTHEwkRGxenjEW+VWqRYQ8T9puUzgmGHmEZUaUEDHAe9Qyvp0/Ew04sAiQw9XjhJg==
"@rushstack/terminal@0.14.5":
version "0.14.5"
resolved "https://registry.yarnpkg.com/@rushstack/terminal/-/terminal-0.14.5.tgz#4b0e79b139b4372901956f920b5a4a405a1d09d8"
integrity sha512-TEOpNwwmsZVrkp0omnuTUTGZRJKTr6n6m4OITiNjkqzLAkcazVpwR1SOtBg6uzpkIBLgrcNHETqI8rbw3uiUfw==
dependencies:
"@rushstack/node-core-library" "5.10.1"
"@rushstack/node-core-library" "5.10.2"
supports-color "~8.1.1"

"@rushstack/ts-command-line@4.23.2":
version "4.23.2"
resolved "https://registry.yarnpkg.com/@rushstack/ts-command-line/-/ts-command-line-4.23.2.tgz#37b28a418db84d04f6a1c787390dd02ad8dfadf0"
integrity sha512-JJ7XZX5K3ThBBva38aomgsPv1L7FV6XmSOcR6HtM7HDFZJkepqT65imw26h9ggGqMjsY0R9jcl30tzKcVj9aOQ==
"@rushstack/ts-command-line@4.23.3":
version "4.23.3"
resolved "https://registry.yarnpkg.com/@rushstack/ts-command-line/-/ts-command-line-4.23.3.tgz#a42fe413159c0f3f2c57afdceedf91a5b75c2d67"
integrity sha512-HazKL8fv4HMQMzrKJCrOrhyBPPdzk7iajUXgsASwjQ8ROo1cmgyqxt/k9+SdmrNLGE1zATgRqMUH3s/6smbRMA==
dependencies:
"@rushstack/terminal" "0.14.4"
"@rushstack/terminal" "0.14.5"
"@types/argparse" "1.0.38"
argparse "~1.0.9"
string-argv "~0.3.1"
Expand Down Expand Up @@ -2322,10 +2322,10 @@
"@rollup/plugin-node-resolve" "^15.2.3"
rollup "^4.9.5"

"@sveltejs/kit@^2.0.0":
version "2.13.0"
resolved "https://registry.yarnpkg.com/@sveltejs/kit/-/kit-2.13.0.tgz#46cf8fe302f059242363f09268702069387cfd58"
integrity sha512-6t6ne00vZx/TjD6s0Jvwt8wRLKBwbSAN1nhlOzcLUSTYX1hTp4eCBaTPB5Yz/lu+tYcvz4YPEEuPv3yfsNp2gw==
"@sveltejs/kit@^2.15.2":
version "2.15.2"
resolved "https://registry.yarnpkg.com/@sveltejs/kit/-/kit-2.15.2.tgz#a6e9357856089da5233bdbf03e8d4cb7483a0c49"
integrity sha512-p208T1kdM6zd8k4YXIUM60pLWQ8dZqehXSiqn4NulXHyHibX53uIAL2xtNL8GjxX2IVPqPRT978MwVYhCKExdQ==
dependencies:
"@types/cookie" "^0.6.0"
cookie "^0.6.0"
Expand Down Expand Up @@ -3142,7 +3142,7 @@
loupe "^3.1.2"
tinyrainbow "^1.2.0"

"@volar/language-core@2.4.11", "@volar/language-core@~2.4.1":
"@volar/language-core@2.4.11", "@volar/language-core@~2.4.11":
version "2.4.11"
resolved "https://registry.yarnpkg.com/@volar/language-core/-/language-core-2.4.11.tgz#d95a9ec4f14fbdb41a6a64f9f321d11d23a5291c"
integrity sha512-lN2C1+ByfW9/JRPpqScuZt/4OrUUse57GLI6TbLgTIqBVemdl1wNcZ1qYGEo2+Gw8coYLgCy7SuKqn6IrQcQgg==
Expand All @@ -3154,7 +3154,7 @@
resolved "https://registry.yarnpkg.com/@volar/source-map/-/source-map-2.4.11.tgz#5876d4531508129724c2755e295db1df98bd5895"
integrity sha512-ZQpmafIGvaZMn/8iuvCFGrW3smeqkq/IIh9F1SdSx9aUl0J4Iurzd6/FhmjNO5g2ejF3rT45dKskgXWiofqlZQ==

"@volar/typescript@^2.4.4":
"@volar/typescript@^2.4.11":
version "2.4.11"
resolved "https://registry.yarnpkg.com/@volar/typescript/-/typescript-2.4.11.tgz#aafbfa413337654db211bf4d8fb6670c89f6fa57"
integrity sha512-2DT+Tdh88Spp5PyPbqhyoYavYCPDsqbHLFwcUI9K1NlY1YgUJvujGdrqUp0zWxnW7KWNTr3xSpMuv2WnaTKDAw==
Expand Down Expand Up @@ -3277,7 +3277,7 @@
estree-walker "^2.0.2"
source-map-js "^1.2.0"

"@vue/compiler-dom@^3.4.0":
"@vue/compiler-dom@^3.5.0":
version "3.5.13"
resolved "https://registry.yarnpkg.com/@vue/compiler-dom/-/compiler-dom-3.5.13.tgz#bb1b8758dbc542b3658dda973b98a1c9311a8a58"
integrity sha512-ZOJ46sMOKUjO3e94wPdCzQ6P1Lx/vhp2RSvfaab88Ajexs0AHeV0uasYhi99WPaogmBlRHNRuly8xV75cNTMDA==
Expand All @@ -3293,21 +3293,21 @@
de-indent "^1.0.2"
he "^1.2.0"

"@vue/language-core@2.1.6":
version "2.1.6"
resolved "https://registry.yarnpkg.com/@vue/language-core/-/language-core-2.1.6.tgz#b48186bdb9b3ef2b83e1f76d5b1ac357b3a7ed94"
integrity sha512-MW569cSky9R/ooKMh6xa2g1D0AtRKbL56k83dzus/bx//RDJk24RHWkMzbAlXjMdDNyxAaagKPRquBIxkxlCkg==
"@vue/language-core@2.2.0":
version "2.2.0"
resolved "https://registry.yarnpkg.com/@vue/language-core/-/language-core-2.2.0.tgz#e48c54584f889f78b120ce10a050dfb316c7fcdf"
integrity sha512-O1ZZFaaBGkKbsRfnVH1ifOK1/1BUkyK+3SQsfnh6PmMmD4qJcTU8godCeA96jjDRTL6zgnK7YzCHfaUlH2r0Mw==
dependencies:
"@volar/language-core" "~2.4.1"
"@vue/compiler-dom" "^3.4.0"
"@volar/language-core" "~2.4.11"
"@vue/compiler-dom" "^3.5.0"
"@vue/compiler-vue2" "^2.7.16"
"@vue/shared" "^3.4.0"
computeds "^0.0.1"
"@vue/shared" "^3.5.0"
alien-signals "^0.4.9"
minimatch "^9.0.3"
muggle-string "^0.4.1"
path-browserify "^1.0.1"

"@vue/shared@3.5.13", "@vue/shared@^3.4.0":
"@vue/shared@3.5.13", "@vue/shared@^3.5.0":
version "3.5.13"
resolved "https://registry.yarnpkg.com/@vue/shared/-/shared-3.5.13.tgz#87b309a6379c22b926e696893237826f64339b6f"
integrity sha512-/hnE/qP5ZoGpol0a5mDi45bOd7t3tjYJBjsgCsivow7D48cJeV5l05RD82lPqi7gRiphZM37rnhW1l6ZoCNNnQ==
Expand Down Expand Up @@ -3420,6 +3420,11 @@ algoliasearch@^5.14.2:
"@algolia/requester-fetch" "5.18.0"
"@algolia/requester-node-http" "5.18.0"

alien-signals@^0.4.9:
version "0.4.14"
resolved "https://registry.yarnpkg.com/alien-signals/-/alien-signals-0.4.14.tgz#9ff8f72a272300a51692f54bd9bbbada78fbf539"
integrity sha512-itUAVzhczTmP2U5yX67xVpsbbOiquusbWVyA9N+sy6+r6YVbFkahXvNCeEPWEOMhwDYwbVbGHFkVL03N9I5g+Q==

ansi-escapes@^4.3.2:
version "4.3.2"
resolved "https://registry.yarnpkg.com/ansi-escapes/-/ansi-escapes-4.3.2.tgz#6b2291d1db7d98b6521d5f1efa42d0f3a9feb65e"
Expand Down Expand Up @@ -4041,11 +4046,6 @@ compare-versions@^6.1.1:
resolved "https://registry.yarnpkg.com/compare-versions/-/compare-versions-6.1.1.tgz#7af3cc1099ba37d244b3145a9af5201b629148a9"
integrity sha512-4hm4VPpIecmlg59CHXnRDnqGplJFrbLG4aFEl5vl6cK1u76ws3LLvX7ikFnTDl5vo39sjWD6AaDPYodJp/NNHg==

computeds@^0.0.1:
version "0.0.1"
resolved "https://registry.yarnpkg.com/computeds/-/computeds-0.0.1.tgz#215b08a4ba3e08a11ff6eee5d6d8d7166a97ce2e"
integrity sha512-7CEBgcMjVmitjYo5q8JTJVra6X5mQ20uTThdK+0kR7UEaDrAWEQcRiBtWJzga4eRpP6afNwwLsX2SET2JhVB1Q==

concat-map@0.0.1:
version "0.0.1"
resolved "https://registry.yarnpkg.com/concat-map/-/concat-map-0.0.1.tgz#d8a96bd77fd68df7793a73036a3ba0d5405d477b"
Expand Down Expand Up @@ -6181,7 +6181,7 @@ load-tsconfig@^0.2.3:
resolved "https://registry.yarnpkg.com/load-tsconfig/-/load-tsconfig-0.2.5.tgz#453b8cd8961bfb912dea77eb6c168fe8cca3d3a1"
integrity sha512-IXO6OCs9yg8tMKzfPZ1YmheJbZCiEsnBdcB03l0OcfK9prKnJb96siuHCr5Fl37/yo9DnKU+TLpxzTUspw9shg==

local-pkg@^0.5.0, local-pkg@^0.5.1:
local-pkg@^0.5.1:
version "0.5.1"
resolved "https://registry.yarnpkg.com/local-pkg/-/local-pkg-0.5.1.tgz#69658638d2a95287534d4c2fff757980100dbb6d"
integrity sha512-9rrA30MRRP3gBD3HTGnC6cDFpaE1kVDWxWgqWJUN0RvDNAo+Nz/9GxB+nHOH0ifbVFy0hSA1V6vFDvnx54lTEQ==
Expand Down Expand Up @@ -6329,7 +6329,7 @@ magic-string@^0.30.11, magic-string@^0.30.12:
dependencies:
"@jridgewell/sourcemap-codec" "^1.5.0"

magic-string@^0.30.15:
magic-string@^0.30.15, magic-string@^0.30.17:
version "0.30.17"
resolved "https://registry.yarnpkg.com/magic-string/-/magic-string-0.30.17.tgz#450a449673d2460e5bbcfba9a61916a1714c7453"
integrity sha512-sNPKHvyjVf7gyjwS4xGTaW/mCnF8wnjtifKBEhxfZ7E/S8tQ0rssrwGNn6q8JH/ohItJfSQp9mBtQYuTlH5QnA==
Expand Down Expand Up @@ -9016,10 +9016,10 @@ typed-rest-client@^1.8.4:
tunnel "0.0.6"
underscore "^1.12.1"

typescript@5.4.2:
version "5.4.2"
resolved "https://registry.yarnpkg.com/typescript/-/typescript-5.4.2.tgz#0ae9cebcfae970718474fe0da2c090cad6577372"
integrity sha512-+2/g0Fds1ERlP6JsakQQDXjZdZMM+rqpamFZJEKh4kwTIn3iDkgKtby0CeNd5ATNZ4Ry1ax15TMx0W2V+miizQ==
typescript@5.7.2:
version "5.7.2"
resolved "https://registry.yarnpkg.com/typescript/-/typescript-5.7.2.tgz#3169cf8c4c8a828cde53ba9ecb3d2b1d5dd67be6"
integrity sha512-i5t66RHxDvVN40HfDd1PsEThGNnlMCMT3jMUuoh9/0TaqWevNontacunWyN02LA9/fIbEWlcHZcgTKb9QoaLfg==

typescript@^5.0.0:
version "5.4.5"
Expand Down Expand Up @@ -9297,20 +9297,20 @@ vite-node@2.1.8:
pathe "^1.1.2"
vite "^5.0.0"

vite-plugin-dts@^4.3.0:
version "4.3.0"
resolved "https://registry.yarnpkg.com/vite-plugin-dts/-/vite-plugin-dts-4.3.0.tgz#f7365e4969f018ee47e6dda55adf051aa47083a7"
integrity sha512-LkBJh9IbLwL6/rxh0C1/bOurDrIEmRE7joC+jFdOEEciAFPbpEKOLSAr5nNh5R7CJ45cMbksTrFfy52szzC5eA==
vite-plugin-dts@^4.5.0:
version "4.5.0"
resolved "https://registry.yarnpkg.com/vite-plugin-dts/-/vite-plugin-dts-4.5.0.tgz#a83899470dc3d423298755b615f1279abd49e0ac"
integrity sha512-M1lrPTdi7gilLYRZoLmGYnl4fbPryVYsehPN9JgaxjJKTs8/f7tuAlvCCvOLB5gRDQTTKnptBcB0ACsaw2wNLw==
dependencies:
"@microsoft/api-extractor" "^7.47.11"
"@rollup/pluginutils" "^5.1.0"
"@volar/typescript" "^2.4.4"
"@vue/language-core" "2.1.6"
"@microsoft/api-extractor" "^7.49.1"
"@rollup/pluginutils" "^5.1.4"
"@volar/typescript" "^2.4.11"
"@vue/language-core" "2.2.0"
compare-versions "^6.1.1"
debug "^4.3.6"
debug "^4.4.0"
kolorist "^1.8.0"
local-pkg "^0.5.0"
magic-string "^0.30.11"
local-pkg "^0.5.1"
magic-string "^0.30.17"

vite-plugin-inspect@^0.8.3:
version "0.8.9"
Expand Down

0 comments on commit aad7519

Please sign in to comment.