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

Nextra POC #290

Merged
merged 111 commits into from
Jan 24, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
111 commits
Select commit Hold shift + click to select a range
f71a7b1
Update SUMMARY.md (#251)
tanay1337 Oct 17, 2023
866bcaf
Add GH action for readability (#254)
tanay1337 Oct 20, 2023
c42e78e
Add workflow for style check on PRs (#255)
tanay1337 Oct 20, 2023
dc399b3
Update workflow setting
Oct 23, 2023
f665bf1
Add link check workflow (#257)
tanay1337 Oct 23, 2023
ac4df31
Remove link check GH action
Oct 23, 2023
457a4a5
Link check workflow (#259)
tanay1337 Oct 23, 2023
d743b34
Add weekly link checker (#260)
tanay1337 Oct 23, 2023
425dbb8
Add manual trigger for testing
Oct 24, 2023
6071df8
Fix conditional for issue creation
Oct 24, 2023
942de0c
Update conditional for workflow
Oct 24, 2023
4e9e445
Minor updates to the workflow
Oct 24, 2023
0f562ae
Update information architecture (#265)
tanay1337 Oct 27, 2023
bbbd890
Update Safe Apps section (#267)
tanay1337 Oct 27, 2023
78e743d
Update IA for reference (#268)
tanay1337 Oct 27, 2023
e3dc95b
docs: fix typos (#271)
xiaolou86 Nov 13, 2023
b2a2ad0
fix: update `@web3auth/*` versions (#270)
iamacook Nov 14, 2023
6fbe44a
Update README.md (#276)
tanay1337 Nov 16, 2023
5e561b1
Add script to generate Supported Networks pages from safe-deployments…
louis-md Nov 23, 2023
ba3e227
Link checks (#275)
louis-md Nov 23, 2023
0e7c0e7
Add Pimlico to Safe Modules (#279)
tanay1337 Nov 24, 2023
4d2f19d
Update weekly-link-check.yml (#281)
tanay1337 Nov 24, 2023
e5becc9
Revert "Update weekly-link-check.yml (#281)" (#283)
tanay1337 Nov 24, 2023
c32fcf9
Link fixes (#284)
tanay1337 Nov 24, 2023
ee0962d
Link checks (#285)
louis-md Nov 24, 2023
c9df891
protocol-kit v2.0 (#266)
DaniSomoza Nov 27, 2023
ca7f318
Switch from gitbook to nextra
louis-md Nov 28, 2023
8ceb7ab
Migrate getting started section
louis-md Nov 28, 2023
bf58141
Migrate assets
louis-md Nov 28, 2023
bdd4522
Migrate misc section
louis-md Nov 28, 2023
45297c5
Migrate safe-apps section
louis-md Nov 28, 2023
2700414
Migrate safe-core-api section
louis-md Nov 28, 2023
8a91a22
Migrate safe-core-sdk section
louis-md Nov 28, 2023
8b77008
Migrate safe-smart-account section
louis-md Nov 28, 2023
51d3172
Migrate safe-core-protocol section
louis-md Nov 28, 2023
6efc1b5
Add index page
louis-md Nov 28, 2023
cb3abba
Update generate supported network script
louis-md Nov 28, 2023
e1f5878
Fix broken links & vale errors
louis-md Nov 28, 2023
c946192
Fix vale errors
louis-md Nov 28, 2023
0a39786
Fix vale errors
louis-md Nov 28, 2023
f3f64e6
Fix vale errors
louis-md Nov 28, 2023
558747a
Reorder sidebar (#292)
tanay1337 Nov 29, 2023
e2da419
Implement design feedback (color palette, font)
louis-md Nov 29, 2023
0d8d6c7
Add torusscan as a deprecated block explorer in generateSupportedNetw…
louis-md Nov 29, 2023
aa6932d
Add footer from safe.global
louis-md Nov 29, 2023
c8b2e64
Remove Home component; redirect index to first page
louis-md Nov 29, 2023
3b7272b
Implement design feedback (navbar background color & backdrop filter)
louis-md Nov 29, 2023
d393a62
Add legacy `safe-core-sdk` migration guide (#291)
dasanra Nov 30, 2023
a175bad
Add middleware information for Safe Apps (#293)
tanay1337 Nov 30, 2023
6fdc161
Fix information architecture
louis-md Nov 30, 2023
e6db49c
Fix error in code snippet (#295)
dasanra Dec 1, 2023
9b8d955
Fix all images & callouts
louis-md Dec 1, 2023
73d9252
Collapse sidebar menu items
louis-md Dec 4, 2023
a72cda6
Add deployment workflow
louis-md Dec 4, 2023
0bbad9e
Fix deployment workflow
louis-md Dec 4, 2023
785c14d
Fix deployment workflow
louis-md Dec 4, 2023
85dc6c3
Fix deployment workflow
louis-md Dec 4, 2023
f660d7b
docs(auth-kit): Update docs for the new `SafeAuthPack` (#289)
dasanra Dec 4, 2023
2b6e3a4
Fix deployment workflow
louis-md Dec 4, 2023
6a73090
Fix deployment workflow
louis-md Dec 4, 2023
563bb5c
Fix deployment workflow
louis-md Dec 4, 2023
2ff1ae0
fix broken links (#296)
heypran Dec 4, 2023
da1a510
Minor fixes
Dec 4, 2023
01bbe4f
chore: Improve auth-kit docs (#298)
yagopv Dec 4, 2023
170bcc9
Fix broken links
louis-md Dec 4, 2023
da83079
Force dark theme
louis-md Dec 4, 2023
d64f581
Fix generate supported networks
louis-md Dec 5, 2023
377b3c9
Add avax.boba.network as deprecated block explorers
louis-md Dec 5, 2023
6afed64
Fix generate supported networks (#299)
louis-md Dec 5, 2023
5d64ea0
Add favicon; fix theme color.
louis-md Dec 8, 2023
c3b8445
Cherry pick merged changes from #289
louis-md Dec 19, 2023
070c1a9
Cherry pick merged changes from #291
louis-md Dec 19, 2023
8854a28
Cherry pick merged changes from subsequent PRs
louis-md Dec 19, 2023
53257fb
Merge branch 'main' of https://github.com/safe-global/safe-docs into …
louis-md Dec 19, 2023
653bcd0
Fix link checker & vale errors
louis-md Dec 19, 2023
5406020
Add eslint, standard, husky
louis-md Dec 20, 2023
a642d5c
Fix lint errors
louis-md Dec 20, 2023
2514234
Fix pre-push commit hook
louis-md Dec 20, 2023
f0d0d10
Fix theme import
louis-md Dec 20, 2023
6e871a2
Set Google Form for first Safe App review contact (#303)
dasanra Jan 2, 2024
40f28c8
Feedback widget design. WIP logic
louis-md Jan 5, 2024
79cd409
Add google analytics
louis-md Jan 8, 2024
d0128ad
Move contact-us links in footer
louis-md Jan 9, 2024
d172c23
Rename all files with prefixes
louis-md Jan 9, 2024
71c7f3a
Add local link checker to prepush hook
louis-md Jan 9, 2024
51bc382
Minor fix
louis-md Jan 9, 2024
68968d7
Fix vale config
louis-md Jan 10, 2024
7ae3519
Add missing content from `main`
louis-md Jan 10, 2024
dbdc192
Add redirections from gitbook paths
louis-md Jan 10, 2024
10f00e7
Fix eslint config
louis-md Jan 10, 2024
e8296fa
Remove linkchecker from prepush hook
louis-md Jan 10, 2024
fccee10
Add legacy redirects
louis-md Jan 10, 2024
a052ec6
Merge branch 'main' of https://github.com/safe-global/safe-docs into …
louis-md Jan 10, 2024
7e82628
Custom 404 page
louis-md Jan 10, 2024
ea8bf9f
Fix breaking changes in vale v3
louis-md Jan 10, 2024
4cfef43
fix: link view inside hint element not showing as expected (#307)
dasanra Jan 11, 2024
65d1406
Restore signature files (#308)
germartinez Jan 11, 2024
14adbd0
Fix conflicts with signatures
germartinez Jan 12, 2024
d83d1b2
Update gitignore
germartinez Jan 12, 2024
317a712
Merge branch 'main' into nextra
germartinez Jan 12, 2024
e8e5e6b
Fix Vale errors
germartinez Jan 12, 2024
481d388
Accept words with Vale
germartinez Jan 15, 2024
a3e0172
Fix vale errors; add vale to lint command.
louis-md Jan 18, 2024
c8e6237
Fix build
louis-md Jan 18, 2024
7aca986
Fix redirect link
germartinez Jan 22, 2024
d1f4899
Implement requested changes
louis-md Jan 23, 2024
1c1ce83
Add redirections test
louis-md Jan 24, 2024
fa3ba77
Fix tsconfig
louis-md Jan 24, 2024
f8c4214
Fix typos in redirects
louis-md Jan 24, 2024
c1ef55c
Fix typo in redirects
louis-md Jan 24, 2024
039c8d5
Switch all routes to kebab-case
louis-md Jan 24, 2024
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
3 changes: 3 additions & 0 deletions .env.example
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
NEXT_PUBLIC_HOST_URL='http://localhost:3000'
NEXT_PUBLIC_GOOGLE_ANALYTICS_TRACKING_ID=
NEXT_PUBLIC_GOOGLE_ANALYTICS_DOMAIN=
28 changes: 28 additions & 0 deletions .eslintrc.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
module.exports = {
parser: '@typescript-eslint/parser',
extends: [
'plugin:@typescript-eslint/recommended',
'plugin:security/recommended-legacy',
'standard-with-typescript',
'next/core-web-vitals'
],
parserOptions: {
project: './tsconfig.json'
},
ignorePatterns: ['.eslintrc.js', 'next.config.js', 'next-env.d.ts', 'out'],
rules: {
'@typescript-eslint/key-spacing': 0,
'multiline-ternary': 0,
'no-console': ['error', { allow: ['info', 'warn', 'error'] }],
'max-len': [
2,
{
code: 100,
ignoreComments: true,
ignoreStrings: true,
ignoreTemplateLiterals: true,
ignoreUrls: true
}
]
}
}
11 changes: 0 additions & 11 deletions .gitbook.yaml

This file was deleted.

156 changes: 156 additions & 0 deletions .github/scripts/generateSupportedNetworks.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,156 @@
// This script generates the supported networks page from the safe-deployments repo.
// It clones the repo, reads the JSON files, and generates the markdown files as well as a _meta.json file for nextra.

const shell = require('shelljs')
const fs = require('fs')
const path = require('path')

// Explore a given directory recursively and return all the file paths
const walkPath = dir => {
let results = []
const list = fs.readdirSync(dir)
list.forEach(function (file) {
const filePath = path.join(dir, file)
const stat = fs.statSync(filePath)
if (stat?.isDirectory()) {
results = results.concat(walkPath(filePath))
} else {
results.push(filePath)
}
})

return results
}

// Reduce function to deduplicate an array
const deduplicate = (acc, curr) => {
if (acc.includes(curr)) {
return acc
}

return [...acc, curr]
}

const supportedNetworksPath = './pages/safe-smart-account/supported-networks'

const generateSupportedNetworks = async () => {
const deploymentRepoUrl = 'https://github.com/safe-global/safe-deployments/'
shell.exec(`git clone ${deploymentRepoUrl} ./deployments`)
shell.rm('-rf', supportedNetworksPath)

const fetch = await import('node-fetch')
const paths = walkPath('deployments/src/assets').map(p =>
p.replace('deployments/src/assets/', '')
)

const allNetworks = await fetch
.default('https://chainid.network/chains.json')
.then(res => res.json())

const contracts = paths.map(p => {
const file = fs.readFileSync(`deployments/src/assets/${p}`, 'utf8')
const json = JSON.parse(file)

return Object.entries(json.networkAddresses).map(([chainId, address]) => ({
name: p.split('/')[1].split('.')[0],
version: p.split('/')[0],
address,
chainId,
chainName: allNetworks.find(n => n.chainId === parseInt(chainId))?.name,
blockExplorerUrl: allNetworks.find(n => n.chainId === parseInt(chainId))
?.explorers?.[0]?.url
}))
})

const versions = contracts
.flat()
.map(c => c.version)
.reduce(deduplicate, [])
.reverse()

shell.mkdir(supportedNetworksPath)

versions.forEach(version => {
const _contracts = contracts.flat().filter(c => c.version === version)

const networks = Object.entries(
_contracts.reduce((acc, curr) => {
const { chainId, chainName } = curr
if (acc[chainId]) {
return acc
}

return {
...acc,
[chainId]: chainName
}
}, {})
)

const content = `# ${version}

This page lists the addresses of all the Safe contracts \`${version}\` grouped by chain.

## Networks
${networks
.map(([chainId, network]) => {
return `
### ${network}

This network's chain ID is ${chainId}.

${_contracts
.filter(c => c.chainId === chainId)
.map(
c =>
`- \`${c.name}.sol\`: ${
c.blockExplorerUrl == null ||
deprecatedBlockExplorers.includes(c.blockExplorerUrl)
? c.address
: `[${c.address}](${c.blockExplorerUrl}/address/${c.address})`
}`
)
.join('\n')}
`
})
.join('\n')}

`
fs.writeFileSync(`${supportedNetworksPath}/${version}.md`, content)
})

// Generate _meta.json file to order versions in descending order
fs.writeFileSync(
`${supportedNetworksPath}/_meta.json`,
JSON.stringify(
versions.reduce((acc, curr) => ({ ...acc, [curr]: curr }), {}),
null,
2
)
)

shell.rm('-rf', './deployments')
}

generateSupportedNetworks()

const deprecatedBlockExplorers = [
'https://ropsten.etherscan.io',
'https://rinkeby.etherscan.io',
'https://kovan-optimistic.etherscan.io',
'https://stardust-explorer.metis.io',
'https://blockexplorer.rinkeby.boba.network',
'https://blockexplorer.bobabeam.boba.network',
'https://blockexplorer.avax.boba.network',
'https://rabbit.analogscan.com',
'https://explorer.eurus.network',
'https://testnetexplorer.eurus.network',
'https://explorer.tst.publicmint.io',
'https://evm-testnet.venidiumexplorer.com',
'https://evm.venidiumexplorer.com',
'https://evm.explorer.canto.io',
'https://explorer.autobahn.network',
'https://explorer.cascadia.foundation',
'https://testnet.torusscan.com',
'https://testnet.toruscan.com'
]
13 changes: 13 additions & 0 deletions .github/scripts/s3_upload.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
#!/bin/bash

set -ev

aws s3 sync ./out $BUCKET --delete

# Upload all HTML files again but w/o an extention so that URLs like /welcome open the right page

cd out

for file in $(find . -name '*.html' | sed 's|^\./||'); do
aws s3 cp ${file%} $BUCKET/${file%.*} --content-type 'text/html'
done
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ extends: existence
message: "Always spell out the name of the month."
link: https://docs.microsoft.com/en-us/style-guide/numbers#numbers-in-dates
ignorecase: true
level: error
level: warning
nonword: true
tokens:
- '\b\d{1,2}/\d{1,2}/(?:\d{4}|\d{2})\b'
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
Loading
Loading