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

Method constructor

lib/models/package-info-cache/package-info.js:60–89  ·  view source on GitHub ↗
(pkgObj, realPath, cache, isRoot = false)

Source from the content-addressed store, hash-verified

58 */
59class PackageInfo {
60 constructor(pkgObj, realPath, cache, isRoot = false) {
61 this.pkg = pkgObj;
62 this.pkg['ember-addon'] = this.pkg['ember-addon'] || {};
63 this.realPath = realPath;
64 this.cache = cache;
65 this.errors = new ErrorList();
66
67 // other fields that will be set as needed. For JIT we'll define
68 // them here.
69 this.addonMainPath = undefined; // addons only
70 this.inRepoAddons = undefined; // (list of PackageInfo - both)
71 this.internalAddons = undefined; // (list of PackageInfo - project only)
72 this.cliInfo = undefined; // (PackageInfo - project only)
73 this.dependencyPackages = undefined; // (obj keyed by dependency name: PackageInfo)
74 // NOTE: ALL dependencies, not just addons
75 this.devDependencyPackages = undefined; // (obj keyed by devDependency name: PackageInfo)
76 // NOTE: these are ALL dependencies, not just addons
77 this.nodeModules = undefined; // (NodeModulesList, set only if pkg contains node_modules)
78
79 // flag indicating that the packageInfo is considered valid. This will
80 // be true as long as we have a valid directory and our package.json file
81 // is okay and, if we're an ember addon, that we have a valid 'main' file.
82 // Missing dependencies will not be considered an error, since they may
83 // not actually be used.
84 this.valid = true;
85
86 this.mayHaveAddons = isRoot || this.isForAddon(); // mayHaveAddons used in index.js
87
88 this._hasDumpedInvalidAddonPackages = false;
89 }
90
91 // Make various fields of the pkg object available.
92 get name() {

Callers

nothing calls this directly

Calls 1

isForAddonMethod · 0.95

Tested by

no test coverage detected