OpenZeppelin / contracts-wizard

Interactive smart contract generator based on OpenZeppelin Contracts.
https://wizard.openzeppelin.com
MIT License
245 stars 135 forks source link

Show error page if embed version out of supported range #335

Closed ericglau closed 6 months ago

ericglau commented 6 months ago

In our documentation sites, we embed Wizard for different versions of the Contracts libraries, for example on https://docs.openzeppelin.com/contracts-cairo/0.9.0/wizard

However, Wizard is only compatible with specific versions of the libraries, which is specified (and shown on Wizard) as a semantic version string.

In the embeddings, we should allow passing through a version parameter for the selected version of the documentation. If this version is outside of the compatible versions, the embed will show an error page instead of the actual Wizard. By doing this, we will no longer need to manually remove Wizard from older versions of the doc sites.

This version can be passed in from a documentation page like this:

<oz-wizard style="display: block; min-height: 40rem;" data-lang="cairo" version="0.8.0"></oz-wizard>

Example result: https://deploy-preview-335--openzeppelin-contracts-wizard.netlify.app/embed?lang=cairo&version=0.8.0

socket-security[bot] commented 6 months ago

New and removed dependencies detected. Learn more about Socket for GitHub ↗︎

Package New capabilities Transitives Size Publisher
npm/@nomicfoundation/hardhat-toolbox@3.0.0 environment Transitive: eval, filesystem, network, shell, unsafe +544 200 MB fvictorio
npm/@nomicfoundation/hardhat-toolbox@4.0.0 environment Transitive: eval, filesystem, network, shell, unsafe +506 164 MB fvictorio
npm/@openzeppelin/hardhat-upgrades@3.0.3 filesystem Transitive: environment, eval, network, shell, unsafe +231 94.1 MB ericglau

🚮 Removed packages: npm/@alloc/quick-lru@5.2.0, npm/@babel/code-frame@7.23.5, npm/@isaacs/cliui@8.0.2, npm/@jridgewell/gen-mapping@0.3.3, npm/@jridgewell/source-map@0.3.5, npm/@pkgjs/parseargs@0.11.0, npm/@polka/url@1.0.0-next.24, npm/@popperjs/core@2.11.8, npm/@rollup/plugin-alias@5.1.0, npm/@rollup/plugin-commonjs@25.0.7, npm/@rollup/plugin-json@6.1.0, npm/@rollup/plugin-node-resolve@15.2.3, npm/@rollup/plugin-replace@5.0.5, npm/@rollup/plugin-typescript@11.1.6, npm/@rollup/pluginutils@5.1.0, npm/@trysound/sax@0.2.0, npm/@types/cssnano@5.1.0, npm/@types/estree@1.0.5, npm/@types/file-saver@2.0.7, npm/@types/istanbul-lib-coverage@2.0.6, npm/@types/node@18.19.18, npm/@types/parse-json@4.0.2, npm/@types/pug@2.0.10, npm/@types/resize-observer-browser@0.1.11, npm/@types/semver@7.5.7, npm/@types/uuid@9.0.8, npm/any-promise@1.3.0, npm/array-find-index@1.0.2, npm/array.prototype.flat@1.3.2, npm/array.prototype.flatmap@1.3.2, npm/arrgv@1.0.2, npm/arrify@3.0.0, npm/autoprefixer@10.4.17, npm/ava@5.3.1, npm/browserslist@4.22.3, npm/buffer-crc32@0.2.13, npm/callsites@4.1.0, npm/camelcase-css@2.0.1, npm/camelcase@5.3.1, npm/caniuse-lite@1.0.30001581, npm/ci-info@3.9.0, npm/cliui@5.0.0, npm/commander@7.2.0, npm/console-clear@1.1.1, npm/cosmiconfig@7.1.0, npm/cross-spawn@6.0.5, npm/css-declaration-sorter@7.1.1, npm/css-select@5.1.0, npm/css-tree@2.3.1, npm/css-what@6.1.0, npm/cssnano-preset-default@6.0.3, npm/cssnano-utils@4.0.1, npm/cssnano@6.0.3, npm/csso@5.0.5, npm/decamelize@1.2.0, npm/decode-uri-component@0.2.2, npm/detect-indent@6.1.0, npm/didyoumean@1.2.2, npm/dlv@1.1.3, npm/dom-serializer@2.0.0, npm/domelementtype@2.3.0, npm/domhandler@5.0.3, npm/domutils@3.1.0, npm/entities@4.5.0, npm/es6-promise@3.3.1, npm/estree-walker@2.0.2, npm/eventemitter3@4.0.7, npm/file-saver@2.0.5, npm/filter-obj@1.1.0, npm/find-up@3.0.0, npm/foreground-child@3.1.1, npm/glob@7.2.3, npm/highlight.js@11.9.0, npm/highlightjs-cairo@0.4.0, npm/highlightjs-solidity@2.0.6, npm/icss-utils@5.1.0, npm/immediate@3.0.6, npm/is-arguments@1.1.1, npm/is-generator-function@1.0.10, npm/is-string@1.0.7, npm/is-symbol@1.0.4, npm/is-typed-array@1.1.12, npm/isarray@2.0.5, npm/jackspeak@2.3.6, npm/jest-worker@26.6.2, npm/jiti@1.21.0, npm/jszip@3.10.1, npm/kleur@4.1.5, npm/lilconfig@3.0.0, npm/livereload-js@3.4.1, npm/livereload@0.9.3, npm/local-access@1.1.0, npm/magic-string@0.30.6, npm/mdn-data@2.0.30, npm/min-indent@1.0.1, npm/minipass@7.0.4, npm/mri@1.2.0, npm/mrmime@2.0.0, npm/mz@2.7.0, npm/normalize-url@6.1.0, npm/object-hash@3.0.0, npm/p-queue@6.6.2, npm/path-browserify@1.0.1, npm/path-key@2.0.1, npm/path-scurry@1.10.1, npm/pify@2.3.0, npm/pirates@4.0.6, npm/postcss-calc@9.0.1, npm/postcss-colormin@6.0.2, npm/postcss-convert-values@6.0.2, npm/postcss-discard-comments@6.0.1, npm/postcss-discard-duplicates@6.0.1, npm/postcss-discard-empty@6.0.1, npm/postcss-discard-overridden@6.0.1, npm/postcss-import@15.1.0, npm/postcss-js@4.0.1, npm/postcss-load-config@4.0.2, npm/postcss-merge-longhand@6.0.2, npm/postcss-merge-rules@6.0.3, npm/postcss-minify-font-values@6.0.1, npm/postcss-minify-gradients@6.0.1, npm/postcss-minify-params@6.0.2, npm/postcss-minify-selectors@6.0.2, npm/postcss-modules-extract-imports@3.0.0, npm/postcss-modules-local-by-default@4.0.4, npm/postcss-modules-scope@3.1.1, npm/postcss-modules-values@4.0.0, npm/postcss-nested@6.0.1, npm/postcss-normalize-charset@6.0.1, npm/postcss-normalize-display-values@6.0.1, npm/postcss-normalize-positions@6.0.1, npm/postcss-normalize-repeat-style@6.0.1, npm/postcss-normalize-string@6.0.1, npm/postcss-normalize-timing-functions@6.0.1, npm/postcss-normalize-unicode@6.0.2, npm/postcss-normalize-url@6.0.1, npm/postcss-normalize-whitespace@6.0.1, npm/postcss-ordered-values@6.0.1, npm/postcss-reduce-initial@6.0.2, npm/postcss-reduce-transforms@6.0.1, npm/postcss-selector-parser@6.0.15, npm/postcss-svgo@6.0.2, npm/postcss-unique-selectors@6.0.2, npm/postcss-value-parser@4.2.0, npm/postcss@8.4.35, npm/query-string@7.1.3, npm/resolve.exports@2.0.2, npm/resolve@1.22.8, npm/rimraf@5.0.5, npm/rollup-plugin-livereload@2.0.5, npm/rollup-plugin-styles@4.0.0, npm/rollup-plugin-svelte@7.1.6, npm/rollup-plugin-terser@7.0.2, npm/rollup@2.79.1, npm/rollup@3.29.4, npm/sade@1.8.1, npm/sander@0.5.1, npm/semiver@1.1.0, npm/semver@7.6.0, npm/sirv-cli@2.0.2, npm/solidity-ast@0.4.55, npm/sorcery@0.11.0, npm/source-map-js@1.0.2, npm/string-width@3.1.0, npm/strip-ansi@5.2.0, npm/strip-indent@3.0.0, npm/sucrase@3.35.0, npm/svelte-check@3.6.3, npm/svelte-preprocess@5.1.3, npm/svelte@3.59.2, npm/svelte@4.2.12, npm/tailwindcss@3.4.1, npm/throat@4.1.0, npm/tippy.js@6.3.7, npm/typescript@4.9.5, npm/util@0.12.5, npm/uuid@9.0.1, npm/which-typed-array@1.1.13, npm/wsrun@5.2.4, npm/yaml@1.10.2, npm/yargs-parser@13.1.2

View full report↗︎