Skip to content

Commit

Permalink
create build files for 1.1.6
Browse files Browse the repository at this point in the history
  • Loading branch information
BenoitRanque committed Oct 28, 2021
1 parent 003db92 commit 96de37e
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
1 change: 1 addition & 0 deletions dist/index.d.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
export { mergeMetadataDirectories } from './mergeMetadataDirectories';
export { readMetadata } from './readMetadata';
export { writeMetadata } from './writeMetadata';
export { HasuraMetadataV3 } from './HasuraMetadataV3';
4 changes: 2 additions & 2 deletions dist/writeMetadata.js
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,7 @@ function writeMetadata(outputDir, metadata) {
writeFile([outputDir, 'inherited_roles.yaml'], metadata.inherited_roles);
}
fs_1.default.mkdirSync(path_1.default.join(outputDir, 'databases'));
writeFile([outputDir, 'databases', 'databases.yaml'], metadata.sources.map(function (source) { return (__assign(__assign({}, source), { tables: "!include " + source.name + "/tables/tables.yaml" })); }));
writeFile([outputDir, 'databases', 'databases.yaml'], metadata.sources.map(function (source) { return (__assign(__assign({}, source), { tables: "!include " + source.name + "/tables/tables.yaml", functions: source.functions && source.functions.length ? "!include " + source.name + "/functions/functions.yaml" : undefined })); }));
metadata.sources.forEach(function (source) {
fs_1.default.mkdirSync(path_1.default.join(outputDir, 'databases', source.name));
fs_1.default.mkdirSync(path_1.default.join(outputDir, 'databases', source.name, 'tables'));
Expand All @@ -124,7 +124,7 @@ function writeMetadata(outputDir, metadata) {
table.table.schema + "_" + table.table.name + ".yaml",
], table);
});
if (source.functions) {
if (source.functions && source.functions.length) {
fs_1.default.mkdirSync(path_1.default.join(outputDir, 'databases', source.name, 'functions'));
writeFile([outputDir, 'databases', source.name, 'functions', 'functions.yaml'], source.functions.map(function (fn) {
return typeof fn.function === 'string'
Expand Down

0 comments on commit 96de37e

Please sign in to comment.