diff --git a/package-lock.json b/package-lock.json index e8d7e4c..c04a69f 100644 --- a/package-lock.json +++ b/package-lock.json @@ -402,6 +402,7 @@ "version": "8.15.0", "dev": true, "license": "MIT", + "peer": true, "bin": { "acorn": "bin/acorn" }, @@ -1454,6 +1455,7 @@ "version": "8.57.1", "dev": true, "license": "MIT", + "peer": true, "dependencies": { "@eslint-community/eslint-utils": "^4.2.0", "@eslint-community/regexpp": "^4.6.1", @@ -1534,6 +1536,7 @@ } ], "license": "MIT", + "peer": true, "peerDependencies": { "eslint": "^8.0.1", "eslint-plugin-import": "^2.25.2", @@ -1650,6 +1653,7 @@ "version": "2.32.0", "dev": true, "license": "MIT", + "peer": true, "dependencies": { "@rtsao/scc": "^1.1.0", "array-includes": "^3.1.9", @@ -1709,6 +1713,7 @@ "version": "15.7.0", "dev": true, "license": "MIT", + "peer": true, "dependencies": { "builtins": "^5.0.1", "eslint-plugin-es": "^4.1.0", @@ -1733,6 +1738,7 @@ "version": "6.6.0", "dev": true, "license": "ISC", + "peer": true, "engines": { "node": "^12.22.0 || ^14.17.0 || >=16.0.0" }, @@ -1747,6 +1753,7 @@ "version": "7.37.5", "dev": true, "license": "MIT", + "peer": true, "dependencies": { "array-includes": "^3.1.8", "array.prototype.findlast": "^1.2.5", @@ -3918,6 +3925,7 @@ "version": "4.46.2", "dev": true, "license": "MIT", + "peer": true, "dependencies": { "@types/estree": "1.0.8" }, @@ -4870,7 +4878,7 @@ "autocannon-compare": "^0.4.0" }, "bin": { - "expf": "bin/expf.sh" + "expf": "bin/expf.mjs" }, "devDependencies": { "semistandard": "^17.0.0" diff --git a/packages/cli/bin/expf.mjs b/packages/cli/bin/expf.mjs old mode 100644 new mode 100755 index 0f2cd71..45bc1d8 --- a/packages/cli/bin/expf.mjs +++ b/packages/cli/bin/expf.mjs @@ -1,3 +1,4 @@ +#!/usr/bin/env node import { parseArgs } from 'node:util'; import { argv } from 'node:process'; diff --git a/packages/cli/bin/expf.sh b/packages/cli/bin/expf.sh deleted file mode 100755 index 47f2127..0000000 --- a/packages/cli/bin/expf.sh +++ /dev/null @@ -1,10 +0,0 @@ -#! /bin/bash -SOURCE=${BASH_SOURCE[0]:-$0} -while [ -L "$SOURCE" ]; do # resolve $SOURCE until the file is no longer a symlink - DIR=$( cd -P "$( dirname "$SOURCE" )" >/dev/null 2>&1 && pwd ) - SOURCE=$(readlink "$SOURCE") - [[ $SOURCE != /* ]] && SOURCE=$DIR/$SOURCE # if $SOURCE was a relative symlink, we need to resolve it relative to the path where the symlink file was located -done -DIR=$( cd -P "$( dirname "$SOURCE" )" >/dev/null 2>&1 && pwd ) - -node "${DIR}/expf.mjs" "$@" diff --git a/packages/cli/load.mjs b/packages/cli/load.mjs index 4d07126..51ae913 100644 --- a/packages/cli/load.mjs +++ b/packages/cli/load.mjs @@ -48,7 +48,8 @@ export default function main (_opts = {}) { let conf = {}; try { - conf = (await import(join(cwd, _opts.config || 'expf.config.json'), { + const configPath = join(cwd, _opts.config || 'expf.config.json'); + conf = (await import(configPath, { with: { type: 'json' } diff --git a/packages/cli/package.json b/packages/cli/package.json index c3b3b42..0e64971 100644 --- a/packages/cli/package.json +++ b/packages/cli/package.json @@ -8,7 +8,7 @@ "lint:fix": "semistandard --fix" }, "bin": { - "expf": "./bin/expf.sh" + "expf": "./bin/expf.mjs" }, "keywords": [], "author": "", diff --git a/packages/runner-local/setup.mjs b/packages/runner-local/setup.mjs index b2da817..9fffad6 100644 --- a/packages/runner-local/setup.mjs +++ b/packages/runner-local/setup.mjs @@ -7,6 +7,7 @@ import { constants as fsConstants } from 'node:fs/promises'; import { dirname, join } from 'node:path'; +import { pathToFileURL } from 'node:url'; import { promisify } from 'node:util'; import { execFile } from 'node:child_process'; @@ -50,7 +51,8 @@ export async function setup (cwd, opts = {}) { const { pkgPath, pkgBakPath } = await restore(cwd); // Read in package.json contets - const pkg = (await import(pkgPath, { + const pkgUrl = pathToFileURL(pkgPath).href; + const pkg = (await import(pkgUrl, { with: { type: 'json' }