@browsersync/bslive 0.0.9 → 0.0.13
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/Cargo.toml +3 -2
- package/bslive/src/lib.rs +8 -3
- package/bsnext/src/main.rs +9 -3
- package/crates/bsnext_client/generated/dto.ts +33 -2
- package/crates/bsnext_client/generated/schema.ts +52 -2
- package/crates/bsnext_client/{dist → inject/dist}/index.js +105 -58
- package/crates/bsnext_client/inject/package.json +12 -0
- package/crates/bsnext_client/{ts → inject/src}/index.ts +2 -2
- package/crates/bsnext_client/package-lock.json +89 -3
- package/crates/bsnext_client/package.json +4 -2
- package/crates/bsnext_client/src/lib.rs +10 -0
- package/crates/bsnext_client/tsconfig.json +8 -2
- package/crates/bsnext_client/ui/dist/index.css +78 -0
- package/crates/bsnext_client/ui/dist/index.js +997 -0
- package/crates/bsnext_client/{index.html → ui/index.html} +8 -4
- package/crates/bsnext_client/ui/input.yml +19 -0
- package/crates/bsnext_client/ui/package.json +18 -0
- package/crates/bsnext_client/ui/src/components/bs-debug.ts +27 -0
- package/crates/bsnext_client/ui/src/components/bs-header.ts +33 -0
- package/crates/bsnext_client/ui/src/components/bs-icon.ts +101 -0
- package/crates/bsnext_client/ui/src/components/bs-server-detail.ts +21 -0
- package/crates/bsnext_client/ui/src/components/bs-server-identity.ts +24 -0
- package/crates/bsnext_client/ui/src/components/bs-server-list.ts +39 -0
- package/crates/bsnext_client/ui/src/index.ts +39 -0
- package/crates/bsnext_client/ui/styles/base.css.ts +17 -0
- package/crates/bsnext_client/ui/styles/reset.css +52 -0
- package/crates/bsnext_client/ui/styles/style.css +29 -0
- package/crates/bsnext_client/ui/svg/wordmark-white.svg +38 -0
- package/crates/bsnext_core/Cargo.toml +1 -0
- package/crates/bsnext_core/src/common_layers.rs +62 -0
- package/crates/bsnext_core/src/dir_loader.rs +1 -1
- package/crates/bsnext_core/src/dto.rs +62 -2
- package/crates/bsnext_core/src/lib.rs +1 -0
- package/crates/bsnext_core/src/not_found/mod.rs +0 -1
- package/crates/bsnext_core/src/not_found/not_found_service.rs +5 -11
- package/crates/bsnext_core/src/raw_loader.rs +4 -34
- package/crates/bsnext_core/src/server/handler_listen.rs +10 -4
- package/crates/bsnext_core/src/server/router/assets.rs +39 -0
- package/crates/bsnext_core/src/server/router/mod.rs +15 -4
- package/crates/bsnext_core/src/server/router/pub_api.rs +39 -0
- package/crates/bsnext_core/src/server/router/snapshots/bsnext_core__server__router__tests__test__handlers.snap +9 -0
- package/crates/bsnext_core/src/server/router/tests.rs +11 -6
- package/crates/bsnext_core/src/server/state.rs +4 -0
- package/crates/bsnext_core/src/servers_supervisor/get_servers_handler.rs +3 -2
- package/crates/bsnext_core/src/servers_supervisor/start_handler.rs +5 -1
- package/crates/bsnext_fs/src/actor.rs +2 -1
- package/crates/bsnext_fs/src/filter.rs +14 -5
- package/crates/bsnext_fs/src/test/mod.rs +1 -1
- package/crates/bsnext_fs/src/watch_path_handler.rs +1 -1
- package/crates/bsnext_fs/src/watcher.rs +2 -1
- package/crates/bsnext_input/Cargo.toml +3 -0
- package/crates/bsnext_input/src/input_test/mod.rs +34 -0
- package/crates/bsnext_input/src/input_test/snapshots/bsnext_input__input_test__deserialize_3_headers.snap +29 -0
- package/crates/bsnext_input/src/input_test/snapshots/bsnext_input__input_test__deserialize_3_headers_control.snap +25 -0
- package/crates/bsnext_input/src/route.rs +4 -0
- package/crates/bsnext_output/src/pretty.rs +1 -1
- package/crates/bsnext_system/Cargo.toml +1 -1
- package/crates/bsnext_system/src/args.rs +4 -0
- package/crates/bsnext_system/src/monitor_any_watchables.rs +20 -14
- package/crates/bsnext_system/src/start_kind/snapshots/bsnext_system__start_kind__start_from_paths__test__test-2.snap +2 -1
- package/crates/bsnext_system/src/start_kind/snapshots/bsnext_system__start_kind__start_from_paths__test__test.snap +2 -1
- package/crates/bsnext_tracing/src/lib.rs +42 -4
- package/examples/kitchen-sink/input.yml +1 -1
- package/package.json +17 -17
- package/crates/bsnext_client/style.css +0 -3
- package/crates/bsnext_core/src/not_found/not_found.html +0 -20
- package/crates/bsnext_core/src/not_found/route_list.rs +0 -49
- /package/crates/bsnext_client/{ts → inject/src}/console.ts +0 -0
|
@@ -5,8 +5,8 @@ import {Timer} from "livereload-js/src/timer.js";
|
|
|
5
5
|
|
|
6
6
|
import {webSocket} from "rxjs/webSocket";
|
|
7
7
|
import {retry} from "rxjs";
|
|
8
|
-
import {clientEventSchema} from "
|
|
9
|
-
import {ChangeDTO, ClientEvent} from "
|
|
8
|
+
import {clientEventSchema} from "../../generated/schema.js";
|
|
9
|
+
import {ChangeDTO, ClientEvent} from "../../generated/dto";
|
|
10
10
|
import {createLRConsoleObserver, Level} from "./console";
|
|
11
11
|
|
|
12
12
|
const [consoleSubject, consoleApi] = createLRConsoleObserver();
|
|
@@ -8,16 +8,34 @@
|
|
|
8
8
|
"name": "bsnext_client",
|
|
9
9
|
"version": "1.0.0",
|
|
10
10
|
"license": "ISC",
|
|
11
|
+
"workspaces": [
|
|
12
|
+
"inject",
|
|
13
|
+
"ui"
|
|
14
|
+
],
|
|
11
15
|
"dependencies": {
|
|
12
16
|
"@types/node": "18.19.25",
|
|
13
17
|
"esbuild": "^0.20.2",
|
|
14
18
|
"livereload-js": "^4.0.2",
|
|
19
|
+
"prettier": "^3.2.5",
|
|
15
20
|
"rxjs": "^7.8.1",
|
|
16
21
|
"ts-to-zod": "^3.8.2",
|
|
17
22
|
"typescript": "^5.4.5",
|
|
18
23
|
"zod": "^3.22.4"
|
|
19
24
|
}
|
|
20
25
|
},
|
|
26
|
+
"inject": {
|
|
27
|
+
"name": "@browsersync/bslive-inject",
|
|
28
|
+
"version": "1.0.0",
|
|
29
|
+
"license": "ISC"
|
|
30
|
+
},
|
|
31
|
+
"node_modules/@browsersync/bslive-inject": {
|
|
32
|
+
"resolved": "inject",
|
|
33
|
+
"link": true
|
|
34
|
+
},
|
|
35
|
+
"node_modules/@browsersync/bslive-ui": {
|
|
36
|
+
"resolved": "ui",
|
|
37
|
+
"link": true
|
|
38
|
+
},
|
|
21
39
|
"node_modules/@esbuild/aix-ppc64": {
|
|
22
40
|
"version": "0.20.2",
|
|
23
41
|
"resolved": "https://registry.npmjs.org/@esbuild/aix-ppc64/-/aix-ppc64-0.20.2.tgz",
|
|
@@ -363,6 +381,19 @@
|
|
|
363
381
|
"node": ">=12"
|
|
364
382
|
}
|
|
365
383
|
},
|
|
384
|
+
"node_modules/@lit-labs/ssr-dom-shim": {
|
|
385
|
+
"version": "1.2.0",
|
|
386
|
+
"resolved": "https://registry.npmjs.org/@lit-labs/ssr-dom-shim/-/ssr-dom-shim-1.2.0.tgz",
|
|
387
|
+
"integrity": "sha512-yWJKmpGE6lUURKAaIltoPIE/wrbY3TEkqQt+X0m+7fQNnAv0keydnYvbiJFP1PnMhizmIWRWOG5KLhYyc/xl+g=="
|
|
388
|
+
},
|
|
389
|
+
"node_modules/@lit/reactive-element": {
|
|
390
|
+
"version": "2.0.4",
|
|
391
|
+
"resolved": "https://registry.npmjs.org/@lit/reactive-element/-/reactive-element-2.0.4.tgz",
|
|
392
|
+
"integrity": "sha512-GFn91inaUa2oHLak8awSIigYz0cU0Payr1rcFsrkf5OJ5eSPxElyZfKh0f2p9FsTiZWXQdWGJeXZICEfXXYSXQ==",
|
|
393
|
+
"dependencies": {
|
|
394
|
+
"@lit-labs/ssr-dom-shim": "^1.2.0"
|
|
395
|
+
}
|
|
396
|
+
},
|
|
366
397
|
"node_modules/@nodelib/fs.scandir": {
|
|
367
398
|
"version": "2.1.5",
|
|
368
399
|
"resolved": "https://registry.npmjs.org/@nodelib/fs.scandir/-/fs.scandir-2.1.5.tgz",
|
|
@@ -449,6 +480,11 @@
|
|
|
449
480
|
"undici-types": "~5.26.4"
|
|
450
481
|
}
|
|
451
482
|
},
|
|
483
|
+
"node_modules/@types/trusted-types": {
|
|
484
|
+
"version": "2.0.7",
|
|
485
|
+
"resolved": "https://registry.npmjs.org/@types/trusted-types/-/trusted-types-2.0.7.tgz",
|
|
486
|
+
"integrity": "sha512-ScaPdn1dQczgbl0QFTeTOmVHFULt394XJgOQNoyVhZ6r2vLnMLJfBPd53SB52T/3G36VI1/g2MZaX0cwDuXsfw=="
|
|
487
|
+
},
|
|
452
488
|
"node_modules/@typescript/vfs": {
|
|
453
489
|
"version": "1.5.0",
|
|
454
490
|
"resolved": "https://registry.npmjs.org/@typescript/vfs/-/vfs-1.5.0.tgz",
|
|
@@ -1385,6 +1421,34 @@
|
|
|
1385
1421
|
"graceful-fs": "^4.1.6"
|
|
1386
1422
|
}
|
|
1387
1423
|
},
|
|
1424
|
+
"node_modules/lit": {
|
|
1425
|
+
"version": "3.1.3",
|
|
1426
|
+
"resolved": "https://registry.npmjs.org/lit/-/lit-3.1.3.tgz",
|
|
1427
|
+
"integrity": "sha512-l4slfspEsnCcHVRTvaP7YnkTZEZggNFywLEIhQaGhYDczG+tu/vlgm/KaWIEjIp+ZyV20r2JnZctMb8LeLCG7Q==",
|
|
1428
|
+
"dependencies": {
|
|
1429
|
+
"@lit/reactive-element": "^2.0.4",
|
|
1430
|
+
"lit-element": "^4.0.4",
|
|
1431
|
+
"lit-html": "^3.1.2"
|
|
1432
|
+
}
|
|
1433
|
+
},
|
|
1434
|
+
"node_modules/lit-element": {
|
|
1435
|
+
"version": "4.0.5",
|
|
1436
|
+
"resolved": "https://registry.npmjs.org/lit-element/-/lit-element-4.0.5.tgz",
|
|
1437
|
+
"integrity": "sha512-iTWskWZEtn9SyEf4aBG6rKT8GABZMrTWop1+jopsEOgEcugcXJGKuX5bEbkq9qfzY+XB4MAgCaSPwnNpdsNQ3Q==",
|
|
1438
|
+
"dependencies": {
|
|
1439
|
+
"@lit-labs/ssr-dom-shim": "^1.2.0",
|
|
1440
|
+
"@lit/reactive-element": "^2.0.4",
|
|
1441
|
+
"lit-html": "^3.1.2"
|
|
1442
|
+
}
|
|
1443
|
+
},
|
|
1444
|
+
"node_modules/lit-html": {
|
|
1445
|
+
"version": "3.1.3",
|
|
1446
|
+
"resolved": "https://registry.npmjs.org/lit-html/-/lit-html-3.1.3.tgz",
|
|
1447
|
+
"integrity": "sha512-FwIbqDD8O/8lM4vUZ4KvQZjPPNx7V1VhT7vmRB8RBAO0AU6wuTVdoXiu2CivVjEGdugvcbPNBLtPE1y0ifplHA==",
|
|
1448
|
+
"dependencies": {
|
|
1449
|
+
"@types/trusted-types": "^2.0.2"
|
|
1450
|
+
}
|
|
1451
|
+
},
|
|
1388
1452
|
"node_modules/livereload-js": {
|
|
1389
1453
|
"version": "4.0.2",
|
|
1390
1454
|
"resolved": "https://registry.npmjs.org/livereload-js/-/livereload-js-4.0.2.tgz",
|
|
@@ -1572,9 +1636,9 @@
|
|
|
1572
1636
|
}
|
|
1573
1637
|
},
|
|
1574
1638
|
"node_modules/prettier": {
|
|
1575
|
-
"version": "3.
|
|
1576
|
-
"resolved": "https://registry.npmjs.org/prettier/-/prettier-3.
|
|
1577
|
-
"integrity": "sha512-
|
|
1639
|
+
"version": "3.2.5",
|
|
1640
|
+
"resolved": "https://registry.npmjs.org/prettier/-/prettier-3.2.5.tgz",
|
|
1641
|
+
"integrity": "sha512-3/GWa9aOC0YeD7LUfvOG2NiDyhOWRvt1k+rcKhOuYnMY24iiCphgneUfJDyFXd6rZCAnuLBv6UeAULtrhT/F4A==",
|
|
1578
1642
|
"bin": {
|
|
1579
1643
|
"prettier": "bin/prettier.cjs"
|
|
1580
1644
|
},
|
|
@@ -1928,6 +1992,20 @@
|
|
|
1928
1992
|
"ts-to-zod": "bin/run"
|
|
1929
1993
|
}
|
|
1930
1994
|
},
|
|
1995
|
+
"node_modules/ts-to-zod/node_modules/prettier": {
|
|
1996
|
+
"version": "3.0.3",
|
|
1997
|
+
"resolved": "https://registry.npmjs.org/prettier/-/prettier-3.0.3.tgz",
|
|
1998
|
+
"integrity": "sha512-L/4pUDMxcNa8R/EthV08Zt42WBO4h1rarVtK0K+QJG0X187OLo7l699jWw0GKuwzkPQ//jMFA/8Xm6Fh3J/DAg==",
|
|
1999
|
+
"bin": {
|
|
2000
|
+
"prettier": "bin/prettier.cjs"
|
|
2001
|
+
},
|
|
2002
|
+
"engines": {
|
|
2003
|
+
"node": ">=14"
|
|
2004
|
+
},
|
|
2005
|
+
"funding": {
|
|
2006
|
+
"url": "https://github.com/prettier/prettier?sponsor=1"
|
|
2007
|
+
}
|
|
2008
|
+
},
|
|
1931
2009
|
"node_modules/tslib": {
|
|
1932
2010
|
"version": "2.6.2",
|
|
1933
2011
|
"resolved": "https://registry.npmjs.org/tslib/-/tslib-2.6.2.tgz",
|
|
@@ -2054,6 +2132,14 @@
|
|
|
2054
2132
|
"funding": {
|
|
2055
2133
|
"url": "https://github.com/sponsors/colinhacks"
|
|
2056
2134
|
}
|
|
2135
|
+
},
|
|
2136
|
+
"ui": {
|
|
2137
|
+
"name": "@browsersync/bslive-ui",
|
|
2138
|
+
"version": "1.0.0",
|
|
2139
|
+
"license": "ISC",
|
|
2140
|
+
"dependencies": {
|
|
2141
|
+
"lit": "^3.1.3"
|
|
2142
|
+
}
|
|
2057
2143
|
}
|
|
2058
2144
|
}
|
|
2059
2145
|
}
|
|
@@ -5,10 +5,11 @@
|
|
|
5
5
|
"main": "index.js",
|
|
6
6
|
"scripts": {
|
|
7
7
|
"tsc": "tsc",
|
|
8
|
-
"build": "
|
|
8
|
+
"build": "npm run build --workspaces",
|
|
9
9
|
"test": "echo \"Error: no test specified\" && exit 1",
|
|
10
10
|
"schema": "ts-to-zod generated/dto.ts generated/schema.ts"
|
|
11
11
|
},
|
|
12
|
+
"workspaces": ["inject", "ui"],
|
|
12
13
|
"keywords": [],
|
|
13
14
|
"author": "",
|
|
14
15
|
"license": "ISC",
|
|
@@ -20,6 +21,7 @@
|
|
|
20
21
|
"typescript": "^5.4.5",
|
|
21
22
|
"@types/node": "18.19.25",
|
|
22
23
|
"ts-to-zod": "^3.8.2",
|
|
23
|
-
"zod": "^3.22.4"
|
|
24
|
+
"zod": "^3.22.4",
|
|
25
|
+
"prettier": "^3.2.5"
|
|
24
26
|
}
|
|
25
27
|
}
|
|
@@ -1 +1,11 @@
|
|
|
1
1
|
pub const DIR: &str = "dist";
|
|
2
|
+
pub const UI_CSS: &str = include_str!("../ui/dist/index.css");
|
|
3
|
+
pub const UI_JS: &str = include_str!("../ui/dist/index.js");
|
|
4
|
+
const UI_HTML: &str = include_str!("../ui/index.html");
|
|
5
|
+
|
|
6
|
+
pub fn html_with_base(base_override: &str) -> String {
|
|
7
|
+
let base = UI_HTML;
|
|
8
|
+
let next = format!("<base href=\"{}\" />", base_override);
|
|
9
|
+
let replaced = base.replace("<base href=\"/\" />", next.as_str());
|
|
10
|
+
replaced
|
|
11
|
+
}
|
|
@@ -8,9 +8,15 @@
|
|
|
8
8
|
"esModuleInterop": true,
|
|
9
9
|
"forceConsistentCasingInFileNames": true,
|
|
10
10
|
"strict": true,
|
|
11
|
-
"skipLibCheck": true
|
|
11
|
+
"skipLibCheck": true,
|
|
12
|
+
"experimentalDecorators": true
|
|
12
13
|
},
|
|
13
14
|
"include": [
|
|
14
|
-
"
|
|
15
|
+
"inject",
|
|
16
|
+
"ui"
|
|
17
|
+
],
|
|
18
|
+
"exclude": [
|
|
19
|
+
"ui/dist",
|
|
20
|
+
"inject/dist"
|
|
15
21
|
]
|
|
16
22
|
}
|
|
@@ -0,0 +1,78 @@
|
|
|
1
|
+
/* styles/reset.css */
|
|
2
|
+
*,
|
|
3
|
+
*::before,
|
|
4
|
+
*::after {
|
|
5
|
+
box-sizing: border-box;
|
|
6
|
+
}
|
|
7
|
+
* {
|
|
8
|
+
margin: 0;
|
|
9
|
+
}
|
|
10
|
+
body {
|
|
11
|
+
line-height: 1.5;
|
|
12
|
+
-webkit-font-smoothing: antialiased;
|
|
13
|
+
}
|
|
14
|
+
img,
|
|
15
|
+
picture,
|
|
16
|
+
video,
|
|
17
|
+
canvas,
|
|
18
|
+
svg {
|
|
19
|
+
display: block;
|
|
20
|
+
max-width: 100%;
|
|
21
|
+
}
|
|
22
|
+
input,
|
|
23
|
+
button,
|
|
24
|
+
textarea,
|
|
25
|
+
select {
|
|
26
|
+
font: inherit;
|
|
27
|
+
}
|
|
28
|
+
p,
|
|
29
|
+
h1,
|
|
30
|
+
h2,
|
|
31
|
+
h3,
|
|
32
|
+
h4,
|
|
33
|
+
h5,
|
|
34
|
+
h6 {
|
|
35
|
+
overflow-wrap: break-word;
|
|
36
|
+
}
|
|
37
|
+
#root,
|
|
38
|
+
#__next {
|
|
39
|
+
isolation: isolate;
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
/* styles/style.css */
|
|
43
|
+
:root {
|
|
44
|
+
--brand-blue: #0F2634;
|
|
45
|
+
--brand-grey: #6D6D6D;
|
|
46
|
+
--brand-red: #F24747;
|
|
47
|
+
--brand-white: #FFFFFF;
|
|
48
|
+
--theme-txt-color: var(--brand-blue);
|
|
49
|
+
--theme-page-color: var(--brand-white);
|
|
50
|
+
}
|
|
51
|
+
body {
|
|
52
|
+
font-family:
|
|
53
|
+
-apple-system,
|
|
54
|
+
BlinkMacSystemFont,
|
|
55
|
+
"Segoe UI",
|
|
56
|
+
Roboto,
|
|
57
|
+
Oxygen,
|
|
58
|
+
Ubuntu,
|
|
59
|
+
Cantarell,
|
|
60
|
+
"Open Sans",
|
|
61
|
+
"Helvetica Neue",
|
|
62
|
+
sans-serif;
|
|
63
|
+
color: var(--theme-txt-color);
|
|
64
|
+
background: var(--theme-page-color);
|
|
65
|
+
}
|
|
66
|
+
svg:not(:root) {
|
|
67
|
+
overflow: hidden;
|
|
68
|
+
}
|
|
69
|
+
.main {
|
|
70
|
+
padding-left: 1em;
|
|
71
|
+
padding-right: 1em;
|
|
72
|
+
}
|
|
73
|
+
@media (prefers-color-scheme: dark) {
|
|
74
|
+
:root {
|
|
75
|
+
--theme-txt-color: var(--brand-white);
|
|
76
|
+
--theme-page-color: var(--brand-blue);
|
|
77
|
+
}
|
|
78
|
+
}
|