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
14 changes: 13 additions & 1 deletion packages/cli/bin/dev.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,17 @@
#!/usr/bin/env -S node --loader ts-node/esm --disable-warning=ExperimentalWarning

import { execute } from "@oclif/core";
const MIN_NODE_MAJOR = 18;
const currentVersion = process.versions.node;
const currentMajor = parseInt(currentVersion.split(".")[0], 10);

if (currentMajor < MIN_NODE_MAJOR) {
console.error(
`\nError: ecloud requires Node.js v${MIN_NODE_MAJOR} or later, but you are running v${currentVersion}.\n` +
`Please upgrade Node.js: https://nodejs.org/\n`,
);
process.exit(1);
}

const { execute } = await import("@oclif/core");

await execute({ development: true, dir: import.meta.url });
17 changes: 16 additions & 1 deletion packages/cli/bin/run.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,20 @@
#!/usr/bin/env node

import { execute } from "@oclif/core";
// Preflight: check Node.js version before loading dependencies.
// Without this, an incompatible Node version surfaces as a cryptic
// "ReferenceError: crypto is not defined" deep in the workflow.
const MIN_NODE_MAJOR = 18;
const currentVersion = process.versions.node;
const currentMajor = parseInt(currentVersion.split(".")[0], 10);

if (currentMajor < MIN_NODE_MAJOR) {
console.error(
`\nError: ecloud requires Node.js v${MIN_NODE_MAJOR} or later, but you are running v${currentVersion}.\n` +
`Please upgrade Node.js: https://nodejs.org/\n`,
);
process.exit(1);
}

const { execute } = await import("@oclif/core");

await execute({ dir: import.meta.url });
3 changes: 3 additions & 0 deletions packages/cli/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,9 @@
"name": "@layr-labs/ecloud-cli",
"version": "0.0.0-development",
"type": "module",
"engines": {
"node": ">=18.0.0"
},
"files": [
"dist",
"bin",
Expand Down
3 changes: 3 additions & 0 deletions packages/sdk/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,9 @@
"name": "@layr-labs/ecloud-sdk",
"version": "0.0.0-development",
"type": "module",
"engines": {
"node": ">=18.0.0"
},
"main": "dist/index.js",
"module": "dist/index.js",
"types": "dist/index.d.ts",
Expand Down