Skip to content

Commit

Permalink
chore: rearrange create-lz-oapp selections (#1067)
Browse files Browse the repository at this point in the history
  • Loading branch information
St0rmBr3w authored Nov 22, 2024
1 parent 5b563f0 commit 9c95650
Show file tree
Hide file tree
Showing 3 changed files with 40 additions and 23 deletions.
54 changes: 34 additions & 20 deletions packages/create-lz-oapp/src/config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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',
Expand All @@ -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,
},
{
Expand All @@ -47,19 +40,40 @@ 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,
},
]
: []),
// 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,
},
]
: []),
// OApp Read examples are feature flagged for the time being
...(process.env.LZ_ENABLE_READ_EXAMPLE
? [
Expand Down
6 changes: 3 additions & 3 deletions tests-user/tests/create-lz-oapp.bats
Original file line number Diff line number Diff line change
Expand Up @@ -161,7 +161,7 @@ teardown() {
@test "should work with pnpm & native-oft-adapter example in CI mode" {
local DESTINATION="$PROJECTS_DIRECTORY/pnpm-native-oft-adapter"

npx --yes create-lz-oapp --ci --example native-oft-adapter --destination $DESTINATION --package-manager pnpm
LZ_ENABLE_NATIVE_EXAMPLE=1 npx --yes create-lz-oapp --ci --example native-oft-adapter --destination $DESTINATION --package-manager pnpm
cd "$DESTINATION"
pnpm compile
pnpm test
Expand Down Expand Up @@ -234,7 +234,7 @@ teardown() {
@test "should work with yarn & native-oft-adapter example in CI mode" {
local DESTINATION="$PROJECTS_DIRECTORY/yarn-native-oft-adapter"

YARN_CACHE_FOLDER="/tmp/.yarn-cache-native-oft-adapter-evm" npx --yes create-lz-oapp --ci --example native-oft-adapter --destination $DESTINATION --package-manager yarn
YARN_CACHE_FOLDER="/tmp/.yarn-cache-native-oft-adapter-evm" LZ_ENABLE_NATIVE_EXAMPLE=1 npx --yes create-lz-oapp --ci --example native-oft-adapter --destination $DESTINATION --package-manager yarn
cd "$DESTINATION"
yarn compile
yarn test
Expand Down Expand Up @@ -307,7 +307,7 @@ teardown() {
@test "should work with npm & native-oft-adapter example in CI mode" {
local DESTINATION="$PROJECTS_DIRECTORY/npm-native-oft-adapter"

npx --yes create-lz-oapp --ci --example native-oft-adapter --destination $DESTINATION --package-manager npm
LZ_ENABLE_NATIVE_EXAMPLE=1 npx --yes create-lz-oapp --ci --example native-oft-adapter --destination $DESTINATION --package-manager npm
cd "$DESTINATION"
npm run compile
npm run test
Expand Down
3 changes: 3 additions & 0 deletions turbo.json
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,9 @@
"LZ_ENABLE_EXPERIMENTAL_SIMULATION",
"LZ_ENABLE_EXPERIMENTAL_SOLANA_OFT_EXAMPLE",
"LZ_ENABLE_READ_EXAMPLE",
"LZ_ENABLE_ZKSOLC_EXAMPLE",
"LZ_ENABLE_NATIVE_EXAMPLE",
"LZ_ENABLE_UPGRADEABLE_EXAMPLE",

"LAYERZERO_EXAMPLES_REPOSITORY_URL",
"LAYERZERO_EXAMPLES_REPOSITORY_REF",
Expand Down

0 comments on commit 9c95650

Please sign in to comment.