Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
159 commits
Select commit Hold shift + click to select a range
66130f7
chore: fix license copyright
shining-mind Oct 16, 2023
dc0d1c2
chore: configure yarn
shining-mind Oct 16, 2023
4738413
chore: add linter rules
shining-mind Oct 16, 2023
07b2081
docs: add readme's for packages
shining-mind Oct 16, 2023
3975354
chore(v4fire-devtools-core): init v4fire app
shining-mind Oct 17, 2023
be6823a
chore: remove v4fire prefix from devtools-core package
shining-mind Oct 18, 2023
ae07985
chore: remove v4fire prefix from devtools-extension package
shining-mind Oct 18, 2023
3a1dce4
chore(devtools-extension): init v4fire app
shining-mind Oct 18, 2023
c0dd2d4
chore(devtools-extension): add icons
shining-mind Oct 18, 2023
13360ab
chore(devtools-core): add npmignore
shining-mind Oct 18, 2023
d42f5a9
chore(devtools-extension): add npmignore
shining-mind Oct 18, 2023
61b5807
chore(devtools-extension): add config params
shining-mind Oct 18, 2023
cfcbf7d
chore(devtools-extension): add ExtensionManifestPlugin for webpack
shining-mind Oct 18, 2023
d7e7008
chore(devtools-extension): install webpack copy plugin
shining-mind Oct 18, 2023
9f2f142
chore(devtools-extension): add manifest templates
shining-mind Oct 18, 2023
abc11fd
chore(devtools-extension): init webpack plugins
shining-mind Oct 18, 2023
da7d395
chore: fix editorconfig files
shining-mind Oct 19, 2023
a5894cf
chore(proxy-server): fix error after refactoring
shining-mind Oct 19, 2023
fbc9b99
chore(build): disable dummy components
shining-mind Oct 19, 2023
b7c9c0c
feat(devtools-extension/shared/lib): add browser-api module
shining-mind Oct 19, 2023
00789c5
feat(devtools-extension/pages): add devtools page
shining-mind Oct 19, 2023
5cc02a4
chore(devtools-extension/pages): build devtools page
shining-mind Oct 19, 2023
53045ba
chore(devtools-extension): fix build scripts
shining-mind Oct 19, 2023
22508c3
docs(devtools-extension): update readme
shining-mind Oct 19, 2023
b6a7ed0
chore(devtools-extension): remove webview app
shining-mind Oct 19, 2023
65de3a6
chore(devtools-extension): fix import style in webpack plugins
shining-mind Oct 19, 2023
e548ca4
chore(devtools-core): add path-to-regexp to dependencies
shining-mind Oct 20, 2023
d3c5015
feat(devtools-core): create components page dummy
shining-mind Oct 20, 2023
1d2ce8d
chore(devtools-core): add router and dynamic-page to p-root
shining-mind Oct 20, 2023
30d31b6
chore(devtools-core): update components lock
shining-mind Oct 20, 2023
ee3fa17
feat(devtools-core): create profiler page dummy
shining-mind Oct 20, 2023
e256ed8
feat(b-header): add header widget
shining-mind Oct 20, 2023
c555b36
chore(b-header): add header to the root page
shining-mind Oct 20, 2023
d7b3fad
chore(devtools-core): update components lock
shining-mind Oct 20, 2023
0ccb16e
feat(p-components): add component tree
shining-mind Oct 24, 2023
d9ac245
chore(p-root): load dependencies from config
shining-mind Oct 24, 2023
ed682c9
chore(shared/lib/browser-api): create const file
shining-mind Oct 24, 2023
92c0ed0
feat(shared/lib/browser-api): add devtoolsEval helper
shining-mind Oct 24, 2023
b0af022
chore(b-tree): override getItemProps
shining-mind Oct 24, 2023
d6a03be
chore: add tmp styles for b-tree
shining-mind Oct 24, 2023
bf0d74c
feat(devtools-extension/p-components): load component tree from inspe…
shining-mind Oct 24, 2023
191455e
chore: update components-lock
shining-mind Oct 24, 2023
14af7e6
chore: update components-lock
shining-mind Oct 27, 2023
6fd52ef
feat(p-root): add placeholder field
shining-mind Oct 27, 2023
447656c
chore(devtools-extension): use root placeholder field on init
shining-mind Oct 27, 2023
a0a75a7
fix: v4fire app detection
shining-mind Oct 31, 2023
5d0c7bf
feat(p-components): add panel for component meta
shining-mind Oct 31, 2023
3a7862f
chore(p-root): change cursor to pointer for b-tree items
shining-mind Oct 31, 2023
04081b8
feat(devtools-extension): load component meta via eval
shining-mind Oct 31, 2023
865a013
chore: create @v4fire/devtools-backend package
shining-mind Nov 1, 2023
93662f6
chore(config): set default es = ES2020
shining-mind Nov 1, 2023
9653ce4
chore(p-root): remove favicons
shining-mind Nov 1, 2023
10757ff
feat(devtools-extension): create service worker
shining-mind Nov 1, 2023
f2baf43
chore(devtools-extension): add devtools-backend to deps
shining-mind Nov 1, 2023
cdb7fad
chore(devtools-extension): add entries for sw and backend
shining-mind Nov 1, 2023
500df10
chore(devtools-extension): set service worker in the manifest
shining-mind Nov 1, 2023
e262623
chore(p-devtools): connect to the service worker and inject backend
shining-mind Nov 1, 2023
16e94c8
chore(p-components): use devtools backend to serialize component data
shining-mind Nov 1, 2023
ff07d3e
chore(devtools-extension): set minimum chrome version
shining-mind Nov 2, 2023
4b8a2a6
chore(build): remove `standalone` postfix from scripts
shining-mind Nov 2, 2023
7292dd0
feat(devtools-extension): add popups
shining-mind Nov 2, 2023
93fac4b
chore(devtools-extension): move backend script to scripts dir
shining-mind Nov 2, 2023
0644777
feat(devtools-extension): add pageHasV4Fire helper
shining-mind Nov 2, 2023
a804013
feat(devtools-extension/sw): add updateExtensionTray helper
shining-mind Nov 2, 2023
86672ec
chore(p-root): check that backend is loaded
shining-mind Nov 2, 2023
583bbd9
feat(devtools-extension): create detect script
shining-mind Nov 2, 2023
b7e9214
feat(devtools-extension): create proxy script
shining-mind Nov 2, 2023
1eeadb7
chore(p-devtools): refactor V4Fire detection
shining-mind Nov 2, 2023
1ce8265
chore(devtools-extension): inject content scripts via dynamic declara…
shining-mind Nov 2, 2023
775a477
chore(devtools-extension): update message handler
shining-mind Nov 2, 2023
900b09a
Merge pull request #1 from V4Fire/draft
shining-mind Nov 3, 2023
6826ed1
chore(devtools-backend): improve serialization
shining-mind Nov 7, 2023
b4f730f
feat(devtools-core): create helper normalizeComponentName
shining-mind Nov 7, 2023
f04b505
feat(devtools-core): create bComponentsPanel
shining-mind Nov 7, 2023
56e5116
chore(devtools-extension): export @super/shared/lib
shining-mind Nov 7, 2023
a5fe878
chore: use b-components-panel in b-components
shining-mind Nov 7, 2023
bf5f83c
chore(devtools-core): remove b-tree override
shining-mind Nov 8, 2023
b965948
feat(b-components-tree): create
shining-mind Nov 8, 2023
ba288c0
chore(p-components): integrate b-components-tree
shining-mind Nov 8, 2023
f0cc141
feat(b-components-tree): add ComponentsTreeState type
shining-mind Nov 9, 2023
9e7f85d
chore(p-root): set max-height and hidden overflow
shining-mind Nov 9, 2023
5dcb760
chore(b-header): add padding for tabs
shining-mind Nov 9, 2023
d12ce8f
chore(p-components): improve grid
shining-mind Nov 9, 2023
f3e8618
chore(b-components-panel): improve styles
shining-mind Nov 9, 2023
a8ed194
feat(b-components-tree): implement search
shining-mind Nov 9, 2023
0772959
chore(b-components-tree): refactor items search match
shining-mind Nov 10, 2023
3cc263f
chore(p-components): add bottom border for placeholder
shining-mind Nov 10, 2023
52c7734
chore(b-components-tree): decouple current search index and active item
shining-mind Nov 10, 2023
5b112e1
chore(b-tree): add default styles for b-tree
shining-mind Nov 10, 2023
069dd97
refactor(b-components-tree): use b-tree via composition
shining-mind Nov 10, 2023
11db015
chore(p-components): show alert for no data
shining-mind Nov 10, 2023
3d75107
fix(p-components): fix ref name of b-components-tree
shining-mind Nov 10, 2023
877352e
chore(b-components-tree): forward change event
shining-mind Nov 10, 2023
de5a7d8
refactor(b-components-panel): use b-tree via composition
shining-mind Nov 10, 2023
c72257c
fix(b-tree): fix class name of marker
shining-mind Nov 10, 2023
18ef968
chore: set @v4fire/client to dev branch
shining-mind Nov 11, 2023
088d10a
fix(serialize): detect circular refs
shining-mind Nov 11, 2023
2ef37ce
chore: change project structure to match the V4Fire paradigm
shining-mind Nov 13, 2023
510b874
chore(b-components-tree): make value and label required for Item
shining-mind Nov 14, 2023
781d888
fix(eval-components-tree): correctly detect root
shining-mind Nov 15, 2023
538aac5
fix(eval-components-tree): deduplicate nodes
shining-mind Nov 15, 2023
f597ecb
Highlight directive (#3)
shining-mind Nov 20, 2023
8d3a885
fix(b-components-panel): improve rendering of tree
shining-mind Nov 16, 2023
2e7ea9b
chore: update v4fire/client
shining-mind Nov 16, 2023
bcf2f57
chore(p-components): use throttle to load selected component data
shining-mind Nov 16, 2023
bd0f750
fix(eval-component-meta): check componentId of the node
shining-mind Nov 16, 2023
e28ec62
feat(p-root): set --header-height css variable
shining-mind Nov 16, 2023
2114260
chore(p-components): improve height of children with `overflow: auto`
shining-mind Nov 16, 2023
b2dd2e5
feat(b-tree): create pretty theme
shining-mind Nov 16, 2023
b54682d
chore(devtools-backend/serialize): pass value to isRestrictedKey
shining-mind Nov 16, 2023
cf07e72
chore(eval-component-meta): improve restricted key
shining-mind Nov 16, 2023
335b46f
chore(b-components-panel): add padding for level 0 nodes
shining-mind Nov 16, 2023
233bb79
chore(b-components-tree): highlight active item
shining-mind Nov 16, 2023
35d0716
chore: set eslint ignores correctly
shining-mind Nov 17, 2023
d88c7c6
fix(p-root): set header height variable for root node
shining-mind Nov 27, 2023
62ce126
feat(devtools-backend): create search module
shining-mind Nov 27, 2023
4785d84
feat(devtools-backend): create ui module
shining-mind Nov 27, 2023
c9f4a21
feat(devtools-backend): export ui and search modules
shining-mind Nov 27, 2023
9af9f5b
feat(b-components-tree): add mouseenter and mouseleave props to item
shining-mind Nov 27, 2023
599d2f6
fix(eval-components-tree): log missing parent in map
shining-mind Nov 27, 2023
33d7a05
chore(eval-component-meta): use findComponentNode
shining-mind Nov 27, 2023
ebad7ec
chore(p-devtools): render p-root on idle
shining-mind Nov 27, 2023
d2340e8
chore(devtools-extension): highlight component's node
shining-mind Nov 27, 2023
02c6dcd
feat(b-header): add reload button
shining-mind Dec 8, 2023
384c77a
fix(b-components-tree): re-export from super
shining-mind Dec 8, 2023
72558c7
chore(b-components-panel): add componentId to ComponentData type
shining-mind Dec 8, 2023
f42ebf9
feat(b-components-panel): use icons for actions
shining-mind Dec 8, 2023
7f09c6b
feat(b-components-panel): implement onInspect method
shining-mind Dec 8, 2023
598a7b7
chore: update components lock
shining-mind Dec 8, 2023
03476bb
chore(p-devtools): do not inject backend for window without tabId
shining-mind Dec 8, 2023
de9b30e
chore: update @v4fire/client
shining-mind Dec 8, 2023
9c23e91
chore(devtools-backend): make component-highlight a singleton
shining-mind Dec 11, 2023
bc57902
chore(devtools-backend): disable pointer events for component highlight
shining-mind Dec 11, 2023
505d9f3
feat(devtools-backend): create ComponentLocate class
shining-mind Dec 11, 2023
91e7018
chore(devtools-core): add crosshair icon
shining-mind Dec 11, 2023
665e713
feat(devtools-core): create b-components-actions
shining-mind Dec 11, 2023
8d56c3d
chore(b-header): integrate b-components-actions
shining-mind Dec 11, 2023
f7b29b2
chore(b-components-actions): add override for devtools-extension
shining-mind Dec 11, 2023
61acbe2
chore: update components lock
shining-mind Dec 11, 2023
9bfc09d
fix(b-components-panel): hint position
shining-mind Dec 11, 2023
8438268
chore: add hints for components actions
shining-mind Dec 12, 2023
cb3c59a
refactor(BrowserTabManager): create helpers and handle proxy connections
shining-mind Dec 12, 2023
fd07195
fix(CouldNotFindV4FireOnThePageError): fix name
shining-mind Dec 12, 2023
5e94b50
feat(p-devtools): listen for messages from proxy
shining-mind Dec 12, 2023
cef55e1
chore(component-locate): send message to devtools on component select
shining-mind Dec 12, 2023
5835262
refactor(b-components-tree): add scrollToItem method
shining-mind Dec 12, 2023
5b9448b
feat(scripts/proxy): connect to extension's service worker
shining-mind Dec 12, 2023
2fa6d6f
feat: handle `bridge.select-component` event
shining-mind Dec 12, 2023
91bf06b
docs: add test-cases for components page
shining-mind Dec 12, 2023
b8450d0
Merge pull request #4 from V4Fire/p-components-fixes
shining-mind Dec 12, 2023
603bfca
chore(build/webpack/module): fix filenames for production build
shining-mind Dec 12, 2023
ca93762
chore(b-components-actions): move reload button from b-header
shining-mind Dec 12, 2023
e2fc80b
chore(b-header): disable Profiler tab
shining-mind Dec 12, 2023
3a60fb0
chore(devtools-extension): add build:store script
shining-mind Dec 12, 2023
c9aa608
chore(devtools-extension): :up: 0.1.0
shining-mind Dec 12, 2023
4712b7a
feat(deps): bump `v4fire/*` (#13)
ItMaga Mar 19, 2024
b0cf597
feat: add `mods` into component panel (#12)
ItMaga Apr 27, 2024
0c7dae5
chore: update v4fire dependencies
shining-mind May 2, 2024
d203cc6
Merge pull request #14 from V4Fire/up-v4fire
shining-mind May 2, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
26 changes: 26 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
# Dependencies
node_modules

# Build && test
/coverage
/.nyc_output
dist
.env
*.tgz

# IDE
.idea
.vscode

# Operating System Files
.DS_Store
.AppleDouble
.LSOverride

# Yarn
.yarn/*
!.yarn/patches
!.yarn/plugins
!.yarn/releases
!.yarn/sdks
!.yarn/versions
874 changes: 874 additions & 0 deletions .yarn/releases/yarn-3.6.4.cjs

Large diffs are not rendered by default.

3 changes: 3 additions & 0 deletions .yarnrc.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
nodeLinker: node-modules

yarnPath: .yarn/releases/yarn-3.6.4.cjs
2 changes: 1 addition & 1 deletion LICENSE
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
MIT License

Copyright (c) 2023 V4FIRE
Copyright (c) 2023 V4Fire

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
Expand Down
19 changes: 19 additions & 0 deletions docs/ru/tests/01-components.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
# Тесты страницы "Components"

## 1. Выбор компонента на странице

### Кейс 1.1

1. Открыть приложение V4Fire
2. Открыть devtools
3. Открыть вкладку `v4fire` в devtools
4. Кликнуть на иконку прицела и выбрать компонент на странице -> Данные компонента отобразились в панели

### Кейс 1.2

1. Открыть приложение V4Fire
2. Открыть devtools
3. Открыть вкладку `v4fire` в devtools
4. Сменить вкладку в браузере
5. Вернуться на вкладку с приложением V4Fire
6. Кликнуть на иконку прицела и выбрать компонент на странице -> Данные компонента отобразились в панели
54 changes: 54 additions & 0 deletions eslint.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
/*!
* V4Fire DevTools
* https://github.com/V4Fire/DevTools
*
* Released under the MIT license
* https://github.com/V4Fire/DevTools/blob/main/LICENSE
*/

'use strict';

const
headerPlugin = require('eslint-plugin-header');

const
base = require('@v4fire/linters/eslint.config');

const copyrightTemplate = [
'!',
' * V4Fire DevTools',
' * https://github.com/V4Fire/DevTools',
' *',
' * Released under the MIT license',
' * https://github.com/V4Fire/DevTools/blob/main/LICENSE',
' '
];

const ignore = [
'**/src/**/@(i-|b-|p-|g-|v-)*/index.js',
'**/src/**/test/**/*.js',

'**/assets/**',
'**/src/assets/**',

'**/tmp/**',
'**/src/entries/tmp/**',

'**/docs/**',
'**/dist/**',
'**/node_modules/**'
];

base.forEach((item) => {
item.ignores = ignore;

if (item.plugins) {
item.plugins['header'] = headerPlugin;
}

if (item.rules) {
item.rules['header/header'] = [2, 'block', copyrightTemplate];
}
});

module.exports = base;
15 changes: 15 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
{
"workspaces": [
"packages/*"
],
"scripts": {
"lint": "npx eslint ./packages"
},
"license": "MIT",
"packageManager": "yarn@3.6.4",
"devDependencies": {
"@v4fire/cli": "^2.1.0",
"@v4fire/linters": "git+https://github.com/v4fire/linters#rework_rules",
"typescript": "4.6.2"
}
}
12 changes: 12 additions & 0 deletions packages/devtools-backend/.editorconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
root = true

[*]
charset = utf-8
end_of_line = lf
indent_style = space
indent_size = 2
trim_trailing_whitespace = true
insert_final_newline = true

[*.{js,jsx,ts,tsx,html,css,styl,ss,ess}]
indent_style = tab
1 change: 1 addition & 0 deletions packages/devtools-backend/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
dist
10 changes: 10 additions & 0 deletions packages/devtools-backend/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
# V4Fire DevTools Backend

This is the source code for the V4Fire DevTools backend.
It must be injected in the inspected window as the `__V4FIRE_DEVTOOLS_BACKEND__` global variable.

## Quick start

1. Run at the root `yarn install`
2. `cd ./packages/devtools-backend`
3. `yarn dev`
15 changes: 15 additions & 0 deletions packages/devtools-backend/package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
{
"name": "@v4fire/devtools-backend",
"version": "0.1.0",
"packageManager": "yarn@3.6.4",
"scripts": {
"build": "npx tsc",
"dev": "npx tsc -w"
},
"main": "dist/index.js",
"types": "dist/index.d.ts",
"files": [
"dist/*"
],
"license": "MIT"
}
12 changes: 12 additions & 0 deletions packages/devtools-backend/src/index.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
/*!
* V4Fire DevTools
* https://github.com/V4Fire/DevTools
*
* Released under the MIT license
* https://github.com/V4Fire/DevTools/blob/main/LICENSE
*/

export * from './serialize';
export * from './search';
export * from './ui';
export * from './interface';
23 changes: 23 additions & 0 deletions packages/devtools-backend/src/interface/component.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
/*!
* V4Fire DevTools
* https://github.com/V4Fire/DevTools
*
* Released under the MIT license
* https://github.com/V4Fire/DevTools/blob/main/LICENSE
*/

/**
* Parameters to search for a component
*/
export interface ComponentQuery {
/**
* The unique component identifier.
* The value is formed based on the passed prop or dynamically.
*/
readonly componentId: string;

/**
* The component name in dash-style without special postfixes like `-functional`
*/
readonly componentName?: string;
}
9 changes: 9 additions & 0 deletions packages/devtools-backend/src/interface/index.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
/*!
* V4Fire DevTools
* https://github.com/V4Fire/DevTools
*
* Released under the MIT license
* https://github.com/V4Fire/DevTools/blob/main/LICENSE
*/

export * from './component';
5 changes: 5 additions & 0 deletions packages/devtools-backend/src/search/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
# Search

These modules provide search API:

- find component node
30 changes: 30 additions & 0 deletions packages/devtools-backend/src/search/find-component-node.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
/*!
* V4Fire DevTools
* https://github.com/V4Fire/DevTools
*
* Released under the MIT license
* https://github.com/V4Fire/DevTools/blob/main/LICENSE
*/

import type { ComponentQuery } from '../interface';

/**
* Find component DOM node
*
* @param query - component query
*/
export default function findComponentNode<T extends Element>(query: ComponentQuery): T | null {
const {componentId: id, componentName: name} = query;
let node = Array.prototype.find.call(
document.querySelectorAll(`.i-block-helper.${id}`),
(node) => node.component?.componentId === id
);

if (node == null && name != null) {
// Maybe it's a functional component
const nodes = document.querySelectorAll(`.i-block-helper.${name}`);
node = Array.prototype.find.call(nodes, (node) => node.component?.componentId === id);
}

return node;
}
8 changes: 8 additions & 0 deletions packages/devtools-backend/src/search/index.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
/*!
* V4Fire DevTools
* https://github.com/V4Fire/DevTools
*
* Released under the MIT license
* https://github.com/V4Fire/DevTools/blob/main/LICENSE
*/
export { default as findComponentNode } from './find-component-node';
43 changes: 43 additions & 0 deletions packages/devtools-backend/src/serialize/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
# serialize

This module is used to serialize complex values.
It is mainly used to serialize component's meta and send it to the devtools.

## API

### serialize

Serializes the given value:

```ts
import { serialize } from '@v4fire/devtools-backend';

serialize({date: new Date(), set: new Set([1,2,3]), sum: (a, b) => a + b})

// NOTE: the result was formatted for the example
// {
// "date": "2023-11-01T12:31:56.859Z",
// "set": {
// "__DATA__": "__DATA__:Set",
// "__DATA__:Set": [
// 1,
// 2,
// 3
// ]
// },
// "sum": {
// "__DATA__": "__DATA__:Function",
// "__DATA__:Function": "(a, b) => a + b"
// }
// }
```

### deserialize

Deserializes previously serialized value:

```ts
import { deserialize } from '@v4fire/devtools-backend';

deserialize('{"set":{"__DATA__":"__DATA__:Set","__DATA__:Set":[1,2,3]}}') // {set: Set(3)}
```
Loading