From 0fefcc869c968ef87425802f5fd42738b95547b5 Mon Sep 17 00:00:00 2001 From: PhilippeR26 Date: Tue, 23 Jan 2024 13:38:37 +0100 Subject: [PATCH] Merge branch 'docs-add-search' --- src/utils/calldata/enum/CairoCustomEnum.ts | 6 ++-- src/utils/calldata/enum/CairoOption.ts | 3 +- src/utils/calldata/enum/CairoResult.ts | 3 +- www/docusaurus.config.js | 34 ++++++++++++++++-- www/package-lock.json | 42 +++++++++++----------- www/package.json | 6 ++-- 6 files changed, 63 insertions(+), 31 deletions(-) diff --git a/src/utils/calldata/enum/CairoCustomEnum.ts b/src/utils/calldata/enum/CairoCustomEnum.ts index 7978f7a3c..547e676b3 100644 --- a/src/utils/calldata/enum/CairoCustomEnum.ts +++ b/src/utils/calldata/enum/CairoCustomEnum.ts @@ -8,7 +8,8 @@ export type CairoEnumRaw = { * {Success: 234, Warning: undefined, Error: undefined}. * Only one variant with a value, object, array. * @returns an instance representing a Cairo custom Enum. - * @example ```typescript + * @example + * ```typescript * const myCairoEnum = new CairoCustomEnum( {Success: undefined, Warning: "0x7f32ea", Error: undefined}) * ``` */ @@ -16,7 +17,8 @@ export class CairoCustomEnum { /** * direct readonly access to variants of the Cairo Custom Enum. * @returns a value of type any - * @example ```typescript + * @example + * ```typescript * const successValue = myCairoEnum.variant.Success; */ readonly variant: CairoEnumRaw; diff --git a/src/utils/calldata/enum/CairoOption.ts b/src/utils/calldata/enum/CairoOption.ts index 75d3990a9..13a8df94d 100644 --- a/src/utils/calldata/enum/CairoOption.ts +++ b/src/utils/calldata/enum/CairoOption.ts @@ -8,7 +8,8 @@ export enum CairoOptionVariant { * @param variant CairoOptionVariant.Some or CairoOptionVariant.None * @param someContent value of type T. * @returns an instance representing a Cairo Option. - * @example ```typescript + * @example + * ```typescript * const myOption = new CairoOption(CairoOptionVariant.Some, "0x54dda8"); * ``` */ diff --git a/src/utils/calldata/enum/CairoResult.ts b/src/utils/calldata/enum/CairoResult.ts index ef5385394..f6fae9467 100644 --- a/src/utils/calldata/enum/CairoResult.ts +++ b/src/utils/calldata/enum/CairoResult.ts @@ -8,7 +8,8 @@ export enum CairoResultVariant { * @param variant CairoResultVariant.Ok or CairoResultVariant.Err * @param resultContent value of type T or U. * @returns an instance representing a Cairo Result. - * @example ```typescript + * @example + * ```typescript * const myOption = new CairoResult(CairoResultVariant.Ok, "0x54dda8"); * ``` */ diff --git a/www/docusaurus.config.js b/www/docusaurus.config.js index 4aaca8c8b..dbfe38308 100644 --- a/www/docusaurus.config.js +++ b/www/docusaurus.config.js @@ -38,7 +38,35 @@ const config = { themeConfig: /** @type {import('@docusaurus/preset-classic').ThemeConfig} */ - ({ + { + algolia: { + // The application ID provided by Algolia + appId: '86VVNRI64B', + + // Public API key: it is safe to commit it + apiKey: '6f4db54e4ee0ae77619b41dbe862af7f', + + indexName: 'starknetjs', + + // Optional: see doc section below + contextualSearch: true, + + // Optional: Specify domains where the navigation should occur through window.location instead on history.push. Useful when our Algolia config crawls multiple documentation sites and we want to navigate with window.location.href to them. + //externalUrlRegex: 'external\\.com|domain\\.com', + + // Optional: Replace parts of the item URLs from Algolia. Useful when using the same search index for multiple deployments using a different baseUrl. You can use regexp or string in the `from` param. For example: localhost:3000 vs myCompany.com/docs + //replaceSearchResultPathname: { + // from: '/docs/', // or as RegExp: /\/docs\// + // to: '/', + + // Optional: Algolia search parameters + //searchParameters: {}, + + // Optional: path for search page that enabled by default (`false` to disable it) + //searchPagePath: 'search', + + //... other Algolia param + }, announcementBar: { content: `Migrate from v4`, backgroundColor: 'rgb(230 231 232)', @@ -67,6 +95,7 @@ const config = { dropdownActiveClassDisabled: true, position: 'left', }, + { label: 'GitHub', href: 'https://github.com/starknet-io/starknet.js', @@ -119,7 +148,7 @@ const config = { theme: lightCodeTheme, darkTheme: darkCodeTheme, }, - }), + }, plugins: [ [ @@ -155,7 +184,6 @@ const config = { 'Function', 'Accessor', 'Method', - 'ObjectLiteral', 'Parameter', 'TypeParameter', 'TypeLiteral', diff --git a/www/package-lock.json b/www/package-lock.json index 912113d51..448704d07 100644 --- a/www/package-lock.json +++ b/www/package-lock.json @@ -19,9 +19,9 @@ "devDependencies": { "@docusaurus/module-type-aliases": "^2.4.0", "@tsconfig/docusaurus": "^1.0.7", - "docusaurus-plugin-typedoc": "^0.19.2", - "typedoc": "^0.24.7", - "typedoc-plugin-markdown": "^3.15.3", + "docusaurus-plugin-typedoc": "^0.21.0", + "typedoc": "^0.25.4", + "typedoc-plugin-markdown": "^3.17.1", "typescript": "^5.0.4" } }, @@ -4418,9 +4418,9 @@ } }, "node_modules/caniuse-lite": { - "version": "1.0.30001489", - "resolved": "https://registry.npmjs.org/caniuse-lite/-/caniuse-lite-1.0.30001489.tgz", - "integrity": "sha512-x1mgZEXK8jHIfAxm+xgdpHpk50IN3z3q3zP261/WS+uvePxW8izXuCu6AHz0lkuYTlATDehiZ/tNyYBdSQsOUQ==", + "version": "1.0.30001566", + "resolved": "https://registry.npmjs.org/caniuse-lite/-/caniuse-lite-1.0.30001566.tgz", + "integrity": "sha512-ggIhCsTxmITBAMmK8yZjEhCO5/47jKXPu6Dha/wuCS4JePVL+3uiDEBuhu2aIoT+bqTOR8L76Ip1ARL9xYsEJA==", "funding": [ { "type": "opencollective", @@ -5548,9 +5548,9 @@ } }, "node_modules/docusaurus-plugin-typedoc": { - "version": "0.19.2", - "resolved": "https://registry.npmjs.org/docusaurus-plugin-typedoc/-/docusaurus-plugin-typedoc-0.19.2.tgz", - "integrity": "sha512-N4B2MOaXIyu+FloFn6zVbGgSqszeFQE/7ZIgFakpkVg5F0rfysiDGac2PHbPf4o8DWdyyviJOAuhXk6U7Febeg==", + "version": "0.21.0", + "resolved": "https://registry.npmjs.org/docusaurus-plugin-typedoc/-/docusaurus-plugin-typedoc-0.21.0.tgz", + "integrity": "sha512-7DLFrf0JP+L5vSRQHVKIbndjbksd2MlxPqNmmdxzLFiRINgrY23s9waduWM9t24PUsf5JZ0tlGKlE3sK4uZ72Q==", "dev": true, "peerDependencies": { "typedoc": ">=0.24.0", @@ -11486,30 +11486,30 @@ } }, "node_modules/typedoc": { - "version": "0.24.7", - "resolved": "https://registry.npmjs.org/typedoc/-/typedoc-0.24.7.tgz", - "integrity": "sha512-zzfKDFIZADA+XRIp2rMzLe9xZ6pt12yQOhCr7cD7/PBTjhPmMyMvGrkZ2lPNJitg3Hj1SeiYFNzCsSDrlpxpKw==", + "version": "0.25.4", + "resolved": "https://registry.npmjs.org/typedoc/-/typedoc-0.25.4.tgz", + "integrity": "sha512-Du9ImmpBCw54bX275yJrxPVnjdIyJO/84co0/L9mwe0R3G4FSR6rQ09AlXVRvZEGMUg09+z/usc8mgygQ1aidA==", "dev": true, "dependencies": { "lunr": "^2.3.9", "marked": "^4.3.0", - "minimatch": "^9.0.0", + "minimatch": "^9.0.3", "shiki": "^0.14.1" }, "bin": { "typedoc": "bin/typedoc" }, "engines": { - "node": ">= 14.14" + "node": ">= 16" }, "peerDependencies": { - "typescript": "4.6.x || 4.7.x || 4.8.x || 4.9.x || 5.0.x" + "typescript": "4.6.x || 4.7.x || 4.8.x || 4.9.x || 5.0.x || 5.1.x || 5.2.x || 5.3.x" } }, "node_modules/typedoc-plugin-markdown": { - "version": "3.15.3", - "resolved": "https://registry.npmjs.org/typedoc-plugin-markdown/-/typedoc-plugin-markdown-3.15.3.tgz", - "integrity": "sha512-idntFYu3vfaY3eaD+w9DeRd0PmNGqGuNLKihPU9poxFGnATJYGn9dPtEhn2QrTdishFMg7jPXAhos+2T6YCWRQ==", + "version": "3.17.1", + "resolved": "https://registry.npmjs.org/typedoc-plugin-markdown/-/typedoc-plugin-markdown-3.17.1.tgz", + "integrity": "sha512-QzdU3fj0Kzw2XSdoL15ExLASt2WPqD7FbLeaqwT70+XjKyTshBnUlQA5nNREO1C2P8Uen0CDjsBLMsCQ+zd0lw==", "dev": true, "dependencies": { "handlebars": "^4.7.7" @@ -11528,9 +11528,9 @@ } }, "node_modules/typedoc/node_modules/minimatch": { - "version": "9.0.1", - "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-9.0.1.tgz", - "integrity": "sha512-0jWhJpD/MdhPXwPuiRkCbfYfSKp2qnn2eOc279qI7f+osl/l+prKSrvhg157zSYvx/1nmgn2NqdT6k2Z7zSH9w==", + "version": "9.0.3", + "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-9.0.3.tgz", + "integrity": "sha512-RHiac9mvaRw0x3AYRgDC1CxAP7HTcNrrECeA8YYJeWnpo+2Q5CegtZjaotWTWxDG3UeGA1coE05iH1mPjT/2mg==", "dev": true, "dependencies": { "brace-expansion": "^2.0.1" diff --git a/www/package.json b/www/package.json index a876c05d2..9cd839850 100644 --- a/www/package.json +++ b/www/package.json @@ -27,9 +27,9 @@ "devDependencies": { "@docusaurus/module-type-aliases": "^2.4.0", "@tsconfig/docusaurus": "^1.0.7", - "docusaurus-plugin-typedoc": "^0.19.2", - "typedoc": "^0.24.7", - "typedoc-plugin-markdown": "^3.15.3", + "docusaurus-plugin-typedoc": "^0.21.0", + "typedoc": "^0.25.4", + "typedoc-plugin-markdown": "^3.17.1", "typescript": "^5.0.4" }, "browserslist": {