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: validate imports added to code snippets #1665

Merged
merged 47 commits into from
Jan 29, 2024

Conversation

Torres-ssf
Copy link
Contributor

@Torres-ssf Torres-ssf commented Jan 18, 2024

This PR adds a new way to generate imports within code snippets by using the #import flag:

// #import { AssetId };

const assetId: AssetId = {
  value: Bits256,
};

This final result will be:

import { AssetId } from 'fuels';

const assetId: AssetId = {
  value: Bits256,
};

@Torres-ssf Torres-ssf added the docs Requests pertinent to documentation label Jan 18, 2024
@Torres-ssf Torres-ssf self-assigned this Jan 18, 2024
Copy link
Contributor

github-actions bot commented Jan 18, 2024

Coverage report

St.
Category Percentage Covered / Total
🟢 Statements
86.15% (-0.81% 🔻)
6250/7255
🟡 Branches
69.21% (-1.84% 🔻)
987/1426
🟡 Functions
77.64% (-0.42% 🔻)
1028/1324
🟢 Lines
86.13% (-0.8% 🔻)
5982/6945
Show new covered files 🐣
St.
File Statements Branches Functions Lines
🟢
... / extractImports.ts
100% 100% 100% 100%
🔴
... / snippetPlugin.ts
10.47% 0% 0% 10%

Test suite run success

1515 tests passing in 265 suites.

Report generated by 🧪jest coverage report action from 9d845bc

@Torres-ssf Torres-ssf changed the title docs: add imports to code snippets docs: validate imports added to code snippets Jan 18, 2024
@danielbate
Copy link
Member

🚀

@Torres-ssf Torres-ssf marked this pull request as ready for review January 19, 2024 16:02
arboleya
arboleya previously approved these changes Jan 24, 2024
@Torres-ssf Torres-ssf enabled auto-merge (squash) January 24, 2024 15:45
@arboleya arboleya self-requested a review January 29, 2024 20:45
Copy link
Member

@arboleya arboleya left a comment

Choose a reason for hiding this comment

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

You have a small problem to fix.

Copy link
Contributor

Coverage Report:

Lines Branches Functions Statements
78.63%(+0.03%) 68.64%(+0.08%) 76.65%(+0%) 78.59%(+0.02%)
Changed Files:
Ok File (✨=New File) Lines Branches Functions Statements
✨ packages/utils/src/cli-utils/findBinPath.ts 100%
(+100%)
100%
(+100%)
100%
(+100%)
100%
(+100%)
🔴 packages/wallet/src/test-utils/launchNode.ts 100%
(+1.12%)
88.46%
(+1.43%)
64.7%
(-1.96%)
93.4%
(+0.62%)

@arboleya arboleya self-requested a review January 29, 2024 22:06
Copy link
Contributor

@Dhaiwat10 Dhaiwat10 left a comment

Choose a reason for hiding this comment

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

Looks good!

  • In the PR description, can you also mention the fact that this PR adds validation that checks for the validity of the imports in our docs snippets?
  • The FE conditional review workflow seems to be broken on this PR

@Torres-ssf Torres-ssf merged commit e959a27 into master Jan 29, 2024
19 of 20 checks passed
@Torres-ssf Torres-ssf deleted the st/docs/add-imports-to-code-snippets branch January 29, 2024 23:14
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.

Lack of validations for imports using #context within code snippets
5 participants