Giter VIP home page Giter VIP logo

pnpm-sync's People

Contributors

chengcyber avatar g-chao avatar iclanton avatar octogonz avatar

Stargazers

 avatar

Watchers

 avatar  avatar  avatar  avatar

Forkers

iclanton

pnpm-sync's Issues

`.pnpm-sync.json` should be versioned.

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:
image

[pnpm-sync-lib] Improve approach to console logging

From https://github.com/microsoft/rushstack/pull/4530/files#r1504932679:

image

  1. Also I would suggest to improve the formatting of the message:

    pnpm-sync: Copied 107 files in 95ms from C:\Git\rushstack\libraries\terminal
    
  2. 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.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.