Skip to content

Commit 866ca8d

Browse files
committed
refactor: migrate to pnpm workspace
1 parent 3a1b5e5 commit 866ca8d

File tree

14 files changed

+71
-50
lines changed

14 files changed

+71
-50
lines changed

.gitignore

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -7,10 +7,5 @@
77
/test.*
88
yarn.lock
99
yarn-error.log
10-
/docs/.vitepress/dist
11-
/docs/.vitepress/build-system/shim/vue-eslint-parser.mjs
12-
/docs/.vitepress/build-system/shim/@typescript-eslint/parser.mjs
13-
/docs/.vitepress/.temp
14-
/docs/.vitepress/cache
1510
typings/eslint/lib/rules
1611
eslint-typegen.d.ts

docs/.gitignore

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
.vitepress/dist
2+
.vitepress/build-system/shim/@typescript-eslint
3+
.vitepress/build-system/shim/vue-eslint-parser.js
4+
.vitepress/.temp
5+
.vitepress/cache

docs/.vitepress/build-system/build.mts renamed to docs/.vitepress/build-system/build.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ build(
1313
dirname,
1414
'../../../node_modules/@typescript-eslint/parser/dist/index.js'
1515
),
16-
path.join(dirname, './shim/@typescript-eslint/parser.mjs'),
16+
path.join(dirname, './shim/@typescript-eslint/parser.js'),
1717
[
1818
'util',
1919
'node:util',
@@ -29,7 +29,7 @@ build(
2929

3030
build(
3131
path.join(dirname, '../../../node_modules/vue-eslint-parser/index.js'),
32-
path.join(dirname, './shim/vue-eslint-parser.mjs'),
32+
path.join(dirname, './shim/vue-eslint-parser.js'),
3333
[
3434
'path',
3535
'debug',
@@ -59,7 +59,7 @@ function bundle(entryPoint: string, externals: string[]) {
5959
bundle: true,
6060
external: externals,
6161
write: false,
62-
inject: [path.join(dirname, './src/process-shim.mjs')]
62+
inject: [path.join(dirname, './src/process-shim.js')]
6363
})
6464

6565
return `${result.outputFiles[0].text}`

docs/.vitepress/config.mts renamed to docs/.vitepress/config.ts

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -2,11 +2,11 @@ import type { DefaultTheme } from 'vitepress'
22
import { defineConfig } from 'vitepress'
33
import path from 'pathe'
44
import { fileURLToPath } from 'url'
5-
import { viteCommonjs, vitePluginRequireResolve } from './vite-plugin.mjs'
5+
import { viteCommonjs, vitePluginRequireResolve } from './vite-plugin'
66
import eslint4b, { requireESLintUseAtYourOwnRisk4b } from 'vite-plugin-eslint4b'
77

88
// Pre-build cjs packages that cannot be bundled well.
9-
import './build-system/build.mjs'
9+
import './build-system/build'
1010

1111
const dirname = path.dirname(fileURLToPath(import.meta.url))
1212

@@ -153,17 +153,17 @@ export default async () => {
153153
alias: {
154154
'vue-eslint-parser': path.join(
155155
dirname,
156-
'./build-system/shim/vue-eslint-parser.mjs'
156+
'./build-system/shim/vue-eslint-parser.js'
157157
),
158158
'@typescript-eslint/parser': path.join(
159159
dirname,
160-
'./build-system/shim/@typescript-eslint/parser.mjs'
160+
'./build-system/shim/@typescript-eslint/parser.js'
161161
),
162162

163163
tslib: path.join(dirname, '../../node_modules/tslib/tslib.es6.js'),
164-
globby: path.join(dirname, './build-system/shim/empty.mjs'),
165-
'fast-glob': path.join(dirname, './build-system/shim/empty.mjs'),
166-
module: path.join(dirname, './build-system/shim/empty.mjs')
164+
globby: path.join(dirname, './build-system/shim/empty.js'),
165+
'fast-glob': path.join(dirname, './build-system/shim/empty.js'),
166+
module: path.join(dirname, './build-system/shim/empty.js')
167167
}
168168
},
169169
define: {

docs/.vitepress/theme/index.ts

Lines changed: 8 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,25 +1,17 @@
1-
// @ts-expect-error -- Browser
2-
if (typeof window !== 'undefined') {
3-
if (typeof require === 'undefined') {
4-
// @ts-expect-error -- Browser
5-
;(window as any).require = () => {
6-
const e = new Error('require is not defined')
7-
;(e as any).code = 'MODULE_NOT_FOUND'
8-
throw e
9-
}
10-
}
11-
}
12-
// @ts-expect-error -- Cannot change `module` option
131
import type { Theme } from 'vitepress'
14-
// @ts-expect-error -- Cannot change `module` option
152
import DefaultTheme from 'vitepress/theme'
16-
// @ts-expect-error -- ignore
173
import Layout from './Layout.vue'
18-
// @ts-expect-error -- ignore
194
import ESLintCodeBlock from './components/eslint-code-block.vue'
20-
// @ts-expect-error -- ignore
215
import RulesTable from './components/rules-table.vue'
226

7+
if (typeof window !== 'undefined' && typeof require === 'undefined') {
8+
;(window as any).require = () => {
9+
const e = new Error('require is not defined')
10+
;(e as any).code = 'MODULE_NOT_FOUND'
11+
throw e
12+
}
13+
}
14+
2315
const theme: Theme = {
2416
...DefaultTheme,
2517
Layout,

docs/.vitepress/vite-plugin.mts renamed to docs/.vitepress/vite-plugin.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@ import type { UserConfig } from 'vitepress'
22
import path from 'pathe'
33
import { fileURLToPath } from 'url'
44
import esbuild from 'esbuild'
5+
56
type Plugin = Extract<
67
NonNullable<NonNullable<UserConfig['vite']>['plugins']>[number],
78
{ name: string }

docs/package.json

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
{
2+
"private": true,
3+
"type": "module",
4+
"scripts": {
5+
"dev": "vitepress",
6+
"build": "vitepress build"
7+
}
8+
}

docs/tsconfig.json

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
{
2+
"extends": "../tsconfig.base.json",
3+
"compilerOptions": {
4+
"module": "esnext",
5+
"target": "esnext",
6+
"moduleResolution": "bundler",
7+
"lib": ["ESNext", "DOM"],
8+
},
9+
"include": [
10+
".vitepress/**/*.js",
11+
".vitepress/**/*.ts",
12+
".vitepress/**/*.vue"
13+
]
14+
}

0 commit comments

Comments
 (0)