Skip to content

Commit d5e78c4

Browse files
author
Daniel Del Core
committed
Revert "fixes node-entrypoints"
This reverts commit d3162ae.
1 parent ef96f53 commit d5e78c4

File tree

5 files changed

+11
-14
lines changed

5 files changed

+11
-14
lines changed
Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,4 @@
11
#!/usr/bin/env node
2-
export * from '../dist/index.js';
2+
const path = require('path');
3+
4+
require(path.join('..', 'dist', 'index.js'));

packages/cli-alias/src/index.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
import '@hypermod/cli';
1+
export * from '@hypermod/cli';

packages/cli-alias/tsconfig.json

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,9 @@
33
"compilerOptions": {
44
"rootDir": "src",
55
"outDir": "dist",
6-
"baseUrl": "."
6+
"baseUrl": ".",
7+
"module": "NodeNext",
8+
"moduleResolution": "NodeNext"
79
},
810
"include": ["src"],
911
"references": [

packages/cli/src/index.ts

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -9,12 +9,10 @@ import init from './init.js';
99
import validate from './validate.js';
1010
import { InvalidUserInputError, InvalidConfigError } from './errors.js';
1111

12+
const __dirname = path.dirname(new URL(import.meta.url).pathname);
13+
1214
const packageJson = readFileSync(
13-
path.join(
14-
path.dirname(new URL(import.meta.url).pathname),
15-
'..',
16-
'package.json',
17-
),
15+
path.join(__dirname, '..', 'package.json'),
1816
'utf-8',
1917
);
2018

packages/cli/src/main.ts

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,6 @@ const ExperimentalModuleLoader = () => {
3737
};
3838

3939
const install = async (packageName: string) => {
40-
const __dirname = path.dirname(new URL(import.meta.url).pathname);
4140
await installPackage(packageName, {
4241
cwd: __dirname,
4342
packageManager: 'npm',
@@ -80,11 +79,7 @@ export default async function main(
8079
}
8180

8281
const pluginManagerConfig: Partial<PluginManagerOptions> = {
83-
pluginsPath: path.join(
84-
path.dirname(new URL(import.meta.url).pathname),
85-
'..',
86-
'node_modules',
87-
),
82+
pluginsPath: path.join(__dirname, '..', 'node_modules'),
8883
};
8984

9085
// If a registry is provided in the CLI flags, use it for the pluginManagers configuration.

0 commit comments

Comments
 (0)