Skip to content

Commit

Permalink
ci: patch @pkgr packages for node compatibility
Browse files Browse the repository at this point in the history
  • Loading branch information
JounQin committed Jan 16, 2024
1 parent 6577174 commit 32fb365
Show file tree
Hide file tree
Showing 5 changed files with 245 additions and 3 deletions.
3 changes: 2 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@
"lint": "run-p 'lint:*'",
"lint:es": "eslint . --cache",
"lint:tsc": "tsc --noEmit",
"prepare": "simple-git-hooks",
"prepare": "patch-package && simple-git-hooks",
"release": "yarn build && clean-pkg-json && changeset publish",
"test": "jest"
},
Expand All @@ -63,6 +63,7 @@
"@total-typescript/ts-reset": "^0.5.1",
"@types/jest": "^29.5.11",
"@types/mock-fs": "^4.13.4",
"@unts/patch-package": "^8.0.0",
"clean-pkg-json": "^1.2.0",
"eslint": "^8.56.0",
"eslint-config-prettier": "^9.1.0",
Expand Down
28 changes: 28 additions & 0 deletions patches/@pkgr+core+0.1.0.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
diff --git a/node_modules/@pkgr/core/lib/helpers.js b/node_modules/@pkgr/core/lib/helpers.js
index 806148f..770d272 100644
--- a/node_modules/@pkgr/core/lib/helpers.js
+++ b/node_modules/@pkgr/core/lib/helpers.js
@@ -1,5 +1,5 @@
-import fs from 'node:fs';
-import path from 'node:path';
+import fs from 'fs';
+import path from 'path';
import { CWD, EXTENSIONS, cjsRequire } from './constants.js';
export const tryPkg = (pkg) => {
try {
diff --git a/node_modules/@pkgr/core/lib/index.cjs b/node_modules/@pkgr/core/lib/index.cjs
index 6c7375a..2602d12 100644
--- a/node_modules/@pkgr/core/lib/index.cjs
+++ b/node_modules/@pkgr/core/lib/index.cjs
@@ -1,8 +1,8 @@
'use strict';

-var node_module = require('node:module');
-var fs = require('node:fs');
-var path = require('node:path');
+var node_module = require('module');
+var fs = require('fs');
+var path = require('path');

const import_meta = {};
const CWD = process.cwd();
25 changes: 25 additions & 0 deletions patches/@pkgr+rollup+4.1.3.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
diff --git a/node_modules/@pkgr/rollup/lib/cli.js b/node_modules/@pkgr/rollup/lib/cli.js
index 6b87f60..3c7047e 100755
--- a/node_modules/@pkgr/rollup/lib/cli.js
+++ b/node_modules/@pkgr/rollup/lib/cli.js
@@ -1,6 +1,6 @@
#!/usr/bin/env node
-import path from 'node:path';
-import { fileURLToPath } from 'node:url';
+import path from 'path';
+import { fileURLToPath } from 'url';
import { tryRequirePkg } from '@pkgr/utils';
import { program } from 'commander';
import debug from 'debug';
diff --git a/node_modules/@pkgr/rollup/lib/config.js b/node_modules/@pkgr/rollup/lib/config.js
index 8a60fcc..8e22ac4 100644
--- a/node_modules/@pkgr/rollup/lib/config.js
+++ b/node_modules/@pkgr/rollup/lib/config.js
@@ -1,5 +1,5 @@
-import fs from 'node:fs';
-import path from 'node:path';
+import fs from 'fs';
+import path from 'path';
import { entries } from '@pkgr/es-modules';
import { getGlobals, normalizePkg, upperCamelCase, } from '@pkgr/umd-globals';
import { CWD, EXTENSIONS, PROD, __DEV__, __PROD__, arrayify, identify, monorepoPkgs, tryExtensions, tryFile, tryGlob, tryPkg, tryRequirePkg, } from '@pkgr/utils';
71 changes: 71 additions & 0 deletions patches/@pkgr+utils+2.4.2.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,71 @@
diff --git a/node_modules/@pkgr/utils/lib/browser.js b/node_modules/@pkgr/utils/lib/browser.js
index b36ffa9..0140c1a 100644
--- a/node_modules/@pkgr/utils/lib/browser.js
+++ b/node_modules/@pkgr/utils/lib/browser.js
@@ -1,7 +1,7 @@
import { __awaiter } from "tslib";
-import { execSync } from 'node:child_process';
-import path from 'node:path';
-import { fileURLToPath } from 'node:url';
+import { execSync } from 'child_process';
+import path from 'path';
+import { fileURLToPath } from 'url';
import spawn from 'cross-spawn';
import picocolors from 'picocolors';
const OSX_CHROME = 'google chrome';
diff --git a/node_modules/@pkgr/utils/lib/constants.js b/node_modules/@pkgr/utils/lib/constants.js
index a09c9b0..ea782f7 100644
--- a/node_modules/@pkgr/utils/lib/constants.js
+++ b/node_modules/@pkgr/utils/lib/constants.js
@@ -1,5 +1,5 @@
var _a;
-import { createRequire } from 'node:module';
+import { createRequire } from 'module';
export const DEV = 'development';
export const PROD = 'production';
export const NODE_ENV = (_a = process.env.NODE_ENV) !== null && _a !== void 0 ? _a : DEV;
diff --git a/node_modules/@pkgr/utils/lib/helpers.js b/node_modules/@pkgr/utils/lib/helpers.js
index 3caead9..de43f7f 100644
--- a/node_modules/@pkgr/utils/lib/helpers.js
+++ b/node_modules/@pkgr/utils/lib/helpers.js
@@ -1,5 +1,5 @@
-import fs from 'node:fs';
-import path from 'node:path';
+import fs from 'fs';
+import path from 'path';
import isGlob from 'is-glob';
import { CWD, EXTENSIONS, cjsRequire, SCRIPT_RUNNERS, SCRIPT_EXECUTORS, } from './constants.js';
export const tryPkg = (pkg) => {
diff --git a/node_modules/@pkgr/utils/lib/index.cjs b/node_modules/@pkgr/utils/lib/index.cjs
index 88c446f..0653a4a 100644
--- a/node_modules/@pkgr/utils/lib/index.cjs
+++ b/node_modules/@pkgr/utils/lib/index.cjs
@@ -1,12 +1,12 @@
'use strict';

-var node_child_process = require('node:child_process');
-var path = require('node:path');
-var node_url = require('node:url');
+var node_child_process = require('child_process');
+var path = require('path');
+var node_url = require('url');
var spawn = require('cross-spawn');
var picocolors = require('picocolors');
-var node_module = require('node:module');
-var fs = require('node:fs');
+var node_module = require('module');
+var fs = require('fs');
var isGlob = require('is-glob');

var __async = (__this, __arguments, generator) => {
diff --git a/node_modules/@pkgr/utils/lib/monorepo.js b/node_modules/@pkgr/utils/lib/monorepo.js
index 7126296..7166d1f 100644
--- a/node_modules/@pkgr/utils/lib/monorepo.js
+++ b/node_modules/@pkgr/utils/lib/monorepo.js
@@ -1,5 +1,5 @@
var _a, _b, _c, _d;
-import path from 'node:path';
+import path from 'path';
import { tryGlob, tryRequirePkg } from './helpers.js';
const pkg = (_a = tryRequirePkg(path.resolve('package.json'))) !== null && _a !== void 0 ? _a : {};
const lernaConfig = (_b = tryRequirePkg(path.resolve('lerna.json'))) !== null && _b !== void 0 ? _b : {};
121 changes: 119 additions & 2 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -4438,6 +4438,31 @@ __metadata:
languageName: node
linkType: hard

"@unts/patch-package@npm:^8.0.0":
version: 8.0.0
resolution: "@unts/patch-package@npm:8.0.0"
dependencies:
"@yarnpkg/lockfile": ^1.1.0
chalk: ^4.1.2
ci-info: ^3.7.0
cross-spawn: ^7.0.3
find-yarn-workspace-root: ^2.0.0
fs-extra: ^9.0.0
json-stable-stringify: ^1.0.2
klaw-sync: ^6.0.0
minimist: ^1.2.6
open: ^7.4.2
rimraf: ^2.6.3
semver: ^7.5.3
slash: ^2.0.0
tmp: ^0.0.33
yaml: ^2.2.2
bin:
patch-package: index.js
checksum: cbae0f30fb869c899e5fee29d12af279ef0fdf3d6f2c5a5cfb6ac8189f0d7da62e1aae1beec2c34073d9e482623c9ce989a7fcd44c103dcc3f023caf78a099d0
languageName: node
linkType: hard

"@vue/babel-helper-vue-jsx-merge-props@npm:^1.4.0":
version: 1.4.0
resolution: "@vue/babel-helper-vue-jsx-merge-props@npm:1.4.0"
Expand Down Expand Up @@ -4594,6 +4619,13 @@ __metadata:
languageName: node
linkType: hard

"@yarnpkg/lockfile@npm:^1.1.0":
version: 1.1.0
resolution: "@yarnpkg/lockfile@npm:1.1.0"
checksum: 76f3f2625334fb4d37881408643b61ae08e1cfcdeb5db3e3e92f626b3535f99e963df8bafe5c07d85aa1dd09a308939eb4d0667ed4a4e93e645417b6af6e9a2f
languageName: node
linkType: hard

"JSONStream@npm:^1.3.5":
version: 1.3.5
resolution: "JSONStream@npm:1.3.5"
Expand Down Expand Up @@ -5081,6 +5113,13 @@ __metadata:
languageName: node
linkType: hard

"at-least-node@npm:^1.0.0":
version: 1.0.0
resolution: "at-least-node@npm:1.0.0"
checksum: 8f33efc16287ed39766065c718a2d36a469f702c66c6eb41fa460c0c62bca395301a6a02946e315ae4a84c9cc7f44c94ec73a556bc2a1049350da98d0b013afe
languageName: node
linkType: hard

"atob@npm:^2.1.2":
version: 2.1.2
resolution: "atob@npm:2.1.2"
Expand Down Expand Up @@ -8242,6 +8281,15 @@ __metadata:
languageName: node
linkType: hard

"find-yarn-workspace-root@npm:^2.0.0":
version: 2.0.0
resolution: "find-yarn-workspace-root@npm:2.0.0"
dependencies:
micromatch: ^4.0.2
checksum: 21c2b76621c58ecb0aadfeb128ece1ece979a9c43aac6f91bb422b20ca5744e63300d175692bc1a9e7b9f2f949f865e0f3ec05efeeabb81447146e6b4ccf003a
languageName: node
linkType: hard

"flat-cache@npm:^3.0.4":
version: 3.2.0
resolution: "flat-cache@npm:3.2.0"
Expand Down Expand Up @@ -8346,6 +8394,18 @@ __metadata:
languageName: node
linkType: hard

"fs-extra@npm:^9.0.0":
version: 9.1.0
resolution: "fs-extra@npm:9.1.0"
dependencies:
at-least-node: ^1.0.0
graceful-fs: ^4.2.0
jsonfile: ^6.0.1
universalify: ^2.0.0
checksum: e667d8df54113b527bf5830dd9db8f142618db488894b329fe07724c7020dfacf8a372b144a74e683ae44e66f56117adca9cac165950dda7d83537c46c10dc4b
languageName: node
linkType: hard

"fs-minipass@npm:^2.0.0":
version: 2.1.0
resolution: "fs-minipass@npm:2.1.0"
Expand Down Expand Up @@ -9816,7 +9876,7 @@ __metadata:
languageName: node
linkType: hard

"is-wsl@npm:^2.2.0":
"is-wsl@npm:^2.1.1, is-wsl@npm:^2.2.0":
version: 2.2.0
resolution: "is-wsl@npm:2.2.0"
dependencies:
Expand Down Expand Up @@ -10665,6 +10725,18 @@ __metadata:
languageName: node
linkType: hard

"json-stable-stringify@npm:^1.0.2":
version: 1.1.0
resolution: "json-stable-stringify@npm:1.1.0"
dependencies:
call-bind: ^1.0.5
isarray: ^2.0.5
jsonify: ^0.0.1
object-keys: ^1.1.1
checksum: 62bfb878cda4e0afd8472a362616d182c0cd5993316f6c6ac4132eb4db712f15d789c3bc34641c656281a964aa9b102bc08d1e6529b6677260a919982c28a752
languageName: node
linkType: hard

"json5@npm:2.x, json5@npm:^2.2.3":
version: 2.2.3
resolution: "json5@npm:2.2.3"
Expand Down Expand Up @@ -10732,6 +10804,13 @@ __metadata:
languageName: node
linkType: hard

"jsonify@npm:^0.0.1":
version: 0.0.1
resolution: "jsonify@npm:0.0.1"
checksum: 70f1187d9041070c06388dc3be02fb2b4edef0d41575bc53f10d3edf04e2a39e55e9198e6ea2064aeab649792bb5592276709cc01fc985f063a0f85fd58a810a
languageName: node
linkType: hard

"jsonparse@npm:^1.2.0":
version: 1.3.1
resolution: "jsonparse@npm:1.3.1"
Expand Down Expand Up @@ -10794,6 +10873,15 @@ __metadata:
languageName: node
linkType: hard

"klaw-sync@npm:^6.0.0":
version: 6.0.0
resolution: "klaw-sync@npm:6.0.0"
dependencies:
graceful-fs: ^4.1.11
checksum: 40112f582d6b906ff556f2c8b67376bc1cad1939da981ac8265fcf6e46cad3bd521e7b9d1bd7e63016d744e7952eca4cb7a0da77466732c6b4e7fd51d42d76a4
languageName: node
linkType: hard

"kleur@npm:^3.0.3":
version: 3.0.3
resolution: "kleur@npm:3.0.3"
Expand Down Expand Up @@ -12956,6 +13044,16 @@ __metadata:
languageName: node
linkType: hard

"open@npm:^7.4.2":
version: 7.4.2
resolution: "open@npm:7.4.2"
dependencies:
is-docker: ^2.0.0
is-wsl: ^2.1.1
checksum: 07545fa768e5fbc25c6f53c6f17465f1b7ee663a494f87608d99a7b3227c83d2d2e0f0e5ecb70325b4ddef97dcd02d206f9afe3f8d6bb3d6612db9ca310ed4eb
languageName: node
linkType: hard

"open@npm:^9.1.0":
version: 9.1.0
resolution: "open@npm:9.1.0"
Expand Down Expand Up @@ -13631,6 +13729,7 @@ __metadata:
"@total-typescript/ts-reset": ^0.5.1
"@types/jest": ^29.5.11
"@types/mock-fs": ^4.13.4
"@unts/patch-package": ^8.0.0
chalk: ^4.1.2
clean-pkg-json: ^1.2.0
eslint: ^8.56.0
Expand Down Expand Up @@ -15142,6 +15241,17 @@ resolve@^2.0.0-next.4:
languageName: node
linkType: hard

"rimraf@npm:^2.6.3":
version: 2.7.1
resolution: "rimraf@npm:2.7.1"
dependencies:
glob: ^7.1.3
bin:
rimraf: ./bin.js
checksum: 059efac2838ef917d4d1da1d80e724ad28c120cdf14ca6ed27ca72db2dc70be3e25421cba5947c6ec3d804c1d2bb9a247254653816ee0722bf943ffdd1ae19ef
languageName: node
linkType: hard

"rimraf@npm:^3.0.0, rimraf@npm:^3.0.2":
version: 3.0.2
resolution: "rimraf@npm:3.0.2"
Expand Down Expand Up @@ -15624,6 +15734,13 @@ resolve@^2.0.0-next.4:
languageName: node
linkType: hard

"slash@npm:^2.0.0":
version: 2.0.0
resolution: "slash@npm:2.0.0"
checksum: 19b39a8b711b2820521ed23f915ecd86c6f1f64190a26ea2890367bcdbf6963b9f812c78dde91836cef67674f8463fe1cee1d58414716992f2949b102ffc57a1
languageName: node
linkType: hard

"slash@npm:^3.0.0":
version: 3.0.0
resolution: "slash@npm:3.0.0"
Expand Down Expand Up @@ -17797,7 +17914,7 @@ typescript@~4.4.4:
languageName: node
linkType: hard

"yaml@npm:^2.0.0":
"yaml@npm:^2.0.0, yaml@npm:^2.2.2":
version: 2.3.4
resolution: "yaml@npm:2.3.4"
checksum: c5f378790e172f8951d94c9076e16c3e678e2d3e93db6726fd6312b4e8c039fd02ed29ba3961fc634ceea6ddfe71d0bb75c6d16bdded02b50d91ee75d1df72ce
Expand Down

0 comments on commit 32fb365

Please sign in to comment.