tiktok / pnpm-sync Goto Github PK
View Code? Open in Web Editor NEWAutomatically resync injected dependencies when using the PNPM package manager
License: MIT License
Automatically resync injected dependencies when using the PNPM package manager
License: MIT License
The .pnpm-sync.json
file should contain a version
field so it can be invalidated and regenerated if its schema changes between versions of the pnpm-sync-lib
packages, or if an issue is identified and fixed.
I'm seeing an issue on my current local clone of https://github.com/microsoft/rushstack, where the build-tests-subspace/typescript-v4-test/node_modules/@rushstack/heft
folder is linked to the wrong location (see screenshot below) because the sourceFolder
property was generated with the wrong value.
The .pnpm-sync.json
file should have been regenerated after the bug creating the incorrect path was fixed, and that would have been easily identified if it contained a version field.
apps/heft/node_modules/.pnpm-sync.json
:
{
"postbuildInjectedCopy": {
"sourceFolder": "../..",
"targetFolders": [
{
"folderPath": "../../../../common/temp/node_modules/.pnpm/file+..+..+apps+heft/node_modules/@rushstack/heft"
},
{
"folderPath": "../../../common/temp/build-tests-subspace/node_modules/.pnpm/file+..+..+..+apps+heft_@[email protected]/node_modules/@rushstack/heft"
}
]
}
}
build-tests-subspace/typescript-v4-test/node_modules/@rushstack/heft
structure:
From https://github.com/microsoft/rushstack/pull/4530/files#r1504932679:
Also I would suggest to improve the formatting of the message:
pnpm-sync: Copied 107 files in 95ms from C:\Git\rushstack\libraries\terminal
It seems
pnpmSyncCopy()
is printing this message directly to the console. We should improve the API to provide a messaging callback that allows the output to be redirected and (ideally) optionally reformatted. Something like this:pnpmSyncCopy({ pnpmSyncJsonPath, messageCallback: ({ message, messageKind: 'error'|'warning'|'info'|'verbose'|'timing', messageId, details }) => { if (messageKind === 'verbose' && !debug) { return; } switch (messageId) { case 'sync-finished': // customized logging; the structure of details can depend on messageId terminal.writeLine(colors.green('pnpm-sync') + ` copied ${details.fileCount} files in ${details.totalMs} ms from ${details.sourcePath}`); break; default: // simple preformatted logging if (messageKind === 'error' | messageKind === 'warning') { console.error(message); } else { console.log(message); } break; } } })This would ensure that Rush (and in the future PNPM) has full ownership of its CLI UX.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.