From 0b0f06a7769e2120192fc4e60f1578d61685d977 Mon Sep 17 00:00:00 2001 From: Matthew Krak Date: Thu, 21 Nov 2024 12:33:37 +0700 Subject: [PATCH] chore: rearrange `create-lz-oapp` selections Change the selection options available via feature flag and exposed by default within create-lz-oapp --- packages/create-lz-oapp/src/config.ts | 58 ++++++++++++++++++--------- 1 file changed, 38 insertions(+), 20 deletions(-) diff --git a/packages/create-lz-oapp/src/config.ts b/packages/create-lz-oapp/src/config.ts index 28b1fa847..cf6bc50f3 100644 --- a/packages/create-lz-oapp/src/config.ts +++ b/packages/create-lz-oapp/src/config.ts @@ -18,13 +18,6 @@ export const getExamples = (): Example[] => { const ref = process.env.LAYERZERO_EXAMPLES_REPOSITORY_REF || '' return [ - { - id: 'oft', - label: 'OFT', - repository, - directory: 'examples/oft', - ref, - }, { id: 'oapp', label: 'OApp', @@ -33,10 +26,10 @@ export const getExamples = (): Example[] => { ref, }, { - id: 'onft721', - label: 'ONFT721', + id: 'oft', + label: 'OFT', repository, - directory: 'examples/onft721', + directory: 'examples/oft', ref, }, { @@ -47,19 +40,44 @@ export const getExamples = (): Example[] => { ref, }, { - id: 'native-oft-adapter', - label: 'NativeOFTAdapter', - repository, - directory: 'examples/native-oft-adapter', - ref, - }, - { - id: 'oft-upgradeable', - label: 'Upgradeable OFT', + id: 'onft721', + label: 'ONFT721', repository, - directory: 'examples/oft-upgradeable', + directory: 'examples/onft721', ref, }, + // ZK-Solc examples are feature flagged for the time being + ...(process.env.LZ_ENABLE_ZKSOLC_EXAMPLE + ? [ + { id: 'onft721-zksync', label: 'ONFT721 zksolc', repository, directory: 'examples/onft721-zksync', ref }, + ] + : []), + // Upgradeable contract examples are feature flagged for the time being + ...(process.env.LZ_ENABLE_UPGRADEABLE_EXAMPLE + ? [ + { id: 'oft-upgradeable', label: 'UpgradeableOFT', repository, directory: 'examples/oft-upgradeable', ref }, + { + id: 'uniswap-read', + label: 'UniswapV3 Quote', + repository, + directory: 'examples/uniswap-read', + ref, + }, + ] + : []), + // Native OFT Adapter example is feature flagged for the time being + ...(process.env.LZ_ENABLE_NATIVE_EXAMPLE + ? [ + { id: 'native-oft-adapter', label: 'NativeOFTAdapter', repository, directory: 'examples/native-oft-adapter', ref }, + { + id: 'uniswap-read', + label: 'UniswapV3 Quote', + repository, + directory: 'examples/uniswap-read', + ref, + }, + ] + : []), // OApp Read examples are feature flagged for the time being ...(process.env.LZ_ENABLE_READ_EXAMPLE ? [