Skip to content

Commit

Permalink
Merge pull request #33 from element-hq/t3chguy/tidy-web
Browse files Browse the repository at this point in the history
  • Loading branch information
t3chguy authored Dec 23, 2024
2 parents e88ee8f + b94addf commit 2a08466
Show file tree
Hide file tree
Showing 5 changed files with 604 additions and 736 deletions.
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@
- [Web] Bump wasm-pack version to `0.13.1`.
- [Web] Switch bindings/wysiwyg-wasm from npm to yarn.
- [Web] Add typescript checking to bindings/wysiwyg-wasm.
- [Web] Update vite and related packages.
- [Web] Simplify build scripts.

# [2.37.14]
- [Android] Have separate modes for parsing HTML for 'editor mode' and 'message mode' using `isEditor: Boolean` parameter.
Expand Down
15 changes: 6 additions & 9 deletions platforms/web/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
"types": "./dist/index.d.ts",
"scripts": {
"dev": "vite",
"build": "vite build && node scripts/hack_myfetch.js && node scripts/hack_exports.js",
"build": "vite build && node scripts/hack_myfetch.js",
"build:demo": "vite build -c vite.demo.config.ts",
"preview": "vite preview",
"typecheck": "tsc --noEmit",
Expand All @@ -53,8 +53,7 @@
"@typescript-eslint/eslint-plugin": "^5.35.1",
"@typescript-eslint/parser": "^5.6.0",
"@vitejs/plugin-react": "^4.2.1",
"@vitest/coverage-c8": "^0.33.0",
"@vitest/coverage-v8": "^1.6.0",
"@vitest/coverage-v8": "^2.1.8",
"@vitest/ui": "^0.34.0",
"cypress": "^10.9.0",
"eslint": "^8.23.1",
Expand All @@ -67,18 +66,16 @@
"eslint-plugin-prettier": "^4.2.1",
"eslint-plugin-react": "^7.31.8",
"eslint-plugin-react-hooks": "^4.6.0",
"eslint-plugin-unicorn": "^54.0.0",
"jest-environment-jsdom": "^29.0.3",
"prettier": "2.8.8",
"react": "^18.2.0",
"react-dom": "^18.2.0",
"replace": "^1.2.1",
"typescript": "^4.7.4",
"vite": "^3.1.0",
"vite-plugin-dts": "^1.5.0",
"vitest": "^1.6.0",
"vite": "5.3.3",
"vite-plugin-dts": "^4.3.0",
"vitest": "^2.1.8",
"vitest-sonar-reporter": "^0.5.0"
},
"dependencies": {
"eslint-plugin-unicorn": "^54.0.0"
}
}
19 changes: 0 additions & 19 deletions platforms/web/scripts/hack_exports.js

This file was deleted.

13 changes: 8 additions & 5 deletions platforms/web/vite.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,17 +8,13 @@ Please see LICENSE in the repository root for full details.

import { defineConfig } from 'vitest/config';
import react from '@vitejs/plugin-react';
import { resolve } from 'path';
import { resolve } from 'node:path';
import dts from 'vite-plugin-dts';

// https://vitejs.dev/config/
export default defineConfig({
plugins: [
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
// @ts-ignore
react(),
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
// @ts-ignore
dts({
include: [
'lib/useWysiwyg.ts',
Expand All @@ -29,6 +25,12 @@ export default defineConfig({
'lib/useTestCases/types.ts',
],
rollupTypes: true,
copyDtsFiles: true,
beforeWriteFile: async (filePath, content) => {
// Hack generated types to make all exported
content = content.replace(/^declare/gm, 'export declare');
return { filePath, content };
},
}),
],
test: {
Expand All @@ -37,6 +39,7 @@ export default defineConfig({
setupFiles: 'test.setup.ts',
includeSource: ['lib/**/*.{ts,tsx}'],
coverage: {
provider: 'v8',
all: true,
include: ['lib/**/*.{ts,tsx}'],
exclude: [
Expand Down
Loading

0 comments on commit 2a08466

Please sign in to comment.