Skip to content
Compare
Choose a tag to compare
@shopify-github-actions-access shopify-github-actions-access released this 30 May 20:40
· 1380 commits to main since this release
a5a532e

Major Changes

  • 6970109: Drop support for Node 16.

Minor Changes

  • 36e3c62: Add support for Node 22.

  • 51f257b: Updated dependency on @shopify/graphql-codegen, which can now output regular .ts files in addition to .d.ts files, which will allow apps to import enums from the .types.ts file in their code.

    If you're using shopifyApiProject or shopifyApiTypes, you can pass in a new declarations setting, which defaults to true to maintain the previous behaviour:

    // For shopifyApiProject
    export default {
      ...
      projects: {
        default: shopifyApiProject({
          apiType: ApiType.Admin,
          apiVersion: '2023-10',
          documents: ['./app/**/*.{js,ts,jsx,tsx}'],
          outputDir: './app/types',
    +     declarations: false,
        }),
      },
    };
    
    // For shopifyApiTypes
    export default {
      ...
      projects: {
        // To produce variable / return types for Admin API operations
        schema: 'https://shopify.dev/admin-graphql-direct-proxy/2023-10',
        documents: ['./app/**/*.{js,ts,jsx,tsx}'],
        extensions: {
          codegen: {
            pluckConfig,
            generates: shopifyApiTypes({
              apiType: ApiType.Admin,
              apiVersion: '2023-10',
              documents: ['./app/**/*.{js,ts,jsx,tsx}'],
              outputDir: './app/types',
    +         declarations: false,
            }),
          },
        },
      },
    };

    If you're using the preset directly, you just need to change your output files to .ts:

    export default {
      ...
      projects: {
        default: {
          schema: 'https://shopify.dev/admin-graphql-direct-proxy',
          documents: ['./**/*.{js,ts,jsx,tsx}'],
          extensions: {
            codegen: {
              // Enables support for `#graphql` tags, as well as `/* GraphQL */`
              pluckConfig,
              generates: {
                './types/admin.schema.json': {
                  plugins: ['introspection'],
                  config: {minify: true},
                },
    -           './types/admin.types.d.ts': {
    +           './types/admin.types.ts': {
                  plugins: ['typescript'],
                },
    -           './types/admin.generated.d.ts': {
    +           './types/admin.generated.ts': {
                  preset,
                  presetConfig: {
                    apiType: ApiType.Admin,
                  },
                },
              },
            },
          },
        },
      },
    };

Patch Changes

  • faf7ad5: Use type imports in generated codegen files.
  • 4a915a0: Updated dependency on @graphql-codegen/typescript