Skip to content

Commit

Permalink
docs: adjustments to new doc snippets infra (#3238)
Browse files Browse the repository at this point in the history
  • Loading branch information
Torres-ssf authored and Dhaiwat10 committed Nov 19, 2024
1 parent b2879ac commit 6c3e0a2
Show file tree
Hide file tree
Showing 4 changed files with 23 additions and 12 deletions.
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
}
}
]
}
}
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)
.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"
],
"ignore": [
"**/*.d.ts",
"**/*.map",
"**/*.js",
"**/out/release/**",
"../docs-snippets2/**/*.test.ts"
]
}

0 comments on commit 6c3e0a2

Please sign in to comment.