Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Upgrade nextra #226

Merged
merged 7 commits into from
Jan 13, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions next.config.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,10 @@ import nextra from "nextra";

const withNextra = nextra({
theme: "nextra-theme-docs",
themeConfig: "./src/theme.config.js",
themeConfig: "./src/theme.config.jsx",
latex: true,
flexsearch: {
codeblock: false,
search: {
codeblocks: false,
},
});

Expand Down
4,476 changes: 2,336 additions & 2,140 deletions package-lock.json

Large diffs are not rendered by default.

24 changes: 12 additions & 12 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,27 +10,27 @@
"start": "next start"
},
"dependencies": {
"@radix-ui/react-icons": "^1.3.0",
"@radix-ui/react-tooltip": "^1.1.2",
"class-variance-authority": "^0.7.0",
"@radix-ui/react-icons": "^1.3.2",
"@radix-ui/react-tooltip": "^1.1.6",
"class-variance-authority": "^0.7.1",
"clsx": "^2.1.1",
"next": "^14.2.7",
"nextra": "^2.13.4",
"nextra-theme-docs": "^2.13.4",
"next": "^15.1.4",
"nextra": "^3.3.1",
"nextra-theme-docs": "^3.3.1",
"react": "^18.3.1",
"react-dom": "^18.3.1",
"sharp": "^0.33.5",
"tailwind-merge": "^2.5.2",
"tailwind-merge": "^2.6.0",
"tailwindcss-animate": "^1.0.7"
},
"devDependencies": {
"autoprefixer": "^10.4.20",
"git-format-staged": "^3.1.1",
"gray-matter": "^4.0.3",
"husky": "^9.1.5",
"postcss": "^8.4.41",
"prettier": "3.3.3",
"prettier-plugin-tailwindcss": "^0.6.6",
"tailwindcss": "^3.4.10"
"husky": "^9.1.7",
"postcss": "^8.4.49",
"prettier": "3.4.2",
"prettier-plugin-tailwindcss": "^0.6.9",
"tailwindcss": "^3.4.17"
}
}
6 changes: 1 addition & 5 deletions src/components/TagDots.jsx
Original file line number Diff line number Diff line change
@@ -1,8 +1,4 @@
import {
Tooltip,
TooltipContent,
TooltipTrigger,
} from "@/components/ui/tooltip";
import { Tooltip, TooltipContent, TooltipTrigger } from "@/components/ui/tooltip";
import tagsObj from "@/utils/tags.json";
import * as TooltipPrimitive from "@radix-ui/react-tooltip";
import Link from "next/link";
Expand Down
22 changes: 5 additions & 17 deletions src/components/TagFilter.jsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import tagsObj from "@/utils/tags.json";
import { useRouter } from "next/router";
import { useSearchParams } from "next/navigation";
import { useRouter } from "next/router";
import TagPill from "./TagPill";

export default function TagFilter() {
Expand All @@ -9,16 +9,11 @@ export default function TagFilter() {
const urlTags = searchParams.getAll("tag");

const routes = Object.entries(tagsObj.routes)
.filter(
([, tags]) =>
!urlTags.length || urlTags.find((urlTag) => tags.includes(urlTag)),
)
.filter(([, tags]) => !urlTags.length || urlTags.find((urlTag) => tags.includes(urlTag)))
.map(([route]) => route)
.sort();

const minRouteDepth = Math.min(
...routes.map((route) => route.match(/\//gi).length),
);
const minRouteDepth = Math.min(...routes.map((route) => route.match(/\//gi).length));

const toggleTag = (selectedTag) => {
let newTags = [];
Expand All @@ -34,17 +29,10 @@ export default function TagFilter() {

return (
<>
<p className="my-4">
Select one or more tags to list its associated articles
</p>
<p className="my-4">Select one or more tags to list its associated articles</p>
<div className="my-4 flex flex-wrap gap-2">
{tagsObj.allTags.map((tag) => (
<TagPill
key={tag}
tag={tag}
onClick={() => toggleTag(tag)}
checked={urlTags.includes(tag)}
/>
<TagPill key={tag} tag={tag} onClick={() => toggleTag(tag)} checked={urlTags.includes(tag)} />
))}
</div>
{routes.length ? (
Expand Down
File renamed without changes.
15 changes: 15 additions & 0 deletions src/pages/_meta.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
export default {
index: "Welcome",
core: "CosmWasm Core",
wasmd: "Wasmd",
ibc: "IBC",
sylvia: "Sylvia",
storey: "Storey",
"cw-storage-plus": "StoragePlus",
"cw-multi-test": "MultiTest",
"how-to-doc": "How to doc",
tags: {
display: "hidden",
},
tutorial: "Tutorial",
};
15 changes: 0 additions & 15 deletions src/pages/_meta.json

This file was deleted.

9 changes: 9 additions & 0 deletions src/pages/core/_meta.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
export default {
installation: "Installation",
entrypoints: "Entrypoints",
architecture: "Architecture",
"standard-library": "Standard Library",
conventions: "Conventions",
advanced: "Advanced",
specification: "Specification",
};
9 changes: 0 additions & 9 deletions src/pages/core/_meta.json

This file was deleted.

3 changes: 3 additions & 0 deletions src/pages/core/advanced/_meta.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
export default {
"measuring-time": "Measuring time",
};
3 changes: 0 additions & 3 deletions src/pages/core/advanced/_meta.json

This file was deleted.

8 changes: 8 additions & 0 deletions src/pages/core/architecture/_meta.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
export default {
semantics: "Semantics",
"actor-model": "Actor Model",
events: "Events",
gas: "Gas",
pinning: "Pinning",
transactions: "Transactions",
};
8 changes: 0 additions & 8 deletions src/pages/core/architecture/_meta.json

This file was deleted.

4 changes: 4 additions & 0 deletions src/pages/core/conventions/_meta.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
export default {
"library-feature": "Library feature",
"enum-dispatch": "Enum dispatch",
};
4 changes: 0 additions & 4 deletions src/pages/core/conventions/_meta.json

This file was deleted.

7 changes: 7 additions & 0 deletions src/pages/core/entrypoints/_meta.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
export default {
instantiate: "Instantiate",
execute: "Execute",
query: "Query",
migrate: "Migrate",
sudo: "Sudo",
};
7 changes: 0 additions & 7 deletions src/pages/core/entrypoints/_meta.json

This file was deleted.

3 changes: 3 additions & 0 deletions src/pages/core/specification/_meta.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
export default {
"instantiate2-algo": "Instantiate2 Algorithm",
};
3 changes: 0 additions & 3 deletions src/pages/core/specification/_meta.json

This file was deleted.

4 changes: 4 additions & 0 deletions src/pages/core/standard-library/_meta.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
export default {
math: "Math",
cryptography: "Cryptography",
};
4 changes: 0 additions & 4 deletions src/pages/core/standard-library/_meta.json

This file was deleted.

6 changes: 6 additions & 0 deletions src/pages/core/standard-library/cryptography/_meta.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
export default {
ed25519: "Ed25519",
p256: "P-256",
k256: "K-256",
"bls12-381": "BLS12-381",
};
6 changes: 0 additions & 6 deletions src/pages/core/standard-library/cryptography/_meta.json

This file was deleted.

4 changes: 4 additions & 0 deletions src/pages/core/standard-library/math/_meta.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
export default {
decimals: "Decimals",
integers: "Integers",
};
4 changes: 0 additions & 4 deletions src/pages/core/standard-library/math/_meta.json

This file was deleted.

9 changes: 9 additions & 0 deletions src/pages/cw-multi-test/_meta.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
export default {
installation: "Installation",
features: "Features",
"getting-started": "Getting started",
app: "App",
"app-builder": "AppBuilder",
blocks: "Blocks",
addresses: "Addresses",
};
9 changes: 0 additions & 9 deletions src/pages/cw-multi-test/_meta.json

This file was deleted.

8 changes: 4 additions & 4 deletions src/pages/cw-multi-test/addresses.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
tags: ["multitest", "addresses"]
---

import { Cards, Card } from "nextra/components";
import { Cards } from "nextra/components";

# Addresses

Expand All @@ -11,7 +11,7 @@ The following chapters provide useful explanations of how addresses are managed
Click on any of the cards below to learn more about each address category.

<Cards>
<Card title="User address" href="addresses/user-address" icon="" children="" />
<Card title="Contract address" href="addresses/contract-address" icon="" children="" />
<Card title="Validator address" href="addresses/validator-address" icon="" children="" />
<Cards.Card title="User address" href="addresses/user-address" icon="" children="" />
<Cards.Card title="Contract address" href="addresses/contract-address" icon="" children="" />
<Cards.Card title="Validator address" href="addresses/validator-address" icon="" children="" />
</Cards>
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
export default {
"user-address": "User address",
"contract-address": "Contract address",
"validator-address": "Validator address"
}
"validator-address": "Validator address",
};
6 changes: 3 additions & 3 deletions src/pages/cw-multi-test/getting-started.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
tags: ["multitest", "getting started"]
---

import { Cards, Card } from "nextra/components";
import { Cards } from "nextra/components";

# Getting started

Expand All @@ -19,6 +19,6 @@ pure CosmWasm libraries and the other using the Sylvia framework. The functional
**counter** smart contract is the same in both versions.

<Cards>
<Card title="Counter" href="getting-started/counter" icon="" children="" />
<Card title="Writing tests" href="getting-started/writing-tests" icon="" children="" />
<Cards.Card title="Counter" href="getting-started/counter" icon="" children="" />
<Cards.Card title="Writing tests" href="getting-started/writing-tests" icon="" children="" />
</Cards>
4 changes: 4 additions & 0 deletions src/pages/cw-multi-test/getting-started/_meta.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
export default {
counter: "Counter",
"writing-tests": "Writing tests",
};
4 changes: 0 additions & 4 deletions src/pages/cw-multi-test/getting-started/_meta.json

This file was deleted.

6 changes: 3 additions & 3 deletions src/pages/cw-multi-test/getting-started/counter.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
tags: ["multitest", "getting started", "counter"]
---

import { Callout, Cards, Card } from "nextra/components";
import { Callout, Cards } from "nextra/components";

# Counter

Expand Down Expand Up @@ -132,13 +132,13 @@ contract.
</Callout>

<Cards>
<Card
<Cards.Card
title="Counter smart contract written using pure CosmWasm libraries"
href="counter/counter-cosmwasm"
icon=""
children=""
/>
<Card
<Cards.Card
title="Counter smart contract written using Sylvia framework"
href="counter/counter-sylvia"
icon=""
Expand Down
4 changes: 4 additions & 0 deletions src/pages/cw-multi-test/getting-started/counter/_meta.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
export default {
"counter-cosmwasm": "CosmWasm",
"counter-sylvia": "Sylvia",
};
4 changes: 0 additions & 4 deletions src/pages/cw-multi-test/getting-started/counter/_meta.json

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
tags: ["multitest", "getting started", "counter", "CosmWasm"]
---

import { Card, Cards } from "nextra/components";
import { Cards } from "nextra/components";

# Counter written in CosmWasm

Expand Down Expand Up @@ -477,8 +477,8 @@ Having the **counter** smart contract prepared, you can begin writing tests usin
or you might want to check the Sylvia version of the **counter** smart contract first.

<Cards>
<Card title="Writing tests" href="../writing-tests" icon="" children="" />
<Card
<Cards.Card title="Writing tests" href="../writing-tests" icon="" children="" />
<Cards.Card
title="Counter written using the Sylvia framework"
href="counter-sylvia"
icon=""
Expand Down
Loading
Loading