@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
package/package.json CHANGED
@@ -1,68 +1,49 @@
1
1
  {
2
2
  "name": "@qwik.dev/devtools",
3
- "version": "0.0.2",
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"
9
12
  },
10
13
  "./component": {
11
- "import": "./src/devtools.tsx"
14
+ "import": "./dist/component/index.qwik.mjs",
15
+ "require": "./dist/component/index.qwik.cjs",
16
+ "types": "./dist/component/lib-types/index.d.ts"
12
17
  }
13
18
  },
14
19
  "files": [
15
- "src",
16
- "lib",
17
- "lib-types"
20
+ "dist/**"
18
21
  ],
19
- "engines": {
20
- "node": "^18.17.0 || ^20.3.0 || >=21.0.0"
21
- },
22
- "private": false,
23
- "type": "module",
24
22
  "scripts": {
25
- "build": "qwik build",
26
- "build.lib": "vite build --mode lib",
27
- "build.types": "tsc --emitDeclarationOnly",
28
- "dev:ssr": "vite --mode ssr",
29
- "dev": "nodemon --watch src -e tsx,ts,css --exec 'npm run build.lib'",
30
- "dev.debug": "node --inspect-brk ./node_modules/vite/bin/vite.js --mode ssr --force",
31
- "fmt": "prettier --write .",
32
- "fmt.check": "prettier --check .",
33
- "lint": "eslint \"src/**/*.ts*\"",
34
- "release": "np",
35
- "start": "vite --open --mode ssr",
36
- "test": "echo \"No test specified\" && exit 0",
37
- "qwik": "qwik"
23
+ "playground": "pnpm --filter playground dev",
24
+ "build": "tsx scripts/build-devtools.ts"
38
25
  },
39
26
  "peerDependencies": {
27
+ "vite": "^6.0.7",
40
28
  "@qwik.dev/core": "^2.0.0-alpha.4",
41
- "@qwik.dev/router": "^2.0.0-alpha.4",
42
- "vite": "^6.0.0"
29
+ "@qwik.dev/router": "^2.0.0-alpha.4"
43
30
  },
44
31
  "dependencies": {
45
- "image-meta": "^0.2.1",
46
32
  "birpc": "^0.2.19",
47
- "perfect-debounce": "^1.0.0",
48
- "fast-glob": "^3.3.2",
49
33
  "superjson": "^2.2.2",
50
34
  "dree": "^5.1.5",
51
35
  "@qwikest/icons": "^0.0.13",
52
36
  "vite-hot-client": "^0.2.4"
53
37
  },
54
38
  "devDependencies": {
55
- "@types/eslint": "8.56.10",
56
- "@types/node": "20.14.11",
57
- "@typescript-eslint/eslint-plugin": "7.16.1",
58
- "@typescript-eslint/parser": "7.16.1",
59
- "eslint": "8.57.0",
60
- "eslint-plugin-qwik": "2.0.0-alpha.3",
61
- "np": "^8.0.4",
62
- "prettier": "3.3.3",
63
- "typescript": "5.4.5",
64
- "vite": "5.4.10",
65
- "vite-tsconfig-paths": "^4.2.1",
66
- "cpy-cli": "^5.0.0"
67
- }
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"
68
49
  }
@@ -1,4 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
3
- const index = require("./plugin/index.qwik.cjs");
4
- exports.qwikDevtools = index.qwikDevtools;
@@ -1,4 +0,0 @@
1
- import { qwikDevtools } from "./plugin/index.qwik.mjs";
2
- export {
3
- qwikDevtools
4
- };
@@ -1,16 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
3
- const shared = require("./shared.qwik.cjs");
4
- const globals = require("./globals.qwik.cjs");
5
- function getViteServerContext() {
6
- return shared.target[globals.SERVER_CTX];
7
- }
8
- function setViteServerContext(ctx) {
9
- shared.target[globals.SERVER_CTX] = ctx;
10
- }
11
- function setViteServerRpc(rpc) {
12
- shared.target[globals.SERVER_RPC] = rpc;
13
- }
14
- exports.getViteServerContext = getViteServerContext;
15
- exports.setViteServerContext = setViteServerContext;
16
- exports.setViteServerRpc = setViteServerRpc;
@@ -1,16 +0,0 @@
1
- import { target } from "./shared.qwik.mjs";
2
- import { SERVER_CTX, SERVER_RPC } from "./globals.qwik.mjs";
3
- function getViteServerContext() {
4
- return target[SERVER_CTX];
5
- }
6
- function setViteServerContext(ctx) {
7
- target[SERVER_CTX] = ctx;
8
- }
9
- function setViteServerRpc(rpc) {
10
- target[SERVER_RPC] = rpc;
11
- }
12
- export {
13
- getViteServerContext,
14
- setViteServerContext,
15
- setViteServerRpc
16
- };
@@ -1,6 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
3
- const SERVER_CTX = "__qwik_server_ctx__";
4
- const SERVER_RPC = "__qwik_server_rpc__";
5
- exports.SERVER_CTX = SERVER_CTX;
6
- exports.SERVER_RPC = SERVER_RPC;
@@ -1,6 +0,0 @@
1
- const SERVER_CTX = "__qwik_server_ctx__";
2
- const SERVER_RPC = "__qwik_server_rpc__";
3
- export {
4
- SERVER_CTX,
5
- SERVER_RPC
6
- };
@@ -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/component")) {
22
- code = `import { QwikDevtools } from '@qwik.dev/devtools/component';
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/component")) {
20
- code = `import { QwikDevtools } from '@qwik.dev/devtools/component';
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 +0,0 @@
1
- export { qwikDevtools } from './plugin';
@@ -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
- }