Skip to content

Commit 0ebc118

Browse files
committed
Formatting
1 parent df5f033 commit 0ebc118

File tree

1 file changed

+31
-31
lines changed

1 file changed

+31
-31
lines changed

lib/print.js

Lines changed: 31 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -157,7 +157,7 @@ class Package {
157157
* src: {
158158
* type: 'url',
159159
* url: string,
160-
* sha1?: string
160+
* sha1?: string,
161161
* } | {
162162
* type: 'local',
163163
* },
@@ -211,17 +211,17 @@ class Package {
211211
const parsedUrl = new URL(resolved);
212212
// prettier-ignore
213213
if (['registry.yarnpkg.com', 'registry.npmjs.org'].includes(parsedUrl.host)) {
214-
src = {
214+
src = {
215215
sha1: parsedUrl.hash.slice(1), // cut off the first ('#') character
216-
url: parsedUrl.origin + parsedUrl.pathname,
216+
url: parsedUrl.origin + parsedUrl.pathname,
217217
type: 'url',
218218
};
219219
} else {
220-
src = {
220+
src = {
221221
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,
223223
type: 'url',
224-
};
224+
};
225225
}
226226
} else if (isPath(pkgInfo.version)) {
227227
src = { type: 'local' };
@@ -259,7 +259,7 @@ class Package {
259259

260260
// Override case, for hosted modules
261261
if (this.host) {
262-
return ` "${this.renderKey()}" =
262+
return ` "${this.renderKey()}" =
263263
self."${this.key.toString()}".override {
264264
host = { scope = "${this.host.id.scope || ''}"; name = "${this.host.id.name}"; };
265265
modules = [
@@ -313,8 +313,8 @@ class Package {
313313
/** @type {string | undefined} */
314314
const name = !path.extname(url)
315315
? `abort ''
316-
317-
316+
317+
318318
Failed to recognise the type of the archive of the \`${this.renderKey()}\` package served from
319319
\`${url}\`
320320
@@ -329,47 +329,47 @@ class Package {
329329
};
330330
});
331331
}
332-
332+
333333
''`
334334
: undefined;
335335
return `self.fetchurl { ${
336336
name
337337
? `
338338
name = ${name};`
339339
: ''
340-
}
341-
url = "${url}";
340+
}
341+
url = "${url}";
342342
${
343343
sha1
344344
? `sha1 = "${sha1}"`
345345
: `sha256 = abort ''
346-
347-
346+
347+
348348
Failed to infer \`sha256\` hash of the \`${this.renderKey()}\` package source from
349349
\`${url}\`.
350350
351351
Override \`"${this.renderKey()}".src.sha256\` attribute in order to provide this missing piece to Nix.
352352
For example:
353-
353+
354354
self: super: {
355355
"${this.renderKey()}" = super."${this.renderKey()}".override (x: {
356356
# The sha256 value is obtained via
357357
# nix-prefetch-url ${url}
358-
src = x.src.override {
358+
src = x.src.override {
359359
sha256 = "<sha256>";
360360
};
361361
});
362362
}
363363
364364
''`
365-
};
365+
};
366366
}`;
367367

368368
case 'local':
369369
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
373373
in order to point Nix to the source of the package. For example:
374374
375375
self: super: {
@@ -479,7 +479,7 @@ function generateDepTree(lock) {
479479
* cycles will be non-granular and the rest of the dependency tree will be granular.
480480
* Please note that such cycles are a quite rare case, however, it still needs to be
481481
* handled appropriately.
482-
*
482+
*
483483
* This function traverses the tree in order to fix up dependency cycles in a way that
484484
* the package that is an entry point to a dependency cycle hosts the dependencies that are
485485
* part of the cycle inside of it.
@@ -493,24 +493,24 @@ function generateDepTree(lock) {
493493
* tree by cloning and modifying dependencies C and D so they will be hosted by package B. That
494494
* means that the dependency tree will contain two versions of package C and D: the original ones
495495
* and the ones that are modified to be hosted by B.
496-
*
496+
*
497497
* Original packages have identifiers made of their name and version. In the example above the
498498
* original C package will be identified as:
499-
*
499+
*
500500
501-
*
501+
*
502502
* Hosted packages have identifiers of form <HOST>+<PACKAGE>. In the example above the hosted
503503
* C package will be identified as:
504-
*
504+
*
505505
506-
*
506+
*
507507
* The hosted C package will refer to hosted dependencies appropriately. For example it will depend
508508
* on the hosted D package identified as [email protected][email protected] package, but not the original D package
509509
* identified as [email protected].
510510
* The hosted D package, which depends on B, will identify it as:
511-
*
511+
*
512512
513-
*
513+
*
514514
* that doesn't refer to the source of package [email protected] but rather indicates that the hosted package
515515
* needs to depend on its host. This type of package identifier is called a 'stub'. This is how a
516516
* cycle is broken so the dependency tree can be installed by Nix.
@@ -580,7 +580,7 @@ function hostDependencyCycles(tree) {
580580
* Modifies the dependency tree in a way that the package that is an entry point
581581
* to a dependency cycle, hosts cycled dependencies inside a single Nix derivation,
582582
* so Nix can handle it.
583-
*
583+
*
584584
* @param {string[]} cycle - path of the cycle, where the first and thte last elements
585585
* are the same node with, potentially, different host
586586
*/
@@ -623,9 +623,9 @@ function hostDependencyCycles(tree) {
623623
}
624624

625625
/**
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
627627
* particular yarn.lock file.
628-
*
628+
*
629629
* @example
630630
* resolveRef('toposort@^2.0.2', tree) // -> '[email protected]';
631631
*

0 commit comments

Comments
 (0)