Skip to content

Commit d3162ae

Browse files
author
Daniel Del Core
committed
fixes node-entrypoints
1 parent be0ed7b commit d3162ae

File tree

5 files changed

+14
-11
lines changed

5 files changed

+14
-11
lines changed
Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,2 @@
11
#!/usr/bin/env node
2-
const path = require('path');
3-
4-
require(path.join('..', 'dist', 'index.js'));
2+
export * from '../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-
export * from '@hypermod/cli';
1+
import '@hypermod/cli';

packages/cli-alias/tsconfig.json

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,7 @@
33
"compilerOptions": {
44
"rootDir": "src",
55
"outDir": "dist",
6-
"baseUrl": ".",
7-
"module": "NodeNext",
8-
"moduleResolution": "NodeNext"
6+
"baseUrl": "."
97
},
108
"include": ["src"],
119
"references": [

packages/cli/src/index.ts

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,10 +9,12 @@ 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-
1412
const packageJson = readFileSync(
15-
path.join(__dirname, '..', 'package.json'),
13+
path.join(
14+
path.dirname(new URL(import.meta.url).pathname),
15+
'..',
16+
'package.json',
17+
),
1618
'utf-8',
1719
);
1820

packages/cli/src/main.ts

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

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

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

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

0 commit comments

Comments
 (0)