Skip to content

Commit

Permalink
chore: rename generation command
Browse files Browse the repository at this point in the history
  • Loading branch information
ST-DDT committed Jan 28, 2022
1 parent d80e22b commit 28aba63
Show file tree
Hide file tree
Showing 60 changed files with 63 additions and 61 deletions.
2 changes: 1 addition & 1 deletion CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ If you want to make `Faker` a better, please read the following contribution gui
Make sure you **build** the project before running the docs, cause some files depend on `dist`.
Use `pnpm run docs:dev` to edit them in live mode.
- The tests are executing `vitest` against `test/**/*.spec.ts`
- If you update the locales, make sure to run `pnpm run generate` to generate/update the related files.
- If you update the locales, make sure to run `pnpm run generate:locales` to generate/update the related files.

## Architecture

Expand Down
2 changes: 1 addition & 1 deletion docs/api/localization.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ faker.locale = 'de';

<!-- LOCALES-AUTO-GENERATED-START -->

<!-- Run 'pnpm run generate' to update. -->
<!-- Run 'pnpm run generate:locales' to update. -->

| Locale | Name |
| :---------- | :------------------------ |
Expand Down
6 changes: 4 additions & 2 deletions scripts/generateLocales.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,8 @@ const pathDocsApiLocalization = resolve(
'localization.md'
);

const scriptCommand = 'pnpm run generate:locales';

const locales = readdirSync(pathLocales);
locales.splice(locales.indexOf('index.ts'), 1);

Expand All @@ -26,7 +28,7 @@ let localizationLocales = '| Locale | Name |\n| :--- | :--- |\n';

const autoGeneratedCommentHeader = `/*
* This file is automatically generated.
* Run 'pnpm run generate' to update.
* Run '${scriptCommand}' to update.
*/`;

for (let locale of locales) {
Expand Down Expand Up @@ -93,6 +95,6 @@ localizationLocales = format(localizationLocales, {
let localizationContent = readFileSync(pathDocsApiLocalization, 'utf-8');
localizationContent = localizationContent.replace(
/(^<!-- LOCALES-AUTO-GENERATED-START -->$).*(^<!-- LOCALES-AUTO-GENERATED-END -->$)/gms,
`$1\n\n<!-- Run 'pnpm run generate' to update. -->\n\n${localizationLocales}\n$2`
`$1\n\n<!-- Run '${scriptCommand}' to update. -->\n\n${localizationLocales}\n$2`
);
writeFileSync(pathDocsApiLocalization, localizationContent);
2 changes: 1 addition & 1 deletion src/locale/af_ZA.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/*
* This file is automatically generated.
* Run 'pnpm run generate' to update.
* Run 'pnpm run generate:locales' to update.
*/

import { Faker } from '..';
Expand Down
2 changes: 1 addition & 1 deletion src/locale/ar.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/*
* This file is automatically generated.
* Run 'pnpm run generate' to update.
* Run 'pnpm run generate:locales' to update.
*/

import { Faker } from '..';
Expand Down
2 changes: 1 addition & 1 deletion src/locale/az.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/*
* This file is automatically generated.
* Run 'pnpm run generate' to update.
* Run 'pnpm run generate:locales' to update.
*/

import { Faker } from '..';
Expand Down
2 changes: 1 addition & 1 deletion src/locale/cz.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/*
* This file is automatically generated.
* Run 'pnpm run generate' to update.
* Run 'pnpm run generate:locales' to update.
*/

import { Faker } from '..';
Expand Down
2 changes: 1 addition & 1 deletion src/locale/de.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/*
* This file is automatically generated.
* Run 'pnpm run generate' to update.
* Run 'pnpm run generate:locales' to update.
*/

import { Faker } from '..';
Expand Down
2 changes: 1 addition & 1 deletion src/locale/de_AT.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/*
* This file is automatically generated.
* Run 'pnpm run generate' to update.
* Run 'pnpm run generate:locales' to update.
*/

import { Faker } from '..';
Expand Down
2 changes: 1 addition & 1 deletion src/locale/de_CH.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/*
* This file is automatically generated.
* Run 'pnpm run generate' to update.
* Run 'pnpm run generate:locales' to update.
*/

import { Faker } from '..';
Expand Down
2 changes: 1 addition & 1 deletion src/locale/el.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/*
* This file is automatically generated.
* Run 'pnpm run generate' to update.
* Run 'pnpm run generate:locales' to update.
*/

import { Faker } from '..';
Expand Down
2 changes: 1 addition & 1 deletion src/locale/en.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/*
* This file is automatically generated.
* Run 'pnpm run generate' to update.
* Run 'pnpm run generate:locales' to update.
*/

import { Faker } from '..';
Expand Down
2 changes: 1 addition & 1 deletion src/locale/en_AU.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/*
* This file is automatically generated.
* Run 'pnpm run generate' to update.
* Run 'pnpm run generate:locales' to update.
*/

import { Faker } from '..';
Expand Down
2 changes: 1 addition & 1 deletion src/locale/en_AU_ocker.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/*
* This file is automatically generated.
* Run 'pnpm run generate' to update.
* Run 'pnpm run generate:locales' to update.
*/

import { Faker } from '..';
Expand Down
2 changes: 1 addition & 1 deletion src/locale/en_BORK.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/*
* This file is automatically generated.
* Run 'pnpm run generate' to update.
* Run 'pnpm run generate:locales' to update.
*/

import { Faker } from '..';
Expand Down
2 changes: 1 addition & 1 deletion src/locale/en_CA.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/*
* This file is automatically generated.
* Run 'pnpm run generate' to update.
* Run 'pnpm run generate:locales' to update.
*/

import { Faker } from '..';
Expand Down
2 changes: 1 addition & 1 deletion src/locale/en_GB.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/*
* This file is automatically generated.
* Run 'pnpm run generate' to update.
* Run 'pnpm run generate:locales' to update.
*/

import { Faker } from '..';
Expand Down
2 changes: 1 addition & 1 deletion src/locale/en_GH.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/*
* This file is automatically generated.
* Run 'pnpm run generate' to update.
* Run 'pnpm run generate:locales' to update.
*/

import { Faker } from '..';
Expand Down
2 changes: 1 addition & 1 deletion src/locale/en_IE.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/*
* This file is automatically generated.
* Run 'pnpm run generate' to update.
* Run 'pnpm run generate:locales' to update.
*/

import { Faker } from '..';
Expand Down
2 changes: 1 addition & 1 deletion src/locale/en_IND.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/*
* This file is automatically generated.
* Run 'pnpm run generate' to update.
* Run 'pnpm run generate:locales' to update.
*/

import { Faker } from '..';
Expand Down
2 changes: 1 addition & 1 deletion src/locale/en_NG.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/*
* This file is automatically generated.
* Run 'pnpm run generate' to update.
* Run 'pnpm run generate:locales' to update.
*/

import { Faker } from '..';
Expand Down
2 changes: 1 addition & 1 deletion src/locale/en_US.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/*
* This file is automatically generated.
* Run 'pnpm run generate' to update.
* Run 'pnpm run generate:locales' to update.
*/

import { Faker } from '..';
Expand Down
2 changes: 1 addition & 1 deletion src/locale/en_ZA.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/*
* This file is automatically generated.
* Run 'pnpm run generate' to update.
* Run 'pnpm run generate:locales' to update.
*/

import { Faker } from '..';
Expand Down
2 changes: 1 addition & 1 deletion src/locale/es.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/*
* This file is automatically generated.
* Run 'pnpm run generate' to update.
* Run 'pnpm run generate:locales' to update.
*/

import { Faker } from '..';
Expand Down
2 changes: 1 addition & 1 deletion src/locale/es_MX.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/*
* This file is automatically generated.
* Run 'pnpm run generate' to update.
* Run 'pnpm run generate:locales' to update.
*/

import { Faker } from '..';
Expand Down
2 changes: 1 addition & 1 deletion src/locale/fa.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/*
* This file is automatically generated.
* Run 'pnpm run generate' to update.
* Run 'pnpm run generate:locales' to update.
*/

import { Faker } from '..';
Expand Down
2 changes: 1 addition & 1 deletion src/locale/fi.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/*
* This file is automatically generated.
* Run 'pnpm run generate' to update.
* Run 'pnpm run generate:locales' to update.
*/

import { Faker } from '..';
Expand Down
2 changes: 1 addition & 1 deletion src/locale/fr.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/*
* This file is automatically generated.
* Run 'pnpm run generate' to update.
* Run 'pnpm run generate:locales' to update.
*/

import { Faker } from '..';
Expand Down
2 changes: 1 addition & 1 deletion src/locale/fr_BE.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/*
* This file is automatically generated.
* Run 'pnpm run generate' to update.
* Run 'pnpm run generate:locales' to update.
*/

import { Faker } from '..';
Expand Down
2 changes: 1 addition & 1 deletion src/locale/fr_CA.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/*
* This file is automatically generated.
* Run 'pnpm run generate' to update.
* Run 'pnpm run generate:locales' to update.
*/

import { Faker } from '..';
Expand Down
2 changes: 1 addition & 1 deletion src/locale/fr_CH.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/*
* This file is automatically generated.
* Run 'pnpm run generate' to update.
* Run 'pnpm run generate:locales' to update.
*/

import { Faker } from '..';
Expand Down
2 changes: 1 addition & 1 deletion src/locale/ge.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/*
* This file is automatically generated.
* Run 'pnpm run generate' to update.
* Run 'pnpm run generate:locales' to update.
*/

import { Faker } from '..';
Expand Down
2 changes: 1 addition & 1 deletion src/locale/he.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/*
* This file is automatically generated.
* Run 'pnpm run generate' to update.
* Run 'pnpm run generate:locales' to update.
*/

import { Faker } from '..';
Expand Down
2 changes: 1 addition & 1 deletion src/locale/hr.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/*
* This file is automatically generated.
* Run 'pnpm run generate' to update.
* Run 'pnpm run generate:locales' to update.
*/

import { Faker } from '..';
Expand Down
2 changes: 1 addition & 1 deletion src/locale/hy.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/*
* This file is automatically generated.
* Run 'pnpm run generate' to update.
* Run 'pnpm run generate:locales' to update.
*/

import { Faker } from '..';
Expand Down
2 changes: 1 addition & 1 deletion src/locale/id_ID.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/*
* This file is automatically generated.
* Run 'pnpm run generate' to update.
* Run 'pnpm run generate:locales' to update.
*/

import { Faker } from '..';
Expand Down
2 changes: 1 addition & 1 deletion src/locale/it.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/*
* This file is automatically generated.
* Run 'pnpm run generate' to update.
* Run 'pnpm run generate:locales' to update.
*/

import { Faker } from '..';
Expand Down
2 changes: 1 addition & 1 deletion src/locale/ja.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/*
* This file is automatically generated.
* Run 'pnpm run generate' to update.
* Run 'pnpm run generate:locales' to update.
*/

import { Faker } from '..';
Expand Down
2 changes: 1 addition & 1 deletion src/locale/ko.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/*
* This file is automatically generated.
* Run 'pnpm run generate' to update.
* Run 'pnpm run generate:locales' to update.
*/

import { Faker } from '..';
Expand Down
2 changes: 1 addition & 1 deletion src/locale/lv.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/*
* This file is automatically generated.
* Run 'pnpm run generate' to update.
* Run 'pnpm run generate:locales' to update.
*/

import { Faker } from '..';
Expand Down
2 changes: 1 addition & 1 deletion src/locale/mk.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/*
* This file is automatically generated.
* Run 'pnpm run generate' to update.
* Run 'pnpm run generate:locales' to update.
*/

import { Faker } from '..';
Expand Down
2 changes: 1 addition & 1 deletion src/locale/nb_NO.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/*
* This file is automatically generated.
* Run 'pnpm run generate' to update.
* Run 'pnpm run generate:locales' to update.
*/

import { Faker } from '..';
Expand Down
2 changes: 1 addition & 1 deletion src/locale/ne.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/*
* This file is automatically generated.
* Run 'pnpm run generate' to update.
* Run 'pnpm run generate:locales' to update.
*/

import { Faker } from '..';
Expand Down
2 changes: 1 addition & 1 deletion src/locale/nl.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/*
* This file is automatically generated.
* Run 'pnpm run generate' to update.
* Run 'pnpm run generate:locales' to update.
*/

import { Faker } from '..';
Expand Down
2 changes: 1 addition & 1 deletion src/locale/nl_BE.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/*
* This file is automatically generated.
* Run 'pnpm run generate' to update.
* Run 'pnpm run generate:locales' to update.
*/

import { Faker } from '..';
Expand Down
2 changes: 1 addition & 1 deletion src/locale/pl.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/*
* This file is automatically generated.
* Run 'pnpm run generate' to update.
* Run 'pnpm run generate:locales' to update.
*/

import { Faker } from '..';
Expand Down
2 changes: 1 addition & 1 deletion src/locale/pt_BR.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/*
* This file is automatically generated.
* Run 'pnpm run generate' to update.
* Run 'pnpm run generate:locales' to update.
*/

import { Faker } from '..';
Expand Down
Loading

0 comments on commit 28aba63

Please sign in to comment.