From 84ac819f791501a838813e9f79f6ba281498cd01 Mon Sep 17 00:00:00 2001 From: Mike Donnalley Date: Fri, 1 Mar 2024 09:24:30 -0700 Subject: [PATCH] fix: asjust root --- .gitignore | 1 + bin/cjs-shims.js | 2 +- package.json | 4 ++-- src/index.ts | 5 +++-- yarn.lock | 8 ++++---- 5 files changed, 11 insertions(+), 9 deletions(-) diff --git a/.gitignore b/.gitignore index 878c8e9..3921a3a 100644 --- a/.gitignore +++ b/.gitignore @@ -10,3 +10,4 @@ node_modules oclif.lock oclif.manifest.json +/bin/run.mjs diff --git a/bin/cjs-shims.js b/bin/cjs-shims.js index b8f2373..98b1177 100644 --- a/bin/cjs-shims.js +++ b/bin/cjs-shims.js @@ -4,4 +4,4 @@ import url from 'node:url'; globalThis.require = createRequire(import.meta.url); globalThis.__filename = url.fileURLToPath(import.meta.url); -globalThis.__dirname = path.dirname(__filename); +globalThis.__dirname = path.dirname(url.fileURLToPath(import.meta.url)); diff --git a/package.json b/package.json index 3593d23..c7a5095 100644 --- a/package.json +++ b/package.json @@ -11,7 +11,7 @@ "bundle": "./bin/run.mjs" }, "dependencies": { - "@oclif/core": "3.20.1-dev.0", + "@oclif/core": "3.20.1-dev.1", "@oclif/plugin-test-esm-1": "^0.7.1" }, "devDependencies": { @@ -33,7 +33,7 @@ "typescript": "^5" }, "resolutions": { - "@oclif/core": "3.20.1-dev.0" + "@oclif/core": "3.20.1-dev.1" }, "engines": { "node": ">=18.0.0" diff --git a/src/index.ts b/src/index.ts index 4c58ead..a93ab85 100644 --- a/src/index.ts +++ b/src/index.ts @@ -1,5 +1,7 @@ import {Command, Interfaces, execute} from '@oclif/core' import * as PluginTestEsm1 from '@oclif/plugin-test-esm-1' +import {dirname} from 'node:path' +import {fileURLToPath} from 'node:url' import pjson from '../package.json' assert {type: 'json'} import ESBuild from './commands/esbuild.js' @@ -19,10 +21,9 @@ export const COMMANDS: Record = { export async function run() { await execute({ - dir: '.', loadOptions: { pjson: pjson as unknown as Interfaces.PJSON.Plugin, - root: '.' + root: dirname(fileURLToPath(import.meta.url)), }, }) } diff --git a/yarn.lock b/yarn.lock index abd7665..18b1d9b 100644 --- a/yarn.lock +++ b/yarn.lock @@ -1603,10 +1603,10 @@ node-gyp "^10.0.0" which "^4.0.0" -"@oclif/core@3.20.1-dev.0", "@oclif/core@^3", "@oclif/core@^3.10.2", "@oclif/core@^3.18.2", "@oclif/core@^3.19.2", "@oclif/core@dev": - version "3.20.1-dev.0" - resolved "https://registry.yarnpkg.com/@oclif/core/-/core-3.20.1-dev.0.tgz#3badb7be5d9a36510fff98a06afd4c8c655f86c0" - integrity sha512-00q7RlnIdQIT7W35/KtLMteJ8iEO+zGePXgvW/hnhq2Y4mS/5cv2ZwtkkLFcDS4KDCd+UDObOFwgDscywCU/1g== +"@oclif/core@3.20.1-dev.1", "@oclif/core@^3", "@oclif/core@^3.10.2", "@oclif/core@^3.18.2", "@oclif/core@^3.19.2", "@oclif/core@dev": + version "3.20.1-dev.1" + resolved "https://registry.yarnpkg.com/@oclif/core/-/core-3.20.1-dev.1.tgz#e4b1a5f84a510c5858ca8145284a1b06d5ac66d9" + integrity sha512-B7G/QnzkJeGI2ef7PJ/k9PLhP0SdkXeXPnMbNzGv84L4ZfKzetpsrxRoxJB45+zjQObYz/AV1Yhs8Bux6TEQjQ== dependencies: "@types/cli-progress" "^3.11.5" ansi-escapes "^4.3.2"