@capybara-devtools/core 0.4.0 → 0.5.1
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/client.d.ts.map +1 -1
- package/dist/client.js +20 -2
- package/dist/client.js.map +1 -1
- package/dist/index.d.ts +8 -2
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +4 -1
- package/dist/index.js.map +1 -1
- package/dist/init.d.ts +40 -0
- package/dist/init.d.ts.map +1 -0
- package/dist/init.js +35 -0
- package/dist/init.js.map +1 -0
- package/dist/plugins/console.d.ts.map +1 -1
- package/dist/plugins/console.js +105 -9
- package/dist/plugins/console.js.map +1 -1
- package/dist/plugins/network/body.d.ts +9 -0
- package/dist/plugins/network/body.d.ts.map +1 -0
- package/dist/plugins/network/body.js +114 -0
- package/dist/plugins/network/body.js.map +1 -0
- package/dist/plugins/network/failure.d.ts +16 -0
- package/dist/plugins/network/failure.d.ts.map +1 -0
- package/dist/plugins/network/failure.js +73 -0
- package/dist/plugins/network/failure.js.map +1 -0
- package/dist/plugins/network/fetch.d.ts +12 -0
- package/dist/plugins/network/fetch.d.ts.map +1 -0
- package/dist/plugins/network/fetch.js +159 -0
- package/dist/plugins/network/fetch.js.map +1 -0
- package/dist/plugins/network/settings.d.ts +24 -0
- package/dist/plugins/network/settings.d.ts.map +1 -0
- package/dist/plugins/network/settings.js +26 -0
- package/dist/plugins/network/settings.js.map +1 -0
- package/dist/plugins/network/xhr.d.ts +4 -0
- package/dist/plugins/network/xhr.d.ts.map +1 -0
- package/dist/plugins/network/xhr.js +214 -0
- package/dist/plugins/network/xhr.js.map +1 -0
- package/dist/plugins/network.d.ts +2 -15
- package/dist/plugins/network.d.ts.map +1 -1
- package/dist/plugins/network.js +8 -497
- package/dist/plugins/network.js.map +1 -1
- package/dist/plugins/state/context-names.d.ts +13 -0
- package/dist/plugins/state/context-names.d.ts.map +1 -0
- package/dist/plugins/state/context-names.js +280 -0
- package/dist/plugins/state/context-names.js.map +1 -0
- package/dist/plugins/state/context.d.ts +0 -89
- package/dist/plugins/state/context.d.ts.map +1 -1
- package/dist/plugins/state/context.js +3 -474
- package/dist/plugins/state/context.js.map +1 -1
- package/dist/plugins/state/engine.d.ts +5 -0
- package/dist/plugins/state/engine.d.ts.map +1 -1
- package/dist/plugins/state/engine.js +12 -2
- package/dist/plugins/state/engine.js.map +1 -1
- package/dist/plugins/state/fibers.d.ts +75 -0
- package/dist/plugins/state/fibers.d.ts.map +1 -0
- package/dist/plugins/state/fibers.js +92 -0
- package/dist/plugins/state/fibers.js.map +1 -0
- package/dist/plugins/state/index.d.ts +5 -0
- package/dist/plugins/state/index.d.ts.map +1 -1
- package/dist/plugins/state/index.js.map +1 -1
- package/dist/plugins/state/mobx.d.ts +22 -0
- package/dist/plugins/state/mobx.d.ts.map +1 -0
- package/dist/plugins/state/mobx.js +69 -0
- package/dist/plugins/state/mobx.js.map +1 -0
- package/dist/plugins/state/react-hook.d.ts +19 -0
- package/dist/plugins/state/react-hook.d.ts.map +1 -0
- package/dist/plugins/state/react-hook.js +100 -0
- package/dist/plugins/state/react-hook.js.map +1 -0
- package/dist/plugins/state/redux.d.ts +2 -0
- package/dist/plugins/state/redux.d.ts.map +1 -1
- package/dist/plugins/state/redux.js +2 -2
- package/dist/plugins/state/redux.js.map +1 -1
- package/dist/plugins/state/xstate.d.ts +26 -0
- package/dist/plugins/state/xstate.d.ts.map +1 -0
- package/dist/plugins/state/xstate.js +85 -0
- package/dist/plugins/state/xstate.js.map +1 -0
- package/dist/plugins/storage.d.ts +1 -1
- package/dist/plugins/storage.d.ts.map +1 -1
- package/dist/plugins/storage.js +5 -7
- package/dist/plugins/storage.js.map +1 -1
- package/dist/serialize.d.ts.map +1 -1
- package/dist/serialize.js +1 -0
- package/dist/serialize.js.map +1 -1
- package/package.json +7 -5
- package/src/client.ts +19 -2
- package/src/index.ts +8 -2
- package/src/init.ts +66 -0
- package/src/plugins/console.ts +103 -10
- package/src/plugins/network/body.ts +114 -0
- package/src/plugins/network/failure.ts +79 -0
- package/src/plugins/network/fetch.ts +169 -0
- package/src/plugins/network/settings.ts +48 -0
- package/src/plugins/network/xhr.ts +223 -0
- package/src/plugins/network.ts +11 -545
- package/src/plugins/state/context-names.ts +265 -0
- package/src/plugins/state/context.ts +3 -532
- package/src/plugins/state/engine.ts +12 -2
- package/src/plugins/state/fibers.ts +160 -0
- package/src/plugins/state/index.ts +2 -0
- package/src/plugins/state/mobx.ts +80 -0
- package/src/plugins/state/react-hook.ts +98 -0
- package/src/plugins/state/redux.ts +2 -2
- package/src/plugins/state/xstate.ts +94 -0
- package/src/plugins/storage.ts +13 -8
- package/src/serialize.ts +2 -1
|
@@ -0,0 +1,265 @@
|
|
|
1
|
+
import type { Fiber } from './fibers.js';
|
|
2
|
+
|
|
3
|
+
const COMPONENT_TAGS = new Set([0, 1, 11, 14, 15]);
|
|
4
|
+
|
|
5
|
+
export function contextName(context: object): string | undefined {
|
|
6
|
+
try {
|
|
7
|
+
const name = (context as { displayName?: unknown }).displayName;
|
|
8
|
+
return typeof name === 'string' && name !== '' ? name : undefined;
|
|
9
|
+
} catch {
|
|
10
|
+
return undefined;
|
|
11
|
+
}
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
/**
|
|
15
|
+
* The component that rendered the provider: its owner, which development builds keep, else the closest one above.
|
|
16
|
+
* `owned` keeps to the owner, for an element created outside any render (e.g. passed to `root.render()`) has none.
|
|
17
|
+
*/
|
|
18
|
+
export function ownerName(fiber: Fiber, owned = false): string | undefined {
|
|
19
|
+
try {
|
|
20
|
+
for (let owner = fiber._debugOwner as Fiber | { name?: unknown } | null | undefined, hops = 0; owner != null && hops < 20; hops++) {
|
|
21
|
+
// A Server Component owner is plain info with a name.
|
|
22
|
+
if (!('tag' in owner)) return typeof owner.name === 'string' && owner.name !== '' ? owner.name : undefined;
|
|
23
|
+
const name = componentName(owner);
|
|
24
|
+
if (name !== undefined) return name;
|
|
25
|
+
owner = owner._debugOwner as Fiber | null | undefined;
|
|
26
|
+
}
|
|
27
|
+
if (owned) return undefined;
|
|
28
|
+
for (let node = fiber.return, hops = 0; node != null && hops < 50; node = node.return, hops++) {
|
|
29
|
+
if (!COMPONENT_TAGS.has(node.tag)) continue;
|
|
30
|
+
const name = componentName(node);
|
|
31
|
+
if (name !== undefined) return name;
|
|
32
|
+
}
|
|
33
|
+
} catch {
|
|
34
|
+
// a getter that threw: numbered instead
|
|
35
|
+
}
|
|
36
|
+
return undefined;
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
function componentName(fiber: Fiber): string | undefined {
|
|
40
|
+
if (!COMPONENT_TAGS.has(fiber.tag)) return undefined;
|
|
41
|
+
// memo() and forwardRef() wrap the function, sometimes one inside the other.
|
|
42
|
+
let type = fiber.elementType ?? fiber.type;
|
|
43
|
+
for (let depth = 0; type != null && depth < 3; depth++) {
|
|
44
|
+
const name: unknown = type.displayName ?? (typeof type === 'function' ? type.name : undefined);
|
|
45
|
+
// Bundlers rename clashing functions with a suffix, e.g. Vite's pre-bundling turns SWRConfig into SWRConfig$1.
|
|
46
|
+
if (typeof name === 'string' && name !== '') return name.replace(/\$\d+$/, '') || name;
|
|
47
|
+
if (typeof type !== 'object') return undefined;
|
|
48
|
+
type = type.render ?? type.type;
|
|
49
|
+
}
|
|
50
|
+
return undefined;
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
// ---------------------------------------------------------------------------
|
|
54
|
+
// Library contexts
|
|
55
|
+
// ---------------------------------------------------------------------------
|
|
56
|
+
|
|
57
|
+
/** Contexts that libraries name, by display name. */
|
|
58
|
+
const LIBRARY_CONTEXTS = new Map(Object.entries({
|
|
59
|
+
ReactRedux: 'react-redux',
|
|
60
|
+
TextAncestorContext: 'React Native',
|
|
61
|
+
RootTagContext: 'React Native',
|
|
62
|
+
ScrollViewContext: 'React Native',
|
|
63
|
+
VirtualizedListContext: 'React Native',
|
|
64
|
+
ImageAnalyticsTagContext: 'React Native',
|
|
65
|
+
SafeAreaInsetsContext: 'react-native-safe-area-context',
|
|
66
|
+
SafeAreaFrameContext: 'react-native-safe-area-context',
|
|
67
|
+
LinkingContext: 'React Navigation',
|
|
68
|
+
LocaleDirContext: 'React Navigation',
|
|
69
|
+
UnhandledLinkingContext: 'React Navigation',
|
|
70
|
+
HeaderBackContext: 'React Navigation',
|
|
71
|
+
HeaderHeightContext: 'React Navigation',
|
|
72
|
+
HeaderShownContext: 'React Navigation',
|
|
73
|
+
NavigatorContext: 'Expo Router',
|
|
74
|
+
RouteNode: 'Expo Router',
|
|
75
|
+
}));
|
|
76
|
+
|
|
77
|
+
/** Where React Navigation keeps the contexts it names, so that two copies of it share them. */
|
|
78
|
+
const REACT_NAVIGATION_CONTEXTS = '__react_navigation__elements_contexts';
|
|
79
|
+
|
|
80
|
+
/** Library components that render providers, by the names their code gives them. Names an app might use are left out. */
|
|
81
|
+
const LIBRARY_COMPONENTS = new Map(Object.entries({
|
|
82
|
+
QueryClientProvider: 'TanStack Query',
|
|
83
|
+
QueryErrorResetBoundary: 'TanStack Query',
|
|
84
|
+
PersistQueryClientProvider: 'TanStack Query',
|
|
85
|
+
HydrationBoundary: 'TanStack Query',
|
|
86
|
+
SWRConfig: 'SWR',
|
|
87
|
+
BaseNavigationContainer: 'React Navigation',
|
|
88
|
+
NavigationContainerInner: 'React Navigation',
|
|
89
|
+
NavigationIndependentTree: 'React Navigation',
|
|
90
|
+
NavigationProvider: 'React Navigation',
|
|
91
|
+
NavigationStateListenerProvider: 'React Navigation',
|
|
92
|
+
PreventRemoveProvider: 'React Navigation',
|
|
93
|
+
EnsureSingleNavigator: 'React Navigation',
|
|
94
|
+
SceneView: 'React Navigation',
|
|
95
|
+
ServerContainer: 'React Navigation',
|
|
96
|
+
FrameSizeProvider: 'React Navigation',
|
|
97
|
+
AnimatedHeaderHeightProvider: 'React Navigation',
|
|
98
|
+
BottomTabView: 'React Navigation',
|
|
99
|
+
CardContainerInner: 'React Navigation',
|
|
100
|
+
DrawerViewBase: 'React Navigation',
|
|
101
|
+
NativeStackView: 'React Navigation',
|
|
102
|
+
MaterialTopTabView: 'React Navigation',
|
|
103
|
+
NavigationContent: 'React Navigation',
|
|
104
|
+
PanGestureHandler: 'React Navigation',
|
|
105
|
+
ExpoRoot: 'Expo Router',
|
|
106
|
+
ContextNavigator: 'Expo Router',
|
|
107
|
+
InnerRoot: 'Expo Router',
|
|
108
|
+
RootModalProvider: 'Expo Router',
|
|
109
|
+
LinkPreviewContextProvider: 'Expo Router',
|
|
110
|
+
NativeTabsNavigator: 'Expo Router',
|
|
111
|
+
SlotNavigator: 'Expo Router',
|
|
112
|
+
SplitViewNavigator: 'Expo Router',
|
|
113
|
+
ExperimentalStackNavigator: 'Expo Router',
|
|
114
|
+
ZoomTransitionSourceContextProvider: 'Expo Router',
|
|
115
|
+
ZoomTransitionTargetContextProvider: 'Expo Router',
|
|
116
|
+
// Expo Router 58, which carries its own copy of React Navigation.
|
|
117
|
+
RoutingQueueProvider: 'Expo Router',
|
|
118
|
+
RemovalEventEmitterRegistryProvider: 'Expo Router',
|
|
119
|
+
RoutesWithRemovalPreventedProvider: 'Expo Router',
|
|
120
|
+
PreventRemovalProvider: 'Expo Router',
|
|
121
|
+
GuardContextProvider: 'Expo Router',
|
|
122
|
+
NavigationActivityProvider: 'Expo Router',
|
|
123
|
+
StandardRouterNavigator: 'Expo Router',
|
|
124
|
+
NativeTabsNavigatorWrapper: 'Expo Router',
|
|
125
|
+
NativeTabsContent: 'Expo Router',
|
|
126
|
+
NativeStackNavigatorContent: 'Expo Router',
|
|
127
|
+
ExperimentalStackNavigatorContent: 'Expo Router',
|
|
128
|
+
HeaderToolbarHostBase: 'Expo Router',
|
|
129
|
+
StackToolbarHeader: 'Expo Router',
|
|
130
|
+
StackToolbarBottom: 'Expo Router',
|
|
131
|
+
NativeToolbarMenu: 'Expo Router',
|
|
132
|
+
LinkWithPreview: 'Expo Router',
|
|
133
|
+
HrefPreview: 'Expo Router',
|
|
134
|
+
PreviewForRootHrefState: 'Expo Router',
|
|
135
|
+
InnerRouter: 'Expo Router',
|
|
136
|
+
FocusedHead: 'Expo Router',
|
|
137
|
+
HeadShim: 'Expo Router',
|
|
138
|
+
WebSafeAreaProvider: 'Expo Router',
|
|
139
|
+
ServerRoot: 'Expo Router',
|
|
140
|
+
ServerRouter: 'Expo Router',
|
|
141
|
+
ServerDocument: 'Expo Router',
|
|
142
|
+
SafeAreaProvider: 'react-native-safe-area-context',
|
|
143
|
+
ScreenStack: 'react-native-screens',
|
|
144
|
+
ScreenStackItem: 'react-native-screens',
|
|
145
|
+
InnerScreen: 'react-native-screens',
|
|
146
|
+
GestureDetectorProvider: 'react-native-screens',
|
|
147
|
+
ReanimatedScreenProvider: 'react-native-screens',
|
|
148
|
+
ReanimatedNativeStackScreen: 'react-native-screens',
|
|
149
|
+
GestureHandlerRootView: 'react-native-gesture-handler',
|
|
150
|
+
InterceptingGestureDetector: 'react-native-gesture-handler',
|
|
151
|
+
ScrollViewResponderProvider: 'react-native-gesture-handler',
|
|
152
|
+
SkipEntering: 'react-native-reanimated',
|
|
153
|
+
AppContainer: 'React Native',
|
|
154
|
+
}));
|
|
155
|
+
|
|
156
|
+
/** Expo Router names each route's component after the route, e.g. `Route(index)`. */
|
|
157
|
+
const EXPO_ROUTE = /^Route\(.*\)$/;
|
|
158
|
+
|
|
159
|
+
/**
|
|
160
|
+
* Library components whose names an app might use too, recognized by the component that rendered them: Expo
|
|
161
|
+
* Router's `Content` comes from ContextNavigator, its `Route` from a route's own component.
|
|
162
|
+
*/
|
|
163
|
+
const LIBRARY_COMPONENTS_BY_OWNER = new Map<string, (owner: string) => boolean>([
|
|
164
|
+
['Content', (owner) => owner === 'ContextNavigator'],
|
|
165
|
+
['Route', (owner) => EXPO_ROUTE.test(owner)],
|
|
166
|
+
]);
|
|
167
|
+
|
|
168
|
+
const NAVIGATION_COLORS = ['primary', 'background', 'card', 'text', 'border', 'notification'];
|
|
169
|
+
|
|
170
|
+
/** A React Navigation theme, which its ThemeContext holds; an app's ThemeContext usually holds something else. */
|
|
171
|
+
function isNavigationTheme(value: Record<string, unknown>): boolean {
|
|
172
|
+
const colors = value.colors as Record<string, unknown> | null | undefined;
|
|
173
|
+
return typeof value.dark === 'boolean' && colors != null && NAVIGATION_COLORS.every((key) => typeof colors[key] === 'string');
|
|
174
|
+
}
|
|
175
|
+
|
|
176
|
+
/**
|
|
177
|
+
* Expo Router's layouts (Stack, Tabs, Drawer…) carry `Screen` and `Protected` as statics, and some are anonymous
|
|
178
|
+
* arrow functions, so the name of the app's layout that renders them would be taken for theirs.
|
|
179
|
+
*/
|
|
180
|
+
function ownedByExpoRouterLayout(fiber: Fiber): boolean {
|
|
181
|
+
const owner = fiber._debugOwner as Fiber | null | undefined;
|
|
182
|
+
if (owner == null || !('tag' in owner)) return false;
|
|
183
|
+
for (let type = owner.elementType ?? owner.type, depth = 0; type != null && depth < 3; depth++) {
|
|
184
|
+
if (typeof type.Screen === 'function' && typeof type.Protected === 'function') return true;
|
|
185
|
+
if (typeof type !== 'object') return false;
|
|
186
|
+
type = type.render ?? type.type;
|
|
187
|
+
}
|
|
188
|
+
return false;
|
|
189
|
+
}
|
|
190
|
+
|
|
191
|
+
/** The name of the component that rendered the owner: one step past `ownerName(fiber, true)`. */
|
|
192
|
+
function ownerOfOwnerName(fiber: Fiber): string | undefined {
|
|
193
|
+
for (let owner = fiber._debugOwner as Fiber | null | undefined, hops = 0; owner != null && 'tag' in owner && hops < 20; hops++) {
|
|
194
|
+
if (componentName(owner) !== undefined) return ownerName(owner, true);
|
|
195
|
+
owner = owner._debugOwner as Fiber | null | undefined;
|
|
196
|
+
}
|
|
197
|
+
return undefined;
|
|
198
|
+
}
|
|
199
|
+
|
|
200
|
+
/**
|
|
201
|
+
* The library a context comes from, or undefined for the app's own. Runs once per store. Only the owner counts, not
|
|
202
|
+
* a component above: an app's provider passed to `root.render()` inside a library's has no owner.
|
|
203
|
+
*/
|
|
204
|
+
export function vendorOf(fiber: Fiber, context: object, value: unknown): string | undefined {
|
|
205
|
+
try {
|
|
206
|
+
const redux = (globalThis as Record<symbol, unknown>)[Symbol.for('react-redux-context')];
|
|
207
|
+
if (redux instanceof Map) for (const known of redux.values()) if (known === context) return 'react-redux';
|
|
208
|
+
const navigation = (globalThis as Record<string, unknown>)[REACT_NAVIGATION_CONTEXTS];
|
|
209
|
+
if (navigation instanceof Map) for (const known of navigation.values()) if (known === context) return 'React Navigation';
|
|
210
|
+
// Bundlers number names they had to rename, e.g. `SWRConfig$1`.
|
|
211
|
+
const plain = (text: string | undefined) => text?.replace(/(?:\$|_)\d+$/, '');
|
|
212
|
+
const name = plain(contextName(context));
|
|
213
|
+
if (value !== null && typeof value === 'object') {
|
|
214
|
+
const v = value as Record<string, unknown>;
|
|
215
|
+
if (typeof v.getQueryCache === 'function' && typeof v.getMutationCache === 'function') return 'TanStack Query';
|
|
216
|
+
const cache = v.cache as Record<string, unknown> | null | undefined;
|
|
217
|
+
if (typeof v.mutate === 'function' && cache != null && typeof cache.get === 'function' && typeof cache.set === 'function') {
|
|
218
|
+
return 'SWR';
|
|
219
|
+
}
|
|
220
|
+
if (name === 'ThemeContext' && isNavigationTheme(v)) return 'React Navigation';
|
|
221
|
+
}
|
|
222
|
+
if (ownedByExpoRouterLayout(fiber)) return 'Expo Router';
|
|
223
|
+
const owner = plain(ownerName(fiber, true));
|
|
224
|
+
if (owner === undefined) return LIBRARY_CONTEXTS.get(name ?? '') ?? sourcePackage(fiber);
|
|
225
|
+
const byOwner = LIBRARY_COMPONENTS_BY_OWNER.get(owner);
|
|
226
|
+
const byName =
|
|
227
|
+
LIBRARY_CONTEXTS.get(name ?? '') ??
|
|
228
|
+
LIBRARY_COMPONENTS.get(owner) ??
|
|
229
|
+
(EXPO_ROUTE.test(owner) || byOwner?.(plain(ownerOfOwnerName(fiber)) ?? '') ? 'Expo Router' : undefined);
|
|
230
|
+
return byName ?? sourcePackage(fiber);
|
|
231
|
+
} catch {
|
|
232
|
+
return undefined;
|
|
233
|
+
}
|
|
234
|
+
}
|
|
235
|
+
|
|
236
|
+
/**
|
|
237
|
+
* The package whose code created the provider element, from where React says it was created. Web only: React
|
|
238
|
+
* Native's stacks name the bundle rather than files.
|
|
239
|
+
*/
|
|
240
|
+
function sourcePackage(fiber: Fiber): string | undefined {
|
|
241
|
+
let path: string | undefined;
|
|
242
|
+
const source = fiber._debugSource as { fileName?: unknown } | null | undefined;
|
|
243
|
+
if (typeof source?.fileName === 'string') {
|
|
244
|
+
path = source.fileName;
|
|
245
|
+
} else {
|
|
246
|
+
// React Native's frames name the bundle, never a file: not worth formatting the stack for.
|
|
247
|
+
if (typeof navigator === 'object' && navigator?.product === 'ReactNative') return undefined;
|
|
248
|
+
const stack = (fiber._debugStack as { stack?: unknown } | null | undefined)?.stack;
|
|
249
|
+
if (typeof stack !== 'string' || stack.includes('UnknownOwner')) return undefined;
|
|
250
|
+
// The first frame is React's jsxDEV or createElement; the next is the code that created the element.
|
|
251
|
+
const frame = stack.split('\n').filter((line) => /:\d+:\d+\)?\s*$/.test(line))[1];
|
|
252
|
+
path = frame && /((?:[a-z][\w+.-]*:\/\/|\/)[^\s()]+?)(?::\d+){1,2}\)?\s*$/i.exec(frame)?.[1]?.replace(/[?#].*$/, '');
|
|
253
|
+
}
|
|
254
|
+
if (path === undefined) return undefined;
|
|
255
|
+
// Turbopack names chunks after the path they hold, with underscores for slashes.
|
|
256
|
+
if (/\/node_modules_[^/]*$/.test(path)) return 'a dependency';
|
|
257
|
+
const at = path.lastIndexOf('node_modules/');
|
|
258
|
+
if (at < 0) return undefined;
|
|
259
|
+
const rest = path.slice(at + 'node_modules/'.length);
|
|
260
|
+
// Vite serves dependencies as `.vite/deps/<name>.js`, with `@scope_name` for scoped ones.
|
|
261
|
+
const vite = /^\.vite\/deps\/([^/]+?)\.js$/.exec(rest)?.[1];
|
|
262
|
+
if (vite !== undefined) return vite.startsWith('chunk-') ? 'a dependency' : vite.replace(/^(@[^_]+)_/, '$1/');
|
|
263
|
+
const parts = rest.split('/');
|
|
264
|
+
return (parts[0]?.startsWith('@') ? `${parts[0]}/${parts[1]}` : parts[0]) || 'a dependency';
|
|
265
|
+
}
|