File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -42,7 +42,8 @@ async function main() {
4242
4343 await writeFile ( outputPath , shrinkwrapContent , "utf-8" ) ;
4444
45- console . log ( `Successfully generated npm-shrinkwrap.json with ${ Object . keys ( shrinkwrap . packages ) . length - 1 } dependencies (excluding root)` ) ;
45+ console . log ( `Successfully generated npm-shrinkwrap.json with ` +
46+ `${ Object . keys ( shrinkwrap . packages ) . length - 1 } dependencies (excluding root)` ) ;
4647 console . log ( `Output written to: ${ outputPath } ` ) ;
4748 } catch ( error ) {
4849 console . error ( `Unexpected error: ${ error . message } ` ) ;
Original file line number Diff line number Diff line change @@ -30,7 +30,8 @@ export default async function convertPackageLockToShrinkwrap(workspaceRootDir, t
3030
3131 // Validate lockfile version - only support version 3
3232 if ( packageLockJson . lockfileVersion && packageLockJson . lockfileVersion !== 3 ) {
33- throw new Error ( `Unsupported lockfile version: ${ packageLockJson . lockfileVersion } . Only lockfile version 3 is supported` ) ;
33+ throw new Error ( `Unsupported lockfile version: ${ packageLockJson . lockfileVersion } . ` +
34+ `Only lockfile version 3 is supported` ) ;
3435 }
3536
3637 // Default to version 3 if not specified
@@ -115,6 +116,10 @@ function collectDependencies(node, relevantPackageLocations) {
115116
116117/**
117118 * Fetch package metadata from npm registry using pacote
119+ *
120+ * @param {string } packageName - Name of the package
121+ * @param {string } version - Version of the package
122+ * @returns {Promise<{resolved: string, integrity: string}> } - Resolved URL and integrity hash
118123 */
119124async function fetchPackageMetadata ( packageName , version ) {
120125 try {
Original file line number Diff line number Diff line change @@ -94,8 +94,10 @@ test("Compare generated shrinkwrap with expected result", async (t) => {
9494 console . log ( "=== TOP-LEVEL COMPARISON ===" ) ;
9595 console . log ( `Generated name: ${ generatedShrinkwrap . name } , Expected name: ${ expectedShrinkwrap . name } ` ) ;
9696 console . log ( `Generated version: ${ generatedShrinkwrap . version } , Expected version: ${ expectedShrinkwrap . version } ` ) ;
97- console . log ( `Generated lockfileVersion: ${ generatedShrinkwrap . lockfileVersion } , Expected lockfileVersion: ${ expectedShrinkwrap . lockfileVersion } ` ) ;
98- console . log ( `Generated requires: ${ generatedShrinkwrap . requires } , Expected requires: ${ expectedShrinkwrap . requires } ` ) ;
97+ console . log ( `Generated lockfileVersion: ${ generatedShrinkwrap . lockfileVersion } ,` +
98+ ` Expected lockfileVersion: ${ expectedShrinkwrap . lockfileVersion } ` ) ;
99+ console . log ( `Generated requires: ${ generatedShrinkwrap . requires } , ` +
100+ `Expected requires: ${ expectedShrinkwrap . requires } ` ) ;
99101
100102 // Compare root package entries
101103 console . log ( "\n=== ROOT PACKAGE COMPARISON ===" ) ;
You can’t perform that action at this time.
0 commit comments