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

Code Generator - new website #7981

Merged
merged 9 commits into from
Jul 12, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
17 changes: 5 additions & 12 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,21 +1,14 @@
.idea
.idea/
.npmrc
.yarnclean
.DS_Store
coverage
npm-debug.log
lerna-debug.log
yarn-error.log
node_modules
website/build
website/functions
website/i18n
website/static/live-demo
*.log
node_modules/
temp
test-results/
junit.xml
dist
.bob
dist/
.bob/
out.txt
.cache
tsconfig.tsbuildinfo
Expand Down
12 changes: 9 additions & 3 deletions .prettierignore
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,13 @@ CHANGELOG.md
.husky/_/
.changeset/*.md

# temporarly ignore follow files because prettier-ignore comments don't work in mdx2
# temporarily ignore follow files because prettier-ignore comments don't work in mdx2
# see https://github.com/prettier/prettier/pull/12208
website/docs/advanced/how-does-it-work.mdx
website/docs/getting-started/development-workflow.mdx
website/src/pages/docs/advanced/generated-files-colocation.mdx
saihaj marked this conversation as resolved.
Show resolved Hide resolved
website/src/pages/docs/advanced/how-does-it-work.mdx
website/src/pages/docs/config-reference/schema-field.mdx
website/src/pages/docs/getting-started/index.mdx
website/src/pages/docs/guides/graphql-server-apollo-yoga.mdx
website/src/pages/docs/guides/react.mdx
website/src/pages/plugins/index.mdx
website/src/pages/plugins/presets/near-operation-file-preset.mdx
5 changes: 1 addition & 4 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -100,10 +100,7 @@
"packages/**/src/**/*.{ts,tsx}": [
"eslint --fix"
],
"**/*.{ts,tsx,graphql,yml}": [
"prettier --write"
],
"**/*.json": [
"**/*.{js,jsx,cjs,mjs,ts,tsx,graphql,gql,yml,yaml,json,md}": [
"prettier --write"
],
"yarn.lock": [
Expand Down
6 changes: 3 additions & 3 deletions packages/plugins/flow/operations/src/config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ export interface FlowDocumentsPluginConfig extends RawDocumentsConfig {
* @default true
*
* @exampleMarkdown
* ```yaml
* ```yaml {6}
* generates:
* path/to/file.ts:
* plugins:
Expand All @@ -28,7 +28,7 @@ export interface FlowDocumentsPluginConfig extends RawDocumentsConfig {
* @default false
*
* @exampleMarkdown
* ```yaml
* ```yaml {6}
* generates:
* path/to/file.ts:
* plugins:
Expand All @@ -43,7 +43,7 @@ export interface FlowDocumentsPluginConfig extends RawDocumentsConfig {
* @default false
*
* @exampleMarkdown
* ```yaml
* ```yaml {7}
* generates:
* path/to/file.ts:
* plugins:
Expand Down
8 changes: 4 additions & 4 deletions packages/plugins/other/fragment-matcher/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ interface PossibleTypesResultData {
*
* If you are using `apollo-client` and your schema contains `interface` or `union` declaration, it's recommended to use Apollo's Fragment Matcher and the result generated by the plugin.
*
* You can read more about it in `apollo-client` documentation: https://www.apollographql.com/docs/react/data/fragments/#fragments-on-unions-and-interfaces.
* You can read more about it in [`apollo-client` documentation](https://apollographql.com/docs/react/data/fragments/#fragments-on-unions-and-interfaces).
*
* Fragment Matcher plugin accepts a TypeScript / JavaScript or a JSON file as an output _(`.ts, .tsx, .js, .jsx, .json`)_.
*
Expand All @@ -42,7 +42,7 @@ export interface FragmentMatcherConfig {
* @default es2015
*
* @exampleMarkdown
* ```yaml
* ```yaml {6}
* generates:
* path/to/file.json:
* plugins:
Expand All @@ -57,7 +57,7 @@ export interface FragmentMatcherConfig {
* @default 3
*
* @exampleMarkdown
* ```yaml
* ```yaml {6}
* generates:
* path/to/file.ts:
* plugins:
Expand All @@ -72,7 +72,7 @@ export interface FragmentMatcherConfig {
* @default false
*
* @exampleMarkdown
* ```yaml
* ```yaml {6}
* generates:
* path/to/file.ts:
* plugins:
Expand Down
2 changes: 1 addition & 1 deletion packages/plugins/other/introspection/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ export interface IntrospectionPluginConfig {
* @default false
*
* @exampleMarkdown
* ```yaml
* ```yaml {6}
* generates:
* introspection.json:
* plugins:
Expand Down
6 changes: 3 additions & 3 deletions packages/plugins/other/schema-ast/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ export interface SchemaASTConfig {
* @default false
*
* @exampleMarkdown
* ```yaml
* ```yaml {8}
* schema:
* - './src/schema.graphql'
* generates:
Expand All @@ -43,7 +43,7 @@ export interface SchemaASTConfig {
* @default false
*
* @exampleMarkdown
* ```yaml
* ```yaml {8}
* schema:
* - './src/schema.graphql'
* generates:
Expand All @@ -60,7 +60,7 @@ export interface SchemaASTConfig {
* @default false
*
* @exampleMarkdown
* ```yaml
* ```yaml {7}
* schema: http://localhost:3000/graphql
* generates:
* schema.graphql:
Expand Down
4 changes: 2 additions & 2 deletions packages/plugins/other/time/src/config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ export interface TimePluginConfig {
* @default YYYY-MM-DDTHH:mm:ssZ
*
* @exampleMarkdown
* ```yaml
* ```yaml {4-5}
* generates:
* path/to/file.ts:
* plugins:
Expand All @@ -18,7 +18,7 @@ export interface TimePluginConfig {
* @default 'Generated on'
*
* @exampleMarkdown
* ```yaml
* ```yaml {4-5}
* generates:
* path/to/file.ts:
* plugins:
Expand Down
2 changes: 1 addition & 1 deletion packages/plugins/other/urql-introspection/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ export interface UrqlIntrospectionConfig {
* @default es2015
*
* @exampleMarkdown
* ```yaml
* ```yaml {6}
* generates:
* path/to/file.json:
* plugins:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ export interface RawResolversConfig extends RawConfig {
* @description Adds `_` to generated `Args` types in order to avoid duplicate identifiers.
*
* @exampleMarkdown
* ```yaml
* ```yaml {2}
* config:
* addUnderscoreToArgsType: true
* ```
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -179,7 +179,7 @@ export interface RawTypesConfig extends RawConfig {
* @exampleMarkdown
* ## Override all definition types
*
* ```yml
* ```yaml
* generates:
* path/to/file.ts:
* plugins:
Expand Down
12 changes: 6 additions & 6 deletions packages/plugins/other/visitor-plugin-common/src/base-visitor.ts
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ export interface RawConfig {
* @default false
*
* @exampleMarkdown
* ```yaml
* ```yaml {2}
* config:
* strictScalars: true
* ```
Expand All @@ -57,7 +57,7 @@ export interface RawConfig {
* @default any
*
* @exampleMarkdown
* ```yaml
* ```yaml {2}
* config:
* defaultScalarType: unknown
* ```
Expand Down Expand Up @@ -123,7 +123,7 @@ export interface RawConfig {
* @description Prefixes all the generated types.
*
* @exampleMarkdown
* ```yaml
* ```yaml {2}
* config:
* typesPrefix: I
* ```
Expand All @@ -134,7 +134,7 @@ export interface RawConfig {
* @description Suffixes all the generated types.
*
* @exampleMarkdown
* ```yaml
* ```yaml {2}
* config:
* typesSuffix: I
* ```
Expand All @@ -157,7 +157,7 @@ export interface RawConfig {
* in the selection set, and makes it non-optional
*
* @exampleMarkdown
* ```yaml
* ```yaml {2}
* config:
* nonOptionalTypename: true
* ```
Expand All @@ -171,7 +171,7 @@ export interface RawConfig {
* compatibility with TypeScript's "importsNotUsedAsValues": "error" option
*
* @example
* ```yaml
* ```yaml {2}
* config:
* useTypeImports: true
* ```
Expand Down
2 changes: 1 addition & 1 deletion packages/plugins/typescript/typescript/src/config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -138,7 +138,7 @@ export interface TypeScriptPluginConfig extends RawTypesConfig {
* @default false
*
* @exampleMarkdown Override all definition types
* ```yml
* ```yaml
* generates:
* path/to/file.ts:
* plugins:
Expand Down
4 changes: 2 additions & 2 deletions packages/presets/gql-tag-operations/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ export type GqlTagConfig = {
* E.g. `graphql-tag` or `@urql/core`.
*
* @exampleMarkdown
* ```yaml
* ```yaml {5}
* generates:
* gql/:
* preset: gql-tag-operations-preset
Expand All @@ -50,7 +50,7 @@ export type GqlTagConfig = {
*
* When using the `augmentedModuleName` option, the unmask function will by default NOT be imported from the same module. It will still be generated to a `index.ts` file. You can, however, specify to resolve the unmasking function from an an augmented module by using the `augmentedModuleName` object sub-config.
* @exampleMarkdown
* ```yaml
* ```yaml {6-7}
* generates:
* gql/:
* preset: gql-tag-operations-preset
Expand Down
4 changes: 2 additions & 2 deletions packages/presets/import-types/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ export type ImportTypesConfig = {
* The key of the output is used a the base path for this file.
*
* @exampleMarkdown
* ```yaml
* ```yaml {5}
* generates:
* path/to/file.ts:
* preset: import-types
Expand All @@ -24,7 +24,7 @@ export type ImportTypesConfig = {
* @default Types
*
* @exampleMarkdown
* ```yaml
* ```yaml {6}
* generates:
* src/:
* preset: import-types
Expand Down
12 changes: 6 additions & 6 deletions packages/presets/near-operation-file/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ export type NearOperationFileConfig = {
* If you wish to use an NPM package or a local workspace package, make sure to prefix the package name with `~`.
*
* @exampleMarkdown
* ```yaml
* ```yaml {5}
* generates:
* src/:
* preset: near-operation-file
Expand All @@ -45,7 +45,7 @@ export type NearOperationFileConfig = {
* If you wish to use an NPM package or a local workspace package, make sure to prefix the package name with `~`.
*
* @exampleMarkdown
* ```yaml
* ```yaml {6}
* generates:
* src/:
* preset: near-operation-file
Expand All @@ -62,7 +62,7 @@ export type NearOperationFileConfig = {
* @default .generated.ts
*
* @exampleMarkdown
* ```yaml
* ```yaml {6}
* generates:
* src/:
* preset: near-operation-file
Expand All @@ -80,7 +80,7 @@ export type NearOperationFileConfig = {
* @default process.cwd()
*
* @exampleMarkdown
* ```yaml
* ```yaml {6}
* generates:
* src/:
* preset: near-operation-file
Expand All @@ -97,7 +97,7 @@ export type NearOperationFileConfig = {
* @default ''
*
* @exampleMarkdown
* ```yaml
* ```yaml {6}
* generates:
* src/:
* preset: near-operation-file
Expand All @@ -114,7 +114,7 @@ export type NearOperationFileConfig = {
* @default Types
*
* @exampleMarkdown
* ```yaml
* ```yaml {6}
* generates:
* src/:
* preset: near-operation-file
Expand Down
Loading