Skip to content
Draft
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
6 changes: 3 additions & 3 deletions .gitmodules
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
[submodule "packages/mql-typescript/mongo-php-library"]
path = packages/mql-typescript/mongo-php-library
url = https://github.com/mongodb-js/mongo-php-library
[submodule "packages/mql-typescript/mql-specifications"]
path = packages/mql-typescript/mql-specifications
url = https://github.com/mongodb/mql-specifications.git
1 change: 0 additions & 1 deletion packages/mql-typescript/mongo-php-library
Submodule mongo-php-library deleted from 4a2867
1 change: 1 addition & 0 deletions packages/mql-typescript/mql-specifications
Submodule mql-specifications added at 0b6743
1,897 changes: 1,126 additions & 771 deletions packages/mql-typescript/out/schema.d.ts

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions packages/mql-typescript/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@
"check-ci": "npm run check",
"test": "tsc --noEmit tests/**/*.ts",
"reformat": "npm run prettier -- --write .",
"extract-metaschema": "json-refs resolve mongo-php-library/generator/config/schema.json | json-schema-to-zod -n Operator -o src/metaschema.ts && npm run prettier -- --write src/metaschema.ts",
"extract-metaschema": "json-refs resolve mql-specifications/schema.json | json-schema-to-zod -n Operator -o src/metaschema.ts && npm run prettier -- --write src/metaschema.ts",
"pregenerate-schema": "npm run extract-metaschema",
"generate-schema": "ts-node src/cli.ts schema",
"postgenerate-schema": "npm run prettier -- --write out/*",
Expand All @@ -66,7 +66,7 @@
"postgenerate-tests": "npm run prettier -- --write tests/**/*.ts",
"pregenerate-driver-schema": "npm run extract-metaschema",
"generate-driver-schema": "ts-node src/cli.ts driver-schema",
"postgenerate-driver-schema": "yamlfix -c mongo-php-library/generator/config/.yamlfix.toml mongo-php-library/generator/config",
"postgenerate-driver-schema": "yamlfix -c mql-specifications/.yamlfix.toml mql-specifications/definitions",
"format-generated-files": "npm run postgenerate-schema && npm run postgenerate-tests && npm run postgenerate-driver-schema"
},
"devDependencies": {
Expand Down
2 changes: 1 addition & 1 deletion packages/mql-typescript/src/cli.ts
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,6 @@ async function main() {
}

main().catch((err) => {
console.error(err);
console.dir(err, { depth: Infinity });
process.exit(1);
});
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,15 @@ export class DriverSchemaGenerator extends GeneratorBase {
console.error(`No docs reference found for ${test.name}`);
return '// TODO: No docs reference found';
}
if (!test.pipeline) {
console.error(`No pipeline found for ${test.name} at ${test.link}`);
return '// TODO: No pipeline found';
if (
(!('pipeline' in test) || !test.pipeline) &&
(!('update' in test) || !test.update) &&
(!('filter' in test) || !test.filter)
) {
console.error(
`No pipeline, update, or filter found for ${test.name} at ${test.link}`,
);
return '// TODO: No pipeline, update, or filter found';
}

const docsCrawler = new DocsCrawler(test.link);
Expand Down
5 changes: 2 additions & 3 deletions packages/mql-typescript/src/generator.ts
Original file line number Diff line number Diff line change
Expand Up @@ -196,9 +196,8 @@ export abstract class GeneratorBase {
protected configDir = path.join(
__dirname,
'..',
'mongo-php-library',
'generator',
'config',
'mql-specifications',
'definitions',
);

private async *listCategories(
Expand Down
Loading
Loading