yarn icon indicating copy to clipboard operation
yarn copied to clipboard

publish updates to @yarnpkg/lockfile

Open peey opened this issue 2 years ago • 5 comments

There have been several updates to lockfile logic: https://github.com/yarnpkg/yarn/commits/a75dbe36ca7f6d881d291a7231676d00d523bb39/src/lockfile

But it hasn't been published since 1.1.0 or since 2018: https://www.npmjs.com/package/@yarnpkg/lockfile/v/1.1.0

peey avatar Nov 02 '21 13:11 peey

you might want to look at @yarnpkg/parsers instead

naugtur avatar May 25 '22 09:05 naugtur

@naugtur that isn't published either :(

thebigredgeek avatar Mar 21 '23 20:03 thebigredgeek

I used it. It's probably scoped

naugtur avatar Mar 21 '23 20:03 naugtur

https://www.npmjs.com/package/@yarnpkg/parsers

naugtur avatar Mar 23 '23 11:03 naugtur

Just a small bump to this issue.

https://www.npmjs.com/package/@yarnpkg/parsers

It has 0 documentation, and it looks like one cannot parse a lockfile using it

@yarnpkg/lockfile

It is still not updated.

Note that TypeScript declaration are too up-to-date in https://github.com/DefinitelyTyped/DefinitelyTyped/blob/master/types/yarnpkg__lockfile/index.d.ts

And version 1.1.0 of this declaration (https://github.com/DefinitelyTyped/DefinitelyTyped/blob/0773a10d017be0e80e473c16a9623487fdb4f4f0/types/yarnpkg__lockfile/index.d.ts) are wrong, I had to use the following declaration:

declare module '@yarnpkg/lockfile' {
    interface Dependency {
        [packageName: string]: string;
    }

    interface FirstLevelDependency {
        version: string;
        resolved?: string;
        dependencies?: Dependency;
    }

    interface LockFileObject {
        [packageName: string]: FirstLevelDependency;
    }

    // function parse(file: string): { object: LockFileObject }
    // export = parse

    namespace _exported { function parse(file: string): { object: LockFileObject } }
    export = _exported;
}

homersimpsons avatar Dec 05 '23 16:12 homersimpsons