Skip to content

Commit

Permalink
chore: upgrade to prettier v3 (#362)
Browse files Browse the repository at this point in the history
  • Loading branch information
JounQin committed Jan 16, 2024
1 parent 80d0b9b commit 05a8246
Show file tree
Hide file tree
Showing 10 changed files with 1,200 additions and 930 deletions.
1 change: 1 addition & 0 deletions .codesandbox/ci.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
{
"node": "18",
"installCommand": "codesandbox:install",
"packages": [
"packages/*"
],
Expand Down
8 changes: 4 additions & 4 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@
"build:r": "tsx packages/rollup/src/cli.ts -f cjs -d false",
"build:ts": "tsc -b",
"clean": "rimraf --glob packages/*/{lib,*.tsbuildinfo}",
"codesandbox:install": "yarn --ignore-engines",
"lint": "run-p lint:*",
"lint:es": "eslint . --cache -f friendly",
"lint:tsc": "tsc --noEmit",
Expand All @@ -27,7 +28,7 @@
"typecov": "type-coverage"
},
"devDependencies": {
"@1stg/common-config": "^9.0.1",
"@1stg/common-config": "^10.0.0",
"@changesets/changelog-github": "^0.5.0",
"@changesets/cli": "^2.27.1",
"@types/cross-spawn": "^6.0.6",
Expand All @@ -37,7 +38,7 @@
"@types/jest": "^29.5.11",
"@types/lodash-es": "^4.17.12",
"@types/micromatch": "^4.0.6",
"@types/node": "^20.10.5",
"@types/node": "^20.11.4",
"jest": "^29.7.0",
"patch-package": "^8.0.0",
"rimraf": "^5.0.5",
Expand All @@ -48,8 +49,7 @@
"yarn-deduplicate": "^6.0.2"
},
"resolutions": {
"@pkgr/utils": "link:packages/utils",
"prettier": "^2.8.8"
"prettier": "^3.2.2"
},
"commitlint": {
"extends": [
Expand Down
20 changes: 10 additions & 10 deletions packages/rollup/src/config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -207,12 +207,12 @@ ConfigOptions = {}): RollupOptions[] => {
monorepo === false
? [CWD]
: Array.isArray(monorepo)
? tryGlob(
monorepo.map(pkg =>
pkg.endsWith('/package.json') ? pkg : `${pkg}/package.json`,
),
)
: getMonorepoPkgs()
? tryGlob(
monorepo.map(pkg =>
pkg.endsWith('/package.json') ? pkg : `${pkg}/package.json`,
),
)
: getMonorepoPkgs()

pkgs = pkgs.map(pkg => pkg.replace(/[/\\]package\.json$/, ''))

Expand Down Expand Up @@ -377,10 +377,10 @@ ConfigOptions = {}): RollupOptions[] => {
return pkgRegExp instanceof RegExp
? pkgRegExp.test(id)
: isGlob(pkg)
? tryRequirePkg<typeof import('micromatch')>(
'micromatch',
)!.isMatch(id, pkg)
: id === pkg || id.startsWith(`${pkg}/`)
? tryRequirePkg<typeof import('micromatch')>(
'micromatch',
)!.isMatch(id, pkg)
: id === pkg || id.startsWith(`${pkg}/`)
})
},
onwarn,
Expand Down
47 changes: 0 additions & 47 deletions patches/@1stg+eslint-config+7.0.1.patch

This file was deleted.

17 changes: 17 additions & 0 deletions patches/cliui+8.0.1.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
diff --git a/node_modules/cliui/build/index.cjs b/node_modules/cliui/build/index.cjs
index 82126b6..73f29ae 100644
--- a/node_modules/cliui/build/index.cjs
+++ b/node_modules/cliui/build/index.cjs
@@ -288,9 +288,9 @@ function cliui(opts, _mixin) {
}

// Bootstrap cliui with CommonJS dependencies:
-const stringWidth = require('string-width');
-const stripAnsi = require('strip-ansi');
-const wrap = require('wrap-ansi');
+const stringWidth = require('string-width-cjs');
+const stripAnsi = require('strip-ansi-cjs');
+const wrap = require('wrap-ansi-cjs');
function ui(opts) {
return cliui(opts, {
stringWidth,
11 changes: 11 additions & 0 deletions patches/string-length+4.0.2.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
diff --git a/node_modules/string-length/index.js b/node_modules/string-length/index.js
index c2589a2..3040f0a 100644
--- a/node_modules/string-length/index.js
+++ b/node_modules/string-length/index.js
@@ -1,5 +1,5 @@
'use strict';
-const stripAnsi = require('strip-ansi');
+const stripAnsi = require('strip-ansi-cjs');
const charRegex = require('char-regex');

const stringLength = string => {
11 changes: 11 additions & 0 deletions patches/string-width-cjs+4.2.3.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
diff --git a/node_modules/string-width-cjs/index.js b/node_modules/string-width-cjs/index.js
index f4d261a..7ea642a 100644
--- a/node_modules/string-width-cjs/index.js
+++ b/node_modules/string-width-cjs/index.js
@@ -1,5 +1,5 @@
'use strict';
-const stripAnsi = require('strip-ansi');
+const stripAnsi = require('strip-ansi-cjs');
const isFullwidthCodePoint = require('is-fullwidth-code-point');
const emojiRegex = require('emoji-regex');

13 changes: 13 additions & 0 deletions patches/wrap-ansi-cjs+7.0.0.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
diff --git a/node_modules/wrap-ansi-cjs/index.js b/node_modules/wrap-ansi-cjs/index.js
index d502255..c33a23a 100755
--- a/node_modules/wrap-ansi-cjs/index.js
+++ b/node_modules/wrap-ansi-cjs/index.js
@@ -1,6 +1,6 @@
'use strict';
-const stringWidth = require('string-width');
-const stripAnsi = require('strip-ansi');
+const stringWidth = require('string-width-cjs');
+const stripAnsi = require('strip-ansi-cjs');
const ansiStyles = require('ansi-styles');

const ESCAPES = new Set([
7 changes: 7 additions & 0 deletions patches/yargs+17.7.2.patch

Large diffs are not rendered by default.

0 comments on commit 05a8246

Please sign in to comment.