MCPcopy Index your code
hub / github.com/ember-cli/ember-cli / create

Method create

tests/helpers/package-cache.js:571–600  ·  view source on GitHub ↗

* The `create` method adds a new package cache entry. * * @method create * @param {String} label The label for the cache. * @param {String} type The type of package cache. * @param {String} manifest The contents of the manifest file for the cache. * @param {Array} links Packages to

(label, type, manifest, links)

Source from the content-addressed store, hash-verified

569 * @return {String} The directory on disk which contains the cache.
570 */
571 create(label, type, manifest, links) {
572 links = links || [];
573
574 // Save metadata about the PackageCache invocation in the manifest.
575 let packageManagerVersion = commands[type].invoke('--version').stdout;
576
577 let jsonManifest = JSON.parse(manifest);
578 jsonManifest._packageCache = {
579 node: process.version,
580 packageManager: type,
581 packageManagerVersion,
582 links,
583 };
584
585 manifest = JSON.stringify(jsonManifest);
586
587 // Compare any existing manifest to the ideal per current blueprint.
588 let identical = this._checkManifest(label, type, manifest);
589
590 if (identical) {
591 // Use what we have, but opt in to SemVer drift.
592 this._upgrade(label, type);
593 } else {
594 // Tell the package manager to start semi-fresh.
595 this._writeManifest(label, type, manifest);
596 this._install(label, type);
597 }
598
599 return this.dirs[label];
600 }
601
602 /**
603 * The `update` method aliases the `create` method.

Callers 15

linkDependenciesFunction · 0.95
test-helper.tsFile · 0.80
constructorMethod · 0.80
addonCommandsMethod · 0.80
addon.jsFile · 0.80
clearFunction · 0.80
initFunction · 0.80
discoverAddonsFunction · 0.80
addDependenciesMethod · 0.80
generateAddonPackagesMethod · 0.80
constructorMethod · 0.80
_clearMethod · 0.80

Calls 5

_checkManifestMethod · 0.95
_upgradeMethod · 0.95
_writeManifestMethod · 0.95
_installMethod · 0.95
invokeMethod · 0.80

Tested by

no test coverage detected