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

1313 - Contract-level events #1339

Merged
merged 96 commits into from
Jan 12, 2024
Merged
Show file tree
Hide file tree
Changes from 71 commits
Commits
Show all changes
96 commits
Select commit Hold shift + click to select a range
fd89a60
bugfixing search bar
guidoviani Aug 28, 2023
a6d1b04
quick fix search svg
guidoviani Aug 28, 2023
94faa1a
fix navbar
guidoviani Aug 29, 2023
a6bef00
Merge branch 'casper-network:dev' into dev
msalmeron Aug 29, 2023
0c845f6
add tabindex in theme switch
guidoviani Aug 29, 2023
c684596
Merge branch 'dev' of https://github.com/MiracleDevs/casper-docs into…
guidoviani Aug 29, 2023
fcd9bdf
delete desktop class
guidoviani Aug 29, 2023
0fb6d4b
add desktop class
guidoviani Aug 29, 2023
22a8086
Loading fix when search value changes.
lucasarceMD Aug 29, 2023
ab4641c
Merge branch 'dev' of https://github.com/MiracleDevs/casper-docs into…
lucasarceMD Aug 29, 2023
a3a762c
Clarifying
ACStone-MTS Oct 24, 2023
70129a0
Update serialization-standard.md
ACStone-MTS Oct 24, 2023
48c527f
Update serialization-standard.md
ACStone-MTS Oct 24, 2023
6b61b2c
remove bond from moving-node
Jiuhong-casperlabs Oct 25, 2023
a8939d9
Merge pull request #1312 from Jiuhong-casperlabs/update-moving-node.md
Jiuhong-casperlabs Oct 26, 2023
43a538c
Apply suggestions from code review
ACStone-MTS Oct 26, 2023
f0ab0f3
Update serialization-standard.md
ACStone-MTS Oct 26, 2023
754dc7b
Merge pull request #1311 from ACStoneCL/1307_URef_Access_Rights
ACStone-MTS Oct 26, 2023
f40bbc7
Adding Token Standard Docs
ACStone-MTS Oct 27, 2023
1482e7f
JS Tutorial addition
ACStone-MTS Oct 27, 2023
25b5324
Slug add
ACStone-MTS Oct 27, 2023
27df0c8
Link Test
ACStone-MTS Oct 27, 2023
df55a40
Link Fixes
ACStone-MTS Oct 27, 2023
669a10b
Last link fix
ACStone-MTS Oct 27, 2023
491d3d0
Incorporating Feedback
ACStone-MTS Oct 27, 2023
5589b39
Merge pull request #1316 from ACStoneCL/1315_Casper_Token_Standards
ACStone-MTS Oct 27, 2023
9396692
URef AccessRights Clarification Tutorial
ACStone-MTS Nov 1, 2023
3ad8102
Link Fix
ACStone-MTS Nov 1, 2023
c13dd46
Merge pull request #1319 from ACStoneCL/1310_URef_Tutorial
ACStone-MTS Nov 6, 2023
87f6233
Updating CEP-18 docs.
ACStone-MTS Nov 6, 2023
b5c0fea
Merge pull request #1326 from ACStoneCL/CEP18_Update
ACStone-MTS Nov 6, 2023
7adb20b
Redelegation Clarification
ACStone-MTS Nov 9, 2023
24444b6
Update redelegate.md
ACStone-MTS Nov 9, 2023
7f7a1f0
Update source/docs/casper/developers/cli/redelegate.md
ACStone-MTS Nov 9, 2023
a069f2c
Merge pull request #1327 from ACStoneCL/Redelegate_Hotfix
ACStone-MTS Nov 9, 2023
fc0b1d0
OpCode Documentation
ACStone-MTS Nov 9, 2023
d410d3d
Update source/docs/casper/developers/cli/opcode-costs.md
ACStone-MTS Nov 13, 2023
60b4347
Adding information about enabling contracts.
ACStone-MTS Nov 16, 2023
af04ae6
Update links
ipopescu Nov 18, 2023
0731ab5
Merge pull request #1332 from casper-network/1331_updated_links
ipopescu Nov 20, 2023
740271d
Readme refactoring
ipopescu Nov 20, 2023
5a983e2
Updated technology stack
ipopescu Nov 20, 2023
12f0df4
add query data
guidoviani Nov 24, 2023
4031a69
Changes in navbar
guidoviani Nov 24, 2023
5a722cc
Changes in footer
guidoviani Nov 24, 2023
621c3ef
fix dropdown sidebar
guidoviani Nov 24, 2023
40d70c6
fix styles to dropdowns
guidoviani Nov 24, 2023
f63446f
Merge pull request #1328 from ACStoneCL/Updating_OpCode_Costs
ACStone-MTS Nov 27, 2023
81e97db
Merge pull request #1330 from ACStoneCL/1325_Enable_Contracts
ACStone-MTS Nov 27, 2023
4a96d66
Merge pull request #1334 from ipopescu/1284_update_readme
ipopescu Nov 27, 2023
78a9671
quick fix min-width navbar
guidoviani Nov 28, 2023
dc063a4
NavTree plugin data cleanup
lucasarceMD Nov 28, 2023
d20adf1
delete log
guidoviani Nov 28, 2023
4e2081e
Merge remote-tracking branch 'upstream/dev' into dev
msalmeron Nov 29, 2023
8c253a4
Merge pull request #1337 from MiracleDevs/dev
bradjohnl Nov 30, 2023
589b840
NavItems query removed.
lucasarceMD Nov 30, 2023
61a35cb
Merge pull request #1338 from MiracleDevs/dev
bradjohnl Nov 30, 2023
10d360a
Initial content
ipopescu Dec 1, 2023
ca86cd2
Add content and examples
ipopescu Dec 1, 2023
1fd4bb4
Update the chai-spec.md file
ipopescu Dec 1, 2023
3a7ddd2
Add space and cross links
ipopescu Dec 2, 2023
b74b35a
Add more sample queries
ipopescu Dec 2, 2023
3af7d9b
Final content and image
ipopescu Dec 6, 2023
5d7704e
Updated explanation re. keys
ipopescu Dec 6, 2023
6e5d722
Use blake2b instead of BLAKE2b
ipopescu Dec 7, 2023
a3b4608
Add missing period
ipopescu Dec 7, 2023
4d75c59
Merge branch 'casper-network:dev' into 1313_contract_events
ipopescu Dec 16, 2023
2b181ff
Add info on Rust crates and documentation
ipopescu Dec 16, 2023
81d370a
Use actions/upload-artifact@v4
ipopescu Dec 19, 2023
afdf742
Merge pull request #1343 from ipopescu/1238_rust_links
ipopescu Dec 19, 2023
6cb82ed
Merge branch 'casper-network:dev' into 1313_contract_events
ipopescu Dec 19, 2023
32b59e4
Content was added back; remove the TODO
ipopescu Dec 19, 2023
3d2e417
Remove duplicate links in left nav
ipopescu Dec 19, 2023
0766643
Merge branch 'dev' into 1344_navigation
ipopescu Dec 19, 2023
a8a50fb
Merge pull request #1345 from ipopescu/1344_navigation
ipopescu Dec 19, 2023
92c0d52
Remove 2 additional duplicate links
ipopescu Dec 19, 2023
fcc3ca9
Add index pages to improve navigation
ipopescu Dec 19, 2023
6076ad9
Merge pull request #1346 from ipopescu/1344_navigation
ipopescu Dec 20, 2023
89560d1
Remove empty pages
ipopescu Dec 22, 2023
52a6c27
Remove Signer-related pages
ipopescu Dec 22, 2023
cc82fdf
Remove comment linking to a removed page
ipopescu Dec 22, 2023
d131466
Remove another empty page
ipopescu Dec 22, 2023
81bec0d
Use more descriptive titles
ipopescu Dec 22, 2023
073689b
Merge pull request #1347 from ipopescu/1092_empty_pages
ipopescu Dec 22, 2023
d02cb7c
Merge pull request #1348 from ipopescu/1093_HTML_titles
ipopescu Dec 22, 2023
7b7dceb
Highlight ways to contribute to the docs
ipopescu Dec 22, 2023
2ed03d3
Merge pull request #1349 from ipopescu/927_contribute
ipopescu Dec 27, 2023
0a90e31
TTL Update
ACStone-MTS Jan 2, 2024
7510e12
Merge pull request #1352 from ACStoneCL/TTL_Update
ACStone-MTS Jan 2, 2024
456c272
Fix broken link for package required for compatibility with Ubuntu 22.04
jdpinedac Jan 4, 2024
d16842c
Merge pull request #1 from Pyxis-Portal/fix-broken-pkg-url
jdpinedac Jan 4, 2024
b9aee51
Improved Explanation Wording
jdpinedac Jan 4, 2024
9507c8b
Merge pull request #1353 from Pyxis-Portal/dev
ipopescu Jan 9, 2024
e291f25
Merge branch 'casper-network:dev' into 1313_contract_events
ipopescu Jan 12, 2024
26326f3
Clarify pruning with an example
ipopescu Jan 12, 2024
394fb7c
Merge branch '1313_contract_events' of https://github.com/ipopescu/do…
ipopescu Jan 12, 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
4 changes: 2 additions & 2 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ jobs:
with:
ref: gh-pages

- uses: actions/upload-artifact@v3
- uses: actions/upload-artifact@v4
with:
name: gh-pages-backup
path: .
Expand Down Expand Up @@ -96,7 +96,7 @@ jobs:
run: |
echo "$prod_pages_fqdn" > ./docs/CNAME

- uses: actions/upload-artifact@v3
- uses: actions/upload-artifact@v4
with:
name: gh-pages-depl-payload
path: ./docs
Expand Down
252 changes: 252 additions & 0 deletions DEVELOPERS.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,252 @@
# Casper Documentation Developer Guide

If you want to add new content or make structural updates to the documentation, follow this guide.

## Technology Stack

This documentation website uses the following infrastructure:

- Docusaurus (2.4.0)
- React (17.0.1)
- Node (>=16.14)

To see the current versions, open the [package.json](./package.json) file.

## Project Architecture

The table below shows you the main structure of the documentation framework.

| Folder/File | Description |
| -------------------- | ----------------------------------------- |
| .docusaurus | Docusaurus default configuration module |
| .github | GitHub module |
| .husky | Husky script module |
| .vscode | Visual Studio Code editor configuration |
| build | Docusaurus build packages |
| config | Docusaurus detailed configuration modules |
| source/blog | Blog page module |
| source/docs | Main documentation .md files |
| source/i18n | Localization packages |
| scripts | Bash script module |
| src/assets | Asset modules (style/image/icons) |
| src/components | Component module |
| src/html | HTML codebase |
| src/mocks | Mocks data module |
| src/pages | React page module |
| src/utils | Utility module |
| static | Static modules (image/icons) |
| types | Type interface definition part |
| .env | Environment variables |
| .eslintrc | Eslint configuration |
| .prettierrc | Prettier configuration |
| .textlintrc | Text lint configuration |
| Babel.config.js | Babel configuration |
| Crowdin.yml | Crowdin configuration |
| Docusaurus.config.js | Docusaurus configuration |
| package.json | NPM package list |
| Tsconfig.js | Typescript configuration |
| yarn.lock | Package dependency graph |

## Project Deployment

Build and run the project as shown in the [README](./README.md#running-the-website-locally).

### Additional `yarn` commands

You might find these commands useful:

- `yarn start` - Run the project in dev mode
- `yarn build` - Build the project pages
- `yarn swizzle` - Eject a Docusaurus core source component to customize it. Do not eject all components; eject a specific component by adding parameters to this command
- `yarn deploy` - Deploy your Docusaurus project using GitHub hosting
- `yarn clear` - Remove previous builds
- `yarn serve` - Host the project
- `yarn write-translations` - Generate translation modules automatically from pages
- `yarn write-heading-ids` -Generate translation modules automatically from pages
- `yarn crowdin:sync` - Build, upload, and download translation modules
- `yarn run:prettier` - Format the code base
- `yarn run:eslint` - Check the code style based on eslint
- `yarn format` - Run `prettier` and `lint` in sequence
- `yarn reinstall` - Reinstall all `npm` packages
- `yarn prepare` - This is an internal command for `husky` install; you do not need to run this command because it is included in `yarn install`
- `yarn commit` - Internal command for `lint-stage`. This command is included in pre-commit hooks, so you do not need to run this command but we include this here for visibility

## Page Development

- To create a new document, add an `md` or `mdx` file at an intuitive location in the source directory, [docs/casper](./source/docs/casper/). Page routing will depend on page hierarchy unless you specify the routing in the [config](./config/) folder.
- You will need to [update the sidebar](#sidebar-footer-and-navbar-development) to include the new file.
- To add an overview page or a new tutorial, use a template from the [templates](.github/templates) folder.
- Add images in the [static/image](./static/image/) directory.
- To create React pages, follow the pattern in the [src/page](./src/pages/) directory.

## Component Development

- Create reusable components in the [src/components](./src/components/) directory based on their purpose.
- Define or declare the necessary types in the component or in the [types](./types/) directory.
- Follow the pattern from the [Background](./src/components/atoms/Background/) or [Hero](./src/components/containers/Hero/) components.

## Sidebar, Footer, and Navbar Development

To add or update a sidebar:

- Open the [config/sidebar.config.js](./config/sidebar.config.js) file.
- To add a new directory or file in the sidebar, update the `module.exports` structure.
- Note that item hierarchy depends on the order in which you list the items in this file.

For example, if you want to add a new directory called `workflow`, then add the following code as a property in `module.exports`:

```javascript
module.exports = {
workflow: [
"workflow/index",
"workflow/staking",
...
],
...
```

To create or update a navbar, open and update the [config/navbar.config.js](./config/navbar.config.js) file. Note that item hierarchy depends on the item order in this file. For example, if you want to create a navbar called `Staking`, add the following property in the `module.exports` structure:

```javascript
{
to: `${routePrefix}/staking`,
activeBasePath: `${routePrefix}/staking`,
label: "Staking",
position: "left",
},
```

To create or update a footer, open the [config/footer.config.js](./config/footer.config.js) file. Note that item hierarchy depends on the item order in this file. For example, assuming you want to add an item called `Style Guide`, add the following property:

```javascript
title: 'Docs',
items: [
{
label: 'Style Guide',
to: 'docs/',
},
```

## Theme Development

To create new theme, add a variable in this file: [scss/variable.scss](./src/assets/scss/variable.scss) and a theme class in the [scss/theme.scss](./src/assets/scss/theme.scss) file.

To change an existing theme, modify the [config/color.config.js](./config/color.config.js) file.

For example, you can switch to the light theme:

```javascript
module.exports = {
defaultMode: "light",
respectPrefersColorScheme: false,
disableSwitch: false,
};
```

<!-- TODO comment out when localization becomes available.
## Localization Development

- If you have made changes in the navbar, footer, or sidebar, remove the files that contain changed keys. Otherwise, you can skip this step.
- Run the `yarn run:i18n` script to tag content updates that need localization.
- Open the [config/i18n.config.js](./config/i18n.config.js) file to change the default language or add more languages. You can customize the [scripts/setup-i18n-json.sh](./scripts/setup-i18n-json.sh) and [setup-i18n-md.sh](./scripts/setup-i18n-md.sh) modules to add more localization scripts.
- Next, replace the `crowdin.yml` file, or insert the Crowdin API key (CROWDIN_PERSONAL_ACCESS_TOKEN) into the `.env` file. Then run `yarn run:crowdin` to update the translated files using Crowdin.

Configure the next variables in [config/site.navbar.config.js](./config/site.navbar.config.js).

```
module.exports = {
...
'locales': [
{ internal: 'es', external: 'es-es' },
{ internal: 'en', external: 'en-us' }
],
'defaultExternalLocales': 'en-us'
},
```
-->

## reStructuredText to Markdown Conversion

To migrate reStructuredText (.rst) files to markdown (.md) files, follow these steps:

- Add the new `.rst` documents into the top-level directory.
- Run `yarn run:migrate`.
- Check that the `.rst` documents were converted to `.md` files.
- Remove the original `.rst` files.

For more information, reference the [scripts/rst-to-md.sh](./scripts/rst-to-md.sh) script.

## HTML Code Injection

For embedding HTML, follow the example in the [src/html/footer.html](./src/html/footer.html) and [config/footer.config.js](./config/footer.config.js) files.

## Asset Management

You can add icons and images in the [static](./static/) folder.

- Add icons in the `icon` sub-folder, using this pattern: `icon_name.svg`.
- Add images in the `image` sub-folder, using this pattern: `image_name.png`.

## Search

Open the [config/algolia.config.js](./config/algolia.config.js) file and specify the `apiKey` and `indexName`. Customize the search box or create a new style using the [src/assets/scss/theme.scss](./src/assets/scss/theme.scss) file.

## Custom header

If the Docusaurus version is updated, the navbar, footer and side bar could stop working. In that case, run this command to restructure the navbar:

```bash
npm run swizzle @docusaurus/theme-classic Navbar -- --eject
```

For more information, visit `https://docusaurus.io/docs/swizzling`.

Use the following environment variables to enable the navbar:

```
DIRECTUS_URL=REPLACE_WITH_YOUR_DIRECTUS_URL
DIRECTUS_GRAPHQL_URL=REPLACE_WITH_YOUR_DIRECTUS_GRAPH_URL
DIRECTUS_TOKEN=REPLACE_WITH_YOUR_DIRECTUS_TOKEN
SITE_URL=REPLACE_WITH_YOUR_SITE_URL
ALGOLIA_SITE_APP_ID=REPLACE_WITH_YOUR_ALGOLIA_SITE_APP_ID
ALGOLIA_SITE_API_KEY=REPLACE_WITH_YOUR_ALGOLIA_SITE_API_KEY
ALGOLIA_SITE_INDEX_NAME=REPLACE_WITH_YOUR_ALGOLIA_SITE_INDEX_NAME
```

## Troubleshooting

### Debugging site data

Run the project locally and go to `http://localhost:3000/__docusaurus/debug/routes`.

### Git hooks

If Git hooks are not working, try the following:

- Install `husky` locally in the root level of the project using this command:

```bash
`yarn add -D husky`
```

- Create new Git hooks using this command:

```bash
npx husky add .husky/pre-commit "npm run commit"
```

- Update the `pre-commit` module with this script:

```sh
#!/bin/sh
. "$(dirname "$0")/_/husky.sh"
npm run commit
```

- Create a new `.js` file to test the commit flow. You should be able to see the Git hooks triggering.

- Undo the test commit by using the following command:

```bash
git reset --hard HEAD
```
Loading