Skip to content

Commit

Permalink
Reapply "Fix sync-docs"
Browse files Browse the repository at this point in the history
This reverts commit 226e9d5.
  • Loading branch information
cdedreuille committed Jul 8, 2024
1 parent 226e9d5 commit 15ab44a
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 2 deletions.
8 changes: 7 additions & 1 deletion apps/frontpage/tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,12 @@
"compilerOptions": {
"plugins": [{ "name": "next" }]
},
"include": ["next-env.d.ts", "**/*.ts", "**/*.tsx", ".next/types/**/*.ts"],
"include": [
"next-env.d.ts",
"**/*.ts",
"**/*.tsx",
".next/types/**/*.ts",
"../../sync-docs.ts"
],
"exclude": ["node_modules"]
}
14 changes: 13 additions & 1 deletion sync-docs.ts
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,19 @@ dotenv.config();
console.log(`\n✳︎ 👀 http://localhost:3000/docs/${slugVersion}\n`);

fs.rmSync(pathToLocalDocs, { recursive: true });
fs.cpSync(pathToStorybookDocs, pathToLocalDocs, { recursive: true });
fs.cpSync(pathToStorybookDocs, pathToLocalDocs, {
recursive: true,
filter: (src) => {
if (
src.includes('.prettierignore') ||
src.includes('.prettierrc') ||
src.includes('_assets') ||
src.includes('_snippets')
)
return false;
return true;
},
});

fs.watch(pathToStorybookDocs, { recursive: true }, (_, filename) => {
const srcFilePath = path.join(pathToStorybookDocs, filename);
Expand Down

0 comments on commit 15ab44a

Please sign in to comment.