Skip to content

Commit 14d1aaf

Browse files
committed
rename CLI entry point to cli.js
1 parent 11d0f41 commit 14d1aaf

File tree

5 files changed

+8
-8
lines changed

5 files changed

+8
-8
lines changed

apps/oxlint/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"name": "oxlint",
33
"version": "0.1.0",
4-
"bin": "dist/index.js",
4+
"bin": "dist/cli.js",
55
"type": "module",
66
"scripts": {
77
"build": "pnpm run build-napi-release && pnpm run build-js",
File renamed without changes.

apps/oxlint/test/e2e.test.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,10 +5,10 @@ import { describe, expect, it } from 'vitest';
55
import { execa } from 'execa';
66

77
const PACKAGE_ROOT_PATH = path.dirname(import.meta.dirname);
8-
const ENTRY_POINT_PATH = path.join(PACKAGE_ROOT_PATH, 'dist/index.js');
8+
const CLI_PATH = path.join(PACKAGE_ROOT_PATH, 'dist/cli.js');
99

1010
async function runOxlintWithoutPlugins(cwd: string, args: string[] = []) {
11-
return await execa('node', [ENTRY_POINT_PATH, ...args], {
11+
return await execa('node', [CLI_PATH, ...args], {
1212
cwd: path.join(PACKAGE_ROOT_PATH, cwd),
1313
reject: false,
1414
});

apps/oxlint/tsdown.config.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import { defineConfig } from 'tsdown';
22

33
export default defineConfig({
4-
entry: ['src-js/index.ts', 'src-js/plugins/index.ts'],
4+
entry: ['src-js/cli.ts', 'src-js/plugins/index.ts'],
55
format: ['esm'],
66
platform: 'node',
77
target: 'node20',

npm/oxlint/bin/oxlint

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,13 @@
11
#!/usr/bin/env node
22

3-
// This script is run as CommonJS, so use dynamic import to load ESM module `dist/index.js`.
4-
// Even if runtime supports require(ESM), can't use `require` here, because `dist/index.js`
3+
// This script is run as CommonJS, so use dynamic import to load ESM module `dist/cli.js`.
4+
// Even if runtime supports require(ESM), can't use `require` here, because `dist/cli.js`
55
// uses top-level `await`.
66
//
7-
// `dist/index.js` uses require(ESM) internally, but only on path where `--experimental-js-plugins`
7+
// `dist/cli.js` uses require(ESM) internally, but only on path where `--experimental-js-plugins`
88
// CLI option is used. So we still support runtimes without require(ESM) for users who aren't
99
// using experimental options.
10-
import("../dist/index.js").catch(onError);
10+
import("../dist/cli.js").catch(onError);
1111

1212
function onError(err) {
1313
console.error(err);

0 commit comments

Comments
 (0)