Skip to content

Commit

Permalink
Revert "fix: use pathe (#1632)"
Browse files Browse the repository at this point in the history
This reverts commit 48263d7.
  • Loading branch information
sudongyuer committed Sep 27, 2022
1 parent 68b2414 commit a433931
Show file tree
Hide file tree
Showing 26 changed files with 23 additions and 49 deletions.
2 changes: 1 addition & 1 deletion alias.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { resolve } from 'pathe'
import { resolve } from 'path'

const r = (p: string) => resolve(__dirname, p)

Expand Down
2 changes: 1 addition & 1 deletion bench/build.mjs
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/* eslint-disable no-console */
import { performance } from 'perf_hooks'
import { join } from 'pathe'
import { join } from 'path'
import fs from 'fs-extra'
import { build } from 'vite'
import { dir, targets } from './meta.mjs'
Expand Down
2 changes: 1 addition & 1 deletion bench/gen.mjs
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { existsSync, promises as fs } from 'fs'
import { join } from 'pathe'
import { join } from 'path'
import { dir } from './meta.mjs'

const sizes = [
Expand Down
2 changes: 1 addition & 1 deletion bench/meta.mjs
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { fileURLToPath } from 'url'
import { dirname, resolve } from 'pathe'
import { dirname, resolve } from 'path'
import { getPackageInfo } from 'local-pkg'
import fs from 'fs-extra'

Expand Down
2 changes: 1 addition & 1 deletion bench/run.mjs
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/* eslint-disable no-console */
import { execSync } from 'child_process'
import { join } from 'pathe'
import { join } from 'path'
import fs from 'fs-extra'
import { escapeSelector } from '@unocss/core'
import { dir, getVersions, targets } from './meta.mjs'
Expand Down
2 changes: 1 addition & 1 deletion interactive/scripts/prepare.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { basename, dirname, parse } from 'pathe'
import { basename, dirname, parse } from 'path'
import fs from 'fs-extra'
import fg from 'fast-glob'
import YAML from 'js-yaml'
Expand Down
1 change: 0 additions & 1 deletion packages/config/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,6 @@
},
"dependencies": {
"@unocss/core": "workspace:*",
"pathe": "^0.3.7",
"unconfig": "^0.3.6"
}
}
2 changes: 1 addition & 1 deletion packages/config/src/index.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { dirname, resolve } from 'path'
import fs from 'fs'
import { dirname, resolve } from 'pathe'
import type { UserConfig } from '@unocss/core'
import type { LoadConfigResult, LoadConfigSource } from 'unconfig'
import { createConfigLoader as createLoader } from 'unconfig'
Expand Down
2 changes: 1 addition & 1 deletion packages/inspector/node/index.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { dirname, resolve } from 'path'
import { fileURLToPath } from 'url'
import { dirname, resolve } from 'pathe'
import sirv from 'sirv'
import type { Plugin, ViteDevServer } from 'vite'
import type { UnocssPluginContext } from '@unocss/core'
Expand Down
1 change: 0 additions & 1 deletion packages/inspector/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,6 @@
},
"dependencies": {
"gzip-size": "^6.0.0",
"pathe": "^0.3.7",
"sirv": "^2.0.2"
}
}
1 change: 0 additions & 1 deletion packages/nuxt/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,6 @@
"@unocss/reset": "workspace:*",
"@unocss/vite": "workspace:*",
"@unocss/webpack": "workspace:*",
"pathe": "^0.3.7",
"unocss": "workspace:*"
},
"devDependencies": {
Expand Down
2 changes: 1 addition & 1 deletion packages/nuxt/src/index.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { dirname, resolve } from 'path'
import { fileURLToPath } from 'url'
import { dirname, resolve } from 'pathe'
import { addComponentsDir, addPluginTemplate, defineNuxtModule, extendWebpackConfig } from '@nuxt/kit'
import WebpackPlugin from '@unocss/webpack'
import VitePlugin from '@unocss/vite'
Expand Down
3 changes: 1 addition & 2 deletions packages/preset-uno/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,6 @@
"dependencies": {
"@unocss/core": "workspace:*",
"@unocss/preset-mini": "workspace:*",
"@unocss/preset-wind": "workspace:*",
"pathe": "^0.3.7"
"@unocss/preset-wind": "workspace:*"
}
}
3 changes: 1 addition & 2 deletions packages/preset-web-fonts/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,6 @@
},
"dependencies": {
"@unocss/core": "workspace:*",
"ohmyfetch": "^0.4.18",
"pathe": "^0.3.7"
"ohmyfetch": "^0.4.18"
}
}
3 changes: 1 addition & 2 deletions packages/preset-wind/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,6 @@
},
"dependencies": {
"@unocss/core": "workspace:*",
"@unocss/preset-mini": "workspace:*",
"pathe": "^0.3.7"
"@unocss/preset-mini": "workspace:*"
}
}
3 changes: 1 addition & 2 deletions packages/vite/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -53,8 +53,7 @@
"@unocss/inspector": "workspace:*",
"@unocss/scope": "workspace:*",
"@unocss/transformer-directives": "workspace:*",
"magic-string": "^0.26.3",
"pathe": "^0.3.7"
"magic-string": "^0.26.3"
},
"devDependencies": {
"@unocss/shared-integration": "workspace:*",
Expand Down
2 changes: 1 addition & 1 deletion packages/vite/src/devtool.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import fs from 'fs'
import { dirname, resolve } from 'path'
import { fileURLToPath } from 'url'
import { dirname, resolve } from 'pathe'
import type { Plugin, ResolvedConfig, ViteDevServer } from 'vite'
import type { IncomingMessage } from 'connect'
import type { UnocssPluginContext } from '@unocss/core'
Expand Down
2 changes: 1 addition & 1 deletion packages/vite/src/modes/global/build.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { resolve } from 'pathe'
import { resolve } from 'path'
import type { Plugin, ResolvedConfig } from 'vite'
import type { GenerateResult, UnocssPluginContext } from '@unocss/core'
import {
Expand Down
1 change: 0 additions & 1 deletion packages/webpack/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,6 @@
"@unocss/config": "workspace:*",
"@unocss/core": "workspace:*",
"magic-string": "^0.26.3",
"pathe": "^0.3.7",
"unplugin": "^0.9.5",
"webpack-sources": "^3.2.3"
},
Expand Down
22 changes: 2 additions & 20 deletions pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion scripts/copy-files.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { copyFileSync } from 'fs'
import { resolve } from 'path'
import { fileURLToPath } from 'url'
import { resolve } from 'pathe'

// relative to scripts directory
const destinations = [
Expand Down
2 changes: 1 addition & 1 deletion scripts/prepare.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { basename, dirname, extname, relative } from 'pathe'
import { basename, dirname, extname, relative } from 'path'
import fg from 'fast-glob'
import fs from 'fs-extra'

Expand Down
2 changes: 1 addition & 1 deletion scripts/size.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import fs from 'fs/promises'
import { basename } from 'pathe'
import { basename } from 'path'
import { sync as brotli } from 'brotli-size'
import { sync as gzip } from 'gzip-size'
import { minify } from 'terser'
Expand Down
2 changes: 1 addition & 1 deletion test/cli.test.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { resolve } from 'pathe'
import { resolve } from 'path'
import fs from 'fs-extra'
import { afterAll, beforeAll, describe, expect, it } from 'vitest'
import { startCli } from '../packages/cli/src/cli-start'
Expand Down
2 changes: 1 addition & 1 deletion test/fixtures.test.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { join, resolve } from 'pathe'
import { join, resolve } from 'path'
import { build } from 'vite'
import { describe, expect, it } from 'vitest'
import fs from 'fs-extra'
Expand Down
2 changes: 1 addition & 1 deletion test/fixtures/vite-lib/vite.config.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { resolve } from 'pathe'
import { resolve } from 'path'
import { defineConfig } from 'vite'
import UnoCSS from '@unocss/vite'

Expand Down

0 comments on commit a433931

Please sign in to comment.