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: 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(/[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": "
new ModuleExampleTest()
new ModuleExampleTest()
+ "examples": "new ModuleExampleTest()
Complex array parameter.
", - "examples": "complexArrayParameter<T>(array: readonly Array<{
- value: T,
- weight: number
-}>): T
complexArrayParameter<T>(array: readonly Array<{
- value: T,
- weight: number
-}>): T
+ "examples": "complexArrayParameter<T>(array: readonly Array<{
+ value: T,
+ weight: number
+}>): T
Test with a default parameter.
", - "examples": "defaultBooleanParamMethod(c: boolean = true): number
defaultBooleanParamMethod(c: boolean = true): number
+ "examples": "defaultBooleanParamMethod(c: boolean = true): number
Test with a function parameters.
", - "examples": "functionParamMethod(fn: (a: string) => number): number
functionParamMethod(fn: (a: string) => number): number
+ "examples": "functionParamMethod(fn: (a: string) => number): number
Test with LiteralUnion.
", - "examples": "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": "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
Test with deprecated and see marker.
", - "examples": "methodWithDeprecated(): number
methodWithDeprecated(): number
+ "examples": "methodWithDeprecated(): number
Test with deprecated option.
", - "examples": "methodWithDeprecatedOption(option: {
- a: string,
- b: () => number,
- c: number
-}): number
methodWithDeprecatedOption(option: {
- a: string,
- b: () => number,
- c: number
-}): number
+ "examples": "methodWithDeprecatedOption(option: {
+ a: string,
+ b: () => number,
+ c: number
+}): number
Test with example marker.
", - "examples": "methodWithExample(): number
-test.apidoc.methodWithExample() // 0
methodWithExample(): number
-test.apidoc.methodWithExample() // 0
+ "examples": "methodWithExample(): number
+test.apidoc.methodWithExample() // 0
Test with multiple see markers.
", - "examples": "methodWithMultipleSeeMarkers(): number
methodWithMultipleSeeMarkers(): number
+ "examples": "methodWithMultipleSeeMarkers(): number
Test with multiple see markers and backticks.
", - "examples": "methodWithMultipleSeeMarkersAndBackticks(): number
methodWithMultipleSeeMarkersAndBackticks(): number
+ "examples": "methodWithMultipleSeeMarkersAndBackticks(): number
Test with multiple throws.
", - "examples": "methodWithMultipleThrows(): number
methodWithMultipleThrows(): number
+ "examples": "methodWithMultipleThrows(): number
Test with since marker.
", - "examples": "methodWithSinceMarker(): number
methodWithSinceMarker(): number
+ "examples": "methodWithSinceMarker(): number
Test with throws.
", - "examples": "methodWithThrows(): number
methodWithThrows(): number
+ "examples": "methodWithThrows(): number
Test with multiple parameters.
", - "examples": "multiParamMethod(a: number, b?: string, c: boolean = true): number
multiParamMethod(a: number, b?: string, c: boolean = true): number
+ "examples": "multiParamMethod(a: number, b?: string, c: boolean = true): number
Test with no parameters.
", - "examples": "noParamMethod(): number
noParamMethod(): number
+ "examples": "noParamMethod(): number
Test with an optional parameter.
", - "examples": "optionalStringParamMethod(b?: string): number
optionalStringParamMethod(b?: string): number
+ "examples": "optionalStringParamMethod(b?: string): number
Test with a function parameters (inline types) with defaults.
", - "examples": "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": "optionsInlineParamMethodWithDefaults(a: {
+ value: number
+} = { value: 1 }, b: {
+ value: number
+} = { value: 1 }, c: {
+ value: number
+}): number
Test with a function parameters with defaults.
", - "examples": "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": "optionsInterfaceParamMethodWithDefaults(a: ParameterOptionsInterfaceA = { value: 1 }, b: ParameterOptionsInterfaceB = { value: 1 }, c: ParameterOptionsInterfaceC): number
Test with an options parameter.
", - "examples": "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": "optionsParamMethod(options: {
+ a: number,
+ b: string,
+ c: boolean,
+ d: () => string,
+ e: 'a' | 'b' | string
+}): number
Test with a function parameters with defaults.
", - "examples": "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": "optionsTypeParamMethodWithDefaults(a: ParameterOptionsTypeA = { value: 1 }, b: ParameterOptionsTypeB = { value: 1 }, c: ParameterOptionsTypeC): number
Test with a Record parameter.
", - "examples": "recordParamMethod(object: Record<string, number>): number
recordParamMethod(object: Record<string, number>): number
+ "examples": "recordParamMethod(object: Record<string, number>): number
Test with a required parameter.
", - "examples": "requiredNumberParamMethod(a: number): number
requiredNumberParamMethod(a: number): number
+ "examples": "requiredNumberParamMethod(a: number): number
Test with string union.
", - "examples": "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": "stringUnionParamMethod(value: 'a' | 'b', options?: {
+ casing: 'lower' | 'mixed' | 'upper',
+ excludes: readonly AlphaNumericChar[],
+ format: 'binary' | 'css' | 'decimal' | 'hex'
+}): string