Skip to content

Commit

Permalink
Throw a more interpretable error when old CLIs encounter new Core ver…
Browse files Browse the repository at this point in the history
…sions (#1607)
  • Loading branch information
Ekrekr authored Dec 7, 2023
1 parent 14c5495 commit 4703af3
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 4 deletions.
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";

0 comments on commit 4703af3

Please sign in to comment.