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:
Marcus Andersson
2026-02-11 22:27:26 +01:00
committed by GitHub
parent 2415f4f5bb
commit c3cce293e8
167 changed files with 423 additions and 180 deletions
+1 -6
View File
@@ -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
}
+2 -2
View File
@@ -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)