@treelocator/runtime 0.3.2 → 0.4.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.
@@ -4,6 +4,8 @@ import { normalizeFilePath } from "./normalizeFilePath";
4
4
 
5
5
  /**
6
6
  * Check if any DOM element has React 19 fibers (with _debugStack instead of _debugSource).
7
+ * Must walk the _debugOwner chain because DOM element fibers (HostComponent) never have
8
+ * _debugStack — only function component fibers do.
7
9
  */
8
10
  function isReact19Environment(): boolean {
9
11
  const el = document.querySelector("[class]") || document.body;
@@ -12,8 +14,13 @@ function isReact19Environment(): boolean {
12
14
  const fiberKey = Object.keys(el).find((k) => k.startsWith("__reactFiber$"));
13
15
  if (!fiberKey) return false;
14
16
 
15
- const fiber = (el as any)[fiberKey];
16
- return !fiber?._debugSource && !!(fiber as any)?._debugStack;
17
+ let fiber = (el as any)[fiberKey];
18
+ while (fiber) {
19
+ if (fiber._debugSource) return false; // React 18
20
+ if ((fiber as any)._debugStack) return true; // React 19
21
+ fiber = fiber._debugOwner || null;
22
+ }
23
+ return false;
17
24
  }
18
25
 
19
26
  /**
@@ -1,32 +0,0 @@
1
-
2
- > @treelocator/runtime@0.3.2 build /Users/wende/projects/treelocatorjs/packages/runtime
3
- > concurrently pnpm:build:*
4
-
5
- [wrapImage]
6
- [wrapImage] > @treelocator/runtime@0.3.2 build:wrapImage /Users/wende/projects/treelocatorjs/packages/runtime
7
- [wrapImage] > node ./scripts/wrapImage.js
8
- [wrapImage]
9
- [ts]
10
- [ts] > @treelocator/runtime@0.3.2 build:ts /Users/wende/projects/treelocatorjs/packages/runtime
11
- [ts] > tsc --declaration --emitDeclarationOnly --noEmit false --outDir dist
12
- [ts]
13
- [tailwind]
14
- [tailwind] > @treelocator/runtime@0.3.2 build:tailwind /Users/wende/projects/treelocatorjs/packages/runtime
15
- [tailwind] > tailwindcss -i ./src/main.css -o ./dist/output.css
16
- [tailwind]
17
- [babel]
18
- [babel] > @treelocator/runtime@0.3.2 build:babel /Users/wende/projects/treelocatorjs/packages/runtime
19
- [babel] > babel src --out-dir dist --extensions .js,.jsx,.ts,.tsx
20
- [babel]
21
- [wrapImage] Tree icon file generated
22
- [wrapImage] pnpm run build:wrapImage exited with code 0
23
- [babel] [baseline-browser-mapping] The data in this module is over two months old. To ensure accurate Baseline data, please update: `npm i baseline-browser-mapping@latest -D`
24
- [tailwind] [baseline-browser-mapping] The data in this module is over two months old. To ensure accurate Baseline data, please update: `npm i baseline-browser-mapping@latest -D`
25
- [tailwind]
26
- [tailwind] Rebuilding...
27
- [tailwind]
28
- [tailwind] Done in 179ms.
29
- [tailwind] pnpm run build:tailwind exited with code 0
30
- [babel] Successfully compiled 82 files with Babel (538ms).
31
- [babel] pnpm run build:babel exited with code 0
32
- [ts] pnpm run build:ts exited with code 0
@@ -1,32 +0,0 @@
1
-
2
- > @treelocator/runtime@0.1.8 dev /Users/wende/projects/locatorjs/packages/runtime
3
- > concurrently pnpm:dev:*
4
-
5
- [babel]
6
- [babel] > @treelocator/runtime@0.1.8 dev:babel /Users/wende/projects/locatorjs/packages/runtime
7
- [babel] > babel src --watch --out-dir dist --extensions .js,.jsx,.ts,.tsx
8
- [babel]
9
- [wrapImage]
10
- [wrapImage] > @treelocator/runtime@0.1.8 dev:wrapImage /Users/wende/projects/locatorjs/packages/runtime
11
- [wrapImage] > WATCH=true node ./scripts/wrapImage.js
12
- [wrapImage]
13
- [ts]
14
- [ts] > @treelocator/runtime@0.1.8 dev:ts /Users/wende/projects/locatorjs/packages/runtime
15
- [ts] > tsc --watch --declaration --emitDeclarationOnly --noEmit false --outDir dist --preserveWatchOutput
16
- [ts]
17
- [wrapCSS]
18
- [wrapCSS] > @treelocator/runtime@0.1.8 dev:wrapCSS /Users/wende/projects/locatorjs/packages/runtime
19
- [wrapCSS] > WATCH=true node ./scripts/wrapCSS.js
20
- [wrapCSS]
21
- [tailwind]
22
- [tailwind] > @treelocator/runtime@0.1.8 dev:tailwind /Users/wende/projects/locatorjs/packages/runtime
23
- [tailwind] > tailwindcss -i ./src/main.css -o ./dist/output.css --watch
24
- [tailwind]
25
- [tailwind]  ELIFECYCLE  Command failed.
26
- [ts]  ELIFECYCLE  Command failed.
27
- [wrapImage]  ELIFECYCLE  Command failed.
28
- [wrapCSS]  ELIFECYCLE  Command failed.
29
- [babel]  ELIFECYCLE  Command failed.
30
- [babel] pnpm run dev:babel exited with code SIGINT
31
- [wrapCSS] pnpm run dev:wrapCSS exited with code SIGINT
32
- [wrapImage] pnpm run dev:wrapImage exited with code SIGINT
@@ -1,14 +0,0 @@
1
-
2
- > @treelocator/runtime@0.3.2 test /Users/wende/projects/treelocatorjs/packages/runtime
3
- > vitest run
4
-
5
-
6
- RUN v2.1.9 /Users/wende/projects/treelocatorjs/packages/runtime
7
-
8
- ✓ src/functions/transformPath.test.ts (3 tests) 2ms
9
- ✓ src/functions/getUsableFileName.test.tsx (4 tests) 2ms
10
- ✓ src/functions/evalTemplate.test.ts (1 test) 3ms
11
- ✓ src/functions/cropPath.test.ts (2 tests) 2ms
12
- ✓ src/functions/mergeRects.test.ts (1 test) 1ms
13
- ✓ src/functions/formatAncestryChain.test.ts (14 tests) 3ms
14
-  ELIFECYCLE  Test failed. See above for more details.
@@ -1,4 +0,0 @@
1
-
2
- > @locator/runtime@0.5.1 ts /Users/wende/projects/locatorjs/packages/runtime
3
- > tsc --noEmit
4
-
package/LICENSE DELETED
@@ -1,22 +0,0 @@
1
- MIT License
2
-
3
- Copyright (c) 2025 Krzysztof Wende
4
- Copyright (c) 2023 Michael Musil (original LocatorJS)
5
-
6
- Permission is hereby granted, free of charge, to any person obtaining a copy
7
- of this software and associated documentation files (the "Software"), to deal
8
- in the Software without restriction, including without limitation the rights
9
- to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
10
- copies of the Software, and to permit persons to whom the Software is
11
- furnished to do so, subject to the following conditions:
12
-
13
- The above copyright notice and this permission notice shall be included in all
14
- copies or substantial portions of the Software.
15
-
16
- THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
17
- IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
18
- FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
19
- AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
20
- LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
21
- OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
22
- SOFTWARE.