From 4db0839e9136e0aeada360b05f98b2844985b30d Mon Sep 17 00:00:00 2001 From: Kurdistan Tech Ministry Date: Tue, 21 Apr 2026 18:53:18 +0300 Subject: [PATCH] chore: migrate git dependencies to Gitea mirror (git.pezkuwichain.io) --- package.json | 6 ++-- packages/dev-test/package.json | 6 ++-- packages/dev-ts/package.json | 6 ++-- packages/dev/package.json | 8 ++--- packages/dev/scripts/pezkuwi-dev-build-ts.mjs | 33 ++++++++++++------- 5 files changed, 34 insertions(+), 25 deletions(-) diff --git a/package.json b/package.json index 28ca3ab..d0f59af 100644 --- a/package.json +++ b/package.json @@ -1,16 +1,16 @@ { "author": "Pezkuwi Team ", - "bugs": "https://github.com/pezkuwichain/pezkuwi-dev/issues", + "bugs": "https://git.pezkuwichain.io/pezkuwichain/pezkuwi-dev/issues", "engines": { "node": ">=18.14" }, - "homepage": "https://github.com/pezkuwichain/pezkuwi-dev#readme", + "homepage": "https://git.pezkuwichain.io/pezkuwichain/pezkuwi-dev#readme", "license": "Apache-2.0", "packageManager": "yarn@4.6.0", "private": true, "repository": { "type": "git", - "url": "https://github.com/pezkuwichain/pezkuwi-dev.git" + "url": "https://git.pezkuwichain.io/pezkuwichain/pezkuwi-dev.git" }, "sideEffects": false, "type": "module", diff --git a/packages/dev-test/package.json b/packages/dev-test/package.json index 5e4032b..3d26684 100644 --- a/packages/dev-test/package.json +++ b/packages/dev-test/package.json @@ -1,17 +1,17 @@ { "author": "Pezkuwi Team ", - "bugs": "https://github.com/pezkuwichain/pezkuwi-dev/issues", + "bugs": "https://git.pezkuwichain.io/pezkuwichain/pezkuwi-dev/issues", "description": "A basic test-functions-as-global library on top of node:test", "engines": { "node": ">=18.14" }, - "homepage": "https://github.com/pezkuwichain/pezkuwi-dev/tree/master/packages/dev-test#readme", + "homepage": "https://git.pezkuwichain.io/pezkuwichain/pezkuwi-dev/tree/master/packages/dev-test#readme", "license": "Apache-2.0", "name": "@pezkuwi/dev-test", "repository": { "directory": "packages/dev-test", "type": "git", - "url": "https://github.com/pezkuwichain/pezkuwi-dev.git" + "url": "https://git.pezkuwichain.io/pezkuwichain/pezkuwi-dev.git" }, "sideEffects": false, "type": "module", diff --git a/packages/dev-ts/package.json b/packages/dev-ts/package.json index ca5a37a..3da1ca8 100644 --- a/packages/dev-ts/package.json +++ b/packages/dev-ts/package.json @@ -1,17 +1,17 @@ { "author": "Pezkuwi Team ", - "bugs": "https://github.com/pezkuwichain/pezkuwi-dev/issues", + "bugs": "https://git.pezkuwichain.io/pezkuwichain/pezkuwi-dev/issues", "description": "An TS -> ESM loader for Node >= 16.12", "engines": { "node": ">=18" }, - "homepage": "https://github.com/pezkuwichain/pezkuwi-dev/tree/master/packages/dev-ts#readme", + "homepage": "https://git.pezkuwichain.io/pezkuwichain/pezkuwi-dev/tree/master/packages/dev-ts#readme", "license": "Apache-2.0", "name": "@pezkuwi/dev-ts", "repository": { "directory": "packages/dev-ts", "type": "git", - "url": "https://github.com/pezkuwichain/pezkuwi-dev.git" + "url": "https://git.pezkuwichain.io/pezkuwichain/pezkuwi-dev.git" }, "sideEffects": false, "type": "module", diff --git a/packages/dev/package.json b/packages/dev/package.json index a10ad53..f2e104e 100644 --- a/packages/dev/package.json +++ b/packages/dev/package.json @@ -1,22 +1,22 @@ { "author": "Pezkuwi Team ", - "bugs": "https://github.com/pezkuwichain/pezkuwi-dev/issues", + "bugs": "https://git.pezkuwichain.io/pezkuwichain/pezkuwi-dev/issues", "description": "A collection of shared CI scripts and development environment used by @pezkuwi projects", "engines": { "node": ">=18" }, - "homepage": "https://github.com/pezkuwichain/pezkuwi-dev/tree/master/packages/dev#readme", + "homepage": "https://git.pezkuwichain.io/pezkuwichain/pezkuwi-dev/tree/master/packages/dev#readme", "license": "Apache-2.0", "name": "@pezkuwi/dev", "repository": { "directory": "packages/dev", "type": "git", - "url": "https://github.com/pezkuwichain/pezkuwi-dev.git" + "url": "https://git.pezkuwichain.io/pezkuwichain/pezkuwi-dev.git" }, "sideEffects": false, "type": "module", "types": "./index.d.ts", - "version": "0.85.5", + "version": "0.85.11", "main": "./cjs/index.js", "module": "./index.js", "bin": { diff --git a/packages/dev/scripts/pezkuwi-dev-build-ts.mjs b/packages/dev/scripts/pezkuwi-dev-build-ts.mjs index e78af49..3c5c694 100755 --- a/packages/dev/scripts/pezkuwi-dev-build-ts.mjs +++ b/packages/dev/scripts/pezkuwi-dev-build-ts.mjs @@ -363,24 +363,24 @@ function rewriteImports (dir, pkgCwd, pkgJson, replacer) { .filter((line) => !line.startsWith('//')) .map((line) => line - // handle import/export - .replace(/(import|export) (.*) from '(.*)'/g, (o, t, a, f) => { + // handle import/export (use [^']* to avoid capturing 'json' from with { type: 'json' }) + .replace(/(import|export) (.*) from '([^']*)'/g, (o, t, a, f) => { const adjusted = replacer(pkgCwd, pkgJson, dir, f); return adjusted ? `${t} ${a} from '${adjusted}'` : o; }) - // handle augmented inputs - .replace(/(import|declare module) '(.*)'/g, (o, t, f) => { + // handle augmented inputs (use [^']* to avoid capturing quotes from import attributes) + .replace(/(import|declare module) '([^']*)'/g, (o, t, f) => { const adjusted = replacer(pkgCwd, pkgJson, dir, f, t !== 'import'); return adjusted ? `${t} '${adjusted}'` : o; }) - // handle dynamic imports - .replace(/( import|^import)\('(.*)'\)/g, (o, t, f) => { + // handle dynamic imports (use [^']* for consistency) + .replace(/( import|^import)\('([^']*)'\)/g, (o, t, f) => { const adjusted = replacer(pkgCwd, pkgJson, dir, f); return adjusted @@ -445,7 +445,10 @@ function buildDeno () { * @returns {string} */ function relativePath (value) { - return `${value && value.startsWith('.') ? value : './'}${value}`.replace(/\/\//g, '/'); + if (!value || typeof value !== 'string') { + return ''; + } + return value.startsWith('.') ? value : `./${value}`; } /** @@ -643,7 +646,7 @@ function findFiles (buildDir, extra = '', exclude = []) { .readdirSync(currDir) .filter((f) => !exclude.includes(f)) .reduce((/** @type {[string, Record | string][]} */ all, jsName) => { - const jsPath = `${extra}/${jsName}`; + const jsPath = extra ? `${extra}/${jsName}` : jsName; const fullPathEsm = path.join(buildDir, jsPath); if (fs.statSync(fullPathEsm).isDirectory()) { @@ -788,11 +791,14 @@ function buildExports () { } if (pkg.main) { - const main = pkg.main.startsWith('./') + let main = pkg.main.startsWith('./') ? pkg.main : `./${pkg.main}`; - // Only add ./cjs/ prefix if main doesn't already start with ./cjs/ + // Strip ./build/ prefix if present (source package.json may have ./build/cjs/index.js) + main = main.replace(/^\.\/build\//, './'); + + // Add ./cjs/ prefix if not already present (for CJS entry point) pkg.main = main.startsWith('./cjs/') ? main : main.replace(/^\.\//, './cjs/'); pkg.module = main; pkg.types = main.replace('.js', '.d.ts'); @@ -803,11 +809,14 @@ function buildExports () { const value = pkg[k]; if (typeof value === 'string') { - const entry = value.startsWith('./') + let entry = value.startsWith('./') ? value : `./${value}`; - // Only add ./cjs/ prefix if entry doesn't already start with ./cjs/ + // Strip ./build/ prefix if present + entry = entry.replace(/^\.\/build\//, './'); + + // Add ./cjs/ prefix if not already present pkg[k] = entry.startsWith('./cjs/') ? entry : entry.replace(/^\.\//, './cjs/'); } });