Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 6 additions & 5 deletions napi/minify/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,9 @@
// @ts-nocheck
/* auto-generated by NAPI-RS */

const { createRequire } = require('node:module')
require = createRequire(__filename)
import { createRequire } from 'node:module'
const require = createRequire(import.meta.url)
const __dirname = new URL('.', import.meta.url).pathname

const { readFileSync } = require('node:fs')
let nativeBinding = null
Expand Down Expand Up @@ -400,6 +401,6 @@ if (!nativeBinding) {
throw new Error(`Failed to load native binding`)
}

module.exports = nativeBinding
module.exports.minify = nativeBinding.minify
module.exports.Severity = nativeBinding.Severity
const { minify, Severity } = nativeBinding
export { minify }
export { Severity }
4 changes: 2 additions & 2 deletions napi/minify/package.json
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
{
"name": "oxc-minify",
"version": "0.82.3",
"type": "commonjs",
"type": "module",
"main": "index.js",
"browser": "browser.js",
"scripts": {
"build-dev": "napi build --platform",
"build-dev": "napi build --esm --platform",
"build-test": "pnpm run build-dev",
"build": "pnpm run build-dev --features allocator --release",
"postbuild-dev": "node patch.mjs",
Expand Down
17 changes: 9 additions & 8 deletions napi/transform/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,9 @@
// @ts-nocheck
/* auto-generated by NAPI-RS */

const { createRequire } = require('node:module')
require = createRequire(__filename)
import { createRequire } from 'node:module'
const require = createRequire(import.meta.url)
const __dirname = new URL('.', import.meta.url).pathname

const { readFileSync } = require('node:fs')
let nativeBinding = null
Expand Down Expand Up @@ -400,9 +401,9 @@ if (!nativeBinding) {
throw new Error(`Failed to load native binding`)
}

module.exports = nativeBinding
module.exports.Severity = nativeBinding.Severity
module.exports.HelperMode = nativeBinding.HelperMode
module.exports.isolatedDeclaration = nativeBinding.isolatedDeclaration
module.exports.moduleRunnerTransform = nativeBinding.moduleRunnerTransform
module.exports.transform = nativeBinding.transform
const { Severity, HelperMode, isolatedDeclaration, moduleRunnerTransform, transform } = nativeBinding
export { Severity }
export { HelperMode }
export { isolatedDeclaration }
export { moduleRunnerTransform }
export { transform }
4 changes: 2 additions & 2 deletions napi/transform/package.json
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
{
"name": "oxc-transform",
"version": "0.82.3",
"type": "commonjs",
"type": "module",
"main": "index.js",
"browser": "browser.js",
"scripts": {
"build-dev": "napi build --platform",
"build-dev": "napi build --esm --platform",
"build-test": "pnpm run build-dev",
"build": "pnpm run build-dev --features allocator --release",
"postbuild-dev": "node patch.mjs",
Expand Down
4 changes: 2 additions & 2 deletions napi/transform/test/id.test.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { describe, expect, it } from 'vitest';

import oxc from '../index';
import { isolatedDeclaration } from '../index';

describe('isolated declaration', () => {
const code = `
Expand All @@ -18,7 +18,7 @@ describe('isolated declaration', () => {
`;

it('matches output', () => {
const ret = oxc.isolatedDeclaration('test.ts', code, { sourcemap: true });
const ret = isolatedDeclaration('test.ts', code, { sourcemap: true });
expect(ret).toMatchObject({
code: '/**\n' +
'* jsdoc 1\n' +
Expand Down
Loading