Skip to content

Conversation

@vividviolet
Copy link
Member

@vividviolet vividviolet commented Nov 27, 2025

WHY are these changes introduced?

Fix https://github.com/Shopify/admin-extensibility/issues/2295

Currently TypeScript types are only generated for UI extensions when the extension toml is updated. This means newly imported files would have missing types.

Screen Recording 2025-11-27 at 9.47.03 AM.mov (uploaded via Graphite)

WHAT is this pull request doing?

This PR enables automatic regeneration of TypeScript types when extensions are rebuilt during development. Specifically:

  • Adds logic to regenerate extension types after extensions are rebuilt due to file changes
  • Ensures types are regenerated when extensions are deleted to clean up type definitions
  • Avoids duplicate type generation when the app is reloaded (as types are already generated during reload)
  • Adds comprehensive tests to verify the type generation behavior in different scenarios

How to test your changes?

  1. Create am app with a ui extension and run dev.
  2. Create a new test.ts file with the following content:
export function test() {
    console.log('shopify', shopify);
}
  1. Add import {test} from './test.ts' in the extension's module and save the file
  2. Verify that when hovering over shopify in test.ts you see the types

Measuring impact

How do we know this change was effective? Please choose one:

  • n/a - this doesn't need measurement, e.g. a linting rule or a bug-fix

Checklist

  • I've considered possible cross-platform impacts (Mac, Linux, Windows)
  • I've considered possible documentation changes

Copy link
Member Author

This stack of pull requests is managed by Graphite. Learn more about stacking.

@vividviolet vividviolet marked this pull request as ready for review November 27, 2025 15:36
@vividviolet vividviolet requested review from a team as code owners November 27, 2025 15:36
@vividviolet vividviolet force-pushed the Regenerate_types_after_rebuilding_extensions_during_dev branch 2 times, most recently from 6ee6adf to 40f72cb Compare November 27, 2025 15:43
@github-actions
Copy link
Contributor

github-actions bot commented Nov 27, 2025

Coverage report

St.
Category Percentage Covered / Total
🟡 Statements
79.27% (+0.04% 🔼)
13763/17363
🟡 Branches
73.22% (+0.11% 🔼)
6721/9179
🟡 Functions
79.4% (+0.03% 🔼)
3535/4452
🟡 Lines
79.63% (+0.05% 🔼)
13005/16331
Show new covered files 🐣
St.
File Statements Branches Functions Lines
🟢
... / admin-as-app.ts
100% 100% 100% 100%
🟢
... / bulk-operation-run-mutation.ts
100% 100% 100% 100%
🟢
... / bulk-operation-run-query.ts
100% 100% 100% 100%
🟢
... / get-bulk-operation-by-id.ts
100% 100% 100% 100%
🟢
... / staged-uploads-create.ts
100% 100% 100% 100%
🔴
... / status.ts
0% 100% 0% 0%
🟢
... / bulk-operation-status.ts
96% 85.71% 100% 100%
🟢
... / download-bulk-operation-results.ts
100% 100% 100% 100%
🟢
... / execute-bulk-operation.ts
90.91% 80.56% 100% 92.31%
🟢
... / format-bulk-operation-status.ts
100% 100% 100% 100%
🟢
... / run-mutation.ts
100% 100% 100% 100%
🟢
... / run-query.ts
100% 100% 100% 100%
🟡
... / stage-file.ts
72.73% 62.5% 83.33% 71.88%
🟢
... / watch-bulk-operation.ts
100% 100% 100% 100%
Show files with reduced coverage 🔻
St.
File Statements Branches Functions Lines
🟡
... / specification.ts
68.52% (-0.57% 🔻)
75.61% (+2.44% 🔼)
76.47% (-1.31% 🔻)
68.09% (-0.66% 🔻)
🟢
... / developer-platform-client.ts
84.62% (-1.5% 🔻)
73.68% (+3.1% 🔼)
81.82% (+1.82% 🔼)
90.63% (-2.71% 🔻)
🟢
... / api.ts
87.07% (-0.43% 🔻)
76.71% (-0.1% 🔻)
100%
86.49% (-0.43% 🔻)
🟢
... / ConcurrentOutput.tsx
98.36% (-1.64% 🔻)
92% (-4% 🔻)
100%
98.33% (-1.67% 🔻)
🔴
... / ui.tsx
50.82% (-0.79% 🔻)
42.86% (-5.53% 🔻)
54.55% (+1.42% 🔼)
50% (-0.82% 🔻)
🟢
... / console.ts
81.82% (+15.15% 🔼)
75% (-25% 🔻)
100% (+33.33% 🔼)
81.82% (+15.15% 🔼)
🔴
... / dev.ts
12.77% (-0.57% 🔻)
2.78% (-0.16% 🔻)
57.14%
12.77% (-0.57% 🔻)
🟡
... / theme-environment.ts
69.57% (-1.86% 🔻)
50%
55.56% (-3.27% 🔻)
69.57% (-1.86% 🔻)

Test suite run success

3426 tests passing in 1391 suites.

Report generated by 🧪jest coverage report action from 61d1a5d

@vividviolet vividviolet force-pushed the Regenerate_types_after_rebuilding_extensions_during_dev branch from 40f72cb to 61d1a5d Compare November 27, 2025 21:31
@vividviolet vividviolet added this pull request to the merge queue Nov 27, 2025
Merged via the queue into main with commit e5b16b4 Nov 27, 2025
25 checks passed
@vividviolet vividviolet deleted the Regenerate_types_after_rebuilding_extensions_during_dev branch November 27, 2025 22:04
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

Successfully merging this pull request may close these issues.

2 participants