@qwik.dev/devtools 0.0.3 → 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 (134) 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/{lib → dist/component}/devtools.qwik.cjs +19 -20
  6. package/{lib → dist/component}/devtools.qwik.mjs +11 -12
  7. package/{lib → dist/component}/index.qwik.cjs +0 -2
  8. package/dist/component/index.qwik.mjs +4 -0
  9. package/{lib-types → dist/component/lib-types/devtools/src}/index.d.ts +0 -1
  10. 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
  11. 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
  12. 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
  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/lu.qwik.qwik.mjs +32 -0
  14. package/dist/component/node_modules/.pnpm/balanced-match@1.0.2/node_modules/balanced-match/index.qwik.cjs +54 -0
  15. package/dist/component/node_modules/.pnpm/balanced-match@1.0.2/node_modules/balanced-match/index.qwik.mjs +54 -0
  16. package/dist/component/node_modules/.pnpm/birpc@0.2.19/node_modules/birpc/dist/index.qwik.cjs +128 -0
  17. package/dist/component/node_modules/.pnpm/birpc@0.2.19/node_modules/birpc/dist/index.qwik.mjs +128 -0
  18. package/dist/component/node_modules/.pnpm/brace-expansion@2.0.1/node_modules/brace-expansion/index.qwik.cjs +149 -0
  19. package/dist/component/node_modules/.pnpm/brace-expansion@2.0.1/node_modules/brace-expansion/index.qwik.mjs +150 -0
  20. package/dist/component/node_modules/.pnpm/copy-anything@3.0.5/node_modules/copy-anything/dist/index.qwik.cjs +36 -0
  21. package/dist/component/node_modules/.pnpm/copy-anything@3.0.5/node_modules/copy-anything/dist/index.qwik.mjs +36 -0
  22. package/dist/component/node_modules/.pnpm/dree@5.1.5/node_modules/dree/bundled/lib/esm/index.esm.qwik.cjs +12 -0
  23. package/dist/component/node_modules/.pnpm/dree@5.1.5/node_modules/dree/bundled/lib/esm/index.esm.qwik.mjs +12 -0
  24. package/dist/component/node_modules/.pnpm/is-what@4.1.16/node_modules/is-what/dist/index.qwik.cjs +17 -0
  25. package/dist/component/node_modules/.pnpm/is-what@4.1.16/node_modules/is-what/dist/index.qwik.mjs +17 -0
  26. package/dist/component/node_modules/.pnpm/minimatch@10.0.1/node_modules/minimatch/dist/esm/assert-valid-pattern.qwik.cjs +12 -0
  27. package/dist/component/node_modules/.pnpm/minimatch@10.0.1/node_modules/minimatch/dist/esm/assert-valid-pattern.qwik.mjs +12 -0
  28. package/dist/component/node_modules/.pnpm/minimatch@10.0.1/node_modules/minimatch/dist/esm/ast.qwik.cjs +513 -0
  29. package/dist/component/node_modules/.pnpm/minimatch@10.0.1/node_modules/minimatch/dist/esm/ast.qwik.mjs +513 -0
  30. package/dist/component/node_modules/.pnpm/minimatch@10.0.1/node_modules/minimatch/dist/esm/brace-expressions.qwik.cjs +110 -0
  31. package/dist/component/node_modules/.pnpm/minimatch@10.0.1/node_modules/minimatch/dist/esm/brace-expressions.qwik.mjs +110 -0
  32. package/dist/component/node_modules/.pnpm/minimatch@10.0.1/node_modules/minimatch/dist/esm/escape.qwik.cjs +6 -0
  33. package/dist/component/node_modules/.pnpm/minimatch@10.0.1/node_modules/minimatch/dist/esm/escape.qwik.mjs +6 -0
  34. package/dist/component/node_modules/.pnpm/minimatch@10.0.1/node_modules/minimatch/dist/esm/index.qwik.cjs +738 -0
  35. package/dist/component/node_modules/.pnpm/minimatch@10.0.1/node_modules/minimatch/dist/esm/index.qwik.mjs +738 -0
  36. package/dist/component/node_modules/.pnpm/minimatch@10.0.1/node_modules/minimatch/dist/esm/unescape.qwik.cjs +6 -0
  37. package/dist/component/node_modules/.pnpm/minimatch@10.0.1/node_modules/minimatch/dist/esm/unescape.qwik.mjs +6 -0
  38. package/dist/component/node_modules/.pnpm/superjson@2.2.2/node_modules/superjson/dist/accessDeep.qwik.cjs +120 -0
  39. package/dist/component/node_modules/.pnpm/superjson@2.2.2/node_modules/superjson/dist/accessDeep.qwik.mjs +120 -0
  40. package/dist/component/node_modules/.pnpm/superjson@2.2.2/node_modules/superjson/dist/class-registry.qwik.cjs +23 -0
  41. package/dist/component/node_modules/.pnpm/superjson@2.2.2/node_modules/superjson/dist/class-registry.qwik.mjs +23 -0
  42. package/dist/component/node_modules/.pnpm/superjson@2.2.2/node_modules/superjson/dist/custom-transformer-registry.qwik.cjs +18 -0
  43. package/dist/component/node_modules/.pnpm/superjson@2.2.2/node_modules/superjson/dist/custom-transformer-registry.qwik.mjs +18 -0
  44. package/dist/component/node_modules/.pnpm/superjson@2.2.2/node_modules/superjson/dist/double-indexed-kv.qwik.cjs +23 -0
  45. package/dist/component/node_modules/.pnpm/superjson@2.2.2/node_modules/superjson/dist/double-indexed-kv.qwik.mjs +23 -0
  46. package/dist/component/node_modules/.pnpm/superjson@2.2.2/node_modules/superjson/dist/index.qwik.cjs +91 -0
  47. package/dist/component/node_modules/.pnpm/superjson@2.2.2/node_modules/superjson/dist/index.qwik.mjs +91 -0
  48. package/dist/component/node_modules/.pnpm/superjson@2.2.2/node_modules/superjson/dist/is.qwik.cjs +51 -0
  49. package/dist/component/node_modules/.pnpm/superjson@2.2.2/node_modules/superjson/dist/is.qwik.mjs +51 -0
  50. package/dist/component/node_modules/.pnpm/superjson@2.2.2/node_modules/superjson/dist/pathstringifier.qwik.cjs +30 -0
  51. package/dist/component/node_modules/.pnpm/superjson@2.2.2/node_modules/superjson/dist/pathstringifier.qwik.mjs +30 -0
  52. package/dist/component/node_modules/.pnpm/superjson@2.2.2/node_modules/superjson/dist/plainer.qwik.cjs +148 -0
  53. package/dist/component/node_modules/.pnpm/superjson@2.2.2/node_modules/superjson/dist/plainer.qwik.mjs +148 -0
  54. package/dist/component/node_modules/.pnpm/superjson@2.2.2/node_modules/superjson/dist/registry.qwik.cjs +28 -0
  55. package/dist/component/node_modules/.pnpm/superjson@2.2.2/node_modules/superjson/dist/registry.qwik.mjs +28 -0
  56. package/dist/component/node_modules/.pnpm/superjson@2.2.2/node_modules/superjson/dist/transformer.qwik.cjs +203 -0
  57. package/dist/component/node_modules/.pnpm/superjson@2.2.2/node_modules/superjson/dist/transformer.qwik.mjs +203 -0
  58. package/dist/component/node_modules/.pnpm/superjson@2.2.2/node_modules/superjson/dist/util.qwik.cjs +47 -0
  59. package/dist/component/node_modules/.pnpm/superjson@2.2.2/node_modules/superjson/dist/util.qwik.mjs +47 -0
  60. 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
  61. 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
  62. package/{lib/kit → dist/component/packages/kit/src}/client.qwik.cjs +5 -5
  63. package/{lib/kit → dist/component/packages/kit/src}/client.qwik.mjs +2 -2
  64. package/{lib/kit → dist/component/packages/kit/src}/context.qwik.cjs +0 -12
  65. package/{lib/kit → dist/component/packages/kit/src}/context.qwik.mjs +2 -14
  66. package/{lib/kit → dist/component/packages/kit/src}/globals.qwik.cjs +0 -4
  67. package/dist/component/packages/kit/src/globals.qwik.mjs +6 -0
  68. package/dist/plugin/index.cjs +10504 -0
  69. package/dist/plugin/index.mjs +10492 -0
  70. package/package.json +26 -41
  71. package/lib/index.qwik.mjs +0 -6
  72. package/lib/kit/globals.qwik.mjs +0 -10
  73. package/lib/kit/server.qwik.cjs +0 -18
  74. package/lib/kit/server.qwik.mjs +0 -18
  75. package/lib/plugin/assets/index.qwik.cjs +0 -67
  76. package/lib/plugin/assets/index.qwik.mjs +0 -67
  77. package/lib/plugin/index.qwik.cjs +0 -49
  78. package/lib/plugin/index.qwik.mjs +0 -49
  79. package/lib/plugin/npm/index.qwik.cjs +0 -19
  80. package/lib/plugin/npm/index.qwik.mjs +0 -19
  81. package/lib/plugin/routes/index.qwik.cjs +0 -17
  82. package/lib/plugin/routes/index.qwik.mjs +0 -17
  83. package/lib/plugin/rpc/index.qwik.cjs +0 -14
  84. package/lib/plugin/rpc/index.qwik.mjs +0 -14
  85. package/lib/utils/location.qwik.cjs +0 -9
  86. package/lib/utils/location.qwik.mjs +0 -9
  87. package/lib-types/plugin/assets/index.d.ts +0 -5
  88. package/lib-types/plugin/components/index.d.ts +0 -0
  89. package/lib-types/plugin/index.d.ts +0 -2
  90. package/lib-types/plugin/npm/index.d.ts +0 -5
  91. package/lib-types/plugin/routes/index.d.ts +0 -5
  92. package/lib-types/plugin/rpc/index.d.ts +0 -3
  93. package/lib-types/plugin/types/index.d.ts +0 -5
  94. package/src/devtools.css +0 -558
  95. package/src/devtools.tsx +0 -404
  96. package/src/entry.dev.tsx +0 -17
  97. package/src/entry.ssr.tsx +0 -25
  98. package/src/index.ts +0 -2
  99. package/src/kit/client.ts +0 -21
  100. package/src/kit/constants.ts +0 -1
  101. package/src/kit/context.ts +0 -42
  102. package/src/kit/globals.ts +0 -22
  103. package/src/kit/index.ts +0 -4
  104. package/src/kit/server.ts +0 -21
  105. package/src/kit/shared.ts +0 -11
  106. package/src/kit/types.ts +0 -48
  107. package/src/plugin/assets/index.ts +0 -126
  108. package/src/plugin/components/index.ts +0 -0
  109. package/src/plugin/index.ts +0 -50
  110. package/src/plugin/npm/index.ts +0 -24
  111. package/src/plugin/routes/index.ts +0 -16
  112. package/src/plugin/rpc/index.ts +0 -14
  113. package/src/plugin/types/index.ts +0 -6
  114. package/src/root.tsx +0 -15
  115. package/src/utils/location.ts +0 -9
  116. /package/{lib → dist/component}/devtools.css.qwik.cjs +0 -0
  117. /package/{lib → dist/component}/devtools.css.qwik.mjs +0 -0
  118. /package/{lib-types → dist/component/lib-types/devtools/src}/devtools.d.ts +0 -0
  119. /package/{lib-types → dist/component/lib-types/devtools/src}/entry.dev.d.ts +0 -0
  120. /package/{lib-types → dist/component/lib-types/devtools/src}/entry.ssr.d.ts +0 -0
  121. /package/{lib-types → dist/component/lib-types/devtools/src}/root.d.ts +0 -0
  122. /package/{lib-types → dist/component/lib-types/devtools/src}/utils/location.d.ts +0 -0
  123. /package/{lib-types/kit → dist/component/lib-types/kit/src}/client.d.ts +0 -0
  124. /package/{lib-types/kit → dist/component/lib-types/kit/src}/constants.d.ts +0 -0
  125. /package/{lib-types/kit → dist/component/lib-types/kit/src}/context.d.ts +0 -0
  126. /package/{lib-types/kit → dist/component/lib-types/kit/src}/globals.d.ts +0 -0
  127. /package/{lib-types/kit → dist/component/lib-types/kit/src}/index.d.ts +0 -0
  128. /package/{lib-types/kit → dist/component/lib-types/kit/src}/server.d.ts +0 -0
  129. /package/{lib-types/kit → dist/component/lib-types/kit/src}/shared.d.ts +0 -0
  130. /package/{lib-types/kit → dist/component/lib-types/kit/src}/types.d.ts +0 -0
  131. /package/{lib/kit → dist/component/packages/kit/src}/constants.qwik.cjs +0 -0
  132. /package/{lib/kit → dist/component/packages/kit/src}/constants.qwik.mjs +0 -0
  133. /package/{lib/kit → dist/component/packages/kit/src}/shared.qwik.cjs +0 -0
  134. /package/{lib/kit → dist/component/packages/kit/src}/shared.qwik.mjs +0 -0
package/package.json CHANGED
@@ -1,64 +1,49 @@
1
1
  {
2
2
  "name": "@qwik.dev/devtools",
3
- "version": "0.0.3",
3
+ "version": "0.0.4",
4
+ "license": "MIT",
5
+ "main": "./dist/plugin/index.mjs",
4
6
  "description": "Qwik devtools package",
5
- "main": "./lib/index.qwik.mjs",
7
+ "qwik": "./dist/component/index.qwik.mjs",
6
8
  "exports": {
7
9
  ".": {
8
- "import": "./lib/index.qwik.mjs"
10
+ "import": "./dist/plugin/index.mjs",
11
+ "types": "./dist/plugin/index.d.ts"
12
+ },
13
+ "./component": {
14
+ "import": "./dist/component/index.qwik.mjs",
15
+ "require": "./dist/component/index.qwik.cjs",
16
+ "types": "./dist/component/lib-types/index.d.ts"
9
17
  }
10
18
  },
11
19
  "files": [
12
- "src",
13
- "lib",
14
- "lib-types"
20
+ "dist/**"
15
21
  ],
16
- "engines": {
17
- "node": "^18.17.0 || ^20.3.0 || >=21.0.0"
18
- },
19
- "private": false,
20
- "type": "module",
21
22
  "scripts": {
22
- "build": "qwik build",
23
- "build.lib": "vite build --mode lib",
24
- "build.types": "tsc --emitDeclarationOnly",
25
- "dev:ssr": "vite --mode ssr",
26
- "dev": "nodemon --watch src -e tsx,ts,css --exec 'npm run build.lib'",
27
- "dev.debug": "node --inspect-brk ./node_modules/vite/bin/vite.js --mode ssr --force",
28
- "fmt": "prettier --write .",
29
- "fmt.check": "prettier --check .",
30
- "lint": "eslint \"src/**/*.ts*\"",
31
- "release": "np",
32
- "start": "vite --open --mode ssr",
33
- "test": "echo \"No test specified\" && exit 0",
34
- "qwik": "qwik"
23
+ "playground": "pnpm --filter playground dev",
24
+ "build": "tsx scripts/build-devtools.ts"
35
25
  },
36
26
  "peerDependencies": {
27
+ "vite": "^6.0.7",
37
28
  "@qwik.dev/core": "^2.0.0-alpha.4",
38
- "vite": "^6.0.0"
29
+ "@qwik.dev/router": "^2.0.0-alpha.4"
39
30
  },
40
31
  "dependencies": {
41
- "image-meta": "^0.2.1",
42
32
  "birpc": "^0.2.19",
43
- "perfect-debounce": "^1.0.0",
44
- "fast-glob": "^3.3.2",
45
33
  "superjson": "^2.2.2",
46
34
  "dree": "^5.1.5",
47
35
  "@qwikest/icons": "^0.0.13",
48
36
  "vite-hot-client": "^0.2.4"
49
37
  },
50
38
  "devDependencies": {
51
- "@types/eslint": "8.56.10",
52
- "@types/node": "20.14.11",
53
- "@typescript-eslint/eslint-plugin": "7.16.1",
54
- "@typescript-eslint/parser": "7.16.1",
55
- "eslint": "8.57.0",
56
- "eslint-plugin-qwik": "2.0.0-alpha.3",
57
- "np": "^8.0.4",
58
- "prettier": "3.3.3",
59
- "typescript": "5.4.5",
60
- "vite": "5.4.10",
61
- "vite-tsconfig-paths": "^4.2.1",
62
- "cpy-cli": "^5.0.0"
63
- }
39
+ "tsx": "^4.19.2",
40
+ "@types/node": "^22.10.5"
41
+ },
42
+ "private": false,
43
+ "keywords": [
44
+ "qwik",
45
+ "devtools",
46
+ "plugin"
47
+ ],
48
+ "packageManager": "pnpm@9.15.3+sha512.1f79bc245a66eb0b07c5d4d83131240774642caaa86ef7d0434ab47c0d16f66b04e21e0c086eb61e62c77efc4d7f7ec071afad3796af64892fae66509173893a"
64
49
  }
@@ -1,6 +0,0 @@
1
- import { qwikDevtools } from "./plugin/index.qwik.mjs";
2
- import { QwikDevtools } from "./devtools.qwik.mjs";
3
- export {
4
- QwikDevtools,
5
- qwikDevtools
6
- };
@@ -1,10 +0,0 @@
1
- const CLIENT_CTX = "__qwik_client_ctx__";
2
- const SERVER_CTX = "__qwik_server_ctx__";
3
- const SERVER_RPC = "__qwik_server_rpc__";
4
- const CLIENT_RPC = "__qwik_client_rpc__";
5
- export {
6
- CLIENT_CTX,
7
- CLIENT_RPC,
8
- SERVER_CTX,
9
- SERVER_RPC
10
- };
@@ -1,18 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
3
- const SuperJSON = require("superjson");
4
- const birpc = require("birpc");
5
- const constants = require("./constants.qwik.cjs");
6
- const context = require("./context.qwik.cjs");
7
- function createServerRpc(functions) {
8
- const server = context.getViteServerContext();
9
- const rpc = birpc.createBirpc(functions, {
10
- post: (data) => server.ws.send(constants.DEVTOOLS_VITE_MESSAGING_EVENT, SuperJSON.stringify(data)),
11
- on: (fn) => server.ws.on(constants.DEVTOOLS_VITE_MESSAGING_EVENT, (data) => {
12
- fn(SuperJSON.parse(data));
13
- }),
14
- timeout: 12e4
15
- });
16
- context.setViteServerRpc(rpc);
17
- }
18
- exports.createServerRpc = createServerRpc;
@@ -1,18 +0,0 @@
1
- import SuperJSON from "superjson";
2
- import { createBirpc } from "birpc";
3
- import { DEVTOOLS_VITE_MESSAGING_EVENT } from "./constants.qwik.mjs";
4
- import { setViteServerRpc, getViteServerContext } from "./context.qwik.mjs";
5
- function createServerRpc(functions) {
6
- const server = getViteServerContext();
7
- const rpc = createBirpc(functions, {
8
- post: (data) => server.ws.send(DEVTOOLS_VITE_MESSAGING_EVENT, SuperJSON.stringify(data)),
9
- on: (fn) => server.ws.on(DEVTOOLS_VITE_MESSAGING_EVENT, (data) => {
10
- fn(SuperJSON.parse(data));
11
- }),
12
- timeout: 12e4
13
- });
14
- setViteServerRpc(rpc);
15
- }
16
- export {
17
- createServerRpc
18
- };
@@ -1,67 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
3
- const fsp = require("node:fs/promises");
4
- const fg = require("fast-glob");
5
- const posix = require("node:path/posix");
6
- function getAssetsFunctions({ config }) {
7
- let cache = null;
8
- async function getAssetsFromPublicDir() {
9
- const dir = posix.resolve(config.root);
10
- const baseURL = config.base;
11
- const publicDir = config.publicDir;
12
- const relativePublicDir = publicDir === "" ? "" : `${posix.relative(dir, publicDir)}/`;
13
- const files = await fg([
14
- // image
15
- "**/*.(png|jpg|jpeg|gif|svg|webp|avif|ico|bmp|tiff)",
16
- // video
17
- "**/*.(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)",
18
- // audio
19
- "**/*.(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)",
20
- // font
21
- "**/*.(woff2?|eot|ttf|otf|ttc|pfa|pfb|pfm|afm)",
22
- // text
23
- "**/*.(json|json5|jsonc|txt|text|tsx|jsx|md|mdx|mdc|markdown|yaml|yml|toml)",
24
- // wasm
25
- "**/*.wasm"
26
- ], {
27
- cwd: publicDir,
28
- onlyFiles: true,
29
- caseSensitiveMatch: false,
30
- ignore: [
31
- "**/node_modules/**",
32
- "**/dist/**",
33
- "**/package-lock.*",
34
- "**/pnpm-lock.*",
35
- "**/pnpm-workspace.*"
36
- ]
37
- });
38
- cache = await Promise.all(files.map(async (relativePath) => {
39
- const filePath = posix.resolve(publicDir, relativePath);
40
- const stat = await fsp.lstat(filePath);
41
- const path = relativePath.replace(relativePublicDir, "");
42
- return {
43
- path,
44
- relativePath,
45
- publicPath: posix.join(baseURL, path),
46
- filePath,
47
- type: guessType(relativePath),
48
- size: stat.size,
49
- mtime: stat.mtimeMs
50
- };
51
- }));
52
- return cache;
53
- }
54
- return {
55
- getAssetsFromPublicDir
56
- };
57
- }
58
- function guessType(path) {
59
- if (/\.(?:png|jpe?g|jxl|gif|svg|webp|avif|ico|bmp|tiff?)$/i.test(path)) return "image";
60
- if (/\.(?: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(path)) return "video";
61
- if (/\.(?: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(path)) return "audio";
62
- if (/\.(?:woff2?|eot|ttf|otf|ttc|pfa|pfb|pfm|afm)/i.test(path)) return "font";
63
- if (/\.(?:json[5c]?|te?xt|[mc]?[jt]sx?|md[cx]?|markdown|ya?ml|toml)/i.test(path)) return "text";
64
- if (/\.wasm/i.test(path)) return "wasm";
65
- return "other";
66
- }
67
- exports.getAssetsFunctions = getAssetsFunctions;
@@ -1,67 +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
- function getAssetsFunctions({ config }) {
5
- let cache = null;
6
- async function getAssetsFromPublicDir() {
7
- const dir = resolve(config.root);
8
- const baseURL = config.base;
9
- const publicDir = config.publicDir;
10
- const relativePublicDir = publicDir === "" ? "" : `${relative(dir, publicDir)}/`;
11
- const files = await fg([
12
- // image
13
- "**/*.(png|jpg|jpeg|gif|svg|webp|avif|ico|bmp|tiff)",
14
- // video
15
- "**/*.(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)",
16
- // audio
17
- "**/*.(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)",
18
- // font
19
- "**/*.(woff2?|eot|ttf|otf|ttc|pfa|pfb|pfm|afm)",
20
- // text
21
- "**/*.(json|json5|jsonc|txt|text|tsx|jsx|md|mdx|mdc|markdown|yaml|yml|toml)",
22
- // wasm
23
- "**/*.wasm"
24
- ], {
25
- cwd: publicDir,
26
- onlyFiles: true,
27
- caseSensitiveMatch: false,
28
- ignore: [
29
- "**/node_modules/**",
30
- "**/dist/**",
31
- "**/package-lock.*",
32
- "**/pnpm-lock.*",
33
- "**/pnpm-workspace.*"
34
- ]
35
- });
36
- cache = await Promise.all(files.map(async (relativePath) => {
37
- const filePath = resolve(publicDir, relativePath);
38
- const stat = await fsp.lstat(filePath);
39
- const path = relativePath.replace(relativePublicDir, "");
40
- return {
41
- path,
42
- relativePath,
43
- publicPath: join(baseURL, path),
44
- filePath,
45
- type: guessType(relativePath),
46
- size: stat.size,
47
- mtime: stat.mtimeMs
48
- };
49
- }));
50
- return cache;
51
- }
52
- return {
53
- getAssetsFromPublicDir
54
- };
55
- }
56
- function guessType(path) {
57
- if (/\.(?:png|jpe?g|jxl|gif|svg|webp|avif|ico|bmp|tiff?)$/i.test(path)) return "image";
58
- if (/\.(?: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(path)) return "video";
59
- if (/\.(?: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(path)) return "audio";
60
- if (/\.(?:woff2?|eot|ttf|otf|ttc|pfa|pfb|pfm|afm)/i.test(path)) return "font";
61
- if (/\.(?:json[5c]?|te?xt|[mc]?[jt]sx?|md[cx]?|markdown|ya?ml|toml)/i.test(path)) return "text";
62
- if (/\.wasm/i.test(path)) return "wasm";
63
- return "other";
64
- }
65
- export {
66
- getAssetsFunctions
67
- };
@@ -1,49 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
3
- const index = require("./rpc/index.qwik.cjs");
4
- require("superjson");
5
- require("birpc");
6
- const context = require("../kit/context.qwik.cjs");
7
- const server = require("../kit/server.qwik.cjs");
8
- require("dree");
9
- function qwikDevtools() {
10
- let _config;
11
- return {
12
- name: "vite-plugin-qwik-devtools",
13
- apply: "serve",
14
- configResolved(viteConfig) {
15
- _config = viteConfig;
16
- },
17
- transform: {
18
- order: "pre",
19
- handler(code, id) {
20
- if (id.endsWith("root.tsx")) {
21
- if (!code.includes("@qwik.dev/devtools")) {
22
- code = `import { QwikDevtools } from '@qwik.dev/devtools';
23
- ${code}`;
24
- }
25
- const match = code.match(/<body[^>]*>([\s\S]*?)<\/body>/);
26
- if (match) {
27
- const bodyContent = match[1];
28
- const newBodyContent = bodyContent.replace(/{!isDev && <ServiceWorkerRegister \/>}/, `{!isDev && <ServiceWorkerRegister />}
29
- {isDev && <QwikDevtools />}`);
30
- code = code.replace(bodyContent, newBodyContent);
31
- }
32
- return {
33
- code,
34
- map: null
35
- };
36
- }
37
- }
38
- },
39
- configureServer(server$1) {
40
- context.setViteServerContext(server$1);
41
- const rpcFunctions = index.getServerFunctions({
42
- server: server$1,
43
- config: _config
44
- });
45
- server.createServerRpc(rpcFunctions);
46
- }
47
- };
48
- }
49
- exports.qwikDevtools = qwikDevtools;
@@ -1,49 +0,0 @@
1
- import { getServerFunctions } from "./rpc/index.qwik.mjs";
2
- import "superjson";
3
- import "birpc";
4
- import { setViteServerContext } from "../kit/context.qwik.mjs";
5
- import { createServerRpc } from "../kit/server.qwik.mjs";
6
- import "dree";
7
- function qwikDevtools() {
8
- let _config;
9
- return {
10
- name: "vite-plugin-qwik-devtools",
11
- apply: "serve",
12
- configResolved(viteConfig) {
13
- _config = viteConfig;
14
- },
15
- transform: {
16
- order: "pre",
17
- handler(code, id) {
18
- if (id.endsWith("root.tsx")) {
19
- if (!code.includes("@qwik.dev/devtools")) {
20
- code = `import { QwikDevtools } from '@qwik.dev/devtools';
21
- ${code}`;
22
- }
23
- const match = code.match(/<body[^>]*>([\s\S]*?)<\/body>/);
24
- if (match) {
25
- const bodyContent = match[1];
26
- const newBodyContent = bodyContent.replace(/{!isDev && <ServiceWorkerRegister \/>}/, `{!isDev && <ServiceWorkerRegister />}
27
- {isDev && <QwikDevtools />}`);
28
- code = code.replace(bodyContent, newBodyContent);
29
- }
30
- return {
31
- code,
32
- map: null
33
- };
34
- }
35
- }
36
- },
37
- configureServer(server) {
38
- setViteServerContext(server);
39
- const rpcFunctions = getServerFunctions({
40
- server,
41
- config: _config
42
- });
43
- createServerRpc(rpcFunctions);
44
- }
45
- };
46
- }
47
- export {
48
- qwikDevtools
49
- };
@@ -1,19 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
3
- const fsp = require("node:fs/promises");
4
- function getNpmFunctions({ config }) {
5
- return {
6
- async getQwikPackages() {
7
- const pathToPackageJson = config.configFileDependencies.find((file) => file.endsWith("package.json"));
8
- if (!pathToPackageJson) return [];
9
- try {
10
- const pkgJson = await fsp.readFile(pathToPackageJson, "utf-8");
11
- const pkg = JSON.parse(pkgJson);
12
- return Object.entries(pkg.devDependencies).filter(([key]) => /@qwik/i.test(key));
13
- } catch (error) {
14
- return [];
15
- }
16
- }
17
- };
18
- }
19
- exports.getNpmFunctions = getNpmFunctions;
@@ -1,19 +0,0 @@
1
- import fsp from "node:fs/promises";
2
- function getNpmFunctions({ config }) {
3
- return {
4
- async getQwikPackages() {
5
- const pathToPackageJson = config.configFileDependencies.find((file) => file.endsWith("package.json"));
6
- if (!pathToPackageJson) return [];
7
- try {
8
- const pkgJson = await fsp.readFile(pathToPackageJson, "utf-8");
9
- const pkg = JSON.parse(pkgJson);
10
- return Object.entries(pkg.devDependencies).filter(([key]) => /@qwik/i.test(key));
11
- } catch (error) {
12
- return [];
13
- }
14
- }
15
- };
16
- }
17
- export {
18
- getNpmFunctions
19
- };
@@ -1,17 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
3
- const dree = require("dree");
4
- function getRouteFunctions({ config }) {
5
- const routesDir = `${config.root}/src/routes`;
6
- return {
7
- getRoutes: async () => {
8
- const routes = await dree.scanAsync(routesDir, {
9
- extensions: [
10
- "tsx"
11
- ]
12
- });
13
- return routes;
14
- }
15
- };
16
- }
17
- exports.getRouteFunctions = getRouteFunctions;
@@ -1,17 +0,0 @@
1
- import { scanAsync } from "dree";
2
- function getRouteFunctions({ config }) {
3
- const routesDir = `${config.root}/src/routes`;
4
- return {
5
- getRoutes: async () => {
6
- const routes = await scanAsync(routesDir, {
7
- extensions: [
8
- "tsx"
9
- ]
10
- });
11
- return routes;
12
- }
13
- };
14
- }
15
- export {
16
- getRouteFunctions
17
- };
@@ -1,14 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
3
- const index = require("../assets/index.qwik.cjs");
4
- const index$1 = require("../routes/index.qwik.cjs");
5
- const index$2 = require("../npm/index.qwik.cjs");
6
- function getServerFunctions(ctx) {
7
- return {
8
- healthCheck: () => true,
9
- ...index.getAssetsFunctions(ctx),
10
- ...index$1.getRouteFunctions(ctx),
11
- ...index$2.getNpmFunctions(ctx)
12
- };
13
- }
14
- exports.getServerFunctions = getServerFunctions;
@@ -1,14 +0,0 @@
1
- import { getAssetsFunctions } from "../assets/index.qwik.mjs";
2
- import { getRouteFunctions } from "../routes/index.qwik.mjs";
3
- import { getNpmFunctions } from "../npm/index.qwik.mjs";
4
- function getServerFunctions(ctx) {
5
- return {
6
- healthCheck: () => true,
7
- ...getAssetsFunctions(ctx),
8
- ...getRouteFunctions(ctx),
9
- ...getNpmFunctions(ctx)
10
- };
11
- }
12
- export {
13
- getServerFunctions
14
- };
@@ -1,9 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
3
- const core = require("@qwik.dev/core");
4
- function getCurrentLocation() {
5
- if (!core.isBrowser) return "";
6
- if (window.location.pathname === "/") return "/";
7
- return window.location.pathname.slice(0, -1);
8
- }
9
- exports.getCurrentLocation = getCurrentLocation;
@@ -1,9 +0,0 @@
1
- import { isBrowser } from "@qwik.dev/core";
2
- function getCurrentLocation() {
3
- if (!isBrowser) return "";
4
- if (window.location.pathname === "/") return "/";
5
- return window.location.pathname.slice(0, -1);
6
- }
7
- export {
8
- getCurrentLocation
9
- };
@@ -1,5 +0,0 @@
1
- import { ServerContext } from '../types';
2
- import { AssetInfo } from '../../kit/types';
3
- export declare function getAssetsFunctions({ config }: ServerContext): {
4
- getAssetsFromPublicDir: () => Promise<AssetInfo[]>;
5
- };
File without changes
@@ -1,2 +0,0 @@
1
- import { type Plugin } from 'vite';
2
- export declare function qwikDevtools(): Plugin;
@@ -1,5 +0,0 @@
1
- import { ServerContext } from '../types';
2
- import { NpmInfo } from '../../kit/types';
3
- export declare function getNpmFunctions({ config }: ServerContext): {
4
- getQwikPackages(): Promise<NpmInfo>;
5
- };
@@ -1,5 +0,0 @@
1
- import { RoutesInfo } from '../../kit/types';
2
- import { ServerContext } from '../types';
3
- export declare function getRouteFunctions({ config }: ServerContext): {
4
- getRoutes: () => Promise<RoutesInfo>;
5
- };
@@ -1,3 +0,0 @@
1
- import { ServerFunctions } from '../../kit/types';
2
- import { ServerContext } from '../types';
3
- export declare function getServerFunctions(ctx: ServerContext): ServerFunctions;
@@ -1,5 +0,0 @@
1
- import { ViteDevServer, ResolvedConfig } from 'vite';
2
- export interface ServerContext {
3
- server: ViteDevServer;
4
- config: ResolvedConfig;
5
- }