chore: fix running dist package in nodejs

So we have to add ".js" to the import name...
This commit is contained in:
2025-04-13 13:29:36 +07:00
parent 358fe53be9
commit 6cf4096064
5 changed files with 15 additions and 8 deletions

View File

@ -2,6 +2,13 @@
Rice shirt rice money :( Rice shirt rice money :(
## Notice
> [!WARNING]
> This software is provided by the author as is, without any warranty. Use at your own risk
The view buffed should be around 1/2 (or 2/5) of the amount of proxy you chosen in the worst case, and possibly near the amount in the best case.
## Installation ## Installation
This project uses Bun for dependency management and Node.js (or Bun on UNIX platforms) for the app execution. This project uses Bun for dependency management and Node.js (or Bun on UNIX platforms) for the app execution.

View File

@ -8,7 +8,7 @@
"dev-bun": "bun ./src/index.ts", "dev-bun": "bun ./src/index.ts",
"start": "node ./dist/index.js", "start": "node ./dist/index.js",
"start-bun": "bun ./dist/index.js", "start-bun": "bun ./dist/index.js",
"build": "swc ./src -d dist" "build": "swc ./src -d dist --strip-leading-paths"
}, },
"devDependencies": { "devDependencies": {
"@swc-node/register": "^1.10.10", "@swc-node/register": "^1.10.10",

View File

@ -1,8 +1,8 @@
import { chromium, type Browser, type LaunchOptions } from "patchright"; import { chromium, type Browser, type LaunchOptions } from "patchright";
import fs from 'node:fs'; import fs from 'node:fs';
import * as reflect4 from "./proxy/reflect4"; import * as reflect4 from "./proxy/reflect4.js";
import logger from "./logger"; import logger from "./logger.js";
import Config from "./config"; import Config from "./config.js";
const version = "0.1.0"; const version = "0.1.0";

View File

@ -1,7 +1,7 @@
import { devices, type BrowserContext, type Locator } from "patchright"; import { devices, type BrowserContext, type Locator } from "patchright";
import logger from "../logger"; import logger from "../logger.js";
import * as twitch from "../website/twitch"; import * as twitch from "../website/twitch.js";
import * as constants from "../constants"; import * as constants from "../constants.js";
async function spawn(context: BrowserContext, targetUrl: string, changeViewport: boolean = false, spawnId: string = "unknown") { async function spawn(context: BrowserContext, targetUrl: string, changeViewport: boolean = false, spawnId: string = "unknown") {
const server = constants.REFLECT4_SERVERS[Math.floor(Math.random() * constants.REFLECT4_SERVERS.length)]; const server = constants.REFLECT4_SERVERS[Math.floor(Math.random() * constants.REFLECT4_SERVERS.length)];

View File

@ -1,5 +1,5 @@
import type { Page } from "patchright"; import type { Page } from "patchright";
import logger from "../logger"; import logger from "../logger.js";
async function checkConsentButton(page: Page, spawnId: string = "unknown") { async function checkConsentButton(page: Page, spawnId: string = "unknown") {
const consentButton = page.locator("button[data-a-target='consent-banner-accept']"); const consentButton = page.locator("button[data-a-target='consent-banner-accept']");