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: Faker and utility pages #1940 #2

Closed
wants to merge 34 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
34 commits
Select commit Hold shift + click to select a range
69b1d50
docs: prepare Faker page
ST-DDT Mar 16, 2023
4ff532c
chore: cleanup
ST-DDT Mar 16, 2023
7ef7510
chore: fix typo
ST-DDT Mar 16, 2023
d21a693
docs: add jsdocs
ST-DDT Mar 16, 2023
0a804e0
docs: fix duplicate jsdocs
ST-DDT Mar 18, 2023
e3a9886
Merge branch 'next' into docs/faker-and-utility-page
ST-DDT Mar 18, 2023
c5c8a72
docs: add jsdocs to Faker
ST-DDT Mar 18, 2023
0ecec03
docs: add example to faker.setDefaultRefDate
ST-DDT Mar 18, 2023
331ed09
docs: generate search index based on generated pages
ST-DDT Mar 18, 2023
249c9cc
docs: add utilities page
ST-DDT Mar 18, 2023
a2d0b27
docs: remove duplicate html suffix
ST-DDT Mar 18, 2023
0da3e5a
docs: just use the generate link
ST-DDT Mar 18, 2023
818f75b
Merge branch 'next' into docs/faker-and-utility-page
ST-DDT Mar 18, 2023
d25542c
Merge branch 'next' into docs/faker-and-utility-page
ST-DDT Mar 20, 2023
2103626
docs: prepare faker.seed for api docs
ST-DDT Mar 20, 2023
3619076
Merge branch 'next' into docs/faker-and-utility-page
ST-DDT Mar 20, 2023
866947e
Merge branch 'next' into docs/faker-and-utility-page
ST-DDT Mar 21, 2023
940baa8
docs: improve Faker.constructor jsdocs
ST-DDT Mar 21, 2023
553dde2
chore: extract Faker jsdocs to own PR
ST-DDT Mar 22, 2023
df88c53
Merge branch 'next' into docs/faker-and-utility-page
ST-DDT Mar 27, 2023
a1ef49f
Merge branch 'next' into docs/faker-and-utility-page
ST-DDT Mar 29, 2023
0aa9ebc
Merge branch 'next' into docs/faker-and-utility-page
ST-DDT Mar 30, 2023
52dc6fb
Merge branch 'next' into docs/faker-and-utility-page
ST-DDT Apr 1, 2023
18b5cad
chore: include deprecation message in module hash
ST-DDT Apr 1, 2023
caf58d9
chore(deps): update devdependencies (#2006)
renovate[bot] Apr 2, 2023
6556fef
fix: fix module urls
ST-DDT Apr 2, 2023
20aca79
Merge branch 'next' into docs/faker-and-utility-page
ST-DDT Apr 2, 2023
3c176b2
feat(locale): add locale TH (#1922)
munkeawtoast Apr 2, 2023
9bf0a6d
docs(person): fix formatting issues (#2005)
ST-DDT Apr 2, 2023
7ff8fc9
Merge branch 'next' into docs/faker-and-utility-page
ST-DDT Apr 2, 2023
9d904a3
fix: typo in Faker jsdocs (#2008)
ST-DDT Apr 2, 2023
e4d4492
infra: extend preflight (#2003)
ST-DDT Apr 2, 2023
34b743a
feat(locale): add en_US location.county data (#1996)
matthewmayer Apr 2, 2023
8f863b0
Merge branch 'next' into docs/faker-and-utility-page
ST-DDT Apr 2, 2023
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
2 changes: 1 addition & 1 deletion cypress/e2e/api.cy.ts
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ describe('API Test', () => {

cy.request({
method: 'HEAD',
url: `/api/${link}`,
url: link,
failOnStatusCode: false,
})
.should(({ status }) => {
Expand Down
2 changes: 2 additions & 0 deletions docs/.vitepress/api-pages.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
// Run 'pnpm run generate:api-docs' to update
export const apiPages = [
{ text: 'Overview', link: '/api/' },
{ text: 'Faker', link: '/api/faker.html' },
{ text: 'Airline', link: '/api/airline.html' },
{ text: 'Animal', link: '/api/animal.html' },
{ text: 'Color', link: '/api/color.html' },
Expand All @@ -28,4 +29,5 @@ export const apiPages = [
{ text: 'System', link: '/api/system.html' },
{ text: 'Vehicle', link: '/api/vehicle.html' },
{ text: 'Word', link: '/api/word.html' },
{ text: 'Utilities', link: '/api/utils.html' },
];
1 change: 0 additions & 1 deletion docs/.vitepress/components/api-docs/method.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
export interface Method {
readonly name: string;
readonly title: string;
readonly description: string; // HTML
readonly parameters: MethodParameter[];
readonly returns: string;
Expand Down
3 changes: 3 additions & 0 deletions docs/.vitepress/components/api-docs/method.vue
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,9 @@ const props = defineProps<{ method: Method }>();

function seeAlsoToUrl(see: string): string {
const [, module, method] = see.replace(/\(.*/, '').split('\.');
if (!method) {
return 'faker.html#' + slugify(module);
}
return module + '.html#' + slugify(method);
}
</script>
Expand Down
6 changes: 2 additions & 4 deletions docs/api/ApiIndex.vue
Original file line number Diff line number Diff line change
Expand Up @@ -97,13 +97,11 @@ onUnmounted(() => window.removeEventListener('keydown', apiSearchFocusHandler));
<div class="api-groups">
<div v-for="item of section.items" :key="item.text" class="api-group">
<h3>
<a :href="item.link + '.html'">{{ item.text }}</a>
<a :href="item.link">{{ item.text }}</a>
</h3>
<ul>
<li v-for="h of item.headers" :key="h.anchor">
<a :href="item.link + '.html#' + slugify(h.anchor)">{{
h.text
}}</a>
<a :href="item.link + '#' + slugify(h.anchor)">{{ h.text }}</a>
</li>
</ul>
</div>
Expand Down
1 change: 1 addition & 0 deletions docs/guide/localization.md
Original file line number Diff line number Diff line change
Expand Up @@ -128,6 +128,7 @@ In this example there are 5 locales. Each of these is checked in order, and the
| `sk` | Slovakian | `fakerSK` |
| `sr_RS_latin` | Serbian (Latin) | `fakerSR_RS_latin` |
| `sv` | Swedish | `fakerSV` |
| `th` | Thai | `fakerTH` |
| `tr` | Turkish | `fakerTR` |
| `uk` | Ukrainian | `fakerUK` |
| `ur` | Urdu | `fakerUR` |
Expand Down
18 changes: 10 additions & 8 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,7 @@
"build:code": "tsx ./scripts/bundle.ts",
"build:types": "tsc --emitDeclarationOnly --outDir dist/types",
"build": "run-s build:clean build:code build:types",
"generate": "run-s generate:locales generate:api-docs",
"generate:api-docs": "tsx ./scripts/apidoc.ts",
"generate:locales": "tsx ./scripts/generateLocales.ts",
"docs:build": "run-s docs:prepare docs:build:run",
Expand All @@ -69,6 +70,7 @@
"docs:diff": "tsx ./scripts/diff.ts",
"format": "prettier --cache --write .",
"lint": "eslint --cache --cache-strategy content .",
"ts-check": "run-s ts-check:scripts ts-check:tests",
"ts-check:scripts": "tsc --project tsconfig.check-scripts.json",
"ts-check:tests": "tsc --project tsconfig.check-tests.json",
"test": "vitest",
Expand All @@ -80,14 +82,14 @@
"docs:test:e2e:open": "run-p --race docs:serve \"cypress open\"",
"release": "standard-version",
"prepublishOnly": "pnpm run clean && pnpm install && pnpm run build",
"preflight": "pnpm install && run-s generate:* format lint build test:update-snapshots"
"preflight": "pnpm install && run-s generate format lint build test:update-snapshots ts-check"
},
"devDependencies": {
"@actions/github": "~5.1.1",
"@algolia/client-search": "~4.16.0",
"@types/glob": "~8.1.0",
"@types/markdown-it": "~12.2.3",
"@types/node": "~18.15.10",
"@types/node": "~18.15.11",
"@types/prettier": "~2.7.2",
"@types/react": "~18.0.29",
"@types/sanitize-html": "~2.9.0",
Expand All @@ -100,16 +102,16 @@
"@vueuse/core": "~9.13.0",
"c8": "~7.13.0",
"conventional-changelog-cli": "~2.2.2",
"cypress": "~12.8.1",
"esbuild": "~0.17.14",
"eslint": "~8.36.0",
"cypress": "~12.9.0",
"esbuild": "~0.17.15",
"eslint": "~8.37.0",
"eslint-config-prettier": "~8.8.0",
"eslint-define-config": "~1.17.0",
"eslint-gitignore": "~0.1.0",
"eslint-plugin-deprecation": "~1.3.3",
"eslint-plugin-jsdoc": "~40.1.0",
"eslint-plugin-deprecation": "~1.4.0",
"eslint-plugin-jsdoc": "~40.1.1",
"eslint-plugin-prettier": "~4.2.1",
"glob": "~9.3.2",
"glob": "~9.3.4",
"npm-run-all": "~4.1.5",
"picocolors": "~1.0.0",
"prettier": "2.8.7",
Expand Down
Loading