@@ -157,7 +157,7 @@ class Package {
157
157
* src: {
158
158
* type: 'url',
159
159
* url: string,
160
- * sha1?: string
160
+ * sha1?: string,
161
161
* } | {
162
162
* type: 'local',
163
163
* },
@@ -211,17 +211,17 @@ class Package {
211
211
const parsedUrl = new URL ( resolved ) ;
212
212
// prettier-ignore
213
213
if ( [ 'registry.yarnpkg.com' , 'registry.npmjs.org' ] . includes ( parsedUrl . host ) ) {
214
- src = {
214
+ src = {
215
215
sha1 : parsedUrl . hash . slice ( 1 ) , // cut off the first ('#') character
216
- url : parsedUrl . origin + parsedUrl . pathname ,
216
+ url : parsedUrl . origin + parsedUrl . pathname ,
217
217
type : 'url' ,
218
218
} ;
219
219
} else {
220
- src = {
220
+ src = {
221
221
sha1 : undefined , // We don't provide sha in order to force to override it manually
222
- url : parsedUrl . origin + parsedUrl . pathname ,
222
+ url : parsedUrl . origin + parsedUrl . pathname ,
223
223
type : 'url' ,
224
- } ;
224
+ } ;
225
225
}
226
226
} else if ( isPath ( pkgInfo . version ) ) {
227
227
src = { type : 'local' } ;
@@ -259,7 +259,7 @@ class Package {
259
259
260
260
// Override case, for hosted modules
261
261
if ( this . host ) {
262
- return ` "${ this . renderKey ( ) } " =
262
+ return ` "${ this . renderKey ( ) } " =
263
263
self."${ this . key . toString ( ) } ".override {
264
264
host = { scope = "${ this . host . id . scope || '' } "; name = "${ this . host . id . name } "; };
265
265
modules = [
@@ -313,8 +313,8 @@ class Package {
313
313
/** @type {string | undefined } */
314
314
const name = ! path . extname ( url )
315
315
? `abort ''
316
-
317
-
316
+
317
+
318
318
Failed to recognise the type of the archive of the \`${ this . renderKey ( ) } \` package served from
319
319
\`${ url } \`
320
320
@@ -329,47 +329,47 @@ class Package {
329
329
};
330
330
});
331
331
}
332
-
332
+
333
333
''`
334
334
: undefined ;
335
335
return `self.fetchurl { ${
336
336
name
337
337
? `
338
338
name = ${ name } ;`
339
339
: ''
340
- }
341
- url = "${ url } ";
340
+ }
341
+ url = "${ url } ";
342
342
${
343
343
sha1
344
344
? `sha1 = "${ sha1 } "`
345
345
: `sha256 = abort ''
346
-
347
-
346
+
347
+
348
348
Failed to infer \`sha256\` hash of the \`${ this . renderKey ( ) } \` package source from
349
349
\`${ url } \`.
350
350
351
351
Override \`"${ this . renderKey ( ) } ".src.sha256\` attribute in order to provide this missing piece to Nix.
352
352
For example:
353
-
353
+
354
354
self: super: {
355
355
"${ this . renderKey ( ) } " = super."${ this . renderKey ( ) } ".override (x: {
356
356
# The sha256 value is obtained via
357
357
# nix-prefetch-url ${ url }
358
- src = x.src.override {
358
+ src = x.src.override {
359
359
sha256 = "<sha256>";
360
360
};
361
361
});
362
362
}
363
363
364
364
''`
365
- } ;
365
+ } ;
366
366
}` ;
367
367
368
368
case 'local' :
369
369
return `abort ''
370
-
371
-
372
- The \`${ this . renderKey ( ) } \` package is a local package. Override the \`"${ this . renderKey ( ) } ".src\` attribute
370
+
371
+
372
+ The \`${ this . renderKey ( ) } \` package is a local package. Override the \`"${ this . renderKey ( ) } ".src\` attribute
373
373
in order to point Nix to the source of the package. For example:
374
374
375
375
self: super: {
@@ -479,7 +479,7 @@ function generateDepTree(lock) {
479
479
* cycles will be non-granular and the rest of the dependency tree will be granular.
480
480
* Please note that such cycles are a quite rare case, however, it still needs to be
481
481
* handled appropriately.
482
- *
482
+ *
483
483
* This function traverses the tree in order to fix up dependency cycles in a way that
484
484
* the package that is an entry point to a dependency cycle hosts the dependencies that are
485
485
* part of the cycle inside of it.
@@ -493,24 +493,24 @@ function generateDepTree(lock) {
493
493
* tree by cloning and modifying dependencies C and D so they will be hosted by package B. That
494
494
* means that the dependency tree will contain two versions of package C and D: the original ones
495
495
* and the ones that are modified to be hosted by B.
496
- *
496
+ *
497
497
* Original packages have identifiers made of their name and version. In the example above the
498
498
* original C package will be identified as:
499
- *
499
+ *
500
500
501
- *
501
+ *
502
502
* Hosted packages have identifiers of form <HOST>+<PACKAGE>. In the example above the hosted
503
503
* C package will be identified as:
504
- *
504
+ *
505
505
506
- *
506
+ *
507
507
* The hosted C package will refer to hosted dependencies appropriately. For example it will depend
508
508
* on the hosted D package identified as [email protected] [email protected] package, but not the original D package
509
509
* identified as [email protected] .
510
510
* The hosted D package, which depends on B, will identify it as:
511
- *
511
+ *
512
512
513
- *
513
+ *
514
514
* that doesn't refer to the source of package [email protected] but rather indicates that the hosted package
515
515
* needs to depend on its host. This type of package identifier is called a 'stub'. This is how a
516
516
* cycle is broken so the dependency tree can be installed by Nix.
@@ -580,7 +580,7 @@ function hostDependencyCycles(tree) {
580
580
* Modifies the dependency tree in a way that the package that is an entry point
581
581
* to a dependency cycle, hosts cycled dependencies inside a single Nix derivation,
582
582
* so Nix can handle it.
583
- *
583
+ *
584
584
* @param {string[] } cycle - path of the cycle, where the first and thte last elements
585
585
* are the same node with, potentially, different host
586
586
*/
@@ -623,9 +623,9 @@ function hostDependencyCycles(tree) {
623
623
}
624
624
625
625
/**
626
- * Resolves package alias to it's direct name withinn the context of a
626
+ * Resolves package alias to it's direct name withinn the context of a
627
627
* particular yarn.lock file.
628
- *
628
+ *
629
629
* @example
630
630
* resolveRef('toposort@^2.0.2', tree) // -> '[email protected] ';
631
631
*
0 commit comments