Skip to content

Commit 31926ee

Browse files
fix: DVR-330 | Changed the mechanism on example app's sidebar_orders for consistency (#2599)
1 parent 7c99f96 commit 31926ee

File tree

25 files changed

+84
-95
lines changed

25 files changed

+84
-95
lines changed

.github/workflows/publish-example-tutorials.yaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ on:
88
paths:
99
- 'examples/*/*/tutorial.md'
1010
- 'examples/*/*/metadata.json'
11+
- 'examples/*/*/features.json'
1112
# Allow manual triggering
1213
workflow_dispatch:
1314

examples/_parsed/checkout-examples.json

Lines changed: 19 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -2,22 +2,20 @@
22
"sdk-connect-with-nextjs": {
33
"tutorial": "sdk-connect-with-nextjs.md",
44
"metadata": {
5-
"title": "Connect with MetaMask in Next.js",
6-
"description": "A Next.js example that demonstrates how to integrate the Immutable Checkout SDK to connect with MetaMask wallets, with and without explicit permissions",
5+
"title": "Checkout SDK Connect with NextJS",
6+
"description": "Example app demonstrating integration of the Immutable Checkout SDK with Next.js for connecting with MetaMask wallets.",
77
"keywords": [
88
"Immutable",
99
"SDK",
1010
"Checkout",
11-
"Wallet",
1211
"MetaMask",
13-
"Connect",
14-
"Next.js"
12+
"Web3",
13+
"Connect Wallet"
1514
],
1615
"tech_stack": [
1716
"Next.js",
1817
"TypeScript",
19-
"React",
20-
"ethers.js"
18+
"Ethers.js"
2119
],
2220
"product": "Checkout",
2321
"programming_language": "TypeScript",
@@ -28,25 +26,25 @@
2826
"tutorial": "sdk-gas-estimation-with-nextjs.md",
2927
"metadata": {
3028
"title": "Gas Estimation with Checkout SDK and Next.js",
31-
"description": "Example app demonstrating how to estimate gas fees for swap and bridge transactions using the Immutable Checkout SDK",
29+
"description": "Demonstrates how to use the Immutable Checkout SDK to estimate gas fees for different types of transactions such as swaps and bridging to Layer 2.",
3230
"keywords": [
3331
"Immutable",
3432
"SDK",
3533
"Gas Estimation",
34+
"Checkout",
35+
"MetaMask",
36+
"Next.js",
3637
"Swap",
37-
"Bridge",
38-
"Layer 2",
39-
"MetaMask"
38+
"Bridge"
4039
],
4140
"tech_stack": [
4241
"Next.js",
43-
"React",
4442
"TypeScript",
45-
"Ethers.js"
43+
"ethers.js"
4644
],
4745
"product": "Checkout",
4846
"programming_language": "TypeScript",
49-
"sidebar_order": 2
47+
"sidebar_order": 4
5048
}
5149
},
5250
"sdk-switch-network-with-nextjs": {
@@ -77,18 +75,20 @@
7775
"tutorial": "sdk-wallet-balance-with-nextjs.md",
7876
"metadata": {
7977
"title": "Wallet Balance with NextJS",
80-
"description": "Example app demonstrating how to check wallet balances using the Immutable Checkout SDK with NextJS",
78+
"description": "A NextJS app that demonstrates how to use the Immutable Checkout SDK to connect to MetaMask, fetch token balances, and display token information",
8179
"keywords": [
8280
"Immutable",
8381
"SDK",
84-
"Checkout",
85-
"Wallet Balance",
86-
"MetaMask"
82+
"Wallet",
83+
"Balance",
84+
"MetaMask",
85+
"Token",
86+
"NextJS"
8787
],
8888
"tech_stack": [
8989
"NextJS",
9090
"TypeScript",
91-
"React"
91+
"ethers.js"
9292
],
9393
"product": "Checkout",
9494
"programming_language": "TypeScript",

examples/_parsed/contracts-examples.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,8 @@
1919
"Immutable Contracts"
2020
],
2121
"product": "Contracts",
22-
"programming_language": "TypeScript"
22+
"programming_language": "TypeScript",
23+
"sidebar_order": 1
2324
}
2425
}
2526
}

examples/_parsed/orderbook-examples.json

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@
2323
],
2424
"product": "Orderbook",
2525
"programming_language": "TypeScript",
26-
"sidebar_order": 1
26+
"sidebar_order": 2
2727
}
2828
},
2929
"create-collection-bid-with-nextjs": {
@@ -49,7 +49,7 @@
4949
],
5050
"product": "Orderbook",
5151
"programming_language": "TypeScript",
52-
"sidebar_order": 2
52+
"sidebar_order": 3
5353
}
5454
},
5555
"create-listing-with-nextjs": {
@@ -74,7 +74,7 @@
7474
],
7575
"product": "Orderbook",
7676
"programming_language": "TypeScript",
77-
"sidebar_order": 3
77+
"sidebar_order": 1
7878
}
7979
},
8080
"fulfill-bid-with-nextjs": {
@@ -99,7 +99,7 @@
9999
],
100100
"product": "Orderbook",
101101
"programming_language": "TypeScript",
102-
"sidebar_order": 4
102+
"sidebar_order": 5
103103
}
104104
},
105105
"fulfill-collection-bid-with-nextjs": {
@@ -125,32 +125,32 @@
125125
],
126126
"product": "Orderbook",
127127
"programming_language": "TypeScript",
128-
"sidebar_order": 5
128+
"sidebar_order": 6
129129
}
130130
},
131131
"fulfill-listing-with-nextjs": {
132132
"tutorial": "fulfill-listing-with-nextjs.md",
133133
"metadata": {
134-
"title": "Fulfill Listings with Next.js",
135-
"description": "A Next.js application that demonstrates how to fulfill ERC721 and ERC1155 listings using the Immutable Orderbook SDK",
134+
"title": "Fulfill Listing with Next.js",
135+
"description": "Demonstrates how to fulfill ERC721 and ERC1155 listings using the Immutable Orderbook SDK with Next.js",
136136
"keywords": [
137137
"Immutable",
138138
"SDK",
139139
"Orderbook",
140-
"Fulfill Listing",
140+
"Listing",
141+
"Fulfill",
141142
"ERC721",
142143
"ERC1155",
143144
"Next.js"
144145
],
145146
"tech_stack": [
146147
"Next.js",
147148
"TypeScript",
148-
"Immutable SDK",
149-
"Ethers.js"
149+
"ethers"
150150
],
151151
"product": "Orderbook",
152152
"programming_language": "TypeScript",
153-
"sidebar_order": 6
153+
"sidebar_order": 4
154154
}
155155
}
156156
}

examples/_parsed/passport-examples.json

Lines changed: 7 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@
2020
],
2121
"product": "Passport",
2222
"programming_language": "TypeScript",
23-
"sidebar_order": 1
23+
"sidebar_order": 2
2424
}
2525
},
2626
"login-with-nextjs": {
@@ -71,7 +71,7 @@
7171
],
7272
"product": "Passport",
7373
"programming_language": "TypeScript",
74-
"sidebar_order": 3
74+
"sidebar_order": 6
7575
}
7676
},
7777
"wallets-connect-with-nextjs": {
@@ -99,7 +99,7 @@
9999
],
100100
"product": "Passport",
101101
"programming_language": "TypeScript",
102-
"sidebar_order": 4
102+
"sidebar_order": 3
103103
}
104104
},
105105
"wallets-signing-with-nextjs": {
@@ -130,25 +130,23 @@
130130
"tutorial": "wallets-transactions-with-nextjs.md",
131131
"metadata": {
132132
"title": "Wallet Connection and Transaction Execution with Next.js",
133-
"description": "A Next.js application that demonstrates how to connect to users' wallets and execute transactions using Immutable Passport",
133+
"description": "This example demonstrates how to establish a connection to the user's wallet and execute transactions on the Immutable zkEVM network using Passport.",
134134
"keywords": [
135135
"Immutable",
136136
"SDK",
137137
"Passport",
138138
"Wallet Connection",
139139
"Transaction Execution",
140-
"Next.js",
141-
"ERC-721"
140+
"zkEVM"
142141
],
143142
"tech_stack": [
144143
"Next.js",
145144
"TypeScript",
146-
"Ethers.js",
147-
"Tailwind CSS"
145+
"ethers.js"
148146
],
149147
"product": "Passport",
150148
"programming_language": "TypeScript",
151-
"sidebar_order": 6
149+
"sidebar_order": 4
152150
}
153151
}
154152
}

examples/_scripts/sample-app-parser.mjs

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,10 +23,18 @@ const main = (product) => {
2323
let metadataContent = '{}';
2424
try {
2525
metadataContent = fs.readFileSync(path.join(appDir, 'metadata.json'), 'utf8');
26+
// add sidebar_order to metadata.json by using the features.json file
27+
const featuresContent = fs.readFileSync(path.join(appDir, 'features.json'), 'utf8');
28+
const features = JSON.parse(featuresContent);
29+
30+
const metadataObject = JSON.parse(metadataContent);
31+
metadataObject.sidebar_order = features.order;
32+
metadataContent = JSON.stringify(metadataObject, null, 2);
33+
2634
} catch (error) {
2735
console.log(`No metadata.json found for ${app}`);
2836
}
29-
37+
3038
// Check if tutorial.md exists but don't read its content
3139
let tutorialExists = false;
3240
try {

examples/checkout/prompt.txt

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,6 @@ Create a metadata.json file in the example app's root with the following structu
7979
"tech_stack": ["[Framework]", "[Library]", "..."],
8080
"product": "[Passport/Checkout/Orderbook/etc]",
8181
"programming_language": "[TypeScript/JavaScript/etc]",
82-
"sidebar_order": [number] // This value will be grepped from the features.json file
8382
}
8483

8584

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,8 @@
11
{
2-
"title": "Connect with MetaMask in Next.js",
3-
"description": "A Next.js example that demonstrates how to integrate the Immutable Checkout SDK to connect with MetaMask wallets, with and without explicit permissions",
4-
"keywords": ["Immutable", "SDK", "Checkout", "Wallet", "MetaMask", "Connect", "Next.js"],
5-
"tech_stack": ["Next.js", "TypeScript", "React", "ethers.js"],
2+
"title": "Checkout SDK Connect with NextJS",
3+
"description": "Example app demonstrating integration of the Immutable Checkout SDK with Next.js for connecting with MetaMask wallets.",
4+
"keywords": ["Immutable", "SDK", "Checkout", "MetaMask", "Web3", "Connect Wallet"],
5+
"tech_stack": ["Next.js", "TypeScript", "Ethers.js"],
66
"product": "Checkout",
7-
"programming_language": "TypeScript",
8-
"sidebar_order": 1
7+
"programming_language": "TypeScript"
98
}
Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,8 @@
11
{
22
"title": "Gas Estimation with Checkout SDK and Next.js",
3-
"description": "Example app demonstrating how to estimate gas fees for swap and bridge transactions using the Immutable Checkout SDK",
4-
"keywords": ["Immutable", "SDK", "Gas Estimation", "Swap", "Bridge", "Layer 2", "MetaMask"],
5-
"tech_stack": ["Next.js", "React", "TypeScript", "Ethers.js"],
3+
"description": "Demonstrates how to use the Immutable Checkout SDK to estimate gas fees for different types of transactions such as swaps and bridging to Layer 2.",
4+
"keywords": ["Immutable", "SDK", "Gas Estimation", "Checkout", "MetaMask", "Next.js", "Swap", "Bridge"],
5+
"tech_stack": ["Next.js", "TypeScript", "ethers.js"],
66
"product": "Checkout",
7-
"programming_language": "TypeScript",
8-
"sidebar_order": 2
7+
"programming_language": "TypeScript"
98
}

examples/checkout/sdk-switch-network-with-nextjs/metadata.json

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,5 @@
44
"keywords": ["Immutable", "SDK", "MetaMask", "Network Switching", "Checkout", "Wallet Connection"],
55
"tech_stack": ["Next.js", "TypeScript", "React", "Ethers.js"],
66
"product": "Checkout",
7-
"programming_language": "TypeScript",
8-
"sidebar_order": 3
7+
"programming_language": "TypeScript"
98
}

0 commit comments

Comments
 (0)