Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@firebaseextensions/fs-bq-schema-views",
"version": "0.4.8",
"version": "0.4.9",
"description": "Generate strongly-typed BigQuery Views based on raw JSON",
"main": "./lib/index.js",
"repository": {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -76,4 +76,19 @@ describe("filesystem schema loading", () => {
const schemas = schema_loader_utils.readSchemas([globPattern]);
expect(Object.keys(schemas)).to.have.members(results);
});
it("should load schemas from a comma-separated list of file paths", () => {
const schemaFiles = `${schemaDir}/full-directory/schema-1.json,${schemaDir}/full-directory/schema-2.json`;
const schemas = Object.keys(schema_loader_utils.readSchemas([schemaFiles]));
expect(schemas.length).to.equal(2);
expect(schemas).to.include(
schema_loader_utils.filePathToSchemaName(
`${schemaDir}/full-directory/schema-1.json`
)
);
expect(schemas).to.include(
schema_loader_utils.filePathToSchemaName(
`${schemaDir}/full-directory/schema-2.json`
)
);
});
});
Original file line number Diff line number Diff line change
Expand Up @@ -174,6 +174,7 @@ async function parseConfig(): Promise<CliConfig> {
program.outputHelp();
process.exit(1);
}

return {
projectId: program.project,
bigQueryProjectId: program.bigQueryProject,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -63,8 +63,10 @@ function resolveFilePath(filePath: string): string {

function expandGlobs(globs: string[]): string[] {
let results = [];
for (var i = 0; i < globs.length; i++) {
const globResults = glob.sync(globs[i]);
// Split any comma-separated globs into individual paths
const expandedGlobs = globs.flatMap((g) => g.split(",").map((s) => s.trim()));
for (const globPath of expandedGlobs) {
const globResults = glob.sync(globPath);
results = results.concat(globResults);
}
return results;
Expand Down
40 changes: 26 additions & 14 deletions firestore-bigquery-export/scripts/import/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading
Loading