Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Throw a more interpretable error when a <v3 CLI encounters a >=v3 Core version #1607

Merged
merged 1 commit into from
Dec 7, 2023
Merged
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
14 changes: 11 additions & 3 deletions core/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,15 @@ const session = globalSession();

const supportedFeatures = [dataform.SupportedFeatures.ARRAY_BUFFER_IPC];

// These exports constitute the public API of @dataform/core.
// Older versions of the CLI are not compatible with Core version ^3.0.0, and throw when this method
// is not available. Instead this more interpretable error message is thrown.
// Note: for future backwards compatability breaking changes, the exported "version" variable should
// be used instead.
function indexFileGenerator() {
throw new Error("@dataform/cli ^3.0.0 required.");
}

// These exports constitute the public API of @dataform/core.
// They must also be listed in packages/@dataform/core/index.ts.
// Changes to these will break @dataform/api, so take care!
export { compiler, main, session, supportedFeatures, version };
// Changes to these will break @dataform/cli, so take care!
export { compiler, indexFileGenerator, main, session, supportedFeatures, version };
2 changes: 1 addition & 1 deletion packages/@dataform/core/index.ts
Original file line number Diff line number Diff line change
@@ -1 +1 @@
export { compiler, main, session, supportedFeatures, version } from "df/core";
export { compiler, indexFileGenerator, main, session, supportedFeatures, version } from "df/core";
Loading