diff --git a/package-lock.json b/package-lock.json index cc342ba..962d15e 100644 --- a/package-lock.json +++ b/package-lock.json @@ -26,7 +26,7 @@ "tailwind-merge": "^3.2.0", "tailwindcss": "^4.1.4", "tw-animate-css": "^1.2.5", - "twd-js": "^1.2.3", + "twd-js": "^1.3.2", "zustand": "^5.0.3" }, "devDependencies": { @@ -11162,6 +11162,16 @@ "node": "^10 || ^12 || >=14" } }, + "node_modules/preact": { + "version": "10.28.0", + "resolved": "https://registry.npmjs.org/preact/-/preact-10.28.0.tgz", + "integrity": "sha512-rytDAoiXr3+t6OIP3WGlDd0ouCUG1iCWzkcY3++Nreuoi17y6T5i/zRhe6uYfoVcxq6YU+sBtJouuRDsq8vvqA==", + "license": "MIT", + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/preact" + } + }, "node_modules/prelude-ls": { "version": "1.2.1", "resolved": "https://registry.npmjs.org/prelude-ls/-/prelude-ls-1.2.1.tgz", @@ -13211,15 +13221,16 @@ } }, "node_modules/twd-js": { - "version": "1.2.3", - "resolved": "https://registry.npmjs.org/twd-js/-/twd-js-1.2.3.tgz", - "integrity": "sha512-cCETzNo7TiXb1HeT3oq6oZU7knA2IpHSNgZXl7e7iMqpFM1LJcs9D4UrGdT4C1K57P6Twbwo17D8SRDg3cRnEA==", + "version": "1.3.2", + "resolved": "https://registry.npmjs.org/twd-js/-/twd-js-1.3.2.tgz", + "integrity": "sha512-DwFAycv4/0bbtlfnEdAyJtxKjWe+IYhwREZS+9kEq/M7pBL+RCf264eZsEal3t0ZvOcobI7bTn8gFDJuS9nGFg==", "license": "MIT", "dependencies": { "@testing-library/dom": "^10.4.1", "@testing-library/user-event": "^14.6.1", "@types/chai": "^5.2.3", - "chai": "^6.2.1" + "chai": "^6.2.1", + "preact": "^10.28.0" }, "bin": { "twd-js": "dist/cli.js" diff --git a/package.json b/package.json index 3a158cb..f83fb9b 100644 --- a/package.json +++ b/package.json @@ -36,7 +36,7 @@ "tailwind-merge": "^3.2.0", "tailwindcss": "^4.1.4", "tw-animate-css": "^1.2.5", - "twd-js": "^1.2.3", + "twd-js": "^1.3.2", "zustand": "^5.0.3" }, "devDependencies": { diff --git a/src/main.tsx b/src/main.tsx index aaba95b..958a653 100644 --- a/src/main.tsx +++ b/src/main.tsx @@ -5,19 +5,9 @@ import { RouterProvider } from "react-router"; import router from './AppRoutes'; if (import.meta.env.DEV) { - // You choose how to load the tests; this example uses Vite's glob import - const testModules = import.meta.glob("./**/*.twd.test.{ts,tsx}"); - const { initTests, twd, TWDSidebar } = await import('twd-js'); - // You need to pass the test modules, the sidebar component, and createRoot function - initTests(testModules, , createRoot); - // if you want to use mock requests, you can initialize it here - twd.initRequestMocking() - .then(() => { - console.log("Request mocking initialized"); - }) - .catch((err) => { - console.error("Error initializing request mocking:", err); - }); + const { initTWD } = await import('twd-js/bundled'); + const tests = import.meta.glob("./**/*.twd.test.ts") + initTWD(tests); } createRoot(document.getElementById('root')!).render(