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

docs: finalise docs-snippets #3369

Open
wants to merge 37 commits into
base: master
Choose a base branch
from

Conversation

petertonysmith94
Copy link
Contributor

@petertonysmith94 petertonysmith94 commented Oct 30, 2024

Summary

Checklist

  • All changes are covered by tests (or not applicable)
  • All changes are documented (or not applicable)
  • I reviewed the entire PR myself (preferably, on GH UI)
  • I described all Breaking Changes (or there's none)

@petertonysmith94 petertonysmith94 added the docs Requests pertinent to documentation label Oct 30, 2024
@petertonysmith94 petertonysmith94 self-assigned this Oct 30, 2024
Copy link

vercel bot commented Oct 30, 2024

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
fuels-template ✅ Ready (Inspect) Visit Preview 💬 Add feedback Nov 22, 2024 8:54am
ts-docs 🔄 Building (Inspect) Visit Preview 💬 Add feedback Nov 22, 2024 8:54am
ts-docs-api ✅ Ready (Inspect) Visit Preview 💬 Add feedback Nov 22, 2024 8:54am

Copy link

codspeed-hq bot commented Nov 13, 2024

CodSpeed Performance Report

Merging #3369 will not alter performance

Comparing ps/docs/finalise-docs-snippets (f9711d9) with master (30585c1)

Summary

✅ 18 untouched benchmarks

@petertonysmith94
Copy link
Contributor Author

We need to make some changes to the docs-hub GitHub workflow as it's currently failing in CI.

I'm opening this for review as it should be isolated to the github-actions repository.

Torres-ssf
Torres-ssf previously approved these changes Nov 20, 2024
Copy link
Contributor

Coverage Report:

Lines Branches Functions Statements
76.86%(+12.66%) 70.51%(+0.8%) 75.13%(+2.14%) 76.98%(+12.34%)
Changed Files:
Ok File (✨=New File) Lines Branches Functions Statements
🔴 packages/account/src/providers/transaction-request/transaction-request.ts 88.57%
(+0%)
76.71%
(-1.37%)
84%
(+0%)
88.81%
(+0%)

Copy link
Member

@maschad maschad left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Awesome job on this @petertonysmith94 , so happy to finally put these doc changes to bed 🚀 😃

I've left some comments and questions.

context_visible_first: true
escapes: \\[\\`~]
delimiters:
- name: SPCheck
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This looks like just a formatting change

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

pnpm build
```

The snippets are built into testable scripts from the `src/snippets` folder and generates the Typegen types into the `src/snippets/typegend` folder. All test scripts end with a `.test.ts` suffix.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
The snippets are built into testable scripts from the `src/snippets` folder and generates the Typegen types into the `src/snippets/typegend` folder. All test scripts end with a `.test.ts` suffix.
The build process generates testable scripts from the snippets and outputs them alongside the snippets. The corresponding Typegen types are also generated and outputted in the `src/snippets/typegend` folder. All test scripts end with a `.test.ts` suffix.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.


## Testing

This will build the snippets and run the generated tests. To test a specific environment (`node` or `browser`), the snippet should be named as `{name}.{environment}.test.ts`. e.g. `deploy-contract.node.test.ts`
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We had discussed this before on a previous PR but essentially @danielbate made the point about us standardizing how we want to specify test environments by continuing to use the group comments as opposed to using file suffixes. I think we should perhaps continue in that vain.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@@ -1,5 +1,5 @@
# Check if node is already running at port 4000, if not start it
# TODO: This is a temporary solution to avoid conflicts with the test node in docs-snippets2
# TODO: This is a temporary solution to avoid conflicts with the test node in docs-snippets
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This should no longer be necessary, perhaps we can revert this to 8e80ba1

# Kill anything running on port 4000
lsof -t -i:4000 | xargs -r kill

# Runs a node at port 4000
pnpm fuels node > /dev/null 2>&1 &

# Builds projects
pnpm fuels build

# Deploys projects (needed for loader bytecode)
pnpm fuels deploy

# Kills the node
lsof -t -i:4000 | xargs -r kill

# Checks for type errors
pnpm tsc --noEmit

Although I don't think the type check is necessary anymore post-#3381

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

`src/vite.config.ts`,
`src/versions.data.ts`,
`src/jsonc.d.ts`,
`src/guide/transactions/new-api.ts`,
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not introduced on this PR but does this file exist? Not seeing it

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

"prettier:check": "prettier --check packages --check apps/docs-snippets",
"prettier:format": "prettier --write packages --check apps/docs-snippets",
"prettier:check": "prettier --check packages --check apps/docs",
"prettier:format": "prettier --write packages --write apps/docs",
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is this --write intentional?

Suggested change
"prettier:format": "prettier --write packages --write apps/docs",
"prettier:format": "prettier --write packages --check apps/docs",

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, I'd expect to fix the changes, as it's the prettier:format command.

@@ -1,8 +1,10 @@
{
"extends": "../../tsconfig.base.json",
"compilerOptions": {
"outDir": "./dist"
"module": "ES2022",
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just confirming but this is to enable top-level await?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Correct :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
docs Requests pertinent to documentation
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Remove old docs-snippets directory
4 participants