Skip to content

Commit 62df46d

Browse files
authored
refactor!: bump @pkgr/core and tinyexec, drop tslib (#218)
1 parent fecd416 commit 62df46d

File tree

16 files changed

+5604
-6078
lines changed

16 files changed

+5604
-6078
lines changed

.changeset/heavy-rabbits-repeat.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
"pretty-quick": major
3+
---
4+
5+
refactor!: bump `@pkgr/core` and `tinyexec`, drop `tslib`

.github/workflows/ci.yml

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -17,8 +17,6 @@ jobs:
1717
strategy:
1818
matrix:
1919
node:
20-
- 14
21-
- 16
2220
- 18
2321
- 20
2422
- 22
@@ -41,15 +39,13 @@ jobs:
4139
run: yarn --immutable
4240

4341
- name: Build
44-
if: matrix.node != 14
4542
run: yarn build
4643

4744
- name: Test
4845
run: yarn test
4946

5047
- name: Lint
5148
run: yarn lint
52-
if: matrix.node != 14 && matrix.node != 16
5349
env:
5450
EFF_NO_LINK_RULES: true
5551
PARSER_NO_WATCH: true

.yarn/plugins/@yarnpkg/plugin-interactive-tools.cjs

Lines changed: 0 additions & 541 deletions
This file was deleted.

.yarn/releases/yarn-3.6.4.cjs

Lines changed: 0 additions & 874 deletions
This file was deleted.

.yarn/releases/yarn-4.9.1.cjs

Lines changed: 948 additions & 0 deletions
Large diffs are not rendered by default.

.yarnrc.yml

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,5 @@ nodeLinker: node-modules
99
plugins:
1010
- path: .yarn/plugins/plugin-prepare-lifecycle.cjs
1111
spec: 'https://github.com/un-es/yarn-plugin-prepare-lifecycle/releases/download/v0.0.1/index.js'
12-
- path: .yarn/plugins/@yarnpkg/plugin-interactive-tools.cjs
13-
spec: '@yarnpkg/plugin-interactive-tools'
1412

15-
yarnPath: .yarn/releases/yarn-3.6.4.cjs
13+
yarnPath: .yarn/releases/yarn-4.9.1.cjs

package.json

Lines changed: 6 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -10,9 +10,9 @@
1010
],
1111
"funding": "https://opencollective.com/pretty-quick",
1212
"license": "MIT",
13-
"packageManager": "yarn@3.6.4",
13+
"packageManager": "yarn@4.9.1",
1414
"engines": {
15-
"node": ">=14"
15+
"node": "^14.18.0 || >=16.0.0"
1616
},
1717
"bin": "lib/cli.mjs",
1818
"main": "lib/index.js",
@@ -54,13 +54,11 @@
5454
"precommit"
5555
],
5656
"scripts": {
57-
"build": "run-s 'build:*'",
58-
"build:tsc": "tsc -b",
59-
"build:tsdown": "tsdown --no-clean -d lib",
57+
"build": "tsdown",
6058
"format": "prettier --write .",
6159
"lint": "run-p 'lint:*'",
6260
"lint:es": "eslint . --cache",
63-
"lint:tsc": "tsc --noEmit",
61+
"lint:tsc": "tsc -p tsconfig.base.json",
6462
"prepare": "patch-package && simple-git-hooks",
6563
"release": "yarn build && clean-pkg-json && changeset publish",
6664
"test": "jest"
@@ -69,13 +67,12 @@
6967
"prettier": "^3.0.0"
7068
},
7169
"dependencies": {
72-
"@pkgr/core": "^0.2.7",
70+
"@pkgr/core": "^0.3.3",
7371
"ignore": "^7.0.5",
7472
"mri": "^1.2.0",
7573
"picocolors": "^1.1.1",
7674
"picomatch": "^4.0.2",
77-
"tinyexec": "^0.3.2",
78-
"tslib": "^2.8.1"
75+
"tinyexec": "^1.0.1"
7976
},
8077
"devDependencies": {
8178
"@1stg/common-config": "^14.1.0",

patches/ts-jest+29.3.4.patch

Lines changed: 0 additions & 16 deletions
This file was deleted.

src/scms/git.ts

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,11 @@ import { Output, exec } from 'tinyexec'
66
export const name = 'git'
77

88
export const detect = (directory: string) => {
9-
const found = findUp(path.resolve(directory), '.git', true)
9+
const found = findUp({
10+
entry: path.resolve(directory),
11+
search: '.git',
12+
type: ['file', 'directory'],
13+
})
1014
return found ? path.dirname(found) : null
1115
}
1216

src/scms/hg.ts

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
import fs from 'fs'
21
import path from 'path'
32

43
import { findUp } from '@pkgr/core'
@@ -7,10 +6,12 @@ import { Output, exec } from 'tinyexec'
76
export const name = 'hg'
87

98
export const detect = (directory: string) => {
10-
const found = findUp(path.resolve(directory), '.hg', true)
11-
if (found && fs.statSync(found).isDirectory()) {
12-
return path.dirname(found)
13-
}
9+
const found = findUp({
10+
entry: path.resolve(directory),
11+
search: '.hg',
12+
type: 'directory',
13+
})
14+
return found ? path.dirname(found) : null
1415
}
1516

1617
const runHg = (directory: string, args: string[]) =>

src/tsconfig.json

Lines changed: 0 additions & 8 deletions
This file was deleted.

test/pretty-quick.spec.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ import mock from 'mock-fs'
22

33
import prettyQuick from 'pretty-quick'
44

5-
jest.mock('execa')
5+
jest.mock('tinyexec')
66

77
afterEach(() => mock.restore())
88

tsconfig.base.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
{
2-
// used by @pkgr/rollup and ESLint
2+
// used by ESLint
33
"extends": "./tsconfig.lib",
44
"compilerOptions": {
55
"paths": {

tsconfig.json

Lines changed: 1 addition & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -2,13 +2,5 @@
22
"extends": "./tsconfig.base",
33
"compilerOptions": {
44
"noEmit": true
5-
},
6-
"ts-node": {
7-
"transpileOnly": true
8-
},
9-
"references": [
10-
{
11-
"path": "./src"
12-
}
13-
]
5+
}
146
}

tsdown.config.mts

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
import { defineConfig, type UserConfig } from 'tsdown/config'
2+
3+
const sharedConfig: UserConfig = {
4+
outDir: 'lib',
5+
}
6+
7+
export default defineConfig([
8+
{
9+
...sharedConfig,
10+
format: 'esm',
11+
unbundle: true,
12+
},
13+
{
14+
...sharedConfig,
15+
entry: 'src/cli.mts',
16+
format: 'esm',
17+
unbundle: true,
18+
},
19+
{
20+
...sharedConfig,
21+
format: 'cjs',
22+
// ESM only
23+
noExternal: 'tinyexec',
24+
},
25+
])

0 commit comments

Comments
 (0)