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

TypeScript config validation #74

Open
n1ru4l opened this issue Jun 22, 2022 · 4 comments
Open

TypeScript config validation #74

n1ru4l opened this issue Jun 22, 2022 · 4 comments

Comments

@n1ru4l
Copy link
Collaborator

n1ru4l commented Jun 22, 2022

Bob should probably check the tsconfig.json file within the projects and then yell at you in case you are doing something you probably should not do.

In a lot of projects we use the tsconfig.json and tsconfig.build.json pattern, tsconfig.build.json could potentially be completely life within bob.

@n1ru4l
Copy link
Collaborator Author

n1ru4l commented Jun 23, 2022

I actually think we can completely drop the tsconfig.build.json. bob can run tsc with the existing tsconfig and overwrite specific parameters.

@n1ru4l
Copy link
Collaborator Author

n1ru4l commented Jun 23, 2022

In addition, bob should bootstrap the TypeScript config and generate the paths config based on the packages exports map within the mono repository.

"paths": {
      "@graphql-codegen/cli": ["packages/graphql-codegen-cli/src/index.ts"],
      "@graphql-codegen/core": ["packages/graphql-codegen-core/src/index.ts"],
      "@graphql-codegen/flow": ["packages/plugins/flow/flow/src/index.ts"],
      "@graphql-codegen/flow-operations": ["packages/plugins/flow/operations/src/index.ts"],
      "@graphql-codegen/flow-resolvers": ["packages/plugins/flow/resolvers/src/index.ts"],
      "@graphql-codegen/java-apollo-android": ["packages/plugins/java/apollo-android/src/index.ts"],
      "@graphql-codegen/java-common": ["packages/plugins/java/common/src/index.ts"],
      "@graphql-codegen/java": ["packages/plugins/java/java/src/index.ts"],
      "@graphql-codegen/kotlin": ["packages/plugins/java/kotlin/src/index.ts"],
      "@graphql-codegen/java-resolvers": ["packages/plugins/java/resolvers/src/index.ts"],
      "@graphql-codegen/add": ["packages/plugins/other/add/src/index.ts"],
      "@graphql-codegen/fragment-matcher": ["packages/plugins/other/fragment-matcher/src/index.ts"],
      "@graphql-codegen/urql-introspection": ["packages/plugins/other/urql-introspection/src/index.ts"],
      "@graphql-codegen/introspection": ["packages/plugins/other/introspection/src/index.ts"],
      "@graphql-codegen/schema-ast": ["packages/plugins/other/schema-ast/src/index.ts"],
      "@graphql-codegen/time": ["packages/plugins/other/time/src/index.ts"],
      "@graphql-codegen/visitor-plugin-common": ["packages/plugins/other/visitor-plugin-common/src/index.ts"],
      "@graphql-codegen/typescript-apollo-angular": ["packages/plugins/typescript/apollo-angular/src/index.ts"],
      "@graphql-codegen/typescript-document-nodes": ["packages/plugins/typescript/document-nodes/src/index.ts"],
      "@graphql-codegen/typescript-enum-array": ["packages/plugins/typescript/enum-array/src/index.ts"],
      "@graphql-codegen/typescript-generic-sdk": ["packages/plugins/typescript/generic-sdk/src/index.ts"],
      "@graphql-codegen/typescript-graphql-files-modules": [
        "packages/plugins/typescript/graphql-files-modules/src/index.ts"
      ],
      "@graphql-codegen/typescript-graphql-request": ["packages/plugins/typescript/graphql-request/src/index.ts"],
      "@graphql-codegen/typescript-mongodb": ["packages/plugins/typescript/mongodb/src/index.ts"],
      "@graphql-codegen/typescript-oclif": ["packages/plugins/typescript/oclif/src/index.ts"],
      "@graphql-codegen/typescript-operations": ["packages/plugins/typescript/operations/src/index.ts"],
      "@graphql-codegen/typescript-react-offix": ["packages/plugins/typescript/react-apollo-offix/src/index.ts"],
      "@graphql-codegen/typescript-react-apollo": ["packages/plugins/typescript/react-apollo/src/index.ts"],
      "@graphql-codegen/typescript-resolvers": ["packages/plugins/typescript/resolvers/src/index.ts"],
      "@graphql-codegen/typescript-stencil-apollo": ["packages/plugins/typescript/stencil-apollo/src/index.ts"],
      "@graphql-codegen/typescript-type-graphql": ["packages/plugins/typescript/type-graphql/src/index.ts"],
      "@graphql-codegen/typed-document-node": ["packages/plugins/typescript/typed-document-node/src/index.ts"],
      "@graphql-codegen/gql-tag-operations": ["packages/plugins/typescript/gql-tag-operations/src/index.ts"],
      "@graphql-codegen/typescript": ["packages/plugins/typescript/typescript/src/index.ts"],
      "@graphql-codegen/typescript-urql": ["packages/plugins/typescript/urql/src/index.ts"],
      "@graphql-codegen/typescript-vue-urql": ["packages/plugins/typescript/urql/src/index.ts"],
      "@graphql-codegen/typescript-vue-apollo": ["packages/plugins/typescript/vue-apollo/src/index.ts"],
      "@graphql-codegen/typescript-vue-apollo-smart-ops": [
        "packages/plugins/typescript/vue-apollo-smart-ops/src/index.ts"
      ],
      "@graphql-codegen/c-sharp": ["packages/plugins/c-sharp/c-sharp/src/index.ts"],
      "@graphql-codegen/c-sharp-apollo": ["packages/plugins/c-sharp/apollo-dot-net/src/index.ts"],
      "@graphql-codegen/import-types-preset": ["packages/presets/import-types/src/index.ts"],
      "@graphql-codegen/near-operation-file-preset": ["packages/presets/near-operation-file/src/index.ts"],
      "@graphql-codegen/gql-tag-operations-preset": ["packages/presets/gql-tag-operations-preset/src/index.ts"],
      "@graphql-codegen/testing": ["packages/utils/graphql-codegen-testing/src/index.ts"],
      "@graphql-codegen/plugin-helpers": ["packages/utils/plugins-helpers/src/index.ts"],
      "@graphql-codegen/typescript-apollo-client-helpers": [
        "packages/plugins/typescript/apollo-client-helpers/src/index.ts"
      ],
      "@graphql-codegen/typescript-react-query": ["packages/plugins/typescript/react-query/src/index.ts"],
      "@graphql-codegen/typescript-msw": ["packages/plugins/typescript/msw/src/index.ts"],
      "@graphql-cli/codegen": ["packages/graphql-cli-codegen-plugin/src/index.ts"]
    }

@ardatan
Copy link
Collaborator

ardatan commented Jun 23, 2022

@n1ru4l I agree. Bob can generate paths map by looking at the package.json files in the "workspace".

@Urigo
Copy link

Urigo commented Jun 25, 2022

I wonder if this issue is the best place for it but should we also use tsconfig bases centralized recommendations repo in our configs and have Bob validate that we do?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants