diff options
| author | renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> | 2024-02-09 17:55:17 +0100 |
|---|---|---|
| committer | GitHub <[email protected]> | 2024-02-09 17:55:17 +0100 |
| commit | bc3ebb793666c0d7e58cf428ba12465a7b290cbe (patch) | |
| tree | 268d0ace82b56aada6fc320dbf99216ca9f0d7c6 | |
| parent | aa183ad7cfe6346248801c280d89f9fad7c3cfee (diff) | |
| download | faker-bc3ebb793666c0d7e58cf428ba12465a7b290cbe.tar.xz faker-bc3ebb793666c0d7e58cf428ba12465a7b290cbe.zip | |
chore(deps)!: update dependency typescript to v5 (#1953)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
Co-authored-by: ST-DDT <[email protected]>
| -rw-r--r-- | docs/guide/upgrading_v9/1953.md | 4 | ||||
| -rw-r--r-- | package.json | 2 | ||||
| -rw-r--r-- | pnpm-lock.yaml | 108 | ||||
| -rw-r--r-- | src/index.ts | 15 | ||||
| -rw-r--r-- | test/all-functional.spec.ts | 2 | ||||
| -rw-r--r-- | test/faker.spec.ts | 2 | ||||
| -rw-r--r-- | test/internal/mersenne.spec.ts | 2 | ||||
| -rw-r--r-- | test/locale-proxy.spec.ts | 2 | ||||
| -rw-r--r-- | test/modules/datatype.spec.ts | 2 | ||||
| -rw-r--r-- | test/modules/date.spec.ts | 2 | ||||
| -rw-r--r-- | test/modules/helpers-eval.spec.ts | 2 | ||||
| -rw-r--r-- | test/modules/helpers.spec.ts | 2 | ||||
| -rw-r--r-- | test/modules/location.spec.ts | 2 | ||||
| -rw-r--r-- | test/modules/number.spec.ts | 2 | ||||
| -rw-r--r-- | test/modules/person.spec.ts | 2 | ||||
| -rw-r--r-- | test/modules/random.spec.ts | 2 | ||||
| -rw-r--r-- | test/modules/string.spec.ts | 2 | ||||
| -rw-r--r-- | test/scripts/apidoc/__snapshots__/signature.spec.ts.snap | 20 | ||||
| -rw-r--r-- | test/scripts/apidoc/signature.example.ts | 2 | ||||
| -rw-r--r-- | test/scripts/apidoc/verify-jsdoc-tags.spec.ts | 2 | ||||
| -rw-r--r-- | test/support/seeded-runs.ts | 2 |
21 files changed, 93 insertions, 88 deletions
diff --git a/docs/guide/upgrading_v9/1953.md b/docs/guide/upgrading_v9/1953.md new file mode 100644 index 00000000..65a36772 --- /dev/null +++ b/docs/guide/upgrading_v9/1953.md @@ -0,0 +1,4 @@ +### Upgrade to TypeScript v5 + +We now use TypeScript v5 for our project (previously v4). +While generally not breaking for users, this might have small side effects on our types. diff --git a/package.json b/package.json index 8e6ce8c5..958c05f5 100644 --- a/package.json +++ b/package.json @@ -126,7 +126,7 @@ "standard-version": "~9.5.0", "tsx": "~4.7.0", "typedoc": "~0.25.7", - "typescript": "~4.9.5", + "typescript": "~5.3.3", "validator": "~13.11.0", "vite": "~5.1.1", "vitepress": "1.0.0-rc.39", diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index d079b3b4..c8862355 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -43,10 +43,10 @@ devDependencies: version: 13.11.9 '@typescript-eslint/eslint-plugin': specifier: ~6.21.0 '@typescript-eslint/parser': specifier: ~6.21.0 - version: 6.21.0([email protected])([email protected]) + version: 6.21.0([email protected])([email protected]) '@vitest/coverage-v8': specifier: ~1.2.2 version: 1.2.2([email protected]) @@ -79,7 +79,7 @@ devDependencies: version: 0.1.0([email protected]) eslint-plugin-deprecation: specifier: ~2.0.0 - version: 2.0.0([email protected])([email protected]) + version: 2.0.0([email protected])([email protected]) eslint-plugin-jsdoc: specifier: ~48.0.6 version: 48.0.6([email protected]) @@ -91,7 +91,7 @@ devDependencies: version: 51.0.1([email protected]) eslint-plugin-vitest: specifier: ~0.3.22 - version: 0.3.22(@typescript-eslint/[email protected])([email protected])([email protected])([email protected]) + version: 0.3.22(@typescript-eslint/[email protected])([email protected])([email protected])([email protected]) glob: specifier: ~10.3.10 version: 10.3.10 @@ -103,7 +103,7 @@ devDependencies: version: 3.2.5 prettier-plugin-organize-imports: specifier: ~3.2.4 - version: 3.2.4([email protected])([email protected]) + version: 3.2.4([email protected])([email protected]) rimraf: specifier: ~5.0.5 version: 5.0.5 @@ -121,10 +121,10 @@ devDependencies: version: 4.7.0 typedoc: specifier: ~0.25.7 - version: 0.25.7([email protected]) + version: 0.25.7([email protected]) typescript: - specifier: ~4.9.5 - version: 4.9.5 + specifier: ~5.3.3 + version: 5.3.3 validator: specifier: ~13.11.0 version: 13.11.0 @@ -133,13 +133,13 @@ devDependencies: version: 5.1.1(@types/[email protected]) vitepress: specifier: 1.0.0-rc.39 - version: 1.0.0-rc.39(@algolia/[email protected])(@types/[email protected])([email protected])([email protected]) + version: 1.0.0-rc.39(@algolia/[email protected])(@types/[email protected])([email protected])([email protected]) vitest: specifier: ~1.2.2 version: 1.2.2(@types/[email protected])(@vitest/[email protected]) vue: specifier: ~3.4.18 - version: 3.4.18([email protected]) + version: 3.4.18([email protected]) packages: @@ -1310,7 +1310,7 @@ packages: dev: true optional: true - /@typescript-eslint/[email protected](@typescript-eslint/[email protected])([email protected])([email protected]): + /@typescript-eslint/[email protected](@typescript-eslint/[email protected])([email protected])([email protected]): resolution: {integrity: sha512-oy9+hTPCUFpngkEZUSzbf9MxI65wbKFoQYsgPdILTfbUldp5ovUuphZVe4i30emU9M/kP+T64Di0mxl7dSw3MA==} engines: {node: ^16.0.0 || >=18.0.0} peerDependencies: @@ -1322,10 +1322,10 @@ packages: optional: true dependencies: '@eslint-community/regexpp': 4.10.0 - '@typescript-eslint/parser': 6.21.0([email protected])([email protected]) + '@typescript-eslint/parser': 6.21.0([email protected])([email protected]) '@typescript-eslint/scope-manager': 6.21.0 - '@typescript-eslint/type-utils': 6.21.0([email protected])([email protected]) - '@typescript-eslint/utils': 6.21.0([email protected])([email protected]) + '@typescript-eslint/type-utils': 6.21.0([email protected])([email protected]) + '@typescript-eslint/utils': 6.21.0([email protected])([email protected]) '@typescript-eslint/visitor-keys': 6.21.0 debug: 4.3.4([email protected]) eslint: 8.56.0 @@ -1333,13 +1333,13 @@ packages: ignore: 5.3.1 natural-compare: 1.4.0 semver: 7.6.0 - ts-api-utils: 1.2.1([email protected]) - typescript: 4.9.5 + ts-api-utils: 1.2.1([email protected]) + typescript: 5.3.3 transitivePeerDependencies: - supports-color dev: true resolution: {integrity: sha512-tbsV1jPne5CkFQCgPBcDOt30ItF7aJoZL997JSF7MhGQqOeT3svWRYxiqlfA5RUdlHN6Fi+EI9bxqbdyAUZjYQ==} engines: {node: ^16.0.0 || >=18.0.0} peerDependencies: @@ -1351,11 +1351,11 @@ packages: dependencies: '@typescript-eslint/scope-manager': 6.21.0 '@typescript-eslint/types': 6.21.0 - '@typescript-eslint/typescript-estree': 6.21.0([email protected]) + '@typescript-eslint/typescript-estree': 6.21.0([email protected]) '@typescript-eslint/visitor-keys': 6.21.0 debug: 4.3.4([email protected]) eslint: 8.56.0 - typescript: 4.9.5 + typescript: 5.3.3 transitivePeerDependencies: - supports-color dev: true @@ -1368,7 +1368,7 @@ packages: '@typescript-eslint/visitor-keys': 6.21.0 dev: true resolution: {integrity: sha512-rZQI7wHfao8qMX3Rd3xqeYSMCL3SoiSQLBATSiVKARdFGCYSRvmViieZjqc58jKgs8Y8i9YvVVhRbHSTA4VBag==} engines: {node: ^16.0.0 || >=18.0.0} peerDependencies: @@ -1378,12 +1378,12 @@ packages: typescript: optional: true dependencies: - '@typescript-eslint/typescript-estree': 6.21.0([email protected]) - '@typescript-eslint/utils': 6.21.0([email protected])([email protected]) + '@typescript-eslint/typescript-estree': 6.21.0([email protected]) + '@typescript-eslint/utils': 6.21.0([email protected])([email protected]) debug: 4.3.4([email protected]) eslint: 8.56.0 - ts-api-utils: 1.2.1([email protected]) - typescript: 4.9.5 + ts-api-utils: 1.2.1([email protected]) + typescript: 5.3.3 transitivePeerDependencies: - supports-color dev: true @@ -1393,7 +1393,7 @@ packages: engines: {node: ^16.0.0 || >=18.0.0} dev: true - /@typescript-eslint/[email protected]([email protected]): + /@typescript-eslint/[email protected]([email protected]): resolution: {integrity: sha512-6npJTkZcO+y2/kr+z0hc4HwNfrrP4kNYh57ek7yCNlrBjWQ1Y0OS7jiZTkgumrvkX5HkEKXFZkkdFNkaW2wmUQ==} engines: {node: ^16.0.0 || >=18.0.0} peerDependencies: @@ -1409,13 +1409,13 @@ packages: is-glob: 4.0.3 minimatch: 9.0.3 semver: 7.6.0 - ts-api-utils: 1.2.1([email protected]) - typescript: 4.9.5 + ts-api-utils: 1.2.1([email protected]) + typescript: 5.3.3 transitivePeerDependencies: - supports-color dev: true resolution: {integrity: sha512-NfWVaC8HP9T8cbKQxHcsJBY5YE1O33+jpMwN45qzWWaPDZgLIbo12toGMWnmhvCpd3sIxkpDw3Wv1B3dYrbDQQ==} engines: {node: ^16.0.0 || >=18.0.0} peerDependencies: @@ -1426,7 +1426,7 @@ packages: '@types/semver': 7.5.6 '@typescript-eslint/scope-manager': 6.21.0 '@typescript-eslint/types': 6.21.0 - '@typescript-eslint/typescript-estree': 6.21.0([email protected]) + '@typescript-eslint/typescript-estree': 6.21.0([email protected]) eslint: 8.56.0 semver: 7.6.0 transitivePeerDependencies: @@ -1454,7 +1454,7 @@ packages: vue: ^3.2.25 dependencies: vite: 5.1.1(@types/[email protected]) - vue: 3.4.18([email protected]) + vue: 3.4.18([email protected]) dev: true /@vitest/[email protected]([email protected]): @@ -1604,7 +1604,7 @@ packages: dependencies: '@vue/compiler-ssr': 3.4.18 '@vue/shared': 3.4.18 - vue: 3.4.18([email protected]) + vue: 3.4.18([email protected]) dev: true /@vue/[email protected]: @@ -2975,17 +2975,17 @@ packages: - supports-color dev: true resolution: {integrity: sha512-OAm9Ohzbj11/ZFyICyR5N6LbOIvQMp7ZU2zI7Ej0jIc8kiGUERXPNMfw2QqqHD1ZHtjMub3yPZILovYEYucgoQ==} peerDependencies: eslint: ^7.0.0 || ^8.0.0 typescript: ^4.2.4 || ^5.0.0 dependencies: - '@typescript-eslint/utils': 6.21.0([email protected])([email protected]) + '@typescript-eslint/utils': 6.21.0([email protected])([email protected]) eslint: 8.56.0 tslib: 2.6.2 - tsutils: 3.21.0([email protected]) - typescript: 4.9.5 + tsutils: 3.21.0([email protected]) + typescript: 5.3.3 transitivePeerDependencies: - supports-color dev: true @@ -3058,7 +3058,7 @@ packages: - supports-color dev: true - /[email protected](@typescript-eslint/[email protected])([email protected])([email protected])([email protected]): + /[email protected](@typescript-eslint/[email protected])([email protected])([email protected])([email protected]): resolution: {integrity: sha512-atkFGQ7aVgcuSeSMDqnyevIyUpfBPMnosksgEPrKE7Y8xQlqG/5z2IQ6UDau05zXaaFv7Iz8uzqvIuKshjZ0Zw==} engines: {node: ^18.0.0 || >= 20.0.0} peerDependencies: @@ -3071,8 +3071,8 @@ packages: vitest: optional: true dependencies: - '@typescript-eslint/eslint-plugin': 6.21.0(@typescript-eslint/[email protected])([email protected])([email protected]) - '@typescript-eslint/utils': 6.21.0([email protected])([email protected]) + '@typescript-eslint/eslint-plugin': 6.21.0(@typescript-eslint/[email protected])([email protected])([email protected]) + '@typescript-eslint/utils': 6.21.0([email protected])([email protected]) eslint: 8.56.0 vitest: 1.2.2(@types/[email protected])(@vitest/[email protected]) transitivePeerDependencies: @@ -4888,7 +4888,7 @@ packages: fast-diff: 1.3.0 dev: true resolution: {integrity: sha512-6m8WBhIp0dfwu0SkgfOxJqh+HpdyfqSSLfKKRZSFbDuEQXDDndb8fTpRWkUrX/uBenkex3MgnVk0J3b3Y5byog==} peerDependencies: '@volar/vue-language-plugin-pug': ^1.0.4 @@ -4902,7 +4902,7 @@ packages: optional: true dependencies: prettier: 3.2.5 - typescript: 4.9.5 + typescript: 5.3.3 dev: true @@ -5732,13 +5732,13 @@ packages: engines: {node: '>=8'} dev: true resolution: {integrity: sha512-RIYA36cJn2WiH9Hy77hdF9r7oEwxAtB/TS9/S4Qd90Ap4z5FSiin5zEiTL44OII1Y3IIlEvxwxFUVgrHSZ/UpA==} engines: {node: '>=16'} peerDependencies: typescript: '>=4.2.0' dependencies: - typescript: 4.9.5 + typescript: 5.3.3 dev: true @@ -5749,14 +5749,14 @@ packages: resolution: {integrity: sha512-AEYxH93jGFPn/a2iVAwW87VuUIkR1FVUKB77NwMF7nBTDkDrrT/Hpt/IrCJ0QXhW27jTBDcf5ZY7w6RiqTMw2Q==} dev: true resolution: {integrity: sha512-mHKK3iUXL+3UF6xL5k0PEhKRUBKPBCv/+RkEOpjRWxxx27KKRBmmA60A9pgOUvMi8GKhRMPEmjBRPzs2W7O1OA==} engines: {node: '>= 6'} peerDependencies: typescript: '>=2.8.0 || >= 3.2.0-dev || >= 3.3.0-dev || >= 3.4.0-dev || >= 3.5.0-dev || >= 3.6.0-dev || >= 3.6.0-beta || >= 3.7.0-dev || >= 3.7.0-beta' dependencies: tslib: 1.14.1 - typescript: 4.9.5 + typescript: 5.3.3 dev: true @@ -5874,7 +5874,7 @@ packages: resolution: {integrity: sha512-/aCDEGatGvZ2BIk+HmLf4ifCJFwvKFNb9/JeZPMulfgFracn9QFcAf5GO8B/mweUjSoblS5In0cWhqpfs/5PQA==} dev: true resolution: {integrity: sha512-m6A6JjQRg39p2ZVRIN3NKXgrN8vzlHhOS+r9ymUYtcUP/TIQPvWSq7YgE5ZjASfv5Vd5BW5xrir6Gm2XNNcOow==} engines: {node: '>= 16'} hasBin: true @@ -5885,12 +5885,12 @@ packages: marked: 4.3.0 minimatch: 9.0.3 shiki: 0.14.7 - typescript: 4.9.5 + typescript: 5.3.3 dev: true - resolution: {integrity: sha512-1FXk9E2Hm+QzZQ7z+McJiHL4NW1F2EzMu9Nq9i3zAaGqibafqYwCVU6WyWAuyQRRzOlxou8xZSyXLEN8oKj24g==} - engines: {node: '>=4.2.0'} + resolution: {integrity: sha512-pXWcraxM0uxAS+tN0AG/BF2TyqmHO014Z070UsJ+pFvYuRSq8KH8DmWpnbXe0pEPDHXZV3FcAbJkijJ5oNEnWw==} + engines: {node: '>=14.17'} hasBin: true dev: true @@ -6065,7 +6065,7 @@ packages: fsevents: 2.3.3 dev: true - /[email protected](@algolia/[email protected])(@types/[email protected])([email protected])([email protected]): + /[email protected](@algolia/[email protected])(@types/[email protected])([email protected])([email protected]): resolution: {integrity: sha512-EcgoRlAAp37WOxUOYv45oxyhLrcy3Upey+mKpqW3ldsg6Ol4trPndRBk2GO0QiSvEKlb9BMerk49D/bFICN6kg==} hasBin: true peerDependencies: @@ -6091,7 +6091,7 @@ packages: shikiji-core: 0.9.19 shikiji-transformers: 0.9.19 vite: 5.1.1(@types/[email protected]) - vue: 3.4.18([email protected]) + vue: 3.4.18([email protected]) transitivePeerDependencies: - '@algolia/client-search' - '@types/node' @@ -6198,10 +6198,10 @@ packages: '@vue/composition-api': optional: true dependencies: - vue: 3.4.18([email protected]) + vue: 3.4.18([email protected]) dev: true resolution: {integrity: sha512-0zLRYamFRe0wF4q2L3O24KQzLyLpL64ye1RUToOgOxuWZsb/FhaNRdGmeozdtVYLz6tl94OXLaK7/WQIrVCw1A==} peerDependencies: typescript: '*' @@ -6214,7 +6214,7 @@ packages: '@vue/runtime-dom': 3.4.18 '@vue/server-renderer': 3.4.18([email protected]) '@vue/shared': 3.4.18 - typescript: 4.9.5 + typescript: 5.3.3 dev: true diff --git a/src/index.ts b/src/index.ts index 8adcd384..8a8ffdb7 100644 --- a/src/index.ts +++ b/src/index.ts @@ -1,4 +1,7 @@ +// organize-imports-ignore export type { + /** @deprecated Use LocationDefinitions instead */ + LocationDefinition as AddressDefinitions, AirlineDefinition, /** @deprecated Use AirlineDefinition instead */ AirlineDefinition as AirlineDefinitions, @@ -35,8 +38,6 @@ export type { InternetDefinition as InternetDefinitions, LocaleDefinition, LocaleEntry, - /** @deprecated Use LocationDefinitions instead */ - LocationDefinition as AddressDefinitions, LocationDefinition, LoremDefinition, /** @deprecated Use LoremDefinition instead */ @@ -47,9 +48,9 @@ export type { MusicDefinition as MusicDefinitions, /** @deprecated Use PersonDefinitions instead */ PersonDefinition as NameDefinitions, - PersonDefinition, /** @deprecated Use PersonTitleDefinitions instead */ PersonTitleDefinition as NameTitleDefinitions, + PersonDefinition, PersonTitleDefinition, PhoneNumberDefinition, /** @deprecated Use PhoneNumberDefinition instead */ @@ -82,14 +83,14 @@ export type { AircraftType, AirlineModule } from './modules/airline'; export type { AnimalModule } from './modules/animal'; export { CssFunction, CssSpace } from './modules/color'; export type { - Casing, - ColorFormat, - ColorModule, /** @deprecated Use CssFunctionType instead */ CssFunctionType as CSSFunction, - CssFunctionType, /** @deprecated Use CssSpaceType instead */ CssSpaceType as CSSSpace, + Casing, + ColorFormat, + ColorModule, + CssFunctionType, CssSpaceType, NumberColorFormat, StringColorFormat, diff --git a/test/all-functional.spec.ts b/test/all-functional.spec.ts index a883da7d..80b1fece 100644 --- a/test/all-functional.spec.ts +++ b/test/all-functional.spec.ts @@ -1,5 +1,5 @@ import { describe, expect, it } from 'vitest'; -import type { allLocales, Faker, RandomModule } from '../src'; +import type { Faker, RandomModule, allLocales } from '../src'; import { allFakers, fakerEN } from '../src'; import { keys } from '../src/internal/keys'; diff --git a/test/faker.spec.ts b/test/faker.spec.ts index 06d192c1..a026577b 100644 --- a/test/faker.spec.ts +++ b/test/faker.spec.ts @@ -1,6 +1,6 @@ import type { MockInstance } from 'vitest'; import { describe, expect, it, vi } from 'vitest'; -import { faker, Faker } from '../src'; +import { Faker, faker } from '../src'; import { FakerError } from '../src/errors/faker-error'; import { keys } from '../src/internal/keys'; diff --git a/test/internal/mersenne.spec.ts b/test/internal/mersenne.spec.ts index bbee0502..d72a9c3f 100644 --- a/test/internal/mersenne.spec.ts +++ b/test/internal/mersenne.spec.ts @@ -1,7 +1,7 @@ import { beforeAll, beforeEach, describe, expect, it } from 'vitest'; import { - generateMersenne32Randomizer, MersenneTwister19937, + generateMersenne32Randomizer, } from '../../src/internal/mersenne'; import type { Randomizer } from '../../src/randomizer'; import { seededRuns } from '../support/seeded-runs'; diff --git a/test/locale-proxy.spec.ts b/test/locale-proxy.spec.ts index d1671485..c9c8928c 100644 --- a/test/locale-proxy.spec.ts +++ b/test/locale-proxy.spec.ts @@ -1,5 +1,5 @@ import { describe, expect, it } from 'vitest'; -import { en, FakerError } from '../src'; +import { FakerError, en } from '../src'; import { createLocaleProxy } from '../src/locale-proxy'; describe('LocaleProxy', () => { diff --git a/test/modules/datatype.spec.ts b/test/modules/datatype.spec.ts index 7a75ce58..ca6c3328 100644 --- a/test/modules/datatype.spec.ts +++ b/test/modules/datatype.spec.ts @@ -1,5 +1,5 @@ import { describe, expect, it } from 'vitest'; -import { faker, FakerError } from '../../src'; +import { FakerError, faker } from '../../src'; import { seededTests } from '../support/seeded-runs'; import { times } from './../support/times'; diff --git a/test/modules/date.spec.ts b/test/modules/date.spec.ts index bbd8020d..7cff8d33 100644 --- a/test/modules/date.spec.ts +++ b/test/modules/date.spec.ts @@ -1,5 +1,5 @@ import { afterEach, describe, expect, it } from 'vitest'; -import { faker, fakerAZ, FakerError } from '../../src'; +import { FakerError, faker, fakerAZ } from '../../src'; import { seededTests } from '../support/seeded-runs'; import { times } from './../support/times'; diff --git a/test/modules/helpers-eval.spec.ts b/test/modules/helpers-eval.spec.ts index 40612c37..e6995464 100644 --- a/test/modules/helpers-eval.spec.ts +++ b/test/modules/helpers-eval.spec.ts @@ -1,5 +1,5 @@ import { describe, expect, it, vi } from 'vitest'; -import { faker, FakerError } from '../../src'; +import { FakerError, faker } from '../../src'; import { fakeEval } from '../../src/modules/helpers/eval'; describe('fakeEval()', () => { diff --git a/test/modules/helpers.spec.ts b/test/modules/helpers.spec.ts index 1b9ba3ae..50bacda3 100644 --- a/test/modules/helpers.spec.ts +++ b/test/modules/helpers.spec.ts @@ -1,5 +1,5 @@ import { describe, expect, it } from 'vitest'; -import { faker, FakerError } from '../../src'; +import { FakerError, faker } from '../../src'; import { luhnCheck } from '../../src/modules/helpers/luhn-check'; import type { RecordKey } from '../../src/modules/helpers/unique'; import { seededTests } from '../support/seeded-runs'; diff --git a/test/modules/location.spec.ts b/test/modules/location.spec.ts index cb020418..682e3441 100644 --- a/test/modules/location.spec.ts +++ b/test/modules/location.spec.ts @@ -1,5 +1,5 @@ import { describe, expect, it } from 'vitest'; -import { faker, fakerEN_CA, fakerEN_US, FakerError } from '../../src'; +import { FakerError, faker, fakerEN_CA, fakerEN_US } from '../../src'; import { seededTests } from '../support/seeded-runs'; import { times } from './../support/times'; diff --git a/test/modules/number.spec.ts b/test/modules/number.spec.ts index 922819c0..43d0bc99 100644 --- a/test/modules/number.spec.ts +++ b/test/modules/number.spec.ts @@ -1,6 +1,6 @@ import validator from 'validator'; import { describe, expect, it } from 'vitest'; -import { faker, FakerError, SimpleFaker } from '../../src'; +import { FakerError, SimpleFaker, faker } from '../../src'; import { MERSENNE_MAX_VALUE } from '../internal/mersenne-test-utils'; import { seededTests } from '../support/seeded-runs'; import { times } from './../support/times'; diff --git a/test/modules/person.spec.ts b/test/modules/person.spec.ts index 14bedf1d..1af3dfb8 100644 --- a/test/modules/person.spec.ts +++ b/test/modules/person.spec.ts @@ -1,5 +1,5 @@ import { describe, expect, it } from 'vitest'; -import { faker, fakerAZ, fakerMK, fakerUK, Sex } from '../../src'; +import { Sex, faker, fakerAZ, fakerMK, fakerUK } from '../../src'; import { seededTests } from '../support/seeded-runs'; import { times } from './../support/times'; diff --git a/test/modules/random.spec.ts b/test/modules/random.spec.ts index f6fe2234..94de137e 100644 --- a/test/modules/random.spec.ts +++ b/test/modules/random.spec.ts @@ -1,5 +1,5 @@ import { describe, expect, it } from 'vitest'; -import { Faker, faker, FakerError, fakerZH_CN } from '../../src'; +import { Faker, FakerError, faker, fakerZH_CN } from '../../src'; import { seededTests } from '../support/seeded-runs'; import { times } from './../support/times'; diff --git a/test/modules/string.spec.ts b/test/modules/string.spec.ts index e82fa93f..22fa8aeb 100644 --- a/test/modules/string.spec.ts +++ b/test/modules/string.spec.ts @@ -1,5 +1,5 @@ import { describe, expect, it } from 'vitest'; -import { faker, FakerError } from '../../src'; +import { FakerError, faker } from '../../src'; import { seededTests } from '../support/seeded-runs'; import { times } from './../support/times'; diff --git a/test/scripts/apidoc/__snapshots__/signature.spec.ts.snap b/test/scripts/apidoc/__snapshots__/signature.spec.ts.snap index d62c6c4c..37a9f754 100644 --- a/test/scripts/apidoc/__snapshots__/signature.spec.ts.snap +++ b/test/scripts/apidoc/__snapshots__/signature.spec.ts.snap @@ -130,7 +130,7 @@ exports[`signature > analyzeSignature() > literalUnionParamMethod 1`] = ` "deprecated": undefined, "description": "<p>Test with LiteralUnion.</p> ", - "examples": "<div class="language-ts vp-adaptive-theme"><button title="Copy Code" class="copy"></button><span class="lang">ts</span><pre class="shiki shiki-themes github-light github-dark vp-code" v-pre><code><span class="line"><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0">literalUnionParamMethod</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8">(value: </span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF">'a'</span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583"> |</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF"> 'b'</span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583"> |</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8"> string, namedValue: </span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF">'a'</span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583"> |</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF"> 'b'</span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583"> |</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8"> string, array: readonly Array</span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583"><</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF">'a'</span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583"> |</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF"> 'b'</span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583"> |</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8"> string</span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583">></span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8">, namedArray: readonly Array</span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583"><</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF">'a'</span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583"> |</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF"> 'b'</span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583"> |</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8"> string</span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583">></span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8">, mixed: </span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF">'a'</span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583"> |</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF"> 'b'</span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583"> |</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8"> string </span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583">|</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8"> readonly Array</span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583"><</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF">'a'</span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583"> |</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF"> 'b'</span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583"> |</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8"> string</span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583">></span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8">, namedMixed: </span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF">'a'</span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583"> |</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF"> 'b'</span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583"> |</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8"> string </span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583">|</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8"> readonly Array</span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583"><</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF">'a'</span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583"> |</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF"> 'b'</span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583"> |</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8"> string</span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583">></span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8">): string</span></span></code></pre> + "examples": "<div class="language-ts vp-adaptive-theme"><button title="Copy Code" class="copy"></button><span class="lang">ts</span><pre class="shiki shiki-themes github-light github-dark vp-code" v-pre><code><span class="line"><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0">literalUnionParamMethod</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8">(value: </span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF">'a'</span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583"> |</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF"> 'b'</span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583"> |</span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583"> ?</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8">, namedValue</span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583">:</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF"> 'a'</span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583"> |</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF"> 'b'</span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583"> |</span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583"> ?</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8">, array</span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583">:</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8"> readonly Array</span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583"><</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF">'a'</span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583"> |</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF"> 'b'</span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583"> |</span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583"> ?></span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8">, namedArray</span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583">:</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8"> readonly Array</span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583"><</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF">'a'</span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583"> |</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF"> 'b'</span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583"> |</span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583"> ?></span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8">, mixed</span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583">:</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF"> 'a'</span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583"> |</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF"> 'b'</span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583"> |</span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583"> ?</span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583"> |</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8"> readonly Array</span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583"><</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF">'a'</span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583"> |</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF"> 'b'</span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583"> |</span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583"> ?></span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8">, namedMixed</span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583">:</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF"> 'a'</span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583"> |</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF"> 'b'</span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583"> |</span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583"> ?</span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583"> |</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8"> readonly Array</span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583"><</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF">'a'</span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583"> |</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF"> 'b'</span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583"> |</span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583"> ?></span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8">)</span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583">:</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8"> string</span></span></code></pre> </div>", "name": "literalUnionParamMethod", "parameters": [ @@ -139,42 +139,42 @@ exports[`signature > analyzeSignature() > literalUnionParamMethod 1`] = ` "description": "<p><code>'a'</code> or <code>'b'</code>.</p> ", "name": "value", - "type": "'a' | 'b' | string", + "type": "'a' | 'b' | ?", }, { "default": undefined, "description": "<p><code>'a'</code> or <code>'b'</code>.</p> ", "name": "namedValue", - "type": "'a' | 'b' | string", + "type": "'a' | 'b' | ?", }, { "default": undefined, "description": "<p>Array of <code>'a'</code> or <code>'b'</code>.</p> ", "name": "array", - "type": "Array<'a' | 'b' | string>", + "type": "Array<'a' | 'b' | ?>", }, { "default": undefined, "description": "<p>Array of <code>'a'</code> or <code>'b'</code>.</p> ", "name": "namedArray", - "type": "Array<'a' | 'b' | string>", + "type": "Array<'a' | 'b' | ?>", }, { "default": undefined, "description": "<p>Value <code>'a'</code> or <code>'b'</code> or an array thereof.</p> ", "name": "mixed", - "type": "'a' | 'b' | string | Array<'a' | 'b' | string>", + "type": "'a' | 'b' | ? | Array<'a' | 'b' | ?>", }, { "default": undefined, "description": "<p>Value <code>'a'</code> or <code>'b'</code> or an array thereof.</p> ", "name": "namedMixed", - "type": "'a' | 'b' | string | Array<'a' | 'b' | string>", + "type": "'a' | 'b' | ? | Array<'a' | 'b' | ?>", }, ], "returns": "string", @@ -565,8 +565,8 @@ exports[`signature > analyzeSignature() > optionsParamMethod 1`] = ` <span class="line"><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8"> b: string,</span></span> <span class="line"><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8"> c: boolean,</span></span> <span class="line"><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0"> d</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8">: () </span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583">=></span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8"> string,</span></span> -<span class="line"><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8"> e: </span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF">'a'</span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583"> |</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF"> 'b'</span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583"> |</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8"> string</span></span> -<span class="line"><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8">}): number</span></span></code></pre> +<span class="line"><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8"> e: </span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF">'a'</span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583"> |</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF"> 'b'</span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583"> |</span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583"> ?</span></span> +<span class="line"><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8">})</span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583">:</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8"> number</span></span></code></pre> </div>", "name": "optionsParamMethod", "parameters": [ @@ -610,7 +610,7 @@ exports[`signature > analyzeSignature() > optionsParamMethod 1`] = ` "description": "<p>A parameter with inline documentation.</p> ", "name": "options.e", - "type": "'a' | 'b' | string", + "type": "'a' | 'b' | ?", }, ], "returns": "number", diff --git a/test/scripts/apidoc/signature.example.ts b/test/scripts/apidoc/signature.example.ts index 2f62057b..af04ee90 100644 --- a/test/scripts/apidoc/signature.example.ts +++ b/test/scripts/apidoc/signature.example.ts @@ -4,7 +4,7 @@ import type { AlphaNumericChar } from '../../../src/modules/string'; import type { LiteralUnion } from '../../../src/utils/types'; // explicitly export types so they show up in the docs as decomposed types export type { NumberColorFormat, StringColorFormat } from '../../../src'; -export { Casing, ColorFormat, AlphaNumericChar, LiteralUnion }; +export { AlphaNumericChar, Casing, ColorFormat, LiteralUnion }; /** * Parameter options type with default from signature. diff --git a/test/scripts/apidoc/verify-jsdoc-tags.spec.ts b/test/scripts/apidoc/verify-jsdoc-tags.spec.ts index b14523e1..7d6d8554 100644 --- a/test/scripts/apidoc/verify-jsdoc-tags.spec.ts +++ b/test/scripts/apidoc/verify-jsdoc-tags.spec.ts @@ -7,6 +7,7 @@ import { afterAll, beforeAll, describe, expect, it, vi } from 'vitest'; import { initMarkdownRenderer } from '../../../scripts/apidoc/markdown'; import { analyzeSignature } from '../../../scripts/apidoc/signature'; import { + MISSING_DESCRIPTION, extractDeprecated, extractDescription, extractJoinedRawExamples, @@ -16,7 +17,6 @@ import { extractSince, extractSummaryDefault, extractTagContent, - MISSING_DESCRIPTION, } from '../../../scripts/apidoc/typedoc'; import { loadProjectModules } from './utils'; diff --git a/test/support/seeded-runs.ts b/test/support/seeded-runs.ts index e95a522f..75019799 100644 --- a/test/support/seeded-runs.ts +++ b/test/support/seeded-runs.ts @@ -1,4 +1,4 @@ -import { describe, describe as vi_describe, expect, it as vi_it } from 'vitest'; +import { describe, expect, describe as vi_describe, it as vi_it } from 'vitest'; import type { Faker } from '../../src/faker'; import type { Callable, MethodOf } from '../../src/utils/types'; |
