Skip to content

Commit

Permalink
Merge branch 'next' into refactor/internet/ip
Browse files Browse the repository at this point in the history
  • Loading branch information
Shinigami92 authored Oct 14, 2022
2 parents 5d515a9 + 9c1437d commit 6718cfd
Show file tree
Hide file tree
Showing 40 changed files with 105 additions and 1,524 deletions.
12 changes: 6 additions & 6 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ jobs:
uses: actions/checkout@v3

- name: Install pnpm
uses: pnpm/[email protected].2
uses: pnpm/[email protected].3
with:
version: 7

Expand Down Expand Up @@ -62,7 +62,7 @@ jobs:
uses: actions/checkout@v3

- name: Install pnpm
uses: pnpm/[email protected].2
uses: pnpm/[email protected].3
with:
version: 7

Expand Down Expand Up @@ -90,7 +90,7 @@ jobs:
fetch-depth: 0

- name: Install pnpm
uses: pnpm/[email protected].2
uses: pnpm/[email protected].3
with:
version: 7

Expand Down Expand Up @@ -121,7 +121,7 @@ jobs:
fetch-depth: 0

- name: Install pnpm
uses: pnpm/[email protected].2
uses: pnpm/[email protected].3
with:
version: 7

Expand Down Expand Up @@ -149,7 +149,7 @@ jobs:
fetch-depth: 0

- name: Install pnpm
uses: pnpm/[email protected].2
uses: pnpm/[email protected].3
with:
version: 7

Expand Down Expand Up @@ -177,7 +177,7 @@ jobs:
fetch-depth: 0

- name: Install pnpm
uses: pnpm/[email protected].2
uses: pnpm/[email protected].3
with:
version: 7

Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/pr.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ jobs:
fetch-depth: 0

- name: Install pnpm
uses: pnpm/[email protected].2
uses: pnpm/[email protected].3
with:
version: 7

Expand Down
3 changes: 0 additions & 3 deletions docs/.vitepress/api-pages.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,22 +10,19 @@ export const apiPages = [
{ text: 'Database', link: '/api/database.html' },
{ text: 'Datatype', link: '/api/datatype.html' },
{ text: 'Date', link: '/api/date.html' },
{ text: 'Fake', link: '/api/fake.html' },
{ text: 'Finance', link: '/api/finance.html' },
{ text: 'Git', link: '/api/git.html' },
{ text: 'Hacker', link: '/api/hacker.html' },
{ text: 'Helpers', link: '/api/helpers.html' },
{ text: 'Image', link: '/api/image.html' },
{ text: 'Internet', link: '/api/internet.html' },
{ text: 'Lorem', link: '/api/lorem.html' },
{ text: 'Mersenne', link: '/api/mersenne.html' },
{ text: 'Music', link: '/api/music.html' },
{ text: 'Name', link: '/api/name.html' },
{ text: 'Phone', link: '/api/phone.html' },
{ text: 'Random', link: '/api/random.html' },
{ text: 'Science', link: '/api/science.html' },
{ text: 'System', link: '/api/system.html' },
{ text: 'Unique', link: '/api/unique.html' },
{ text: 'Vehicle', link: '/api/vehicle.html' },
{ text: 'Word', link: '/api/word.html' },
];
2 changes: 0 additions & 2 deletions scripts/apidoc.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@ import {
writeApiPagesIndex,
writeApiSearchIndex,
} from './apidoc/apiDocsWriter';
import { processDirectMethods } from './apidoc/directMethods';
import { processModuleMethods } from './apidoc/moduleMethods';
import { initMarkdownRenderer } from './apidoc/signature';
import type { PageIndex } from './apidoc/utils';
Expand Down Expand Up @@ -35,7 +34,6 @@ async function build(): Promise<void> {

const modulesPages: PageIndex = [];
modulesPages.push(...processModuleMethods(project));
modulesPages.push(...processDirectMethods(project));
writeApiPagesIndex(modulesPages);

writeApiSearchIndex(project);
Expand Down
35 changes: 1 addition & 34 deletions scripts/apidoc/apiDocsWriter.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ import type { ProjectReflection } from 'typedoc';
import { ReflectionKind } from 'typedoc';
import type { Method } from '../../docs/.vitepress/components/api-docs/method';
import type { APIGroup, APIItem } from '../../docs/api/api-types';
import { selectDirectMethods } from './directMethods';
import { extractModuleName, selectApiModules } from './moduleMethods';
import type { PageIndex } from './utils';
import {
Expand Down Expand Up @@ -78,37 +77,6 @@ export function writeApiDocsModulePage(
writeFileSync(resolve(pathOutputDir, `${lowerModuleName}.md`), content);
}

/**
* Writes the api page for the given method to the correct location.
*
* @param methodName The name of the method to write the docs for.
* @param capitalizedMethodName The capitalized name of the method.
*/
export function writeApiDocsDirectPage(
methodName: string,
capitalizedMethodName: string
): void {
let content = `
<script setup>
import ApiDocsMethod from '../.vitepress/components/api-docs/method.vue';
import ${methodName} from './${methodName}.json';
</script>
<!-- This file is automatically generated. -->
<!-- Run '${scriptCommand}' to update -->
# ${capitalizedMethodName}
## ${methodName}
<ApiDocsMethod :method="${methodName}.${methodName}" v-once />
`.replace(/\n +/g, '\n');

content = vitePressInFileOptions + formatMarkdown(content);

writeFileSync(resolve(pathOutputDir, `${methodName}.md`), content);
}

/**
* Writes the api docs data to correct location.
*
Expand Down Expand Up @@ -164,9 +132,8 @@ export function writeApiSearchIndex(project: ProjectReflection): void {
apiIndex.push(moduleApiSection);

const apiModules = selectApiModules(project);
const directMethods = selectDirectMethods(project);

moduleApiSection.items = [...apiModules, ...directMethods]
moduleApiSection.items = apiModules
.map((module) => {
const moduleName = extractModuleName(module);
const apiSection: APIItem = {
Expand Down
68 changes: 0 additions & 68 deletions scripts/apidoc/directMethods.ts

This file was deleted.

7 changes: 1 addition & 6 deletions src/faker.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@ import { CompanyModule } from './modules/company';
import { DatabaseModule } from './modules/database';
import { DatatypeModule } from './modules/datatype';
import { DateModule } from './modules/date';
import { FakeModule } from './modules/fake';
import { FinanceModule } from './modules/finance';
import { GitModule } from './modules/git';
import { HackerModule } from './modules/hacker';
Expand All @@ -24,7 +23,6 @@ import { PhoneModule } from './modules/phone';
import { RandomModule } from './modules/random';
import { ScienceModule } from './modules/science';
import { SystemModule } from './modules/system';
import { UniqueModule } from './modules/unique';
import { VehicleModule } from './modules/vehicle';
import { WordModule } from './modules/word';
import type { LiteralUnion } from './utils/types';
Expand Down Expand Up @@ -76,11 +74,8 @@ export class Faker {

readonly definitions: LocaleDefinition = this.initDefinitions();

readonly fake: FakeModule['fake'] = new FakeModule(this).fake;
readonly unique: UniqueModule['unique'] = new UniqueModule(this).unique;

/**
* @deprecated Internal. Use faker.datatype.number() or faker.seed() instead.
* @internal
*/
readonly mersenne: MersenneModule = new MersenneModule();
readonly random: RandomModule = new RandomModule(this);
Expand Down
7 changes: 2 additions & 5 deletions src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -45,23 +45,20 @@ export type { CompanyModule } from './modules/company';
export type { DatabaseModule } from './modules/database';
export type { DatatypeModule } from './modules/datatype';
export type { DateModule } from './modules/date';
export type { FakeModule } from './modules/fake';
export type { FinanceModule } from './modules/finance';
export type { GitModule } from './modules/git';
export type { HackerModule } from './modules/hacker';
export type { HelpersModule } from './modules/helpers';
export type { ImageModule } from './modules/image';
export type { InternetModule } from './modules/internet';
export type { LoremModule } from './modules/lorem';
export type { MersenneModule } from './modules/mersenne';
export type { MusicModule } from './modules/music';
export { Gender, Sex } from './modules/name';
export type { GenderType, NameModule, SexType } from './modules/name';
export { Sex } from './modules/name';
export type { NameModule, SexType } from './modules/name';
export type { PhoneModule } from './modules/phone';
export type { RandomModule } from './modules/random';
export type { ChemicalElement, ScienceModule, Unit } from './modules/science';
export type { SystemModule } from './modules/system';
export type { UniqueModule } from './modules/unique';
export type { VehicleModule } from './modules/vehicle';
export type { WordModule } from './modules/word';
export { Faker };
Expand Down
Loading

0 comments on commit 6718cfd

Please sign in to comment.