okai 0.0.25 → 0.0.27
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cs-gen.js +1 -1
- package/dist/index.js +1 -1
- package/dist/ts-ast.js +7 -1
- package/dist/utils.js +1 -0
- package/package.json +1 -1
package/dist/cs-gen.js
CHANGED
package/dist/index.js
CHANGED
@@ -653,7 +653,7 @@ function chooseFile(ctx, info, gist, comamnd) {
|
|
653
653
|
}
|
654
654
|
const origTsd = file.content;
|
655
655
|
const tsdAst = astForProject(toAst(origTsd), info);
|
656
|
-
const res = generateCsAstFromTsd(toTsd(tsdAst));
|
656
|
+
const res = generateCsAstFromTsd(toTsd(tsdAst), { references: [`./api.d.ts`] });
|
657
657
|
const genApis = new CSharpApiGenerator();
|
658
658
|
const csApiFiles = genApis.generate(res.csAst);
|
659
659
|
const getMigrations = new CSharpMigrationGenerator();
|
package/dist/ts-ast.js
CHANGED
@@ -34,8 +34,14 @@ export function astForProject(tsAst, info) {
|
|
34
34
|
return tsAst;
|
35
35
|
}
|
36
36
|
// Convert User TypeScript into CS AST and Updated TSD
|
37
|
-
export function generateCsAstFromTsd(userTs) {
|
37
|
+
export function generateCsAstFromTsd(userTs, opt) {
|
38
38
|
const userTsAst = toAst(userTs); // user modified tsd
|
39
|
+
if (opt?.references) {
|
40
|
+
userTsAst.references = userTsAst.references || [];
|
41
|
+
opt.references
|
42
|
+
.filter(x => !userTsAst.references.some(y => y.path === x))
|
43
|
+
.forEach(path => userTsAst.references.push({ path }));
|
44
|
+
}
|
39
45
|
const tsd = toTsd(userTsAst);
|
40
46
|
const tsdAst = toAst(tsd);
|
41
47
|
const csAst = toMetadataTypes(tsdAst);
|
package/dist/utils.js
CHANGED