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: adjustments to new doc snippets infra #3238

Merged
merged 6 commits into from
Oct 2, 2024
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
1 change: 0 additions & 1 deletion .eslintignore
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@ apps/demo-react-cra
apps/demo-react-vite
apps/create-fuels-counter-guide
apps/docs-snippets2/src/typegend
apps/docs-snippets2/src/**/*.wrapped.ts

packages/fuels/src/cli/commands/deploy/proxy
packages/fuels/test/fixtures/project
Expand Down
9 changes: 8 additions & 1 deletion .prettierrc
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,13 @@
"options": {
"useTabs": false
}
},
{
"files": ["apps/docs-snippets2/src/**/*.ts"],
"excludeFiles": ["apps/docs-snippets2/src/**/*.test.ts"],
"options": {
"printWidth": 80
}
}
Torres-ssf marked this conversation as resolved.
Show resolved Hide resolved
]
}
}
10 changes: 2 additions & 8 deletions apps/docs-snippets2/scripts/wrap-snippets.ts
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ export const wrapSnippet = (filepath: string) => {
const wrappedSnippet =
// eslintDisableRule +
wrapperFnContents
.replace('%IMPORTS%', imports)
.replace('// %IMPORTS%', imports)
.replace('%NAME%', basename(filepath))
.replace('// %SNIPPET%', indented)
Torres-ssf marked this conversation as resolved.
Show resolved Hide resolved
.replace('// %NODE_LAUNCHER%', nodeLauncher)
Expand All @@ -97,12 +97,6 @@ export const wrapSnippet = (filepath: string) => {
*/
const dir = 'src/**';
const src = `${dir}/*.ts`;
const ignore = [
`src/typegend/**`,
`src/env.ts`,
`src/transactions/new-api.ts`,
`${dir}/*.test.ts`,
`${dir}/*.wrapped.ts`,
];
const ignore = [`src/typegend/**`, `src/env.ts`, `src/transactions/new-api.ts`, `${dir}/*.test.ts`];

globSync(src, { ignore }).forEach(wrapSnippet);
15 changes: 13 additions & 2 deletions apps/docs/nodemon.config.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,17 @@
{
"verbose": true,
"ext": "ts",
"watch": ["../../packages", "../docs-snippets"],
"ignore": ["**/*.d.ts", "**/*.map", "**/*.js", "**/out/release/**"]
"watch": [
"../../packages",
"../docs-snippets",
"../docs-snippets2/src",
"../docs-snippets2/sway"
Torres-ssf marked this conversation as resolved.
Show resolved Hide resolved
],
"ignore": [
"**/*.d.ts",
"**/*.map",
"**/*.js",
"**/out/release/**",
"../docs-snippets2/**/*.test.ts"
]
}