@vitejs/devtools-vite 0.4.3 → 0.4.4
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/index.mjs +30 -12
- package/dist/nitro.json +1 -1
- package/dist/public/200.html +1 -1
- package/dist/public/404.html +1 -1
- package/dist/public/_nuxt/{CeVkPjP7.js → B4Gu6iiy.js} +1 -1
- package/dist/public/_nuxt/{0fZFclj2.js → BC_sx2n1.js} +2 -2
- package/dist/public/_nuxt/{BjJFp2QE.js → BD4CFFZd.js} +1 -1
- package/dist/public/_nuxt/{K3CNNOBf.js → BaWrej0D.js} +1 -1
- package/dist/public/_nuxt/builds/latest.json +1 -1
- package/dist/public/_nuxt/builds/meta/9ed128ae-36cf-47ec-9da9-d8526939fcad.json +1 -0
- package/dist/public/_nuxt/{entry.CzwuNVVL.css → entry.WUs_YScM.css} +1 -1
- package/dist/public/_nuxt/{QSP1yWcH.js → r__Gyeey.js} +1 -1
- package/dist/public/index.html +1 -1
- package/package.json +3 -3
- package/dist/public/_nuxt/builds/meta/d3f7ed61-b5b0-435f-9c70-ecd6f63b3201.json +0 -1
package/dist/index.mjs
CHANGED
|
@@ -1695,15 +1695,32 @@ var ViteInspectEnvironmentContext = class {
|
|
|
1695
1695
|
}
|
|
1696
1696
|
};
|
|
1697
1697
|
//#endregion
|
|
1698
|
+
//#region src/node/rpc/inspect-module-updated.ts
|
|
1699
|
+
const VITE_INSPECT_MODULE_UPDATED_STATE_KEY = "vite:inspect:module-updated";
|
|
1700
|
+
function getViteInspectModuleUpdatedState(context) {
|
|
1701
|
+
return context.rpc.sharedState.get(VITE_INSPECT_MODULE_UPDATED_STATE_KEY, { initialValue: {
|
|
1702
|
+
ids: null,
|
|
1703
|
+
updatedAt: 0
|
|
1704
|
+
} });
|
|
1705
|
+
}
|
|
1706
|
+
function notifyViteInspectModuleUpdated(state, ids = null) {
|
|
1707
|
+
state.mutate((value) => {
|
|
1708
|
+
value.ids = ids;
|
|
1709
|
+
value.updatedAt = Date.now();
|
|
1710
|
+
});
|
|
1711
|
+
}
|
|
1712
|
+
//#endregion
|
|
1698
1713
|
//#region src/node/rpc/functions/vite-clear-module-transform.ts
|
|
1699
1714
|
const viteClearModuleTransform = defineRpcFunction({
|
|
1700
1715
|
name: "vite:inspect:clear-module-transform",
|
|
1701
1716
|
type: "action",
|
|
1702
1717
|
jsonSerializable: true,
|
|
1703
|
-
setup: (devtoolsCtx) => {
|
|
1718
|
+
setup: async (devtoolsCtx) => {
|
|
1704
1719
|
const ctx = getViteInspectContext(devtoolsCtx);
|
|
1720
|
+
const moduleUpdatedState = await getViteInspectModuleUpdatedState(devtoolsCtx);
|
|
1705
1721
|
return { handler: async (query, id) => {
|
|
1706
1722
|
await ctx.queryEnv(query).clearModuleTransform(id);
|
|
1723
|
+
notifyViteInspectModuleUpdated(moduleUpdatedState, [id]);
|
|
1707
1724
|
} };
|
|
1708
1725
|
}
|
|
1709
1726
|
});
|
|
@@ -1713,6 +1730,7 @@ const viteEnvInfo = defineRpcFunction({
|
|
|
1713
1730
|
name: "vite:env-info",
|
|
1714
1731
|
type: "query",
|
|
1715
1732
|
jsonSerializable: true,
|
|
1733
|
+
cacheable: true,
|
|
1716
1734
|
setup: () => {
|
|
1717
1735
|
return { handler: async () => {
|
|
1718
1736
|
const { default: { helpers } } = await import("envinfo");
|
|
@@ -1745,6 +1763,7 @@ const viteGetMetadata = defineRpcFunction({
|
|
|
1745
1763
|
name: "vite:inspect:get-metadata",
|
|
1746
1764
|
type: "query",
|
|
1747
1765
|
jsonSerializable: true,
|
|
1766
|
+
cacheable: true,
|
|
1748
1767
|
dump: async () => ({ inputs: [[]] }),
|
|
1749
1768
|
setup: (devtoolsCtx) => {
|
|
1750
1769
|
const ctx = getViteInspectContext(devtoolsCtx);
|
|
@@ -1757,6 +1776,7 @@ const viteGetModuleTransformInfo = defineRpcFunction({
|
|
|
1757
1776
|
name: "vite:inspect:get-module-transform-info",
|
|
1758
1777
|
type: "query",
|
|
1759
1778
|
jsonSerializable: true,
|
|
1779
|
+
cacheable: true,
|
|
1760
1780
|
dump: async (devtoolsCtx) => {
|
|
1761
1781
|
return { inputs: (await getAllModuleIds(getViteInspectContext(devtoolsCtx))).map(([query, id]) => [query, id]) };
|
|
1762
1782
|
},
|
|
@@ -1771,6 +1791,7 @@ const viteGetModulesList = defineRpcFunction({
|
|
|
1771
1791
|
name: "vite:inspect:get-modules-list",
|
|
1772
1792
|
type: "query",
|
|
1773
1793
|
jsonSerializable: true,
|
|
1794
|
+
cacheable: true,
|
|
1774
1795
|
dump: async (devtoolsCtx) => {
|
|
1775
1796
|
return { inputs: getAllQueryEnvs(getViteInspectContext(devtoolsCtx)).map((query) => [query]) };
|
|
1776
1797
|
},
|
|
@@ -1785,6 +1806,7 @@ const viteGetPluginDetails = defineRpcFunction({
|
|
|
1785
1806
|
name: "vite:inspect:get-plugin-details",
|
|
1786
1807
|
type: "query",
|
|
1787
1808
|
jsonSerializable: true,
|
|
1809
|
+
cacheable: true,
|
|
1788
1810
|
setup: (devtoolsCtx) => {
|
|
1789
1811
|
const ctx = getViteInspectContext(devtoolsCtx);
|
|
1790
1812
|
return { handler: async (query, id) => ctx.queryEnv(query).getPluginDetails(Number(id)) };
|
|
@@ -1796,6 +1818,7 @@ const viteGetPluginMetrics = defineRpcFunction({
|
|
|
1796
1818
|
name: "vite:inspect:get-plugin-metrics",
|
|
1797
1819
|
type: "query",
|
|
1798
1820
|
jsonSerializable: true,
|
|
1821
|
+
cacheable: true,
|
|
1799
1822
|
dump: async (devtoolsCtx) => {
|
|
1800
1823
|
return { inputs: getAllQueryEnvs(getViteInspectContext(devtoolsCtx)).map((query) => [query]) };
|
|
1801
1824
|
},
|
|
@@ -1810,6 +1833,7 @@ const viteGetServerMetrics = defineRpcFunction({
|
|
|
1810
1833
|
name: "vite:inspect:get-server-metrics",
|
|
1811
1834
|
type: "query",
|
|
1812
1835
|
jsonSerializable: true,
|
|
1836
|
+
cacheable: true,
|
|
1813
1837
|
dump: async (devtoolsCtx) => {
|
|
1814
1838
|
return { inputs: getAllQueryEnvs(getViteInspectContext(devtoolsCtx)).map((query) => [query]) };
|
|
1815
1839
|
},
|
|
@@ -1824,6 +1848,7 @@ const viteMetaInfo = defineRpcFunction({
|
|
|
1824
1848
|
name: "vite:meta-info",
|
|
1825
1849
|
type: "query",
|
|
1826
1850
|
jsonSerializable: true,
|
|
1851
|
+
cacheable: true,
|
|
1827
1852
|
setup: (context) => {
|
|
1828
1853
|
return { handler: async () => {
|
|
1829
1854
|
const { root, base, plugins } = context.viteConfig;
|
|
@@ -1841,6 +1866,7 @@ const viteResolveId = defineRpcFunction({
|
|
|
1841
1866
|
name: "vite:inspect:resolve-id",
|
|
1842
1867
|
type: "query",
|
|
1843
1868
|
jsonSerializable: true,
|
|
1869
|
+
cacheable: true,
|
|
1844
1870
|
dump: async (devtoolsCtx) => {
|
|
1845
1871
|
return { inputs: (await getAllModuleIds(getViteInspectContext(devtoolsCtx))).map(([query, id]) => [query, id]) };
|
|
1846
1872
|
},
|
|
@@ -1851,7 +1877,6 @@ const viteResolveId = defineRpcFunction({
|
|
|
1851
1877
|
});
|
|
1852
1878
|
//#endregion
|
|
1853
1879
|
//#region src/node/rpc/index.ts
|
|
1854
|
-
const VITE_INSPECT_MODULE_UPDATED_STATE_KEY = "vite:inspect:module-updated";
|
|
1855
1880
|
const viteRpcFunctions = [viteMetaInfo, viteEnvInfo];
|
|
1856
1881
|
const inspectRpcFunctions = [
|
|
1857
1882
|
viteClearModuleTransform,
|
|
@@ -2104,11 +2129,7 @@ function DevToolsViteInspect() {
|
|
|
2104
2129
|
let inspectStorageDir;
|
|
2105
2130
|
let inspectModuleUpdatedState;
|
|
2106
2131
|
function notifyInspectModuleUpdated(ids = null) {
|
|
2107
|
-
inspectModuleUpdatedState
|
|
2108
|
-
state.version += 1;
|
|
2109
|
-
state.ids = ids;
|
|
2110
|
-
state.updatedAt = Date.now();
|
|
2111
|
-
});
|
|
2132
|
+
if (inspectModuleUpdatedState) notifyViteInspectModuleUpdated(inspectModuleUpdatedState, ids);
|
|
2112
2133
|
}
|
|
2113
2134
|
async function createInspectContext(config) {
|
|
2114
2135
|
const storageDir = join(config.cacheDir || join(config.root, "node_modules/.vite"), "devtools", "inspect");
|
|
@@ -2156,15 +2177,12 @@ function DevToolsViteInspect() {
|
|
|
2156
2177
|
if (currentInspectContext) {
|
|
2157
2178
|
setViteInspectContext(ctx, currentInspectContext);
|
|
2158
2179
|
for (const fn of inspectRpcFunctions) ctx.rpc.register(fn);
|
|
2159
|
-
inspectModuleUpdatedState = await ctx
|
|
2160
|
-
version: 0,
|
|
2161
|
-
ids: null,
|
|
2162
|
-
updatedAt: 0
|
|
2163
|
-
} });
|
|
2180
|
+
inspectModuleUpdatedState = await getViteInspectModuleUpdatedState(ctx);
|
|
2164
2181
|
if (ctx.viteServer) {
|
|
2165
2182
|
const debouncedNotify = debounce(() => {
|
|
2166
2183
|
notifyInspectModuleUpdated();
|
|
2167
2184
|
}, 100);
|
|
2185
|
+
ctx.viteServer.watcher.on("all", debouncedNotify);
|
|
2168
2186
|
ctx.viteServer.middlewares.use((_req, _res, next) => {
|
|
2169
2187
|
debouncedNotify();
|
|
2170
2188
|
next();
|
package/dist/nitro.json
CHANGED
package/dist/public/200.html
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
<!DOCTYPE html><html lang="en" class="bg-dots"><head><meta charset="utf-8"><meta name="viewport" content="width=device-width,initial-scale=1"><title>Vite DevTools</title><script type="importmap">{"imports":{"#entry":"/__devtools-vite/_nuxt/
|
|
1
|
+
<!DOCTYPE html><html lang="en" class="bg-dots"><head><meta charset="utf-8"><meta name="viewport" content="width=device-width,initial-scale=1"><title>Vite DevTools</title><script type="importmap">{"imports":{"#entry":"/__devtools-vite/_nuxt/BC_sx2n1.js"}}</script><link rel="stylesheet" href="/__devtools-vite/_nuxt/entry.WUs_YScM.css" crossorigin><link rel="stylesheet" href="/__devtools-vite/_nuxt/rpc.CVTFzytL.css" crossorigin><link rel="modulepreload" as="script" crossorigin href="/__devtools-vite/_nuxt/BC_sx2n1.js"><link rel="modulepreload" as="script" crossorigin href="/__devtools-vite/_nuxt/D3MExTHO.js"><link rel="modulepreload" as="script" crossorigin href="/__devtools-vite/_nuxt/457Jr4Pr.js"><link rel="modulepreload" as="script" crossorigin href="/__devtools-vite/_nuxt/BJv-YGcz.js"><link rel="modulepreload" as="script" crossorigin href="/__devtools-vite/_nuxt/NLJpu4QF.js"><link rel="modulepreload" as="script" crossorigin href="/__devtools-vite/_nuxt/CQYaOgKz.js"><link rel="modulepreload" as="script" crossorigin href="/__devtools-vite/_nuxt/CWPpjZx6.js"><link rel="modulepreload" as="script" crossorigin href="/__devtools-vite/_nuxt/CAlSLYmJ.js"><link rel="modulepreload" as="script" crossorigin href="/__devtools-vite/_nuxt/BaWrej0D.js"><script type="module" src="/__devtools-vite/_nuxt/BC_sx2n1.js" crossorigin></script><link rel="prefetch" as="style" crossorigin href="/__devtools-vite/_nuxt/error-404.YVLV_SWG.css"><link rel="prefetch" as="script" crossorigin href="/__devtools-vite/_nuxt/CJwKXY9k.js"><link rel="prefetch" as="script" crossorigin href="/__devtools-vite/_nuxt/BDNMzG2s.js"><link rel="prefetch" as="style" crossorigin href="/__devtools-vite/_nuxt/error-500.DoVxOHYG.css"><link rel="prefetch" as="script" crossorigin href="/__devtools-vite/_nuxt/BKuuhLmM.js"><meta name="description" content="DevTools for Vite"><meta property="og:title" content="Vite DevTools"><meta property="og:description" content="DevTools for Vite"><link rel="icon" type="image/svg+xml" href="/favicon.svg"></head><body><div id="__nuxt"></div><div id="teleports"></div><script>window.__NUXT__={};window.__NUXT__.config={public:{},app:{baseURL:"/__devtools-vite/",buildId:"9ed128ae-36cf-47ec-9da9-d8526939fcad",buildAssetsDir:"/_nuxt/",cdnURL:""}}</script><script type="application/json" data-nuxt-data="nuxt-app" data-ssr="false" id="__NUXT_DATA__">[{"prerenderedAt":1,"serverRendered":2},1784780401969,false]</script></body></html>
|
package/dist/public/404.html
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
<!DOCTYPE html><html lang="en" class="bg-dots"><head><meta charset="utf-8"><meta name="viewport" content="width=device-width,initial-scale=1"><title>Vite DevTools</title><script type="importmap">{"imports":{"#entry":"/__devtools-vite/_nuxt/
|
|
1
|
+
<!DOCTYPE html><html lang="en" class="bg-dots"><head><meta charset="utf-8"><meta name="viewport" content="width=device-width,initial-scale=1"><title>Vite DevTools</title><script type="importmap">{"imports":{"#entry":"/__devtools-vite/_nuxt/BC_sx2n1.js"}}</script><link rel="stylesheet" href="/__devtools-vite/_nuxt/entry.WUs_YScM.css" crossorigin><link rel="stylesheet" href="/__devtools-vite/_nuxt/rpc.CVTFzytL.css" crossorigin><link rel="modulepreload" as="script" crossorigin href="/__devtools-vite/_nuxt/BC_sx2n1.js"><link rel="modulepreload" as="script" crossorigin href="/__devtools-vite/_nuxt/D3MExTHO.js"><link rel="modulepreload" as="script" crossorigin href="/__devtools-vite/_nuxt/457Jr4Pr.js"><link rel="modulepreload" as="script" crossorigin href="/__devtools-vite/_nuxt/BJv-YGcz.js"><link rel="modulepreload" as="script" crossorigin href="/__devtools-vite/_nuxt/NLJpu4QF.js"><link rel="modulepreload" as="script" crossorigin href="/__devtools-vite/_nuxt/CQYaOgKz.js"><link rel="modulepreload" as="script" crossorigin href="/__devtools-vite/_nuxt/CWPpjZx6.js"><link rel="modulepreload" as="script" crossorigin href="/__devtools-vite/_nuxt/CAlSLYmJ.js"><link rel="modulepreload" as="script" crossorigin href="/__devtools-vite/_nuxt/BaWrej0D.js"><script type="module" src="/__devtools-vite/_nuxt/BC_sx2n1.js" crossorigin></script><link rel="prefetch" as="style" crossorigin href="/__devtools-vite/_nuxt/error-404.YVLV_SWG.css"><link rel="prefetch" as="script" crossorigin href="/__devtools-vite/_nuxt/CJwKXY9k.js"><link rel="prefetch" as="script" crossorigin href="/__devtools-vite/_nuxt/BDNMzG2s.js"><link rel="prefetch" as="style" crossorigin href="/__devtools-vite/_nuxt/error-500.DoVxOHYG.css"><link rel="prefetch" as="script" crossorigin href="/__devtools-vite/_nuxt/BKuuhLmM.js"><meta name="description" content="DevTools for Vite"><meta property="og:title" content="Vite DevTools"><meta property="og:description" content="DevTools for Vite"><link rel="icon" type="image/svg+xml" href="/favicon.svg"></head><body><div id="__nuxt"></div><div id="teleports"></div><script>window.__NUXT__={};window.__NUXT__.config={public:{},app:{baseURL:"/__devtools-vite/",buildId:"9ed128ae-36cf-47ec-9da9-d8526939fcad",buildAssetsDir:"/_nuxt/",cdnURL:""}}</script><script type="application/json" data-nuxt-data="nuxt-app" data-ssr="false" id="__NUXT_DATA__">[{"prerenderedAt":1,"serverRendered":2},1784780401970,false]</script></body></html>
|