@taujs/react 0.1.7 → 0.1.8

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/plugin.d.ts CHANGED
@@ -1,6 +1,17 @@
1
1
  import react from '@vitejs/plugin-react';
2
2
  import { PluginOption } from 'vite';
3
3
 
4
+ /**
5
+ * NOTE:
6
+ * `@vitejs/plugin-react` is a **peer dependency only**.
7
+ *
8
+ * It is intentionally NOT installed as a dependency to avoid
9
+ * coupling τjs to a specific Vite toolchain or React refresh implementation.
10
+ *
11
+ * Consumers using `@taujs/react/plugin` must install `@vitejs/plugin-react`
12
+ * in their own project.
13
+ */
14
+
4
15
  declare function pluginReact(opts?: Parameters<typeof react>[0]): PluginOption;
5
16
 
6
17
  export { pluginReact };
package/dist/plugin.js CHANGED
@@ -1,7 +1,22 @@
1
1
  // src/plugin.ts
2
2
  import react from "@vitejs/plugin-react";
3
+ function taujsReactPreambleFix() {
4
+ return {
5
+ name: "taujs:react-refresh-preamble-fix",
6
+ apply: "serve",
7
+ enforce: "post",
8
+ transformIndexHtml(html) {
9
+ if (html.includes("__vite_plugin_react_preamble_installed__")) return html;
10
+ if (!html.includes("/@react-refresh")) return html;
11
+ return html.replace(
12
+ /<head([^>]*)>/i,
13
+ `<head$1><script>window.__vite_plugin_react_preamble_installed__=true;window.$RefreshReg$=()=>{};window.$RefreshSig$=()=>(t)=>t;</script>`
14
+ );
15
+ }
16
+ };
17
+ }
3
18
  function pluginReact(opts) {
4
- return react(opts);
19
+ return [react(opts), taujsReactPreambleFix()];
5
20
  }
6
21
  export {
7
22
  pluginReact
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@taujs/react",
3
- "version": "0.1.7",
3
+ "version": "0.1.8",
4
4
  "description": "taujs | τjs",
5
5
  "author": "Aoede <taujs@aoede.uk.net> (https://www.aoede.uk.net)",
6
6
  "license": "MIT",
@@ -45,25 +45,25 @@
45
45
  "@testing-library/dom": "^10.4.0",
46
46
  "@testing-library/react": "^16.1.0",
47
47
  "@types/node": "^24.0.7",
48
- "@types/react": "^19.0.2",
49
- "@types/react-dom": "^19.0.2",
48
+ "@types/react": "^19.2.8",
49
+ "@types/react-dom": "^19.2.3",
50
50
  "@vitest/coverage-v8": "^3.2.4",
51
51
  "@vitest/ui": "^3.2.4",
52
52
  "jsdom": "^25.0.0",
53
53
  "prettier": "^3.3.3",
54
- "react": "^19.0.0",
55
- "react-dom": "^19.0.0",
54
+ "react": "^19.2.3",
55
+ "react-dom": "^19.2.3",
56
56
  "tsup": "^8.2.4",
57
57
  "typescript": "^5.5.4",
58
- "vite": "^7.1.9",
58
+ "vite": "^7.3.1",
59
59
  "vitest": "^3.2.4"
60
60
  },
61
61
  "peerDependencies": {
62
- "@vitejs/plugin-react": "^4.6.0",
63
- "react": "^19.0.0",
64
- "react-dom": "^19.0.0",
62
+ "@vitejs/plugin-react": "^5.1.2",
63
+ "react": "^19.2.3",
64
+ "react-dom": "^19.2.3",
65
65
  "typescript": "^5.5.4",
66
- "vite": "^7.1.9"
66
+ "vite": "^7.3.1"
67
67
  },
68
68
  "peerDependenciesMeta": {
69
69
  "react": {