diff --git a/api/api.js b/api/api.js index c4e4c54..63b5e6c 100644 --- a/api/api.js +++ b/api/api.js @@ -7,7 +7,6 @@ YUI.add("yuidoc-meta", function(Y) { "Builder", "CLI", "Command", - "CommandGenerator", "DefaultPackager", "EmberAddon", "EmberApp", @@ -16,10 +15,9 @@ YUI.add("yuidoc-meta", function(Y) { "Instrumentation", "NodeModulesList", "NpmTask", - "PackageCache", "PackageInfo", "PackageInfoCache", - "PrivateTestHelpers", + "PerBundleAddonCache", "Project", "ServeFilesAddon", "TestsServerAddon", diff --git a/api/classes/Addon.html b/api/classes/Addon.html index 7f2e9c6..fa01886 100644 --- a/api/classes/Addon.html +++ b/api/classes/Addon.html @@ -42,7 +42,6 @@

Classes

  • Builder
  • CLI
  • Command
  • -
  • CommandGenerator
  • DefaultPackager
  • EmberAddon
  • EmberApp
  • @@ -51,10 +50,9 @@

    Classes

  • Instrumentation
  • NodeModulesList
  • NpmTask
  • -
  • PackageCache
  • PackageInfo
  • PackageInfoCache
  • -
  • PrivateTestHelpers
  • +
  • PerBundleAddonCache
  • Project
  • ServeFilesAddon
  • TestsServerAddon
  • @@ -152,8 +150,6 @@

    Addon

  • _findHost
  • _shouldCompilePodTemplates
  • _treeFor
  • -
  • _warn
  • -
  • addonJsFiles
  • compileAddon
  • compileStyles
  • compileTemplates
  • @@ -172,14 +168,14 @@

    Addon

    - Version: 3.21.2 + Version: 5.4.0-a905f346b9
    @@ -449,7 +445,7 @@

    Method Summary

    config(env, baseConfig): Object
    -

    Augments the applications configuration settings.

    +

    Augments the application's configuration settings.

    @@ -985,7 +981,7 @@

    Method Summary

    _shouldCompilePodTemplates( ): Boolean
    -

    Looks in the addon/ and addon/templates trees to determine if template files exists in the pods format that need to be precompiled.

    +

    Looks in the addon/ and addon/templates trees to determine if template files exist in the pods format that need to be precompiled.

    @@ -1009,36 +1005,6 @@

    Method Summary

    private - - -
    - _warn( ) -
    -
    - -
    - - - - - private - - - - -
    - addonJsFiles( ): Tree -
    -
    -

    Returns a tree containing the addon's js files

    -
    - - - - - private - -
    @@ -1135,7 +1101,7 @@

    Method Summary

    jshintAddonTree( ): Tree
    -

    Returns a tree with JSHhint output for all addon JS.

    +

    Returns a tree with JSHint output for all addon JS.

    @@ -1180,7 +1146,7 @@

    Method Summary

    shouldCompileTemplates( ): Boolean
    -

    Looks in the addon/ and addon/templates trees to determine if template files exists that need to be precompiled.

    +

    Looks in the addon/ and addon/templates trees to determine if template files exist that need to be precompiled.

    @@ -1212,7 +1178,7 @@

    Method Summary

    Public Constructors

    - lib/models/addon.js:137 + lib/models/addon.js:122

    public @@ -1280,7 +1246,7 @@

    Parameters:

    Public Properties

    - lib/models/addon.js:223 + lib/models/addon.js:208

    public @@ -1298,7 +1264,7 @@

    - lib/models/addon.js:188 + lib/models/addon.js:173

    public @@ -1317,7 +1283,7 @@

    - lib/models/addon.js:170 + lib/models/addon.js:155

    public @@ -1333,7 +1299,7 @@

    - lib/models/addon.js:210 + lib/models/addon.js:195

    public @@ -1352,7 +1318,7 @@

    - lib/models/addon.js:245 + lib/models/addon.js:230

    public @@ -1368,7 +1334,7 @@

    - lib/models/addon.js:201 + lib/models/addon.js:186

    public @@ -1384,7 +1350,7 @@

    - lib/models/addon.js:179 + lib/models/addon.js:164

    public @@ -1400,7 +1366,7 @@

    - lib/models/addon.js:235 + lib/models/addon.js:220

    public @@ -1423,7 +1389,7 @@

    Public Methods

    - lib/models/addon.js:1347 + lib/models/addon.js:1278

    public @@ -1456,7 +1422,7 @@

    Example:

    - lib/models/addon.js:1646 + lib/models/addon.js:1576

    public @@ -1515,7 +1481,7 @@

    Example:

    - lib/models/addon.js:674 + lib/models/addon.js:640

    public @@ -1577,7 +1543,7 @@

    Return:

    - lib/models/addon.js:1365 + lib/models/addon.js:1296

    public @@ -1588,7 +1554,7 @@

    -

    Augments the applications configuration settings.

    +

    Augments the application's configuration settings.

    Object returned from this hook is merged with the application's configuration object.

    Application's configuration always take precedence.

    Uses:

    @@ -1597,7 +1563,6 @@

    Uses:

    • For example
        -
      • minifyJS
      • storeConfigInMeta
      • et, al
      @@ -1672,7 +1637,7 @@

      Example:

    - lib/models/addon.js:1723 + lib/models/addon.js:1653

    public @@ -1755,7 +1720,7 @@

    Example:

    - lib/models/addon.js:1405 + lib/models/addon.js:1335

    public @@ -1782,7 +1747,7 @@

    Return:

    - lib/models/addon.js:343 + lib/models/addon.js:320

    public @@ -1813,7 +1778,7 @@

    - lib/models/addon.js:367 + lib/models/addon.js:344

    public @@ -1834,7 +1799,7 @@

    - lib/models/addon.js:772 + lib/models/addon.js:738

    public @@ -1936,7 +1901,7 @@

    Parameters:

    - lib/models/addon.js:1480 + lib/models/addon.js:1410

    public @@ -1994,7 +1959,7 @@

    Example:

    - lib/models/addon.js:739 + lib/models/addon.js:705

    public @@ -2057,7 +2022,7 @@

    Example:

    - lib/models/addon.js:1456 + lib/models/addon.js:1386

    public @@ -2099,7 +2064,7 @@

    Example:

    - lib/models/addon.js:254 + lib/models/addon.js:239

    public @@ -2169,7 +2134,7 @@

    Example:

    - lib/models/addon.js:396 + lib/models/addon.js:373

    public @@ -2200,7 +2165,7 @@

    Return:

    - lib/models/addon.js:1415 + lib/models/addon.js:1345

    public @@ -2227,7 +2192,7 @@

    Return:

    - lib/models/addon.js:1704 + lib/models/addon.js:1634

    public @@ -2302,7 +2267,7 @@

    Example:

    - lib/models/addon.js:1332 + lib/models/addon.js:1263

    public @@ -2330,7 +2295,7 @@

    Return:

    - lib/models/addon.js:1629 + lib/models/addon.js:1559

    public @@ -2394,7 +2359,7 @@

    Example:

    - lib/models/addon.js:1613 + lib/models/addon.js:1543

    public @@ -2452,7 +2417,7 @@

    Parameters:

    - lib/models/addon.js:1538 + lib/models/addon.js:1468

    public @@ -2528,7 +2493,7 @@

    Example:

    - lib/models/addon.js:1605 + lib/models/addon.js:1535

    public @@ -2577,7 +2542,7 @@

    Parameters:

    - lib/models/addon.js:1524 + lib/models/addon.js:1454

    public @@ -2652,7 +2617,7 @@

    Return:

    - lib/models/addon.js:1551 + lib/models/addon.js:1481

    public @@ -2734,7 +2699,7 @@

    Example:

    - lib/models/addon.js:1662 + lib/models/addon.js:1592

    public @@ -2829,7 +2794,7 @@

    Example:

    - lib/models/addon.js:1424 + lib/models/addon.js:1354

    public @@ -2901,7 +2866,7 @@

    Example:

    - lib/models/addon.js:1590 + lib/models/addon.js:1520

    public @@ -2956,7 +2921,7 @@

    Parameters:

    - lib/models/addon.js:586 + lib/models/addon.js:552

    public @@ -3029,7 +2994,7 @@

    Return:

    - lib/models/addon.js:828 + lib/models/addon.js:794

    public @@ -3084,22 +3049,19 @@

    Return:

    Example:

    treeForAddon() {
    -  var tree = this._super.treeForAddon.apply(this, arguments);
    -  var checker = new VersionChecker(this);
    -  var isOldEmber = checker.for('ember', 'bower').lt('1.13.0');
    +  let emberVersion = new VersionChecker(this.project).for('ember-source');
    +  let shouldUsePolyfill = emberVersion.lt('4.5.0-alpha.4');
     
    -  if (isOldEmber) {
    -    tree = new Funnel(tree, { exclude: [ /instance-initializers/ ] });
    +  if (shouldUsePolyfill) {
    +    return this._super.treeForAddon.apply(this, arguments);
       }
    -
    -  return tree;
     }
     
    - lib/models/addon.js:816 + lib/models/addon.js:782

    public @@ -3155,7 +3117,7 @@

    Return:

    - lib/models/addon.js:925 + lib/models/addon.js:888

    public @@ -3210,7 +3172,7 @@

    Return:

    - lib/models/addon.js:792 + lib/models/addon.js:758

    public @@ -3266,7 +3228,7 @@

    Return:

    - lib/models/addon.js:905 + lib/models/addon.js:868

    public @@ -3322,7 +3284,7 @@

    Return:

    - lib/models/addon.js:862 + lib/models/addon.js:825

    public @@ -3379,7 +3341,7 @@

    Return:

    - lib/models/addon.js:804 + lib/models/addon.js:770

    public @@ -3435,7 +3397,7 @@

    Return:

    - lib/models/addon.js:893 + lib/models/addon.js:856

    public @@ -3491,7 +3453,7 @@

    Return:

    - lib/models/addon.js:881 + lib/models/addon.js:844

    public @@ -3552,7 +3514,7 @@

    Return:

    Private Methods

    - lib/models/addon.js:506 + lib/models/addon.js:484

    private @@ -3615,7 +3577,7 @@

    Parameters:

    - lib/models/addon.js:716 + lib/models/addon.js:682

    private @@ -3638,7 +3600,7 @@

    - lib/models/addon.js:998 + lib/models/addon.js:961

    private @@ -3650,7 +3612,7 @@

    Looks in the addon/ and addon/templates trees to determine if template files -exists in the pods format that need to be precompiled.

    +exist in the pods format that need to be precompiled.

    This is executed once when building, but not on rebuilds.

    @@ -3668,7 +3630,7 @@

    Return:

    - lib/models/addon.js:652 + lib/models/addon.js:618

    private @@ -3719,60 +3681,10 @@

    Return:

    -
    -
    -
    - lib/models/addon.js:574 -

    - private - - - _warn( ) -

    -
    - - - -
    - - - - -
    -
    -
    - lib/models/addon.js:1269 -

    - private - - - addonJsFiles( ): Tree -

    -
    - - -
    -

    Deprecated: This method is deprecated.

    -
    - -

    Returns a tree containing the addon's js files

    -
    - - -
    -

    Return:

    -
    - Tree -

    The filtered addon js files

    -
    -
    -
    - -
    - lib/models/addon.js:1149 + lib/models/addon.js:1113

    private @@ -3829,7 +3741,7 @@

    Return:

    - lib/models/addon.js:960 + lib/models/addon.js:922

    private @@ -3886,7 +3798,7 @@

    Return:

    - lib/models/addon.js:1116 + lib/models/addon.js:1079

    private @@ -3943,7 +3855,7 @@

    Return:

    - lib/models/addon.js:382 + lib/models/addon.js:359

    private @@ -4014,7 +3926,7 @@

    Return:

    - lib/models/addon.js:434 + lib/models/addon.js:409

    private @@ -4038,7 +3950,7 @@

    - lib/models/addon.js:481 + lib/models/addon.js:459

    private @@ -4101,7 +4013,7 @@

    Parameters:

    - lib/models/addon.js:1203 + lib/models/addon.js:1157

    private @@ -4112,7 +4024,7 @@

    -

    Returns a tree with JSHhint output for all addon JS.

    +

    Returns a tree with JSHint output for all addon JS.

    @@ -4129,7 +4041,7 @@

    Return:

    - lib/models/addon.js:1286 + lib/models/addon.js:1223

    private @@ -4157,7 +4069,7 @@

    Return:

    - lib/models/addon.js:1297 + lib/models/addon.js:1234

    private @@ -4214,7 +4126,7 @@

    Return:

    - lib/models/addon.js:984 + lib/models/addon.js:947

    private @@ -4226,7 +4138,7 @@

    Looks in the addon/ and addon/templates trees to determine if template files -exists that need to be precompiled.

    +exist that need to be precompiled.

    This is executed once when building, but not on rebuilds.

    @@ -4244,7 +4156,7 @@

    Return:

    - lib/models/addon.js:539 + lib/models/addon.js:517

    private diff --git a/api/classes/AmdTransformAddon.html b/api/classes/AmdTransformAddon.html index 0eb15b1..72d62c6 100644 --- a/api/classes/AmdTransformAddon.html +++ b/api/classes/AmdTransformAddon.html @@ -42,7 +42,6 @@

    Classes

  • Builder
  • CLI
  • Command
  • -
  • CommandGenerator
  • DefaultPackager
  • EmberAddon
  • EmberApp
  • @@ -51,10 +50,9 @@

    Classes

  • Instrumentation
  • NodeModulesList
  • NpmTask
  • -
  • PackageCache
  • PackageInfo
  • PackageInfoCache
  • -
  • PrivateTestHelpers
  • +
  • PerBundleAddonCache
  • Project
  • ServeFilesAddon
  • TestsServerAddon
  • @@ -100,14 +98,14 @@

    AmdTransformAddon

    - Version: 3.21.2 + Version: 5.4.0-a905f346b9
    @@ -163,7 +161,7 @@

    Constructor Summary

    Public Constructors

    @@ -182,14 +185,14 @@

    Blueprint

    - Version: 3.21.2 + Version: 5.4.0-a905f346b9
    @@ -360,7 +363,7 @@

    Static Method Summary

    - load(blueprintPath): Blueprint + load(blueprintPath, [blueprintOptions]): Blueprint

    Loads a blueprint from given path.

    @@ -479,7 +482,7 @@

    Constructor Summary

    - Blueprint([blueprintPath]) + Blueprint([blueprintPath], [blueprintOptions])

    A blueprint is a bundle of template files with optional install logic.

    @@ -495,6 +498,30 @@

    Constructor Summary

    Property Summary

    + + + + + + + + + + + + +
    Public Properties
    + public + + + + +
    +

    Indicates whether or not a blueprint is a candidate for automatic transpilation from TS to JS. This property could be false in the case that the blueprint is written in JS and is not intended to work with TS at all, OR in the case that the blueprint is written in TS and the author does not intend to support transpilation to JS.

    +
    +
    @@ -566,36 +593,6 @@

    Method Summary

    public - - - - - - - - - @@ -1162,6 +1159,21 @@

    Method Summary

    private + + + + + + + + + + + + + + + + + + + + @@ -1568,7 +1623,7 @@

    Return:

    - lib/models/blueprint.js:1268 + lib/models/blueprint.js:1379

    public static @@ -1644,6 +1699,20 @@

    Parameters:

    + + + + + + @@ -1668,12 +1737,12 @@

    Return:

    Public Constructors

    - lib/models/blueprint.js:30 + lib/models/blueprint.js:29

    public - Blueprint([blueprintPath]) + Blueprint([blueprintPath], [blueprintOptions])

    @@ -1706,6 +1775,19 @@

    Parameters:

    + + + + + + +
    -
    - addBowerPackagesToProject(packages, installOptions): Promise -
    -
    -

    Used to add an array of packages to the projects bower.json.

    -
    -
    - public - - - -
    - addBowerPackageToProject(localPackageName, target, installOptions): Promise -
    -
    -

    Used to add a package to the projects bower.json.

    -
    -
    - public - -
    @@ -719,7 +716,7 @@

    Method Summary

    - files( ): Array + files(options): Array

    Used to retrieve files for blueprint.

    @@ -947,7 +944,7 @@

    Method Summary

    taskFor(dasherizedName)
    -

    Used to retrieve a task with the given name. Passes the new task the standard information available (like ui, analytics, project, etc).

    +

    Used to retrieve a task with the given name. Passes the new task the standard information available (like ui, project, etc).

    +
    + _processOptions(options) +
    +
    +

    Process the options object coming from either the init, install or uninstall hook.

    +
    +
    + private + +
    @@ -1192,6 +1204,21 @@

    Method Summary

    private +
    +
    + convertToJS(fileInfo): Promise +
    +
    + +
    +
    + private + +
    @@ -1357,6 +1384,21 @@

    Method Summary

    private +
    +
    + shouldConvertToJS(options, fileInfo): Boolean +
    +
    + +
    +
    + private + +
    @@ -1374,7 +1416,7 @@

    Method Summary

    Static Public Properties

    - lib/models/blueprint.js:1401 + lib/models/blueprint.js:1524

    public static @@ -1389,7 +1431,7 @@

    - lib/models/blueprint.js:1389 + lib/models/blueprint.js:1512

    public static @@ -1404,7 +1446,7 @@

    - lib/models/blueprint.js:1395 + lib/models/blueprint.js:1518

    public static @@ -1419,7 +1461,7 @@

    - lib/models/blueprint.js:1374 + lib/models/blueprint.js:1497

    public static @@ -1445,7 +1487,7 @@

    Static Public Methods

    - lib/models/blueprint.js:1325 + lib/models/blueprint.js:1448

    public static @@ -1512,12 +1554,12 @@

    Return:

    - lib/models/blueprint.js:1298 + lib/models/blueprint.js:1420

    public static - load(blueprintPath): Blueprint + load(blueprintPath, [blueprintOptions]): Blueprint

    @@ -1546,6 +1588,19 @@

    Parameters:

    + +
    blueprintOptionsObject +
      +
    • optional
    • + +

    Throw a SilentError if a matching Blueprint could not be found

    +
    options.blueprintOptionsObject +
      +
    • optional
    • + + +
    +

    Options object that will be passed +along to the Blueprint instance on creation.

    blueprintOptionsObject +
      +
    • optional
    • + + +
    +
    @@ -1717,13 +1799,35 @@

    Parameters:

    +
    +

    Public Properties

    +
    +
    + lib/models/blueprint.js:198 +

    + public + + + shouldTransformTypeScript: Boolean +

    +
    + + +

    Indicates whether or not a blueprint is a candidate for automatic transpilation from TS to JS. +This property could be false in the case that the blueprint is written in JS and is not intended +to work with TS at all, OR in the case that the blueprint is written in TS and the author does +not intend to support transpilation to JS.

    +
    + +
    +

    Private Properties

    - lib/models/blueprint.js:299 + lib/models/blueprint.js:330

    private @@ -1743,7 +1847,7 @@

    Public Methods

    - lib/models/blueprint.js:1083 + lib/models/blueprint.js:1164

    public @@ -1802,7 +1906,7 @@

    Return:

    - lib/models/blueprint.js:1063 + lib/models/blueprint.js:1144

    public @@ -1858,177 +1962,10 @@

    Return:

    -
    -
    -
    - lib/models/blueprint.js:1026 -

    - public - - - addBowerPackagesToProject(packages, installOptions): Promise -

    -
    - - - -

    Used to add an array of packages to the projects bower.json.

    -

    Generally, this would be done from the afterInstall hook, to -ensure that a package that is required by a given blueprint is -available.

    -

    Expects each array item to be an object with a name. Each object -may optionally have a target to specify a specific version, or a -source to specify a non-local name to be resolved.

    -
    - -
    -

    Parameters:

    - - - - - - - - - - - - - - - - - - - - - - - - - -
    NameTypeAttributeDescription
    packagesArray -
      - - - -
    -
    installOptionsObject -
      - - - -
    -
    -
    - -
    -

    Return:

    -
    - Promise - -
    -
    - - -
    -
    -
    - lib/models/blueprint.js:996 -

    - public - - - addBowerPackageToProject(localPackageName, target, installOptions): Promise -

    -
    - - - -

    Used to add a package to the projects bower.json.

    -

    Generally, this would be done from the afterInstall hook, to -ensure that a package that is required by a given blueprint is -available.

    -

    localPackageName and target may be thought of as equivalent -to the key-value pairs in the dependency or devDepencency -objects contained within a bower.json file.

    -
    - -
    -

    Parameters:

    - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    NameTypeAttributeDescription
    localPackageNameString -
      - - - -
    -
    targetString -
      - - - -
    -
    installOptionsObject -
      - - - -
    -
    -
    - -
    -

    Return:

    -
    - Promise - -
    -
    - - -

    Example:

    -
    addBowerPackageToProject('jquery', '~1.11.1');
    -addBowerPackageToProject('old_jquery', 'jquery#~1.9.1');
    -addBowerPackageToProject('bootstrap-3', 'https://twitter.github.io/bootstrap/assets/bootstrap');
    -
    -
    - lib/models/blueprint.js:889 + lib/models/blueprint.js:1037

    public @@ -2095,7 +2032,7 @@

    Example:

    - lib/models/blueprint.js:867 + lib/models/blueprint.js:1015

    public @@ -2166,7 +2103,7 @@

    Return:

    - lib/models/blueprint.js:500 + lib/models/blueprint.js:599

    public @@ -2193,7 +2130,7 @@

    Return:

    - lib/models/blueprint.js:514 + lib/models/blueprint.js:613

    public @@ -2220,7 +2157,7 @@

    Return:

    - lib/models/blueprint.js:493 + lib/models/blueprint.js:592

    public @@ -2247,7 +2184,7 @@

    Return:

    - lib/models/blueprint.js:507 + lib/models/blueprint.js:606

    public @@ -2274,7 +2211,7 @@

    Return:

    - lib/models/blueprint.js:657 + lib/models/blueprint.js:756

    public @@ -2354,7 +2291,7 @@

    Return:

    - lib/models/blueprint.js:558 + lib/models/blueprint.js:657

    public @@ -2395,12 +2332,12 @@

    Return:

    - lib/models/blueprint.js:222 + lib/models/blueprint.js:252

    public - files( ): Array + files(options): Array

    @@ -2409,6 +2346,34 @@

    Used to retrieve files for blueprint.

    +
    +

    Parameters:

    + + + + + + + + + + + + + + + + + + +
    NameTypeAttributeDescription
    optionsObject +
      + + + +
    +
    +

    Return:

    @@ -2423,7 +2388,7 @@

    Return:

    - lib/models/blueprint.js:205 + lib/models/blueprint.js:235

    public @@ -2483,7 +2448,7 @@

    Return:

    - lib/models/blueprint.js:642 + lib/models/blueprint.js:741

    public @@ -2538,7 +2503,7 @@

    Return:

    - lib/models/blueprint.js:1147 + lib/models/blueprint.js:1258

    public @@ -2561,11 +2526,11 @@

    will be inserted at the end of the file.

    Example:

    // app/router.js
    -Router.map(function() {
    +Router.map(function () {
     });
     
    insertIntoFile('app/router.js', '  this.route("admin");', {
    -  after: 'Router.map(function() {' + EOL
    +  after: 'Router.map(function () {' + EOL
     }).then(function() {
       // file has been inserted into!
     });
    @@ -2573,7 +2538,7 @@ 

    // app/router.js
    -Router.map(function() {
    +Router.map(function () {
       this.route("admin");
     });
     
    @@ -2646,7 +2611,7 @@

    Return:

    - lib/models/blueprint.js:438 + lib/models/blueprint.js:543

    public @@ -2700,7 +2665,7 @@

    Return:

    - lib/models/blueprint.js:678 + lib/models/blueprint.js:777

    public @@ -2726,7 +2691,7 @@

    Return:

    - lib/models/blueprint.js:523 + lib/models/blueprint.js:622

    public @@ -2800,7 +2765,7 @@

    Return:

    - lib/models/blueprint.js:1251 + lib/models/blueprint.js:1362

    public @@ -2855,7 +2820,7 @@

    Return:

    - lib/models/blueprint.js:775 + lib/models/blueprint.js:923

    public @@ -2922,7 +2887,7 @@

    Return:

    - lib/models/blueprint.js:253 + lib/models/blueprint.js:284

    public @@ -2983,7 +2948,7 @@

    Return:

    - lib/models/blueprint.js:740 + lib/models/blueprint.js:839

    public @@ -3050,7 +3015,7 @@

    Return:

    - lib/models/blueprint.js:762 + lib/models/blueprint.js:872

    public @@ -3110,7 +3075,7 @@

    Parameters:

    - lib/models/blueprint.js:938 + lib/models/blueprint.js:1086

    public @@ -3168,7 +3133,7 @@

    Return:

    - lib/models/blueprint.js:955 + lib/models/blueprint.js:1103

    public @@ -3227,7 +3192,7 @@

    Return:

    - lib/models/blueprint.js:244 + lib/models/blueprint.js:275

    public @@ -3282,7 +3247,7 @@

    Return:

    - lib/models/blueprint.js:1129 + lib/models/blueprint.js:1241

    public @@ -3294,7 +3259,7 @@

    Used to retrieve a task with the given name. Passes the new task -the standard information available (like ui, analytics, project, etc).

    +the standard information available (like ui, project, etc).

    @@ -3331,7 +3296,7 @@

    Parameters:

    - lib/models/blueprint.js:468 + lib/models/blueprint.js:570

    public @@ -3390,7 +3355,7 @@

    Return:

    Private Methods

    - lib/models/blueprint.js:726 + lib/models/blueprint.js:825

    private @@ -3450,7 +3415,7 @@

    Parameters:

    - lib/models/blueprint.js:355 + lib/models/blueprint.js:386

    private @@ -3470,7 +3435,7 @@

    - lib/models/blueprint.js:383 + lib/models/blueprint.js:414

    private @@ -3517,7 +3482,7 @@

    Parameters:

    - lib/models/blueprint.js:337 + lib/models/blueprint.js:368

    private @@ -3580,7 +3545,7 @@

    Throws:

    - lib/models/blueprint.js:586 + lib/models/blueprint.js:685

    private @@ -3634,7 +3599,7 @@

    Return:

    - lib/models/blueprint.js:804 + lib/models/blueprint.js:952

    private @@ -3714,7 +3679,7 @@

    Return:

    - lib/models/blueprint.js:688 + lib/models/blueprint.js:787

    private @@ -3795,7 +3760,7 @@

    Return:

    - lib/models/blueprint.js:713 + lib/models/blueprint.js:812

    private @@ -3850,7 +3815,7 @@

    Return:

    - lib/models/blueprint.js:700 + lib/models/blueprint.js:799

    private @@ -3870,7 +3835,7 @@

    - lib/models/blueprint.js:834 + lib/models/blueprint.js:982

    private @@ -3924,7 +3889,7 @@

    Return:

    - lib/models/blueprint.js:372 + lib/models/blueprint.js:403

    private @@ -3971,7 +3936,7 @@

    Parameters:

    - lib/models/blueprint.js:412 + lib/models/blueprint.js:443

    private @@ -4054,10 +4019,59 @@

    Parameters:

    +
    +
    +
    + lib/models/blueprint.js:219 +

    + private + + + _processOptions(options) +

    +
    + + + +

    Process the options object coming from either +the init, install or uninstall hook.

    +
    + +
    +

    Parameters:

    + + + + + + + + + + + + + + + + + + +
    NameTypeAttributeDescription
    optionsObject +
      + + + +
    +
    +
    + + +
    - lib/models/blueprint.js:287 + lib/models/blueprint.js:318

    private @@ -4111,7 +4125,7 @@

    Return:

    - lib/models/blueprint.js:273 + lib/models/blueprint.js:304

    private @@ -4182,10 +4196,64 @@

    Parameters:

    +
    +
    +
    + lib/models/blueprint.js:523 +

    + private + + + convertToJS(fileInfo): Promise +

    +
    + + + +
    + +
    +

    Parameters:

    + + + + + + + + + + + + + + + + + + +
    NameTypeAttributeDescription
    fileInfoFileInfo +
      + + + +
    +
    +
    + +
    +

    Return:

    +
    + Promise + +
    +
    + +
    - lib/models/blueprint.js:1546 + lib/models/blueprint.js:1669

    private @@ -4212,7 +4280,7 @@

    Return:

    - lib/models/blueprint.js:1442 + lib/models/blueprint.js:1565

    private @@ -4279,7 +4347,7 @@

    Return:

    - lib/models/blueprint.js:1468 + lib/models/blueprint.js:1591

    private @@ -4335,7 +4403,7 @@

    Return:

    - lib/models/blueprint.js:1559 + lib/models/blueprint.js:1682

    private @@ -4390,7 +4458,7 @@

    Return:

    - lib/models/blueprint.js:1483 + lib/models/blueprint.js:1606

    private @@ -4446,7 +4514,7 @@

    Return:

    - lib/models/blueprint.js:1536 + lib/models/blueprint.js:1659

    private @@ -4500,7 +4568,7 @@

    Return:

    - lib/models/blueprint.js:1456 + lib/models/blueprint.js:1579

    private @@ -4554,7 +4622,7 @@

    Return:

    - lib/models/blueprint.js:1522 + lib/models/blueprint.js:1645

    private @@ -4608,7 +4676,7 @@

    Return:

    - lib/models/blueprint.js:1422 + lib/models/blueprint.js:1545

    private @@ -4655,7 +4723,7 @@

    Parameters:

    - lib/models/blueprint.js:1433 + lib/models/blueprint.js:1556

    private @@ -4702,7 +4770,7 @@

    Parameters:

    - lib/models/blueprint.js:1409 + lib/models/blueprint.js:1532

    private @@ -4753,10 +4821,77 @@

    Return:

    +
    +
    +
    + lib/models/blueprint.js:469 +

    + private + + + shouldConvertToJS(options, fileInfo): Boolean +

    +
    + + + +
    + +
    +

    Parameters:

    + + + + + + + + + + + + + + + + + + + + + + + + + +
    NameTypeAttributeDescription
    optionsObject +
      + + + +
    +
    fileInfoFileInfo +
      + + + +
    +
    +
    + +
    +

    Return:

    +
    + Boolean + +
    +
    + +
    - lib/models/blueprint.js:792 + lib/models/blueprint.js:940

    private diff --git a/api/classes/Builder.html b/api/classes/Builder.html index e6b92ff..f887bad 100644 --- a/api/classes/Builder.html +++ b/api/classes/Builder.html @@ -42,7 +42,6 @@

    Classes

  • Builder
  • CLI
  • Command
  • -
  • CommandGenerator
  • DefaultPackager
  • EmberAddon
  • EmberApp
  • @@ -51,10 +50,9 @@

    Classes

  • Instrumentation
  • NodeModulesList
  • NpmTask
  • -
  • PackageCache
  • PackageInfo
  • PackageInfoCache
  • -
  • PrivateTestHelpers
  • +
  • PerBundleAddonCache
  • Project
  • ServeFilesAddon
  • TestsServerAddon
  • @@ -107,7 +105,7 @@

    Builder

    - Version: 3.21.2 + Version: 5.4.0-a905f346b9
    @@ -283,7 +281,7 @@

    Method Summary

    Private Methods

    - lib/models/builder.js:164 + lib/models/builder.js:169

    private @@ -309,7 +307,7 @@

    Return:

    - lib/models/builder.js:93 + lib/models/builder.js:98

    private @@ -367,7 +365,7 @@

    Return:

    - lib/models/builder.js:265 + lib/models/builder.js:276

    private @@ -391,7 +389,7 @@

    - lib/models/builder.js:233 + lib/models/builder.js:244

    private @@ -418,7 +416,7 @@

    Return:

    - lib/models/builder.js:115 + lib/models/builder.js:120

    private @@ -465,7 +463,7 @@

    Parameters:

    - lib/models/builder.js:139 + lib/models/builder.js:144

    private @@ -532,7 +530,7 @@

    Return:

    - lib/models/builder.js:40 + lib/models/builder.js:39

    private @@ -580,7 +578,7 @@

    Parameters:

    - lib/models/builder.js:55 + lib/models/builder.js:60

    private diff --git a/api/classes/CLI.html b/api/classes/CLI.html index f556dd4..753ba1d 100644 --- a/api/classes/CLI.html +++ b/api/classes/CLI.html @@ -42,7 +42,6 @@

    Classes

  • Builder
  • CLI
  • Command
  • -
  • CommandGenerator
  • DefaultPackager
  • EmberAddon
  • EmberApp
  • @@ -51,10 +50,9 @@

    Classes

  • Instrumentation
  • NodeModulesList
  • NpmTask
  • -
  • PackageCache
  • PackageInfo
  • PackageInfoCache
  • -
  • PrivateTestHelpers
  • +
  • PerBundleAddonCache
  • Project
  • ServeFilesAddon
  • TestsServerAddon
  • @@ -95,7 +93,6 @@

    CLI

    @@ -186,21 +183,6 @@

    Property Summary

    private - - -
    - analytics: Unknown -
    -
    - -
    - - - - - private - -
    @@ -441,24 +423,9 @@

    Parameters:

    Private Properties

    -
    -
    - lib/cli/cli.js:35 -

    - private - - - analytics: Unknown -

    -
    - - -
    - -
    - lib/cli/cli.js:48 + lib/cli/cli.js:42

    private @@ -473,7 +440,7 @@

    - lib/cli/cli.js:67 + lib/cli/cli.js:61

    private @@ -503,7 +470,7 @@

    - lib/cli/cli.js:61 + lib/cli/cli.js:55

    private @@ -518,7 +485,7 @@

    - lib/cli/cli.js:55 + lib/cli/cli.js:49

    private @@ -533,7 +500,7 @@

    - lib/cli/cli.js:41 + lib/cli/cli.js:35

    private @@ -569,7 +536,7 @@

    Private Methods

    - lib/cli/cli.js:262 + lib/cli/cli.js:224

    private @@ -623,7 +590,7 @@

    Return:

    - lib/cli/cli.js:303 + lib/cli/cli.js:264

    private @@ -677,7 +644,7 @@

    Return:

    - lib/cli/cli.js:83 + lib/cli/cli.js:77

    private @@ -744,7 +711,7 @@

    Return:

    - lib/cli/cli.js:122 + lib/cli/cli.js:115

    private diff --git a/api/classes/Command.html b/api/classes/Command.html index 6d93063..fecb05f 100644 --- a/api/classes/Command.html +++ b/api/classes/Command.html @@ -42,7 +42,6 @@

    Classes

  • Builder
  • CLI
  • Command
  • -
  • CommandGenerator
  • DefaultPackager
  • EmberAddon
  • EmberApp
  • @@ -51,10 +50,9 @@

    Classes

  • Instrumentation
  • NodeModulesList
  • NpmTask
  • -
  • PackageCache
  • PackageInfo
  • PackageInfoCache
  • -
  • PrivateTestHelpers
  • +
  • PerBundleAddonCache
  • Project
  • ServeFilesAddon
  • TestsServerAddon
  • @@ -131,7 +129,7 @@

    Command

    - Version: 3.21.2 + Version: 5.4.0-a905f346b9
    @@ -598,7 +596,7 @@

    Example:

    - lib/models/command.js:138 + lib/models/command.js:137

    public @@ -639,7 +637,6 @@

    Example:

    { name: 'verbose', type: Boolean, default: false, aliases: ['v'] }, { name: 'blueprint', type: String, default: 'app', aliases: ['b'] }, { name: 'skip-npm', type: Boolean, default: false, aliases: ['sn'] }, - { name: 'skip-bower', type: Boolean, default: false, aliases: ['sb'] }, { name: 'skip-git', type: Boolean, default: false, aliases: ['sg'] }, { name: 'directory', type: String , aliases: ['dir'] } ], @@ -726,7 +723,7 @@

    Public Methods

    - lib/models/command.js:494 + lib/models/command.js:482

    public @@ -793,7 +790,7 @@

    Return:

    - lib/models/command.js:390 + lib/models/command.js:378

    public @@ -874,7 +871,7 @@

    Return:

    - lib/models/command.js:249 + lib/models/command.js:247

    public @@ -902,7 +899,7 @@

    Return:

    - lib/models/command.js:648 + lib/models/command.js:636

    public @@ -956,7 +953,7 @@

    Return:

    - lib/models/command.js:322 + lib/models/command.js:315

    public @@ -1011,7 +1008,7 @@

    Return:

    - lib/models/command.js:338 + lib/models/command.js:331

    public @@ -1067,7 +1064,7 @@

    Return:

    - lib/models/command.js:378 + lib/models/command.js:366

    public @@ -1122,7 +1119,7 @@

    Return:

    - lib/models/command.js:180 + lib/models/command.js:179

    public @@ -1151,7 +1148,7 @@

    Return:

    - lib/models/command.js:449 + lib/models/command.js:437

    public @@ -1219,7 +1216,7 @@

    Return:

    - lib/models/command.js:541 + lib/models/command.js:529

    public @@ -1274,7 +1271,7 @@

    Return:

    - lib/models/command.js:607 + lib/models/command.js:595

    public @@ -1303,7 +1300,7 @@

    - lib/models/command.js:638 + lib/models/command.js:626

    public @@ -1325,7 +1322,7 @@

    - lib/models/command.js:154 + lib/models/command.js:153

    public @@ -1375,7 +1372,7 @@

    Parameters:

    - lib/models/command.js:597 + lib/models/command.js:585

    public @@ -1422,7 +1419,7 @@

    Parameters:

    - lib/models/command.js:509 + lib/models/command.js:497

    public @@ -1477,7 +1474,7 @@

    Return:

    - lib/models/command.js:257 + lib/models/command.js:255

    public @@ -1503,7 +1500,7 @@

    Return:

    - lib/models/command.js:423 + lib/models/command.js:411

    public @@ -1563,7 +1560,7 @@

    Return:

    Private Methods

    - lib/models/command.js:208 + lib/models/command.js:206

    private diff --git a/api/classes/DefaultPackager.html b/api/classes/DefaultPackager.html index 01483ea..a7c8053 100644 --- a/api/classes/DefaultPackager.html +++ b/api/classes/DefaultPackager.html @@ -42,7 +42,6 @@

    Classes

  • Builder
  • CLI
  • Command
  • -
  • CommandGenerator
  • DefaultPackager
  • EmberAddon
  • EmberApp
  • @@ -51,10 +50,9 @@

    Classes

  • Instrumentation
  • NodeModulesList
  • NpmTask
  • -
  • PackageCache
  • PackageInfo
  • PackageInfoCache
  • -
  • PrivateTestHelpers
  • +
  • PerBundleAddonCache
  • Project
  • ServeFilesAddon
  • TestsServerAddon
  • @@ -100,14 +98,14 @@

    DefaultPackager

    - Version: 3.21.2 + Version: 5.4.0-a905f346b9
    @@ -163,7 +161,7 @@

    Constructor Summary

    Public Constructors

    - lib/broccoli/default-packager.js:99 + lib/broccoli/default-packager.js:98

    public diff --git a/api/classes/EmberAddon.html b/api/classes/EmberAddon.html index 50b4377..d004097 100644 --- a/api/classes/EmberAddon.html +++ b/api/classes/EmberAddon.html @@ -42,7 +42,6 @@

    Classes

  • Builder
  • CLI
  • Command
  • -
  • CommandGenerator
  • DefaultPackager
  • EmberAddon
  • EmberApp
  • @@ -51,10 +50,9 @@

    Classes

  • Instrumentation
  • NodeModulesList
  • NpmTask
  • -
  • PackageCache
  • PackageInfo
  • PackageInfoCache
  • -
  • PrivateTestHelpers
  • +
  • PerBundleAddonCache
  • Project
  • ServeFilesAddon
  • TestsServerAddon
  • @@ -103,11 +101,9 @@

    EmberAddon

    @@ -264,7 +260,7 @@

    Method Summary

    @@ -279,7 +275,7 @@

    Method Summary

    @@ -306,36 +302,6 @@

    Method Summary

    private - - -
    - _addonInstalled(addonName): Boolean -
    -
    - -
    - - - - - private - - - - - -
    - -
    - - - - - private - -
    @@ -714,7 +680,7 @@

    Parameters:

    Public Methods

    - lib/broccoli/ember-app.js:1351 + lib/broccoli/ember-app.js:1088

    public @@ -743,7 +709,7 @@

    Return:

    - lib/broccoli/ember-app.js:1360 + lib/broccoli/ember-app.js:1097

    public @@ -871,7 +837,7 @@

    Parameters:

    - lib/broccoli/ember-app.js:1636 + lib/broccoli/ember-app.js:1306

    public @@ -932,18 +898,18 @@

    Return:

    Private Methods

    -
    - lib/broccoli/ember-app.js:537 +
    + lib/broccoli/ember-app.js:410

    private - _addonDisabledByBlacklist(addon): Boolean + _addonDisabledByExclude(addon): Boolean

    - Inherited from EmberApp + Inherited from EmberApp
    @@ -989,18 +955,18 @@

    Return:

    -
    - lib/broccoli/ember-app.js:548 +
    + lib/broccoli/ember-app.js:421

    private - _addonDisabledByWhitelist(addon): Boolean + _addonDisabledByInclude(addon): Boolean

    - Inherited from EmberApp + Inherited from EmberApp
    @@ -1047,7 +1013,7 @@

    Return:

    - lib/broccoli/ember-app.js:525 + lib/broccoli/ember-app.js:398

    private @@ -1083,120 +1049,6 @@

    Parameters:

    - - - - - - - -
    - -
    -

    Return:

    -
    - Boolean - -
    -
    - - -
    -
    -
    - lib/broccoli/ember-app.js:1341 -

    - private - - - _addonInstalled(addonName): Boolean -

    -
    - -
    - Inherited from EmberApp -
    - - -
    - -
    -

    Parameters:

    - - - - - - - - - - - - - - - - - - -
    NameTypeAttributeDescription
    addonNameString -
      - - - -
    -
    The name of the addon we are checking to see if it's installed
    -
    - -
    -

    Return:

    -
    - Boolean - -
    -
    - - -
    -
    -
    - lib/broccoli/ember-app.js:559 -

    - private - - - _checkEmberCliBabel(addons): Boolean -

    -
    - -
    - Inherited from EmberApp -
    - - -
    - -
    -

    Parameters:

    - - - - - - - - - - - - - - @@ -1218,7 +1070,7 @@

    Return:

    - lib/broccoli/ember-app.js:510 + lib/broccoli/ember-app.js:383

    private @@ -1288,7 +1140,7 @@

    Return:

    - lib/broccoli/ember-app.js:1491 + lib/broccoli/ember-app.js:1228

    private @@ -1345,7 +1197,7 @@

    Return:

    - lib/broccoli/ember-app.js:1406 + lib/broccoli/ember-app.js:1143

    private @@ -1447,7 +1299,7 @@

    Parameters:

    - lib/broccoli/ember-app.js:215 + lib/broccoli/ember-app.js:217

    private @@ -1520,7 +1372,7 @@

    Parameters:

    - lib/broccoli/ember-app.js:194 + lib/broccoli/ember-app.js:196

    private @@ -1571,7 +1423,7 @@

    Parameters:

    - lib/broccoli/ember-app.js:178 + lib/broccoli/ember-app.js:180

    private @@ -1623,7 +1475,7 @@

    Parameters:

    - lib/broccoli/ember-app.js:1086 + lib/broccoli/ember-app.js:841

    private @@ -1696,7 +1548,7 @@

    Return:

    - lib/broccoli/ember-app.js:886 + lib/broccoli/ember-app.js:645

    private @@ -1789,7 +1641,7 @@

    Return:

    - lib/broccoli/ember-app.js:813 + lib/broccoli/ember-app.js:572

    private @@ -1883,7 +1735,7 @@

    Return:

    - lib/broccoli/ember-app.js:850 + lib/broccoli/ember-app.js:609

    private @@ -1976,7 +1828,7 @@

    Return:

    - lib/broccoli/ember-app.js:715 + lib/broccoli/ember-app.js:560

    private @@ -2033,7 +1885,7 @@

    Return:

    - lib/broccoli/ember-app.js:1301 + lib/broccoli/ember-app.js:1048

    private @@ -2064,7 +1916,7 @@

    Return:

    - lib/broccoli/ember-app.js:587 + lib/broccoli/ember-app.js:432

    private @@ -2166,7 +2018,7 @@

    Return:

    - lib/broccoli/ember-app.js:1532 + lib/broccoli/ember-app.js:1269

    private diff --git a/api/classes/EmberApp.html b/api/classes/EmberApp.html index 47ca5aa..df11f25 100644 --- a/api/classes/EmberApp.html +++ b/api/classes/EmberApp.html @@ -42,7 +42,6 @@

    Classes

  • Builder
  • CLI
  • Command
  • -
  • CommandGenerator
  • DefaultPackager
  • EmberAddon
  • EmberApp
  • @@ -51,10 +50,9 @@

    Classes

  • Instrumentation
  • NodeModulesList
  • NpmTask
  • -
  • PackageCache
  • PackageInfo
  • PackageInfoCache
  • -
  • PrivateTestHelpers
  • +
  • PerBundleAddonCache
  • Project
  • ServeFilesAddon
  • TestsServerAddon
  • @@ -108,11 +106,9 @@

    EmberApp

    @@ -163,12 +159,10 @@

    EmberApp

  • autoRun, defaults to true
  • outputPaths, defaults to {}
  • minifyCSS, defaults to `{enabled: !!isProduction,options: { relativeTo: 'assets' }}
  • -
  • minifyJS, defaults to `{enabled: !!isProduction}
  • sourcemaps, defaults to {}
  • trees, defaults to {}
  • -
  • jshintrc, defaults to {}
  • vendorFiles, defaults to {}
  • -
  • addons, defaults to { blacklist: [], whitelist: [] }
  • +
  • addons, defaults to { exclude: [], include: [] }
  • @@ -308,7 +302,7 @@

    Method Summary

    - - - - - - - - - - - - -
    NameTypeAttributeDescription
    addonsAddons -
      - - -
    @@ -323,7 +317,7 @@

    Method Summary

    @@ -350,36 +344,6 @@

    Method Summary

    private -
    -
    - _addonInstalled(addonName): Boolean -
    -
    - -
    -
    - private - - - - -
    - -
    -
    - private - -
    @@ -685,7 +649,7 @@

    Method Summary

    Static Public Methods

    - lib/broccoli/ember-app.js:498 + lib/broccoli/ember-app.js:371

    public static @@ -719,7 +683,7 @@

    Return:

    Public Constructors

    - lib/broccoli/ember-app.js:73 + lib/broccoli/ember-app.js:60

    public @@ -789,7 +753,7 @@

    Parameters:

    Public Methods

    - lib/broccoli/ember-app.js:1351 + lib/broccoli/ember-app.js:1088

    public @@ -816,7 +780,7 @@

    Return:

    - lib/broccoli/ember-app.js:1360 + lib/broccoli/ember-app.js:1097

    public @@ -944,7 +908,7 @@

    Parameters:

    - lib/broccoli/ember-app.js:1636 + lib/broccoli/ember-app.js:1306

    public @@ -1005,13 +969,13 @@

    Return:

    Private Methods

    -
    - lib/broccoli/ember-app.js:537 +
    + lib/broccoli/ember-app.js:410

    private - _addonDisabledByBlacklist(addon): Boolean + _addonDisabledByExclude(addon): Boolean

    @@ -1059,13 +1023,13 @@

    Return:

    -
    - lib/broccoli/ember-app.js:548 +
    + lib/broccoli/ember-app.js:421

    private - _addonDisabledByWhitelist(addon): Boolean + _addonDisabledByInclude(addon): Boolean

    @@ -1114,7 +1078,7 @@

    Return:

    - lib/broccoli/ember-app.js:525 + lib/broccoli/ember-app.js:398

    private @@ -1148,115 +1112,6 @@

    Parameters:

    - -
    -
    - -
    -

    Return:

    -
    - Boolean - -
    -
    - - -
    -
    -
    - lib/broccoli/ember-app.js:1341 -

    - private - - - _addonInstalled(addonName): Boolean -

    -
    - - - -
    - -
    -

    Parameters:

    - - - - - - - - - - - - - - - - - - -
    NameTypeAttributeDescription
    addonNameString -
      - - - -
    -

    The name of the addon we are checking to see if it's installed

    -
    -
    - -
    -

    Return:

    -
    - Boolean - -
    -
    - - -
    -
    -
    - lib/broccoli/ember-app.js:559 -

    - private - - - _checkEmberCliBabel(addons): Boolean -

    -
    - - - -
    - -
    -

    Parameters:

    - - - - - - - - - - - - - - @@ -1278,7 +1133,7 @@

    Return:

    - lib/broccoli/ember-app.js:510 + lib/broccoli/ember-app.js:383

    private @@ -1346,7 +1201,7 @@

    Return:

    - lib/broccoli/ember-app.js:1491 + lib/broccoli/ember-app.js:1228

    private @@ -1401,7 +1256,7 @@

    Return:

    - lib/broccoli/ember-app.js:1406 + lib/broccoli/ember-app.js:1143

    private @@ -1500,7 +1355,7 @@

    Parameters:

    - lib/broccoli/ember-app.js:215 + lib/broccoli/ember-app.js:217

    private @@ -1569,7 +1424,7 @@

    Parameters:

    - lib/broccoli/ember-app.js:194 + lib/broccoli/ember-app.js:196

    private @@ -1618,7 +1473,7 @@

    Parameters:

    - lib/broccoli/ember-app.js:178 + lib/broccoli/ember-app.js:180

    private @@ -1667,7 +1522,7 @@

    Parameters:

    - lib/broccoli/ember-app.js:1086 + lib/broccoli/ember-app.js:841

    private @@ -1733,7 +1588,7 @@

    Return:

    - lib/broccoli/ember-app.js:886 + lib/broccoli/ember-app.js:645

    private @@ -1825,7 +1680,7 @@

    Return:

    - lib/broccoli/ember-app.js:813 + lib/broccoli/ember-app.js:572

    private @@ -1915,7 +1770,7 @@

    Return:

    - lib/broccoli/ember-app.js:850 + lib/broccoli/ember-app.js:609

    private @@ -2004,7 +1859,7 @@

    Return:

    - lib/broccoli/ember-app.js:715 + lib/broccoli/ember-app.js:560

    private @@ -2061,7 +1916,7 @@

    Return:

    - lib/broccoli/ember-app.js:1301 + lib/broccoli/ember-app.js:1048

    private @@ -2089,7 +1944,7 @@

    Return:

    - lib/broccoli/ember-app.js:587 + lib/broccoli/ember-app.js:432

    private @@ -2185,7 +2040,7 @@

    Return:

    - lib/broccoli/ember-app.js:1532 + lib/broccoli/ember-app.js:1269

    private diff --git a/api/classes/HardwareInfo.html b/api/classes/HardwareInfo.html index a14743c..965d3cc 100644 --- a/api/classes/HardwareInfo.html +++ b/api/classes/HardwareInfo.html @@ -42,7 +42,6 @@

    Classes

  • Builder
  • CLI
  • Command
  • -
  • CommandGenerator
  • DefaultPackager
  • EmberAddon
  • EmberApp
  • @@ -51,10 +50,9 @@

    Classes

  • Instrumentation
  • NodeModulesList
  • NpmTask
  • -
  • PackageCache
  • PackageInfo
  • PackageInfoCache
  • -
  • PrivateTestHelpers
  • +
  • PerBundleAddonCache
  • Project
  • ServeFilesAddon
  • TestsServerAddon
  • @@ -107,7 +105,7 @@

    HardwareInfo

    - Version: 3.21.2 + Version: 5.4.0-a905f346b9
    @@ -152,7 +150,7 @@

    Method Summary

    isUsingBattery(platform): Null | Boolean
    -

    Inidcates whether the host is running on battery power. This can cause performance degredation.

    +

    Indicates whether the host is running on battery power. This can cause performance degredation.

    @@ -293,7 +291,7 @@

    -

    Inidcates whether the host is running on battery power. This can cause +

    Indicates whether the host is running on battery power. This can cause performance degredation.

    diff --git a/api/classes/HistorySupportAddon.html b/api/classes/HistorySupportAddon.html index db40078..8cd7bc7 100644 --- a/api/classes/HistorySupportAddon.html +++ b/api/classes/HistorySupportAddon.html @@ -42,7 +42,6 @@

    Classes

  • Builder
  • CLI
  • Command
  • -
  • CommandGenerator
  • DefaultPackager
  • EmberAddon
  • EmberApp
  • @@ -51,10 +50,9 @@

    Classes

  • Instrumentation
  • NodeModulesList
  • NpmTask
  • -
  • PackageCache
  • PackageInfo
  • PackageInfoCache
  • -
  • PrivateTestHelpers
  • +
  • PerBundleAddonCache
  • Project
  • ServeFilesAddon
  • TestsServerAddon
  • @@ -100,7 +98,7 @@

    HistorySupportAddon

    - Version: 3.21.2 + Version: 5.4.0-a905f346b9
    diff --git a/api/classes/Instrumentation.html b/api/classes/Instrumentation.html index fdb5ffe..38b5bdd 100644 --- a/api/classes/Instrumentation.html +++ b/api/classes/Instrumentation.html @@ -42,7 +42,6 @@

    Classes

  • Builder
  • CLI
  • Command
  • -
  • CommandGenerator
  • DefaultPackager
  • EmberAddon
  • EmberApp
  • @@ -51,10 +50,9 @@

    Classes

  • Instrumentation
  • NodeModulesList
  • NpmTask
  • -
  • PackageCache
  • PackageInfo
  • PackageInfoCache
  • -
  • PrivateTestHelpers
  • +
  • PerBundleAddonCache
  • Project
  • ServeFilesAddon
  • TestsServerAddon
  • @@ -90,18 +88,24 @@

    Instrumentation

    + +
    - Version: 3.21.2 + Version: 5.4.0-a905f346b9
    @@ -150,10 +154,25 @@

    Method Summary

    + + + + @@ -176,6 +195,45 @@

    Method Summary

    NameTypeAttributeDescription
    addonsAddons -
      - - -
    - checkInstallations( ) + findLCAHost(engineInstance): EngineAddon | EmberApp
    -

    Check if npm and bower installation directories are present, and raise an error message with instructions on how to proceed.

    +

    This returns the LCA host for a given engine; we use the associated package info to compute this (see getHostAddonInfo above); this finds the lowest common ancestor that is considered a host amongst all engines by the same name in the project. This function is intended to replace the original behavior in ember-engines.

    +
    +
    + public + + + +
    + getHostAddonInfo(packageInfoForLazyEngine): hostPackageInfo: PackageInfo, hostAndAncestorBundledPackageInfos: Set +
    +
    +

    This function intends to return a common host for a bundle host (lazy engine). The root package info should be the starting point (i.e., the project's package info). We do this by performing a breadth-first traversal until we find the intended lazy engine (represented as a package-info & the 1st argument passed to this function). As part of the traversal, we keep track of all paths to said engine; then, once we find the intended engine we use this to determine the nearest common host amongst all shortest paths.

    + + + + + + + + + + + + + + + + +
    Private Methods
    + private + + + +
    + _findNearestBundleHost(paths): PackageInfo, PackageInfo[] +
    +
    +

    Given a path (calculated as part of getHostAddonInfo), return the correct "bundle host". A bundle host is considered the project or lazy engine.

    +
    +
    + private + + + +
    + _getBundledPackageInfos(pkgInfoToStartAt): Set +
    +
    +

    Returns a Set of package-info objects that a given bundle host is directly responsible for bundling (i.e., it excludes other bundle hosts/lazy engines when it encounters these)

    +
    +
    @@ -192,26 +250,156 @@

    Method Summary

    Public Methods

    -
    - lib/models/installation-checker.js:13 +
    + lib/models/host-info-cache.js:270

    public - checkInstallations( ) + findLCAHost(engineInstance): EngineAddon | EmberApp

    -

    Check if npm and bower installation directories are present, -and raise an error message with instructions on how to proceed.

    -

    If some of these package managers aren't being used in the project -we just ignore them. Their usage is considered by checking the -presence of your manifest files: package.json for npm and bower.json for bower.

    +

    This returns the LCA host for a given engine; we use the associated package info +to compute this (see getHostAddonInfo above); this finds the lowest common ancestor +that is considered a host amongst all engines by the same name in the project. This +function is intended to replace the original behavior in ember-engines.

    +

    For more info, see the original implementation here:

    +

    https://github.com/ember-engines/ember-engines/blob/master/packages/ember-engines/lib/utils/find-lca-host.js

    +
    +

    Parameters:

    + + + + + + + + + + + + + + + + + +
    NameTypeAttributeDescription
    engineInstanceEngineAddon +
      + + + +
    +
    +
    + +
    +

    Return:

    +
    + EngineAddon | EmberApp + +
    +
    + + +
    +
    +
    + lib/models/host-info-cache.js:147 +

    + public + + + getHostAddonInfo(packageInfoForLazyEngine): hostPackageInfo: PackageInfo, hostAndAncestorBundledPackageInfos: Set +

    +
    + + + +

    This function intends to return a common host for a bundle host (lazy engine). The root +package info should be the starting point (i.e., the project's package info). We do this +by performing a breadth-first traversal until we find the intended lazy engine (represented +as a package-info & the 1st argument passed to this function). As part of the traversal, we keep +track of all paths to said engine; then, once we find the intended engine we use this to determine +the nearest common host amongst all shortest paths.

    +

    Some context:

    +

    For a given engine/bundle host, this finds the lowest common ancestor that is considered a +host amongst all engines by the same name in the project.

    +

    For example, given the following package structure:

    +
     --Project--
    +  /      \
    + /        \
    +
    +

    Lazy Engine A
    +Addon A +| +| +Lazy Engine B +/
    +/
    +Lazy Engine A Lazy Engine C

    +
      +
    • The LCA host for Lazy Engine A is the project
    • +
    • The LCA host for Lazy Engine B is the project
    • +
    • The LCA host for Lazy Engine C is Lazy Engine B
    • +
    +

    This also returns hostAndAncestorBundledPackageInfos, which are all bundled addons above a given host:

    +
      +
    • hostAndAncestorBundledPackageInfos for lazy engine A includes all non-lazy dependencies of its LCA host & above (in this case, just the project)
    • +
    • hostAndAncestorBundledPackageInfos for lazy engine B includes all non-lazy dependencies of its LCA host & above (in this case, just the project)
    • +
    • hostAndAncestorBundledPackageInfos for lazy engine C includes non-lazy deps of lazy engine B & non-lazy deps of the project (LCA host & above)
    • +
    +

    This is intended to mimic the behavior of ancestorHostAddons in ember-engines: +https://github.com/ember-engines/ember-engines/blob/master/packages/ember-engines/lib/engine-addon.js#L333

    +

    Unfortunately, we can't easily repurpose the logic in ember-engines since the algorithm has to be different; +in ember-engines we need access to the actual addon instance, however, this is intended to be used during +addon instantiation, so we only have access to package-info objects. In having said this, we can repurpose +the hostPackageInfo to determine the LCA host; see below findLCAHost.

    +
    + +
    +

    Parameters:

    + + + + + + + + + + + + + + + + + + +
    NameTypeAttributeDescription
    packageInfoForLazyEnginePackageInfo +
      + + + +
    +
    +
    + +
    +

    Return:

    +
    + hostPackageInfo: PackageInfo, hostAndAncestorBundledPackageInfos: Set +

    }

    +
    +
    +
    @@ -300,6 +488,158 @@

    Parameters:

    +
    +

    Private Methods

    +
    +
    + lib/models/host-info-cache.js:16 +

    + private + + + _findNearestBundleHost(paths): PackageInfo, PackageInfo[] +

    +
    + + + +

    Given a path (calculated as part of getHostAddonInfo), return the correct +"bundle host". A bundle host is considered the project or lazy engine.

    +

    For example, given the following package structure:

    +
     --Project--
    +  /      \
    + /        \
    +
    +

    Lazy Engine A
    +Addon A +| +| +Lazy Engine B +/
    +/
    +Lazy Engine A Lazy Engine C

    +

    The provided paths for lazy engine A would look like:

    +
      +
    • [Project]
    • +
    • [Project, Addon A, Lazy Engine B]
    • +
    +

    For this project structure, this function would return [Project, [Project]]

    +

    Similarly, given the following project structure:

    +
           --Project--
    +        /      \
    +       /        \
    +Lazy Engine A    \
    +     /        Lazy Engine B
    +    /               |
    +   /                |
    +
    +

    Lazy Engine C Lazy Engine C

    +

    The provided paths for lazy engine C would look like:

    +
      +
    • [Project, Lazy Engine A]
    • +
    • [Project, Lazy Engine B]
    • +
    +

    In this case, the host is the project and would also return [Project, [Project]]

    +
    + +
    +

    Parameters:

    + + + + + + + + + + + + + + + + + + +
    NameTypeAttributeDescription
    pathsArray +
      + + + +
    +

    The found paths to a given bundle host

    +
    +
    + +
    +

    Return:

    +
    + PackageInfo, PackageInfo[] + +
    +
    + + +
    +
    +
    + lib/models/host-info-cache.js:93 +

    + private + + + _getBundledPackageInfos(pkgInfoToStartAt): Set +

    +
    + + + +

    Returns a Set of package-info objects that a given bundle host is +directly responsible for bundling (i.e., it excludes other bundle +hosts/lazy engines when it encounters these)

    +
    + +
    +

    Parameters:

    + + + + + + + + + + + + + + + + + + +
    NameTypeAttributeDescription
    pkgInfoToStartAtPackageInfo +
      + + + +
    +
    +
    + +
    +

    Return:

    +
    + Set + +
    +
    + + +
    +
    diff --git a/api/classes/NodeModulesList.html b/api/classes/NodeModulesList.html index f85d483..5595e89 100644 --- a/api/classes/NodeModulesList.html +++ b/api/classes/NodeModulesList.html @@ -42,7 +42,6 @@

    Classes

  • Builder
  • CLI
  • Command
  • -
  • CommandGenerator
  • DefaultPackager
  • EmberAddon
  • EmberApp
  • @@ -51,10 +50,9 @@

    Classes

  • Instrumentation
  • NodeModulesList
  • NpmTask
  • -
  • PackageCache
  • PackageInfo
  • PackageInfoCache
  • -
  • PrivateTestHelpers
  • +
  • PerBundleAddonCache
  • Project
  • ServeFilesAddon
  • TestsServerAddon
  • @@ -106,7 +104,7 @@

    NodeModulesList

    - Version: 3.21.2 + Version: 5.4.0-a905f346b9
    diff --git a/api/classes/NpmTask.html b/api/classes/NpmTask.html index 8daee7a..f7a0aba 100644 --- a/api/classes/NpmTask.html +++ b/api/classes/NpmTask.html @@ -42,7 +42,6 @@

    Classes

  • Builder
  • CLI
  • Command
  • -
  • CommandGenerator
  • DefaultPackager
  • EmberAddon
  • EmberApp
  • @@ -51,10 +50,9 @@

    Classes

  • Instrumentation
  • NodeModulesList
  • NpmTask
  • -
  • PackageCache
  • PackageInfo
  • PackageInfoCache
  • -
  • PrivateTestHelpers
  • +
  • PerBundleAddonCache
  • Project
  • ServeFilesAddon
  • TestsServerAddon
  • @@ -106,14 +104,14 @@

    NpmTask

    - Version: 3.21.2 + Version: 5.4.0-a905f346b9
    @@ -213,7 +211,7 @@

    Method Summary

    Private Constructors

    - lib/tasks/npm-task.js:16 + lib/tasks/npm-task.js:14

    private @@ -269,7 +267,7 @@

    Parameters:

    Private Methods

    - lib/tasks/npm-task.js:113 + lib/tasks/npm-task.js:128

    private @@ -301,7 +299,7 @@

    Return:

    - lib/tasks/build-watch.js:49 + lib/tasks/build-watch.js:52

    private diff --git a/api/classes/PackageInfo.html b/api/classes/PackageInfo.html index 9cae074..352dbdd 100644 --- a/api/classes/PackageInfo.html +++ b/api/classes/PackageInfo.html @@ -42,7 +42,6 @@

    Classes

  • Builder
  • CLI
  • Command
  • -
  • CommandGenerator
  • DefaultPackager
  • EmberAddon
  • EmberApp
  • @@ -51,10 +50,9 @@

    Classes

  • Instrumentation
  • NodeModulesList
  • NpmTask
  • -
  • PackageCache
  • PackageInfo
  • PackageInfoCache
  • -
  • PrivateTestHelpers
  • +
  • PerBundleAddonCache
  • Project
  • ServeFilesAddon
  • TestsServerAddon
  • @@ -94,8 +92,14 @@

    PackageInfo

  • discoverAddonAddons
  • discoverProjectAddons
  • generateAddonPackages
  • -
  • getAddonConstructor
  • +
  • getAddonInstance
  • hasErrors
  • +
  • initChildAddons
  • +
  • isForAddon
  • +
  • isForBundleHost
  • +
  • isForEngine
  • +
  • isForLazyEngine
  • +
  • isForProject
  • @@ -106,20 +110,26 @@

    PackageInfo

  • addInternalAddon
  • + +
    - Version: 3.21.2 + Version: 5.4.0-a905f346b9
    @@ -216,10 +226,10 @@

    Method Summary

    - getAddonConstructor( ): AddonConstructor + getAddonInstance(parent, project): Object
    -

    This is only supposed to be called by the addon instantiation code. Also, the assumption here is that this PackageInfo really is for an Addon, so we don't need to check each time.

    +

    Create an instance of the addon represented by this packageInfo or (if we are supporting per-bundle caching and this is an allow-caching-per-bundle addon) check if we should be creating a proxy instead.

    @@ -238,6 +248,96 @@

    Method Summary

    + + + public + + + + +
    + initChildAddons(addonInstance) +
    +
    +

    Initialize the child addons array of a newly-created addon instance. Normally when an addon derives from Addon, child addons will be created during 'setupRegistry' and this code is essentially unnecessary. But if an addon is created with custom constructors that don't call 'setupRegistry', any child addons may not yet be initialized.

    +
    + + + + + public + + + + + +
    +

    Indicate if this packageInfo is for an Addon.

    +
    + + + + + public + + + + + +
    +

    For use with the PerBundleAddonCache, is this packageInfo representing a bundle host (for now, a Project or a lazy engine).

    +
    + + + + + public + + + + + +
    +

    Indicate if this packageInfo represents an engine.

    +
    + + + + + public + + + + + +
    +

    Indicate if this packageInfo represents a lazy engine.

    +
    + + + + + public + + + + + +
    +

    Indicate if this packageInfo is for a project. Should be called only after the project has been loaded (see {@link PackageInfoCache#loadProject} for details).

    +
    + + @@ -311,6 +411,60 @@

    Method Summary

    + + + + + + + + + + + + + + + + + + + + +
    Private Methods
    + private + + + + +
    +

    Gets the addon entry point

    +
    +
    + private + + + +
    + constructAddonInstance(parent, project) +
    +
    +

    Construct an addon instance.

    +
    +
    + private + + + +
    + getAddonConstructor( ): AddonConstructor +
    +
    +

    This is only supposed to be called by the addon instantiation code. Also, the assumption here is that this PackageInfo really is for an Addon, so we don't need to check each time.

    +
    +
    @@ -328,7 +482,7 @@

    Method Summary

    Public Methods

    -
    - lib/models/package-info-cache/package-info.js:371 +
    + lib/models/package-info-cache/package-info.js:492

    public - getAddonConstructor( ): AddonConstructor + getAddonInstance(parent, project): Object

    -

    This is only supposed to be called by the addon instantiation code. -Also, the assumption here is that this PackageInfo really is for an -Addon, so we don't need to check each time.

    +

    Create an instance of the addon represented by this packageInfo or (if we +are supporting per-bundle caching and this is an allow-caching-per-bundle addon) +check if we should be creating a proxy instead.

    +

    NOTE: we assume that the value of 'allowCachingPerBundle' does not change between +calls to the constructor! A given addon is either allowing or not allowing caching +for an entire run.

    +
    +

    Parameters:

    + + + + + + + + + + + + + + + + + + + + + + + + + +
    NameTypeAttributeDescription
    parentObject +
      + + + +
    +

    the addon/project that is to be the direct parent of the +addon instance created here

    +
    project +
      + + + +
    +

    the project that is to contain this addon instance

    +
    +

    Return:

    - AddonConstructor -

    an instance of a constructor function for the Addon class -whose package information is stored in this object.

    + Object +

    the constructed instance of the addon

    @@ -547,7 +747,7 @@

    Return:

    +
    +
    + lib/models/package-info-cache/package-info.js:525 +

    + public + + + initChildAddons(addonInstance) +

    +
    + + + +

    Initialize the child addons array of a newly-created addon instance. Normally when +an addon derives from Addon, child addons will be created during 'setupRegistry' and +this code is essentially unnecessary. But if an addon is created with custom constructors +that don't call 'setupRegistry', any child addons may not yet be initialized.

    +
    + +
    +

    Parameters:

    + + + + + + + + + + + + + + + + + + +
    NameTypeAttributeDescription
    addonInstanceAddon +
      + + + +
    +
    +
    + + + +
    +
    +
    + lib/models/package-info-cache/package-info.js:237 +

    + public + + + isForAddon( ): Boolean +

    +
    + + + +

    Indicate if this packageInfo is for an Addon.

    +
    + + +
    +

    Return:

    +
    + Boolean +

    true if this packageInfo is for an Addon, false otherwise.

    +
    +
    +
    + + +
    +
    +
    + lib/models/package-info-cache/package-info.js:268 +

    + public + + + isForBundleHost( ): Boolean +

    +
    + + + +

    For use with the PerBundleAddonCache, is this packageInfo representing a +bundle host (for now, a Project or a lazy engine).

    +
    + + +
    +

    Return:

    +
    + Boolean +

    true if this pkgInfo is for a bundle host, false otherwise.

    +
    +
    +
    + + +
    +
    +
    + lib/models/package-info-cache/package-info.js:247 +

    + public + + + isForEngine( ): Boolean +

    +
    + + + +

    Indicate if this packageInfo represents an engine.

    +
    + + +
    +

    Return:

    +
    + Boolean +

    true if this pkgInfo is configured as an engine & false otherwise

    +
    +
    +
    + + +
    +
    +
    + lib/models/package-info-cache/package-info.js:257 +

    + public + + + isForLazyEngine( ): Boolean +

    +
    + + + +

    Indicate if this packageInfo represents a lazy engine.

    +
    + + +
    +

    Return:

    +
    + Boolean +

    true if this pkgInfo is configured as an engine and the +module this represents has lazyLoading enabled, false otherwise.

    +
    +
    +
    + + +
    +
    +
    + lib/models/package-info-cache/package-info.js:226 +

    + public + + + isForProject( ): Boolean +

    +
    + + + +

    Indicate if this packageInfo is for a project. Should be called only after the project +has been loaded (see {@link PackageInfoCache#loadProject} for details).

    +
    + + +
    +

    Return:

    +
    + Boolean +

    true if this packageInfo is for a Project, false otherwise.

    +
    +
    +
    + +
    @@ -602,7 +996,7 @@

    Parameters:

    Protected Methods

    - lib/models/package-info-cache/package-info.js:154 + lib/models/package-info-cache/package-info.js:157

    protected @@ -621,7 +1015,7 @@

    Note: this is not to be called until all packages that can be have been added to the cache.

    Note: this is for ALL dependencies, not just addons. To get just -addons, filter the result by calling pkgInfo.isAddon().

    +addons, filter the result by calling pkgInfo.isForAddon().

    Note: this is only intended for use from PackageInfoCache._resolveDependencies. It is not to be called directly by anything else.

    @@ -671,7 +1065,7 @@

    Return:

    +
    +

    Private Methods

    +
    +
    + lib/models/package-info-cache/package-info.js:542 +

    + private + + + _getAddonEntryPoint( ): Object | Function +

    +
    + + + +

    Gets the addon entry point

    +
    + + +
    +

    Return:

    +
    + Object | Function +

    The exported addon entry point

    +
    +
    +
    + + +
    +
    +
    + lib/models/package-info-cache/package-info.js:457 +

    + private + + + constructAddonInstance(parent, project) +

    +
    + + + +

    Construct an addon instance.

    +

    NOTE: this does NOT call constructors for the child addons. That is left to +the caller to do, so they can insert any other logic they want.

    +
    + +
    +

    Parameters:

    + + + + + + + + + + + + + + + + + + + + + + + + + +
    NameTypeAttributeDescription
    parentProject | Addon +
      + + + +
    +

    the parent that directly contains this addon

    +
    projectProject +
      + + + +
    +

    the project that is/contains this addon

    +
    +
    + + + +
    +
    +
    + lib/models/package-info-cache/package-info.js:419 +

    + private + + + getAddonConstructor( ): AddonConstructor +

    +
    + + + +

    This is only supposed to be called by the addon instantiation code. +Also, the assumption here is that this PackageInfo really is for an +Addon, so we don't need to check each time.

    +
    + + +
    +

    Return:

    +
    + AddonConstructor +

    an instance of a constructor function for the Addon class +whose package information is stored in this object.

    +
    +
    +
    + + +
    +
    diff --git a/api/classes/PackageInfoCache.html b/api/classes/PackageInfoCache.html index d0ef8df..5146488 100644 --- a/api/classes/PackageInfoCache.html +++ b/api/classes/PackageInfoCache.html @@ -42,7 +42,6 @@

    Classes

  • Builder
  • CLI
  • Command
  • -
  • CommandGenerator
  • DefaultPackager
  • EmberAddon
  • EmberApp
  • @@ -51,10 +50,9 @@

    Classes

  • Instrumentation
  • NodeModulesList
  • NpmTask
  • -
  • PackageCache
  • PackageInfo
  • PackageInfoCache
  • -
  • PrivateTestHelpers
  • +
  • PerBundleAddonCache
  • Project
  • ServeFilesAddon
  • TestsServerAddon
  • @@ -90,7 +88,9 @@

    PackageInfoCache

    @@ -154,6 +154,21 @@

    Method Summary

    public + + +
    + assert(description, condition) +
    +
    +

    Verify that a certain condition is met, or throw an error if otherwise.

    +
    + + + + + public + +
    @@ -169,6 +184,21 @@

    Method Summary

    public + + +
    + deprecate(description, condition, options) +
    +
    +

    Display a deprecation message.

    +
    + + + + + public + +
    @@ -372,9 +402,84 @@

    Method Summary

    Public Methods

    +
    +
    + lib/debug/assert.js:3 +

    + public + + + assert(description, condition) +

    +
    + + + +

    Verify that a certain condition is met, or throw an error if otherwise.

    +

    This is useful for communicating expectations in the code to other human +readers as well as catching bugs that accidentally violate these expectations.

    +
    const { assert } = require('ember-cli/lib/debug');
    +
    +// Test for truthiness:
    +assert('Must pass a string.', typeof str === 'string');
    +
    +// Fail unconditionally:
    +assert('This code path should never run.');
    +
    +
    + +
    +

    Parameters:

    + + + + + + + + + + + + + + + + + + + + + + + + + +
    NameTypeAttributeDescription
    descriptionString +
      + + + +
    +

    Describes the condition. +This will become the message of the error thrown if the assertion fails.

    +
    conditionAny +
      + + + +
    +

    Must be truthy for the assertion to pass. +If falsy, an error will be thrown.

    +
    +
    + + + +
    +
    +
    + lib/debug/deprecate.js:7 +

    + public + + + deprecate(description, condition, options) +

    +
    + + + +

    Display a deprecation message.

    +
    const { deprecate } = require('ember-cli/lib/debug');
    +
    +deprecate('The foo method is deprecated.', false, {
    +  for: 'ember-cli',
    +  id: 'ember-cli.foo-method',
    +  since: {
    +    available: '4.1.0',
    +    enabled: '4.2.0',
    +  },
    +  until: '5.0.0',
    +  url: 'https://example.com',
    +});
    +
    +
    + +
    +

    Parameters:

    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    NameTypeAttributeDescription
    descriptionString +
      + + + +
    +

    Describes the deprecation.

    +
    conditionAny +
      + + + +
    +

    If falsy, the deprecation message will be displayed.

    +
    optionsObject +
      + + + +
    +

    An object including the deprecation's details:

    +
      +
    • for The library that the deprecation is for
    • +
    • id The deprecation's unique id
    • +
    • since.available A SemVer version indicating when the deprecation was made available
    • +
    • since.enabled A SemVer version indicating when the deprecation was enabled
    • +
    • until A SemVer version indicating until when the deprecation will be active
    • +
    • url A URL that refers to additional information about the deprecation
    • +
    +
    +
    + + +
    - lib/models/package-info-cache/index.js:307 + lib/models/package-info-cache/index.js:309

    public @@ -717,7 +920,7 @@

    Private Methods

    - lib/models/package-info-cache/index.js:260 + lib/models/package-info-cache/index.js:262

    private diff --git a/api/classes/PerBundleAddonCache.html b/api/classes/PerBundleAddonCache.html new file mode 100644 index 0000000..2482aec --- /dev/null +++ b/api/classes/PerBundleAddonCache.html @@ -0,0 +1,1008 @@ + + + + + PerBundleAddonCache - ember-cli + + + + + + +
    +
    + + +
    +
    + + + + +

    For large applications with many addons (and many instances of each, resulting in +potentially many millions of addon instances during a build), the build can become +very, very slow (tens of minutes) partially due to the sheer number of addon instances. +The PerBundleAddonCache deals with this slowness by doing 3 things:

    +

    (1) Making only a single copy of each of certain addons and their dependent addons +(2) Replacing any other instances of those addons with Proxy copies to the single instance +(3) Having the Proxies return an empty array for their dependent addons, rather +than proxying to the contents of the single addon instance. This gives up the +ability of the Proxies to traverse downward into their child addons, +something that many addons do not do anyway, for the huge reduction in duplications +of those child addons. For applications that enable ember-engines dedupe logic, +that logic is stateful, and having the Proxies allow access to the child addons array +just breaks everything, because that logic will try multiple times to remove items +it thinks are duplicated, messing up the single copy of the child addon array. +See the explanation of the dedupe logic in +{@link https://github.com/ember-engines/ember-engines/blob/master/packages/ember-engines/lib/utils/deeply-non-duplicated-addon.js}

    +

    What follows are the more technical details of how the PerBundleAddonCache implements +the above 3 behaviors.

    +

    This class supports per-bundle-host (bundle host = project or lazy engine) +caching of addon instances. During addon initialization we cannot add a +cache to each bundle host object AFTER it is instantiated because running the +addon constructor ultimately causes Addon class setupRegistry code to +run which instantiates child addons, which need the cache to already be +in place for the parent bundle host. +We handle this by providing a global cache that exists independent of the +bundle host objects. That is this object.

    +

    There are a number of "behaviors" being implemented by this object and +its contents. They are: +(1) Any addon that is a lazy engine has only a single real instance per +project - all other references to the lazy engine are to be proxies. These +lazy engines are compared by name, not by packageInfo.realPath. +(2) Any addon that is not a lazy engine, there is only a single real instance +of the addon per "bundle host" (i.e. lazy engine or project). +(3) An optimization - any addon that is in a lazy engine but that is also +in bundled by its LCA host - the single instance is the one bundled by this +host. All other instances (in any lazy engine) are proxies.

    +

    NOTE: the optimization is only enabled if the environment variable that controls +ember-engines transitive deduplication (process.env.EMBER_ENGINES_ADDON_DEDUPE) +is set to a truthy value. For more info, see: +https://github.com/ember-engines/ember-engines/blob/master/packages/ember-engines/lib/engine-addon.js#L396

    +
    + + + + + + + + +

    Method Summary

    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    Public Methods
    + public + + + +
    + allowCachingPerBundle(addonEntryPointModule): Boolean +
    +
    +

    The default implementation here is to indicate if the original addon entry point has the allowCachingPerBundle flag set either on itself or on its prototype.

    +
    +
    + public + + + +
    + bundleHostOwnsInstance((Object}, addonPkgInfo): Boolean +
    +
    +

    An optimization we support from lazy engines is the following:

    +
    +
    + public + + + +
    + createAddonCacheEntry(addonInstance, addonRealPath): Object +
    +
    +

    Create a cache entry object for a given (non-bundle-host) addon to put into an addon cache.

    +
    +
    + public + + + +
    + createBundleHostCacheEntry(bundleHostPkgInfo): Object +
    +
    +

    Creates a cache entry for the bundleHostCache. Because we want to use the same sort of proxy for both bundle hosts and for 'regular' addon instances (though their cache entries have slightly different structures) we'll use the Symbol from getAddonProxy.

    +
    +
    + public + + + +
    + findBundleHost(addonParent, addonPkgInfo): Object +
    +
    +

    Given a parent object of a potential addon (another addon or the project), go up the 'parent' chain to find the potential addon's bundle host object (i.e. lazy engine or project.) Because Projects are always bundle hosts, this should always pass, but we'll throw if somehow it doesn't work.

    +
    +
    + public + + + +
    + getAddonInstance(parent, addonPkgInfo): Addon | Proxy +
    +
    +

    Called from PackageInfo.getAddonInstance(), return an instance of the requested addon or a Proxy, based on the type of addon and its bundle host.

    +
    +
    + public + + + +
    + getAddonProxy(targetCacheEntry, parent): +
    +
    +

    Returns a proxy to a target with specific handling for the parent property, as well has to handle the app property; that is, the proxy should maintain correct local state in closure scope for the app property if it happens to be set by ember-cli. Other than parent & app, this function also proxies almost everything to target[TARGET_INSTANCE] with a few exceptions: we trap & return[]foraddons, and we don't return the originalincluded(it's already called on the "real" addon byember-cli`).

    +
    +
    + public + + + +
    + resolvePerBundleAddonCacheUtil(project): AllowCachingPerBundle: Function +
    +
    +

    Resolves the perBundleAddonCacheUtil; this prefers the custom provided version by the consuming application, and defaults to an internal implementation here.

    +
    +
    + public + + + +
    + validateCacheKey(realAddonInstance, treeType, newCacheKey) +
    +
    +

    Validates that a new cache key for a given tree type matches the previous cache key for the same tree type. To opt-in to bundle addon caching for a given addon it's assumed that it returns stable cache keys; specifically this is because the interplay between bundle addon caching and ember-engines when transitive deduplication is enabled assumes stable cache keys, so we validate for this case here.

    +
    +
    + + + + + + + + + + + + + + + +
    +

    Public Methods

    +
    +
    + lib/models/per-bundle-addon-cache/index.js:116 +

    + public + + + allowCachingPerBundle(addonEntryPointModule): Boolean +

    +
    + + + +

    The default implementation here is to indicate if the original addon entry point has +the allowCachingPerBundle flag set either on itself or on its prototype.

    +

    If a consuming application specifies a relative path to a custom utility via the +ember-addon.perBundleAddonCacheUtil configuration, we prefer the custom implementation +provided by the consumer.

    +
    + +
    +

    Parameters:

    + + + + + + + + + + + + + + + + + + +
    NameTypeAttributeDescription
    addonEntryPointModuleObject | Function +
      + + + +
    +
    +
    + +
    +

    Return:

    +
    + Boolean +

    true if the given constructor function or class supports caching per bundle, false otherwise

    +
    +
    +
    + + +
    +
    +
    + lib/models/per-bundle-addon-cache/index.js:197 +

    + public + + + bundleHostOwnsInstance((Object}, addonPkgInfo): Boolean +

    +
    + + + +

    An optimization we support from lazy engines is the following:

    +

    If an addon instance is supposed to be bundled with a particular lazy engine, and +same addon is also to be bundled by a common LCA host, prefer the one bundled by the +host (since it's ultimately going to be deduped later by ember-engines).

    +

    NOTE: this only applies if this.engineAddonTransitiveDedupeEnabled is truthy. If it is not, +the bundle host always "owns" the addon instance.

    +

    If deduping is enabled and the LCA host also depends on the same addon, +the lazy-engine instances of the addon will all be proxies to the one in +the LCA host. This function indicates whether the bundle host passed in +(either the project or a lazy engine) is really the bundle host to "own" the +new addon.

    +
    + +
    +

    Parameters:

    + + + + + + + + + + + + + + + + + + + + + + + + + +
    NameTypeAttributeDescription
    (Object}Object +
      + + + +
    +

    bundleHost the project or lazy engine that is trying to "own" +the new addon instance specified by addonPkgInfo

    +
    addonPkgInfoPackageInfo +
      + + + +
    +

    the PackageInfo of the potential new addon instance

    +
    +
    + +
    +

    Return:

    +
    + Boolean +

    true if the bundle host is to "own" the instance, false otherwise.

    +
    +
    +
    + + +
    +
    +
    + lib/models/per-bundle-addon-cache/index.js:145 +

    + public + + + createAddonCacheEntry(addonInstance, addonRealPath): Object +

    +
    + + + +

    Create a cache entry object for a given (non-bundle-host) addon to put into +an addon cache.

    +
    + +
    +

    Parameters:

    + + + + + + + + + + + + + + + + + + + + + + + + + +
    NameTypeAttributeDescription
    addonInstanceAddon +
      + + + +
    +

    the addon instance to cache

    +
    addonRealPathString +
      + + + +
    +

    the addon's pkgInfo.realPath

    +
    +
    + +
    +

    Return:

    +
    + Object +

    an object in the form of an addon-cache entry

    +
    +
    +
    + + +
    +
    +
    + lib/models/per-bundle-addon-cache/index.js:132 +

    + public + + + createBundleHostCacheEntry(bundleHostPkgInfo): Object +

    +
    + + + +

    Creates a cache entry for the bundleHostCache. Because we want to use the same sort of proxy +for both bundle hosts and for 'regular' addon instances (though their cache entries have +slightly different structures) we'll use the Symbol from getAddonProxy.

    +
    + +
    +

    Parameters:

    + + + + + + + + + + + + + + + + + + +
    NameTypeAttributeDescription
    bundleHostPkgInfoPackageInfo +
      + + + +
    +

    bundle host's pkgInfo.realPath

    +
    +
    + +
    +

    Return:

    +
    + Object +

    an object in the form of a bundle-host cache entry

    +
    +
    +
    + + +
    +
    +
    + lib/models/per-bundle-addon-cache/index.js:158 +

    + public + + + findBundleHost(addonParent, addonPkgInfo): Object +

    +
    + + + +

    Given a parent object of a potential addon (another addon or the project), +go up the 'parent' chain to find the potential addon's bundle host object +(i.e. lazy engine or project.) Because Projects are always bundle hosts, +this should always pass, but we'll throw if somehow it doesn't work.

    +
    + +
    +

    Parameters:

    + + + + + + + + + + + + + + + + + + + + + + + + + +
    NameTypeAttributeDescription
    addonParentProject | Addon +
      + + + +
    +

    the direct parent object of a (potential or real) addon.

    +
    addonPkgInfoPackageInfo +
      + + + +
    +

    the PackageInfo for an addon being instantiated. This is only +used for information if an error is going to be thrown.

    +
    +
    + +
    +

    Return:

    +
    + Object +

    the object in the 'parent' chain that is a bundle host.

    +
    +
    +
    + +
    +

    Throws:

    +
    + Error +

    if there is not bundle host

    +
    +
    +
    + +
    +
    +
    + lib/models/per-bundle-addon-cache/index.js:247 +

    + public + + + getAddonInstance(parent, addonPkgInfo): Addon | Proxy +

    +
    + + + +

    Called from PackageInfo.getAddonInstance(), return an instance of the requested +addon or a Proxy, based on the type of addon and its bundle host.

    +
    + +
    +

    Parameters:

    + + + + + + + + + + + + + + + + + + + + + + + + + +
    NameTypeAttributeDescription
    parentAddon | Project +
      + + + +
    +

    the parent Addon or Project this addon instance is +a child of.

    +
    addonPkgInfo +
      + + + +
    +

    the PackageInfo for the addon being created.

    +
    +
    + +
    +

    Return:

    +
    + Addon | Proxy +

    An addon instance (for the first copy of the addon) or a Proxy. +An addon that is a lazy engine will only ever have a single copy in the cache. +An addon that is not will have 1 copy per bundle host (Project or lazy engine), +except if it is an addon that's also owned by a given LCA host and transitive +dedupe is enabled (engineAddonTransitiveDedupeEnabled), in which case it will +only have a single copy in the project's addon cache.

    +
    +
    +
    + + +
    +
    +
    + lib/models/per-bundle-addon-cache/addon-proxy.js:42 +

    + public + + + getAddonProxy(targetCacheEntry, parent): +

    +
    + + + +

    Returns a proxy to a target with specific handling for the +parent property, as well has to handle the app property; +that is, the proxy should maintain correct local state in +closure scope for the app property if it happens to be set +by ember-cli. Other than parent & app, this function also +proxies almost everything to target[TARGET_INSTANCE] with a few exceptions: we trap & return[]foraddons, and we don't return the originalincluded(it's already called on the "real" addon byember-cli`).

    +

    Note: the target is NOT the per-bundle cacheable instance of the addon. Rather, +it is a cache entry POJO from PerBundleAddonCache.

    +
    + +
    +

    Parameters:

    + + + + + + + + + + + + + + + + + + + + + + + + + +
    NameTypeAttributeDescription
    targetCacheEntryObject +
      + + + +
    +

    the PerBundleAddonCache cache entry we are to proxy. It +has one interesting property, the real addon instance the proxy is forwarding +calls to (that property is not globally exposed).

    +
    parentObject +
      + + + +
    +

    the parent object of the proxy being created (the same as +the 'parent' property of a normal addon instance)

    +
    +
    + +
    +

    Return:

    +
    + +

    Proxy

    +
    +
    +
    + + +
    +
    +
    + lib/models/per-bundle-addon-cache/index.js:17 +

    + public + + + resolvePerBundleAddonCacheUtil(project): AllowCachingPerBundle: Function +

    +
    + + + +

    Resolves the perBundleAddonCacheUtil; this prefers the custom provided version by +the consuming application, and defaults to an internal implementation here.

    +
    + +
    +

    Parameters:

    + + + + + + + + + + + + + + + + + + +
    NameTypeAttributeDescription
    projectProject +
      + + + +
    +
    +
    + +
    +

    Return:

    +
    + AllowCachingPerBundle: Function +

    }

    +
    +
    +
    + + +
    +
    +
    + lib/models/per-bundle-addon-cache/addon-proxy.js:7 +

    + public + + + validateCacheKey(realAddonInstance, treeType, newCacheKey) +

    +
    + + + +

    Validates that a new cache key for a given tree type matches the previous +cache key for the same tree type. To opt-in to bundle addon caching for +a given addon it's assumed that it returns stable cache keys; specifically +this is because the interplay between bundle addon caching and ember-engines +when transitive deduplication is enabled assumes stable cache keys, so we validate +for this case here.

    +
    + +
    +

    Parameters:

    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    NameTypeAttributeDescription
    realAddonInstanceAddon +
      + + + +
    +

    The real addon instance

    +
    treeTypeString +
      + + + +
    +
    newCacheKeyString +
      + + + +
    +
    +
    + + +
    +

    Throws:

    +
    + Error +

    If the new cache key doesn't match the previous cache key

    +
    +
    +
    + +
    +
    + + + + +
    +
    +
    +
    + + + + + diff --git a/api/classes/Project.html b/api/classes/Project.html index 6ba3c8c..12735df 100644 --- a/api/classes/Project.html +++ b/api/classes/Project.html @@ -42,7 +42,6 @@

    Classes

  • Builder
  • CLI
  • Command
  • -
  • CommandGenerator
  • DefaultPackager
  • EmberAddon
  • EmberApp
  • @@ -51,10 +50,9 @@

    Classes

  • Instrumentation
  • NodeModulesList
  • NpmTask
  • -
  • PackageCache
  • PackageInfo
  • PackageInfoCache
  • -
  • PrivateTestHelpers
  • +
  • PerBundleAddonCache
  • Project
  • ServeFilesAddon
  • TestsServerAddon
  • @@ -127,7 +125,6 @@

    Project

  • addonBlueprintLookupPaths
  • addonCommands
  • blueprintLookupPaths
  • -
  • bowerDependencies
  • configPath
  • configWithoutCache
  • dependencies
  • @@ -142,7 +139,6 @@

    Project

  • reloadAddons
  • reloadPkg
  • resolveSync
  • -
  • setupBowerDirectory
  • supportedInternalAddonPaths
  • @@ -151,7 +147,7 @@

    Project

    - Version: 3.21.2 + Version: 5.4.0-a905f346b9
    @@ -216,7 +212,7 @@

    Static Method Summary

    closestSync(pathName, _ui): Project
    -

    Returns a new project based on the first package.json that is found in pathName.

    +

    Returns a new project based on the first package.json that is found in pathName.

    @@ -469,21 +465,6 @@

    Method Summary

    private - - - -
    -

    Returns the bower dependencies for this project.

    -
    - - - - - private - -
    @@ -670,7 +651,7 @@

    Method Summary

    reloadPkg( ): Object
    -

    Reloads package.json

    +

    Reloads package.json of the project. Clears and reloads the packageInfo and per-bundle addon cache, too.

    @@ -694,21 +675,6 @@

    Method Summary

    private - - - -
    -

    Sets the name of the bower directory for this project

    -
    - - - - - private - -
    @@ -729,7 +695,7 @@

    Method Summary

    Static Public Methods

    - lib/models/project.js:705 + lib/models/project.js:694

    public static @@ -762,7 +728,7 @@

    Return:

    Static Private Methods

    - lib/models/project.js:645 + lib/models/project.js:619

    private static @@ -773,8 +739,11 @@

    -

    Returns a new project based on the first package.json that is found +

    Returns a new project based on the first package.json that is found in pathName.

    +

    If the above package.json specifies ember-addon.projectRoot, we load +the project based on the relative path between this directory and the +specified projectRoot.

    @@ -834,7 +803,7 @@

    Return:

    - lib/models/project.js:681 + lib/models/project.js:670

    private static @@ -991,7 +960,7 @@

    Parameters:

    Public Properties

    - lib/models/project.js:264 + lib/models/project.js:244

    public @@ -1025,7 +994,7 @@

    Set when the Watcher.detectWatchman helper method finishes running, so that other areas of the system can be aware that watchman is being used.

    For example, this information is used in the broccoli build pipeline to know -if we can watch additional directories (like bower_components) "cheaply".

    +if we can watch additional directories "cheaply".

    Contains enabled and version.

    @@ -1036,7 +1005,7 @@

    Public Methods

    - lib/models/project.js:226 + lib/models/project.js:206

    public @@ -1093,7 +1062,7 @@

    Return:

    - lib/models/project.js:607 + lib/models/project.js:581

    public @@ -1150,7 +1119,7 @@

    Return:

    - lib/models/project.js:621 + lib/models/project.js:595

    public @@ -1163,7 +1132,7 @@

    Generate test file contents.

    This method is supposed to be overwritten by test framework addons -like ember-qunit and ember-mocha.

    +like ember-qunit.

    @@ -1223,7 +1192,7 @@

    Return:

    - lib/models/project.js:199 + lib/models/project.js:179

    public @@ -1251,7 +1220,7 @@

    Return:

    - lib/models/project.js:340 + lib/models/project.js:320

    public @@ -1315,7 +1284,7 @@

    Return:

    Private Methods

    - lib/models/project.js:554 + lib/models/project.js:517

    private @@ -1343,7 +1312,7 @@

    Return:

    - lib/models/project.js:461 + lib/models/project.js:424

    private @@ -1372,7 +1341,7 @@

    Return:

    - lib/models/project.js:536 + lib/models/project.js:499

    private @@ -1397,67 +1366,10 @@

    Return:

    -
    -
    -
    - lib/models/project.js:375 -

    - private - - - bowerDependencies(bower): Object -

    -
    - - - -

    Returns the bower dependencies for this project.

    -
    - -
    -

    Parameters:

    - - - - - - - - - - - - - - - - - - -
    NameTypeAttributeDescription
    bowerString -
      - - - -
    -

    Path to bower.json

    -
    -
    - -
    -

    Return:

    -
    - Object -

    Bower dependencies

    -
    -
    -
    - -
    - lib/models/project.js:209 + lib/models/project.js:189

    private @@ -1485,7 +1397,7 @@

    Return:

    - lib/models/project.js:245 + lib/models/project.js:225

    private @@ -1541,7 +1453,7 @@

    Return:

    - lib/models/project.js:355 + lib/models/project.js:335

    private @@ -1612,7 +1524,7 @@

    Return:

    - lib/models/project.js:417 + lib/models/project.js:381

    private @@ -1634,7 +1546,7 @@

    - lib/models/project.js:502 + lib/models/project.js:465

    private @@ -1688,7 +1600,7 @@

    Parameters:

    - lib/models/project.js:291 + lib/models/project.js:271

    private @@ -1759,7 +1671,7 @@

    Return:

    - lib/models/project.js:314 + lib/models/project.js:294

    private @@ -1816,7 +1728,7 @@

    Return:

    - lib/models/project.js:441 + lib/models/project.js:403

    private @@ -1836,7 +1748,7 @@

    - lib/models/project.js:187 + lib/models/project.js:167

    private @@ -1865,7 +1777,7 @@

    Return:

    - lib/models/project.js:525 + lib/models/project.js:488

    private @@ -1893,7 +1805,7 @@

    Return:

    - lib/models/project.js:174 + lib/models/project.js:154

    private @@ -1921,7 +1833,7 @@

    Return:

    - lib/models/project.js:595 + lib/models/project.js:568

    private @@ -1941,7 +1853,7 @@

    - lib/models/project.js:577 + lib/models/project.js:540

    private @@ -1952,7 +1864,8 @@

    -

    Reloads package.json

    +

    Reloads package.json of the project. Clears and reloads the packageInfo and +per-bundle addon cache, too.

    @@ -1969,7 +1882,7 @@

    Return:

    - lib/models/project.js:326 + lib/models/project.js:306

    private @@ -2023,30 +1936,10 @@

    Return:

    -
    -
    -
    - lib/models/project.js:101 -

    - private - - - setupBowerDirectory( ) -

    -
    - - - -

    Sets the name of the bower directory for this project

    -
    - - - -
    - lib/models/project.js:391 + lib/models/project.js:355

    private diff --git a/api/classes/ServeFilesAddon.html b/api/classes/ServeFilesAddon.html index fd22c07..4ecc831 100644 --- a/api/classes/ServeFilesAddon.html +++ b/api/classes/ServeFilesAddon.html @@ -42,7 +42,6 @@

    Classes

  • Builder
  • CLI
  • Command
  • -
  • CommandGenerator
  • DefaultPackager
  • EmberAddon
  • EmberApp
  • @@ -51,10 +50,9 @@

    Classes

  • Instrumentation
  • NodeModulesList
  • NpmTask
  • -
  • PackageCache
  • PackageInfo
  • PackageInfoCache
  • -
  • PrivateTestHelpers
  • +
  • PerBundleAddonCache
  • Project
  • ServeFilesAddon
  • TestsServerAddon
  • @@ -105,7 +103,7 @@

    ServeFilesAddon

    - Version: 3.21.2 + Version: 5.4.0-a905f346b9
    diff --git a/api/classes/TestsServerAddon.html b/api/classes/TestsServerAddon.html index f143834..43cba14 100644 --- a/api/classes/TestsServerAddon.html +++ b/api/classes/TestsServerAddon.html @@ -42,7 +42,6 @@

    Classes

  • Builder
  • CLI
  • Command
  • -
  • CommandGenerator
  • DefaultPackager
  • EmberAddon
  • EmberApp
  • @@ -51,10 +50,9 @@

    Classes

  • Instrumentation
  • NodeModulesList
  • NpmTask
  • -
  • PackageCache
  • PackageInfo
  • PackageInfoCache
  • -
  • PrivateTestHelpers
  • +
  • PerBundleAddonCache
  • Project
  • ServeFilesAddon
  • TestsServerAddon
  • @@ -100,7 +98,7 @@

    TestsServerAddon

    - Version: 3.21.2 + Version: 5.4.0-a905f346b9
    @@ -115,7 +113,7 @@

    TestsServerAddon

    This addon is used to serve the QUnit or Mocha test runner -at baseURL + '/tests'.

    +at rootURL + '/tests'.

    @@ -141,7 +139,7 @@

    Constructor Summary

    TestsServerAddon( )
    -

    This addon is used to serve the QUnit or Mocha test runner at baseURL + '/tests'.

    +

    This addon is used to serve the QUnit or Mocha test runner at rootURL + '/tests'.

    diff --git a/api/classes/WatcherAddon.html b/api/classes/WatcherAddon.html index 39df8c8..3243406 100644 --- a/api/classes/WatcherAddon.html +++ b/api/classes/WatcherAddon.html @@ -42,7 +42,6 @@

    Classes

  • Builder
  • CLI
  • Command
  • -
  • CommandGenerator
  • DefaultPackager
  • EmberAddon
  • EmberApp
  • @@ -51,10 +50,9 @@

    Classes

  • Instrumentation
  • NodeModulesList
  • NpmTask
  • -
  • PackageCache
  • PackageInfo
  • PackageInfoCache
  • -
  • PrivateTestHelpers
  • +
  • PerBundleAddonCache
  • Project
  • ServeFilesAddon
  • TestsServerAddon
  • @@ -100,7 +98,7 @@

    WatcherAddon

    - Version: 3.21.2 + Version: 5.4.0-a905f346b9
    diff --git a/api/classes/WindowsSymlinkChecker.html b/api/classes/WindowsSymlinkChecker.html index ef8695d..43b4bff 100644 --- a/api/classes/WindowsSymlinkChecker.html +++ b/api/classes/WindowsSymlinkChecker.html @@ -42,7 +42,6 @@

    Classes

  • Builder
  • CLI
  • Command
  • -
  • CommandGenerator
  • DefaultPackager
  • EmberAddon
  • EmberApp
  • @@ -51,10 +50,9 @@

    Classes

  • Instrumentation
  • NodeModulesList
  • NpmTask
  • -
  • PackageCache
  • PackageInfo
  • PackageInfoCache
  • -
  • PrivateTestHelpers
  • +
  • PerBundleAddonCache
  • Project
  • ServeFilesAddon
  • TestsServerAddon
  • @@ -90,11 +88,11 @@

    WindowsSymlinkChecker

    @@ -180,10 +177,10 @@

    Method Summary

    - calculateBaseTag(baseURL, locationType): String + checkIfSymlinksNeedToBeEnabled( ): Promise
    -

    Returns the tag for index.html.

    +

    if not windows, will fulfill with: { windows: false, elevated: null) if windows, and elevated will fulfill with: { windows: false, elevated: true) if windows, and is NOT elevated will fulfill with: { windows: false, elevated: false) will include heplful warning, so that users know (if possible) how to achieve better windows build performance

    @@ -198,7 +195,7 @@

    Method Summary

    checkIfSymlinksNeedToBeEnabled( ): Promise
    -

    if not windows, will fulfill with: { windows: false, elevated: null) if windows, and elevated will fulfill with: { windows: false, elevated: true) if windows, and is NOT elevated will fulfill with: { windows: false, elevated: false) will include heplful warning, so that users know (if possible) how to achieve better windows build performance

    +
    @@ -210,10 +207,10 @@

    Method Summary

    - checkIfSymlinksNeedToBeEnabled( ): Promise + contentFor(config, match, type, options): String
    - +

    Returns the content for a specific type (section) for index.html.

    @@ -225,10 +222,10 @@

    Method Summary

    - contentFor(config, match, type, options): String + convertObjectToString(Any): String
    -

    Returns the content for a specific type (section) for index.html.

    +

    Converts Javascript Object to a string. Returns an empty object string representation if a "falsy" value is passed in.

    @@ -240,10 +237,10 @@

    Method Summary

    -

    Converts Javascript Object to a string. Returns an empty object string representation if a "falsy" value is passed in.

    +

    Derive a directory name from a package name. Takes scoped packages into account.

    @@ -413,21 +410,6 @@

    Method Summary

    private - - -
    - isYarnProject(thePath): Boolean -
    -
    -

    Returns true if and only if the given directory has a yarn.lock file or is a child of a yarn workspace root.

    -
    - - - - - private - -
    @@ -500,76 +482,6 @@

    Method Summary

    Public Methods

    -
    -
    - lib/utilities/ember-app-utils.js:37 -

    - public - - - calculateBaseTag(baseURL, locationType): String -

    -
    - - - -

    Returns the tag for index.html.

    -
    - -
    -

    Parameters:

    - - - - - - - - - - - - - - - - - - - - - - - - - -
    NameTypeAttributeDescription
    baseURLString -
      - - - -
    -
    locationTypeString -
      - - - -
    -

    'history', 'none' or 'hash'.

    -
    -
    - -
    -

    Return:

    -
    - String -

    Base tag or an empty string

    -
    -
    -
    - - -
    lib/utilities/windows-admin.js:38 @@ -634,7 +546,7 @@

    Return:

    +
    +
    + lib/utilities/directory-for-package-name.js:5 +

    + public + + + directoryForPackageName(packageName): String +

    +
    + + + +

    Derive a directory name from a package name. +Takes scoped packages into account.

    +
    + +
    +

    Parameters:

    + + + + + + + + + + + + + + + + + + +
    NameTypeAttributeDescription
    packageNameString +
      + + + +
    +
    +
    + +
    +

    Return:

    +
    + String +

    Derived directory name.

    +
    +
    +
    + +
    @@ -856,15 +825,15 @@

    option to false.

    Example:

    // app/router.js
    -Router.map(function() {
    +Router.map(function () {
     });
     
    insertIntoFile('app/router.js', '  this.route("admin");', {
    -  after: 'Router.map(function() {' + EOL
    +  after: 'Router.map(function () {' + EOL
     });
     
    // app/router.js
    -Router.map(function() {
    +Router.map(function () {
       this.route("admin");
     });
     
    @@ -1318,66 +1287,10 @@

    Parameters:

    -
    -
    -
    - lib/utilities/is-yarn-project.js:6 -

    - private - - - isYarnProject(thePath): Boolean -

    -
    - - - -

    Returns true if and only if the given directory has a yarn.lock file or is a child of a -yarn workspace root.

    -
    - -
    -

    Parameters:

    - - - - - - - - - - - - - - - - - - -
    NameTypeAttributeDescription
    thePathString -
      - - - -
    -
    -
    - -
    -

    Return:

    -
    - Boolean - -
    -
    - -
    - lib/tasks/serve.js:100 + lib/tasks/serve.js:102

    private diff --git a/api/data.json b/api/data.json index 42cccd3..37b8ab1 100644 --- a/api/data.json +++ b/api/data.json @@ -3,7 +3,7 @@ "logo": "https://ember-cli.com/assets/images/ember-cli-logo-small-dark.png", "name": "ember-cli", "description": "Command line tool for developing ambitious ember.js apps", - "version": "3.21.2" + "version": "5.4.0-a905f346b9" }, "files": { "lib/broccoli/default-packager.js": { @@ -44,6 +44,20 @@ "fors": {}, "namespaces": {} }, + "lib/debug/assert.js": { + "name": "lib/debug/assert.js", + "modules": {}, + "classes": {}, + "fors": {}, + "namespaces": {} + }, + "lib/debug/deprecate.js": { + "name": "lib/debug/deprecate.js", + "modules": {}, + "classes": {}, + "fors": {}, + "namespaces": {} + }, "lib/models/package-info-cache/index.js": { "name": "lib/models/package-info-cache/index.js", "modules": {}, @@ -71,6 +85,29 @@ "fors": {}, "namespaces": {} }, + "lib/models/per-bundle-addon-cache/addon-proxy.js": { + "name": "lib/models/per-bundle-addon-cache/addon-proxy.js", + "modules": {}, + "classes": {}, + "fors": {}, + "namespaces": {} + }, + "lib/models/per-bundle-addon-cache/index.js": { + "name": "lib/models/per-bundle-addon-cache/index.js", + "modules": {}, + "classes": { + "PerBundleAddonCache": 1 + }, + "fors": {}, + "namespaces": {} + }, + "lib/models/per-bundle-addon-cache/target-instance.js": { + "name": "lib/models/per-bundle-addon-cache/target-instance.js", + "modules": {}, + "classes": {}, + "fors": {}, + "namespaces": {} + }, "lib/models/addon-info.js": { "name": "lib/models/addon-info.js", "modules": {}, @@ -125,8 +162,8 @@ }, "namespaces": {} }, - "lib/models/installation-checker.js": { - "name": "lib/models/installation-checker.js", + "lib/models/host-info-cache.js": { + "name": "lib/models/host-info-cache.js", "modules": {}, "classes": {}, "fors": {}, @@ -239,6 +276,13 @@ "fors": {}, "namespaces": {} }, + "lib/utilities/directory-for-package-name.js": { + "name": "lib/utilities/directory-for-package-name.js", + "modules": {}, + "classes": {}, + "fors": {}, + "namespaces": {} + }, "lib/utilities/ember-app-utils.js": { "name": "lib/utilities/ember-app-utils.js", "modules": {}, @@ -253,8 +297,8 @@ "fors": {}, "namespaces": {} }, - "lib/utilities/is-yarn-project.js": { - "name": "lib/utilities/is-yarn-project.js", + "lib/utilities/is-lazy-engine.js": { + "name": "lib/utilities/is-lazy-engine.js", "modules": {}, "classes": {}, "fors": {}, @@ -282,54 +326,6 @@ }, "fors": {}, "namespaces": {} - }, - "tests/helpers/acceptance.js": { - "name": "tests/helpers/acceptance.js", - "modules": {}, - "classes": { - "PrivateTestHelpers": 1 - }, - "fors": {}, - "namespaces": {} - }, - "tests/helpers/command-generator.js": { - "name": "tests/helpers/command-generator.js", - "modules": {}, - "classes": { - "CommandGenerator": 1 - }, - "fors": {}, - "namespaces": {} - }, - "tests/helpers/package-cache.js": { - "name": "tests/helpers/package-cache.js", - "modules": {}, - "classes": { - "PackageCache": 1 - }, - "fors": {}, - "namespaces": {} - }, - "tests/unit/models/addon-test.js": { - "name": "tests/unit/models/addon-test.js", - "modules": {}, - "classes": {}, - "fors": {}, - "namespaces": {} - }, - "tests/.eslintrc.js": { - "name": "tests/.eslintrc.js", - "modules": {}, - "classes": {}, - "fors": {}, - "namespaces": {} - }, - ".eslintrc.js": { - "name": ".eslintrc.js", - "modules": {}, - "classes": {}, - "fors": {}, - "namespaces": {} } }, "modules": { @@ -345,6 +341,7 @@ "PackageInfoCache": 1, "NodeModulesList": 1, "PackageInfo": 1, + "PerBundleAddonCache": 1, "Addon": 1, "Blueprint": 1, "Builder": 1, @@ -358,10 +355,7 @@ "TestsServerAddon": 1, "AmdTransformAddon": 1, "NpmTask": 1, - "WindowsSymlinkChecker": 1, - "PrivateTestHelpers": 1, - "CommandGenerator": 1, - "PackageCache": 1 + "WindowsSymlinkChecker": 1 }, "fors": { "HardwareInfo": 1 @@ -370,8 +364,8 @@ "Blueprint": 1 }, "tag": "module", - "file": "tests/helpers/package-cache.js", - "line": 102, + "file": "lib/utilities/windows-admin.js", + "line": 6, "access": "private", "tagname": "", "is_constructor": 1, @@ -389,7 +383,7 @@ "extension_for": [], "module": "ember-cli", "file": "lib/broccoli/default-packager.js", - "line": 99, + "line": 98, "description": "Responsible for packaging Ember.js application.", "is_constructor": 1 }, @@ -435,8 +429,8 @@ "module": "ember-cli", "namespace": "", "file": "lib/broccoli/ember-app.js", - "line": 73, - "description": "EmberApp is the main class Ember CLI uses to manage the Broccoli trees\nfor your application. It is very tightly integrated with Broccoli and has\na `toTree()` method you can use to get the entire tree for your application.\n\nAvailable init options:\n- storeConfigInMeta, defaults to `true`\n- autoRun, defaults to `true`\n- outputPaths, defaults to `{}`\n- minifyCSS, defaults to `{enabled: !!isProduction,options: { relativeTo: 'assets' }}\n- minifyJS, defaults to `{enabled: !!isProduction}\n- sourcemaps, defaults to `{}`\n- trees, defaults to `{}`\n- jshintrc, defaults to `{}`\n- vendorFiles, defaults to `{}`\n- addons, defaults to `{ blacklist: [], whitelist: [] }`", + "line": 60, + "description": "EmberApp is the main class Ember CLI uses to manage the Broccoli trees\nfor your application. It is very tightly integrated with Broccoli and has\na `toTree()` method you can use to get the entire tree for your application.\n\nAvailable init options:\n- storeConfigInMeta, defaults to `true`\n- autoRun, defaults to `true`\n- outputPaths, defaults to `{}`\n- minifyCSS, defaults to `{enabled: !!isProduction,options: { relativeTo: 'assets' }}\n- sourcemaps, defaults to `{}`\n- trees, defaults to `{}`\n- vendorFiles, defaults to `{}`\n- addons, defaults to `{ exclude: [], include: [] }`", "is_constructor": 1, "params": [ { @@ -519,11 +513,27 @@ "module": "ember-cli", "namespace": "", "file": "lib/models/package-info-cache/package-info.js", - "line": 47, + "line": 50, "description": "Class that stores information about a single package (directory tree with\na package.json and other data, like and Addon or Project.) It is one of the\ntwo types of entries in a PackageInfoCache. It is only created by the\nPackageInfoCache.", "access": "public", "tagname": "" }, + "PerBundleAddonCache": { + "name": "PerBundleAddonCache", + "shortname": "PerBundleAddonCache", + "classitems": [], + "plugins": [], + "extensions": [], + "plugin_for": [], + "extension_for": [], + "module": "ember-cli", + "namespace": "", + "file": "lib/models/per-bundle-addon-cache/index.js", + "line": 46, + "description": "For large applications with many addons (and many instances of each, resulting in\npotentially many millions of addon instances during a build), the build can become\nvery, very slow (tens of minutes) partially due to the sheer number of addon instances.\nThe PerBundleAddonCache deals with this slowness by doing 3 things:\n\n(1) Making only a single copy of each of certain addons and their dependent addons\n(2) Replacing any other instances of those addons with Proxy copies to the single instance\n(3) Having the Proxies return an empty array for their dependent addons, rather\n than proxying to the contents of the single addon instance. This gives up the\n ability of the Proxies to traverse downward into their child addons,\n something that many addons do not do anyway, for the huge reduction in duplications\n of those child addons. For applications that enable `ember-engines` dedupe logic,\n that logic is stateful, and having the Proxies allow access to the child addons array\n just breaks everything, because that logic will try multiple times to remove items\n it thinks are duplicated, messing up the single copy of the child addon array.\n See the explanation of the dedupe logic in\n {@link https://github.com/ember-engines/ember-engines/blob/master/packages/ember-engines/lib/utils/deeply-non-duplicated-addon.js}\n\nWhat follows are the more technical details of how the PerBundleAddonCache implements\nthe above 3 behaviors.\n\nThis class supports per-bundle-host (bundle host = project or lazy engine)\ncaching of addon instances. During addon initialization we cannot add a\ncache to each bundle host object AFTER it is instantiated because running the\naddon constructor ultimately causes Addon class `setupRegistry` code to\nrun which instantiates child addons, which need the cache to already be\nin place for the parent bundle host.\nWe handle this by providing a global cache that exists independent of the\nbundle host objects. That is this object.\n\nThere are a number of \"behaviors\" being implemented by this object and\nits contents. They are:\n(1) Any addon that is a lazy engine has only a single real instance per\nproject - all other references to the lazy engine are to be proxies. These\nlazy engines are compared by name, not by packageInfo.realPath.\n(2) Any addon that is not a lazy engine, there is only a single real instance\nof the addon per \"bundle host\" (i.e. lazy engine or project).\n(3) An optimization - any addon that is in a lazy engine but that is also\nin bundled by its LCA host - the single instance is the one bundled by this\nhost. All other instances (in any lazy engine) are proxies.\n\nNOTE: the optimization is only enabled if the environment variable that controls\n`ember-engines` transitive deduplication (process.env.EMBER_ENGINES_ADDON_DEDUPE)\nis set to a truthy value. For more info, see:\nhttps://github.com/ember-engines/ember-engines/blob/master/packages/ember-engines/lib/engine-addon.js#L396", + "access": "public", + "tagname": "" + }, "Addon": { "name": "Addon", "shortname": "Addon", @@ -535,7 +545,7 @@ "module": "ember-cli", "namespace": "", "file": "lib/models/addon.js", - "line": 137, + "line": 122, "description": "Root class for an Addon. If your addon module exports an Object this\nwill be extended from this base class. If you export a constructor (function),\nit will **not** extend from this class.\n\nHooks:\n\n- {{#crossLink \"Addon/config:method\"}}{{/crossLink}}\n- {{#crossLink \"Addon/blueprintsPath:method\"}}{{/crossLink}}\n- {{#crossLink \"Addon/includedCommands:method\"}}{{/crossLink}}\n- {{#crossLink \"Addon/importTransforms:method\"}}{{/crossLink}}\n- {{#crossLink \"Addon/serverMiddleware:method\"}}{{/crossLink}}\n- {{#crossLink \"Addon/testemMiddleware:method\"}}{{/crossLink}}\n- {{#crossLink \"Addon/postBuild:method\"}}{{/crossLink}}\n- {{#crossLink \"Addon/preBuild:method\"}}{{/crossLink}}\n- {{#crossLink \"Addon/outputReady:method\"}}{{/crossLink}}\n- {{#crossLink \"Addon/buildError:method\"}}{{/crossLink}}\n- {{#crossLink \"Addon/included:method\"}}{{/crossLink}}\n- {{#crossLink \"Addon/shouldIncludeChildAddon:method\"}}{{/crossLink}}\n- {{#crossLink \"Addon/setupPreprocessorRegistry:method\"}}{{/crossLink}}\n- {{#crossLink \"Addon/preprocessTree:method\"}}{{/crossLink}}\n- {{#crossLink \"Addon/postprocessTree:method\"}}{{/crossLink}}\n- {{#crossLink \"Addon/lintTree:method\"}}{{/crossLink}}\n- {{#crossLink \"Addon/contentFor:method\"}}{{/crossLink}}\n- {{#crossLink \"Addon/treeFor:method\"}}{{/crossLink}}", "extends": "CoreObject", "is_constructor": 1, @@ -563,7 +573,7 @@ "module": "ember-cli", "namespace": "Blueprint", "file": "lib/models/blueprint.js", - "line": 30, + "line": 29, "description": "A blueprint is a bundle of template files with optional install\nlogic.\n\nBlueprints follow a simple structure. Let's take the built-in\n`controller` blueprint as an example:\n\n```\nblueprints/controller\n├── files\n│ ├── app\n│ │ └── __path__\n│ │ └── __name__.js\n└── index.js\n\nblueprints/controller-test\n├── files\n│ └── tests\n│ └── unit\n│ └── controllers\n│ └── __test__.js\n└── index.js\n```\n\n## Files\n\n`files` contains templates for the all the files to be\ninstalled into the target directory.\n\nThe `__name__` token is subtituted with the dasherized\nentity name at install time. For example, when the user\ninvokes `ember generate controller foo` then `__name__` becomes\n`foo`. When the `--pod` flag is used, for example `ember\ngenerate controller foo --pod` then `__name__` becomes\n`controller`.\n\nThe `__path__` token is substituted with the blueprint\nname at install time. For example, when the user invokes\n`ember generate controller foo` then `__path__` becomes\n`controller`. When the `--pod` flag is used, for example\n`ember generate controller foo --pod` then `__path__`\nbecomes `foo` (or `/foo` if the\npodModulePrefix is defined). This token is primarily for\npod support, and is only necessary if the blueprint can be\nused in pod structure. If the blueprint does not require pod\nsupport, simply use the blueprint name instead of the\n`__path__` token.\n\nThe `__test__` token is substituted with the dasherized\nentity name and appended with `-test` at install time.\nThis token is primarily for pod support and only necessary\nif the blueprint requires support for a pod structure. If\nthe blueprint does not require pod support, simply use the\n`__name__` token instead.\n\n## Template Variables (AKA Locals)\n\nVariables can be inserted into templates with\n`<%= someVariableName %>`.\n\nFor example, the built-in `util` blueprint\n`files/app/utils/__name__.js` looks like this:\n\n```js\nexport default function <%= camelizedModuleName %>() {\n return true;\n}\n```\n\n`<%= camelizedModuleName %>` is replaced with the real\nvalue at install time.\n\nThe following template variables are provided by default:\n\n- `dasherizedPackageName`\n- `classifiedPackageName`\n- `dasherizedModuleName`\n- `classifiedModuleName`\n- `camelizedModuleName`\n\n`packageName` is the project name as found in the project's\n`package.json`.\n\n`moduleName` is the name of the entity being generated.\n\nThe mechanism for providing custom template variables is\ndescribed below.\n\n## Index.js\n\nCustom installation and uninstallation behavior can be added\nby overriding the hooks documented below. `index.js` should\nexport a plain object, which will extend the prototype of the\n`Blueprint` class. If needed, the original `Blueprint` prototype\ncan be accessed through the `_super` property.\n\n```js\nmodule.exports = {\n locals(options) {\n // Return custom template variables here.\n return {};\n },\n\n normalizeEntityName(entityName) {\n // Normalize and validate entity name here.\n return entityName;\n },\n\n fileMapTokens(options) {\n // Return custom tokens to be replaced in your files\n return {\n __token__(options){\n // logic to determine value goes here\n return 'value';\n }\n }\n },\n\n filesPath(options) {\n return path.join(this.path, 'files');\n },\n\n beforeInstall(options) {},\n afterInstall(options) {},\n beforeUninstall(options) {},\n afterUninstall(options) {}\n\n};\n```\n\n## Blueprint Hooks\n\n### beforeInstall & beforeUninstall\n\nCalled before any of the template files are processed and receives\nthe `options` and `locals` hashes as parameters. Typically used for\nvalidating any additional command line options or for any asynchronous\nsetup that is needed. As an example, the `controller` blueprint validates\nits `--type` option in this hook. If you need to run any asynchronous code,\nwrap it in a promise and return that promise from these hooks. This will\nensure that your code is executed correctly.\n\n### afterInstall & afterUninstall\n\nThe `afterInstall` and `afterUninstall` hooks receives the same\narguments as `locals`. Use it to perform any custom work after the\nfiles are processed. For example, the built-in `route` blueprint\nuses these hooks to add and remove relevant route declarations in\n`app/router.js`.\n\n### Overriding Install\n\nIf you don't want your blueprint to install the contents of\n`files` you can override the `install` method. It receives the\nsame `options` object described above and must return a promise.\nSee the built-in `resource` blueprint for an example of this.", "is_constructor": 1, "extends": "CoreObject", @@ -573,6 +583,12 @@ "description": "", "type": "String", "optional": true + }, + { + "name": "blueprintOptions", + "description": "", + "type": "Object", + "optional": true } ] }, @@ -727,7 +743,7 @@ "namespace": "", "file": "lib/tasks/server/middleware/tests-server/index.js", "line": 9, - "description": "This addon is used to serve the QUnit or Mocha test runner\nat `baseURL + '/tests'`.", + "description": "This addon is used to serve the QUnit or Mocha test runner\nat `rootURL + '/tests'`.", "is_constructor": 1 }, "AmdTransformAddon": { @@ -741,7 +757,7 @@ "module": "ember-cli", "namespace": "", "file": "lib/tasks/transforms/amd/index.js", - "line": 6, + "line": 4, "description": "This addon is used to register a custom AMD transform for app and addons to use.", "is_constructor": 1 }, @@ -756,7 +772,7 @@ "module": "ember-cli", "namespace": "", "file": "lib/tasks/npm-task.js", - "line": 16, + "line": 14, "access": "private", "tagname": "", "is_constructor": 1, @@ -783,78 +799,13 @@ "description": "On Windows, users will have a much better experience if symlinks are enabled\n and usable. When queried, this object informs Windows users regarding\n improving their build performance, and how.\n > Windows Vista: nothing we can really do, so we fall back to junctions for folders + copying of files\n <= Windows Vista: symlinks are available but using them is somewhat tricky\n * if the user is an admin, the process needs to have been started with elevated privileges\n * if the user is not an admin, a specific setting needs to be enabled\n <= Windows 10\n * if developer mode is enabled, symlinks \"just work\"\n * https://blogs.windows.com/buildingapps/2016/12/02/symlinks-windows-10\n```js\n let checker = WindowsSymlinkChecker;\n let {\n windows,\n elevated\n } = await = checker.checkIfSymlinksNeedToBeEnabled(); // aslso emits helpful warnings\n ```", "access": "public", "tagname": "" - }, - "PrivateTestHelpers": { - "name": "PrivateTestHelpers", - "shortname": "PrivateTestHelpers", - "classitems": [], - "plugins": [], - "extensions": [], - "plugin_for": [], - "extension_for": [], - "module": "ember-cli", - "namespace": "", - "file": "tests/helpers/acceptance.js", - "line": 46 - }, - "CommandGenerator": { - "name": "CommandGenerator", - "shortname": "CommandGenerator", - "classitems": [], - "plugins": [], - "extensions": [], - "plugin_for": [], - "extension_for": [], - "module": "ember-cli", - "namespace": "", - "file": "tests/helpers/command-generator.js", - "line": 5, - "description": "A simple tool to make behavior and API consistent between commands\nthe user wraps in this.\n\nUsage:\n\n```\nvar bower = new CommandGenerator(require.resolve('bower/bin/bower'));\nbower.invoke('install', 'ember');\n```", - "access": "private", - "tagname": "", - "is_constructor": 1, - "params": [ - { - "name": "program", - "description": "The path to the command.", - "type": "Path" - } - ], - "return": { - "description": "A command helper.", - "type": "Function" - } - }, - "PackageCache": { - "name": "PackageCache", - "shortname": "PackageCache", - "classitems": [], - "plugins": [], - "extensions": [], - "plugin_for": [], - "extension_for": [], - "module": "ember-cli", - "namespace": "", - "file": "tests/helpers/package-cache.js", - "line": 102, - "description": "The PackageCache wraps all package management functions. It also\nhandles initial global state setup.\n\nUsage:\n\n```\nlet cache = new PackageCache();\nlet dir = cache.create('your-cache', 'yarn', '{\n \"dependencies\": {\n \"lodash\": \"*\",\n \"ember-cli\": \"*\"\n }\n}');\n// => process.cwd()/tmp/your-cache-A3B4C6D\n```\n\nThis will generate a persistent cache which contains the results\nof a clean installation of the `dependencies` as you specified in\nthe manifest argument. It will save the results of these in a\ntemporary folder, returned as `dir`. On a second invocation\n(in the same process, or in a subsequent run) PackageCache will first\ncompare the manifest to the previously installed one, using the manifest\nas the cache key, and make a decision as to the fastest way to get\nthe cache up-to-date. PackageCache guarantees that your cache will\nalways be up-to-date.\n\nIf done in the same process, this simply returns the existing cache\ndirectory with no change, making the following invocation simply a\ncache validation check:\n\n```\nlet dir2 = cache.create('your-cache', 'yarn', '{\n \"dependencies\": {\n \"lodash\": \"*\",\n \"ember-cli\": \"*\"\n }\n}');\n// => process.cwd()/tmp/your-cache-A3B4C6D\n```\n\nIf you wish to modify a cache you can do so using the `update` API:\n\n```\nlet dir3 = cache.update('your-cache', 'yarn', '{\n \"dependencies\": {\n \"\": \"*\",\n \"lodash\": \"*\",\n \"ember-cli\": \"*\"\n }\n}');\n// => process.cwd()/tmp/your-cache-A3B4C6D\n```\n\nUnderneath the hood `create` and `update` are identical–which\nmakes clear the simplicity of this tool. It will always do the\nright thing. You can think of the outcome of any `create` or\n`update` call as identical to `rm -rf node_modules && npm install`\nexcept as performant as possible.\n\nIf you need to make modifications to a cache but wish to retain\nthe original you can invoke the `clone` command:\n\n```\nlet newDir = cache.clone('your-cache', 'modified-cache');\nlet manifest = fs.readJsonSync(path.join(newDir, 'package.json'));\nmanifest.dependencies['express'] = '*';\ncache.update('modified-cache', 'yarn', JSON.stringify(manifest));\n// => process.cwd()/tmp/modified-cache-F8D5C8B\n```\n\nThis mental model makes it easy to prevent coding mistakes, state\nleakage across multiple test runs by making multiple caches cheap,\nand has tremendous performance benefits.\n\nYou can even programatically update a cache:\n\n```\nlet CommandGenerator = require('./command-generator');\nlet yarn = new CommandGenerator('yarn');\n\nlet dir = cache.create('your-cache', 'yarn', '{ ... }');\n\nyarn.invoke('add', 'some-addon', { cwd: dir });\n```\n\nThe programmatic approach enables the entire set of usecases that\nthe underlying package manager supports while continuing to wrap it\nin a persistent cache. You should not directly modify any files in the\ncache other than the manifest unless you really know what you're doing as\nthat can put the cache into a possibly invalid state.\n\nPackageCache also supports linking. If you pass an array of module names to\nin the fourth position it will ensure that those are linked, and remain\nlinked for the lifetime of the cache. When you link a package it uses the\ncurrent global link provided by the underlying package manager and invokes\ntheir built-in `link` command.\n\n```\nlet dir = cache.create('your-cache', 'yarn', '{ ... }', ['ember-cli']);\n// => `yarn link ember-cli` happens along the way.\n```\n\nSometimes this global linking behavior is not what you want. Instead you wish\nto link in some other working directory. PackageCache makes a best effort\nattempt at supporting this workflow by allowing you to specify an object in\nthe `links` argument array passed to `create`.\n\nlet dir = cache.create('your-cache', 'yarn', '{ ... }', [\n { name: 'ember-cli', path: '/the/absolute/path/to/the/package' },\n 'other-package'\n]);\n\nThis creates a symlink at the named package path to the specified directory.\nAs package managers do different things for their own linking behavior this\nis \"best effort\" only. Be sure to review upstream behavior to identify if you\nrely on those features for your code to function:\n\n- [bower](https://github.com/bower/bower/blob/master/lib/commands/link.js)\n- [npm](https://github.com/npm/npm/blob/latest/lib/link.js)\n- [yarn](https://github.com/yarnpkg/yarn/blob/master/src/cli/commands/link.js)\n\nAs the only caveat, PackageCache _is_ persistent. The consuming\ncode is responsible for ensuring that the cache size does not\ngrow unbounded.", - "access": "private", - "tagname": "", - "is_constructor": 1, - "params": [ - { - "name": "rootPath", - "description": "Root of the directory for `PackageCache`.", - "type": "String" - } - ] } }, "elements": {}, "classitems": [ { "file": "lib/broccoli/ember-app.js", - "line": 178, + "line": 180, "description": "Initializes the `tests` and `hinting` properties.\n\nDefaults to `false` unless `ember test` was used or this is *not* a production build.", "access": "private", "tagname": "", @@ -872,7 +823,7 @@ }, { "file": "lib/broccoli/ember-app.js", - "line": 194, + "line": 196, "description": "Initializes the `project` property from `options.project` or the\nclosest Ember CLI project from the current working directory.", "access": "private", "tagname": "", @@ -890,7 +841,7 @@ }, { "file": "lib/broccoli/ember-app.js", - "line": 215, + "line": 217, "description": "Initializes the `options` property from the `options` parameter and\na set of default values from Ember CLI.", "access": "private", "tagname": "", @@ -908,7 +859,7 @@ }, { "file": "lib/broccoli/ember-app.js", - "line": 369, + "line": 334, "description": "Resolves a path relative to the project's root", "access": "private", "tagname": "", @@ -919,7 +870,7 @@ }, { "file": "lib/broccoli/ember-app.js", - "line": 379, + "line": 344, "access": "private", "tagname": "", "itemtype": "method", @@ -929,7 +880,7 @@ }, { "file": "lib/broccoli/ember-app.js", - "line": 498, + "line": 371, "description": "Returns the environment name", "access": "public", "tagname": "", @@ -945,7 +896,7 @@ }, { "file": "lib/broccoli/ember-app.js", - "line": 510, + "line": 383, "description": "Delegates to `broccoli-concat` with the `sourceMapConfig` option set to `options.sourcemaps`.", "access": "private", "tagname": "", @@ -969,7 +920,7 @@ }, { "file": "lib/broccoli/ember-app.js", - "line": 525, + "line": 398, "description": "Checks the result of `addon.isEnabled()` if it exists, defaults to `true` otherwise.", "access": "private", "tagname": "", @@ -991,11 +942,11 @@ }, { "file": "lib/broccoli/ember-app.js", - "line": 537, + "line": 410, "access": "private", "tagname": "", "itemtype": "method", - "name": "_addonDisabledByBlacklist", + "name": "_addonDisabledByExclude", "params": [ { "name": "addon", @@ -1012,11 +963,11 @@ }, { "file": "lib/broccoli/ember-app.js", - "line": 548, + "line": 421, "access": "private", "tagname": "", "itemtype": "method", - "name": "_addonDisabledByWhitelist", + "name": "_addonDisabledByInclude", "params": [ { "name": "addon", @@ -1033,28 +984,7 @@ }, { "file": "lib/broccoli/ember-app.js", - "line": 559, - "access": "private", - "tagname": "", - "itemtype": "method", - "name": "_checkEmberCliBabel", - "params": [ - { - "name": "addons", - "description": "", - "type": "Addons" - } - ], - "return": { - "description": "", - "type": "Boolean" - }, - "class": "EmberApp", - "module": "ember-cli" - }, - { - "file": "lib/broccoli/ember-app.js", - "line": 587, + "line": 432, "description": "Returns whether an addon should be added to the project", "access": "private", "tagname": "", @@ -1076,7 +1006,7 @@ }, { "file": "lib/broccoli/ember-app.js", - "line": 603, + "line": 448, "description": "Calls the included hook on addons.", "access": "private", "tagname": "", @@ -1087,7 +1017,7 @@ }, { "file": "lib/broccoli/ember-app.js", - "line": 639, + "line": 484, "description": "Calls the importTransforms hook on addons.", "access": "private", "tagname": "", @@ -1098,7 +1028,7 @@ }, { "file": "lib/broccoli/ember-app.js", - "line": 688, + "line": 533, "description": "Loads and initializes addons for this project.\nCalls initializeAddons on the Project.", "access": "private", "tagname": "", @@ -1109,7 +1039,7 @@ }, { "file": "lib/broccoli/ember-app.js", - "line": 715, + "line": 560, "description": "Returns a list of trees for a given type, returned by all addons.", "access": "private", "tagname": "", @@ -1131,7 +1061,7 @@ }, { "file": "lib/broccoli/ember-app.js", - "line": 813, + "line": 572, "description": "Runs addon post-processing on a given tree and returns the processed tree.\n\nThis enables addons to do process immediately **after** the preprocessor for a\ngiven type is run, but before concatenation occurs. If an addon wishes to\napply a transform before the preprocessors run, they can instead implement the\npreprocessTree hook.\n\nTo utilize this addons implement `postprocessTree` hook.\n\nAn example, would be to apply some broccoli transform on all JS files, but\nonly after the existing pre-processors have run.\n\n```js\nmodule.exports = {\n name: 'my-cool-addon',\n postprocessTree(type, tree) {\n if (type === 'js') {\n return someBroccoliTransform(tree);\n }\n\n return tree;\n }\n}\n\n```", "access": "private", "tagname": "", @@ -1158,7 +1088,7 @@ }, { "file": "lib/broccoli/ember-app.js", - "line": 850, + "line": 609, "description": "Runs addon pre-processing on a given tree and returns the processed tree.\n\nThis enables addons to do process immediately **before** the preprocessor for a\ngiven type is run. If an addon wishes to apply a transform after the\npreprocessors run, they can instead implement the postprocessTree hook.\n\nTo utilize this addons implement `preprocessTree` hook.\n\nAn example, would be to remove some set of files before the preprocessors run.\n\n```js\nvar stew = require('broccoli-stew');\n\nmodule.exports = {\n name: 'my-cool-addon',\n preprocessTree(type, tree) {\n if (type === 'js' && type === 'template') {\n return stew.rm(tree, someGlobPattern);\n }\n\n return tree;\n }\n}\n```", "access": "private", "tagname": "", @@ -1185,7 +1115,7 @@ }, { "file": "lib/broccoli/ember-app.js", - "line": 886, + "line": 645, "description": "Runs addon lintTree hooks and returns a single tree containing all\ntheir output.", "access": "private", "tagname": "", @@ -1212,7 +1142,7 @@ }, { "file": "lib/broccoli/ember-app.js", - "line": 905, + "line": 664, "description": "Imports legacy imports in this.vendorFiles", "access": "private", "tagname": "", @@ -1223,7 +1153,7 @@ }, { "file": "lib/broccoli/ember-app.js", - "line": 1086, + "line": 841, "access": "private", "tagname": "", "itemtype": "method", @@ -1237,7 +1167,7 @@ }, { "file": "lib/broccoli/ember-app.js", - "line": 1301, + "line": 1048, "description": "Runs the `app`, `tests` and `templates` trees through the chain of addons that produces lint trees.\n\nThose lint trees are afterwards funneled into the `tests` folder, babel-ified and returned as an array.", "access": "private", "tagname": "", @@ -1252,28 +1182,7 @@ }, { "file": "lib/broccoli/ember-app.js", - "line": 1341, - "access": "private", - "tagname": "", - "itemtype": "method", - "name": "_addonInstalled", - "params": [ - { - "name": "addonName", - "description": "The name of the addon we are checking to see if it's installed", - "type": "String" - } - ], - "return": { - "description": "", - "type": "Boolean" - }, - "class": "EmberApp", - "module": "ember-cli" - }, - { - "file": "lib/broccoli/ember-app.js", - "line": 1351, + "line": 1088, "access": "public", "tagname": "", "itemtype": "method", @@ -1287,7 +1196,7 @@ }, { "file": "lib/broccoli/ember-app.js", - "line": 1360, + "line": 1097, "description": "Imports an asset into the application.", "access": "public", "tagname": "", @@ -1345,7 +1254,7 @@ }, { "file": "lib/broccoli/ember-app.js", - "line": 1406, + "line": 1143, "access": "private", "tagname": "", "itemtype": "method", @@ -1382,7 +1291,7 @@ }, { "file": "lib/broccoli/ember-app.js", - "line": 1491, + "line": 1228, "access": "private", "tagname": "", "itemtype": "method", @@ -1403,7 +1312,7 @@ }, { "file": "lib/broccoli/ember-app.js", - "line": 1532, + "line": 1269, "description": "Returns an array of trees for this application", "access": "private", "tagname": "", @@ -1418,7 +1327,7 @@ }, { "file": "lib/broccoli/ember-app.js", - "line": 1636, + "line": 1306, "description": "Returns the merged tree for this application", "access": "public", "tagname": "", @@ -1466,16 +1375,6 @@ "access": "private", "tagname": "", "itemtype": "property", - "name": "analytics", - "class": "CLI", - "module": "ember-cli" - }, - { - "file": "lib/cli/cli.js", - "line": 41, - "access": "private", - "tagname": "", - "itemtype": "property", "name": "testing", "type": "Boolean", "class": "CLI", @@ -1483,7 +1382,7 @@ }, { "file": "lib/cli/cli.js", - "line": 48, + "line": 42, "access": "private", "tagname": "", "itemtype": "property", @@ -1494,7 +1393,7 @@ }, { "file": "lib/cli/cli.js", - "line": 55, + "line": 49, "access": "private", "tagname": "", "itemtype": "property", @@ -1504,7 +1403,7 @@ }, { "file": "lib/cli/cli.js", - "line": 61, + "line": 55, "access": "private", "tagname": "", "itemtype": "property", @@ -1514,7 +1413,7 @@ }, { "file": "lib/cli/cli.js", - "line": 67, + "line": 61, "access": "private", "tagname": "", "itemtype": "property", @@ -1524,7 +1423,7 @@ }, { "file": "lib/cli/cli.js", - "line": 83, + "line": 77, "access": "private", "tagname": "", "itemtype": "method", @@ -1548,7 +1447,7 @@ }, { "file": "lib/cli/cli.js", - "line": 122, + "line": 115, "access": "private", "tagname": "", "itemtype": "method", @@ -1569,7 +1468,7 @@ }, { "file": "lib/cli/cli.js", - "line": 262, + "line": 224, "access": "private", "tagname": "", "itemtype": "method", @@ -1589,7 +1488,7 @@ }, { "file": "lib/cli/cli.js", - "line": 303, + "line": 264, "access": "private", "tagname": "", "itemtype": "method", @@ -1607,6 +1506,53 @@ "class": "CLI", "module": "ember-cli" }, + { + "file": "lib/debug/assert.js", + "line": 3, + "description": "Verify that a certain condition is met, or throw an error if otherwise.\n\nThis is useful for communicating expectations in the code to other human\nreaders as well as catching bugs that accidentally violate these expectations.\n\n```js\nconst { assert } = require('ember-cli/lib/debug');\n\n// Test for truthiness:\nassert('Must pass a string.', typeof str === 'string');\n\n// Fail unconditionally:\nassert('This code path should never run.');\n```", + "itemtype": "method", + "name": "assert", + "params": [ + { + "name": "description", + "description": "Describes the condition.\nThis will become the message of the error thrown if the assertion fails.", + "type": "String" + }, + { + "name": "condition", + "description": "Must be truthy for the assertion to pass.\nIf falsy, an error will be thrown.", + "type": "Any" + } + ], + "class": "PackageInfoCache", + "module": "ember-cli" + }, + { + "file": "lib/debug/deprecate.js", + "line": 7, + "description": "Display a deprecation message.\n\n```js\nconst { deprecate } = require('ember-cli/lib/debug');\n\ndeprecate('The `foo` method is deprecated.', false, {\n for: 'ember-cli',\n id: 'ember-cli.foo-method',\n since: {\n available: '4.1.0',\n enabled: '4.2.0',\n },\n until: '5.0.0',\n url: 'https://example.com',\n});\n```", + "itemtype": "method", + "name": "deprecate", + "params": [ + { + "name": "description", + "description": "Describes the deprecation.", + "type": "String" + }, + { + "name": "condition", + "description": "If falsy, the deprecation message will be displayed.", + "type": "Any" + }, + { + "name": "options", + "description": "An object including the deprecation's details:\n- `for` The library that the deprecation is for\n- `id` The deprecation's unique id\n- `since.available` A SemVer version indicating when the deprecation was made available\n- `since.enabled` A SemVer version indicating when the deprecation was enabled\n- `until` A SemVer version indicating until when the deprecation will be active\n- `url` A URL that refers to additional information about the deprecation", + "type": "Object" + } + ], + "class": "PackageInfoCache", + "module": "ember-cli" + }, { "file": "lib/models/package-info-cache/index.js", "line": 36, @@ -1712,7 +1658,7 @@ }, { "file": "lib/models/package-info-cache/index.js", - "line": 260, + "line": 262, "description": "Resolve the node_module dependencies across all packages after they have\nbeen loaded into the cache, because we don't know when a particular package\nwill enter the cache.\n\nSince loadProject can be called multiple times for different projects,\nwe don't want to reprocess any packages that happen to be common\nbetween them. We'll handle this by marking any packageInfo once it\nhas been processed here, then ignore it in any later processing.", "access": "private", "tagname": "", @@ -1723,7 +1669,7 @@ }, { "file": "lib/models/package-info-cache/index.js", - "line": 297, + "line": 299, "description": "Add an entry to the cache.", "access": "private", "tagname": "", @@ -1734,7 +1680,7 @@ }, { "file": "lib/models/package-info-cache/index.js", - "line": 307, + "line": 309, "description": "Retrieve an entry from the cache.", "access": "public", "tagname": "", @@ -1756,7 +1702,7 @@ }, { "file": "lib/models/package-info-cache/index.js", - "line": 319, + "line": 321, "description": "Indicate if an entry for a given path exists in the cache.", "access": "public", "tagname": "", @@ -1777,7 +1723,7 @@ }, { "file": "lib/models/package-info-cache/index.js", - "line": 393, + "line": 395, "description": "Given a directory that supposedly contains a package, create a PackageInfo\nobject and try to fill it out, EVEN IF the package.json is not readable.\nErrors will then be stored in the PackageInfo for anything with the package\nthat might be wrong.\nBecause it's possible that the path given to the packageDir is not actually valid,\nwe'll just use the path.resolve() version of that path to search for the\npath in the cache, before trying to get the 'real' path (which also then\nresolves links). The cache itself is keyed on either the realPath, if the\npackageDir is actually a real valid directory path, or the normalized path (before\npath.resolve()), if it is not.\n\nNOTE: the cache is also used to store the NULL_PROJECT project object,\nwhich actually has no package.json or other files, but does have an empty\npackage object. Because of that, and to speed up processing, loadProject()\nwill pass in both the package root directory path and the project's package\nobject, if there is one. If the package object is present, we will use that\nin preference to trying to find a package.json file.\n\nIf there is no package object, and there is no package.json or the package.json\nis bad or the package is an addon with\nno main, the only thing we can do is return an ErrorEntry to the caller.\nOnce past all those problems, if any error occurs with any of the contents\nof the package, they'll be cached in the PackageInfo itself.\n\nIn summary, only PackageInfo or ErrorEntry will be returned.", "access": "private", "tagname": "", @@ -1800,7 +1746,7 @@ }, { "file": "lib/models/package-info-cache/index.js", - "line": 583, + "line": 585, "description": "Process a directory of modules in a given package directory.\n\nWe will allow cache entries for node_modules that actually\nhave no contents, just so we don't have to hit the file system more\noften than necessary--it's much quicker to check an in-memory object.\nobject.\n\nNote: only a NodeModulesList or null is returned.", "access": "private", "tagname": "", @@ -1896,7 +1842,7 @@ }, { "file": "lib/models/package-info-cache/package-info.js", - "line": 93, + "line": 96, "description": "Given error data, add an ErrorEntry to the ErrorList for this object.\nThis is used by the _readPackage and _readNodeModulesList methods. It\nshould not be called otherwise.", "access": "protected", "tagname": "", @@ -1919,7 +1865,7 @@ }, { "file": "lib/models/package-info-cache/package-info.js", - "line": 108, + "line": 111, "description": "Indicate if there are any errors in the ErrorList for this package. Note that this does\nNOT indicate if there are any errors in the objects referred to by this package (e.g.,\ninternal addons or dependencies).", "access": "public", "tagname": "", @@ -1937,7 +1883,7 @@ }, { "file": "lib/models/package-info-cache/package-info.js", - "line": 121, + "line": 124, "description": "Add a reference to an in-repo addon PackageInfo object.", "access": "protected", "tagname": "", @@ -1958,7 +1904,7 @@ }, { "file": "lib/models/package-info-cache/package-info.js", - "line": 136, + "line": 139, "description": "Add a reference to an internal addon PackageInfo object.\n\"internal\" addons (note: not in-repo addons) only exist in\nProjects, not other packages. Since the cache is loaded from\n'loadProject', this can be done appropriately.", "access": "protected", "tagname": "", @@ -1979,8 +1925,8 @@ }, { "file": "lib/models/package-info-cache/package-info.js", - "line": 154, - "description": "For each dependency in the given list, find the corresponding\nPackageInfo object in the cache (going up the file tree if\nnecessary, as in the node resolution algorithm). Return a map\nof the dependencyName to PackageInfo object. Caller can then\nstore it wherever they like.\n\nNote: this is not to be called until all packages that can be have\nbeen added to the cache.\n\nNote: this is for ALL dependencies, not just addons. To get just\naddons, filter the result by calling pkgInfo.isAddon().\n\nNote: this is only intended for use from PackageInfoCache._resolveDependencies.\nIt is not to be called directly by anything else.", + "line": 157, + "description": "For each dependency in the given list, find the corresponding\nPackageInfo object in the cache (going up the file tree if\nnecessary, as in the node resolution algorithm). Return a map\nof the dependencyName to PackageInfo object. Caller can then\nstore it wherever they like.\n\nNote: this is not to be called until all packages that can be have\nbeen added to the cache.\n\nNote: this is for ALL dependencies, not just addons. To get just\naddons, filter the result by calling pkgInfo.isForAddon().\n\nNote: this is only intended for use from PackageInfoCache._resolveDependencies.\nIt is not to be called directly by anything else.", "access": "protected", "tagname": "", "itemtype": "method", @@ -2001,33 +1947,98 @@ }, { "file": "lib/models/package-info-cache/package-info.js", - "line": 227, - "description": "Add to a list of child addon PackageInfos for this packageInfo.", + "line": 226, + "description": "Indicate if this packageInfo is for a project. Should be called only after the project\nhas been loaded (see {@link PackageInfoCache#loadProject} for details).", "itemtype": "method", - "name": "addPackages", - "params": [ - { - "name": "addonPackageList", - "description": "the list of child addon PackageInfos being constructed from various\nsources in this packageInfo.", - "type": "Array" - }, - { - "name": "packageInfoList", - "description": "a list or map of PackageInfos being considered\n(e.g., pkgInfo.dependencyPackages) for inclusion in the addonPackageList.", - "type": "Array | Object" - }, - { - "name": "excludeFn", - "description": "an optional function. If passed in, each child PackageInfo\nwill be tested against the function and only included in the package map if the function\nreturns a truthy value.", - "type": "Function" - } - ], - "class": "PackageInfo", - "module": "ember-cli" + "name": "isForProject", + "return": { + "description": "true if this packageInfo is for a Project, false otherwise.", + "type": "Boolean" + }, + "class": "PackageInfo", + "module": "ember-cli" }, { "file": "lib/models/package-info-cache/package-info.js", - "line": 266, + "line": 237, + "description": "Indicate if this packageInfo is for an Addon.", + "itemtype": "method", + "name": "isForAddon", + "return": { + "description": "true if this packageInfo is for an Addon, false otherwise.", + "type": "Boolean" + }, + "class": "PackageInfo", + "module": "ember-cli" + }, + { + "file": "lib/models/package-info-cache/package-info.js", + "line": 247, + "description": "Indicate if this packageInfo represents an engine.", + "itemtype": "method", + "name": "isForEngine", + "return": { + "description": "true if this pkgInfo is configured as an engine & false otherwise", + "type": "Boolean" + }, + "class": "PackageInfo", + "module": "ember-cli" + }, + { + "file": "lib/models/package-info-cache/package-info.js", + "line": 257, + "description": "Indicate if this packageInfo represents a lazy engine.", + "itemtype": "method", + "name": "isForLazyEngine", + "return": { + "description": "true if this pkgInfo is configured as an engine and the\nmodule this represents has lazyLoading enabled, false otherwise.", + "type": "Boolean" + }, + "class": "PackageInfo", + "module": "ember-cli" + }, + { + "file": "lib/models/package-info-cache/package-info.js", + "line": 268, + "description": "For use with the PerBundleAddonCache, is this packageInfo representing a\nbundle host (for now, a Project or a lazy engine).", + "itemtype": "method", + "name": "isForBundleHost", + "return": { + "description": "true if this pkgInfo is for a bundle host, false otherwise.", + "type": "Boolean" + }, + "class": "PackageInfo", + "module": "ember-cli" + }, + { + "file": "lib/models/package-info-cache/package-info.js", + "line": 279, + "description": "Add to a list of child addon PackageInfos for this packageInfo.", + "itemtype": "method", + "name": "addPackages", + "params": [ + { + "name": "addonPackageList", + "description": "the list of child addon PackageInfos being constructed from various\nsources in this packageInfo.", + "type": "Array" + }, + { + "name": "packageInfoList", + "description": "a list or map of PackageInfos being considered\n(e.g., pkgInfo.dependencyPackages) for inclusion in the addonPackageList.", + "type": "Array | Object" + }, + { + "name": "excludeFn", + "description": "an optional function. If passed in, each child PackageInfo\nwill be tested against the function and only included in the package map if the function\nreturns a truthy value.", + "type": "Function" + } + ], + "class": "PackageInfo", + "module": "ember-cli" + }, + { + "file": "lib/models/package-info-cache/package-info.js", + "line": 318, "description": "Discover the child addons for this packageInfo, which corresponds to an Addon.", "itemtype": "method", "name": "discoverAddonAddons", @@ -2036,7 +2047,7 @@ }, { "file": "lib/models/package-info-cache/package-info.js", - "line": 284, + "line": 336, "description": "Discover the child addons for this packageInfo, which corresponds to a Project.", "itemtype": "method", "name": "discoverProjectAddons", @@ -2045,7 +2056,7 @@ }, { "file": "lib/models/package-info-cache/package-info.js", - "line": 304, + "line": 356, "description": "Given a list of PackageInfo objects, generate the 'addonPackages' object (keyed by\nname, value = AddonInfo instance, for all packages marked 'valid'). This is stored in\nboth Addon and Project instances.", "itemtype": "method", "name": "generateAddonPackages", @@ -2066,8 +2077,10 @@ }, { "file": "lib/models/package-info-cache/package-info.js", - "line": 371, + "line": 419, "description": "This is only supposed to be called by the addon instantiation code.\nAlso, the assumption here is that this PackageInfo really is for an\nAddon, so we don't need to check each time.", + "access": "private", + "tagname": "", "itemtype": "method", "name": "getAddonConstructor", "return": { @@ -2078,641 +2091,483 @@ "module": "ember-cli" }, { - "file": "lib/models/addon.js", - "line": 170, - "description": "The name of this addon.", - "access": "public", - "tagname": "", - "final": 1, - "type": "String", - "itemtype": "property", - "name": "name", - "class": "Addon", - "module": "ember-cli" - }, - { - "file": "lib/models/addon.js", - "line": 179, - "description": "The absolute path of the root directory where this addon is located.", - "access": "public", - "tagname": "", - "final": 1, - "type": "String", - "itemtype": "property", - "name": "root", - "class": "Addon", - "module": "ember-cli" - }, - { - "file": "lib/models/addon.js", - "line": 188, - "description": "The host app instance.\n\n**Note**: this property will only be present on addons that are a direct dependency\nof the application itself, not of other addons. It is also not available in `init()`,\nbut will be set before `setupPreprocessorRegistry()` and `included()` are invoked.", - "access": "public", - "tagname": "", - "final": 1, - "type": "EmberApp", - "itemtype": "property", - "name": "app", - "class": "Addon", - "module": "ember-cli" - }, - { - "file": "lib/models/addon.js", - "line": 201, - "description": "The root {{#crossLink \"Project\"}}project{{/crossLink}} to which this addon belongs.", - "access": "public", - "tagname": "", - "final": 1, - "type": "Project", - "itemtype": "property", - "name": "project", - "class": "Addon", - "module": "ember-cli" - }, - { - "file": "lib/models/addon.js", - "line": 210, - "description": "This addon's parent.\n\nIf the addon is a direct dependency of an application, then `parent` will be the\ncorresponding {{#crossLink \"Project\"}}project{{/crossLink}} instance. If it's a\ndependency of another addon, then `parent` will be a reference to that addon.", - "access": "public", - "tagname": "", - "final": 1, - "type": "Project|Addon", - "itemtype": "property", - "name": "parent", - "class": "Addon", - "module": "ember-cli" - }, - { - "file": "lib/models/addon.js", - "line": 223, - "description": "The set of addons that this addon itself depends on.\n\nThis array is populated from the addon's listed `dependencies` and any items in\n`ember-addon.paths` in its `package.json`.", - "access": "public", - "tagname": "", - "final": 1, - "type": "Addon[]", - "itemtype": "property", - "name": "addons", - "class": "Addon", - "module": "ember-cli" - }, - { - "file": "lib/models/addon.js", - "line": 235, - "description": "A [`console-ui`](https://github.com/ember-cli/console-ui) object that can be used\nto log messages for the user and indicate progress on long-running operations.", - "access": "public", - "tagname": "", - "final": 1, - "type": "UI", - "itemtype": "property", - "name": "ui", - "class": "Addon", - "module": "ember-cli" - }, - { - "file": "lib/models/addon.js", - "line": 245, - "description": "The contents of the addon's `package.json`.", - "access": "public", - "tagname": "", - "final": 1, - "type": "Object", - "itemtype": "property", - "name": "pkg", - "class": "Addon", - "module": "ember-cli" - }, - { - "file": "lib/models/addon.js", - "line": 254, - "description": "Initializes the addon. If you override this method make sure and call `this._super.init && this._super.init.apply(this, arguments);` or your addon will not work.", - "access": "public", + "file": "lib/models/package-info-cache/package-info.js", + "line": 457, + "description": "Construct an addon instance.\n\nNOTE: this does NOT call constructors for the child addons. That is left to\nthe caller to do, so they can insert any other logic they want.", + "access": "private", "tagname": "", "itemtype": "method", - "name": "init", + "name": "constructAddonInstance", "params": [ { "name": "parent", - "description": "The project or addon that directly depends on this addon", + "description": "the parent that directly contains this addon", "type": "Project|Addon" }, { "name": "project", - "description": "The current project (deprecated)", + "description": "the project that is/contains this addon", "type": "Project" } ], - "example": [ - "\n```js\ninit(parent, project) {\n this._super.init && this._super.init.apply(this, arguments);\n this._someCustomSetup();\n}\n```" - ], - "class": "Addon", - "module": "ember-cli" - }, - { - "file": "lib/models/addon.js", - "line": 343, - "description": "Find an addon of the current addon.\n\nExample: ember-data depends on ember-cli-babel and wishes to have\nadditional control over transpilation this method helps.\n\n```js\n// ember-data/index.js\ntreeForAddon(tree) {\n let babel = this.findOwnAddonByName('ember-cli-babel');\n\n return babel.transpileTree(tree, {\n // customize the babel step (see: ember-cli-addons readme for more details);\n });\n}\n```", - "access": "public", - "tagname": "", - "itemtype": "method", - "name": "findOwnAddonByName", - "class": "Addon", - "module": "ember-cli" - }, - { - "file": "lib/models/addon.js", - "line": 367, - "description": "Check if the current addon intends to be hinted. Typically this is for\nhinting/linting libraries such as eslint or jshint", - "access": "public", - "tagname": "", - "itemtype": "method", - "name": "hintingEnabled", - "class": "Addon", + "class": "PackageInfo", "module": "ember-cli" }, { - "file": "lib/models/addon.js", - "line": 382, - "description": "Shorthand method for [broccoli-concat](https://github.com/ember-cli/broccoli-concat)", - "access": "private", - "tagname": "", + "file": "lib/models/package-info-cache/package-info.js", + "line": 492, + "description": "Create an instance of the addon represented by this packageInfo or (if we\nare supporting per-bundle caching and this is an allow-caching-per-bundle addon)\ncheck if we should be creating a proxy instead.\n\nNOTE: we assume that the value of 'allowCachingPerBundle' does not change between\ncalls to the constructor! A given addon is either allowing or not allowing caching\nfor an entire run.", "itemtype": "method", - "name": "concatFiles", + "name": "getAddonInstance", "params": [ { - "name": "tree", - "description": "Tree of files", - "type": "Tree" + "name": "parent", + "description": "the addon/project that is to be the direct parent of the\naddon instance created here" }, { - "name": "options", - "description": "Options for broccoli-concat", - "type": "Object" + "name": "project", + "description": "the project that is to contain this addon instance", + "type": "*" } ], "return": { - "description": "Modified tree", - "type": "Tree" + "description": "the constructed instance of the addon", + "type": "Object" }, - "class": "Addon", + "class": "PackageInfo", "module": "ember-cli" }, { - "file": "lib/models/addon.js", - "line": 396, - "description": "Allows to mark the addon as developing, triggering live-reload in the project the addon is linked to.\n\n#### Uses:\n\n- Working on projects with internal addons", - "access": "public", - "tagname": "", + "file": "lib/models/package-info-cache/package-info.js", + "line": 525, + "description": "Initialize the child addons array of a newly-created addon instance. Normally when\nan addon derives from Addon, child addons will be created during 'setupRegistry' and\nthis code is essentially unnecessary. But if an addon is created with custom constructors\nthat don't call 'setupRegistry', any child addons may not yet be initialized.", "itemtype": "method", - "name": "isDevelopingAddon", - "return": { - "description": "", - "type": "Boolean" - }, - "class": "Addon", + "name": "initChildAddons", + "params": [ + { + "name": "addonInstance", + "description": "", + "type": "Addon" + } + ], + "class": "PackageInfo", "module": "ember-cli" }, { - "file": "lib/models/addon.js", - "line": 434, - "description": "Discovers all child addons of this addon and an AddonInfo about\neach addon in this.addonPackages (keyed on addon name).\n\nChild addons include those from 'dependencies' (not devDependencies)\nand in-repo addons\n\nAny packageInfos that we find that are marked as not valid are excluded.", + "file": "lib/models/package-info-cache/package-info.js", + "line": 542, + "description": "Gets the addon entry point", + "itemtype": "method", + "name": "_getAddonEntryPoint", + "return": { + "description": "The exported addon entry point", + "type": "Object|Function" + }, "access": "private", "tagname": "", - "itemtype": "method", - "name": "discoverAddons", - "class": "Addon", + "class": "PackageInfo", "module": "ember-cli" }, { - "file": "lib/models/addon.js", - "line": 481, - "description": "Invoke the specified method for each enabled addon.", - "access": "private", - "tagname": "", + "file": "lib/models/per-bundle-addon-cache/addon-proxy.js", + "line": 7, + "description": "Validates that a new cache key for a given tree type matches the previous\ncache key for the same tree type. To opt-in to bundle addon caching for\na given addon it's assumed that it returns stable cache keys; specifically\nthis is because the interplay between bundle addon caching and `ember-engines`\nwhen transitive deduplication is enabled assumes stable cache keys, so we validate\nfor this case here.", "itemtype": "method", - "name": "eachAddonInvoke", + "name": "validateCacheKey", "params": [ { - "name": "methodName", - "description": "the method to invoke on each addon", + "name": "realAddonInstance", + "description": "The real addon instance", + "type": "Addon" + }, + { + "name": "treeType", + "description": "", "type": "String" }, { - "name": "args", - "description": "the arguments to pass to the invoked method", - "type": "Array" + "name": "newCacheKey", + "description": "", + "type": "String" } ], - "class": "Addon", + "throws": { + "description": "If the new cache key doesn't match the previous cache key", + "type": "Error" + }, + "class": "PerBundleAddonCache", "module": "ember-cli" }, { - "file": "lib/models/addon.js", - "line": 506, - "description": "Invoke the specified method for each of the project's addons.", - "access": "private", - "tagname": "", + "file": "lib/models/per-bundle-addon-cache/addon-proxy.js", + "line": 42, + "description": "Returns a proxy to a target with specific handling for the\n`parent` property, as well has to handle the `app` property;\nthat is, the proxy should maintain correct local state in\nclosure scope for the `app` property if it happens to be set\nby `ember-cli`. Other than `parent` & `app`, this function also\nproxies _almost_ everything to `target[TARGET_INSTANCE] with a few\nexceptions: we trap & return `[]` for `addons`, and we don't return\nthe original `included` (it's already called on the \"real\" addon\nby `ember-cli`).\n\nNote: the target is NOT the per-bundle cacheable instance of the addon. Rather,\nit is a cache entry POJO from PerBundleAddonCache.", "itemtype": "method", - "name": "_eachProjectAddonInvoke", + "name": "getAddonProxy", "params": [ { - "name": "methodName", - "description": "the method to invoke on each addon", - "type": "String" + "name": "targetCacheEntry", + "description": "the PerBundleAddonCache cache entry we are to proxy. It\nhas one interesting property, the real addon instance the proxy is forwarding\ncalls to (that property is not globally exposed)." }, { - "name": "args", - "description": "the arguments to pass to the invoked method", - "type": "Array" + "name": "parent", + "description": "the parent object of the proxy being created (the same as\nthe 'parent' property of a normal addon instance)" } ], - "class": "Addon", - "module": "ember-cli" - }, - { - "file": "lib/models/addon.js", - "line": 539, - "description": "Generates a tree for the specified path", - "access": "private", - "tagname": "", - "itemtype": "method", - "name": "treeGenerator", "return": { - "description": "", - "type": "Tree" + "description": "Proxy" }, - "class": "Addon", - "module": "ember-cli" - }, - { - "file": "lib/models/addon.js", - "line": 574, - "access": "private", - "tagname": "", - "itemtype": "method", - "name": "_warn", - "class": "Addon", + "class": "PerBundleAddonCache", "module": "ember-cli" }, { - "file": "lib/models/addon.js", - "line": 586, - "description": "Returns a given type of tree (if present), merged with the\napplication tree. For each of the trees available using this\nmethod, you can also use a direct method called `treeFor[Type]` (eg. `treeForApp`).\n\nAvailable tree names:\n- {{#crossLink \"Addon/treeForApp:method\"}}app{{/crossLink}}\n- {{#crossLink \"Addon/treeForStyles:method\"}}styles{{/crossLink}}\n- {{#crossLink \"Addon/treeForTemplates:method\"}}templates{{/crossLink}}\n- {{#crossLink \"Addon/treeForAddonTemplates:method\"}}addon-templates{{/crossLink}}\n- {{#crossLink \"Addon/treeForAddon:method\"}}addon{{/crossLink}}\n- {{#crossLink \"Addon/treeForVendor:method\"}}vendor{{/crossLink}}\n- {{#crossLink \"Addon/treeForTestSupport:method\"}}test-support{{/crossLink}}\n- {{#crossLink \"Addon/treeForAddonTestSupport:method\"}}addon-test-support{{/crossLink}}\n- {{#crossLink \"Addon/treeForPublic:method\"}}public{{/crossLink}}\n\n#### Uses:\n\n- manipulating trees at build time", - "access": "public", - "tagname": "", + "file": "lib/models/per-bundle-addon-cache/index.js", + "line": 17, + "description": "Resolves the perBundleAddonCacheUtil; this prefers the custom provided version by\nthe consuming application, and defaults to an internal implementation here.", "itemtype": "method", - "name": "treeFor", + "name": "resolvePerBundleAddonCacheUtil", "params": [ { - "name": "name", + "name": "project", "description": "", - "type": "String" + "type": "Project" } ], "return": { - "description": "", - "type": "Tree" + "description": "}", + "type": "AllowCachingPerBundle: Function" }, - "class": "Addon", + "class": "PerBundleAddonCache", "module": "ember-cli" }, { - "file": "lib/models/addon.js", - "line": 652, - "access": "private", - "tagname": "", + "file": "lib/models/per-bundle-addon-cache/index.js", + "line": 116, + "description": "The default implementation here is to indicate if the original addon entry point has\nthe `allowCachingPerBundle` flag set either on itself or on its prototype.\n\nIf a consuming application specifies a relative path to a custom utility via the\n`ember-addon.perBundleAddonCacheUtil` configuration, we prefer the custom implementation\nprovided by the consumer.", + "itemtype": "method", + "name": "allowCachingPerBundle", "params": [ { - "name": "name", + "name": "addonEntryPointModule", "description": "", - "type": "String" + "type": "Object|Function" } ], - "itemtype": "method", - "name": "_treeFor", "return": { - "description": "", - "type": "Tree" + "description": "true if the given constructor function or class supports caching per bundle, false otherwise", + "type": "Boolean" }, - "class": "Addon", + "class": "PerBundleAddonCache", "module": "ember-cli" }, { - "file": "lib/models/addon.js", - "line": 674, - "description": "Calculates a cacheKey for the given treeType. It is expected to return a\ncache key allowing multiple builds of the same tree to simply return the\noriginal tree (preventing duplicate work). If it returns null / undefined\nthe tree in question will opt out of this caching system.\n\nThis method is invoked prior to calling treeFor with the same tree name.\n\nYou should override this method if you implement custom treeFor or treeFor*\nmethods, which cause addons to opt-out of this caching.", - "access": "public", - "tagname": "", + "file": "lib/models/per-bundle-addon-cache/index.js", + "line": 132, + "description": "Creates a cache entry for the bundleHostCache. Because we want to use the same sort of proxy\nfor both bundle hosts and for 'regular' addon instances (though their cache entries have\nslightly different structures) we'll use the Symbol from getAddonProxy.", "itemtype": "method", - "name": "cacheKeyForTree", + "name": "createBundleHostCacheEntry", "params": [ { - "name": "treeType", - "description": "", - "type": "String" + "name": "bundleHostPkgInfo", + "description": "bundle host's pkgInfo.realPath", + "type": "PackageInfo" } ], "return": { - "description": "cacheKey", - "type": "String" + "description": "an object in the form of a bundle-host cache entry", + "type": "Object" }, - "class": "Addon", - "module": "ember-cli" - }, - { - "file": "lib/models/addon.js", - "line": 716, - "description": "This method climbs up the hierarchy of addons\nup to the host application.\n\nThis prevents previous addons (prior to `this.import`, ca 2.7.0)\nto break at importing assets when they are used nested in other addons.", - "access": "private", - "tagname": "", - "itemtype": "method", - "name": "_findHost", - "class": "Addon", + "class": "PerBundleAddonCache", "module": "ember-cli" }, { - "file": "lib/models/addon.js", - "line": 739, - "description": "This method is called when the addon is included in a build. You\nwould typically use this hook to perform additional imports\n\n#### Uses:\n\n- including vendor files\n- setting configuration options\n\n*Note:* Any options set in the consuming application will override the addon.", - "access": "public", - "tagname": "", + "file": "lib/models/per-bundle-addon-cache/index.js", + "line": 145, + "description": "Create a cache entry object for a given (non-bundle-host) addon to put into\nan addon cache.", "itemtype": "method", - "name": "included", + "name": "createAddonCacheEntry", "params": [ { - "name": "parent", - "description": "The parent object which included this addon", - "type": "EmberApp|EmberAddon" + "name": "addonInstance", + "description": "the addon instance to cache", + "type": "Addon" + }, + { + "name": "addonRealPath", + "description": "the addon's pkgInfo.realPath", + "type": "String" } ], - "example": [ - "\n```js\nincluded(parent) {\n this._super.included.apply(this, arguments);\n this.import(somePath);\n}\n```" - ], - "class": "Addon", + "return": { + "description": "an object in the form of an addon-cache entry", + "type": "Object" + }, + "class": "PerBundleAddonCache", "module": "ember-cli" }, { - "file": "lib/models/addon.js", - "line": 772, - "description": "Imports an asset into this addon.", - "access": "public", - "tagname": "", + "file": "lib/models/per-bundle-addon-cache/index.js", + "line": 158, + "description": "Given a parent object of a potential addon (another addon or the project),\ngo up the 'parent' chain to find the potential addon's bundle host object\n(i.e. lazy engine or project.) Because Projects are always bundle hosts,\nthis should always pass, but we'll throw if somehow it doesn't work.", "itemtype": "method", - "name": "import", + "name": "findBundleHost", "params": [ { - "name": "asset", - "description": "Either a path to the asset or an object with environment names and paths as key-value pairs.", - "type": "Object|String" + "name": "addonParent", + "description": "the direct parent object of a (potential or real) addon.", + "type": "Project|Addon" }, { - "name": "options", - "description": "Options object", - "type": "Object", - "optional": true, - "props": [ - { - "name": "type", - "description": "Either 'vendor' or 'test', defaults to 'vendor'", - "type": "String", - "optional": true - }, - { - "name": "prepend", - "description": "Whether or not this asset should be prepended, defaults to false", - "type": "Boolean", - "optional": true - }, - { - "name": "destDir", - "description": "Destination directory, defaults to the name of the directory the asset is in", - "type": "String", - "optional": true - } - ] + "name": "addonPkgInfo", + "description": "the PackageInfo for an addon being instantiated. This is only\nused for information if an error is going to be thrown.", + "type": "PackageInfo" } ], - "since": "2.7.0", - "class": "Addon", + "return": { + "description": "the object in the 'parent' chain that is a bundle host.", + "type": "Object" + }, + "throws": { + "description": "if there is not bundle host", + "type": "Error" + }, + "class": "PerBundleAddonCache", "module": "ember-cli" }, { - "file": "lib/models/addon.js", - "line": 792, - "description": "Returns the tree for all app files", - "access": "public", - "tagname": "", + "file": "lib/models/per-bundle-addon-cache/index.js", + "line": 197, + "description": "An optimization we support from lazy engines is the following:\n\nIf an addon instance is supposed to be bundled with a particular lazy engine, and\nsame addon is also to be bundled by a common LCA host, prefer the one bundled by the\nhost (since it's ultimately going to be deduped later by `ember-engines`).\n\nNOTE: this only applies if this.engineAddonTransitiveDedupeEnabled is truthy. If it is not,\nthe bundle host always \"owns\" the addon instance.\n\nIf deduping is enabled and the LCA host also depends on the same addon,\nthe lazy-engine instances of the addon will all be proxies to the one in\nthe LCA host. This function indicates whether the bundle host passed in\n(either the project or a lazy engine) is really the bundle host to \"own\" the\nnew addon.", "itemtype": "method", - "name": "treeForApp", + "name": "bundleHostOwnsInstance", "params": [ { - "name": "tree", - "description": "", - "type": "Tree" + "name": "(Object}", + "description": "bundleHost the project or lazy engine that is trying to \"own\"\nthe new addon instance specified by addonPkgInfo" + }, + { + "name": "addonPkgInfo", + "description": "the PackageInfo of the potential new addon instance", + "type": "PackageInfo" } ], "return": { - "description": "App file tree", - "type": "Tree" + "description": "true if the bundle host is to \"own\" the instance, false otherwise.", + "type": "Boolean" }, - "class": "Addon", + "class": "PerBundleAddonCache", "module": "ember-cli" }, { - "file": "lib/models/addon.js", - "line": 804, - "description": "Returns the tree for all template files", - "access": "public", - "tagname": "", + "file": "lib/models/per-bundle-addon-cache/index.js", + "line": 247, + "description": "Called from PackageInfo.getAddonInstance(), return an instance of the requested\naddon or a Proxy, based on the type of addon and its bundle host.", "itemtype": "method", - "name": "treeForTemplates", + "name": "getAddonInstance", "params": [ { - "name": "tree", - "description": "", - "type": "Tree" + "name": "parent", + "description": "the parent Addon or Project this addon instance is\na child of.", + "type": "Addon|Project" + }, + { + "name": "addonPkgInfo", + "description": "the PackageInfo for the addon being created.", + "type": "*" } ], "return": { - "description": "Template file tree", - "type": "Tree" + "description": "An addon instance (for the first copy of the addon) or a Proxy.\nAn addon that is a lazy engine will only ever have a single copy in the cache.\nAn addon that is not will have 1 copy per bundle host (Project or lazy engine),\nexcept if it is an addon that's also owned by a given LCA host and transitive\ndedupe is enabled (`engineAddonTransitiveDedupeEnabled`), in which case it will\nonly have a single copy in the project's addon cache.", + "type": "Addon|Proxy" }, - "class": "Addon", + "class": "PerBundleAddonCache", "module": "ember-cli" }, { - "file": "lib/models/addon.js", - "line": 816, - "description": "Returns the tree for this addon's templates", - "access": "public", + "file": "lib/models/per-bundle-addon-cache/target-instance.js", + "line": 3, + "description": "A Symbol constant for sharing between index.js and addon-proxy.js rather than\nputting the symbol into the Symbol global cache. The symbol is used in per-bundle\ncache entries to refer to the field that points at the real instance that a Proxy\nrefers to.", + "type": "Symbol", + "access": "private", "tagname": "", - "itemtype": "method", - "name": "treeForAddonTemplates", - "params": [ - { - "name": "tree", - "description": "", - "type": "Tree" - } - ], - "return": { - "description": "Addon Template file tree", - "type": "Tree" - }, + "final": 1, "class": "Addon", "module": "ember-cli" }, { "file": "lib/models/addon.js", - "line": 828, - "description": "Returns a tree for this addon", + "line": 155, + "description": "The name of this addon.", "access": "public", "tagname": "", - "itemtype": "method", - "name": "treeForAddon", - "params": [ - { - "name": "tree", - "description": "", - "type": "Tree" - } - ], - "return": { - "description": "Addon file tree", - "type": "Tree" - }, - "example": [ - "\n```js\ntreeForAddon() {\n var tree = this._super.treeForAddon.apply(this, arguments);\n var checker = new VersionChecker(this);\n var isOldEmber = checker.for('ember', 'bower').lt('1.13.0');\n\n if (isOldEmber) {\n tree = new Funnel(tree, { exclude: [ /instance-initializers/ ] });\n }\n\n return tree;\n}\n```" - ], + "final": 1, + "type": "String", + "itemtype": "property", + "name": "name", "class": "Addon", "module": "ember-cli" }, { "file": "lib/models/addon.js", - "line": 862, - "description": "Returns the tree for all style files", + "line": 164, + "description": "The absolute path of the root directory where this addon is located.", "access": "public", "tagname": "", - "itemtype": "method", - "name": "treeForStyles", - "params": [ - { - "name": "tree", - "description": "The tree to process, usually `app/styles/` in the addon.", - "type": "Tree" - } - ], - "return": { - "description": "The return tree has the same contents as the input tree, but is moved so that the `app/styles/` path is preserved.", - "type": "Tree" - }, + "final": 1, + "type": "String", + "itemtype": "property", + "name": "root", "class": "Addon", "module": "ember-cli" }, { "file": "lib/models/addon.js", - "line": 881, - "description": "Returns the tree for all vendor files", + "line": 173, + "description": "The host app instance.\n\n**Note**: this property will only be present on addons that are a direct dependency\nof the application itself, not of other addons. It is also not available in `init()`,\nbut will be set before `setupPreprocessorRegistry()` and `included()` are invoked.", "access": "public", "tagname": "", - "itemtype": "method", - "name": "treeForVendor", - "params": [ - { - "name": "tree", - "description": "", - "type": "Tree" - } - ], - "return": { - "description": "Vendor file tree", - "type": "Tree" - }, + "final": 1, + "type": "EmberApp", + "itemtype": "property", + "name": "app", "class": "Addon", "module": "ember-cli" }, { "file": "lib/models/addon.js", - "line": 893, - "description": "Returns the tree for all test support files", + "line": 186, + "description": "The root {{#crossLink \"Project\"}}project{{/crossLink}} to which this addon belongs.", + "access": "public", + "tagname": "", + "final": 1, + "type": "Project", + "itemtype": "property", + "name": "project", + "class": "Addon", + "module": "ember-cli" + }, + { + "file": "lib/models/addon.js", + "line": 195, + "description": "This addon's parent.\n\nIf the addon is a direct dependency of an application, then `parent` will be the\ncorresponding {{#crossLink \"Project\"}}project{{/crossLink}} instance. If it's a\ndependency of another addon, then `parent` will be a reference to that addon.", + "access": "public", + "tagname": "", + "final": 1, + "type": "Project|Addon", + "itemtype": "property", + "name": "parent", + "class": "Addon", + "module": "ember-cli" + }, + { + "file": "lib/models/addon.js", + "line": 208, + "description": "The set of addons that this addon itself depends on.\n\nThis array is populated from the addon's listed `dependencies` and any items in\n`ember-addon.paths` in its `package.json`.", + "access": "public", + "tagname": "", + "final": 1, + "type": "Addon[]", + "itemtype": "property", + "name": "addons", + "class": "Addon", + "module": "ember-cli" + }, + { + "file": "lib/models/addon.js", + "line": 220, + "description": "A [`console-ui`](https://github.com/ember-cli/console-ui) object that can be used\nto log messages for the user and indicate progress on long-running operations.", + "access": "public", + "tagname": "", + "final": 1, + "type": "UI", + "itemtype": "property", + "name": "ui", + "class": "Addon", + "module": "ember-cli" + }, + { + "file": "lib/models/addon.js", + "line": 230, + "description": "The contents of the addon's `package.json`.", + "access": "public", + "tagname": "", + "final": 1, + "type": "Object", + "itemtype": "property", + "name": "pkg", + "class": "Addon", + "module": "ember-cli" + }, + { + "file": "lib/models/addon.js", + "line": 239, + "description": "Initializes the addon. If you override this method make sure and call `this._super.init && this._super.init.apply(this, arguments);` or your addon will not work.", "access": "public", "tagname": "", "itemtype": "method", - "name": "treeForTestSupport", + "name": "init", "params": [ { - "name": "tree", - "description": "", - "type": "Tree" + "name": "parent", + "description": "The project or addon that directly depends on this addon", + "type": "Project|Addon" + }, + { + "name": "project", + "description": "The current project (deprecated)", + "type": "Project" } ], - "return": { - "description": "Test Support file tree", - "type": "Tree" - }, + "example": [ + "\n```js\ninit(parent, project) {\n this._super.init && this._super.init.apply(this, arguments);\n this._someCustomSetup();\n}\n```" + ], "class": "Addon", "module": "ember-cli" }, { "file": "lib/models/addon.js", - "line": 905, - "description": "Returns the tree for all public files", + "line": 320, + "description": "Find an addon of the current addon.\n\nExample: ember-data depends on ember-cli-babel and wishes to have\nadditional control over transpilation this method helps.\n\n```js\n// ember-data/index.js\ntreeForAddon(tree) {\n let babel = this.findOwnAddonByName('ember-cli-babel');\n\n return babel.transpileTree(tree, {\n // customize the babel step (see: ember-cli-addons readme for more details);\n });\n}\n```", "access": "public", "tagname": "", "itemtype": "method", - "name": "treeForPublic", - "params": [ - { - "name": "tree", - "description": "", - "type": "Tree" - } - ], - "return": { - "description": "Public file tree", - "type": "Tree" - }, + "name": "findOwnAddonByName", "class": "Addon", "module": "ember-cli" }, { "file": "lib/models/addon.js", - "line": 925, - "description": "Returns the tree for all test files namespaced to a given addon.", + "line": 344, + "description": "Check if the current addon intends to be hinted. Typically this is for\nhinting/linting libraries such as eslint or jshint", "access": "public", "tagname": "", "itemtype": "method", - "name": "treeForAddonTestSupport", - "params": [ - { - "name": "tree", - "description": "", - "type": "Tree" - } - ], - "return": { - "description": "", - "type": "Tree" - }, + "name": "hintingEnabled", "class": "Addon", "module": "ember-cli" }, { "file": "lib/models/addon.js", - "line": 960, - "description": "Runs the styles tree through preprocessors.", + "line": 359, + "description": "Shorthand method for [broccoli-concat](https://github.com/ember-cli/broccoli-concat)", "access": "private", "tagname": "", "itemtype": "method", - "name": "compileStyles", + "name": "concatFiles", "params": [ { - "name": "addonStylesTree", - "description": "Styles file tree", + "name": "tree", + "description": "Tree of files", "type": "Tree" + }, + { + "name": "options", + "description": "Options for broccoli-concat", + "type": "Object" } ], "return": { - "description": "Compiled styles tree", + "description": "Modified tree", "type": "Tree" }, "class": "Addon", @@ -2720,14 +2575,14 @@ }, { "file": "lib/models/addon.js", - "line": 984, - "description": "Looks in the addon/ and addon/templates trees to determine if template files\nexists that need to be precompiled.\n\nThis is executed once when building, but not on rebuilds.", - "access": "private", + "line": 373, + "description": "Allows to mark the addon as developing, triggering live-reload in the project the addon is linked to.\n\n#### Uses:\n\n- Working on projects with internal addons", + "access": "public", "tagname": "", "itemtype": "method", - "name": "shouldCompileTemplates", + "name": "isDevelopingAddon", "return": { - "description": "indicates if templates need to be compiled for this addon", + "description": "", "type": "Boolean" }, "class": "Addon", @@ -2735,73 +2590,71 @@ }, { "file": "lib/models/addon.js", - "line": 998, - "description": "Looks in the addon/ and addon/templates trees to determine if template files\nexists in the pods format that need to be precompiled.\n\nThis is executed once when building, but not on rebuilds.", + "line": 409, + "description": "Discovers all child addons of this addon and an AddonInfo about\neach addon in this.addonPackages (keyed on addon name).\n\nChild addons include those from 'dependencies' (not devDependencies)\nand in-repo addons\n\nAny packageInfos that we find that are marked as not valid are excluded.", "access": "private", "tagname": "", "itemtype": "method", - "name": "_shouldCompilePodTemplates", - "return": { - "description": "indicates if pod based templates need to be compiled for this addon", - "type": "Boolean" - }, + "name": "discoverAddons", "class": "Addon", "module": "ember-cli" }, { "file": "lib/models/addon.js", - "line": 1116, - "description": "Runs the templates tree through preprocessors.", + "line": 459, + "description": "Invoke the specified method for each enabled addon.", "access": "private", "tagname": "", "itemtype": "method", - "name": "compileTemplates", + "name": "eachAddonInvoke", "params": [ { - "name": "tree", - "description": "Templates file tree", - "type": "Tree" + "name": "methodName", + "description": "the method to invoke on each addon", + "type": "String" + }, + { + "name": "args", + "description": "the arguments to pass to the invoked method", + "type": "Array" } ], - "return": { - "description": "Compiled templates tree", - "type": "Tree" - }, "class": "Addon", "module": "ember-cli" }, { "file": "lib/models/addon.js", - "line": 1149, - "description": "Runs the addon tree through preprocessors.", + "line": 484, + "description": "Invoke the specified method for each of the project's addons.", "access": "private", "tagname": "", "itemtype": "method", - "name": "compileAddon", + "name": "_eachProjectAddonInvoke", "params": [ { - "name": "tree", - "description": "Addon file tree", - "type": "Tree" + "name": "methodName", + "description": "the method to invoke on each addon", + "type": "String" + }, + { + "name": "args", + "description": "the arguments to pass to the invoked method", + "type": "Array" } ], - "return": { - "description": "Compiled addon tree", - "type": "Tree" - }, "class": "Addon", "module": "ember-cli" }, { "file": "lib/models/addon.js", - "line": 1203, - "description": "Returns a tree with JSHhint output for all addon JS.", + "line": 517, + "description": "Generates a tree for the specified path", "access": "private", "tagname": "", "itemtype": "method", - "name": "jshintAddonTree", + "name": "treeGenerator", "return": { - "description": "Tree with JShint output (tests)", + "description": "", "type": "Tree" }, "class": "Addon", @@ -2809,15 +2662,21 @@ }, { "file": "lib/models/addon.js", - "line": 1269, - "description": "Returns a tree containing the addon's js files", - "access": "private", + "line": 552, + "description": "Returns a given type of tree (if present), merged with the\napplication tree. For each of the trees available using this\nmethod, you can also use a direct method called `treeFor[Type]` (eg. `treeForApp`).\n\nAvailable tree names:\n- {{#crossLink \"Addon/treeForApp:method\"}}app{{/crossLink}}\n- {{#crossLink \"Addon/treeForStyles:method\"}}styles{{/crossLink}}\n- {{#crossLink \"Addon/treeForTemplates:method\"}}templates{{/crossLink}}\n- {{#crossLink \"Addon/treeForAddonTemplates:method\"}}addon-templates{{/crossLink}}\n- {{#crossLink \"Addon/treeForAddon:method\"}}addon{{/crossLink}}\n- {{#crossLink \"Addon/treeForVendor:method\"}}vendor{{/crossLink}}\n- {{#crossLink \"Addon/treeForTestSupport:method\"}}test-support{{/crossLink}}\n- {{#crossLink \"Addon/treeForAddonTestSupport:method\"}}addon-test-support{{/crossLink}}\n- {{#crossLink \"Addon/treeForPublic:method\"}}public{{/crossLink}}\n\n#### Uses:\n\n- manipulating trees at build time", + "access": "public", "tagname": "", - "deprecated": true, "itemtype": "method", - "name": "addonJsFiles", + "name": "treeFor", + "params": [ + { + "name": "name", + "description": "", + "type": "String" + } + ], "return": { - "description": "The filtered addon js files", + "description": "", "type": "Tree" }, "class": "Addon", @@ -2825,14 +2684,20 @@ }, { "file": "lib/models/addon.js", - "line": 1286, - "description": "Preprocesses a javascript tree.", + "line": 618, "access": "private", "tagname": "", + "params": [ + { + "name": "name", + "description": "", + "type": "String" + } + ], "itemtype": "method", - "name": "preprocessJs", + "name": "_treeFor", "return": { - "description": "Preprocessed javascript", + "description": "", "type": "Tree" }, "class": "Addon", @@ -2840,201 +2705,233 @@ }, { "file": "lib/models/addon.js", - "line": 1297, - "description": "Returns a tree with all javascript for this addon.", - "access": "private", + "line": 640, + "description": "Calculates a cacheKey for the given treeType. It is expected to return a\ncache key allowing multiple builds of the same tree to simply return the\noriginal tree (preventing duplicate work). If it returns null / undefined\nthe tree in question will opt out of this caching system.\n\nThis method is invoked prior to calling treeFor with the same tree name.\n\nYou should override this method if you implement custom treeFor or treeFor*\nmethods, which cause addons to opt-out of this caching.", + "access": "public", "tagname": "", "itemtype": "method", - "name": "processedAddonJsFiles", + "name": "cacheKeyForTree", "params": [ { - "name": "the", - "description": "tree to preprocess", - "type": "Tree" + "name": "treeType", + "description": "", + "type": "String" } ], "return": { - "description": "Processed javascript file tree", - "type": "Tree" + "description": "cacheKey", + "type": "String" }, "class": "Addon", "module": "ember-cli" }, { "file": "lib/models/addon.js", - "line": 1332, - "description": "Returns the module name for this addon.", - "access": "public", + "line": 682, + "description": "This method climbs up the hierarchy of addons\nup to the host application.\n\nThis prevents previous addons (prior to `this.import`, ca 2.7.0)\nto break at importing assets when they are used nested in other addons.", + "access": "private", "tagname": "", "itemtype": "method", - "name": "moduleName", - "return": { - "description": "module name", - "type": "String" - }, + "name": "_findHost", "class": "Addon", "module": "ember-cli" }, { "file": "lib/models/addon.js", - "line": 1347, - "description": "Returns the path for addon blueprints.", + "line": 705, + "description": "This method is called when the addon is included in a build. You\nwould typically use this hook to perform additional imports\n\n#### Uses:\n\n- including vendor files\n- setting configuration options\n\n*Note:* Any options set in the consuming application will override the addon.", "access": "public", "tagname": "", "itemtype": "method", - "name": "blueprintsPath", - "return": { - "description": "The path for blueprints", - "type": "String" - }, + "name": "included", + "params": [ + { + "name": "parent", + "description": "The parent object which included this addon", + "type": "EmberApp|EmberAddon" + } + ], "example": [ - "\n- [ember-cli-coffeescript](https://github.com/kimroen/ember-cli-coffeescript/blob/v1.13.2/index.js#L26)" + "\n```js\nincluded(parent) {\n this._super.included.apply(this, arguments);\n this.import(somePath);\n}\n```" ], "class": "Addon", "module": "ember-cli" }, { "file": "lib/models/addon.js", - "line": 1365, - "description": "Augments the applications configuration settings.\n\nObject returned from this hook is merged with the application's configuration object.\n\nApplication's configuration always take precedence.\n\n#### Uses:\n\n- Modifying configuration options (see list of defaults [here](https://github.com/ember-cli/ember-cli/blob/v2.4.3/lib/broccoli/ember-app.js#L163))\n - For example\n - `minifyJS`\n - `storeConfigInMeta`\n - et, al", + "line": 738, + "description": "Imports an asset into this addon.", "access": "public", "tagname": "", "itemtype": "method", - "name": "config", + "name": "import", "params": [ { - "name": "env", - "description": "Name of current environment (ie \"development\")", - "type": "String" + "name": "asset", + "description": "Either a path to the asset or an object with environment names and paths as key-value pairs.", + "type": "Object|String" }, { - "name": "baseConfig", - "description": "Initial application configuration", - "type": "Object" + "name": "options", + "description": "Options object", + "type": "Object", + "optional": true, + "props": [ + { + "name": "type", + "description": "Either 'vendor' or 'test', defaults to 'vendor'", + "type": "String", + "optional": true + }, + { + "name": "prepend", + "description": "Whether or not this asset should be prepended, defaults to false", + "type": "Boolean", + "optional": true + }, + { + "name": "destDir", + "description": "Destination directory, defaults to the name of the directory the asset is in", + "type": "String", + "optional": true + } + ] } ], - "return": { - "description": "Configuration object to be merged with application configuration.", - "type": "Object" - }, - "example": [ - "\n```js\nconfig(environment, appConfig) {\n return {\n someAddonDefault: \"foo\"\n };\n}\n```" - ], + "since": "2.7.0", "class": "Addon", "module": "ember-cli" }, { "file": "lib/models/addon.js", - "line": 1405, + "line": 758, + "description": "Returns the tree for all app files", "access": "public", "tagname": "", "itemtype": "method", - "name": "dependencies", + "name": "treeForApp", + "params": [ + { + "name": "tree", + "description": "", + "type": "Tree" + } + ], "return": { - "description": "The addon's dependencies based on the addon's package.json", - "type": "Object" + "description": "App file tree", + "type": "Tree" }, "class": "Addon", "module": "ember-cli" }, { "file": "lib/models/addon.js", - "line": 1415, + "line": 770, + "description": "Returns the tree for all template files", "access": "public", "tagname": "", "itemtype": "method", - "name": "isEnabled", + "name": "treeForTemplates", + "params": [ + { + "name": "tree", + "description": "", + "type": "Tree" + } + ], "return": { - "description": "Whether or not this addon is enabled", - "type": "Boolean" + "description": "Template file tree", + "type": "Tree" }, "class": "Addon", "module": "ember-cli" }, { "file": "lib/models/addon.js", - "line": 1424, - "description": "Can be used to exclude addons from being added as a child addon.\n\n#### Uses:\n\n- Abstract away multiple addons while only including one into the built assets", + "line": 782, + "description": "Returns the tree for this addon's templates", "access": "public", "tagname": "", "itemtype": "method", - "name": "shouldIncludeChildAddon", + "name": "treeForAddonTemplates", "params": [ { - "name": "childAddon", + "name": "tree", "description": "", - "type": "Addon" + "type": "Tree" } ], "return": { - "description": "Whether or not a child addon is supposed to be included", - "type": "Boolean" + "description": "Addon Template file tree", + "type": "Tree" }, - "example": [ - "\n```js\nshouldIncludeChildAddon(childAddon) {\n if(childAddon.name === 'ember-cli-some-legacy-select-component') {\n return this.options.legacyMode;\n } else if(childAddon.name === 'ember-cli-awesome-new-select-component') {\n return !this.options.legacyMode;\n } else {\n return this._super.shouldIncludeChildAddon.apply(this, arguments);\n }\n}\n```" - ], "class": "Addon", "module": "ember-cli" }, { "file": "lib/models/addon.js", - "line": 1456, - "description": "Allows the specification of custom addon commands.\nExpects you to return an object whose key is the name of the command and value is the command instance..\n\nThis function is not implemented by default\n\n#### Uses:\n\n- Include custom commands into consuming application", + "line": 794, + "description": "Returns a tree for this addon", "access": "public", "tagname": "", "itemtype": "method", - "name": "includedCommands", + "name": "treeForAddon", + "params": [ + { + "name": "tree", + "description": "", + "type": "Tree" + } + ], "return": { - "description": "An object with included commands", - "type": "Object" + "description": "Addon file tree", + "type": "Tree" }, "example": [ - "\n```js\nincludedCommands() {\n return {\n 'do-foo': require('./lib/commands/foo')\n };\n}\n```" + "\n```js\ntreeForAddon() {\n let emberVersion = new VersionChecker(this.project).for('ember-source');\n let shouldUsePolyfill = emberVersion.lt('4.5.0-alpha.4');\n\n if (shouldUsePolyfill) {\n return this._super.treeForAddon.apply(this, arguments);\n }\n}\n```" ], "class": "Addon", "module": "ember-cli" }, { "file": "lib/models/addon.js", - "line": 1480, - "description": "Allows addons to define a custom transform function that other addons and app can use when using `app.import`.\n\nThis function is not implemented by default\n\n#### Uses:\n\n- An app or addons want to transform a dependency that is being imported using `app.import`.", + "line": 825, + "description": "Returns the tree for all style files", "access": "public", "tagname": "", "itemtype": "method", - "name": "importTransforms", + "name": "treeForStyles", + "params": [ + { + "name": "tree", + "description": "The tree to process, usually `app/styles/` in the addon.", + "type": "Tree" + } + ], "return": { - "description": "An object with custom transforms", - "type": "Object" + "description": "The return tree has the same contents as the input tree, but is moved so that the `app/styles/` path is preserved.", + "type": "Tree" }, - "example": [ - "\n```js\nimportTransforms() {\n return {\n 'my-custom-transform': function(tree, options) {\n // transform the incoming tree and return the updated tree\n }\n };\n}\n```\n\nAlternatively, if you want to process `options` before being passed into the custom transform function, use:", - "\n```js\nimportTransforms() {\n return {\n 'my-custom-transform': {\n transform: function(tree, options) {\n // transform the incoming tree and return the updated tree\n },\n processOptions: function(assetPath, entry, options) {\n // process your options\n\n return options\n }\n };\n}\n```" - ], "class": "Addon", "module": "ember-cli" }, { "file": "lib/models/addon.js", - "line": 1524, - "description": "Pre-process a tree\n\n#### Uses:\n\n- removing / adding files from the build.", + "line": 844, + "description": "Returns the tree for all vendor files", "access": "public", "tagname": "", "itemtype": "method", - "name": "preprocessTree", + "name": "treeForVendor", "params": [ - { - "name": "type", - "description": "What kind of tree (eg. 'js', 'css', 'template')", - "type": "String" - }, { "name": "tree", - "description": "Tree to process", + "description": "", "type": "Tree" } ], "return": { - "description": "Processed tree", + "description": "Vendor file tree", "type": "Tree" }, "class": "Addon", @@ -3042,761 +2939,649 @@ }, { "file": "lib/models/addon.js", - "line": 1538, - "description": "Post-process a tree", + "line": 856, + "description": "Returns the tree for all test support files", "access": "public", "tagname": "", "itemtype": "method", - "name": "postprocessTree", + "name": "treeForTestSupport", "params": [ - { - "name": "type", - "description": "What kind of tree (eg. 'js', 'css', 'template')", - "type": "String" - }, { "name": "tree", - "description": "Tree to process", + "description": "", "type": "Tree" } ], "return": { - "description": "Processed tree", + "description": "Test Support file tree", "type": "Tree" }, - "example": [ - "\n- [broccoli-asset-rev](https://github.com/rickharrison/broccoli-asset-rev/blob/c82c3580855554a31f7d6600b866aecf69cdaa6d/index.js#L29)" - ], "class": "Addon", "module": "ember-cli" }, { "file": "lib/models/addon.js", - "line": 1551, - "description": "This hook allows you to make changes to the express server run by ember-cli.\n\nIt's passed a `startOptions` object which contains:\n- `app` Express server instance\n- `options` A hash with:\n - `project` Current {{#crossLink \"Project\"}}project{{/crossLink}}\n - `watcher`\n - `environment`\n\nThis function is not implemented by default\n\n#### Uses:\n\n- Tacking on headers to each request\n- Modifying the request object\n\n*Note:* that this should only be used in development, and if you need the same behavior in production you'll\nneed to configure your server.", + "line": 868, + "description": "Returns the tree for all public files", "access": "public", "tagname": "", "itemtype": "method", - "name": "serverMiddleware", + "name": "treeForPublic", "params": [ { - "name": "startOptions", - "description": "Express server start options", - "type": "Object" + "name": "tree", + "description": "", + "type": "Tree" } ], - "example": [ - "\n```js\nserverMiddleware(startOptions) {\n var app = startOptions.app;\n\n app.use(function(req, res, next) {\n // Some middleware\n });\n}\n```\n\n- [ember-cli-content-security-policy](https://github.com/rwjblue/ember-cli-content-security-policy/blob/v0.5.0/index.js#L84)\n- [history-support-addon](https://github.com/ember-cli/ember-cli/blob/v2.4.3/lib/tasks/server/middleware/history-support/index.js#L25)" - ], + "return": { + "description": "Public file tree", + "type": "Tree" + }, "class": "Addon", "module": "ember-cli" }, { "file": "lib/models/addon.js", - "line": 1590, - "description": "This hook allows you to make changes to the express server run by testem.\n\nThis function is not implemented by default\n\n#### Uses:\n\n- Adding custom test-specific endpoints\n- Manipulating HTTP requests in tests", + "line": 888, + "description": "Returns the tree for all test files namespaced to a given addon.", "access": "public", "tagname": "", "itemtype": "method", - "name": "testemMiddleware", + "name": "treeForAddonTestSupport", "params": [ { - "name": "app", - "description": "the express app instance", - "type": "Object" + "name": "tree", + "description": "", + "type": "Tree" } ], + "return": { + "description": "", + "type": "Tree" + }, "class": "Addon", "module": "ember-cli" }, { "file": "lib/models/addon.js", - "line": 1605, - "description": "This hook is called before a build takes place.", - "access": "public", + "line": 922, + "description": "Runs the styles tree through preprocessors.", + "access": "private", "tagname": "", "itemtype": "method", - "name": "preBuild", + "name": "compileStyles", "params": [ { - "name": "result", - "description": "Build object", - "type": "Object" + "name": "addonStylesTree", + "description": "Styles file tree", + "type": "Tree" } ], + "return": { + "description": "Compiled styles tree", + "type": "Tree" + }, "class": "Addon", "module": "ember-cli" }, { "file": "lib/models/addon.js", - "line": 1613, - "description": "This hook is called after a build is complete.\n\nIt's passed a `result` object which contains:\n- `directory` Path to build output\n\n#### Uses:\n\n- Slow tree listing\n- May be used to manipulate your project after build has happened", - "access": "public", + "line": 947, + "description": "Looks in the addon/ and addon/templates trees to determine if template files\nexist that need to be precompiled.\n\nThis is executed once when building, but not on rebuilds.", + "access": "private", "tagname": "", "itemtype": "method", - "name": "postBuild", - "params": [ - { - "name": "result", - "description": "Build result object", - "type": "Object" - } - ], + "name": "shouldCompileTemplates", + "return": { + "description": "indicates if templates need to be compiled for this addon", + "type": "Boolean" + }, "class": "Addon", "module": "ember-cli" }, { "file": "lib/models/addon.js", - "line": 1629, - "description": "This hook is called after the build has been processed and the build files have been copied to the output directory\n\nIt's passed a `result` object which contains:\n- `directory` Path to build output", - "access": "public", + "line": 961, + "description": "Looks in the addon/ and addon/templates trees to determine if template files\nexist in the pods format that need to be precompiled.\n\nThis is executed once when building, but not on rebuilds.", + "access": "private", "tagname": "", "itemtype": "method", - "name": "outputReady", - "params": [ - { - "name": "result", - "description": "Build result object", - "type": "Object" - } - ], - "example": [ - "\n- Opportunity to symlink or copy files elsewhere.\n- [ember-cli-rails-addon](https://github.com/rondale-sc/ember-cli-rails-addon/blob/v0.7.0/index.js#L45)\n - In this case we are using this in tandem with a rails middleware to remove a lock file.\n This allows our ruby gem to block incoming requests until after the build happens reliably." - ], + "name": "_shouldCompilePodTemplates", + "return": { + "description": "indicates if pod based templates need to be compiled for this addon", + "type": "Boolean" + }, "class": "Addon", "module": "ember-cli" }, { "file": "lib/models/addon.js", - "line": 1646, - "description": "This hook is called when an error occurs during the preBuild, postBuild or outputReady hooks\nfor addons, or when the build fails\n\n#### Uses:\n\n- Custom error handling during build process", - "access": "public", + "line": 1079, + "description": "Runs the templates tree through preprocessors.", + "access": "private", "tagname": "", "itemtype": "method", - "name": "buildError", + "name": "compileTemplates", "params": [ { - "name": "error", - "description": "The error that was caught during the processes listed above", - "type": "Error" + "name": "tree", + "description": "Templates file tree", + "type": "Tree" } ], - "example": [ - "\n- [ember-cli-rails-addon](https://github.com/rondale-sc/ember-cli-rails-addon/blob/v0.7.0/index.js#L11)" - ], + "return": { + "description": "Compiled templates tree", + "type": "Tree" + }, "class": "Addon", "module": "ember-cli" }, { "file": "lib/models/addon.js", - "line": 1662, - "description": "Used to add preprocessors to the preprocessor registry. This is often used by addons like [ember-cli-htmlbars](https://github.com/ember-cli/ember-cli-htmlbars)\nand [ember-cli-coffeescript](https://github.com/kimroen/ember-cli-coffeescript) to add a `template` or `js` preprocessor to the registry.\n\n**Uses:**\n\n- Adding preprocessors to the registry.", - "access": "public", + "line": 1113, + "description": "Runs the addon tree through preprocessors.", + "access": "private", "tagname": "", "itemtype": "method", - "name": "setupPreprocessorRegistry", + "name": "compileAddon", "params": [ { - "name": "type", - "description": "either `\"self\"` or `\"parent\"`", - "type": "String" - }, - { - "name": "registry", - "description": "the registry to be set up" + "name": "tree", + "description": "Addon file tree", + "type": "Tree" } ], - "example": [ - "\n```js\nsetupPreprocessorRegistry(type, registry) {\n // ensure that broccoli-ember-hbs-template-compiler is not processing hbs files\n registry.remove('template', 'broccoli-ember-hbs-template-compiler');\n\n registry.add('template', {\n name: 'ember-cli-htmlbars',\n ext: 'hbs',\n _addon: this,\n toTree(tree) {\n var htmlbarsOptions = this._addon.htmlbarsOptions();\n return htmlbarsCompile(tree, htmlbarsOptions);\n },\n\n precompile(string) {\n var htmlbarsOptions = this._addon.htmlbarsOptions();\n var templateCompiler = htmlbarsOptions.templateCompiler;\n return utils.template(templateCompiler, string);\n }\n });\n\n if (type === 'parent') {\n this.parentRegistry = registry;\n }\n}\n```" - ], + "return": { + "description": "Compiled addon tree", + "type": "Tree" + }, "class": "Addon", "module": "ember-cli" }, { "file": "lib/models/addon.js", - "line": 1704, - "description": "Return value is merged into the **tests** tree. This lets you inject\nlinter output as test results.\n\n**Uses:**\n\n- JSHint\n- any other form of automated test generation that turns code into tests", - "access": "public", + "line": 1157, + "description": "Returns a tree with JSHint output for all addon JS.", + "access": "private", "tagname": "", "itemtype": "method", - "name": "lintTree", - "params": [ - { - "name": "treeType", - "description": "`app`, `tests`, `templates`, or `addon`", - "type": "String" - }, - { - "name": "tree", - "description": "tree of files (JavaScript files for `app`, `tests`, and `addon` types)", - "type": "Tree" - } - ], - "example": [ - "\n- [ember-cli-qunit](https://github.com/ember-cli/ember-cli-qunit/blob/v1.4.1/index.js#L206)\n- [ember-cli-mocha](https://github.com/ef4/ember-cli-mocha/blob/66803037fe203b24e96dea83a2bd91de48b842e1/index.js#L101)" - ], + "name": "jshintAddonTree", + "return": { + "description": "Tree with JShint output (tests)", + "type": "Tree" + }, "class": "Addon", "module": "ember-cli" }, { "file": "lib/models/addon.js", - "line": 1723, - "description": "Allow addons to implement contentFor method to add string output into the associated `{{content-for 'foo'}}` section in `index.html`\n\n**Uses:**\n\n- For instance, to inject analytics code into `index.html`", - "access": "public", + "line": 1223, + "description": "Preprocesses a javascript tree.", + "access": "private", "tagname": "", "itemtype": "method", - "name": "contentFor", - "params": [ - { - "name": "type", - "description": "" - }, - { - "name": "config", - "description": "" - }, - { - "name": "content", - "description": "" - } - ], - "example": [ - "\n- [ember-cli-google-analytics](https://github.com/pgrippi/ember-cli-google-analytics/blob/v1.5.0/index.js#L79)" - ], + "name": "preprocessJs", + "return": { + "description": "Preprocessed javascript", + "type": "Tree" + }, "class": "Addon", "module": "ember-cli" }, { - "file": "lib/models/blueprint.js", - "line": 205, - "description": "Hook to specify the path to the blueprint's files. By default this is\n`path.join(this.path, 'files)`.\n\nThis can be used to customize which set of files to install based on options\nor environmental variables. It defaults to the `files` directory within the\nblueprint's folder.", - "access": "public", + "file": "lib/models/addon.js", + "line": 1234, + "description": "Returns a tree with all javascript for this addon.", + "access": "private", "tagname": "", "itemtype": "method", - "name": "filesPath", + "name": "processedAddonJsFiles", "params": [ { - "name": "options", - "description": "", - "type": "Object" + "name": "the", + "description": "tree to preprocess", + "type": "Tree" } ], "return": { - "description": "Path to the blueprints files directory.", - "type": "String" + "description": "Processed javascript file tree", + "type": "Tree" }, - "class": "Blueprint", + "class": "Addon", "module": "ember-cli" }, { - "file": "lib/models/blueprint.js", - "line": 222, - "description": "Used to retrieve files for blueprint.", + "file": "lib/models/addon.js", + "line": 1263, + "description": "Returns the module name for this addon.", "access": "public", "tagname": "", "itemtype": "method", - "name": "files", - "return": { - "description": "Contents of the blueprint's files directory", - "type": "Array" - }, - "class": "Blueprint", - "module": "ember-cli" - }, - { - "file": "lib/models/blueprint.js", - "line": 244, - "itemtype": "method", - "name": "srcPath", - "params": [ - { - "name": "file", - "description": "", - "type": "String" - } - ], + "name": "moduleName", "return": { - "description": "Resolved path to the file", + "description": "module name", "type": "String" }, - "class": "Blueprint", + "class": "Addon", "module": "ember-cli" }, { - "file": "lib/models/blueprint.js", - "line": 253, - "description": "Hook for normalizing entity name\n\nUse the `normalizeEntityName` hook to add custom normalization and\nvalidation of the provided entity name. The default hook does not\nmake any changes to the entity name, but makes sure an entity name\nis present and that it doesn't have a trailing slash.\n\nThis hook receives the entity name as its first argument. The string\nreturned by this hook will be used as the new entity name.", + "file": "lib/models/addon.js", + "line": 1278, + "description": "Returns the path for addon blueprints.", "access": "public", "tagname": "", "itemtype": "method", - "name": "normalizeEntityName", - "params": [ - { - "name": "entityName", - "description": "", - "type": "String" - } - ], + "name": "blueprintsPath", "return": { - "description": "", - "type": "Null" + "description": "The path for blueprints", + "type": "String" }, - "class": "Blueprint", + "example": [ + "\n- [ember-cli-coffeescript](https://github.com/kimroen/ember-cli-coffeescript/blob/v1.13.2/index.js#L26)" + ], + "class": "Addon", "module": "ember-cli" }, { - "file": "lib/models/blueprint.js", - "line": 273, - "description": "Write a status and message to the UI", - "access": "private", + "file": "lib/models/addon.js", + "line": 1296, + "description": "Augments the application's configuration settings.\n\nObject returned from this hook is merged with the application's configuration object.\n\nApplication's configuration always take precedence.\n\n#### Uses:\n\n- Modifying configuration options (see list of defaults [here](https://github.com/ember-cli/ember-cli/blob/v2.4.3/lib/broccoli/ember-app.js#L163))\n - For example\n - `storeConfigInMeta`\n - et, al", + "access": "public", "tagname": "", "itemtype": "method", - "name": "_writeStatusToUI", + "name": "config", "params": [ { - "name": "chalkColor", - "description": "", - "type": "Function" - }, - { - "name": "keyword", - "description": "", + "name": "env", + "description": "Name of current environment (ie \"development\")", "type": "String" }, { - "name": "message", - "description": "", - "type": "String" + "name": "baseConfig", + "description": "Initial application configuration", + "type": "Object" } ], - "class": "Blueprint", + "return": { + "description": "Configuration object to be merged with application configuration.", + "type": "Object" + }, + "example": [ + "\n```js\nconfig(environment, appConfig) {\n return {\n someAddonDefault: \"foo\"\n };\n}\n```" + ], + "class": "Addon", "module": "ember-cli" }, { - "file": "lib/models/blueprint.js", - "line": 287, - "access": "private", + "file": "lib/models/addon.js", + "line": 1335, + "access": "public", "tagname": "", "itemtype": "method", - "name": "_writeFile", - "params": [ - { - "name": "info", - "description": "", - "type": "Object" - } - ], + "name": "dependencies", "return": { - "description": "", - "type": "Promise" + "description": "The addon's dependencies based on the addon's package.json", + "type": "Object" }, - "class": "Blueprint", + "class": "Addon", "module": "ember-cli" }, { - "file": "lib/models/blueprint.js", - "line": 299, - "description": "Actions lookup", - "access": "private", + "file": "lib/models/addon.js", + "line": 1345, + "access": "public", "tagname": "", - "itemtype": "property", - "name": "_actions", - "type": "Object", - "class": "Blueprint", + "itemtype": "method", + "name": "isEnabled", + "return": { + "description": "Whether or not this addon is enabled", + "type": "Boolean" + }, + "class": "Addon", "module": "ember-cli" }, { - "file": "lib/models/blueprint.js", - "line": 337, - "description": "Calls an action.", - "access": "private", + "file": "lib/models/addon.js", + "line": 1354, + "description": "Can be used to exclude addons from being added as a child addon.\n\n#### Uses:\n\n- Abstract away multiple addons while only including one into the built assets", + "access": "public", "tagname": "", "itemtype": "method", - "name": "_commit", + "name": "shouldIncludeChildAddon", "params": [ { - "name": "result", + "name": "childAddon", "description": "", - "type": "Object" + "type": "Addon" } ], "return": { - "description": "", - "type": "Promise" - }, - "throws": { - "description": "Action doesn't exist.", - "type": "Error" + "description": "Whether or not a child addon is supposed to be included", + "type": "Boolean" }, - "class": "Blueprint", + "example": [ + "\n```js\nshouldIncludeChildAddon(childAddon) {\n if(childAddon.name === 'ember-cli-some-legacy-select-component') {\n return this.options.legacyMode;\n } else if(childAddon.name === 'ember-cli-awesome-new-select-component') {\n return !this.options.legacyMode;\n } else {\n return this._super.shouldIncludeChildAddon.apply(this, arguments);\n }\n}\n```" + ], + "class": "Addon", "module": "ember-cli" }, { - "file": "lib/models/blueprint.js", - "line": 355, - "description": "Prints warning for pod unsupported.", - "access": "private", + "file": "lib/models/addon.js", + "line": 1386, + "description": "Allows the specification of custom addon commands.\nExpects you to return an object whose key is the name of the command and value is the command instance..\n\nThis function is not implemented by default\n\n#### Uses:\n\n- Include custom commands into consuming application", + "access": "public", "tagname": "", "itemtype": "method", - "name": "_checkForPod", - "class": "Blueprint", + "name": "includedCommands", + "return": { + "description": "An object with included commands", + "type": "Object" + }, + "example": [ + "\n```js\nincludedCommands() {\n return {\n 'do-foo': require('./lib/commands/foo')\n };\n}\n```" + ], + "class": "Addon", "module": "ember-cli" }, { - "file": "lib/models/blueprint.js", - "line": 372, - "access": "private", + "file": "lib/models/addon.js", + "line": 1410, + "description": "Allows addons to define a custom transform function that other addons and app can use when using `app.import`.\n\nThis function is not implemented by default\n\n#### Uses:\n\n- An app or addons want to transform a dependency that is being imported using `app.import`.", + "access": "public", "tagname": "", "itemtype": "method", - "name": "_normalizeEntityName", - "params": [ - { - "name": "entity", - "description": "", - "type": "Object" - } + "name": "importTransforms", + "return": { + "description": "An object with custom transforms", + "type": "Object" + }, + "example": [ + "\n```js\nimportTransforms() {\n return {\n 'my-custom-transform': function(tree, options) {\n // transform the incoming tree and return the updated tree\n }\n };\n}\n```\n\nAlternatively, if you want to process `options` before being passed into the custom transform function, use:", + "\n```js\nimportTransforms() {\n return {\n 'my-custom-transform': {\n transform: function(tree, options) {\n // transform the incoming tree and return the updated tree\n },\n processOptions: function(assetPath, entry, options) {\n // process your options\n\n return options\n }\n };\n}\n```" ], - "class": "Blueprint", + "class": "Addon", "module": "ember-cli" }, { - "file": "lib/models/blueprint.js", - "line": 383, - "access": "private", + "file": "lib/models/addon.js", + "line": 1454, + "description": "Pre-process a tree\n\n#### Uses:\n\n- removing / adding files from the build.", + "access": "public", "tagname": "", "itemtype": "method", - "name": "_checkInRepoAddonExists", + "name": "preprocessTree", "params": [ { - "name": "options", - "description": "", - "type": "Object" + "name": "type", + "description": "What kind of tree (eg. 'js', 'css', 'template')", + "type": "String" + }, + { + "name": "tree", + "description": "Tree to process", + "type": "Tree" } ], - "class": "Blueprint", + "return": { + "description": "Processed tree", + "type": "Tree" + }, + "class": "Addon", "module": "ember-cli" }, { - "file": "lib/models/blueprint.js", - "line": 412, - "access": "private", + "file": "lib/models/addon.js", + "line": 1468, + "description": "Post-process a tree", + "access": "public", "tagname": "", "itemtype": "method", - "name": "_process", + "name": "postprocessTree", "params": [ { - "name": "options", - "description": "", - "type": "Object" - }, - { - "name": "beforeHook", - "description": "", - "type": "Function" - }, - { - "name": "process", - "description": "", - "type": "Function" + "name": "type", + "description": "What kind of tree (eg. 'js', 'css', 'template')", + "type": "String" }, { - "name": "afterHook", - "description": "", - "type": "Function" + "name": "tree", + "description": "Tree to process", + "type": "Tree" } ], - "class": "Blueprint", + "return": { + "description": "Processed tree", + "type": "Tree" + }, + "example": [ + "\n- [broccoli-asset-rev](https://github.com/rickharrison/broccoli-asset-rev/blob/c82c3580855554a31f7d6600b866aecf69cdaa6d/index.js#L29)" + ], + "class": "Addon", "module": "ember-cli" }, { - "file": "lib/models/blueprint.js", - "line": 438, + "file": "lib/models/addon.js", + "line": 1481, + "description": "This hook allows you to make changes to the express server run by ember-cli.\n\nIt's passed a `startOptions` object which contains:\n- `app` Express server instance\n- `options` A hash with:\n - `project` Current {{#crossLink \"Project\"}}project{{/crossLink}}\n - `watcher`\n - `environment`\n\nThis function is not implemented by default\n\n#### Uses:\n\n- Tacking on headers to each request\n- Modifying the request object\n\n*Note:* that this should only be used in development, and if you need the same behavior in production you'll\nneed to configure your server.", + "access": "public", + "tagname": "", "itemtype": "method", - "name": "install", + "name": "serverMiddleware", "params": [ { - "name": "options", - "description": "", + "name": "startOptions", + "description": "Express server start options", "type": "Object" } ], - "return": { - "description": "", - "type": "Promise" - }, - "class": "Blueprint", + "example": [ + "\n```js\nserverMiddleware(startOptions) {\n var app = startOptions.app;\n\n app.use(function(req, res, next) {\n // Some middleware\n });\n}\n```\n\n- [ember-cli-content-security-policy](https://github.com/rwjblue/ember-cli-content-security-policy/blob/v0.5.0/index.js#L84)\n- [history-support-addon](https://github.com/ember-cli/ember-cli/blob/v2.4.3/lib/tasks/server/middleware/history-support/index.js#L25)" + ], + "class": "Addon", "module": "ember-cli" }, { - "file": "lib/models/blueprint.js", - "line": 468, + "file": "lib/models/addon.js", + "line": 1520, + "description": "This hook allows you to make changes to the express server run by testem.\n\nThis function is not implemented by default\n\n#### Uses:\n\n- Adding custom test-specific endpoints\n- Manipulating HTTP requests in tests", + "access": "public", + "tagname": "", "itemtype": "method", - "name": "uninstall", + "name": "testemMiddleware", "params": [ { - "name": "options", - "description": "", + "name": "app", + "description": "the express app instance", "type": "Object" } ], - "return": { - "description": "", - "type": "Promise" - }, - "class": "Blueprint", - "module": "ember-cli" - }, - { - "file": "lib/models/blueprint.js", - "line": 493, - "description": "Hook for running operations before install.", - "itemtype": "method", - "name": "beforeInstall", - "return": { - "description": "", - "type": "Promise|null" - }, - "class": "Blueprint", - "module": "ember-cli" - }, - { - "file": "lib/models/blueprint.js", - "line": 500, - "description": "Hook for running operations after install.", - "itemtype": "method", - "name": "afterInstall", - "return": { - "description": "", - "type": "Promise|null" - }, - "class": "Blueprint", - "module": "ember-cli" - }, - { - "file": "lib/models/blueprint.js", - "line": 507, - "description": "Hook for running operations before uninstall.", - "itemtype": "method", - "name": "beforeUninstall", - "return": { - "description": "", - "type": "Promise|null" - }, - "class": "Blueprint", - "module": "ember-cli" - }, - { - "file": "lib/models/blueprint.js", - "line": 514, - "description": "Hook for running operations after uninstall.", - "itemtype": "method", - "name": "afterUninstall", - "return": { - "description": "", - "type": "Promise|null" - }, - "class": "Blueprint", + "class": "Addon", "module": "ember-cli" }, { - "file": "lib/models/blueprint.js", - "line": 523, - "description": "Hook for adding custom template variables.\n\nWhen the following is called on the command line:\n\n```sh\nember generate controller foo --type=array --dry-run isAdmin:true\n```\n\nThe object passed to `locals` looks like this:\n\n```js\n{\n entity: {\n name: 'foo',\n options: {\n isAdmin: true\n }\n },\n dryRun: true\n type: \"array\"\n // more keys\n}\n```\n\nThis hook must return an object or a Promise which resolves to an object.\nThe resolved object will be merged with the aforementioned default locals.", + "file": "lib/models/addon.js", + "line": 1535, + "description": "This hook is called before a build takes place.", "access": "public", "tagname": "", "itemtype": "method", - "name": "locals", + "name": "preBuild", "params": [ { - "name": "options", - "description": "General and entity-specific options", + "name": "result", + "description": "Build object", "type": "Object" } ], - "return": { - "description": "", - "type": "Object|Promise|null" - }, - "class": "Blueprint", + "class": "Addon", "module": "ember-cli" }, { - "file": "lib/models/blueprint.js", - "line": 558, - "description": "Hook to add additional or override existing fileMap tokens.\n\nUse `fileMapTokens` to add custom fileMap tokens for use\nin the `mapFile` method. The hook must return an object in the\nfollowing pattern:\n\n```js\n{\n __token__(options){\n // logic to determine value goes here\n return 'value';\n }\n}\n```\n\nIt will be merged with the default `fileMapTokens`, and can be used\nto override any of the default tokens.\n\nTokens are used in the files folder (see `files`), and get replaced with\nvalues when the `mapFile` method is called.", + "file": "lib/models/addon.js", + "line": 1543, + "description": "This hook is called after a build is complete.\n\nIt's passed a `result` object which contains:\n- `directory` Path to build output\n\n#### Uses:\n\n- Slow tree listing\n- May be used to manipulate your project after build has happened", "access": "public", "tagname": "", "itemtype": "method", - "name": "fileMapTokens", - "return": { - "description": "", - "type": "Object|null" - }, - "class": "Blueprint", - "module": "ember-cli" - }, - { - "file": "lib/models/blueprint.js", - "line": 586, - "access": "private", - "tagname": "", - "itemtype": "method", - "name": "_fileMapTokens", + "name": "postBuild", "params": [ { - "name": "options", - "description": "", + "name": "result", + "description": "Build result object", "type": "Object" } ], - "return": { - "description": "", - "type": "Object" - }, - "class": "Blueprint", + "class": "Addon", "module": "ember-cli" }, { - "file": "lib/models/blueprint.js", - "line": 642, - "description": "Used to generate fileMap tokens for mapFile.", + "file": "lib/models/addon.js", + "line": 1559, + "description": "This hook is called after the build has been processed and the build files have been copied to the output directory\n\nIt's passed a `result` object which contains:\n- `directory` Path to build output", + "access": "public", + "tagname": "", "itemtype": "method", - "name": "generateFileMap", + "name": "outputReady", "params": [ { - "name": "fileMapVariables", - "description": "", + "name": "result", + "description": "Build result object", "type": "Object" } ], - "return": { - "description": "", - "type": "Object" - }, - "class": "Blueprint", + "example": [ + "\n- Opportunity to symlink or copy files elsewhere.\n- [ember-cli-rails-addon](https://github.com/rondale-sc/ember-cli-rails-addon/blob/v0.7.0/index.js#L45)\n - In this case we are using this in tandem with a rails middleware to remove a lock file.\n This allows our ruby gem to block incoming requests until after the build happens reliably." + ], + "class": "Addon", "module": "ember-cli" }, { - "file": "lib/models/blueprint.js", - "line": 657, + "file": "lib/models/addon.js", + "line": 1576, + "description": "This hook is called when an error occurs during the preBuild, postBuild or outputReady hooks\nfor addons, or when the build fails\n\n#### Uses:\n\n- Custom error handling during build process", + "access": "public", + "tagname": "", "itemtype": "method", - "name": "buildFileInfo", + "name": "buildError", "params": [ { - "name": "destPath", - "description": "", - "type": "Function" - }, - { - "name": "templateVariables", - "description": "", - "type": "Object" - }, - { - "name": "file", - "description": "", - "type": "String" + "name": "error", + "description": "The error that was caught during the processes listed above", + "type": "Error" } ], - "return": { - "description": "", - "type": "FileInfo" - }, - "class": "Blueprint", - "module": "ember-cli" - }, - { - "file": "lib/models/blueprint.js", - "line": 678, - "itemtype": "method", - "name": "isUpdate", - "return": { - "description": "", - "type": "Boolean" - }, - "class": "Blueprint", + "example": [ + "\n- [ember-cli-rails-addon](https://github.com/rondale-sc/ember-cli-rails-addon/blob/v0.7.0/index.js#L11)" + ], + "class": "Addon", "module": "ember-cli" }, { - "file": "lib/models/blueprint.js", - "line": 688, - "access": "private", + "file": "lib/models/addon.js", + "line": 1592, + "description": "Used to add preprocessors to the preprocessor registry. This is often used by addons like [ember-cli-htmlbars](https://github.com/ember-cli/ember-cli-htmlbars)\nand [ember-cli-coffeescript](https://github.com/kimroen/ember-cli-coffeescript) to add a `template` or `js` preprocessor to the registry.\n\n**Uses:**\n\n- Adding preprocessors to the registry.", + "access": "public", "tagname": "", "itemtype": "method", - "name": "_getFileInfos", + "name": "setupPreprocessorRegistry", "params": [ { - "name": "files", - "description": "", - "type": "Array" - }, - { - "name": "intoDir", - "description": "", + "name": "type", + "description": "either `\"self\"` or `\"parent\"`", "type": "String" }, { - "name": "templateVariables", - "description": "", - "type": "Object" + "name": "registry", + "description": "the registry to be set up" } ], - "return": { - "description": "file infos", - "type": "Array" - }, - "class": "Blueprint", + "example": [ + "\n```js\nsetupPreprocessorRegistry(type, registry) {\n // ensure that broccoli-ember-hbs-template-compiler is not processing hbs files\n registry.remove('template', 'broccoli-ember-hbs-template-compiler');\n\n registry.add('template', {\n name: 'ember-cli-htmlbars',\n ext: 'hbs',\n _addon: this,\n toTree(tree) {\n var htmlbarsOptions = this._addon.htmlbarsOptions();\n return htmlbarsCompile(tree, htmlbarsOptions);\n },\n\n precompile(string) {\n var htmlbarsOptions = this._addon.htmlbarsOptions();\n var templateCompiler = htmlbarsOptions.templateCompiler;\n return utils.template(templateCompiler, string);\n }\n });\n\n if (type === 'parent') {\n this.parentRegistry = registry;\n }\n}\n```" + ], + "class": "Addon", "module": "ember-cli" }, { - "file": "lib/models/blueprint.js", - "line": 700, - "description": "Add update files to ignored files or reset them", - "access": "private", + "file": "lib/models/addon.js", + "line": 1634, + "description": "Return value is merged into the **tests** tree. This lets you inject\nlinter output as test results.\n\n**Uses:**\n\n- JSHint\n- any other form of automated test generation that turns code into tests", + "access": "public", "tagname": "", "itemtype": "method", - "name": "_ignoreUpdateFiles", - "class": "Blueprint", + "name": "lintTree", + "params": [ + { + "name": "treeType", + "description": "`app`, `tests`, `templates`, or `addon`", + "type": "String" + }, + { + "name": "tree", + "description": "tree of files (JavaScript files for `app`, `tests`, and `addon` types)", + "type": "Tree" + } + ], + "example": [ + "\n- [ember-cli-qunit](https://github.com/ember-cli/ember-cli-qunit/blob/v1.4.1/index.js#L206)\n- [ember-cli-mocha](https://github.com/ef4/ember-cli-mocha/blob/66803037fe203b24e96dea83a2bd91de48b842e1/index.js#L101)" + ], + "class": "Addon", "module": "ember-cli" }, { - "file": "lib/models/blueprint.js", - "line": 713, - "access": "private", + "file": "lib/models/addon.js", + "line": 1653, + "description": "Allow addons to implement contentFor method to add string output into the associated `{{content-for 'foo'}}` section in `index.html`\n\n**Uses:**\n\n- For instance, to inject analytics code into `index.html`", + "access": "public", "tagname": "", "itemtype": "method", - "name": "_getFilesForInstall", + "name": "contentFor", "params": [ { - "name": "targetFiles", - "description": "", - "type": "Array" + "name": "type", + "description": "" + }, + { + "name": "config", + "description": "" + }, + { + "name": "content", + "description": "" } ], - "return": { - "description": "files", - "type": "Array" - }, + "example": [ + "\n- [ember-cli-google-analytics](https://github.com/pgrippi/ember-cli-google-analytics/blob/v1.5.0/index.js#L79)" + ], + "class": "Addon", + "module": "ember-cli" + }, + { + "file": "lib/models/blueprint.js", + "line": 198, + "description": "Indicates whether or not a blueprint is a candidate for automatic transpilation from TS to JS.\nThis property could be false in the case that the blueprint is written in JS and is not intended\nto work with TS at all, OR in the case that the blueprint is written in TS and the author does\nnot intend to support transpilation to JS.", + "access": "public", + "tagname": "", + "itemtype": "property", + "name": "shouldTransformTypeScript", + "type": "Boolean", "class": "Blueprint", "module": "ember-cli" }, { "file": "lib/models/blueprint.js", - "line": 726, + "line": 219, + "description": "Process the options object coming from either\nthe `init`, `install` or `uninstall` hook.", "access": "private", "tagname": "", "itemtype": "method", - "name": "_checkForNoMatch", + "name": "_processOptions", "params": [ { - "name": "fileInfos", - "description": "", - "type": "Array" - }, - { - "name": "rawArgs", + "name": "options", "description": "", - "type": "String" + "type": "Object" } ], "class": "Blueprint", @@ -3804,66 +3589,62 @@ }, { "file": "lib/models/blueprint.js", - "line": 740, + "line": 235, + "description": "Hook to specify the path to the blueprint's files. By default this is\n`path.join(this.path, 'files)`.\n\nThis can be used to customize which set of files to install based on options\nor environmental variables. It defaults to the `files` directory within the\nblueprint's folder.", + "access": "public", + "tagname": "", "itemtype": "method", - "name": "processFiles", + "name": "filesPath", "params": [ { - "name": "intoDir", - "description": "", - "type": "String" - }, - { - "name": "templateVariables", + "name": "options", "description": "", "type": "Object" } ], "return": { - "description": "", - "type": "Promise" + "description": "Path to the blueprints files directory.", + "type": "String" }, "class": "Blueprint", "module": "ember-cli" }, { "file": "lib/models/blueprint.js", - "line": 762, + "line": 252, + "description": "Used to retrieve files for blueprint.", + "access": "public", + "tagname": "", "itemtype": "method", - "name": "processFilesForUninstall", + "name": "files", "params": [ { - "name": "intoDir", - "description": "", - "type": "String" - }, - { - "name": "templateVariables", + "name": "options", "description": "", "type": "Object" } ], + "return": { + "description": "Contents of the blueprint's files directory", + "type": "Array" + }, "class": "Blueprint", "module": "ember-cli" }, { "file": "lib/models/blueprint.js", - "line": 775, + "line": 275, "itemtype": "method", - "name": "mapFile", + "name": "srcPath", "params": [ { "name": "file", "description": "", "type": "String" - }, - { - "name": "locals", - "description": "" } ], "return": { - "description": "", + "description": "Resolved path to the file", "type": "String" }, "class": "Blueprint", @@ -3871,207 +3652,228 @@ }, { "file": "lib/models/blueprint.js", - "line": 792, - "description": "Looks for a __root__ token in the files folder. Must be present for\nthe blueprint to support addon tokens. The `server`, `blueprints`, and `test`", - "access": "private", + "line": 284, + "description": "Hook for normalizing entity name\n\nUse the `normalizeEntityName` hook to add custom normalization and\nvalidation of the provided entity name. The default hook does not\nmake any changes to the entity name, but makes sure an entity name\nis present and that it doesn't have a trailing slash.\n\nThis hook receives the entity name as its first argument. The string\nreturned by this hook will be used as the new entity name.", + "access": "public", "tagname": "", "itemtype": "method", - "name": "supportsAddon", + "name": "normalizeEntityName", + "params": [ + { + "name": "entityName", + "description": "", + "type": "String" + } + ], "return": { "description": "", - "type": "Boolean" + "type": "Null" }, "class": "Blueprint", "module": "ember-cli" }, { "file": "lib/models/blueprint.js", - "line": 804, + "line": 304, + "description": "Write a status and message to the UI", "access": "private", "tagname": "", "itemtype": "method", - "name": "_generateFileMapVariables", + "name": "_writeStatusToUI", "params": [ { - "name": "moduleName", + "name": "chalkColor", "description": "", - "type": "String" + "type": "Function" }, { - "name": "locals", - "description": "" + "name": "keyword", + "description": "", + "type": "String" }, { - "name": "options", + "name": "message", "description": "", - "type": "Object" + "type": "String" } ], - "return": { - "description": "", - "type": "Object" - }, "class": "Blueprint", "module": "ember-cli" }, { "file": "lib/models/blueprint.js", - "line": 834, + "line": 318, "access": "private", "tagname": "", "itemtype": "method", - "name": "_locals", + "name": "_writeFile", "params": [ { - "name": "options", + "name": "info", "description": "", "type": "Object" } ], "return": { "description": "", - "type": "Object" + "type": "Promise" }, "class": "Blueprint", "module": "ember-cli" }, { "file": "lib/models/blueprint.js", - "line": 867, - "description": "Used to add a package to the project's `package.json`.\n\nGenerally, this would be done from the `afterInstall` hook, to\nensure that a package that is required by a given blueprint is\navailable.", + "line": 330, + "description": "Actions lookup", + "access": "private", + "tagname": "", + "itemtype": "property", + "name": "_actions", + "type": "Object", + "class": "Blueprint", + "module": "ember-cli" + }, + { + "file": "lib/models/blueprint.js", + "line": 368, + "description": "Calls an action.", + "access": "private", + "tagname": "", "itemtype": "method", - "name": "addPackageToProject", + "name": "_commit", "params": [ { - "name": "packageName", - "description": "", - "type": "String" - }, - { - "name": "target", + "name": "result", "description": "", - "type": "String" + "type": "Object" } ], "return": { "description": "", "type": "Promise" }, + "throws": { + "description": "Action doesn't exist.", + "type": "Error" + }, "class": "Blueprint", "module": "ember-cli" }, { "file": "lib/models/blueprint.js", - "line": 889, - "description": "Used to add multiple packages to the project's `package.json`.\n\nGenerally, this would be done from the `afterInstall` hook, to\nensure that a package that is required by a given blueprint is\navailable.\n\nExpects each array item to be an object with a `name`. Each object\nmay optionally have a `target` to specify a specific version.", - "itemtype": "method", - "name": "addPackagesToProject", + "line": 386, + "description": "Prints warning for pod unsupported.", + "access": "private", + "tagname": "", + "itemtype": "method", + "name": "_checkForPod", + "class": "Blueprint", + "module": "ember-cli" + }, + { + "file": "lib/models/blueprint.js", + "line": 403, + "access": "private", + "tagname": "", + "itemtype": "method", + "name": "_normalizeEntityName", "params": [ { - "name": "packages", + "name": "entity", "description": "", - "type": "Array" + "type": "Object" } ], - "return": { - "description": "", - "type": "Promise" - }, - "example": [ - "\n```js\nthis.addPackagesToProject([\n { name: 'lodash' },\n { name: 'moment', target: '^2.17.0' },\n]);\n```" - ], "class": "Blueprint", "module": "ember-cli" }, { "file": "lib/models/blueprint.js", - "line": 938, - "description": "Used to remove a package from the project's `package.json`.\n\nGenerally, this would be done from the `afterInstall` hook, to\nensure that any package conflicts can be resolved before the\naddon is used.", + "line": 414, + "access": "private", + "tagname": "", "itemtype": "method", - "name": "removePackageFromProject", + "name": "_checkInRepoAddonExists", "params": [ { - "name": "packageName", + "name": "options", "description": "", - "type": "String" + "type": "Object" } ], - "return": { - "description": "", - "type": "Promise" - }, "class": "Blueprint", "module": "ember-cli" }, { "file": "lib/models/blueprint.js", - "line": 955, - "description": "Used to remove multiple packages from the project's `package.json`.\n\nGenerally, this would be done from the `afterInstall` hook, to\nensure that any package conflicts can be resolved before the\naddon is used.\n\nExpects each array item to be an object with a `name` property.", + "line": 443, + "access": "private", + "tagname": "", "itemtype": "method", - "name": "removePackagesFromProject", + "name": "_process", "params": [ { - "name": "packages", + "name": "options", "description": "", - "type": "Array" + "type": "Object" + }, + { + "name": "beforeHook", + "description": "", + "type": "Function" + }, + { + "name": "process", + "description": "", + "type": "Function" + }, + { + "name": "afterHook", + "description": "", + "type": "Function" } ], - "return": { - "description": "", - "type": "Promise" - }, "class": "Blueprint", "module": "ember-cli" }, { "file": "lib/models/blueprint.js", - "line": 996, - "description": "Used to add a package to the projects `bower.json`.\n\nGenerally, this would be done from the `afterInstall` hook, to\nensure that a package that is required by a given blueprint is\navailable.\n\n`localPackageName` and `target` may be thought of as equivalent\nto the key-value pairs in the `dependency` or `devDepencency`\nobjects contained within a bower.json file.", + "line": 469, + "access": "private", + "tagname": "", "itemtype": "method", - "name": "addBowerPackageToProject", + "name": "shouldConvertToJS", "params": [ { - "name": "localPackageName", - "description": "", - "type": "String" - }, - { - "name": "target", + "name": "options", "description": "", - "type": "String" + "type": "Object" }, { - "name": "installOptions", + "name": "fileInfo", "description": "", - "type": "Object" + "type": "FileInfo" } ], "return": { "description": "", - "type": "Promise" + "type": "Boolean" }, - "example": [ - "\n```js\naddBowerPackageToProject('jquery', '~1.11.1');\naddBowerPackageToProject('old_jquery', 'jquery#~1.9.1');\naddBowerPackageToProject('bootstrap-3', 'https://twitter.github.io/bootstrap/assets/bootstrap');\n```" - ], "class": "Blueprint", "module": "ember-cli" }, { "file": "lib/models/blueprint.js", - "line": 1026, - "description": "Used to add an array of packages to the projects `bower.json`.\n\nGenerally, this would be done from the `afterInstall` hook, to\nensure that a package that is required by a given blueprint is\navailable.\n\nExpects each array item to be an object with a `name`. Each object\nmay optionally have a `target` to specify a specific version, or a\n`source` to specify a non-local name to be resolved.", + "line": 523, + "access": "private", + "tagname": "", "itemtype": "method", - "name": "addBowerPackagesToProject", + "name": "convertToJS", "params": [ { - "name": "packages", - "description": "", - "type": "Array" - }, - { - "name": "installOptions", + "name": "fileInfo", "description": "", - "type": "Object" + "type": "FileInfo" } ], "return": { @@ -4083,10 +3885,9 @@ }, { "file": "lib/models/blueprint.js", - "line": 1063, - "description": "Used to add an addon to the project's `package.json` and run it's\n`defaultBlueprint` if it provides one.\n\nGenerally, this would be done from the `afterInstall` hook, to\nensure that a package that is required by a given blueprint is\navailable.", + "line": 543, "itemtype": "method", - "name": "addAddonToProject", + "name": "install", "params": [ { "name": "options", @@ -4103,10 +3904,9 @@ }, { "file": "lib/models/blueprint.js", - "line": 1083, - "description": "Used to add multiple addons to the project's `package.json` and run their\n`defaultBlueprint` if they provide one.\n\nGenerally, this would be done from the `afterInstall` hook, to\nensure that a package that is required by a given blueprint is\navailable.", + "line": 570, "itemtype": "method", - "name": "addAddonsToProject", + "name": "uninstall", "params": [ { "name": "options", @@ -4123,2759 +3923,2684 @@ }, { "file": "lib/models/blueprint.js", - "line": 1129, - "description": "Used to retrieve a task with the given name. Passes the new task\nthe standard information available (like `ui`, `analytics`, `project`, etc).", + "line": 592, + "description": "Hook for running operations before install.", "itemtype": "method", - "name": "taskFor", - "params": [ - { - "name": "dasherizedName", - "description": "" - } - ], - "access": "public", - "tagname": "", + "name": "beforeInstall", + "return": { + "description": "", + "type": "Promise|null" + }, "class": "Blueprint", "module": "ember-cli" }, { "file": "lib/models/blueprint.js", - "line": 1147, - "description": "Inserts the given content into a file. If the `contentsToInsert` string is already\npresent in the current contents, the file will not be changed unless `force` option\nis passed.\n\nIf `options.before` is specified, `contentsToInsert` will be inserted before\nthe first instance of that string. If `options.after` is specified, the\ncontents will be inserted after the first instance of that string.\nIf the string specified by options.before or options.after is not in the file,\nno change will be made.\n\nIf neither `options.before` nor `options.after` are present, `contentsToInsert`\nwill be inserted at the end of the file.\n\nExample:\n```\n// app/router.js\nRouter.map(function() {\n});\n```\n\n```\ninsertIntoFile('app/router.js', ' this.route(\"admin\");', {\n after: 'Router.map(function() {' + EOL\n}).then(function() {\n // file has been inserted into!\n});\n\n\n```\n\n```\n// app/router.js\nRouter.map(function() {\n this.route(\"admin\");\n});\n```", + "line": 599, + "description": "Hook for running operations after install.", "itemtype": "method", - "name": "insertIntoFile", - "params": [ - { - "name": "pathRelativeToProjectRoot", - "description": "", - "type": "String" - }, - { - "name": "contentsToInsert", - "description": "", - "type": "String" - }, - { - "name": "providedOptions", - "description": "", - "type": "Object" - } - ], + "name": "afterInstall", "return": { "description": "", - "type": "Promise" + "type": "Promise|null" }, "class": "Blueprint", "module": "ember-cli" }, { "file": "lib/models/blueprint.js", - "line": 1251, - "description": "Used to retrieve a blueprint with the given name.", + "line": 606, + "description": "Hook for running operations before uninstall.", "itemtype": "method", - "name": "lookupBlueprint", - "params": [ - { - "name": "dasherizedName", - "description": "", - "type": "String" - } - ], + "name": "beforeUninstall", "return": { "description": "", - "type": "Blueprint" + "type": "Promise|null" }, - "access": "public", - "tagname": "", "class": "Blueprint", "module": "ember-cli" }, { "file": "lib/models/blueprint.js", - "line": 1268, - "static": 1, + "line": 613, + "description": "Hook for running operations after uninstall.", "itemtype": "method", - "name": "lookup", + "name": "afterUninstall", + "return": { + "description": "", + "type": "Promise|null" + }, + "class": "Blueprint", + "module": "ember-cli" + }, + { + "file": "lib/models/blueprint.js", + "line": 622, + "description": "Hook for adding custom template variables.\n\nWhen the following is called on the command line:\n\n```sh\nember generate controller foo --type=array --dry-run isAdmin:true\n```\n\nThe object passed to `locals` looks like this:\n\n```js\n{\n entity: {\n name: 'foo',\n options: {\n isAdmin: true\n }\n },\n dryRun: true\n type: \"array\"\n // more keys\n}\n```\n\nThis hook must return an object or a Promise which resolves to an object.\nThe resolved object will be merged with the aforementioned default locals.", + "access": "public", + "tagname": "", + "itemtype": "method", + "name": "locals", "params": [ - { - "name": "name", - "description": "", - "type": "String" - }, { "name": "options", - "description": "", - "type": "Object", - "optional": true, - "props": [ - { - "name": "paths", - "description": "Extra paths to search for blueprints", - "type": "Array", - "optional": true - }, - { - "name": "ignoreMissing", - "description": "Throw a `SilentError` if a\n matching Blueprint could not be found", - "type": "Boolean", - "optional": true - } - ] + "description": "General and entity-specific options", + "type": "Object" } ], "return": { "description": "", - "type": "Blueprint" + "type": "Object|Promise|null" }, "class": "Blueprint", - "module": "ember-cli", - "namespace": "Blueprint" + "module": "ember-cli" }, { "file": "lib/models/blueprint.js", - "line": 1298, - "description": "Loads a blueprint from given path.", - "static": 1, + "line": 657, + "description": "Hook to add additional or override existing fileMap tokens.\n\nUse `fileMapTokens` to add custom fileMap tokens for use\nin the `mapFile` method. The hook must return an object in the\nfollowing pattern:\n\n```js\n{\n __token__(options){\n // logic to determine value goes here\n return 'value';\n }\n}\n```\n\nIt will be merged with the default `fileMapTokens`, and can be used\nto override any of the default tokens.\n\nTokens are used in the files folder (see `files`), and get replaced with\nvalues when the `mapFile` method is called.", + "access": "public", + "tagname": "", "itemtype": "method", - "name": "load", + "name": "fileMapTokens", + "return": { + "description": "", + "type": "Object|null" + }, + "class": "Blueprint", + "module": "ember-cli" + }, + { + "file": "lib/models/blueprint.js", + "line": 685, + "access": "private", + "tagname": "", + "itemtype": "method", + "name": "_fileMapTokens", "params": [ { - "name": "blueprintPath", + "name": "options", "description": "", - "type": "String" + "type": "Object" } ], "return": { - "description": "blueprint instance", - "type": "Blueprint" + "description": "", + "type": "Object" }, "class": "Blueprint", - "module": "ember-cli", - "namespace": "Blueprint" + "module": "ember-cli" }, { "file": "lib/models/blueprint.js", - "line": 1325, - "static": 1, + "line": 741, + "description": "Used to generate fileMap tokens for mapFile.", "itemtype": "method", - "name": "list", + "name": "generateFileMap", "params": [ { - "name": "options", + "name": "fileMapVariables", "description": "", - "type": "Object", - "optional": true, - "props": [ - { - "name": "paths", - "description": "Extra paths to search for blueprints", - "type": "Array", - "optional": true - } - ] + "type": "Object" } ], "return": { "description": "", - "type": "Array" + "type": "Object" }, "class": "Blueprint", - "module": "ember-cli", - "namespace": "Blueprint" + "module": "ember-cli" }, { "file": "lib/models/blueprint.js", - "line": 1374, - "description": "Files that are renamed when installed into the target directory.\nThis allows including files in the blueprint that would have an effect\non another process, such as a file named `.gitignore`.\n\nThe keys are the filenames used in the files folder.\nThe values are the filenames used in the target directory.", - "static": 1, - "itemtype": "property", - "name": "renamedFiles", - "class": "Blueprint", - "module": "ember-cli", - "namespace": "Blueprint" - }, - { - "file": "lib/models/blueprint.js", - "line": 1389, - "static": 1, - "itemtype": "property", - "name": "ignoredFiles", - "class": "Blueprint", - "module": "ember-cli", - "namespace": "Blueprint" - }, - { - "file": "lib/models/blueprint.js", - "line": 1395, - "static": 1, - "itemtype": "property", - "name": "ignoredUpdateFiles", + "line": 756, + "itemtype": "method", + "name": "buildFileInfo", + "params": [ + { + "name": "destPath", + "description": "", + "type": "Function" + }, + { + "name": "templateVariables", + "description": "", + "type": "Object" + }, + { + "name": "file", + "description": "", + "type": "String" + } + ], + "return": { + "description": "", + "type": "FileInfo" + }, "class": "Blueprint", - "module": "ember-cli", - "namespace": "Blueprint" + "module": "ember-cli" }, { "file": "lib/models/blueprint.js", - "line": 1401, - "static": 1, - "itemtype": "property", - "name": "defaultLookupPaths", + "line": 777, + "itemtype": "method", + "name": "isUpdate", + "return": { + "description": "", + "type": "Boolean" + }, "class": "Blueprint", - "module": "ember-cli", - "namespace": "Blueprint" + "module": "ember-cli" }, { "file": "lib/models/blueprint.js", - "line": 1409, + "line": 787, "access": "private", "tagname": "", "itemtype": "method", - "name": "prepareConfirm", + "name": "_getFileInfos", "params": [ { - "name": "info", + "name": "files", "description": "", - "type": "FileInfo" + "type": "Array" + }, + { + "name": "intoDir", + "description": "", + "type": "String" + }, + { + "name": "templateVariables", + "description": "", + "type": "Object" } ], "return": { - "description": "", - "type": "Promise" + "description": "file infos", + "type": "Array" }, "class": "Blueprint", - "module": "ember-cli", - "namespace": "Blueprint" + "module": "ember-cli" }, { "file": "lib/models/blueprint.js", - "line": 1422, + "line": 799, + "description": "Add update files to ignored files or reset them", "access": "private", "tagname": "", "itemtype": "method", - "name": "markIdenticalToBeSkipped", + "name": "_ignoreUpdateFiles", + "class": "Blueprint", + "module": "ember-cli" + }, + { + "file": "lib/models/blueprint.js", + "line": 812, + "access": "private", + "tagname": "", + "itemtype": "method", + "name": "_getFilesForInstall", "params": [ { - "name": "info", + "name": "targetFiles", "description": "", - "type": "FileInfo" + "type": "Array" } ], + "return": { + "description": "files", + "type": "Array" + }, "class": "Blueprint", - "module": "ember-cli", - "namespace": "Blueprint" + "module": "ember-cli" }, { "file": "lib/models/blueprint.js", - "line": 1433, + "line": 825, "access": "private", "tagname": "", "itemtype": "method", - "name": "markToBeRemoved", + "name": "_checkForNoMatch", "params": [ { - "name": "info", + "name": "fileInfos", "description": "", - "type": "FileInfo" + "type": "Array" + }, + { + "name": "rawArgs", + "description": "", + "type": "String" } ], "class": "Blueprint", - "module": "ember-cli", - "namespace": "Blueprint" + "module": "ember-cli" }, { "file": "lib/models/blueprint.js", - "line": 1442, - "access": "private", - "tagname": "", + "line": 839, "itemtype": "method", - "name": "gatherConfirmationMessages", + "name": "processFiles", "params": [ { - "name": "collection", + "name": "intoDir", "description": "", - "type": "Array" + "type": "String" }, { - "name": "info", + "name": "templateVariables", "description": "", - "type": "FileInfo" + "type": "Object" } ], "return": { "description": "", - "type": "Array" + "type": "Promise" }, "class": "Blueprint", - "module": "ember-cli", - "namespace": "Blueprint" + "module": "ember-cli" }, { "file": "lib/models/blueprint.js", - "line": 1456, - "access": "private", - "tagname": "", + "line": 872, "itemtype": "method", - "name": "isIgnored", + "name": "processFilesForUninstall", "params": [ { - "name": "info", + "name": "intoDir", "description": "", - "type": "FileInfo" + "type": "String" + }, + { + "name": "templateVariables", + "description": "", + "type": "Object" } ], - "return": { - "description": "", - "type": "Boolean" - }, "class": "Blueprint", - "module": "ember-cli", - "namespace": "Blueprint" + "module": "ember-cli" }, { "file": "lib/models/blueprint.js", - "line": 1468, - "description": "Combines provided lookup paths with defaults and removes\nduplicates.", - "access": "private", - "tagname": "", + "line": 923, "itemtype": "method", - "name": "generateLookupPaths", + "name": "mapFile", "params": [ { - "name": "lookupPaths", + "name": "file", "description": "", - "type": "Array" + "type": "String" + }, + { + "name": "locals", + "description": "" } ], "return": { "description": "", - "type": "Array" + "type": "String" }, "class": "Blueprint", - "module": "ember-cli", - "namespace": "Blueprint" + "module": "ember-cli" }, { "file": "lib/models/blueprint.js", - "line": 1483, - "description": "Looks for a __path__ token in the files folder. Must be present for\nthe blueprint to support pod tokens.", + "line": 940, + "description": "Looks for a __root__ token in the files folder. Must be present for\nthe blueprint to support addon tokens. The `server`, `blueprints`, and `test`", "access": "private", "tagname": "", "itemtype": "method", - "name": "hasPathToken", - "params": [ - { - "name": "files", - "description": "", - "type": "Files" - } - ], + "name": "supportsAddon", "return": { "description": "", "type": "Boolean" }, "class": "Blueprint", - "module": "ember-cli", - "namespace": "Blueprint" + "module": "ember-cli" }, { "file": "lib/models/blueprint.js", - "line": 1522, + "line": 952, "access": "private", "tagname": "", "itemtype": "method", - "name": "isValidFile", + "name": "_generateFileMapVariables", "params": [ { - "name": "fileInfo", + "name": "moduleName", + "description": "", + "type": "String" + }, + { + "name": "locals", + "description": "" + }, + { + "name": "options", "description": "", "type": "Object" } ], "return": { "description": "", - "type": "Promise" + "type": "Object" }, "class": "Blueprint", - "module": "ember-cli", - "namespace": "Blueprint" + "module": "ember-cli" }, { "file": "lib/models/blueprint.js", - "line": 1536, + "line": 982, "access": "private", "tagname": "", "itemtype": "method", - "name": "isFilePath", + "name": "_locals", "params": [ { - "name": "fileInfo", + "name": "options", "description": "", "type": "Object" } ], "return": { "description": "", - "type": "Promise" + "type": "Object" }, "class": "Blueprint", - "module": "ember-cli", - "namespace": "Blueprint" + "module": "ember-cli" }, { "file": "lib/models/blueprint.js", - "line": 1546, - "access": "private", - "tagname": "", + "line": 1015, + "description": "Used to add a package to the project's `package.json`.\n\nGenerally, this would be done from the `afterInstall` hook, to\nensure that a package that is required by a given blueprint is\navailable.", "itemtype": "method", - "name": "dir", + "name": "addPackageToProject", + "params": [ + { + "name": "packageName", + "description": "", + "type": "String" + }, + { + "name": "target", + "description": "", + "type": "String" + } + ], "return": { - "description": "list of files in the given directory or and empty array if no directory exists", - "type": "Array" + "description": "", + "type": "Promise" }, "class": "Blueprint", - "module": "ember-cli", - "namespace": "Blueprint" + "module": "ember-cli" }, { "file": "lib/models/blueprint.js", - "line": 1559, - "access": "private", - "tagname": "", + "line": 1037, + "description": "Used to add multiple packages to the project's `package.json`.\n\nGenerally, this would be done from the `afterInstall` hook, to\nensure that a package that is required by a given blueprint is\navailable.\n\nExpects each array item to be an object with a `name`. Each object\nmay optionally have a `target` to specify a specific version.", "itemtype": "method", - "name": "getDetailedHelpPath", + "name": "addPackagesToProject", "params": [ { - "name": "thisPath", + "name": "packages", "description": "", - "type": "String" + "type": "Array" } ], "return": { - "description": "help path", - "type": "String" + "description": "", + "type": "Promise" }, + "example": [ + "\n```js\nthis.addPackagesToProject([\n { name: 'lodash' },\n { name: 'moment', target: '^2.17.0' },\n]);\n```" + ], "class": "Blueprint", - "module": "ember-cli", - "namespace": "Blueprint" + "module": "ember-cli" }, { - "file": "lib/models/builder.js", - "line": 40, - "access": "private", - "tagname": "", + "file": "lib/models/blueprint.js", + "line": 1086, + "description": "Used to remove a package from the project's `package.json`.\n\nGenerally, this would be done from the `afterInstall` hook, to\nensure that any package conflicts can be resolved before the\naddon is used.", "itemtype": "method", - "name": "readBuildFile", + "name": "removePackageFromProject", "params": [ { - "name": "path", - "description": "The file path to read the build file from" + "name": "packageName", + "description": "", + "type": "String" } ], - "class": "Builder", + "return": { + "description": "", + "type": "Promise" + }, + "class": "Blueprint", "module": "ember-cli" }, { - "file": "lib/models/builder.js", - "line": 55, - "access": "private", - "tagname": "", + "file": "lib/models/blueprint.js", + "line": 1103, + "description": "Used to remove multiple packages from the project's `package.json`.\n\nGenerally, this would be done from the `afterInstall` hook, to\nensure that any package conflicts can be resolved before the\naddon is used.\n\nExpects each array item to be an object with a `name` property.", "itemtype": "method", - "name": "setupBroccoliBuilder", - "class": "Builder", + "name": "removePackagesFromProject", + "params": [ + { + "name": "packages", + "description": "", + "type": "Array" + } + ], + "return": { + "description": "", + "type": "Promise" + }, + "class": "Blueprint", "module": "ember-cli" }, { - "file": "lib/models/builder.js", - "line": 93, - "description": "Determine whether the output path is safe to delete. If the outputPath\nappears anywhere in the parents of the project root, the build would\ndelete the project directory. In this case return `false`, otherwise\nreturn `true`.", - "access": "private", - "tagname": "", + "file": "lib/models/blueprint.js", + "line": 1144, + "description": "Used to add an addon to the project's `package.json` and run it's\n`defaultBlueprint` if it provides one.\n\nGenerally, this would be done from the `afterInstall` hook, to\nensure that a package that is required by a given blueprint is\navailable.", "itemtype": "method", - "name": "canDeleteOutputPath", + "name": "addAddonToProject", "params": [ { - "name": "outputPath", + "name": "options", "description": "", - "type": "String" + "type": "Object" } ], "return": { "description": "", - "type": "Boolean" + "type": "Promise" }, - "class": "Builder", + "class": "Blueprint", "module": "ember-cli" }, { - "file": "lib/models/builder.js", - "line": 115, - "access": "private", - "tagname": "", + "file": "lib/models/blueprint.js", + "line": 1164, + "description": "Used to add multiple addons to the project's `package.json` and run their\n`defaultBlueprint` if they provide one.\n\nGenerally, this would be done from the `afterInstall` hook, to\nensure that a package that is required by a given blueprint is\navailable.", "itemtype": "method", - "name": "copyToOutputPath", + "name": "addAddonsToProject", "params": [ { - "name": "inputPath", + "name": "options", "description": "", - "type": "String" + "type": "Object" } ], - "class": "Builder", + "return": { + "description": "", + "type": "Promise" + }, + "class": "Blueprint", "module": "ember-cli" }, { - "file": "lib/models/builder.js", - "line": 139, - "access": "private", - "tagname": "", + "file": "lib/models/blueprint.js", + "line": 1241, + "description": "Used to retrieve a task with the given name. Passes the new task\nthe standard information available (like `ui`, `project`, etc).", "itemtype": "method", - "name": "processAddonBuildSteps", + "name": "taskFor", "params": [ { - "name": "buildStep", + "name": "dasherizedName", "description": "" + } + ], + "access": "public", + "tagname": "", + "class": "Blueprint", + "module": "ember-cli" + }, + { + "file": "lib/models/blueprint.js", + "line": 1258, + "description": "Inserts the given content into a file. If the `contentsToInsert` string is already\npresent in the current contents, the file will not be changed unless `force` option\nis passed.\n\nIf `options.before` is specified, `contentsToInsert` will be inserted before\nthe first instance of that string. If `options.after` is specified, the\ncontents will be inserted after the first instance of that string.\nIf the string specified by options.before or options.after is not in the file,\nno change will be made.\n\nIf neither `options.before` nor `options.after` are present, `contentsToInsert`\nwill be inserted at the end of the file.\n\nExample:\n```\n// app/router.js\nRouter.map(function () {\n});\n```\n\n```\ninsertIntoFile('app/router.js', ' this.route(\"admin\");', {\n after: 'Router.map(function () {' + EOL\n}).then(function() {\n // file has been inserted into!\n});\n\n\n```\n\n```\n// app/router.js\nRouter.map(function () {\n this.route(\"admin\");\n});\n```", + "itemtype": "method", + "name": "insertIntoFile", + "params": [ + { + "name": "pathRelativeToProjectRoot", + "description": "", + "type": "String" }, { - "name": "results", - "description": "" + "name": "contentsToInsert", + "description": "", + "type": "String" + }, + { + "name": "providedOptions", + "description": "", + "type": "Object" } ], "return": { "description": "", "type": "Promise" }, - "class": "Builder", + "class": "Blueprint", "module": "ember-cli" }, { - "file": "lib/models/builder.js", - "line": 164, - "access": "private", - "tagname": "", + "file": "lib/models/blueprint.js", + "line": 1362, + "description": "Used to retrieve a blueprint with the given name.", "itemtype": "method", - "name": "build", + "name": "lookupBlueprint", + "params": [ + { + "name": "dasherizedName", + "description": "", + "type": "String" + } + ], "return": { "description": "", - "type": "Promise" + "type": "Blueprint" }, - "class": "Builder", + "access": "public", + "tagname": "", + "class": "Blueprint", "module": "ember-cli" }, { - "file": "lib/models/builder.js", - "line": 233, - "description": "Delegates to the `cleanup` method of the wrapped Broccoli builder.", - "access": "private", - "tagname": "", + "file": "lib/models/blueprint.js", + "line": 1379, + "static": 1, "itemtype": "method", - "name": "cleanup", + "name": "lookup", + "params": [ + { + "name": "name", + "description": "", + "type": "String" + }, + { + "name": "options", + "description": "", + "type": "Object", + "optional": true, + "props": [ + { + "name": "paths", + "description": "Extra paths to search for blueprints", + "type": "Array", + "optional": true + }, + { + "name": "ignoreMissing", + "description": "Throw a `SilentError` if a\n matching Blueprint could not be found", + "type": "Boolean", + "optional": true + }, + { + "name": "blueprintOptions", + "description": "Options object that will be passed\n along to the Blueprint instance on creation.", + "type": "Object", + "optional": true + } + ] + } + ], "return": { "description": "", - "type": "Promise" + "type": "Blueprint" }, - "class": "Builder", - "module": "ember-cli" + "class": "Blueprint", + "module": "ember-cli", + "namespace": "Blueprint" }, { - "file": "lib/models/builder.js", - "line": 265, - "description": "Checks for issues in the environment that can't easily be detected until\nafter a build and issues any necessary deprecation warnings.\n\n- check for old (pre 0.1.4) versions of heimdalljs", - "access": "private", - "tagname": "", + "file": "lib/models/blueprint.js", + "line": 1420, + "description": "Loads a blueprint from given path.", + "static": 1, "itemtype": "method", - "name": "checkForPostBuildEnvironmentIssues", - "class": "Builder", - "module": "ember-cli" - }, - { - "file": "lib/models/command.js", - "line": 51, - "description": "The description of what this command does.", - "final": 1, - "itemtype": "property", - "name": "description", - "type": "String", - "class": "Command", - "module": "ember-cli" - }, - { - "file": "lib/models/command.js", - "line": 60, - "description": "Does this command work everywhere or just inside or outside of projects.\n\nPossible values:\n\n- `insideProject`\n- `outsideProject`\n- `everywhere`", - "final": 1, - "itemtype": "property", - "name": "works", - "type": "String", - "default": "`insideProject`", - "class": "Command", - "module": "ember-cli" - }, - { - "file": "lib/models/command.js", - "line": 81, - "final": 1, - "itemtype": "property", - "name": "isWithinProject", - "type": "Boolean", - "class": "Command", - "module": "ember-cli" - }, - { - "file": "lib/models/command.js", - "line": 88, - "description": "The name of the command.", - "final": 1, - "itemtype": "property", - "name": "name", - "type": "String", - "example": [ - " `new` or `generate`" + "name": "load", + "params": [ + { + "name": "blueprintPath", + "description": "", + "type": "String" + }, + { + "name": "blueprintOptions", + "description": "", + "type": "Object", + "optional": true + } ], - "class": "Command", - "module": "ember-cli" + "return": { + "description": "blueprint instance", + "type": "Blueprint" + }, + "class": "Blueprint", + "module": "ember-cli", + "namespace": "Blueprint" }, { - "file": "lib/models/command.js", - "line": 100, - "description": "An array of aliases for the command", - "final": 1, - "itemtype": "property", - "name": "aliases", - "type": "Array", - "example": [ - " `['g']` for the `generate` command" + "file": "lib/models/blueprint.js", + "line": 1448, + "static": 1, + "itemtype": "method", + "name": "list", + "params": [ + { + "name": "options", + "description": "", + "type": "Object", + "optional": true, + "props": [ + { + "name": "paths", + "description": "Extra paths to search for blueprints", + "type": "Array", + "optional": true + } + ] + } ], - "class": "Command", - "module": "ember-cli" + "return": { + "description": "", + "type": "Array" + }, + "class": "Blueprint", + "module": "ember-cli", + "namespace": "Blueprint" }, { - "file": "lib/models/command.js", - "line": 117, - "description": "An array of available options for the command", - "final": 1, + "file": "lib/models/blueprint.js", + "line": 1497, + "description": "Files that are renamed when installed into the target directory.\nThis allows including files in the blueprint that would have an effect\non another process, such as a file named `.gitignore`.\n\nThe keys are the filenames used in the files folder.\nThe values are the filenames used in the target directory.", + "static": 1, "itemtype": "property", - "name": "availableOptions", - "type": "Array", - "example": [ - "\n```js\navailableOptions: [\n { name: 'dry-run', type: Boolean, default: false, aliases: ['d'] },\n { name: 'verbose', type: Boolean, default: false, aliases: ['v'] },\n { name: 'blueprint', type: String, default: 'app', aliases: ['b'] },\n { name: 'skip-npm', type: Boolean, default: false, aliases: ['sn'] },\n { name: 'skip-bower', type: Boolean, default: false, aliases: ['sb'] },\n { name: 'skip-git', type: Boolean, default: false, aliases: ['sg'] },\n { name: 'directory', type: String , aliases: ['dir'] }\n],\n```" - ], - "class": "Command", - "module": "ember-cli" + "name": "renamedFiles", + "class": "Blueprint", + "module": "ember-cli", + "namespace": "Blueprint" }, { - "file": "lib/models/command.js", - "line": 138, - "description": "An array of anonymous options for the command", - "final": 1, + "file": "lib/models/blueprint.js", + "line": 1512, + "static": 1, "itemtype": "property", - "name": "anonymousOptions", - "type": "Array", - "example": [ - "\n```js\nanonymousOptions: [\n ''\n],\n```" - ], - "class": "Command", - "module": "ember-cli" + "name": "ignoredFiles", + "class": "Blueprint", + "module": "ember-cli", + "namespace": "Blueprint" }, { - "file": "lib/models/command.js", - "line": 154, - "description": "Registers options with command. This method provides the ability to extend or override command options.\nExpects an object containing anonymousOptions or availableOptions, which it will then merge with\nexisting availableOptions before building the optionsAliases which are used to define shorthands.", - "itemtype": "method", - "name": "registerOptions", - "params": [ - { - "name": "options", - "description": "", - "type": "Object" - } - ], - "class": "Command", - "module": "ember-cli" + "file": "lib/models/blueprint.js", + "line": 1518, + "static": 1, + "itemtype": "property", + "name": "ignoredUpdateFiles", + "class": "Blueprint", + "module": "ember-cli", + "namespace": "Blueprint" }, { - "file": "lib/models/command.js", - "line": 180, - "description": "Called when command is interrupted from outside, e.g. ctrl+C or process kill\nCan be used to cleanup artifacts produced by command and control process exit code", - "itemtype": "method", - "name": "onInterrupt", - "return": { - "description": "if rejected promise then result of promise will be used as an exit code", - "type": "Promise|undefined" - }, - "class": "Command", - "module": "ember-cli" + "file": "lib/models/blueprint.js", + "line": 1524, + "static": 1, + "itemtype": "property", + "name": "defaultLookupPaths", + "class": "Blueprint", + "module": "ember-cli", + "namespace": "Blueprint" }, { - "file": "lib/models/command.js", - "line": 208, - "description": "Looks up for the task and runs\nIt also keeps the reference for the current active task\nKeeping reference for the current task allows to cleanup task on interruption", + "file": "lib/models/blueprint.js", + "line": 1532, "access": "private", "tagname": "", "itemtype": "method", - "name": "runTask", - "throws": { - "description": "on attempt to run concurrent task", - "type": "Error" - }, + "name": "prepareConfirm", "params": [ { - "name": "name", - "description": "Task name from the tasks registry. Should be capitalized", - "type": "String" - }, - { - "name": "options", + "name": "info", "description": "", - "type": "Object" + "type": "FileInfo" } ], - "return": { - "description": "Task run", - "type": "Promise" - }, - "class": "Command", - "module": "ember-cli" - }, - { - "file": "lib/models/command.js", - "line": 249, - "description": "Hook for extending a command before it is run in the cli.run command.\nMost common use case would be to extend availableOptions.", - "itemtype": "method", - "name": "beforeRun", - "return": { - "description": "", - "type": "Promise|null" - }, - "class": "Command", - "module": "ember-cli" - }, - { - "file": "lib/models/command.js", - "line": 257, - "itemtype": "method", - "name": "validateAndRun", "return": { "description": "", "type": "Promise" }, - "class": "Command", - "module": "ember-cli" + "class": "Blueprint", + "module": "ember-cli", + "namespace": "Blueprint" }, { - "file": "lib/models/command.js", - "line": 322, - "description": "Reports if the given command has a command line option by a given name", + "file": "lib/models/blueprint.js", + "line": 1545, + "access": "private", + "tagname": "", "itemtype": "method", - "name": "hasOption", + "name": "markIdenticalToBeSkipped", "params": [ { - "name": "name", + "name": "info", "description": "", - "type": "String" + "type": "FileInfo" } ], - "return": { - "description": "", - "type": "Boolean" - }, - "class": "Command", - "module": "ember-cli" + "class": "Blueprint", + "module": "ember-cli", + "namespace": "Blueprint" }, { - "file": "lib/models/command.js", - "line": 338, - "description": "Merges any options with duplicate keys in the availableOptions array.\nUsed primarily by registerOptions.", + "file": "lib/models/blueprint.js", + "line": 1556, + "access": "private", + "tagname": "", "itemtype": "method", - "name": "mergeDuplicateOption", + "name": "markToBeRemoved", "params": [ { - "name": "key", + "name": "info", "description": "", - "type": "String" + "type": "FileInfo" } ], - "return": { - "description": "", - "type": "Object" - }, - "class": "Command", - "module": "ember-cli" + "class": "Blueprint", + "module": "ember-cli", + "namespace": "Blueprint" }, { - "file": "lib/models/command.js", - "line": 378, - "description": "Normalizes option, filling in implicit values", + "file": "lib/models/blueprint.js", + "line": 1565, + "access": "private", + "tagname": "", "itemtype": "method", - "name": "normalizeOption", + "name": "gatherConfirmationMessages", "params": [ { - "name": "option", + "name": "collection", "description": "", - "type": "Object" + "type": "Array" + }, + { + "name": "info", + "description": "", + "type": "FileInfo" } ], "return": { "description": "", - "type": "Object" + "type": "Array" }, - "class": "Command", - "module": "ember-cli" + "class": "Blueprint", + "module": "ember-cli", + "namespace": "Blueprint" }, { - "file": "lib/models/command.js", - "line": 390, - "description": "Assigns option", + "file": "lib/models/blueprint.js", + "line": 1579, + "access": "private", + "tagname": "", "itemtype": "method", - "name": "assignOption", + "name": "isIgnored", "params": [ { - "name": "option", - "description": "", - "type": "Object" - }, - { - "name": "parsedOptions", - "description": "", - "type": "Object" - }, - { - "name": "commandOptions", + "name": "info", "description": "", - "type": "Object" + "type": "FileInfo" } ], "return": { "description": "", "type": "Boolean" }, - "class": "Command", - "module": "ember-cli" + "class": "Blueprint", + "module": "ember-cli", + "namespace": "Blueprint" }, { - "file": "lib/models/command.js", - "line": 423, - "description": "Validates option", + "file": "lib/models/blueprint.js", + "line": 1591, + "description": "Combines provided lookup paths with defaults and removes\nduplicates.", + "access": "private", + "tagname": "", "itemtype": "method", - "name": "validateOption", + "name": "generateLookupPaths", "params": [ { - "name": "option", + "name": "lookupPaths", "description": "", - "type": "Object" + "type": "Array" } ], "return": { "description": "", - "type": "Boolean" + "type": "Array" }, - "class": "Command", - "module": "ember-cli" + "class": "Blueprint", + "module": "ember-cli", + "namespace": "Blueprint" }, { - "file": "lib/models/command.js", - "line": 449, - "description": "Parses alias for an option and adds it to optionsAliases", + "file": "lib/models/blueprint.js", + "line": 1606, + "description": "Looks for a __path__ token in the files folder. Must be present for\nthe blueprint to support pod tokens.", + "access": "private", + "tagname": "", "itemtype": "method", - "name": "parseAlias", + "name": "hasPathToken", "params": [ { - "name": "option", - "description": "", - "type": "Object" - }, - { - "name": "alias", + "name": "files", "description": "", - "type": "Object|String" + "type": "Files" } ], "return": { "description": "", - "type": "Object" + "type": "Boolean" }, - "class": "Command", - "module": "ember-cli" + "class": "Blueprint", + "module": "ember-cli", + "namespace": "Blueprint" }, { - "file": "lib/models/command.js", - "line": 494, + "file": "lib/models/blueprint.js", + "line": 1645, + "access": "private", + "tagname": "", "itemtype": "method", - "name": "assignAlias", + "name": "isValidFile", "params": [ { - "name": "option", - "description": "" - }, - { - "name": "alias", - "description": "" + "name": "fileInfo", + "description": "", + "type": "Object" } ], "return": { "description": "", - "type": "Boolean" + "type": "Promise" }, - "class": "Command", - "module": "ember-cli" + "class": "Blueprint", + "module": "ember-cli", + "namespace": "Blueprint" }, { - "file": "lib/models/command.js", - "line": 509, - "description": "Validates alias value", + "file": "lib/models/blueprint.js", + "line": 1659, + "access": "private", + "tagname": "", "itemtype": "method", - "name": "validateAlias", + "name": "isFilePath", "params": [ { - "name": "alias", + "name": "fileInfo", "description": "", "type": "Object" } ], "return": { "description": "", - "type": "Boolean" + "type": "Promise" }, - "class": "Command", - "module": "ember-cli" + "class": "Blueprint", + "module": "ember-cli", + "namespace": "Blueprint" }, { - "file": "lib/models/command.js", - "line": 541, - "description": "Parses command arguments and processes", + "file": "lib/models/blueprint.js", + "line": 1669, + "access": "private", + "tagname": "", "itemtype": "method", - "name": "parseArgs", + "name": "dir", + "return": { + "description": "list of files in the given directory or and empty array if no directory exists", + "type": "Array" + }, + "class": "Blueprint", + "module": "ember-cli", + "namespace": "Blueprint" + }, + { + "file": "lib/models/blueprint.js", + "line": 1682, + "access": "private", + "tagname": "", + "itemtype": "method", + "name": "getDetailedHelpPath", "params": [ { - "name": "commandArgs", + "name": "thisPath", "description": "", - "type": "Object" + "type": "String" } ], "return": { - "description": "", - "type": "Object|null" + "description": "help path", + "type": "String" }, - "class": "Command", - "module": "ember-cli" + "class": "Blueprint", + "module": "ember-cli", + "namespace": "Blueprint" }, { - "file": "lib/models/command.js", - "line": 597, + "file": "lib/models/builder.js", + "line": 39, + "access": "private", + "tagname": "", "itemtype": "method", - "name": "run", + "name": "readBuildFile", "params": [ { - "name": "commandArgs", - "description": "" + "name": "path", + "description": "The file path to read the build file from" } ], - "class": "Command", - "module": "ember-cli" - }, - { - "file": "lib/models/command.js", - "line": 607, - "description": "Prints basic help for the command.\n\nBasic help looks like this:\n\n ember generate \n Generates new code from blueprints\n aliases: g\n --dry-run (Default: false)\n --verbose (Default: false)\n\nThe default implementation is designed to cover all bases\nbut may be overridden if necessary.", - "itemtype": "method", - "name": "printBasicHelp", - "class": "Command", + "class": "Builder", "module": "ember-cli" }, { - "file": "lib/models/command.js", - "line": 638, - "description": "Prints detailed help for the command.\n\nThe default implementation is no-op and should be overridden\nfor each command where further help text is required.", + "file": "lib/models/builder.js", + "line": 60, + "access": "private", + "tagname": "", "itemtype": "method", - "name": "printDetailedHelp", - "class": "Command", + "name": "setupBroccoliBuilder", + "class": "Builder", "module": "ember-cli" }, { - "file": "lib/models/command.js", - "line": 648, + "file": "lib/models/builder.js", + "line": 98, + "description": "Determine whether the output path is safe to delete. If the outputPath\nappears anywhere in the parents of the project root, the build would\ndelete the project directory. In this case return `false`, otherwise\nreturn `true`.", + "access": "private", + "tagname": "", "itemtype": "method", - "name": "getJson", + "name": "canDeleteOutputPath", "params": [ { - "name": "options", + "name": "outputPath", "description": "", - "type": "Object" + "type": "String" } ], "return": { "description": "", - "type": "Object" + "type": "Boolean" }, - "class": "Command", + "class": "Builder", "module": "ember-cli" }, { - "file": "lib/models/hardware-info.js", - "line": 232, - "description": "Inidcates whether the host is running on battery power. This can cause\nperformance degredation.", + "file": "lib/models/builder.js", + "line": 120, "access": "private", "tagname": "", "itemtype": "method", - "name": "isUsingBattery", + "name": "copyToOutputPath", "params": [ { - "name": "platform", - "description": "The current hardware platform.\n USED FOR TESTING ONLY.", - "type": "String=process.platform" + "name": "inputPath", + "description": "", + "type": "String" } ], - "return": { - "description": "`true` iff the host is running on battery power or\n `false` if not. `null` if the battery status\n cannot be determined.", - "type": "Null|Boolean" - }, - "class": "HardwareInfo", + "class": "Builder", "module": "ember-cli" }, { - "file": "lib/models/hardware-info.js", - "line": 266, - "description": "Determines the amount of swap/virtual memory currently in use.", + "file": "lib/models/builder.js", + "line": 144, "access": "private", "tagname": "", "itemtype": "method", - "name": "memorySwapUsed", + "name": "processAddonBuildSteps", "params": [ { - "name": "platform", - "description": "The current hardware platform.\n USED FOR TESTING ONLY.", - "type": "String=process.platform" + "name": "buildStep", + "description": "" + }, + { + "name": "results", + "description": "" } ], "return": { - "description": "The amount of used swap space, in bytes. `null` if\n the used swap space cannot be determined.", - "type": "Null|Number" + "description": "", + "type": "Promise" }, - "class": "HardwareInfo", + "class": "Builder", "module": "ember-cli" }, { - "file": "lib/models/hardware-info.js", - "line": 297, - "description": "Determines the total amount of memory available to the host, as from\n`os.totalmem`.", + "file": "lib/models/builder.js", + "line": 169, "access": "private", "tagname": "", "itemtype": "method", - "name": "memoryTotal", + "name": "build", "return": { - "description": "The total memory in bytes.", - "type": "Number" + "description": "", + "type": "Promise" }, - "class": "HardwareInfo", + "class": "Builder", "module": "ember-cli" }, { - "file": "lib/models/hardware-info.js", - "line": 309, - "description": "Determines the amount of memory currently being used by the current Node\nprocess, as from `process.memoryUsage`.", + "file": "lib/models/builder.js", + "line": 244, + "description": "Delegates to the `cleanup` method of the wrapped Broccoli builder.", "access": "private", "tagname": "", "itemtype": "method", - "name": "memoryUsed", + "name": "cleanup", "return": { - "description": "The Resident Set Size, as reported by\n `process.memoryUsage`.", - "type": "Object" + "description": "", + "type": "Promise" }, - "class": "HardwareInfo", + "class": "Builder", "module": "ember-cli" }, { - "file": "lib/models/hardware-info.js", - "line": 322, - "description": "Determines the number of logical processors available to the host, as from\n`os.cpus`.", + "file": "lib/models/builder.js", + "line": 276, + "description": "Checks for issues in the environment that can't easily be detected until\nafter a build and issues any necessary deprecation warnings.\n\n- check for old (pre 0.1.4) versions of heimdalljs", "access": "private", "tagname": "", "itemtype": "method", - "name": "processorCount", - "return": { - "description": "The number of logical processors.", - "type": "Number" - }, - "class": "HardwareInfo", + "name": "checkForPostBuildEnvironmentIssues", + "class": "Builder", "module": "ember-cli" }, { - "file": "lib/models/hardware-info.js", - "line": 334, - "description": "Determines the average processor load across the system. This is\nexpressed as a fractional number between 0 and the number of logical\nprocessors.", - "access": "private", - "tagname": "", - "itemtype": "method", - "name": "processorLoad", - "params": [ - { - "name": "platform", - "description": "The current hardware platform.\n USED FOR TESTING ONLY.", - "type": "String=process.platform" - } + "file": "lib/models/command.js", + "line": 51, + "description": "The description of what this command does.", + "final": 1, + "itemtype": "property", + "name": "description", + "type": "String", + "class": "Command", + "module": "ember-cli" + }, + { + "file": "lib/models/command.js", + "line": 60, + "description": "Does this command work everywhere or just inside or outside of projects.\n\nPossible values:\n\n- `insideProject`\n- `outsideProject`\n- `everywhere`", + "final": 1, + "itemtype": "property", + "name": "works", + "type": "String", + "default": "`insideProject`", + "class": "Command", + "module": "ember-cli" + }, + { + "file": "lib/models/command.js", + "line": 81, + "final": 1, + "itemtype": "property", + "name": "isWithinProject", + "type": "Boolean", + "class": "Command", + "module": "ember-cli" + }, + { + "file": "lib/models/command.js", + "line": 88, + "description": "The name of the command.", + "final": 1, + "itemtype": "property", + "name": "name", + "type": "String", + "example": [ + " `new` or `generate`" ], - "return": { - "description": "The one-, five-, and fifteen-minute processor load\n averages.", - "type": "Array" - }, - "class": "HardwareInfo", + "class": "Command", "module": "ember-cli" }, { - "file": "lib/models/hardware-info.js", - "line": 358, - "description": "Gets the speed of the host's processors.\n\nIf more than one processor is found, the average of their speeds is taken.", - "access": "private", - "tagname": "", - "itemtype": "method", - "name": "processorSpeed", - "return": { - "description": "The average processor speed in MHz.", - "type": "Number" - }, - "class": "HardwareInfo", + "file": "lib/models/command.js", + "line": 100, + "description": "An array of aliases for the command", + "final": 1, + "itemtype": "property", + "name": "aliases", + "type": "Array", + "example": [ + " `['g']` for the `generate` command" + ], + "class": "Command", "module": "ember-cli" }, { - "file": "lib/models/hardware-info.js", - "line": 373, - "description": "Determines the time since the host was started, as from `os.uptime`.", - "access": "private", - "tagname": "", + "file": "lib/models/command.js", + "line": 117, + "description": "An array of available options for the command", + "final": 1, + "itemtype": "property", + "name": "availableOptions", + "type": "Array", + "example": [ + "\n```js\navailableOptions: [\n { name: 'dry-run', type: Boolean, default: false, aliases: ['d'] },\n { name: 'verbose', type: Boolean, default: false, aliases: ['v'] },\n { name: 'blueprint', type: String, default: 'app', aliases: ['b'] },\n { name: 'skip-npm', type: Boolean, default: false, aliases: ['sn'] },\n { name: 'skip-git', type: Boolean, default: false, aliases: ['sg'] },\n { name: 'directory', type: String , aliases: ['dir'] }\n],\n```" + ], + "class": "Command", + "module": "ember-cli" + }, + { + "file": "lib/models/command.js", + "line": 137, + "description": "An array of anonymous options for the command", + "final": 1, + "itemtype": "property", + "name": "anonymousOptions", + "type": "Array", + "example": [ + "\n```js\nanonymousOptions: [\n ''\n],\n```" + ], + "class": "Command", + "module": "ember-cli" + }, + { + "file": "lib/models/command.js", + "line": 153, + "description": "Registers options with command. This method provides the ability to extend or override command options.\nExpects an object containing anonymousOptions or availableOptions, which it will then merge with\nexisting availableOptions before building the optionsAliases which are used to define shorthands.", "itemtype": "method", - "name": "uptime", - "return": { - "description": "The number of seconds since the host was started.", - "type": "Number" - }, - "class": "HardwareInfo", + "name": "registerOptions", + "params": [ + { + "name": "options", + "description": "", + "type": "Object" + } + ], + "class": "Command", "module": "ember-cli" }, { - "file": "lib/models/installation-checker.js", - "line": 13, - "description": "Check if npm and bower installation directories are present,\nand raise an error message with instructions on how to proceed.\n\nIf some of these package managers aren't being used in the project\nwe just ignore them. Their usage is considered by checking the\npresence of your manifest files: package.json for npm and bower.json for bower.", + "file": "lib/models/command.js", + "line": 179, + "description": "Called when command is interrupted from outside, e.g. ctrl+C or process kill\nCan be used to cleanup artifacts produced by command and control process exit code", "itemtype": "method", - "name": "checkInstallations", - "class": "Instrumentation", + "name": "onInterrupt", + "return": { + "description": "if rejected promise then result of promise will be used as an exit code", + "type": "Promise|undefined" + }, + "class": "Command", "module": "ember-cli" }, { - "file": "lib/models/instantiate-addons.js", - "line": 12, - "description": "Create instances of a set of \"child\" addons for a parent addon or project.", + "file": "lib/models/command.js", + "line": 206, + "description": "Looks up for the task and runs\nIt also keeps the reference for the current active task\nKeeping reference for the current task allows to cleanup task on interruption", + "access": "private", + "tagname": "", "itemtype": "method", - "name": "instantiateAddons", + "name": "runTask", + "throws": { + "description": "on attempt to run concurrent task", + "type": "Error" + }, "params": [ { - "name": "parent", - "description": "an Addon or Project that is the direct containing object of the list\n of children defined in addonPackages.", - "type": "Object" - }, - { - "name": "project", - "description": "the project that contains the parent (so either the addon's project\n if parent is an addon, or the project itself if it is a project). It is possible when\n constructing custom addon instances that the project will actually be undefined--various\n addon tests do this, for example.", - "type": "Project" + "name": "name", + "description": "Task name from the tasks registry. Should be capitalized", + "type": "String" }, { - "name": "a", - "description": "map of addon name (including scope) to an AddonInfo with the name, path and\n 'pkg' object for that addon's package.json). These are what is turned into addons.", + "name": "options", + "description": "", "type": "Object" } ], - "class": "Instrumentation", + "return": { + "description": "Task run", + "type": "Promise" + }, + "class": "Command", "module": "ember-cli" }, { - "file": "lib/models/project.js", - "line": 52, - "description": "Set when the `Watcher.detectWatchman` helper method finishes running,\nso that other areas of the system can be aware that watchman is being used.\n\nFor example, this information is used in the broccoli build pipeline to know\nif we can watch additional directories (like bower_components) \"cheaply\".\n\nContains `enabled` and `version`.", - "access": "private", - "tagname": "", - "itemtype": "property", - "name": "_watchmanInfo", + "file": "lib/models/command.js", + "line": 247, + "description": "Hook for extending a command before it is run in the cli.run command.\nMost common use case would be to extend availableOptions.", + "itemtype": "method", + "name": "beforeRun", "return": { "description": "", - "type": "Object" + "type": "Promise|null" }, - "default": "false", - "class": "Project", + "class": "Command", "module": "ember-cli" }, { - "file": "lib/models/project.js", - "line": 101, - "description": "Sets the name of the bower directory for this project", - "access": "private", - "tagname": "", + "file": "lib/models/command.js", + "line": 255, "itemtype": "method", - "name": "setupBowerDirectory", - "class": "Project", + "name": "validateAndRun", + "return": { + "description": "", + "type": "Promise" + }, + "class": "Command", "module": "ember-cli" }, { - "file": "lib/models/project.js", - "line": 174, - "description": "Returns the name from package.json.", - "access": "private", - "tagname": "", + "file": "lib/models/command.js", + "line": 315, + "description": "Reports if the given command has a command line option by a given name", "itemtype": "method", - "name": "name", + "name": "hasOption", + "params": [ + { + "name": "name", + "description": "", + "type": "String" + } + ], "return": { - "description": "Package name", - "type": "String" + "description": "", + "type": "Boolean" }, - "class": "Project", + "class": "Command", "module": "ember-cli" }, { - "file": "lib/models/project.js", - "line": 187, - "description": "Returns whether or not this is an Ember CLI project.\nThis checks whether ember-cli is listed in devDependencies.", - "access": "private", - "tagname": "", + "file": "lib/models/command.js", + "line": 331, + "description": "Merges any options with duplicate keys in the availableOptions array.\nUsed primarily by registerOptions.", "itemtype": "method", - "name": "isEmberCLIProject", + "name": "mergeDuplicateOption", + "params": [ + { + "name": "key", + "description": "", + "type": "String" + } + ], "return": { - "description": "Whether this is an Ember CLI project", - "type": "Boolean" + "description": "", + "type": "Object" }, - "class": "Project", + "class": "Command", "module": "ember-cli" }, { - "file": "lib/models/project.js", - "line": 199, - "description": "Returns whether or not this is an Ember CLI addon.", + "file": "lib/models/command.js", + "line": 366, + "description": "Normalizes option, filling in implicit values", "itemtype": "method", - "name": "isEmberCLIAddon", + "name": "normalizeOption", + "params": [ + { + "name": "option", + "description": "", + "type": "Object" + } + ], "return": { - "description": "Whether or not this is an Ember CLI Addon.", - "type": "Boolean" + "description": "", + "type": "Object" }, - "class": "Project", + "class": "Command", "module": "ember-cli" }, { - "file": "lib/models/project.js", - "line": 209, - "description": "Returns the path to the configuration.", - "access": "private", - "tagname": "", + "file": "lib/models/command.js", + "line": 378, + "description": "Assigns option", "itemtype": "method", - "name": "configPath", + "name": "assignOption", + "params": [ + { + "name": "option", + "description": "", + "type": "Object" + }, + { + "name": "parsedOptions", + "description": "", + "type": "Object" + }, + { + "name": "commandOptions", + "description": "", + "type": "Object" + } + ], "return": { - "description": "Configuration path", - "type": "String" + "description": "", + "type": "Boolean" }, - "class": "Project", + "class": "Command", "module": "ember-cli" }, { - "file": "lib/models/project.js", - "line": 226, - "description": "Loads the configuration for this project and its addons.", - "access": "public", - "tagname": "", + "file": "lib/models/command.js", + "line": 411, + "description": "Validates option", "itemtype": "method", - "name": "config", + "name": "validateOption", "params": [ { - "name": "env", - "description": "Environment name", - "type": "String" + "name": "option", + "description": "", + "type": "Object" } ], "return": { - "description": "Merged configuration object", - "type": "Object" + "description": "", + "type": "Boolean" }, - "class": "Project", + "class": "Command", "module": "ember-cli" }, { - "file": "lib/models/project.js", - "line": 245, - "access": "private", - "tagname": "", + "file": "lib/models/command.js", + "line": 437, + "description": "Parses alias for an option and adds it to optionsAliases", "itemtype": "method", - "name": "configWithoutCache", + "name": "parseAlias", "params": [ { - "name": "env", - "description": "Environment name", - "type": "String" + "name": "option", + "description": "", + "type": "Object" + }, + { + "name": "alias", + "description": "", + "type": "Object|String" } ], "return": { - "description": "Merged configuration object", + "description": "", "type": "Object" }, - "class": "Project", + "class": "Command", "module": "ember-cli" }, { - "file": "lib/models/project.js", - "line": 264, - "description": "Returns the targets of this project, or the default targets if not present.", - "access": "public", - "tagname": "", - "itemtype": "property", - "name": "targets", + "file": "lib/models/command.js", + "line": 482, + "itemtype": "method", + "name": "assignAlias", + "params": [ + { + "name": "option", + "description": "" + }, + { + "name": "alias", + "description": "" + } + ], "return": { - "description": "Targets object", - "type": "Object" + "description": "", + "type": "Boolean" }, - "class": "Project", + "class": "Command", "module": "ember-cli" }, { - "file": "lib/models/project.js", - "line": 291, - "description": "Returns the addons configuration.", - "access": "private", - "tagname": "", + "file": "lib/models/command.js", + "line": 497, + "description": "Validates alias value", "itemtype": "method", - "name": "getAddonsConfig", + "name": "validateAlias", "params": [ { - "name": "env", - "description": "Environment name", - "type": "String" - }, - { - "name": "appConfig", - "description": "Application configuration", + "name": "alias", + "description": "", "type": "Object" } ], "return": { - "description": "Merged configuration of all addons", - "type": "Object" + "description": "", + "type": "Boolean" }, - "class": "Project", + "class": "Command", "module": "ember-cli" }, { - "file": "lib/models/project.js", - "line": 314, - "description": "Returns whether or not the given file name is present in this project.", - "access": "private", - "tagname": "", + "file": "lib/models/command.js", + "line": 529, + "description": "Parses command arguments and processes", "itemtype": "method", - "name": "has", + "name": "parseArgs", "params": [ { - "name": "file", - "description": "File name", - "type": "String" + "name": "commandArgs", + "description": "", + "type": "Object" } ], "return": { - "description": "Whether or not the file is present", - "type": "Boolean" + "description": "", + "type": "Object|null" }, - "class": "Project", + "class": "Command", "module": "ember-cli" }, { - "file": "lib/models/project.js", - "line": 326, - "description": "Resolves the absolute path to a file synchronously", - "access": "private", - "tagname": "", + "file": "lib/models/command.js", + "line": 585, "itemtype": "method", - "name": "resolveSync", + "name": "run", "params": [ { - "name": "file", - "description": "File to resolve", - "type": "String" + "name": "commandArgs", + "description": "" } ], - "return": { - "description": "Absolute path to file", - "type": "String" - }, - "class": "Project", + "class": "Command", "module": "ember-cli" }, { - "file": "lib/models/project.js", - "line": 340, - "description": "Calls `require` on a given module from the context of the project. For\ninstance, an addon may want to require a class from the root project's\nversion of ember-cli.", - "access": "public", - "tagname": "", + "file": "lib/models/command.js", + "line": 595, + "description": "Prints basic help for the command.\n\nBasic help looks like this:\n\n ember generate \n Generates new code from blueprints\n aliases: g\n --dry-run (Default: false)\n --verbose (Default: false)\n\nThe default implementation is designed to cover all bases\nbut may be overridden if necessary.", "itemtype": "method", - "name": "require", + "name": "printBasicHelp", + "class": "Command", + "module": "ember-cli" + }, + { + "file": "lib/models/command.js", + "line": 626, + "description": "Prints detailed help for the command.\n\nThe default implementation is no-op and should be overridden\nfor each command where further help text is required.", + "itemtype": "method", + "name": "printDetailedHelp", + "class": "Command", + "module": "ember-cli" + }, + { + "file": "lib/models/command.js", + "line": 636, + "itemtype": "method", + "name": "getJson", "params": [ { - "name": "file", - "description": "File path or module name", - "type": "String" + "name": "options", + "description": "", + "type": "Object" } ], "return": { - "description": "Imported module", + "description": "", "type": "Object" }, - "class": "Project", + "class": "Command", "module": "ember-cli" }, { - "file": "lib/models/project.js", - "line": 355, - "description": "Returns the dependencies from a package.json", + "file": "lib/models/hardware-info.js", + "line": 232, + "description": "Indicates whether the host is running on battery power. This can cause\nperformance degredation.", "access": "private", "tagname": "", "itemtype": "method", - "name": "dependencies", + "name": "isUsingBattery", "params": [ { - "name": "pkg", - "description": "Package object", - "type": "Object", - "optional": true, - "optdefault": "this.pkg" - }, - { - "name": "excludeDevDeps", - "description": "Whether or not development dependencies should be excluded", - "type": "Boolean", - "optional": true, - "optdefault": "false" + "name": "platform", + "description": "The current hardware platform.\n USED FOR TESTING ONLY.", + "type": "String=process.platform" } ], "return": { - "description": "Dependencies", - "type": "Object" + "description": "`true` iff the host is running on battery power or\n `false` if not. `null` if the battery status\n cannot be determined.", + "type": "Null|Boolean" }, - "class": "Project", + "class": "HardwareInfo", "module": "ember-cli" }, { - "file": "lib/models/project.js", - "line": 375, - "description": "Returns the bower dependencies for this project.", + "file": "lib/models/hardware-info.js", + "line": 266, + "description": "Determines the amount of swap/virtual memory currently in use.", "access": "private", "tagname": "", "itemtype": "method", - "name": "bowerDependencies", + "name": "memorySwapUsed", "params": [ { - "name": "bower", - "description": "Path to bower.json", - "type": "String" + "name": "platform", + "description": "The current hardware platform.\n USED FOR TESTING ONLY.", + "type": "String=process.platform" } ], "return": { - "description": "Bower dependencies", - "type": "Object" + "description": "The amount of used swap space, in bytes. `null` if\n the used swap space cannot be determined.", + "type": "Null|Number" }, - "class": "Project", - "module": "ember-cli" - }, - { - "file": "lib/models/project.js", - "line": 391, - "description": "Provides the list of paths to consult for addons that may be provided\ninternally to this project. Used for middleware addons with built-in support.", - "access": "private", - "tagname": "", - "itemtype": "method", - "name": "supportedInternalAddonPaths", - "class": "Project", + "class": "HardwareInfo", "module": "ember-cli" }, { - "file": "lib/models/project.js", - "line": 417, - "description": "Discovers all addons for this project and stores their names and\npackage.json contents in this.addonPackages as key-value pairs.\n\nAny packageInfos that we find that are marked as not valid are excluded.", + "file": "lib/models/hardware-info.js", + "line": 297, + "description": "Determines the total amount of memory available to the host, as from\n`os.totalmem`.", "access": "private", "tagname": "", "itemtype": "method", - "name": "discoverAddons", - "class": "Project", + "name": "memoryTotal", + "return": { + "description": "The total memory in bytes.", + "type": "Number" + }, + "class": "HardwareInfo", "module": "ember-cli" }, { - "file": "lib/models/project.js", - "line": 441, - "description": "Loads and initializes all addons for this project.", + "file": "lib/models/hardware-info.js", + "line": 309, + "description": "Determines the amount of memory currently being used by the current Node\nprocess, as from `process.memoryUsage`.", "access": "private", "tagname": "", "itemtype": "method", - "name": "initializeAddons", - "class": "Project", + "name": "memoryUsed", + "return": { + "description": "The Resident Set Size, as reported by\n `process.memoryUsage`.", + "type": "Object" + }, + "class": "HardwareInfo", "module": "ember-cli" }, { - "file": "lib/models/project.js", - "line": 461, - "description": "Returns what commands are made available by addons by inspecting\n`includedCommands` for every addon.", + "file": "lib/models/hardware-info.js", + "line": 322, + "description": "Determines the number of logical processors available to the host, as from\n`os.cpus`.", "access": "private", "tagname": "", "itemtype": "method", - "name": "addonCommands", + "name": "processorCount", "return": { - "description": "Addon names and command maps as key-value pairs", - "type": "Object" + "description": "The number of logical processors.", + "type": "Number" }, - "class": "Project", + "class": "HardwareInfo", "module": "ember-cli" }, { - "file": "lib/models/project.js", - "line": 502, - "description": "Execute a given callback for every addon command.\nExample:\n\n```\nproject.eachAddonCommand(function(addonName, commands) {\n console.log('Addon ' + addonName + ' exported the following commands:' + commands.keys().join(', '));\n});\n```", + "file": "lib/models/hardware-info.js", + "line": 334, + "description": "Determines the average processor load across the system. This is\nexpressed as a fractional number between 0 and the number of logical\nprocessors.", "access": "private", "tagname": "", "itemtype": "method", - "name": "eachAddonCommand", + "name": "processorLoad", "params": [ { - "name": "callback", - "description": "[description]", - "type": "Function" + "name": "platform", + "description": "The current hardware platform.\n USED FOR TESTING ONLY.", + "type": "String=process.platform" } ], - "class": "Project", + "return": { + "description": "The one-, five-, and fifteen-minute processor load\n averages.", + "type": "Array" + }, + "class": "HardwareInfo", "module": "ember-cli" }, { - "file": "lib/models/project.js", - "line": 525, - "description": "Path to the blueprints for this project.", + "file": "lib/models/hardware-info.js", + "line": 358, + "description": "Gets the speed of the host's processors.\n\nIf more than one processor is found, the average of their speeds is taken.", "access": "private", "tagname": "", "itemtype": "method", - "name": "localBlueprintLookupPath", + "name": "processorSpeed", "return": { - "description": "Path to blueprints", - "type": "String" + "description": "The average processor speed in MHz.", + "type": "Number" }, - "class": "Project", + "class": "HardwareInfo", "module": "ember-cli" }, { - "file": "lib/models/project.js", - "line": 536, - "description": "Returns a list of paths (including addon paths) where blueprints will be looked up.", + "file": "lib/models/hardware-info.js", + "line": 373, + "description": "Determines the time since the host was started, as from `os.uptime`.", "access": "private", "tagname": "", "itemtype": "method", - "name": "blueprintLookupPaths", + "name": "uptime", "return": { - "description": "List of paths", - "type": "Array" + "description": "The number of seconds since the host was started.", + "type": "Number" }, - "class": "Project", + "class": "HardwareInfo", "module": "ember-cli" }, { - "file": "lib/models/project.js", - "line": 554, - "description": "Returns a list of addon paths where blueprints will be looked up.", - "access": "private", - "tagname": "", + "file": "lib/models/host-info-cache.js", + "line": 16, + "description": "Given a path (calculated as part of `getHostAddonInfo`), return the correct\n\"bundle host\". A bundle host is considered the project or lazy engine.\n\nFor example, given the following package structure:\n\n --Project--\n / \\\n / \\\nLazy Engine A \\\n Addon A\n |\n |\n Lazy Engine B\n / \\\n / \\\n Lazy Engine A Lazy Engine C\n\nThe provided paths for lazy engine A would look like:\n\n- [Project]\n- [Project, Addon A, Lazy Engine B]\n\nFor this project structure, this function would return [Project, [Project]]\n\nSimilarly, given the following project structure:\n\n --Project--\n / \\\n / \\\n Lazy Engine A \\\n / Lazy Engine B\n / |\n / |\n Lazy Engine C Lazy Engine C\n\nThe provided paths for lazy engine C would look like:\n\n- [Project, Lazy Engine A]\n- [Project, Lazy Engine B]\n\nIn this case, the host is the project and would also return [Project, [Project]]", "itemtype": "method", - "name": "addonBlueprintLookupPaths", + "name": "_findNearestBundleHost", + "params": [ + { + "name": "paths", + "description": "The found paths to a given bundle host", + "type": "Array" + } + ], "return": { - "description": "List of paths", - "type": "Array" + "description": "", + "type": "[PackageInfo, PackageInfo[]]" }, - "class": "Project", + "access": "private", + "tagname": "", + "class": "Instrumentation", "module": "ember-cli" }, { - "file": "lib/models/project.js", - "line": 577, - "description": "Reloads package.json", - "access": "private", - "tagname": "", + "file": "lib/models/host-info-cache.js", + "line": 93, + "description": "Returns a `Set` of package-info objects that a given bundle host is\n_directly_ responsible for bundling (i.e., it excludes other bundle\nhosts/lazy engines when it encounters these)", "itemtype": "method", - "name": "reloadPkg", + "name": "_getBundledPackageInfos", + "params": [ + { + "name": "pkgInfoToStartAt", + "description": "", + "type": "PackageInfo" + } + ], "return": { - "description": "Package content", - "type": "Object" + "description": "", + "type": "Set" }, - "class": "Project", - "module": "ember-cli" - }, - { - "file": "lib/models/project.js", - "line": 595, - "description": "Re-initializes addons.", "access": "private", "tagname": "", - "itemtype": "method", - "name": "reloadAddons", - "class": "Project", + "class": "Instrumentation", "module": "ember-cli" }, { - "file": "lib/models/project.js", - "line": 607, - "description": "Find an addon by its name", - "access": "public", - "tagname": "", + "file": "lib/models/host-info-cache.js", + "line": 147, + "description": "This function intends to return a common host for a bundle host (lazy engine). The root\npackage info should be the starting point (i.e., the project's package info). We do this\nby performing a breadth-first traversal until we find the intended lazy engine (represented\nas a package-info & the 1st argument passed to this function). As part of the traversal, we keep\ntrack of all paths to said engine; then, once we find the intended engine we use this to determine\nthe nearest common host amongst all shortest paths.\n\nSome context:\n\nFor a given engine/bundle host, this finds the lowest common ancestor that is considered a\nhost amongst _all_ engines by the same name in the project.\n\nFor example, given the following package structure:\n\n --Project--\n / \\\n / \\\nLazy Engine A \\\n Addon A\n |\n |\n Lazy Engine B\n / \\\n / \\\n Lazy Engine A Lazy Engine C\n\n- The LCA host for Lazy Engine A is the project\n- The LCA host for Lazy Engine B is the project\n- The LCA host for Lazy Engine C is Lazy Engine B\n\nThis also returns `hostAndAncestorBundledPackageInfos`, which are all bundled addons above a given host:\n\n- `hostAndAncestorBundledPackageInfos` for lazy engine A includes all non-lazy dependencies of its LCA host & above (in this case, just the project)\n- `hostAndAncestorBundledPackageInfos` for lazy engine B includes all non-lazy dependencies of its LCA host & above (in this case, just the project)\n- `hostAndAncestorBundledPackageInfos` for lazy engine C includes non-lazy deps of lazy engine B & non-lazy deps of the project (LCA host & above)\n\nThis is intended to mimic the behavior of `ancestorHostAddons` in `ember-engines`:\nhttps://github.com/ember-engines/ember-engines/blob/master/packages/ember-engines/lib/engine-addon.js#L333\n\nUnfortunately, we can't easily repurpose the logic in `ember-engines` since the algorithm has to be different;\nin `ember-engines` we need access to the actual addon instance, however, this is intended to be used _during_\naddon instantiation, so we only have access to package-info objects. In having said this, we _can_ repurpose\nthe `hostPackageInfo` to determine the LCA host; see below `findLCAHost`.", "itemtype": "method", - "name": "findAddonByName", + "name": "getHostAddonInfo", "params": [ { - "name": "name", - "description": "Addon name as specified in package.json", - "type": "String" + "name": "packageInfoForLazyEngine", + "description": "", + "type": "PackageInfo" } ], "return": { - "description": "Addon instance", - "type": "Addon" + "description": "}", + "type": " hostPackageInfo: PackageInfo, hostAndAncestorBundledPackageInfos: Set" }, - "class": "Project", + "class": "Instrumentation", "module": "ember-cli" }, { - "file": "lib/models/project.js", - "line": 621, - "description": "Generate test file contents.\n\nThis method is supposed to be overwritten by test framework addons\nlike `ember-qunit` and `ember-mocha`.", - "access": "public", - "tagname": "", + "file": "lib/models/host-info-cache.js", + "line": 270, + "description": "This returns the LCA host for a given engine; we use the associated package info\nto compute this (see `getHostAddonInfo` above); this finds the lowest common ancestor\nthat is considered a host amongst _all_ engines by the same name in the project. This\nfunction is intended to replace the original behavior in `ember-engines`.\n\nFor more info, see the original implementation here:\n\nhttps://github.com/ember-engines/ember-engines/blob/master/packages/ember-engines/lib/utils/find-lca-host.js", "itemtype": "method", - "name": "generateTestFile", + "name": "findLCAHost", "params": [ { - "name": "moduleName", - "description": "Name of the test module (e.g. `JSHint`)", - "type": "String" - }, - { - "name": "tests", - "description": "Array of tests with `name`, `passed` and `errorMessage` properties", - "type": "Object[]" + "name": "engineInstance", + "description": "", + "type": "EngineAddon" } ], "return": { - "description": "The test file content", - "type": "String" + "description": "", + "type": "EngineAddon|EmberApp" }, - "class": "Project", + "class": "Instrumentation", "module": "ember-cli" }, { - "file": "lib/models/project.js", - "line": 645, - "description": "Returns a new project based on the first package.json that is found\nin `pathName`.", - "access": "private", - "tagname": "", - "static": 1, + "file": "lib/models/instantiate-addons.js", + "line": 12, + "description": "Create instances of a set of \"child\" addons for a parent addon or project.", "itemtype": "method", - "name": "closestSync", + "name": "instantiateAddons", "params": [ { - "name": "pathName", - "description": "Path to your project", - "type": "String" + "name": "parent", + "description": "an Addon or Project that is the direct containing object of the list\n of children defined in addonPackages.", + "type": "Object" }, { - "name": "_ui", - "description": "The UI instance to provide to the created Project.", - "type": "UI" + "name": "project", + "description": "the project that contains the parent (so either the addon's project\n if parent is an addon, or the project itself if it is a project). It is possible when\n constructing custom addon instances that the project will actually be undefined--various\n addon tests do this, for example.", + "type": "Project" + }, + { + "name": "a", + "description": "map of addon name (including scope) to an AddonInfo with the name, path and\n 'pkg' object for that addon's package.json). These are what is turned into addons.", + "type": "Object" } ], - "return": { - "description": "Project instance", - "type": "Project" - }, - "class": "Project", + "class": "Instrumentation", "module": "ember-cli" }, { "file": "lib/models/project.js", - "line": 681, - "description": "Returns a new project based on the first package.json that is found\nin `pathName`, or the nullProject.\n\nThe nullProject signifies no-project, but abides by the null object pattern", + "line": 52, + "description": "Set when the `Watcher.detectWatchman` helper method finishes running,\nso that other areas of the system can be aware that watchman is being used.\n\nFor example, this information is used in the broccoli build pipeline to know\nif we can watch additional directories \"cheaply\".\n\nContains `enabled` and `version`.", "access": "private", "tagname": "", - "static": 1, - "itemtype": "method", - "name": "projectOrnullProject", - "params": [ - { - "name": "_ui", - "description": "The UI instance to provide to the created Project.", - "type": "UI" - } - ], + "itemtype": "property", + "name": "_watchmanInfo", "return": { - "description": "Project instance", - "type": "Project" + "description": "", + "type": "Object" }, + "default": "false", "class": "Project", "module": "ember-cli" }, { "file": "lib/models/project.js", - "line": 705, - "description": "Returns the project root based on the first package.json that is found", - "static": 1, + "line": 154, + "description": "Returns the name from package.json.", + "access": "private", + "tagname": "", "itemtype": "method", - "name": "getProjectRoot", + "name": "name", "return": { - "description": "The project root directory", + "description": "Package name", "type": "String" }, "class": "Project", "module": "ember-cli" }, { - "file": "lib/models/task.js", - "line": 10, - "description": "Interrupt comamd with an exit code\nCalled when the process is interrupted from outside, e.g. CTRL+C or `process.kill()`", - "access": "private", - "tagname": "", - "itemtype": "method", - "name": "onInterrupt", - "class": "ServeFilesAddon", - "module": "ember-cli" - }, - { - "file": "lib/tasks/build-watch.js", - "line": 49, - "description": "Exit silently", - "access": "private", - "tagname": "", - "itemtype": "method", - "name": "onInterrupt", - "class": "NpmTask", - "module": "ember-cli" - }, - { - "file": "lib/tasks/npm-task.js", - "line": 113, - "description": "This method will determine what package manager (npm or yarn) should be\nused to install the npm dependencies.\n\nSetting `this.useYarn` to `true` or `false` will force the use of yarn\nor npm respectively.\n\nIf `this.useYarn` is not set we check if `yarn.lock` exists and if\n`yarn` is available and in that case set `useYarn` to `true`.", + "file": "lib/models/project.js", + "line": 167, + "description": "Returns whether or not this is an Ember CLI project.\nThis checks whether ember-cli is listed in devDependencies.", "access": "private", "tagname": "", "itemtype": "method", - "name": "findPackageManager", + "name": "isEmberCLIProject", "return": { - "description": "", - "type": "Promise" + "description": "Whether this is an Ember CLI project", + "type": "Boolean" }, - "class": "NpmTask", + "class": "Project", "module": "ember-cli" }, { - "file": "lib/tasks/serve.js", - "line": 100, - "description": "Exit silently", - "access": "private", - "tagname": "", + "file": "lib/models/project.js", + "line": 179, + "description": "Returns whether or not this is an Ember CLI addon.", "itemtype": "method", - "name": "onInterrupt", - "class": "WindowsSymlinkChecker", + "name": "isEmberCLIAddon", + "return": { + "description": "Whether or not this is an Ember CLI Addon.", + "type": "Boolean" + }, + "class": "Project", "module": "ember-cli" }, { - "file": "lib/tasks/test-server.js", - "line": 61, - "description": "Exit silently", + "file": "lib/models/project.js", + "line": 189, + "description": "Returns the path to the configuration.", "access": "private", "tagname": "", "itemtype": "method", - "name": "onInterrupt", - "class": "WindowsSymlinkChecker", - "module": "ember-cli" - }, - { - "file": "lib/utilities/ember-app-utils.js", - "line": 7, - "description": "Returns a normalized url given a string.\nReturns an empty string if `null`, `undefined` or an empty string are passed\nin.", - "itemtype": "method", - "name": "normalizeUrl", - "params": [ - { - "name": "Raw", - "description": "url.", - "type": "String" - } - ], + "name": "configPath", "return": { - "description": "Normalized url.", + "description": "Configuration path", "type": "String" }, - "class": "WindowsSymlinkChecker", + "class": "Project", "module": "ember-cli" }, { - "file": "lib/utilities/ember-app-utils.js", - "line": 24, - "description": "Converts Javascript Object to a string.\nReturns an empty object string representation if a \"falsy\" value is passed\nin.", + "file": "lib/models/project.js", + "line": 206, + "description": "Loads the configuration for this project and its addons.", + "access": "public", + "tagname": "", "itemtype": "method", - "name": "convertObjectToString", + "name": "config", "params": [ { - "name": "Any", - "description": "Javascript Object.", - "type": "Object" + "name": "env", + "description": "Environment name", + "type": "String" } ], "return": { - "description": "A string representation of a Javascript Object.", - "type": "String" + "description": "Merged configuration object", + "type": "Object" }, - "class": "WindowsSymlinkChecker", + "class": "Project", "module": "ember-cli" }, { - "file": "lib/utilities/ember-app-utils.js", - "line": 37, - "description": "Returns the tag for index.html.", + "file": "lib/models/project.js", + "line": 225, + "access": "private", + "tagname": "", "itemtype": "method", - "name": "calculateBaseTag", + "name": "configWithoutCache", "params": [ { - "name": "baseURL", - "description": "", - "type": "String" - }, - { - "name": "locationType", - "description": "'history', 'none' or 'hash'.", + "name": "env", + "description": "Environment name", "type": "String" } ], "return": { - "description": "Base tag or an empty string", - "type": "String" + "description": "Merged configuration object", + "type": "Object" }, - "class": "WindowsSymlinkChecker", + "class": "Project", "module": "ember-cli" }, { - "file": "lib/utilities/ember-app-utils.js", - "line": 55, - "description": "Returns the content for a specific type (section) for index.html.\n\n```\n{{content-for \"[type]\"}}\n```\n\nSupported types:\n\n- 'head'\n- 'config-module'\n- 'head-footer'\n- 'test-header-footer'\n- 'body-footer'\n- 'test-body-footer'", - "itemtype": "method", - "name": "contentFor", - "params": [ - { - "name": "config", - "description": "Ember.js application configuration", - "type": "Object" - }, - { - "name": "match", - "description": "Regular expression to match against", - "type": "RegExp" - }, - { - "name": "type", - "description": "Type of content", - "type": "String" - }, - { - "name": "options", - "description": "Settings that control the default content", - "type": "Object", - "props": [ - { - "name": "autoRun", - "description": "Controls whether to bootstrap the\n application or not", - "type": "Boolean" - }, - { - "name": "storeConfigInMeta", - "description": "Controls whether to include the\n contents of config", - "type": "Boolean" - } - ] - } - ], + "file": "lib/models/project.js", + "line": 244, + "description": "Returns the targets of this project, or the default targets if not present.", + "access": "public", + "tagname": "", + "itemtype": "property", + "name": "targets", "return": { - "description": "The content.", - "type": "String" + "description": "Targets object", + "type": "Object" }, - "class": "WindowsSymlinkChecker", + "class": "Project", "module": "ember-cli" }, { - "file": "lib/utilities/insert-into-file.js", - "line": 6, - "description": "Inserts the given content into a file. If the `contentsToInsert` string is already\npresent in the current contents, the file will not be changed unless `force` option\nis passed.\n\nIf `options.before` is specified, `contentsToInsert` will be inserted before\nthe first instance of that string. If `options.after` is specified, the\ncontents will be inserted after the first instance of that string.\nIf the string specified by options.before or options.after is not in the file,\nno change will be made. Both of these options support regular expressions.\n\nIf neither `options.before` nor `options.after` are present, `contentsToInsert`\nwill be inserted at the end of the file.\n\nIt will create a new file if one doesn't exist, unless you set the `options.create`\noption to `false`.\n\nExample:\n\n```\n// app/router.js\nRouter.map(function() {\n});\n```\n\n```\ninsertIntoFile('app/router.js', ' this.route(\"admin\");', {\n after: 'Router.map(function() {' + EOL\n});\n```\n\n```\n// app/router.js\nRouter.map(function() {\n this.route(\"admin\");\n});\n```", + "file": "lib/models/project.js", + "line": 271, + "description": "Returns the addons configuration.", + "access": "private", + "tagname": "", "itemtype": "method", - "name": "insertIntoFile", + "name": "getAddonsConfig", "params": [ { - "name": "pathRelativeToProjectRoot", - "description": "", - "type": "String" - }, - { - "name": "contentsToInsert", - "description": "", + "name": "env", + "description": "Environment name", "type": "String" }, { - "name": "providedOptions", - "description": "", + "name": "appConfig", + "description": "Application configuration", "type": "Object" } ], "return": { - "description": "", - "type": "Promise" + "description": "Merged configuration of all addons", + "type": "Object" }, - "class": "WindowsSymlinkChecker", + "class": "Project", "module": "ember-cli" }, { - "file": "lib/utilities/is-yarn-project.js", - "line": 6, - "description": "Returns true if and only if the given directory has a yarn.lock file or is a child of a\nyarn workspace root.", + "file": "lib/models/project.js", + "line": 294, + "description": "Returns whether or not the given file name is present in this project.", "access": "private", "tagname": "", "itemtype": "method", - "name": "isYarnProject", + "name": "has", "params": [ { - "name": "thePath", - "description": "", + "name": "file", + "description": "File name", "type": "String" } ], "return": { - "description": "", - "type": "Boolean" - }, - "class": "WindowsSymlinkChecker", - "module": "ember-cli" - }, - { - "file": "lib/utilities/valid-project-name.js", - "line": 5, - "description": "Checks if the string starts with a number.", - "itemtype": "method", - "name": "startsWithNumber", - "return": { - "description": "", + "description": "Whether or not the file is present", "type": "Boolean" }, - "class": "WindowsSymlinkChecker", + "class": "Project", "module": "ember-cli" }, { - "file": "lib/utilities/valid-project-name.js", - "line": 24, - "description": "Checks if project name is valid.\n\nInvalid names are some of the internal constants that Ember CLI uses, such as\n`app`, `ember`, `ember-cli`, `test`, and `vendor`. Names that start with\nnumbers are considered invalid as well.", + "file": "lib/models/project.js", + "line": 306, + "description": "Resolves the absolute path to a file synchronously", + "access": "private", + "tagname": "", "itemtype": "method", - "name": "validProjectName", + "name": "resolveSync", "params": [ { - "name": "name", - "description": "The name of Ember CLI project", + "name": "file", + "description": "File to resolve", "type": "String" } ], "return": { - "description": "", - "type": "Boolean" + "description": "Absolute path to file", + "type": "String" }, - "class": "WindowsSymlinkChecker", - "module": "ember-cli" - }, - { - "file": "lib/utilities/will-interrupt-process.js", - "line": 47, - "description": "Drops all the interruption handlers and disables an ability to add new one\n\nNote: We don't call `captureExit.releaseExit() here.\nIn some rare scenarios it can lead to the hard to debug issues.\nsee: https://github.com/ember-cli/ember-cli/issues/6779#issuecomment-280940358\n\nWe can more or less feel comfortable with a captured exit because it behaves very\nsimilar to the original `exit` except of cases when we need to do cleanup before exit.", - "access": "private", - "tagname": "", - "itemtype": "method", - "name": "release", - "class": "WindowsSymlinkChecker", + "class": "Project", "module": "ember-cli" }, { - "file": "lib/utilities/will-interrupt-process.js", - "line": 69, - "description": "Add process interruption handler\n\nWhen the first handler is added then automatically\nsets up process interruption signals listeners", - "access": "private", + "file": "lib/models/project.js", + "line": 320, + "description": "Calls `require` on a given module from the context of the project. For\ninstance, an addon may want to require a class from the root project's\nversion of ember-cli.", + "access": "public", "tagname": "", "itemtype": "method", - "name": "addHandler", + "name": "require", "params": [ { - "name": "cb", - "description": "Callback to be called when process interruption fired", - "type": "Function" + "name": "file", + "description": "File path or module name", + "type": "String" } ], - "class": "WindowsSymlinkChecker", + "return": { + "description": "Imported module", + "type": "Object" + }, + "class": "Project", "module": "ember-cli" }, { - "file": "lib/utilities/will-interrupt-process.js", - "line": 97, - "description": "Remove process interruption handler\n\nIf there are no remaining handlers after removal\nthen clean up all the process interruption signal listeners", + "file": "lib/models/project.js", + "line": 335, + "description": "Returns the dependencies from a package.json", "access": "private", "tagname": "", "itemtype": "method", - "name": "removeHandler", + "name": "dependencies", "params": [ { - "name": "cb", - "description": "Callback to be removed", - "type": "Function" + "name": "pkg", + "description": "Package object", + "type": "Object", + "optional": true, + "optdefault": "this.pkg" + }, + { + "name": "excludeDevDeps", + "description": "Whether or not development dependencies should be excluded", + "type": "Boolean", + "optional": true, + "optdefault": "false" } ], - "class": "WindowsSymlinkChecker", - "module": "ember-cli" - }, - { - "file": "lib/utilities/will-interrupt-process.js", - "line": 122, - "description": "Sets up listeners for interruption signals\n\nWhen one of these signals is caught than raise process.exit()\nwhich enforces `capture-exit` to run registered interruption handlers", - "itemtype": "method", - "name": "setupSignalsTrap", - "class": "WindowsSymlinkChecker", - "module": "ember-cli" - }, - { - "file": "lib/utilities/will-interrupt-process.js", - "line": 140, - "description": "Removes interruption signal listeners and tears down capture-exit", - "itemtype": "method", - "name": "teardownSignalsTrap", - "class": "WindowsSymlinkChecker", + "return": { + "description": "Dependencies", + "type": "Object" + }, + "class": "Project", "module": "ember-cli" }, { - "file": "lib/utilities/will-interrupt-process.js", - "line": 155, - "description": "Suppresses \"Terminate batch job (Y/N)\" confirmation on Windows", + "file": "lib/models/project.js", + "line": 355, + "description": "Provides the list of paths to consult for addons that may be provided\ninternally to this project. Used for middleware addons with built-in support.", + "access": "private", + "tagname": "", "itemtype": "method", - "name": "trapWindowsSignals", - "class": "WindowsSymlinkChecker", + "name": "supportedInternalAddonPaths", + "class": "Project", "module": "ember-cli" }, { - "file": "lib/utilities/windows-admin.js", - "line": 38, - "description": "if not windows, will fulfill with:\n `{ windows: false, elevated: null)`\nif windows, and elevated will fulfill with:\n `{ windows: false, elevated: true)`\nif windows, and is NOT elevated will fulfill with:\n `{ windows: false, elevated: false)`\n will include heplful warning, so that users know (if possible) how to\n achieve better windows build performance", - "access": "public", + "file": "lib/models/project.js", + "line": 381, + "description": "Discovers all addons for this project and stores their names and\npackage.json contents in this.addonPackages as key-value pairs.\n\nAny packageInfos that we find that are marked as not valid are excluded.", + "access": "private", "tagname": "", "itemtype": "method", - "name": "checkIfSymlinksNeedToBeEnabled", - "return": { - "description": "Object describing whether we're on windows and if admin rights exist", - "type": "Promise" - }, - "class": "WindowsSymlinkChecker", + "name": "discoverAddons", + "class": "Project", "module": "ember-cli" }, { - "file": "lib/utilities/windows-admin.js", - "line": 60, - "description": "sets up a WindowsSymlinkChecker\n\nproviding it with defaults for:\n\n* if we are on windows\n* if we can symlink\n* a reference to exec", + "file": "lib/models/project.js", + "line": 403, + "description": "Loads and initializes all addons for this project.", "access": "private", "tagname": "", "itemtype": "method", - "name": "_setup", - "params": [ - { - "name": "UI", - "description": "", - "type": "UI" - } - ], - "return": { - "description": "", - "type": "WindowsSymlinkChecker" - }, - "class": "WindowsSymlinkChecker", + "name": "initializeAddons", + "class": "Project", "module": "ember-cli" }, { - "file": "lib/utilities/windows-admin.js", - "line": 81, - "access": "public", + "file": "lib/models/project.js", + "line": 424, + "description": "Returns what commands are made available by addons by inspecting\n`includedCommands` for every addon.", + "access": "private", "tagname": "", "itemtype": "method", - "name": "checkIfSymlinksNeedToBeEnabled", + "name": "addonCommands", "return": { - "description": "Object describing whether we're on windows and if admin rights exist", - "type": "Promise" + "description": "Addon names and command maps as key-value pairs", + "type": "Object" }, - "class": "WindowsSymlinkChecker", + "class": "Project", "module": "ember-cli" }, { - "file": "lib/utilities/windows-admin.js", - "line": 104, - "description": "Uses the eon-old command NET SESSION to determine whether or not the\n current user has elevated rights (think sudo, but Windows).", + "file": "lib/models/project.js", + "line": 465, + "description": "Execute a given callback for every addon command.\nExample:\n\n```\nproject.eachAddonCommand(function(addonName, commands) {\n console.log('Addon ' + addonName + ' exported the following commands:' + commands.keys().join(', '));\n});\n```", "access": "private", "tagname": "", "itemtype": "method", - "name": "_checkForElevatedRights", + "name": "eachAddonCommand", "params": [ { - "name": "ui", - "description": "- ui object used to call writeLine();", - "type": "Object" + "name": "callback", + "description": "[description]", + "type": "Function" } ], - "return": { - "description": "Object describing whether we're on windows and if admin rights exist", - "type": "Object" - }, - "class": "WindowsSymlinkChecker", + "class": "Project", "module": "ember-cli" }, { - "file": "tests/helpers/acceptance.js", - "line": 50, - "description": "Use `createTestTargets` in the before hook to do the initial\nsetup of a project. This will ensure that we limit the amount of times\nwe go to the network to fetch dependencies.", - "itemtype": "property", - "name": "options.command The command you want to run", - "type": "String", + "file": "lib/models/project.js", + "line": 488, + "description": "Path to the blueprints for this project.", + "access": "private", + "tagname": "", + "itemtype": "method", + "name": "localBlueprintLookupPath", "return": { - "description": "The result of the running the command", - "type": "Promise" - }, - "class": "PrivateTestHelpers", - "module": "ember-cli", - "subprops": [ - { - "name": "projectName", - "description": "The name of the project. Can be an app or addon.", - "type": "String" - }, - { - "name": "options", - "description": "", - "type": "Object" - } - ] + "description": "Path to blueprints", + "type": "String" + }, + "class": "Project", + "module": "ember-cli" }, { - "file": "tests/helpers/acceptance.js", - "line": 72, - "description": "Tears down the targeted project download directory", - "class": "PrivateTestHelpers", + "file": "lib/models/project.js", + "line": 499, + "description": "Returns a list of paths (including addon paths) where blueprints will be looked up.", + "access": "private", + "tagname": "", + "itemtype": "method", + "name": "blueprintLookupPaths", + "return": { + "description": "List of paths", + "type": "Array" + }, + "class": "Project", "module": "ember-cli" }, { - "file": "tests/helpers/acceptance.js", - "line": 83, - "description": "Creates symbolic links from the dependency temp directories\nto the project that is under test.", + "file": "lib/models/project.js", + "line": 517, + "description": "Returns a list of addon paths where blueprints will be looked up.", + "access": "private", + "tagname": "", "itemtype": "method", - "name": "linkDependencies", - "params": [ - { - "name": "projectName", - "description": "The name of the project under test", - "type": "String" - } - ], + "name": "addonBlueprintLookupPaths", "return": { - "description": "The path to the hydrated fixture.", - "type": "String" + "description": "List of paths", + "type": "Array" }, - "class": "PrivateTestHelpers", + "class": "Project", "module": "ember-cli" }, { - "file": "tests/helpers/acceptance.js", - "line": 112, - "description": "Clean a test run.", - "class": "PrivateTestHelpers", + "file": "lib/models/project.js", + "line": 540, + "description": "Reloads package.json of the project. Clears and reloads the packageInfo and\nper-bundle addon cache, too.", + "access": "private", + "tagname": "", + "itemtype": "method", + "name": "reloadPkg", + "return": { + "description": "Package content", + "type": "Object" + }, + "class": "Project", "module": "ember-cli" }, { - "file": "tests/helpers/command-generator.js", - "line": 27, - "description": "The `invoke` method is responsible for building the final executable command.", + "file": "lib/models/project.js", + "line": 568, + "description": "Re-initializes addons.", "access": "private", "tagname": "", "itemtype": "method", - "name": "command", - "params": [ - { - "name": "arguments", - "description": "Arguments to be passed into the command.", - "type": "String", - "optional": true, - "multiple": true - }, - { - "name": "options", - "description": "The options passed into child_process.spawnSync.\n (https://nodejs.org/api/child_process.html#child_process_child_process_spawnsync_command_args_options)", - "type": "Object", - "optional": true, - "optdefault": "{}" - } - ], - "class": "CommandGenerator", + "name": "reloadAddons", + "class": "Project", "module": "ember-cli" }, { - "file": "tests/helpers/package-cache.js", - "line": 25, - "description": "The `bower` command helper.", - "access": "private", + "file": "lib/models/project.js", + "line": 581, + "description": "Find an addon by its name", + "access": "public", "tagname": "", "itemtype": "method", - "name": "bower", + "name": "findAddonByName", "params": [ { - "name": "subcommand", - "description": "The subcommand to be passed into bower.", + "name": "name", + "description": "Addon name as specified in package.json", "type": "String" - }, - { - "name": "arguments", - "description": "Arguments to be passed into the bower subcommand.", - "type": "String", - "optional": true, - "multiple": true - }, - { - "name": "options", - "description": "The options passed into child_process.spawnSync.\n (https://nodejs.org/api/child_process.html#child_process_child_process_spawnsync_command_args_options)", - "type": "Object", - "optional": true, - "optdefault": "{}" } ], - "class": "PackageCache", + "return": { + "description": "Addon instance", + "type": "Addon" + }, + "class": "Project", "module": "ember-cli" }, { - "file": "tests/helpers/package-cache.js", - "line": 37, - "description": "The `npm` command helper.", - "access": "private", + "file": "lib/models/project.js", + "line": 595, + "description": "Generate test file contents.\n\nThis method is supposed to be overwritten by test framework addons\nlike `ember-qunit`.", + "access": "public", "tagname": "", "itemtype": "method", - "name": "npm", + "name": "generateTestFile", "params": [ { - "name": "subcommand", - "description": "The subcommand to be passed into npm.", + "name": "moduleName", + "description": "Name of the test module (e.g. `JSHint`)", "type": "String" }, { - "name": "arguments", - "description": "Arguments to be passed into the npm subcommand.", - "type": "String", - "optional": true, - "multiple": true - }, - { - "name": "options", - "description": "The options passed into child_process.spawnSync.\n (https://nodejs.org/api/child_process.html#child_process_child_process_spawnsync_command_args_options)", - "type": "Object", - "optional": true, - "optdefault": "{}" + "name": "tests", + "description": "Array of tests with `name`, `passed` and `errorMessage` properties", + "type": "Object[]" } ], - "class": "PackageCache", + "return": { + "description": "The test file content", + "type": "String" + }, + "class": "Project", "module": "ember-cli" }, { - "file": "tests/helpers/package-cache.js", - "line": 49, - "description": "The `yarn` command helper.", + "file": "lib/models/project.js", + "line": 619, + "description": "Returns a new project based on the first `package.json` that is found\nin `pathName`.\n\nIf the above `package.json` specifies `ember-addon.projectRoot`, we load\nthe project based on the relative path between this directory and the\nspecified `projectRoot`.", "access": "private", "tagname": "", + "static": 1, "itemtype": "method", - "name": "yarn", + "name": "closestSync", "params": [ { - "name": "subcommand", - "description": "The subcommand to be passed into yarn.", + "name": "pathName", + "description": "Path to your project", "type": "String" }, { - "name": "arguments", - "description": "Arguments to be passed into the yarn subcommand.", - "type": "String", - "optional": true, - "multiple": true - }, - { - "name": "options", - "description": "The options passed into child_process.spawnSync.\n (https://nodejs.org/api/child_process.html#child_process_child_process_spawnsync_command_args_options)", - "type": "Object", - "optional": true, - "optdefault": "{}" + "name": "_ui", + "description": "The UI instance to provide to the created Project.", + "type": "UI" } ], - "class": "PackageCache", + "return": { + "description": "Project instance", + "type": "Project" + }, + "class": "Project", "module": "ember-cli" }, { - "file": "tests/helpers/package-cache.js", - "line": 88, - "description": "The `translate` command is used to turn a consistent argument into\nappropriate values based upon the context in which it is used. It's\na convenience helper to avoid littering lookups throughout the code.", + "file": "lib/models/project.js", + "line": 670, + "description": "Returns a new project based on the first package.json that is found\nin `pathName`, or the nullProject.\n\nThe nullProject signifies no-project, but abides by the null object pattern", "access": "private", "tagname": "", + "static": 1, "itemtype": "method", - "name": "translate", + "name": "projectOrnullProject", "params": [ { - "name": "type", - "description": "Either 'bower', 'npm', or 'yarn'.", - "type": "String" - }, - { - "name": "lookup", - "description": "Either 'manifest', 'path', or 'upgrade'.", - "type": "String" + "name": "_ui", + "description": "The UI instance to provide to the created Project.", + "type": "UI" } ], - "class": "PackageCache", + "return": { + "description": "Project instance", + "type": "Project" + }, + "class": "Project", "module": "ember-cli" }, { - "file": "tests/helpers/package-cache.js", - "line": 253, - "description": "The `__setupForTesting` modifies things in module scope.", - "access": "private", - "tagname": "", + "file": "lib/models/project.js", + "line": 694, + "description": "Returns the project root based on the first package.json that is found", + "static": 1, "itemtype": "method", - "name": "__setupForTesting", - "class": "PackageCache", + "name": "getProjectRoot", + "return": { + "description": "The project root directory", + "type": "String" + }, + "class": "Project", "module": "ember-cli" }, { - "file": "tests/helpers/package-cache.js", - "line": 264, - "description": "The `__resetForTesting` puts things back in module scope.", + "file": "lib/models/task.js", + "line": 10, + "description": "Interrupt comamd with an exit code\nCalled when the process is interrupted from outside, e.g. CTRL+C or `process.kill()`", "access": "private", "tagname": "", "itemtype": "method", - "name": "__resetForTesting", - "class": "PackageCache", + "name": "onInterrupt", + "class": "ServeFilesAddon", "module": "ember-cli" }, { - "file": "tests/helpers/package-cache.js", - "line": 274, - "description": "The `_cleanDirs` method deals with sync issues between the\nConfigstore and what exists on disk. Non-existent directories\nare removed from `this.dirs`.", + "file": "lib/tasks/build-watch.js", + "line": 52, + "description": "Exit silently", "access": "private", "tagname": "", "itemtype": "method", - "name": "_cleanDirs", - "class": "PackageCache", + "name": "onInterrupt", + "class": "NpmTask", "module": "ember-cli" }, { - "file": "tests/helpers/package-cache.js", - "line": 295, - "description": "The `_readManifest` method reads the on-disk manifest for the current\ncache and returns its value.", + "file": "lib/tasks/npm-task.js", + "line": 128, + "description": "This method will determine what package manager (npm or yarn) should be\nused to install the npm dependencies.\n\nSetting `this.useYarn` to `true` or `false` will force the use of yarn\nor npm respectively.\n\nIf `this.useYarn` is not set we check if `yarn.lock` exists and if\n`yarn` is available and in that case set `useYarn` to `true`.", "access": "private", "tagname": "", "itemtype": "method", - "name": "_readManifest", - "params": [ - { - "name": "label", - "description": "The label for the cache.", - "type": "String" - }, - { - "name": "type", - "description": "The type of package cache.", - "type": "String" - } - ], + "name": "findPackageManager", "return": { - "description": "The manifest file contents on disk.", - "type": "String" + "description": "", + "type": "Promise" }, - "class": "PackageCache", - "module": "ember-cli" - }, - { - "file": "tests/helpers/package-cache.js", - "line": 326, - "description": "The `_writeManifest` method generates the on-disk folder for the package cache\nand saves the manifest into it. If it is a yarn package cache it will remove\nthe existing lock file.", - "access": "private", - "tagname": "", - "itemtype": "method", - "name": "_writeManifest", - "params": [ - { - "name": "label", - "description": "The label for the cache.", - "type": "String" - }, - { - "name": "type", - "description": "The type of package cache.", - "type": "String" - }, - { - "name": "manifest", - "description": "The contents of the manifest file to write to disk.", - "type": "String" - } - ], - "class": "PackageCache", + "class": "NpmTask", "module": "ember-cli" }, { - "file": "tests/helpers/package-cache.js", - "line": 360, - "description": "The `_removeLinks` method removes from the dependencies of the manifest the\nassets which will be linked in so that we don't duplicate install. It saves\noff the values in the internal `PackageCache` metadata for restoration after\nlinking as those values may be necessary.\n\nIt is also responsible for removing these links prior to making any changes\nto the specified cache.", + "file": "lib/tasks/serve.js", + "line": 102, + "description": "Exit silently", "access": "private", "tagname": "", "itemtype": "method", - "name": "_removeLinks", - "params": [ - { - "name": "label", - "description": "The label for the cache.", - "type": "String" - }, - { - "name": "type", - "description": "The type of package cache.", - "type": "String" - } - ], - "class": "PackageCache", + "name": "onInterrupt", + "class": "WindowsSymlinkChecker", "module": "ember-cli" }, { - "file": "tests/helpers/package-cache.js", - "line": 433, - "description": "The `_restoreLinks` method restores the dependencies from the internal\n`PackageCache` metadata so that the manifest matches its original state after\nperforming the links.\n\nIt is also responsible for restoring these links into the `PackageCache`.", + "file": "lib/tasks/test-server.js", + "line": 61, + "description": "Exit silently", "access": "private", "tagname": "", "itemtype": "method", - "name": "_restoreLinks", - "params": [ - { - "name": "label", - "description": "The label for the cache.", - "type": "String" - }, - { - "name": "type", - "description": "The type of package cache.", - "type": "String" - } - ], - "class": "PackageCache", + "name": "onInterrupt", + "class": "WindowsSymlinkChecker", "module": "ember-cli" }, { - "file": "tests/helpers/package-cache.js", - "line": 483, - "description": "The `_checkManifest` method compares the desired manifest to that which\nexists in the cache.", - "access": "private", - "tagname": "", + "file": "lib/utilities/directory-for-package-name.js", + "line": 5, + "description": "Derive a directory name from a package name.\nTakes scoped packages into account.", "itemtype": "method", - "name": "_checkManifest", + "name": "directoryForPackageName", "params": [ { - "name": "label", - "description": "The label for the cache.", - "type": "String" - }, - { - "name": "type", - "description": "The type of package cache.", - "type": "String" - }, - { - "name": "manifest", - "description": "The contents of the manifest file to compare to cache.", + "name": "packageName", + "description": "", "type": "String" } ], "return": { - "description": "`true` if identical.", - "type": "Boolean" + "description": "Derived directory name.", + "type": "String" }, - "class": "PackageCache", + "class": "WindowsSymlinkChecker", "module": "ember-cli" }, { - "file": "tests/helpers/package-cache.js", - "line": 524, - "description": "The `_install` method installs the contents of the manifest into the\nspecified package cache.", - "access": "private", - "tagname": "", + "file": "lib/utilities/ember-app-utils.js", + "line": 7, + "description": "Returns a normalized url given a string.\nReturns an empty string if `null`, `undefined` or an empty string are passed\nin.", "itemtype": "method", - "name": "_install", + "name": "normalizeUrl", "params": [ { - "name": "label", - "description": "The label for the cache.", - "type": "String" - }, - { - "name": "type", - "description": "The type of package cache.", + "name": "Raw", + "description": "url.", "type": "String" } ], - "class": "PackageCache", + "return": { + "description": "Normalized url.", + "type": "String" + }, + "class": "WindowsSymlinkChecker", "module": "ember-cli" }, { - "file": "tests/helpers/package-cache.js", - "line": 542, - "description": "The `_upgrade` method guarantees that the contents of the manifest are\nallowed to drift in a SemVer compatible manner. It ensures that CI is\nalways running against the latest versions of all dependencies.", - "access": "private", - "tagname": "", + "file": "lib/utilities/ember-app-utils.js", + "line": 24, + "description": "Converts Javascript Object to a string.\nReturns an empty object string representation if a \"falsy\" value is passed\nin.", "itemtype": "method", - "name": "_upgrade", + "name": "convertObjectToString", "params": [ { - "name": "label", - "description": "The label for the cache.", - "type": "String" - }, - { - "name": "type", - "description": "The type of package cache.", - "type": "String" + "name": "Any", + "description": "Javascript Object.", + "type": "Object" } ], - "class": "PackageCache", + "return": { + "description": "A string representation of a Javascript Object.", + "type": "String" + }, + "class": "WindowsSymlinkChecker", "module": "ember-cli" }, { - "file": "tests/helpers/package-cache.js", - "line": 578, - "description": "The `create` method adds a new package cache entry.", + "file": "lib/utilities/ember-app-utils.js", + "line": 37, + "description": "Returns the content for a specific type (section) for index.html.\n\n```\n{{content-for \"[type]\"}}\n```\n\nSupported types:\n\n- 'head'\n- 'config-module'\n- 'head-footer'\n- 'test-header-footer'\n- 'body-footer'\n- 'test-body-footer'", "itemtype": "method", - "name": "create", + "name": "contentFor", "params": [ { - "name": "label", - "description": "The label for the cache.", - "type": "String" + "name": "config", + "description": "Ember.js application configuration", + "type": "Object" }, { - "name": "type", - "description": "The type of package cache.", - "type": "String" + "name": "match", + "description": "Regular expression to match against", + "type": "RegExp" }, { - "name": "manifest", - "description": "The contents of the manifest file for the cache.", + "name": "type", + "description": "Type of content", "type": "String" }, { - "name": "links", - "description": "Packages to omit for install and link.", - "type": "Array" + "name": "options", + "description": "Settings that control the default content", + "type": "Object", + "props": [ + { + "name": "autoRun", + "description": "Controls whether to bootstrap the\n application or not", + "type": "Boolean" + }, + { + "name": "storeConfigInMeta", + "description": "Controls whether to include the\n contents of config", + "type": "Boolean" + } + ] } ], "return": { - "description": "The directory on disk which contains the cache.", + "description": "The content.", "type": "String" }, - "class": "PackageCache", + "class": "WindowsSymlinkChecker", "module": "ember-cli" }, { - "file": "tests/helpers/package-cache.js", - "line": 619, - "description": "The `update` method aliases the `create` method.", + "file": "lib/utilities/insert-into-file.js", + "line": 6, + "description": "Inserts the given content into a file. If the `contentsToInsert` string is already\npresent in the current contents, the file will not be changed unless `force` option\nis passed.\n\nIf `options.before` is specified, `contentsToInsert` will be inserted before\nthe first instance of that string. If `options.after` is specified, the\ncontents will be inserted after the first instance of that string.\nIf the string specified by options.before or options.after is not in the file,\nno change will be made. Both of these options support regular expressions.\n\nIf neither `options.before` nor `options.after` are present, `contentsToInsert`\nwill be inserted at the end of the file.\n\nIt will create a new file if one doesn't exist, unless you set the `options.create`\noption to `false`.\n\nExample:\n\n```\n// app/router.js\nRouter.map(function () {\n});\n```\n\n```\ninsertIntoFile('app/router.js', ' this.route(\"admin\");', {\n after: 'Router.map(function () {' + EOL\n});\n```\n\n```\n// app/router.js\nRouter.map(function () {\n this.route(\"admin\");\n});\n```", "itemtype": "method", - "name": "update", + "name": "insertIntoFile", "params": [ { - "name": "label", - "description": "The label for the cache.", - "type": "String" - }, - { - "name": "type", - "description": "The type of package cache.", + "name": "pathRelativeToProjectRoot", + "description": "", "type": "String" }, { - "name": "manifest", - "description": "The contents of the manifest file for the cache.", + "name": "contentsToInsert", + "description": "", "type": "String" }, { - "name": "links", - "description": "Packages to elide for install and link.", - "type": "Array" + "name": "providedOptions", + "description": "", + "type": "Object" } ], "return": { - "description": "The directory on disk which contains the cache.", - "type": "String" + "description": "", + "type": "Promise" }, - "class": "PackageCache", + "class": "WindowsSymlinkChecker", "module": "ember-cli" }, { - "file": "tests/helpers/package-cache.js", - "line": 633, - "description": "The `get` method returns the directory for the cache.", - "itemtype": "method", - "name": "get", + "file": "lib/utilities/is-lazy-engine.js", + "line": 3, + "description": "Indicate if a given object is a constructor function or class or an instance of an Addon.", + "access": "private", + "tagname": "", "params": [ { - "name": "label", - "description": "The label for the cache.", - "type": "String" + "name": "addonCtorOrInstance", + "description": "the constructor function/class or an instance of an Addon.", + "type": "Object" } ], "return": { - "description": "The directory on disk which contains the cache.", - "type": "String" + "description": "True if the addonCtorOrInstance is a lazy engine, False otherwise.", + "type": "Boolean" + }, + "class": "WindowsSymlinkChecker", + "module": "ember-cli" + }, + { + "file": "lib/utilities/valid-project-name.js", + "line": 5, + "description": "Checks if the string starts with a number.", + "itemtype": "method", + "name": "startsWithNumber", + "return": { + "description": "", + "type": "Boolean" }, - "class": "PackageCache", + "class": "WindowsSymlinkChecker", "module": "ember-cli" }, { - "file": "tests/helpers/package-cache.js", - "line": 644, - "description": "The `destroy` method removes all evidence of the package cache.", + "file": "lib/utilities/valid-project-name.js", + "line": 24, + "description": "Checks if project name is valid.\n\nInvalid names are some of the internal constants that Ember CLI uses, such as\n`app`, `ember`, `ember-cli`, `test`, and `vendor`. Names that start with\nnumbers are considered invalid as well.", "itemtype": "method", - "name": "destroy", + "name": "validProjectName", "params": [ { - "name": "label", - "description": "The label for the cache.", - "type": "String" - }, - { - "name": "type", - "description": "The type of package cache.", + "name": "name", + "description": "The name of Ember CLI project", "type": "String" } ], - "class": "PackageCache", + "return": { + "description": "", + "type": "Boolean" + }, + "class": "WindowsSymlinkChecker", + "module": "ember-cli" + }, + { + "file": "lib/utilities/will-interrupt-process.js", + "line": 47, + "description": "Drops all the interruption handlers and disables an ability to add new one\n\nNote: We don't call `captureExit.releaseExit() here.\nIn some rare scenarios it can lead to the hard to debug issues.\nsee: https://github.com/ember-cli/ember-cli/issues/6779#issuecomment-280940358\n\nWe can more or less feel comfortable with a captured exit because it behaves very\nsimilar to the original `exit` except of cases when we need to do cleanup before exit.", + "access": "private", + "tagname": "", + "itemtype": "method", + "name": "release", + "class": "WindowsSymlinkChecker", "module": "ember-cli" }, { - "file": "tests/helpers/package-cache.js", - "line": 659, - "description": "The `clone` method duplicates a cache. Some package managers can\nleverage a pre-existing state to speed up their installation.", + "file": "lib/utilities/will-interrupt-process.js", + "line": 69, + "description": "Add process interruption handler\n\nWhen the first handler is added then automatically\nsets up process interruption signals listeners", + "access": "private", + "tagname": "", "itemtype": "method", - "name": "destroy", + "name": "addHandler", "params": [ { - "name": "fromLabel", - "description": "The label for the cache to clone.", - "type": "String" - }, - { - "name": "toLabel", - "description": "The label for the new cache.", - "type": "String" + "name": "cb", + "description": "Callback to be called when process interruption fired", + "type": "Function" } ], - "class": "PackageCache", + "class": "WindowsSymlinkChecker", "module": "ember-cli" }, { - "file": "tests/unit/models/addon-test.js", - "line": 384, - "description": "Tests the various configuration options that affect the hintingEnabled method.\n\n | configuration | test1 | test2 | test3 | test4 | test5 |\n | ------------- | ----- | ----- | ----- | ----- | ----- |\n | hinting | true | true | true | false | unset |\n | environment | dev | N/A | prod | N\\A | N\\A |\n | test_command | set | set | unset | set | set |\n | RESULT | true | true | false | false | true |", + "file": "lib/utilities/will-interrupt-process.js", + "line": 97, + "description": "Remove process interruption handler\n\nIf there are no remaining handlers after removal\nthen clean up all the process interruption signal listeners", + "access": "private", + "tagname": "", "itemtype": "method", - "name": "hintingEnabled", - "class": "", - "module": "ember-cli" - }, - { - "file": "tests/.eslintrc.js", - "line": 20, - "class": "", + "name": "removeHandler", + "params": [ + { + "name": "cb", + "description": "Callback to be removed", + "type": "Function" + } + ], + "class": "WindowsSymlinkChecker", "module": "ember-cli" }, { - "file": "tests/.eslintrc.js", - "line": 26, - "class": "", + "file": "lib/utilities/will-interrupt-process.js", + "line": 122, + "description": "Sets up listeners for interruption signals\n\nWhen one of these signals is caught than raise process.exit()\nwhich enforces `capture-exit` to run registered interruption handlers", + "itemtype": "method", + "name": "setupSignalsTrap", + "class": "WindowsSymlinkChecker", "module": "ember-cli" }, { - "file": ".eslintrc.js", - "line": 17, - "class": "", + "file": "lib/utilities/will-interrupt-process.js", + "line": 140, + "description": "Removes interruption signal listeners and tears down capture-exit", + "itemtype": "method", + "name": "teardownSignalsTrap", + "class": "WindowsSymlinkChecker", "module": "ember-cli" }, { - "file": ".eslintrc.js", - "line": 23, - "class": "", + "file": "lib/utilities/will-interrupt-process.js", + "line": 155, + "description": "Suppresses \"Terminate batch job (Y/N)\" confirmation on Windows", + "itemtype": "method", + "name": "trapWindowsSignals", + "class": "WindowsSymlinkChecker", "module": "ember-cli" }, { - "file": ".eslintrc.js", - "line": 42, - "class": "", + "file": "lib/utilities/windows-admin.js", + "line": 38, + "description": "if not windows, will fulfill with:\n `{ windows: false, elevated: null)`\nif windows, and elevated will fulfill with:\n `{ windows: false, elevated: true)`\nif windows, and is NOT elevated will fulfill with:\n `{ windows: false, elevated: false)`\n will include heplful warning, so that users know (if possible) how to\n achieve better windows build performance", + "access": "public", + "tagname": "", + "itemtype": "method", + "name": "checkIfSymlinksNeedToBeEnabled", + "return": { + "description": "Object describing whether we're on windows and if admin rights exist", + "type": "Promise" + }, + "class": "WindowsSymlinkChecker", "module": "ember-cli" }, { - "file": ".eslintrc.js", - "line": 46, - "class": "", + "file": "lib/utilities/windows-admin.js", + "line": 60, + "description": "sets up a WindowsSymlinkChecker\n\nproviding it with defaults for:\n\n* if we are on windows\n* if we can symlink\n* a reference to exec", + "access": "private", + "tagname": "", + "itemtype": "method", + "name": "_setup", + "params": [ + { + "name": "UI", + "description": "", + "type": "UI" + } + ], + "return": { + "description": "", + "type": "WindowsSymlinkChecker" + }, + "class": "WindowsSymlinkChecker", "module": "ember-cli" }, { - "file": ".eslintrc.js", - "line": 52, - "class": "", + "file": "lib/utilities/windows-admin.js", + "line": 81, + "access": "public", + "tagname": "", + "itemtype": "method", + "name": "checkIfSymlinksNeedToBeEnabled", + "return": { + "description": "Object describing whether we're on windows and if admin rights exist", + "type": "Promise" + }, + "class": "WindowsSymlinkChecker", "module": "ember-cli" }, { - "file": ".eslintrc.js", - "line": 62, - "class": "", + "file": "lib/utilities/windows-admin.js", + "line": 104, + "description": "Uses the eon-old command NET SESSION to determine whether or not the\n current user has elevated rights (think sudo, but Windows).", + "access": "private", + "tagname": "", + "itemtype": "method", + "name": "_checkForElevatedRights", + "params": [ + { + "name": "ui", + "description": "- ui object used to call writeLine();", + "type": "Object" + } + ], + "return": { + "description": "Object describing whether we're on windows and if admin rights exist", + "type": "Object" + }, + "class": "WindowsSymlinkChecker", "module": "ember-cli" } ], "warnings": [ { - "message": "Missing item type\nTears down the targeted project download directory", - "line": " tests/helpers/acceptance.js:72" - }, - { - "message": "Missing item type\nClean a test run.", - "line": " tests/helpers/acceptance.js:112" - }, - { - "message": "Missing item type", - "line": " tests/.eslintrc.js:20" - }, - { - "message": "Missing item type", - "line": " tests/.eslintrc.js:26" - }, - { - "message": "Missing item type", - "line": " .eslintrc.js:17" - }, - { - "message": "Missing item type", - "line": " .eslintrc.js:23" - }, - { - "message": "Missing item type", - "line": " .eslintrc.js:42" - }, - { - "message": "Missing item type", - "line": " .eslintrc.js:46" - }, - { - "message": "Missing item type", - "line": " .eslintrc.js:52" + "message": "Missing item type\nA Symbol constant for sharing between index.js and addon-proxy.js rather than\nputting the symbol into the Symbol global cache. The symbol is used in per-bundle\ncache entries to refer to the field that points at the real instance that a Proxy\nrefers to.", + "line": " lib/models/per-bundle-addon-cache/target-instance.js:3" }, { - "message": "Missing item type", - "line": " .eslintrc.js:62" + "message": "Missing item type\nIndicate if a given object is a constructor function or class or an instance of an Addon.", + "line": " lib/utilities/is-lazy-engine.js:3" } ] } \ No newline at end of file diff --git a/api/files/lib_broccoli_default-packager.js.html b/api/files/lib_broccoli_default-packager.js.html index 3c7c249..a443205 100644 --- a/api/files/lib_broccoli_default-packager.js.html +++ b/api/files/lib_broccoli_default-packager.js.html @@ -42,7 +42,6 @@

    Classes

  • Builder
  • CLI
  • Command
  • -
  • CommandGenerator
  • DefaultPackager
  • EmberAddon
  • EmberApp
  • @@ -51,10 +50,9 @@

    Classes

  • Instrumentation
  • NodeModulesList
  • NpmTask
  • -
  • PackageCache
  • PackageInfo
  • PackageInfoCache
  • -
  • PrivateTestHelpers
  • +
  • PerBundleAddonCache
  • Project
  • ServeFilesAddon
  • TestsServerAddon
  • @@ -69,7 +67,7 @@

    Classes

    - Version: 3.21.2 + Version: 5.4.0-a905f346b9
    @@ -100,7 +98,6 @@

    lib/broccoli/default-packager.js

    const preprocessTemplates = p.preprocessTemplates; const preprocessMinifyCss = p.preprocessMinifyCss; -const DEFAULT_BOWER_PATH = 'bower_components'; const DEFAULT_VENDOR_PATH = 'vendor'; const EMBER_CLI_INTERNAL_FILES_PATH = '/vendor/ember-cli/'; const EMBER_CLI_FILES = [ @@ -187,7 +184,6 @@

    lib/broccoli/default-packager.js

    module.exports = class DefaultPackager { constructor(options) { this._cachedTests = null; - this._cachedBower = null; this._cachedVendor = null; this._cachedPublic = null; this._cachedConfig = null; @@ -234,7 +230,6 @@

    lib/broccoli/default-packager.js

    * / * ├── addon-tree-output/ * ├── the-best-app-ever/ - * ├── bower_components/ * └── vendor/ * ``` * @@ -278,8 +273,8 @@

    lib/broccoli/default-packager.js

    } /* - * Combines compiled javascript, external files (node modules, bower - * components), vendor files and processed configuration (based on the + * Combines compiled javascript, external files (node modules), + * vendor files and processed configuration (based on the * environment) into a single tree. * * Input tree: @@ -288,7 +283,6 @@

    lib/broccoli/default-packager.js

    * / * ├── addon-tree-output/ * ├── the-best-app-ever/ - * ├── bower_components/ * └── vendor/ * ``` * @@ -380,7 +374,6 @@

    lib/broccoli/default-packager.js

    * ``` * / * ├── addon-tree-output/ - * ├── bower_components/ * └── vendor/ * ``` * @@ -483,7 +476,6 @@

    lib/broccoli/default-packager.js

    * ``` * / * ├── addon-tree-output/ - * ├── bower_components/ * ├── the-best-app-ever/ * └── vendor/ * ``` @@ -525,6 +517,7 @@

    lib/broccoli/default-packager.js

    'template', preprocessTemplates(preprocessedTemplatesFromAddons, { registry: this.registry, + treeType: 'templates', }) ); } @@ -541,7 +534,6 @@

    lib/broccoli/default-packager.js

    * ``` * / * ├── addon-tree-output/ - * ├── bower_components/ * ├── the-best-app-ever/ * └── vendor/ * ``` @@ -584,6 +576,7 @@

    lib/broccoli/default-packager.js

    let preprocessedApp = preprocessJs(app, '/', this.name, { registry: this.registry, + treeType: 'app', }); this._cachedProcessedJavascript = callAddonsPostprocessTreeHook(this.project, 'js', preprocessedApp); @@ -602,9 +595,6 @@

    lib/broccoli/default-packager.js

    * ``` * addon-tree-output/ * ... - * bower_components/ - * hint.css/ - * ... * the-best-app-ever/ * styles/ * ... @@ -632,13 +622,11 @@

    lib/broccoli/default-packager.js

    outputPaths: this.distPaths.appCssFile, registry: this.registry, minifyCSS: this.minifyCSS.options, + treeType: 'styles', }; let stylesAndVendor = callAddonsPreprocessTreeHook(this.project, 'css', tree); - stylesAndVendor = this._debugTree(stylesAndVendor, 'mu-layout:addonsPreprocessTree:css'); - let preprocessedStyles = preprocessCss(stylesAndVendor, '/app/styles', '/assets', options); - preprocessedStyles = this._debugTree(preprocessedStyles, 'mu-layout:preprocess:css'); let vendorStyles = []; for (let outputFile in this.styleOutputFiles) { @@ -680,43 +668,6 @@

    lib/broccoli/default-packager.js

    return this._cachedProcessedStyles; } - /* - * Given an input tree, returns a properly assembled Broccoli tree with bower - * components. - * - * Given a tree: - * - * ``` - * ├── ember.js/ - * ├── pusher/ - * └── raven-js/ - * ``` - * - * Returns: - * - * ``` - * [bowerDirectory]/ - * ├── ember.js/ - * ├── pusher/ - * └── raven-js/ - * ``` - * - * @private - * @method packageBower - * @param {BroccoliTree} tree - * @param {String} bowerDirectory Custom path to bower components - */ - packageBower(tree, bowerDirectory) { - if (this._cachedBower === null) { - this._cachedBower = new Funnel(tree, { - destDir: bowerDirectory || DEFAULT_BOWER_PATH, - annotation: 'Packaged Bower', - }); - } - - return this._cachedBower; - } - /* * Given an input tree, returns a properly assembled Broccoli tree with vendor * files. @@ -769,7 +720,6 @@

    lib/broccoli/default-packager.js

    * * ``` * addon-tree-output/ - * bower_components/ * the-best-app-ever/ * tests/ * ├── acceptance/ @@ -819,6 +769,7 @@

    lib/broccoli/default-packager.js

    const inputPath = '/tests'; let preprocessedTests = preprocessJs(treeToCompile, inputPath, this.name, { registry: this.registry, + treeType: 'test', }); let mergedTestTrees = mergeTrees([addonTestSupportTree, preprocessedTests], { @@ -839,7 +790,6 @@

    lib/broccoli/default-packager.js

    * * ``` * addon-tree-output/ - * bower_components/ * the-best-app-ever/ * tests/ * ├── acceptance/ @@ -890,7 +840,6 @@

    lib/broccoli/default-packager.js

    * / * ├── addon-tree-output/ * ├── the-best-app-ever/ - * ├── bower_components/ * ├── tests/ * └── vendor/ * ``` @@ -989,7 +938,6 @@

    lib/broccoli/default-packager.js

    * * ``` * addon-tree-output/ - * bower_components/ * the-best-app-ever/ * tests/ * ├── acceptance/ @@ -1041,7 +989,6 @@

    lib/broccoli/default-packager.js

    * * ``` * addon-tree-output/ - * bower_components/ * the-best-app-ever/ * tests/ * ├── acceptance/ @@ -1219,10 +1166,6 @@

    lib/broccoli/default-packager.js

    * ember-engines/ * ember-resolver/ * ... - * bower_components/ - * usertiming/ - * sinonjs/ - * ... * the-best-app-ever/ * components/ * config/ @@ -1284,10 +1227,6 @@

    lib/broccoli/default-packager.js

    * ember-engines/ * ember-resolver/ * ... - * bower_components/ - * usertiming/ - * sinonjs/ - * ... * the-best-app-ever/ * components/ * config/ @@ -1347,10 +1286,6 @@

    lib/broccoli/default-packager.js

    * ember-engines/ * ember-resolver/ * ... - * bower_components/ - * usertiming/ - * sinonjs/ - * ... * the-best-app-ever/ * components/ * config/ diff --git a/api/files/lib_broccoli_ember-addon.js.html b/api/files/lib_broccoli_ember-addon.js.html index 1206610..f45ab1e 100644 --- a/api/files/lib_broccoli_ember-addon.js.html +++ b/api/files/lib_broccoli_ember-addon.js.html @@ -42,7 +42,6 @@

    Classes

  • Builder
  • CLI
  • Command
  • -
  • CommandGenerator
  • DefaultPackager
  • EmberAddon
  • EmberApp
  • @@ -51,10 +50,9 @@

    Classes

  • Instrumentation
  • NodeModulesList
  • NpmTask
  • -
  • PackageCache
  • PackageInfo
  • PackageInfoCache
  • -
  • PrivateTestHelpers
  • +
  • PerBundleAddonCache
  • Project
  • ServeFilesAddon
  • TestsServerAddon
  • @@ -69,7 +67,7 @@

    Classes

    - Version: 3.21.2 + Version: 5.4.0-a905f346b9
    @@ -85,7 +83,7 @@

    lib/broccoli/ember-addon.js

    /** @module ember-cli */ -const defaultsDeep = require('ember-cli-lodash-subset').defaultsDeep; +const { defaultsDeep } = require('ember-cli-lodash-subset'); const Funnel = require('broccoli-funnel'); const fs = require('fs'); @@ -124,10 +122,6 @@

    lib/broccoli/ember-addon.js

    }), vendor: null, }, - jshintrc: { - tests: './tests', - app: './tests/dummy', - }, }; if (!fs.existsSync('tests/dummy/app')) { diff --git a/api/files/lib_broccoli_ember-app.js.html b/api/files/lib_broccoli_ember-app.js.html index d58407e..7e1de96 100644 --- a/api/files/lib_broccoli_ember-app.js.html +++ b/api/files/lib_broccoli_ember-app.js.html @@ -42,7 +42,6 @@

    Classes

  • Builder
  • CLI
  • Command
  • -
  • CommandGenerator
  • DefaultPackager
  • EmberAddon
  • EmberApp
  • @@ -51,10 +50,9 @@

    Classes

  • Instrumentation
  • NodeModulesList
  • NpmTask
  • -
  • PackageCache
  • PackageInfo
  • PackageInfoCache
  • -
  • PrivateTestHelpers
  • +
  • PerBundleAddonCache
  • Project
  • ServeFilesAddon
  • TestsServerAddon
  • @@ -69,7 +67,7 @@

    Classes

    - Version: 3.21.2 + Version: 5.4.0-a905f346b9
    @@ -91,33 +89,21 @@

    lib/broccoli/ember-app.js

    const chalk = require('chalk'); const resolve = require('resolve'); +const { assert, deprecate } = require('../debug'); const Project = require('../models/project'); -const SilentError = require('silent-error'); - -let preprocessJs = p.preprocessJs; -let isType = p.isType; - -let preprocessTemplates = p.preprocessTemplates; const concat = require('broccoli-concat'); const BroccoliDebug = require('broccoli-debug'); -const AmdFunnel = require('broccoli-amd-funnel'); const mergeTrees = require('./merge-trees'); +const broccoliMergeTrees = require('broccoli-merge-trees'); const WatchedDir = require('broccoli-source').WatchedDir; const UnwatchedDir = require('broccoli-source').UnwatchedDir; -const BroccoliMergeTrees = require('broccoli-merge-trees'); -const merge = require('ember-cli-lodash-subset').merge; -const defaultsDeep = require('ember-cli-lodash-subset').defaultsDeep; -const omitBy = require('ember-cli-lodash-subset').omitBy; -const isNull = require('ember-cli-lodash-subset').isNull; +const { merge, defaultsDeep, omitBy, isNull } = require('ember-cli-lodash-subset'); const Funnel = require('broccoli-funnel'); const logger = require('heimdalljs-logger')('ember-cli:ember-app'); const addonProcessTree = require('../utilities/addon-process-tree'); const lintAddonsByType = require('../utilities/lint-addons-by-type'); -const emberCLIBabelConfigKey = require('../utilities/ember-cli-babel-config-key'); -const { isExperimentEnabled } = require('../experiments'); -const semver = require('semver'); const DefaultPackager = require('./default-packager'); let DEFAULT_CONFIG = { @@ -147,7 +133,6 @@

    lib/broccoli/ember-app.js

    }, sourcemaps: {}, trees: {}, - jshintrc: {}, addons: {}, }; @@ -162,12 +147,10 @@

    lib/broccoli/ember-app.js

    - autoRun, defaults to `true` - outputPaths, defaults to `{}` - minifyCSS, defaults to `{enabled: !!isProduction,options: { relativeTo: 'assets' }} - - minifyJS, defaults to `{enabled: !!isProduction} - sourcemaps, defaults to `{}` - trees, defaults to `{}` - - jshintrc, defaults to `{}` - vendorFiles, defaults to `{}` - - addons, defaults to `{ blacklist: [], whitelist: [] }` + - addons, defaults to `{ exclude: [], include: [] }` @class EmberApp @constructor @@ -191,8 +174,6 @@

    lib/broccoli/ember-app.js

    this.registry = options.registry || p.defaultRegistry(this); - this.bowerDirectory = this.project.bowerDirectory; - this._initTestsAndHinting(options); this._initOptions(options); this._initVendorFiles(); @@ -219,10 +200,6 @@

    lib/broccoli/ember-app.js

    this._importAddonTransforms(); this._notifyAddonIncluded(); - if (!this._addonInstalled('loader.js') && !this.options._ignoreMissingLoader) { - throw new SilentError('The loader.js addon is missing from your project, please add it to `package.json`.'); - } - this._debugTree = BroccoliDebug.buildDebugCallback('ember-app'); this._defaultPackager = new DefaultPackager({ @@ -253,8 +230,31 @@

    lib/broccoli/ember-app.js

    }, }); - this._isPackageHookSupplied = typeof this.options.package === 'function'; this._cachedAddonBundles = {}; + + if (this.project.perBundleAddonCache && this.project.perBundleAddonCache.numProxies > 0) { + if (this.options.addons.include && this.options.addons.include.length) { + throw new Error( + [ + `[ember-cli] addon bundle caching is disabled for apps that specify an addon "include"`, + '', + 'All addons using bundle caching:', + ...this.project.perBundleAddonCache.getPathsToAddonsOptedIn(), + ].join('\n') + ); + } + + if (this.options.addons.exclude && this.options.addons.exclude.length) { + throw new Error( + [ + `[ember-cli] addon bundle caching is disabled for apps that specify an addon "exclude"`, + '', + 'All addons using bundle caching:', + ...this.project.perBundleAddonCache.getPathsToAddonsOptedIn(), + ].join('\n') + ); + } + } } /** @@ -303,6 +303,20 @@

    lib/broccoli/ember-app.js

    @param {Object} options */ _initOptions(options) { + deprecate( + 'Using the `outputPaths` build option is deprecated, as output paths will no longer be predetermined under Embroider.', + typeof options.outputPaths === 'undefined', + { + for: 'ember-cli', + id: 'ember-cli.outputPaths-build-option', + since: { + available: '5.3.0', + enabled: '5.3.0', + }, + until: '6.0.0', + } + ); + let resolvePathFor = (defaultPath, specified) => { let path = defaultPath; if (specified && typeof specified === 'string') { @@ -333,8 +347,6 @@

    lib/broccoli/ember-app.js

    let trees = (options && options.trees) || {}; let appTree = buildTreeFor('app', trees.app); - - let testsPath = typeof trees.tests === 'string' ? resolvePathFor('tests', trees.tests) : null; let testsTree = buildTreeFor('tests', trees.tests, options.tests); // these are contained within app/ no need to watch again @@ -347,47 +359,15 @@

    lib/broccoli/ember-app.js

    } let templatesTree = buildTreeFor('app/templates', trees.templates, false); - - // do not watch bower's default directory by default - let bowerTree = buildTreeFor(this.bowerDirectory, null, !!this.project._watchmanInfo.enabled); - - // Set the flag to make sure: - // - // - we do not blow up if there is no bower_components folder - // - we do not attempt to merge bower and vendor together if they are the - // same tree - this._bowerEnabled = this.bowerDirectory !== 'vendor' && fs.existsSync(this.bowerDirectory); - let vendorTree = buildTreeFor('vendor', trees.vendor); let publicTree = buildTreeFor('public', trees.public); let detectedDefaultOptions = { babel: {}, - jshintrc: { - app: this.project.root, - tests: testsPath, - }, minifyCSS: { enabled: this.isProduction, options: { processImport: false }, }, - // TODO: remove this with a deprecation (nothing in the default app/addon setup consumes it) - minifyJS: { - enabled: this.isProduction, - options: { - compress: { - // this is adversely affects heuristics for IIFE eval - // eslint-disable-next-line camelcase - negate_iife: false, - // limit sequences because of memory issues during parsing - sequences: 30, - }, - output: { - // no difference in size and much easier to debug - semicolons: false, - }, - }, - }, outputPaths: { app: { css: { @@ -405,7 +385,6 @@

    lib/broccoli/ember-app.js

    tests: testsTree, styles: stylesTree, templates: templatesTree, - bower: bowerTree, vendor: vendorTree, public: publicTree, }, @@ -413,18 +392,8 @@

    lib/broccoli/ember-app.js

    let emberCLIBabelInstance = this.project.findAddonByName('ember-cli-babel'); if (emberCLIBabelInstance) { - let version = this.project.require('ember-cli-babel/package.json').version; - if (semver.lt(version, '6.0.0-alpha.1')) { - detectedDefaultOptions.babel = { - modules: 'amdStrict', - moduleIds: true, - resolveModuleSource: require('amd-name-resolver').moduleResolve, - }; - } - - let emberCLIBabelConfigKey = this._emberCLIBabelConfigKey(); - detectedDefaultOptions[emberCLIBabelConfigKey] = detectedDefaultOptions[emberCLIBabelConfigKey] || {}; - detectedDefaultOptions[emberCLIBabelConfigKey].compileModules = true; + detectedDefaultOptions['ember-cli-babel'] = detectedDefaultOptions['ember-cli-babel'] || {}; + detectedDefaultOptions['ember-cli-babel'].compileModules = true; } this.options = defaultsDeep(options, detectedDefaultOptions, DEFAULT_CONFIG); @@ -442,12 +411,6 @@

    lib/broccoli/ember-app.js

    this.options.fingerprint.exclude.push('testem'); } - _emberCLIBabelConfigKey() { - let emberCLIBabelInstance = this.project.findAddonByName('ember-cli-babel'); - - return emberCLIBabelConfigKey(emberCLIBabelInstance); - } - /** Resolves a path relative to the project's root @@ -463,118 +426,26 @@

    lib/broccoli/ember-app.js

    @method _initVendorFiles */ _initVendorFiles() { - let bowerDeps = this.project.bowerDependencies(); - let ember = this.project.findAddonByName('ember-source'); - let addonEmberCliShims = this.project.findAddonByName('ember-cli-shims'); - let bowerEmberCliShims = bowerDeps['ember-cli-shims']; - let developmentEmber; - let productionEmber; - let emberTesting; - let emberShims = null; - - if (ember) { - developmentEmber = ember.paths.debug; - productionEmber = ember.paths.prod; - emberTesting = ember.paths.testing; - emberShims = ember.paths.shims; - } else { - if (bowerEmberCliShims) { - emberShims = `${this.bowerDirectory}/ember-cli-shims/app-shims.js`; - } + let emberSource = this.project.findAddonByName('ember-source'); - // in Ember 1.10 and higher `ember.js` is deprecated in favor of - // the more aptly named `ember.debug.js`. - productionEmber = `${this.bowerDirectory}/ember/ember.prod.js`; - developmentEmber = `${this.bowerDirectory}/ember/ember.debug.js`; - if (!fs.existsSync(this._resolveLocal(developmentEmber))) { - developmentEmber = `${this.bowerDirectory}/ember/ember.js`; - } - emberTesting = `${this.bowerDirectory}/ember/ember-testing.js`; - } - - let handlebarsVendorFiles; - if ('handlebars' in bowerDeps) { - handlebarsVendorFiles = { - development: `${this.bowerDirectory}/handlebars/handlebars.js`, - production: `${this.bowerDirectory}/handlebars/handlebars.runtime.js`, - }; - } else { - handlebarsVendorFiles = null; - } + assert( + 'Could not find `ember-source`. Please install `ember-source` by running `ember install ember-source`.', + emberSource + ); this.vendorFiles = omitBy( merge( { - 'handlebars.js': handlebarsVendorFiles, 'ember.js': { - development: developmentEmber, - production: productionEmber, + development: emberSource.paths.debug, + production: emberSource.paths.prod, }, - 'ember-testing.js': [emberTesting, { type: 'test' }], - 'app-shims.js': emberShims, - 'ember-resolver.js': [ - `${this.bowerDirectory}/ember-resolver/dist/modules/ember-resolver.js`, - { - exports: { - 'ember/resolver': ['default'], - }, - }, - ], + 'ember-testing.js': [emberSource.paths.testing, { type: 'test' }], }, this.options.vendorFiles ), isNull ); - - this._addJqueryInLegacyEmber(); - - if (this._addonInstalled('ember-resolver') || !bowerDeps['ember-resolver']) { - // if the project is using `ember-resolver` as an addon - // remove it from `vendorFiles` (the npm version properly works - // without `app.import`s) - delete this.vendorFiles['ember-resolver.js']; - } - - // Warn if ember-cli-shims is not included. - // certain versions of `ember-source` bundle them by default, - // so we must check if that is the load mechanism of ember - // before checking `bower`. - let emberCliShimsRequired = this._checkEmberCliBabel(this.project.addons); - if (!emberShims && !addonEmberCliShims && !bowerEmberCliShims && emberCliShimsRequired) { - this.project.ui.writeWarnLine( - "You have not included `ember-cli-shims` in your project's `bower.json` or `package.json`. This only works if you provide an alternative yourself and unset `app.vendorFiles['app-shims.js']`." - ); - } - - // If ember-testing.js is coming from Bower (not ember-source) and it does not - // exist, then we remove it from vendor files. This is needed to support versions - // of Ember older than 1.8.0 (when ember-testing.js was incldued in ember.js itself) - if (!ember && this.vendorFiles['ember-testing.js'] && !fs.existsSync(this.vendorFiles['ember-testing.js'][0])) { - delete this.vendorFiles['ember-testing.js']; - } - } - - _addJqueryInLegacyEmber() { - if (this.project.findAddonByName('@ember/jquery')) { - return; - } - let ember = this.project.findAddonByName('ember-source'); - let jqueryPath; - if (ember) { - let optionFeatures = this.project.findAddonByName('@ember/optional-features'); - if (optionFeatures && !optionFeatures.isFeatureEnabled('jquery-integration')) { - return; - } - this.project.ui.writeDeprecateLine( - 'The integration of jQuery into Ember has been deprecated and will be removed with Ember 4.0. You can either' + - ' opt-out of using jQuery, or install the `@ember/jquery` addon to provide the jQuery integration. Please' + - ' consult the deprecation guide for further details: https://emberjs.com/deprecations/v3.x#toc_jquery-apis' - ); - jqueryPath = ember.paths.jquery; - } else { - jqueryPath = `${this.bowerDirectory}/jquery/dist/jquery.js`; - } - this.vendorFiles = merge({ 'jquery.js': jqueryPath }, this.vendorFiles); } /** @@ -618,52 +489,24 @@

    lib/broccoli/ember-app.js

    /** @private - @method _addonDisabledByBlacklist + @method _addonDisabledByExclude @param {Addon} addon @return {Boolean} */ - _addonDisabledByBlacklist(addon) { - let blacklist = this.options.addons.blacklist; - return !!blacklist && blacklist.indexOf(addon.name) !== -1; + _addonDisabledByExclude(addon) { + let exclude = this.options.addons.exclude; + return !!exclude && exclude.indexOf(addon.name) !== -1; } /** @private - @method _addonDisabledByWhitelist + @method _addonDisabledByInclude @param {Addon} addon @return {Boolean} */ - _addonDisabledByWhitelist(addon) { - let whitelist = this.options.addons.whitelist; - return !!whitelist && whitelist.indexOf(addon.name) === -1; - } - - /** - @private - @method _checkEmberCliBabel - @param {Addons} addons - @return {Boolean} - */ - _checkEmberCliBabel(addons, result, roots) { - addons = addons || []; - result = result || false; - roots = roots || {}; - - let babelInstance = addons.find((addon) => addon.name === 'ember-cli-babel'); - if (babelInstance) { - let version = babelInstance.pkg.version; - if (semver.lt(version, '6.6.0')) { - result = true; - } - if (semver.lt(version, '6.0.0') && !roots[babelInstance.root]) { - roots[babelInstance.root] = true; - this.project.ui.writeDeprecateLine( - `ember-cli-babel 5.x has been deprecated. Please upgrade to at least ember-cli-babel 6.6. Version ${version} located: ${babelInstance.root}` - ); - } - } - - return addons.some((addon) => this._checkEmberCliBabel(addon.addons, result, roots)) || result; + _addonDisabledByInclude(addon) { + let include = this.options.addons.include; + return !!include && include.indexOf(addon.name) === -1; } /** @@ -679,7 +522,7 @@

    lib/broccoli/ember-app.js

    return false; } - return !this._addonDisabledByBlacklist(addon) && !this._addonDisabledByWhitelist(addon); + return !this._addonDisabledByExclude(addon) && !this._addonDisabledByInclude(addon); } /** @@ -691,18 +534,18 @@

    lib/broccoli/ember-app.js

    _notifyAddonIncluded() { let addonNames = this.project.addons.map((addon) => addon.name); - if (this.options.addons.blacklist) { - this.options.addons.blacklist.forEach((addonName) => { + if (this.options.addons.exclude) { + this.options.addons.exclude.forEach((addonName) => { if (addonNames.indexOf(addonName) === -1) { - throw new Error(`Addon "${addonName}" defined in blacklist is not found`); + throw new Error(`Addon "${addonName}" defined in "exclude" is not found`); } }); } - if (this.options.addons.whitelist) { - this.options.addons.whitelist.forEach((addonName) => { + if (this.options.addons.include) { + this.options.addons.include.forEach((addonName) => { if (addonNames.indexOf(addonName) === -1) { - throw new Error(`Addon "${addonName}" defined in whitelist is not found`); + throw new Error(`Addon "${addonName}" defined in "include" is not found`); } }); } @@ -806,92 +649,6 @@

    lib/broccoli/ember-app.js

    return this._addonTreesFor(type).map((addonBundle) => addonBundle.tree); } - _getDefaultPluginForType(type) { - let plugins = this.registry.load(type); - let defaultsForType = plugins.filter((plugin) => plugin.isDefaultForType); - - if (defaultsForType.length > 1) { - throw new Error( - `There are multiple preprocessor plugins marked as default for '${type}': ${defaultsForType - .map((p) => p.name) - .join(', ')}` - ); - } - - return defaultsForType[0]; - } - - _compileAddonTemplates(tree) { - let defaultPluginForType = this._getDefaultPluginForType('template'); - let options = { - annotation: `_compileAddonTemplates`, - registry: this.registry, - }; - - if (defaultPluginForType) { - tree = defaultPluginForType.toTree(tree, options); - } else { - tree = preprocessTemplates(tree, options); - } - - return tree; - } - - _compileAddonJs(tree) { - let defaultPluginForType = this._getDefaultPluginForType('js'); - let options = { - annotation: '_compileAddonJs', - registry: this.registry, - }; - - if (defaultPluginForType) { - tree = defaultPluginForType.toTree(tree, options); - } else { - tree = preprocessJs(tree, '/', '/', options); - } - - return tree; - } - - _compileAddonTree(tree, skipTemplates) { - if (!skipTemplates) { - tree = this._compileAddonTemplates(tree); - } - tree = this._compileAddonJs(tree); - - return tree; - } - - _precompileAppJsTree(tree) { - let emberCLIBabelConfigKey = this._emberCLIBabelConfigKey(); - - let original = this.options[emberCLIBabelConfigKey]; - - // the app will handle transpilation after it tree-shakes - // do it here instead of the constructor because - // ember-data and others do their own compilation in their - // treeForAddon without calling super - // they need the original params preserved because they call - // babel themselves and expect compilation the old way - this.options[emberCLIBabelConfigKey] = Object.assign({}, original, { - compileModules: false, - disablePresetEnv: true, - disableDebugTooling: true, - disableEmberModulesAPIPolyfill: true, - }); - - tree = preprocessJs(tree, '/', '/', { - annotation: `_precompileAppJsTree`, - registry: this.registry, - }); - - // return the original params because there are multiple - // entrances to preprocessJs - this.options[emberCLIBabelConfigKey] = original; - - return tree; - } - /** Runs addon post-processing on a given tree and returns the processed tree. @@ -1070,7 +827,7 @@

    lib/broccoli/ember-app.js

    * @method getAppJavascript * @return {BroccoliTree} */ - getAppJavascript(isPackageHookSupplied) { + getAppJavascript() { let appTrees = [].concat(this.addonTreesFor('app'), this.trees.app).filter(Boolean); let mergedApp = mergeTrees(appTrees, { @@ -1084,10 +841,6 @@

    lib/broccoli/ember-app.js

    annotation: 'ProcessedAppTree', }); - if (isExperimentEnabled('PACKAGER') && isPackageHookSupplied) { - appTree = this._precompileAppJsTree(appTree); - } - return appTree; } @@ -1242,7 +995,6 @@

    lib/broccoli/ember-app.js

    * * + app `vendor` files * + add-ons' `vendor` files - * + bower packages * + node modules * * Resulting tree: @@ -1250,7 +1002,6 @@

    lib/broccoli/ember-app.js

    * ``` * / * ├── addon-tree-output/ - * ├── bower_components/ * └── vendor/ * ``` * @@ -1272,13 +1023,7 @@

    lib/broccoli/ember-app.js

    ); let addons = this.addonTree(); - let trees = [vendor].concat(addons); - if (this._bowerEnabled) { - let bower = this._defaultPackager.packageBower(this.trees.bower, this.bowerDirectory); - - trees.push(bower); - } trees = this._nodeModuleTrees().concat(trees); @@ -1420,16 +1165,6 @@

    lib/broccoli/ember-app.js

    }); } - /** - * @private - * @method _addonInstalled - * @param {String} addonName The name of the addon we are checking to see if it's installed - * @return {Boolean} - */ - _addonInstalled(addonName) { - return !!this.registry.availablePlugins[addonName]; - } - /** @public @method dependencies @@ -1473,7 +1208,7 @@

    lib/broccoli/ember-app.js

    } let directory = path.dirname(assetPath); - let subdirectory = directory.replace(new RegExp(`^vendor/|${this.bowerDirectory}|node_modules/`), ''); + let subdirectory = directory.replace(new RegExp(`^vendor/|node_modules/`), ''); let extension = path.extname(assetPath); if (!extension) { @@ -1498,7 +1233,7 @@

    lib/broccoli/ember-app.js

    // TODO: refactor, this has gotten very messy. Relevant tests: tests/unit/broccoli/ember-app-test.js let basename = path.basename(assetPath); - if (isType(assetPath, 'js', { registry: this.registry })) { + if (p.isType(assetPath, 'js', { registry: this.registry })) { if (options.using) { if (!Array.isArray(options.using)) { throw new Error('You must pass an array of transformations for `using` option'); @@ -1625,77 +1360,10 @@

    lib/broccoli/ember-app.js

    this.getTests(), this.getExternalTree(), this.getPublic(), - this.getAppJavascript(this._isPackageHookSupplied), + this.getAppJavascript(), ].filter(Boolean); } - _legacyAddonCompile(type, outputDir, _options) { - let options = Object.assign( - { - // moduleNormalizerDisabled: this.options.moduleNormalizerDisabled, - amdFunnelDisabled: this.options.amdFunnelDisabled, - skipTemplates: false, - }, - _options - ); - - let addonBundles = this._cachedAddonBundles[type]; - - let addonTrees = addonBundles.map((addonBundle) => { - let { name, tree, root } = addonBundle; - - let precompiledSource = tree; - - if (!options.amdFunnelDisabled) { - // don't want to double compile the AMD modules - let hasAlreadyPrintedAmdDeprecation; - precompiledSource = new AmdFunnel(precompiledSource, { - callback: () => { - if (!hasAlreadyPrintedAmdDeprecation) { - this.project.ui.writeDeprecateLine( - `Addon "${name}" (found at "${root}") is manually generating AMD modules. Code should be ES6 modules only. Support for this will be removed in a future version.` - ); - hasAlreadyPrintedAmdDeprecation = true; - } - }, - annotation: `AmdFunnel (${type} ${name})`, - }); - } - - return [tree, precompiledSource]; - }); - - let precompiledSource = addonTrees.map((pair) => pair[1]); - addonTrees = addonTrees.map((pair) => pair[0]); - - precompiledSource = mergeTrees(precompiledSource, { - overwrite: true, - annotation: `TreeMerger (${type})`, - }); - - precompiledSource = this._debugTree(precompiledSource, `precompiledAddonTree:${type}`); - - let compiledSource = this._compileAddonTree(precompiledSource, options.skipTemplates); - - compiledSource = this._debugTree(compiledSource, `postcompiledAddonTree:${type}`); - - let combinedAddonTree; - - if (options.amdFunnelDisabled) { - combinedAddonTree = compiledSource; - } else { - combinedAddonTree = mergeTrees(addonTrees.concat(compiledSource), { - overwrite: true, - annotation: `AmdFunnel TreeMerger (${type})`, - }); - } - - return new Funnel(combinedAddonTree, { - destDir: outputDir, - annotation: `Funnel: ${outputDir} ${type}`, - }); - } - _legacyPackage(fullTree) { let javascriptTree = this._defaultPackager.packageJavascript(fullTree); let stylesTree = this._defaultPackager.packageStyles(fullTree); @@ -1725,7 +1393,6 @@

    lib/broccoli/ember-app.js

    */ toTree(additionalTrees) { let packagedTree; - let packageFn = this.options.package; let fullTree = mergeTrees(this.toArray(), { overwrite: true, @@ -1734,20 +1401,12 @@

    lib/broccoli/ember-app.js

    fullTree = this._debugTree(fullTree, 'prepackage'); - if (isExperimentEnabled('PACKAGER')) { - if (this._isPackageHookSupplied) { - packagedTree = packageFn.call(this, fullTree); - } else { - this.project.ui.writeWarnLine('`package` hook must be a function, falling back to default packaging.'); - } - } - if (!packagedTree) { packagedTree = this._legacyPackage(fullTree); } let trees = [].concat(packagedTree, additionalTrees).filter(Boolean); - let combinedPackageTree = new BroccoliMergeTrees(trees); + let combinedPackageTree = broccoliMergeTrees(trees); return this.addonPostprocessTree('all', combinedPackageTree); } diff --git a/api/files/lib_cli_cli.js.html b/api/files/lib_cli_cli.js.html index 57a58ff..a7f54a5 100644 --- a/api/files/lib_cli_cli.js.html +++ b/api/files/lib_cli_cli.js.html @@ -42,7 +42,6 @@

    Classes

  • Builder
  • CLI
  • Command
  • -
  • CommandGenerator
  • DefaultPackager
  • EmberAddon
  • EmberApp
  • @@ -51,10 +50,9 @@

    Classes

  • Instrumentation
  • NodeModulesList
  • NpmTask
  • -
  • PackageCache
  • PackageInfo
  • PackageInfoCache
  • -
  • PrivateTestHelpers
  • +
  • PerBundleAddonCache
  • Project
  • ServeFilesAddon
  • TestsServerAddon
  • @@ -69,7 +67,7 @@

    Classes

    - Version: 3.21.2 + Version: 5.4.0-a905f346b9
    @@ -114,12 +112,6 @@

    lib/cli/cli.js

    */ this.ui = options.ui; - /** - * @private - * @property analytics - */ - this.analytics = options.analytics; - /** * @private * @property testing @@ -189,7 +181,6 @@

    lib/cli/cli.js

    */ let command = new CurrentCommand({ ui: this.ui, - analytics: this.analytics, commands: this._environment.commands, tasks: this._environment.tasks, project: this._environment.project, @@ -231,39 +222,8 @@

    lib/cli/cli.js

    process.env[`EMBER_VERBOSE_${arg.toUpperCase()}`] = 'true'; }); - let platformCheckerToken = heimdall.start('platform-checker'); - - const PlatformChecker = require('../utilities/platform-checker'); - let platform = new PlatformChecker(process.version); - let recommendation = - ' We recommend that you use the most-recent "Active LTS" version of Node.js.' + - ' See https://git.io/v7S5n for details.'; - - if (!this.testing) { - if (platform.isDeprecated) { - this.ui.writeDeprecateLine(`Node ${process.version} is no longer supported by Ember CLI.${recommendation}`); - } - - if (!platform.isTested) { - this.ui.writeWarnLine( - `Node ${process.version} is not tested against Ember CLI on your platform.${recommendation}` - ); - } - } - - platformCheckerToken.stop(); - logger.info('command: %s', commandName); - if (!this.testing) { - process.chdir(environment.project.root); - let skipInstallationCheck = commandArgs.indexOf('--skip-installation-check') !== -1; - if (environment.project.isEmberCLIProject() && !skipInstallationCheck) { - const InstallationChecker = require('../models/installation-checker'); - new InstallationChecker({ project: environment.project }).checkInstallations(); - } - } - let instrumentation = this.instrumentation; let onCommandInterrupt; @@ -361,7 +321,6 @@

    lib/cli/cli.js

    let help = new HelpCommand({ ui: this.ui, - analytics: this.analytics, commands: environment.commands, tasks: environment.tasks, project: environment.project, diff --git a/api/files/lib_debug_assert.js.html b/api/files/lib_debug_assert.js.html new file mode 100644 index 0000000..14a0b27 --- /dev/null +++ b/api/files/lib_debug_assert.js.html @@ -0,0 +1,129 @@ + + + + + lib/debug/assert.js - ember-cli + + + + + + +
    +
    + + +
    +
    +

    lib/debug/assert.js

    +
    + +
    +'use strict';
    +
    +/**
    + * Verify that a certain condition is met, or throw an error if otherwise.
    + *
    + * This is useful for communicating expectations in the code to other human
    + * readers as well as catching bugs that accidentally violate these expectations.
    + *
    + * ```js
    + * const { assert } = require('ember-cli/lib/debug');
    + *
    + * // Test for truthiness:
    + * assert('Must pass a string.', typeof str === 'string');
    + *
    + * // Fail unconditionally:
    + * assert('This code path should never run.');
    + * ```
    + *
    + * @method assert
    + * @param {String} description Describes the condition.
    + * This will become the message of the error thrown if the assertion fails.
    + * @param {Any} condition Must be truthy for the assertion to pass.
    + * If falsy, an error will be thrown.
    + */
    +function assert(description, condition) {
    +  if (!description) {
    +    throw new Error('When calling `assert`, you must provide a description as the first argument.');
    +  }
    +
    +  if (condition) {
    +    return;
    +  }
    +
    +  throw new Error(`ASSERTION FAILED: ${description}`);
    +}
    +
    +module.exports = assert;
    +
    +
    + +
    +
    +
    +
    + + + + + diff --git a/api/files/lib_debug_deprecate.js.html b/api/files/lib_debug_deprecate.js.html new file mode 100644 index 0000000..3de0cdf --- /dev/null +++ b/api/files/lib_debug_deprecate.js.html @@ -0,0 +1,203 @@ + + + + + lib/debug/deprecate.js - ember-cli + + + + + + +
    +
    + + +
    +
    +

    lib/debug/deprecate.js

    +
    + +
    +'use strict';
    +
    +const chalk = require('chalk');
    +const semver = require('semver');
    +const assert = require('./assert');
    +
    +/**
    + * Display a deprecation message.
    + *
    + * ```js
    + * const { deprecate } = require('ember-cli/lib/debug');
    + *
    + * deprecate('The `foo` method is deprecated.', false, {
    + *   for: 'ember-cli',
    + *   id: 'ember-cli.foo-method',
    + *   since: {
    + *     available: '4.1.0',
    + *     enabled: '4.2.0',
    + *   },
    + *   until: '5.0.0',
    + *   url: 'https://example.com',
    + * });
    + * ```
    + *
    + * @method deprecate
    + * @param {String} description Describes the deprecation.
    + * @param {Any} condition If falsy, the deprecation message will be displayed.
    + * @param {Object} options An object including the deprecation's details:
    + * - `for` The library that the deprecation is for
    + * - `id` The deprecation's unique id
    + * - `since.available` A SemVer version indicating when the deprecation was made available
    + * - `since.enabled` A SemVer version indicating when the deprecation was enabled
    + * - `until` A SemVer version indicating until when the deprecation will be active
    + * - `url` A URL that refers to additional information about the deprecation
    + */
    +function deprecate(description, condition, options) {
    +  assert('When calling `deprecate`, you must provide a description as the first argument.', description);
    +  assert('When calling `deprecate`, you must provide a condition as the second argument.', arguments.length > 1);
    +
    +  assert(
    +    'When calling `deprecate`, you must provide an options object as the third argument. The options object must include the `for`, `id`, `since` and `until` options (`url` is optional).',
    +    options
    +  );
    +
    +  assert('When calling `deprecate`, you must provide the `for` option.', options.for);
    +  assert('When calling `deprecate`, you must provide the `id` option.', options.id);
    +
    +  assert(
    +    'When calling `deprecate`, you must provide the `since` option. `since` must include the `available` and/or the `enabled` option.',
    +    options.since
    +  );
    +
    +  assert(
    +    'When calling `deprecate`, you must provide the `since.available` and/or the `since.enabled` option.',
    +    options.since.available || options.since.enabled
    +  );
    +
    +  assert(
    +    '`since.available` must be a valid SemVer version.',
    +    !options.since.available || isSemVer(options.since.available)
    +  );
    +
    +  assert('`since.enabled` must be a valid SemVer version.', !options.since.enabled || isSemVer(options.since.enabled));
    +
    +  assert(
    +    'When calling `deprecate`, you must provide a valid SemVer version for the `until` option.',
    +    isSemVer(options.until)
    +  );
    +
    +  if (condition) {
    +    return;
    +  }
    +
    +  let message = formatMessage(description, options);
    +
    +  warn(message);
    +  warn(getStackTrace());
    +
    +  // Return the message for testing purposes.
    +  // This can be removed once we can register deprecation handlers.
    +  return message;
    +}
    +
    +function isSemVer(version) {
    +  return semver.valid(version) !== null;
    +}
    +
    +function formatMessage(description, options) {
    +  let message = [`DEPRECATION: ${description}`, `[ID: ${options.id}]`];
    +
    +  if (options.url) {
    +    message.push(`See ${options.url} for more details.`);
    +  }
    +
    +  return message.join(' ');
    +}
    +
    +function getStackTrace() {
    +  let error = new Error();
    +  let lines = error.stack.split('\n');
    +
    +  lines.shift(); // Remove the word `Error`.
    +
    +  return lines.map((line) => line.trim()).join('\n');
    +}
    +
    +function warn(message) {
    +  console.warn(chalk.yellow(message));
    +}
    +
    +module.exports = deprecate;
    +
    +
    + +
    +
    +
    +
    + + + + + diff --git a/api/files/lib_models_addon-info.js.html b/api/files/lib_models_addon-info.js.html index 96432b3..9e1f2b4 100644 --- a/api/files/lib_models_addon-info.js.html +++ b/api/files/lib_models_addon-info.js.html @@ -42,7 +42,6 @@

    Classes

  • Builder
  • CLI
  • Command
  • -
  • CommandGenerator
  • DefaultPackager
  • EmberAddon
  • EmberApp
  • @@ -51,10 +50,9 @@

    Classes

  • Instrumentation
  • NodeModulesList
  • NpmTask
  • -
  • PackageCache
  • PackageInfo
  • PackageInfoCache
  • -
  • PrivateTestHelpers
  • +
  • PerBundleAddonCache
  • Project
  • ServeFilesAddon
  • TestsServerAddon
  • @@ -69,7 +67,7 @@

    Classes

    - Version: 3.21.2 + Version: 5.4.0-a905f346b9
    diff --git a/api/files/lib_models_addon.js.html b/api/files/lib_models_addon.js.html index f1152ed..5680027 100644 --- a/api/files/lib_models_addon.js.html +++ b/api/files/lib_models_addon.js.html @@ -42,7 +42,6 @@

    Classes

  • Builder
  • CLI
  • Command
  • -
  • CommandGenerator
  • DefaultPackager
  • EmberAddon
  • EmberApp
  • @@ -51,10 +50,9 @@

    Classes

  • Instrumentation
  • NodeModulesList
  • NpmTask
  • -
  • PackageCache
  • PackageInfo
  • PackageInfoCache
  • -
  • PrivateTestHelpers
  • +
  • PerBundleAddonCache
  • Project
  • ServeFilesAddon
  • TestsServerAddon
  • @@ -69,7 +67,7 @@

    Classes

    - Version: 3.21.2 + Version: 5.4.0-a905f346b9
    @@ -109,18 +107,12 @@

    lib/models/addon.js

    const Funnel = require('broccoli-funnel'); const walkSync = require('walk-sync'); const ensurePosixPath = require('ensure-posix-path'); -const defaultsDeep = require('ember-cli-lodash-subset').defaultsDeep; -const findAddonByName = require('../utilities/find-addon-by-name'); +const { defaultsDeep } = require('ember-cli-lodash-subset'); const heimdall = require('heimdalljs'); const calculateCacheKeyForTree = require('calculate-cache-key-for-tree'); const addonProcessTree = require('../utilities/addon-process-tree'); -const emberCLIBabelConfigKey = require('../utilities/ember-cli-babel-config-key'); -const semver = require('semver'); -const processModulesOnly = require('../broccoli/babel-process-modules-only'); const registryHasPreprocessor = require('../utilities/registry-has-preprocessor'); -const BUILD_BABEL_OPTIONS_FOR_PREPROCESSORS = Symbol('BUILD_BABEL_OPTIONS_FOR_PREPROCESSORS'); - if (!heimdall.hasMonitor('addon-tree-cache')) { heimdall.registerMonitor('addon-tree-cache', function AddonTreeCacheSchema() { this.hits = 0; @@ -207,15 +199,6 @@

    lib/models/addon.js

    ADDON_TREE_CACHE.clear(); } -function warn(message) { - if (this.ui) { - this.ui.writeDeprecateLine(message); - } else { - const chalk = require('chalk'); - console.log(chalk.yellow(`DEPRECATION: ${message}`)); - } -} - /** Root class for an Addon. If your addon module exports an Object this will be extended from this base class. If you export a constructor (function), @@ -399,27 +382,19 @@

    lib/models/addon.js

    this._packageInfo = this.packageInfoCache.loadAddon(this); - // force us to use the real path as the root. - this.root = this._packageInfo.realPath; - p.setupRegistry(this); this._initDefaultBabelOptions(); }, _initDefaultBabelOptions() { - this.__originalOptions = this.options = defaultsDeep(this.options, { - babel: this[BUILD_BABEL_OPTIONS_FOR_PREPROCESSORS](), + this.options = defaultsDeep(this.options, { + babel: {}, }); - let defaultEmberCLIBabelOptions = { + this.options['ember-cli-babel'] = defaultsDeep(this.options['ember-cli-babel'], { compileModules: true, - }; - let emberCLIBabelConfigKey = this._emberCLIBabelConfigKey(); - this.__originalOptions[emberCLIBabelConfigKey] = this.options[emberCLIBabelConfigKey] = defaultsDeep( - this.options[emberCLIBabelConfigKey], - defaultEmberCLIBabelOptions - ); + }); }, /** @@ -494,16 +469,14 @@

    lib/models/addon.js

    return true; } - // Addon names in index.js and package.json should be the same at all times whether they have scope or not. + // Addon names in index.js and package.json must be the same at all times whether they have scope or not. if (this.root === this.parent.root) { - if (parentName !== this.name && !process.env.EMBER_CLI_IGNORE_ADDON_NAME_MISMATCH) { + if (parentName !== this.name) { let pathToDisplay = process.cwd() === this.root ? process.cwd() : path.relative(process.cwd(), this.root); throw new SilentError( - 'ember-cli: Your names in package.json and index.js should match. ' + - `The addon in ${pathToDisplay} currently have '${parentName}' in package.json and '${this.name}' in index.js. ` + - 'Until ember-cli v3.9, this error can be disabled by setting env variable EMBER_CLI_IGNORE_ADDON_NAME_MISMATCH to "true". ' + - 'For more information about this workaround, see: https://github.com/ember-cli/ember-cli/pull/7950.' + 'ember-cli: Your names in package.json and index.js must match. ' + + `The addon in ${pathToDisplay} currently has '${parentName}' in package.json and '${this.name}' in index.js.` ); } @@ -526,7 +499,10 @@

    lib/models/addon.js

    * @method discoverAddons */ discoverAddons() { - let pkgInfo = this.packageInfoCache.getEntry(this.root); + // prefer `packageRoot`, fallback to `root`; this is to maintain backwards compatibility for + // consumers who create a new instance of the base addon model class directly and don't set + // `packageRoot` + let pkgInfo = this.packageInfoCache.getEntry(this.packageRoot || this.root); if (pkgInfo) { let addonPackageList = pkgInfo.discoverAddonAddons(); @@ -629,8 +605,8 @@

    lib/models/addon.js

    let tree; if (!this.project) { - this._warn( - `Addon: \`${this.name}\` is missing addon.project, this may be the result of an addon forgetting to invoke \`super\` in its init.` + throw new SilentError( + `Addon \`${this.name}\` is missing \`addon.project\`. This may be the result of an addon forgetting to invoke \`super\` in its init hook.` ); } // TODO: fix law of demeter `_watchmanInfo.canNestRoots` is obviously a poor idea @@ -653,18 +629,6 @@

    lib/models/addon.js

    return ensurePosixPath(normalizedAbsoluteTreePath); }, - /** - * @private - * @method _warn - */ - _warn: warn, - - _emberCLIBabelConfigKey() { - let emberCLIBabelInstance = findAddonByName(this.addons, 'ember-cli-babel'); - - return emberCLIBabelConfigKey(emberCLIBabelInstance); - }, - /** Returns a given type of tree (if present), merged with the application tree. For each of the trees available using this @@ -918,15 +882,12 @@

    lib/models/addon.js

    @example ```js treeForAddon() { - var tree = this._super.treeForAddon.apply(this, arguments); - var checker = new VersionChecker(this); - var isOldEmber = checker.for('ember', 'bower').lt('1.13.0'); + let emberVersion = new VersionChecker(this.project).for('ember-source'); + let shouldUsePolyfill = emberVersion.lt('4.5.0-alpha.4'); - if (isOldEmber) { - tree = new Funnel(tree, { exclude: [ /instance-initializers/ ] }); + if (shouldUsePolyfill) { + return this._super.treeForAddon.apply(this, arguments); } - - return tree; } ``` */ @@ -1026,17 +987,16 @@

    lib/models/addon.js

    if (registryHasPreprocessor(this.registry, 'js')) { return this.preprocessJs(namespacedTree, '/', this.name, { registry: this.registry, + treeType: 'addon-test-support', }); - } else { - this._warn( - `Addon test support files were detected in \`${this._treePathFor('addon-test-support')}\`, but no JavaScript ` + - `preprocessors were found for \`${this.name}\`. Please make sure to add a preprocessor ` + - `(most likely \`ember-cli-babel\`) to \`dependencies\` (NOT \`devDependencies\`) in ` + - `\`${this.name}\`'s \`package.json\`.` - ); - - return processModulesOnly(namespacedTree, `Babel Fallback - Addon#treeForAddonTestSupport (${this.name})`); } + + throw new SilentError( + `Addon test-support files were detected in \`${this._treePathFor('addon-test-support')}\`, but no JavaScript ` + + `preprocessor was found for \`${this.name}\`. Please make sure to add a preprocessor ` + + `(most likely \`ember-cli-babel\`) to \`dependencies\` (NOT \`devDependencies\`) in ` + + `\`${this.name}\`'s \`package.json\`.` + ); }, /** @@ -1054,6 +1014,7 @@

    lib/models/addon.js

    let processedStylesTree = preprocessCss(preprocessedStylesTree, '/', '/', { outputPaths: { addon: `${this.name}.css` }, registry: this.registry, + treeType: 'addon-styles', }); processedStylesTree = new Funnel(processedStylesTree, { destDir: `${this.name}/__COMPILED_STYLES__`, @@ -1065,7 +1026,7 @@

    lib/models/addon.js

    /** Looks in the addon/ and addon/templates trees to determine if template files - exists that need to be precompiled. + exist that need to be precompiled. This is executed once when building, but not on rebuilds. @@ -1079,7 +1040,7 @@

    lib/models/addon.js

    /** Looks in the addon/ and addon/templates trees to determine if template files - exists in the pods format that need to be precompiled. + exist in the pods format that need to be precompiled. This is executed once when building, but not on rebuilds. @@ -1108,7 +1069,7 @@

    lib/models/addon.js

    addonTemplatesTreeInAddonTree && addonTemplatesTreePath.replace(`${addonTreePath}/`, ''); let podTemplateMatcher = new RegExp(`template.(${templateExtensions.join('|')})$`); let hasPodTemplates = files.some((file) => { - // short circuit if this is actually a `addon/templates` file + // short circuit if this is actually an `addon/templates` file if (addonTemplatesTreeInAddonTree && file.indexOf(addonTemplatesRelativeToAddonPath) === 0) { return false; } @@ -1218,6 +1179,7 @@

    lib/models/addon.js

    let processedTemplateTree = preprocessTemplates(preprocessedTemplateTree, { annotation: `compileTemplates(${this.name})`, registry: this.registry, + treeType: 'addon-templates', }); let postprocessedTemplateTree = this._addonPostprocessTree('template', processedTemplateTree); @@ -1238,37 +1200,27 @@

    lib/models/addon.js

    */ compileAddon(tree) { if (!this.options) { - this._warn( + throw new SilentError( `Ember CLI addons manage their own module transpilation during the \`treeForAddon\` processing. ` + `\`${this.name}\` (found at \`${this.root}\`) has removed \`this.options\` ` + - `which conflicts with the addons ability to transpile its \`addon/\` files properly. ` + - `Falling back to default babel configuration options.` + `which conflicts with the addons ability to transpile its \`addon/\` files properly.` ); - - this.options = {}; } if (!this.options.babel) { - this._warn( + throw new SilentError( `Ember CLI addons manage their own module transpilation during the \`treeForAddon\` processing. ` + - `\`${this.name}\` (found at \`${this.root}\`) has overridden the \`this.options.babel\` ` + - `options which conflicts with the addons ability to transpile its \`addon/\` files properly. ` + - `Falling back to default babel configuration options.` + `\`${this.name}\` (found at \`${this.root}\`) has overridden the \`this.options.babel\` options ` + + `which conflicts with the addons ability to transpile its \`addon/\` files properly.` ); - - this.options.babel = this.__originalOptions.babel; } - let emberCLIBabelConfigKey = this._emberCLIBabelConfigKey(); - if (!this.options[emberCLIBabelConfigKey]) { - this._warn( + if (!this.options['ember-cli-babel']) { + throw new SilentError( `Ember CLI addons manage their own module transpilation during the \`treeForAddon\` processing. ` + - `\`${this.name}\` (found at \`${this.root}\`) has overridden the \`this.options.${emberCLIBabelConfigKey}\` ` + - `options which conflicts with the addons ability to transpile its \`addon/\` files properly. ` + - `Falling back to default babel configuration options.` + `\`${this.name}\` (found at \`${this.root}\`) has overridden the \`this.options['ember-cli-babel']\` options ` + + `which conflicts with the addons ability to transpile its \`addon/\` files properly.` ); - - this.options[emberCLIBabelConfigKey] = this.__originalOptions[emberCLIBabelConfigKey]; } let scopedInput = new Funnel(tree, { @@ -1283,7 +1235,7 @@

    lib/models/addon.js

    }, /** - Returns a tree with JSHhint output for all addon JS. + Returns a tree with JSHint output for all addon JS. @private @method jshintAddonTree @@ -1348,23 +1300,6 @@

    lib/models/addon.js

    }); }, - /** - Returns a tree containing the addon's js files - - @private - @deprecated - @method addonJsFiles - @return {Tree} The filtered addon js files - */ - addonJsFiles(tree) { - this._warn(`Addon.prototype.addonJsFiles is deprecated`); - - return new Funnel(tree, { - destDir: this.moduleName(), - annotation: 'Funnel: Addon JS', - }); - }, - /** Preprocesses a javascript tree. @@ -1390,25 +1325,19 @@

    lib/models/addon.js

    let processedAddonJS = this.preprocessJs(preprocessedAddonJS, '/', this.name, { annotation: `processedAddonJsFiles(${this.name})`, registry: this.registry, + treeType: 'addon', }); - let postprocessedAddonJs = this._addonPostprocessTree('js', processedAddonJS); - - if (!registryHasPreprocessor(this.registry, 'js')) { - this._warn( - `Addon files were detected in \`${this._treePathFor('addon')}\`, but no JavaScript ` + - `preprocessors were found for \`${this.name}\`. Please make sure to add a preprocessor ` + - '(most likely `ember-cli-babel`) to in `dependencies` (NOT `devDependencies`) in ' + - `\`${this.name}\`'s \`package.json\`.` - ); - - postprocessedAddonJs = processModulesOnly( - postprocessedAddonJs, - `Babel Fallback - Addon#processedAddonJsFiles(${this.name})` - ); + if (registryHasPreprocessor(this.registry, 'js')) { + return this._addonPostprocessTree('js', processedAddonJS); } - return postprocessedAddonJs; + throw new SilentError( + `Addon files were detected in \`${this._treePathFor('addon')}\`, but no JavaScript ` + + `preprocessor was found for \`${this.name}\`. Please make sure to add a preprocessor ` + + '(most likely `ember-cli-babel`) to `dependencies` (NOT `devDependencies`) in ' + + `\`${this.name}\`'s \`package.json\`.` + ); }, /** @@ -1445,7 +1374,7 @@

    lib/models/addon.js

    }, /** - Augments the applications configuration settings. + Augments the application's configuration settings. Object returned from this hook is merged with the application's configuration object. @@ -1455,7 +1384,6 @@

    lib/models/addon.js

    - Modifying configuration options (see list of defaults [here](https://github.com/ember-cli/ember-cli/blob/v2.4.3/lib/broccoli/ember-app.js#L163)) - For example - - `minifyJS` - `storeConfigInMeta` - et, al @@ -1827,24 +1755,6 @@

    lib/models/addon.js

    let Addon = CoreObject.extend(addonProto); -Addon.prototype[BUILD_BABEL_OPTIONS_FOR_PREPROCESSORS] = function () { - let emberCLIBabelInstance = findAddonByName(this.addons, 'ember-cli-babel'); - let version; - if (emberCLIBabelInstance) { - version = require(path.join(emberCLIBabelInstance.root, 'package')).version; - } - - if (version && semver.satisfies(version, '^5')) { - return { - modules: 'amdStrict', - moduleIds: true, - resolveModuleSource: require('amd-name-resolver').moduleResolve, - }; - } else { - return {}; - } -}; - module.exports = Addon; module.exports._resetTreeCache = _resetTreeCache; module.exports._treeCache = ADDON_TREE_CACHE; diff --git a/api/files/lib_models_blueprint.js.html b/api/files/lib_models_blueprint.js.html index 5e18238..c3439ba 100644 --- a/api/files/lib_models_blueprint.js.html +++ b/api/files/lib_models_blueprint.js.html @@ -42,7 +42,6 @@

    Classes

  • Builder
  • CLI
  • Command
  • -
  • CommandGenerator
  • DefaultPackager
  • EmberAddon
  • EmberApp
  • @@ -51,10 +50,9 @@

    Classes

  • Instrumentation
  • NodeModulesList
  • NpmTask
  • -
  • PackageCache
  • PackageInfo
  • PackageInfoCache
  • -
  • PrivateTestHelpers
  • +
  • PerBundleAddonCache
  • Project
  • ServeFilesAddon
  • TestsServerAddon
  • @@ -69,7 +67,7 @@

    Classes

    - Version: 3.21.2 + Version: 5.4.0-a905f346b9
    @@ -97,12 +95,11 @@

    lib/models/blueprint.js

    const minimatch = require('minimatch'); const path = require('path'); const stringUtils = require('ember-cli-string-utils'); -const _ = require('ember-cli-lodash-subset'); +const { merge, zipObject, intersection, cloneDeep, compact, uniq } = require('ember-cli-lodash-subset'); const walkSync = require('walk-sync'); const SilentError = require('silent-error'); const CoreObject = require('core-object'); const EOL = require('os').EOL; -const bowEpParser = require('bower-endpoint-parser'); const logger = require('heimdalljs-logger')('ember-cli:blueprint'); const normalizeEntityName = require('ember-cli-normalize-entity-name'); const isAddon = require('../utilities/is-addon'); @@ -270,6 +267,7 @@

    lib/models/blueprint.js

    @constructor @extends CoreObject @param {String} [blueprintPath] + @param {Object} [blueprintOptions] */ let Blueprint = CoreObject.extend({ availableOptions: [], @@ -277,11 +275,41 @@

    lib/models/blueprint.js

    _printableProperties: ['name', 'description', 'availableOptions', 'anonymousOptions', 'overridden'], - init(blueprintPath) { + /** + Indicates whether or not a blueprint is a candidate for automatic transpilation from TS to JS. + This property could be false in the case that the blueprint is written in JS and is not intended + to work with TS at all, OR in the case that the blueprint is written in TS and the author does + not intend to support transpilation to JS. + + @public + @property shouldTransformTypeScript + @type Boolean + */ + shouldTransformTypeScript: false, + + init(blueprintPath, blueprintOptions) { this._super(); this.path = blueprintPath; this.name = path.basename(blueprintPath); + + this._processOptions(blueprintOptions); + }, + + /** + Process the options object coming from either + the `init`, `install` or `uninstall` hook. + + @private + @method _processOptions + @param {Object} options + */ + _processOptions(options = {}) { + this.options = options; + this.dryRun = options.dryRun; + this.pod = options.pod; + this.project = options.project; + this.ui = options.ui; }, /** @@ -306,9 +334,10 @@

    lib/models/blueprint.js

    @public @method files + @param {Object} options @return {Array} Contents of the blueprint's files directory */ - files() { + files(/* options */) { if (this._files) { return this._files; } @@ -511,29 +540,100 @@

    lib/models/blueprint.js

    let fileInfos = await process.call(this, intoDir, locals); // commit changes for each FileInfo (with prompting as needed) - await Promise.all(fileInfos.map((fi) => this._commit(fi))); + await Promise.all(fileInfos.map((info) => this._commit(info))); // run afterInstall/afterUninstall userland hooks await afterHook.call(this, options); }, + /** + @private + @method shouldConvertToJS + @param {Object} options + @param {FileInfo} fileInfo + @return {Boolean} + */ + shouldConvertToJS(options, fileInfo) { + // If this isn't turned on, it doesn't matter what else was passed, we're not touching it. + if (!this.shouldTransformTypeScript) { + return false; + } + + // If the blueprint isn't a TS file to begin with, there's nothing to convert. + if (!isTypeScriptFile(fileInfo.outputPath)) { + // If the user wants TypeScript output but there is no TypeScript blueprint available, we want + // to warn them that they're not going to get what they're expecting while still at least giving + // them the JS output. We check for this *after* checking `shouldTranformTypeScript` because + // it's possible for people to set `{typescript: true}` in their `.ember-cli` file, which would + // then erroneously trigger this message every time they generate a JS blueprint even though + // they didn't pass the flag. + if (options.typescript === true && isJavaScriptFile(fileInfo.outputPath)) { + this.ui.writeLine( + chalk.yellow( + "You passed the '--typescript' flag but there is no TypeScript blueprint available. " + + 'A JavaScript blueprint will be generated instead.' + ) + ); + } + + return false; + } + + // Indicates when the user explicitly passed either `--typescript` or `--no-typescript` as opposed + // to not passing a flag at all and allowing for default behavior + const userExplicitlySelectedTypeScriptStatus = options.typescript !== undefined; + + // Indicates when the user has asked for TypeScript either globally (by setting + // `isTypeScriptProject` to true) or locally (by passing the `--typescript` flag when they + // invoked the generator). Although ember-cli merges `.ember-cli` and all of the flag values into + // one object, we thought the DX would be improved by differentiating between what is intended + // to be global vs. local config. + const shouldUseTypeScript = userExplicitlySelectedTypeScriptStatus + ? options.typescript + : options.isTypeScriptProject; + + // if the user wants TS output and we have a TS file available, we do *not* want to downlevel to JS + if (shouldUseTypeScript) { + return false; + } + + return true; + }, + + /** + @private + @method convertToJS + @param {FileInfo} fileInfo + @return {Promise} + */ + async convertToJS(fileInfo) { + let rendered = await fileInfo.render(); + + const { removeTypes } = require('remove-types'); + const transformed = await removeTypes(rendered); + + fileInfo.rendered = transformed; + + fileInfo.displayPath = replaceExtension(fileInfo.displayPath, '.js'); + fileInfo.outputPath = replaceExtension(fileInfo.outputPath, '.js'); + + return fileInfo; + }, + /** @method install @param {Object} options @return {Promise} */ install(options) { - let ui = (this.ui = options.ui); - let dryRun = (this.dryRun = options.dryRun); - this.project = options.project; - this.pod = options.pod; - this.options = options; - this.hasPathToken = hasPathToken(this.files()); + this._processOptions(options); - ui.writeLine(`installing ${this.name}`); + this.hasPathToken = hasPathToken(this.files(this.options)); - if (dryRun) { - ui.writeLine(chalk.yellow('You specified the dry-run flag, so no' + ' changes will be written.')); + this.ui.writeLine(`installing ${this.name}`); + + if (this.dryRun) { + this.ui.writeLine(chalk.yellow('You specified the `dry-run` flag, so no changes will be written.')); } this._normalizeEntityName(options.entity); @@ -553,17 +653,14 @@

    lib/models/blueprint.js

    @return {Promise} */ uninstall(options) { - let ui = (this.ui = options.ui); - let dryRun = (this.dryRun = options.dryRun); - this.project = options.project; - this.pod = options.pod; - this.options = options; - this.hasPathToken = hasPathToken(this.files()); + this._processOptions(options); + + this.hasPathToken = hasPathToken(this.files(this.options)); - ui.writeLine(`uninstalling ${this.name}`); + this.ui.writeLine(`uninstalling ${this.name}`); - if (dryRun) { - ui.writeLine(chalk.yellow('You specified the dry-run flag, so no' + ' files will be deleted.')); + if (this.dryRun) { + this.ui.writeLine(chalk.yellow('You specified the `dry-run` flag, so no files will be deleted.')); } this._normalizeEntityName(options.entity); @@ -718,7 +815,7 @@

    lib/models/blueprint.js

    }; let customTokens = this.fileMapTokens(options) || options.fileMapTokens || {}; - return _.merge(standardTokens, customTokens); + return merge(standardTokens, customTokens); }, /** @@ -730,10 +827,10 @@

    lib/models/blueprint.js

    */ generateFileMap(fileMapVariables) { let tokens = this._fileMapTokens(fileMapVariables); - let fileMapValues = _.values(tokens); + let fileMapValues = Object.values(tokens); let tokenValues = fileMapValues.map((token) => token(fileMapVariables)); let tokenKeys = Object.keys(tokens); - return _.zipObject(tokenKeys, tokenValues); + return zipObject(tokenKeys, tokenValues); }, /** @@ -799,10 +896,10 @@

    lib/models/blueprint.js

    @return {Array} files */ _getFilesForInstall(targetFiles) { - let files = this.files(); + let files = this.files(this.options); // if we've defined targetFiles, get file info on ones that match - return (targetFiles && targetFiles.length > 0 && _.intersection(files, targetFiles)) || files; + return (targetFiles && targetFiles.length > 0 && intersection(files, targetFiles)) || files; }, /** @@ -838,6 +935,17 @@

    lib/models/blueprint.js

    return Promise.all(fileInfos.filter(isValidFile).map(prepareConfirm)) .then(finishProcessingForInstall) + .then((fileInfos) => { + return Promise.all( + fileInfos.map((info) => { + if (this.shouldConvertToJS(this.options, info)) { + return this.convertToJS(info); + } + + return info; + }) + ); + }) .then((fileInfos) => fileInfos.concat(fileInfosToRemove)); }, @@ -847,11 +955,49 @@

    lib/models/blueprint.js

    @param {Object} templateVariables */ processFilesForUninstall(intoDir, templateVariables) { - let fileInfos = this._getFileInfos(this.files(), intoDir, templateVariables); + let fileInfos = this._getFileInfos(this.files(this.options), intoDir, templateVariables); this._ignoreUpdateFiles(); - return finishProcessingForUninstall(fileInfos.filter(isValidFile)); + fileInfos = fileInfos.filter(isValidFile).reduce((acc, info) => { + // if it's possible that this blueprint could have produced either typescript OR javascript, we have to do some + // work to figure out which files to delete. + if (this.shouldTransformTypeScript) { + if (this.options.typescript === true) { + // if the user explicitly passed `--typescript`, we only want to delete TS files, so we stick with the existing + // info object since it will contain a .ts outputPath (since we know this blueprint is authored in TS because + // of our check above) + acc.push(info); + return acc; + } + + const jsInfo = new FileInfo({ + ...info, + outputPath: replaceExtension(info.outputPath, '.js'), + displayPath: replaceExtension(info.displayPath, '.js'), + }); + + if (this.options.typescript === false) { + // if the user explicitly passed `--no-typescript`, we only want to delete JS file, so we return our newly + // created jsInfo object since it contains the javascript version of the output path. + acc.push(jsInfo); + return acc; + } + + if (this.options.typescript === undefined) { + // if the user didn't specify one way or the other, then both the JS and TS paths are possibilities, so we add + // both of them to the list. `finishProcessingForUninstall` will actually look to see which of them exists and + // delete whatever it finds. + acc.push(info, jsInfo); + return acc; + } + } + + acc.push(info); + return acc; + }, []); + + return finishProcessingForUninstall(fileInfos); }, /** @@ -880,7 +1026,7 @@

    lib/models/blueprint.js

    @return {Boolean} */ supportsAddon() { - return /__root__/.test(this.files().join()); + return /__root__/.test(this.files(this.options).join()); }, /** @@ -942,7 +1088,7 @@

    lib/models/blueprint.js

    rawArgs: options.rawArgs, }; - return _.merge({}, standardLocals, customLocals); + return merge({}, standardLocals, customLocals); }); }, @@ -1075,73 +1221,6 @@

    lib/models/blueprint.js

    }); }, - /** - Used to add a package to the projects `bower.json`. - - Generally, this would be done from the `afterInstall` hook, to - ensure that a package that is required by a given blueprint is - available. - - `localPackageName` and `target` may be thought of as equivalent - to the key-value pairs in the `dependency` or `devDepencency` - objects contained within a bower.json file. - @method addBowerPackageToProject - @param {String} localPackageName - @param {String} target - @param {Object} installOptions - @return {Promise} - - @example - ```js - addBowerPackageToProject('jquery', '~1.11.1'); - addBowerPackageToProject('old_jquery', 'jquery#~1.9.1'); - addBowerPackageToProject('bootstrap-3', 'https://twitter.github.io/bootstrap/assets/bootstrap'); - ``` - */ - addBowerPackageToProject(localPackageName, target, installOptions) { - let lpn = localPackageName; - let tar = target; - let packageObject = bowEpParser.json2decomposed(lpn, tar); - return this.addBowerPackagesToProject([packageObject], installOptions); - }, - - /** - Used to add an array of packages to the projects `bower.json`. - - Generally, this would be done from the `afterInstall` hook, to - ensure that a package that is required by a given blueprint is - available. - - Expects each array item to be an object with a `name`. Each object - may optionally have a `target` to specify a specific version, or a - `source` to specify a non-local name to be resolved. - - @method addBowerPackagesToProject - @param {Array} packages - @param {Object} installOptions - @return {Promise} - */ - addBowerPackagesToProject(packages, installOptions) { - let task = this.taskFor('bower-install'); - let installText = packages.length > 1 ? 'install bower packages' : 'install bower package'; - let packageNames = []; - let packageNamesAndVersions = packages - .map((pkg) => { - pkg.source = pkg.source || pkg.name; - packageNames.push(pkg.name); - return pkg; - }) - .map(bowEpParser.compose); - - this._writeStatusToUI(chalk.green, installText, packageNames.join(', ')); - - return task.run({ - verbose: true, - packages: packageNamesAndVersions, - installOptions: installOptions || { save: true }, - }); - }, - /** Used to add an addon to the project's `package.json` and run it's `defaultBlueprint` if it provides one. @@ -1205,12 +1284,43 @@

    lib/models/blueprint.js

    let installText = packages.length > 1 ? 'install addons' : 'install addon'; this._writeStatusToUI(chalk.green, installText, taskOptions['packages'].join(', ')); - return this.taskFor('addon-install').run(taskOptions); + let previousCwd; + if (!this.project.isEmberCLIProject()) { + // our blueprint ran *outside* an ember-cli project. So the only way this + // makes sense if the blueprint generated a new project, which we're now + // ready to add some addons into. So we need to switch from "outside" mode + // to "inside" by reinitializing the Project. + // + // One might think the cache clear is unnecessary, because in theory the + // caches should be shareable, but in practice the new Project we create + // below will have the same root dir as the NullProject and that makes bad + // things happen. + this.project.packageInfoCache._clear(); + const Project = require('../../lib/models/project'); + this.project = taskOptions.blueprintOptions.project = Project.closestSync( + options.blueprintOptions.target, + this.project.ui, + this.project.cli + ); + + // The install task adds dependencies based on the current working directory. + // But in case we created the new project by calling the blueprint with a custom target directory (options.target), + // the current directory will *not* be the one the project is created in, so we must adjust this here. + previousCwd = process.cwd(); + process.chdir(options.blueprintOptions.target); + } + + let result = this.taskFor('addon-install').run(taskOptions); + if (previousCwd) { + return result.then(() => process.chdir(previousCwd)); + } + + return result; }, /** Used to retrieve a task with the given name. Passes the new task - the standard information available (like `ui`, `analytics`, `project`, etc). + the standard information available (like `ui`, `project`, etc). @method taskFor @param dasherizedName @@ -1222,7 +1332,6 @@

    lib/models/blueprint.js

    return new Task({ ui: this.ui, project: this.project, - analytics: this.analytics, }); }, @@ -1243,13 +1352,13 @@

    lib/models/blueprint.js

    Example: ``` // app/router.js - Router.map(function() { + Router.map(function () { }); ``` ``` insertIntoFile('app/router.js', ' this.route("admin");', { - after: 'Router.map(function() {' + EOL + after: 'Router.map(function () {' + EOL }).then(function() { // file has been inserted into! }); @@ -1259,7 +1368,7 @@

    lib/models/blueprint.js

    ``` // app/router.js - Router.map(function() { + Router.map(function () { this.route("admin"); }); ``` @@ -1310,7 +1419,7 @@

    lib/models/blueprint.js

    this._printableProperties.forEach((key) => { let value = this[key]; if (key === 'availableOptions') { - value = _.cloneDeep(value); + value = cloneDeep(value); value.forEach((option) => { if (typeof option.type === 'function') { option.type = option.type.name; @@ -1356,6 +1465,8 @@

    lib/models/blueprint.js

    @param {Array} [options.paths] Extra paths to search for blueprints @param {Boolean} [options.ignoreMissing] Throw a `SilentError` if a matching Blueprint could not be found + @param {Object} [options.blueprintOptions] Options object that will be passed + along to the Blueprint instance on creation. @return {Blueprint} */ Blueprint.lookup = function (name, options) { @@ -1368,7 +1479,16 @@

    lib/models/blueprint.js

    let blueprintPath = path.resolve(lookupPath, name); if (Blueprint._existsSync(blueprintPath)) { - return Blueprint.load(blueprintPath); + return Blueprint.load(blueprintPath, options.blueprintOptions); + } + } + + // Check if `name` itself is a path to a blueprint: + if (name.includes(path.sep)) { + let blueprintPath = path.resolve(name); + + if (Blueprint._existsSync(blueprintPath)) { + return Blueprint.load(blueprintPath, options.blueprintOptions); } } @@ -1383,9 +1503,10 @@

    lib/models/blueprint.js

    @method load @namespace Blueprint @param {String} blueprintPath + @param {Object} [blueprintOptions] @return {Blueprint} blueprint instance */ -Blueprint.load = function (blueprintPath) { +Blueprint.load = function (blueprintPath, blueprintOptions) { if (fs.lstatSync(blueprintPath).isDirectory()) { let Constructor = Blueprint; @@ -1400,7 +1521,7 @@

    lib/models/blueprint.js

    } } - return new Constructor(blueprintPath); + return new Constructor(blueprintPath, blueprintOptions); } }; @@ -1431,7 +1552,7 @@

    lib/models/blueprint.js

    let blueprint = Blueprint.load(blueprintPath); if (blueprint) { let name = blueprint.name; - blueprint.overridden = _.includes(seen, name); + blueprint.overridden = seen.includes(name); seen.push(name); return blueprint; @@ -1440,7 +1561,7 @@

    lib/models/blueprint.js

    return { source, - blueprints: _.compact(blueprints), + blueprints: compact(blueprints), }; }); }; @@ -1559,7 +1680,7 @@

    lib/models/blueprint.js

    function generateLookupPaths(lookupPaths) { lookupPaths = lookupPaths || []; lookupPaths = lookupPaths.concat(Blueprint.defaultLookupPaths()); - return _.uniq(lookupPaths); + return uniq(lookupPaths); } /** @@ -1663,6 +1784,24 @@

    lib/models/blueprint.js

    return validInfos; } +function replaceExtension(filePath, newExt) { + const { dir, name } = path.parse(filePath); + + return path.format({ + dir, + name, + ext: newExt, + }); +} + +function isTypeScriptFile(filePath) { + return path.extname(filePath) === '.ts'; +} + +function isJavaScriptFile(filePath) { + return path.extname(filePath) === '.js'; +} + module.exports = Blueprint; diff --git a/api/files/lib_models_builder.js.html b/api/files/lib_models_builder.js.html index 3d4c56b..5a115a7 100644 --- a/api/files/lib_models_builder.js.html +++ b/api/files/lib_models_builder.js.html @@ -42,7 +42,6 @@

    Classes

  • Builder
  • CLI
  • Command
  • -
  • CommandGenerator
  • DefaultPackager
  • EmberAddon
  • EmberApp
  • @@ -51,10 +50,9 @@

    Classes

  • Instrumentation
  • NodeModulesList
  • NpmTask
  • -
  • PackageCache
  • PackageInfo
  • PackageInfoCache
  • -
  • PrivateTestHelpers
  • +
  • PerBundleAddonCache
  • Project
  • ServeFilesAddon
  • TestsServerAddon
  • @@ -69,7 +67,7 @@

    Classes

    - Version: 3.21.2 + Version: 5.4.0-a905f346b9
    @@ -108,7 +106,6 @@

    lib/models/builder.js

    // Use Broccoli 2.0 by default, if this fails due to .read/.rebuild API, fallback to broccoli-builder this.broccoliBuilderFallback = false; - this.setupBroccoliBuilder(); this._instantiationStack = new Error().stack.replace(/[^\n]*\n/, ''); this._cleanup = this.cleanup.bind(this); @@ -124,25 +121,31 @@

    lib/models/builder.js

    * @method readBuildFile * @param path The file path to read the build file from */ - readBuildFile(path) { + async readBuildFile(path) { // Load the build file - let buildFile = findBuildFile('ember-cli-build.js', path); + let buildFile = await findBuildFile(path); if (buildFile) { - return buildFile({ project: this.project }); + return await buildFile({ project: this.project }); } throw new SilentError('No ember-cli-build.js found.'); } + async ensureBroccoliBuilder() { + if (this.builder === undefined) { + await this.setupBroccoliBuilder(); + } + } + /** * @private * @method setupBroccoliBuilder */ - setupBroccoliBuilder() { + async setupBroccoliBuilder() { this.environment = this.environment || 'development'; process.env.EMBER_ENV = process.env.EMBER_ENV || this.environment; - this.tree = this.readBuildFile(this.project.root); + this.tree = await this.readBuildFile(this.project.root); let broccoli = require('broccoli'); @@ -249,6 +252,8 @@

    lib/models/builder.js

    * @return {Promise} */ async build(addWatchDirCallback, resultAnnotation) { + await this.ensureBroccoliBuilder(); + let buildResults, uiProgressIntervalID; try { @@ -303,6 +308,10 @@

    lib/models/builder.js

    } catch (error) { await this.processAddonBuildSteps('buildError', error); + // Mark this as a builder error so the watcher knows it has been handled + // and won't re-throw it + error.isBuilderError = true; + throw error; } finally { clearInterval(uiProgressIntervalID); diff --git a/api/files/lib_models_command.js.html b/api/files/lib_models_command.js.html index c688350..edc2e22 100644 --- a/api/files/lib_models_command.js.html +++ b/api/files/lib_models_command.js.html @@ -42,7 +42,6 @@

    Classes

  • Builder
  • CLI
  • Command
  • -
  • CommandGenerator
  • DefaultPackager
  • EmberAddon
  • EmberApp
  • @@ -51,10 +50,9 @@

    Classes

  • Instrumentation
  • NodeModulesList
  • NpmTask
  • -
  • PackageCache
  • PackageInfo
  • PackageInfoCache
  • -
  • PrivateTestHelpers
  • +
  • PerBundleAddonCache
  • Project
  • ServeFilesAddon
  • TestsServerAddon
  • @@ -69,7 +67,7 @@

    Classes

    - Version: 3.21.2 + Version: 5.4.0-a905f346b9
    @@ -89,7 +87,7 @@

    lib/models/command.js

    const camelize = require('ember-cli-string-utils').camelize; const getCallerFile = require('get-caller-file'); const printCommand = require('../utilities/print-command'); -const _ = require('ember-cli-lodash-subset'); +const { union, defaults, uniq, uniqBy, reject } = require('ember-cli-lodash-subset'); const EOL = require('os').EOL; const CoreObject = require('core-object'); const logger = require('heimdalljs-logger')('ember-cli:command'); @@ -97,7 +95,7 @@

    lib/models/command.js

    const SilentError = require('silent-error'); const execSync = require('child_process').execSync; const fs = require('fs'); -const isYarnProject = require('../utilities/is-yarn-project'); +const { determineInstallCommand } = require('../utilities/package-managers'); let cache = {}; @@ -209,7 +207,6 @@

    lib/models/command.js

    * { name: 'verbose', type: Boolean, default: false, aliases: ['v'] }, * { name: 'blueprint', type: String, default: 'app', aliases: ['b'] }, * { name: 'skip-npm', type: Boolean, default: false, aliases: ['sn'] }, - * { name: 'skip-bower', type: Boolean, default: false, aliases: ['sb'] }, * { name: 'skip-git', type: Boolean, default: false, aliases: ['sg'] }, * { name: 'directory', type: String , aliases: ['dir'] } * ], @@ -245,12 +242,12 @@

    lib/models/command.js

    let extendedAvailableOptions = (options && options.availableOptions) || []; let extendedAnonymousOptions = (options && options.anonymousOptions) || []; - this.anonymousOptions = _.union(this.anonymousOptions.slice(0), extendedAnonymousOptions); + this.anonymousOptions = union(this.anonymousOptions.slice(0), extendedAnonymousOptions); // merge any availableOptions - this.availableOptions = _.union(this.availableOptions.slice(0), extendedAvailableOptions); + this.availableOptions = union(this.availableOptions.slice(0), extendedAvailableOptions); - let optionKeys = _.uniq(_.map(this.availableOptions, 'name')); + let optionKeys = uniq(this.availableOptions.map((option) => option.name)); optionKeys.map(this.mergeDuplicateOption.bind(this)); @@ -272,7 +269,7 @@

    lib/models/command.js

    } else { // interrupt all external commands which don't use `runTask()` with an error - // eslint-disable-next-line no-process-exit + // eslint-disable-next-line n/no-process-exit process.exit(1); } }, @@ -280,7 +277,6 @@

    lib/models/command.js

    _env(/* name */) { return { ui: this.ui, - analytics: this.analytics, project: this.project, testing: this.testing, settings: this.settings, @@ -340,65 +336,60 @@

    lib/models/command.js

    @method validateAndRun @return {Promise} */ - validateAndRun(args) { - return new Promise((resolve, reject) => { - let commandOptions = this.parseArgs(args); - // if the help option was passed, resolve with 'callHelp' to call help command - if (commandOptions && (commandOptions.options.help || commandOptions.options.h)) { - logger.info(`${this.name} called with help option`); - return resolve('callHelp'); - } + async validateAndRun(args) { + let commandOptions = this.parseArgs(args); - this.analytics.track({ - name: 'ember ', - message: this.name, - }); + // If the `help` option was passed, resolve with `callHelp` to call the `help` command: + if (commandOptions && (commandOptions.options.help || commandOptions.options.h)) { + logger.info(`${this.name} called with help option`); - if (commandOptions === null) { - return reject(); - } + return 'callHelp'; + } - if (this.works === 'outsideProject' && this.isWithinProject) { - throw new SilentError(`You cannot use the ${chalk.green(this.name)} command inside an ember-cli project.`); - } + if (commandOptions === null) { + throw new SilentError(); + } - if (this.works === 'insideProject') { - if (!this.project.hasDependencies()) { - if (!this.isWithinProject && !this.project.isEmberCLIAddon()) { - throw new SilentError( - `You have to be inside an ember-cli project to use the ${chalk.green(this.name)} command.` - ); - } - - let installInstuction = '`npm install`'; - if (isYarnProject(this.project.root)) { - installInstuction = '`yarn install`'; - } + if (this.works === 'outsideProject' && this.isWithinProject) { + throw new SilentError(`You cannot use the ${chalk.green(this.name)} command inside an ember-cli project.`); + } + + if (this.works === 'insideProject') { + if (!this.project.hasDependencies()) { + if (!this.isWithinProject && !this.project.isEmberCLIAddon()) { throw new SilentError( - `Required packages are missing, run ${installInstuction} from this directory to install them.` + `You have to be inside an ember-cli project to use the ${chalk.green(this.name)} command.` ); } - } - let detector = new WatchDetector({ - ui: this.ui, - childProcess: { execSync }, - fs, - watchmanSupportsPlatform: /^win/.test(process.platform), - cache, - root: this.project.root, - }); - - let options = commandOptions.options; + let installCommand = await determineInstallCommand(this.project.root); - if (this.hasOption('watcher')) { - // do stuff to try and provide a good experience when it comes to file watching - let watchPreference = detector.findBestWatcherOption(options); - this.project._watchmanInfo = watchPreference.watchmanInfo; - options.watcher = watchPreference.watcher; + throw new SilentError( + `Required packages are missing, run \`${installCommand}\` from this directory to install them.` + ); } - resolve(this.run(options, commandOptions.args)); + } + + let detector = new WatchDetector({ + ui: this.ui, + childProcess: { execSync }, + fs, + watchmanSupportsPlatform: /^win/.test(process.platform), + cache, + root: this.project.root, }); + + let options = commandOptions.options; + + if (this.hasOption('watcher')) { + // Do stuff to try and provide a good experience when it comes to file watching: + let watchPreference = detector.findBestWatcherOption(options); + + this.project._watchmanInfo = watchPreference.watchmanInfo; + options.watcher = watchPreference.watcher; + } + + return this.run(options, commandOptions.args); }, /** @@ -427,23 +418,17 @@

    lib/models/command.js

    mergeDuplicateOption(key) { let duplicateOptions, mergedOption, mergedAliases; // get duplicates to merge - duplicateOptions = _.filter(this.availableOptions, { name: key }); + duplicateOptions = this.availableOptions.filter((option) => option.name === key); if (duplicateOptions.length > 1) { // TODO: warn on duplicates and overwriting - mergedAliases = []; - - _.map(duplicateOptions, 'aliases').map((alias) => { - alias.map((a) => { - mergedAliases.push(a); - }); - }); + mergedAliases = duplicateOptions.flatMap((option) => option.aliases); // merge duplicate options mergedOption = Object.assign.apply(null, duplicateOptions); // replace aliases with unique aliases - mergedOption.aliases = _.uniqBy(mergedAliases, (alias) => { + mergedOption.aliases = uniqBy(mergedAliases, (alias) => { if (typeof alias === 'object') { return alias[Object.keys(alias)[0]]; } @@ -451,9 +436,10 @@

    lib/models/command.js

    }); // remove duplicates from options - this.availableOptions = _.reject(this.availableOptions, { name: key }); + this.availableOptions = reject(this.availableOptions, { name: key }); this.availableOptions.push(mergedOption); } + return this.availableOptions; }, @@ -671,7 +657,7 @@

    lib/models/command.js

    Object.keys(parsedOptions).map(validateParsed.bind(this)); return { - options: _.defaults(commandOptions, this.settings), + options: defaults(commandOptions, this.settings), args: parsedOptions.argv.remain, }; }, diff --git a/api/files/lib_models_hardware-info.js.html b/api/files/lib_models_hardware-info.js.html index 5373de9..0f79858 100644 --- a/api/files/lib_models_hardware-info.js.html +++ b/api/files/lib_models_hardware-info.js.html @@ -42,7 +42,6 @@

    Classes

  • Builder
  • CLI
  • Command
  • -
  • CommandGenerator
  • DefaultPackager
  • EmberAddon
  • EmberApp
  • @@ -51,10 +50,9 @@

    Classes

  • Instrumentation
  • NodeModulesList
  • NpmTask
  • -
  • PackageCache
  • PackageInfo
  • PackageInfoCache
  • -
  • PrivateTestHelpers
  • +
  • PerBundleAddonCache
  • Project
  • ServeFilesAddon
  • TestsServerAddon
  • @@ -69,7 +67,7 @@

    Classes

    - Version: 3.21.2 + Version: 5.4.0-a905f346b9
    @@ -312,7 +310,7 @@

    lib/models/hardware-info.js

    const hwinfo = { /** - * Inidcates whether the host is running on battery power. This can cause + * Indicates whether the host is running on battery power. This can cause * performance degredation. * * @private diff --git a/api/files/lib_models_host-info-cache.js.html b/api/files/lib_models_host-info-cache.js.html new file mode 100644 index 0000000..9b32651 --- /dev/null +++ b/api/files/lib_models_host-info-cache.js.html @@ -0,0 +1,424 @@ + + + + + lib/models/host-info-cache.js - ember-cli + + + + + + +
    +
    + + +
    +
    +

    lib/models/host-info-cache.js

    +
    + +
    +'use strict';
    +
    +function allPkgInfosEqualAtIndex(paths, index) {
    +  const itemToCheck = paths[0][index];
    +  return paths.every((pathToLazyEngine) => pathToLazyEngine[index] === itemToCheck);
    +}
    +
    +class HostInfoCache {
    +  constructor(project) {
    +    this.project = project;
    +    this._bundledPackageInfoCache = new Map();
    +    this._hostAddonInfoCache = new Map();
    +    this._lcaHostCache = new Map();
    +  }
    +
    +  /**
    +   * Given a path (calculated as part of `getHostAddonInfo`), return the correct
    +   * "bundle host". A bundle host is considered the project or lazy engine.
    +   *
    +   * For example, given the following package structure:
    +   *
    +   *      --Project--
    +   *       /      \
    +   *      /        \
    +   * Lazy Engine A  \
    +   *              Addon A
    +   *                |
    +   *                |
    +   *           Lazy Engine B
    +   *            /          \
    +   *           /            \
    +   *      Lazy Engine A   Lazy Engine C
    +   *
    +   * The provided paths for lazy engine A would look like:
    +   *
    +   * - [Project]
    +   * - [Project, Addon A, Lazy Engine B]
    +   *
    +   * For this project structure, this function would return [Project, [Project]]
    +   *
    +   * Similarly, given the following project structure:
    +   *
    +   *            --Project--
    +   *             /      \
    +   *            /        \
    +   *     Lazy Engine A    \
    +   *          /        Lazy Engine B
    +   *         /               |
    +   *        /                |
    +   *  Lazy Engine C     Lazy Engine C
    +   *
    +   * The provided paths for lazy engine C would look like:
    +   *
    +   * - [Project, Lazy Engine A]
    +   * - [Project, Lazy Engine B]
    +   *
    +   * In this case, the host is the project and would also return [Project, [Project]]
    +   *
    +   * @method _findNearestBundleHost
    +   * @param {Array<PackageInfo[]>} paths The found paths to a given bundle host
    +   * @return {[PackageInfo, PackageInfo[]]}
    +   * @private
    +   */
    +  _findNearestBundleHost(paths, pkgInfoForLazyEngine) {
    +    // building an engine in isolation (it's considered the project, but it's
    +    // also added as a dependency to the project by `ember-cli`)
    +    if (this.project._packageInfo === pkgInfoForLazyEngine) {
    +      return [this.project._packageInfo, [this.project._packageInfo]];
    +    }
    +
    +    const shortestPath = paths.reduce(
    +      (acc, pathToLazyEngine) => Math.min(acc, pathToLazyEngine.length),
    +      Number.POSITIVE_INFINITY
    +    );
    +
    +    const pathsEqualToShortest = paths.filter((pathToLazyEngine) => pathToLazyEngine.length === shortestPath);
    +    const [firstPath] = pathsEqualToShortest;
    +
    +    for (let i = firstPath.length - 1; i >= 0; i--) {
    +      const pkgInfo = firstPath[i];
    +
    +      if (pkgInfo.isForBundleHost() && allPkgInfosEqualAtIndex(pathsEqualToShortest, i)) {
    +        return [pkgInfo, firstPath.slice(0, i + 1)];
    +      }
    +    }
    +
    +    // this should _never_ be triggered
    +    throw new Error(
    +      `[ember-cli] Could not find a common host for: \`${pkgInfoForLazyEngine.name}\` (located at \`${pkgInfoForLazyEngine.realPath}\`)`
    +    );
    +  }
    +
    +  /**
    +   * Returns a `Set` of package-info objects that a given bundle host is
    +   * _directly_ responsible for bundling (i.e., it excludes other bundle
    +   * hosts/lazy engines when it encounters these)
    +   *
    +   * @method _getBundledPackageInfos
    +   * @param {PackageInfo} pkgInfoToStartAt
    +   * @return {Set<PackageInfo>}
    +   * @private
    +   */
    +  _getBundledPackageInfos(pkgInfoToStartAt) {
    +    let pkgInfos = this._bundledPackageInfoCache.get(pkgInfoToStartAt);
    +
    +    if (pkgInfos) {
    +      return pkgInfos;
    +    }
    +
    +    if (!pkgInfoToStartAt.isForBundleHost()) {
    +      throw new Error(
    +        `[ember-cli] \`${pkgInfoToStartAt.name}\` is not a bundle host; \`getBundledPackageInfos\` should only be used to find bundled package infos for a project or lazy engine`
    +      );
    +    }
    +
    +    pkgInfos = new Set();
    +    this._bundledPackageInfoCache.set(pkgInfoToStartAt, pkgInfos);
    +
    +    let findAddons = (currentPkgInfo) => {
    +      if (!currentPkgInfo.valid || !currentPkgInfo.addonMainPath) {
    +        return;
    +      }
    +
    +      if (pkgInfos.has(currentPkgInfo)) {
    +        return;
    +      }
    +
    +      if (currentPkgInfo.isForBundleHost()) {
    +        return;
    +      }
    +
    +      pkgInfos.add(currentPkgInfo);
    +
    +      let addonPackageList = currentPkgInfo.discoverAddonAddons();
    +      addonPackageList.forEach((pkgInfo) => findAddons(pkgInfo));
    +    };
    +
    +    let addonPackageList = pkgInfoToStartAt.project
    +      ? pkgInfoToStartAt.discoverProjectAddons()
    +      : pkgInfoToStartAt.discoverAddonAddons();
    +
    +    addonPackageList.forEach((pkgInfo) => findAddons(pkgInfo));
    +
    +    return pkgInfos;
    +  }
    +
    +  /**
    +   * This function intends to return a common host for a bundle host (lazy engine). The root
    +   * package info should be the starting point (i.e., the project's package info). We do this
    +   * by performing a breadth-first traversal until we find the intended lazy engine (represented
    +   * as a package-info & the 1st argument passed to this function). As part of the traversal, we keep
    +   * track of all paths to said engine; then, once we find the intended engine we use this to determine
    +   * the nearest common host amongst all shortest paths.
    +   *
    +   * Some context:
    +   *
    +   * For a given engine/bundle host, this finds the lowest common ancestor that is considered a
    +   * host amongst _all_ engines by the same name in the project.
    +   *
    +   * For example, given the following package structure:
    +   *
    +   *      --Project--
    +   *       /      \
    +   *      /        \
    +   * Lazy Engine A  \
    +   *              Addon A
    +   *                |
    +   *                |
    +   *           Lazy Engine B
    +   *            /          \
    +   *           /            \
    +   *      Lazy Engine A   Lazy Engine C
    +   *
    +   * - The LCA host for Lazy Engine A is the project
    +   * - The LCA host for Lazy Engine B is the project
    +   * - The LCA host for Lazy Engine C is Lazy Engine B
    +   *
    +   * This also returns `hostAndAncestorBundledPackageInfos`, which are all bundled addons above a given host:
    +   *
    +   * - `hostAndAncestorBundledPackageInfos` for lazy engine A includes all non-lazy dependencies of its LCA host & above (in this case, just the project)
    +   * - `hostAndAncestorBundledPackageInfos` for lazy engine B includes all non-lazy dependencies of its LCA host & above (in this case, just the project)
    +   * - `hostAndAncestorBundledPackageInfos` for lazy engine C includes non-lazy deps of lazy engine B & non-lazy deps of the project (LCA host & above)
    +   *
    +   * This is intended to mimic the behavior of `ancestorHostAddons` in `ember-engines`:
    +   * https://github.com/ember-engines/ember-engines/blob/master/packages/ember-engines/lib/engine-addon.js#L333
    +   *
    +   * Unfortunately, we can't easily repurpose the logic in `ember-engines` since the algorithm has to be different;
    +   * in `ember-engines` we need access to the actual addon instance, however, this is intended to be used _during_
    +   * addon instantiation, so we only have access to package-info objects. In having said this, we _can_ repurpose
    +   * the `hostPackageInfo` to determine the LCA host; see below `findLCAHost`.
    +   *
    +   * @method getHostAddonInfo
    +   * @param {PackageInfo} packageInfoForLazyEngine
    +   * @return {{ hostPackageInfo: PackageInfo, hostAndAncestorBundledPackageInfos: Set<PackageInfo> }}
    +   */
    +  getHostAddonInfo(packageInfoForLazyEngine) {
    +    const cacheKey = `${this.project._packageInfo.realPath}-${packageInfoForLazyEngine.realPath}`;
    +
    +    let hostInfoCacheEntry = this._hostAddonInfoCache.get(cacheKey);
    +
    +    if (hostInfoCacheEntry) {
    +      return hostInfoCacheEntry;
    +    }
    +
    +    if (!packageInfoForLazyEngine.isForEngine()) {
    +      throw new Error(
    +        `[ember-cli] \`${packageInfoForLazyEngine.name}\` is not an engine; \`getHostAddonInfo\` should only be used to find host information about engines`
    +      );
    +    }
    +
    +    const queue = [{ pkgInfo: this.project._packageInfo, path: [] }];
    +    const visited = new Set();
    +    const foundPaths = [];
    +
    +    while (queue.length) {
    +      const { pkgInfo: currentPackageInfo, path } = queue.shift();
    +
    +      const {
    +        addonMainPath,
    +        inRepoAddons = [],
    +        dependencyPackages = {},
    +        devDependencyPackages = {},
    +      } = currentPackageInfo;
    +
    +      const isCurrentPackageInfoProject = this.project._packageInfo === currentPackageInfo;
    +
    +      // don't process non-ember addons
    +      if (!isCurrentPackageInfoProject && typeof addonMainPath !== 'string') {
    +        continue;
    +      }
    +
    +      // store found paths
    +      if (currentPackageInfo === packageInfoForLazyEngine) {
    +        foundPaths.push([...path]);
    +      }
    +
    +      // don't process a given `PackageInfo` object more than once
    +      if (!visited.has(currentPackageInfo)) {
    +        visited.add(currentPackageInfo);
    +
    +        // add current package info to current path
    +        path.push(currentPackageInfo);
    +
    +        queue.push(
    +          ...[...inRepoAddons, ...Object.values(dependencyPackages), ...Object.values(devDependencyPackages)].map(
    +            (pkgInfo) => ({ pkgInfo, path: [...path] })
    +          )
    +        );
    +      }
    +    }
    +
    +    const [hostPackageInfo, foundPath] = this._findNearestBundleHost(foundPaths, packageInfoForLazyEngine);
    +
    +    const hostAndAncestorBundledPackageInfos = foundPath
    +      .filter((pkgInfo) => pkgInfo.isForBundleHost())
    +      .reduce((acc, curr) => {
    +        acc.push(...this._getBundledPackageInfos(curr));
    +        return acc;
    +      }, []);
    +
    +    hostInfoCacheEntry = {
    +      hostPackageInfo,
    +      hostAndAncestorBundledPackageInfos: new Set(hostAndAncestorBundledPackageInfos),
    +    };
    +
    +    this._hostAddonInfoCache.set(cacheKey, hostInfoCacheEntry);
    +    return hostInfoCacheEntry;
    +  }
    +
    +  /**
    +   * This returns the LCA host for a given engine; we use the associated package info
    +   * to compute this (see `getHostAddonInfo` above); this finds the lowest common ancestor
    +   * that is considered a host amongst _all_ engines by the same name in the project. This
    +   * function is intended to replace the original behavior in `ember-engines`.
    +   *
    +   * For more info, see the original implementation here:
    +   *
    +   * https://github.com/ember-engines/ember-engines/blob/master/packages/ember-engines/lib/utils/find-lca-host.js
    +   *
    +   * @method findLCAHost
    +   * @param {EngineAddon} engineInstance
    +   * @return {EngineAddon|EmberApp}
    +   */
    +  findLCAHost(engineInstance) {
    +    // only compute once for a given engine
    +    // we're using the engine name as the cache key here because regardless of its
    +    // version, lazy engines will always get output to: `engines-dist/${engineName}`
    +    let lcaHost = this._lcaHostCache.get(engineInstance.name);
    +
    +    if (lcaHost) {
    +      return lcaHost;
    +    }
    +
    +    if (!engineInstance._packageInfo.isForEngine()) {
    +      throw new Error(
    +        `[ember-cli] \`findLCAHost\` should only be used for engines; \`${engineInstance.name}\` is not an engine`
    +      );
    +    }
    +
    +    const { hostPackageInfo } = this.getHostAddonInfo(engineInstance._packageInfo);
    +
    +    let curr = engineInstance;
    +
    +    while (curr && curr.parent) {
    +      if (curr.app) {
    +        lcaHost = curr.app;
    +        break;
    +      }
    +
    +      if (curr._packageInfo === hostPackageInfo) {
    +        lcaHost = curr;
    +        break;
    +      }
    +
    +      curr = curr.parent;
    +    }
    +
    +    if (lcaHost) {
    +      this._lcaHostCache.set(engineInstance.name, lcaHost);
    +      return lcaHost;
    +    }
    +
    +    // this should _never_ be triggered
    +    throw new Error(
    +      `[ember-cli] Could not find an LCA host for: \`${engineInstance.name}\` (located at \`${
    +        engineInstance.packageRoot || engineInstance.root
    +      }\`)`
    +    );
    +  }
    +}
    +
    +module.exports = HostInfoCache;
    +
    +
    + +
    +
    +
    +
    + + + + + diff --git a/api/files/lib_models_instantiate-addons.js.html b/api/files/lib_models_instantiate-addons.js.html index 35842ab..365e6ba 100644 --- a/api/files/lib_models_instantiate-addons.js.html +++ b/api/files/lib_models_instantiate-addons.js.html @@ -42,7 +42,6 @@

    Classes

  • Builder
  • CLI
  • Command
  • -
  • CommandGenerator
  • DefaultPackager
  • EmberAddon
  • EmberApp
  • @@ -51,10 +50,9 @@

    Classes

  • Instrumentation
  • NodeModulesList
  • NpmTask
  • -
  • PackageCache
  • PackageInfo
  • PackageInfoCache
  • -
  • PrivateTestHelpers
  • +
  • PerBundleAddonCache
  • Project
  • ServeFilesAddon
  • TestsServerAddon
  • @@ -69,7 +67,7 @@

    Classes

    - Version: 3.21.2 + Version: 5.4.0-a905f346b9
    @@ -131,6 +129,8 @@

    lib/models/instantiate-addons.js

    }); let addons = []; + let timings = new Map(); + graph.each((key, value) => { let addonInfo = value; if (addonInfo) { @@ -150,28 +150,11 @@

    lib/models/instantiate-addons.js

    ); } - let AddonConstructor = pkgInfo.getAddonConstructor(); - - let addon; + // get an instance of the addon. If that fails it will throw. + let addon = pkgInfo.getAddonInstance(parent, project); - try { - addon = new AddonConstructor(parent, project); - } catch (e) { - if (parent && parent.ui) { - parent.ui.writeError(e); - } - const SilentError = require('silent-error'); - throw new SilentError(`An error occurred in the constructor for ${addonInfo.name} at ${addonInfo.path}`); - } - - if (addon.initializeAddons) { - addon.initializeAddons(); - } else { - addon.addons = []; - } + timings.set(addon, Date.now() - start); - AddonConstructor._meta_.initializeIn = Date.now() - start; - addon.constructor = AddonConstructor; initializeAddonToken.stop(); addons.push(addon); @@ -182,10 +165,7 @@

    lib/models/instantiate-addons.js

    ' addon info %o', addons.map((addon) => ({ name: addon.name, - times: { - initialize: addon.constructor._meta_.initializeIn, - lookup: addon.constructor._meta_.lookupIn, - }, + initializeTotalMillis: timings.get(addon), })) ); diff --git a/api/files/lib_models_instrumentation.js.html b/api/files/lib_models_instrumentation.js.html index 1e1b576..770c855 100644 --- a/api/files/lib_models_instrumentation.js.html +++ b/api/files/lib_models_instrumentation.js.html @@ -42,7 +42,6 @@

    Classes

  • Builder
  • CLI
  • Command
  • -
  • CommandGenerator
  • DefaultPackager
  • EmberAddon
  • EmberApp
  • @@ -51,10 +50,9 @@

    Classes

  • Instrumentation
  • NodeModulesList
  • NpmTask
  • -
  • PackageCache
  • PackageInfo
  • PackageInfoCache
  • -
  • PrivateTestHelpers
  • +
  • PerBundleAddonCache
  • Project
  • ServeFilesAddon
  • TestsServerAddon
  • @@ -69,7 +67,7 @@

    Classes

    - Version: 3.21.2 + Version: 5.4.0-a905f346b9
    diff --git a/api/files/lib_models_package-info-cache_index.js.html b/api/files/lib_models_package-info-cache_index.js.html index e059687..f1b276b 100644 --- a/api/files/lib_models_package-info-cache_index.js.html +++ b/api/files/lib_models_package-info-cache_index.js.html @@ -42,7 +42,6 @@

    Classes

  • Builder
  • CLI
  • Command
  • -
  • CommandGenerator
  • DefaultPackager
  • EmberAddon
  • EmberApp
  • @@ -51,10 +50,9 @@

    Classes

  • Instrumentation
  • NodeModulesList
  • NpmTask
  • -
  • PackageCache
  • PackageInfo
  • PackageInfoCache
  • -
  • PrivateTestHelpers
  • +
  • PerBundleAddonCache
  • Project
  • ServeFilesAddon
  • TestsServerAddon
  • @@ -69,7 +67,7 @@

    Classes

    - Version: 3.21.2 + Version: 5.4.0-a905f346b9
    @@ -326,7 +324,9 @@

    lib/models/package-info-cache/index.js

    * No copy is made. */ loadAddon(addonInstance) { - let pkgInfo = this._readPackage(addonInstance.root, addonInstance.pkg); + // to maintain backwards compatibility for consumers who create a new instance + // of the base addon model class directly and don't set `packageRoot` + let pkgInfo = this._readPackage(addonInstance.packageRoot || addonInstance.root, addonInstance.pkg); // NOTE: the returned pkgInfo may contain errors, or may contain // other packages that have errors. We will try to process @@ -593,7 +593,7 @@

    lib/models/package-info-cache/index.js

    // If we have an ember-addon, check that the main exists and points // to a valid file. - if (pkgInfo.isAddon()) { + if (pkgInfo.isForAddon()) { logger.info('%s is an addon', pkg.name); // Note: when we have both 'main' and ember-addon:main, the latter takes precedence diff --git a/api/files/lib_models_package-info-cache_node-modules-list.js.html b/api/files/lib_models_package-info-cache_node-modules-list.js.html index 64dc9be..a864d79 100644 --- a/api/files/lib_models_package-info-cache_node-modules-list.js.html +++ b/api/files/lib_models_package-info-cache_node-modules-list.js.html @@ -42,7 +42,6 @@

    Classes

  • Builder
  • CLI
  • Command
  • -
  • CommandGenerator
  • DefaultPackager
  • EmberAddon
  • EmberApp
  • @@ -51,10 +50,9 @@

    Classes

  • Instrumentation
  • NodeModulesList
  • NpmTask
  • -
  • PackageCache
  • PackageInfo
  • PackageInfoCache
  • -
  • PrivateTestHelpers
  • +
  • PerBundleAddonCache
  • Project
  • ServeFilesAddon
  • TestsServerAddon
  • @@ -69,7 +67,7 @@

    Classes

    - Version: 3.21.2 + Version: 5.4.0-a905f346b9
    diff --git a/api/files/lib_models_package-info-cache_package-info.js.html b/api/files/lib_models_package-info-cache_package-info.js.html index f313874..aaab6ab 100644 --- a/api/files/lib_models_package-info-cache_package-info.js.html +++ b/api/files/lib_models_package-info-cache_package-info.js.html @@ -42,7 +42,6 @@

    Classes

  • Builder
  • CLI
  • Command
  • -
  • CommandGenerator
  • DefaultPackager
  • EmberAddon
  • EmberApp
  • @@ -51,10 +50,9 @@

    Classes

  • Instrumentation
  • NodeModulesList
  • NpmTask
  • -
  • PackageCache
  • PackageInfo
  • PackageInfoCache
  • -
  • PrivateTestHelpers
  • +
  • PerBundleAddonCache
  • Project
  • ServeFilesAddon
  • TestsServerAddon
  • @@ -69,7 +67,7 @@

    Classes

    - Version: 3.21.2 + Version: 5.4.0-a905f346b9
    @@ -87,7 +85,10 @@

    lib/models/package-info-cache/package-info.js

    const Errors = require('./errors'); const AddonInfo = require('../addon-info'); const isAddon = require('../../utilities/is-addon'); +const isEngine = require('../../utilities/is-engine'); +const isLazyEngine = require('../../utilities/is-lazy-engine'); const logger = require('heimdalljs-logger')('ember-cli:package-info-cache:package-info'); +const PerBundleAddonCache = require('../per-bundle-addon-cache'); function lexicographically(a, b) { const aIsString = typeof a.name === 'string'; @@ -162,7 +163,7 @@

    lib/models/package-info-cache/package-info.js

    // not actually be used. this.valid = true; - this.mayHaveAddons = isRoot || this.isAddon(); // mayHaveAddons used in index.js + this.mayHaveAddons = isRoot || this.isForAddon(); // mayHaveAddons used in index.js this._hasDumpedInvalidAddonPackages = false; } @@ -244,7 +245,7 @@

    lib/models/package-info-cache/package-info.js

    * been added to the cache. * * Note: this is for ALL dependencies, not just addons. To get just - * addons, filter the result by calling pkgInfo.isAddon(). + * addons, filter the result by calling pkgInfo.isForAddon(). * * Note: this is only intended for use from PackageInfoCache._resolveDependencies. * It is not to be called directly by anything else. @@ -302,10 +303,59 @@

    lib/models/package-info-cache/package-info.js

    return packages; } - isAddon() { + /** + * Indicate if this packageInfo is for a project. Should be called only after the project + * has been loaded (see {@link PackageInfoCache#loadProject} for details). + * + * @method isForProject + * @return {Boolean} true if this packageInfo is for a Project, false otherwise. + */ + isForProject() { + return !!this.project && this.project.isEmberCLIProject && this.project.isEmberCLIProject(); + } + + /** + * Indicate if this packageInfo is for an Addon. + * + * @method isForAddon + * @return {Boolean} true if this packageInfo is for an Addon, false otherwise. + */ + isForAddon() { return isAddon(this.pkg.keywords); } + /** + * Indicate if this packageInfo represents an engine. + * + * @method isForEngine + * @return {Boolean} true if this pkgInfo is configured as an engine & false otherwise + */ + isForEngine() { + return isEngine(this.pkg.keywords); + } + + /** + * Indicate if this packageInfo represents a lazy engine. + * + * @method isForLazyEngine + * @return {Boolean} true if this pkgInfo is configured as an engine and the + * module this represents has lazyLoading enabled, false otherwise. + */ + isForLazyEngine() { + return this.isForEngine() && isLazyEngine(this._getAddonEntryPoint()); + } + + /** + * For use with the PerBundleAddonCache, is this packageInfo representing a + * bundle host (for now, a Project or a lazy engine). + * + * @method isForBundleHost + * @return {Boolean} true if this pkgInfo is for a bundle host, false otherwise. + */ + isForBundleHost() { + return this.isForProject() || this.isForLazyEngine(); + } + /** * Add to a list of child addon PackageInfos for this packageInfo. * @@ -356,7 +406,7 @@

    lib/models/package-info-cache/package-info.js

    this.addPackages( addonPackageList, this.dependencyPackages, - (pkgInfo) => !pkgInfo.isAddon() || pkgInfo.name === 'ember-cli' + (pkgInfo) => !pkgInfo.isForAddon() || pkgInfo.name === 'ember-cli' ); this.addPackages(addonPackageList, this.inRepoAddons); @@ -376,8 +426,8 @@

    lib/models/package-info-cache/package-info.js

    this.addPackages(addonPackageList, project.isEmberCLIAddon() ? [this] : null); this.addPackages(addonPackageList, this.cliInfo ? this.cliInfo.inRepoAddons : null); this.addPackages(addonPackageList, this.internalAddons); - this.addPackages(addonPackageList, this.devDependencyPackages, (pkgInfo) => !pkgInfo.isAddon()); - this.addPackages(addonPackageList, this.dependencyPackages, (pkgInfo) => !pkgInfo.isAddon()); + this.addPackages(addonPackageList, this.devDependencyPackages, (pkgInfo) => !pkgInfo.isForAddon()); + this.addPackages(addonPackageList, this.dependencyPackages, (pkgInfo) => !pkgInfo.isForAddon()); this.addPackages(addonPackageList, this.inRepoAddons); return addonPackageList; @@ -442,11 +492,7 @@

    lib/models/package-info-cache/package-info.js

    }); } - if (process.env.EMBER_CLI_ERROR_ON_INVALID_ADDON) { - throw msg; - } else { - this.cache.ui.writeWarnLine(msg); - } + throw msg; } } @@ -455,6 +501,7 @@

    lib/models/package-info-cache/package-info.js

    * Also, the assumption here is that this PackageInfo really is for an * Addon, so we don't need to check each time. * + * @private * @method getAddonConstructor * @return {AddonConstructor} an instance of a constructor function for the Addon class * whose package information is stored in this object. @@ -464,10 +511,7 @@

    lib/models/package-info-cache/package-info.js

    return this.addonConstructor; } - // Load the addon. - // TODO: Future work - allow a time budget for loading each addon and warn - // or error for those that take too long. - let module = require(this.addonMainPath); + let module = this._getAddonEntryPoint(); let mainDir = path.dirname(this.addonMainPath); let ctor; @@ -475,24 +519,123 @@

    lib/models/package-info-cache/package-info.js

    if (typeof module === 'function') { ctor = module; ctor.prototype.root = ctor.prototype.root || mainDir; + ctor.prototype.packageRoot = ctor.prototype.packageRoot || this.realPath; ctor.prototype.pkg = ctor.prototype.pkg || this.pkg; } else { const Addon = require('../addon'); // done here because of circular dependency - ctor = Addon.extend(Object.assign({ root: mainDir, pkg: this.pkg }, module)); + ctor = Addon.extend(Object.assign({ root: mainDir, packageRoot: this.realPath, pkg: this.pkg }, module)); } - // XXX Probably want to store the timings here in PackageInfo, - // rather than adding _meta_ to the constructor. - // XXX Will also need to remove calls to it from various places. ctor._meta_ = { modulePath: this.addonMainPath, - lookupDuration: 0, - initializeIn: 0, }; return (this.addonConstructor = ctor); } + + /** + * Construct an addon instance. + * + * NOTE: this does NOT call constructors for the child addons. That is left to + * the caller to do, so they can insert any other logic they want. + * + * @private + * @method constructAddonInstance + * @param {Project|Addon} parent the parent that directly contains this addon + * @param {Project} project the project that is/contains this addon + */ + constructAddonInstance(parent, project) { + let start = Date.now(); + + let AddonConstructor = this.getAddonConstructor(); + + let addonInstance; + + try { + addonInstance = new AddonConstructor(parent, project); + } catch (e) { + if (parent && parent.ui) { + parent.ui.writeError(e); + } + + const SilentError = require('silent-error'); + throw new SilentError(`An error occurred in the constructor for ${this.name} at ${this.realPath}`); + } + + AddonConstructor._meta_.initializeIn = Date.now() - start; + addonInstance.constructor = AddonConstructor; + + return addonInstance; + } + + /** + * Create an instance of the addon represented by this packageInfo or (if we + * are supporting per-bundle caching and this is an allow-caching-per-bundle addon) + * check if we should be creating a proxy instead. + * + * NOTE: we assume that the value of 'allowCachingPerBundle' does not change between + * calls to the constructor! A given addon is either allowing or not allowing caching + * for an entire run. + * + * @method getAddonInstance + * @param {} parent the addon/project that is to be the direct parent of the + * addon instance created here + * @param {*} project the project that is to contain this addon instance + * @return {Object} the constructed instance of the addon + */ + getAddonInstance(parent, project) { + let addonEntryPointModule = this._getAddonEntryPoint(); + let addonInstance; + + if ( + PerBundleAddonCache.isEnabled() && + project && + project.perBundleAddonCache.allowCachingPerBundle(addonEntryPointModule) + ) { + addonInstance = project.perBundleAddonCache.getAddonInstance(parent, this); + } else { + addonInstance = this.constructAddonInstance(parent, project); + this.initChildAddons(addonInstance); + } + + return addonInstance; + } + + /** + * Initialize the child addons array of a newly-created addon instance. Normally when + * an addon derives from Addon, child addons will be created during 'setupRegistry' and + * this code is essentially unnecessary. But if an addon is created with custom constructors + * that don't call 'setupRegistry', any child addons may not yet be initialized. + * + * @method initChildAddons + * @param {Addon} addonInstance + */ + initChildAddons(addonInstance) { + if (addonInstance.initializeAddons) { + addonInstance.initializeAddons(); + } else { + addonInstance.addons = []; + } + } + + /** + * Gets the addon entry point + * + * @method _getAddonEntryPoint + * @return {Object|Function} The exported addon entry point + * @private + */ + _getAddonEntryPoint() { + if (!this.addonMainPath) { + throw new Error(`${this.pkg.name} at ${this.realPath} is missing its addon main file`); + } + + // Load the addon. + // TODO: Future work - allow a time budget for loading each addon and warn + // or error for those that take too long. + return require(this.addonMainPath); + } } module.exports = PackageInfo; diff --git a/api/files/lib_models_per-bundle-addon-cache_addon-proxy.js.html b/api/files/lib_models_per-bundle-addon-cache_addon-proxy.js.html new file mode 100644 index 0000000..30e33c2 --- /dev/null +++ b/api/files/lib_models_per-bundle-addon-cache_addon-proxy.js.html @@ -0,0 +1,250 @@ + + + + + lib/models/per-bundle-addon-cache/addon-proxy.js - ember-cli + + + + + + +
    +
    + + +
    +
    +

    lib/models/per-bundle-addon-cache/addon-proxy.js

    +
    + +
    +'use strict';
    +
    +const { TARGET_INSTANCE } = require('./target-instance');
    +
    +const CACHE_KEY_FOR_TREE_TRACKER = Symbol('CACHE_KEY_FOR_TREE_TRACKER');
    +
    +/**
    + * Validates that a new cache key for a given tree type matches the previous
    + * cache key for the same tree type. To opt-in to bundle addon caching for
    + * a given addon it's assumed that it returns stable cache keys; specifically
    + * this is because the interplay between bundle addon caching and `ember-engines`
    + * when transitive deduplication is enabled assumes stable cache keys, so we validate
    + * for this case here.
    + *
    + * @method validateCacheKey
    + * @param {Addon} realAddonInstance The real addon instance
    + * @param {string} treeType
    + * @param {string} newCacheKey
    + * @throws {Error} If the new cache key doesn't match the previous cache key
    + */
    +function validateCacheKey(realAddonInstance, treeType, newCacheKey) {
    +  let cacheKeyTracker = realAddonInstance[CACHE_KEY_FOR_TREE_TRACKER];
    +
    +  if (!cacheKeyTracker) {
    +    cacheKeyTracker = {};
    +    realAddonInstance[CACHE_KEY_FOR_TREE_TRACKER] = cacheKeyTracker;
    +  }
    +
    +  cacheKeyTracker[treeType] = treeType in cacheKeyTracker ? cacheKeyTracker[treeType] : newCacheKey;
    +
    +  if (cacheKeyTracker[treeType] !== newCacheKey) {
    +    throw new Error(
    +      `[ember-cli] addon bundle caching can only be used on addons that have stable cache keys (previously \`${
    +        cacheKeyTracker[treeType]
    +      }\`, now \`${newCacheKey}\`; for addon \`${realAddonInstance.name}\` located at \`${
    +        realAddonInstance.packageRoot || realAddonInstance.root
    +      }\`)`
    +    );
    +  }
    +}
    +
    +/**
    + * Returns a proxy to a target with specific handling for the
    + * `parent` property, as well has to handle the `app` property;
    + * that is, the proxy should maintain correct local state in
    + * closure scope for the `app` property if it happens to be set
    + * by `ember-cli`. Other than `parent` & `app`, this function also
    + * proxies _almost_ everything to `target[TARGET_INSTANCE] with a few
    + * exceptions: we trap & return `[]` for `addons`, and we don't return
    + * the original `included` (it's already called on the "real" addon
    + * by `ember-cli`).
    + *
    + * Note: the target is NOT the per-bundle cacheable instance of the addon. Rather,
    + * it is a cache entry POJO from PerBundleAddonCache.
    + *
    + * @method getAddonProxy
    + * @param targetCacheEntry the PerBundleAddonCache cache entry we are to proxy. It
    + * has one interesting property, the real addon instance the proxy is forwarding
    + * calls to (that property is not globally exposed).
    + * @param parent the parent object of the proxy being created (the same as
    + * the 'parent' property of a normal addon instance)
    + * @return Proxy
    + */
    +function getAddonProxy(targetCacheEntry, parent) {
    +  let _app;
    +
    +  // handle `preprocessJs` separately for Embroider
    +  //
    +  // some context here:
    +  //
    +  // Embroider patches `preprocessJs`, so we want to maintain local state within the
    +  // proxy rather than allowing a patched `preprocessJs` set on the original addon
    +  // instance itself
    +  //
    +  // for more info as to where this happens, see:
    +  // https://github.com/embroider-build/embroider/blob/master/packages/compat/src/v1-addon.ts#L634
    +  let _preprocessJs;
    +
    +  return new Proxy(targetCacheEntry, {
    +    get(targetCacheEntry, property) {
    +      if (property === 'parent') {
    +        return parent;
    +      }
    +
    +      if (property === 'app') {
    +        return _app;
    +      }
    +
    +      // only return `_preprocessJs` here if it was previously set to a patched version
    +      if (property === 'preprocessJs' && _preprocessJs) {
    +        return _preprocessJs;
    +      }
    +
    +      // keep proxies from even trying to set or initialize addons
    +      if (property === 'initializeAddons') {
    +        return undefined;
    +      }
    +
    +      // See the {@link index.js} file for a discussion of why the proxy 'addons'
    +      // property returns an empty array.
    +      if (property === 'addons') {
    +        return [];
    +      }
    +
    +      // allow access to the property pointing to the real instance.
    +      if (property === TARGET_INSTANCE) {
    +        return targetCacheEntry[TARGET_INSTANCE];
    +      }
    +
    +      // `included` will be called on the "real" addon, so there's no need for it to be
    +      // called again; instead we return a no-op implementation here
    +      if (property === 'included') {
    +        return () => undefined;
    +      }
    +
    +      if (targetCacheEntry[TARGET_INSTANCE]) {
    +        if (property !== 'constructor' && typeof targetCacheEntry[TARGET_INSTANCE][property] === 'function') {
    +          // If we fall through to the Reflect.get just below, the 'this' context of the function when
    +          // invoked is the proxy, not the original instance (so its local state is incorrect).
    +          // Wrap the original methods to maintain the correct 'this' context.
    +          return function _originalAddonPropMethodWrapper() {
    +            let originalReturnValue = targetCacheEntry[TARGET_INSTANCE][property](...arguments);
    +
    +            if (property === 'cacheKeyForTree') {
    +              const treeType = arguments[0];
    +              validateCacheKey(targetCacheEntry[TARGET_INSTANCE], treeType, originalReturnValue);
    +            }
    +
    +            return originalReturnValue;
    +          };
    +        }
    +
    +        return Reflect.get(targetCacheEntry[TARGET_INSTANCE], property);
    +      }
    +
    +      return Reflect.get(targetCacheEntry, property);
    +    },
    +    set(targetCacheEntry, property, value) {
    +      if (property === 'app') {
    +        _app = value;
    +        return true;
    +      }
    +
    +      if (property === 'preprocessJs') {
    +        _preprocessJs = value;
    +        return true;
    +      }
    +
    +      if (targetCacheEntry[TARGET_INSTANCE]) {
    +        return Reflect.set(targetCacheEntry[TARGET_INSTANCE], property, value);
    +      }
    +
    +      return Reflect.set(targetCacheEntry, property, value);
    +    },
    +  });
    +}
    +
    +module.exports = { getAddonProxy };
    +
    +
    + +
    +
    +
    +
    + + + + + diff --git a/api/files/lib_models_per-bundle-addon-cache_index.js.html b/api/files/lib_models_per-bundle-addon-cache_index.js.html new file mode 100644 index 0000000..c33cb86 --- /dev/null +++ b/api/files/lib_models_per-bundle-addon-cache_index.js.html @@ -0,0 +1,482 @@ + + + + + lib/models/per-bundle-addon-cache/index.js - ember-cli + + + + + + +
    +
    + + +
    +
    +

    lib/models/per-bundle-addon-cache/index.js

    +
    + +
    +'use strict';
    +
    +const fs = require('fs');
    +const path = require('path');
    +const isLazyEngine = require('../../utilities/is-lazy-engine');
    +const { getAddonProxy } = require('./addon-proxy');
    +const logger = require('heimdalljs-logger')('ember-cli:per-bundle-addon-cache');
    +const { TARGET_INSTANCE } = require('./target-instance');
    +
    +function defaultAllowCachingPerBundle({ addonEntryPointModule }) {
    +  return (
    +    addonEntryPointModule.allowCachingPerBundle ||
    +    (addonEntryPointModule.prototype && addonEntryPointModule.prototype.allowCachingPerBundle)
    +  );
    +}
    +
    +/**
    + * Resolves the perBundleAddonCacheUtil; this prefers the custom provided version by
    + * the consuming application, and defaults to an internal implementation here.
    + *
    + * @method resolvePerBundleAddonCacheUtil
    + * @param {Project} project
    + * @return {{allowCachingPerBundle: Function}}
    + */
    +function resolvePerBundleAddonCacheUtil(project) {
    +  const relativePathToUtil =
    +    project.pkg && project.pkg['ember-addon'] && project.pkg['ember-addon'].perBundleAddonCacheUtil;
    +
    +  if (typeof relativePathToUtil === 'string') {
    +    const absolutePathToUtil = path.resolve(project.root, relativePathToUtil);
    +
    +    if (!fs.existsSync(absolutePathToUtil)) {
    +      throw new Error(
    +        `[ember-cli] the provided \`${relativePathToUtil}\` for \`ember-addon.perBundleAddonCacheUtil\` does not exist`
    +      );
    +    }
    +
    +    return require(absolutePathToUtil);
    +  }
    +
    +  return {
    +    allowCachingPerBundle: defaultAllowCachingPerBundle,
    +  };
    +}
    +
    +/**
    + * For large applications with many addons (and many instances of each, resulting in
    + * potentially many millions of addon instances during a build), the build can become
    + * very, very slow (tens of minutes) partially due to the sheer number of addon instances.
    + * The PerBundleAddonCache deals with this slowness by doing 3 things:
    + *
    + * (1) Making only a single copy of each of certain addons and their dependent addons
    + * (2) Replacing any other instances of those addons with Proxy copies to the single instance
    + * (3) Having the Proxies return an empty array for their dependent addons, rather
    + *     than proxying to the contents of the single addon instance. This gives up the
    + *     ability of the Proxies to traverse downward into their child addons,
    + *     something that many addons do not do anyway, for the huge reduction in duplications
    + *     of those child addons. For applications that enable `ember-engines` dedupe logic,
    + *     that logic is stateful, and having the Proxies allow access to the child addons array
    + *     just breaks everything, because that logic will try multiple times to remove items
    + *     it thinks are duplicated, messing up the single copy of the child addon array.
    + *     See the explanation of the dedupe logic in
    + *    {@link https://github.com/ember-engines/ember-engines/blob/master/packages/ember-engines/lib/utils/deeply-non-duplicated-addon.js}
    + *
    + * What follows are the more technical details of how the PerBundleAddonCache implements
    + * the above 3 behaviors.
    + *
    + * This class supports per-bundle-host (bundle host = project or lazy engine)
    + * caching of addon instances. During addon initialization we cannot add a
    + * cache to each bundle host object AFTER it is instantiated because running the
    + * addon constructor ultimately causes Addon class `setupRegistry` code to
    + * run which instantiates child addons, which need the cache to already be
    + * in place for the parent bundle host.
    + * We handle this by providing a global cache that exists independent of the
    + * bundle host objects. That is this object.
    + *
    + * There are a number of "behaviors" being implemented by this object and
    + * its contents. They are:
    + * (1) Any addon that is a lazy engine has only a single real instance per
    + * project - all other references to the lazy engine are to be proxies. These
    + * lazy engines are compared by name, not by packageInfo.realPath.
    + * (2) Any addon that is not a lazy engine, there is only a single real instance
    + * of the addon per "bundle host" (i.e. lazy engine or project).
    + * (3) An optimization - any addon that is in a lazy engine but that is also
    + * in bundled by its LCA host - the single instance is the one bundled by this
    + * host. All other instances (in any lazy engine) are proxies.
    + *
    + * NOTE: the optimization is only enabled if the environment variable that controls
    + * `ember-engines` transitive deduplication (process.env.EMBER_ENGINES_ADDON_DEDUPE)
    + * is set to a truthy value. For more info, see:
    + * https://github.com/ember-engines/ember-engines/blob/master/packages/ember-engines/lib/engine-addon.js#L396
    + *
    + * @public
    + * @class PerBundleAddonCache
    + */
    +class PerBundleAddonCache {
    +  constructor(project) {
    +    this.project = project;
    +
    +    // The cache of bundle-host package infos and their individual addon caches.
    +    // The cache is keyed by package info (representing a bundle host (project or
    +    // lazy engine)) and an addon instance cache to bundle with that bundle host.
    +    this.bundleHostCache = new Map();
    +
    +    // Indicate if ember-engines transitive dedupe is enabled.
    +    this.engineAddonTransitiveDedupeEnabled = !!process.env.EMBER_ENGINES_ADDON_DEDUPE;
    +    this._perBundleAddonCacheUtil = resolvePerBundleAddonCacheUtil(this.project);
    +
    +    // For stats purposes, counts on the # addons and proxies created. Addons we
    +    // can compare against the bundleHostCache addon caches. Proxies, not so much,
    +    // but we'll count them here.
    +    this.numAddonInstances = 0;
    +    this.numProxies = 0;
    +  }
    +
    +  /**
    +   * The default implementation here is to indicate if the original addon entry point has
    +   * the `allowCachingPerBundle` flag set either on itself or on its prototype.
    +   *
    +   * If a consuming application specifies a relative path to a custom utility via the
    +   * `ember-addon.perBundleAddonCacheUtil` configuration, we prefer the custom implementation
    +   * provided by the consumer.
    +   *
    +   * @method allowCachingPerBundle
    +   * @param {Object|Function} addonEntryPointModule
    +   * @return {Boolean} true if the given constructor function or class supports caching per bundle, false otherwise
    +   */
    +  allowCachingPerBundle(addonEntryPointModule) {
    +    return this._perBundleAddonCacheUtil.allowCachingPerBundle({ addonEntryPointModule });
    +  }
    +
    +  /**
    +   * Creates a cache entry for the bundleHostCache. Because we want to use the same sort of proxy
    +   * for both bundle hosts and for 'regular' addon instances (though their cache entries have
    +   * slightly different structures) we'll use the Symbol from getAddonProxy.
    +   *
    +   * @method createBundleHostCacheEntry
    +   * @param {PackageInfo} bundleHostPkgInfo bundle host's pkgInfo.realPath
    +   * @return {Object} an object in the form of a bundle-host cache entry
    +   */
    +  createBundleHostCacheEntry(bundleHostPkgInfo) {
    +    return { [TARGET_INSTANCE]: null, realPath: bundleHostPkgInfo.realPath, addonInstanceCache: new Map() };
    +  }
    +
    +  /**
    +   * Create a cache entry object for a given (non-bundle-host) addon to put into
    +   * an addon cache.
    +   *
    +   * @method createAddonCacheEntry
    +   * @param {Addon} addonInstance the addon instance to cache
    +   * @param {String} addonRealPath the addon's pkgInfo.realPath
    +   * @return {Object} an object in the form of an addon-cache entry
    +   */
    +  createAddonCacheEntry(addonInstance, addonRealPath) {
    +    return { [TARGET_INSTANCE]: addonInstance, realPath: addonRealPath };
    +  }
    +
    +  /**
    +   * Given a parent object of a potential addon (another addon or the project),
    +   * go up the 'parent' chain to find the potential addon's bundle host object
    +   * (i.e. lazy engine or project.) Because Projects are always bundle hosts,
    +   * this should always pass, but we'll throw if somehow it doesn't work.
    +   *
    +   * @method findBundleHost
    +   * @param {Project|Addon} addonParent the direct parent object of a (potential or real) addon.
    +   * @param {PackageInfo} addonPkgInfo the PackageInfo for an addon being instantiated. This is only
    +   * used for information if an error is going to be thrown.
    +   * @return {Object} the object in the 'parent' chain that is a bundle host.
    +   * @throws {Error} if there is not bundle host
    +   */
    +  findBundleHost(addonParent, addonPkgInfo) {
    +    let curr = addonParent;
    +
    +    while (curr) {
    +      if (curr === this.project) {
    +        return curr;
    +      }
    +
    +      if (isLazyEngine(curr)) {
    +        // if we're building a lazy engine in isolation, prefer that the bundle host is
    +        // the project, not the lazy engine addon instance
    +        if (curr.parent === this.project && curr._packageInfo === this.project._packageInfo) {
    +          return this.project;
    +        }
    +
    +        return curr;
    +      }
    +
    +      curr = curr.parent;
    +    }
    +
    +    // the following should not be able to happen given that Projects are always
    +    // bundle hosts, but just in case, throw an error if we didn't find one.
    +    throw new Error(`Addon at path\n  ${addonPkgInfo.realPath}\n has 'allowCachingPerBundle' but has no bundleHost`);
    +  }
    +
    +  /**
    +   * An optimization we support from lazy engines is the following:
    +   *
    +   * If an addon instance is supposed to be bundled with a particular lazy engine, and
    +   * same addon is also to be bundled by a common LCA host, prefer the one bundled by the
    +   * host (since it's ultimately going to be deduped later by `ember-engines`).
    +   *
    +   * NOTE: this only applies if this.engineAddonTransitiveDedupeEnabled is truthy. If it is not,
    +   * the bundle host always "owns" the addon instance.
    +   *
    +   * If deduping is enabled and the LCA host also depends on the same addon,
    +   * the lazy-engine instances of the addon will all be proxies to the one in
    +   * the LCA host. This function indicates whether the bundle host passed in
    +   * (either the project or a lazy engine) is really the bundle host to "own" the
    +   * new addon.
    +   *
    +   * @method bundleHostOwnsInstance
    +   * @param (Object} bundleHost the project or lazy engine that is trying to "own"
    +   * the new addon instance specified by addonPkgInfo
    +   * @param {PackageInfo} addonPkgInfo the PackageInfo of the potential new addon instance
    +   * @return {Boolean} true if the bundle host is to "own" the instance, false otherwise.
    +   */
    +  bundleHostOwnsInstance(bundleHost, addonPkgInfo) {
    +    if (isLazyEngine(bundleHost)) {
    +      return (
    +        !this.engineAddonTransitiveDedupeEnabled ||
    +        !this.project.hostInfoCache
    +          .getHostAddonInfo(bundleHost._packageInfo)
    +          .hostAndAncestorBundledPackageInfos.has(addonPkgInfo)
    +      );
    +    }
    +
    +    return true;
    +  }
    +
    +  findBundleOwner(bundleHost, addonPkgInfo) {
    +    if (bundleHost === this.project._packageInfo) {
    +      return bundleHost;
    +    }
    +
    +    let { hostPackageInfo, hostAndAncestorBundledPackageInfos } =
    +      this.project.hostInfoCache.getHostAddonInfo(bundleHost);
    +
    +    if (!hostAndAncestorBundledPackageInfos.has(addonPkgInfo)) {
    +      return bundleHost;
    +    }
    +
    +    return this.findBundleOwner(hostPackageInfo, addonPkgInfo);
    +  }
    +
    +  /**
    +   * Called from PackageInfo.getAddonInstance(), return an instance of the requested
    +   * addon or a Proxy, based on the type of addon and its bundle host.
    +   *
    +   * @method getAddonInstance
    +   * @param {Addon|Project} parent the parent Addon or Project this addon instance is
    +   * a child of.
    +   * @param {*} addonPkgInfo the PackageInfo for the addon being created.
    +   * @return {Addon|Proxy} An addon instance (for the first copy of the addon) or a Proxy.
    +   * An addon that is a lazy engine will only ever have a single copy in the cache.
    +   * An addon that is not will have 1 copy per bundle host (Project or lazy engine),
    +   * except if it is an addon that's also owned by a given LCA host and transitive
    +   * dedupe is enabled (`engineAddonTransitiveDedupeEnabled`), in which case it will
    +   * only have a single copy in the project's addon cache.
    +   */
    +  getAddonInstance(parent, addonPkgInfo) {
    +    // If the new addon is itself a bundle host (i.e. lazy engine), there is only one
    +    // instance of the bundle host, and it's in the entries of the bundleHostCache, outside
    +    // of the 'regular' addon caches. Because 'setupBundleHostCache' ran during construction,
    +    // we know that an entry is in the cache with this engine name.
    +    if (addonPkgInfo.isForBundleHost()) {
    +      let cacheEntry = this._getBundleHostCacheEntry(addonPkgInfo);
    +
    +      if (cacheEntry[TARGET_INSTANCE]) {
    +        logger.debug(`About to construct BR PROXY to cache entry for addon at: ${addonPkgInfo.realPath}`);
    +        this.numProxies++;
    +        return getAddonProxy(cacheEntry, parent);
    +      } else {
    +        // create an instance, put it in the pre-existing cache entry, then
    +        // return it (as the first instance of the lazy engine.)
    +        logger.debug(`About to fill in BR EXISTING cache entry for addon at: ${addonPkgInfo.realPath}`);
    +        this.numAddonInstances++;
    +        let addon = addonPkgInfo.constructAddonInstance(parent, this.project);
    +        cacheEntry[TARGET_INSTANCE] = addon; // cache BEFORE initializing child addons
    +        addonPkgInfo.initChildAddons(addon);
    +        return addon;
    +      }
    +    }
    +
    +    // We know now we're asking for a 'regular' (non-bundle-host) addon instance.
    +
    +    let bundleHost = this.findBundleHost(parent, addonPkgInfo);
    +
    +    // if the bundle host "owns" the new addon instance
    +    //   * Do we already have an instance of the addon cached?
    +    //     * If so, make a proxy for it.
    +    //     * If not, make a new instance of the addon and cache it in the
    +    //       bundle host's addon cache.
    +    // If not, it means the bundle host is a lazy engine but the LCA host also uses
    +    // the addon and deduping is enabled
    +    //   * If the LCA host already has a cached entry, return a proxy to that
    +    //   * If it does not, create a 'blank' cache entry and return a proxy to that.
    +    //     When the addon is encountered later when processing the LCA host's addons,
    +    //     fill in the instance.
    +    if (this.bundleHostOwnsInstance(bundleHost, addonPkgInfo)) {
    +      let bundleHostCacheEntry = this._getBundleHostCacheEntry(bundleHost._packageInfo);
    +      let addonInstanceCache = bundleHostCacheEntry.addonInstanceCache;
    +      let addonCacheEntry = addonInstanceCache.get(addonPkgInfo.realPath);
    +      let addonInstance;
    +
    +      if (addonCacheEntry) {
    +        if (addonCacheEntry[TARGET_INSTANCE]) {
    +          logger.debug(`About to construct REGULAR ADDON PROXY for addon at: ${addonPkgInfo.realPath}`);
    +          this.numProxies++;
    +          return getAddonProxy(addonCacheEntry, parent);
    +        } else {
    +          // the cache entry was created 'empty' by an earlier call, indicating
    +          // an addon that is used in a lazy engine but also used by its LCA host,
    +          // and we're now creating the instance for the LCA host.
    +          // Fill in the entry and return the new instance.
    +          logger.debug(`About to fill in REGULAR ADDON EXISTING cache entry for addon at: ${addonPkgInfo.realPath}`);
    +          this.numAddonInstances++;
    +          addonInstance = addonPkgInfo.constructAddonInstance(parent, this.project);
    +          addonCacheEntry[TARGET_INSTANCE] = addonInstance; // cache BEFORE initializing child addons
    +          addonPkgInfo.initChildAddons(addonInstance);
    +          return addonInstance;
    +        }
    +      }
    +
    +      // There is no entry for this addon in the bundleHost's addon cache. Create a new
    +      // instance, cache it in the addon cache, and return it.
    +      logger.debug(`About to construct REGULAR ADDON NEW cache entry for addon at: ${addonPkgInfo.realPath}`);
    +      this.numAddonInstances++;
    +      addonInstance = addonPkgInfo.constructAddonInstance(parent, this.project);
    +      addonCacheEntry = this.createAddonCacheEntry(addonInstance, addonPkgInfo.realPath);
    +      addonInstanceCache.set(addonPkgInfo.realPath, addonCacheEntry); // cache BEFORE initializing child addons
    +      addonPkgInfo.initChildAddons(addonInstance);
    +      return addonInstance;
    +    } else {
    +      // The bundleHost is not the project but the some ancestor bundles the addon and
    +      // deduping is enabled, so the cache entry needs to go in the bundle owner's cache.
    +      // Get/create an empty cache entry and return a proxy to it. The bundle owner will
    +      // set the instance later (see above).
    +      let bundleHostCacheEntry = this._getBundleHostCacheEntry(
    +        this.findBundleOwner(bundleHost._packageInfo, addonPkgInfo)
    +      );
    +      let addonCacheEntry = bundleHostCacheEntry.addonInstanceCache.get(addonPkgInfo.realPath);
    +
    +      if (!addonCacheEntry) {
    +        logger.debug(`About to construct REGULAR ADDON EMPTY cache entry for addon at: ${addonPkgInfo.realPath}`);
    +        addonCacheEntry = this.createAddonCacheEntry(null, addonPkgInfo.realPath);
    +        bundleHostCacheEntry.addonInstanceCache.set(addonPkgInfo.realPath, addonCacheEntry);
    +      }
    +
    +      logger.debug(`About to construct REGULAR ADDON PROXY for EMPTY addon at: ${addonPkgInfo.realPath}`);
    +      this.numProxies++;
    +      return getAddonProxy(addonCacheEntry, parent);
    +    }
    +  }
    +
    +  getPathsToAddonsOptedIn() {
    +    const addonSet = new Set();
    +
    +    for (const [, { addonInstanceCache }] of this.bundleHostCache) {
    +      Array.from(addonInstanceCache.keys()).forEach((realPath) => {
    +        addonSet.add(realPath);
    +      });
    +    }
    +
    +    return Array.from(addonSet);
    +  }
    +
    +  _getBundleHostCacheEntry(pkgInfo) {
    +    let cacheEntry = this.bundleHostCache.get(pkgInfo);
    +
    +    if (!cacheEntry) {
    +      cacheEntry = this.createBundleHostCacheEntry(pkgInfo);
    +      this.bundleHostCache.set(pkgInfo, cacheEntry);
    +    }
    +
    +    return cacheEntry;
    +  }
    +
    +  // Support for per-bundle addon caching is GLOBAL opt OUT (unless you explicitly set
    +  // EMBER_CLI_ADDON_INSTANCE_CACHING to false, it will be enabled.) If you opt out, that
    +  // overrides setting `allowCachingPerBundle` for any particular addon type to true.
    +  // To help make testing easier, we'll expose the setting as a function so it can be
    +  // called multiple times and evaluate each time.
    +  static isEnabled() {
    +    return process.env.EMBER_CLI_ADDON_INSTANCE_CACHING !== 'false';
    +  }
    +}
    +
    +module.exports = PerBundleAddonCache;
    +
    +
    + +
    +
    +
    +
    + + + + + diff --git a/api/files/lib_models_per-bundle-addon-cache_target-instance.js.html b/api/files/lib_models_per-bundle-addon-cache_target-instance.js.html new file mode 100644 index 0000000..956bf95 --- /dev/null +++ b/api/files/lib_models_per-bundle-addon-cache_target-instance.js.html @@ -0,0 +1,107 @@ + + + + + lib/models/per-bundle-addon-cache/target-instance.js - ember-cli + + + + + + +
    +
    + + +
    +
    +

    lib/models/per-bundle-addon-cache/target-instance.js

    +
    + +
    +'use strict';
    +
    +/**
    + * A Symbol constant for sharing between index.js and addon-proxy.js rather than
    + * putting the symbol into the Symbol global cache. The symbol is used in per-bundle
    + * cache entries to refer to the field that points at the real instance that a Proxy
    + * refers to.
    + *
    + * @type Symbol
    + * @private
    + * @final
    + */
    +const TARGET_INSTANCE = Symbol('_targetInstance_');
    +
    +module.exports.TARGET_INSTANCE = TARGET_INSTANCE;
    +
    +
    + +
    +
    +
    +
    + + + + + diff --git a/api/files/lib_models_project.js.html b/api/files/lib_models_project.js.html index 3f081f6..4e35b4c 100644 --- a/api/files/lib_models_project.js.html +++ b/api/files/lib_models_project.js.html @@ -42,7 +42,6 @@

    Classes

  • Builder
  • CLI
  • Command
  • -
  • CommandGenerator
  • DefaultPackager
  • EmberAddon
  • EmberApp
  • @@ -51,10 +50,9 @@

    Classes

  • Instrumentation
  • NodeModulesList
  • NpmTask
  • -
  • PackageCache
  • PackageInfo
  • PackageInfoCache
  • -
  • PrivateTestHelpers
  • +
  • PerBundleAddonCache
  • Project
  • ServeFilesAddon
  • TestsServerAddon
  • @@ -69,7 +67,7 @@

    Classes

    - Version: 3.21.2 + Version: 5.4.0-a905f346b9
    @@ -90,15 +88,15 @@

    lib/models/project.js

    const findup = require('find-up'); const resolve = util.promisify(require('resolve')); const fs = require('fs-extra'); -const _ = require('ember-cli-lodash-subset'); +const { cloneDeep, merge, forOwn } = require('ember-cli-lodash-subset'); const logger = require('heimdalljs-logger')('ember-cli:project'); const versionUtils = require('../utilities/version-utils'); const emberCLIVersion = versionUtils.emberCLIVersion; -const findAddonByName = require('../utilities/find-addon-by-name'); const heimdall = require('heimdalljs'); -const PackageInfoCache = require('../models/package-info-cache'); - -const instantiateAddons = require('../models/instantiate-addons'); +const PackageInfoCache = require('./package-info-cache'); +const PerBundleAddonCache = require('./per-bundle-addon-cache'); +const instantiateAddons = require('./instantiate-addons'); +const HostInfoCache = require('./host-info-cache'); let processCwd = process.cwd(); @@ -128,15 +126,15 @@

    lib/models/project.js

    this.addonPackages = Object.create(null); this.addons = []; this.liveReloadFilterPatterns = []; - this.setupBowerDirectory(); this.configCache = new Map(); + this.hostInfoCache = new HostInfoCache(this); /** Set when the `Watcher.detectWatchman` helper method finishes running, so that other areas of the system can be aware that watchman is being used. For example, this information is used in the broccoli build pipeline to know - if we can watch additional directories (like bower_components) "cheaply". + if we can watch additional directories "cheaply". Contains `enabled` and `version`. @@ -178,30 +176,10 @@

    lib/models/project.js

    if (this.packageInfoCache.hasErrors()) { this.packageInfoCache.showErrors(); } - } - - /** - * Sets the name of the bower directory for this project - * - * @private - * @method setupBowerDirectory - */ - setupBowerDirectory() { - let bowerrcPath = path.join(this.root, '.bowerrc'); - - logger.info('bowerrc path: %s', bowerrcPath); - if (fs.existsSync(bowerrcPath)) { - try { - this.bowerDirectory = fs.readJsonSync(bowerrcPath).directory; - } catch (exception) { - logger.info('failed to parse bowerc: %s', exception); - this.bowerDirectory = null; - } + if (PerBundleAddonCache.isEnabled()) { + this.perBundleAddonCache = new PerBundleAddonCache(this); } - - this.bowerDirectory = this.bowerDirectory || 'bower_components'; - logger.info('bowerDirectory: %s', this.bowerDirectory); } // Checks whether the project's npm dependencies are @@ -285,7 +263,7 @@

    lib/models/project.js

    @return {Boolean} Whether or not this is an Ember CLI Addon. */ isEmberCLIAddon() { - return !!this.pkg.keywords && this.pkg.keywords.indexOf('ember-addon') > -1; + return !!this.pkg && !!this.pkg.keywords && this.pkg.keywords.indexOf('ember-addon') > -1; } /** @@ -321,7 +299,7 @@

    lib/models/project.js

    config = this.configWithoutCache(_env); this.configCache.set(key, config); } - return _.cloneDeep(config); + return cloneDeep(config); } /** @@ -337,7 +315,7 @@

    lib/models/project.js

    let appConfig = this.require(configPath)(env); let addonsConfig = this.getAddonsConfig(env, appConfig); - return _.merge(addonsConfig, appConfig); + return merge(addonsConfig, appConfig); } else { return this.getAddonsConfig(env, {}); } @@ -365,7 +343,7 @@

    lib/models/project.js

    if (fs.existsSync(`${targetsPath}.js`)) { this._targets = this.require(targetsPath); } else { - this._targets = require('../utilities/default-targets'); + this._targets = { browsers: ['last 1 Chrome versions', 'last 1 Firefox versions', 'last 1 Safari versions'] }; } return this._targets; } @@ -382,11 +360,11 @@

    lib/models/project.js

    getAddonsConfig(env, appConfig) { this.initializeAddons(); - let initialConfig = _.merge({}, appConfig); + let initialConfig = merge({}, appConfig); return this.addons.reduce((config, addon) => { if (addon.config) { - _.merge(config, addon.config(env, config)); + merge(config, addon.config(env, config)); } return config; @@ -454,22 +432,6 @@

    lib/models/project.js

    return Object.assign({}, devDependencies, pkg['dependencies']); } - /** - Returns the bower dependencies for this project. - - @private - @method bowerDependencies - @param {String} bower Path to bower.json - @return {Object} Bower dependencies - */ - bowerDependencies(bower) { - if (!bower) { - let bowerPath = path.join(this.root, 'bower.json'); - bower = fs.existsSync(bowerPath) ? require(bowerPath) : {}; - } - return Object.assign({}, bower['devDependencies'], bower['dependencies']); - } - /** Provides the list of paths to consult for addons that may be provided internally to this project. Used for middleware addons with built-in support. @@ -507,17 +469,15 @@

    lib/models/project.js

    */ discoverAddons() { if (this._didDiscoverAddons) { - this._didDiscoverAddons = true; return; } + this._didDiscoverAddons = true; - let pkgInfo = this.packageInfoCache.getEntry(this.root); - - let addonPackageList = pkgInfo.discoverProjectAddons(); - this.addonPackages = pkgInfo.generateAddonPackages(addonPackageList); + let addonPackageList = this._packageInfo.discoverProjectAddons(); + this.addonPackages = this._packageInfo.generateAddonPackages(addonPackageList); // in case any child addons are invalid, dump to the console about them. - pkgInfo.dumpInvalidAddonPackages(addonPackageList); + this._packageInfo.dumpInvalidAddonPackages(addonPackageList); } /** @@ -531,6 +491,7 @@

    lib/models/project.js

    return; } this._addonsInitialized = true; + this._didDiscoverAddons = false; logger.info('initializeAddons for: %s', this.name()); @@ -600,7 +561,7 @@

    lib/models/project.js

    this.initializeAddons(); let addonCommands = this.addonCommands(); - _.forOwn(addonCommands, (commands, addonName) => callback(addonName, commands)); + forOwn(addonCommands, (commands, addonName) => callback(addonName, commands)); } } @@ -657,7 +618,8 @@

    lib/models/project.js

    } /** - Reloads package.json + Reloads package.json of the project. Clears and reloads the packageInfo and + per-bundle addon cache, too. @private @method reloadPkg @@ -671,6 +633,15 @@

    lib/models/project.js

    this.packageInfoCache.reloadProjects(); + // update `_packageInfo` after reloading projects from the `PackageInfoCache` instance + // if we don't do this we get into a state where `_packageInfo` is referencing the old + // pkginfo object that hasn't been updated/reloaded + this._packageInfo = this.packageInfoCache.loadProject(this); + + if (PerBundleAddonCache.isEnabled()) { + this.perBundleAddonCache = new PerBundleAddonCache(this); + } + return this.pkg; } @@ -683,6 +654,7 @@

    lib/models/project.js

    reloadAddons() { this.reloadPkg(); this._addonsInitialized = false; + this._didDiscoverAddons = false; return this.initializeAddons(); } @@ -697,14 +669,14 @@

    lib/models/project.js

    findAddonByName(name) { this.initializeAddons(); - return findAddonByName(this.addons, name); + return this.addons.find((addon) => addon.pkg?.name === name); } /** Generate test file contents. This method is supposed to be overwritten by test framework addons - like `ember-qunit` and `ember-mocha`. + like `ember-qunit`. @public @method generateTestFile @@ -725,9 +697,13 @@

    lib/models/project.js

    } /** - Returns a new project based on the first package.json that is found + Returns a new project based on the first `package.json` that is found in `pathName`. + If the above `package.json` specifies `ember-addon.projectRoot`, we load + the project based on the relative path between this directory and the + specified `projectRoot`. + @private @static @method closestSync @@ -741,15 +717,26 @@

    lib/models/project.js

    let ui = ensureUI(_ui); let directory = findupPath(pathName); + let pkg = fs.readJsonSync(path.join(directory, 'package.json')); logger.info('found package.json at %s', directory); + // allow `package.json` files to specify where the actual project lives + if (pkg && pkg['ember-addon'] && typeof pkg['ember-addon'].projectRoot === 'string') { + if (fs.existsSync(path.join(directory, 'ember-cli-build.js'))) { + throw new Error( + `Both \`ember-addon.projectRoot\` and \`ember-cli-build.js\` exist as part of \`${directory}\`` + ); + } + + return Project.closestSync(path.join(directory, pkg['ember-addon'].projectRoot), _ui, _cli); + } + let relative = path.relative(directory, pathName); if (relative.indexOf('tmp') === 0) { logger.info('ignoring parent project since we are in the tmp folder of the project'); return Project.nullProject(_ui, _cli); } - let pkg = fs.readJsonSync(path.join(directory, 'package.json')); logger.info('project name: %s', pkg && pkg.name); if (!isEmberCliProject(pkg)) { diff --git a/api/files/lib_models_task.js.html b/api/files/lib_models_task.js.html index baaac6f..2dc1458 100644 --- a/api/files/lib_models_task.js.html +++ b/api/files/lib_models_task.js.html @@ -42,7 +42,6 @@

    Classes

  • Builder
  • CLI
  • Command
  • -
  • CommandGenerator
  • DefaultPackager
  • EmberAddon
  • EmberApp
  • @@ -51,10 +50,9 @@

    Classes

  • Instrumentation
  • NodeModulesList
  • NpmTask
  • -
  • PackageCache
  • PackageInfo
  • PackageInfoCache
  • -
  • PrivateTestHelpers
  • +
  • PerBundleAddonCache
  • Project
  • ServeFilesAddon
  • TestsServerAddon
  • @@ -69,7 +67,7 @@

    Classes

    - Version: 3.21.2 + Version: 5.4.0-a905f346b9
    @@ -97,7 +95,7 @@

    lib/models/task.js

    * @method onInterrupt */ onInterrupt() { - // eslint-disable-next-line no-process-exit + // eslint-disable-next-line n/no-process-exit process.exit(1); } } diff --git a/api/files/lib_tasks_build-watch.js.html b/api/files/lib_tasks_build-watch.js.html index 213bd6f..ad7678b 100644 --- a/api/files/lib_tasks_build-watch.js.html +++ b/api/files/lib_tasks_build-watch.js.html @@ -42,7 +42,6 @@

    Classes

  • Builder
  • CLI
  • Command
  • -
  • CommandGenerator
  • DefaultPackager
  • EmberAddon
  • EmberApp
  • @@ -51,10 +50,9 @@

    Classes

  • Instrumentation
  • NodeModulesList
  • NpmTask
  • -
  • PackageCache
  • PackageInfo
  • PackageInfoCache
  • -
  • PrivateTestHelpers
  • +
  • PerBundleAddonCache
  • Project
  • ServeFilesAddon
  • TestsServerAddon
  • @@ -69,7 +67,7 @@

    Classes

    - Version: 3.21.2 + Version: 5.4.0-a905f346b9
    @@ -83,6 +81,7 @@

    lib/tasks/build-watch.js

    'use strict'; const chalk = require('chalk'); +const path = require('path'); const Task = require('../models/task'); const Watcher = require('../models/watcher'); const Builder = require('../models/builder'); @@ -116,12 +115,14 @@

    lib/tasks/build-watch.js

    let watcher = options._watcher || - new Watcher({ - ui, - builder, - analytics: this.analytics, - options, - }); + ( + await Watcher.build({ + ui, + builder, + options, + ignored: [path.resolve(this.project.root, options.outputPath)], + }) + ).watcher; await watcher; // Run until failure or signal to exit diff --git a/api/files/lib_tasks_npm-task.js.html b/api/files/lib_tasks_npm-task.js.html index 398a208..b9e24ef 100644 --- a/api/files/lib_tasks_npm-task.js.html +++ b/api/files/lib_tasks_npm-task.js.html @@ -42,7 +42,6 @@

    Classes

  • Builder
  • CLI
  • Command
  • -
  • CommandGenerator
  • DefaultPackager
  • EmberAddon
  • EmberApp
  • @@ -51,10 +50,9 @@

    Classes

  • Instrumentation
  • NodeModulesList
  • NpmTask
  • -
  • PackageCache
  • PackageInfo
  • PackageInfoCache
  • -
  • PrivateTestHelpers
  • +
  • PerBundleAddonCache
  • Project
  • ServeFilesAddon
  • TestsServerAddon
  • @@ -69,7 +67,7 @@

    Classes

    - Version: 3.21.2 + Version: 5.4.0-a905f346b9
    @@ -82,13 +80,11 @@

    lib/tasks/npm-task.js

     'use strict';
     
    -// Runs `npm install` in cwd
    -
     const chalk = require('chalk');
     const execa = require('../utilities/execa');
     const semver = require('semver');
     const SilentError = require('silent-error');
    -const isYarnProject = require('../utilities/is-yarn-project');
    +const { isPnpmProject, isYarnProject } = require('../utilities/package-managers');
     
     const logger = require('heimdalljs-logger')('ember-cli:npm-task');
     
    @@ -106,8 +102,10 @@ 

    lib/tasks/npm-task.js

    // The command to run: can be 'install' or 'uninstall' this.command = ''; + } - this.versionConstraints = '3 || 4 || 5 || 6'; + get packageManagerOutputName() { + return this.packageManager.name; } npm(args) { @@ -120,10 +118,19 @@

    lib/tasks/npm-task.js

    return execa('yarn', args, { preferLocal: false }); } + pnpm(args) { + logger.info('pnpm: %j', args); + return execa('pnpm', args, { preferLocal: false }); + } + hasYarnLock() { return isYarnProject(this.project.root); } + hasPNPMLock() { + return isPnpmProject(this.project.root); + } + async checkYarn() { try { let result = await this.yarn(['--version']); @@ -131,14 +138,16 @@

    lib/tasks/npm-task.js

    if (semver.gte(version, '2.0.0')) { logger.warn('yarn --version: %s', version); - this.ui.writeWarnLine(`Yarn v2 is not fully supported. Proceeding with yarn: ${version}`); + let yarnConfig = await this.yarn(['config', 'get', 'nodeLinker']); + let nodeLinker = yarnConfig.stdout.trim(); + if (nodeLinker !== 'node-modules') { + this.ui.writeWarnLine(`Yarn v2 is not fully supported. Proceeding with yarn: ${version}`); + } } else { logger.info('yarn --version: %s', version); } - this.useYarn = true; - - return { yarnVersion: version }; + return { name: 'yarn', version }; } catch (error) { logger.error('yarn --version failed: %s', error); @@ -153,31 +162,35 @@

    lib/tasks/npm-task.js

    } } - async checkNpmVersion() { + async checkPNPM() { try { - let result = await this.npm(['--version']); + let result = await this.pnpm(['--version']); let version = result.stdout; - logger.info('npm --version: %s', version); - let ok = semver.satisfies(version, this.versionConstraints); - if (!ok) { - logger.warn('npm --version is outside of version constraint: %s', this.versionConstraints); + logger.info('pnpm --version: %s', version); - let below = semver.ltr(version, this.versionConstraints); - if (below) { - throw new SilentError( - 'Ember CLI is now using the global npm, but your npm version is outdated.\n' + - 'Please update your global npm version by running: npm install -g npm' - ); - } + return { name: 'pnpm', version }; + } catch (error) { + logger.error('pnpm --version failed: %s', error); - this.ui.writeWarnLine( - 'Ember CLI is using the global npm, but your npm version has not yet been ' + - 'verified to work with the current Ember CLI release.' + if (error.code === 'ENOENT') { + throw new SilentError( + 'Ember CLI is now using pnpm, but was not able to find it.\n' + + 'Please install pnpm using the instructions at https://pnpm.io/installation' ); } - return { npmVersion: version }; + throw error; + } + } + + async checkNpmVersion() { + try { + let result = await this.npm(['--version']); + let version = result.stdout; + logger.info('npm --version: %s', version); + + return { name: 'npm', version }; } catch (error) { logger.error('npm --version failed: %s', error); @@ -206,37 +219,55 @@

    lib/tasks/npm-task.js

    * @method findPackageManager * @return {Promise} */ - async findPackageManager() { - if (this.useYarn === true) { + async findPackageManager(packageManager = null) { + if (packageManager === 'yarn') { logger.info('yarn requested -> trying yarn'); return this.checkYarn(); } - if (this.useYarn === false) { + if (packageManager === 'npm') { logger.info('npm requested -> using npm'); return this.checkNpmVersion(); } - if (!this.hasYarnLock()) { - logger.info('yarn.lock not found -> using npm'); - return this.checkNpmVersion(); + if (packageManager === 'pnpm') { + logger.info('pnpm requested -> using pnpm'); + return this.checkPNPM(); } - logger.info('yarn.lock found -> trying yarn'); - try { - const yarnResult = await this.checkYarn(); - logger.info('yarn found -> using yarn'); - return yarnResult; - } catch (_err) { - logger.info('yarn not found -> using npm'); - return this.checkNpmVersion(); + if (this.hasYarnLock()) { + logger.info('yarn.lock found -> trying yarn'); + try { + const yarnResult = await this.checkYarn(); + logger.info('yarn found -> using yarn'); + return yarnResult; + } catch (_err) { + logger.info('yarn not found'); + } + } else { + logger.info('yarn.lock not found'); } + + if (await this.hasPNPMLock()) { + logger.info('pnpm-lock.yaml found -> trying pnpm'); + try { + let result = await this.checkPNPM(); + logger.info('pnpm found -> using pnpm'); + return result; + } catch (_err) { + logger.info('pnpm not found'); + } + } else { + logger.info('pnpm-lock.yaml not found'); + } + + logger.info('using npm'); + return this.checkNpmVersion(); } async run(options) { - this.useYarn = options.useYarn; + this.packageManager = await this.findPackageManager(options.packageManager); - let result = await this.findPackageManager(); let ui = this.ui; let startMessage = this.formatStartMessage(options.packages); let completeMessage = this.formatCompleteMessage(options.packages); @@ -247,31 +278,22 @@

    lib/tasks/npm-task.js

    ui.writeLine(prependEmoji('🚧', 'Installing packages... This might take a couple of minutes.')); ui.startProgress(chalk.green(startMessage)); - let promise; - if (this.useYarn) { - this.yarnVersion = result.yarnVersion; - let args = this.toYarnArgs(this.command, options); - promise = this.yarn(args); - } else { - let args = this.toNpmArgs(this.command, options); - promise = this.npm(args); - - // as of 2018-10-09 npm 5 and 6 _break_ the hierarchy of `node_modules` - // after a `npm install foo` (deletes files/folders other than - // what was directly installed) in some circumstances, see: - // - // * https://github.com/npm/npm/issues/16853 - // * https://github.com/npm/npm/issues/17379 - // - // this ensures that we run a full `npm install` **after** any `npm - // install foo` runs to ensure that we have a fully functional - // node_modules hierarchy - if (result.npmVersion && semver.lt(result.npmVersion, '5.7.1')) { - promise = promise.then(() => this.npm(['install'])); + try { + if (this.packageManager.name === 'yarn') { + let args = this.toYarnArgs(this.command, options); + await this.yarn(args); + } else if (this.packageManager.name === 'pnpm') { + let args = this.toPNPMArgs(this.command, options); + await this.pnpm(args); + } else { + let args = this.toNpmArgs(this.command, options); + await this.npm(args); } + } finally { + ui.stopProgress(); } - return promise.finally(() => ui.stopProgress()).then(() => ui.writeLine(chalk.green(completeMessage))); + ui.writeLine(chalk.green(completeMessage)); } toNpmArgs(command, options) { @@ -294,9 +316,9 @@

    lib/tasks/npm-task.js

    } if (options.verbose) { - args.push('--loglevel verbose'); + args.push('--loglevel', 'verbose'); } else { - args.push('--loglevel error'); + args.push('--loglevel', 'error'); } if (options.packages) { @@ -344,13 +366,43 @@

    lib/tasks/npm-task.js

    // Yarn v2 defaults to non-interactive // with an optional -i flag - if (semver.lt(this.yarnVersion, '2.0.0')) { + if (semver.lt(this.packageManager.version, '2.0.0')) { args.push('--non-interactive'); } return args; } + toPNPMArgs(command, options) { + let args = []; + + if (command === 'install') { + if (options.save) { + args.push('add'); + } else if (options['save-dev']) { + args.push('add', '--save-dev'); + } else if (options.packages) { + throw new Error(`npm command "${command} ${options.packages.join(' ')}" can not be translated to pnpm command`); + } else { + args.push('install'); + } + + if (options['save-exact']) { + args.push('--save-exact'); + } + } else if (command === 'uninstall') { + args.push('remove'); + } else { + throw new Error(`npm command "${command}" can not be translated to pnpm command`); + } + + if (options.packages) { + args = args.concat(options.packages); + } + + return args; + } + formatStartMessage(/* packages */) { return ''; } diff --git a/api/files/lib_tasks_serve.js.html b/api/files/lib_tasks_serve.js.html index 72534f2..0edf443 100644 --- a/api/files/lib_tasks_serve.js.html +++ b/api/files/lib_tasks_serve.js.html @@ -42,7 +42,6 @@

    Classes

  • Builder
  • CLI
  • Command
  • -
  • CommandGenerator
  • DefaultPackager
  • EmberAddon
  • EmberApp
  • @@ -51,10 +50,9 @@

    Classes

  • Instrumentation
  • NodeModulesList
  • NpmTask
  • -
  • PackageCache
  • PackageInfo
  • PackageInfoCache
  • -
  • PrivateTestHelpers
  • +
  • PerBundleAddonCache
  • Project
  • ServeFilesAddon
  • TestsServerAddon
  • @@ -69,7 +67,7 @@

    Classes

    - Version: 3.21.2 + Version: 5.4.0-a905f346b9
    @@ -137,23 +135,26 @@

    lib/tasks/serve.js

    let watcher = options._watcher || - new Watcher({ - ui: this.ui, - builder, - analytics: this.analytics, - options, - serving: true, - }); + ( + await Watcher.build({ + ui: this.ui, + builder, + options, + serving: true, + ignored: [path.resolve(this.project.root, options.outputPath)], + }) + ).watcher; let serverRoot = './server'; let serverWatcher = null; if (fs.existsSync(serverRoot)) { - serverWatcher = new ServerWatcher({ - ui: this.ui, - analytics: this.analytics, - watchedDir: path.resolve(serverRoot), - options, - }); + serverWatcher = ( + await ServerWatcher.build({ + ui: this.ui, + watchedDir: path.resolve(serverRoot), + options, + }) + ).watcher; } let expressServer = @@ -161,7 +162,6 @@

    lib/tasks/serve.js

    new ExpressServer({ ui: this.ui, project: this.project, - analytics: this.analytics, watcher, serverRoot, serverWatcher, diff --git a/api/files/lib_tasks_server_middleware_broccoli-serve-files_index.js.html b/api/files/lib_tasks_server_middleware_broccoli-serve-files_index.js.html index 11a311e..e152df0 100644 --- a/api/files/lib_tasks_server_middleware_broccoli-serve-files_index.js.html +++ b/api/files/lib_tasks_server_middleware_broccoli-serve-files_index.js.html @@ -42,7 +42,6 @@

    Classes

  • Builder
  • CLI
  • Command
  • -
  • CommandGenerator
  • DefaultPackager
  • EmberAddon
  • EmberApp
  • @@ -51,10 +50,9 @@

    Classes

  • Instrumentation
  • NodeModulesList
  • NpmTask
  • -
  • PackageCache
  • PackageInfo
  • PackageInfoCache
  • -
  • PrivateTestHelpers
  • +
  • PerBundleAddonCache
  • Project
  • ServeFilesAddon
  • TestsServerAddon
  • @@ -69,7 +67,7 @@

    Classes

    - Version: 3.21.2 + Version: 5.4.0-a905f346b9
    diff --git a/api/files/lib_tasks_server_middleware_broccoli-watcher_index.js.html b/api/files/lib_tasks_server_middleware_broccoli-watcher_index.js.html index 1094cb1..408087c 100644 --- a/api/files/lib_tasks_server_middleware_broccoli-watcher_index.js.html +++ b/api/files/lib_tasks_server_middleware_broccoli-watcher_index.js.html @@ -42,7 +42,6 @@

    Classes

  • Builder
  • CLI
  • Command
  • -
  • CommandGenerator
  • DefaultPackager
  • EmberAddon
  • EmberApp
  • @@ -51,10 +50,9 @@

    Classes

  • Instrumentation
  • NodeModulesList
  • NpmTask
  • -
  • PackageCache
  • PackageInfo
  • PackageInfoCache
  • -
  • PrivateTestHelpers
  • +
  • PerBundleAddonCache
  • Project
  • ServeFilesAddon
  • TestsServerAddon
  • @@ -69,7 +67,7 @@

    Classes

    - Version: 3.21.2 + Version: 5.4.0-a905f346b9
    @@ -109,20 +107,20 @@

    lib/tasks/server/middleware/broccoli-watcher/index.js

    autoIndex: false, // disable directory listings }); - let baseURL = options.rootURL === '' ? '/' : cleanBaseURL(options.rootURL || options.baseURL); + let rootURL = options.rootURL === '' ? '/' : cleanBaseURL(options.rootURL); - logger.info('serverMiddleware: baseURL: %s', baseURL); + logger.info('serverMiddleware: rootURL: %s', rootURL); app.use((req, res, next) => { let oldURL = req.url; let url = req.serveUrl || req.url; logger.info('serving: %s', url); - let actualPrefix = req.url.slice(0, baseURL.length - 1); // Don't care - let expectedPrefix = baseURL.slice(0, baseURL.length - 1); // about last slash + let actualPrefix = req.url.slice(0, rootURL.length - 1); // Don't care + let expectedPrefix = rootURL.slice(0, rootURL.length - 1); // about last slash if (actualPrefix === expectedPrefix) { - let urlToBeServed = url.slice(actualPrefix.length); // Remove baseURL prefix + let urlToBeServed = url.slice(actualPrefix.length); // Remove rootURL prefix req.url = urlToBeServed; logger.info('serving: (prefix stripped) %s, was: %s', urlToBeServed, url); diff --git a/api/files/lib_tasks_server_middleware_history-support_index.js.html b/api/files/lib_tasks_server_middleware_history-support_index.js.html index 9b52eb1..dc74639 100644 --- a/api/files/lib_tasks_server_middleware_history-support_index.js.html +++ b/api/files/lib_tasks_server_middleware_history-support_index.js.html @@ -42,7 +42,6 @@

    Classes

  • Builder
  • CLI
  • Command
  • -
  • CommandGenerator
  • DefaultPackager
  • EmberAddon
  • EmberApp
  • @@ -51,10 +50,9 @@

    Classes

  • Instrumentation
  • NodeModulesList
  • NpmTask
  • -
  • PackageCache
  • PackageInfo
  • PackageInfoCache
  • -
  • PrivateTestHelpers
  • +
  • PerBundleAddonCache
  • Project
  • ServeFilesAddon
  • TestsServerAddon
  • @@ -69,7 +67,7 @@

    Classes

    - Version: 3.21.2 + Version: 5.4.0-a905f346b9
    @@ -126,14 +124,22 @@

    lib/tasks/server/middleware/history-support/index.js

    let app = config.app; let options = config.options; let watcher = options.watcher; - - let baseURL = options.rootURL === '' ? '/' : cleanBaseURL(options.rootURL || options.baseURL); + let rootURL = options.rootURL === '' ? '/' : cleanBaseURL(options.rootURL); app.use(async (req, _, next) => { try { - const results = await watcher; + let results; + try { + results = await watcher; + } catch (e) { + // This means there was a build error, so we won't actually be serving + // index.html, and we have nothing to do. We have to catch it here, + // though, or it will go uncaught and cause the process to exit. + return; + } + if (this.shouldHandleRequest(req, options)) { - let assetPath = req.path.slice(baseURL.length); + let assetPath = req.path.slice(rootURL.length); let isFile = false; try { @@ -142,7 +148,7 @@

    lib/tasks/server/middleware/history-support/index.js

    /* ignore */ } if (!isFile) { - req.serveUrl = `${baseURL}index.html`; + req.serveUrl = `${rootURL}index.html`; } } } finally { @@ -160,9 +166,15 @@

    lib/tasks/server/middleware/history-support/index.js

    if (!hasHTMLHeader) { return false; } - let baseURL = options.rootURL === '' ? '/' : cleanBaseURL(options.rootURL || options.baseURL); - let baseURLRegexp = new RegExp(`^${baseURL}`); - return baseURLRegexp.test(req.path); + let rootURL = options.rootURL === '' ? '/' : cleanBaseURL(options.rootURL); + if (req.path.startsWith(rootURL)) { + return true; + } + // exactly match the rootURL without a trailing slash + if (req.path === rootURL.slice(0, -1)) { + return true; + } + return false; } } diff --git a/api/files/lib_tasks_server_middleware_tests-server_index.js.html b/api/files/lib_tasks_server_middleware_tests-server_index.js.html index 0a87335..63d0441 100644 --- a/api/files/lib_tasks_server_middleware_tests-server_index.js.html +++ b/api/files/lib_tasks_server_middleware_tests-server_index.js.html @@ -42,7 +42,6 @@

    Classes

  • Builder
  • CLI
  • Command
  • -
  • CommandGenerator
  • DefaultPackager
  • EmberAddon
  • EmberApp
  • @@ -51,10 +50,9 @@

    Classes

  • Instrumentation
  • NodeModulesList
  • NpmTask
  • -
  • PackageCache
  • PackageInfo
  • PackageInfoCache
  • -
  • PrivateTestHelpers
  • +
  • PerBundleAddonCache
  • Project
  • ServeFilesAddon
  • TestsServerAddon
  • @@ -69,7 +67,7 @@

    Classes

    - Version: 3.21.2 + Version: 5.4.0-a905f346b9
    @@ -90,7 +88,7 @@

    lib/tasks/server/middleware/tests-server/index.js

    module.exports = class TestsServerAddon { /** * This addon is used to serve the QUnit or Mocha test runner - * at `baseURL + '/tests'`. + * at `rootURL + '/tests'`. * * @class TestsServerAddon * @constructor @@ -104,9 +102,8 @@

    lib/tasks/server/middleware/tests-server/index.js

    let app = config.app; let options = config.options; let watcher = options.watcher; - - let baseURL = options.rootURL === '' ? '/' : cleanBaseURL(options.rootURL || options.baseURL); - let testsPath = `${baseURL}tests`; + let rootURL = options.rootURL === '' ? '/' : cleanBaseURL(options.rootURL); + let testsPath = `${rootURL}tests`; app.use(async (req, _, next) => { let results; @@ -124,7 +121,7 @@

    lib/tasks/server/middleware/tests-server/index.js

    } if (watcherSuccess) { - rewriteRequestUrlIfBasePageIsNeeded(req, testsPath, baseURL, results.directory); + rewriteRequestUrlIfBasePageIsNeeded(req, testsPath, rootURL, results.directory); } next(); @@ -136,7 +133,7 @@

    lib/tasks/server/middleware/tests-server/index.js

    } }; -function rewriteRequestUrlIfBasePageIsNeeded(req, testsPath, baseURL, directory) { +function rewriteRequestUrlIfBasePageIsNeeded(req, testsPath, rootURL, directory) { let acceptHeaders = req.headers.accept || []; let hasHTMLHeader = acceptHeaders.indexOf('text/html') !== -1; let hasWildcardHeader = acceptHeaders.indexOf('*/*') !== -1; @@ -146,12 +143,12 @@

    lib/tasks/server/middleware/tests-server/index.js

    logger.info('isForTests: %o', isForTests); if (isForTests && (hasHTMLHeader || hasWildcardHeader) && req.method === 'GET') { - let assetPath = req.path.slice(baseURL.length); + let assetPath = req.path.slice(rootURL.length); let filePath = path.join(directory, assetPath); if (!fs.existsSync(filePath) || !fs.statSync(filePath).isFile()) { - // N.B., `baseURL` will end with a slash as it went through `cleanBaseURL` - let newURL = `${baseURL}tests/index.html`; + // N.B., `rootURL` will end with a slash as it went through `cleanBaseURL` + let newURL = `${rootURL}tests/index.html`; logger.info('url: %s resolved to path: %s which is not a file. Assuming %s instead', req.path, filePath, newURL); req.url = newURL; } diff --git a/api/files/lib_tasks_test-server.js.html b/api/files/lib_tasks_test-server.js.html index 3322c7d..8817a87 100644 --- a/api/files/lib_tasks_test-server.js.html +++ b/api/files/lib_tasks_test-server.js.html @@ -42,7 +42,6 @@

    Classes

  • Builder
  • CLI
  • Command
  • -
  • CommandGenerator
  • DefaultPackager
  • EmberAddon
  • EmberApp
  • @@ -51,10 +50,9 @@

    Classes

  • Instrumentation
  • NodeModulesList
  • NpmTask
  • -
  • PackageCache
  • PackageInfo
  • PackageInfoCache
  • -
  • PrivateTestHelpers
  • +
  • PerBundleAddonCache
  • Project
  • ServeFilesAddon
  • TestsServerAddon
  • @@ -69,7 +67,7 @@

    Classes

    - Version: 3.21.2 + Version: 5.4.0-a905f346b9
    diff --git a/api/files/lib_tasks_transforms_amd_index.js.html b/api/files/lib_tasks_transforms_amd_index.js.html index e50d4ea..edd6d8a 100644 --- a/api/files/lib_tasks_transforms_amd_index.js.html +++ b/api/files/lib_tasks_transforms_amd_index.js.html @@ -42,7 +42,6 @@

    Classes

  • Builder
  • CLI
  • Command
  • -
  • CommandGenerator
  • DefaultPackager
  • EmberAddon
  • EmberApp
  • @@ -51,10 +50,9 @@

    Classes

  • Instrumentation
  • NodeModulesList
  • NpmTask
  • -
  • PackageCache
  • PackageInfo
  • PackageInfoCache
  • -
  • PrivateTestHelpers
  • +
  • PerBundleAddonCache
  • Project
  • ServeFilesAddon
  • TestsServerAddon
  • @@ -69,7 +67,7 @@

    Classes

    - Version: 3.21.2 + Version: 5.4.0-a905f346b9
    @@ -82,8 +80,6 @@

    lib/tasks/transforms/amd/index.js

     'use strict';
     
    -const shimAmd = require('./amd-shim');
    -
     class AmdTransformAddon {
       /**
        * This addon is used to register a custom AMD transform for app and addons to use.
    @@ -97,6 +93,8 @@ 

    lib/tasks/transforms/amd/index.js

    } importTransforms() { + const shimAmd = require('./amd-shim'); + return { amd: { transform: (tree, options) => { diff --git a/api/files/lib_utilities_directory-for-package-name.js.html b/api/files/lib_utilities_directory-for-package-name.js.html new file mode 100644 index 0000000..48d55d4 --- /dev/null +++ b/api/files/lib_utilities_directory-for-package-name.js.html @@ -0,0 +1,123 @@ + + + + + lib/utilities/directory-for-package-name.js - ember-cli + + + + + + +
    +
    + + +
    +
    +

    lib/utilities/directory-for-package-name.js

    +
    + +
    +'use strict';
    +
    +const path = require('path');
    +
    +/**
    + * Derive a directory name from a package name.
    + * Takes scoped packages into account.
    + *
    + * @method directoryForPackageName
    + * @param {String} packageName
    + * @return {String} Derived directory name.
    + */
    +module.exports = function directoryForPackageName(packageName) {
    +  let isScoped = packageName[0] === '@' && packageName.includes('/');
    +
    +  if (isScoped) {
    +    let slashIndex = packageName.indexOf('/');
    +    let scopeName = packageName.substring(1, slashIndex);
    +    let packageNameWithoutScope = packageName.substring(slashIndex + 1);
    +    let pathParts = process.cwd().split(path.sep);
    +    let parentDirectoryContainsScopeName = pathParts.includes(scopeName);
    +
    +    if (parentDirectoryContainsScopeName) {
    +      return packageNameWithoutScope;
    +    } else {
    +      return `${scopeName}-${packageNameWithoutScope}`;
    +    }
    +  } else {
    +    return packageName;
    +  }
    +};
    +
    +
    + +
    +
    +
    +
    + + + + + diff --git a/api/files/lib_utilities_ember-app-utils.js.html b/api/files/lib_utilities_ember-app-utils.js.html index 2952b58..409aeb3 100644 --- a/api/files/lib_utilities_ember-app-utils.js.html +++ b/api/files/lib_utilities_ember-app-utils.js.html @@ -42,7 +42,6 @@

    Classes

  • Builder
  • CLI
  • Command
  • -
  • CommandGenerator
  • DefaultPackager
  • EmberAddon
  • EmberApp
  • @@ -51,10 +50,9 @@

    Classes

  • Instrumentation
  • NodeModulesList
  • NpmTask
  • -
  • PackageCache
  • PackageInfo
  • PackageInfoCache
  • -
  • PrivateTestHelpers
  • +
  • PerBundleAddonCache
  • Project
  • ServeFilesAddon
  • TestsServerAddon
  • @@ -69,7 +67,7 @@

    Classes

    - Version: 3.21.2 + Version: 5.4.0-a905f346b9
    @@ -116,24 +114,6 @@

    lib/utilities/ember-app-utils.js

    return JSON.stringify(env || {}); } -/** - * Returns the <base> tag for index.html. - * - * @method calculateBaseTag - * @param {String} baseURL - * @param {String} locationType 'history', 'none' or 'hash'. - * @return {String} Base tag or an empty string - */ -function calculateBaseTag(baseURL, locationType) { - let normalizedBaseUrl = cleanBaseURL(baseURL); - - if (locationType === 'hash') { - return ''; - } - - return normalizedBaseUrl ? `<base href="${normalizedBaseUrl}" />` : ''; -} - /** * Returns the content for a specific type (section) for index.html. * @@ -172,8 +152,6 @@

    lib/utilities/ember-app-utils.js

    switch (type) { case 'head': - content.push(calculateBaseTag(config.baseURL, config.locationType)); - if (options.storeConfigInMeta) { content.push( `<meta name="${config.modulePrefix}/config/environment" content="${encodeURIComponent( @@ -211,7 +189,13 @@

    lib/utilities/ember-app-utils.js

    break; case 'test-body-footer': content.push( - `<script>Ember.assert('The tests file was not loaded. Make sure your tests index.html includes "assets/tests.js".', EmberENV.TESTS_FILE_LOADED);</script>` + `<script> +document.addEventListener('DOMContentLoaded', function() { + if (!EmberENV.TESTS_FILE_LOADED) { + throw new Error('The tests file was not loaded. Make sure your tests index.html includes "assets/tests.js".'); + } +}); +</script>` ); break; @@ -271,7 +255,7 @@

    lib/utilities/ember-app-utils.js

    ]; } -module.exports = { normalizeUrl, convertObjectToString, calculateBaseTag, contentFor, configReplacePatterns }; +module.exports = { normalizeUrl, convertObjectToString, contentFor, configReplacePatterns };
    diff --git a/api/files/lib_utilities_insert-into-file.js.html b/api/files/lib_utilities_insert-into-file.js.html index 7673b70..ec9858f 100644 --- a/api/files/lib_utilities_insert-into-file.js.html +++ b/api/files/lib_utilities_insert-into-file.js.html @@ -42,7 +42,6 @@

    Classes

  • Builder
  • CLI
  • Command
  • -
  • CommandGenerator
  • DefaultPackager
  • EmberAddon
  • EmberApp
  • @@ -51,10 +50,9 @@

    Classes

  • Instrumentation
  • NodeModulesList
  • NpmTask
  • -
  • PackageCache
  • PackageInfo
  • PackageInfoCache
  • -
  • PrivateTestHelpers
  • +
  • PerBundleAddonCache
  • Project
  • ServeFilesAddon
  • TestsServerAddon
  • @@ -69,7 +67,7 @@

    Classes

    - Version: 3.21.2 + Version: 5.4.0-a905f346b9
    @@ -106,19 +104,19 @@

    lib/utilities/insert-into-file.js

    ``` // app/router.js - Router.map(function() { + Router.map(function () { }); ``` ``` insertIntoFile('app/router.js', ' this.route("admin");', { - after: 'Router.map(function() {' + EOL + after: 'Router.map(function () {' + EOL }); ``` ``` // app/router.js - Router.map(function() { + Router.map(function () { this.route("admin"); }); ``` diff --git a/api/files/lib_utilities_is-lazy-engine.js.html b/api/files/lib_utilities_is-lazy-engine.js.html new file mode 100644 index 0000000..1409ce7 --- /dev/null +++ b/api/files/lib_utilities_is-lazy-engine.js.html @@ -0,0 +1,123 @@ + + + + + lib/utilities/is-lazy-engine.js - ember-cli + + + + + + +
    +
    + + +
    +
    +

    lib/utilities/is-lazy-engine.js

    +
    + +
    +'use strict';
    +
    +/**
    + * Indicate if a given object is a constructor function or class or an instance of an Addon.
    + *
    + * @private
    + * @param {Object} addonCtorOrInstance the constructor function/class or an instance of an Addon.
    + * @return {Boolean} True if the addonCtorOrInstance is a lazy engine, False otherwise.
    + */
    +module.exports = function isLazyEngine(addonCtorOrInstance) {
    +  if (!addonCtorOrInstance) {
    +    return false;
    +  }
    +
    +  if (addonCtorOrInstance.lazyLoading) {
    +    return addonCtorOrInstance.lazyLoading.enabled === true;
    +  } else if (addonCtorOrInstance.options) {
    +    return !!(addonCtorOrInstance.options.lazyLoading && addonCtorOrInstance.options.lazyLoading.enabled === true);
    +  } else if (addonCtorOrInstance.prototype) {
    +    if (addonCtorOrInstance.prototype.lazyLoading) {
    +      return addonCtorOrInstance.prototype.lazyLoading.enabled === true;
    +    } else if (addonCtorOrInstance.prototype.options) {
    +      return !!(
    +        addonCtorOrInstance.prototype.options.lazyLoading &&
    +        addonCtorOrInstance.prototype.options.lazyLoading.enabled === true
    +      );
    +    }
    +  }
    +
    +  return false;
    +};
    +
    +
    + +
    +
    +
    +
    + + + + + diff --git a/api/files/lib_utilities_valid-project-name.js.html b/api/files/lib_utilities_valid-project-name.js.html index a328405..674050d 100644 --- a/api/files/lib_utilities_valid-project-name.js.html +++ b/api/files/lib_utilities_valid-project-name.js.html @@ -42,7 +42,6 @@

    Classes

  • Builder
  • CLI
  • Command
  • -
  • CommandGenerator
  • DefaultPackager
  • EmberAddon
  • EmberApp
  • @@ -51,10 +50,9 @@

    Classes

  • Instrumentation
  • NodeModulesList
  • NpmTask
  • -
  • PackageCache
  • PackageInfo
  • PackageInfoCache
  • -
  • PrivateTestHelpers
  • +
  • PerBundleAddonCache
  • Project
  • ServeFilesAddon
  • TestsServerAddon
  • @@ -69,7 +67,7 @@

    Classes

    - Version: 3.21.2 + Version: 5.4.0-a905f346b9
    diff --git a/api/files/lib_utilities_will-interrupt-process.js.html b/api/files/lib_utilities_will-interrupt-process.js.html index 6c97dd9..c608e91 100644 --- a/api/files/lib_utilities_will-interrupt-process.js.html +++ b/api/files/lib_utilities_will-interrupt-process.js.html @@ -42,7 +42,6 @@

    Classes

  • Builder
  • CLI
  • Command
  • -
  • CommandGenerator
  • DefaultPackager
  • EmberAddon
  • EmberApp
  • @@ -51,10 +50,9 @@

    Classes

  • Instrumentation
  • NodeModulesList
  • NpmTask
  • -
  • PackageCache
  • PackageInfo
  • PackageInfoCache
  • -
  • PrivateTestHelpers
  • +
  • PerBundleAddonCache
  • Project
  • ServeFilesAddon
  • TestsServerAddon
  • @@ -69,7 +67,7 @@

    Classes

    - Version: 3.21.2 + Version: 5.4.0-a905f346b9
    diff --git a/api/files/lib_utilities_windows-admin.js.html b/api/files/lib_utilities_windows-admin.js.html index 48b1902..8bbe882 100644 --- a/api/files/lib_utilities_windows-admin.js.html +++ b/api/files/lib_utilities_windows-admin.js.html @@ -42,7 +42,6 @@

    Classes

  • Builder
  • CLI
  • Command
  • -
  • CommandGenerator
  • DefaultPackager
  • EmberAddon
  • EmberApp
  • @@ -51,10 +50,9 @@

    Classes

  • Instrumentation
  • NodeModulesList
  • NpmTask
  • -
  • PackageCache
  • PackageInfo
  • PackageInfoCache
  • -
  • PrivateTestHelpers
  • +
  • PerBundleAddonCache
  • Project
  • ServeFilesAddon
  • TestsServerAddon
  • @@ -69,7 +67,7 @@

    Classes

    - Version: 3.21.2 + Version: 5.4.0-a905f346b9
    diff --git a/api/index.html b/api/index.html index ff2498b..efe38f8 100644 --- a/api/index.html +++ b/api/index.html @@ -42,7 +42,6 @@

    Classes

  • Builder
  • CLI
  • Command
  • -
  • CommandGenerator
  • DefaultPackager
  • EmberAddon
  • EmberApp
  • @@ -51,10 +50,9 @@

    Classes

  • Instrumentation
  • NodeModulesList
  • NpmTask
  • -
  • PackageCache
  • PackageInfo
  • PackageInfoCache
  • -
  • PrivateTestHelpers
  • +
  • PerBundleAddonCache
  • Project
  • ServeFilesAddon
  • TestsServerAddon
  • @@ -69,7 +67,7 @@

    Classes

    - Version: 3.21.2 + Version: 5.4.0-a905f346b9
    @@ -107,9 +105,9 @@

    Contributing

    Please see the contributing guidelines

    Community

    License

    This project is licensed under the MIT License.

    diff --git a/api/modules/ember-cli.html b/api/modules/ember-cli.html index 28136ee..401a081 100644 --- a/api/modules/ember-cli.html +++ b/api/modules/ember-cli.html @@ -42,7 +42,6 @@

    Classes

  • Builder
  • CLI
  • Command
  • -
  • CommandGenerator
  • DefaultPackager
  • EmberAddon
  • EmberApp
  • @@ -51,10 +50,9 @@

    Classes

  • Instrumentation
  • NodeModulesList
  • NpmTask
  • -
  • PackageCache
  • PackageInfo
  • PackageInfoCache
  • -
  • PrivateTestHelpers
  • +
  • PerBundleAddonCache
  • Project
  • ServeFilesAddon
  • TestsServerAddon
  • @@ -96,14 +94,14 @@

    ember-cli

    - Version: 3.21.2 + Version: 5.4.0-a905f346b9