-
-
Notifications
You must be signed in to change notification settings - Fork 10.8k
docs: minor updates #14038
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: minor updates #14038
Changes from 1 commit
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -39,7 +39,7 @@ import { PrefetchPageLinks } from "react-router"; | |
| ## Signature | ||
|
|
||
| ```tsx | ||
| function PrefetchPageLinks({ page, ...dataLinkProps }: PageLinkDescriptor) | ||
| function PrefetchPageLinks({ page, ...linkProps }: PageLinkDescriptor) | ||
| ``` | ||
|
|
||
| ## Props | ||
|
|
@@ -48,8 +48,8 @@ function PrefetchPageLinks({ page, ...dataLinkProps }: PageLinkDescriptor) | |
|
|
||
| The absolute path of the page to prefetch, e.g. `/absolute/path`. | ||
|
|
||
| ### dataLinkProps | ||
| ### linkProps | ||
|
|
||
| Additional props to pass to the [`<link>`](https://developer.mozilla.org/en-US/docs/Web/HTML/Reference/Elements/link) | ||
| tag, such as `crossOrigin`, `integrity`, `rel`, etc. | ||
| Additional props to spread onto the [`<link>`](https://developer.mozilla.org/en-US/docs/Web/HTML/Reference/Elements/link) | ||
| tags, such as `crossOrigin`, `integrity`, `rel`, etc. | ||
|
Comment on lines
+53
to
+54
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Hopefully his helps clarify that it's just a bag of props to spread onto |
||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -48,13 +48,13 @@ export default function Root() { | |
| ## Signature | ||
|
|
||
| ```tsx | ||
| function Scripts(props: ScriptsProps): React.JSX.Element | null | ||
| function Scripts(scriptProps: ScriptsProps): React.JSX.Element | null | ||
| ``` | ||
|
|
||
| ## Props | ||
|
|
||
| ### props | ||
| ### scriptProps | ||
|
|
||
| Props for the [`<script>`](https://developer.mozilla.org/en-US/docs/Web/HTML/Reference/Elements/script) | ||
| Additional props to spread onto the [`<script>`](https://developer.mozilla.org/en-US/docs/Web/HTML/Reference/Elements/script) | ||
|
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Same here for the |
||
| tag, such as `crossOrigin`, `nonce`, etc. | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -110,20 +110,39 @@ const { values: args } = util.parseArgs({ | |
| type: "string", | ||
| short: "o", | ||
| }, | ||
| help: { | ||
| type: "boolean", | ||
| short: "h", | ||
| }, | ||
| }, | ||
| allowPositionals: true, | ||
| }); | ||
|
|
||
| if (!args.path) { | ||
| console.error( | ||
| "Usage: docs.ts --path <filepath-or-glob> [--api <api1,api2,...>] [--write] [--output <output-dir>]", | ||
| if (args.help) { | ||
| console.log("\n"); | ||
| console.log( | ||
| "Usage: docs.ts [--path <filepath-or-glob>] [--api <api1,api2,...>] [--write] [--output <output-dir>]", | ||
| ); | ||
| console.log( | ||
| ' --path, -p File path or glob pattern to parse (default "packages/**/*.{ts,tsx}")', | ||
| ); | ||
| console.error(" --path, -p File path or glob pattern to parse"); | ||
| console.error( | ||
| console.log( | ||
| " --api, -a Comma-separated list of specific APIs to generate", | ||
| ); | ||
| console.error(" --write, -w Write markdown files to output directory"); | ||
| console.error(" --output, -o Output directory (default: docs/api)"); | ||
| console.log(" --write, -w Write markdown files to output directory"); | ||
| console.log(" --output, -o Output directory (default: docs/api)"); | ||
| process.exit(0); | ||
| } | ||
|
|
||
| // Resolve file paths using glob patterns | ||
| let pathGlob = args.path || "packages/**/*.{ts,tsx}"; | ||
|
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. No longer require |
||
| const filePaths = fg.sync(pathGlob, { | ||
| onlyFiles: true, | ||
| ignore: ["**/node_modules/**", "**/__tests__/**", "**/dist/**"], | ||
| }); | ||
|
|
||
| if (filePaths.length === 0) { | ||
| console.error(`No files found matching pattern: ${pathGlob}`); | ||
| process.exit(1); | ||
| } | ||
|
|
||
|
|
@@ -140,17 +159,6 @@ const outputDir = args.output || "docs/api"; | |
| const repoApiLookup = buildRepoDocsLinks(outputDir); | ||
| const typedocLookup = buildTypedocLinks(outputDir); | ||
|
|
||
| // Resolve file paths using glob patterns | ||
| const filePaths = fg.sync(args.path, { | ||
| onlyFiles: true, | ||
| ignore: ["**/node_modules/**", "**/__tests__/**", "**/dist/**"], | ||
| }); | ||
|
|
||
| if (filePaths.length === 0) { | ||
| console.error(`No files found matching pattern: ${args.path}`); | ||
| process.exit(1); | ||
| } | ||
|
|
||
| run(); | ||
|
|
||
| // Generate markdown documentation for all matching files | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We can now just run this for all files - only the ones marked
@publicget written out