Skip to content

Commit c9e2d7b

Browse files
authored
Merge pull request #49 from mizdra/rename-project
Rename `graphql-fabbrica` to `graphql-codegen-typescript-fabbrica`
2 parents fe22efb + dd02e25 commit c9e2d7b

File tree

7 files changed

+34
-34
lines changed

7 files changed

+34
-34
lines changed

README.md

Lines changed: 16 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
1-
# graphql-fabbrica
1+
# graphql-codegen-typescript-fabbrica
22

33
GraphQL Code Generator Plugin to define mock data factory.
44

55
## Installation
66

77
```sh
8-
npm install --save-dev @mizdra/graphql-fabbrica
8+
npm install --save-dev @mizdra/graphql-codegen-typescript-fabbrica
99
```
1010

1111
## Requirements
@@ -34,7 +34,7 @@ const config: CodegenConfig = {
3434
},
3535
},
3636
'./__generated__/fabbrica.ts': {
37-
plugins: ['@mizdra/graphql-fabbrica'],
37+
plugins: ['@mizdra/graphql-codegen-typescript-fabbrica'],
3838
config: {
3939
typesFile: './types', // required
4040
},
@@ -385,7 +385,7 @@ const config: CodegenConfig = {
385385
},
386386
},
387387
'./__generated__/fabbrica.ts': {
388-
plugins: ['@mizdra/graphql-fabbrica'],
388+
plugins: ['@mizdra/graphql-codegen-typescript-fabbrica'],
389389
config: {
390390
// ...
391391
skipTypename: true,
@@ -417,7 +417,7 @@ const config: CodegenConfig = {
417417
},
418418
},
419419
'./__generated__/fabbrica.ts': {
420-
plugins: ['@mizdra/graphql-fabbrica'],
420+
plugins: ['@mizdra/graphql-codegen-typescript-fabbrica'],
421421
config: {
422422
// ...
423423
skipIsAbstractType: false,
@@ -446,7 +446,7 @@ const config: CodegenConfig = {
446446
},
447447
},
448448
'./__generated__/fabbrica.ts': {
449-
plugins: ['@mizdra/graphql-fabbrica'],
449+
plugins: ['@mizdra/graphql-codegen-typescript-fabbrica'],
450450
config: {
451451
// ...
452452
nonOptionalDefaultFields: true,
@@ -463,7 +463,7 @@ type: `NamingConvention`, default: `change-case-all#pascalCase`
463463

464464
Allow you to override the naming convention of the output.
465465

466-
This option is compatible with [the one for typescript plugin](https://the-guild.dev/graphql/codegen/docs/config-reference/naming-convention#namingconvention). If you specify it for the typescript plugin, you must set the same value for graphql-fabbrica.
466+
This option is compatible with [the one for typescript plugin](https://the-guild.dev/graphql/codegen/docs/config-reference/naming-convention#namingconvention). If you specify it for the typescript plugin, you must set the same value for graphql-codegen-typescript-fabbrica.
467467

468468
```ts
469469
import { CodegenConfig } from '@graphql-codegen/cli';
@@ -478,7 +478,7 @@ const config: CodegenConfig = {
478478
// ...
479479
},
480480
'./__generated__/fabbrica.ts': {
481-
plugins: ['@mizdra/graphql-fabbrica'],
481+
plugins: ['@mizdra/graphql-codegen-typescript-fabbrica'],
482482
// ...
483483
},
484484
},
@@ -492,7 +492,7 @@ type: `string`, default: `''`
492492

493493
Prefixes all the generated types.
494494

495-
This option is compatible with [the one for typescript plugin](https://the-guild.dev/graphql/codegen/plugins/typescript/typescript#typesprefix). If you specify it for the typescript plugin, you must set the same value for graphql-fabbrica.
495+
This option is compatible with [the one for typescript plugin](https://the-guild.dev/graphql/codegen/plugins/typescript/typescript#typesprefix). If you specify it for the typescript plugin, you must set the same value for graphql-codegen-typescript-fabbrica.
496496

497497
```ts
498498
import { CodegenConfig } from '@graphql-codegen/cli';
@@ -507,7 +507,7 @@ const config: CodegenConfig = {
507507
// ...
508508
},
509509
'./__generated__/fabbrica.ts': {
510-
plugins: ['@mizdra/graphql-fabbrica'],
510+
plugins: ['@mizdra/graphql-codegen-typescript-fabbrica'],
511511
// ...
512512
},
513513
},
@@ -521,7 +521,7 @@ type: `string`, default: `''`
521521

522522
Suffixes all the generated types.
523523

524-
This option is compatible with [the one for typescript plugin](https://the-guild.dev/graphql/codegen/plugins/typescript/typescript#typessuffix). If you specify it for the typescript plugin, you must set the same value for graphql-fabbrica.
524+
This option is compatible with [the one for typescript plugin](https://the-guild.dev/graphql/codegen/plugins/typescript/typescript#typessuffix). If you specify it for the typescript plugin, you must set the same value for graphql-codegen-typescript-fabbrica.
525525

526526
## Troubleshooting
527527

@@ -579,7 +579,7 @@ const AuthorFactory = defineAuthorFactory({
579579
});
580580
```
581581

582-
### `error TS2307: Cannot find module '@mizdra/graphql-fabbrica/helper' or its corresponding type declarations.`
582+
### `error TS2307: Cannot find module '@mizdra/graphql-codegen-typescript-fabbrica/helper' or its corresponding type declarations.`
583583

584584
Incorrect values for the `moduleResolution` option in `tsconfig.json` cause compile errors.
585585

@@ -593,9 +593,9 @@ Incorrect values for the `moduleResolution` option in `tsconfig.json` cause comp
593593

594594
```console
595595
$ npx tsc --noEmit
596-
__generated__/1-basic/fabbrica.ts:7:8 - error TS2307: Cannot find module '@mizdra/graphql-fabbrica/helper' or its corresponding type declarations.
596+
__generated__/1-basic/fabbrica.ts:7:8 - error TS2307: Cannot find module '@mizdra/graphql-codegen-typescript-fabbrica/helper' or its corresponding type declarations.
597597

598-
7 } from '@mizdra/graphql-fabbrica/helper';
598+
7 } from '@mizdra/graphql-codegen-typescript-fabbrica/helper';
599599
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
600600
```
601601

@@ -613,6 +613,6 @@ To resolve this error, set the value of `moduleResolution` to `Bundler`, `Node16
613613

614614
This library is licensed under the MIT license.
615615

616-
The copyright contains two names. The first is [@mizdra](https://github.com/mizdra), author of graphql-fabbrica. The second is [@Quramy](https://github.com/Quramy), author of [prisma-fabbrica](https://github.com/Quramy/prisma-fabbrica).
616+
The copyright contains two names. The first is [@mizdra](https://github.com/mizdra), author of graphql-codegen-typescript-fabbrica. The second is [@Quramy](https://github.com/Quramy), author of [prisma-fabbrica](https://github.com/Quramy/prisma-fabbrica).
617617

618-
The name of the author of prisma-fabbrica is written because graphql-fabbrica reuses some of prisma-fabbrica's code.
618+
The name of the author of prisma-fabbrica is written because graphql-codegen-typescript-fabbrica reuses some of prisma-fabbrica's code.

e2e/codegen.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ const config: CodegenConfig = {
2929
},
3030
'./__generated__/1-basic/fabbrica.ts': {
3131
schema: './1-basic-schema.graphql',
32-
plugins: ['@mizdra/graphql-fabbrica'],
32+
plugins: ['@mizdra/graphql-codegen-typescript-fabbrica'],
3333
config: {
3434
...defaultFabbricaPluginConfig,
3535
namingConvention: {
@@ -47,7 +47,7 @@ const config: CodegenConfig = {
4747
},
4848
'./__generated__/2-typesPrefix/fabbrica.ts': {
4949
schema: './2-typesPrefix-schema.graphql',
50-
plugins: ['@mizdra/graphql-fabbrica'],
50+
plugins: ['@mizdra/graphql-codegen-typescript-fabbrica'],
5151
config: {
5252
...defaultFabbricaPluginConfig,
5353
typesPrefix: 'Prefix',
@@ -63,7 +63,7 @@ const config: CodegenConfig = {
6363
},
6464
'./__generated__/3-typesSuffix/fabbrica.ts': {
6565
schema: './3-typesSuffix-schema.graphql',
66-
plugins: ['@mizdra/graphql-fabbrica'],
66+
plugins: ['@mizdra/graphql-codegen-typescript-fabbrica'],
6767
config: {
6868
...defaultFabbricaPluginConfig,
6969
typesSuffix: 'Suffix',
@@ -78,7 +78,7 @@ const config: CodegenConfig = {
7878
},
7979
'./__generated__/4-non-optional-fields/fabbrica.ts': {
8080
schema: './4-non-optional-fields-schema.graphql',
81-
plugins: ['@mizdra/graphql-fabbrica'],
81+
plugins: ['@mizdra/graphql-codegen-typescript-fabbrica'],
8282
config: {
8383
...defaultFabbricaPluginConfig,
8484
nonOptionalDefaultFields: true,

e2e/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,6 @@
1111
"node": ">=18.0.0"
1212
},
1313
"dependencies": {
14-
"@mizdra/graphql-fabbrica": ".."
14+
"@mizdra/graphql-codegen-typescript-fabbrica": ".."
1515
}
1616
}

package-lock.json

Lines changed: 7 additions & 7 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
{
2-
"name": "@mizdra/graphql-fabbrica",
2+
"name": "@mizdra/graphql-codegen-typescript-fabbrica",
33
"description": "GraphQL Code Generator Plugin to define mock data factory.",
44
"version": "0.2.0",
55
"type": "commonjs",
66
"sideEffects": false,
7-
"repository": "https://github.com/mizdra/graphql-fabbrica.git",
7+
"repository": "https://github.com/mizdra/graphql-codegen-typescript-fabbrica.git",
88
"author": "mizdra <[email protected]>",
99
"license": "MIT",
1010
"private": false,

src/__snapshots__/code-generator.test.ts.snap

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,10 +7,10 @@ exports[`generateCode > generates code 1`] = `
77
type TypeFactoryInterface,
88
type DefaultFieldsResolver,
99
defineTypeFactoryInternal,
10-
} from '@mizdra/graphql-fabbrica/helper';
10+
} from '@mizdra/graphql-codegen-typescript-fabbrica/helper';
1111
import type { Maybe, Book, Author } from './types';
1212
13-
export * from '@mizdra/graphql-fabbrica/helper';
13+
export * from '@mizdra/graphql-codegen-typescript-fabbrica/helper';
1414
export type OptionalBook = {
1515
id: string;
1616
title: string;

src/code-generator.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,10 +10,10 @@ import {
1010
type TypeFactoryInterface,
1111
type DefaultFieldsResolver,
1212
defineTypeFactoryInternal,
13-
} from '@mizdra/graphql-fabbrica/helper';
13+
} from '@mizdra/graphql-codegen-typescript-fabbrica/helper';
1414
import type { Maybe, ${joinedTypeNames} } from '${config.typesFile}';
1515
16-
export * from '@mizdra/graphql-fabbrica/helper';
16+
export * from '@mizdra/graphql-codegen-typescript-fabbrica/helper';
1717
`.trim();
1818
return `${code}\n`;
1919
}

0 commit comments

Comments
 (0)