Fixes #10711 The `ModuleVariablesTransformer` only adds module variables in use. This was missing module variables used by providers since we ran the provider too late. This moves the transformer and adds a test for this.