Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(bindings/node): Fix regression of JS APIs #8998

Merged
merged 4 commits into from
May 30, 2024
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
2 changes: 1 addition & 1 deletion packages/core/__tests__/plugin_test.mjs
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import swc from "..";
import Visitor from "../src/Visitor";
import Visitor from "../Visitor";

function assertAllObjectHasTypeFiled(obj, desc = '') {
if (Array.isArray(obj)) {
Expand Down
2 changes: 1 addition & 1 deletion packages/core/__tests__/transform/plugin_test.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
const swc = require("../../");
const Visitor = require("../../src/Visitor").default;
const Visitor = require("../../Visitor").default;

{
const src = `
Expand Down
4 changes: 2 additions & 2 deletions packages/core/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ const bindings: typeof import("../binding") = (() => {
try {
binding = !!bindingsOverride
? require(resolve(bindingsOverride))
: require("../binding.js");
: require("./binding.js");

// If native binding loaded successfully, it should return proper target triple constant.
const triple = binding.getTargetTriple();
Expand All @@ -40,7 +40,7 @@ const bindings: typeof import("../binding") = (() => {
/**
* Version of the swc binding.
*/
export const version: string = require("../package.json").version;
export const version: string = require("./package.json").version;

/**
* @deprecated JavaScript API is deprecated. Please use Wasm plugin instead.
Expand Down
File renamed without changes.
2 changes: 1 addition & 1 deletion packages/core/tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
"sourceMap": false /* Generates corresponding '.map' file. */,
// "outFile": "./", /* Concatenate and emit output to single file. */
"outDir": "./" /* Redirect output structure to the directory. */,
"rootDir": "./" /* Specify the root directory of input files. Use to control the output directory structure with --outDir. */,
"rootDir": "./src/" /* Specify the root directory of input files. Use to control the output directory structure with --outDir. */,
// "composite": true, /* Enable project compilation */
"removeComments": false /* Do not emit comments to output. */,
// "noEmit": true, /* Do not emit outputs. */
Expand Down
Loading