mirror of
https://github.com/cosmos/cosmjs.git
synced 2025-03-10 21:49:15 +00:00
Merge pull request #1553 from cosmos/upgrade-yarn3
Upgrade yarn to latest version 3.x
This commit is contained in:
commit
49053d00fd
88
.pnp.cjs
generated
88
.pnp.cjs
generated
@ -16420,7 +16420,8 @@ class ZipFS extends BasePortableFakeFS {
|
|||||||
stream$1.destroy();
|
stream$1.destroy();
|
||||||
},
|
},
|
||||||
bytesRead: 0,
|
bytesRead: 0,
|
||||||
path: p
|
path: p,
|
||||||
|
pending: false
|
||||||
}
|
}
|
||||||
);
|
);
|
||||||
const immediate = setImmediate(async () => {
|
const immediate = setImmediate(async () => {
|
||||||
@ -16461,11 +16462,12 @@ class ZipFS extends BasePortableFakeFS {
|
|||||||
}
|
}
|
||||||
}),
|
}),
|
||||||
{
|
{
|
||||||
bytesWritten: 0,
|
|
||||||
path: p,
|
|
||||||
close() {
|
close() {
|
||||||
stream$1.destroy();
|
stream$1.destroy();
|
||||||
}
|
},
|
||||||
|
bytesWritten: 0,
|
||||||
|
path: p,
|
||||||
|
pending: false
|
||||||
}
|
}
|
||||||
);
|
);
|
||||||
stream$1.on(`data`, (chunk) => {
|
stream$1.on(`data`, (chunk) => {
|
||||||
@ -17405,18 +17407,10 @@ class ProxiedFS extends FakeFS {
|
|||||||
return this.baseFs.symlinkSync(mappedTarget, mappedP, type);
|
return this.baseFs.symlinkSync(mappedTarget, mappedP, type);
|
||||||
}
|
}
|
||||||
async readFilePromise(p, encoding) {
|
async readFilePromise(p, encoding) {
|
||||||
if (encoding === `utf8`) {
|
return this.baseFs.readFilePromise(this.fsMapToBase(p), encoding);
|
||||||
return this.baseFs.readFilePromise(this.fsMapToBase(p), encoding);
|
|
||||||
} else {
|
|
||||||
return this.baseFs.readFilePromise(this.fsMapToBase(p), encoding);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
readFileSync(p, encoding) {
|
readFileSync(p, encoding) {
|
||||||
if (encoding === `utf8`) {
|
return this.baseFs.readFileSync(this.fsMapToBase(p), encoding);
|
||||||
return this.baseFs.readFileSync(this.fsMapToBase(p), encoding);
|
|
||||||
} else {
|
|
||||||
return this.baseFs.readFileSync(this.fsMapToBase(p), encoding);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
async readdirPromise(p, opts) {
|
async readdirPromise(p, opts) {
|
||||||
return this.baseFs.readdirPromise(this.mapToBase(p), opts);
|
return this.baseFs.readdirPromise(this.mapToBase(p), opts);
|
||||||
@ -18142,24 +18136,14 @@ class ZipOpenFS extends BasePortableFakeFS {
|
|||||||
}
|
}
|
||||||
async readFilePromise(p, encoding) {
|
async readFilePromise(p, encoding) {
|
||||||
return this.makeCallPromise(p, async () => {
|
return this.makeCallPromise(p, async () => {
|
||||||
switch (encoding) {
|
return await this.baseFs.readFilePromise(p, encoding);
|
||||||
case `utf8`:
|
|
||||||
return await this.baseFs.readFilePromise(p, encoding);
|
|
||||||
default:
|
|
||||||
return await this.baseFs.readFilePromise(p, encoding);
|
|
||||||
}
|
|
||||||
}, async (zipFs, { subPath }) => {
|
}, async (zipFs, { subPath }) => {
|
||||||
return await zipFs.readFilePromise(subPath, encoding);
|
return await zipFs.readFilePromise(subPath, encoding);
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
readFileSync(p, encoding) {
|
readFileSync(p, encoding) {
|
||||||
return this.makeCallSync(p, () => {
|
return this.makeCallSync(p, () => {
|
||||||
switch (encoding) {
|
return this.baseFs.readFileSync(p, encoding);
|
||||||
case `utf8`:
|
|
||||||
return this.baseFs.readFileSync(p, encoding);
|
|
||||||
default:
|
|
||||||
return this.baseFs.readFileSync(p, encoding);
|
|
||||||
}
|
|
||||||
}, (zipFs, { subPath }) => {
|
}, (zipFs, { subPath }) => {
|
||||||
return zipFs.readFileSync(subPath, encoding);
|
return zipFs.readFileSync(subPath, encoding);
|
||||||
});
|
});
|
||||||
@ -18851,38 +18835,28 @@ function patchFs(patchedFs, fakeFs) {
|
|||||||
patchedFs.realpathSync.native = patchedFs.realpathSync;
|
patchedFs.realpathSync.native = patchedFs.realpathSync;
|
||||||
}
|
}
|
||||||
{
|
{
|
||||||
const origEmitWarning = process.emitWarning;
|
const patchedFsPromises = patchedFs.promises;
|
||||||
process.emitWarning = () => {
|
for (const fnName of ASYNC_IMPLEMENTATIONS) {
|
||||||
};
|
const origName = fnName.replace(/Promise$/, ``);
|
||||||
let patchedFsPromises;
|
if (typeof patchedFsPromises[origName] === `undefined`)
|
||||||
try {
|
continue;
|
||||||
patchedFsPromises = patchedFs.promises;
|
const fakeImpl = fakeFs[fnName];
|
||||||
} finally {
|
if (typeof fakeImpl === `undefined`)
|
||||||
process.emitWarning = origEmitWarning;
|
continue;
|
||||||
}
|
if (fnName === `open`)
|
||||||
if (typeof patchedFsPromises !== `undefined`) {
|
continue;
|
||||||
for (const fnName of ASYNC_IMPLEMENTATIONS) {
|
setupFn(patchedFsPromises, origName, (pathLike, ...args) => {
|
||||||
const origName = fnName.replace(/Promise$/, ``);
|
if (pathLike instanceof FileHandle) {
|
||||||
if (typeof patchedFsPromises[origName] === `undefined`)
|
return pathLike[origName].apply(pathLike, args);
|
||||||
continue;
|
} else {
|
||||||
const fakeImpl = fakeFs[fnName];
|
return fakeImpl.call(fakeFs, pathLike, ...args);
|
||||||
if (typeof fakeImpl === `undefined`)
|
}
|
||||||
continue;
|
|
||||||
if (fnName === `open`)
|
|
||||||
continue;
|
|
||||||
setupFn(patchedFsPromises, origName, (pathLike, ...args) => {
|
|
||||||
if (pathLike instanceof FileHandle) {
|
|
||||||
return pathLike[origName].apply(pathLike, args);
|
|
||||||
} else {
|
|
||||||
return fakeImpl.call(fakeFs, pathLike, ...args);
|
|
||||||
}
|
|
||||||
});
|
|
||||||
}
|
|
||||||
setupFn(patchedFsPromises, `open`, async (...args) => {
|
|
||||||
const fd = await fakeFs.openPromise(...args);
|
|
||||||
return new FileHandle(fd, fakeFs);
|
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
setupFn(patchedFsPromises, `open`, async (...args) => {
|
||||||
|
const fd = await fakeFs.openPromise(...args);
|
||||||
|
return new FileHandle(fd, fakeFs);
|
||||||
|
});
|
||||||
}
|
}
|
||||||
{
|
{
|
||||||
patchedFs.read[nodeUtils.promisify.custom] = async (fd, buffer, ...args) => {
|
patchedFs.read[nodeUtils.promisify.custom] = async (fd, buffer, ...args) => {
|
||||||
@ -25129,7 +25103,7 @@ function makeManager(pnpapi, opts) {
|
|||||||
apiEntry.lastRefreshCheck = timeNow;
|
apiEntry.lastRefreshCheck = timeNow;
|
||||||
const stats = opts.fakeFs.statSync(pnpApiPath);
|
const stats = opts.fakeFs.statSync(pnpApiPath);
|
||||||
if (stats.mtime > apiEntry.stats.mtime) {
|
if (stats.mtime > apiEntry.stats.mtime) {
|
||||||
process.emitWarning(`[Warning] The runtime detected new informations in a PnP file; reloading the API instance (${npath.fromPortablePath(pnpApiPath)})`);
|
process.emitWarning(`[Warning] The runtime detected new information in a PnP file; reloading the API instance (${npath.fromPortablePath(pnpApiPath)})`);
|
||||||
apiEntry.stats = stats;
|
apiEntry.stats = stats;
|
||||||
apiEntry.instance = loadApiInstance(pnpApiPath);
|
apiEntry.instance = loadApiInstance(pnpApiPath);
|
||||||
}
|
}
|
||||||
|
73
.pnp.loader.mjs
generated
73
.pnp.loader.mjs
generated
@ -1190,18 +1190,10 @@ class ProxiedFS extends FakeFS {
|
|||||||
return this.baseFs.symlinkSync(mappedTarget, mappedP, type);
|
return this.baseFs.symlinkSync(mappedTarget, mappedP, type);
|
||||||
}
|
}
|
||||||
async readFilePromise(p, encoding) {
|
async readFilePromise(p, encoding) {
|
||||||
if (encoding === `utf8`) {
|
return this.baseFs.readFilePromise(this.fsMapToBase(p), encoding);
|
||||||
return this.baseFs.readFilePromise(this.fsMapToBase(p), encoding);
|
|
||||||
} else {
|
|
||||||
return this.baseFs.readFilePromise(this.fsMapToBase(p), encoding);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
readFileSync(p, encoding) {
|
readFileSync(p, encoding) {
|
||||||
if (encoding === `utf8`) {
|
return this.baseFs.readFileSync(this.fsMapToBase(p), encoding);
|
||||||
return this.baseFs.readFileSync(this.fsMapToBase(p), encoding);
|
|
||||||
} else {
|
|
||||||
return this.baseFs.readFileSync(this.fsMapToBase(p), encoding);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
async readdirPromise(p, opts) {
|
async readdirPromise(p, opts) {
|
||||||
return this.baseFs.readdirPromise(this.mapToBase(p), opts);
|
return this.baseFs.readdirPromise(this.mapToBase(p), opts);
|
||||||
@ -1333,7 +1325,7 @@ const HAS_CONSOLIDATED_HOOKS = major > 16 || major === 16 && minor >= 12;
|
|||||||
const HAS_UNFLAGGED_JSON_MODULES = major > 17 || major === 17 && minor >= 5 || major === 16 && minor >= 15;
|
const HAS_UNFLAGGED_JSON_MODULES = major > 17 || major === 17 && minor >= 5 || major === 16 && minor >= 15;
|
||||||
const HAS_JSON_IMPORT_ASSERTION_REQUIREMENT = major > 17 || major === 17 && minor >= 1 || major === 16 && minor > 14;
|
const HAS_JSON_IMPORT_ASSERTION_REQUIREMENT = major > 17 || major === 17 && minor >= 1 || major === 16 && minor > 14;
|
||||||
const WATCH_MODE_MESSAGE_USES_ARRAYS = major > 19 || major === 19 && minor >= 2 || major === 18 && minor >= 13;
|
const WATCH_MODE_MESSAGE_USES_ARRAYS = major > 19 || major === 19 && minor >= 2 || major === 18 && minor >= 13;
|
||||||
const HAS_LAZY_LOADED_TRANSLATORS = major > 19 || major === 19 && minor >= 3;
|
const HAS_LAZY_LOADED_TRANSLATORS = major === 20 && minor < 6 || major === 19 && minor >= 3;
|
||||||
|
|
||||||
const builtinModules = new Set(Module.builtinModules || Object.keys(process.binding(`natives`)));
|
const builtinModules = new Set(Module.builtinModules || Object.keys(process.binding(`natives`)));
|
||||||
const isBuiltinModule = (request) => request.startsWith(`node:`) || builtinModules.has(request);
|
const isBuiltinModule = (request) => request.startsWith(`node:`) || builtinModules.has(request);
|
||||||
@ -2012,31 +2004,46 @@ async function resolve$1(originalSpecifier, context, nextResolve) {
|
|||||||
|
|
||||||
if (!HAS_LAZY_LOADED_TRANSLATORS) {
|
if (!HAS_LAZY_LOADED_TRANSLATORS) {
|
||||||
const binding = process.binding(`fs`);
|
const binding = process.binding(`fs`);
|
||||||
const originalfstat = binding.fstat;
|
const originalReadFile = binding.readFileUtf8 || binding.readFileSync;
|
||||||
const ZIP_MASK = 4278190080;
|
if (originalReadFile) {
|
||||||
const ZIP_MAGIC = 704643072;
|
binding[originalReadFile.name] = function(...args) {
|
||||||
binding.fstat = function(...args) {
|
|
||||||
const [fd, useBigint, req] = args;
|
|
||||||
if ((fd & ZIP_MASK) === ZIP_MAGIC && useBigint === false && req === void 0) {
|
|
||||||
try {
|
try {
|
||||||
const stats = fs.fstatSync(fd);
|
return fs.readFileSync(args[0], {
|
||||||
return new Float64Array([
|
encoding: `utf8`,
|
||||||
stats.dev,
|
flag: args[1]
|
||||||
stats.mode,
|
});
|
||||||
stats.nlink,
|
|
||||||
stats.uid,
|
|
||||||
stats.gid,
|
|
||||||
stats.rdev,
|
|
||||||
stats.blksize,
|
|
||||||
stats.ino,
|
|
||||||
stats.size,
|
|
||||||
stats.blocks
|
|
||||||
]);
|
|
||||||
} catch {
|
} catch {
|
||||||
}
|
}
|
||||||
}
|
return originalReadFile.apply(this, args);
|
||||||
return originalfstat.apply(this, args);
|
};
|
||||||
};
|
} else {
|
||||||
|
const binding2 = process.binding(`fs`);
|
||||||
|
const originalfstat = binding2.fstat;
|
||||||
|
const ZIP_MASK = 4278190080;
|
||||||
|
const ZIP_MAGIC = 704643072;
|
||||||
|
binding2.fstat = function(...args) {
|
||||||
|
const [fd, useBigint, req] = args;
|
||||||
|
if ((fd & ZIP_MASK) === ZIP_MAGIC && useBigint === false && req === void 0) {
|
||||||
|
try {
|
||||||
|
const stats = fs.fstatSync(fd);
|
||||||
|
return new Float64Array([
|
||||||
|
stats.dev,
|
||||||
|
stats.mode,
|
||||||
|
stats.nlink,
|
||||||
|
stats.uid,
|
||||||
|
stats.gid,
|
||||||
|
stats.rdev,
|
||||||
|
stats.blksize,
|
||||||
|
stats.ino,
|
||||||
|
stats.size,
|
||||||
|
stats.blocks
|
||||||
|
]);
|
||||||
|
} catch {
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return originalfstat.apply(this, args);
|
||||||
|
};
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
const resolve = resolve$1;
|
const resolve = resolve$1;
|
||||||
|
874
.yarn/releases/yarn-3.6.3.cjs
vendored
874
.yarn/releases/yarn-3.6.3.cjs
vendored
File diff suppressed because one or more lines are too long
875
.yarn/releases/yarn-3.8.0.cjs
vendored
Executable file
875
.yarn/releases/yarn-3.8.0.cjs
vendored
Executable file
File diff suppressed because one or more lines are too long
@ -13,4 +13,4 @@ plugins:
|
|||||||
|
|
||||||
pnpMode: loose
|
pnpMode: loose
|
||||||
|
|
||||||
yarnPath: .yarn/releases/yarn-3.6.3.cjs
|
yarnPath: .yarn/releases/yarn-3.8.0.cjs
|
||||||
|
@ -50,5 +50,5 @@
|
|||||||
"prettier": "^2.8.8",
|
"prettier": "^2.8.8",
|
||||||
"typescript": "~4.9"
|
"typescript": "~4.9"
|
||||||
},
|
},
|
||||||
"packageManager": "yarn@3.6.3"
|
"packageManager": "yarn@3.8.0"
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user