@qwik.dev/devtools 0.0.2 → 0.0.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.
Files changed (136) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +1 -47
  3. package/dist/component/_virtual/_commonjsHelpers.qwik.cjs +6 -0
  4. package/dist/component/_virtual/_commonjsHelpers.qwik.mjs +6 -0
  5. package/dist/component/devtools.css.qwik.cjs +3 -0
  6. package/dist/component/devtools.css.qwik.mjs +4 -0
  7. package/dist/component/devtools.qwik.cjs +537 -0
  8. package/dist/component/devtools.qwik.mjs +537 -0
  9. package/dist/component/index.qwik.cjs +4 -0
  10. package/dist/component/index.qwik.mjs +4 -0
  11. package/dist/component/lib-types/devtools/src/index.d.ts +1 -0
  12. package/dist/component/lib-types/devtools/src/utils/location.d.ts +1 -0
  13. package/dist/component/node_modules/.pnpm/@qwikest_icons@0.0.13_@builder.io_qwik@1.11.0_vite@5.4.10_@types_node@20.14.11__/node_modules/@qwikest/icons/lib/hi.qwik.qwik.cjs +60 -0
  14. package/dist/component/node_modules/.pnpm/@qwikest_icons@0.0.13_@builder.io_qwik@1.11.0_vite@5.4.10_@types_node@20.14.11__/node_modules/@qwikest/icons/lib/hi.qwik.qwik.mjs +60 -0
  15. package/dist/component/node_modules/.pnpm/@qwikest_icons@0.0.13_@builder.io_qwik@1.11.0_vite@5.4.10_@types_node@20.14.11__/node_modules/@qwikest/icons/lib/lu.qwik.qwik.cjs +32 -0
  16. package/dist/component/node_modules/.pnpm/@qwikest_icons@0.0.13_@builder.io_qwik@1.11.0_vite@5.4.10_@types_node@20.14.11__/node_modules/@qwikest/icons/lib/lu.qwik.qwik.mjs +32 -0
  17. package/dist/component/node_modules/.pnpm/balanced-match@1.0.2/node_modules/balanced-match/index.qwik.cjs +54 -0
  18. package/dist/component/node_modules/.pnpm/balanced-match@1.0.2/node_modules/balanced-match/index.qwik.mjs +54 -0
  19. package/dist/component/node_modules/.pnpm/birpc@0.2.19/node_modules/birpc/dist/index.qwik.cjs +128 -0
  20. package/dist/component/node_modules/.pnpm/birpc@0.2.19/node_modules/birpc/dist/index.qwik.mjs +128 -0
  21. package/dist/component/node_modules/.pnpm/brace-expansion@2.0.1/node_modules/brace-expansion/index.qwik.cjs +149 -0
  22. package/dist/component/node_modules/.pnpm/brace-expansion@2.0.1/node_modules/brace-expansion/index.qwik.mjs +150 -0
  23. package/dist/component/node_modules/.pnpm/copy-anything@3.0.5/node_modules/copy-anything/dist/index.qwik.cjs +36 -0
  24. package/dist/component/node_modules/.pnpm/copy-anything@3.0.5/node_modules/copy-anything/dist/index.qwik.mjs +36 -0
  25. package/dist/component/node_modules/.pnpm/dree@5.1.5/node_modules/dree/bundled/lib/esm/index.esm.qwik.cjs +12 -0
  26. package/dist/component/node_modules/.pnpm/dree@5.1.5/node_modules/dree/bundled/lib/esm/index.esm.qwik.mjs +12 -0
  27. package/dist/component/node_modules/.pnpm/is-what@4.1.16/node_modules/is-what/dist/index.qwik.cjs +17 -0
  28. package/dist/component/node_modules/.pnpm/is-what@4.1.16/node_modules/is-what/dist/index.qwik.mjs +17 -0
  29. package/dist/component/node_modules/.pnpm/minimatch@10.0.1/node_modules/minimatch/dist/esm/assert-valid-pattern.qwik.cjs +12 -0
  30. package/dist/component/node_modules/.pnpm/minimatch@10.0.1/node_modules/minimatch/dist/esm/assert-valid-pattern.qwik.mjs +12 -0
  31. package/dist/component/node_modules/.pnpm/minimatch@10.0.1/node_modules/minimatch/dist/esm/ast.qwik.cjs +513 -0
  32. package/dist/component/node_modules/.pnpm/minimatch@10.0.1/node_modules/minimatch/dist/esm/ast.qwik.mjs +513 -0
  33. package/dist/component/node_modules/.pnpm/minimatch@10.0.1/node_modules/minimatch/dist/esm/brace-expressions.qwik.cjs +110 -0
  34. package/dist/component/node_modules/.pnpm/minimatch@10.0.1/node_modules/minimatch/dist/esm/brace-expressions.qwik.mjs +110 -0
  35. package/dist/component/node_modules/.pnpm/minimatch@10.0.1/node_modules/minimatch/dist/esm/escape.qwik.cjs +6 -0
  36. package/dist/component/node_modules/.pnpm/minimatch@10.0.1/node_modules/minimatch/dist/esm/escape.qwik.mjs +6 -0
  37. package/dist/component/node_modules/.pnpm/minimatch@10.0.1/node_modules/minimatch/dist/esm/index.qwik.cjs +738 -0
  38. package/dist/component/node_modules/.pnpm/minimatch@10.0.1/node_modules/minimatch/dist/esm/index.qwik.mjs +738 -0
  39. package/dist/component/node_modules/.pnpm/minimatch@10.0.1/node_modules/minimatch/dist/esm/unescape.qwik.cjs +6 -0
  40. package/dist/component/node_modules/.pnpm/minimatch@10.0.1/node_modules/minimatch/dist/esm/unescape.qwik.mjs +6 -0
  41. package/dist/component/node_modules/.pnpm/superjson@2.2.2/node_modules/superjson/dist/accessDeep.qwik.cjs +120 -0
  42. package/dist/component/node_modules/.pnpm/superjson@2.2.2/node_modules/superjson/dist/accessDeep.qwik.mjs +120 -0
  43. package/dist/component/node_modules/.pnpm/superjson@2.2.2/node_modules/superjson/dist/class-registry.qwik.cjs +23 -0
  44. package/dist/component/node_modules/.pnpm/superjson@2.2.2/node_modules/superjson/dist/class-registry.qwik.mjs +23 -0
  45. package/dist/component/node_modules/.pnpm/superjson@2.2.2/node_modules/superjson/dist/custom-transformer-registry.qwik.cjs +18 -0
  46. package/dist/component/node_modules/.pnpm/superjson@2.2.2/node_modules/superjson/dist/custom-transformer-registry.qwik.mjs +18 -0
  47. package/dist/component/node_modules/.pnpm/superjson@2.2.2/node_modules/superjson/dist/double-indexed-kv.qwik.cjs +23 -0
  48. package/dist/component/node_modules/.pnpm/superjson@2.2.2/node_modules/superjson/dist/double-indexed-kv.qwik.mjs +23 -0
  49. package/dist/component/node_modules/.pnpm/superjson@2.2.2/node_modules/superjson/dist/index.qwik.cjs +91 -0
  50. package/dist/component/node_modules/.pnpm/superjson@2.2.2/node_modules/superjson/dist/index.qwik.mjs +91 -0
  51. package/dist/component/node_modules/.pnpm/superjson@2.2.2/node_modules/superjson/dist/is.qwik.cjs +51 -0
  52. package/dist/component/node_modules/.pnpm/superjson@2.2.2/node_modules/superjson/dist/is.qwik.mjs +51 -0
  53. package/dist/component/node_modules/.pnpm/superjson@2.2.2/node_modules/superjson/dist/pathstringifier.qwik.cjs +30 -0
  54. package/dist/component/node_modules/.pnpm/superjson@2.2.2/node_modules/superjson/dist/pathstringifier.qwik.mjs +30 -0
  55. package/dist/component/node_modules/.pnpm/superjson@2.2.2/node_modules/superjson/dist/plainer.qwik.cjs +148 -0
  56. package/dist/component/node_modules/.pnpm/superjson@2.2.2/node_modules/superjson/dist/plainer.qwik.mjs +148 -0
  57. package/dist/component/node_modules/.pnpm/superjson@2.2.2/node_modules/superjson/dist/registry.qwik.cjs +28 -0
  58. package/dist/component/node_modules/.pnpm/superjson@2.2.2/node_modules/superjson/dist/registry.qwik.mjs +28 -0
  59. package/dist/component/node_modules/.pnpm/superjson@2.2.2/node_modules/superjson/dist/transformer.qwik.cjs +203 -0
  60. package/dist/component/node_modules/.pnpm/superjson@2.2.2/node_modules/superjson/dist/transformer.qwik.mjs +203 -0
  61. package/dist/component/node_modules/.pnpm/superjson@2.2.2/node_modules/superjson/dist/util.qwik.cjs +47 -0
  62. package/dist/component/node_modules/.pnpm/superjson@2.2.2/node_modules/superjson/dist/util.qwik.mjs +47 -0
  63. package/dist/component/node_modules/.pnpm/vite-hot-client@0.2.4_vite@5.4.10_@types_node@20.14.11_/node_modules/vite-hot-client/dist/index.qwik.cjs +35 -0
  64. package/dist/component/node_modules/.pnpm/vite-hot-client@0.2.4_vite@5.4.10_@types_node@20.14.11_/node_modules/vite-hot-client/dist/index.qwik.mjs +35 -0
  65. package/dist/component/packages/kit/src/client.qwik.cjs +18 -0
  66. package/dist/component/packages/kit/src/client.qwik.mjs +18 -0
  67. package/dist/component/packages/kit/src/context.qwik.cjs +20 -0
  68. package/dist/component/packages/kit/src/context.qwik.mjs +20 -0
  69. package/dist/component/packages/kit/src/globals.qwik.cjs +6 -0
  70. package/dist/component/packages/kit/src/globals.qwik.mjs +6 -0
  71. package/dist/plugin/index.cjs +10504 -0
  72. package/dist/plugin/index.mjs +10492 -0
  73. package/package.json +24 -43
  74. package/lib/index.qwik.cjs +0 -4
  75. package/lib/index.qwik.mjs +0 -4
  76. package/lib/kit/context.qwik.cjs +0 -16
  77. package/lib/kit/context.qwik.mjs +0 -16
  78. package/lib/kit/globals.qwik.cjs +0 -6
  79. package/lib/kit/globals.qwik.mjs +0 -6
  80. package/lib/kit/server.qwik.cjs +0 -18
  81. package/lib/kit/server.qwik.mjs +0 -18
  82. package/lib/plugin/assets/index.qwik.cjs +0 -67
  83. package/lib/plugin/assets/index.qwik.mjs +0 -67
  84. package/lib/plugin/index.qwik.cjs +0 -49
  85. package/lib/plugin/index.qwik.mjs +0 -49
  86. package/lib/plugin/npm/index.qwik.cjs +0 -19
  87. package/lib/plugin/npm/index.qwik.mjs +0 -19
  88. package/lib/plugin/routes/index.qwik.cjs +0 -17
  89. package/lib/plugin/routes/index.qwik.mjs +0 -17
  90. package/lib/plugin/rpc/index.qwik.cjs +0 -14
  91. package/lib/plugin/rpc/index.qwik.mjs +0 -14
  92. package/lib-types/index.d.ts +0 -1
  93. package/lib-types/plugin/assets/index.d.ts +0 -5
  94. package/lib-types/plugin/components/index.d.ts +0 -0
  95. package/lib-types/plugin/index.d.ts +0 -2
  96. package/lib-types/plugin/npm/index.d.ts +0 -5
  97. package/lib-types/plugin/routes/index.d.ts +0 -5
  98. package/lib-types/plugin/rpc/index.d.ts +0 -3
  99. package/lib-types/plugin/types/index.d.ts +0 -5
  100. package/src/devtools.css +0 -558
  101. package/src/devtools.tsx +0 -411
  102. package/src/entry.dev.tsx +0 -17
  103. package/src/entry.ssr.tsx +0 -25
  104. package/src/index.ts +0 -1
  105. package/src/kit/client.ts +0 -21
  106. package/src/kit/constants.ts +0 -1
  107. package/src/kit/context.ts +0 -42
  108. package/src/kit/globals.ts +0 -22
  109. package/src/kit/index.ts +0 -4
  110. package/src/kit/server.ts +0 -21
  111. package/src/kit/shared.ts +0 -11
  112. package/src/kit/types.ts +0 -48
  113. package/src/plugin/assets/index.ts +0 -126
  114. package/src/plugin/components/index.ts +0 -0
  115. package/src/plugin/index.ts +0 -50
  116. package/src/plugin/npm/index.ts +0 -24
  117. package/src/plugin/routes/index.ts +0 -16
  118. package/src/plugin/rpc/index.ts +0 -14
  119. package/src/plugin/types/index.ts +0 -6
  120. package/src/root.tsx +0 -15
  121. /package/{lib-types → dist/component/lib-types/devtools/src}/devtools.d.ts +0 -0
  122. /package/{lib-types → dist/component/lib-types/devtools/src}/entry.dev.d.ts +0 -0
  123. /package/{lib-types → dist/component/lib-types/devtools/src}/entry.ssr.d.ts +0 -0
  124. /package/{lib-types → dist/component/lib-types/devtools/src}/root.d.ts +0 -0
  125. /package/{lib-types/kit → dist/component/lib-types/kit/src}/client.d.ts +0 -0
  126. /package/{lib-types/kit → dist/component/lib-types/kit/src}/constants.d.ts +0 -0
  127. /package/{lib-types/kit → dist/component/lib-types/kit/src}/context.d.ts +0 -0
  128. /package/{lib-types/kit → dist/component/lib-types/kit/src}/globals.d.ts +0 -0
  129. /package/{lib-types/kit → dist/component/lib-types/kit/src}/index.d.ts +0 -0
  130. /package/{lib-types/kit → dist/component/lib-types/kit/src}/server.d.ts +0 -0
  131. /package/{lib-types/kit → dist/component/lib-types/kit/src}/shared.d.ts +0 -0
  132. /package/{lib-types/kit → dist/component/lib-types/kit/src}/types.d.ts +0 -0
  133. /package/{lib/kit → dist/component/packages/kit/src}/constants.qwik.cjs +0 -0
  134. /package/{lib/kit → dist/component/packages/kit/src}/constants.qwik.mjs +0 -0
  135. /package/{lib/kit → dist/component/packages/kit/src}/shared.qwik.cjs +0 -0
  136. /package/{lib/kit → dist/component/packages/kit/src}/shared.qwik.mjs +0 -0
@@ -1,126 +0,0 @@
1
- import fsp from 'node:fs/promises';
2
- import fg from 'fast-glob';
3
- import { resolve, relative, join } from 'node:path/posix';
4
- import { ServerContext } from '../types';
5
- import { AssetType, AssetInfo } from '../../kit/types';
6
-
7
- // const defaultAllowedExtensions = [
8
- // 'png',
9
- // 'jpg',
10
- // 'jpeg',
11
- // 'gif',
12
- // 'svg',
13
- // 'webp',
14
- // 'ico',
15
- // 'mp4',
16
- // 'ogg',
17
- // 'mp3',
18
- // 'wav',
19
- // 'mov',
20
- // 'mkv',
21
- // 'mpg',
22
- // 'txt',
23
- // 'ttf',
24
- // 'woff',
25
- // 'woff2',
26
- // 'eot',
27
- // 'json',
28
- // 'js',
29
- // 'jsx',
30
- // 'ts',
31
- // 'tsx',
32
- // 'md',
33
- // 'mdx',
34
- // 'vue',
35
- // 'webm',
36
- // ];
37
-
38
- export function getAssetsFunctions({ config }: ServerContext) {
39
- let cache: AssetInfo[] | null = null;
40
-
41
- async function getAssetsFromPublicDir() {
42
- const dir = resolve(config.root);
43
- const baseURL = config.base;
44
-
45
- // publicDir in ResolvedConfig is an absolute path
46
- const publicDir = config.publicDir;
47
- const relativePublicDir =
48
- publicDir === '' ? '' : `${relative(dir, publicDir)}/`;
49
-
50
- const files = await fg(
51
- [
52
- // image
53
- '**/*.(png|jpg|jpeg|gif|svg|webp|avif|ico|bmp|tiff)',
54
- // video
55
- '**/*.(mp4|webm|ogv|mov|avi|flv|wmv|mpg|mpeg|mkv|3gp|3g2|m2ts|vob|ogm|ogx|rm|rmvb|asf|amv|divx|m4v|svi|viv|f4v|f4p|f4a|f4b)',
56
- // audio
57
- '**/*.(mp3|wav|ogg|flac|aac|wma|alac|ape|ac3|dts|tta|opus|amr|aiff|au|mid|midi|ra|rm|wv|weba|dss|spx|vox|tak|dsf|dff|dsd|cda)',
58
- // font
59
- '**/*.(woff2?|eot|ttf|otf|ttc|pfa|pfb|pfm|afm)',
60
- // text
61
- '**/*.(json|json5|jsonc|txt|text|tsx|jsx|md|mdx|mdc|markdown|yaml|yml|toml)',
62
- // wasm
63
- '**/*.wasm',
64
- ],
65
- {
66
- cwd: publicDir,
67
- onlyFiles: true,
68
- caseSensitiveMatch: false,
69
- ignore: [
70
- '**/node_modules/**',
71
- '**/dist/**',
72
- '**/package-lock.*',
73
- '**/pnpm-lock.*',
74
- '**/pnpm-workspace.*',
75
- ],
76
- },
77
- );
78
-
79
- cache = await Promise.all(
80
- files.map(async (relativePath) => {
81
- const filePath = resolve(publicDir, relativePath);
82
- const stat = await fsp.lstat(filePath);
83
- // remove public prefix to resolve vite assets warning
84
- const path = relativePath.replace(relativePublicDir, '');
85
- return {
86
- path,
87
- relativePath,
88
- publicPath: join(baseURL, path),
89
- filePath,
90
- type: guessType(relativePath),
91
- size: stat.size,
92
- mtime: stat.mtimeMs,
93
- };
94
- }),
95
- );
96
- return cache;
97
- }
98
-
99
- return {
100
- getAssetsFromPublicDir,
101
- };
102
- }
103
-
104
- function guessType(path: string): AssetType {
105
- if (/\.(?:png|jpe?g|jxl|gif|svg|webp|avif|ico|bmp|tiff?)$/i.test(path))
106
- return 'image';
107
- if (
108
- /\.(?:mp4|webm|ogv|mov|avi|flv|wmv|mpg|mpeg|mkv|3gp|3g2|ts|mts|m2ts|vob|ogm|ogx|rm|rmvb|asf|amv|divx|m4v|svi|viv|f4v|f4p|f4a|f4b)$/i.test(
109
- path,
110
- )
111
- )
112
- return 'video';
113
- if (
114
- /\.(?:mp3|wav|ogg|flac|aac|wma|alac|ape|ac3|dts|tta|opus|amr|aiff|au|mid|midi|ra|rm|wv|weba|dss|spx|vox|tak|dsf|dff|dsd|cda)$/i.test(
115
- path,
116
- )
117
- )
118
- return 'audio';
119
- if (/\.(?:woff2?|eot|ttf|otf|ttc|pfa|pfb|pfm|afm)/i.test(path)) return 'font';
120
- if (
121
- /\.(?:json[5c]?|te?xt|[mc]?[jt]sx?|md[cx]?|markdown|ya?ml|toml)/i.test(path)
122
- )
123
- return 'text';
124
- if (/\.wasm/i.test(path)) return 'wasm';
125
- return 'other';
126
- }
File without changes
@@ -1,50 +0,0 @@
1
- import { ResolvedConfig, type Plugin } from 'vite';
2
- import { getServerFunctions } from './rpc';
3
- import { createServerRpc, setViteServerContext } from '../kit';
4
-
5
- export function qwikDevtools(): Plugin {
6
- let _config: ResolvedConfig;
7
- return {
8
- name: 'vite-plugin-qwik-devtools',
9
- apply: 'serve',
10
- configResolved(viteConfig) {
11
- _config = viteConfig;
12
- },
13
- transform: {
14
- order: 'pre',
15
- handler(code, id) {
16
- // Only transform the root component file
17
- if (id.endsWith('root.tsx')) {
18
- // Check if QwikDevtools import already exists
19
- if (!code.includes('@qwik.dev/devtools/component')) {
20
- // Add import for QwikDevtools using the correct package name
21
- code = `import { QwikDevtools } from '@qwik.dev/devtools/component';\n${code}`;
22
- }
23
-
24
- // Find the closing body tag and inject the QwikDevtools component before it
25
- const match = code.match(/<body[^>]*>([\s\S]*?)<\/body>/);
26
- if (match) {
27
- const bodyContent = match[1];
28
- const newBodyContent = bodyContent.replace(
29
- /{!isDev && <ServiceWorkerRegister \/>}/,
30
- `{!isDev && <ServiceWorkerRegister />}\n {isDev && <QwikDevtools />}`,
31
- );
32
- code = code.replace(bodyContent, newBodyContent);
33
- }
34
-
35
- return {
36
- code,
37
- map: null,
38
- };
39
- }
40
- },
41
- },
42
- configureServer(server) {
43
- setViteServerContext(server);
44
-
45
- const rpcFunctions = getServerFunctions({ server, config: _config });
46
-
47
- createServerRpc(rpcFunctions);
48
- },
49
- };
50
- }
@@ -1,24 +0,0 @@
1
- import { ServerContext } from '../types';
2
- import fsp from 'node:fs/promises';
3
- import { NpmInfo } from '../../kit/types';
4
-
5
- export function getNpmFunctions({ config }: ServerContext) {
6
- return {
7
- async getQwikPackages(): Promise<NpmInfo> {
8
- const pathToPackageJson = config.configFileDependencies.find((file) =>
9
- file.endsWith('package.json'),
10
- );
11
- if (!pathToPackageJson) return [];
12
-
13
- try {
14
- const pkgJson = await fsp.readFile(pathToPackageJson, 'utf-8');
15
- const pkg = JSON.parse(pkgJson);
16
- return Object.entries<string>(pkg.devDependencies).filter(([key]) =>
17
- /@qwik/i.test(key),
18
- );
19
- } catch (error) {
20
- return [];
21
- }
22
- },
23
- };
24
- }
@@ -1,16 +0,0 @@
1
- import { RoutesInfo } from '../../kit/types';
2
- import { ServerContext } from '../types';
3
- import { scanAsync } from 'dree';
4
-
5
- export function getRouteFunctions({ config }: ServerContext) {
6
- const routesDir = `${config.root}/src/routes`;
7
- return {
8
- getRoutes: async (): Promise<RoutesInfo> => {
9
- const routes = await scanAsync(routesDir, {
10
- extensions: ['tsx'],
11
- });
12
-
13
- return routes;
14
- },
15
- };
16
- }
@@ -1,14 +0,0 @@
1
- import { ServerFunctions } from '../../kit/types';
2
- import { getAssetsFunctions } from '../assets';
3
- import { ServerContext } from '../types';
4
- import { getRouteFunctions } from '../routes';
5
- import { getNpmFunctions } from '../npm';
6
-
7
- export function getServerFunctions(ctx: ServerContext): ServerFunctions {
8
- return {
9
- healthCheck: () => true,
10
- ...getAssetsFunctions(ctx),
11
- ...getRouteFunctions(ctx),
12
- ...getNpmFunctions(ctx),
13
- };
14
- }
@@ -1,6 +0,0 @@
1
- import { ViteDevServer, ResolvedConfig } from 'vite';
2
-
3
- export interface ServerContext {
4
- server: ViteDevServer;
5
- config: ResolvedConfig;
6
- }
package/src/root.tsx DELETED
@@ -1,15 +0,0 @@
1
- import { QwikDevtools } from './devtools';
2
-
3
- export default () => {
4
- return (
5
- <>
6
- <head>
7
- <meta charset="utf-8" />
8
- <title>Qwik Blank App</title>
9
- </head>
10
- <body>
11
- <QwikDevtools />
12
- </body>
13
- </>
14
- );
15
- };