@ogygia/devtools 0.11.4 → 0.12.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.
- package/README.md +1 -1
- package/dist/profiler/standalone.js +12 -4
- package/package.json +9 -9
package/README.md
CHANGED
|
@@ -23,4 +23,4 @@ export default defineConfig(({ mode }) => ({
|
|
|
23
23
|
|
|
24
24
|
Code for the profiler: `@ogygia/devtools/profiler` (`span`, `instrument`), `@ogygia/devtools/profiler/client` (`mark`), and stores at `@ogygia/devtools/profiler/storage/sqlite`, `/redis`, `/postgres`.
|
|
25
25
|
|
|
26
|
-
Docs: [
|
|
26
|
+
Docs: [@ogygia/devtools](https://ogygiajs.dev/docs/devtools/overview), with [the dock](https://ogygiajs.dev/docs/devtools/dock) and [the profiler](https://ogygiajs.dev/docs/devtools/profiler/overview).
|
|
@@ -3,7 +3,9 @@ const STYLESHEET_RE = /<link\b[^>]*\brel=["']stylesheet["'][^>]*>/gi;
|
|
|
3
3
|
const MODULEPRELOAD_RE = /<link\b[^>]*\brel=["']modulepreload["'][^>]*>/gi;
|
|
4
4
|
const HREF_RE = /\bhref=["']([^"']+)["']/i;
|
|
5
5
|
const MODULE_SCRIPT_RE = /<script\b([^>]*\btype=["']module["'][^>]*)\bsrc=["']([^"']+)["']([^>]*)><\/script>/gi;
|
|
6
|
-
const
|
|
6
|
+
const REGION_TAG_RE = /<ogygia-region\b[^>]*>/gi;
|
|
7
|
+
const REGION_ENTRY_RE = /((?<![\w-])entry=["'])([^"']+)(["'])/i;
|
|
8
|
+
const REGION_SRC_RE = /((?<![\w-])src=["'])([^"']+)(["'])/i;
|
|
7
9
|
/** a static or dynamic import of a RELATIVE specifier inside a built chunk — quoted, or a
|
|
8
10
|
* template literal with no interpolation (Vite emits `import(\`./chunks/x.js\`)`) */
|
|
9
11
|
const IMPORT_RE = /((?:\bfrom|\bimport)\s*\(?\s*)(["'`])(\.{1,2}\/[^"'`$]+)\2/g;
|
|
@@ -78,10 +80,16 @@ async function build_standalone(html, opts) {
|
|
|
78
80
|
chunks.delete(key);
|
|
79
81
|
}
|
|
80
82
|
const entries = [];
|
|
81
|
-
html = html.replace(
|
|
82
|
-
const
|
|
83
|
+
html = html.replace(REGION_TAG_RE, (tag) => {
|
|
84
|
+
const src = REGION_SRC_RE.exec(tag)?.[2];
|
|
85
|
+
const file = src ?? REGION_ENTRY_RE.exec(tag)?.[2];
|
|
86
|
+
if (!file) return tag;
|
|
87
|
+
const u = new URL(file, base);
|
|
83
88
|
entries.push(u);
|
|
84
|
-
|
|
89
|
+
const key = key_of(u);
|
|
90
|
+
let out = tag.replace(REGION_ENTRY_RE, (_m, open, _v, close) => open + key + close);
|
|
91
|
+
if (src) out = out.replace(REGION_SRC_RE, (_m, open, _v, close) => open + key + close);
|
|
92
|
+
return out;
|
|
85
93
|
});
|
|
86
94
|
for (const u of entries) await add_chunk(u);
|
|
87
95
|
const imports = {};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@ogygia/devtools",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.12.0",
|
|
4
4
|
"description": "Devtools for ogygia: the in-page dock, and the SSR profiler with its report, client marks and storage adapters",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"devtools",
|
|
@@ -66,10 +66,13 @@
|
|
|
66
66
|
},
|
|
67
67
|
"dependencies": {
|
|
68
68
|
"@neodrag/svelte": "3.0.0-next.12",
|
|
69
|
-
"
|
|
70
|
-
"
|
|
69
|
+
"@ogygia/router": "^0.12.0",
|
|
70
|
+
"devalue": "^5.9.3"
|
|
71
71
|
},
|
|
72
72
|
"devDependencies": {
|
|
73
|
+
"@ogygia/core": "0.12.0",
|
|
74
|
+
"@ogygia/tooling": "0.0.0",
|
|
75
|
+
"@ogygia/tsdown-plugin-svelte": "1.1.1",
|
|
73
76
|
"@playwright/test": "1.62.1",
|
|
74
77
|
"@sveltejs/kit": "^2.70.2",
|
|
75
78
|
"@sveltejs/vite-plugin-svelte": "^7.2.0",
|
|
@@ -80,16 +83,13 @@
|
|
|
80
83
|
"tsdown": "^0.23.4",
|
|
81
84
|
"typescript": "^6.0.3",
|
|
82
85
|
"vite": "^8.3.5",
|
|
83
|
-
"vitest": "^4.1.12"
|
|
84
|
-
"@ogygia/core": "0.11.4",
|
|
85
|
-
"@ogygia/tooling": "0.0.0",
|
|
86
|
-
"@ogygia/tsdown-plugin-svelte": "1.1.0"
|
|
86
|
+
"vitest": "^4.1.12"
|
|
87
87
|
},
|
|
88
88
|
"peerDependencies": {
|
|
89
|
+
"@ogygia/core": "^0.12.0",
|
|
89
90
|
"@sveltejs/kit": ">=2.70.2 <4",
|
|
90
91
|
"svelte": "^5.56.8",
|
|
91
|
-
"vite": "^8.2.4"
|
|
92
|
-
"@ogygia/core": "^0.11.4"
|
|
92
|
+
"vite": "^8.2.4"
|
|
93
93
|
},
|
|
94
94
|
"scripts": {
|
|
95
95
|
"build": "tsdown",
|