From 67b42a6c26220a67939d3f96c5ae63c163e4625e Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Mon, 1 Jan 2024 01:48:06 +0000 Subject: [PATCH 1/2] chore(deps): update dependency vitepress to v1.0.0-rc.34 --- package.json | 2 +- pnpm-lock.yaml | 47 ++++++++++++++++++++++++++++++----------------- 2 files changed, 31 insertions(+), 18 deletions(-) diff --git a/package.json b/package.json index d0fe97c55ce..4084dc1a7b8 100644 --- a/package.json +++ b/package.json @@ -129,7 +129,7 @@ "typescript": "~4.9.5", "validator": "~13.11.0", "vite": "~4.5.1", - "vitepress": "1.0.0-rc.29", + "vitepress": "1.0.0-rc.34", "vitest": "~0.34.6", "vue": "~3.4.3" }, diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index b12f8d386a8..327ed7b0503 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -128,8 +128,8 @@ devDependencies: specifier: ~4.5.1 version: 4.5.1(@types/node@20.10.6) vitepress: - specifier: 1.0.0-rc.29 - version: 1.0.0-rc.29(@algolia/client-search@4.22.0)(@types/node@20.10.6)(search-insights@2.13.0)(typescript@4.9.5) + specifier: 1.0.0-rc.34 + version: 1.0.0-rc.34(@algolia/client-search@4.22.0)(@types/node@20.10.6)(search-insights@2.13.0)(typescript@4.9.5) vitest: specifier: ~0.34.6 version: 0.34.6(@vitest/ui@0.34.7) @@ -1445,11 +1445,11 @@ packages: resolution: {integrity: sha512-zuVdFrMJiuCDQUMCzQaD6KL28MjnqqN8XnAqiEq9PNm/hCPTSGfrXCOfwj1ow4LFb/tNymJPwsNbVePc1xFqrQ==} dev: true - /@vitejs/plugin-vue@4.6.0(vite@5.0.10)(vue@3.4.3): - resolution: {integrity: sha512-XHuyFdAikWRmHuAd89FOyUGIjrBU5KlxJtyi2hVeR9ySGFxQwE0bl5xAQju/ArMq5azdBivY4d+D2yPKwoYWUg==} - engines: {node: ^14.18.0 || >=16.0.0} + /@vitejs/plugin-vue@5.0.2(vite@5.0.10)(vue@3.4.3): + resolution: {integrity: sha512-kEjJHrLb5ePBvjD0SPZwJlw1QTRcjjCA9sB5VyfonoXVBxTS7TMnqL6EkLt1Eu61RDeiuZ/WN9Hf6PxXhPI2uA==} + engines: {node: ^18.0.0 || >=20.0.0} peerDependencies: - vite: ^4.0.0 || ^5.0.0 + vite: ^5.0.0 vue: ^3.2.25 dependencies: vite: 5.0.10(@types/node@20.10.6) @@ -4396,11 +4396,6 @@ packages: engines: {node: '>=0.10.0'} dev: true - /mrmime@1.0.1: - resolution: {integrity: sha512-hzzEagAgDyoU1Q6yg5uI+AorQgdvMCur3FcKf7NhMKWsaYg+RnbTyHRa/9IlLF9rf455MOCtcqqrQQ83pPP7Uw==} - engines: {node: '>=10'} - dev: true - /mrmime@2.0.0: resolution: {integrity: sha512-eu38+hdgojoyq63s+yTpN4XMBdt5l8HhMhc4VKLO9KM5caLIBvUm4thi7fFaxyTmCKeNnXZ5pAlBwCUnhA09uw==} engines: {node: '>=10'} @@ -5210,6 +5205,22 @@ packages: vscode-textmate: 8.0.0 dev: true + /shikiji-core@0.9.15: + resolution: {integrity: sha512-7hqIcUKS15OMs/61Qp2GvO1fSajBB36bDqi8vexIg5kp80V6v6SGtBrlq+nLlo7erMG2d1kvIuTIq1bwKI6fEg==} + dev: true + + /shikiji-transformers@0.9.15: + resolution: {integrity: sha512-k0sQ6tX26/cdb8QV9CCwwr7QjRp6/AVP9C0oNIXNld3of+xCrpf74kD74piybG6vMfzBoHGsz/s60RVBJOUaYQ==} + dependencies: + shikiji: 0.9.15 + dev: true + + /shikiji@0.9.15: + resolution: {integrity: sha512-+inN4cN+nY7b0uCPOiqFHAk+cn2DEdM3AIQgPhAV7QKqhww/o7OGS5xvLh3SNnjke9C/HispALqGOQGYHVq7KQ==} + dependencies: + shikiji-core: 0.9.15 + dev: true + /side-channel@1.0.4: resolution: {integrity: sha512-q5XPytqFEIKHkGdiMIrY10mvLRvnQh42/+GoBlFW3b2LXLE2xxJpZFdm94we0BaoV3RwJyGqg5wS7epxTv0Zvw==} dependencies: @@ -5988,12 +5999,12 @@ packages: fsevents: 2.3.3 dev: true - /vitepress@1.0.0-rc.29(@algolia/client-search@4.22.0)(@types/node@20.10.6)(search-insights@2.13.0)(typescript@4.9.5): - resolution: {integrity: sha512-6sKmyEvH16SgMqkHzRwwadt9Uju13AOIqouzOVEg3Rk6X9mds6jLsq2GxnAJvg0s6bl/0Qs/cw+f8SNki82ltw==} + /vitepress@1.0.0-rc.34(@algolia/client-search@4.22.0)(@types/node@20.10.6)(search-insights@2.13.0)(typescript@4.9.5): + resolution: {integrity: sha512-TUbTiSdAZFni2XlHlpx61KikgkQ5uG4Wtmw2R0SXhIOG6qGqzDJczAFjkMc4i45I9c3KyatwOYe8oEfCnzVYwQ==} hasBin: true peerDependencies: markdown-it-mathjax3: ^4.3.2 - postcss: ^8.4.31 + postcss: ^8.4.32 peerDependenciesMeta: markdown-it-mathjax3: optional: true @@ -6003,15 +6014,17 @@ packages: '@docsearch/css': 3.5.2 '@docsearch/js': 3.5.2(@algolia/client-search@4.22.0)(search-insights@2.13.0) '@types/markdown-it': 13.0.7 - '@vitejs/plugin-vue': 4.6.0(vite@5.0.10)(vue@3.4.3) + '@vitejs/plugin-vue': 5.0.2(vite@5.0.10)(vue@3.4.3) '@vue/devtools-api': 6.5.1 '@vueuse/core': 10.7.1(vue@3.4.3) '@vueuse/integrations': 10.7.1(focus-trap@7.5.4)(vue@3.4.3) focus-trap: 7.5.4 mark.js: 8.11.1 minisearch: 6.3.0 - mrmime: 1.0.1 - shiki: 0.14.7 + mrmime: 2.0.0 + shikiji: 0.9.15 + shikiji-core: 0.9.15 + shikiji-transformers: 0.9.15 vite: 5.0.10(@types/node@20.10.6) vue: 3.4.3(typescript@4.9.5) transitivePeerDependencies: From 617f3a5e262cddeafa149e3ff1ba7568d2feb9e8 Mon Sep 17 00:00:00 2001 From: ST-DDT Date: Mon, 1 Jan 2024 03:41:10 +0100 Subject: [PATCH 2/2] chore: update html checks --- scripts/apidoc/markdown.ts | 9 +- .../apidoc/__snapshots__/module.spec.ts.snap | 2 +- .../__snapshots__/signature.spec.ts.snap | 116 +++++++----------- 3 files changed, 54 insertions(+), 73 deletions(-) diff --git a/scripts/apidoc/markdown.ts b/scripts/apidoc/markdown.ts index 88df01507b6..870b4201136 100644 --- a/scripts/apidoc/markdown.ts +++ b/scripts/apidoc/markdown.ts @@ -39,10 +39,15 @@ const htmlSanitizeOptions: sanitizeHtml.IOptions = { function comparableSanitizedHtml(html: string): string { return html + .replace(/&#x[0-9A-F]{2};/g, (x) => + String.fromCodePoint(Number.parseInt(x.slice(3, -1), 16)) + ) .replace(/>/g, '>') - .replace(/ /g, '') + .replace(/</g, '<') + .replace(/&/g, '&') .replace(/"/g, '"') - .replace(/'/g, "'"); + .replace(/=""/g, '') + .replace(/ /g, ''); } /** diff --git a/test/scripts/apidoc/__snapshots__/module.spec.ts.snap b/test/scripts/apidoc/__snapshots__/module.spec.ts.snap index dcd88cd0cf3..2f2d15ddbee 100644 --- a/test/scripts/apidoc/__snapshots__/module.spec.ts.snap +++ b/test/scripts/apidoc/__snapshots__/module.spec.ts.snap @@ -12,7 +12,7 @@ exports[`module > analyzeModule() > ModuleExampleTest 1`] = ` { "comment": "This is a description for a module with a code example.", "deprecated": undefined, - "examples": "
ts
new ModuleExampleTest()
new ModuleExampleTest()
+ "examples": "
ts
new ModuleExampleTest()
", } `; diff --git a/test/scripts/apidoc/__snapshots__/signature.spec.ts.snap b/test/scripts/apidoc/__snapshots__/signature.spec.ts.snap index 04e2ee97c6f..9848720c9f6 100644 --- a/test/scripts/apidoc/__snapshots__/signature.spec.ts.snap +++ b/test/scripts/apidoc/__snapshots__/signature.spec.ts.snap @@ -5,13 +5,10 @@ exports[`signature > analyzeSignature() > complexArrayParameter 1`] = ` "deprecated": undefined, "description": "

Complex array parameter.

", - "examples": "
ts
complexArrayParameter<T>(array: readonly Array<{
-  value: T,
-  weight: number
-}>): T
complexArrayParameter<T>(array: readonly Array<{
-  value: T,
-  weight: number
-}>): T
+ "examples": "
ts
complexArrayParameter<T>(array: readonly Array<{
+  value: T,
+  weight: number
+}>): T
", "name": "complexArrayParameter", "parameters": [ @@ -56,7 +53,7 @@ exports[`signature > analyzeSignature() > defaultBooleanParamMethod 1`] = ` "deprecated": undefined, "description": "

Test with a default parameter.

", - "examples": "
ts
defaultBooleanParamMethod(c: boolean = true): number
defaultBooleanParamMethod(c: boolean = true): number
+ "examples": "
ts
defaultBooleanParamMethod(c: boolean = true): number
", "name": "defaultBooleanParamMethod", "parameters": [ @@ -108,7 +105,7 @@ exports[`signature > analyzeSignature() > functionParamMethod 1`] = ` "deprecated": undefined, "description": "

Test with a function parameters.

", - "examples": "
ts
functionParamMethod(fn: (a: string) => number): number
functionParamMethod(fn: (a: string) => number): number
+ "examples": "
ts
functionParamMethod(fn: (a: string) => number): number
", "name": "functionParamMethod", "parameters": [ @@ -133,7 +130,7 @@ exports[`signature > analyzeSignature() > literalUnionParamMethod 1`] = ` "deprecated": undefined, "description": "

Test with LiteralUnion.

", - "examples": "
ts
literalUnionParamMethod(value: 'a' | 'b' | string, namedValue: 'a' | 'b' | string, array: readonly Array<'a' | 'b' | string>, namedArray: readonly Array<'a' | 'b' | string>, mixed: 'a' | 'b' | string | readonly Array<'a' | 'b' | string>, namedMixed: 'a' | 'b' | string | readonly Array<'a' | 'b' | string>): string
literalUnionParamMethod(value: 'a' | 'b' | string, namedValue: 'a' | 'b' | string, array: readonly Array<'a' | 'b' | string>, namedArray: readonly Array<'a' | 'b' | string>, mixed: 'a' | 'b' | string | readonly Array<'a' | 'b' | string>, namedMixed: 'a' | 'b' | string | readonly Array<'a' | 'b' | string>): string
+ "examples": "
ts
literalUnionParamMethod(value: 'a' | 'b' | string, namedValue: 'a' | 'b' | string, array: readonly Array<'a' | 'b' | string>, namedArray: readonly Array<'a' | 'b' | string>, mixed: 'a' | 'b' | string | readonly Array<'a' | 'b' | string>, namedMixed: 'a' | 'b' | string | readonly Array<'a' | 'b' | string>): string
", "name": "literalUnionParamMethod", "parameters": [ @@ -194,7 +191,7 @@ exports[`signature > analyzeSignature() > methodWithDeprecated 1`] = ` ", "description": "

Test with deprecated and see marker.

", - "examples": "
ts
methodWithDeprecated(): number
methodWithDeprecated(): number
+ "examples": "
ts
methodWithDeprecated(): number
", "name": "methodWithDeprecated", "parameters": [], @@ -213,15 +210,11 @@ exports[`signature > analyzeSignature() > methodWithDeprecatedOption 1`] = ` "deprecated": undefined, "description": "

Test with deprecated option.

", - "examples": "
ts
methodWithDeprecatedOption(option: {
-  a: string,
-  b: () => number,
-  c: number
-}): number
methodWithDeprecatedOption(option: {
-  a: string,
-  b: () => number,
-  c: number
-}): number
+ "examples": "
ts
methodWithDeprecatedOption(option: {
+  a: string,
+  b: () => number,
+  c: number
+}): number
", "name": "methodWithDeprecatedOption", "parameters": [ @@ -269,9 +262,8 @@ exports[`signature > analyzeSignature() > methodWithExample 1`] = ` "deprecated": undefined, "description": "

Test with example marker.

", - "examples": "
ts
methodWithExample(): number
-test.apidoc.methodWithExample() // 0
methodWithExample(): number
-test.apidoc.methodWithExample() // 0
+ "examples": "
ts
methodWithExample(): number
+test.apidoc.methodWithExample() // 0
", "name": "methodWithExample", "parameters": [], @@ -288,7 +280,7 @@ exports[`signature > analyzeSignature() > methodWithMultipleSeeMarkers 1`] = ` "deprecated": undefined, "description": "

Test with multiple see markers.

", - "examples": "
ts
methodWithMultipleSeeMarkers(): number
methodWithMultipleSeeMarkers(): number
+ "examples": "
ts
methodWithMultipleSeeMarkers(): number
", "name": "methodWithMultipleSeeMarkers", "parameters": [], @@ -308,7 +300,7 @@ exports[`signature > analyzeSignature() > methodWithMultipleSeeMarkersAndBacktic "deprecated": undefined, "description": "

Test with multiple see markers and backticks.

", - "examples": "
ts
methodWithMultipleSeeMarkersAndBackticks(): number
methodWithMultipleSeeMarkersAndBackticks(): number
+ "examples": "
ts
methodWithMultipleSeeMarkersAndBackticks(): number
", "name": "methodWithMultipleSeeMarkersAndBackticks", "parameters": [], @@ -328,7 +320,7 @@ exports[`signature > analyzeSignature() > methodWithMultipleThrows 1`] = ` "deprecated": undefined, "description": "

Test with multiple throws.

", - "examples": "
ts
methodWithMultipleThrows(): number
methodWithMultipleThrows(): number
+ "examples": "
ts
methodWithMultipleThrows(): number
", "name": "methodWithMultipleThrows", "parameters": [], @@ -346,7 +338,7 @@ exports[`signature > analyzeSignature() > methodWithSinceMarker 1`] = ` "deprecated": undefined, "description": "

Test with since marker.

", - "examples": "
ts
methodWithSinceMarker(): number
methodWithSinceMarker(): number
+ "examples": "
ts
methodWithSinceMarker(): number
", "name": "methodWithSinceMarker", "parameters": [], @@ -363,7 +355,7 @@ exports[`signature > analyzeSignature() > methodWithThrows 1`] = ` "deprecated": undefined, "description": "

Test with throws.

", - "examples": "
ts
methodWithThrows(): number
methodWithThrows(): number
+ "examples": "
ts
methodWithThrows(): number
", "name": "methodWithThrows", "parameters": [], @@ -380,7 +372,7 @@ exports[`signature > analyzeSignature() > multiParamMethod 1`] = ` "deprecated": undefined, "description": "

Test with multiple parameters.

", - "examples": "
ts
multiParamMethod(a: number, b?: string, c: boolean = true): number
multiParamMethod(a: number, b?: string, c: boolean = true): number
+ "examples": "
ts
multiParamMethod(a: number, b?: string, c: boolean = true): number
", "name": "multiParamMethod", "parameters": [ @@ -419,7 +411,7 @@ exports[`signature > analyzeSignature() > noParamMethod 1`] = ` "deprecated": undefined, "description": "

Test with no parameters.

", - "examples": "
ts
noParamMethod(): number
noParamMethod(): number
+ "examples": "
ts
noParamMethod(): number
", "name": "noParamMethod", "parameters": [], @@ -436,7 +428,7 @@ exports[`signature > analyzeSignature() > optionalStringParamMethod 1`] = ` "deprecated": undefined, "description": "

Test with an optional parameter.

", - "examples": "
ts
optionalStringParamMethod(b?: string): number
optionalStringParamMethod(b?: string): number
+ "examples": "
ts
optionalStringParamMethod(b?: string): number
", "name": "optionalStringParamMethod", "parameters": [ @@ -461,19 +453,13 @@ exports[`signature > analyzeSignature() > optionsInlineParamMethodWithDefaults 1 "deprecated": undefined, "description": "

Test with a function parameters (inline types) with defaults.

", - "examples": "
ts
optionsInlineParamMethodWithDefaults(a: {
-  value: number
-} = { value: 1 }, b: {
-  value: number
-} = { value: 1 }, c: {
-  value: number
-}): number
optionsInlineParamMethodWithDefaults(a: {
-  value: number
-} = { value: 1 }, b: {
-  value: number
-} = { value: 1 }, c: {
-  value: number
-}): number
+ "examples": "
ts
optionsInlineParamMethodWithDefaults(a: {
+  value: number
+} = { value: 1 }, b: {
+  value: number
+} = { value: 1 }, c: {
+  value: number
+}): number
", "name": "optionsInlineParamMethodWithDefaults", "parameters": [ @@ -535,7 +521,7 @@ exports[`signature > analyzeSignature() > optionsInterfaceParamMethodWithDefault "deprecated": undefined, "description": "

Test with a function parameters with defaults.

", - "examples": "
ts
optionsInterfaceParamMethodWithDefaults(a: ParameterOptionsInterfaceA = { value: 1 }, b: ParameterOptionsInterfaceB = { value: 1 }, c: ParameterOptionsInterfaceC): number
optionsInterfaceParamMethodWithDefaults(a: ParameterOptionsInterfaceA = { value: 1 }, b: ParameterOptionsInterfaceB = { value: 1 }, c: ParameterOptionsInterfaceC): number
+ "examples": "
ts
optionsInterfaceParamMethodWithDefaults(a: ParameterOptionsInterfaceA = { value: 1 }, b: ParameterOptionsInterfaceB = { value: 1 }, c: ParameterOptionsInterfaceC): number
", "name": "optionsInterfaceParamMethodWithDefaults", "parameters": [ @@ -574,19 +560,13 @@ exports[`signature > analyzeSignature() > optionsParamMethod 1`] = ` "deprecated": undefined, "description": "

Test with an options parameter.

", - "examples": "
ts
optionsParamMethod(options: {
-  a: number,
-  b: string,
-  c: boolean,
-  d: () => string,
-  e: 'a' | 'b' | string
-}): number
optionsParamMethod(options: {
-  a: number,
-  b: string,
-  c: boolean,
-  d: () => string,
-  e: 'a' | 'b' | string
-}): number
+ "examples": "
ts
optionsParamMethod(options: {
+  a: number,
+  b: string,
+  c: boolean,
+  d: () => string,
+  e: 'a' | 'b' | string
+}): number
", "name": "optionsParamMethod", "parameters": [ @@ -646,7 +626,7 @@ exports[`signature > analyzeSignature() > optionsTypeParamMethodWithDefaults 1`] "deprecated": undefined, "description": "

Test with a function parameters with defaults.

", - "examples": "
ts
optionsTypeParamMethodWithDefaults(a: ParameterOptionsTypeA = { value: 1 }, b: ParameterOptionsTypeB = { value: 1 }, c: ParameterOptionsTypeC): number
optionsTypeParamMethodWithDefaults(a: ParameterOptionsTypeA = { value: 1 }, b: ParameterOptionsTypeB = { value: 1 }, c: ParameterOptionsTypeC): number
+ "examples": "
ts
optionsTypeParamMethodWithDefaults(a: ParameterOptionsTypeA = { value: 1 }, b: ParameterOptionsTypeB = { value: 1 }, c: ParameterOptionsTypeC): number
", "name": "optionsTypeParamMethodWithDefaults", "parameters": [ @@ -685,7 +665,7 @@ exports[`signature > analyzeSignature() > recordParamMethod 1`] = ` "deprecated": undefined, "description": "

Test with a Record parameter.

", - "examples": "
ts
recordParamMethod(object: Record<string, number>): number
recordParamMethod(object: Record<string, number>): number
+ "examples": "
ts
recordParamMethod(object: Record<string, number>): number
", "name": "recordParamMethod", "parameters": [ @@ -710,7 +690,7 @@ exports[`signature > analyzeSignature() > requiredNumberParamMethod 1`] = ` "deprecated": undefined, "description": "

Test with a required parameter.

", - "examples": "
ts
requiredNumberParamMethod(a: number): number
requiredNumberParamMethod(a: number): number
+ "examples": "
ts
requiredNumberParamMethod(a: number): number
", "name": "requiredNumberParamMethod", "parameters": [ @@ -735,15 +715,11 @@ exports[`signature > analyzeSignature() > stringUnionParamMethod 1`] = ` "deprecated": undefined, "description": "

Test with string union.

", - "examples": "
ts
stringUnionParamMethod(value: 'a' | 'b', options?: {
-  casing: 'lower' | 'mixed' | 'upper',
-  excludes: readonly AlphaNumericChar[],
-  format: 'binary' | 'css' | 'decimal' | 'hex'
-}): string
stringUnionParamMethod(value: 'a' | 'b', options?: {
-  casing: 'lower' | 'mixed' | 'upper',
-  excludes: readonly AlphaNumericChar[],
-  format: 'binary' | 'css' | 'decimal' | 'hex'
-}): string
+ "examples": "
ts
stringUnionParamMethod(value: 'a' | 'b', options?: {
+  casing: 'lower' | 'mixed' | 'upper',
+  excludes: readonly AlphaNumericChar[],
+  format: 'binary' | 'css' | 'decimal' | 'hex'
+}): string
", "name": "stringUnionParamMethod", "parameters": [