Skip to content

Commit 64f1237

Browse files
committed
Merge remote-tracking branch 'origin/master' into unitySidekick
2 parents 1b3e22a + ae58723 commit 64f1237

127 files changed

Lines changed: 11318 additions & 1783 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.
Lines changed: 103 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,103 @@
1+
const fs = require('fs');
2+
const path = require('path');
3+
4+
function parseGuideCards() {
5+
const filePath = path.join(process.cwd(), 'guides', 'guide-overview.mdx');
6+
7+
if (!fs.existsSync(filePath)) {
8+
console.error('guides/guide-overview.mdx file not found');
9+
process.exit(1);
10+
}
11+
12+
const content = fs.readFileSync(filePath, 'utf8');
13+
14+
// Parse sections and cards
15+
const sections = [];
16+
17+
// Find Game Developers section
18+
const gameDevelopersMatch = content.match(/## Game Developers\s*<CardGroup[^>]*>\s*([\s\S]*?)\s*<\/CardGroup>/);
19+
if (gameDevelopersMatch) {
20+
const cards = parseCardsFromSection(gameDevelopersMatch[1]);
21+
sections.push({
22+
title: 'Game Developers',
23+
cards: cards
24+
});
25+
}
26+
27+
// Find Web3 section
28+
const web3Match = content.match(/## Web3\s*<CardGroup[^>]*>\s*([\s\S]*?)\s*<\/CardGroup>/);
29+
if (web3Match) {
30+
const cards = parseCardsFromSection(web3Match[1]);
31+
sections.push({
32+
title: 'Web3',
33+
cards: cards
34+
});
35+
}
36+
37+
const result = {
38+
lastUpdated: new Date().toISOString(),
39+
totalCards: sections.reduce((sum, section) => sum + section.cards.length, 0),
40+
sections: sections
41+
};
42+
43+
// Write to JSON file
44+
const outputPath = path.join(process.cwd(), 'guides', 'guide-cards.json');
45+
fs.writeFileSync(outputPath, JSON.stringify(result, null, 2));
46+
47+
console.log(`Successfully parsed ${result.totalCards} cards from guide-overview.mdx`);
48+
console.log(`Generated guide-cards.json with ${sections.length} sections`);
49+
50+
return result;
51+
}
52+
53+
function parseCardsFromSection(sectionContent) {
54+
const cards = [];
55+
56+
// Regex to match Card components with their attributes and content
57+
const cardRegex = /<Card\s+([\s\S]*?)>\s*([\s\S]*?)\s*<\/Card>/g;
58+
59+
let match;
60+
while ((match = cardRegex.exec(sectionContent)) !== null) {
61+
const attributesStr = match[1];
62+
const description = match[2].trim();
63+
64+
const card = {
65+
title: '',
66+
img: '',
67+
href: '',
68+
description: description
69+
};
70+
71+
// Parse attributes
72+
const titleMatch = attributesStr.match(/title="([^"]*)"/);
73+
if (titleMatch) {
74+
card.title = titleMatch[1];
75+
}
76+
77+
const imgMatch = attributesStr.match(/img="([^"]*)"/);
78+
if (imgMatch) {
79+
card.img = imgMatch[1];
80+
}
81+
82+
const hrefMatch = attributesStr.match(/href="([^"]*)"/);
83+
if (hrefMatch) {
84+
card.href = hrefMatch[1];
85+
}
86+
87+
cards.push(card);
88+
}
89+
90+
return cards;
91+
}
92+
93+
// Run the parser
94+
if (require.main === module) {
95+
try {
96+
parseGuideCards();
97+
} catch (error) {
98+
console.error('Error parsing guide cards:', error);
99+
process.exit(1);
100+
}
101+
}
102+
103+
module.exports = { parseGuideCards };
Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
name: Parse Guide Overview Cards
2+
3+
on:
4+
push:
5+
paths:
6+
- 'guides/guide-overview.mdx'
7+
pull_request:
8+
paths:
9+
- 'guides/guide-overview.mdx'
10+
11+
jobs:
12+
parse-cards:
13+
runs-on: ubuntu-latest
14+
15+
steps:
16+
- name: Checkout repository
17+
uses: actions/checkout@v4
18+
19+
- name: Setup Node.js
20+
uses: actions/setup-node@v4
21+
with:
22+
node-version: '18'
23+
24+
- name: Install dependencies
25+
run: npm install
26+
27+
- name: Parse guide overview cards
28+
run: node .github/scripts/parse-guide-cards.js
29+
30+
- name: Commit and push changes
31+
run: |
32+
git config --global user.name 'github-actions[bot]'
33+
git config --global user.email 'github-actions[bot]@users.noreply.github.com'
34+
git add guides/guide-cards.json
35+
if git diff --staged --quiet; then
36+
echo "No changes to commit"
37+
else
38+
git commit -m "Auto-update guide cards metadata [skip ci]"
39+
git push
40+
fi
41+
env:
42+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
---
2+
title: TopUpGasTank
3+
openapi: ./builder-api.json post /rpc/Builder/TopUpGasTank
4+
---

docs.json

Lines changed: 37 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -270,8 +270,31 @@
270270
{
271271
"group": "Hooks",
272272
"pages": [
273-
"sdk/marketplace-sdk/hooks/marketplace-actions",
274-
"sdk/marketplace-sdk/hooks/marketplace-data-hooks"
273+
{
274+
"group": "Marketplace Actions",
275+
"pages": [
276+
"sdk/marketplace-sdk/hooks/marketplace-actions/useCreateListingModal",
277+
"sdk/marketplace-sdk/hooks/marketplace-actions/useBuyModal",
278+
"sdk/marketplace-sdk/hooks/marketplace-actions/useMakeOfferModal",
279+
"sdk/marketplace-sdk/hooks/marketplace-actions/useSellModal",
280+
"sdk/marketplace-sdk/hooks/marketplace-actions/useCancelOrder"
281+
]
282+
},
283+
{
284+
"group": "Marketplace Data",
285+
"pages": [
286+
"sdk/marketplace-sdk/hooks/marketplace-data/overview",
287+
"sdk/marketplace-sdk/hooks/marketplace-data/useCountOfCollectables",
288+
"sdk/marketplace-sdk/hooks/marketplace-data/useListCollectibles",
289+
"sdk/marketplace-sdk/hooks/marketplace-data/useListCollectiblesPaginated",
290+
"sdk/marketplace-sdk/hooks/marketplace-data/useMarketplaceConfig",
291+
"sdk/marketplace-sdk/hooks/marketplace-data/useMarketCurrencies",
292+
"sdk/marketplace-sdk/hooks/marketplace-data/useCollection",
293+
"sdk/marketplace-sdk/hooks/marketplace-data/useCollectionBalanceDetails",
294+
"sdk/marketplace-sdk/hooks/marketplace-data/useCollectionDetails",
295+
"sdk/marketplace-sdk/hooks/marketplace-data/useInventory"
296+
]
297+
}
275298
]
276299
}
277300
]
@@ -318,7 +341,6 @@
318341
"sdk/unity/power/sign-messages",
319342
"sdk/unity/power/deploy-contracts",
320343
"sdk/unity/power/contract-events",
321-
"sdk/unity/power/wallet-ui",
322344
{
323345
"group": "Advanced Blockchain Interactions",
324346
"pages": [
@@ -446,7 +468,8 @@
446468
"sdk/headless-wallet/on-ramp",
447469
"sdk/headless-wallet/fee-options",
448470
"sdk/headless-wallet/verification",
449-
"sdk/headless-wallet/transaction-receipts"
471+
"sdk/headless-wallet/transaction-receipts",
472+
"sdk/headless-wallet/use-with-privy"
450473
]
451474
}
452475
]
@@ -815,7 +838,8 @@
815838
"guides/typed-on-chain-signatures",
816839
"guides/building-relaying-server",
817840
"guides/analytics-guide",
818-
"guides/build-embedding-wallet"
841+
"guides/build-embedding-wallet",
842+
"guides/use-with-privy"
819843
]
820844
},
821845
{
@@ -1230,7 +1254,8 @@
12301254
"ja/sdk/headless-wallet/on-ramp",
12311255
"ja/sdk/headless-wallet/fee-options",
12321256
"ja/sdk/headless-wallet/verification",
1233-
"ja/sdk/headless-wallet/transaction-receipts"
1257+
"ja/sdk/headless-wallet/transaction-receipts",
1258+
"ja/sdk/headless-wallet/use-with-privy"
12341259
]
12351260
}
12361261
]
@@ -2031,7 +2056,8 @@
20312056
"es/sdk/headless-wallet/on-ramp",
20322057
"es/sdk/headless-wallet/fee-options",
20332058
"es/sdk/headless-wallet/verification",
2034-
"es/sdk/headless-wallet/transaction-receipts"
2059+
"es/sdk/headless-wallet/transaction-receipts",
2060+
"es/sdk/headless-wallet/use-with-privy"
20352061
]
20362062
}
20372063
]
@@ -2568,6 +2594,10 @@
25682594
{
25692595
"source": "/solutions/builder/overview",
25702596
"destination": "/solutions/getting-started"
2597+
},
2598+
{
2599+
"source": "/solutions/wallets/embedded-wallet/examples/use-with-privy",
2600+
"destination": "/sdk/headless-wallet/use-with-privy"
25712601
}
25722602
],
25732603
"theme": "mint"

0 commit comments

Comments
 (0)