Skip to content

Commit 9c52c20

Browse files
committed
build(napi/oxlint): flatten dist directory structure
1 parent 21cbfbe commit 9c52c20

File tree

5 files changed

+9
-8
lines changed

5 files changed

+9
-8
lines changed

napi/oxlint/scripts/build.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ const oxlintDirPath = join(import.meta.dirname, '..'),
1010
console.log('Building with tsdown...');
1111
execSync('pnpm tsdown', { stdio: 'inherit', cwd: oxlintDirPath });
1212

13-
// Copy files from `napi/parser` to `napi/oxlint/dist/parser`
13+
// Copy files from `napi/parser` to `napi/oxlint/dist`
1414
console.log('Copying files from parser...');
1515

1616
const parserFilePaths = [
@@ -22,7 +22,7 @@ const parserFilePaths = [
2222
];
2323

2424
for (const parserFilePath of parserFilePaths) {
25-
copyFile(join(parserDirPath, parserFilePath), join(distDirPath, 'parser', parserFilePath));
25+
copyFile(join(parserDirPath, parserFilePath), join(distDirPath, parserFilePath));
2626
}
2727

2828
// Copy native `.node` files from `src-js`

napi/oxlint/src-js/plugins/lint.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,9 +10,9 @@ import { assertIs } from './utils.js';
1010
import { addVisitorToCompiled, compiledVisitor, finalizeCompiledVisitor, initCompiledVisitor } from './visitor.js';
1111

1212
// @ts-expect-error we need to generate `.d.ts` file for this module.
13-
import { TOKEN } from '../../dist/parser/raw-transfer/lazy-common.mjs';
13+
import { TOKEN } from '../../dist/raw-transfer/lazy-common.mjs';
1414
// @ts-expect-error we need to generate `.d.ts` file for this module.
15-
import { walkProgram } from '../../dist/parser/generated/lazy/walk.mjs';
15+
import { walkProgram } from '../../dist/generated/lazy/walk.mjs';
1616

1717
// Buffer with typed array views of itself stored as properties
1818
interface BufferWithArrays extends Uint8Array {

napi/oxlint/src-js/plugins/visitor.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,7 @@
7474

7575
// TODO(camc314): we need to generate `.d.ts` file for this module.
7676
// @ts-expect-error
77-
import { LEAF_NODE_TYPES_COUNT, NODE_TYPE_IDS_MAP, NODE_TYPES_COUNT } from '../../dist/parser/generated/lazy/types.mjs';
77+
import { LEAF_NODE_TYPES_COUNT, NODE_TYPE_IDS_MAP, NODE_TYPES_COUNT } from '../../dist/generated/lazy/types.mjs';
7878
import { assertIs } from './utils.js';
7979

8080
import type { CompiledVisitorEntry, EnterExit, Node, VisitFn, Visitor } from './types.ts';

napi/oxlint/test/compile-visitor.test.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import { afterEach, beforeEach, describe, expect, it, vi } from 'vitest';
22
// TODO(camc314): we need to generate `.d.ts` file for this module.
33
// @ts-expect-error
4-
import { NODE_TYPE_IDS_MAP } from '../../parser/generated/lazy/types.mjs';
4+
import { NODE_TYPE_IDS_MAP } from '../dist/generated/lazy/types.mjs';
55
import {
66
addVisitorToCompiled,
77
compiledVisitor,

napi/oxlint/tsdown.config.ts

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,9 @@ export default defineConfig({
1212
// External native bindings
1313
'./oxlint.*.node',
1414
'oxlint-*',
15-
// These are generated (also used by oxc-parser, so we'll copy them separately)
16-
/..\/parser\/.*/,
15+
// Files copied from `oxc-parser`.
16+
// Not bundled, to avoid needing sourcemaps when debugging.
17+
/\/dist\//,
1718
],
1819
// At present only compress syntax.
1920
// Don't mangle identifiers or remove whitespace, so `dist` code remains somewhat readable.

0 commit comments

Comments
 (0)