@peachy/plugin-react 0.0.10 → 0.0.11

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/index.mjs CHANGED
@@ -88,7 +88,7 @@ function reactRefreshWrapperPlugin() {
88
88
  sourcemap: true
89
89
  });
90
90
  for (const error of errors) this.error({
91
- frame: error.codeframe,
91
+ frame: error.codeframe ?? void 0,
92
92
  message: error.message,
93
93
  cause: error.helpMessage,
94
94
  stack: ""
@@ -43,9 +43,7 @@ if (!globalThis.__hmr__) {
43
43
 
44
44
  connection.connect("message", async (_, _type, event) => {
45
45
  const decoder = new TextDecoder();
46
- const payload = JSON.parse(
47
- decoder.decode(event.toArray()),
48
- ) as HMRMessage;
46
+ const payload = JSON.parse(decoder.decode(event.toArray())) as HMRMessage;
49
47
 
50
48
  switch (payload?.type) {
51
49
  case "reload":
@@ -60,12 +58,9 @@ if (!globalThis.__hmr__) {
60
58
  for (const update of payload.updates) {
61
59
  if (globalThis.__hmr__.contexts[update.id]) {
62
60
  try {
63
- const module = await import(
64
- "file://" + update.url + "?t=" + Date.now()
65
- );
61
+ const module = await import("file://" + update.url + "?t=" + Date.now());
66
62
 
67
- const accepted =
68
- globalThis.__hmr__.contexts[update.id].emit(module);
63
+ const accepted = globalThis.__hmr__.contexts[update.id].emit(module);
69
64
 
70
65
  if (accepted) {
71
66
  console.info("[HMR] Update accepted by", update.id);
@@ -7,9 +7,7 @@ if (import.meta) {
7
7
  }
8
8
 
9
9
  var NO_FAST_REFRESH =
10
- !globalThis.$RefreshReg$ ||
11
- !globalThis.$RefreshSig$ ||
12
- !globalThis.$RefreshRuntime$;
10
+ !globalThis.$RefreshReg$ || !globalThis.$RefreshSig$ || !globalThis.$RefreshRuntime$;
13
11
  if (NO_FAST_REFRESH) {
14
12
  console.warn(
15
13
  "[HMR]: React Refresh is not enabled. Please ensure that you have installed the necessary dependencies and enabled the plugin in your webpack configuration.",
@@ -21,10 +19,10 @@ if (NO_FAST_REFRESH) {
21
19
  const fullId = $hmrId$ + "#" + id;
22
20
  globalThis.$RefreshRuntime$.register(type, fullId);
23
21
  };
24
- globalThis.$RefreshSig$ =
25
- globalThis.$RefreshRuntime$.createSignatureFunctionForTransform;
22
+ globalThis.$RefreshSig$ = globalThis.$RefreshRuntime$.createSignatureFunctionForTransform;
26
23
  }
27
24
 
25
+ /* oxlint-disable no-unused-expressions */
28
26
  $sourceCode$;
29
27
 
30
28
  if (!NO_FAST_REFRESH) {
package/package.json CHANGED
@@ -1,29 +1,30 @@
1
1
  {
2
2
  "name": "@peachy/plugin-react",
3
- "version": "0.0.10",
3
+ "version": "0.0.11",
4
4
  "description": "HMR for react",
5
- "type": "module",
6
- "main": "./dist/index.mjs",
7
5
  "keywords": [],
8
- "author": "Angelo Verlain <hey@vixalien.com>",
9
6
  "license": "MIT",
10
- "devDependencies": {
11
- "@types/node": "^25.2.2",
12
- "rolldown": "1.0.0-rc.3",
13
- "tsdown": "0.20.3",
14
- "typescript": "^5.9.3"
15
- },
7
+ "author": "Angelo Verlain <hey@vixalien.com>",
8
+ "files": [
9
+ "dist"
10
+ ],
11
+ "type": "module",
12
+ "main": "./dist/index.mjs",
16
13
  "dependencies": {
17
14
  "@ampproject/remapping": "^2.3.0",
18
15
  "magic-string": "^0.30.21",
19
16
  "react-refresh": "^0.18.0"
20
17
  },
18
+ "devDependencies": {
19
+ "@types/node": "^25.2.2",
20
+ "rolldown": "1.0.0-rc.3",
21
+ "tsdown": "0.20.3",
22
+ "typescript": "^5.9.3",
23
+ "@peachy/internal-utilities": "0.0.0"
24
+ },
21
25
  "peerDependencies": {
22
26
  "rolldown": "1.0.0-beta.58"
23
27
  },
24
- "files": [
25
- "dist"
26
- ],
27
28
  "scripts": {
28
29
  "build": "tsdown src/index.ts --dts && mkdir -p dist/templates && cp src/templates/* dist/templates"
29
30
  },