@zuplo/cli 7.15.5 → 7.15.7

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 (67) hide show
  1. package/node_modules/@hono/node-server/dist/serve-static.cjs +1 -1
  2. package/node_modules/@hono/node-server/dist/serve-static.mjs +1 -1
  3. package/node_modules/@hono/node-server/package.json +1 -1
  4. package/node_modules/@inquirer/ansi/package.json +4 -4
  5. package/node_modules/@inquirer/checkbox/package.json +8 -8
  6. package/node_modules/@inquirer/confirm/package.json +6 -6
  7. package/node_modules/@inquirer/core/dist/lib/make-theme.js +3 -0
  8. package/node_modules/@inquirer/core/package.json +8 -8
  9. package/node_modules/@inquirer/editor/package.json +7 -7
  10. package/node_modules/@inquirer/expand/package.json +6 -6
  11. package/node_modules/@inquirer/external-editor/package.json +4 -4
  12. package/node_modules/@inquirer/figures/package.json +4 -4
  13. package/node_modules/@inquirer/input/package.json +6 -6
  14. package/node_modules/@inquirer/number/dist/index.js +7 -2
  15. package/node_modules/@inquirer/number/package.json +6 -6
  16. package/node_modules/@inquirer/password/package.json +7 -7
  17. package/node_modules/@inquirer/rawlist/dist/index.js +3 -3
  18. package/node_modules/@inquirer/rawlist/package.json +6 -6
  19. package/node_modules/@inquirer/search/package.json +7 -7
  20. package/node_modules/@inquirer/select/dist/index.js +5 -1
  21. package/node_modules/@inquirer/select/package.json +8 -8
  22. package/node_modules/@inquirer/type/package.json +4 -4
  23. package/node_modules/@posthog/types/dist/feature-flags.d.ts +2 -0
  24. package/node_modules/@posthog/types/dist/feature-flags.d.ts.map +1 -1
  25. package/node_modules/@posthog/types/dist/posthog-config.d.ts +3 -0
  26. package/node_modules/@posthog/types/dist/posthog-config.d.ts.map +1 -1
  27. package/node_modules/@posthog/types/package.json +1 -1
  28. package/node_modules/@posthog/types/src/feature-flags.ts +2 -0
  29. package/node_modules/@posthog/types/src/posthog-config.ts +3 -0
  30. package/node_modules/@zuplo/core/package.json +1 -1
  31. package/node_modules/@zuplo/graphql/package.json +1 -1
  32. package/node_modules/@zuplo/openapi-tools/package.json +1 -1
  33. package/node_modules/@zuplo/otel/package.json +1 -1
  34. package/node_modules/@zuplo/runtime/package.json +1 -1
  35. package/node_modules/brace-expansion/README.md +30 -0
  36. package/node_modules/brace-expansion/dist/commonjs/index.d.ts +2 -0
  37. package/node_modules/brace-expansion/dist/commonjs/index.d.ts.map +1 -1
  38. package/node_modules/brace-expansion/dist/commonjs/index.js +222 -36
  39. package/node_modules/brace-expansion/dist/commonjs/index.js.map +1 -1
  40. package/node_modules/brace-expansion/dist/esm/index.d.ts +2 -0
  41. package/node_modules/brace-expansion/dist/esm/index.d.ts.map +1 -1
  42. package/node_modules/brace-expansion/dist/esm/index.js +222 -36
  43. package/node_modules/brace-expansion/dist/esm/index.js.map +1 -1
  44. package/node_modules/brace-expansion/package.json +1 -1
  45. package/node_modules/hono/dist/cjs/hono-base.js +7 -2
  46. package/node_modules/hono/dist/cjs/middleware/body-limit/index.js +9 -10
  47. package/node_modules/hono/dist/cjs/middleware/method-not-allowed/index.js +1 -1
  48. package/node_modules/hono/dist/cjs/middleware/mount/index.js +3 -2
  49. package/node_modules/hono/dist/cjs/middleware/serve-static/index.js +1 -1
  50. package/node_modules/hono/dist/cjs/utils/mount.js +18 -2
  51. package/node_modules/hono/dist/cjs/utils/url.js +8 -11
  52. package/node_modules/hono/dist/cjs/validator/validator.js +5 -5
  53. package/node_modules/hono/dist/hono-base.js +7 -2
  54. package/node_modules/hono/dist/middleware/body-limit/index.js +9 -10
  55. package/node_modules/hono/dist/middleware/language/language.js +1 -1
  56. package/node_modules/hono/dist/middleware/method-not-allowed/index.js +1 -1
  57. package/node_modules/hono/dist/middleware/mount/index.js +3 -2
  58. package/node_modules/hono/dist/middleware/serve-static/index.js +1 -1
  59. package/node_modules/hono/dist/types/hono-base.d.ts +2 -0
  60. package/node_modules/hono/dist/types/middleware/mount/index.d.ts +2 -1
  61. package/node_modules/hono/dist/types/utils/url.d.ts +0 -1
  62. package/node_modules/hono/dist/utils/mount.js +19 -3
  63. package/node_modules/hono/dist/utils/url.js +9 -11
  64. package/node_modules/hono/dist/validator/validator.js +5 -5
  65. package/node_modules/hono/package.json +1 -1
  66. package/node_modules/mute-stream/package.json +13 -20
  67. package/package.json +11 -11
@@ -80,6 +80,7 @@ const tryDecode = (str, decoder) => {
80
80
  * tryDecodeURI('Hello%20World/%A4%A2') // 'Hello World/%A4%A2'
81
81
  */
82
82
  const tryDecodeURI = (str) => tryDecode(str, decodeURI);
83
+ const decodeURIWithPreservedPercent = (value) => decodeURI(value.includes("%25") ? value.replace(/%25/g, "%2525") : value);
83
84
  const getPath = (request) => {
84
85
  const url = request.url;
85
86
  const start = url.indexOf("/", url.indexOf(":") + 4);
@@ -91,7 +92,13 @@ const getPath = (request) => {
91
92
  const hashIndex = url.indexOf("#", i);
92
93
  const end = queryIndex === -1 ? hashIndex === -1 ? void 0 : hashIndex : hashIndex === -1 ? queryIndex : Math.min(queryIndex, hashIndex);
93
94
  const path = url.slice(start, end);
94
- return tryDecodeURI(path.includes("%25") ? path.replace(/%25/g, "%2525") : path);
95
+ const decoded = tryDecode(path, decodeURIWithPreservedPercent);
96
+ if (/%(?![0-9A-Fa-f]{2})/.test(path)) {
97
+ const rewritten = new URL("http://localhost");
98
+ rewritten.pathname = decoded.replace(/[\\\t\n\r]/g, encodeURIComponent);
99
+ if (tryDecode(rewritten.pathname, decodeURIWithPreservedPercent) !== decoded) return tryDecode(path.replace(/%(?![0-9A-Fa-f]{2})/g, "%25"), decodeURIWithPreservedPercent);
100
+ }
101
+ return decoded;
95
102
  } else if (charCode === 63 || charCode === 35) break;
96
103
  }
97
104
  return url.slice(start, i);
@@ -110,15 +117,6 @@ const getPathNoStrict = (request) => {
110
117
  const result = getPath(request);
111
118
  return result.length > 1 && result.at(-1) === "/" ? result.slice(0, -1) : result;
112
119
  };
113
- const stripPathPrefix = (rawPath, decodedPath, prefixLength) => {
114
- if (rawPath.at(-1) === "/" && decodedPath.at(-1) !== "/") rawPath = rawPath.slice(0, -1);
115
- let index = 0;
116
- for (let i = decodedPath.indexOf("/"); i !== -1 && i < prefixLength; i = decodedPath.indexOf("/", i + 1)) {
117
- index = rawPath.indexOf("/", index + 1);
118
- if (index === -1) return "/";
119
- }
120
- return rawPath.slice(index) || "/";
121
- };
122
120
  /**
123
121
  * Merge paths.
124
122
  * @param {string[]} ...paths - The paths to merge.
@@ -212,4 +210,4 @@ const getQueryParams = (url, key) => {
212
210
  };
213
211
  const decodeURIComponent_ = decodeURIComponent;
214
212
  //#endregion
215
- export { checkOptionalParameter, decodeURIComponent_, getPath, getPathNoStrict, getPattern, getQueryParam, getQueryParams, getQueryStrings, mergePath, splitPath, splitRoutingPath, stripPathPrefix, tryDecode, tryDecodeURI, tryDecodeURIComponent };
213
+ export { checkOptionalParameter, decodeURIComponent_, getPath, getPathNoStrict, getPattern, getQueryParam, getQueryParams, getQueryStrings, mergePath, splitPath, splitRoutingPath, tryDecode, tryDecodeURI, tryDecodeURIComponent };
@@ -2,16 +2,16 @@ import { HTTPException } from "../http-exception.js";
2
2
  import { bufferToFormData } from "../utils/buffer.js";
3
3
  import { getCookie } from "../helper/cookie/index.js";
4
4
  //#region src/validator/validator.ts
5
- const jsonRegex = /^application\/([a-z-\.]+\+)?json(;\s*[a-zA-Z0-9\-]+\=([^;]+))*$/i;
6
- const multipartRegex = /^multipart\/form-data(;\s*[a-zA-Z0-9\-]+\=([^;]+))*$/i;
7
- const urlencodedRegex = /^application\/x-www-form-urlencoded(;\s*[a-zA-Z0-9\-]+\=([^;]+))*$/i;
5
+ const jsonRegex = /^application\/([\w.-]+\+)?json$/i;
6
+ const getMediaType = (contentType) => contentType.split(";")[0].trim().toLowerCase();
8
7
  const validator = (target, validationFunc) => {
9
8
  return async (c, next) => {
10
9
  let value = {};
11
10
  const contentType = c.req.header("Content-Type");
11
+ const mediaType = contentType ? getMediaType(contentType) : "";
12
12
  switch (target) {
13
13
  case "json":
14
- if (!contentType || !jsonRegex.test(contentType)) break;
14
+ if (!jsonRegex.test(mediaType)) break;
15
15
  try {
16
16
  value = await c.req.json();
17
17
  } catch {
@@ -19,7 +19,7 @@ const validator = (target, validationFunc) => {
19
19
  }
20
20
  break;
21
21
  case "form": {
22
- if (!contentType || !(multipartRegex.test(contentType) || urlencodedRegex.test(contentType))) break;
22
+ if (mediaType !== "multipart/form-data" && mediaType !== "application/x-www-form-urlencoded") break;
23
23
  let formData;
24
24
  if (c.req.bodyCache.formData) formData = await c.req.bodyCache.formData;
25
25
  else try {
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "hono",
3
- "version": "4.13.17",
3
+ "version": "4.13.18",
4
4
  "description": "Web framework built on Web Standards",
5
5
  "main": "dist/cjs/index.js",
6
6
  "type": "module",
@@ -1,21 +1,22 @@
1
1
  {
2
2
  "name": "mute-stream",
3
- "version": "3.0.0",
3
+ "version": "4.0.0",
4
4
  "main": "lib/index.js",
5
5
  "devDependencies": {
6
- "@npmcli/eslint-config": "^5.0.0",
7
- "@npmcli/template-oss": "4.27.1",
8
- "tap": "^16.3.0"
6
+ "@npmcli/eslint-config": "^6.0.0",
7
+ "@npmcli/template-oss": "5.0.0"
9
8
  },
10
9
  "scripts": {
11
- "test": "tap",
10
+ "test": "node --test './test/**/*.js'",
12
11
  "lint": "npm run eslint",
13
12
  "postlint": "template-oss-check",
14
13
  "template-oss-apply": "template-oss-apply --force",
15
14
  "lintfix": "npm run eslint -- --fix",
16
- "snap": "tap",
15
+ "snap": "node --test --test-update-snapshots './test/**/*.js'",
17
16
  "posttest": "npm run lint",
18
- "eslint": "eslint \"**/*.{js,cjs,ts,mjs,jsx,tsx}\""
17
+ "eslint": "eslint \"**/*.{js,cjs,ts,mjs,jsx,tsx}\"",
18
+ "test:node20": "node --test test",
19
+ "test:cover": "node --test --experimental-test-coverage --test-timeout=3000 --test-coverage-lines=100 --test-coverage-functions=100 --test-coverage-branches=100 './test/**/*.js'"
19
20
  },
20
21
  "repository": {
21
22
  "type": "git",
@@ -33,22 +34,14 @@
33
34
  "bin/",
34
35
  "lib/"
35
36
  ],
36
- "tap": {
37
- "statements": 70,
38
- "branches": 60,
39
- "functions": 81,
40
- "lines": 70,
41
- "nyc-arg": [
42
- "--exclude",
43
- "tap-snapshots/**"
44
- ]
45
- },
46
37
  "engines": {
47
- "node": "^20.17.0 || >=22.9.0"
38
+ "node": "^22.22.2 || ^24.15.0 || >=26.0.0"
48
39
  },
49
40
  "templateOSS": {
50
41
  "//@npmcli/template-oss": "This file is partially managed by @npmcli/template-oss. Edits may be overwritten.",
51
- "version": "4.27.1",
52
- "publish": true
42
+ "version": "5.0.0",
43
+ "publish": true,
44
+ "testRunner": "node:test",
45
+ "latestCiVersion": 24
53
46
  }
54
47
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@zuplo/cli",
3
- "version": "7.15.5",
3
+ "version": "7.15.7",
4
4
  "repository": "https://github.com/zuplo/zuplo",
5
5
  "author": "Zuplo, Inc.",
6
6
  "type": "module",
@@ -32,10 +32,10 @@
32
32
  "@opentelemetry/api": "1.9.0",
33
33
  "@opentelemetry/api-logs": "0.220.0",
34
34
  "@swc/core": "1.10.18",
35
- "@zuplo/core": "7.15.5",
35
+ "@zuplo/core": "7.15.7",
36
36
  "@zuplo/editor": "1.0.39603386871",
37
- "@zuplo/openapi-tools": "7.15.5",
38
- "@zuplo/runtime": "7.15.5",
37
+ "@zuplo/openapi-tools": "7.15.7",
38
+ "@zuplo/runtime": "7.15.7",
39
39
  "chalk": "5.4.1",
40
40
  "chokidar": "3.5.3",
41
41
  "cookie": "1.0.2",
@@ -66,15 +66,15 @@
66
66
  "workerd": "1.20261002.1",
67
67
  "yargs": "17.7.2",
68
68
  "zod": "4.6.7",
69
- "@zuplo/graphql": "7.15.5",
70
- "@zuplo/otel": "7.15.5"
69
+ "@zuplo/graphql": "7.15.7",
70
+ "@zuplo/otel": "7.15.7"
71
71
  },
72
72
  "optionalDependencies": {
73
- "@zuplo/lint-darwin-arm64": "7.15.5",
74
- "@zuplo/lint-darwin-x64": "7.15.5",
75
- "@zuplo/lint-linux-x64": "7.15.5",
76
- "@zuplo/lint-linux-arm64": "7.15.5",
77
- "@zuplo/lint-win32-x64": "7.15.5"
73
+ "@zuplo/lint-darwin-arm64": "7.15.7",
74
+ "@zuplo/lint-darwin-x64": "7.15.7",
75
+ "@zuplo/lint-linux-x64": "7.15.7",
76
+ "@zuplo/lint-linux-arm64": "7.15.7",
77
+ "@zuplo/lint-win32-x64": "7.15.7"
78
78
  },
79
79
  "bundleDependencies": [
80
80
  "@inquirer/prompts",