mirror of
https://github.com/grafana/grafana.git
synced 2026-08-19 01:34:54 -05:00
Schema: Re-introduce exports for the schema package (#116683)
* wip * added fallback exports.# * renamed files to new pattern to follow exports. * added fallback exports. * added more exports. * wip * wip * wip. * Updating rollup to output proper paths. * wip * wip * reverted new export APIs, will be done in follow up PRs. * fixed rollup config. * replaced imports with new proper exports. * fixed tests. * renamed missing file. * fixed error. * Needed to make the file names shorter due to publint limitations. * Fixed issue with generated index fiels. * fixed preferences export as well. * reverted import. * fixed conflicts. * fixed issue with type imports. * fixed so we are backwards compatible with the node moduleresolution.
This commit is contained in:
@@ -38,10 +38,5 @@ func (j TSTypesJenny) Generate(sfg SchemaForGen) (*codejen.File, error) {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
outputName := sfg.Name
|
||||
if sfg.OutputName != "" {
|
||||
outputName = sfg.OutputName
|
||||
}
|
||||
|
||||
return codejen.NewFile(outputName+"_types.gen.ts", []byte(f.String()), j), nil
|
||||
return codejen.NewFile("types.gen.ts", []byte(f.String()), j), nil
|
||||
}
|
||||
|
||||
@@ -152,7 +152,7 @@ func (gen *genTSVeneerIndex) extractTSIndexVeneerElements(def SchemaForGen, tf *
|
||||
CommentList: []ast.Comment{ts.CommentFromString(fmt.Sprintf("Raw generated types from %s kind.", def.Name), 80, false)},
|
||||
TypeOnly: true,
|
||||
Exports: raw,
|
||||
From: ast.Str{Value: fmt.Sprintf("./raw/%s/%s/%s_types.gen", machineName, vpath, machineName)},
|
||||
From: ast.Str{Value: fmt.Sprintf("./raw/%s/%s/types.gen", machineName, vpath)},
|
||||
})
|
||||
}
|
||||
if len(rawD) > 0 {
|
||||
@@ -160,7 +160,7 @@ func (gen *genTSVeneerIndex) extractTSIndexVeneerElements(def SchemaForGen, tf *
|
||||
CommentList: []ast.Comment{ts.CommentFromString(fmt.Sprintf("Raw generated enums and default consts from %s kind.", machineName), 80, false)},
|
||||
TypeOnly: false,
|
||||
Exports: rawD,
|
||||
From: ast.Str{Value: fmt.Sprintf("./raw/%s/%s/%s_types.gen", machineName, vpath, machineName)},
|
||||
From: ast.Str{Value: fmt.Sprintf("./raw/%s/%s/types.gen", machineName, vpath)},
|
||||
})
|
||||
}
|
||||
vtfile := fmt.Sprintf("./veneer/%s.types", machineName)
|
||||
|
||||
Reference in New Issue
Block a user