@spotpatch/vite 1.0.0

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.
@@ -0,0 +1,16 @@
1
+ var S="0.6.1",b=`bippy-${S}`,L=Object.defineProperty,W=Object.prototype.hasOwnProperty,d=()=>{},H=e=>{try{Function.prototype.toString.call(e).indexOf("^_^")>-1&&setTimeout(()=>{throw Error("React is running in production mode, but dead code elimination has not been applied. Read how to correctly configure React for production: https://reactjs.org/link/perf-use-production-build")})}catch{}},h=(e=globalThis.__REACT_DEVTOOLS_GLOBAL_HOOK__)=>!!(e&&"getFiberRoots"in e),P=!1,D,p=(e=globalThis.__REACT_DEVTOOLS_GLOBAL_HOOK__)=>P?!0:(e&&typeof e.inject=="function"&&(D=e.inject.toString()),!!D?.includes("(injected)")),u=new Set,c=new Set;var R=e=>{e&&u.add(e);let t=new Map,n=0,r={_instrumentationIsActive:!1,_instrumentationSource:b,checkDCE:H,hasUnsupportedRendererAttached:!1,inject(a){let o=++n;return t.set(o,a),c.add(a),r._instrumentationIsActive||(r._instrumentationIsActive=!0,u.forEach(i=>i())),o},on:d,onCommitFiberRoot:d,onCommitFiberUnmount:d,onPostCommitFiberRoot:d,renderers:t,supportsFiber:!0,supportsFlight:!0};try{L(globalThis,"__REACT_DEVTOOLS_GLOBAL_HOOK__",{configurable:!0,enumerable:!0,get(){return r},set(i){if(i&&typeof i=="object"){let s=r.renderers;r=i,s.size>0&&(s.forEach((l,m)=>{c.add(l),i.renderers.set(m,l)}),f(e))}}});let a=window.hasOwnProperty,o=!1;L(window,"hasOwnProperty",{configurable:!0,value:function(...i){try{if(!o&&i[0]==="__REACT_DEVTOOLS_GLOBAL_HOOK__")return globalThis.__REACT_DEVTOOLS_GLOBAL_HOOK__=void 0,o=!0,-0}catch{}return a.apply(this,i)},writable:!0})}catch{f(e)}return r},f=e=>{e&&u.add(e);try{let t=globalThis.__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!t)return;if(!t._instrumentationSource){t.checkDCE=H,t.supportsFiber=!0,t.supportsFlight=!0,t.hasUnsupportedRendererAttached=!1,t._instrumentationSource=b,t._instrumentationIsActive=!1;let n=h(t);if(n||(t.on=d),t.renderers.size){t._instrumentationIsActive=!0,u.forEach(o=>o());return}let r=t.inject,a=p(t);a&&!n&&(P=!0,t.inject({scheduleRefresh(){}})&&(t._instrumentationIsActive=!0)),t.inject=o=>{let i=r(o);return c.add(o),a&&t.renderers.set(i,o),t._instrumentationIsActive=!0,u.forEach(s=>s()),i}}(t.renderers.size||t._instrumentationIsActive||p())&&e?.()}catch{}},g=()=>W.call(globalThis,"__REACT_DEVTOOLS_GLOBAL_HOOK__"),_=e=>g()?(f(e),globalThis.__REACT_DEVTOOLS_GLOBAL_HOOK__):R(e),y=()=>!!(typeof window<"u"&&(window.document?.createElement||window.navigator?.product==="ReactNative")),T=()=>{try{y()&&_()}catch{}};T();var O=e=>{switch(e.tag){case 1:case 11:case 0:case 14:case 15:return!0;default:return!1}},w=e=>!e||typeof e!="object"?!1:"pendingProps"in e&&!("containerInfo"in e);var F=e=>{let t=[],n=e;for(;n.return;)t.push(n),n=n.return;return t};function j(e,t,n=!1){if(!e)return null;let r=t(e);if(r instanceof Promise)return(async()=>{if(await r===!0)return e;let o=n?e.return:e.child;for(;o;){let i=await B(o,t,n);if(i)return i;o=n?null:o.sibling}return null})();if(r===!0)return e;let a=n?e.return:e.child;for(;a;){let o=k(a,t,n);if(o)return o;a=n?null:a.sibling}return null}var k=(e,t,n=!1)=>{if(!e)return null;if(t(e)===!0)return e;let r=n?e.return:e.child;for(;r;){let a=k(r,t,n);if(a)return a;r=n?null:r.sibling}return null},B=async(e,t,n=!1)=>{if(!e)return null;if(await t(e)===!0)return e;let r=n?e.return:e.child;for(;r;){let a=await B(r,t,n);if(a)return a;r=n?null:r.sibling}return null};var E=e=>{let t=e;return typeof t=="function"?t:typeof t=="object"&&t?E(t.type||t.render):null},N=e=>{let t=e;if(typeof t=="string")return t;if(typeof t!="function"&&!(typeof t=="object"&&t))return null;let n=t.displayName||t.name||null;if(n)return n;let r=E(t);return r&&(r.displayName||r.name)||null};var x=new Set;var q=e=>{if(!g())return null;let t=e;for(;t.return;)t=t.return;let n=Q.get(t.stateNode);return n===void 0?null:_().renderers?.get(n)??null};var Q=new WeakMap;var M=new Set,J=e=>e.startsWith("__reactContainer$")||e.startsWith("__reactInternalInstance$")||e.startsWith("__reactFiber"),v=e=>{let t=globalThis.__REACT_DEVTOOLS_GLOBAL_HOOK__;if(t?.renderers)for(let n of t.renderers.values())try{let r=n.findFiberByHostInstance?.(e);if(r)return r}catch{}if(typeof e=="object"&&e){if("_reactRootContainer"in e)return e._reactRootContainer?._internalRoot?.current?.child;let n=e.__internalInstanceHandle??e._internalInstanceHandle;if(w(n))return n;let r=e;for(let a of M){let o=r[a];if(o)return o}for(let a of Object.keys(r))if(J(a))return M.add(a),r[a]||null;for(let a of x){if(q(a.current)?.findFiberByHostInstance)continue;let o=j(a.current,i=>i.stateNode===e);if(o)return o}}return null};function C(e){return typeof e=="object"&&e!==null?e:void 0}function z(e){return typeof e=="number"&&Number.isSafeInteger(e)&&e>0?e:void 0}function X(e){let t=e._debugSource;if(typeof t!="object"||t===null||!("fileName"in t)||typeof t.fileName!="string")return;let n="lineNumber"in t?z(t.lineNumber):void 0,r="columnNumber"in t?z(t.columnNumber):void 0;return Object.freeze({fileName:t.fileName,...n===void 0?{}:{line:n},...r===void 0?{}:{column:r}})}function Z(e){for(let n of c)try{let r=n.findFiberByHostInstance?.(e);if(r!=null)return Object.freeze({node:r,version:n.reconcilerVersion})}catch{}let t=v(e);return t===null?void 0:Object.freeze({node:t})}function Y(){return Object.freeze({find:Z,getAncestors(e){let t=C(e);return t===void 0?[]:F(t)},isComposite(e){let t=C(e);return t!==void 0&&O(t)},getDisplayName(e){let t=C(e);return t===void 0?void 0:N(t.type)??void 0},getSource(e){let t=C(e);return t===void 0?void 0:X(t)}})}function ee(e){return e.split(/[?#]/,1)[0]??""}function U(e){return e.split("/").every(t=>t.length>0&&t!=="."&&t!=="..")}function I(e){let t=e.replaceAll("\\","/");return t.startsWith("node_modules/")||t.includes("/node_modules/")}function A(e){if(e.length===0||I(e))return;let t=e.replaceAll("\\","/");try{/^https?:\/\//i.test(t)&&(t=new URL(t).pathname)}catch{return}t=ee(t);let n=t.lastIndexOf("/src/");if(n>=0){let r=t.slice(n+1);return U(r)?r:void 0}if(t.startsWith("src/")&&U(t))return t}var te=/^18\.(?:2|3)\./,ne=new Set(["Fragment","StrictMode","Suspense","Context.Consumer","Context.Provider"]);function G(e){return e!==void 0&&te.test(e)}function re(e){return ne.has(e)||e.endsWith(".Provider")||e.endsWith(".Consumer")}function oe(e,t,n){let r=[],a,o;for(let i of e.getAncestors(t)){if(!e.isComposite(i))continue;let s=e.getDisplayName(i);if(s===void 0||s.length===0||re(s))continue;let l=e.getSource(i),m=Object.freeze({name:s,...l===void 0?{}:{source:l}});if(a??=m,r.length<n&&r.push(s),o===void 0&&l!==void 0&&!I(l.fileName)&&A(l.fileName)!==void 0&&(o=m),o!==void 0&&r.length>=n)break}return Object.freeze({...o===void 0?{}:{businessComponent:o},...a===void 0?{}:{firstComponent:a},stack:Object.freeze(r)})}function ae(e){if(e===void 0)return;let t=A(e.fileName);if(t!==void 0)return Object.freeze({relativePath:t,...e.line===void 0?{}:{line:e.line},...e.column===void 0?{}:{column:e.column},origin:"react-fiber",confidence:"probable"})}function V(e){if(!Number.isSafeInteger(e.maxComponentDepth)||e.maxComponentDepth<=0)throw new RangeError("React component depth must be a positive integer.");let t=e.bridge??Y(),n=!1;function r(a){if(n)return Object.freeze({supported:!1,componentStack:[]});let o=t.find(a);if(o===void 0||!G(o.version))return Object.freeze({supported:!1,...o?.version===void 0?{}:{version:o.version},componentStack:[]});let i=oe(t,o.node,e.maxComponentDepth),s=i.businessComponent?.name??i.firstComponent?.name,l=ae(i.businessComponent?.source);return Object.freeze({supported:!0,version:o.version,...s===void 0?{}:{componentName:s},componentStack:i.stack,...l===void 0?{}:{source:l}})}return Object.freeze({name:"bippy-react-18",supports(a){return n?!1:G(t.find(a)?.version)},inspect:r,dispose(){n=!0}})}export{V as createReact18Adapter};
2
+ /*! Bundled license information:
3
+
4
+ bippy/dist/rdt-hook.js:
5
+ bippy/dist/install-hook-only.js:
6
+ bippy/dist/core.js:
7
+ bippy/dist/index.js:
8
+ (**
9
+ * @license bippy
10
+ *
11
+ * Copyright (c) Aiden Bai
12
+ *
13
+ * This source code is licensed under the MIT license found in the
14
+ * LICENSE file in the root directory of this source tree.
15
+ *)
16
+ */
package/package.json ADDED
@@ -0,0 +1,68 @@
1
+ {
2
+ "name": "@spotpatch/vite",
3
+ "version": "1.0.0",
4
+ "description": "Vite development plugin for SpotPatch.",
5
+ "license": "MIT",
6
+ "repository": {
7
+ "type": "git",
8
+ "url": "git+https://github.com/huanglvjing/spotpatch.git",
9
+ "directory": "packages/vite"
10
+ },
11
+ "homepage": "https://github.com/huanglvjing/spotpatch#readme",
12
+ "bugs": {
13
+ "url": "https://github.com/huanglvjing/spotpatch/issues"
14
+ },
15
+ "keywords": [
16
+ "spotpatch",
17
+ "vite",
18
+ "react",
19
+ "developer-tools",
20
+ "ai-agent"
21
+ ],
22
+ "type": "module",
23
+ "sideEffects": false,
24
+ "engines": {
25
+ "node": ">=20.19.0"
26
+ },
27
+ "files": [
28
+ "dist"
29
+ ],
30
+ "main": "./dist/index.cjs",
31
+ "module": "./dist/index.js",
32
+ "types": "./dist/index.d.ts",
33
+ "exports": {
34
+ ".": {
35
+ "import": {
36
+ "types": "./dist/index.d.ts",
37
+ "default": "./dist/index.js"
38
+ },
39
+ "require": {
40
+ "types": "./dist/index.d.cts",
41
+ "default": "./dist/index.cjs"
42
+ }
43
+ }
44
+ },
45
+ "dependencies": {
46
+ "@rollup/pluginutils": "5.4.0",
47
+ "launch-editor": "2.14.1",
48
+ "magic-string": "1.1.0",
49
+ "oxc-parser": "0.143.0",
50
+ "zod": "4.4.3",
51
+ "@spotpatch/agent": "^1.0.0",
52
+ "@spotpatch/react-adapter": "^1.0.0",
53
+ "@spotpatch/runtime": "^1.0.0",
54
+ "@spotpatch/shared": "^1.0.0"
55
+ },
56
+ "peerDependencies": {
57
+ "vite": "^5.0.0 || ^6.0.0 || ^7.0.0"
58
+ },
59
+ "publishConfig": {
60
+ "access": "public",
61
+ "registry": "https://registry.npmjs.org/"
62
+ },
63
+ "scripts": {
64
+ "build": "tsup src/index.ts --format esm,cjs --dts --sourcemap --clean && tsup --config tsup.runtime-client.config.ts && tsup --config tsup.runtime-react-adapter.config.ts",
65
+ "clean": "node --input-type=module -e \"import { rmSync } from 'node:fs'; rmSync('dist', { recursive: true, force: true })\"",
66
+ "typecheck": "tsc --noEmit -p tsconfig.json"
67
+ }
68
+ }