diff --git a/craco.config.js b/craco.config.js
deleted file mode 100644
index a0098d1..0000000
--- a/craco.config.js
+++ /dev/null
@@ -1,22 +0,0 @@
-module.exports = {
- webpack: {
- configure: (webpackConfig) => {
- // Needed for sql.js
- webpackConfig.resolve.fallback = {
- fs: require.resolve("browserify-fs"),
- stream: require.resolve("stream-browserify"),
- crypto: require.resolve("crypto-browserify"),
- vm: false,
- };
-
- // Add the 'module' configuration for handling .wasm files
- webpackConfig.module.rules.push({
- test: /\.wasm$/,
- type: "javascript/auto",
- });
-
- return webpackConfig;
- },
- },
-};
-
\ No newline at end of file
diff --git a/eslint.config.mjs b/eslint.config.mjs
index 0b600a6..8001fc5 100644
--- a/eslint.config.mjs
+++ b/eslint.config.mjs
@@ -30,7 +30,13 @@ export default [
{
rules: {
"no-unused-vars": "off",
- "@typescript-eslint/no-unused-vars": ["warn", { argsIgnorePattern: "^_" }],
+ "@typescript-eslint/no-unused-vars": [
+ "warn",
+ {
+ argsIgnorePattern: "^_",
+ }
+ ],
+ "react/react-in-jsx-scope": "off",
"quotes": ["error", "double", { avoidEscape: true }],
"@stylistic/indent": ["error", 2],
"@stylistic/jsx-quotes": ["error"],
diff --git a/index.html b/index.html
new file mode 100644
index 0000000..6d8e29b
--- /dev/null
+++ b/index.html
@@ -0,0 +1,29 @@
+
+
+
+ (null);
- if (process.env.REACT_APP_PRIVACY_CF_WEB_ANALYTICS !== "true") {
+ if (import.meta.env.VITE_PRIVACY_CF_WEB_ANALYTICS !== "true") {
return null;
}
@@ -30,10 +30,10 @@ const PrivacyNoticeToggle = () => {
Cloudflare's privacy-first web analytics
{" "}
for general usage statistics without tracking individual users.{" "}
- {process.env.REACT_APP_PRIVACY_COMPANY_NAME} ({process.env.REACT_APP_PRIVACY_COMPANY_PARENTHESES_VALUE}) is the
+ {import.meta.env.VITE_PRIVACY_COMPANY_NAME} ({import.meta.env.VITE_PRIVACY_COMPANY_PARENTHESES_VALUE}) is the
responsible data provider for this deployment of the app. For inquiries, contact{" "}
-
- {process.env.REACT_APP_PRIVACY_EMAIL}
+
+ {import.meta.env.VITE_PRIVACY_EMAIL}
.
diff --git a/src/vite-env.d.ts b/src/vite-env.d.ts
new file mode 100644
index 0000000..1a3c7aa
--- /dev/null
+++ b/src/vite-env.d.ts
@@ -0,0 +1,21 @@
+///
+
+declare module "*.css" {
+ const content: string;
+ export default content;
+}
+
+declare module "*.svg" {
+ const content: string;
+ export default content;
+}
+
+declare module "*.png" {
+ const content: string;
+ export default content;
+}
+
+declare module "@djthoms/pretty-checkbox" {
+ const content: unknown;
+ export default content;
+}
diff --git a/tsconfig.json b/tsconfig.json
index a273b0c..ba6fe76 100644
--- a/tsconfig.json
+++ b/tsconfig.json
@@ -1,24 +1,36 @@
{
"compilerOptions": {
- "target": "es5",
+ "target": "ES2020",
+ "useDefineForClassFields": true,
"lib": [
+ "ES2020",
"dom",
- "dom.iterable",
- "esnext"
+ "dom.iterable"
],
- "allowJs": true,
+ "module": "ESNext",
"skipLibCheck": true,
+
+ /* Bundler mode */
+ "moduleResolution": "bundler",
+ "allowImportingTsExtensions": true,
+ "isolatedModules": true,
+ "moduleDetection": "force",
+ "noEmit": true,
+ "jsx": "react-jsx",
+
+ /* Linting */
+ "strict": true,
+ "noUnusedLocals": true,
+ "noUnusedParameters": true,
+ "noFallthroughCasesInSwitch": true,
+ "noUncheckedSideEffectImports": true,
+
+ /* Additional options from original config */
+ "allowJs": true,
"esModuleInterop": true,
"allowSyntheticDefaultImports": true,
- "strict": true,
"forceConsistentCasingInFileNames": true,
- "noFallthroughCasesInSwitch": true,
- "module": "esnext",
- "moduleResolution": "node",
- "resolveJsonModule": true,
- "isolatedModules": true,
- "noEmit": true,
- "jsx": "react-jsx"
+ "resolveJsonModule": true
},
"include": [
"src"
diff --git a/tsconfig.node.json b/tsconfig.node.json
new file mode 100644
index 0000000..0d3d714
--- /dev/null
+++ b/tsconfig.node.json
@@ -0,0 +1,22 @@
+{
+ "compilerOptions": {
+ "target": "ES2022",
+ "lib": ["ES2023"],
+ "module": "ESNext",
+ "skipLibCheck": true,
+
+ /* Bundler mode */
+ "moduleResolution": "bundler",
+ "allowImportingTsExtensions": true,
+ "isolatedModules": true,
+ "moduleDetection": "force",
+ "noEmit": true,
+
+ /* Linting */
+ "strict": true,
+ "noUnusedLocals": true,
+ "noUnusedParameters": true,
+ "noFallthroughCasesInSwitch": true
+ },
+ "include": ["vite.config.ts"]
+}
diff --git a/tsconfig.tsbuildinfo b/tsconfig.tsbuildinfo
new file mode 100644
index 0000000..005ace8
--- /dev/null
+++ b/tsconfig.tsbuildinfo
@@ -0,0 +1 @@
+{"root":["./src/app.test.tsx","./src/app.tsx","./src/databaselayoutdialog.tsx","./src/exportrenderer.tsx","./src/exportselectormodal.tsx","./src/privacynoticetoggle.tsx","./src/questionselector.tsx","./src/resulttable.tsx","./src/themetoggle.tsx","./src/viewstable.tsx","./src/wordbreaktext.tsx","./src/index.tsx","./src/react-app-env.d.ts","./src/reportwebvitals.ts","./src/setuptests.ts","./src/usetheme.tsx","./src/utils.ts","./src/vite-env.d.ts"],"version":"5.9.3"}
\ No newline at end of file
diff --git a/vite.config.ts b/vite.config.ts
new file mode 100644
index 0000000..10d4eae
--- /dev/null
+++ b/vite.config.ts
@@ -0,0 +1,27 @@
+import { defineConfig } from "vite";
+import react from "@vitejs/plugin-react";
+import { nodePolyfills } from "vite-plugin-node-polyfills";
+
+// https://vite.dev/config/
+export default defineConfig({
+ plugins: [
+ react(),
+ nodePolyfills({
+ // Enable polyfills for specific modules
+ // Needed for sql.js
+ include: ["fs", "stream", "crypto", "buffer", "path", "util"],
+ globals: {
+ Buffer: true,
+ process: true,
+ },
+ }),
+ ],
+ server: {
+ port: 3000,
+ open: true,
+ },
+ build: {
+ outDir: "build",
+ },
+ assetsInclude: ["**/*.wasm"],
+});