File tree Expand file tree Collapse file tree 7 files changed +490
-18
lines changed Expand file tree Collapse file tree 7 files changed +490
-18
lines changed Original file line number Diff line number Diff line change 6262 "vite-node" : " ^2.1.4 || ^3.1.2" ,
6363 "web-ext-run" : " ^0.2.4"
6464 },
65+ "peerDependencies" : {
66+ "eslint" : " ^8.57.0 || ^9.0.0"
67+ },
68+ "peerDependenciesMeta" : {
69+ "eslint" : {
70+ "optional" : true
71+ }
72+ },
6573 "devDependencies" : {
6674 "@aklinker1/check" : " ^2.1.0" ,
6775 "@faker-js/faker" : " ^10.0.0" ,
7078 "@types/node" : " ^20.17.6" ,
7179 "@types/normalize-path" : " ^3.0.2" ,
7280 "@types/prompts" : " ^2.4.9" ,
81+ "eslint" : " ^9.38.0" ,
7382 "extract-zip" : " ^2.0.1" ,
7483 "happy-dom" : " ^18.0.1" ,
7584 "lodash.merge" : " ^4.6.2" ,
8089 "vitest" : " ^3.2.4" ,
8190 "vitest-plugin-random-seed" : " ^1.1.1"
8291 },
83- "peerDependenciesMeta" : {},
8492 "repository" : {
8593 "type" : " git" ,
8694 "url" : " git+https://github.com/wxt-dev/wxt.git"
Original file line number Diff line number Diff line change 11import { ResolvedConfig } from '../../../../types' ;
2- import * as vite from 'vite' ;
2+ import type * as vite from 'vite' ;
33import { normalizePath } from '../../../utils/paths' ;
44import { removeMainFunctionCode } from '../../../utils/transform' ;
55import { resolve } from 'node:path' ;
Original file line number Diff line number Diff line change @@ -536,17 +536,10 @@ async function getUnimportEslintOptions(
536536 * Returns the path to `node_modules/wxt`.
537537 */
538538function resolveWxtModuleDir ( ) {
539- // TODO: Drop the __filename expression once we're fully running in ESM
540- // (see https://github.com/wxt-dev/wxt/issues/277)
541- const importer =
542- typeof __filename === 'string'
543- ? pathToFileURL ( __filename ) . href
544- : import . meta. url ;
545-
546539 // TODO: Switch to import.meta.resolve() once the parent argument is unflagged
547540 // (e.g. --experimental-import-meta-resolve) and all Node.js versions we support
548541 // have it.
549- const url = esmResolve ( 'wxt' , importer ) ;
542+ const url = esmResolve ( 'wxt' , import . meta . url ) ;
550543
551544 // esmResolve() returns the "wxt/dist/index.mjs" file, not the package's root
552545 // directory, which we want to return from this function.
Original file line number Diff line number Diff line change @@ -3,13 +3,14 @@ import { createWslRunner } from './wsl';
33import { createWebExtRunner } from './web-ext' ;
44import { createSafariRunner } from './safari' ;
55import { createManualRunner } from './manual' ;
6- import { isWsl } from '../utils/wsl' ;
6+
77import { wxt } from '../wxt' ;
8+ import isWsl from 'is-wsl' ;
89
910export async function createExtensionRunner ( ) : Promise < ExtensionRunner > {
1011 if ( wxt . config . browser === 'safari' ) return createSafariRunner ( ) ;
1112
12- if ( await isWsl ( ) ) return createWslRunner ( ) ;
13+ if ( isWsl ) return createWslRunner ( ) ;
1314 if ( wxt . config . runnerConfig . config ?. disabled ) return createManualRunner ( ) ;
1415
1516 return createWebExtRunner ( ) ;
Original file line number Diff line number Diff line change 11export async function getEslintVersion ( ) : Promise < string [ ] > {
22 try {
3- const require = ( await import ( 'node:module' ) ) . default . createRequire (
4- import . meta. url ,
5- ) ;
6- const { ESLint } = require ( 'eslint' ) ;
3+ const { ESLint } = await import ( 'eslint' ) ;
74 return ESLint . version ?. split ( '.' ) ?? [ ] ;
85 } catch {
96 // Return an empty version when there's an error importing ESLint
Original file line number Diff line number Diff line change 1+ import isWsl_ from 'is-wsl' ;
2+
13/**
24 * Returns true when running on WSL or WSL2.
35 */
46export async function isWsl ( ) : Promise < boolean > {
5- const { default : isWsl } = await import ( 'is-wsl' ) ; // ESM only, requires dynamic import
6- return isWsl ;
7+ return isWsl_ ;
78}
You can’t perform that action at this time.
0 commit comments