From ba167a742f8aa37f223a0bbe7a68cfdb1f9cbb34 Mon Sep 17 00:00:00 2001 From: Jen Weber Date: Thu, 1 Oct 2020 08:33:59 -0400 Subject: [PATCH] update api docs files to 3.21 --- api/api.js | 4 + api/classes/Addon.html | 233 +- api/classes/AmdTransformAddon.html | 6 +- api/classes/Blueprint.html | 225 +- api/classes/Builder.html | 195 +- api/classes/CLI.html | 121 +- api/classes/Command.html | 58 +- api/classes/CommandGenerator.html | 344 +++ api/classes/DefaultPackager.html | 10 +- api/classes/EmberAddon.html | 103 +- api/classes/EmberApp.html | 108 +- api/classes/HardwareInfo.html | 620 ++++++ api/classes/HistorySupportAddon.html | 10 +- api/classes/Instrumentation.html | 8 +- api/classes/NodeModulesList.html | 6 +- api/classes/NpmTask.html | 14 +- api/classes/PackageCache.html | 1911 +++++++++++++++++ api/classes/PackageInfo.html | 16 +- api/classes/PackageInfoCache.html | 182 +- api/classes/PrivateTestHelpers.html | 294 +++ api/classes/Project.html | 252 +-- api/classes/ServeFilesAddon.html | 6 +- api/classes/TestsServerAddon.html | 6 +- api/classes/WatcherAddon.html | 6 +- api/classes/WindowsSymlinkChecker.html | 70 +- api/data.json | 1710 +++++++++++---- api/files/.eslintrc.js.html | 164 ++ .../lib_broccoli_default-packager.js.html | 340 +-- api/files/lib_broccoli_ember-addon.js.html | 11 +- api/files/lib_broccoli_ember-app.js.html | 410 ++-- api/files/lib_cli_cli.js.html | 197 +- api/files/lib_models_addon-info.js.html | 6 +- api/files/lib_models_addon.js.html | 303 +-- api/files/lib_models_blueprint.js.html | 211 +- api/files/lib_models_builder.js.html | 238 +- api/files/lib_models_command.js.html | 88 +- api/files/lib_models_hardware-info.js.html | 479 +++++ .../lib_models_installation-checker.js.html | 27 +- .../lib_models_instantiate-addons.js.html | 30 +- api/files/lib_models_instrumentation.js.html | 80 +- ...ib_models_package-info-cache_index.js.html | 169 +- ...ckage-info-cache_node-modules-list.js.html | 12 +- ...ls_package-info-cache_package-info.js.html | 72 +- api/files/lib_models_project.js.html | 97 +- api/files/lib_models_task.js.html | 6 +- api/files/lib_tasks_build-watch.js.html | 55 +- api/files/lib_tasks_npm-task.js.html | 162 +- api/files/lib_tasks_serve.js.html | 89 +- ...dleware_broccoli-serve-files_index.js.html | 6 +- ..._middleware_broccoli-watcher_index.js.html | 10 +- ...r_middleware_history-support_index.js.html | 26 +- ...rver_middleware_tests-server_index.js.html | 76 +- api/files/lib_tasks_test-server.js.html | 7 +- .../lib_tasks_transforms_amd_index.js.html | 38 +- .../lib_utilities_ember-app-utils.js.html | 69 +- .../lib_utilities_insert-into-file.js.html | 37 +- .../lib_utilities_is-yarn-project.js.html | 6 +- .../lib_utilities_valid-project-name.js.html | 42 +- ...b_utilities_will-interrupt-process.js.html | 26 +- api/files/lib_utilities_windows-admin.js.html | 32 +- api/files/tests_.eslintrc.js.html | 140 ++ api/files/tests_helpers_acceptance.js.html | 219 ++ .../tests_helpers_command-generator.js.html | 144 ++ api/files/tests_helpers_package-cache.js.html | 772 +++++++ .../tests_unit_models_addon-test.js.html | 992 +++++++++ api/index.html | 17 +- api/modules/ember-cli.html | 12 +- 67 files changed, 9361 insertions(+), 3074 deletions(-) create mode 100644 api/classes/CommandGenerator.html create mode 100644 api/classes/HardwareInfo.html create mode 100644 api/classes/PackageCache.html create mode 100644 api/classes/PrivateTestHelpers.html create mode 100644 api/files/.eslintrc.js.html create mode 100644 api/files/lib_models_hardware-info.js.html create mode 100644 api/files/tests_.eslintrc.js.html create mode 100644 api/files/tests_helpers_acceptance.js.html create mode 100644 api/files/tests_helpers_command-generator.js.html create mode 100644 api/files/tests_helpers_package-cache.js.html create mode 100644 api/files/tests_unit_models_addon-test.js.html diff --git a/api/api.js b/api/api.js index 6ab1cfb..c4e4c54 100644 --- a/api/api.js +++ b/api/api.js @@ -7,15 +7,19 @@ YUI.add("yuidoc-meta", function(Y) { "Builder", "CLI", "Command", + "CommandGenerator", "DefaultPackager", "EmberAddon", "EmberApp", + "HardwareInfo", "HistorySupportAddon", "Instrumentation", "NodeModulesList", "NpmTask", + "PackageCache", "PackageInfo", "PackageInfoCache", + "PrivateTestHelpers", "Project", "ServeFilesAddon", "TestsServerAddon", diff --git a/api/classes/Addon.html b/api/classes/Addon.html index 56e28c7..7f2e9c6 100644 --- a/api/classes/Addon.html +++ b/api/classes/Addon.html @@ -42,15 +42,19 @@

Classes

  • Builder
  • CLI
  • Command
  • +
  • CommandGenerator
  • DefaultPackager
  • EmberAddon
  • EmberApp
  • +
  • HardwareInfo
  • HistorySupportAddon
  • Instrumentation
  • NodeModulesList
  • NpmTask
  • +
  • PackageCache
  • PackageInfo
  • PackageInfoCache
  • +
  • PrivateTestHelpers
  • Project
  • ServeFilesAddon
  • TestsServerAddon
  • @@ -156,12 +160,10 @@

    Addon

  • concatFiles
  • discoverAddons
  • eachAddonInvoke
  • -
  • isModuleUnification
  • jshintAddonTree
  • preprocessJs
  • processedAddonJsFiles
  • shouldCompileTemplates
  • -
  • treeForSrc
  • treeGenerator
  • @@ -170,14 +172,14 @@

    Addon

    - Version: 3.8.1--84707b2801 + Version: 3.21.2
    @@ -537,7 +539,7 @@

    Method Summary

    importTransforms( ): Object
    -

    Allows addons to define a custom transfrom function that other addons and app can use when using app.import.

    +

    Allows addons to define a custom transform function that other addons and app can use when using app.import.

    @@ -1024,7 +1026,7 @@

    Method Summary

    -
    +
    addonJsFiles( ): Tree
    @@ -1127,21 +1129,6 @@

    Method Summary

    private - - - -
    -

    Returns whether this is using a module unification format.

    -
    - - - - - private - -
    @@ -1202,21 +1189,6 @@

    Method Summary

    private - - -
    - treeForSrc( ): -
    -
    - -
    - - - - - private - -
    @@ -1240,7 +1212,7 @@

    Method Summary

    Public Constructors

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

    public @@ -1308,7 +1280,7 @@

    Parameters:

    Public Properties

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

    public @@ -1326,7 +1298,7 @@

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

    public @@ -1345,7 +1317,7 @@

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

    public @@ -1361,7 +1333,7 @@

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

    public @@ -1380,7 +1352,7 @@

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

    public @@ -1396,7 +1368,7 @@

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

    public @@ -1412,7 +1384,7 @@

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

    public @@ -1428,7 +1400,7 @@

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

    public @@ -1451,7 +1423,7 @@

    Public Methods

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

    public @@ -1484,7 +1456,7 @@

    Example:

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

    public @@ -1543,7 +1515,7 @@

    Example:

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

    public @@ -1605,7 +1577,7 @@

    Return:

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

    public @@ -1700,7 +1672,7 @@

    Example:

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

    public @@ -1783,7 +1755,7 @@

    Example:

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

    public @@ -1810,7 +1782,7 @@

    Return:

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

    public @@ -1841,7 +1813,7 @@

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

    public @@ -1862,7 +1834,7 @@

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

    public @@ -1964,7 +1936,7 @@

    Parameters:

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

    public @@ -1975,7 +1947,7 @@

    -

    Allows addons to define a custom transfrom function that other addons and app can use when using app.import.

    +

    Allows addons to define a custom transform function that other addons and app can use when using app.import.

    This function is not implemented by default

    Uses:

      @@ -2022,7 +1994,7 @@

      Example:

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

    public @@ -2085,7 +2057,7 @@

    Example:

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

    public @@ -2127,7 +2099,7 @@

    Example:

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

    public @@ -2197,7 +2169,7 @@

    Example:

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

    public @@ -2228,7 +2200,7 @@

    Return:

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

    public @@ -2255,7 +2227,7 @@

    Return:

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

    public @@ -2330,7 +2302,7 @@

    Example:

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

    public @@ -2358,7 +2330,7 @@

    Return:

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

    public @@ -2422,7 +2394,7 @@

    Example:

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

    public @@ -2480,7 +2452,7 @@

    Parameters:

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

    public @@ -2516,7 +2488,7 @@

    Parameters:

    -

    What kind of tree (eg. 'js', 'css', 'src', 'template')

    +

    What kind of tree (eg. 'js', 'css', 'template')

    @@ -2556,7 +2528,7 @@

    Example:

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

    public @@ -2605,7 +2577,7 @@

    Parameters:

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

    public @@ -2645,7 +2617,7 @@

    Parameters:

    -

    What kind of tree (eg. 'js', 'css', 'src', 'template')

    +

    What kind of tree (eg. 'js', 'css', 'template')

    @@ -2680,7 +2652,7 @@

    Return:

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

    public @@ -2762,7 +2734,7 @@

    Example:

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

    public @@ -2857,7 +2829,7 @@

    Example:

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

    public @@ -2929,7 +2901,7 @@

    Example:

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

    public @@ -2984,7 +2956,7 @@

    Parameters:

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

    public @@ -3057,7 +3029,7 @@

    Return:

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

    public @@ -3127,7 +3099,7 @@

    Example:

    - lib/models/addon.js:885 + lib/models/addon.js:816

    public @@ -3183,7 +3155,7 @@

    Return:

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

    public @@ -3238,7 +3210,7 @@

    Return:

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

    public @@ -3294,7 +3266,7 @@

    Return:

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

    public @@ -3350,7 +3322,7 @@

    Return:

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

    public @@ -3407,7 +3379,7 @@

    Return:

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

    public @@ -3463,7 +3435,7 @@

    Return:

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

    public @@ -3519,7 +3491,7 @@

    Return:

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

    public @@ -3580,7 +3552,7 @@

    Return:

    Private Methods

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

    private @@ -3643,7 +3615,7 @@

    Parameters:

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

    private @@ -3666,7 +3638,7 @@

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

    private @@ -3696,7 +3668,7 @@

    Return:

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

    private @@ -3750,7 +3722,7 @@

    Return:

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

    private @@ -3769,8 +3741,8 @@

    - lib/models/addon.js:1331 -

    + lib/models/addon.js:1269 +

    private @@ -3779,6 +3751,9 @@

    +
    +

    Deprecated: This method is deprecated.

    +

    Returns a tree containing the addon's js files

    @@ -3797,7 +3772,7 @@

    Return:

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

    private @@ -3854,7 +3829,7 @@

    Return:

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

    private @@ -3911,7 +3886,7 @@

    Return:

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

    private @@ -3968,7 +3943,7 @@

    Return:

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

    private @@ -4039,7 +4014,7 @@

    Return:

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

    private @@ -4063,7 +4038,7 @@

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

    private @@ -4123,38 +4098,10 @@

    Parameters:

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

    - private - - - isModuleUnification( ): Boolean -

    -
    - - - -

    Returns whether this is using a module unification format.

    -
    - - -
    -

    Return:

    -
    - Boolean -

    Whether this is using a module unification format.

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

    private @@ -4182,7 +4129,7 @@

    Return:

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

    private @@ -4210,7 +4157,7 @@

    Return:

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

    private @@ -4267,7 +4214,7 @@

    Return:

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

    private @@ -4294,36 +4241,10 @@

    Return:

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

    - private - - - treeForSrc( ): -

    -
    - - - -
    - - -
    -

    Return:

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

    private diff --git a/api/classes/AmdTransformAddon.html b/api/classes/AmdTransformAddon.html index 442c597..0eb15b1 100644 --- a/api/classes/AmdTransformAddon.html +++ b/api/classes/AmdTransformAddon.html @@ -42,15 +42,19 @@

    Classes

  • Builder
  • CLI
  • Command
  • +
  • CommandGenerator
  • DefaultPackager
  • EmberAddon
  • EmberApp
  • +
  • HardwareInfo
  • HistorySupportAddon
  • Instrumentation
  • NodeModulesList
  • NpmTask
  • +
  • PackageCache
  • PackageInfo
  • PackageInfoCache
  • +
  • PrivateTestHelpers
  • Project
  • ServeFilesAddon
  • TestsServerAddon
  • @@ -96,7 +100,7 @@

    AmdTransformAddon

    - Version: 3.8.1--84707b2801 + Version: 3.21.2
    diff --git a/api/classes/Blueprint.html b/api/classes/Blueprint.html index f195166..fddaf30 100644 --- a/api/classes/Blueprint.html +++ b/api/classes/Blueprint.html @@ -42,15 +42,19 @@

    Classes

  • Builder
  • CLI
  • Command
  • +
  • CommandGenerator
  • DefaultPackager
  • EmberAddon
  • EmberApp
  • +
  • HardwareInfo
  • HistorySupportAddon
  • Instrumentation
  • NodeModulesList
  • NpmTask
  • +
  • PackageCache
  • PackageInfo
  • PackageInfoCache
  • +
  • PrivateTestHelpers
  • Project
  • ServeFilesAddon
  • TestsServerAddon
  • @@ -164,7 +168,6 @@

    Blueprint

  • generateLookupPaths
  • getDetailedHelpPath
  • hasPathToken
  • -
  • isFile
  • isFilePath
  • isIgnored
  • isValidFile
  • @@ -179,14 +182,14 @@

    Blueprint

    - Version: 3.8.1--84707b2801 + Version: 3.21.2
    @@ -306,7 +309,7 @@

    Index.js

    Blueprint Hooks

    beforeInstall & beforeUninstall

    Called before any of the template files are processed and receives -the the options and locals hashes as parameters. Typically used for +the options and locals hashes as parameters. Typically used for validating any additional command line options or for any asynchronous setup that is needed. As an example, the controller blueprint validates its --type option in this hook. If you need to run any asynchronous code, @@ -866,7 +869,7 @@

    Method Summary

    - processFiles(intoDir, templateVariables) + processFiles(intoDir, templateVariables): Promise
    @@ -1264,21 +1267,6 @@

    Method Summary

    private - - -
    - isFile(info): Promise -
    -
    - -
    - - - - - private - -
    @@ -1386,7 +1374,7 @@

    Method Summary

    Static Public Properties

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

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

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

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

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

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

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

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

    Static Public Methods

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

    public static @@ -1524,7 +1512,7 @@

    Return:

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

    public static @@ -1580,7 +1568,7 @@

    Return:

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

    public static @@ -1680,7 +1668,7 @@

    Return:

    Public Constructors

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

    public @@ -1735,7 +1723,7 @@

    Parameters:

    Private Properties

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

    private @@ -1755,7 +1743,7 @@

    Public Methods

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

    public @@ -1814,7 +1802,7 @@

    Return:

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

    public @@ -1873,7 +1861,7 @@

    Return:

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

    public @@ -1947,7 +1935,7 @@

    Return:

    - lib/models/blueprint.js:995 + lib/models/blueprint.js:996

    public @@ -2040,7 +2028,7 @@

    Example:

    - lib/models/blueprint.js:888 + lib/models/blueprint.js:889

    public @@ -2107,7 +2095,7 @@

    Example:

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

    public @@ -2178,7 +2166,7 @@

    Return:

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

    public @@ -2205,7 +2193,7 @@

    Return:

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

    public @@ -2232,7 +2220,7 @@

    Return:

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

    public @@ -2259,7 +2247,7 @@

    Return:

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

    public @@ -2286,7 +2274,7 @@

    Return:

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

    public @@ -2366,7 +2354,7 @@

    Return:

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

    public @@ -2407,7 +2395,7 @@

    Return:

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

    public @@ -2435,7 +2423,7 @@

    Return:

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

    public @@ -2495,7 +2483,7 @@

    Return:

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

    public @@ -2550,7 +2538,7 @@

    Return:

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

    public @@ -2658,7 +2646,7 @@

    Return:

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

    public @@ -2712,7 +2700,7 @@

    Return:

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

    public @@ -2738,7 +2726,7 @@

    Return:

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

    public @@ -2751,17 +2739,19 @@

    Hook for adding custom template variables.

    When the following is called on the command line:

    -
    ember generate controller foo --type=array --dry-run
    +
    ember generate controller foo --type=array --dry-run isAdmin:true
     

    The object passed to locals looks like this:

    {
       entity: {
         name: 'foo',
         options: {
    -      type: 'array'
    +      isAdmin: true
         }
       },
       dryRun: true
    +  type: "array"
    +  // more keys
     }
     

    This hook must return an object or a Promise which resolves to an object. @@ -2810,7 +2800,7 @@

    Return:

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

    public @@ -2865,7 +2855,7 @@

    Return:

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

    public @@ -2932,7 +2922,7 @@

    Return:

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

    public @@ -2993,12 +2983,12 @@

    Return:

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

    public - processFiles(intoDir, templateVariables) + processFiles(intoDir, templateVariables): Promise

    @@ -3048,12 +3038,19 @@

    Parameters:

    +
    +

    Return:

    +
    + Promise + +
    +
    - lib/models/blueprint.js:760 + lib/models/blueprint.js:762

    public @@ -3113,7 +3110,7 @@

    Parameters:

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

    public @@ -3171,7 +3168,7 @@

    Return:

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

    public @@ -3230,7 +3227,7 @@

    Return:

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

    public @@ -3285,7 +3282,7 @@

    Return:

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

    public @@ -3334,7 +3331,7 @@

    Parameters:

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

    public @@ -3393,7 +3390,7 @@

    Return:

    Private Methods

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

    private @@ -3453,7 +3450,7 @@

    Parameters:

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

    private @@ -3473,7 +3470,7 @@

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

    private @@ -3520,7 +3517,7 @@

    Parameters:

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

    private @@ -3583,7 +3580,7 @@

    Throws:

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

    private @@ -3637,7 +3634,7 @@

    Return:

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

    private @@ -3717,7 +3714,7 @@

    Return:

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

    private @@ -3798,7 +3795,7 @@

    Return:

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

    private @@ -3853,7 +3850,7 @@

    Return:

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

    private @@ -3873,7 +3870,7 @@

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

    private @@ -3927,7 +3924,7 @@

    Return:

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

    private @@ -3974,7 +3971,7 @@

    Parameters:

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

    private @@ -4060,7 +4057,7 @@

    Parameters:

    - lib/models/blueprint.js:298 + lib/models/blueprint.js:287

    private @@ -4114,7 +4111,7 @@

    Return:

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

    private @@ -4188,7 +4185,7 @@

    Parameters:

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

    private @@ -4215,7 +4212,7 @@

    Return:

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

    private @@ -4282,7 +4279,7 @@

    Return:

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

    private @@ -4338,7 +4335,7 @@

    Return:

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

    private @@ -4393,7 +4390,7 @@

    Return:

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

    private @@ -4446,64 +4443,10 @@

    Return:

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

    - private - - - isFile(info): Promise -

    -
    - - - -
    - -
    -

    Parameters:

    - - - - - - - - - - - - - - - - - - -
    NameTypeAttributeDescription
    infoFileInfo -
      - - - -
    -
    -
    - -
    -

    Return:

    -
    - Promise - -
    -
    - -
    - lib/models/blueprint.js:1549 + lib/models/blueprint.js:1536

    private @@ -4557,7 +4500,7 @@

    Return:

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

    private @@ -4611,7 +4554,7 @@

    Return:

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

    private @@ -4665,7 +4608,7 @@

    Return:

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

    private @@ -4712,7 +4655,7 @@

    Parameters:

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

    private @@ -4759,7 +4702,7 @@

    Parameters:

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

    private @@ -4813,7 +4756,7 @@

    Return:

    - lib/models/blueprint.js:791 + lib/models/blueprint.js:792

    private diff --git a/api/classes/Builder.html b/api/classes/Builder.html index 4940fa3..e6b92ff 100644 --- a/api/classes/Builder.html +++ b/api/classes/Builder.html @@ -42,15 +42,19 @@

    Classes

  • Builder
  • CLI
  • Command
  • +
  • CommandGenerator
  • DefaultPackager
  • EmberAddon
  • EmberApp
  • +
  • HardwareInfo
  • HistorySupportAddon
  • Instrumentation
  • NodeModulesList
  • NpmTask
  • +
  • PackageCache
  • PackageInfo
  • PackageInfoCache
  • +
  • PrivateTestHelpers
  • Project
  • ServeFilesAddon
  • TestsServerAddon
  • @@ -92,11 +96,8 @@

    Builder

  • canDeleteOutputPath
  • checkForPostBuildEnvironmentIssues
  • cleanup
  • -
  • compatNode
  • copyToOutputPath
  • -
  • finalizeBuild
  • processAddonBuildSteps
  • -
  • processBuildResult
  • readBuildFile
  • setupBroccoliBuilder
  • @@ -106,14 +107,14 @@

    Builder

    - Version: 3.8.1--84707b2801 + Version: 3.21.2
    @@ -206,21 +207,6 @@

    Method Summary

    private - - -
    - compatNode(node) -
    -
    -

    broccoli-builder reformats the response into {directory, graph}, this method is a backwards compatible shim for broccoli 1.x

    -
    - - - - - private - -
    @@ -236,21 +222,6 @@

    Method Summary

    private - - -
    - finalizeBuild( ) -
    -
    - -
    - - - - - private - -
    @@ -266,21 +237,6 @@

    Method Summary

    private - - -
    - processBuildResult(results): Promise -
    -
    - -
    - - - - - private - -
    @@ -327,7 +283,7 @@

    Method Summary

    Private Methods

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

    private @@ -353,7 +309,7 @@

    Return:

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

    private @@ -411,7 +367,7 @@

    Return:

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

    private @@ -435,7 +391,7 @@

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

    private @@ -459,60 +415,10 @@

    Return:

    -
    -
    -
    - lib/models/builder.js:295 -

    - private - - - compatNode(node) -

    -
    - - - -

    broccoli-builder reformats the response into {directory, graph}, this method is a backwards -compatible shim for broccoli 1.x

    -
    - -
    -

    Parameters:

    - - - - - - - - - - - - - - - - - - -
    NameTypeAttributeDescription
    nodeObject -
      - - - -
    -

    The node returned from Broccoli builder

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

    private @@ -556,29 +462,10 @@

    Parameters:

    -
    -
    -
    - lib/models/builder.js:287 -

    - private - - - finalizeBuild( ) -

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

    private @@ -624,60 +511,6 @@

    Parameters:

    - - - - - - - -
    - -
    -

    Return:

    -
    - Promise - -
    -
    - - -
    -
    -
    - lib/models/builder.js:159 -

    - private - - - processBuildResult(results): Promise -

    -
    - - - -
    - -
    -

    Parameters:

    - - - - - - - - - - - - - - @@ -699,7 +532,7 @@

    Return:

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

    private @@ -747,7 +580,7 @@

    Parameters:

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

    private diff --git a/api/classes/CLI.html b/api/classes/CLI.html index bad4a44..f556dd4 100644 --- a/api/classes/CLI.html +++ b/api/classes/CLI.html @@ -42,15 +42,19 @@

    Classes

  • Builder
  • CLI
  • Command
  • +
  • CommandGenerator
  • DefaultPackager
  • EmberAddon
  • EmberApp
  • +
  • HardwareInfo
  • HistorySupportAddon
  • Instrumentation
  • NodeModulesList
  • NpmTask
  • +
  • PackageCache
  • PackageInfo
  • PackageInfoCache
  • +
  • PrivateTestHelpers
  • Project
  • ServeFilesAddon
  • TestsServerAddon
  • @@ -107,6 +111,7 @@

    CLI

    @@ -115,14 +120,14 @@

    CLI

    - Version: 3.8.1--84707b2801 + Version: 3.21.2
    @@ -348,7 +353,22 @@

    Method Summary

    + + + + - + + + + + + + + + + + + +
    NameTypeAttributeDescription
    resultsObject -
      - - -
    - run(environment): Promise + maybeMakeCommand(commandName, commandArgs): Null | CurrentCommand +
    +
    + +
    +
    + private + + + +
    + run(environmentPromiseHash): Promise
    @@ -370,7 +390,7 @@

    Method Summary

    Private Constructors

    - lib/cli/cli.js:17 + lib/cli/cli.js:15

    private @@ -423,7 +443,7 @@

    Parameters:

    Private Properties

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

    private @@ -438,7 +458,7 @@

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

    private @@ -453,7 +473,7 @@

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

    private @@ -468,7 +488,7 @@

    - lib/cli/cli.js:24 + lib/cli/cli.js:22

    private @@ -483,7 +503,7 @@

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

    private @@ -498,7 +518,7 @@

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

    private @@ -513,7 +533,7 @@

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

    private @@ -528,7 +548,7 @@

    - lib/cli/cli.js:30 + lib/cli/cli.js:28

    private @@ -549,7 +569,7 @@

    Private Methods

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

    private @@ -603,7 +623,7 @@

    Return:

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

    private @@ -656,13 +676,13 @@

    Return:

    -
    +
    lib/cli/cli.js:83

    private - run(environment): Promise + maybeMakeCommand(commandName, commandArgs): Null | CurrentCommand

    @@ -683,13 +703,80 @@

    Parameters:

    environmentcommandNameObject +
      + + + +
    +
    commandArgs Object
      +
    +
    +
    + +
    +

    Return:

    +
    + Null | CurrentCommand + +
    +
    + + +
    +
    +
    + lib/cli/cli.js:122 +

    + private + + + run(environmentPromiseHash): Promise +

    +
    + + + +
    + +
    +

    Parameters:

    + + + + + + + + + + + + + + diff --git a/api/classes/Command.html b/api/classes/Command.html index 6107142..6d93063 100644 --- a/api/classes/Command.html +++ b/api/classes/Command.html @@ -42,15 +42,19 @@

    Classes

  • Builder
  • CLI
  • Command
  • +
  • CommandGenerator
  • DefaultPackager
  • EmberAddon
  • EmberApp
  • +
  • HardwareInfo
  • HistorySupportAddon
  • Instrumentation
  • NodeModulesList
  • NpmTask
  • +
  • PackageCache
  • PackageInfo
  • PackageInfoCache
  • +
  • PrivateTestHelpers
  • Project
  • ServeFilesAddon
  • TestsServerAddon
  • @@ -127,14 +131,14 @@

    Command

    - Version: 3.8.1--84707b2801 + Version: 3.21.2
    @@ -575,7 +579,7 @@

    Method Summary

    Public Properties

    - lib/models/command.js:108 + lib/models/command.js:100

    public @@ -594,7 +598,7 @@

    Example:

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

    public @@ -616,7 +620,7 @@

    Example:

    - lib/models/command.js:123 + lib/models/command.js:117

    public @@ -644,7 +648,7 @@

    Example:

    - lib/models/command.js:52 + lib/models/command.js:51

    public @@ -660,7 +664,7 @@

    - lib/models/command.js:89 + lib/models/command.js:81

    public @@ -675,7 +679,7 @@

    - lib/models/command.js:96 + lib/models/command.js:88

    public @@ -694,7 +698,7 @@

    Example:

    - lib/models/command.js:61 + lib/models/command.js:60

    public @@ -722,7 +726,7 @@

    Public Methods

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

    public @@ -789,7 +793,7 @@

    Return:

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

    public @@ -870,7 +874,7 @@

    Return:

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

    public @@ -898,7 +902,7 @@

    Return:

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

    public @@ -952,7 +956,7 @@

    Return:

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

    public @@ -1007,7 +1011,7 @@

    Return:

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

    public @@ -1063,7 +1067,7 @@

    Return:

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

    public @@ -1118,7 +1122,7 @@

    Return:

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

    public @@ -1147,7 +1151,7 @@

    Return:

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

    public @@ -1215,7 +1219,7 @@

    Return:

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

    public @@ -1270,7 +1274,7 @@

    Return:

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

    public @@ -1299,7 +1303,7 @@

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

    public @@ -1321,7 +1325,7 @@

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

    public @@ -1371,7 +1375,7 @@

    Parameters:

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

    public @@ -1418,7 +1422,7 @@

    Parameters:

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

    public @@ -1473,7 +1477,7 @@

    Return:

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

    public @@ -1499,7 +1503,7 @@

    Return:

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

    public @@ -1559,7 +1563,7 @@

    Return:

    Private Methods

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

    private diff --git a/api/classes/CommandGenerator.html b/api/classes/CommandGenerator.html new file mode 100644 index 0000000..7e88fa9 --- /dev/null +++ b/api/classes/CommandGenerator.html @@ -0,0 +1,344 @@ + + + + + CommandGenerator - ember-cli + + + + + + +
    +
    + + +
    +
    + tests/helpers/command-generator.js:5 +

    CommandGenerator

    +
    + + + + +

    A simple tool to make behavior and API consistent between commands +the user wraps in this.

    +

    Usage:

    +
    var bower = new CommandGenerator(require.resolve('bower/bin/bower'));
    +bower.invoke('install', 'ember');
    +
    +
    + + + + +

    Constructor Summary

    + + + +

    NameTypeAttributeDescription
    environmentPromiseHashPromise +
      + + +
    + + + + + + + + + + + +
    Private Constructors
    + private + + + +
    + CommandGenerator(program): Function +
    +
    +

    A simple tool to make behavior and API consistent between commands the user wraps in this.

    +
    +
    + + + + +

    Method Summary

    + + + + + + + + + + + + + + + +
    Private Methods
    + private + + + +
    + command([arguments], [options={}]) +
    +
    +

    The invoke method is responsible for building the final executable command.

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

    Private Constructors

    +
    +
    + tests/helpers/command-generator.js:5 +

    + private + + + CommandGenerator(program): Function +

    +
    + + + +
    + +
    +

    Parameters:

    + + + + + + + + + + + + + + + + + + +
    NameTypeAttributeDescription
    programPath +
      + + + +
    +

    The path to the command.

    +
    +
    + +
    +

    Return:

    +
    + Function +

    A command helper.

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

    Private Methods

    +
    +
    + tests/helpers/command-generator.js:27 +

    + private + + + command([arguments], [options={}]) +

    +
    + + + +

    The invoke method is responsible for building the final executable command.

    +
    + +
    +

    Parameters:

    + + + + + + + + + + + + + + + + + + + + + + + + + +
    NameTypeAttributeDescription
    argumentsString +
      +
    • optional
    • + +
    • multiple
    • +
    +

    Arguments to be passed into the command.

    +
    optionsObject +
      +
    • optional
    • +
    • default: {}
    • + +
    +

    The options passed into child_process.spawnSync. +(https://nodejs.org/api/child_process.html#child_process_child_process_spawnsync_command_args_options)

    +
    +
    + + + +
    +
    + + +
    +
    +
    +
    + + + + + diff --git a/api/classes/DefaultPackager.html b/api/classes/DefaultPackager.html index 418f45f..01483ea 100644 --- a/api/classes/DefaultPackager.html +++ b/api/classes/DefaultPackager.html @@ -42,15 +42,19 @@

    Classes

  • Builder
  • CLI
  • Command
  • +
  • CommandGenerator
  • DefaultPackager
  • EmberAddon
  • EmberApp
  • +
  • HardwareInfo
  • HistorySupportAddon
  • Instrumentation
  • NodeModulesList
  • NpmTask
  • +
  • PackageCache
  • PackageInfo
  • PackageInfoCache
  • +
  • PrivateTestHelpers
  • Project
  • ServeFilesAddon
  • TestsServerAddon
  • @@ -96,14 +100,14 @@

    DefaultPackager

    - Version: 3.8.1--84707b2801 + Version: 3.21.2
    @@ -159,7 +163,7 @@

    Constructor Summary

    Public Constructors

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

    public diff --git a/api/classes/EmberAddon.html b/api/classes/EmberAddon.html index cd1ff78..50b4377 100644 --- a/api/classes/EmberAddon.html +++ b/api/classes/EmberAddon.html @@ -42,15 +42,19 @@

    Classes

  • Builder
  • CLI
  • Command
  • +
  • CommandGenerator
  • DefaultPackager
  • EmberAddon
  • EmberApp
  • +
  • HardwareInfo
  • HistorySupportAddon
  • Instrumentation
  • NodeModulesList
  • NpmTask
  • +
  • PackageCache
  • PackageInfo
  • PackageInfoCache
  • +
  • PrivateTestHelpers
  • Project
  • ServeFilesAddon
  • TestsServerAddon
  • @@ -123,7 +127,6 @@

    EmberAddon

  • initializeAddons
  • populateLegacyFiles
  • shouldIncludeAddon
  • -
  • testIndex
  • toArray
  • @@ -132,7 +135,7 @@

    EmberAddon

    - Version: 3.8.1--84707b2801 + Version: 3.21.2
    @@ -618,21 +621,6 @@

    Method Summary

    private - - -
    - testIndex( ): Tree -
    -
    - -
    - - - - - private - -
    @@ -726,7 +714,7 @@

    Parameters:

    Public Methods

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

    public @@ -755,7 +743,7 @@

    Return:

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

    public @@ -883,7 +871,7 @@

    Parameters:

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

    public @@ -945,7 +933,7 @@

    Return:

    Private Methods

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

    private @@ -1002,7 +990,7 @@

    Return:

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

    private @@ -1059,7 +1047,7 @@

    Return:

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

    private @@ -1116,7 +1104,7 @@

    Return:

    - lib/broccoli/ember-app.js:1425 + lib/broccoli/ember-app.js:1341

    private @@ -1173,7 +1161,7 @@

    Return:

    - lib/broccoli/ember-app.js:561 + lib/broccoli/ember-app.js:559

    private @@ -1230,7 +1218,7 @@

    Return:

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

    private @@ -1300,7 +1288,7 @@

    Return:

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

    private @@ -1357,7 +1345,7 @@

    Return:

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

    private @@ -1459,7 +1447,7 @@

    Parameters:

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

    private @@ -1532,7 +1520,7 @@

    Parameters:

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

    private @@ -1583,7 +1571,7 @@

    Parameters:

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

    private @@ -1635,7 +1623,7 @@

    Parameters:

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

    private @@ -1708,7 +1696,7 @@

    Return:

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

    private @@ -1801,7 +1789,7 @@

    Return:

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

    private @@ -1895,7 +1883,7 @@

    Return:

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

    private @@ -1988,7 +1976,7 @@

    Return:

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

    private @@ -2045,7 +2033,7 @@

    Return:

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

    private @@ -2076,7 +2064,7 @@

    Return:

    - lib/broccoli/ember-app.js:902 + lib/broccoli/ember-app.js:905

    private @@ -2175,39 +2163,10 @@

    Return:

    -
    -
    -
    - lib/broccoli/ember-app.js:953 -

    - private - - - testIndex( ): Tree -

    -
    - -
    - Inherited from EmberApp -
    - - -
    Returns the tree for /tests/index.html
    - - -
    -

    Return:

    -
    - Tree - Tree for /tests/index.html -
    -
    - -
    - lib/broccoli/ember-app.js:1608 + lib/broccoli/ember-app.js:1532

    private diff --git a/api/classes/EmberApp.html b/api/classes/EmberApp.html index 95411da..47ca5aa 100644 --- a/api/classes/EmberApp.html +++ b/api/classes/EmberApp.html @@ -42,15 +42,19 @@

    Classes

  • Builder
  • CLI
  • Command
  • +
  • CommandGenerator
  • DefaultPackager
  • EmberAddon
  • EmberApp
  • +
  • HardwareInfo
  • HistorySupportAddon
  • Instrumentation
  • NodeModulesList
  • NpmTask
  • +
  • PackageCache
  • PackageInfo
  • PackageInfoCache
  • +
  • PrivateTestHelpers
  • Project
  • ServeFilesAddon
  • TestsServerAddon
  • @@ -128,7 +132,6 @@

    EmberApp

  • initializeAddons
  • populateLegacyFiles
  • shouldIncludeAddon
  • -
  • testIndex
  • toArray
  • @@ -137,14 +140,14 @@

    EmberApp

    - Version: 3.8.1--84707b2801 + Version: 3.21.2
    @@ -662,21 +665,6 @@

    Method Summary

    private - - -
    - testIndex( ): Tree -
    -
    -

    Returns the tree for /tests/index.html

    -
    - - - - - private - -
    @@ -697,7 +685,7 @@

    Method Summary

    Static Public Methods

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

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

    Return:

    Public Constructors

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

    public @@ -801,7 +789,7 @@

    Parameters:

    Public Methods

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

    public @@ -828,7 +816,7 @@

    Return:

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

    public @@ -956,7 +944,7 @@

    Parameters:

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

    public @@ -1018,7 +1006,7 @@

    Return:

    Private Methods

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

    private @@ -1072,7 +1060,7 @@

    Return:

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

    private @@ -1126,7 +1114,7 @@

    Return:

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

    private @@ -1181,7 +1169,7 @@

    Return:

    - lib/broccoli/ember-app.js:1425 + lib/broccoli/ember-app.js:1341

    private @@ -1236,7 +1224,7 @@

    Return:

    - lib/broccoli/ember-app.js:561 + lib/broccoli/ember-app.js:559

    private @@ -1290,7 +1278,7 @@

    Return:

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

    private @@ -1358,7 +1346,7 @@

    Return:

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

    private @@ -1413,7 +1401,7 @@

    Return:

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

    private @@ -1512,7 +1500,7 @@

    Parameters:

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

    private @@ -1581,7 +1569,7 @@

    Parameters:

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

    private @@ -1630,7 +1618,7 @@

    Parameters:

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

    private @@ -1679,7 +1667,7 @@

    Parameters:

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

    private @@ -1745,7 +1733,7 @@

    Return:

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

    private @@ -1837,7 +1825,7 @@

    Return:

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

    private @@ -1927,7 +1915,7 @@

    Return:

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

    private @@ -2016,7 +2004,7 @@

    Return:

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

    private @@ -2073,7 +2061,7 @@

    Return:

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

    private @@ -2101,7 +2089,7 @@

    Return:

    - lib/broccoli/ember-app.js:902 + lib/broccoli/ember-app.js:905

    private @@ -2194,38 +2182,10 @@

    Return:

    -
    -
    -
    - lib/broccoli/ember-app.js:953 -

    - private - - - testIndex( ): Tree -

    -
    - - - -

    Returns the tree for /tests/index.html

    -
    - - -
    -

    Return:

    -
    - Tree -

    Tree for /tests/index.html

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

    private diff --git a/api/classes/HardwareInfo.html b/api/classes/HardwareInfo.html new file mode 100644 index 0000000..a14743c --- /dev/null +++ b/api/classes/HardwareInfo.html @@ -0,0 +1,620 @@ + + + + + HardwareInfo - ember-cli + + + + + + +
    +
    + + +
    +
    + : +

    HardwareInfo

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

    Method Summary

    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    Private Methods
    + private + + + +
    + isUsingBattery(platform): Null | Boolean +
    +
    +

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

    +
    +
    + private + + + +
    + memorySwapUsed(platform): Null | Number +
    +
    +

    Determines the amount of swap/virtual memory currently in use.

    +
    +
    + private + + + + +
    +

    Determines the total amount of memory available to the host, as from os.totalmem.

    +
    +
    + private + + + +
    + memoryUsed( ): Object +
    +
    +

    Determines the amount of memory currently being used by the current Node process, as from process.memoryUsage.

    +
    +
    + private + + + + +
    +

    Determines the number of logical processors available to the host, as from os.cpus.

    +
    +
    + private + + + +
    + processorLoad(platform): Array +
    +
    +

    Determines the average processor load across the system. This is expressed as a fractional number between 0 and the number of logical processors.

    +
    +
    + private + + + + +
    +

    Gets the speed of the host's processors.

    +
    +
    + private + + + +
    + uptime( ): Number +
    +
    +

    Determines the time since the host was started, as from os.uptime.

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

    Private Methods

    +
    +
    + lib/models/hardware-info.js:232 +

    + private + + + isUsingBattery(platform): Null | Boolean +

    +
    + + + +

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

    +
    + +
    +

    Parameters:

    + + + + + + + + + + + + + + + + + + +
    NameTypeAttributeDescription
    platformString=process.platform +
      + + + +
    +

    The current hardware platform. +USED FOR TESTING ONLY.

    +
    +
    + +
    +

    Return:

    +
    + Null | Boolean +

    true iff the host is running on battery power or +false if not. null if the battery status +cannot be determined.

    +
    +
    +
    + + +
    +
    +
    + lib/models/hardware-info.js:266 +

    + private + + + memorySwapUsed(platform): Null | Number +

    +
    + + + +

    Determines the amount of swap/virtual memory currently in use.

    +
    + +
    +

    Parameters:

    + + + + + + + + + + + + + + + + + + +
    NameTypeAttributeDescription
    platformString=process.platform +
      + + + +
    +

    The current hardware platform. +USED FOR TESTING ONLY.

    +
    +
    + +
    +

    Return:

    +
    + Null | Number +

    The amount of used swap space, in bytes. null if +the used swap space cannot be determined.

    +
    +
    +
    + + +
    +
    +
    + lib/models/hardware-info.js:297 +

    + private + + + memoryTotal( ): Number +

    +
    + + + +

    Determines the total amount of memory available to the host, as from +os.totalmem.

    +
    + + +
    +

    Return:

    +
    + Number +

    The total memory in bytes.

    +
    +
    +
    + + +
    +
    +
    + lib/models/hardware-info.js:309 +

    + private + + + memoryUsed( ): Object +

    +
    + + + +

    Determines the amount of memory currently being used by the current Node +process, as from process.memoryUsage.

    +
    + + +
    +

    Return:

    +
    + Object +

    The Resident Set Size, as reported by +process.memoryUsage.

    +
    +
    +
    + + +
    +
    +
    + lib/models/hardware-info.js:322 +

    + private + + + processorCount( ): Number +

    +
    + + + +

    Determines the number of logical processors available to the host, as from +os.cpus.

    +
    + + +
    +

    Return:

    +
    + Number +

    The number of logical processors.

    +
    +
    +
    + + +
    +
    +
    + lib/models/hardware-info.js:334 +

    + private + + + processorLoad(platform): Array +

    +
    + + + +

    Determines the average processor load across the system. This is +expressed as a fractional number between 0 and the number of logical +processors.

    +
    + +
    +

    Parameters:

    + + + + + + + + + + + + + + + + + + +
    NameTypeAttributeDescription
    platformString=process.platform +
      + + + +
    +

    The current hardware platform. +USED FOR TESTING ONLY.

    +
    +
    + +
    +

    Return:

    +
    + Array +

    The one-, five-, and fifteen-minute processor load +averages.

    +
    +
    +
    + + +
    +
    +
    + lib/models/hardware-info.js:358 +

    + private + + + processorSpeed( ): Number +

    +
    + + + +

    Gets the speed of the host's processors.

    +

    If more than one processor is found, the average of their speeds is taken.

    +
    + + +
    +

    Return:

    +
    + Number +

    The average processor speed in MHz.

    +
    +
    +
    + + +
    +
    +
    + lib/models/hardware-info.js:373 +

    + private + + + uptime( ): Number +

    +
    + + + +

    Determines the time since the host was started, as from os.uptime.

    +
    + + +
    +

    Return:

    +
    + Number +

    The number of seconds since the host was started.

    +
    +
    +
    + + +
    +
    + + +
    +
    +
    +
    + + + + + diff --git a/api/classes/HistorySupportAddon.html b/api/classes/HistorySupportAddon.html index 66591da..db40078 100644 --- a/api/classes/HistorySupportAddon.html +++ b/api/classes/HistorySupportAddon.html @@ -42,15 +42,19 @@

    Classes

  • Builder
  • CLI
  • Command
  • +
  • CommandGenerator
  • DefaultPackager
  • EmberAddon
  • EmberApp
  • +
  • HardwareInfo
  • HistorySupportAddon
  • Instrumentation
  • NodeModulesList
  • NpmTask
  • +
  • PackageCache
  • PackageInfo
  • PackageInfoCache
  • +
  • PrivateTestHelpers
  • Project
  • ServeFilesAddon
  • TestsServerAddon
  • @@ -96,14 +100,14 @@

    HistorySupportAddon

    - Version: 3.8.1--84707b2801 + Version: 3.21.2
    @@ -160,7 +164,7 @@

    Constructor Summary

    Public Constructors

    - lib/tasks/server/middleware/history-support/index.js:9 + lib/tasks/server/middleware/history-support/index.js:8

    public diff --git a/api/classes/Instrumentation.html b/api/classes/Instrumentation.html index 63ffdbe..fdb5ffe 100644 --- a/api/classes/Instrumentation.html +++ b/api/classes/Instrumentation.html @@ -42,15 +42,19 @@

    Classes

  • Builder
  • CLI
  • Command
  • +
  • CommandGenerator
  • DefaultPackager
  • EmberAddon
  • EmberApp
  • +
  • HardwareInfo
  • HistorySupportAddon
  • Instrumentation
  • NodeModulesList
  • NpmTask
  • +
  • PackageCache
  • PackageInfo
  • PackageInfoCache
  • +
  • PrivateTestHelpers
  • Project
  • ServeFilesAddon
  • TestsServerAddon
  • @@ -97,14 +101,14 @@

    Instrumentation

    - Version: 3.8.1--84707b2801 + Version: 3.21.2
    diff --git a/api/classes/NodeModulesList.html b/api/classes/NodeModulesList.html index 6c5fe9a..f85d483 100644 --- a/api/classes/NodeModulesList.html +++ b/api/classes/NodeModulesList.html @@ -42,15 +42,19 @@

    Classes

  • Builder
  • CLI
  • Command
  • +
  • CommandGenerator
  • DefaultPackager
  • EmberAddon
  • EmberApp
  • +
  • HardwareInfo
  • HistorySupportAddon
  • Instrumentation
  • NodeModulesList
  • NpmTask
  • +
  • PackageCache
  • PackageInfo
  • PackageInfoCache
  • +
  • PrivateTestHelpers
  • Project
  • ServeFilesAddon
  • TestsServerAddon
  • @@ -102,7 +106,7 @@

    NodeModulesList

    - Version: 3.8.1--84707b2801 + Version: 3.21.2
    diff --git a/api/classes/NpmTask.html b/api/classes/NpmTask.html index 728d8f4..8daee7a 100644 --- a/api/classes/NpmTask.html +++ b/api/classes/NpmTask.html @@ -42,15 +42,19 @@

    Classes

  • Builder
  • CLI
  • Command
  • +
  • CommandGenerator
  • DefaultPackager
  • EmberAddon
  • EmberApp
  • +
  • HardwareInfo
  • HistorySupportAddon
  • Instrumentation
  • NodeModulesList
  • NpmTask
  • +
  • PackageCache
  • PackageInfo
  • PackageInfoCache
  • +
  • PrivateTestHelpers
  • Project
  • ServeFilesAddon
  • TestsServerAddon
  • @@ -102,14 +106,14 @@

    NpmTask

    - Version: 3.8.1--84707b2801 + Version: 3.21.2
    @@ -209,7 +213,7 @@

    Method Summary

    Private Constructors

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

    private @@ -265,7 +269,7 @@

    Parameters:

    Private Methods

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

    private @@ -297,7 +301,7 @@

    Return:

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

    private diff --git a/api/classes/PackageCache.html b/api/classes/PackageCache.html new file mode 100644 index 0000000..4502824 --- /dev/null +++ b/api/classes/PackageCache.html @@ -0,0 +1,1911 @@ + + + + + PackageCache - ember-cli + + + + + + +
    +
    + + +
    +
    + + + + +

    The PackageCache wraps all package management functions. It also +handles initial global state setup.

    +

    Usage:

    +
    let cache = new PackageCache();
    +let dir = cache.create('your-cache', 'yarn', '{
    +  "dependencies": {
    +    "lodash": "*",
    +    "ember-cli": "*"
    +  }
    +}');
    +// => process.cwd()/tmp/your-cache-A3B4C6D
    +
    +

    This will generate a persistent cache which contains the results +of a clean installation of the dependencies as you specified in +the manifest argument. It will save the results of these in a +temporary folder, returned as dir. On a second invocation +(in the same process, or in a subsequent run) PackageCache will first +compare the manifest to the previously installed one, using the manifest +as the cache key, and make a decision as to the fastest way to get +the cache up-to-date. PackageCache guarantees that your cache will +always be up-to-date.

    +

    If done in the same process, this simply returns the existing cache +directory with no change, making the following invocation simply a +cache validation check:

    +
    let dir2 = cache.create('your-cache', 'yarn', '{
    +  "dependencies": {
    +    "lodash": "*",
    +    "ember-cli": "*"
    +  }
    +}');
    +// => process.cwd()/tmp/your-cache-A3B4C6D
    +
    +

    If you wish to modify a cache you can do so using the update API:

    +
    let dir3 = cache.update('your-cache', 'yarn', '{
    +  "dependencies": {
    +    "": "*",
    +    "lodash": "*",
    +    "ember-cli": "*"
    +  }
    +}');
    +// => process.cwd()/tmp/your-cache-A3B4C6D
    +
    +

    Underneath the hood create and update are identical–which +makes clear the simplicity of this tool. It will always do the +right thing. You can think of the outcome of any create or +update call as identical to rm -rf node_modules && npm install +except as performant as possible.

    +

    If you need to make modifications to a cache but wish to retain +the original you can invoke the clone command:

    +
    let newDir = cache.clone('your-cache', 'modified-cache');
    +let manifest = fs.readJsonSync(path.join(newDir, 'package.json'));
    +manifest.dependencies['express'] = '*';
    +cache.update('modified-cache', 'yarn', JSON.stringify(manifest));
    +// => process.cwd()/tmp/modified-cache-F8D5C8B
    +
    +

    This mental model makes it easy to prevent coding mistakes, state +leakage across multiple test runs by making multiple caches cheap, +and has tremendous performance benefits.

    +

    You can even programatically update a cache:

    +
    let CommandGenerator = require('./command-generator');
    +let yarn = new CommandGenerator('yarn');
    +
    +let dir = cache.create('your-cache', 'yarn', '{ ... }');
    +
    +yarn.invoke('add', 'some-addon', { cwd: dir });
    +
    +

    The programmatic approach enables the entire set of usecases that +the underlying package manager supports while continuing to wrap it +in a persistent cache. You should not directly modify any files in the +cache other than the manifest unless you really know what you're doing as +that can put the cache into a possibly invalid state.

    +

    PackageCache also supports linking. If you pass an array of module names to +in the fourth position it will ensure that those are linked, and remain +linked for the lifetime of the cache. When you link a package it uses the +current global link provided by the underlying package manager and invokes +their built-in link command.

    +
    let dir = cache.create('your-cache', 'yarn', '{ ... }', ['ember-cli']);
    +// => yarn link ember-cli happens along the way.
    +
    +

    Sometimes this global linking behavior is not what you want. Instead you wish +to link in some other working directory. PackageCache makes a best effort +attempt at supporting this workflow by allowing you to specify an object in +the links argument array passed to create.

    +

    let dir = cache.create('your-cache', 'yarn', '{ ... }', [ +{ name: 'ember-cli', path: '/the/absolute/path/to/the/package' }, +'other-package' +]);

    +

    This creates a symlink at the named package path to the specified directory. +As package managers do different things for their own linking behavior this +is "best effort" only. Be sure to review upstream behavior to identify if you +rely on those features for your code to function:

    + +

    As the only caveat, PackageCache is persistent. The consuming +code is responsible for ensuring that the cache size does not +grow unbounded.

    +
    + + + + +

    Constructor Summary

    + + + + + + + + + + + + + + + +
    Private Constructors
    + private + + + +
    + PackageCache(rootPath) +
    +
    +

    The PackageCache wraps all package management functions. It also handles initial global state setup.

    +
    +
    + + + + +

    Method Summary

    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    Public Methods
    + public + + + +
    + create(label, type, manifest, links): String +
    +
    +

    The create method adds a new package cache entry.

    +
    +
    + public + + + +
    + destroy(label, type) +
    +
    +

    The destroy method removes all evidence of the package cache.

    +
    +
    + public + + + +
    + destroy(fromLabel, toLabel) +
    +
    +

    The clone method duplicates a cache. Some package managers can leverage a pre-existing state to speed up their installation.

    +
    +
    + public + + + +
    + get(label): String +
    +
    +

    The get method returns the directory for the cache.

    +
    +
    + public + + + +
    + update(label, type, manifest, links): String +
    +
    +

    The update method aliases the create method.

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

    The __resetForTesting puts things back in module scope.

    +
    +
    + private + + + + +
    +

    The __setupForTesting modifies things in module scope.

    +
    +
    + private + + + +
    + _checkManifest(label, type, manifest): Boolean +
    +
    +

    The _checkManifest method compares the desired manifest to that which exists in the cache.

    +
    +
    + private + + + +
    + _cleanDirs( ) +
    +
    +

    The _cleanDirs method deals with sync issues between the Configstore and what exists on disk. Non-existent directories are removed from this.dirs.

    +
    +
    + private + + + +
    + _install(label, type) +
    +
    +

    The _install method installs the contents of the manifest into the specified package cache.

    +
    +
    + private + + + +
    + _readManifest(label, type): String +
    +
    +

    The _readManifest method reads the on-disk manifest for the current cache and returns its value.

    +
    +
    + private + + + +
    + _removeLinks(label, type) +
    +
    +

    The _removeLinks method removes from the dependencies of the manifest the assets which will be linked in so that we don't duplicate install. It saves off the values in the internal PackageCache metadata for restoration after linking as those values may be necessary.

    +
    +
    + private + + + +
    + _restoreLinks(label, type) +
    +
    +

    The _restoreLinks method restores the dependencies from the internal PackageCache metadata so that the manifest matches its original state after performing the links.

    +
    +
    + private + + + +
    + _upgrade(label, type) +
    +
    +

    The _upgrade method guarantees that the contents of the manifest are allowed to drift in a SemVer compatible manner. It ensures that CI is always running against the latest versions of all dependencies.

    +
    +
    + private + + + +
    + _writeManifest(label, type, manifest) +
    +
    +

    The _writeManifest method generates the on-disk folder for the package cache and saves the manifest into it. If it is a yarn package cache it will remove the existing lock file.

    +
    +
    + private + + + +
    + bower(subcommand, [arguments], [options={}]) +
    +
    +

    The bower command helper.

    +
    +
    + private + + + +
    + npm(subcommand, [arguments], [options={}]) +
    +
    +

    The npm command helper.

    +
    +
    + private + + + +
    + translate(type, lookup) +
    +
    +

    The translate command is used to turn a consistent argument into appropriate values based upon the context in which it is used. It's a convenience helper to avoid littering lookups throughout the code.

    +
    +
    + private + + + +
    + yarn(subcommand, [arguments], [options={}]) +
    +
    +

    The yarn command helper.

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

    Private Constructors

    +
    +
    + tests/helpers/package-cache.js:102 +

    + private + + + PackageCache(rootPath) +

    +
    + + + +
    + +
    +

    Parameters:

    + + + + + + + + + + + + + + + + + + +
    NameTypeAttributeDescription
    rootPathString +
      + + + +
    +

    Root of the directory for PackageCache.

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

    Public Methods

    +
    +
    + tests/helpers/package-cache.js:578 +

    + public + + + create(label, type, manifest, links): String +

    +
    + + + +

    The create method adds a new package cache entry.

    +
    + +
    +

    Parameters:

    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    NameTypeAttributeDescription
    labelString +
      + + + +
    +

    The label for the cache.

    +
    typeString +
      + + + +
    +

    The type of package cache.

    +
    manifestString +
      + + + +
    +

    The contents of the manifest file for the cache.

    +
    linksArray +
      + + + +
    +

    Packages to omit for install and link.

    +
    +
    + +
    +

    Return:

    +
    + String +

    The directory on disk which contains the cache.

    +
    +
    +
    + + +
    +
    +
    + tests/helpers/package-cache.js:644 +

    + public + + + destroy(label, type) +

    +
    + + + +

    The destroy method removes all evidence of the package cache.

    +
    + +
    +

    Parameters:

    + + + + + + + + + + + + + + + + + + + + + + + + + +
    NameTypeAttributeDescription
    labelString +
      + + + +
    +

    The label for the cache.

    +
    typeString +
      + + + +
    +

    The type of package cache.

    +
    +
    + + + +
    +
    +
    + tests/helpers/package-cache.js:659 +

    + public + + + destroy(fromLabel, toLabel) +

    +
    + + + +

    The clone method duplicates a cache. Some package managers can +leverage a pre-existing state to speed up their installation.

    +
    + +
    +

    Parameters:

    + + + + + + + + + + + + + + + + + + + + + + + + + +
    NameTypeAttributeDescription
    fromLabelString +
      + + + +
    +

    The label for the cache to clone.

    +
    toLabelString +
      + + + +
    +

    The label for the new cache.

    +
    +
    + + + +
    +
    +
    + tests/helpers/package-cache.js:633 +

    + public + + + get(label): String +

    +
    + + + +

    The get method returns the directory for the cache.

    +
    + +
    +

    Parameters:

    + + + + + + + + + + + + + + + + + + +
    NameTypeAttributeDescription
    labelString +
      + + + +
    +

    The label for the cache.

    +
    +
    + +
    +

    Return:

    +
    + String +

    The directory on disk which contains the cache.

    +
    +
    +
    + + +
    +
    +
    + tests/helpers/package-cache.js:619 +

    + public + + + update(label, type, manifest, links): String +

    +
    + + + +

    The update method aliases the create method.

    +
    + +
    +

    Parameters:

    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    NameTypeAttributeDescription
    labelString +
      + + + +
    +

    The label for the cache.

    +
    typeString +
      + + + +
    +

    The type of package cache.

    +
    manifestString +
      + + + +
    +

    The contents of the manifest file for the cache.

    +
    linksArray +
      + + + +
    +

    Packages to elide for install and link.

    +
    +
    + +
    +

    Return:

    +
    + String +

    The directory on disk which contains the cache.

    +
    +
    +
    + + +
    +
    + + +
    +

    Private Methods

    +
    +
    + tests/helpers/package-cache.js:264 +

    + private + + + __resetForTesting( ) +

    +
    + + + +

    The __resetForTesting puts things back in module scope.

    +
    + + + + +
    +
    +
    + tests/helpers/package-cache.js:253 +

    + private + + + __setupForTesting( ) +

    +
    + + + +

    The __setupForTesting modifies things in module scope.

    +
    + + + + +
    +
    +
    + tests/helpers/package-cache.js:483 +

    + private + + + _checkManifest(label, type, manifest): Boolean +

    +
    + + + +

    The _checkManifest method compares the desired manifest to that which +exists in the cache.

    +
    + +
    +

    Parameters:

    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    NameTypeAttributeDescription
    labelString +
      + + + +
    +

    The label for the cache.

    +
    typeString +
      + + + +
    +

    The type of package cache.

    +
    manifestString +
      + + + +
    +

    The contents of the manifest file to compare to cache.

    +
    +
    + +
    +

    Return:

    +
    + Boolean +

    true if identical.

    +
    +
    +
    + + +
    +
    +
    + tests/helpers/package-cache.js:274 +

    + private + + + _cleanDirs( ) +

    +
    + + + +

    The _cleanDirs method deals with sync issues between the +Configstore and what exists on disk. Non-existent directories +are removed from this.dirs.

    +
    + + + + +
    +
    +
    + tests/helpers/package-cache.js:524 +

    + private + + + _install(label, type) +

    +
    + + + +

    The _install method installs the contents of the manifest into the +specified package cache.

    +
    + +
    +

    Parameters:

    + + + + + + + + + + + + + + + + + + + + + + + + + +
    NameTypeAttributeDescription
    labelString +
      + + + +
    +

    The label for the cache.

    +
    typeString +
      + + + +
    +

    The type of package cache.

    +
    +
    + + + +
    +
    +
    + tests/helpers/package-cache.js:295 +

    + private + + + _readManifest(label, type): String +

    +
    + + + +

    The _readManifest method reads the on-disk manifest for the current +cache and returns its value.

    +
    + +
    +

    Parameters:

    + + + + + + + + + + + + + + + + + + + + + + + + + +
    NameTypeAttributeDescription
    labelString +
      + + + +
    +

    The label for the cache.

    +
    typeString +
      + + + +
    +

    The type of package cache.

    +
    +
    + +
    +

    Return:

    +
    + String +

    The manifest file contents on disk.

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

    The _removeLinks method removes from the dependencies of the manifest the +assets which will be linked in so that we don't duplicate install. It saves +off the values in the internal PackageCache metadata for restoration after +linking as those values may be necessary.

    +

    It is also responsible for removing these links prior to making any changes +to the specified cache.

    +
    + +
    +

    Parameters:

    + + + + + + + + + + + + + + + + + + + + + + + + + +
    NameTypeAttributeDescription
    labelString +
      + + + +
    +

    The label for the cache.

    +
    typeString +
      + + + +
    +

    The type of package cache.

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

    The _restoreLinks method restores the dependencies from the internal +PackageCache metadata so that the manifest matches its original state after +performing the links.

    +

    It is also responsible for restoring these links into the PackageCache.

    +
    + +
    +

    Parameters:

    + + + + + + + + + + + + + + + + + + + + + + + + + +
    NameTypeAttributeDescription
    labelString +
      + + + +
    +

    The label for the cache.

    +
    typeString +
      + + + +
    +

    The type of package cache.

    +
    +
    + + + +
    +
    +
    + tests/helpers/package-cache.js:542 +

    + private + + + _upgrade(label, type) +

    +
    + + + +

    The _upgrade method guarantees that the contents of the manifest are +allowed to drift in a SemVer compatible manner. It ensures that CI is +always running against the latest versions of all dependencies.

    +
    + +
    +

    Parameters:

    + + + + + + + + + + + + + + + + + + + + + + + + + +
    NameTypeAttributeDescription
    labelString +
      + + + +
    +

    The label for the cache.

    +
    typeString +
      + + + +
    +

    The type of package cache.

    +
    +
    + + + +
    +
    +
    + tests/helpers/package-cache.js:326 +

    + private + + + _writeManifest(label, type, manifest) +

    +
    + + + +

    The _writeManifest method generates the on-disk folder for the package cache +and saves the manifest into it. If it is a yarn package cache it will remove +the existing lock file.

    +
    + +
    +

    Parameters:

    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    NameTypeAttributeDescription
    labelString +
      + + + +
    +

    The label for the cache.

    +
    typeString +
      + + + +
    +

    The type of package cache.

    +
    manifestString +
      + + + +
    +

    The contents of the manifest file to write to disk.

    +
    +
    + + + +
    +
    +
    + tests/helpers/package-cache.js:25 +

    + private + + + bower(subcommand, [arguments], [options={}]) +

    +
    + + + +

    The bower command helper.

    +
    + +
    +

    Parameters:

    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    NameTypeAttributeDescription
    subcommandString +
      + + + +
    +

    The subcommand to be passed into bower.

    +
    argumentsString +
      +
    • optional
    • + +
    • multiple
    • +
    +

    Arguments to be passed into the bower subcommand.

    +
    optionsObject +
      +
    • optional
    • +
    • default: {}
    • + +
    +

    The options passed into child_process.spawnSync. +(https://nodejs.org/api/child_process.html#child_process_child_process_spawnsync_command_args_options)

    +
    +
    + + + +
    +
    +
    + tests/helpers/package-cache.js:37 +

    + private + + + npm(subcommand, [arguments], [options={}]) +

    +
    + + + +

    The npm command helper.

    +
    + +
    +

    Parameters:

    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    NameTypeAttributeDescription
    subcommandString +
      + + + +
    +

    The subcommand to be passed into npm.

    +
    argumentsString +
      +
    • optional
    • + +
    • multiple
    • +
    +

    Arguments to be passed into the npm subcommand.

    +
    optionsObject +
      +
    • optional
    • +
    • default: {}
    • + +
    +

    The options passed into child_process.spawnSync. +(https://nodejs.org/api/child_process.html#child_process_child_process_spawnsync_command_args_options)

    +
    +
    + + + +
    +
    +
    + tests/helpers/package-cache.js:88 +

    + private + + + translate(type, lookup) +

    +
    + + + +

    The translate command is used to turn a consistent argument into +appropriate values based upon the context in which it is used. It's +a convenience helper to avoid littering lookups throughout the code.

    +
    + +
    +

    Parameters:

    + + + + + + + + + + + + + + + + + + + + + + + + + +
    NameTypeAttributeDescription
    typeString +
      + + + +
    +

    Either 'bower', 'npm', or 'yarn'.

    +
    lookupString +
      + + + +
    +

    Either 'manifest', 'path', or 'upgrade'.

    +
    +
    + + + +
    +
    +
    + tests/helpers/package-cache.js:49 +

    + private + + + yarn(subcommand, [arguments], [options={}]) +

    +
    + + + +

    The yarn command helper.

    +
    + +
    +

    Parameters:

    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    NameTypeAttributeDescription
    subcommandString +
      + + + +
    +

    The subcommand to be passed into yarn.

    +
    argumentsString +
      +
    • optional
    • + +
    • multiple
    • +
    +

    Arguments to be passed into the yarn subcommand.

    +
    optionsObject +
      +
    • optional
    • +
    • default: {}
    • + +
    +

    The options passed into child_process.spawnSync. +(https://nodejs.org/api/child_process.html#child_process_child_process_spawnsync_command_args_options)

    +
    +
    + + + +
    +
    + + +
    +
    +
    +
    + + + + + diff --git a/api/classes/PackageInfo.html b/api/classes/PackageInfo.html index ac0b619..9cae074 100644 --- a/api/classes/PackageInfo.html +++ b/api/classes/PackageInfo.html @@ -42,15 +42,19 @@

    Classes

  • Builder
  • CLI
  • Command
  • +
  • CommandGenerator
  • DefaultPackager
  • EmberAddon
  • EmberApp
  • +
  • HardwareInfo
  • HistorySupportAddon
  • Instrumentation
  • NodeModulesList
  • NpmTask
  • +
  • PackageCache
  • PackageInfo
  • PackageInfoCache
  • +
  • PrivateTestHelpers
  • Project
  • ServeFilesAddon
  • TestsServerAddon
  • @@ -108,7 +112,7 @@

    PackageInfo

    - Version: 3.8.1--84707b2801 + Version: 3.21.2
    @@ -324,7 +328,7 @@

    Method Summary

    Public Methods

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

    public diff --git a/api/classes/PackageInfoCache.html b/api/classes/PackageInfoCache.html index a5e3c98..d0ef8df 100644 --- a/api/classes/PackageInfoCache.html +++ b/api/classes/PackageInfoCache.html @@ -42,15 +42,19 @@

    Classes

  • Builder
  • CLI
  • Command
  • +
  • CommandGenerator
  • DefaultPackager
  • EmberAddon
  • EmberApp
  • +
  • HardwareInfo
  • HistorySupportAddon
  • Instrumentation
  • NodeModulesList
  • NpmTask
  • +
  • PackageCache
  • PackageInfo
  • PackageInfoCache
  • +
  • PrivateTestHelpers
  • Project
  • ServeFilesAddon
  • TestsServerAddon
  • @@ -104,8 +108,6 @@

    PackageInfoCache

  • _readPackage
  • _resolveDependencies
  • _showObjErrors
  • -
  • getRealDirectoryPath
  • -
  • getRealFilePath
  • @@ -113,14 +115,14 @@

    PackageInfoCache

    - Version: 3.8.1--84707b2801 + Version: 3.21.2
    @@ -353,36 +355,6 @@

    Method Summary

    - - - private - - - - -
    - getRealDirectoryPath(directoryPath): String -
    -
    -

    Resolve the real path for a directory, return null if does not exist or is not a directory, return the real path otherwise.

    -
    - - - - - private - - - - -
    - getRealFilePath(filePath): String -
    -
    -

    Resolve the real path for a file, return null if does not exist or is not a file or FIFO, return the real path otherwise.

    -
    - - @@ -402,7 +374,7 @@

    Method Summary

    Public Methods

    - lib/models/package-info-cache/index.js:146 + lib/models/package-info-cache/index.js:65

    public @@ -745,7 +717,7 @@

    Private Methods

    -
    -
    - lib/models/package-info-cache/index.js:60 -

    - private - - - getRealDirectoryPath(directoryPath): String -

    -
    - - - -

    Resolve the real path for a directory, return null if does not -exist or is not a directory, return the real path otherwise.

    -
    - -
    -

    Parameters:

    - - - - - - - - - - - - - - - - - - -
    NameTypeAttributeDescription
    directoryPathString -
      - - - -
    -

    the path to the directory of interest

    -
    -
    - -
    -

    Return:

    -
    - String -

    real path or null

    -
    -
    -
    - - -
    -
    -
    - lib/models/package-info-cache/index.js:19 -

    - private - - - getRealFilePath(filePath): String -

    -
    - - - -

    Resolve the real path for a file, return null if does not -exist or is not a file or FIFO, return the real path otherwise.

    -
    - -
    -

    Parameters:

    - - - - - - - - - - - - - - - - - - -
    NameTypeAttributeDescription
    filePathString -
      - - - -
    -

    the path to the file of interest

    -
    -
    - -
    -

    Return:

    -
    - String -

    real path or null

    -
    -
    -
    - -
    diff --git a/api/classes/PrivateTestHelpers.html b/api/classes/PrivateTestHelpers.html new file mode 100644 index 0000000..f373198 --- /dev/null +++ b/api/classes/PrivateTestHelpers.html @@ -0,0 +1,294 @@ + + + + + PrivateTestHelpers - ember-cli + + + + + + +
    +
    + + +
    +
    + tests/helpers/acceptance.js:46 +

    PrivateTestHelpers

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

    Property Summary

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

    Use createTestTargets in the before hook to do the initial setup of a project. This will ensure that we limit the amount of times we go to the network to fetch dependencies.

    +
    +
    + + + +

    Method Summary

    + + + + + + + + + + + + + +
    Public Methods
    + public + + + +
    + linkDependencies(projectName): String +
    +
    +

    Creates symbolic links from the dependency temp directories to the project that is under test.

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

    Public Properties

    +
    +
    + tests/helpers/acceptance.js:50 +

    + public + + + options.command The command you want to run: String +

    +
    + + +

    Use createTestTargets in the before hook to do the initial +setup of a project. This will ensure that we limit the amount of times +we go to the network to fetch dependencies.

    +
    + +
    +
    + + + +
    +

    Public Methods

    +
    +
    + tests/helpers/acceptance.js:83 +

    + public + + + linkDependencies(projectName): String +

    +
    + + + +

    Creates symbolic links from the dependency temp directories +to the project that is under test.

    +
    + +
    +

    Parameters:

    + + + + + + + + + + + + + + + + + + +
    NameTypeAttributeDescription
    projectNameString +
      + + + +
    +

    The name of the project under test

    +
    +
    + +
    +

    Return:

    +
    + String +

    The path to the hydrated fixture.

    +
    +
    +
    + + +
    +
    + + + + +
    +
    +
    +
    + + + + + diff --git a/api/classes/Project.html b/api/classes/Project.html index c5e9c14..6ba3c8c 100644 --- a/api/classes/Project.html +++ b/api/classes/Project.html @@ -42,15 +42,19 @@

    Classes

  • Builder
  • CLI
  • Command
  • +
  • CommandGenerator
  • DefaultPackager
  • EmberAddon
  • EmberApp
  • +
  • HardwareInfo
  • HistorySupportAddon
  • Instrumentation
  • NodeModulesList
  • NpmTask
  • +
  • PackageCache
  • PackageInfo
  • PackageInfoCache
  • +
  • PrivateTestHelpers
  • Project
  • ServeFilesAddon
  • TestsServerAddon
  • @@ -111,6 +115,7 @@

    Project

    @@ -350,6 +353,21 @@

    Method Summary

    public + + +
    + findAddonByName(name): Addon +
    +
    +

    Find an addon by its name

    +
    + + + + + public + +
    @@ -541,21 +559,6 @@

    Method Summary

    private - - -
    - findAddonByName(name): Addon -
    -
    -

    Find an addon by its name

    -
    - - - - - private - -
    @@ -616,21 +619,6 @@

    Method Summary

    private - - - -
    -

    Returns whether this is using a module unification format.

    -
    - - - - - private - -
    @@ -741,7 +729,7 @@

    Method Summary

    Static Public Methods

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

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

    Return:

    Static Private Methods

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

    private static @@ -846,7 +834,7 @@

    Return:

    - lib/models/project.js:689 + lib/models/project.js:681

    private static @@ -1003,7 +991,7 @@

    Parameters:

    Public Properties

    - lib/models/project.js:280 + lib/models/project.js:264

    public @@ -1048,7 +1036,7 @@

    Public Methods

    - lib/models/project.js:243 + lib/models/project.js:226

    public @@ -1102,10 +1090,67 @@

    Return:

    +
    +
    +
    + lib/models/project.js:607 +

    + public + + + findAddonByName(name): Addon +

    +
    + + + +

    Find an addon by its name

    +
    + +
    +

    Parameters:

    + + + + + + + + + + + + + + + + + + +
    NameTypeAttributeDescription
    nameString +
      + + + +
    +

    Addon name as specified in package.json

    +
    +
    + +
    +

    Return:

    +
    + Addon +

    Addon instance

    +
    +
    +
    + +
    - lib/models/project.js:629 + lib/models/project.js:621

    public @@ -1178,7 +1223,7 @@

    Return:

    - lib/models/project.js:201 + lib/models/project.js:199

    public @@ -1206,7 +1251,7 @@

    Return:

    - lib/models/project.js:356 + lib/models/project.js:340

    public @@ -1270,7 +1315,7 @@

    Return:

    Private Methods

    - lib/models/project.js:566 + lib/models/project.js:554

    private @@ -1298,7 +1343,7 @@

    Return:

    - lib/models/project.js:475 + lib/models/project.js:461

    private @@ -1327,7 +1372,7 @@

    Return:

    - lib/models/project.js:548 + lib/models/project.js:536

    private @@ -1355,7 +1400,7 @@

    Return:

    - lib/models/project.js:391 + lib/models/project.js:375

    private @@ -1412,7 +1457,7 @@

    Return:

    - lib/models/project.js:226 + lib/models/project.js:209

    private @@ -1440,7 +1485,7 @@

    Return:

    - lib/models/project.js:261 + lib/models/project.js:245

    private @@ -1487,7 +1532,7 @@

    Parameters:

    Return:

    Object -

    Merged confiration object

    +

    Merged configuration object

    @@ -1496,7 +1541,7 @@

    Return:

    - lib/models/project.js:371 + lib/models/project.js:355

    private @@ -1567,7 +1612,7 @@

    Return:

    - lib/models/project.js:431 + lib/models/project.js:417

    private @@ -1589,7 +1634,7 @@

    - lib/models/project.js:514 + lib/models/project.js:502

    private @@ -1640,67 +1685,10 @@

    Parameters:

    -
    -
    -
    - lib/models/project.js:615 -

    - private - - - findAddonByName(name): Addon -

    -
    - - - -

    Find an addon by its name

    -
    - -
    -

    Parameters:

    - - - - - - - - - - - - - - - - - - -
    NameTypeAttributeDescription
    nameString -
      - - - -
    -

    Addon name as specified in package.json

    -
    -
    - -
    -

    Return:

    -
    - Addon -

    Addon instance

    -
    -
    -
    - -
    - lib/models/project.js:307 + lib/models/project.js:291

    private @@ -1771,7 +1759,7 @@

    Return:

    - lib/models/project.js:330 + lib/models/project.js:314

    private @@ -1828,7 +1816,7 @@

    Return:

    - lib/models/project.js:455 + lib/models/project.js:441

    private @@ -1848,7 +1836,7 @@

    - lib/models/project.js:189 + lib/models/project.js:187

    private @@ -1874,38 +1862,10 @@

    Return:

    -
    -
    -
    - lib/models/project.js:211 -

    - private - - - isModuleUnification( ): Boolean -

    -
    - - - -

    Returns whether this is using a module unification format.

    -
    - - -
    -

    Return:

    -
    - Boolean -

    Whether this is using a module unification format.

    -
    -
    -
    - -
    - lib/models/project.js:537 + lib/models/project.js:525

    private @@ -1933,7 +1893,7 @@

    Return:

    - lib/models/project.js:176 + lib/models/project.js:174

    private @@ -1961,7 +1921,7 @@

    Return:

    - lib/models/project.js:603 + lib/models/project.js:595

    private @@ -1981,7 +1941,7 @@

    - lib/models/project.js:585 + lib/models/project.js:577

    private @@ -2009,7 +1969,7 @@

    Return:

    - lib/models/project.js:342 + lib/models/project.js:326

    private @@ -2086,7 +2046,7 @@

    - lib/models/project.js:407 + lib/models/project.js:391

    private diff --git a/api/classes/ServeFilesAddon.html b/api/classes/ServeFilesAddon.html index d3a3fc2..fd22c07 100644 --- a/api/classes/ServeFilesAddon.html +++ b/api/classes/ServeFilesAddon.html @@ -42,15 +42,19 @@

    Classes

  • Builder
  • CLI
  • Command
  • +
  • CommandGenerator
  • DefaultPackager
  • EmberAddon
  • EmberApp
  • +
  • HardwareInfo
  • HistorySupportAddon
  • Instrumentation
  • NodeModulesList
  • NpmTask
  • +
  • PackageCache
  • PackageInfo
  • PackageInfoCache
  • +
  • PrivateTestHelpers
  • Project
  • ServeFilesAddon
  • TestsServerAddon
  • @@ -101,7 +105,7 @@

    ServeFilesAddon

    - Version: 3.8.1--84707b2801 + Version: 3.21.2
    diff --git a/api/classes/TestsServerAddon.html b/api/classes/TestsServerAddon.html index e14c30e..f143834 100644 --- a/api/classes/TestsServerAddon.html +++ b/api/classes/TestsServerAddon.html @@ -42,15 +42,19 @@

    Classes

  • Builder
  • CLI
  • Command
  • +
  • CommandGenerator
  • DefaultPackager
  • EmberAddon
  • EmberApp
  • +
  • HardwareInfo
  • HistorySupportAddon
  • Instrumentation
  • NodeModulesList
  • NpmTask
  • +
  • PackageCache
  • PackageInfo
  • PackageInfoCache
  • +
  • PrivateTestHelpers
  • Project
  • ServeFilesAddon
  • TestsServerAddon
  • @@ -96,7 +100,7 @@

    TestsServerAddon

    - Version: 3.8.1--84707b2801 + Version: 3.21.2
    diff --git a/api/classes/WatcherAddon.html b/api/classes/WatcherAddon.html index 9de6f84..39df8c8 100644 --- a/api/classes/WatcherAddon.html +++ b/api/classes/WatcherAddon.html @@ -42,15 +42,19 @@

    Classes

  • Builder
  • CLI
  • Command
  • +
  • CommandGenerator
  • DefaultPackager
  • EmberAddon
  • EmberApp
  • +
  • HardwareInfo
  • HistorySupportAddon
  • Instrumentation
  • NodeModulesList
  • NpmTask
  • +
  • PackageCache
  • PackageInfo
  • PackageInfoCache
  • +
  • PrivateTestHelpers
  • Project
  • ServeFilesAddon
  • TestsServerAddon
  • @@ -96,7 +100,7 @@

    WatcherAddon

    - Version: 3.8.1--84707b2801 + Version: 3.21.2
    diff --git a/api/classes/WindowsSymlinkChecker.html b/api/classes/WindowsSymlinkChecker.html index 2f62c0c..ef8695d 100644 --- a/api/classes/WindowsSymlinkChecker.html +++ b/api/classes/WindowsSymlinkChecker.html @@ -42,15 +42,19 @@

    Classes

  • Builder
  • CLI
  • Command
  • +
  • CommandGenerator
  • DefaultPackager
  • EmberAddon
  • EmberApp
  • +
  • HardwareInfo
  • HistorySupportAddon
  • Instrumentation
  • NodeModulesList
  • NpmTask
  • +
  • PackageCache
  • PackageInfo
  • PackageInfoCache
  • +
  • PrivateTestHelpers
  • Project
  • ServeFilesAddon
  • TestsServerAddon
  • @@ -118,29 +122,29 @@

    WindowsSymlinkChecker

    - Version: 3.8.1--84707b2801 + Version: 3.21.2
    -

    On windows users will have a much better experience if symlinks are enabled -an usable. This object when queried informs windows users, if they can -improve there build performance, and how.

    +

    On Windows, users will have a much better experience if symlinks are enabled +and usable. When queried, this object informs Windows users regarding +improving their build performance, and how.

    -

    Windows vista: nothing we can really do, so we fall back to junctions for folders + copying of files -<= Windows vista: symlinks are available but using them is somewhat tricky -* if the users is an admin, the process needed to have been started with elevated privs +

    Windows Vista: nothing we can really do, so we fall back to junctions for folders + copying of files +<= Windows Vista: symlinks are available but using them is somewhat tricky +* if the user is an admin, the process needs to have been started with elevated privileges * if the user is not an admin, a specific setting needs to be enabled -<= Windows 10 Insiders build 14972 +<= Windows 10 * if developer mode is enabled, symlinks "just work" * https://blogs.windows.com/buildingapps/2016/12/02/symlinks-windows-10

    @@ -221,7 +225,7 @@

    Method Summary

    - contentFor(config, mathch, type, options): String + contentFor(config, match, type, options): String

    Returns the content for a specific type (section) for index.html.

    @@ -568,7 +572,7 @@

    Return:

    - lib/utilities/windows-admin.js:83 + lib/utilities/windows-admin.js:81

    public @@ -635,7 +639,7 @@

    public - contentFor(config, mathch, type, options): String + contentFor(config, match, type, options): String

    @@ -682,7 +686,7 @@

    Parameters:

    - mathch + match RegExp
      @@ -749,20 +753,6 @@

      Parameters:

      Controls whether to include the contents of config

      - - - - options.isModuleUnification - Boolean - -
        - - - -
      - -

      Signifies if the application -supports module unification or not

      @@ -841,7 +831,7 @@

      Return:

    - lib/utilities/valid-project-name.js:13 + lib/utilities/valid-project-name.js:24

    public @@ -1159,7 +1149,7 @@

    Return:

    Private Methods

    - lib/utilities/windows-admin.js:61 + lib/utilities/windows-admin.js:60

    private @@ -1387,7 +1377,7 @@

    Return:

    - lib/tasks/serve.js:92 + lib/tasks/serve.js:100

    private @@ -1407,7 +1397,7 @@

    - lib/tasks/test-server.js:62 + lib/tasks/test-server.js:61

    private @@ -1427,7 +1417,7 @@

    - lib/utilities/will-interrupt-process.js:95 + lib/utilities/will-interrupt-process.js:97

    private diff --git a/api/data.json b/api/data.json index 3ed5b4a..42cccd3 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.8.1--84707b2801" + "version": "3.21.2" }, "files": { "lib/broccoli/default-packager.js": { @@ -116,6 +116,15 @@ "fors": {}, "namespaces": {} }, + "lib/models/hardware-info.js": { + "name": "lib/models/hardware-info.js", + "modules": {}, + "classes": {}, + "fors": { + "HardwareInfo": 1 + }, + "namespaces": {} + }, "lib/models/installation-checker.js": { "name": "lib/models/installation-checker.js", "modules": {}, @@ -273,6 +282,54 @@ }, "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": { @@ -292,6 +349,7 @@ "Blueprint": 1, "Builder": 1, "Command": 1, + "HardwareInfo": 1, "Instrumentation": 1, "Project": 1, "ServeFilesAddon": 1, @@ -300,15 +358,20 @@ "TestsServerAddon": 1, "AmdTransformAddon": 1, "NpmTask": 1, - "WindowsSymlinkChecker": 1 + "WindowsSymlinkChecker": 1, + "PrivateTestHelpers": 1, + "CommandGenerator": 1, + "PackageCache": 1 + }, + "fors": { + "HardwareInfo": 1 }, - "fors": {}, "namespaces": { "Blueprint": 1 }, "tag": "module", - "file": "lib/utilities/windows-admin.js", - "line": 7, + "file": "tests/helpers/package-cache.js", + "line": 102, "access": "private", "tagname": "", "is_constructor": 1, @@ -326,7 +389,7 @@ "extension_for": [], "module": "ember-cli", "file": "lib/broccoli/default-packager.js", - "line": 98, + "line": 99, "description": "Responsible for packaging Ember.js application.", "is_constructor": 1 }, @@ -372,7 +435,7 @@ "module": "ember-cli", "namespace": "", "file": "lib/broccoli/ember-app.js", - "line": 81, + "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: [] }`", "is_constructor": 1, "params": [ @@ -402,7 +465,7 @@ "module": "ember-cli", "namespace": "", "file": "lib/cli/cli.js", - "line": 17, + "line": 15, "access": "private", "tagname": "", "is_constructor": 1, @@ -424,7 +487,7 @@ "module": "ember-cli", "namespace": "", "file": "lib/models/package-info-cache/index.js", - "line": 103, + "line": 23, "description": "Class that stores entries that are either PackageInfo or NodeModulesList objects.\nThe entries are stored in a map keyed by real directory path.", "access": "public", "tagname": "" @@ -472,7 +535,7 @@ "module": "ember-cli", "namespace": "", "file": "lib/models/addon.js", - "line": 135, + "line": 137, "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, @@ -500,8 +563,8 @@ "module": "ember-cli", "namespace": "Blueprint", "file": "lib/models/blueprint.js", - "line": 37, - "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 the `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.", + "line": 30, + "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", "params": [ @@ -524,7 +587,7 @@ "module": "ember-cli", "namespace": "", "file": "lib/models/builder.js", - "line": 16, + "line": 14, "description": "Wrapper for the Broccoli [Builder](https://github.com/broccolijs/broccoli/blob/master/lib/builder.js) class.", "access": "private", "tagname": "" @@ -540,9 +603,20 @@ "module": "ember-cli", "namespace": "", "file": "lib/models/command.js", - "line": 43, + "line": 42, "description": "The base class for all CLI commands." }, + "HardwareInfo": { + "name": "HardwareInfo", + "shortname": "HardwareInfo", + "classitems": [], + "plugins": [], + "extensions": [], + "plugin_for": [], + "extension_for": [], + "module": "ember-cli", + "namespace": "" + }, "Instrumentation": { "name": "Instrumentation", "shortname": "Instrumentation", @@ -554,7 +628,7 @@ "module": "ember-cli", "namespace": "", "file": "lib/models/instrumentation.js", - "line": 26, + "line": 38, "description": "An instance of this class is used for invoking the instrumentation\nhooks on addons.\n\nThe instrumentation types currently supported are:\n\n* init\n* build\n* command\n* shutdown", "access": "private", "tagname": "" @@ -637,7 +711,7 @@ "module": "ember-cli", "namespace": "", "file": "lib/tasks/server/middleware/history-support/index.js", - "line": 9, + "line": 8, "description": "This addon is used to serve the `index.html` file at every requested\nURL that begins with `rootURL` and is expecting `text/html` output.", "is_constructor": 1 }, @@ -682,7 +756,7 @@ "module": "ember-cli", "namespace": "", "file": "lib/tasks/npm-task.js", - "line": 17, + "line": 16, "access": "private", "tagname": "", "is_constructor": 1, @@ -705,17 +779,82 @@ "module": "ember-cli", "namespace": "", "file": "lib/utilities/windows-admin.js", - "line": 7, - "description": "On windows users will have a much better experience if symlinks are enabled\n an usable. This object when queried informs windows users, if they can\n improve there 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 users is an admin, the process needed to have been started with elevated privs\n * if the user is not an admin, a specific setting needs to be enabled\n <= Windows 10 Insiders build 14972\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 ```", + "line": 6, + "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": 187, + "line": 178, "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": "", @@ -733,7 +872,7 @@ }, { "file": "lib/broccoli/ember-app.js", - "line": 203, + "line": 194, "description": "Initializes the `project` property from `options.project` or the\nclosest Ember CLI project from the current working directory.", "access": "private", "tagname": "", @@ -751,7 +890,7 @@ }, { "file": "lib/broccoli/ember-app.js", - "line": 221, + "line": 215, "description": "Initializes the `options` property from the `options` parameter and\na set of default values from Ember CLI.", "access": "private", "tagname": "", @@ -769,7 +908,7 @@ }, { "file": "lib/broccoli/ember-app.js", - "line": 381, + "line": 369, "description": "Resolves a path relative to the project's root", "access": "private", "tagname": "", @@ -780,7 +919,7 @@ }, { "file": "lib/broccoli/ember-app.js", - "line": 391, + "line": 379, "access": "private", "tagname": "", "itemtype": "method", @@ -790,7 +929,7 @@ }, { "file": "lib/broccoli/ember-app.js", - "line": 500, + "line": 498, "description": "Returns the environment name", "access": "public", "tagname": "", @@ -806,7 +945,7 @@ }, { "file": "lib/broccoli/ember-app.js", - "line": 512, + "line": 510, "description": "Delegates to `broccoli-concat` with the `sourceMapConfig` option set to `options.sourcemaps`.", "access": "private", "tagname": "", @@ -830,7 +969,7 @@ }, { "file": "lib/broccoli/ember-app.js", - "line": 527, + "line": 525, "description": "Checks the result of `addon.isEnabled()` if it exists, defaults to `true` otherwise.", "access": "private", "tagname": "", @@ -852,7 +991,7 @@ }, { "file": "lib/broccoli/ember-app.js", - "line": 539, + "line": 537, "access": "private", "tagname": "", "itemtype": "method", @@ -873,7 +1012,7 @@ }, { "file": "lib/broccoli/ember-app.js", - "line": 550, + "line": 548, "access": "private", "tagname": "", "itemtype": "method", @@ -894,7 +1033,7 @@ }, { "file": "lib/broccoli/ember-app.js", - "line": 561, + "line": 559, "access": "private", "tagname": "", "itemtype": "method", @@ -948,7 +1087,7 @@ }, { "file": "lib/broccoli/ember-app.js", - "line": 641, + "line": 639, "description": "Calls the importTransforms hook on addons.", "access": "private", "tagname": "", @@ -959,7 +1098,7 @@ }, { "file": "lib/broccoli/ember-app.js", - "line": 686, + "line": 688, "description": "Loads and initializes addons for this project.\nCalls initializeAddons on the Project.", "access": "private", "tagname": "", @@ -970,7 +1109,7 @@ }, { "file": "lib/broccoli/ember-app.js", - "line": 713, + "line": 715, "description": "Returns a list of trees for a given type, returned by all addons.", "access": "private", "tagname": "", @@ -992,7 +1131,7 @@ }, { "file": "lib/broccoli/ember-app.js", - "line": 809, + "line": 813, "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": "", @@ -1019,7 +1158,7 @@ }, { "file": "lib/broccoli/ember-app.js", - "line": 847, + "line": 850, "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": "", @@ -1046,7 +1185,7 @@ }, { "file": "lib/broccoli/ember-app.js", - "line": 883, + "line": 886, "description": "Runs addon lintTree hooks and returns a single tree containing all\ntheir output.", "access": "private", "tagname": "", @@ -1073,7 +1212,7 @@ }, { "file": "lib/broccoli/ember-app.js", - "line": 902, + "line": 905, "description": "Imports legacy imports in this.vendorFiles", "access": "private", "tagname": "", @@ -1084,22 +1223,7 @@ }, { "file": "lib/broccoli/ember-app.js", - "line": 953, - "description": "Returns the tree for /tests/index.html", - "access": "private", - "tagname": "", - "itemtype": "method", - "name": "testIndex", - "return": { - "description": "Tree for /tests/index.html", - "type": "Tree" - }, - "class": "EmberApp", - "module": "ember-cli" - }, - { - "file": "lib/broccoli/ember-app.js", - "line": 1130, + "line": 1086, "access": "private", "tagname": "", "itemtype": "method", @@ -1113,7 +1237,7 @@ }, { "file": "lib/broccoli/ember-app.js", - "line": 1375, + "line": 1301, "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": "", @@ -1128,7 +1252,7 @@ }, { "file": "lib/broccoli/ember-app.js", - "line": 1425, + "line": 1341, "access": "private", "tagname": "", "itemtype": "method", @@ -1149,7 +1273,7 @@ }, { "file": "lib/broccoli/ember-app.js", - "line": 1435, + "line": 1351, "access": "public", "tagname": "", "itemtype": "method", @@ -1163,7 +1287,7 @@ }, { "file": "lib/broccoli/ember-app.js", - "line": 1444, + "line": 1360, "description": "Imports an asset into the application.", "access": "public", "tagname": "", @@ -1221,7 +1345,7 @@ }, { "file": "lib/broccoli/ember-app.js", - "line": 1494, + "line": 1406, "access": "private", "tagname": "", "itemtype": "method", @@ -1258,7 +1382,7 @@ }, { "file": "lib/broccoli/ember-app.js", - "line": 1573, + "line": 1491, "access": "private", "tagname": "", "itemtype": "method", @@ -1279,7 +1403,7 @@ }, { "file": "lib/broccoli/ember-app.js", - "line": 1608, + "line": 1532, "description": "Returns an array of trees for this application", "access": "private", "tagname": "", @@ -1294,7 +1418,7 @@ }, { "file": "lib/broccoli/ember-app.js", - "line": 1738, + "line": 1636, "description": "Returns the merged tree for this application", "access": "public", "tagname": "", @@ -1317,7 +1441,7 @@ }, { "file": "lib/cli/cli.js", - "line": 24, + "line": 22, "access": "private", "tagname": "", "itemtype": "property", @@ -1327,7 +1451,7 @@ }, { "file": "lib/cli/cli.js", - "line": 30, + "line": 28, "access": "private", "tagname": "", "itemtype": "property", @@ -1338,7 +1462,7 @@ }, { "file": "lib/cli/cli.js", - "line": 37, + "line": 35, "access": "private", "tagname": "", "itemtype": "property", @@ -1348,7 +1472,7 @@ }, { "file": "lib/cli/cli.js", - "line": 43, + "line": 41, "access": "private", "tagname": "", "itemtype": "property", @@ -1359,7 +1483,7 @@ }, { "file": "lib/cli/cli.js", - "line": 50, + "line": 48, "access": "private", "tagname": "", "itemtype": "property", @@ -1370,7 +1494,7 @@ }, { "file": "lib/cli/cli.js", - "line": 57, + "line": 55, "access": "private", "tagname": "", "itemtype": "property", @@ -1380,7 +1504,7 @@ }, { "file": "lib/cli/cli.js", - "line": 63, + "line": 61, "access": "private", "tagname": "", "itemtype": "property", @@ -1390,7 +1514,7 @@ }, { "file": "lib/cli/cli.js", - "line": 69, + "line": 67, "access": "private", "tagname": "", "itemtype": "property", @@ -1404,31 +1528,36 @@ "access": "private", "tagname": "", "itemtype": "method", - "name": "run", + "name": "maybeMakeCommand", "params": [ { - "name": "environment", + "name": "commandName", + "description": "" + }, + { + "name": "commandArgs", "description": "" } ], "return": { "description": "", - "type": "Promise" + "type": "Null|CurrentCommand" }, "class": "CLI", "module": "ember-cli" }, { "file": "lib/cli/cli.js", - "line": 229, + "line": 122, "access": "private", "tagname": "", "itemtype": "method", - "name": "callHelp", + "name": "run", "params": [ { - "name": "options", - "description": "" + "name": "environmentPromiseHash", + "description": "", + "type": "Promise" } ], "return": { @@ -1440,71 +1569,47 @@ }, { "file": "lib/cli/cli.js", - "line": 270, + "line": 262, "access": "private", "tagname": "", "itemtype": "method", - "name": "logError", + "name": "callHelp", "params": [ { - "name": "error", + "name": "options", "description": "" } ], "return": { "description": "", - "type": "Number" + "type": "Promise" }, "class": "CLI", "module": "ember-cli" }, { - "file": "lib/models/package-info-cache/index.js", - "line": 19, - "description": "Resolve the real path for a file, return null if does not\nexist or is not a file or FIFO, return the real path otherwise.", - "access": "private", - "tagname": "", - "itemtype": "method", - "name": "getRealFilePath", - "params": [ - { - "name": "filePath", - "description": "the path to the file of interest", - "type": "String" - } - ], - "return": { - "description": "real path or null", - "type": "String" - }, - "class": "PackageInfoCache", - "module": "ember-cli" - }, - { - "file": "lib/models/package-info-cache/index.js", - "line": 60, - "description": "Resolve the real path for a directory, return null if does not\nexist or is not a directory, return the real path otherwise.", + "file": "lib/cli/cli.js", + "line": 303, "access": "private", "tagname": "", "itemtype": "method", - "name": "getRealDirectoryPath", + "name": "logError", "params": [ { - "name": "directoryPath", - "description": "the path to the directory of interest", - "type": "String" + "name": "error", + "description": "" } ], "return": { - "description": "real path or null", - "type": "String" + "description": "", + "type": "Number" }, - "class": "PackageInfoCache", + "class": "CLI", "module": "ember-cli" }, { "file": "lib/models/package-info-cache/index.js", - "line": 116, + "line": 36, "description": "Clear the cache information.", "access": "private", "tagname": "", @@ -1515,7 +1620,7 @@ }, { "file": "lib/models/package-info-cache/index.js", - "line": 129, + "line": 48, "description": "Indicates if there is at least one error in any object in the cache.", "access": "public", "tagname": "", @@ -1529,7 +1634,7 @@ }, { "file": "lib/models/package-info-cache/index.js", - "line": 146, + "line": 65, "description": "Gather all the errors in the PIC and any cached objects, then dump them\nout to the ui-console.", "access": "public", "tagname": "", @@ -1540,7 +1645,7 @@ }, { "file": "lib/models/package-info-cache/index.js", - "line": 161, + "line": 80, "description": "Dump all the errors for a single object in the cache out to the ui-console.\n\nSpecial case: because package-info-cache also creates PackageInfo objects for entries\nthat do not actually exist (to allow simplifying the code), if there's a case where\nan object has only the single error ERROR_PACKAGE_DIR_MISSING, do not print\nanything. The package will have been found as a reference from some other\naddon or the root project, and we'll print a reference error there. Having\nboth is just confusing to users.", "access": "private", "tagname": "", @@ -1551,7 +1656,7 @@ }, { "file": "lib/models/package-info-cache/index.js", - "line": 230, + "line": 146, "description": "Process the root directory of a project, given a\nProject object (we need the object in order to find the internal addons).\n_readPackage takes care of the general processing of the root directory\nand common locations for addons, filling the cache with each. Once it\nreturns, we take care of the locations for addons that are specific to\nprojects, not other packages (e.g. internal addons, cli root).\n\nOnce all the project processing is done, go back through all cache entries\nto create references between the packageInfo objects.", "access": "public", "tagname": "", @@ -1572,7 +1677,7 @@ }, { "file": "lib/models/package-info-cache/index.js", - "line": 284, + "line": 203, "description": "To support the project.reloadPkg method, we need the ability to flush\nthe cache and reload from the updated package.json.\nThere are some issues with doing this:\n - Because of the possible relationship between projects and their addons\n due to symlinks, it's not trivial to flush only the data related to a\n given project.\n - If an 'ember-build-cli.js' dynamically adds new projects to the cache,\n we will not necessarily get called again to redo the loading of those\n projects.\nThe solution, implemented here:\n - Keep track of the Project objects whose packages are loaded into the cache.\n - If a project is reloaded, flush the cache, then do loadPackage again\n for all the known Projects.", "access": "public", "tagname": "", @@ -1586,7 +1691,7 @@ }, { "file": "lib/models/package-info-cache/index.js", - "line": 309, + "line": 228, "description": "Do the actual processing of the root directory of an addon, when the addon\nobject already exists (i.e. the addon is acting as the root object of a\ntree, like project does). We need the object in order to find the internal addons.\n_readPackage takes care of the general processing of the root directory\nand common locations for addons, filling the cache with each.\n\nOnce all the addon processing is done, go back through all cache entries\nto create references between the packageInfo objects.", "access": "public", "tagname": "", @@ -1607,7 +1712,7 @@ }, { "file": "lib/models/package-info-cache/index.js", - "line": 341, + "line": 260, "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": "", @@ -1618,7 +1723,7 @@ }, { "file": "lib/models/package-info-cache/index.js", - "line": 376, + "line": 297, "description": "Add an entry to the cache.", "access": "private", "tagname": "", @@ -1629,7 +1734,7 @@ }, { "file": "lib/models/package-info-cache/index.js", - "line": 386, + "line": 307, "description": "Retrieve an entry from the cache.", "access": "public", "tagname": "", @@ -1651,7 +1756,7 @@ }, { "file": "lib/models/package-info-cache/index.js", - "line": 398, + "line": 319, "description": "Indicate if an entry for a given path exists in the cache.", "access": "public", "tagname": "", @@ -1672,7 +1777,7 @@ }, { "file": "lib/models/package-info-cache/index.js", - "line": 474, + "line": 393, "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": "", @@ -1695,7 +1800,7 @@ }, { "file": "lib/models/package-info-cache/index.js", - "line": 658, + "line": 583, "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 +2001,7 @@ }, { "file": "lib/models/package-info-cache/package-info.js", - "line": 228, + "line": 227, "description": "Add to a list of child addon PackageInfos for this packageInfo.", "itemtype": "method", "name": "addPackages", @@ -1922,7 +2027,7 @@ }, { "file": "lib/models/package-info-cache/package-info.js", - "line": 267, + "line": 266, "description": "Discover the child addons for this packageInfo, which corresponds to an Addon.", "itemtype": "method", "name": "discoverAddonAddons", @@ -1931,7 +2036,7 @@ }, { "file": "lib/models/package-info-cache/package-info.js", - "line": 282, + "line": 284, "description": "Discover the child addons for this packageInfo, which corresponds to a Project.", "itemtype": "method", "name": "discoverProjectAddons", @@ -1940,7 +2045,7 @@ }, { "file": "lib/models/package-info-cache/package-info.js", - "line": 302, + "line": 304, "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", @@ -1961,7 +2066,7 @@ }, { "file": "lib/models/package-info-cache/package-info.js", - "line": 363, + "line": 371, "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.", "itemtype": "method", "name": "getAddonConstructor", @@ -1974,7 +2079,7 @@ }, { "file": "lib/models/addon.js", - "line": 168, + "line": 170, "description": "The name of this addon.", "access": "public", "tagname": "", @@ -1987,7 +2092,7 @@ }, { "file": "lib/models/addon.js", - "line": 177, + "line": 179, "description": "The absolute path of the root directory where this addon is located.", "access": "public", "tagname": "", @@ -2000,7 +2105,7 @@ }, { "file": "lib/models/addon.js", - "line": 186, + "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": "", @@ -2013,7 +2118,7 @@ }, { "file": "lib/models/addon.js", - "line": 199, + "line": 201, "description": "The root {{#crossLink \"Project\"}}project{{/crossLink}} to which this addon belongs.", "access": "public", "tagname": "", @@ -2026,7 +2131,7 @@ }, { "file": "lib/models/addon.js", - "line": 208, + "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": "", @@ -2039,7 +2144,7 @@ }, { "file": "lib/models/addon.js", - "line": 221, + "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": "", @@ -2052,7 +2157,7 @@ }, { "file": "lib/models/addon.js", - "line": 233, + "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": "", @@ -2065,7 +2170,7 @@ }, { "file": "lib/models/addon.js", - "line": 243, + "line": 245, "description": "The contents of the addon's `package.json`.", "access": "public", "tagname": "", @@ -2078,7 +2183,7 @@ }, { "file": "lib/models/addon.js", - "line": 252, + "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", "tagname": "", @@ -2104,22 +2209,7 @@ }, { "file": "lib/models/addon.js", - "line": 356, - "description": "Returns whether this is using a module unification format.", - "access": "private", - "tagname": "", - "itemtype": "method", - "name": "isModuleUnification", - "return": { - "description": "Whether this is using a module unification format.", - "type": "Boolean" - }, - "class": "Addon", - "module": "ember-cli" - }, - { - "file": "lib/models/addon.js", - "line": 366, + "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": "", @@ -2130,7 +2220,7 @@ }, { "file": "lib/models/addon.js", - "line": 390, + "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": "", @@ -2141,7 +2231,7 @@ }, { "file": "lib/models/addon.js", - "line": 405, + "line": 382, "description": "Shorthand method for [broccoli-concat](https://github.com/ember-cli/broccoli-concat)", "access": "private", "tagname": "", @@ -2168,7 +2258,7 @@ }, { "file": "lib/models/addon.js", - "line": 419, + "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": "", @@ -2183,7 +2273,7 @@ }, { "file": "lib/models/addon.js", - "line": 456, + "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.", "access": "private", "tagname": "", @@ -2194,7 +2284,7 @@ }, { "file": "lib/models/addon.js", - "line": 502, + "line": 481, "description": "Invoke the specified method for each enabled addon.", "access": "private", "tagname": "", @@ -2217,7 +2307,7 @@ }, { "file": "lib/models/addon.js", - "line": 525, + "line": 506, "description": "Invoke the specified method for each of the project's addons.", "access": "private", "tagname": "", @@ -2240,7 +2330,7 @@ }, { "file": "lib/models/addon.js", - "line": 556, + "line": 539, "description": "Generates a tree for the specified path", "access": "private", "tagname": "", @@ -2255,7 +2345,7 @@ }, { "file": "lib/models/addon.js", - "line": 590, + "line": 574, "access": "private", "tagname": "", "itemtype": "method", @@ -2265,7 +2355,7 @@ }, { "file": "lib/models/addon.js", - "line": 602, + "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": "", @@ -2287,7 +2377,7 @@ }, { "file": "lib/models/addon.js", - "line": 668, + "line": 652, "access": "private", "tagname": "", "params": [ @@ -2308,7 +2398,7 @@ }, { "file": "lib/models/addon.js", - "line": 690, + "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": "", @@ -2330,7 +2420,7 @@ }, { "file": "lib/models/addon.js", - "line": 732, + "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": "", @@ -2341,7 +2431,7 @@ }, { "file": "lib/models/addon.js", - "line": 755, + "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": "", @@ -2362,7 +2452,7 @@ }, { "file": "lib/models/addon.js", - "line": 788, + "line": 772, "description": "Imports an asset into this addon.", "access": "public", "tagname": "", @@ -2407,7 +2497,7 @@ }, { "file": "lib/models/addon.js", - "line": 808, + "line": 792, "description": "Returns the tree for all app files", "access": "public", "tagname": "", @@ -2429,7 +2519,7 @@ }, { "file": "lib/models/addon.js", - "line": 840, + "line": 804, "description": "Returns the tree for all template files", "access": "public", "tagname": "", @@ -2451,20 +2541,7 @@ }, { "file": "lib/models/addon.js", - "line": 852, - "access": "private", - "tagname": "", - "itemtype": "method", - "name": "treeForSrc", - "return": { - "description": "" - }, - "class": "Addon", - "module": "ember-cli" - }, - { - "file": "lib/models/addon.js", - "line": 885, + "line": 816, "description": "Returns the tree for this addon's templates", "access": "public", "tagname": "", @@ -2486,7 +2563,7 @@ }, { "file": "lib/models/addon.js", - "line": 897, + "line": 828, "description": "Returns a tree for this addon", "access": "public", "tagname": "", @@ -2511,7 +2588,7 @@ }, { "file": "lib/models/addon.js", - "line": 933, + "line": 862, "description": "Returns the tree for all style files", "access": "public", "tagname": "", @@ -2533,7 +2610,7 @@ }, { "file": "lib/models/addon.js", - "line": 952, + "line": 881, "description": "Returns the tree for all vendor files", "access": "public", "tagname": "", @@ -2555,7 +2632,7 @@ }, { "file": "lib/models/addon.js", - "line": 964, + "line": 893, "description": "Returns the tree for all test support files", "access": "public", "tagname": "", @@ -2577,7 +2654,7 @@ }, { "file": "lib/models/addon.js", - "line": 976, + "line": 905, "description": "Returns the tree for all public files", "access": "public", "tagname": "", @@ -2599,7 +2676,7 @@ }, { "file": "lib/models/addon.js", - "line": 996, + "line": 925, "description": "Returns the tree for all test files namespaced to a given addon.", "access": "public", "tagname": "", @@ -2621,7 +2698,7 @@ }, { "file": "lib/models/addon.js", - "line": 1029, + "line": 960, "description": "Runs the styles tree through preprocessors.", "access": "private", "tagname": "", @@ -2643,7 +2720,7 @@ }, { "file": "lib/models/addon.js", - "line": 1050, + "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", "tagname": "", @@ -2658,7 +2735,7 @@ }, { "file": "lib/models/addon.js", - "line": 1064, + "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.", "access": "private", "tagname": "", @@ -2673,7 +2750,7 @@ }, { "file": "lib/models/addon.js", - "line": 1180, + "line": 1116, "description": "Runs the templates tree through preprocessors.", "access": "private", "tagname": "", @@ -2695,7 +2772,7 @@ }, { "file": "lib/models/addon.js", - "line": 1214, + "line": 1149, "description": "Runs the addon tree through preprocessors.", "access": "private", "tagname": "", @@ -2717,7 +2794,7 @@ }, { "file": "lib/models/addon.js", - "line": 1268, + "line": 1203, "description": "Returns a tree with JSHhint output for all addon JS.", "access": "private", "tagname": "", @@ -2732,10 +2809,11 @@ }, { "file": "lib/models/addon.js", - "line": 1331, + "line": 1269, "description": "Returns a tree containing the addon's js files", "access": "private", "tagname": "", + "deprecated": true, "itemtype": "method", "name": "addonJsFiles", "return": { @@ -2747,7 +2825,7 @@ }, { "file": "lib/models/addon.js", - "line": 1350, + "line": 1286, "description": "Preprocesses a javascript tree.", "access": "private", "tagname": "", @@ -2762,7 +2840,7 @@ }, { "file": "lib/models/addon.js", - "line": 1361, + "line": 1297, "description": "Returns a tree with all javascript for this addon.", "access": "private", "tagname": "", @@ -2784,7 +2862,7 @@ }, { "file": "lib/models/addon.js", - "line": 1394, + "line": 1332, "description": "Returns the module name for this addon.", "access": "public", "tagname": "", @@ -2799,7 +2877,7 @@ }, { "file": "lib/models/addon.js", - "line": 1409, + "line": 1347, "description": "Returns the path for addon blueprints.", "access": "public", "tagname": "", @@ -2817,7 +2895,7 @@ }, { "file": "lib/models/addon.js", - "line": 1427, + "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", "access": "public", "tagname": "", @@ -2847,7 +2925,7 @@ }, { "file": "lib/models/addon.js", - "line": 1467, + "line": 1405, "access": "public", "tagname": "", "itemtype": "method", @@ -2861,7 +2939,7 @@ }, { "file": "lib/models/addon.js", - "line": 1477, + "line": 1415, "access": "public", "tagname": "", "itemtype": "method", @@ -2875,7 +2953,7 @@ }, { "file": "lib/models/addon.js", - "line": 1486, + "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", "access": "public", "tagname": "", @@ -2900,7 +2978,7 @@ }, { "file": "lib/models/addon.js", - "line": 1518, + "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", "access": "public", "tagname": "", @@ -2918,8 +2996,8 @@ }, { "file": "lib/models/addon.js", - "line": 1543, - "description": "Allows addons to define a custom transfrom 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": 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`.", "access": "public", "tagname": "", "itemtype": "method", @@ -2937,7 +3015,7 @@ }, { "file": "lib/models/addon.js", - "line": 1587, + "line": 1524, "description": "Pre-process a tree\n\n#### Uses:\n\n- removing / adding files from the build.", "access": "public", "tagname": "", @@ -2946,7 +3024,7 @@ "params": [ { "name": "type", - "description": "What kind of tree (eg. 'js', 'css', 'src', 'template')", + "description": "What kind of tree (eg. 'js', 'css', 'template')", "type": "String" }, { @@ -2964,7 +3042,7 @@ }, { "file": "lib/models/addon.js", - "line": 1602, + "line": 1538, "description": "Post-process a tree", "access": "public", "tagname": "", @@ -2973,7 +3051,7 @@ "params": [ { "name": "type", - "description": "What kind of tree (eg. 'js', 'css', 'src', 'template')", + "description": "What kind of tree (eg. 'js', 'css', 'template')", "type": "String" }, { @@ -2994,7 +3072,7 @@ }, { "file": "lib/models/addon.js", - "line": 1616, + "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.", "access": "public", "tagname": "", @@ -3015,7 +3093,7 @@ }, { "file": "lib/models/addon.js", - "line": 1656, + "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", "access": "public", "tagname": "", @@ -3033,7 +3111,7 @@ }, { "file": "lib/models/addon.js", - "line": 1672, + "line": 1605, "description": "This hook is called before a build takes place.", "access": "public", "tagname": "", @@ -3051,7 +3129,7 @@ }, { "file": "lib/models/addon.js", - "line": 1681, + "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", "tagname": "", @@ -3069,7 +3147,7 @@ }, { "file": "lib/models/addon.js", - "line": 1698, + "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", "tagname": "", @@ -3090,7 +3168,7 @@ }, { "file": "lib/models/addon.js", - "line": 1716, + "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", "tagname": "", @@ -3111,7 +3189,7 @@ }, { "file": "lib/models/addon.js", - "line": 1733, + "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", "tagname": "", @@ -3136,7 +3214,7 @@ }, { "file": "lib/models/addon.js", - "line": 1776, + "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", "tagname": "", @@ -3162,7 +3240,7 @@ }, { "file": "lib/models/addon.js", - "line": 1796, + "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", "tagname": "", @@ -3190,7 +3268,7 @@ }, { "file": "lib/models/blueprint.js", - "line": 218, + "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", "tagname": "", @@ -3212,7 +3290,7 @@ }, { "file": "lib/models/blueprint.js", - "line": 235, + "line": 222, "description": "Used to retrieve files for blueprint.", "access": "public", "tagname": "", @@ -3227,7 +3305,7 @@ }, { "file": "lib/models/blueprint.js", - "line": 255, + "line": 244, "itemtype": "method", "name": "srcPath", "params": [ @@ -3246,7 +3324,7 @@ }, { "file": "lib/models/blueprint.js", - "line": 264, + "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.", "access": "public", "tagname": "", @@ -3268,7 +3346,7 @@ }, { "file": "lib/models/blueprint.js", - "line": 284, + "line": 273, "description": "Write a status and message to the UI", "access": "private", "tagname": "", @@ -3296,7 +3374,7 @@ }, { "file": "lib/models/blueprint.js", - "line": 298, + "line": 287, "access": "private", "tagname": "", "itemtype": "method", @@ -3317,7 +3395,7 @@ }, { "file": "lib/models/blueprint.js", - "line": 310, + "line": 299, "description": "Actions lookup", "access": "private", "tagname": "", @@ -3329,7 +3407,7 @@ }, { "file": "lib/models/blueprint.js", - "line": 348, + "line": 337, "description": "Calls an action.", "access": "private", "tagname": "", @@ -3355,7 +3433,7 @@ }, { "file": "lib/models/blueprint.js", - "line": 366, + "line": 355, "description": "Prints warning for pod unsupported.", "access": "private", "tagname": "", @@ -3366,7 +3444,7 @@ }, { "file": "lib/models/blueprint.js", - "line": 379, + "line": 372, "access": "private", "tagname": "", "itemtype": "method", @@ -3383,7 +3461,7 @@ }, { "file": "lib/models/blueprint.js", - "line": 390, + "line": 383, "access": "private", "tagname": "", "itemtype": "method", @@ -3400,7 +3478,7 @@ }, { "file": "lib/models/blueprint.js", - "line": 415, + "line": 412, "access": "private", "tagname": "", "itemtype": "method", @@ -3432,7 +3510,7 @@ }, { "file": "lib/models/blueprint.js", - "line": 434, + "line": 438, "itemtype": "method", "name": "install", "params": [ @@ -3451,7 +3529,7 @@ }, { "file": "lib/models/blueprint.js", - "line": 464, + "line": 468, "itemtype": "method", "name": "uninstall", "params": [ @@ -3470,7 +3548,7 @@ }, { "file": "lib/models/blueprint.js", - "line": 494, + "line": 493, "description": "Hook for running operations before install.", "itemtype": "method", "name": "beforeInstall", @@ -3483,7 +3561,7 @@ }, { "file": "lib/models/blueprint.js", - "line": 501, + "line": 500, "description": "Hook for running operations after install.", "itemtype": "method", "name": "afterInstall", @@ -3496,7 +3574,7 @@ }, { "file": "lib/models/blueprint.js", - "line": 508, + "line": 507, "description": "Hook for running operations before uninstall.", "itemtype": "method", "name": "beforeUninstall", @@ -3509,7 +3587,7 @@ }, { "file": "lib/models/blueprint.js", - "line": 515, + "line": 514, "description": "Hook for running operations after uninstall.", "itemtype": "method", "name": "afterUninstall", @@ -3522,8 +3600,8 @@ }, { "file": "lib/models/blueprint.js", - "line": 524, - "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\n```\n\nThe object passed to `locals` looks like this:\n\n```js\n{\n entity: {\n name: 'foo',\n options: {\n type: 'array'\n }\n },\n dryRun: true\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.", + "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.", "access": "public", "tagname": "", "itemtype": "method", @@ -3544,7 +3622,7 @@ }, { "file": "lib/models/blueprint.js", - "line": 557, + "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.", "access": "public", "tagname": "", @@ -3559,7 +3637,7 @@ }, { "file": "lib/models/blueprint.js", - "line": 585, + "line": 586, "access": "private", "tagname": "", "itemtype": "method", @@ -3580,7 +3658,7 @@ }, { "file": "lib/models/blueprint.js", - "line": 641, + "line": 642, "description": "Used to generate fileMap tokens for mapFile.", "itemtype": "method", "name": "generateFileMap", @@ -3600,7 +3678,7 @@ }, { "file": "lib/models/blueprint.js", - "line": 656, + "line": 657, "itemtype": "method", "name": "buildFileInfo", "params": [ @@ -3629,7 +3707,7 @@ }, { "file": "lib/models/blueprint.js", - "line": 677, + "line": 678, "itemtype": "method", "name": "isUpdate", "return": { @@ -3641,7 +3719,7 @@ }, { "file": "lib/models/blueprint.js", - "line": 687, + "line": 688, "access": "private", "tagname": "", "itemtype": "method", @@ -3672,7 +3750,7 @@ }, { "file": "lib/models/blueprint.js", - "line": 699, + "line": 700, "description": "Add update files to ignored files or reset them", "access": "private", "tagname": "", @@ -3683,7 +3761,7 @@ }, { "file": "lib/models/blueprint.js", - "line": 712, + "line": 713, "access": "private", "tagname": "", "itemtype": "method", @@ -3704,7 +3782,7 @@ }, { "file": "lib/models/blueprint.js", - "line": 725, + "line": 726, "access": "private", "tagname": "", "itemtype": "method", @@ -3726,7 +3804,7 @@ }, { "file": "lib/models/blueprint.js", - "line": 738, + "line": 740, "itemtype": "method", "name": "processFiles", "params": [ @@ -3741,12 +3819,16 @@ "type": "Object" } ], + "return": { + "description": "", + "type": "Promise" + }, "class": "Blueprint", "module": "ember-cli" }, { "file": "lib/models/blueprint.js", - "line": 760, + "line": 762, "itemtype": "method", "name": "processFilesForUninstall", "params": [ @@ -3766,7 +3848,7 @@ }, { "file": "lib/models/blueprint.js", - "line": 774, + "line": 775, "itemtype": "method", "name": "mapFile", "params": [ @@ -3789,7 +3871,7 @@ }, { "file": "lib/models/blueprint.js", - "line": 791, + "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", "tagname": "", @@ -3804,7 +3886,7 @@ }, { "file": "lib/models/blueprint.js", - "line": 803, + "line": 804, "access": "private", "tagname": "", "itemtype": "method", @@ -3834,7 +3916,7 @@ }, { "file": "lib/models/blueprint.js", - "line": 833, + "line": 834, "access": "private", "tagname": "", "itemtype": "method", @@ -3855,7 +3937,7 @@ }, { "file": "lib/models/blueprint.js", - "line": 866, + "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.", "itemtype": "method", "name": "addPackageToProject", @@ -3880,7 +3962,7 @@ }, { "file": "lib/models/blueprint.js", - "line": 888, + "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", @@ -3903,7 +3985,7 @@ }, { "file": "lib/models/blueprint.js", - "line": 937, + "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.", "itemtype": "method", "name": "removePackageFromProject", @@ -3923,7 +4005,7 @@ }, { "file": "lib/models/blueprint.js", - "line": 954, + "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.", "itemtype": "method", "name": "removePackagesFromProject", @@ -3943,7 +4025,7 @@ }, { "file": "lib/models/blueprint.js", - "line": 995, + "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.", "itemtype": "method", "name": "addBowerPackageToProject", @@ -3976,7 +4058,7 @@ }, { "file": "lib/models/blueprint.js", - "line": 1025, + "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.", "itemtype": "method", "name": "addBowerPackagesToProject", @@ -4001,7 +4083,7 @@ }, { "file": "lib/models/blueprint.js", - "line": 1060, + "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.", "itemtype": "method", "name": "addAddonToProject", @@ -4021,7 +4103,7 @@ }, { "file": "lib/models/blueprint.js", - "line": 1080, + "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.", "itemtype": "method", "name": "addAddonsToProject", @@ -4041,7 +4123,7 @@ }, { "file": "lib/models/blueprint.js", - "line": 1126, + "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).", "itemtype": "method", "name": "taskFor", @@ -4058,7 +4140,7 @@ }, { "file": "lib/models/blueprint.js", - "line": 1144, + "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```", "itemtype": "method", "name": "insertIntoFile", @@ -4088,7 +4170,7 @@ }, { "file": "lib/models/blueprint.js", - "line": 1248, + "line": 1251, "description": "Used to retrieve a blueprint with the given name.", "itemtype": "method", "name": "lookupBlueprint", @@ -4110,7 +4192,7 @@ }, { "file": "lib/models/blueprint.js", - "line": 1265, + "line": 1268, "static": 1, "itemtype": "method", "name": "lookup", @@ -4151,7 +4233,7 @@ }, { "file": "lib/models/blueprint.js", - "line": 1295, + "line": 1298, "description": "Loads a blueprint from given path.", "static": 1, "itemtype": "method", @@ -4173,7 +4255,7 @@ }, { "file": "lib/models/blueprint.js", - "line": 1322, + "line": 1325, "static": 1, "itemtype": "method", "name": "list", @@ -4203,7 +4285,7 @@ }, { "file": "lib/models/blueprint.js", - "line": 1371, + "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", @@ -4214,7 +4296,7 @@ }, { "file": "lib/models/blueprint.js", - "line": 1386, + "line": 1389, "static": 1, "itemtype": "property", "name": "ignoredFiles", @@ -4224,7 +4306,7 @@ }, { "file": "lib/models/blueprint.js", - "line": 1392, + "line": 1395, "static": 1, "itemtype": "property", "name": "ignoredUpdateFiles", @@ -4234,7 +4316,7 @@ }, { "file": "lib/models/blueprint.js", - "line": 1402, + "line": 1401, "static": 1, "itemtype": "property", "name": "defaultLookupPaths", @@ -4244,7 +4326,7 @@ }, { "file": "lib/models/blueprint.js", - "line": 1412, + "line": 1409, "access": "private", "tagname": "", "itemtype": "method", @@ -4266,7 +4348,7 @@ }, { "file": "lib/models/blueprint.js", - "line": 1425, + "line": 1422, "access": "private", "tagname": "", "itemtype": "method", @@ -4284,7 +4366,7 @@ }, { "file": "lib/models/blueprint.js", - "line": 1436, + "line": 1433, "access": "private", "tagname": "", "itemtype": "method", @@ -4302,7 +4384,7 @@ }, { "file": "lib/models/blueprint.js", - "line": 1445, + "line": 1442, "access": "private", "tagname": "", "itemtype": "method", @@ -4329,11 +4411,11 @@ }, { "file": "lib/models/blueprint.js", - "line": 1459, + "line": 1456, "access": "private", "tagname": "", "itemtype": "method", - "name": "isFile", + "name": "isIgnored", "params": [ { "name": "info", @@ -4343,7 +4425,7 @@ ], "return": { "description": "", - "type": "Promise" + "type": "Boolean" }, "class": "Blueprint", "module": "ember-cli", @@ -4351,39 +4433,17 @@ }, { "file": "lib/models/blueprint.js", - "line": 1469, + "line": 1468, + "description": "Combines provided lookup paths with defaults and removes\nduplicates.", "access": "private", "tagname": "", "itemtype": "method", - "name": "isIgnored", + "name": "generateLookupPaths", "params": [ { - "name": "info", + "name": "lookupPaths", "description": "", - "type": "FileInfo" - } - ], - "return": { - "description": "", - "type": "Boolean" - }, - "class": "Blueprint", - "module": "ember-cli", - "namespace": "Blueprint" - }, - { - "file": "lib/models/blueprint.js", - "line": 1481, - "description": "Combines provided lookup paths with defaults and removes\nduplicates.", - "access": "private", - "tagname": "", - "itemtype": "method", - "name": "generateLookupPaths", - "params": [ - { - "name": "lookupPaths", - "description": "", - "type": "Array" + "type": "Array" } ], "return": { @@ -4396,7 +4456,7 @@ }, { "file": "lib/models/blueprint.js", - "line": 1496, + "line": 1483, "description": "Looks for a __path__ token in the files folder. Must be present for\nthe blueprint to support pod tokens.", "access": "private", "tagname": "", @@ -4419,7 +4479,7 @@ }, { "file": "lib/models/blueprint.js", - "line": 1535, + "line": 1522, "access": "private", "tagname": "", "itemtype": "method", @@ -4441,7 +4501,7 @@ }, { "file": "lib/models/blueprint.js", - "line": 1549, + "line": 1536, "access": "private", "tagname": "", "itemtype": "method", @@ -4463,7 +4523,7 @@ }, { "file": "lib/models/blueprint.js", - "line": 1559, + "line": 1546, "access": "private", "tagname": "", "itemtype": "method", @@ -4478,7 +4538,7 @@ }, { "file": "lib/models/blueprint.js", - "line": 1572, + "line": 1559, "access": "private", "tagname": "", "itemtype": "method", @@ -4500,7 +4560,7 @@ }, { "file": "lib/models/builder.js", - "line": 43, + "line": 40, "access": "private", "tagname": "", "itemtype": "method", @@ -4516,7 +4576,7 @@ }, { "file": "lib/models/builder.js", - "line": 58, + "line": 55, "access": "private", "tagname": "", "itemtype": "method", @@ -4526,7 +4586,7 @@ }, { "file": "lib/models/builder.js", - "line": 113, + "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": "", @@ -4548,7 +4608,7 @@ }, { "file": "lib/models/builder.js", - "line": 135, + "line": 115, "access": "private", "tagname": "", "itemtype": "method", @@ -4565,27 +4625,7 @@ }, { "file": "lib/models/builder.js", - "line": 159, - "access": "private", - "tagname": "", - "itemtype": "method", - "name": "processBuildResult", - "params": [ - { - "name": "results", - "description": "" - } - ], - "return": { - "description": "", - "type": "Promise" - }, - "class": "Builder", - "module": "ember-cli" - }, - { - "file": "lib/models/builder.js", - "line": 174, + "line": 139, "access": "private", "tagname": "", "itemtype": "method", @@ -4609,7 +4649,7 @@ }, { "file": "lib/models/builder.js", - "line": 197, + "line": 164, "access": "private", "tagname": "", "itemtype": "method", @@ -4623,7 +4663,7 @@ }, { "file": "lib/models/builder.js", - "line": 236, + "line": 233, "description": "Delegates to the `cleanup` method of the wrapped Broccoli builder.", "access": "private", "tagname": "", @@ -4638,7 +4678,7 @@ }, { "file": "lib/models/builder.js", - "line": 270, + "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": "", @@ -4647,36 +4687,9 @@ "class": "Builder", "module": "ember-cli" }, - { - "file": "lib/models/builder.js", - "line": 287, - "access": "private", - "tagname": "", - "itemtype": "method", - "name": "finalizeBuild", - "class": "Builder", - "module": "ember-cli" - }, - { - "file": "lib/models/builder.js", - "line": 295, - "description": "broccoli-builder reformats the response into {directory, graph}, this method is a backwards\ncompatible shim for broccoli 1.x", - "access": "private", - "tagname": "", - "itemtype": "method", - "name": "compatNode", - "params": [ - { - "name": "node", - "description": "The node returned from Broccoli builder" - } - ], - "class": "Builder", - "module": "ember-cli" - }, { "file": "lib/models/command.js", - "line": 52, + "line": 51, "description": "The description of what this command does.", "final": 1, "itemtype": "property", @@ -4687,7 +4700,7 @@ }, { "file": "lib/models/command.js", - "line": 61, + "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", @@ -4699,7 +4712,7 @@ }, { "file": "lib/models/command.js", - "line": 89, + "line": 81, "final": 1, "itemtype": "property", "name": "isWithinProject", @@ -4709,7 +4722,7 @@ }, { "file": "lib/models/command.js", - "line": 96, + "line": 88, "description": "The name of the command.", "final": 1, "itemtype": "property", @@ -4723,7 +4736,7 @@ }, { "file": "lib/models/command.js", - "line": 108, + "line": 100, "description": "An array of aliases for the command", "final": 1, "itemtype": "property", @@ -4737,7 +4750,7 @@ }, { "file": "lib/models/command.js", - "line": 123, + "line": 117, "description": "An array of available options for the command", "final": 1, "itemtype": "property", @@ -4751,7 +4764,7 @@ }, { "file": "lib/models/command.js", - "line": 144, + "line": 138, "description": "An array of anonymous options for the command", "final": 1, "itemtype": "property", @@ -4765,7 +4778,7 @@ }, { "file": "lib/models/command.js", - "line": 160, + "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", @@ -4781,7 +4794,7 @@ }, { "file": "lib/models/command.js", - "line": 186, + "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", @@ -4794,7 +4807,7 @@ }, { "file": "lib/models/command.js", - "line": 214, + "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", "access": "private", "tagname": "", @@ -4825,7 +4838,7 @@ }, { "file": "lib/models/command.js", - "line": 254, + "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", @@ -4838,7 +4851,7 @@ }, { "file": "lib/models/command.js", - "line": 264, + "line": 257, "itemtype": "method", "name": "validateAndRun", "return": { @@ -4850,7 +4863,7 @@ }, { "file": "lib/models/command.js", - "line": 321, + "line": 322, "description": "Reports if the given command has a command line option by a given name", "itemtype": "method", "name": "hasOption", @@ -4870,7 +4883,7 @@ }, { "file": "lib/models/command.js", - "line": 337, + "line": 338, "description": "Merges any options with duplicate keys in the availableOptions array.\nUsed primarily by registerOptions.", "itemtype": "method", "name": "mergeDuplicateOption", @@ -4890,7 +4903,7 @@ }, { "file": "lib/models/command.js", - "line": 377, + "line": 378, "description": "Normalizes option, filling in implicit values", "itemtype": "method", "name": "normalizeOption", @@ -4910,7 +4923,7 @@ }, { "file": "lib/models/command.js", - "line": 389, + "line": 390, "description": "Assigns option", "itemtype": "method", "name": "assignOption", @@ -4940,7 +4953,7 @@ }, { "file": "lib/models/command.js", - "line": 420, + "line": 423, "description": "Validates option", "itemtype": "method", "name": "validateOption", @@ -4960,7 +4973,7 @@ }, { "file": "lib/models/command.js", - "line": 446, + "line": 449, "description": "Parses alias for an option and adds it to optionsAliases", "itemtype": "method", "name": "parseAlias", @@ -4985,7 +4998,7 @@ }, { "file": "lib/models/command.js", - "line": 489, + "line": 494, "itemtype": "method", "name": "assignAlias", "params": [ @@ -5007,7 +5020,7 @@ }, { "file": "lib/models/command.js", - "line": 504, + "line": 509, "description": "Validates alias value", "itemtype": "method", "name": "validateAlias", @@ -5027,7 +5040,7 @@ }, { "file": "lib/models/command.js", - "line": 535, + "line": 541, "description": "Parses command arguments and processes", "itemtype": "method", "name": "parseArgs", @@ -5047,7 +5060,7 @@ }, { "file": "lib/models/command.js", - "line": 587, + "line": 597, "itemtype": "method", "name": "run", "params": [ @@ -5061,7 +5074,7 @@ }, { "file": "lib/models/command.js", - "line": 597, + "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", @@ -5070,7 +5083,7 @@ }, { "file": "lib/models/command.js", - "line": 628, + "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.", "itemtype": "method", "name": "printDetailedHelp", @@ -5079,7 +5092,7 @@ }, { "file": "lib/models/command.js", - "line": 638, + "line": 648, "itemtype": "method", "name": "getJson", "params": [ @@ -5096,6 +5109,147 @@ "class": "Command", "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.", + "access": "private", + "tagname": "", + "itemtype": "method", + "name": "isUsingBattery", + "params": [ + { + "name": "platform", + "description": "The current hardware platform.\n USED FOR TESTING ONLY.", + "type": "String=process.platform" + } + ], + "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", + "module": "ember-cli" + }, + { + "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": "memorySwapUsed", + "params": [ + { + "name": "platform", + "description": "The current hardware platform.\n USED FOR TESTING ONLY.", + "type": "String=process.platform" + } + ], + "return": { + "description": "The amount of used swap space, in bytes. `null` if\n the used swap space cannot be determined.", + "type": "Null|Number" + }, + "class": "HardwareInfo", + "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`.", + "access": "private", + "tagname": "", + "itemtype": "method", + "name": "memoryTotal", + "return": { + "description": "The total memory in bytes.", + "type": "Number" + }, + "class": "HardwareInfo", + "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`.", + "access": "private", + "tagname": "", + "itemtype": "method", + "name": "memoryUsed", + "return": { + "description": "The Resident Set Size, as reported by\n `process.memoryUsage`.", + "type": "Object" + }, + "class": "HardwareInfo", + "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`.", + "access": "private", + "tagname": "", + "itemtype": "method", + "name": "processorCount", + "return": { + "description": "The number of logical processors.", + "type": "Number" + }, + "class": "HardwareInfo", + "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" + } + ], + "return": { + "description": "The one-, five-, and fifteen-minute processor load\n averages.", + "type": "Array" + }, + "class": "HardwareInfo", + "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", + "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": "", + "itemtype": "method", + "name": "uptime", + "return": { + "description": "The number of seconds since the host was started.", + "type": "Number" + }, + "class": "HardwareInfo", + "module": "ember-cli" + }, { "file": "lib/models/installation-checker.js", "line": 13, @@ -5160,7 +5314,7 @@ }, { "file": "lib/models/project.js", - "line": 176, + "line": 174, "description": "Returns the name from package.json.", "access": "private", "tagname": "", @@ -5175,7 +5329,7 @@ }, { "file": "lib/models/project.js", - "line": 189, + "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": "", @@ -5190,7 +5344,7 @@ }, { "file": "lib/models/project.js", - "line": 201, + "line": 199, "description": "Returns whether or not this is an Ember CLI addon.", "itemtype": "method", "name": "isEmberCLIAddon", @@ -5203,22 +5357,7 @@ }, { "file": "lib/models/project.js", - "line": 211, - "description": "Returns whether this is using a module unification format.", - "access": "private", - "tagname": "", - "itemtype": "method", - "name": "isModuleUnification", - "return": { - "description": "Whether this is using a module unification format.", - "type": "Boolean" - }, - "class": "Project", - "module": "ember-cli" - }, - { - "file": "lib/models/project.js", - "line": 226, + "line": 209, "description": "Returns the path to the configuration.", "access": "private", "tagname": "", @@ -5233,7 +5372,7 @@ }, { "file": "lib/models/project.js", - "line": 243, + "line": 226, "description": "Loads the configuration for this project and its addons.", "access": "public", "tagname": "", @@ -5255,7 +5394,7 @@ }, { "file": "lib/models/project.js", - "line": 261, + "line": 245, "access": "private", "tagname": "", "itemtype": "method", @@ -5268,7 +5407,7 @@ } ], "return": { - "description": "Merged confiration object", + "description": "Merged configuration object", "type": "Object" }, "class": "Project", @@ -5276,7 +5415,7 @@ }, { "file": "lib/models/project.js", - "line": 280, + "line": 264, "description": "Returns the targets of this project, or the default targets if not present.", "access": "public", "tagname": "", @@ -5291,7 +5430,7 @@ }, { "file": "lib/models/project.js", - "line": 307, + "line": 291, "description": "Returns the addons configuration.", "access": "private", "tagname": "", @@ -5318,7 +5457,7 @@ }, { "file": "lib/models/project.js", - "line": 330, + "line": 314, "description": "Returns whether or not the given file name is present in this project.", "access": "private", "tagname": "", @@ -5340,7 +5479,7 @@ }, { "file": "lib/models/project.js", - "line": 342, + "line": 326, "description": "Resolves the absolute path to a file synchronously", "access": "private", "tagname": "", @@ -5362,7 +5501,7 @@ }, { "file": "lib/models/project.js", - "line": 356, + "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": "", @@ -5384,7 +5523,7 @@ }, { "file": "lib/models/project.js", - "line": 371, + "line": 355, "description": "Returns the dependencies from a package.json", "access": "private", "tagname": "", @@ -5415,7 +5554,7 @@ }, { "file": "lib/models/project.js", - "line": 391, + "line": 375, "description": "Returns the bower dependencies for this project.", "access": "private", "tagname": "", @@ -5437,7 +5576,7 @@ }, { "file": "lib/models/project.js", - "line": 407, + "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": "", @@ -5448,7 +5587,7 @@ }, { "file": "lib/models/project.js", - "line": 431, + "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.", "access": "private", "tagname": "", @@ -5459,7 +5598,7 @@ }, { "file": "lib/models/project.js", - "line": 455, + "line": 441, "description": "Loads and initializes all addons for this project.", "access": "private", "tagname": "", @@ -5470,7 +5609,7 @@ }, { "file": "lib/models/project.js", - "line": 475, + "line": 461, "description": "Returns what commands are made available by addons by inspecting\n`includedCommands` for every addon.", "access": "private", "tagname": "", @@ -5485,7 +5624,7 @@ }, { "file": "lib/models/project.js", - "line": 514, + "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```", "access": "private", "tagname": "", @@ -5503,7 +5642,7 @@ }, { "file": "lib/models/project.js", - "line": 537, + "line": 525, "description": "Path to the blueprints for this project.", "access": "private", "tagname": "", @@ -5518,7 +5657,7 @@ }, { "file": "lib/models/project.js", - "line": 548, + "line": 536, "description": "Returns a list of paths (including addon paths) where blueprints will be looked up.", "access": "private", "tagname": "", @@ -5533,7 +5672,7 @@ }, { "file": "lib/models/project.js", - "line": 566, + "line": 554, "description": "Returns a list of addon paths where blueprints will be looked up.", "access": "private", "tagname": "", @@ -5548,7 +5687,7 @@ }, { "file": "lib/models/project.js", - "line": 585, + "line": 577, "description": "Reloads package.json", "access": "private", "tagname": "", @@ -5563,7 +5702,7 @@ }, { "file": "lib/models/project.js", - "line": 603, + "line": 595, "description": "Re-initializes addons.", "access": "private", "tagname": "", @@ -5574,9 +5713,9 @@ }, { "file": "lib/models/project.js", - "line": 615, + "line": 607, "description": "Find an addon by its name", - "access": "private", + "access": "public", "tagname": "", "itemtype": "method", "name": "findAddonByName", @@ -5596,7 +5735,7 @@ }, { "file": "lib/models/project.js", - "line": 629, + "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": "", @@ -5623,7 +5762,7 @@ }, { "file": "lib/models/project.js", - "line": 653, + "line": 645, "description": "Returns a new project based on the first package.json that is found\nin `pathName`.", "access": "private", "tagname": "", @@ -5651,7 +5790,7 @@ }, { "file": "lib/models/project.js", - "line": 689, + "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", "access": "private", "tagname": "", @@ -5674,7 +5813,7 @@ }, { "file": "lib/models/project.js", - "line": 713, + "line": 705, "description": "Returns the project root based on the first package.json that is found", "static": 1, "itemtype": "method", @@ -5699,7 +5838,7 @@ }, { "file": "lib/tasks/build-watch.js", - "line": 45, + "line": 49, "description": "Exit silently", "access": "private", "tagname": "", @@ -5710,7 +5849,7 @@ }, { "file": "lib/tasks/npm-task.js", - "line": 89, + "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`.", "access": "private", "tagname": "", @@ -5725,7 +5864,7 @@ }, { "file": "lib/tasks/serve.js", - "line": 92, + "line": 100, "description": "Exit silently", "access": "private", "tagname": "", @@ -5736,7 +5875,7 @@ }, { "file": "lib/tasks/test-server.js", - "line": 62, + "line": 61, "description": "Exit silently", "access": "private", "tagname": "", @@ -5823,7 +5962,7 @@ "type": "Object" }, { - "name": "mathch", + "name": "match", "description": "Regular expression to match against", "type": "RegExp" }, @@ -5846,11 +5985,6 @@ "name": "storeConfigInMeta", "description": "Controls whether to include the\n contents of config", "type": "Boolean" - }, - { - "name": "isModuleUnification", - "description": "Signifies if the application\n supports module unification or not", - "type": "Boolean" } ] } @@ -5864,7 +5998,7 @@ }, { "file": "lib/utilities/insert-into-file.js", - "line": 10, + "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": "insertIntoFile", @@ -5916,7 +6050,7 @@ }, { "file": "lib/utilities/valid-project-name.js", - "line": 3, + "line": 5, "description": "Checks if the string starts with a number.", "itemtype": "method", "name": "startsWithNumber", @@ -5929,7 +6063,7 @@ }, { "file": "lib/utilities/valid-project-name.js", - "line": 13, + "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": "validProjectName", @@ -5949,7 +6083,7 @@ }, { "file": "lib/utilities/will-interrupt-process.js", - "line": 48, + "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": "", @@ -5978,7 +6112,7 @@ }, { "file": "lib/utilities/will-interrupt-process.js", - "line": 95, + "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": "", @@ -5996,7 +6130,7 @@ }, { "file": "lib/utilities/will-interrupt-process.js", - "line": 118, + "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", @@ -6005,7 +6139,7 @@ }, { "file": "lib/utilities/will-interrupt-process.js", - "line": 136, + "line": 140, "description": "Removes interruption signal listeners and tears down capture-exit", "itemtype": "method", "name": "teardownSignalsTrap", @@ -6014,7 +6148,7 @@ }, { "file": "lib/utilities/will-interrupt-process.js", - "line": 151, + "line": 155, "description": "Suppresses \"Terminate batch job (Y/N)\" confirmation on Windows", "itemtype": "method", "name": "trapWindowsSignals", @@ -6023,7 +6157,7 @@ }, { "file": "lib/utilities/windows-admin.js", - "line": 39, + "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": "", @@ -6038,7 +6172,7 @@ }, { "file": "lib/utilities/windows-admin.js", - "line": 61, + "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": "", @@ -6060,7 +6194,7 @@ }, { "file": "lib/utilities/windows-admin.js", - "line": 83, + "line": 81, "access": "public", "tagname": "", "itemtype": "method", @@ -6074,7 +6208,7 @@ }, { "file": "lib/utilities/windows-admin.js", - "line": 106, + "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": "", @@ -6093,7 +6227,655 @@ }, "class": "WindowsSymlinkChecker", "module": "ember-cli" - } - ], - "warnings": [] + }, + { + "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", + "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" + } + ] + }, + { + "file": "tests/helpers/acceptance.js", + "line": 72, + "description": "Tears down the targeted project download directory", + "class": "PrivateTestHelpers", + "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.", + "itemtype": "method", + "name": "linkDependencies", + "params": [ + { + "name": "projectName", + "description": "The name of the project under test", + "type": "String" + } + ], + "return": { + "description": "The path to the hydrated fixture.", + "type": "String" + }, + "class": "PrivateTestHelpers", + "module": "ember-cli" + }, + { + "file": "tests/helpers/acceptance.js", + "line": 112, + "description": "Clean a test run.", + "class": "PrivateTestHelpers", + "module": "ember-cli" + }, + { + "file": "tests/helpers/command-generator.js", + "line": 27, + "description": "The `invoke` method is responsible for building the final executable command.", + "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", + "module": "ember-cli" + }, + { + "file": "tests/helpers/package-cache.js", + "line": 25, + "description": "The `bower` command helper.", + "access": "private", + "tagname": "", + "itemtype": "method", + "name": "bower", + "params": [ + { + "name": "subcommand", + "description": "The subcommand to be passed into bower.", + "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", + "module": "ember-cli" + }, + { + "file": "tests/helpers/package-cache.js", + "line": 37, + "description": "The `npm` command helper.", + "access": "private", + "tagname": "", + "itemtype": "method", + "name": "npm", + "params": [ + { + "name": "subcommand", + "description": "The subcommand to be passed into npm.", + "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": "{}" + } + ], + "class": "PackageCache", + "module": "ember-cli" + }, + { + "file": "tests/helpers/package-cache.js", + "line": 49, + "description": "The `yarn` command helper.", + "access": "private", + "tagname": "", + "itemtype": "method", + "name": "yarn", + "params": [ + { + "name": "subcommand", + "description": "The subcommand to be passed into yarn.", + "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": "{}" + } + ], + "class": "PackageCache", + "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.", + "access": "private", + "tagname": "", + "itemtype": "method", + "name": "translate", + "params": [ + { + "name": "type", + "description": "Either 'bower', 'npm', or 'yarn'.", + "type": "String" + }, + { + "name": "lookup", + "description": "Either 'manifest', 'path', or 'upgrade'.", + "type": "String" + } + ], + "class": "PackageCache", + "module": "ember-cli" + }, + { + "file": "tests/helpers/package-cache.js", + "line": 253, + "description": "The `__setupForTesting` modifies things in module scope.", + "access": "private", + "tagname": "", + "itemtype": "method", + "name": "__setupForTesting", + "class": "PackageCache", + "module": "ember-cli" + }, + { + "file": "tests/helpers/package-cache.js", + "line": 264, + "description": "The `__resetForTesting` puts things back in module scope.", + "access": "private", + "tagname": "", + "itemtype": "method", + "name": "__resetForTesting", + "class": "PackageCache", + "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`.", + "access": "private", + "tagname": "", + "itemtype": "method", + "name": "_cleanDirs", + "class": "PackageCache", + "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.", + "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" + } + ], + "return": { + "description": "The manifest file contents on disk.", + "type": "String" + }, + "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", + "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.", + "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", + "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`.", + "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", + "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": "", + "itemtype": "method", + "name": "_checkManifest", + "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.", + "type": "String" + } + ], + "return": { + "description": "`true` if identical.", + "type": "Boolean" + }, + "class": "PackageCache", + "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": "", + "itemtype": "method", + "name": "_install", + "params": [ + { + "name": "label", + "description": "The label for the cache.", + "type": "String" + }, + { + "name": "type", + "description": "The type of package cache.", + "type": "String" + } + ], + "class": "PackageCache", + "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": "", + "itemtype": "method", + "name": "_upgrade", + "params": [ + { + "name": "label", + "description": "The label for the cache.", + "type": "String" + }, + { + "name": "type", + "description": "The type of package cache.", + "type": "String" + } + ], + "class": "PackageCache", + "module": "ember-cli" + }, + { + "file": "tests/helpers/package-cache.js", + "line": 578, + "description": "The `create` method adds a new package cache entry.", + "itemtype": "method", + "name": "create", + "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 for the cache.", + "type": "String" + }, + { + "name": "links", + "description": "Packages to omit for install and link.", + "type": "Array" + } + ], + "return": { + "description": "The directory on disk which contains the cache.", + "type": "String" + }, + "class": "PackageCache", + "module": "ember-cli" + }, + { + "file": "tests/helpers/package-cache.js", + "line": 619, + "description": "The `update` method aliases the `create` method.", + "itemtype": "method", + "name": "update", + "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 for the cache.", + "type": "String" + }, + { + "name": "links", + "description": "Packages to elide for install and link.", + "type": "Array" + } + ], + "return": { + "description": "The directory on disk which contains the cache.", + "type": "String" + }, + "class": "PackageCache", + "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", + "params": [ + { + "name": "label", + "description": "The label for the cache.", + "type": "String" + } + ], + "return": { + "description": "The directory on disk which contains the cache.", + "type": "String" + }, + "class": "PackageCache", + "module": "ember-cli" + }, + { + "file": "tests/helpers/package-cache.js", + "line": 644, + "description": "The `destroy` method removes all evidence of the package cache.", + "itemtype": "method", + "name": "destroy", + "params": [ + { + "name": "label", + "description": "The label for the cache.", + "type": "String" + }, + { + "name": "type", + "description": "The type of package cache.", + "type": "String" + } + ], + "class": "PackageCache", + "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.", + "itemtype": "method", + "name": "destroy", + "params": [ + { + "name": "fromLabel", + "description": "The label for the cache to clone.", + "type": "String" + }, + { + "name": "toLabel", + "description": "The label for the new cache.", + "type": "String" + } + ], + "class": "PackageCache", + "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 |", + "itemtype": "method", + "name": "hintingEnabled", + "class": "", + "module": "ember-cli" + }, + { + "file": "tests/.eslintrc.js", + "line": 20, + "class": "", + "module": "ember-cli" + }, + { + "file": "tests/.eslintrc.js", + "line": 26, + "class": "", + "module": "ember-cli" + }, + { + "file": ".eslintrc.js", + "line": 17, + "class": "", + "module": "ember-cli" + }, + { + "file": ".eslintrc.js", + "line": 23, + "class": "", + "module": "ember-cli" + }, + { + "file": ".eslintrc.js", + "line": 42, + "class": "", + "module": "ember-cli" + }, + { + "file": ".eslintrc.js", + "line": 46, + "class": "", + "module": "ember-cli" + }, + { + "file": ".eslintrc.js", + "line": 52, + "class": "", + "module": "ember-cli" + }, + { + "file": ".eslintrc.js", + "line": 62, + "class": "", + "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", + "line": " .eslintrc.js:62" + } + ] } \ No newline at end of file diff --git a/api/files/.eslintrc.js.html b/api/files/.eslintrc.js.html new file mode 100644 index 0000000..498c445 --- /dev/null +++ b/api/files/.eslintrc.js.html @@ -0,0 +1,164 @@ + + + + + .eslintrc.js - ember-cli + + + + + + +
    +
    + + +
    +
    +

    .eslintrc.js

    +
    + +
    +'use strict';
    +
    +module.exports = {
    +  root: true,
    +  parserOptions: {
    +    ecmaVersion: 2018,
    +  },
    +  plugins: ['node', 'prettier'],
    +  extends: ['eslint:recommended', 'plugin:node/recommended', 'plugin:prettier/recommended'],
    +  env: {
    +    browser: false,
    +    node: true,
    +    es6: true,
    +  },
    +  globals: {},
    +  rules: {
    +    /*** Possible Errors ***/
    +
    +    'no-console': 'off',
    +    'no-template-curly-in-string': 'error',
    +    'no-unsafe-negation': 'error',
    +
    +    /*** Best Practices ***/
    +
    +    curly: 'error',
    +    eqeqeq: 'error',
    +    'guard-for-in': 'off',
    +    'no-caller': 'error',
    +    'no-eq-null': 'error',
    +    'no-eval': 'error',
    +    'no-new': 'off',
    +    'no-unused-expressions': [
    +      'error',
    +      {
    +        allowShortCircuit: true,
    +        allowTernary: true,
    +      },
    +    ],
    +    'wrap-iife': 'off',
    +    yoda: 'error',
    +
    +    /*** Strict Mode ***/
    +
    +    strict: ['error', 'global'],
    +
    +    /*** Variables ***/
    +
    +    'no-undef': 'error',
    +    'no-unused-vars': 'error',
    +    'no-use-before-define': ['error', 'nofunc'],
    +
    +    /*** Stylistic Issues ***/
    +
    +    camelcase: 'error',
    +    'new-cap': ['error', { properties: false }],
    +    'no-array-constructor': 'error',
    +    'no-bitwise': 'error',
    +    'no-lonely-if': 'error',
    +    'no-plusplus': 'off',
    +    'no-unneeded-ternary': 'error',
    +
    +    /*** ECMAScript 6 ***/
    +
    +    'no-useless-computed-key': 'error',
    +    'no-var': 'error',
    +    'object-shorthand': 'error',
    +    'prefer-template': 'error',
    +    'symbol-description': 'error',
    +  },
    +};
    +
    +
    + +
    +
    +
    +
    + + + + + diff --git a/api/files/lib_broccoli_default-packager.js.html b/api/files/lib_broccoli_default-packager.js.html index e7277e6..3c7c249 100644 --- a/api/files/lib_broccoli_default-packager.js.html +++ b/api/files/lib_broccoli_default-packager.js.html @@ -42,15 +42,19 @@

    Classes

  • Builder
  • CLI
  • Command
  • +
  • CommandGenerator
  • DefaultPackager
  • EmberAddon
  • EmberApp
  • +
  • HardwareInfo
  • HistorySupportAddon
  • Instrumentation
  • NodeModulesList
  • NpmTask
  • +
  • PackageCache
  • PackageInfo
  • PackageInfoCache
  • +
  • PrivateTestHelpers
  • Project
  • ServeFilesAddon
  • TestsServerAddon
  • @@ -65,7 +69,7 @@

    Classes

    - Version: 3.8.1--84707b2801 + Version: 3.21.2
    @@ -82,6 +86,7 @@

    lib/broccoli/default-packager.js

    const path = require('path'); const concat = require('broccoli-concat'); const Funnel = require('broccoli-funnel'); +const BroccoliDebug = require('broccoli-debug'); const mergeTrees = require('./merge-trees'); const ConfigLoader = require('broccoli-config-loader'); const UnwatchedDir = require('broccoli-source').UnwatchedDir; @@ -187,7 +192,6 @@

    lib/broccoli/default-packager.js

    this._cachedPublic = null; this._cachedConfig = null; this._cachedJavascript = null; - this._cachedProcessedSrc = null; this._cachedProcessedIndex = null; this._cachedTransformedTree = null; this._cachedProcessedStyles = null; @@ -199,6 +203,8 @@

    lib/broccoli/default-packager.js

    this.options = options || {}; + this._debugTree = BroccoliDebug.buildDebugCallback('default-packager'); + this.env = this.options.env; this.name = this.options.name; this.autoRun = this.options.autoRun; @@ -215,7 +221,6 @@

    lib/broccoli/default-packager.js

    this.additionalAssetPaths = this.options.additionalAssetPaths; this.vendorTestStaticStyles = this.options.vendorTestStaticStyles; this.legacyTestFilesToAppend = this.options.legacyTestFilesToAppend; - this.isModuleUnificationEnabled = this.options.isModuleUnificationEnabled; } /* @@ -244,7 +249,7 @@

    lib/broccoli/default-packager.js

    * @method processIndex * @param {BroccoliTree} * @return {BroccoliTree} - */ + */ processIndex(tree) { if (this._cachedProcessedIndex === null) { let indexFilePath = this.distPaths.appHtmlFile; @@ -256,27 +261,10 @@

    lib/broccoli/default-packager.js

    annotation: 'Classic: index.html', }); - if (this.isModuleUnificationEnabled) { - let srcIndex = new Funnel(tree, { - files: ['src/ui/index.html'], - getDestinationPath: () => indexFilePath, - annotation: 'Module Unification `index.html`', - }); - - index = mergeTrees([ - index, - srcIndex, - ], { - overwrite: true, - annotation: 'Classic And Module Unification `index.html`', - }); - } - let patterns = configReplacePatterns({ addons: this.project.addons, autoRun: this.autoRun, storeConfigInMeta: this.storeConfigInMeta, - isModuleUnification: this.isModuleUnificationEnabled, }); this._cachedProcessedIndex = new ConfigReplace(index, this.packageConfig(), { @@ -310,38 +298,38 @@

    lib/broccoli/default-packager.js

    * @method processAppAndDependencies * @param {BroccoliTree} * @return {BroccoliTree} - */ + */ processAppAndDependencies(allTrees) { if (this._cachedProcessedAppAndDependencies === null) { let config = this.packageConfig(); let internal = this.packageEmberCliInternalFiles(); - let templates = this.processTemplates(allTrees); + let appContentsWithCompiledTemplates = this._debugTree( + this.processTemplates(allTrees), + 'app-and-deps:post-templates' + ); - let trees = [ - allTrees, - templates, - this.processSrc(allTrees), - ].filter(Boolean); + let trees = [allTrees, appContentsWithCompiledTemplates].filter(Boolean); - let mergedTree = mergeTrees(trees, { - annotation: 'TreeMerger (preprocessedApp & templates)', - overwrite: true, - }); + let mergedTree = this._debugTree( + mergeTrees(trees, { + annotation: 'TreeMerger (preprocessedApp & templates)', + overwrite: true, + }), + 'app-and-deps:merged' + ); let external = this.applyCustomTransforms(allTrees); let postprocessedApp = this.processJavascript(mergedTree); - let sourceTrees = [ - external, - postprocessedApp, - config, - internal, - ]; + let sourceTrees = [external, postprocessedApp, config, internal]; - this._cachedProcessedAppAndDependencies = mergeTrees(sourceTrees, { - overwrite: true, - annotation: 'Processed Application and Dependencies', - }); + this._cachedProcessedAppAndDependencies = this._debugTree( + mergeTrees(sourceTrees, { + overwrite: true, + annotation: 'Processed Application and Dependencies', + }), + 'app-and-deps:final' + ); } return this._cachedProcessedAppAndDependencies; @@ -365,10 +353,10 @@

    lib/broccoli/default-packager.js

    * @method importAdditionalAssets * @param {BroccoliTree} * @return {BroccoliTree} - */ + */ importAdditionalAssets(tree) { if (this._cachedProcessedAdditionalAssets === null) { - let otherAssetTrees = funnelReducer(this.additionalAssetPaths).map(options => { + let otherAssetTrees = funnelReducer(this.additionalAssetPaths).map((options) => { let files = options.include.join(','); options.annotation = `${options.srcDir}/{${files}} => ${options.destDir}/{${files}}`; @@ -403,7 +391,7 @@

    lib/broccoli/default-packager.js

    * @method applyCustomTransforms * @param {BroccoliTree} External (vendor) tree * @return {BroccoliTree} - */ + */ applyCustomTransforms(externalTree) { if (this._cachedTransformedTree === null) { this._cachedTransformedTree = externalTree; @@ -417,10 +405,13 @@

    lib/broccoli/default-packager.js

    annotation: `Funnel (custom transform: ${transformName})`, }); - this._cachedTransformedTree = mergeTrees([this._cachedTransformedTree, transformConfig.callback(transformTree, transformConfig.options)], { - annotation: `TreeMerger (custom transform: ${transformName})`, - overwrite: true, - }); + this._cachedTransformedTree = mergeTrees( + [this._cachedTransformedTree, transformConfig.callback(transformTree, transformConfig.options)], + { + annotation: `TreeMerger (custom transform: ${transformName})`, + overwrite: true, + } + ); } } @@ -455,14 +446,13 @@

    lib/broccoli/default-packager.js

    * @private * @method packageEmberCliInternalFiles * @return {BroccoliTree} - */ + */ packageEmberCliInternalFiles() { if (this._cachedEmberCliInternalTree === null) { let patterns = configReplacePatterns({ addons: this.project.addons, autoRun: this.autoRun, storeConfigInMeta: this.storeConfigInMeta, - isModuleUnification: this.isModuleUnificationEnabled, }); let configTree = this.packageConfig(); @@ -513,31 +503,22 @@

    lib/broccoli/default-packager.js

    * @method processTemplates * @param {BroccoliTree} tree * @return {BroccoliTree} - */ - processTemplates(templates) { + */ + processTemplates(inputTree) { if (this._cachedProcessedTemplates === null) { - let include = this.registry.extensionsForType('template') - .map(extension => `**/*/template.${extension}`); - - let pods = new Funnel(templates, { - include, - exclude: ['templates/**/*'], - annotation: 'Pod Templates', - }); - let classic = new Funnel(templates, { - srcDir: `${this.name}/templates`, - destDir: `${this.name}/templates`, - annotation: 'Classic Templates', + let appFiles = new Funnel(inputTree, { + srcDir: `${this.name}/`, + destDir: `${this.name}/`, + annotation: 'processTemplates: app files', }); - let mergedTemplates = mergeTrees([pods, classic], { + + let mergedTemplates = [appFiles]; + + mergedTemplates = mergeTrees(mergedTemplates, { overwrite: true, - annotation: 'Pod & Classic Templates', + annotation: 'Templates', }); - let preprocessedTemplatesFromAddons = callAddonsPreprocessTreeHook( - this.project, - 'template', - mergedTemplates - ); + let preprocessedTemplatesFromAddons = callAddonsPreprocessTreeHook(this.project, 'template', mergedTemplates); this._cachedProcessedTemplates = callAddonsPostprocessTreeHook( this.project, @@ -591,7 +572,7 @@

    lib/broccoli/default-packager.js

    * @method processJavascript * @param {BroccoliTree} tree * @return {BroccoliTree} - */ + */ processJavascript(tree) { if (this._cachedProcessedJavascript === null) { let javascript = new Funnel(tree, { @@ -605,11 +586,7 @@

    lib/broccoli/default-packager.js

    registry: this.registry, }); - this._cachedProcessedJavascript = callAddonsPostprocessTreeHook( - this.project, - 'js', - preprocessedApp - ); + this._cachedProcessedJavascript = callAddonsPostprocessTreeHook(this.project, 'js', preprocessedApp); } return this._cachedProcessedJavascript; @@ -647,7 +624,7 @@

    lib/broccoli/default-packager.js

    * @private * @method packageStyles * @return {BroccoliTree} - */ + */ packageStyles(tree) { if (this._cachedProcessedStyles === null) { let cssMinificationEnabled = this.minifyCSS.enabled; @@ -657,43 +634,27 @@

    lib/broccoli/default-packager.js

    minifyCSS: this.minifyCSS.options, }; - let stylesAndVendor, preprocessedStyles; + let stylesAndVendor = callAddonsPreprocessTreeHook(this.project, 'css', tree); + stylesAndVendor = this._debugTree(stylesAndVendor, 'mu-layout:addonsPreprocessTree:css'); - if (this._cachedProcessedSrc !== null && this.isModuleUnificationEnabled === true) { - stylesAndVendor = mergeTrees([ - this._cachedProcessedSrc, - tree, - ], { - annotation: 'Module Unification Styles', - }); - preprocessedStyles = new Funnel(this._cachedProcessedSrc, { - srcDir: `${this.name}/assets`, - destDir: 'assets', - }); - } else { - stylesAndVendor = callAddonsPreprocessTreeHook(this.project, 'css', tree); - - preprocessedStyles = preprocessCss( - stylesAndVendor, - '/app/styles', - '/assets', - options - ); - } + let preprocessedStyles = preprocessCss(stylesAndVendor, '/app/styles', '/assets', options); + preprocessedStyles = this._debugTree(preprocessedStyles, 'mu-layout:preprocess:css'); let vendorStyles = []; for (let outputFile in this.styleOutputFiles) { let isMainVendorFile = outputFile === this.distPaths.vendorCssFile; let headerFiles = this.styleOutputFiles[outputFile]; - let inputFiles = isMainVendorFile ? ['addon-tree-output/**/*.css'] : []; - - vendorStyles.push(concat(stylesAndVendor, { - headerFiles, - inputFiles, - outputFile, - allowNone: true, - annotation: `Concat: Vendor Styles${outputFile}`, - })); + let inputFiles = isMainVendorFile ? ['addon-tree-output/**/__COMPILED_STYLES__/**/*.css'] : []; + + vendorStyles.push( + concat(stylesAndVendor, { + headerFiles, + inputFiles, + outputFile, + allowNone: true, + annotation: `Concat: Vendor Styles${outputFile}`, + }) + ); } vendorStyles = mergeTrees(vendorStyles, { @@ -707,90 +668,16 @@

    lib/broccoli/default-packager.js

    vendorStyles = preprocessMinifyCss(vendorStyles, options.minifyCSS); } - this._cachedProcessedStyles = callAddonsPostprocessTreeHook(this.project, 'css', mergeTrees([ - preprocessedStyles, - vendorStyles, - ], { - annotation: 'Packaged Styles', - })); - } - - return this._cachedProcessedStyles; - } - - /* - * Runs pre/post-processors hooks on the application files (javascript, - * styles, templates) and returns a single tree with the processed ones. - * - * Used only when `MODULE_UNIFICATION` experiment is enabled. - * - * Given a tree: - * - * ``` - * / - * └── src - * ├── main.js - * ├── resolver.js - * ├── router.js - * └── ui - * ├── components - * ├── index.html - * ├── routes - * │ └── application - * │ └── template.hbs - * └── styles - * └── app.css - * ``` - * - * Returns the tree with the same structure, but with processed files. - * - * @private - * @method processSrc - * @param {BroccoliTree} tree - * @return {BroccoliTree} - */ - processSrc(tree) { - if (this._cachedProcessedSrc === null && this.isModuleUnificationEnabled) { - let src = new Funnel(tree, { - srcDir: 'src', - destDir: 'src', - exclude: ['**/*-test.js'], - annotation: 'Module Unification Src', - }); - - let srcAfterPreprocessTreeHook = callAddonsPreprocessTreeHook(this.project, 'src', src); - - let options = { - outputPaths: this.distPaths.appCssFile, - registry: this.registry, - }; - - // TODO: This isn't quite correct (but it does function properly in most cases), - // and should be re-evaluated before enabling the `MODULE_UNIFICATION` feature - let srcAfterStylePreprocessing = preprocessCss(srcAfterPreprocessTreeHook, '/src/ui/styles', '/assets', options); - - let srcAfterTemplatePreprocessing = preprocessTemplates(srcAfterPreprocessTreeHook, { - registry: this.registry, - annotation: 'Process Templates: src', - }); - - let srcAfterPostprocessTreeHook = callAddonsPostprocessTreeHook( + this._cachedProcessedStyles = callAddonsPostprocessTreeHook( this.project, - 'src', - srcAfterTemplatePreprocessing + 'css', + mergeTrees([preprocessedStyles, vendorStyles], { + annotation: 'Packaged Styles', + }) ); - - this._cachedProcessedSrc = new Funnel(mergeTrees([ - srcAfterPostprocessTreeHook, - srcAfterStylePreprocessing, - ], { ovewrite: true }), { - srcDir: '/', - destDir: this.name, - annotation: 'Funnel: src', - }); } - return this._cachedProcessedSrc; + return this._cachedProcessedStyles; } /* @@ -818,7 +705,7 @@

    lib/broccoli/default-packager.js

    * @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, { @@ -862,7 +749,7 @@

    lib/broccoli/default-packager.js

    * @private * @method packageVendor * @param {BroccoliTree} tree - */ + */ packageVendor(tree) { if (this._cachedVendor === null) { this._cachedVendor = new Funnel(tree, { @@ -909,7 +796,7 @@

    lib/broccoli/default-packager.js

    * @private * @method processTests * @param {BroccoliTree} tree - */ + */ processTests(tree) { if (this._cachedTests === null) { let addonTestSupportTree = new Funnel(tree, { @@ -922,19 +809,6 @@

    lib/broccoli/default-packager.js

    exclude: ['addon-test-support/**/*'], }); - if (this.isModuleUnificationEnabled) { - - let testSrcTree = new Funnel(tree, { - srcDir: 'src', - include: ['**/*-test.js'], - annotation: 'Module Unification Tests', - }); - testTree = mergeTrees([testTree, testSrcTree], { - annotation: 'Merge MU Tests', - }); - - } - let treeToCompile = new Funnel(testTree, { destDir: `${this.name}/tests`, annotation: 'Tests To Process', @@ -942,7 +816,8 @@

    lib/broccoli/default-packager.js

    treeToCompile = callAddonsPreprocessTreeHook(this.project, 'test', treeToCompile); - let preprocessedTests = preprocessJs(treeToCompile, '/tests', this.name, { + const inputPath = '/tests'; + let preprocessedTests = preprocessJs(treeToCompile, inputPath, this.name, { registry: this.registry, }); @@ -991,7 +866,7 @@

    lib/broccoli/default-packager.js

    * @method packageTests * @param {BroccoliTree} * @return {BroccoliTree} - */ + */ packageTests(tree) { let coreTestTree = this.processTests(tree); @@ -1031,7 +906,7 @@

    lib/broccoli/default-packager.js

    * @method processTestIndex * @param {BroccoliTree} * @return {BroccoliTree} - */ + */ processTestIndex(tree) { let index = new Funnel(tree, { srcDir: '/tests', @@ -1044,7 +919,6 @@

    lib/broccoli/default-packager.js

    addons: this.project.addons, autoRun: this.autoRun, storeConfigInMeta: this.storeConfigInMeta, - isModuleUnification: this.isModuleUnificationEnabled, }); let configPath = path.join(this.name, 'config', 'environments', 'test.json'); @@ -1084,14 +958,13 @@

    lib/broccoli/default-packager.js

    * ``` * @private * @method packageTestApplicationConfig - */ + */ packageTestApplicationConfig() { let files = ['app-config.js']; let patterns = configReplacePatterns({ addons: this.project.addons, autoRun: this.autoRun, storeConfigInMeta: this.storeConfigInMeta, - isModuleUnification: this.isModuleUnificationEnabled, }); let configPath = path.join(this.name, 'config', 'environments', `test.json`); @@ -1140,13 +1013,11 @@

    lib/broccoli/default-packager.js

    * @method packageApplicationTests * @param {BroccoliTree} * @return {BroccoliTree} - */ + */ packageApplicationTests(tree) { - let appTestTrees = [].concat( - this.packageEmberCliInternalFiles(), - this.packageTestApplicationConfig(), - tree - ).filter(Boolean); + let appTestTrees = [] + .concat(this.packageEmberCliInternalFiles(), this.packageTestApplicationConfig(), tree) + .filter(Boolean); appTestTrees = mergeTrees(appTestTrees, { overwrite: true, @@ -1154,11 +1025,12 @@

    lib/broccoli/default-packager.js

    }); return concat(appTestTrees, { - inputFiles: [`${this.name}/tests/**/*.js`], + inputFiles: ['**/tests/**/*.js'], headerFiles: ['vendor/ember-cli/tests-prefix.js'], footerFiles: ['vendor/ember-cli/app-config.js', 'vendor/ember-cli/tests-suffix.js'], outputFile: this.distPaths.testJsFile, annotation: 'Concat: App Tests', + sourceMapConfig: this.sourcemaps, }); } @@ -1193,7 +1065,7 @@

    lib/broccoli/default-packager.js

    * @private * @method packageTestFiles * @return {BroccoliTree} - */ + */ packageTestFiles(tree, coreTestTree) { let testSupportPath = this.distPaths.testSupportJsFile; @@ -1201,10 +1073,7 @@

    lib/broccoli/default-packager.js

    let emberCLITree = this.packageEmberCliInternalFiles(); - let headerFiles = [].concat( - 'vendor/ember-cli/test-support-prefix.js', - this.legacyTestFilesToAppend - ); + let headerFiles = [].concat('vendor/ember-cli/test-support-prefix.js', this.legacyTestFilesToAppend); let inputFiles = ['addon-test-support/**/*.js']; @@ -1222,6 +1091,7 @@

    lib/broccoli/default-packager.js

    outputFile: testSupportPath, annotation: 'Concat: Test Support JS', allowNone: true, + sourceMapConfig: this.sourcemaps, }); let testemPath = path.join(__dirname, 'testem'); @@ -1232,10 +1102,7 @@

    lib/broccoli/default-packager.js

    annotation: 'Funnel (testem)', }); - let sourceTrees = [ - testemTree, - testJs, - ]; + let sourceTrees = [testemTree, testJs]; if (this.vendorTestStaticStyles.length > 0) { sourceTrees.push( @@ -1243,6 +1110,7 @@

    lib/broccoli/default-packager.js

    headerFiles: this.vendorTestStaticStyles, outputFile: this.distPaths.testSupportCssFile, annotation: 'Concat: Test Support CSS', + sourceMapConfig: this.sourcemaps, }) ); } @@ -1281,7 +1149,7 @@

    lib/broccoli/default-packager.js

    * @method packagePublic * @param {BroccoliTree} tree * @return {BroccoliTree} - */ + */ packagePublic(tree) { if (this._cachedPublic === null) { this._cachedPublic = new Funnel(tree, { @@ -1316,7 +1184,7 @@

    lib/broccoli/default-packager.js

    * ``` * @private * @method packageConfig - */ + */ packageConfig() { let env = this.env; let name = this.name; @@ -1384,7 +1252,7 @@

    lib/broccoli/default-packager.js

    * @private * @method packageJavascript * @return {BroccoliTree} - */ + */ packageJavascript(tree) { if (this._cachedJavascript === null) { let applicationJs = this.processAppAndDependencies(tree); @@ -1447,12 +1315,10 @@

    lib/broccoli/default-packager.js

    * @private * @method packageApplicationJs * @return {BroccoliTree} - */ + */ packageApplicationJs(tree) { let inputFiles = [`${this.name}/**/*.js`]; - let headerFiles = [ - 'vendor/ember-cli/app-prefix.js', - ]; + let headerFiles = ['vendor/ember-cli/app-prefix.js']; let footerFiles = [ 'vendor/ember-cli/app-suffix.js', 'vendor/ember-cli/app-config.js', @@ -1512,14 +1378,14 @@

    lib/broccoli/default-packager.js

    * @method packageVendorJs * @param {BroccoliTree} tree * @return {BroccoliTree} - */ + */ packageVendorJs(tree) { let importPaths = Object.keys(this.scriptOutputFiles); // iterate over the keys and concat files // to support scenarios like // app.import('vendor/foobar.js', { outputFile: 'assets/baz.js' }); - let vendorTrees = importPaths.map(importPath => { + let vendorTrees = importPaths.map((importPath) => { let files = this.scriptOutputFiles[importPath]; let isMainVendorFile = importPath === this.distPaths.vendorJsFile; diff --git a/api/files/lib_broccoli_ember-addon.js.html b/api/files/lib_broccoli_ember-addon.js.html index a65c384..1206610 100644 --- a/api/files/lib_broccoli_ember-addon.js.html +++ b/api/files/lib_broccoli_ember-addon.js.html @@ -42,15 +42,19 @@

    Classes

  • Builder
  • CLI
  • Command
  • +
  • CommandGenerator
  • DefaultPackager
  • EmberAddon
  • EmberApp
  • +
  • HardwareInfo
  • HistorySupportAddon
  • Instrumentation
  • NodeModulesList
  • NpmTask
  • +
  • PackageCache
  • PackageInfo
  • PackageInfoCache
  • +
  • PrivateTestHelpers
  • Project
  • ServeFilesAddon
  • TestsServerAddon
  • @@ -65,7 +69,7 @@

    Classes

    - Version: 3.8.1--84707b2801 + Version: 3.21.2
    @@ -113,7 +117,6 @@

    lib/broccoli/ember-addon.js

    trees: { app: 'tests/dummy/app', public: 'tests/dummy/public', - src: null, styles: 'tests/dummy/app/styles', templates: 'tests/dummy/app/templates', tests: new Funnel('tests', { @@ -132,10 +135,6 @@

    lib/broccoli/ember-addon.js

    overrides.trees.styles = null; overrides.trees.templates = null; } - if (fs.existsSync('tests/dummy/src')) { - overrides.trees.src = 'tests/dummy/src'; - overrides.trees.styles = 'tests/dummy/src/ui/styles'; - } if (fs.existsSync('tests/dummy/vendor')) { overrides.trees.vendor = 'tests/dummy/vendor'; diff --git a/api/files/lib_broccoli_ember-app.js.html b/api/files/lib_broccoli_ember-app.js.html index 3c7dd2b..d58407e 100644 --- a/api/files/lib_broccoli_ember-app.js.html +++ b/api/files/lib_broccoli_ember-app.js.html @@ -42,15 +42,19 @@

    Classes

  • Builder
  • CLI
  • Command
  • +
  • CommandGenerator
  • DefaultPackager
  • EmberAddon
  • EmberApp
  • +
  • HardwareInfo
  • HistorySupportAddon
  • Instrumentation
  • NodeModulesList
  • NpmTask
  • +
  • PackageCache
  • PackageInfo
  • PackageInfoCache
  • +
  • PrivateTestHelpers
  • Project
  • ServeFilesAddon
  • TestsServerAddon
  • @@ -65,7 +69,7 @@

    Classes

    - Version: 3.8.1--84707b2801 + Version: 3.21.2
    @@ -76,7 +80,6 @@

    lib/broccoli/ember-app.js

    -/* global require, module */
     'use strict';
     
     /**
    @@ -98,9 +101,7 @@ 

    lib/broccoli/ember-app.js

    const concat = require('broccoli-concat'); const BroccoliDebug = require('broccoli-debug'); -const ModuleNormalizer = require('broccoli-module-normalizer'); const AmdFunnel = require('broccoli-amd-funnel'); -const ConfigReplace = require('broccoli-config-replace'); const mergeTrees = require('./merge-trees'); const WatchedDir = require('broccoli-source').WatchedDir; const UnwatchedDir = require('broccoli-source').UnwatchedDir; @@ -112,7 +113,6 @@

    lib/broccoli/ember-app.js

    const isNull = require('ember-cli-lodash-subset').isNull; const Funnel = require('broccoli-funnel'); const logger = require('heimdalljs-logger')('ember-cli:ember-app'); -const emberAppUtils = require('../utilities/ember-app-utils'); const addonProcessTree = require('../utilities/addon-process-tree'); const lintAddonsByType = require('../utilities/lint-addons-by-type'); const emberCLIBabelConfigKey = require('../utilities/ember-cli-babel-config-key'); @@ -120,8 +120,6 @@

    lib/broccoli/ember-app.js

    const semver = require('semver'); const DefaultPackager = require('./default-packager'); -const configReplacePatterns = emberAppUtils.configReplacePatterns; - let DEFAULT_CONFIG = { storeConfigInMeta: true, autoRun: true, @@ -153,8 +151,6 @@

    lib/broccoli/ember-app.js

    addons: {}, }; - - class EmberApp { /** EmberApp is the main class Ember CLI uses to manage the Broccoli trees @@ -191,7 +187,7 @@

    lib/broccoli/ember-app.js

    this.name = options.name || this.project.name(); this.env = EmberApp.env(); - this.isProduction = (this.env === 'production'); + this.isProduction = this.env === 'production'; this.registry = options.registry || p.defaultRegistry(this); @@ -201,7 +197,7 @@

    lib/broccoli/ember-app.js

    this._initOptions(options); this._initVendorFiles(); - this._styleOutputFiles = { }; + this._styleOutputFiles = {}; // ensure addon.css always gets concated this._styleOutputFiles[this.options.outputPaths.vendor.css] = []; @@ -218,7 +214,7 @@

    lib/broccoli/ember-app.js

    this.populateLegacyFiles(); this.initializeAddons(); - this.project.addons.forEach(addon => addon.app = this); + this.project.addons.forEach((addon) => (addon.app = this)); p.setupRegistry(this); this._importAddonTransforms(); this._notifyAddonIncluded(); @@ -245,7 +241,6 @@

    lib/broccoli/ember-app.js

    additionalAssetPaths: this.otherAssetPaths, vendorTestStaticStyles: this.vendorTestStaticStyles, legacyTestFilesToAppend: this.legacyTestFilesToAppend, - isModuleUnificationEnabled: isExperimentEnabled('MODULE_UNIFICATION') && !!this.trees.src, distPaths: { appJsFile: this.options.outputPaths.app.js, appCssFile: this.options.outputPaths.app.css, @@ -272,10 +267,10 @@

    lib/broccoli/ember-app.js

    @param {Object} options */ _initTestsAndHinting(options) { - let testsEnabledDefault = process.env.EMBER_CLI_TEST_COMMAND || !this.isProduction; + let testsEnabledDefault = process.env.EMBER_CLI_TEST_COMMAND === 'true' || !this.isProduction; - this.tests = options.hasOwnProperty('tests') ? options.tests : testsEnabledDefault; - this.hinting = options.hasOwnProperty('hinting') ? options.hinting : testsEnabledDefault; + this.tests = 'tests' in options ? options.tests : testsEnabledDefault; + this.hinting = 'hinting' in options ? options.hinting : testsEnabledDefault; } /** @@ -292,7 +287,10 @@

    lib/broccoli/ember-app.js

    this.project = options.project || Project.closestSync(process.cwd()); if (options.configPath) { - this.project.configPath = function() { return app._resolveLocal(options.configPath); }; + this.project.configPath = function () { + return app._resolveLocal(options.configPath); + }; + this.project.configCache.clear(); } } @@ -334,7 +332,6 @@

    lib/broccoli/ember-app.js

    }; let trees = (options && options.trees) || {}; - let srcTree = buildTreeFor('src', trees.src); let appTree = buildTreeFor('app', trees.app); let testsPath = typeof trees.tests === 'string' ? resolvePathFor('tests', trees.tests) : null; @@ -342,13 +339,7 @@

    lib/broccoli/ember-app.js

    // these are contained within app/ no need to watch again // (we should probably have the builder or the watcher dedup though) - - if (isExperimentEnabled('MODULE_UNIFICATION')) { - let srcStylesPath = `${resolvePathFor('src', trees.src)}/ui/styles`; - this._stylesPath = fs.existsSync(srcStylesPath) ? srcStylesPath : resolvePathFor('app/styles', trees.styles); - } else { - this._stylesPath = resolvePathFor('app/styles', trees.styles); - } + this._stylesPath = resolvePathFor('app/styles', trees.styles); let stylesTree = null; if (fs.existsSync(this._stylesPath)) { @@ -371,7 +362,7 @@

    lib/broccoli/ember-app.js

    let publicTree = buildTreeFor('public', trees.public); let detectedDefaultOptions = { - babel: { }, + babel: {}, jshintrc: { app: this.project.root, tests: testsPath, @@ -380,12 +371,14 @@

    lib/broccoli/ember-app.js

    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 - 'negate_iife': false, + // eslint-disable-next-line camelcase + negate_iife: false, // limit sequences because of memory issues during parsing sequences: 30, }, @@ -408,7 +401,6 @@

    lib/broccoli/ember-app.js

    extensions: ['js'], }, trees: { - src: srcTree, app: appTree, tests: testsTree, styles: stylesTree, @@ -445,9 +437,9 @@

    lib/broccoli/ember-app.js

    // Add testem.js to excludes for broccoli-asset-rev. // This will allow tests to run against the production builds. - if (this.options.fingerprint && this.options.fingerprint.exclude) { - this.options.fingerprint.exclude.push('testem'); - } + this.options.fingerprint = this.options.fingerprint || {}; + this.options.fingerprint.exclude = this.options.fingerprint.exclude || []; + this.options.fingerprint.exclude.push('testem'); } _emberCLIBabelConfigKey() { @@ -510,25 +502,29 @@

    lib/broccoli/ember-app.js

    handlebarsVendorFiles = null; } - this.vendorFiles = omitBy(merge({ - 'handlebars.js': handlebarsVendorFiles, - 'ember.js': { - development: developmentEmber, - production: productionEmber, - }, - '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'], + this.vendorFiles = omitBy( + merge( + { + 'handlebars.js': handlebarsVendorFiles, + 'ember.js': { + development: developmentEmber, + production: productionEmber, }, + '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'], + }, + }, + ], }, - ], - }, this.options.vendorFiles), isNull); + this.options.vendorFiles + ), + isNull + ); this._addJqueryInLegacyEmber(); @@ -545,7 +541,9 @@

    lib/broccoli/ember-app.js

    // 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\']`.'); + 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 @@ -567,7 +565,11 @@

    lib/broccoli/ember-app.js

    if (optionFeatures && !optionFeatures.isFeatureEnabled('jquery-integration')) { return; } - this.project.ui.writeDeprecateLine('Ember will stop including jQuery by default in an upcoming version. If you wish keep using jQuery in your application explicitly add `@ember/jquery` to your package.json'); + 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`; @@ -647,7 +649,7 @@

    lib/broccoli/ember-app.js

    result = result || false; roots = roots || {}; - let babelInstance = addons.find(addon => addon.name === 'ember-cli-babel'); + let babelInstance = addons.find((addon) => addon.name === 'ember-cli-babel'); if (babelInstance) { let version = babelInstance.pkg.version; if (semver.lt(version, '6.6.0')) { @@ -655,11 +657,13 @@

    lib/broccoli/ember-app.js

    } 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}`); + 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; + return addons.some((addon) => this._checkEmberCliBabel(addon.addons, result, roots)) || result; } /** @@ -685,10 +689,10 @@

    lib/broccoli/ember-app.js

    @method _notifyAddonIncluded */ _notifyAddonIncluded() { - let addonNames = this.project.addons.map(addon => addon.name); + let addonNames = this.project.addons.map((addon) => addon.name); if (this.options.addons.blacklist) { - this.options.addons.blacklist.forEach(addonName => { + this.options.addons.blacklist.forEach((addonName) => { if (addonNames.indexOf(addonName) === -1) { throw new Error(`Addon "${addonName}" defined in blacklist is not found`); } @@ -696,7 +700,7 @@

    lib/broccoli/ember-app.js

    } if (this.options.addons.whitelist) { - this.options.addons.whitelist.forEach(addonName => { + this.options.addons.whitelist.forEach((addonName) => { if (addonNames.indexOf(addonName) === -1) { throw new Error(`Addon "${addonName}" defined in whitelist is not found`); } @@ -705,11 +709,9 @@

    lib/broccoli/ember-app.js

    // the addons must be filtered before the `included` hook is called // in case an addon caches the project.addons list - this.project.addons = this.project.addons.filter( - addon => this.shouldIncludeAddon(addon) - ); + this.project.addons = this.project.addons.filter((addon) => this.shouldIncludeAddon(addon)); - this.project.addons.forEach(addon => { + this.project.addons.forEach((addon) => { if (addon.included) { addon.included(this); } @@ -723,7 +725,7 @@

    lib/broccoli/ember-app.js

    @method _importAddonTransforms */ _importAddonTransforms() { - this.project.addons.forEach(addon => { + this.project.addons.forEach((addon) => { if (this.shouldIncludeAddon(addon)) { if (addon.importTransforms) { let transforms = addon.importTransforms(); @@ -732,7 +734,7 @@

    lib/broccoli/ember-app.js

    throw new Error(`Addon "${addon.name}" did not return a transform map from importTransforms function`); } - Object.keys(transforms).forEach(transformName => { + Object.keys(transforms).forEach((transformName) => { let transformConfig = { files: [], options: {}, @@ -746,12 +748,16 @@

    lib/broccoli/ember-app.js

    transformConfig['callback'] = transforms[transformName]; transformConfig['processOptions'] = (assetPath, entry, options) => options; } else { - throw new Error(`Addon "${addon.name}" did not return a callback function correctly for transform "${transformName}".`); + throw new Error( + `Addon "${addon.name}" did not return a callback function correctly for transform "${transformName}".` + ); } if (this._customTransformsMap.has(transformName)) { // there is already a transform with a same name, therefore we warn the user - this.project.ui.writeWarnLine(`Addon "${addon.name}" is defining a transform name: ${transformName} that is already being defined. Using transform from addon: "${addon.name}".`); + this.project.ui.writeWarnLine( + `Addon "${addon.name}" is defining a transform name: ${transformName} that is already being defined. Using transform from addon: "${addon.name}".` + ); } this._customTransformsMap.set(transformName, transformConfig); @@ -797,16 +803,18 @@

    lib/broccoli/ember-app.js

    @return {Array} List of trees */ addonTreesFor(type) { - return this._addonTreesFor(type).map(addonBundle => addonBundle.tree); + return this._addonTreesFor(type).map((addonBundle) => addonBundle.tree); } _getDefaultPluginForType(type) { let plugins = this.registry.load(type); - let defaultsForType = plugins.filter(plugin => plugin.isDefaultForType); + 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(', ')}` + `There are multiple preprocessor plugins marked as default for '${type}': ${defaultsForType + .map((p) => p.name) + .join(', ')}` ); } @@ -921,7 +929,6 @@

    lib/broccoli/ember-app.js

    return addonProcessTree(this.project, 'postprocessTree', type, tree); } - /** Runs addon pre-processing on a given tree and returns the processed tree. @@ -988,7 +995,9 @@

    lib/broccoli/ember-app.js

    for (name in this.vendorFiles) { let args = this.vendorFiles[name]; - if (args === null) { continue; } + if (args === null) { + continue; + } this.import.apply(this, [].concat(args)); } @@ -1028,36 +1037,6 @@

    lib/broccoli/ember-app.js

    return this._cachedTemplateTree; } - /** - Returns the tree for /tests/index.html - - @private - @method testIndex - @return {Tree} Tree for /tests/index.html - */ - testIndex() { - let index = new Funnel(this.trees.tests, { - srcDir: '/', - files: ['index.html'], - destDir: '/tests', - annotation: 'Funnel (test index)', - }); - - let patterns = configReplacePatterns({ - addons: this.project.addons, - autoRun: this.options.autoRun, - storeConfigInMeta: this.options.storeConfigInMeta, - isModuleUnification: isExperimentEnabled('MODULE_UNIFICATION') && !!this.trees.src, - }); - - return new ConfigReplace(index, this._defaultPackager.packageConfig(this.tests), { - configPath: path.join(this.name, 'config', 'environments', 'test.json'), - files: ['tests/index.html'], - env: 'test', - patterns, - }); - } - /* * Gather application and add-ons javascript files and return them in a single * tree. @@ -1090,12 +1069,9 @@

    lib/broccoli/ember-app.js

    * @private * @method getAppJavascript * @return {BroccoliTree} - */ + */ getAppJavascript(isPackageHookSupplied) { - let appTrees = [].concat( - this.addonTreesFor('app'), - this.trees.app - ).filter(Boolean); + let appTrees = [].concat(this.addonTreesFor('app'), this.trees.app).filter(Boolean); let mergedApp = mergeTrees(appTrees, { overwrite: true, @@ -1115,24 +1091,6 @@

    lib/broccoli/ember-app.js

    return appTree; } - /* - * Returns a `src/` directory of the application or `null` if it is not - * present. - * - * @private - * @method getSrc - * @return {BroccoliTree} - */ - getSrc() { - let rawSrcTree = this.trees.src; - - if (!rawSrcTree) { return null; } - - return new Funnel(rawSrcTree, { - destDir: 'src', - }); - } - /* * Gather add-ons style (css/sass/less) files and return them in a single * tree. @@ -1150,7 +1108,7 @@

    lib/broccoli/ember-app.js

    * @private * @method getStyles * @return {BroccoliTree} - */ + */ getStyles() { let styles; if (this.trees.styles) { @@ -1162,10 +1120,12 @@

    lib/broccoli/ember-app.js

    } let addons = this.addonTreesFor('styles'); - return mergeTrees(addons.concat(styles), { + styles = mergeTrees(addons.concat(styles), { overwrite: true, annotation: 'Styles', }); + + return styles; } /* @@ -1188,7 +1148,7 @@

    lib/broccoli/ember-app.js

    * @private * @method getAddonTemplates * @return {BroccoliTree} - */ + */ getAddonTemplates() { let addonTrees = this.addonTreesFor('templates'); let mergedTemplates = mergeTrees(addonTrees, { @@ -1211,53 +1171,29 @@

    lib/broccoli/ember-app.js

    @return {Array} An array of regular expressions. */ _podTemplatePatterns() { - return this.registry.extensionsForType('template') - .map(extension => `**/*/template.${extension}`); + return this.registry.extensionsForType('template').map((extension) => `**/*/template.${extension}`); } _nodeModuleTrees() { if (!this._cachedNodeModuleTrees) { - this._cachedNodeModuleTrees = Array.from(this._nodeModules.values(), module => new Funnel(module.path, { - srcDir: '/', - destDir: `node_modules/${module.name}/`, - annotation: `Funnel (node_modules/${module.name})`, - })); + this._cachedNodeModuleTrees = Array.from( + this._nodeModules.values(), + (module) => + new Funnel(module.path, { + srcDir: '/', + destDir: `node_modules/${module.name}/`, + annotation: `Funnel (node_modules/${module.name})`, + }) + ); } return this._cachedNodeModuleTrees; } - _addonBundles(type, _options) { + _addonBundles(type) { if (!this._cachedAddonBundles[type]) { - let options = Object.assign( - { - moduleNormalizerDisabled: this.options.moduleNormalizerDisabled, - }, - _options - ); - let addonBundles = this._addonTreesFor(type); - for (let addonBundle of addonBundles) { - let { name, root } = addonBundle; - - if (isExperimentEnabled('DELAYED_TRANSPILATION')) { - if (!options.moduleNormalizerDisabled) { - // move legacy /modules/addon to /addon - let hasAlreadyPrintedModuleDeprecation; - addonBundle.tree = new ModuleNormalizer(addonBundle.tree, { - callback: () => { - if (!hasAlreadyPrintedModuleDeprecation) { - this.project.ui.writeDeprecateLine(`Addon "${name}" (found at "${root}") is manually placing files in the legacy "modules" folder. Support for this will be removed in a future version.`); - hasAlreadyPrintedModuleDeprecation = true; - } - }, - annotation: `ModuleNormalizer (${type} ${name})`, - }); - } - } - } - this._cachedAddonBundles[type] = addonBundles; } @@ -1267,14 +1203,17 @@

    lib/broccoli/ember-app.js

    /* * @private * @method @createAddonTree - */ + */ createAddonTree(type, outputDir, options) { let addonBundles = this._addonBundles(type, options); - let tree = mergeTrees(addonBundles.map(({ tree }) => tree), { - overwrite: true, - annotation: `TreeMerger (${type})`, - }); + let tree = mergeTrees( + addonBundles.map(({ tree }) => tree), + { + overwrite: true, + annotation: `TreeMerger (${type})`, + } + ); return new Funnel(tree, { destDir: outputDir, @@ -1298,16 +1237,6 @@

    lib/broccoli/ember-app.js

    return this._cachedAddonTestSupportTree; } - addonSrcTree() { - if (!this._cachedAddonSrcTree) { - this._cachedAddonSrcTree = this.createAddonTree('src', 'addon-tree-output', { - moduleNormalizerDisabled: true, - }); - } - - return this._cachedAddonSrcTree; - } - /* * Gather all dependencies external to `ember-cli`, namely: * @@ -1328,22 +1257,23 @@

    lib/broccoli/ember-app.js

    * @private * @method getExternalTree * @return {BroccoliTree} - */ + */ getExternalTree() { if (!this._cachedExternalTree) { let vendorTrees = this.addonTreesFor('vendor'); vendorTrees.push(this.trees.vendor); - let vendor = this._defaultPackager.packageVendor(mergeTrees(vendorTrees, { - overwrite: true, - annotation: 'TreeMerger (vendor)', - })); + let vendor = this._defaultPackager.packageVendor( + mergeTrees(vendorTrees, { + overwrite: true, + annotation: 'TreeMerger (vendor)', + }) + ); let addons = this.addonTree(); - let addonsSrc = this.addonSrcTree(); - let trees = [vendor].concat(addons, addonsSrc); + let trees = [vendor].concat(addons); if (this._bowerEnabled) { let bower = this._defaultPackager.packageBower(this.trees.bower, this.bowerDirectory); @@ -1382,7 +1312,7 @@

    lib/broccoli/ember-app.js

    * @private * @method getTests * @return {BroccoliTree} - */ + */ getTests() { let addonTrees = this.addonTreesFor('test-support'); @@ -1435,7 +1365,7 @@

    lib/broccoli/ember-app.js

    * @private * @method getPublic * @return {BroccoliTree} - */ + */ getPublic() { let addonPublicTrees = this.addonTreesFor('public'); addonPublicTrees = addonPublicTrees.concat(this.trees.public); @@ -1472,16 +1402,6 @@

    lib/broccoli/ember-app.js

    lintTrees.push(lintedApp); } - if (isExperimentEnabled('MODULE_UNIFICATION') && this.trees.src) { - let lintedSrc = this.addonLintTree('src', this.trees.src); - lintedSrc = new Funnel(lintedSrc, { - destDir: 'lint/src/', - annotation: 'Funnel (lint src)', - }); - - lintTrees.push(lintedSrc); - } - let lintedTests = this.addonLintTree('tests', this.trees.tests); let lintedTemplates = this.addonLintTree('templates', this._templatesTree()); @@ -1557,16 +1477,12 @@

    lib/broccoli/ember-app.js

    let extension = path.extname(assetPath); if (!extension) { - throw new Error('You must pass a file to `app.import`. For directories specify them to the constructor under the `trees` option.'); + throw new Error( + 'You must pass a file to `app.import`. For directories specify them to the constructor under the `trees` option.' + ); } - this._import( - assetPath, - options, - directory, - subdirectory, - extension - ); + this._import(assetPath, options, directory, subdirectory, extension); } /** @@ -1587,25 +1503,25 @@

    lib/broccoli/ember-app.js

    if (!Array.isArray(options.using)) { throw new Error('You must pass an array of transformations for `using` option'); } - options.using.forEach(entry => { + options.using.forEach((entry) => { if (!entry.transformation) { - throw new Error(`while importing ${assetPath}: each entry in the \`using\` list must have a \`transformation\` name`); + throw new Error( + `while importing ${assetPath}: each entry in the \`using\` list must have a \`transformation\` name` + ); } let transformName = entry.transformation; if (!this._customTransformsMap.has(transformName)) { let availableTransformNames = Array.from(this._customTransformsMap.keys()).join(','); - throw new Error(`while import ${assetPath}: found an unknown transformation name ${transformName}. Available transformNames are: ${availableTransformNames}`); + throw new Error( + `while import ${assetPath}: found an unknown transformation name ${transformName}. Available transformNames are: ${availableTransformNames}` + ); } // process options for the transform and update the options let customTransforms = this._customTransformsMap.get(transformName); - customTransforms.options = customTransforms.processOptions( - assetPath, - entry, - customTransforms.options - ); + customTransforms.options = customTransforms.processOptions(assetPath, entry, customTransforms.options); customTransforms.files.push(assetPath); }); } @@ -1614,21 +1530,27 @@

    lib/broccoli/ember-app.js

    options.outputFile = options.outputFile || this.options.outputPaths.vendor.js; addOutputFile('firstOneWins', this._scriptOutputFiles, assetPath, options); } else if (options.type === 'test') { - if (!allowImport('firstOneWins', this.legacyTestFilesToAppend, assetPath, options)) { return; } + if (!allowImport('firstOneWins', this.legacyTestFilesToAppend, assetPath, options)) { + return; + } if (options.prepend) { this.legacyTestFilesToAppend.unshift(assetPath); } else { this.legacyTestFilesToAppend.push(assetPath); } } else { - throw new Error(`You must pass either \`vendor\` or \`test\` for options.type in your call to \`app.import\` for file: ${basename}`); + throw new Error( + `You must pass either \`vendor\` or \`test\` for options.type in your call to \`app.import\` for file: ${basename}` + ); } } else if (extension === '.css') { if (options.type === 'vendor') { options.outputFile = options.outputFile || this.options.outputPaths.vendor.css; addOutputFile('lastOneWins', this._styleOutputFiles, assetPath, options); } else { - if (!allowImport('lastOneWins', this.vendorTestStaticStyles, assetPath, options)) { return; } + if (!allowImport('lastOneWins', this.vendorTestStaticStyles, assetPath, options)) { + return; + } if (options.prepend) { this.vendorTestStaticStyles.unshift(assetPath); } else { @@ -1673,11 +1595,17 @@

    lib/broccoli/ember-app.js

    assetPath = assetPath.split('\\').join('/'); if (assetPath.split('/').length < 2) { - console.log(chalk.red(`Using \`app.import\` with a file in the root of \`vendor/\` causes a significant performance penalty. Please move \`${assetPath}\` into a subdirectory.`)); + console.log( + chalk.red( + `Using \`app.import\` with a file in the root of \`vendor/\` causes a significant performance penalty. Please move \`${assetPath}\` into a subdirectory.` + ) + ); } if (/[*,]/.test(assetPath)) { - throw new Error(`You must pass a file path (without glob pattern) to \`app.import\`. path was: \`${assetPath}\``); + throw new Error( + `You must pass a file path (without glob pattern) to \`app.import\`. path was: \`${assetPath}\`` + ); } return assetPath; @@ -1697,7 +1625,6 @@

    lib/broccoli/ember-app.js

    this.getTests(), this.getExternalTree(), this.getPublic(), - this.getSrc(), this.getAppJavascript(this._isPackageHookSupplied), ].filter(Boolean); } @@ -1714,7 +1641,7 @@

    lib/broccoli/ember-app.js

    let addonBundles = this._cachedAddonBundles[type]; - let addonTrees = addonBundles.map(addonBundle => { + let addonTrees = addonBundles.map((addonBundle) => { let { name, tree, root } = addonBundle; let precompiledSource = tree; @@ -1725,7 +1652,9 @@

    lib/broccoli/ember-app.js

    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.`); + 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; } }, @@ -1736,8 +1665,8 @@

    lib/broccoli/ember-app.js

    return [tree, precompiledSource]; }); - let precompiledSource = addonTrees.map(pair => pair[1]); - addonTrees = addonTrees.map(pair => pair[0]); + let precompiledSource = addonTrees.map((pair) => pair[1]); + addonTrees = addonTrees.map((pair) => pair[0]); precompiledSource = mergeTrees(precompiledSource, { overwrite: true, @@ -1768,40 +1697,13 @@

    lib/broccoli/ember-app.js

    } _legacyPackage(fullTree) { - if (isExperimentEnabled('DELAYED_TRANSPILATION')) { - fullTree = mergeTrees( - [ - fullTree, - this._legacyAddonCompile('addon', 'addon-tree-output'), - this._legacyAddonCompile('addon-test-support', 'tests/addon-test-support', { - skipTemplates: true, - }), - this._legacyAddonCompile('src', 'addon-tree-output', { - // moduleNormalizerDisabled: true, - amdFunnelDisabled: true, - }), - ], - { - overwrite: true, - } - ); - - fullTree = this._debugTree(fullTree, 'postcompiledAddonTrees'); - } - let javascriptTree = this._defaultPackager.packageJavascript(fullTree); let stylesTree = this._defaultPackager.packageStyles(fullTree); let appIndex = this._defaultPackager.processIndex(fullTree); let additionalAssets = this._defaultPackager.importAdditionalAssets(fullTree); let publicTree = this._defaultPackager.packagePublic(fullTree); - let sourceTrees = [ - appIndex, - javascriptTree, - stylesTree, - additionalAssets, - publicTree, - ].filter(Boolean); + let sourceTrees = [appIndex, javascriptTree, stylesTree, additionalAssets, publicTree].filter(Boolean); if (this.tests && this.trees.tests) { sourceTrees.push(this._defaultPackager.packageTests(fullTree)); @@ -1863,7 +1765,9 @@

    lib/broccoli/ember-app.js

    if (!container[outputFile]) { container[outputFile] = []; } - if (!allowImport(strategy, container[outputFile], assetPath, options)) { return; } + if (!allowImport(strategy, container[outputFile], assetPath, options)) { + return; + } if (options.prepend) { container[outputFile].unshift(assetPath); @@ -1878,7 +1782,9 @@

    lib/broccoli/ember-app.js

    let assetIndex = fileList.indexOf(assetPath); // Doesn't exist in the current fileList. Safe to remove. - if (assetIndex === -1) { return true; } + if (assetIndex === -1) { + return true; + } logger.info(`Highlander Rule: duplicate \`app.import(${assetPath})\`. Only including the last by order.`); @@ -1903,7 +1809,9 @@

    lib/broccoli/ember-app.js

    let assetIndex = fileList.indexOf(assetPath); // Doesn't exist in the current fileList. Safe to remove. - if (assetIndex === -1) { return true; } + if (assetIndex === -1) { + return true; + } logger.info(`Highlander Rule: duplicate \`app.import(${assetPath})\`. Only including the first by order.`); diff --git a/api/files/lib_cli_cli.js.html b/api/files/lib_cli_cli.js.html index d53fab3..57a58ff 100644 --- a/api/files/lib_cli_cli.js.html +++ b/api/files/lib_cli_cli.js.html @@ -42,15 +42,19 @@

    Classes

  • Builder
  • CLI
  • Command
  • +
  • CommandGenerator
  • DefaultPackager
  • EmberAddon
  • EmberApp
  • +
  • HardwareInfo
  • HistorySupportAddon
  • Instrumentation
  • NodeModulesList
  • NpmTask
  • +
  • PackageCache
  • PackageInfo
  • PackageInfoCache
  • +
  • PrivateTestHelpers
  • Project
  • ServeFilesAddon
  • TestsServerAddon
  • @@ -65,7 +69,7 @@

    Classes

    - Version: 3.8.1--84707b2801 + Version: 3.21.2
    @@ -78,17 +82,15 @@

    lib/cli/cli.js

     'use strict';
     
    -const RSVP = require('rsvp');
    -
     const lookupCommand = require('./lookup-command');
     const getOptionArgs = require('../utilities/get-option-args');
    +const hash = require('promise.hash.helper');
     const logger = require('heimdalljs-logger')('ember-cli:cli');
     const loggerTesting = require('heimdalljs-logger')('ember-cli:testing');
     const Instrumentation = require('../models/instrumentation');
     const PackageInfoCache = require('../models/package-info-cache');
     const heimdall = require('heimdalljs');
     
    -const Promise = RSVP.Promise;
     const onProcessInterrupt = require('../utilities/will-interrupt-process');
     
     class CLI {
    @@ -148,26 +150,72 @@ 

    lib/cli/cli.js

    * @private * @property instrumentation */ - this.instrumentation = options.instrumentation || new Instrumentation({ - ui: options.ui, - initInstrumentation: options.initInstrumentation, - }); + this.instrumentation = + options.instrumentation || + new Instrumentation({ + ui: options.ui, + initInstrumentation: options.initInstrumentation, + }); this.packageInfoCache = new PackageInfoCache(this.ui); logger.info('testing %o', !!this.testing); } + /** + * @private + * @method maybeMakeCommand + * @param commandName + * @param commandArgs + * @return {null|CurrentCommand} + */ + maybeMakeCommand(commandName, commandArgs) { + if (this._environment === undefined) { + throw new Error('Unable to make command without environment, you have to execute "run" method first.'); + } + let CurrentCommand = lookupCommand(this._environment.commands, commandName, commandArgs, { + project: this._environment.project, + ui: this.ui, + }); + + /* + * XXX Need to decide what to do here about showing errors. For + * a non-CLI project the cache is local and probably should. For + * a CLI project the cache is there, but not sure when we'll know + * about all the errors, because there may be multiple projects. + * if (this.packageInfoCache.hasErrors()) { + * this.packageInfoCache.showErrors(); + * } + */ + let command = new CurrentCommand({ + ui: this.ui, + analytics: this.analytics, + commands: this._environment.commands, + tasks: this._environment.tasks, + project: this._environment.project, + settings: this._environment.settings, + testing: this.testing, + cli: this, + }); + + return command; + } + /** * @private * @method run - * @param environment + * @param {Promise<object>} environmentPromiseHash * @return {Promise} */ - run(environment) { + async run(environmentPromiseHash) { + if (environmentPromiseHash === undefined) { + return Promise.reject(new Error('Unable to execute "run" command without environment argument')); + } let shutdownOnExit = null; - return RSVP.hash(environment).then(environment => { + let environment = (this._environment = await hash(environmentPromiseHash)); + + try { let args = environment.cliArgs.slice(); let commandName = args.shift(); let commandArgs = args; @@ -175,35 +223,11 @@

    lib/cli/cli.js

    let commandLookupCreationToken = heimdall.start('lookup-command'); - let CurrentCommand = lookupCommand(environment.commands, commandName, commandArgs, { - project: environment.project, - ui: this.ui, - }); - - - /* - * XXX Need to decide what to do here about showing errors. For - * a non-CLI project the cache is local and probably should. For - * a CLI project the cache is there, but not sure when we'll know - * about all the errors, because there may be multiple projects. - * if (this.packageInfoCache.hasErrors()) { - * this.packageInfoCache.showErrors(); - * } - */ - let command = new CurrentCommand({ - ui: this.ui, - analytics: this.analytics, - commands: environment.commands, - tasks: environment.tasks, - project: environment.project, - settings: environment.settings, - testing: this.testing, - cli: this, - }); + let command = this.maybeMakeCommand(commandName, commandArgs); commandLookupCreationToken.stop(); - getOptionArgs('--verbose', commandArgs).forEach(arg => { + getOptionArgs('--verbose', commandArgs).forEach((arg) => { process.env[`EMBER_VERBOSE_${arg.toUpperCase()}`] = 'true'; }); @@ -211,8 +235,9 @@

    lib/cli/cli.js

    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.'; + 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) { @@ -220,7 +245,9 @@

    lib/cli/cli.js

    } if (!platform.isTested) { - this.ui.writeWarnLine(`Node ${process.version} is not tested against Ember CLI on your platform.${recommendation}`); + this.ui.writeWarnLine( + `Node ${process.version} is not tested against Ember CLI on your platform.${recommendation}` + ); } } @@ -240,76 +267,86 @@

    lib/cli/cli.js

    let instrumentation = this.instrumentation; let onCommandInterrupt; - let runPromise = Promise.resolve().then(() => { - instrumentation.stopAndReport('init'); - instrumentation.start('command'); + let runPromise = Promise.resolve().then(async () => { + let resultOrExitCode; + + try { + instrumentation.stopAndReport('init'); - loggerTesting.info('cli: command.beforeRun'); - onProcessInterrupt.addHandler(onCommandInterrupt); + try { + instrumentation.start('command'); - return command.beforeRun(commandArgs); - }).then(() => { - loggerTesting.info('cli: command.validateAndRun'); + loggerTesting.info('cli: command.beforeRun'); + onProcessInterrupt.addHandler(onCommandInterrupt); - return command.validateAndRun(commandArgs); - }).then(result => { - instrumentation.stopAndReport('command', commandName, commandArgs); + await command.beforeRun(commandArgs); - onProcessInterrupt.removeHandler(onCommandInterrupt); + loggerTesting.info('cli: command.validateAndRun'); + + resultOrExitCode = await command.validateAndRun(commandArgs); + } finally { + instrumentation.stopAndReport('command', commandName, commandArgs); + + onProcessInterrupt.removeHandler(onCommandInterrupt); + } + } finally { + instrumentation.start('shutdown'); + shutdownOnExit = function () { + instrumentation.stopAndReport('shutdown'); + }; + } - return result; - }).finally(() => { - instrumentation.start('shutdown'); - shutdownOnExit = function() { - instrumentation.stopAndReport('shutdown'); - }; - }).then(result => { // if the help option was passed, call the help command - if (result === 'callHelp') { + if (resultOrExitCode === 'callHelp') { helpOptions = { environment, commandName, commandArgs, }; - return this.callHelp(helpOptions); + resultOrExitCode = await this.callHelp(helpOptions); } - return result; - }).then(exitCode => { + let exitCode = resultOrExitCode; + loggerTesting.info(`cli: command run complete. exitCode: ${exitCode}`); // TODO: fix this // Possibly this issue: https://github.com/joyent/node/issues/8329 // Wait to resolve promise when running on windows. // This ensures that stdout is flushed so acceptance tests get full output - return new Promise(resolve => { - if (process.platform === 'win32') { + if (process.platform === 'win32') { + return new Promise((resolve) => { setTimeout(resolve, 250, exitCode); - } else { - resolve(exitCode); - } - }); + }); + } else { + return exitCode; + } }); - onCommandInterrupt = () => - Promise.resolve(command.onInterrupt()) - .then(() => runPromise); + onCommandInterrupt = async () => { + await command.onInterrupt(); - return runPromise; - }).finally(() => { + return await runPromise; + }; + + return await runPromise; + } catch (error) { + this.logError(error); + return 1; + } finally { if (shutdownOnExit) { shutdownOnExit(); } - }).catch(this.logError.bind(this)); + } } /** - * @private - * @method callHelp - * @param options - * @return {Promise} - */ + * @private + * @method callHelp + * @param options + * @return {Promise} + */ callHelp(options) { let environment = options.environment; let commandName = options.commandName; diff --git a/api/files/lib_models_addon-info.js.html b/api/files/lib_models_addon-info.js.html index 4d3c6f7..96432b3 100644 --- a/api/files/lib_models_addon-info.js.html +++ b/api/files/lib_models_addon-info.js.html @@ -42,15 +42,19 @@

    Classes

  • Builder
  • CLI
  • Command
  • +
  • CommandGenerator
  • DefaultPackager
  • EmberAddon
  • EmberApp
  • +
  • HardwareInfo
  • HistorySupportAddon
  • Instrumentation
  • NodeModulesList
  • NpmTask
  • +
  • PackageCache
  • PackageInfo
  • PackageInfoCache
  • +
  • PrivateTestHelpers
  • Project
  • ServeFilesAddon
  • TestsServerAddon
  • @@ -65,7 +69,7 @@

    Classes

    - Version: 3.8.1--84707b2801 + Version: 3.21.2
    diff --git a/api/files/lib_models_addon.js.html b/api/files/lib_models_addon.js.html index 401f624..f1152ed 100644 --- a/api/files/lib_models_addon.js.html +++ b/api/files/lib_models_addon.js.html @@ -42,15 +42,19 @@

    Classes

  • Builder
  • CLI
  • Command
  • +
  • CommandGenerator
  • DefaultPackager
  • EmberAddon
  • EmberApp
  • +
  • HardwareInfo
  • HistorySupportAddon
  • Instrumentation
  • NodeModulesList
  • NpmTask
  • +
  • PackageCache
  • PackageInfo
  • PackageInfoCache
  • +
  • PrivateTestHelpers
  • Project
  • ServeFilesAddon
  • TestsServerAddon
  • @@ -65,7 +69,7 @@

    Classes

    - Version: 3.8.1--84707b2801 + Version: 3.21.2
    @@ -89,7 +93,6 @@

    lib/models/addon.js

    const logger = heimdallLogger('ember-cli:addon'); const treeCacheLogger = heimdallLogger('ember-cli:addon:tree-cache'); const cacheKeyLogger = heimdallLogger('ember-cli:addon:cache-key-for-tree'); -const { isExperimentEnabled } = require('../experiments'); const PackageInfoCache = require('../models/package-info-cache'); const p = require('ember-cli-preprocess-registry/preprocessors'); @@ -135,7 +138,6 @@

    lib/models/addon.js

    let DEFAULT_TREE_FOR_METHODS = { app: 'treeForApp', - src: 'treeForSrc', addon: 'treeForAddon', 'addon-styles': 'treeForAddonStyles', 'addon-templates': 'treeForAddonTemplates', @@ -150,12 +152,16 @@

    lib/models/addon.js

    let GLOBAL_TREE_FOR_METHOD_METHODS = ['treeFor', '_treeFor', 'treeGenerator']; let DEFAULT_TREE_FOR_METHOD_METHODS = { app: ['treeForApp'], - src: ['treeForSrc'], addon: [ - 'treeForAddon', 'treeForAddonStyles', 'treeForAddonTemplates', - 'compileAddon', 'processedAddonJsFiles', 'compileTemplates', - '_addonTemplateFiles', 'compileStyles', 'preprocessJs', - 'addonJsFiles', + 'treeForAddon', + 'treeForAddonStyles', + 'treeForAddonTemplates', + 'compileAddon', + 'processedAddonJsFiles', + 'compileTemplates', + '_addonTemplateFiles', + 'compileStyles', + 'preprocessJs', ], 'addon-styles': ['treeForAddonStyles'], 'addon-templates': ['treeForAddonTemplates'], @@ -364,7 +370,6 @@

    lib/models/addon.js

    this.treePaths = { app: 'app', - src: 'src', styles: 'app/styles', templates: 'app/templates', addon: 'addon', @@ -399,12 +404,7 @@

    lib/models/addon.js

    p.setupRegistry(this); - this._initDefaultBabelOptions(); - - if (isExperimentEnabled('DELAYED_TRANSPILATION')) { - this.registry.remove('template', 'ember-cli-htmlbars'); - } }, _initDefaultBabelOptions() { @@ -412,33 +412,14 @@

    lib/models/addon.js

    babel: this[BUILD_BABEL_OPTIONS_FOR_PREPROCESSORS](), }); - let defaultEmberCLIBabelOptions; - if (isExperimentEnabled('DELAYED_TRANSPILATION')) { - defaultEmberCLIBabelOptions = { - compileModules: false, - disablePresetEnv: true, - disableDebugTooling: true, - disableEmberModulesAPIPolyfill: true, - }; - } else { - defaultEmberCLIBabelOptions = { - compileModules: true, - }; - } + let defaultEmberCLIBabelOptions = { + compileModules: true, + }; let emberCLIBabelConfigKey = this._emberCLIBabelConfigKey(); - this.__originalOptions[emberCLIBabelConfigKey] = - this.options[emberCLIBabelConfigKey] = - defaultsDeep(this.options[emberCLIBabelConfigKey], defaultEmberCLIBabelOptions); - }, - - /** - Returns whether this is using a module unification format. - @private - @method isModuleUnification - @return {Boolean} Whether this is using a module unification format. - */ - isModuleUnification() { - return false; + this.__originalOptions[emberCLIBabelConfigKey] = this.options[emberCLIBabelConfigKey] = defaultsDeep( + this.options[emberCLIBabelConfigKey], + defaultEmberCLIBabelOptions + ); }, /** @@ -462,7 +443,7 @@

    lib/models/addon.js

    * @method findOwnAddonByName */ findOwnAddonByName(name) { - return this.addons.find(addon => addon.name === name); + return this.addons.find((addon) => addon.name === name); }, /** @@ -474,7 +455,7 @@

    lib/models/addon.js

    */ hintingEnabled() { let isProduction = process.env.EMBER_ENV === 'production'; - let testsEnabledDefault = process.env.EMBER_CLI_TEST_COMMAND || !isProduction; + let testsEnabledDefault = process.env.EMBER_CLI_TEST_COMMAND === 'true' || !isProduction; let explicitlyDisabled = this.app && this.app.options && this.app.options.hinting === false; return testsEnabledDefault && !explicitlyDisabled; @@ -506,7 +487,7 @@

    lib/models/addon.js

    @return {Boolean} */ isDevelopingAddon() { - if (process.env.EMBER_ADDON_ENV === 'development' && (this.parent instanceof Project)) { + if (process.env.EMBER_ADDON_ENV === 'development' && this.parent instanceof Project) { const parentName = this.parent.name(); // If the name in package.json and index.js match, we're definitely developing if (parentName === this.name) { @@ -519,10 +500,11 @@

    lib/models/addon.js

    let pathToDisplay = process.cwd() === this.root ? process.cwd() : path.relative(process.cwd(), this.root); throw new SilentError( - '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 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.' + ); } return true; @@ -548,9 +530,10 @@

    lib/models/addon.js

    if (pkgInfo) { let addonPackageList = pkgInfo.discoverAddonAddons(); - this.addonPackages = - pkgInfo.generateAddonPackages(addonPackageList, - addonInfo => (this.shouldIncludeChildAddon && !this.shouldIncludeChildAddon(addonInfo))); + this.addonPackages = pkgInfo.generateAddonPackages( + addonPackageList, + (addonInfo) => this.shouldIncludeChildAddon && !this.shouldIncludeChildAddon(addonInfo) + ); // in case any child addons are invalid, dump to the console about them. pkgInfo.dumpInvalidAddonPackages(addonPackageList); @@ -574,7 +557,7 @@

    lib/models/addon.js

    this.discoverAddons(); this.addons = instantiateAddons(this, this.project, this.addonPackages); - this.addons.forEach(addon => logger.info('addon: %s', addon.name)); + this.addons.forEach((addon) => logger.info('addon: %s', addon.name)); }, /** @@ -594,7 +577,9 @@

    lib/models/addon.js

    let method = addon[methodName]; if (method) { let val = method.apply(addon, invokeArguments); - if (val) { sum.push(val); } + if (val) { + sum.push(val); + } } return sum; }, []); @@ -617,7 +602,9 @@

    lib/models/addon.js

    let method = addon[methodName]; if (method) { let val = method.apply(addon, invokeArguments); - if (val) { sum.push(val); } + if (val) { + sum.push(val); + } } return sum; }, []); @@ -642,11 +629,12 @@

    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.`); + this._warn( + `Addon: \`${this.name}\` is missing addon.project, this may be the result of an addon forgetting to invoke \`super\` in its init.` + ); } // TODO: fix law of demeter `_watchmanInfo.canNestRoots` is obviously a poor idea - if ((this.project && this.project._watchmanInfo.canNestRoots) || - this.isDevelopingAddon()) { + if ((this.project && this.project._watchmanInfo.canNestRoots) || this.isDevelopingAddon()) { const WatchedDir = require('broccoli-source').WatchedDir; tree = new WatchedDir(dir); } else { @@ -786,7 +774,7 @@

    lib/models/addon.js

    let cacheKeyStats = heimdall.statsFor('cache-key-for-tree'); // determine if treeFor* (or other methods for tree type) overrides for the given tree - let modifiedMethods = methodsToValidate.filter(methodName => this[methodName] !== addonProto[methodName]); + let modifiedMethods = methodsToValidate.filter((methodName) => this[methodName] !== addonProto[methodName]); if (modifiedMethods.length) { cacheKeyStats.modifiedMethods++; @@ -892,26 +880,6 @@

    lib/models/addon.js

    @return {Tree} App file tree */ treeForApp(tree) { - if (!isExperimentEnabled('MODULE_UNIFICATION')) { - return tree; - } else if (this.project.isModuleUnification() && this.isModuleUnification()) { - return null; - } - - let srcTreePath = path.resolve(this.root, this.treePaths.src); - - if (fs.existsSync(srcTreePath)) { - const MUReexporter = require('broccoli-module-unification-reexporter'); - - let srcTree = this.treeGenerator(srcTreePath); - - let reexportedOutput = new MUReexporter(srcTree, { - namespace: this.name, - }); - - return reexportedOutput; - } - return tree; }, @@ -927,39 +895,6 @@

    lib/models/addon.js

    return tree; }, - /** - @private - @method treeForSrc - @return - */ - treeForSrc(rawSrcTree) { - if (!isExperimentEnabled('MODULE_UNIFICATION')) { - return null; - } - if (!rawSrcTree) { return null; } - - let srcNamespacedTree = new Funnel(rawSrcTree, { - destDir: `${this.name}/src`, - annotation: `Addon#treeForSrc(${this.name}) namespace`, - }); - - let srcAfterPreprocessTreeHook = this._addonPreprocessTree('src', srcNamespacedTree); - - let srcAfterTemplatePreprocessing = srcAfterPreprocessTreeHook; - if (!isExperimentEnabled('DELAYED_TRANSPILATION') || registryHasPreprocessor(this.registry, 'template')) { - srcAfterTemplatePreprocessing = preprocessTemplates(srcAfterPreprocessTreeHook, { - registry: this.registry, - annotation: `Addon#treeForSrc(${this.name})`, - }); - } - - let srcAfterJsPreprocessing = preprocessJs(srcAfterTemplatePreprocessing, '/', this.name, { - registry: this.registry, - }); - - return this._addonPostprocessTree('src', srcAfterJsPreprocessing); - }, - /** Returns the tree for this addon's templates @@ -1003,9 +938,7 @@

    lib/models/addon.js

    let addonTree = this.compileAddon(tree); let stylesTree = this.compileStyles(this._treeFor('addon-styles')); - return mergeTrees([addonTree, stylesTree], { - annotation: `Addon#treeForAddon(${this.name})`, - }); + return mergeTrees([addonTree, stylesTree], { annotation: `Addon#treeForAddon(${this.name})` }); }, /** @@ -1095,10 +1028,12 @@

    lib/models/addon.js

    registry: this.registry, }); } 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\`.`); + 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})`); } @@ -1117,9 +1052,12 @@

    lib/models/addon.js

    let preprocessedStylesTree = this._addonPreprocessTree('css', addonStylesTree); let processedStylesTree = preprocessCss(preprocessedStylesTree, '/', '/', { - outputPaths: { 'addon': `${this.name}.css` }, + outputPaths: { addon: `${this.name}.css` }, registry: this.registry, }); + processedStylesTree = new Funnel(processedStylesTree, { + destDir: `${this.name}/__COMPILED_STYLES__`, + }); return this._addonPostprocessTree('css', processedStylesTree); } @@ -1166,9 +1104,10 @@

    lib/models/addon.js

    let files = this._getAddonTreeFiles(); - let addonTemplatesRelativeToAddonPath = addonTemplatesTreeInAddonTree && addonTemplatesTreePath.replace(`${addonTreePath}/`, ''); + let addonTemplatesRelativeToAddonPath = + addonTemplatesTreeInAddonTree && addonTemplatesTreePath.replace(`${addonTreePath}/`, ''); let podTemplateMatcher = new RegExp(`template.(${templateExtensions.join('|')})$`); - let hasPodTemplates = files.some(file => { + let hasPodTemplates = files.some((file) => { // short circuit if this is actually a `addon/templates` file if (addonTemplatesTreeInAddonTree && file.indexOf(addonTemplatesRelativeToAddonPath) === 0) { return false; @@ -1178,14 +1117,14 @@

    lib/models/addon.js

    }); let jsMatcher = new RegExp(`(${jsExtensions.join('|')})$`); - let hasJSFiles = files.some(file => jsMatcher.test(file)); + let hasJSFiles = files.some((file) => jsMatcher.test(file)); if (!addonTemplatesTreeInAddonTree) { files = files.concat(this._getAddonTemplatesTreeFiles()); } let extensionMatcher = new RegExp(`(${templateExtensions.join('|')})$`); - let hasTemplates = files.some(file => extensionMatcher.test(file)); + let hasTemplates = files.some((file) => extensionMatcher.test(file)); this._cachedFileSystemInfo = { hasJSFiles, @@ -1228,7 +1167,7 @@

    lib/models/addon.js

    if (addonTemplates) { standardTemplates = new Funnel(addonTemplates, { srcDir: '/', - destDir: `${this.name}/templates`, + destDir: `${this.moduleName()}/templates`, annotation: `Addon#_addonTemplateFiles (${this.name})`, }); @@ -1236,12 +1175,13 @@

    lib/models/addon.js

    } if (this._shouldCompilePodTemplates()) { - let includePatterns = this.registry.extensionsForType('template') - .map(extension => `**/*/template.${extension}`); + let includePatterns = this.registry + .extensionsForType('template') + .map((extension) => `**/*/template.${extension}`); let podTemplates = new Funnel(addonTree, { include: includePatterns, - destDir: `${this.name}/`, + destDir: `${this.moduleName()}/`, annotation: 'Funnel: Addon Pod Templates', }); @@ -1265,27 +1205,26 @@

    lib/models/addon.js

    */ compileTemplates(addonTree) { if (this.shouldCompileTemplates()) { - if (!isExperimentEnabled('DELAYED_TRANSPILATION') && !registryHasPreprocessor(this.registry, 'template')) { - throw new SilentError(`Addon templates were detected, but there are no template compilers registered for \`${this.name}\`. ` + - `Please make sure your template precompiler (commonly \`ember-cli-htmlbars\`) is listed in \`dependencies\` ` + - `(NOT \`devDependencies\`) in \`${this.name}\`'s \`package.json\`.`); + if (!registryHasPreprocessor(this.registry, 'template')) { + throw new SilentError( + `Addon templates were detected, but there are no template compilers registered for \`${this.name}\`. ` + + `Please make sure your template precompiler (commonly \`ember-cli-htmlbars\`) is listed in \`dependencies\` ` + + `(NOT \`devDependencies\`) in \`${this.name}\`'s \`package.json\`.` + ); } - let preprocessedTemplateTree = this._addonPreprocessTree('template', this._addonTemplateFiles(addonTree)); + let preprocessedTemplateTree = this._addonPreprocessTree('template', addonTree); - let processedTemplateTree; - if (!isExperimentEnabled('DELAYED_TRANSPILATION') || registryHasPreprocessor(this.registry, 'template')) { - processedTemplateTree = preprocessTemplates(preprocessedTemplateTree, { - annotation: `compileTemplates(${this.name})`, - registry: this.registry, - }); - } else { - processedTemplateTree = preprocessedTemplateTree; - } + let processedTemplateTree = preprocessTemplates(preprocessedTemplateTree, { + annotation: `compileTemplates(${this.name})`, + registry: this.registry, + }); let postprocessedTemplateTree = this._addonPostprocessTree('template', processedTemplateTree); - return processModulesOnly(postprocessedTemplateTree, 'Babel: Modules for Templates'); + return postprocessedTemplateTree; + } else { + return addonTree; } }, @@ -1301,9 +1240,9 @@

    lib/models/addon.js

    if (!this.options) { this._warn( `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.` + `\`${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.` ); this.options = {}; @@ -1312,9 +1251,9 @@

    lib/models/addon.js

    if (!this.options.babel) { this._warn( `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. ` + + `Falling back to default babel configuration options.` ); this.options.babel = this.__originalOptions.babel; @@ -1324,23 +1263,23 @@

    lib/models/addon.js

    if (!this.options[emberCLIBabelConfigKey]) { this._warn( `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.${emberCLIBabelConfigKey}\` ` + + `options which conflicts with the addons ability to transpile its \`addon/\` files properly. ` + + `Falling back to default babel configuration options.` ); this.options[emberCLIBabelConfigKey] = this.__originalOptions[emberCLIBabelConfigKey]; } - let addonJs = this.processedAddonJsFiles(tree); - let templatesTree = this.compileTemplates(tree); + let scopedInput = new Funnel(tree, { + destDir: this.moduleName(), + annotation: `Funnel: ${this.name}/addon`, + }); - let trees = [addonJs, templatesTree].filter(Boolean); + let treeWithCompiledTemplates = this.compileTemplates(scopedInput); + let final = this.processedAddonJsFiles(treeWithCompiledTemplates); - return mergeTrees(trees, { - overwrite: true, - annotation: `Addon#compileAddon(${this.name})`, - }); + return final; }, /** @@ -1355,8 +1294,8 @@

    lib/models/addon.js

    let addonPath = this._treePathFor('addon'); if (fs.existsSync(addonPath)) { - let addonJs = new Funnel(this.addonJsFiles(addonPath), { - srcDir: this.moduleName(), + let addonJs = new Funnel(addonPath, { + exclude: ['templates/**/*'], destDir: 'addon', allowEmpty: true, }); @@ -1375,7 +1314,10 @@

    lib/models/addon.js

    let addonTestSupportPath = this._treePathFor('addon-test-support'); if (fs.existsSync(addonTestSupportPath)) { let addonTestSupportTree = new Funnel(addonTestSupportPath, { destDir: 'addon-test-support' }); - let lintAddonTestSupportJsTrees = this._eachProjectAddonInvoke('lintTree', ['addon-test-support', addonTestSupportTree]); + let lintAddonTestSupportJsTrees = this._eachProjectAddonInvoke('lintTree', [ + 'addon-test-support', + addonTestSupportTree, + ]); trees = trees.concat(lintAddonTestSupportJsTrees); } @@ -1410,21 +1352,19 @@

    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) { - let includePatterns = this.registry.extensionsForType('js') - .map(extension => new RegExp(`${extension}$`)); + this._warn(`Addon.prototype.addonJsFiles is deprecated`); return new Funnel(tree, { - include: includePatterns, destDir: this.moduleName(), annotation: 'Funnel: Addon JS', }); }, - /** Preprocesses a javascript tree. @@ -1444,8 +1384,8 @@

    lib/models/addon.js

    @param {Tree} the tree to preprocess @return {Tree} Processed javascript file tree */ - processedAddonJsFiles(addonTree) { - let preprocessedAddonJS = this._addonPreprocessTree('js', this.addonJsFiles(addonTree)); + processedAddonJsFiles(inputTree) { + let preprocessedAddonJS = this._addonPreprocessTree('js', inputTree); let processedAddonJS = this.preprocessJs(preprocessedAddonJS, '/', this.name, { annotation: `processedAddonJsFiles(${this.name})`, @@ -1455,10 +1395,12 @@

    lib/models/addon.js

    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\`.`); + 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, @@ -1478,7 +1420,7 @@

    lib/models/addon.js

    */ moduleName() { if (!this.modulePrefix) { - this.modulePrefix = (this.modulePrefix || this.name).toLowerCase().replace(/\s/g, '-'); + this.modulePrefix = this.name.toLowerCase().replace(/\s/g, '-'); } return this.modulePrefix; @@ -1617,9 +1559,8 @@

    lib/models/addon.js

    ``` */ - /** - Allows addons to define a custom transfrom function that other addons and app can use when using `app.import`. + Allows addons to define a custom transform function that other addons and app can use when using `app.import`. This function is not implemented by default @@ -1671,18 +1612,17 @@

    lib/models/addon.js

    @public @method preprocessTree - @param {String} type What kind of tree (eg. 'js', 'css', 'src', 'template') + @param {String} type What kind of tree (eg. 'js', 'css', 'template') @param {Tree} tree Tree to process @return {Tree} Processed tree */ - /** Post-process a tree @public @method postprocessTree - @param {String} type What kind of tree (eg. 'js', 'css', 'src', 'template') + @param {String} type What kind of tree (eg. 'js', 'css', 'template') @param {Tree} tree Tree to process @return {Tree} Processed tree @@ -1690,7 +1630,6 @@

    lib/models/addon.js

    - [broccoli-asset-rev](https://github.com/rickharrison/broccoli-asset-rev/blob/c82c3580855554a31f7d6600b866aecf69cdaa6d/index.js#L29) */ - /** This hook allows you to make changes to the express server run by ember-cli. @@ -1730,7 +1669,6 @@

    lib/models/addon.js

    - [history-support-addon](https://github.com/ember-cli/ember-cli/blob/v2.4.3/lib/tasks/server/middleware/history-support/index.js#L25) */ - /** This hook allows you to make changes to the express server run by testem. @@ -1746,7 +1684,6 @@

    lib/models/addon.js

    @param {Object} app the express app instance */ - /** This hook is called before a build takes place. @@ -1755,7 +1692,6 @@

    lib/models/addon.js

    @param {Object} result Build object */ - /** This hook is called after a build is complete. @@ -1772,7 +1708,6 @@

    lib/models/addon.js

    @param {Object} result Build result object */ - /** This hook is called after the build has been processed and the build files have been copied to the output directory @@ -1790,7 +1725,6 @@

    lib/models/addon.js

    This allows our ruby gem to block incoming requests until after the build happens reliably. */ - /** This hook is called when an error occurs during the preBuild, postBuild or outputReady hooks for addons, or when the build fails @@ -1807,7 +1741,6 @@

    lib/models/addon.js

    - [ember-cli-rails-addon](https://github.com/rondale-sc/ember-cli-rails-addon/blob/v0.7.0/index.js#L11) */ - /** 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) and [ember-cli-coffeescript](https://github.com/kimroen/ember-cli-coffeescript) to add a `template` or `js` preprocessor to the registry. @@ -1850,7 +1783,6 @@

    lib/models/addon.js

    ``` */ - /** Return value is merged into the **tests** tree. This lets you inject linter output as test results. @@ -1870,7 +1802,6 @@

    lib/models/addon.js

    - [ember-cli-mocha](https://github.com/ef4/ember-cli-mocha/blob/66803037fe203b24e96dea83a2bd91de48b842e1/index.js#L101) */ - /** Allow addons to implement contentFor method to add string output into the associated `{{content-for 'foo'}}` section in `index.html` @@ -1896,7 +1827,7 @@

    lib/models/addon.js

    let Addon = CoreObject.extend(addonProto); -Addon.prototype[BUILD_BABEL_OPTIONS_FOR_PREPROCESSORS] = function() { +Addon.prototype[BUILD_BABEL_OPTIONS_FOR_PREPROCESSORS] = function () { let emberCLIBabelInstance = findAddonByName(this.addons, 'ember-cli-babel'); let version; if (emberCLIBabelInstance) { diff --git a/api/files/lib_models_blueprint.js.html b/api/files/lib_models_blueprint.js.html index 7886fc1..5e18238 100644 --- a/api/files/lib_models_blueprint.js.html +++ b/api/files/lib_models_blueprint.js.html @@ -42,15 +42,19 @@

    Classes

  • Builder
  • CLI
  • Command
  • +
  • CommandGenerator
  • DefaultPackager
  • EmberAddon
  • EmberApp
  • +
  • HardwareInfo
  • HistorySupportAddon
  • Instrumentation
  • NodeModulesList
  • NpmTask
  • +
  • PackageCache
  • PackageInfo
  • PackageInfoCache
  • +
  • PrivateTestHelpers
  • Project
  • ServeFilesAddon
  • TestsServerAddon
  • @@ -65,7 +69,7 @@

    Classes

    - Version: 3.8.1--84707b2801 + Version: 3.21.2
    @@ -82,7 +86,6 @@

    lib/models/blueprint.js

    @module ember-cli */ const FileInfo = require('./file-info'); -const RSVP = require('rsvp'); const chalk = require('chalk'); const MarkdownColor = require('../utilities/markdown-color'); const sequence = require('../utilities/sequence'); @@ -104,13 +107,7 @@

    lib/models/blueprint.js

    const normalizeEntityName = require('ember-cli-normalize-entity-name'); const isAddon = require('../utilities/is-addon'); -const Promise = RSVP.Promise; -const stat = RSVP.denodeify(fs.stat); -const writeFile = RSVP.denodeify(fs.outputFile); - -const initialIgnoredFiles = [ - '.DS_Store', -]; +const initialIgnoredFiles = ['.DS_Store']; /** A blueprint is a bundle of template files with optional install @@ -247,7 +244,7 @@

    lib/models/blueprint.js

    ### beforeInstall & beforeUninstall Called before any of the template files are processed and receives - the the `options` and `locals` hashes as parameters. Typically used for + the `options` and `locals` hashes as parameters. Typically used for validating any additional command line options or for any asynchronous setup that is needed. As an example, the `controller` blueprint validates its `--type` option in this hook. If you need to run any asynchronous code, @@ -278,13 +275,7 @@

    lib/models/blueprint.js

    availableOptions: [], anonymousOptions: ['name'], - _printableProperties: [ - 'name', - 'description', - 'availableOptions', - 'anonymousOptions', - 'overridden', - ], + _printableProperties: ['name', 'description', 'availableOptions', 'anonymousOptions', 'overridden'], init(blueprintPath) { this._super(); @@ -318,7 +309,9 @@

    lib/models/blueprint.js

    @return {Array} Contents of the blueprint's files directory */ files() { - if (this._files) { return this._files; } + if (this._files) { + return this._files; + } let filesPath = this.filesPath(this.options); if (Blueprint._existsSync(filesPath)) { @@ -379,9 +372,9 @@

    lib/models/blueprint.js

    @param {Object} info @return {Promise} */ - _writeFile(info) { + async _writeFile(info) { if (!this.dryRun) { - return writeFile(info.outputPath, info.render()); + return fs.outputFile(info.outputPath, await info.render()); } }, @@ -448,9 +441,13 @@

    lib/models/blueprint.js

    */ _checkForPod(verbose) { if (!this.hasPathToken && this.pod && verbose) { - this.ui.writeLine(chalk.yellow('You specified the pod flag, but this' + - ' blueprint does not support pod structure. It will be generated with' + - ' the default structure.')); + this.ui.writeLine( + chalk.yellow( + 'You specified the pod flag, but this' + + ' blueprint does not support pod structure. It will be generated with' + + ' the default structure.' + ) + ); } }, @@ -477,15 +474,19 @@

    lib/models/blueprint.js

    addon = findAddonByName(this.project, options.inRepoAddon); if (!addon) { - throw new SilentError(`You specified the 'in-repo-addon' flag, but the ` + - `in-repo-addon '${options.inRepoAddon}' does not exist. Please check the name and try again.`); + throw new SilentError( + `You specified the 'in-repo-addon' flag, but the ` + + `in-repo-addon '${options.inRepoAddon}' does not exist. Please check the name and try again.` + ); } } if (options.in) { if (!ensureTargetDirIsAddon(options.in)) { - throw new SilentError(`You specified the 'in' flag, but the ` + - `in repo addon '${options.in}' does not exist. Please check the name and try again.`); + throw new SilentError( + `You specified the 'in' flag, but the ` + + `in repo addon '${options.in}' does not exist. Please check the name and try again.` + ); } } }, @@ -498,15 +499,22 @@

    lib/models/blueprint.js

    @param {Function} process @param {Function} afterHook */ - _process(options, beforeHook, process, afterHook) { + async _process(options, beforeHook, process, afterHook) { let intoDir = options.target; - return this._locals(options) - .then(locals => Promise.resolve() - .then(beforeHook.bind(this, options, locals)) - .then(process.bind(this, intoDir, locals)) - .then(promises => RSVP.map(promises, this._commit.bind(this))) - .then(afterHook.bind(this, options))); + let locals = await this._locals(options); + + // run beforeInstall/beforeUninstall userland hooks + await beforeHook.call(this, options, locals); + + // gather fileInfos to be processed + 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))); + + // run afterInstall/afterUninstall userland hooks + await afterHook.call(this, options); }, /** @@ -515,8 +523,8 @@

    lib/models/blueprint.js

    @return {Promise} */ install(options) { - let ui = this.ui = options.ui; - let dryRun = this.dryRun = options.dryRun; + let ui = (this.ui = options.ui); + let dryRun = (this.dryRun = options.dryRun); this.project = options.project; this.pod = options.pod; this.options = options; @@ -525,8 +533,7 @@

    lib/models/blueprint.js

    ui.writeLine(`installing ${this.name}`); if (dryRun) { - ui.writeLine(chalk.yellow('You specified the dry-run flag, so no' + - ' changes will be written.')); + ui.writeLine(chalk.yellow('You specified the dry-run flag, so no' + ' changes will be written.')); } this._normalizeEntityName(options.entity); @@ -535,8 +542,9 @@

    lib/models/blueprint.js

    logger.info('START: processing blueprint: `%s`', this.name); let start = new Date(); - return this._process(options, this.beforeInstall, this.processFiles, this.afterInstall) - .finally(() => logger.info('END: processing blueprint: `%s` in (%dms)', this.name, new Date() - start)); + return this._process(options, this.beforeInstall, this.processFiles, this.afterInstall).finally(() => + logger.info('END: processing blueprint: `%s` in (%dms)', this.name, new Date() - start) + ); }, /** @@ -545,8 +553,8 @@

    lib/models/blueprint.js

    @return {Promise} */ uninstall(options) { - let ui = this.ui = options.ui; - let dryRun = this.dryRun = options.dryRun; + let ui = (this.ui = options.ui); + let dryRun = (this.dryRun = options.dryRun); this.project = options.project; this.pod = options.pod; this.options = options; @@ -555,18 +563,13 @@

    lib/models/blueprint.js

    ui.writeLine(`uninstalling ${this.name}`); if (dryRun) { - ui.writeLine(chalk.yellow('You specified the dry-run flag, so no' + - ' files will be deleted.')); + ui.writeLine(chalk.yellow('You specified the dry-run flag, so no' + ' files will be deleted.')); } this._normalizeEntityName(options.entity); this._checkForPod(options.verbose); - return this._process( - options, - this.beforeUninstall, - this.processFilesForUninstall, - this.afterUninstall); + return this._process(options, this.beforeUninstall, this.processFilesForUninstall, this.afterUninstall); }, /** @@ -605,7 +608,7 @@

    lib/models/blueprint.js

    When the following is called on the command line: ```sh - ember generate controller foo --type=array --dry-run + ember generate controller foo --type=array --dry-run isAdmin:true ``` The object passed to `locals` looks like this: @@ -615,10 +618,12 @@

    lib/models/blueprint.js

    entity: { name: 'foo', options: { - type: 'array' + isAdmin: true } }, dryRun: true + type: "array" + // more keys } ``` @@ -726,7 +731,7 @@

    lib/models/blueprint.js

    generateFileMap(fileMapVariables) { let tokens = this._fileMapTokens(fileMapVariables); let fileMapValues = _.values(tokens); - let tokenValues = fileMapValues.map(token => token(fileMapVariables)); + let tokenValues = fileMapValues.map((token) => token(fileMapVariables)); let tokenKeys = Object.keys(tokens); return _.zipObject(tokenKeys, tokenValues); }, @@ -808,8 +813,9 @@

    lib/models/blueprint.js

    */ _checkForNoMatch(fileInfos, rawArgs) { if (fileInfos.filter(isFilePath).length < 1 && rawArgs) { - this.ui.writeLine(chalk.yellow(`The globPattern "${rawArgs}" ` + - `did not match any files, so no file updates will be made.`)); + this.ui.writeLine( + chalk.yellow(`The globPattern "${rawArgs}" ` + `did not match any files, so no file updates will be made.`) + ); } }, @@ -817,6 +823,7 @@

    lib/models/blueprint.js

    @method processFiles @param {String} intoDir @param {Object} templateVariables + @return {Promise<FileInfo[]>} */ processFiles(intoDir, templateVariables) { let files = this._getFilesForInstall(templateVariables.targetFiles); @@ -829,10 +836,9 @@

    lib/models/blueprint.js

    fileInfosToRemove = finishProcessingForUninstall(fileInfosToRemove); - return RSVP.filter(fileInfos, isValidFile) - .then(promises => RSVP.map(promises, prepareConfirm)) + return Promise.all(fileInfos.filter(isValidFile).map(prepareConfirm)) .then(finishProcessingForInstall) - .then(fileInfos => fileInfos.concat(fileInfosToRemove)); + .then((fileInfos) => fileInfos.concat(fileInfosToRemove)); }, /** @@ -845,8 +851,7 @@

    lib/models/blueprint.js

    this._ignoreUpdateFiles(); - return RSVP.filter(fileInfos, isValidFile). - then(finishProcessingForUninstall); + return finishProcessingForUninstall(fileInfos.filter(isValidFile)); }, /** @@ -875,7 +880,7 @@

    lib/models/blueprint.js

    @return {Boolean} */ supportsAddon() { - return (/__root__/).test(this.files().join()); + return /__root__/.test(this.files().join()); }, /** @@ -919,9 +924,9 @@

    lib/models/blueprint.js

    let moduleName = (options.entity && options.entity.name) || packageName; let sanitizedModuleName = moduleName.replace(/\//g, '-'); - return new Promise(resolve => { + return new Promise((resolve) => { resolve(this.locals(options)); - }).then(customLocals => { + }).then((customLocals) => { let fileMapVariables = this._generateFileMapVariables(moduleName, customLocals, options); let fileMap = this.generateFileMap(fileMapVariables); let standardLocals = { @@ -987,7 +992,7 @@

    lib/models/blueprint.js

    */ addPackagesToProject(packages) { let task = this.taskFor('npm-install'); - let installText = (packages.length > 1) ? 'install packages' : 'install package'; + let installText = packages.length > 1 ? 'install packages' : 'install package'; let packageNames = []; let packageArray = []; @@ -1044,7 +1049,7 @@

    lib/models/blueprint.js

    */ removePackagesFromProject(packages) { let task = this.taskFor('npm-uninstall'); - let installText = (packages.length > 1) ? 'uninstall packages' : 'uninstall package'; + let installText = packages.length > 1 ? 'uninstall packages' : 'uninstall package'; let packageNames = []; let projectDependencies = this.project.dependencies(); @@ -1118,13 +1123,15 @@

    lib/models/blueprint.js

    */ addBowerPackagesToProject(packages, installOptions) { let task = this.taskFor('bower-install'); - let installText = (packages.length > 1) ? 'install bower packages' : 'install bower package'; + 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); + 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(', ')); @@ -1176,7 +1183,7 @@

    lib/models/blueprint.js

    let packages = options.packages; if (packages && packages.length) { - taskOptions.packages = packages.map(pkg => { + taskOptions.packages = packages.map((pkg) => { if (typeof pkg === 'string') { return pkg; } @@ -1195,7 +1202,7 @@

    lib/models/blueprint.js

    throw new SilentError('You must provide package to addAddonsToProject'); } - let installText = (packages.length > 1) ? 'install addons' : 'install addon'; + let installText = packages.length > 1 ? 'install addons' : 'install addon'; this._writeStatusToUI(chalk.green, installText, taskOptions['packages'].join(', ')); return this.taskFor('addon-install').run(taskOptions); @@ -1300,11 +1307,11 @@

    lib/models/blueprint.js

    getJson(verbose) { let json = {}; - this._printableProperties.forEach(key => { + this._printableProperties.forEach((key) => { let value = this[key]; if (key === 'availableOptions') { value = _.cloneDeep(value); - value.forEach(option => { + value.forEach((option) => { if (typeof option.type === 'function') { option.type = option.type.name; } @@ -1351,7 +1358,7 @@

    lib/models/blueprint.js

    matching Blueprint could not be found @return {Blueprint} */ -Blueprint.lookup = function(name, options) { +Blueprint.lookup = function (name, options) { options = options || {}; let lookupPaths = generateLookupPaths(options.paths); @@ -1378,7 +1385,7 @@

    lib/models/blueprint.js

    @param {String} blueprintPath @return {Blueprint} blueprint instance */ -Blueprint.load = function(blueprintPath) { +Blueprint.load = function (blueprintPath) { if (fs.lstatSync(blueprintPath).isDirectory()) { let Constructor = Blueprint; @@ -1405,13 +1412,13 @@

    lib/models/blueprint.js

    @param {Array} [options.paths] Extra paths to search for blueprints @return {Array} */ -Blueprint.list = function(options) { +Blueprint.list = function (options) { options = options || {}; let lookupPaths = generateLookupPaths(options.paths); let seen = []; - return lookupPaths.map(lookupPath => { + return lookupPaths.map((lookupPath) => { let source; let packagePath = path.join(lookupPath, '../package.json'); if (Blueprint._existsSync(packagePath)) { @@ -1420,7 +1427,7 @@

    lib/models/blueprint.js

    source = path.basename(path.join(lookupPath, '..')); } - let blueprints = dir(lookupPath).map(blueprintPath => { + let blueprints = dir(lookupPath).map((blueprintPath) => { let blueprint = Blueprint.load(blueprintPath); if (blueprint) { let name = blueprint.name; @@ -1438,11 +1445,11 @@

    lib/models/blueprint.js

    }); }; -Blueprint._existsSync = function(path, parent) { +Blueprint._existsSync = function (path, parent) { return fs.existsSync(path, parent); }; -Blueprint._readdirSync = function(path) { +Blueprint._readdirSync = function (path) { return fs.readdirSync(path); }; @@ -1458,7 +1465,7 @@

    lib/models/blueprint.js

    @property renamedFiles */ Blueprint.renamedFiles = { - 'gitignore': '.gitignore', + gitignore: '.gitignore', }; /** @@ -1471,20 +1478,14 @@

    lib/models/blueprint.js

    @static @property ignoredUpdateFiles */ -Blueprint.ignoredUpdateFiles = [ - '.gitkeep', - 'app.css', - 'LICENSE.md', -]; +Blueprint.ignoredUpdateFiles = ['.gitkeep', 'app.css', 'LICENSE.md']; /** @static @property defaultLookupPaths */ -Blueprint.defaultLookupPaths = function() { - return [ - path.resolve(__dirname, '..', '..', 'blueprints'), - ]; +Blueprint.defaultLookupPaths = function () { + return [path.resolve(__dirname, '..', '..', 'blueprints')]; }; /** @@ -1494,7 +1495,7 @@

    lib/models/blueprint.js

    @return {Promise} */ function prepareConfirm(info) { - return info.checkForConflict().then(resolution => { + return info.checkForConflict().then((resolution) => { info.resolution = resolution; return info; }); @@ -1534,16 +1535,6 @@

    lib/models/blueprint.js

    return collection; } -/** - @private - @method isFile - @param {FileInfo} info - @return {Promise} -*/ -function isFile(info) { - return stat(info.inputPath).then(it => it.isFile()); -} - /** @private @method isIgnored @@ -1553,7 +1544,7 @@

    lib/models/blueprint.js

    function isIgnored(info) { let fn = info.inputPath; - return Blueprint.ignoredFiles.some(ignoredFile => minimatch(fn, ignoredFile, { matchBase: true })); + return Blueprint.ignoredFiles.some((ignoredFile) => minimatch(fn, ignoredFile, { matchBase: true })); } /** @@ -1581,17 +1572,17 @@

    lib/models/blueprint.js

    @return {Boolean} */ function hasPathToken(files) { - return (/__path__/).test(files.join()); + return /__path__/.test(files.join()); } function findAddonByName(addonOrProject, name) { - let addon = addonOrProject.addons.find(addon => addon.name === name); + let addon = addonOrProject.addons.find((addon) => addon.name === name); if (addon) { return addon; } - return addonOrProject.addons.find(addon => findAddonByName(addon, name)); + return addonOrProject.addons.find((addon) => findAddonByName(addon, name)); } function ensureTargetDirIsAddon(addonPath) { @@ -1618,9 +1609,9 @@

    lib/models/blueprint.js

    */ function isValidFile(fileInfo) { if (isIgnored(fileInfo)) { - return Promise.resolve(false); + return false; } else { - return isFile(fileInfo); + return isFilePath(fileInfo); } } @@ -1641,7 +1632,7 @@

    lib/models/blueprint.js

    */ function dir(fullPath) { if (Blueprint._existsSync(fullPath)) { - return Blueprint._readdirSync(fullPath).map(fileName => path.join(fullPath, fileName)); + return Blueprint._readdirSync(fullPath).map((fileName) => path.join(fullPath, fileName)); } else { return []; } @@ -1666,7 +1657,7 @@

    lib/models/blueprint.js

    } function finishProcessingForUninstall(infos) { - let validInfos = infos.filter(info => fs.existsSync(info.outputPath)); + let validInfos = infos.filter((info) => fs.existsSync(info.outputPath)); validInfos.forEach(markToBeRemoved); return validInfos; diff --git a/api/files/lib_models_builder.js.html b/api/files/lib_models_builder.js.html index 2e2f959..3d4c56b 100644 --- a/api/files/lib_models_builder.js.html +++ b/api/files/lib_models_builder.js.html @@ -42,15 +42,19 @@

    Classes

  • Builder
  • CLI
  • Command
  • +
  • CommandGenerator
  • DefaultPackager
  • EmberAddon
  • EmberApp
  • +
  • HardwareInfo
  • HistorySupportAddon
  • Instrumentation
  • NodeModulesList
  • NpmTask
  • +
  • PackageCache
  • PackageInfo
  • PackageInfoCache
  • +
  • PrivateTestHelpers
  • Project
  • ServeFilesAddon
  • TestsServerAddon
  • @@ -65,7 +69,7 @@

    Classes

    - Version: 3.8.1--84707b2801 + Version: 3.21.2
    @@ -80,16 +84,14 @@

    lib/models/builder.js

    const onProcessInterrupt = require('../utilities/will-interrupt-process'); const fs = require('fs-extra'); const path = require('path'); -const Promise = require('rsvp').Promise; const CoreObject = require('core-object'); const SilentError = require('silent-error'); const chalk = require('chalk'); -const attemptNeverIndex = require('../utilities/attempt-never-index'); const findBuildFile = require('../utilities/find-build-file'); const _resetTreeCache = require('./addon')._resetTreeCache; const Sync = require('tree-sync'); const heimdall = require('heimdalljs'); -const { isExperimentEnabled } = require('../experiments'); +const progress = require('../utilities/heimdall-progress'); /** * Wrapper for the Broccoli [Builder](https://github.com/broccolijs/broccoli/blob/master/lib/builder.js) class. @@ -101,7 +103,6 @@

    lib/models/builder.js

    * @extends Task */ class Builder extends CoreObject { - constructor(options) { super(options); @@ -109,10 +110,10 @@

    lib/models/builder.js

    this.broccoliBuilderFallback = false; this.setupBroccoliBuilder(); - this._instantiationStack = (new Error()).stack.replace(/[^\n]*\n/, ''); + this._instantiationStack = new Error().stack.replace(/[^\n]*\n/, ''); this._cleanup = this.cleanup.bind(this); - this._cleanupPromise = null; + this._cleanupStarted = false; this._onProcessInterrupt = options.onProcessInterrupt || onProcessInterrupt; this._onProcessInterrupt.addHandler(this._cleanup); @@ -143,49 +144,32 @@

    lib/models/builder.js

    this.tree = this.readBuildFile(this.project.root); - let broccoli, options = {}; - if (isExperimentEnabled('BROCCOLI_2')) { - broccoli = require('broccoli'); - let tmpDir; - - // If not using system temp dir, compatability mode with broccoli-builder, tmp in root - if (!isExperimentEnabled('SYSTEM_TEMP')) { - tmpDir = `${this.project.root}/tmp`; - if (!fs.existsSync(tmpDir)) { - fs.mkdir(tmpDir); - } + let broccoli = require('broccoli'); + + try { + this.builder = new broccoli.Builder(this.tree); + return; + } catch (e) { + // Catch here to trap InvalidNodeError. If this is thrown, it's because the node provided is not valid + // and likely uses the old .read/.rebuild API, so fallback to broccoli-builder that supports that API + if ( + !(e instanceof broccoli.Builder.InvalidNodeError) || + e.message.indexOf('The .read/.rebuild API is no longer supported as of Broccoli 1.0') === -1 + ) { + throw e; } - options = { - tmpdir: tmpDir, - }; - - try { - this.builder = new broccoli.Builder(this.tree, options); - return; - } catch (e) { - // Catch here to trap InvalidNodeError. If this is thrown, it's because the node provided is not valid - // and likely uses the old .read/.rebuild API, so fallback to broccoli-builder that supports that API - if ( - !(e instanceof broccoli.Builder.InvalidNodeError) || - e.message.indexOf('The .read/.rebuild API is no longer supported as of Broccoli 1.0') === -1 - ) { - throw e; - } - // Fallback to broccoli-builder - let error = `Invalid Broccoli2 node detected, falling back to broccoli-builder. Broccoli error:\n`; - error += `---------------\n`; - error += e.message; - error += `---------------\n`; - this.ui.writeWarnLine(error); - } - } else if (isExperimentEnabled('SYSTEM_TEMP')) { - this.ui.writeWarnLine('EMBER_CLI_SYSTEM_TEMP only works in combination with EMBER_CLI_BROCCOLI_2'); + // Fallback to broccoli-builder + let error = `Invalid Broccoli2 node detected, falling back to broccoli-builder. Broccoli error:\n`; + error += `---------------\n`; + error += e.message; + error += `---------------\n`; + this.ui.writeWarnLine(error); } broccoli = require('broccoli-builder'); this.broccoliBuilderFallback = true; - this.builder = new broccoli.Builder(this.tree, options); + this.builder = new broccoli.Builder(this.tree); } /** @@ -231,22 +215,7 @@

    lib/models/builder.js

    let changes = sync.sync(); - return changes.map(op => op[1]); - } - - /** - * @private - * @method processBuildResult - * @param results - * @return {Promise} - */ - processBuildResult(results) { - return Promise.resolve() - .then(() => this.copyToOutputPath(results.directory)) - .then(syncResult => { - results.outputChanges = syncResult; - return results; - }); + return changes.map((op) => op[1]); } /** @@ -263,7 +232,9 @@

    lib/models/builder.js

    let method = addon[buildStep]; if (method) { let val = method.call(addon, results); - if (val) { sum.push(val); } + if (val) { + sum.push(val); + } } return sum; }, []); @@ -277,38 +248,68 @@

    lib/models/builder.js

    * @method build * @return {Promise} */ - build(addWatchDirCallback, resultAnnotation) { - this.project._instrumentation.start('build'); + async build(addWatchDirCallback, resultAnnotation) { + let buildResults, uiProgressIntervalID; - if (!isExperimentEnabled('SYSTEM_TEMP')) { - attemptNeverIndex('tmp'); - } + try { + this.project._instrumentation.start('build'); - if (addWatchDirCallback && !this.broccoliBuilderFallback) { - for (let path of this.builder.watchedPaths) { - addWatchDirCallback(path); + if (addWatchDirCallback && !this.broccoliBuilderFallback) { + for (let path of this.builder.watchedPaths) { + addWatchDirCallback(path); + } } - } - return this.processAddonBuildSteps('preBuild') - .then(() => this.builder.build(this.broccoliBuilderFallback ? addWatchDirCallback : null)) - .then(this.compatNode.bind(this), this.compatBroccoliPayload.bind(this)) - .then(this.processAddonBuildSteps.bind(this, 'postBuild')) - .then(this.processBuildResult.bind(this)) - .then(this.processAddonBuildSteps.bind(this, 'outputReady')) - .then(result => { - this.project._instrumentation.stopAndReport('build', result, resultAnnotation); - return result; - }, reason => { - this.project._instrumentation.stopAndReport('build', null, resultAnnotation); - throw reason; - }) - .then(this.checkForPostBuildEnvironmentIssues.bind(this)) - .catch(error => { - this.processAddonBuildSteps('buildError', error); - throw error; - }) - .finally(this.finalizeBuild.bind(this)); + this.ui.startProgress(progress.format(progress())); + + uiProgressIntervalID = setInterval(() => { + this.ui.spinner.text = progress.format(progress()); + }, this.ui.spinner.interval); + + await this.processAddonBuildSteps('preBuild'); + + if (this.broccoliBuilderFallback) { + try { + buildResults = await this.builder.build(addWatchDirCallback); + } catch (error) { + this.throwFormattedBroccoliError(error); + } + } else { + try { + await this.builder.build(); + + // build legacy style results object (this is passed to various addon APIs) + buildResults = { + directory: this.builder.outputPath, + graph: this.builder.outputNodeWrapper, + }; + } catch (error) { + this.throwFormattedBroccoliError(error); + } + } + + await this.processAddonBuildSteps('postBuild', buildResults); + + let outputChanges = await this.copyToOutputPath(buildResults.directory); + + await this.processAddonBuildSteps( + 'outputReady', + Object.assign({}, buildResults, { outputChanges, directory: this.outputPath }) + ); + + this.checkForPostBuildEnvironmentIssues(); + + return buildResults; + } catch (error) { + await this.processAddonBuildSteps('buildError', error); + + throw error; + } finally { + clearInterval(uiProgressIntervalID); + this.ui.stopProgress(); + this.project._instrumentation.stopAndReport('build', buildResults, resultAnnotation); + this.project.configCache.clear(); + } } /** @@ -318,8 +319,9 @@

    lib/models/builder.js

    * @method cleanup * @return {Promise} */ - cleanup() { - if (!this._cleanupPromise) { + async cleanup() { + if (!this._cleanupStarted) { + this._cleanupStarted = true; let ui = this.project.ui; ui.startProgress('cleaning up'); ui.writeLine('cleaning up...'); @@ -330,19 +332,16 @@

    lib/models/builder.js

    this._onProcessInterrupt.removeHandler(this._cleanup); let node = heimdall.start({ name: 'Builder Cleanup' }); - - this._cleanupPromise = Promise.resolve() - .then(() => this.builder.cleanup()) - .finally(() => { - ui.stopProgress(); - node.stop(); - }).catch(err => { - ui.writeLine(chalk.red('Cleanup error.')); - ui.writeError(err); - }); + try { + await this.builder.cleanup(); + } catch (error) { + ui.writeLine(chalk.red('Cleanup error.')); + ui.writeError(error); + } finally { + ui.stopProgress(); + node.stop(); + } } - - return this._cleanupPromise; } /** @@ -357,38 +356,15 @@

    lib/models/builder.js

    checkForPostBuildEnvironmentIssues(value) { // 0.1.3 and prior used a global heimdall instance to share sessions // newer versions keep the session itself on process - this.project.ui.writeDeprecateLine('Heimdalljs < 0.1.4 found. Please remove old versions of heimdalljs and reinstall (you can find them with `npm ls heimdalljs` as long as you have nothing `npm link`d). Performance instrumentation data will be incomplete until then.', !process._heimdall); + this.project.ui.writeDeprecateLine( + 'Heimdalljs < 0.1.4 found. Please remove old versions of heimdalljs and reinstall (you can find them with `npm ls heimdalljs` as long as you have nothing `npm link`d). Performance instrumentation data will be incomplete until then.', + !process._heimdall + ); return value; } - /** - * @private - * @method finalizeBuild - */ - finalizeBuild() { - this.project.configCache.clear(); - } - - /** - * broccoli-builder reformats the response into {directory, graph}, this method is a backwards - * compatible shim for broccoli 1.x - * @private - * @method compatNode - * @param node The node returned from Broccoli builder - */ - compatNode(node) { - if (!this.broccoliBuilderFallback) { - return { - directory: this.builder.outputPath, - graph: this.builder.outputNodeWrapper, - }; - } - - return node; - } - - compatBroccoliPayload(err) { + throwFormattedBroccoliError(err) { // TODO fix ember-cli/console-ui to handle current broccoli broccoliPayload let broccoliPayload = err && err.broccoliPayload; if (broccoliPayload) { diff --git a/api/files/lib_models_command.js.html b/api/files/lib_models_command.js.html index f68872d..c688350 100644 --- a/api/files/lib_models_command.js.html +++ b/api/files/lib_models_command.js.html @@ -42,15 +42,19 @@

    Classes

  • Builder
  • CLI
  • Command
  • +
  • CommandGenerator
  • DefaultPackager
  • EmberAddon
  • EmberApp
  • +
  • HardwareInfo
  • HistorySupportAddon
  • Instrumentation
  • NodeModulesList
  • NpmTask
  • +
  • PackageCache
  • PackageInfo
  • PackageInfoCache
  • +
  • PrivateTestHelpers
  • Project
  • ServeFilesAddon
  • TestsServerAddon
  • @@ -65,7 +69,7 @@

    Classes

    - Version: 3.8.1--84707b2801 + Version: 3.21.2
    @@ -85,7 +89,6 @@

    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 Promise = require('rsvp').Promise; const _ = require('ember-cli-lodash-subset'); const EOL = require('os').EOL; const CoreObject = require('core-object'); @@ -152,14 +155,7 @@

    lib/models/command.js

    */ works: 'insideProject', - _printableProperties: [ - 'name', - 'description', - 'aliases', - 'works', - 'availableOptions', - 'anonymousOptions', - ], + _printableProperties: ['name', 'description', 'aliases', 'works', 'availableOptions', 'anonymousOptions'], init() { this._super.apply(this, arguments); @@ -195,7 +191,9 @@

    lib/models/command.js

    // Works Property if (!allowedWorkOptions[this.works]) { - throw new Error(`The "${this.name}" command's works field has to be either "everywhere", "insideProject" or "outsideProject".`); + throw new Error( + `The "${this.name}" command's works field has to be either "everywhere", "insideProject" or "outsideProject".` + ); } /** @@ -318,8 +316,9 @@

    lib/models/command.js

    this._currentTask = task; - return Promise.resolve().then(() => task.run(options)) - .catch(error => { + return Promise.resolve() + .then(() => task.run(options)) + .catch((error) => { logger.info(`An error occurred running \`${name}\` from the \`${this.name}\` command.`, error.stack); throw error; @@ -335,9 +334,7 @@

    lib/models/command.js

    @method beforeRun @return {Promise|null} */ - beforeRun() { - - }, + beforeRun() {}, /** @method validateAndRun @@ -367,11 +364,19 @@

    lib/models/command.js

    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`'; } - throw new SilentError(`node_modules appears empty, you may need to run ${installInstuction}`); + throw new SilentError( + `Required packages are missing, run ${installInstuction} from this directory to install them.` + ); } } @@ -379,7 +384,7 @@

    lib/models/command.js

    ui: this.ui, childProcess: { execSync }, fs, - watchmanSupportsPlatform: (/^win/).test(process.platform), + watchmanSupportsPlatform: /^win/.test(process.platform), cache, root: this.project.root, }); @@ -422,14 +427,14 @@

    lib/models/command.js

    mergeDuplicateOption(key) { let duplicateOptions, mergedOption, mergedAliases; // get duplicates to merge - duplicateOptions = _.filter(this.availableOptions, { 'name': key }); + duplicateOptions = _.filter(this.availableOptions, { name: key }); if (duplicateOptions.length > 1) { // TODO: warn on duplicates and overwriting mergedAliases = []; - _.map(duplicateOptions, 'aliases').map(alias => { - alias.map(a => { + _.map(duplicateOptions, 'aliases').map((alias) => { + alias.map((a) => { mergedAliases.push(a); }); }); @@ -438,7 +443,7 @@

    lib/models/command.js

    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]]; } @@ -446,7 +451,7 @@

    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; @@ -490,7 +495,9 @@

    lib/models/command.js

    delete parsedOptions[option.name]; } } else { - this.ui.writeLine(`The specified command ${chalk.green(this.name)} requires the option ${chalk.green(option.name)}.`); + this.ui.writeLine( + `The specified command ${chalk.green(this.name)} requires the option ${chalk.green(option.name)}.` + ); } return isValid; }, @@ -553,8 +560,10 @@

    lib/models/command.js

    logger.error(e); } } - throw new Error(`The "${aliasValue}" [type:${aliasType}] alias is not an acceptable value. ` + - `It must be a string or single key object with a string value (for example, "value" or { "key" : "value" }).`); + throw new Error( + `The "${aliasValue}" [type:${aliasType}] alias is not an acceptable value. ` + + `It must be a string or single key object with a string value (for example, "value" or { "key" : "value" }).` + ); } return { @@ -593,9 +602,10 @@

    lib/models/command.js

    return true; } else { if (value[0] !== this.optionsAliases[key][0]) { - throw new SilentError(`The "${key}" alias is already in use by the "${this.optionsAliases[key][0]}" option ` + - `and cannot be used by the "${value[0]}" option. Please use a different alias.`); - + throw new SilentError( + `The "${key}" alias is already in use by the "${this.optionsAliases[key][0]}" option ` + + `and cannot be used by the "${value[0]}" option. Please use a different alias.` + ); } else if (value[1] !== this.optionsAliases[key][1]) { this.ui.writeLine(chalk.yellow(`The "${key}" alias cannot be overridden. Please use a different alias.`)); // delete offending alias from options @@ -623,22 +633,26 @@

    lib/models/command.js

    this.registerOptions(); - let assembleAndValidateOption = function(option) { + let assembleAndValidateOption = function (option) { return this.assignOption(option, parsedOptions, commandOptions); }; - let validateParsed = function(key) { + let validateParsed = function (key) { // ignore 'argv', 'h', and 'help' - if (!commandOptions.hasOwnProperty(key) && key !== 'argv' && key !== 'h' && key !== 'help') { - this.ui.writeLine(chalk.yellow(`The option '--${key}' is not registered with the '${this.name}' command. ` + - `Run \`ember ${this.name} --help\` for a list of supported options.`)); + if (!(key in commandOptions) && key !== 'argv' && key !== 'h' && key !== 'help') { + this.ui.writeLine( + chalk.yellow( + `The option '--${key}' is not registered with the '${this.name}' command. ` + + `Run \`ember ${this.name} --help\` for a list of supported options.` + ) + ); } if (typeof parsedOptions[key] !== 'object') { commandOptions[camelize(key)] = parsedOptions[key]; } }; - this.availableOptions.forEach(option => { + this.availableOptions.forEach((option) => { if (typeof option.type !== 'string') { knownOpts[option.name] = option.type; } else if (option.type === 'Path') { @@ -722,7 +736,7 @@

    lib/models/command.js

    let json = {}; this.registerOptions(options); - this._printableProperties.forEach(key => (json[key] = this[key])); + this._printableProperties.forEach((key) => (json[key] = this[key])); if (this.addAdditionalJsonForHelp) { this.addAdditionalJsonForHelp(json, options); @@ -758,7 +772,6 @@

    lib/models/command.js

    if (type === 'string') { return true; } else if (type === 'object') { - // no arrays, no multi-key objects if (!Array.isArray(alias) && Object.keys(alias).length === 1) { value = alias[Object.keys(alias)[0]]; @@ -767,7 +780,6 @@

    lib/models/command.js

    if (valueType === expectedType.name.toLowerCase()) { return true; } - } else if (expectedType.indexOf(value) > -1) { return true; } diff --git a/api/files/lib_models_hardware-info.js.html b/api/files/lib_models_hardware-info.js.html new file mode 100644 index 0000000..5373de9 --- /dev/null +++ b/api/files/lib_models_hardware-info.js.html @@ -0,0 +1,479 @@ + + + + + lib/models/hardware-info.js - ember-cli + + + + + + +
    +
    + + +
    +
    +

    lib/models/hardware-info.js

    +
    + +
    +'use strict';
    +
    +const execa = require('execa');
    +const fs = require('fs');
    +const logger = require('heimdalljs-logger')('ember-cli:hardware-info');
    +const os = require('os');
    +
    +function isUsingBatteryAcpi() {
    +  try {
    +    const { stdout } = execa.sync('acpi', ['--ac-adapter']);
    +    const lines = stdout.split('\n').filter(Boolean);
    +
    +    return lines.every((line) => /off-line/.test(line));
    +  } catch (ex) {
    +    logger.warn(`Could not get battery status from acpi: ${ex}`);
    +    logger.warn(ex.stack);
    +
    +    return null;
    +  }
    +}
    +
    +function isUsingBatteryApm() {
    +  try {
    +    const { stdout } = execa.sync('apm', ['-a']);
    +
    +    return parseInt(stdout, 10) === 0;
    +  } catch (ex) {
    +    logger.warn(`Could not get battery status from apm: ${ex}`);
    +    logger.warn(ex.stack);
    +
    +    return null;
    +  }
    +}
    +
    +function isUsingBatteryBsd() {
    +  const apm = isUsingBatteryApm();
    +
    +  if (apm !== null) {
    +    return apm;
    +  }
    +
    +  return isUsingBatteryUpower();
    +}
    +
    +function isUsingBatteryDarwin() {
    +  try {
    +    const { stdout } = execa.sync('pmset', ['-g', 'batt']);
    +
    +    return stdout.indexOf('Battery Power') !== -1;
    +  } catch (ex) {
    +    logger.warn(`Could not get battery status from pmset: ${ex}`);
    +    logger.warn(ex.stack);
    +
    +    return null;
    +  }
    +}
    +
    +function isUsingBatteryLinux() {
    +  const sysClassPowerSupply = isUsingBatterySysClassPowerSupply();
    +
    +  if (sysClassPowerSupply !== null) {
    +    return sysClassPowerSupply;
    +  }
    +
    +  const acpi = isUsingBatteryAcpi();
    +
    +  if (acpi !== null) {
    +    return acpi;
    +  }
    +
    +  return isUsingBatteryUpower();
    +}
    +
    +function isUsingBatterySysClassPowerSupply() {
    +  try {
    +    const value = fs.readFileSync('/sys/class/power_supply/AC/online');
    +
    +    return parseInt(value, 10) === 0;
    +  } catch (ex) {
    +    logger.warn(`Could not get battery status from /sys/class/power_supply: ${ex}`);
    +    logger.warn(ex.stack);
    +
    +    return null;
    +  }
    +}
    +
    +function isUsingBatteryUpower() {
    +  try {
    +    const { stdout } = execa.sync('upower', ['--enumerate']);
    +    const devices = stdout.split('\n').filter(Boolean);
    +
    +    return devices.some((device) => {
    +      const { stdout } = execa.sync('upower', ['--show-info', device]);
    +
    +      return /\bpower supply:\s+yes\b/.test(stdout) && /\bstate:\s+discharging\b/.test(stdout);
    +    });
    +  } catch (ex) {
    +    logger.warn(`Could not get battery status from upower: ${ex}`);
    +    logger.warn(ex.stack);
    +
    +    return null;
    +  }
    +}
    +
    +function isUsingBatteryWindows() {
    +  try {
    +    const { stdout } = execa.sync('wmic', [
    +      '/namespace:',
    +      '\\\\root\\WMI',
    +      'path',
    +      'BatteryStatus',
    +      'get',
    +      'PowerOnline',
    +      '/format:list',
    +    ]);
    +
    +    return /\bPowerOnline=FALSE\b/.test(stdout);
    +  } catch (ex) {
    +    logger.warn(`Could not get battery status from wmic: ${ex}`);
    +    logger.warn(ex.stack);
    +
    +    return null;
    +  }
    +}
    +
    +function memorySwapUsedDarwin() {
    +  try {
    +    const { stdout } = execa.sync('sysctl', ['vm.swapusage']);
    +    const match = /\bused = (\d+\.\d+)M\b/.exec(stdout);
    +
    +    if (!match) {
    +      throw new Error('vm.swapusage not in output.');
    +    }
    +
    +    // convert from fractional megabytes to bytes
    +    return parseFloat(match[1]) * 1048576;
    +  } catch (ex) {
    +    logger.warn(`Could not get swap status from sysctl: ${ex}`);
    +    logger.warn(ex.stack);
    +
    +    return null;
    +  }
    +}
    +
    +function memorySwapUsedBsd() {
    +  try {
    +    const { stdout } = execa.sync('pstat', ['-s']);
    +    const devices = stdout.split('\n').filter(Boolean);
    +    const header = devices.shift();
    +    const match = /^Device\s+(\d+)(K?)-blocks\s+Used\b/.exec(header);
    +
    +    if (!match) {
    +      throw new Error('Block size not found in output.');
    +    }
    +
    +    const blockSize = parseInt(match[1], 10) * (match[2] === 'K' ? 1024 : 1);
    +
    +    return devices.reduce((total, line) => {
    +      const match = /^\S+\s+\d+\s+(\d+)/.exec(line);
    +
    +      if (!match) {
    +        throw new Error(`Unrecognized line in output: '${line}'`);
    +      }
    +
    +      return total + parseInt(match[1], 10) * blockSize;
    +    }, 0);
    +  } catch (ex) {
    +    logger.warn(`Could not get swap status from pstat: ${ex}`);
    +    logger.warn(ex.stack);
    +
    +    return null;
    +  }
    +}
    +
    +function memorySwapUsedLinux() {
    +  try {
    +    const { stdout } = execa.sync('free', ['-b']);
    +    const lines = stdout.split('\n').filter(Boolean);
    +    const header = lines.shift();
    +    const columns = header.split(/\s+/).filter(Boolean);
    +    const columnUsed = columns.reduce((columnUsed, column, index) => {
    +      if (columnUsed !== undefined) {
    +        return columnUsed;
    +      }
    +
    +      if (/used/i.test(column)) {
    +        // there is no heading on the first column, so indices are off by 1
    +        return index + 1;
    +      }
    +    }, undefined);
    +
    +    if (columnUsed === undefined) {
    +      throw new Error('Could not find "used" column.');
    +    }
    +
    +    for (const line of lines) {
    +      const columns = line.split(/\s+/).filter(Boolean);
    +
    +      if (/swap/i.test(columns[0])) {
    +        return parseInt(columns[columnUsed], 10);
    +      }
    +    }
    +
    +    throw new Error('Could not find "swap" row.');
    +  } catch (ex) {
    +    logger.warn(`Could not get swap status from free: ${ex}`);
    +    logger.warn(ex.stack);
    +
    +    return null;
    +  }
    +}
    +
    +function memorySwapUsedWindows() {
    +  try {
    +    const { stdout } = execa.sync('wmic', ['PAGEFILE', 'get', 'CurrentUsage', '/format:list']);
    +    const match = /\bCurrentUsage=(\d+)/.exec(stdout);
    +
    +    if (!match) {
    +      throw new Error('Page file usage info not in output.');
    +    }
    +
    +    return parseInt(match[1], 10) * 1048576;
    +  } catch (ex) {
    +    logger.warn(`Could not get swap status from wmic: ${ex}`);
    +    logger.warn(ex.stack);
    +
    +    return null;
    +  }
    +}
    +
    +const hwinfo = {
    +  /**
    +   * Inidcates whether the host is running on battery power.  This can cause
    +   * performance degredation.
    +   *
    +   * @private
    +   * @method isUsingBattery
    +   * @for HardwareInfo
    +   * @param {String=process.platform} platform The current hardware platform.
    +   *                                           USED FOR TESTING ONLY.
    +   * @return {null|Boolean} `true` iff the host is running on battery power or
    +   *                         `false` if not.  `null` if the battery status
    +   *                         cannot be determined.
    +   */
    +  isUsingBattery(platform = process.platform) {
    +    switch (platform) {
    +      case 'darwin':
    +        return isUsingBatteryDarwin();
    +
    +      case 'freebsd':
    +      case 'openbsd':
    +        return isUsingBatteryBsd();
    +
    +      case 'linux':
    +        return isUsingBatteryLinux();
    +
    +      case 'win32':
    +        return isUsingBatteryWindows();
    +    }
    +
    +    logger.warn(`Battery status is unsupported on the '${platform}' platform.`);
    +
    +    return null;
    +  },
    +
    +  /**
    +   * Determines the amount of swap/virtual memory currently in use.
    +   *
    +   * @private
    +   * @method memorySwapUsed
    +   * @param {String=process.platform} platform The current hardware platform.
    +   *                                           USED FOR TESTING ONLY.
    +   * @return {null|Number} The amount of used swap space, in bytes.  `null` if
    +   *                        the used swap space cannot be determined.
    +   */
    +  memorySwapUsed(platform = process.platform) {
    +    switch (platform) {
    +      case 'darwin':
    +        return memorySwapUsedDarwin();
    +
    +      case 'freebsd':
    +      case 'openbsd':
    +        return memorySwapUsedBsd();
    +
    +      case 'linux':
    +        return memorySwapUsedLinux();
    +
    +      case 'win32':
    +        return memorySwapUsedWindows();
    +    }
    +
    +    logger.warn(`Swap status is unsupported on the '${platform}' platform.`);
    +
    +    return null;
    +  },
    +
    +  /**
    +   * Determines the total amount of memory available to the host, as from
    +   * `os.totalmem`.
    +   *
    +   * @private
    +   * @method memoryTotal
    +   * @return {Number} The total memory in bytes.
    +   */
    +  memoryTotal() {
    +    return os.totalmem();
    +  },
    +
    +  /**
    +   * Determines the amount of memory currently being used by the current Node
    +   * process, as from `process.memoryUsage`.
    +   *
    +   * @private
    +   * @method memoryUsed
    +   * @return {Object} The Resident Set Size, as reported by
    +   *                  `process.memoryUsage`.
    +   */
    +  memoryUsed() {
    +    return process.memoryUsage().rss;
    +  },
    +
    +  /**
    +   * Determines the number of logical processors available to the host, as from
    +   * `os.cpus`.
    +   *
    +   * @private
    +   * @method processorCount
    +   * @return {Number} The number of logical processors.
    +   */
    +  processorCount() {
    +    return os.cpus().length;
    +  },
    +
    +  /**
    +   * Determines the average processor load across the system.  This is
    +   * expressed as a fractional number between 0 and the number of logical
    +   * processors.
    +   *
    +   * @private
    +   * @method processorLoad
    +   * @param {String=process.platform} platform The current hardware platform.
    +   *                                           USED FOR TESTING ONLY.
    +   * @return {Array<Number>} The one-, five-, and fifteen-minute processor load
    +   *                         averages.
    +   */
    +  processorLoad(platform = process.platform) {
    +    // The os.loadavg() call works on win32, but never returns correct
    +    // data.  Better to intercept and warn that it's unsupported.
    +    if (platform === 'win32') {
    +      logger.warn(`Processor load is unsupported on the '${platform}' platform.`);
    +
    +      return null;
    +    }
    +
    +    return os.loadavg();
    +  },
    +
    +  /**
    +   * Gets the speed of the host's processors.
    +   *
    +   * If more than one processor is found, the average of their speeds is taken.
    +   *
    +   * @private
    +   * @method processorSpeed
    +   * @return {Number} The average processor speed in MHz.
    +   */
    +  processorSpeed() {
    +    const cpus = os.cpus();
    +
    +    return cpus.reduce((sum, cpu) => sum + cpu.speed, 0) / cpus.length;
    +  },
    +
    +  /**
    +   * Determines the time since the host was started, as from `os.uptime`.
    +   *
    +   * @private
    +   * @method uptime
    +   * @return {Number} The number of seconds since the host was started.
    +   */
    +  uptime() {
    +    return os.uptime();
    +  },
    +};
    +
    +module.exports = hwinfo;
    +
    +
    + +
    +
    +
    +
    + + + + + diff --git a/api/files/lib_models_installation-checker.js.html b/api/files/lib_models_installation-checker.js.html index 374dcff..09d371d 100644 --- a/api/files/lib_models_installation-checker.js.html +++ b/api/files/lib_models_installation-checker.js.html @@ -42,15 +42,19 @@

    Classes

  • Builder
  • CLI
  • Command
  • +
  • CommandGenerator
  • DefaultPackager
  • EmberAddon
  • EmberApp
  • +
  • HardwareInfo
  • HistorySupportAddon
  • Instrumentation
  • NodeModulesList
  • NpmTask
  • +
  • PackageCache
  • PackageInfo
  • PackageInfoCache
  • +
  • PrivateTestHelpers
  • Project
  • ServeFilesAddon
  • TestsServerAddon
  • @@ -65,7 +69,7 @@

    Classes

    - Version: 3.8.1--84707b2801 + Version: 3.21.2
    @@ -89,15 +93,15 @@

    lib/models/installation-checker.js

    } /** - * 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. - * - * @method checkInstallations - */ + * 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. + * + * @method checkInstallations + */ checkInstallations() { let commands = []; @@ -153,8 +157,7 @@

    lib/models/installation-checker.js

    module.exports = InstallationChecker; function hasDependencies(pkg) { - return (pkg.dependencies && pkg.dependencies.length) || - (pkg.devDependencies && pkg.devDependencies.length); + return (pkg.dependencies && pkg.dependencies.length) || (pkg.devDependencies && pkg.devDependencies.length); } function readJSON(path) { diff --git a/api/files/lib_models_instantiate-addons.js.html b/api/files/lib_models_instantiate-addons.js.html index 2b54d5b..35842ab 100644 --- a/api/files/lib_models_instantiate-addons.js.html +++ b/api/files/lib_models_instantiate-addons.js.html @@ -42,15 +42,19 @@

    Classes

  • Builder
  • CLI
  • Command
  • +
  • CommandGenerator
  • DefaultPackager
  • EmberAddon
  • EmberApp
  • +
  • HardwareInfo
  • HistorySupportAddon
  • Instrumentation
  • NodeModulesList
  • NpmTask
  • +
  • PackageCache
  • PackageInfo
  • PackageInfoCache
  • +
  • PrivateTestHelpers
  • Project
  • ServeFilesAddon
  • TestsServerAddon
  • @@ -65,7 +69,7 @@

    Classes

    - Version: 3.8.1--84707b2801 + Version: 3.21.2
    @@ -101,7 +105,6 @@

    lib/models/instantiate-addons.js

    * 'pkg' object for that addon's package.json). These are what is turned into addons. */ function instantiateAddons(parent, project, addonPackages) { - // depending on whether this is really a project or an addon, the 'name' property may be a getter. let parentName = typeof parent.name === 'function' ? parent.name() : parent.name; @@ -120,7 +123,7 @@

    lib/models/instantiate-addons.js

    let graph = new DAGMap(); let addonInfo, emberAddonConfig; - addonNames.forEach(name => { + addonNames.forEach((name) => { addonInfo = addonPackages[name]; emberAddonConfig = addonInfo.pkg['ember-addon']; @@ -142,7 +145,9 @@

    lib/models/instantiate-addons.js

    let pkgInfo = parent.packageInfoCache.getEntry(addonInfo.path); if (!pkgInfo || !pkgInfo.valid) { - throw new SilentError(`The \`${addonInfo.pkg.name}\` addon could not be found at \`${addonInfo.path}\` or was otherwise invalid.`); + throw new SilentError( + `The \`${addonInfo.pkg.name}\` addon could not be found at \`${addonInfo.path}\` or was otherwise invalid.` + ); } let AddonConstructor = pkgInfo.getAddonConstructor(); @@ -173,13 +178,16 @@

    lib/models/instantiate-addons.js

    } }); - logger.info(' addon info %o', addons.map(addon => ({ - name: addon.name, - times: { - initialize: addon.constructor._meta_.initializeIn, - lookup: addon.constructor._meta_.lookupIn, - }, - }))); + logger.info( + ' addon info %o', + addons.map((addon) => ({ + name: addon.name, + times: { + initialize: addon.constructor._meta_.initializeIn, + lookup: addon.constructor._meta_.lookupIn, + }, + })) + ); initializeAddonsToken.stop(); diff --git a/api/files/lib_models_instrumentation.js.html b/api/files/lib_models_instrumentation.js.html index 3afd58e..1e1b576 100644 --- a/api/files/lib_models_instrumentation.js.html +++ b/api/files/lib_models_instrumentation.js.html @@ -42,15 +42,19 @@

    Classes

  • Builder
  • CLI
  • Command
  • +
  • CommandGenerator
  • DefaultPackager
  • EmberAddon
  • EmberApp
  • +
  • HardwareInfo
  • HistorySupportAddon
  • Instrumentation
  • NodeModulesList
  • NpmTask
  • +
  • PackageCache
  • PackageInfo
  • PackageInfoCache
  • +
  • PrivateTestHelpers
  • Project
  • ServeFilesAddon
  • TestsServerAddon
  • @@ -65,7 +69,7 @@

    Classes

    - Version: 3.8.1--84707b2801 + Version: 3.21.2
    @@ -81,8 +85,10 @@

    lib/models/instrumentation.js

    const fs = require('fs-extra'); const chalk = require('chalk'); const heimdallGraph = require('heimdalljs-graph'); +const getConfig = require('../utilities/get-config'); const utilsInstrumentation = require('../utilities/instrumentation'); const logger = require('heimdalljs-logger')('ember-cli:instrumentation'); +const hwinfo = require('./hardware-info'); let vizEnabled = utilsInstrumentation.vizEnabled; let instrumentationEnabled = utilsInstrumentation.instrumentationEnabled; @@ -99,6 +105,16 @@

    lib/models/instrumentation.js

    _enableFSMonitorIfInstrumentationEnabled(); +function _getHardwareInfo(platform) { + const startTime = process.hrtime(); + + Object.getOwnPropertyNames(hwinfo).forEach((metric) => (platform[metric] = hwinfo[metric]())); + + const collectionTime = process.hrtime(startTime); + + // Convert from integer [seconds, nanoseconds] to floating-point milliseconds. + platform.collectionTime = collectionTime[0] * 10e3 + collectionTime[1] / 10e6; +} class Instrumentation { /** @@ -143,6 +159,8 @@

    lib/models/instrumentation.js

    this._heimdall = null; + this.config = getConfig(); + if (!options.initInstrumentation && this.isEnabled()) { this.instrumentations.init = { token: null, @@ -164,18 +182,22 @@

    lib/models/instrumentation.js

    let nextNode; let nextStat; - for (nodeItr = tree.dfsIterator(); ;) { + for (nodeItr = tree.dfsIterator(); ; ) { nextNode = nodeItr.next(); - if (nextNode.done) { break; } + if (nextNode.done) { + break; + } node = nextNode.value; if (node.label.broccoliNode && !node.label.broccoliCachedNode) { ++buildSteps; } - for (statsItr = node.statsIterator(); ;) { + for (statsItr = node.statsIterator(); ; ) { nextStat = statsItr.next(); - if (nextStat.done) { break; } + if (nextStat.done) { + break; + } statName = nextStat.value[0]; statValue = nextStat.value[1]; @@ -200,6 +222,8 @@

    lib/models/instrumentation.js

    buildSteps, }; + _getHardwareInfo(summary.platform); + if (result) { summary.build.outputChangedFiles = result.outputChanges; summary.output = result.directory; @@ -215,16 +239,20 @@

    lib/models/instrumentation.js

    } _initSummary(tree) { - return { + const summary = { totalTime: totalTime(tree), platform: { name: process.platform, }, }; + + _getHardwareInfo(summary.platform); + + return summary; } _commandSummary(tree, commandName, commandArgs) { - return { + const summary = { name: commandName, args: commandArgs, totalTime: totalTime(tree), @@ -232,15 +260,23 @@

    lib/models/instrumentation.js

    name: process.platform, }, }; + + _getHardwareInfo(summary.platform); + + return summary; } _shutdownSummary(tree) { - return { + const summary = { totalTime: totalTime(tree), platform: { name: process.platform, }, }; + + _getHardwareInfo(summary.platform); + + return summary; } _instrumentationFor(name) { @@ -257,7 +293,7 @@

    lib/models/instrumentation.js

    _invokeAddonHook(name, instrumentationInfo) { if (this.project && this.project.addons.length) { - this.project.addons.forEach(addon => { + this.project.addons.forEach((addon) => { if (typeof addon.instrumentation === 'function') { addon.instrumentation(name, instrumentationInfo); } @@ -266,7 +302,9 @@

    lib/models/instrumentation.js

    } _writeInstrumentation(name, instrumentationInfo) { - if (!vizEnabled()) { return; } + if (!vizEnabled()) { + return; + } let filename = `instrumentation.${name}`; if (name === 'build') { @@ -283,7 +321,9 @@

    lib/models/instrumentation.js

    } start(name) { - if (!instrumentationEnabled()) { return; } + if (!instrumentationEnabled(this.config)) { + return; + } let instr = this._instrumentationFor(name); this._heimdall = this._heimdall || require('heimdalljs'); @@ -300,7 +340,9 @@

    lib/models/instrumentation.js

    } stopAndReport(name) { - if (!instrumentationEnabled()) { return; } + if (!instrumentationEnabled(this.config)) { + return; + } let instr = this._instrumentationFor(name); if (!instr.token) { @@ -347,15 +389,19 @@

    lib/models/instrumentation.js

    let nextNode; let nextStat; - for (nodeItr = tree.dfsIterator(); ;) { + for (nodeItr = tree.dfsIterator(); ; ) { nextNode = nodeItr.next(); - if (nextNode.done) { break; } + if (nextNode.done) { + break; + } node = nextNode.value; - for (statsItr = node.statsIterator(); ;) { + for (statsItr = node.statsIterator(); ; ) { nextStat = statsItr.next(); - if (nextStat.done) { break; } + if (nextStat.done) { + break; + } statName = nextStat.value[0]; statValue = nextStat.value[1]; @@ -371,8 +417,6 @@

    lib/models/instrumentation.js

    // exported for testing Instrumentation._enableFSMonitorIfInstrumentationEnabled = _enableFSMonitorIfInstrumentationEnabled; -Instrumentation._vizEnabled = vizEnabled(); -Instrumentation._instrumentationEnabled = instrumentationEnabled(); module.exports = Instrumentation; 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 3648a76..e059687 100644 --- a/api/files/lib_models_package-info-cache_index.js.html +++ b/api/files/lib_models_package-info-cache_index.js.html @@ -42,15 +42,19 @@

    Classes

  • Builder
  • CLI
  • Command
  • +
  • CommandGenerator
  • DefaultPackager
  • EmberAddon
  • EmberApp
  • +
  • HardwareInfo
  • HistorySupportAddon
  • Instrumentation
  • NodeModulesList
  • NpmTask
  • +
  • PackageCache
  • PackageInfo
  • PackageInfoCache
  • +
  • PrivateTestHelpers
  • Project
  • ServeFilesAddon
  • TestsServerAddon
  • @@ -65,7 +69,7 @@

    Classes

    - Version: 3.8.1--84707b2801 + Version: 3.21.2
    @@ -90,91 +94,11 @@

    lib/models/package-info-cache/index.js

    const PackageInfo = require('./package-info'); const NodeModulesList = require('./node-modules-list'); const logger = require('heimdalljs-logger')('ember-cli:package-info-cache'); +const resolvePackagePath = require('resolve-package-path'); -let realFilePathCache; -let realDirectoryPathCache; - -/** - * Resolve the real path for a file, return null if does not - * exist or is not a file or FIFO, return the real path otherwise. - * - * @private - * @method getRealFilePath - * @param {String} filePath the path to the file of interest - * @return {String} real path or null - */ -function getRealFilePath(filePath) { - let realPath; - - try { - realPath = realFilePathCache[filePath]; - - if (realPath) { - return realPath; - } - - let stat = fs.statSync(filePath); - - if (stat.isFile() || stat.isFIFO()) { - realPath = fs.realpathSync(filePath); - } - } catch (e) { - if ( - e !== null && - typeof e === 'object' && - (e.code === 'ENOENT' || e.code === 'ENOTDIR') - ) { - realPath = null; - } else { - throw e; - } - } - - realFilePathCache[filePath] = realPath; - - return realPath; -} - -/** - * Resolve the real path for a directory, return null if does not - * exist or is not a directory, return the real path otherwise. - * - * @private - * @method getRealDirectoryPath - * @param {String} directoryPath the path to the directory of interest - * @return {String} real path or null - */ -function getRealDirectoryPath(directoryPath) { - let realPath; - - try { - realPath = realDirectoryPathCache[directoryPath]; - - if (realPath) { - return realPath; - } - - let stat = fs.statSync(directoryPath); - - if (stat.isDirectory()) { - realPath = fs.realpathSync(directoryPath); - } - } catch (e) { - if ( - e !== null && - typeof e === 'object' && - (e.code === 'ENOENT' || e.code === 'ENOTDIR') - ) { - realPath = null; - } else { - throw e; - } - } - - realDirectoryPathCache[directoryPath] = realPath; - - return realPath; -} +const getRealFilePath = resolvePackagePath.getRealFilePath; +const getRealDirectoryPath = resolvePackagePath.getRealDirectoryPath; +const _resetCache = resolvePackagePath._resetCache; const PACKAGE_JSON = 'package.json'; @@ -200,8 +124,7 @@

    lib/models/package-info-cache/index.js

    _clear() { this.entries = Object.create(null); this.projects = []; - realFilePathCache = Object.create(null); - realDirectoryPathCache = Object.create(null); + _resetCache(); } /** @@ -214,7 +137,7 @@

    lib/models/package-info-cache/index.js

    hasErrors() { let paths = Object.keys(this.entries); - if (paths.find(entryPath => this.getEntry(entryPath).hasErrors())) { + if (paths.find((entryPath) => this.getEntry(entryPath).hasErrors())) { return true; } @@ -231,7 +154,7 @@

    lib/models/package-info-cache/index.js

    showErrors() { let paths = Object.keys(this.entries).sort(); - paths.forEach(entryPath => { + paths.forEach((entryPath) => { this._showObjErrors(this.getEntry(entryPath)); }); } @@ -250,10 +173,9 @@

    lib/models/package-info-cache/index.js

    * @method _showObjErrors */ _showObjErrors(obj) { - let errorEntries = (obj.hasErrors() ? obj.errors.getErrors() : null); + let errorEntries = obj.hasErrors() ? obj.errors.getErrors() : null; - if (!errorEntries || - (errorEntries.length === 1 && errorEntries[0].type === Errors.ERROR_PACKAGE_DIR_MISSING)) { + if (!errorEntries || (errorEntries.length === 1 && errorEntries[0].type === Errors.ERROR_PACKAGE_DIR_MISSING)) { return; } @@ -264,13 +186,13 @@

    lib/models/package-info-cache/index.js

    logger.info('Top level errors:'); rootPath = this.realPath || ''; } else { - let typeName = (obj.project ? 'project' : 'addon'); + let typeName = obj.project ? 'project' : 'addon'; logger.info(`The 'package.json' file for the ${typeName} at ${obj.realPath}`); rootPath = obj.realPath; } - errorEntries.forEach(errorEntry => { + errorEntries.forEach((errorEntry) => { switch (errorEntry.type) { case Errors.ERROR_PACKAGE_JSON_MISSING: logger.info(` does not exist`); @@ -288,12 +210,10 @@

    lib/models/package-info-cache/index.js

    break; case Errors.ERROR_DEPENDENCIES_MISSING: if (errorEntry.data.length === 1) { - logger.info( - ` specifies a missing dependency '${errorEntry.data[0]}'` - ); + logger.info(` specifies a missing dependency '${errorEntry.data[0]}'`); } else { logger.info(` specifies some missing dependencies:`); - errorEntry.data.forEach(dependencyName => { + errorEntry.data.forEach((dependencyName) => { logger.info(` ${dependencyName}`); }); } @@ -325,6 +245,7 @@

    lib/models/package-info-cache/index.js

    * No copy is made. */ loadProject(projectInstance) { + logger.info('Loading project at %o...', projectInstance.root); let pkgInfo = this._readPackage(projectInstance.root, projectInstance.pkg, true); @@ -339,6 +260,7 @@

    lib/models/package-info-cache/index.js

    pkgInfo.project = projectInstance; if (projectInstance.cli && projectInstance.cli.root) { + logger.info('Reading package for "ember-cli": %o', projectInstance.cli.root); pkgInfo.cliInfo = this._readPackage(projectInstance.cli.root); } @@ -347,8 +269,9 @@

    lib/models/package-info-cache/index.js

    // create a PackageInfo unless there is really a directory at the // suggested location. The created addon may internally have errors, // as with any other PackageInfo. - projectInstance.supportedInternalAddonPaths().forEach(internalAddonPath => { + projectInstance.supportedInternalAddonPaths().forEach((internalAddonPath) => { if (getRealDirectoryPath(internalAddonPath)) { + logger.info('Reading package for internal addon: %o', internalAddonPath); pkgInfo.addInternalAddon(this._readPackage(internalAddonPath)); } }); @@ -381,7 +304,7 @@

    lib/models/package-info-cache/index.js

    reloadProjects() { let projects = this.projects.slice(); this._clear(); - projects.forEach(project => this.loadProject(project)); + projects.forEach((project) => this.loadProject(project)); } /** @@ -430,8 +353,10 @@

    lib/models/package-info-cache/index.js

    * @method _resolveDependencies */ _resolveDependencies() { + logger.info('Resolving dependencies...'); + let packageInfos = this._getPackageInfos(); - packageInfos.forEach(pkgInfo => { + packageInfos.forEach((pkgInfo) => { if (!pkgInfo.processed) { let pkgs = pkgInfo.addDependencies(pkgInfo.pkg.dependencies); if (pkgs) { @@ -488,7 +413,7 @@

    lib/models/package-info-cache/index.js

    _getPackageInfos() { let result = []; - Object.keys(this.entries).forEach(path => { + Object.keys(this.entries).forEach((path) => { let entry = this.entries[path]; if (entry instanceof PackageInfo) { result.push(entry); @@ -529,9 +454,7 @@

    lib/models/package-info-cache/index.js

    while (currPath !== root) { let endsWithNodeModules = path.basename(currPath) === 'node_modules'; - let nodeModulesPath = endsWithNodeModules - ? currPath - : `${currPath}${path.sep}node_modules`; + let nodeModulesPath = endsWithNodeModules ? currPath : `${currPath}${path.sep}node_modules`; let nodeModulesList = this._readNodeModulesList(nodeModulesPath); @@ -660,6 +583,7 @@

    lib/models/package-info-cache/index.js

    // Create a new PackageInfo and load any errors as needed. // Note that pkg may be an empty object here. + logger.info('Creating new PackageInfo instance for %o at %o', pkg.name, realPath); pkgInfo = new PackageInfo(pkg, realPath, this, isRoot); if (setupErrors.hasErrors()) { @@ -670,6 +594,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()) { + logger.info('%s is an addon', pkg.name); // Note: when we have both 'main' and ember-addon:main, the latter takes precedence let main = (pkg['ember-addon'] && pkg['ember-addon'].main) || pkg['main']; @@ -680,6 +605,7 @@

    lib/models/package-info-cache/index.js

    main = `${main}.js`; } + logger.info('Addon entry point is %o', main); pkg.main = main; let mainPath = path.join(realPath, main); @@ -705,8 +631,9 @@

    lib/models/package-info-cache/index.js

    let paths = emberAddonInfo.paths; if (paths) { - paths.forEach(p => { + paths.forEach((p) => { let addonPath = path.join(realPath, p); // real path, though may not exist. + logger.info('Adding in-repo-addon at %o', addonPath); let addonPkgInfo = this._readPackage(addonPath); // may have errors in the addon package. pkgInfo.addInRepoAddon(addonPkgInfo); }); @@ -714,6 +641,8 @@

    lib/models/package-info-cache/index.js

    } if (pkgInfo.mayHaveAddons) { + logger.info('Reading "node_modules" for %o', realPath); + // read addon modules from node_modules. We read the whole directory // because it's assumed that npm/yarn may have placed addons in the // directory from lower down in the project tree, and we want to get @@ -786,19 +715,27 @@

    lib/models/package-info-cache/index.js

    // At this point we know the directory node_modules exists and we can // process it. Further errors will be recorded here, or in the objects // that correspond to the node_modules entries. + logger.info('Creating new NodeModulesList instance for %o', realPath); nodeModulesList = new NodeModulesList(realPath, this); - let entries = fs.readdirSync(realPath); // should not fail because getRealDirectoryPath passed - - entries.forEach(entryName => { - // entries should be either a package or a scoping directory. I think - // there can also be files, but we'll ignore those. - - if (entryName.startsWith('.') || entryName.startsWith('_')) { + const entries = fs.readdirSync(realPath).filter((fileName) => { + if (fileName.startsWith('.') || fileName.startsWith('_')) { // we explicitly want to ignore these, according to the // definition of a valid package name. - return; + return false; + } else if (fileName.startsWith('@')) { + return true; + } else if (!fs.existsSync(`${realPath}/${fileName}/package.json`)) { + // a node_module is only valid if it contains a package.json + return false; + } else { + return true; } + }); // should not fail because getRealDirectoryPath passed + + entries.forEach((entryName) => { + // entries should be either a package or a scoping directory. I think + // there can also be files, but we'll ignore those. let entryPath = path.join(realPath, entryName); @@ -841,10 +778,6 @@

    lib/models/package-info-cache/index.js

    module.exports = PackageInfoCache; -// export the getRealXXXPath functions to enable testing -module.exports.getRealFilePath = getRealFilePath; -module.exports.getRealDirectoryPath = getRealDirectoryPath; -
    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 a073270..64dc9be 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,15 +42,19 @@

    Classes

  • Builder
  • CLI
  • Command
  • +
  • CommandGenerator
  • DefaultPackager
  • EmberAddon
  • EmberApp
  • +
  • HardwareInfo
  • HistorySupportAddon
  • Instrumentation
  • NodeModulesList
  • NpmTask
  • +
  • PackageCache
  • PackageInfo
  • PackageInfoCache
  • +
  • PrivateTestHelpers
  • Project
  • ServeFilesAddon
  • TestsServerAddon
  • @@ -65,7 +69,7 @@

    Classes

    - Version: 3.8.1--84707b2801 + Version: 3.21.2
    @@ -170,7 +174,9 @@

    lib/models/package-info-cache/node-modules-list.js

    * @return the desired PackageInfo if one exists for the given name, else null. */ findPackage(packageName) { - if (!this.hasEntries) { return null; } // for speed + if (!this.hasEntries) { + return null; + } // for speed let val; @@ -182,7 +188,7 @@

    lib/models/package-info-cache/node-modules-list.js

    ? entry.findPackage(parts[1]) // the real name : null; } else { - val = (this.entries[packageName] || null); + val = this.entries[packageName] || null; } return val; 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 6edb4d3..f313874 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,15 +42,19 @@

    Classes

  • Builder
  • CLI
  • Command
  • +
  • CommandGenerator
  • DefaultPackager
  • EmberAddon
  • EmberApp
  • +
  • HardwareInfo
  • HistorySupportAddon
  • Instrumentation
  • NodeModulesList
  • NpmTask
  • +
  • PackageCache
  • PackageInfo
  • PackageInfoCache
  • +
  • PrivateTestHelpers
  • Project
  • ServeFilesAddon
  • TestsServerAddon
  • @@ -65,7 +69,7 @@

    Classes

    - Version: 3.8.1--84707b2801 + Version: 3.21.2
    @@ -267,7 +271,9 @@

    lib/models/package-info-cache/package-info.js

    let missingDependencies = []; - dependencyNames.forEach(dependencyName => { + dependencyNames.forEach((dependencyName) => { + logger.info('%s: Trying to find dependency %o', this.pkg.name, dependencyName); + let dependencyPackage; // much of the time the package will have dependencies in @@ -279,10 +285,7 @@

    lib/models/package-info-cache/package-info.js

    } if (!dependencyPackage) { - dependencyPackage = this.cache._findPackage( - dependencyName, - path.dirname(this.realPath) - ); + dependencyPackage = this.cache._findPackage(dependencyName, path.dirname(this.realPath)); } if (dependencyPackage) { @@ -323,13 +326,13 @@

    lib/models/package-info-cache/package-info.js

    let result = []; if (Array.isArray(packageInfoList)) { if (excludeFn) { - packageInfoList = packageInfoList.filter(pkgInfo => !excludeFn(pkgInfo)); + packageInfoList = packageInfoList.filter((pkgInfo) => !excludeFn(pkgInfo)); } - packageInfoList.forEach(pkgInfo => result.push(pkgInfo)); + packageInfoList.forEach((pkgInfo) => result.push(pkgInfo)); } else { // We're going to assume we have a map of name to packageInfo - Object.keys(packageInfoList).forEach(name => { + Object.keys(packageInfoList).forEach((name) => { let pkgInfo = packageInfoList[name]; if (!excludeFn || !excludeFn(pkgInfo)) { result.push(pkgInfo); @@ -337,7 +340,7 @@

    lib/models/package-info-cache/package-info.js

    }); } - result.sort(lexicographically).forEach(pkgInfo => pushUnique(addonPackageList, pkgInfo)); + result.sort(lexicographically).forEach((pkgInfo) => pushUnique(addonPackageList, pkgInfo)); return addonPackageList; } @@ -350,8 +353,11 @@

    lib/models/package-info-cache/package-info.js

    discoverAddonAddons() { let addonPackageList = []; - this.addPackages(addonPackageList, - this.dependencyPackages, pkgInfo => !pkgInfo.isAddon() || pkgInfo.name === 'ember-cli'); + this.addPackages( + addonPackageList, + this.dependencyPackages, + (pkgInfo) => !pkgInfo.isAddon() || pkgInfo.name === 'ember-cli' + ); this.addPackages(addonPackageList, this.inRepoAddons); return addonPackageList; @@ -367,11 +373,11 @@

    lib/models/package-info-cache/package-info.js

    let addonPackageList = []; - this.addPackages(addonPackageList, (project.isEmberCLIAddon() ? [this] : null)); - this.addPackages(addonPackageList, (this.cliInfo ? this.cliInfo.inRepoAddons : null)); + 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.isAddon()); + this.addPackages(addonPackageList, this.dependencyPackages, (pkgInfo) => !pkgInfo.isAddon()); this.addPackages(addonPackageList, this.inRepoAddons); return addonPackageList; @@ -393,7 +399,7 @@

    lib/models/package-info-cache/package-info.js

    let packageMap = Object.create(null); - validPackages.forEach(pkgInfo => { + validPackages.forEach((pkgInfo) => { let addonInfo = new AddonInfo(pkgInfo.name, pkgInfo.realPath, pkgInfo.pkg); if (!excludeFn || !excludeFn(addonInfo)) { packageMap[pkgInfo.name] = addonInfo; @@ -404,37 +410,43 @@

    lib/models/package-info-cache/package-info.js

    } getValidPackages(addonPackageList) { - return addonPackageList.filter(pkgInfo => pkgInfo.valid); + return addonPackageList.filter((pkgInfo) => pkgInfo.valid); } getInvalidPackages(addonPackageList) { - return addonPackageList.filter(pkgInfo => !pkgInfo.valid); + return addonPackageList.filter((pkgInfo) => !pkgInfo.valid); } dumpInvalidAddonPackages(addonPackageList) { - if (this._hasDumpedInvalidAddonPackages) { return; } + if (this._hasDumpedInvalidAddonPackages) { + return; + } this._hasDumpedInvalidAddonPackages = true; let invalidPackages = this.getInvalidPackages(addonPackageList); if (invalidPackages.length > 0) { - let typeName = (this.project ? 'project' : 'addon'); + let typeName = this.project ? 'project' : 'addon'; - logger.info(''); - logger.info(`The 'package.json' file for the ${typeName} at ${this.realPath}`); + let msg = `The 'package.json' file for the ${typeName} at ${this.realPath}`; let relativePath; - if (invalidPackages.length === 1) { relativePath = path.relative(this.realPath, invalidPackages[0].realPath); - logger.info(` specifies an invalid, malformed or missing addon at relative path '${relativePath}'`); + msg = `${msg}\n specifies an invalid, malformed or missing addon at relative path '${relativePath}'`; } else { - logger.info(' specifies invalid, malformed or missing addons at relative paths'); - invalidPackages.forEach(packageInfo => { + msg = `${msg}\n specifies invalid, malformed or missing addons at relative paths`; + invalidPackages.forEach((packageInfo) => { let relativePath = path.relative(this.realPath, packageInfo.realPath); - logger.info(` '${relativePath}'`); + msg = `${msg}\n '${relativePath}'`; }); } + + if (process.env.EMBER_CLI_ERROR_ON_INVALID_ADDON) { + throw msg; + } else { + this.cache.ui.writeWarnLine(msg); + } } } @@ -467,9 +479,7 @@

    lib/models/package-info-cache/package-info.js

    } 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, pkg: this.pkg }, module)); } // XXX Probably want to store the timings here in PackageInfo, diff --git a/api/files/lib_models_project.js.html b/api/files/lib_models_project.js.html index 2985b3a..3f081f6 100644 --- a/api/files/lib_models_project.js.html +++ b/api/files/lib_models_project.js.html @@ -42,15 +42,19 @@

    Classes

  • Builder
  • CLI
  • Command
  • +
  • CommandGenerator
  • DefaultPackager
  • EmberAddon
  • EmberApp
  • +
  • HardwareInfo
  • HistorySupportAddon
  • Instrumentation
  • NodeModulesList
  • NpmTask
  • +
  • PackageCache
  • PackageInfo
  • PackageInfoCache
  • +
  • PrivateTestHelpers
  • Project
  • ServeFilesAddon
  • TestsServerAddon
  • @@ -65,7 +69,7 @@

    Classes

    - Version: 3.8.1--84707b2801 + Version: 3.21.2
    @@ -81,10 +85,10 @@

    lib/models/project.js

    /** @module ember-cli */ -const RSVP = require('rsvp'); +const util = require('util'); const path = require('path'); const findup = require('find-up'); -const resolve = RSVP.denodeify(require('resolve')); +const resolve = util.promisify(require('resolve')); const fs = require('fs-extra'); const _ = require('ember-cli-lodash-subset'); const logger = require('heimdalljs-logger')('ember-cli:project'); @@ -147,7 +151,7 @@

    lib/models/project.js

    canNestRoots: false, }; - let instrumentation = this._instrumentation = ensureInstrumentation(cli, ui); + let instrumentation = (this._instrumentation = ensureInstrumentation(cli, ui)); instrumentation.project = this; this.emberCLIVersion = emberCLIVersion; @@ -226,23 +230,21 @@

    lib/models/project.js

    } static nullProject(ui, cli) { - if (NULL_PROJECT) { return NULL_PROJECT; } + if (NULL_PROJECT) { + return NULL_PROJECT; + } NULL_PROJECT = new Project(processCwd, {}, ui, cli); - NULL_PROJECT.isEmberCLIProject = function() { + NULL_PROJECT.isEmberCLIProject = function () { return false; }; - NULL_PROJECT.isEmberCLIAddon = function() { + NULL_PROJECT.isEmberCLIAddon = function () { return false; }; - NULL_PROJECT.isModuleUnification = function() { - return false; - }; - - NULL_PROJECT.name = function() { + NULL_PROJECT.name = function () { return path.basename(process.cwd()); }; @@ -286,21 +288,6 @@

    lib/models/project.js

    return !!this.pkg.keywords && this.pkg.keywords.indexOf('ember-addon') > -1; } - /** - Returns whether this is using a module unification format. - @private - @method isModuleUnification - @return {Boolean} Whether this is using a module unification format. - */ - isModuleUnification() { - const { isExperimentEnabled } = require('../experiments'); - if (isExperimentEnabled('MODULE_UNIFICATION')) { - return this.has('src'); - } else { - return false; - } - } - /** Returns the path to the configuration. @@ -327,10 +314,11 @@

    lib/models/project.js

    @return {Object} Merged configuration object */ config(env) { - let key = `${this.configPath()}|${env}`; + let _env = env === undefined ? process.env.EMBER_ENV : env; + let key = `${this.configPath()}|${_env}`; let config = this.configCache.get(key); if (config === undefined) { - config = this.configWithoutCache(env); + config = this.configWithoutCache(_env); this.configCache.set(key, config); } return _.cloneDeep(config); @@ -340,7 +328,7 @@

    lib/models/project.js

    * @private * @method configWithoutCache * @param {String} env Environment name - * @return {Object} Merged confiration object + * @return {Object} Merged configuration object */ configWithoutCache(env) { let configPath = this.configPath(); @@ -477,7 +465,7 @@

    lib/models/project.js

    bowerDependencies(bower) { if (!bower) { let bowerPath = path.join(this.root, 'bower.json'); - bower = (fs.existsSync(bowerPath)) ? require(bowerPath) : {}; + bower = fs.existsSync(bowerPath) ? require(bowerPath) : {}; } return Object.assign({}, bower['devDependencies'], bower['dependencies']); } @@ -490,7 +478,9 @@

    lib/models/project.js

    @method supportedInternalAddonPaths */ supportedInternalAddonPaths() { - if (!this.root) { return []; } + if (!this.root) { + return []; + } let internalMiddlewarePath = path.join(__dirname, '../tasks/server/middleware'); let internalTransformPath = path.join(__dirname, '../tasks/transforms'); @@ -547,7 +537,7 @@

    lib/models/project.js

    this.discoverAddons(); this.addons = instantiateAddons(this, this, this.addonPackages); - this.addons.forEach(addon => logger.info('addon: %s', addon.name)); + this.addons.forEach((addon) => logger.info('addon: %s', addon.name)); } /** @@ -561,8 +551,10 @@

    lib/models/project.js

    addonCommands() { const Command = require('../models/command'); let commands = Object.create(null); - this.addons.forEach(addon => { - if (!addon.includedCommands) { return; } + this.addons.forEach((addon) => { + if (!addon.includedCommands) { + return; + } let token = heimdall.start({ name: `lookup-commands: ${addon.name}`, @@ -649,13 +641,17 @@

    lib/models/project.js

    @return {Array} List of paths */ addonBlueprintLookupPaths() { - let addonPaths = this.addons.reduce((sum, addon) => { - if (addon.blueprintsPath) { - let val = addon.blueprintsPath(); - if (val) { sum.push(val); } - } - return sum; - }, []).reverse(); + let addonPaths = this.addons + .reduce((sum, addon) => { + if (addon.blueprintsPath) { + let val = addon.blueprintsPath(); + if (val) { + sum.push(val); + } + } + return sum; + }, []) + .reverse(); return addonPaths; } @@ -693,7 +689,7 @@

    lib/models/project.js

    /** Find an addon by its name - @private + @public @method findAddonByName @param {String} name Addon name as specified in package.json @return {Addon} Addon instance @@ -806,7 +802,7 @@

    lib/models/project.js

    const pkg = require(packagePath); if (pkg && pkg.name === 'ember-cli') { - logger.info('getProjectRoot: named \'ember-cli\'. Will use cwd: %s', process.cwd()); + logger.info("getProjectRoot: named 'ember-cli'. Will use cwd: %s", process.cwd()); return process.cwd(); } @@ -819,7 +815,7 @@

    lib/models/project.js

    constructor(message) { super(message); this.name = 'NotFoundError'; - this.stack = (new Error()).stack; + this.stack = new Error().stack; } } @@ -847,8 +843,8 @@

    lib/models/project.js

    ui = new UI({ inputStream: process.stdin, outputStream: process.stdout, - ci: process.env.CI || (/^(dumb|emacs)$/).test(process.env.TERM), - writeLevel: (process.argv.indexOf('--silent') !== -1) ? 'ERROR' : undefined, + ci: process.env.CI || /^(dumb|emacs)$/.test(process.env.TERM), + writeLevel: process.argv.indexOf('--silent') !== -1 ? 'ERROR' : undefined, }); } @@ -865,9 +861,10 @@

    lib/models/project.js

    } function isEmberCliProject(pkg) { - return pkg && ( - (pkg.dependencies && Object.keys(pkg.dependencies).indexOf('ember-cli') !== -1) || - (pkg.devDependencies && Object.keys(pkg.devDependencies).indexOf('ember-cli') !== -1) + return ( + pkg && + ((pkg.dependencies && Object.keys(pkg.dependencies).indexOf('ember-cli') !== -1) || + (pkg.devDependencies && Object.keys(pkg.devDependencies).indexOf('ember-cli') !== -1)) ); } diff --git a/api/files/lib_models_task.js.html b/api/files/lib_models_task.js.html index a117aea..baaac6f 100644 --- a/api/files/lib_models_task.js.html +++ b/api/files/lib_models_task.js.html @@ -42,15 +42,19 @@

    Classes

  • Builder
  • CLI
  • Command
  • +
  • CommandGenerator
  • DefaultPackager
  • EmberAddon
  • EmberApp
  • +
  • HardwareInfo
  • HistorySupportAddon
  • Instrumentation
  • NodeModulesList
  • NpmTask
  • +
  • PackageCache
  • PackageInfo
  • PackageInfoCache
  • +
  • PrivateTestHelpers
  • Project
  • ServeFilesAddon
  • TestsServerAddon
  • @@ -65,7 +69,7 @@

    Classes

    - Version: 3.8.1--84707b2801 + Version: 3.21.2
    diff --git a/api/files/lib_tasks_build-watch.js.html b/api/files/lib_tasks_build-watch.js.html index a748300..213bd6f 100644 --- a/api/files/lib_tasks_build-watch.js.html +++ b/api/files/lib_tasks_build-watch.js.html @@ -42,15 +42,19 @@

    Classes

  • Builder
  • CLI
  • Command
  • +
  • CommandGenerator
  • DefaultPackager
  • EmberAddon
  • EmberApp
  • +
  • HardwareInfo
  • HistorySupportAddon
  • Instrumentation
  • NodeModulesList
  • NpmTask
  • +
  • PackageCache
  • PackageInfo
  • PackageInfoCache
  • +
  • PrivateTestHelpers
  • Project
  • ServeFilesAddon
  • TestsServerAddon
  • @@ -65,7 +69,7 @@

    Classes

    - Version: 3.8.1--84707b2801 + Version: 3.21.2
    @@ -82,7 +86,7 @@

    lib/tasks/build-watch.js

    const Task = require('../models/task'); const Watcher = require('../models/watcher'); const Builder = require('../models/builder'); -const RSVP = require('rsvp'); +const pDefer = require('p-defer'); class BuildWatchTask extends Task { constructor(options) { @@ -92,32 +96,36 @@

    lib/tasks/build-watch.js

    this._runDeferred = null; } - run(options) { + async run(options) { let { ui } = this; - ui.startProgress( - chalk.green('Building'), chalk.green('.') - ); + ui.startProgress(chalk.green('Building'), chalk.green('.')); - this._runDeferred = RSVP.defer(); + this._runDeferred = pDefer(); - let builder = this._builder = options._builder || new Builder({ - ui, - outputPath: options.outputPath, - environment: options.environment, - project: this.project, - }); + let builder = (this._builder = + options._builder || + new Builder({ + ui, + outputPath: options.outputPath, + environment: options.environment, + project: this.project, + })); ui.writeLine(`Environment: ${options.environment}`); - let watcher = options._watcher || new Watcher({ - ui, - builder, - analytics: this.analytics, - options, - }); - - return watcher.then(() => this._runDeferred.promise /* Run until failure or signal to exit */); + let watcher = + options._watcher || + new Watcher({ + ui, + builder, + analytics: this.analytics, + options, + }); + + await watcher; + // Run until failure or signal to exit + return this._runDeferred.promise; } /** @@ -126,8 +134,9 @@

    lib/tasks/build-watch.js

    * @private * @method onInterrupt */ - onInterrupt() { - return this._builder.cleanup().then(() => this._runDeferred.resolve()); + async onInterrupt() { + await this._builder.cleanup(); + this._runDeferred.resolve(); } } diff --git a/api/files/lib_tasks_npm-task.js.html b/api/files/lib_tasks_npm-task.js.html index f88b0d6..398a208 100644 --- a/api/files/lib_tasks_npm-task.js.html +++ b/api/files/lib_tasks_npm-task.js.html @@ -42,15 +42,19 @@

    Classes

  • Builder
  • CLI
  • Command
  • +
  • CommandGenerator
  • DefaultPackager
  • EmberAddon
  • EmberApp
  • +
  • HardwareInfo
  • HistorySupportAddon
  • Instrumentation
  • NodeModulesList
  • NpmTask
  • +
  • PackageCache
  • PackageInfo
  • PackageInfoCache
  • +
  • PrivateTestHelpers
  • Project
  • ServeFilesAddon
  • TestsServerAddon
  • @@ -65,7 +69,7 @@

    Classes

    - Version: 3.8.1--84707b2801 + Version: 3.21.2
    @@ -91,7 +95,6 @@

    lib/tasks/npm-task.js

    const Task = require('../models/task'); class NpmTask extends Task { - /** * @private * @class NpmTask @@ -121,19 +124,38 @@

    lib/tasks/npm-task.js

    return isYarnProject(this.project.root); } - checkYarn() { - return this.yarn(['--version']).then(result => { + async checkYarn() { + try { + let result = await this.yarn(['--version']); let version = result.stdout; - logger.info('yarn --version: %s', version); - }).catch(error => { + 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}`); + } else { + logger.info('yarn --version: %s', version); + } + + this.useYarn = true; + + return { yarnVersion: version }; + } catch (error) { logger.error('yarn --version failed: %s', error); + + if (error.code === 'ENOENT') { + throw new SilentError( + 'Ember CLI is now using yarn, but was not able to find it.\n' + + 'Please install yarn using the instructions at https://classic.yarnpkg.com/en/docs/install' + ); + } + throw error; - }); + } } - checkNpmVersion() { - return this.npm(['--version']).then(result => { + async checkNpmVersion() { + try { + let result = await this.npm(['--version']); let version = result.stdout; logger.info('npm --version: %s', version); @@ -143,25 +165,31 @@

    lib/tasks/npm-task.js

    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'); + 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' + ); } - 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.'); + 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.' + ); } return { npmVersion: version }; - }).catch(error => { + } catch (error) { logger.error('npm --version failed: %s', error); if (error.code === 'ENOENT') { - throw new SilentError('Ember CLI is now using the global npm, but was not able to find it.\n' + - 'Please install npm using the instructions at https://github.com/npm/npm'); + throw new SilentError( + 'Ember CLI is now using the global npm, but was not able to find it.\n' + + 'Please install npm using the instructions at https://github.com/npm/npm' + ); } throw error; - }); + } } /** @@ -178,17 +206,10 @@

    lib/tasks/npm-task.js

    * @method findPackageManager * @return {Promise} */ - findPackageManager() { + async findPackageManager() { if (this.useYarn === true) { logger.info('yarn requested -> trying yarn'); - - return this.checkYarn().catch(error => { - if (error.code === 'ENOENT') { - throw new SilentError('Yarn could not be found.'); - } - - throw error; - }); + return this.checkYarn(); } if (this.useYarn === false) { @@ -202,54 +223,55 @@

    lib/tasks/npm-task.js

    } logger.info('yarn.lock found -> trying yarn'); - return this.checkYarn() - .then(() => { - logger.info('yarn found -> using yarn'); - this.useYarn = true; - }) - .catch(() => { - logger.info('yarn not found -> using npm'); - return this.checkNpmVersion(); - }); + 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(); + } } - run(options) { + async run(options) { this.useYarn = options.useYarn; - return this.findPackageManager().then(result => { - let ui = this.ui; - let startMessage = this.formatStartMessage(options.packages); - let completeMessage = this.formatCompleteMessage(options.packages); + let result = await this.findPackageManager(); + let ui = this.ui; + let startMessage = this.formatStartMessage(options.packages); + let completeMessage = this.formatCompleteMessage(options.packages); - ui.startProgress(chalk.green(startMessage)); + const prependEmoji = require('../../lib/utilities/prepend-emoji'); - let promise; - if (this.useYarn) { - 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 heirarchy 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 heirarchy - if (result.npmVersion && semver.gte(result.npmVersion, '5.0.0')) { - promise = promise.then(() => this.npm(['install'])); - } + ui.writeLine(''); + 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'])); } + } - return promise - .finally(() => ui.stopProgress()) - .then(() => ui.writeLine(chalk.green(completeMessage))); - }); + return promise.finally(() => ui.stopProgress()).then(() => ui.writeLine(chalk.green(completeMessage))); } toNpmArgs(command, options) { @@ -307,7 +329,6 @@

    lib/tasks/npm-task.js

    } } else if (command === 'uninstall') { args.push('remove'); - } else { throw new Error(`npm command "${command}" can not be translated to Yarn command`); } @@ -320,7 +341,12 @@

    lib/tasks/npm-task.js

    args = args.concat(options.packages); } - args.push('--non-interactive'); + // Yarn v2 defaults to non-interactive + // with an optional -i flag + + if (semver.lt(this.yarnVersion, '2.0.0')) { + args.push('--non-interactive'); + } return args; } diff --git a/api/files/lib_tasks_serve.js.html b/api/files/lib_tasks_serve.js.html index f5bc7e4..72534f2 100644 --- a/api/files/lib_tasks_serve.js.html +++ b/api/files/lib_tasks_serve.js.html @@ -42,15 +42,19 @@

    Classes

  • Builder
  • CLI
  • Command
  • +
  • CommandGenerator
  • DefaultPackager
  • EmberAddon
  • EmberApp
  • +
  • HardwareInfo
  • HistorySupportAddon
  • Instrumentation
  • NodeModulesList
  • NpmTask
  • +
  • PackageCache
  • PackageInfo
  • PackageInfoCache
  • +
  • PrivateTestHelpers
  • Project
  • ServeFilesAddon
  • TestsServerAddon
  • @@ -65,7 +69,7 @@

    Classes

    - Version: 3.8.1--84707b2801 + Version: 3.21.2
    @@ -81,16 +85,16 @@

    lib/tasks/serve.js

    const fs = require('fs'); const path = require('path'); const ExpressServer = require('./server/express-server'); -const RSVP = require('rsvp'); const Task = require('../models/task'); const Watcher = require('../models/watcher'); const ServerWatcher = require('../models/server-watcher'); const Builder = require('../models/builder'); const SilentError = require('silent-error'); const serveURL = require('../utilities/get-serve-url'); +const pDefer = require('p-defer'); function mockWatcher(distDir) { - let watcher = RSVP.Promise.resolve({ directory: distDir }); + let watcher = Promise.resolve({ directory: distDir }); watcher.on = () => {}; return watcher; } @@ -109,31 +113,37 @@

    lib/tasks/serve.js

    this._builder = null; } - run(options) { + async run(options) { let hasBuild = !!options.path; if (hasBuild) { if (!fs.existsSync(options.path)) { - throw new SilentError(`The path ${options.path} does not exist. Please specify a valid build directory to serve.`); + throw new SilentError( + `The path ${options.path} does not exist. Please specify a valid build directory to serve.` + ); } options._builder = mockBuilder(); options._watcher = mockWatcher(options.path); } - let builder = this._builder = options._builder || new Builder({ - ui: this.ui, - outputPath: options.outputPath, - project: this.project, - environment: options.environment, - }); - - let watcher = options._watcher || new Watcher({ - ui: this.ui, - builder, - analytics: this.analytics, - options, - serving: true, - }); + let builder = (this._builder = + options._builder || + new Builder({ + ui: this.ui, + outputPath: options.outputPath, + project: this.project, + environment: options.environment, + })); + + let watcher = + options._watcher || + new Watcher({ + ui: this.ui, + builder, + analytics: this.analytics, + options, + serving: true, + }); let serverRoot = './server'; let serverWatcher = null; @@ -146,25 +156,27 @@

    lib/tasks/serve.js

    }); } - let expressServer = options._expressServer || new ExpressServer({ - ui: this.ui, - project: this.project, - analytics: this.analytics, - watcher, - serverRoot, - serverWatcher, - }); + let expressServer = + options._expressServer || + new ExpressServer({ + ui: this.ui, + project: this.project, + analytics: this.analytics, + watcher, + serverRoot, + serverWatcher, + }); /* hang until the user exits */ - this._runDeferred = RSVP.defer(); - - return expressServer.start(options) - .then(() => { - if (hasBuild) { - this.ui.writeLine(`– Serving on ${serveURL(options, this.project)}`); - } - return this._runDeferred.promise; - }); + this._runDeferred = pDefer(); + + await expressServer.start(options); + + if (hasBuild) { + this.ui.writeLine(`– Serving on ${serveURL(options, this.project)}`); + } + + return this._runDeferred.promise; } /** @@ -173,8 +185,9 @@

    lib/tasks/serve.js

    * @private * @method onInterrupt */ - onInterrupt() { - return this._builder.cleanup().then(() => this._runDeferred.resolve()); + async onInterrupt() { + await this._builder.cleanup(); + return this._runDeferred.resolve(); } } 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 8993dc6..11a311e 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,15 +42,19 @@

    Classes

  • Builder
  • CLI
  • Command
  • +
  • CommandGenerator
  • DefaultPackager
  • EmberAddon
  • EmberApp
  • +
  • HardwareInfo
  • HistorySupportAddon
  • Instrumentation
  • NodeModulesList
  • NpmTask
  • +
  • PackageCache
  • PackageInfo
  • PackageInfoCache
  • +
  • PrivateTestHelpers
  • Project
  • ServeFilesAddon
  • TestsServerAddon
  • @@ -65,7 +69,7 @@

    Classes

    - Version: 3.8.1--84707b2801 + Version: 3.21.2
    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 0547a45..1094cb1 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,15 +42,19 @@

    Classes

  • Builder
  • CLI
  • Command
  • +
  • CommandGenerator
  • DefaultPackager
  • EmberAddon
  • EmberApp
  • +
  • HardwareInfo
  • HistorySupportAddon
  • Instrumentation
  • NodeModulesList
  • NpmTask
  • +
  • PackageCache
  • PackageInfo
  • PackageInfoCache
  • +
  • PrivateTestHelpers
  • Project
  • ServeFilesAddon
  • TestsServerAddon
  • @@ -65,7 +69,7 @@

    Classes

    - Version: 3.8.1--84707b2801 + Version: 3.21.2
    @@ -124,7 +128,7 @@

    lib/tasks/server/middleware/broccoli-watcher/index.js

    // Find asset and set response headers, if no file has been found, reset url for proxy stuff // that comes afterwards - middleware(req, res, err => { + middleware(req, res, (err) => { req.url = oldURL; if (err) { logger.error('err', err); @@ -132,7 +136,7 @@

    lib/tasks/server/middleware/broccoli-watcher/index.js

    next(err); }); } else { - logger.info('prefixes didn\'t match, passing control on: (actual:%s expected:%s)', actualPrefix, expectedPrefix); + logger.info("prefixes didn't match, passing control on: (actual:%s expected:%s)", actualPrefix, expectedPrefix); next(); } }); 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 768cd85..9b52eb1 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,15 +42,19 @@

    Classes

  • Builder
  • CLI
  • Command
  • +
  • CommandGenerator
  • DefaultPackager
  • EmberAddon
  • EmberApp
  • +
  • HardwareInfo
  • HistorySupportAddon
  • Instrumentation
  • NodeModulesList
  • NpmTask
  • +
  • PackageCache
  • PackageInfo
  • PackageInfoCache
  • +
  • PrivateTestHelpers
  • Project
  • ServeFilesAddon
  • TestsServerAddon
  • @@ -65,7 +69,7 @@

    Classes

    - Version: 3.8.1--84707b2801 + Version: 3.21.2
    @@ -80,7 +84,6 @@

    lib/tasks/server/middleware/history-support/index.js

    const path = require('path'); const fs = require('fs'); - const cleanBaseURL = require('clean-base-url'); class HistorySupportAddon { @@ -112,7 +115,8 @@

    lib/tasks/server/middleware/history-support/index.js

    if (this.shouldAddMiddleware(config.options.environment)) { this.project.ui.writeWarnLine( 'Empty `rootURL` is not supported. Disable history support, or use an absolute `rootURL`', - config.options.rootURL !== ''); + config.options.rootURL !== '' + ); this.addMiddleware(config); } @@ -125,17 +129,25 @@

    lib/tasks/server/middleware/history-support/index.js

    let baseURL = options.rootURL === '' ? '/' : cleanBaseURL(options.rootURL || options.baseURL); - app.use((req, res, next) => { - watcher.then(results => { + app.use(async (req, _, next) => { + try { + const results = await watcher; if (this.shouldHandleRequest(req, options)) { let assetPath = req.path.slice(baseURL.length); let isFile = false; - try { isFile = fs.statSync(path.join(results.directory, assetPath)).isFile(); } catch (err) { /* ignore */ } + + try { + isFile = fs.statSync(path.join(results.directory, assetPath)).isFile(); + } catch (err) { + /* ignore */ + } if (!isFile) { req.serveUrl = `${baseURL}index.html`; } } - }).finally(next); + } finally { + next(); + } }); } 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 4b21fb2..0a87335 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,15 +42,19 @@

    Classes

  • Builder
  • CLI
  • Command
  • +
  • CommandGenerator
  • DefaultPackager
  • EmberAddon
  • EmberApp
  • +
  • HardwareInfo
  • HistorySupportAddon
  • Instrumentation
  • NodeModulesList
  • NpmTask
  • +
  • PackageCache
  • PackageInfo
  • PackageInfoCache
  • +
  • PrivateTestHelpers
  • Project
  • ServeFilesAddon
  • TestsServerAddon
  • @@ -65,7 +69,7 @@

    Classes

    - Version: 3.8.1--84707b2801 + Version: 3.21.2
    @@ -83,7 +87,7 @@

    lib/tasks/server/middleware/tests-server/index.js

    const fs = require('fs'); const logger = require('heimdalljs-logger')('ember-cli:test-server'); -class TestsServerAddon { +module.exports = class TestsServerAddon { /** * This addon is used to serve the QUnit or Mocha test runner * at `baseURL + '/tests'`. @@ -104,40 +108,56 @@

    lib/tasks/server/middleware/tests-server/index.js

    let baseURL = options.rootURL === '' ? '/' : cleanBaseURL(options.rootURL || options.baseURL); let testsPath = `${baseURL}tests`; - app.use((req, res, next) => { - watcher.then(results => { - let acceptHeaders = req.headers.accept || []; - let hasHTMLHeader = acceptHeaders.indexOf('text/html') !== -1; - let hasWildcardHeader = acceptHeaders.indexOf('*/*') !== -1; - - let isForTests = req.path.indexOf(testsPath) === 0; + app.use(async (req, _, next) => { + let results; + let watcherSuccess; + + try { + results = await watcher; + watcherSuccess = true; + } catch (e) { + watcherSuccess = false; + // the build has failed, the middleware can safely be skipped. + // build error reporting is handled by: + // 1. watcher production stderr + // 2. watcher-middleware serving the error page + } + + if (watcherSuccess) { + rewriteRequestUrlIfBasePageIsNeeded(req, testsPath, baseURL, results.directory); + } + + next(); + + if (config.finally) { + config.finally(); + } + }); + } +}; - logger.info('isForTests: %o', isForTests); +function rewriteRequestUrlIfBasePageIsNeeded(req, testsPath, baseURL, directory) { + let acceptHeaders = req.headers.accept || []; + let hasHTMLHeader = acceptHeaders.indexOf('text/html') !== -1; + let hasWildcardHeader = acceptHeaders.indexOf('*/*') !== -1; - if (isForTests && (hasHTMLHeader || hasWildcardHeader) && req.method === 'GET') { - let assetPath = req.path.slice(baseURL.length); - let filePath = path.join(results.directory, assetPath); + let isForTests = req.path.indexOf(testsPath) === 0; - 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`; + logger.info('isForTests: %o', isForTests); - logger.info('url: %s resolved to path: %s which is not a file. Assuming %s instead', req.path, filePath, newURL); - req.url = newURL; - } - } + if (isForTests && (hasHTMLHeader || hasWildcardHeader) && req.method === 'GET') { + let assetPath = req.path.slice(baseURL.length); + let filePath = path.join(directory, assetPath); - }).finally(next).finally(() => { - if (config.finally) { - config.finally(); - } - }); - }); + 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`; + logger.info('url: %s resolved to path: %s which is not a file. Assuming %s instead', req.path, filePath, newURL); + req.url = newURL; + } } } -module.exports = TestsServerAddon; -
    diff --git a/api/files/lib_tasks_test-server.js.html b/api/files/lib_tasks_test-server.js.html index 6fe3d44..3322c7d 100644 --- a/api/files/lib_tasks_test-server.js.html +++ b/api/files/lib_tasks_test-server.js.html @@ -42,15 +42,19 @@

    Classes

  • Builder
  • CLI
  • Command
  • +
  • CommandGenerator
  • DefaultPackager
  • EmberAddon
  • EmberApp
  • +
  • HardwareInfo
  • HistorySupportAddon
  • Instrumentation
  • NodeModulesList
  • NpmTask
  • +
  • PackageCache
  • PackageInfo
  • PackageInfoCache
  • +
  • PrivateTestHelpers
  • Project
  • ServeFilesAddon
  • TestsServerAddon
  • @@ -65,7 +69,7 @@

    Classes

    - Version: 3.8.1--84707b2801 + Version: 3.21.2
    @@ -79,7 +83,6 @@

    lib/tasks/test-server.js

    'use strict'; const TestTask = require('./test'); -const Promise = require('rsvp').Promise; const chalk = require('chalk'); const SilentError = require('silent-error'); diff --git a/api/files/lib_tasks_transforms_amd_index.js.html b/api/files/lib_tasks_transforms_amd_index.js.html index 376ad2e..e50d4ea 100644 --- a/api/files/lib_tasks_transforms_amd_index.js.html +++ b/api/files/lib_tasks_transforms_amd_index.js.html @@ -42,15 +42,19 @@

    Classes

  • Builder
  • CLI
  • Command
  • +
  • CommandGenerator
  • DefaultPackager
  • EmberAddon
  • EmberApp
  • +
  • HardwareInfo
  • HistorySupportAddon
  • Instrumentation
  • NodeModulesList
  • NpmTask
  • +
  • PackageCache
  • PackageInfo
  • PackageInfoCache
  • +
  • PrivateTestHelpers
  • Project
  • ServeFilesAddon
  • TestsServerAddon
  • @@ -65,7 +69,7 @@

    Classes

    - Version: 3.8.1--84707b2801 + Version: 3.21.2
    @@ -78,7 +82,7 @@

    lib/tasks/transforms/amd/index.js

     'use strict';
     
    -const stew = require('broccoli-stew');
    +const shimAmd = require('./amd-shim');
     
     class AmdTransformAddon {
       /**
    @@ -94,33 +98,23 @@ 

    lib/tasks/transforms/amd/index.js

    importTransforms() { return { - 'amd': { + amd: { transform: (tree, options) => { - let amdTransform = stew.map(tree, (content, relativePath) => { - const name = options[relativePath].as; - if (name) { - return [ - '(function(define){\n', - content, - '\n})((function(){ function newDefine(){ var args = Array.prototype.slice.call(arguments); args.unshift("', - name, - '"); return define.apply(null, args); }; newDefine.amd = true; return newDefine; })());', - ].join(''); - } else { - return content; - } - }); + let nameMapping = {}; + for (let relativePath in options) { + nameMapping[relativePath] = options[relativePath].as; + } + + let amdTransform = shimAmd(tree, nameMapping); return amdTransform; }, processOptions: (assetPath, entry, options) => { - if (!entry.as) { - throw new Error(`while importing ${assetPath}: amd transformation requires an \`as\` argument that specifies the desired module name`); - } - // If the import is specified to be a different name we must break because of the broccoli rewrite behavior. if (Object.keys(options).indexOf(assetPath) !== -1 && options[assetPath].as !== entry.as) { - throw new Error(`Highlander error while importing ${assetPath}. You may not import an AMD transformed asset at different module names.`); + throw new Error( + `Highlander error while importing ${assetPath}. You may not import an AMD transformed asset at different module names.` + ); } options[assetPath] = { diff --git a/api/files/lib_utilities_ember-app-utils.js.html b/api/files/lib_utilities_ember-app-utils.js.html index a041cb1..2952b58 100644 --- a/api/files/lib_utilities_ember-app-utils.js.html +++ b/api/files/lib_utilities_ember-app-utils.js.html @@ -42,15 +42,19 @@

    Classes

  • Builder
  • CLI
  • Command
  • +
  • CommandGenerator
  • DefaultPackager
  • EmberAddon
  • EmberApp
  • +
  • HardwareInfo
  • HistorySupportAddon
  • Instrumentation
  • NodeModulesList
  • NpmTask
  • +
  • PackageCache
  • PackageInfo
  • PackageInfoCache
  • +
  • PrivateTestHelpers
  • Project
  • ServeFilesAddon
  • TestsServerAddon
  • @@ -65,7 +69,7 @@

    Classes

    - Version: 3.8.1--84707b2801 + Version: 3.21.2
    @@ -90,7 +94,7 @@

    lib/utilities/ember-app-utils.js

    * @method normalizeUrl * @param {String} Raw url. * @return {String} Normalized url. -*/ + */ function normalizeUrl(rootURL) { if (rootURL === undefined || rootURL === null || rootURL === '') { return ''; @@ -107,7 +111,7 @@

    lib/utilities/ember-app-utils.js

    * @method convertObjectToString * @param {Object} Any Javascript Object. * @return {String} A string representation of a Javascript Object. -*/ + */ function convertObjectToString(env) { return JSON.stringify(env || {}); } @@ -119,7 +123,7 @@

    lib/utilities/ember-app-utils.js

    * @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); @@ -148,15 +152,13 @@

    lib/utilities/ember-app-utils.js

    * * @method contentFor * @param {Object} config Ember.js application configuration - * @param {RegExp} mathch Regular expression to match against + * @param {RegExp} match Regular expression to match against * @param {String} type Type of content * @param {Object} options Settings that control the default content * @param {Boolean} options.autoRun Controls whether to bootstrap the application or not * @param {Boolean} options.storeConfigInMeta Controls whether to include the contents of config - * @param {Boolean} options.isModuleUnification Signifies if the application - supports module unification or not * @return {String} The content. */ function contentFor(config, match, type, options) { @@ -173,7 +175,11 @@

    lib/utilities/ember-app-utils.js

    content.push(calculateBaseTag(config.baseURL, config.locationType)); if (options.storeConfigInMeta) { - content.push(`<meta name="${config.modulePrefix}/config/environment" content="${encodeURIComponent(JSON.stringify(config))}" />`); + content.push( + `<meta name="${config.modulePrefix}/config/environment" content="${encodeURIComponent( + JSON.stringify(config) + )}" />` + ); } break; @@ -194,7 +200,7 @@

    lib/utilities/ember-app-utils.js

    break; case 'app-boot': if (options.autoRun) { - let moduleToRequire = `${config.modulePrefix}/${options.isModuleUnification ? 'src/main' : 'app'}`; + let moduleToRequire = `${config.modulePrefix}/app`; content.push(` if (!runningTests) { require("${moduleToRequire}")["default"].create(${convertObjectToString(config.APP)}); @@ -204,7 +210,9 @@

    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>`); + 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>` + ); break; } @@ -232,32 +240,35 @@

    lib/utilities/ember-app-utils.js

    application or not * @param {Boolean} options.storeConfigInMeta Controls whether to include the contents of config - * @param {Boolean} options.isModuleUnification Signifies if the application - supports module unification or not @return {Array} An array of patterns to match against and replace */ function configReplacePatterns(options) { - return [{ - match: /{{rootURL}}/g, - replacement(config) { - return normalizeUrl(config.rootURL); + return [ + { + match: /{{\s?rootURL\s?}}/g, + replacement(config) { + return normalizeUrl(config.rootURL); + }, }, - }, { - match: /{{EMBER_ENV}}/g, - replacement(config) { - return convertObjectToString(config.EmberENV); + { + match: /{{\s?EMBER_ENV\s?}}/g, + replacement(config) { + return convertObjectToString(config.EmberENV); + }, }, - }, { - match: /{{content-for ['"](.+?)["']}}/g, - replacement(config, match, type) { - return contentFor(config, match, type, options); + { + match: /{{content-for ['"](.+?)["']}}/g, + replacement(config, match, type) { + return contentFor(config, match, type, options); + }, }, - }, { - match: /{{MODULE_PREFIX}}/g, - replacement(config) { - return config.modulePrefix; + { + match: /{{\s?MODULE_PREFIX\s?}}/g, + replacement(config) { + return config.modulePrefix; + }, }, - }]; + ]; } module.exports = { normalizeUrl, convertObjectToString, calculateBaseTag, 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 7c665b9..7673b70 100644 --- a/api/files/lib_utilities_insert-into-file.js.html +++ b/api/files/lib_utilities_insert-into-file.js.html @@ -42,15 +42,19 @@

    Classes

  • Builder
  • CLI
  • Command
  • +
  • CommandGenerator
  • DefaultPackager
  • EmberAddon
  • EmberApp
  • +
  • HardwareInfo
  • HistorySupportAddon
  • Instrumentation
  • NodeModulesList
  • NpmTask
  • +
  • PackageCache
  • PackageInfo
  • PackageInfoCache
  • +
  • PrivateTestHelpers
  • Project
  • ServeFilesAddon
  • TestsServerAddon
  • @@ -65,7 +69,7 @@

    Classes

    - Version: 3.8.1--84707b2801 + Version: 3.21.2
    @@ -80,10 +84,6 @@

    lib/utilities/insert-into-file.js

    const fs = require('fs-extra'); const EOL = require('os').EOL; -const RSVP = require('rsvp'); - -const Promise = RSVP.Promise; -const writeFile = RSVP.denodeify(fs.outputFile); /** Inserts the given content into a file. If the `contentsToInsert` string is already @@ -129,7 +129,7 @@

    lib/utilities/insert-into-file.js

    @param {Object} providedOptions @return {Promise} */ -function insertIntoFile(fullPath, contentsToInsert, providedOptions) { +async function insertIntoFile(fullPath, contentsToInsert, providedOptions) { let options = providedOptions || {}; let returnValue = { @@ -154,10 +154,16 @@

    lib/utilities/insert-into-file.js

    let insert = !alreadyPresent; let insertBehavior = 'end'; - if (options.before) { insertBehavior = 'before'; } - if (options.after) { insertBehavior = 'after'; } + if (options.before) { + insertBehavior = 'before'; + } + if (options.after) { + insertBehavior = 'after'; + } - if (options.force) { insert = true; } + if (options.force) { + insert = true; + } if (insert) { if (insertBehavior === 'end') { @@ -174,11 +180,12 @@

    lib/utilities/insert-into-file.js

    if (contentMarkerIndex !== -1) { let insertIndex = contentMarkerIndex; - if (insertBehavior === 'after') { insertIndex += contentMarker.length; } + if (insertBehavior === 'after') { + insertIndex += contentMarker.length; + } - contentsToWrite = contentsToWrite.slice(0, insertIndex) + - contentsToInsert + EOL + - contentsToWrite.slice(insertIndex); + contentsToWrite = + contentsToWrite.slice(0, insertIndex) + contentsToInsert + EOL + contentsToWrite.slice(insertIndex); } } } @@ -189,8 +196,8 @@

    lib/utilities/insert-into-file.js

    if (contentsToWrite !== originalContents) { returnValue.inserted = true; - return writeFile(fullPath, contentsToWrite) - .then(() => returnValue); + await fs.outputFile(fullPath, contentsToWrite); + return returnValue; } } diff --git a/api/files/lib_utilities_is-yarn-project.js.html b/api/files/lib_utilities_is-yarn-project.js.html index 0a4474b..6b44baa 100644 --- a/api/files/lib_utilities_is-yarn-project.js.html +++ b/api/files/lib_utilities_is-yarn-project.js.html @@ -42,15 +42,19 @@

    Classes

  • Builder
  • CLI
  • Command
  • +
  • CommandGenerator
  • DefaultPackager
  • EmberAddon
  • EmberApp
  • +
  • HardwareInfo
  • HistorySupportAddon
  • Instrumentation
  • NodeModulesList
  • NpmTask
  • +
  • PackageCache
  • PackageInfo
  • PackageInfoCache
  • +
  • PrivateTestHelpers
  • Project
  • ServeFilesAddon
  • TestsServerAddon
  • @@ -65,7 +69,7 @@

    Classes

    - Version: 3.8.1--84707b2801 + Version: 3.21.2
    diff --git a/api/files/lib_utilities_valid-project-name.js.html b/api/files/lib_utilities_valid-project-name.js.html index 8e5e339..a328405 100644 --- a/api/files/lib_utilities_valid-project-name.js.html +++ b/api/files/lib_utilities_valid-project-name.js.html @@ -42,15 +42,19 @@

    Classes

  • Builder
  • CLI
  • Command
  • +
  • CommandGenerator
  • DefaultPackager
  • EmberAddon
  • EmberApp
  • +
  • HardwareInfo
  • HistorySupportAddon
  • Instrumentation
  • NodeModulesList
  • NpmTask
  • +
  • PackageCache
  • PackageInfo
  • PackageInfoCache
  • +
  • PrivateTestHelpers
  • Project
  • ServeFilesAddon
  • TestsServerAddon
  • @@ -65,7 +69,7 @@

    Classes

    - Version: 3.8.1--84707b2801 + Version: 3.21.2
    @@ -78,14 +82,25 @@

    lib/utilities/valid-project-name.js

     'use strict';
     
    +const INVALID_PROJECT_NAMES = ['test', 'ember', 'ember-cli', 'vendor', 'public', 'app', 'addon', 'application'];
    +
     /**
      * Checks if the string starts with a number.
      *
      * @method startsWithNumber
      * @return {Boolean}
    -*/
    + */
     function startsWithNumber(name) {
    -  return (/^\d.*$/).test(name);
    +  return /^\d.*$/.test(name);
    +}
    +
    +function containsInvalidSlash(name) {
    +  let indexOfFirstSlash = name.indexOf('/');
    +  let isScoped = name[0] === '@' && indexOfFirstSlash !== -1;
    +
    +  let containsInvalidSlash = isScoped ? name.indexOf('/', indexOfFirstSlash + 1) > -1 : name.includes('/');
    +
    +  return containsInvalidSlash;
     }
     
     /**
    @@ -98,19 +113,16 @@ 

    lib/utilities/valid-project-name.js

    * @method validProjectName * @param {String} name The name of Ember CLI project * @return {Boolean} -*/ -module.exports = function(name) { - let invalidProjectNames = [ - 'test', - 'ember', - 'ember-cli', - 'vendor', - 'public', - 'app', - ]; - name = name.toLowerCase(); + */ +module.exports = function isValidProjectName(projectName) { + let lowerSanitizedName = projectName.toLowerCase(); - if (invalidProjectNames.indexOf(name) !== -1 || name.indexOf('.') !== -1 || startsWithNumber(name)) { + if ( + INVALID_PROJECT_NAMES.includes(lowerSanitizedName) || + lowerSanitizedName.includes('.') || + containsInvalidSlash(lowerSanitizedName) || + startsWithNumber(lowerSanitizedName) + ) { return false; } diff --git a/api/files/lib_utilities_will-interrupt-process.js.html b/api/files/lib_utilities_will-interrupt-process.js.html index c36fde8..6c97dd9 100644 --- a/api/files/lib_utilities_will-interrupt-process.js.html +++ b/api/files/lib_utilities_will-interrupt-process.js.html @@ -42,15 +42,19 @@

    Classes

  • Builder
  • CLI
  • Command
  • +
  • CommandGenerator
  • DefaultPackager
  • EmberAddon
  • EmberApp
  • +
  • HardwareInfo
  • HistorySupportAddon
  • Instrumentation
  • NodeModulesList
  • NpmTask
  • +
  • PackageCache
  • PackageInfo
  • PackageInfoCache
  • +
  • PrivateTestHelpers
  • Project
  • ServeFilesAddon
  • TestsServerAddon
  • @@ -65,7 +69,7 @@

    Classes

    - Version: 3.8.1--84707b2801 + Version: 3.21.2
    @@ -94,14 +98,12 @@

    lib/utilities/will-interrupt-process.js

    const handlers = []; -let _process, - windowsCtrlCTrap, - originalIsRaw; +let _process, _processCapturedLocation, windowsCtrlCTrap, originalIsRaw; module.exports = { capture(outerProcess) { if (_process) { - throw new Error('process already captured'); + throw new Error(`process already captured at: \n\n${_processCapturedLocation.stack}`); } if (outerProcess instanceof EventEmitter === false) { @@ -109,6 +111,7 @@

    lib/utilities/will-interrupt-process.js

    } _process = outerProcess; + _processCapturedLocation = new Error(); // ember-cli and user apps have many dependencies, many of which require // process.addListener('exit', ....) for cleanup, by default this limit for @@ -142,6 +145,7 @@

    lib/utilities/will-interrupt-process.js

    } _process = null; + _processCapturedLocation = null; }, /** @@ -160,7 +164,9 @@

    lib/utilities/will-interrupt-process.js

    } let index = handlers.indexOf(cb); - if (index > -1) { return; } + if (index > -1) { + return; + } if (handlers.length === 0) { setupSignalsTrap(); @@ -182,7 +188,9 @@

    lib/utilities/will-interrupt-process.js

    */ removeHandler(cb) { let index = handlers.indexOf(cb); - if (index < 0) { return; } + if (index < 0) { + return; + } handlers.splice(index, 1); captureExit.offExit(cb); @@ -239,7 +247,7 @@

    lib/utilities/will-interrupt-process.js

    // This is required to capture Ctrl + C on Windows stdin.setRawMode(true); - windowsCtrlCTrap = function(data) { + windowsCtrlCTrap = function (data) { if (data.length === 1 && data[0] === 0x03) { _process.emit('SIGINT'); } @@ -256,7 +264,7 @@

    lib/utilities/will-interrupt-process.js

    } function isWindowsTTY(_process) { - return (/^win/).test(_process.platform) && _process.stdin && _process.stdin.isTTY; + return /^win/.test(_process.platform) && _process.stdin && _process.stdin.isTTY; } function exit() { diff --git a/api/files/lib_utilities_windows-admin.js.html b/api/files/lib_utilities_windows-admin.js.html index e85a9ff..48b1902 100644 --- a/api/files/lib_utilities_windows-admin.js.html +++ b/api/files/lib_utilities_windows-admin.js.html @@ -42,15 +42,19 @@

    Classes

  • Builder
  • CLI
  • Command
  • +
  • CommandGenerator
  • DefaultPackager
  • EmberAddon
  • EmberApp
  • +
  • HardwareInfo
  • HistorySupportAddon
  • Instrumentation
  • NodeModulesList
  • NpmTask
  • +
  • PackageCache
  • PackageInfo
  • PackageInfoCache
  • +
  • PrivateTestHelpers
  • Project
  • ServeFilesAddon
  • TestsServerAddon
  • @@ -65,7 +69,7 @@

    Classes

    - Version: 3.8.1--84707b2801 + Version: 3.21.2
    @@ -78,21 +82,20 @@

    lib/utilities/windows-admin.js

     'use strict';
     
    -const Promise = require('rsvp').Promise;
     const chalk = require('chalk');
     
     class WindowsSymlinkChecker {
       /**
        *
    -   * On windows users will have a much better experience if symlinks are enabled
    -   * an usable. This object when queried informs windows users, if they can
    -   * improve there build performance, and how.
    +   * On Windows, users will have a much better experience if symlinks are enabled
    +   * and usable. When queried, this object informs Windows users regarding
    +   * improving their build performance, and how.
        *
    -   *  > Windows vista: nothing we can really do, so we fall back to junctions for folders + copying of files
    -   *  <= Windows vista: symlinks are available but using them is somewhat tricky
    -   *    * if the users is an admin, the process needed to have been started with elevated privs
    +   *  > Windows Vista: nothing we can really do, so we fall back to junctions for folders + copying of files
    +   *  <= Windows Vista: symlinks are available but using them is somewhat tricky
    +   *    * if the user is an admin, the process needs to have been started with elevated privileges
        *    * if the user is not an admin, a specific setting needs to be enabled
    -   *  <= Windows 10 Insiders build 14972
    +   *  <= Windows 10
        *    * if developer mode is enabled, symlinks "just work"
        *    * https://blogs.windows.com/buildingapps/2016/12/02/symlinks-windows-10
        *
    @@ -154,17 +157,16 @@ 

    lib/utilities/windows-admin.js

    const exec = require('child_process').exec; const symlinkOrCopy = require('symlink-or-copy'); - return new WindowsSymlinkChecker(ui, (/^win/).test(process.platform), symlinkOrCopy.canSymlink, exec); + return new WindowsSymlinkChecker(ui, /^win/.test(process.platform), symlinkOrCopy.canSymlink, exec); } - /** * @public * @method checkIfSymlinksNeedToBeEnabled * @return {Promise<Object>} Object describing whether we're on windows and if admin rights exist */ checkIfSymlinksNeedToBeEnabled() { - return new Promise(resolve => { + return new Promise((resolve) => { if (!this.isWindows) { resolve({ windows: false, @@ -195,13 +197,13 @@

    lib/utilities/windows-admin.js

    let ui = this.ui; let exec = this.exec; - return new Promise(resolve => { + return new Promise((resolve) => { exec('NET SESSION', (error, stdout, stderr) => { - let elevated = (!stderr || stderr.length === 0); + let elevated = !stderr || stderr.length === 0; if (!elevated) { ui.writeLine(chalk.yellow('\nRunning without permission to symlink will degrade build performance.')); - ui.writeLine('See http://ember-cli.com/user-guide/#windows for details.\n'); + ui.writeLine('See https://cli.emberjs.com/release/appendix/windows/ for details.\n'); } resolve({ diff --git a/api/files/tests_.eslintrc.js.html b/api/files/tests_.eslintrc.js.html new file mode 100644 index 0000000..d828e81 --- /dev/null +++ b/api/files/tests_.eslintrc.js.html @@ -0,0 +1,140 @@ + + + + + tests/.eslintrc.js - ember-cli + + + + + + +
    +
    + + +
    +
    +

    tests/.eslintrc.js

    +
    + +
    +'use strict';
    +
    +module.exports = {
    +  plugins: ['chai-expect', 'mocha'],
    +  env: {
    +    mocha: true,
    +  },
    +  rules: {
    +    // JSHint "expr", disabled due to chai expect assertions
    +    'no-unused-expressions': 0,
    +
    +    // disabled for easier asserting of file contents
    +    quotes: 0,
    +
    +    // disabled because describe(), it(), etc. should not use arrow functions
    +    'prefer-arrow-callback': 0,
    +
    +    camelcase: ['error', { allow: ['bower_components', 'node_modules'] }],
    +
    +    /*** chai-expect ***/
    +
    +    'chai-expect/missing-assertion': 2,
    +    'chai-expect/terminating-properties': 2,
    +    'chai-expect/no-inner-compare': 2,
    +
    +    /*** mocha ***/
    +
    +    'mocha/no-exclusive-tests': 'error',
    +    'mocha/no-skipped-tests': 'off',
    +    'mocha/no-pending-tests': 'off',
    +    'mocha/handle-done-callback': 'error',
    +    'mocha/no-synchronous-tests': 'off',
    +    'mocha/no-global-tests': 'error',
    +    'mocha/no-return-and-callback': 'error',
    +    'mocha/valid-test-description': 'off',
    +    'mocha/valid-suite-description': 'off',
    +    'mocha/no-sibling-hooks': 'error',
    +    'mocha/no-mocha-arrows': 'error',
    +    'mocha/no-hooks': 'off',
    +    'mocha/no-hooks-for-single-case': 'off',
    +    'mocha/no-top-level-hooks': 'error',
    +    'mocha/no-identical-title': 'error',
    +    'mocha/max-top-level-suites': 'off',
    +    'mocha/no-nested-tests': 'error',
    +  },
    +};
    +
    +
    + +
    +
    +
    +
    + + + + + diff --git a/api/files/tests_helpers_acceptance.js.html b/api/files/tests_helpers_acceptance.js.html new file mode 100644 index 0000000..4a0a973 --- /dev/null +++ b/api/files/tests_helpers_acceptance.js.html @@ -0,0 +1,219 @@ + + + + + tests/helpers/acceptance.js - ember-cli + + + + + + +
    +
    + + +
    +
    +

    tests/helpers/acceptance.js

    +
    + +
    +'use strict';
    +
    +const symlinkOrCopySync = require('symlink-or-copy').sync;
    +const path = require('path');
    +const fs = require('fs-extra');
    +const runCommand = require('./run-command');
    +const hasGlobalYarn = require('../helpers/has-global-yarn');
    +
    +let root = path.resolve(__dirname, '..', '..');
    +
    +const PackageCache = require('../../tests/helpers/package-cache');
    +
    +const quickTemp = require('quick-temp');
    +let dirs = {};
    +
    +let runCommandOptions = {
    +  // Note: We must override the default logOnFailure logging, because we are
    +  // not inside a test.
    +  log() {
    +    return; // no output for initial application build
    +  },
    +};
    +
    +function handleResult(result) {
    +  if (result.output) {
    +    console.log(result.output.join('\n'));
    +  }
    +  if (result.errors) {
    +    console.log(result.errors.join('\n'));
    +  }
    +  throw result;
    +}
    +
    +function applyCommand(command, name /*, ...flags*/) {
    +  let flags = [].slice.call(arguments, 2, arguments.length);
    +  let binaryPath = path.resolve(path.join(__dirname, '..', '..', 'bin', 'ember'));
    +  let args = [binaryPath, command, name, '--disable-analytics', '--watcher=node', '--skip-git', runCommandOptions];
    +
    +  flags.forEach(function (flag) {
    +    args.splice(2, 0, flag);
    +  });
    +
    +  return runCommand.apply(undefined, args);
    +}
    +
    +/**
    + * @class PrivateTestHelpers
    + */
    +
    +/**
    + * Use `createTestTargets` in the before hook to do the initial
    + * setup of a project. This will ensure that we limit the amount of times
    + * we go to the network to fetch dependencies.
    + *
    + * @method createTestTargets
    + * @param  {String} projectName The name of the project. Can be an app or addon.
    + * @param  {Object} options
    + * @property {String} options.command The command you want to run
    + * @return {Promise}  The result of the running the command
    + */
    +function createTestTargets(projectName, options) {
    +  let outputDir = quickTemp.makeOrReuse(dirs, projectName);
    +
    +  options = options || {};
    +  options.command = options.command || 'new';
    +
    +  return applyCommand(options.command, projectName, '--skip-npm', '--skip-bower', `--directory=${outputDir}`).catch(
    +    handleResult
    +  );
    +}
    +
    +/**
    + * Tears down the targeted project download directory
    + */
    +function teardownTestTargets() {
    +  // Remove all tmp directories created in this run.
    +  let dirKeys = Object.keys(dirs);
    +  for (let i = 0; i < dirKeys.length; i++) {
    +    quickTemp.remove(dirs, dirKeys[i]);
    +  }
    +}
    +
    +/**
    + * Creates symbolic links from the dependency temp directories
    + * to the project that is under test.
    + *
    + * @method linkDependencies
    + * @param  {String} projectName The name of the project under test
    + * @return {String} The path to the hydrated fixture.
    + */
    +function linkDependencies(projectName) {
    +  let sourceFixture = dirs[projectName]; // original fixture for this acceptance test.
    +  let runFixture = quickTemp.makeOrRemake(dirs, `${projectName}-clone`);
    +
    +  fs.copySync(sourceFixture, runFixture);
    +
    +  let nodeManifest = fs.readFileSync(path.join(runFixture, 'package.json'));
    +
    +  let packageCache = new PackageCache(root);
    +  let packager = hasGlobalYarn ? 'yarn' : 'npm';
    +
    +  packageCache.create('node', packager, nodeManifest, [{ name: 'ember-cli', path: root }]);
    +
    +  let nodeModulesPath = path.join(runFixture, 'node_modules');
    +  symlinkOrCopySync(path.join(packageCache.get('node'), 'node_modules'), nodeModulesPath);
    +
    +  process.chdir(runFixture);
    +
    +  return runFixture;
    +}
    +
    +/**
    + * Clean a test run.
    + */
    +function cleanupRun(projectName) {
    +  process.chdir(root);
    +  quickTemp.remove(dirs, `${projectName}-clone`);
    +}
    +
    +module.exports = {
    +  createTestTargets,
    +  linkDependencies,
    +  teardownTestTargets,
    +  cleanupRun,
    +};
    +
    +
    + +
    +
    +
    +
    + + + + + diff --git a/api/files/tests_helpers_command-generator.js.html b/api/files/tests_helpers_command-generator.js.html new file mode 100644 index 0000000..f5b26f4 --- /dev/null +++ b/api/files/tests_helpers_command-generator.js.html @@ -0,0 +1,144 @@ + + + + + tests/helpers/command-generator.js - ember-cli + + + + + + +
    +
    + + +
    +
    +

    tests/helpers/command-generator.js

    +
    + +
    +'use strict';
    +
    +const execa = require('../../lib/utilities/execa');
    +
    +/**
    + * A simple tool to make behavior and API consistent between commands
    + * the user wraps in this.
    + *
    + * Usage:
    + *
    + * ```
    + * var bower = new CommandGenerator(require.resolve('bower/bin/bower'));
    + * bower.invoke('install', 'ember');
    + * ```
    + *
    + * @private
    + * @class CommandGenerator
    + * @constructor
    + * @param {Path} program The path to the command.
    + * @return {Function} A command helper.
    + */
    +module.exports = class CommandGenerator {
    +  constructor(program) {
    +    this.program = program;
    +  }
    +
    +  /**
    +   * The `invoke` method is responsible for building the final executable command.
    +   *
    +   * @private
    +   * @method command
    +   * @param {String} [...arguments] Arguments to be passed into the command.
    +   * @param {Object} [options={}] The options passed into child_process.spawnSync.
    +   *   (https://nodejs.org/api/child_process.html#child_process_child_process_spawnsync_command_args_options)
    +   */
    +  invoke() {
    +    let args = Array.prototype.slice.call(arguments);
    +    let options = {};
    +
    +    if (typeof args[args.length - 1] === 'object') {
    +      options = args.pop();
    +    }
    +
    +    return this._invoke(args, options);
    +  }
    +
    +  _invoke(args, options) {
    +    return execa.sync(this.program, args, options);
    +  }
    +};
    +
    +
    + +
    +
    +
    +
    + + + + + diff --git a/api/files/tests_helpers_package-cache.js.html b/api/files/tests_helpers_package-cache.js.html new file mode 100644 index 0000000..c94d9d6 --- /dev/null +++ b/api/files/tests_helpers_package-cache.js.html @@ -0,0 +1,772 @@ + + + + + tests/helpers/package-cache.js - ember-cli + + + + + + +
    +
    + + +
    +
    +

    tests/helpers/package-cache.js

    +
    + +
    +'use strict';
    +
    +const fs = require('fs-extra');
    +const path = require('path');
    +const quickTemp = require('quick-temp');
    +const Configstore = require('configstore');
    +const CommandGenerator = require('./command-generator');
    +const stableStringify = require('json-stable-stringify');
    +const symlinkOrCopySync = require('symlink-or-copy').sync;
    +
    +let originalWorkingDirectory = process.cwd();
    +
    +// Module scoped variable to store whether a particular cache has been
    +// attempted to be upgraded.
    +let upgraded = {};
    +
    +/*
    +List of keys which could possibly result in the package manager installing
    +something. This is the "err on the side of caution" approach. It actually
    +doesn't matter if something is or isn't automatically installed in any of the
    +cases where we use this.
    +*/
    +let DEPENDENCY_KEYS = ['dependencies', 'devDependencies', 'peerDependencies', 'optionalDependencies'];
    +
    +/**
    + * The `bower` command helper.
    + *
    + * @private
    + * @method bower
    + * @param {String} subcommand The subcommand to be passed into bower.
    + * @param {String} [...arguments] Arguments to be passed into the bower subcommand.
    + * @param {Object} [options={}] The options passed into child_process.spawnSync.
    + *   (https://nodejs.org/api/child_process.html#child_process_child_process_spawnsync_command_args_options)
    + */
    +let bower = new CommandGenerator('bower');
    +
    +/**
    + * The `npm` command helper.
    + *
    + * @private
    + * @method npm
    + * @param {String} subcommand The subcommand to be passed into npm.
    + * @param {String} [...arguments] Arguments to be passed into the npm subcommand.
    + * @param {Object} [options={}] The options passed into child_process.spawnSync.
    + *   (https://nodejs.org/api/child_process.html#child_process_child_process_spawnsync_command_args_options)
    + */
    +let npm = new CommandGenerator('npm');
    +
    +/**
    + * The `yarn` command helper.
    + *
    + * @private
    + * @method yarn
    + * @param {String} subcommand The subcommand to be passed into yarn.
    + * @param {String} [...arguments] Arguments to be passed into the yarn subcommand.
    + * @param {Object} [options={}] The options passed into child_process.spawnSync.
    + *   (https://nodejs.org/api/child_process.html#child_process_child_process_spawnsync_command_args_options)
    + */
    +let yarn = new CommandGenerator('yarn');
    +
    +// This lookup exists to make it possible to look the commands up based upon context.
    +let originals;
    +let commands = {
    +  bower,
    +  npm,
    +  yarn,
    +};
    +
    +// The definition list of translation terms.
    +let lookups = {
    +  manifest: {
    +    bower: 'bower.json',
    +    npm: 'package.json',
    +    yarn: 'package.json',
    +  },
    +  path: {
    +    bower: 'bower_components',
    +    npm: 'node_modules',
    +    yarn: 'node_modules',
    +  },
    +  upgrade: {
    +    bower: 'update',
    +    npm: 'install',
    +    yarn: 'upgrade',
    +  },
    +};
    +
    +/**
    + * The `translate` command is used to turn a consistent argument into
    + * appropriate values based upon the context in which it is used. It's
    + * a convenience helper to avoid littering lookups throughout the code.
    + *
    + * @private
    + * @method translate
    + * @param {String} type Either 'bower', 'npm', or 'yarn'.
    + * @param {String} lookup Either 'manifest', 'path', or 'upgrade'.
    + */
    +function translate(type, lookup) {
    +  return lookups[lookup][type];
    +}
    +
    +/**
    + * The PackageCache wraps all package management functions. It also
    + * handles initial global state setup.
    + *
    + * Usage:
    + *
    + * ```
    + * let cache = new PackageCache();
    + * let dir = cache.create('your-cache', 'yarn', '{
    + *   "dependencies": {
    + *     "lodash": "*",
    + *     "ember-cli": "*"
    + *   }
    + * }');
    + * // => process.cwd()/tmp/your-cache-A3B4C6D
    + * ```
    + *
    + * This will generate a persistent cache which contains the results
    + * of a clean installation of the `dependencies` as you specified in
    + * the manifest argument. It will save the results of these in a
    + * temporary folder, returned as `dir`. On a second invocation
    + * (in the same process, or in a subsequent run) PackageCache will first
    + * compare the manifest to the previously installed one, using the manifest
    + * as the cache key, and make a decision as to the fastest way to get
    + * the cache up-to-date. PackageCache guarantees that your cache will
    + * always be up-to-date.
    + *
    + * If done in the same process, this simply returns the existing cache
    + * directory with no change, making the following invocation simply a
    + * cache validation check:
    + *
    + * ```
    + * let dir2 = cache.create('your-cache', 'yarn', '{
    + *   "dependencies": {
    + *     "lodash": "*",
    + *     "ember-cli": "*"
    + *   }
    + * }');
    + * // => process.cwd()/tmp/your-cache-A3B4C6D
    + * ```
    + *
    + * If you wish to modify a cache you can do so using the `update` API:
    + *
    + * ```
    + * let dir3 = cache.update('your-cache', 'yarn', '{
    + *   "dependencies": {
    + *     "": "*",
    + *     "lodash": "*",
    + *     "ember-cli": "*"
    + *   }
    + * }');
    + * // => process.cwd()/tmp/your-cache-A3B4C6D
    + * ```
    + *
    + * Underneath the hood `create` and `update` are identical–which
    + * makes clear the simplicity of this tool. It will always do the
    + * right thing. You can think of the outcome of any `create` or
    + * `update` call as identical to `rm -rf node_modules && npm install`
    + * except as performant as possible.
    + *
    + * If you need to make modifications to a cache but wish to retain
    + * the original you can invoke the `clone` command:
    + *
    + * ```
    + * let newDir = cache.clone('your-cache', 'modified-cache');
    + * let manifest = fs.readJsonSync(path.join(newDir, 'package.json'));
    + * manifest.dependencies['express'] = '*';
    + * cache.update('modified-cache', 'yarn', JSON.stringify(manifest));
    + * // => process.cwd()/tmp/modified-cache-F8D5C8B
    + * ```
    + *
    + * This mental model makes it easy to prevent coding mistakes, state
    + * leakage across multiple test runs by making multiple caches cheap,
    + * and has tremendous performance benefits.
    + *
    + * You can even programatically update a cache:
    + *
    + * ```
    + * let CommandGenerator = require('./command-generator');
    + * let yarn = new CommandGenerator('yarn');
    + *
    + * let dir = cache.create('your-cache', 'yarn', '{ ... }');
    + *
    + * yarn.invoke('add', 'some-addon', { cwd: dir });
    + * ```
    + *
    + * The programmatic approach enables the entire set of usecases that
    + * the underlying package manager supports while continuing to wrap it
    + * in a persistent cache. You should not directly modify any files in the
    + * cache other than the manifest unless you really know what you're doing as
    + * that can put the cache into a possibly invalid state.
    + *
    + * PackageCache also supports linking. If you pass an array of module names to
    + * in the fourth position it will ensure that those are linked, and remain
    + * linked for the lifetime of the cache. When you link a package it uses the
    + * current global link provided by the underlying package manager and invokes
    + * their built-in `link` command.
    + *
    + * ```
    + * let dir = cache.create('your-cache', 'yarn', '{ ... }', ['ember-cli']);
    + * // => `yarn link ember-cli` happens along the way.
    + * ```
    + *
    + * Sometimes this global linking behavior is not what you want. Instead you wish
    + * to link in some other working directory. PackageCache makes a best effort
    + * attempt at supporting this workflow by allowing you to specify an object in
    + * the `links` argument array passed to `create`.
    + *
    + * let dir = cache.create('your-cache', 'yarn', '{ ... }', [
    + *   { name: 'ember-cli', path: '/the/absolute/path/to/the/package' },
    + *   'other-package'
    + * ]);
    + *
    + * This creates a symlink at the named package path to the specified directory.
    + * As package managers do different things for their own linking behavior this
    + * is "best effort" only. Be sure to review upstream behavior to identify if you
    + * rely on those features for your code to function:
    + *
    + * - [bower](https://github.com/bower/bower/blob/master/lib/commands/link.js)
    + * - [npm](https://github.com/npm/npm/blob/latest/lib/link.js)
    + * - [yarn](https://github.com/yarnpkg/yarn/blob/master/src/cli/commands/link.js)
    + *
    + * As the only caveat, PackageCache _is_ persistent. The consuming
    + * code is responsible for ensuring that the cache size does not
    + * grow unbounded.
    + *
    + * @private
    + * @class PackageCache
    + * @constructor
    + * @param {String} rootPath Root of the directory for `PackageCache`.
    + */
    +module.exports = class PackageCache {
    +  constructor(rootPath) {
    +    this.rootPath = rootPath || originalWorkingDirectory;
    +
    +    let configPath = path.join(this.rootPath, 'tmp', 'package-cache.json');
    +    this._conf = new Configstore(
    +      'package-cache',
    +      {},
    +      {
    +        configPath,
    +      }
    +    );
    +
    +    this._cleanDirs();
    +  }
    +
    +  get dirs() {
    +    return this._conf.all;
    +  }
    +
    +  /**
    +   * The `__setupForTesting` modifies things in module scope.
    +   *
    +   * @private
    +   * @method __setupForTesting
    +   */
    +  __setupForTesting(stubs) {
    +    originals = commands;
    +    commands = stubs.commands;
    +  }
    +
    +  /**
    +   * The `__resetForTesting` puts things back in module scope.
    +   *
    +   * @private
    +   * @method __resetForTesting
    +   */
    +  __resetForTesting() {
    +    commands = originals;
    +  }
    +
    +  /**
    +   * The `_cleanDirs` method deals with sync issues between the
    +   * Configstore and what exists on disk. Non-existent directories
    +   * are removed from `this.dirs`.
    +   *
    +   * @private
    +   * @method _cleanDirs
    +   */
    +  _cleanDirs() {
    +    let labels = Object.keys(this.dirs);
    +
    +    let label, directory;
    +    for (let i = 0; i < labels.length; i++) {
    +      label = labels[i];
    +      directory = this.dirs[label];
    +      if (!fs.existsSync(directory)) {
    +        this._conf.delete(label);
    +      }
    +    }
    +  }
    +
    +  /**
    +   * The `_readManifest` method reads the on-disk manifest for the current
    +   * cache and returns its value.
    +   *
    +   * @private
    +   * @method _readManifest
    +   * @param {String} label The label for the cache.
    +   * @param {String} type The type of package cache.
    +   * @return {String} The manifest file contents on disk.
    +   */
    +  _readManifest(label, type) {
    +    let readManifestDir = this.dirs[label];
    +
    +    if (!readManifestDir) {
    +      return null;
    +    }
    +
    +    let inputPath = path.join(readManifestDir, translate(type, 'manifest'));
    +
    +    let result = null;
    +    try {
    +      result = fs.readFileSync(inputPath, 'utf8');
    +    } catch (error) {
    +      // Swallow non-exceptional errors.
    +      if (error.code !== 'ENOENT') {
    +        throw error;
    +      }
    +    }
    +    return result;
    +  }
    +
    +  /**
    +   * The `_writeManifest` method generates the on-disk folder for the package cache
    +   * and saves the manifest into it. If it is a yarn package cache it will remove
    +   * the existing lock file.
    +   *
    +   * @private
    +   * @method _writeManifest
    +   * @param {String} label The label for the cache.
    +   * @param {String} type The type of package cache.
    +   * @param {String} manifest The contents of the manifest file to write to disk.
    +   */
    +  _writeManifest(label, type, manifest) {
    +    process.chdir(this.rootPath);
    +    let outputDir = quickTemp.makeOrReuse(this.dirs, label);
    +    process.chdir(originalWorkingDirectory);
    +
    +    this._conf.set(label, outputDir);
    +
    +    let outputFile = path.join(outputDir, translate(type, 'manifest'));
    +    fs.outputFileSync(outputFile, manifest);
    +
    +    // Remove any existing yarn.lock file so that it doesn't try to incorrectly use it as a base.
    +    if (type === 'yarn') {
    +      try {
    +        fs.unlinkSync(path.join(outputDir, 'yarn.lock'));
    +      } catch (error) {
    +        // Catch unexceptional error but rethrow if something is truly wrong.
    +        if (error.code !== 'ENOENT') {
    +          throw error;
    +        }
    +      }
    +    }
    +  }
    +
    +  /**
    +   * The `_removeLinks` method removes from the dependencies of the manifest the
    +   * assets which will be linked in so that we don't duplicate install. It saves
    +   * off the values in the internal `PackageCache` metadata for restoration after
    +   * linking as those values may be necessary.
    +   *
    +   * It is also responsible for removing these links prior to making any changes
    +   * to the specified cache.
    +   *
    +   * @private
    +   * @method _removeLinks
    +   * @param {String} label The label for the cache.
    +   * @param {String} type The type of package cache.
    +   */
    +  _removeLinks(label, type) {
    +    let cachedManifest = this._readManifest(label, type);
    +    if (!cachedManifest) {
    +      return;
    +    }
    +
    +    let jsonManifest = JSON.parse(cachedManifest);
    +    let links = jsonManifest._packageCache.links;
    +
    +    // Blindly remove existing links whether or not they appear in the manifest.
    +    let link, linkPath;
    +    for (let i = 0; i < links.length; i++) {
    +      link = links[i];
    +      if (typeof link === 'string') {
    +        commands[type].invoke('unlink', link, { cwd: this.dirs[label] });
    +      } else {
    +        linkPath = path.join(this.dirs[label], translate(type, 'path'), link.name);
    +        try {
    +          fs.removeSync(linkPath);
    +        } catch (error) {
    +          // Catch unexceptional error but rethrow if something is truly wrong.
    +          if (error.code !== 'ENOENT') {
    +            throw error;
    +          }
    +        }
    +      }
    +    }
    +
    +    // Remove things from the manifest which we know we'll link back in.
    +    let originals = {};
    +    let key, linkName;
    +    for (let i = 0; i < DEPENDENCY_KEYS.length; i++) {
    +      key = DEPENDENCY_KEYS[i];
    +      if (jsonManifest[key]) {
    +        // Get a clone of the original object.
    +        originals[key] = JSON.parse(JSON.stringify(jsonManifest[key]));
    +      }
    +      for (let j = 0; j < links.length; j++) {
    +        link = links[j];
    +
    +        // Support object-style invocation for "manual" linking.
    +        if (typeof link === 'string') {
    +          linkName = link;
    +        } else {
    +          linkName = link.name;
    +        }
    +
    +        if (jsonManifest[key] && jsonManifest[key][linkName]) {
    +          delete jsonManifest[key][linkName];
    +        }
    +      }
    +    }
    +
    +    jsonManifest._packageCache.originals = originals;
    +    let manifest = JSON.stringify(jsonManifest);
    +
    +    this._writeManifest(label, type, manifest);
    +  }
    +
    +  /**
    +   * The `_restoreLinks` method restores the dependencies from the internal
    +   * `PackageCache` metadata so that the manifest matches its original state after
    +   * performing the links.
    +   *
    +   * It is also responsible for restoring these links into the `PackageCache`.
    +   *
    +   * @private
    +   * @method _restoreLinks
    +   * @param {String} label The label for the cache.
    +   * @param {String} type The type of package cache.
    +   */
    +  _restoreLinks(label, type) {
    +    let cachedManifest = this._readManifest(label, type);
    +    if (!cachedManifest) {
    +      return;
    +    }
    +
    +    let jsonManifest = JSON.parse(cachedManifest);
    +    let links = jsonManifest._packageCache.links;
    +
    +    // Blindly restore links.
    +    let link, linkPath;
    +    for (let i = 0; i < links.length; i++) {
    +      link = links[i];
    +      if (typeof link === 'string') {
    +        commands[type].invoke('link', link, { cwd: this.dirs[label] });
    +      } else {
    +        linkPath = path.join(this.dirs[label], translate(type, 'path'), link.name);
    +        fs.mkdirsSync(path.dirname(linkPath)); // Just in case the path doesn't exist.
    +        symlinkOrCopySync(link.path, linkPath);
    +      }
    +    }
    +
    +    // Restore to original state.
    +    let keys = Object.keys(jsonManifest._packageCache.originals);
    +    let key;
    +    for (let i = 0; i < keys.length; i++) {
    +      key = keys[i];
    +      jsonManifest[key] = jsonManifest._packageCache.originals[key];
    +    }
    +
    +    // Get rid of the originals.
    +    delete jsonManifest._packageCache.originals;
    +
    +    // Serialize back to disk.
    +    let manifest = JSON.stringify(jsonManifest);
    +    this._writeManifest(label, type, manifest);
    +  }
    +
    +  /**
    +   * The `_checkManifest` method compares the desired manifest to that which
    +   * exists in the cache.
    +   *
    +   * @private
    +   * @method _checkManifest
    +   * @param {String} label The label for the cache.
    +   * @param {String} type The type of package cache.
    +   * @param {String} manifest The contents of the manifest file to compare to cache.
    +   * @return {Boolean} `true` if identical.
    +   */
    +  _checkManifest(label, type, manifest) {
    +    let cachedManifest = this._readManifest(label, type);
    +
    +    if (cachedManifest === null) {
    +      return false;
    +    }
    +
    +    let parsedCached = JSON.parse(cachedManifest);
    +    let parsedNew = JSON.parse(manifest);
    +
    +    // Only inspect the keys we care about.
    +    // Invalidate the cache based off the private _packageCache key as well.
    +    let keys = [].concat(DEPENDENCY_KEYS, '_packageCache');
    +
    +    let key, before, after;
    +    for (let i = 0; i < keys.length; i++) {
    +      key = keys[i];
    +
    +      // Empty keys are identical to undefined keys.
    +      before = stableStringify(parsedCached[key]) || '{}';
    +      after = stableStringify(parsedNew[key]) || '{}';
    +
    +      if (before !== after) {
    +        return false;
    +      }
    +    }
    +
    +    return true;
    +  }
    +
    +  /**
    +   * The `_install` method installs the contents of the manifest into the
    +   * specified package cache.
    +   *
    +   * @private
    +   * @method _install
    +   * @param {String} label The label for the cache.
    +   * @param {String} type The type of package cache.
    +   */
    +  _install(label, type) {
    +    this._removeLinks(label, type);
    +    commands[type].invoke('install', { cwd: this.dirs[label] });
    +    this._restoreLinks(label, type);
    +
    +    // If we just did a clean install we can treat it as up-to-date.
    +    upgraded[label] = true;
    +  }
    +
    +  /**
    +   * The `_upgrade` method guarantees that the contents of the manifest are
    +   * allowed to drift in a SemVer compatible manner. It ensures that CI is
    +   * always running against the latest versions of all dependencies.
    +   *
    +   * @private
    +   * @method _upgrade
    +   * @param {String} label The label for the cache.
    +   * @param {String} type The type of package cache.
    +   */
    +  _upgrade(label, type) {
    +    // Lock out upgrade calls after the first time upgrading the cache.
    +    if (upgraded[label]) {
    +      return;
    +    }
    +
    +    if (!this._canUpgrade(label, type)) {
    +      // Only way to get repeatable behavior in npm: start over.
    +      // We turn an `_upgrade` task into an `_install` task.
    +      fs.removeSync(path.join(this.dirs[label], translate(type, 'path')));
    +      return this._install(label, type);
    +    }
    +
    +    this._removeLinks(label, type);
    +    commands[type].invoke(translate(type, 'upgrade'), { cwd: this.dirs[label] });
    +    this._restoreLinks(label, type);
    +
    +    upgraded[label] = true;
    +  }
    +
    +  _canUpgrade(label, type) {
    +    return type === 'bower' || (type === 'yarn' && fs.existsSync(path.join(this.dirs[label], 'yarn.lock')));
    +  }
    +
    +  // PUBLIC API BELOW
    +
    +  /**
    +   * The `create` method adds a new package cache entry.
    +   *
    +   * @method create
    +   * @param {String} label The label for the cache.
    +   * @param {String} type The type of package cache.
    +   * @param {String} manifest The contents of the manifest file for the cache.
    +   * @param {Array} links Packages to omit for install and link.
    +   * @return {String} The directory on disk which contains the cache.
    +   */
    +  create(label, type, manifest, links) {
    +    links = links || [];
    +
    +    // Save metadata about the PackageCache invocation in the manifest.
    +    let packageManagerVersion = commands[type].invoke('--version').stdout;
    +
    +    let jsonManifest = JSON.parse(manifest);
    +    jsonManifest._packageCache = {
    +      node: process.version,
    +      packageManager: type,
    +      packageManagerVersion,
    +      links,
    +    };
    +
    +    manifest = JSON.stringify(jsonManifest);
    +
    +    // Compare any existing manifest to the ideal per current blueprint.
    +    let identical = this._checkManifest(label, type, manifest);
    +
    +    if (identical) {
    +      // Use what we have, but opt in to SemVer drift.
    +      this._upgrade(label, type);
    +    } else {
    +      // Tell the package manager to start semi-fresh.
    +      this._writeManifest(label, type, manifest);
    +      this._install(label, type);
    +    }
    +
    +    return this.dirs[label];
    +  }
    +
    +  /**
    +   * The `update` method aliases the `create` method.
    +   *
    +   * @method update
    +   * @param {String} label The label for the cache.
    +   * @param {String} type The type of package cache.
    +   * @param {String} manifest The contents of the manifest file for the cache.
    +   * @param {Array} links Packages to elide for install and link.
    +   * @return {String} The directory on disk which contains the cache.
    +   */
    +  update(/*label, type, manifest, links*/) {
    +    return this.create.apply(this, arguments);
    +  }
    +
    +  /**
    +   * The `get` method returns the directory for the cache.
    +   *
    +   * @method get
    +   * @param {String} label The label for the cache.
    +   * @return {String} The directory on disk which contains the cache.
    +   */
    +  get(label) {
    +    return this.dirs[label];
    +  }
    +
    +  /**
    +   * The `destroy` method removes all evidence of the package cache.
    +   *
    +   * @method destroy
    +   * @param {String} label The label for the cache.
    +   * @param {String} type The type of package cache.
    +   */
    +  destroy(label) {
    +    process.chdir(this.rootPath);
    +    quickTemp.remove(this.dirs, label);
    +    process.chdir(originalWorkingDirectory);
    +
    +    this._conf.delete(label);
    +  }
    +
    +  /**
    +   * The `clone` method duplicates a cache. Some package managers can
    +   * leverage a pre-existing state to speed up their installation.
    +   *
    +   * @method destroy
    +   * @param {String} fromLabel The label for the cache to clone.
    +   * @param {String} toLabel The label for the new cache.
    +   */
    +  clone(fromLabel, toLabel) {
    +    process.chdir(this.rootPath);
    +    let outputDir = quickTemp.makeOrReuse(this.dirs, toLabel);
    +    process.chdir(originalWorkingDirectory);
    +
    +    this._conf.set(toLabel, outputDir);
    +
    +    fs.copySync(this.get(fromLabel), outputDir);
    +
    +    return this.dirs[toLabel];
    +  }
    +};
    +
    +
    + +
    +
    +
    +
    + + + + + diff --git a/api/files/tests_unit_models_addon-test.js.html b/api/files/tests_unit_models_addon-test.js.html new file mode 100644 index 0000000..1dff069 --- /dev/null +++ b/api/files/tests_unit_models_addon-test.js.html @@ -0,0 +1,992 @@ + + + + + tests/unit/models/addon-test.js - ember-cli + + + + + + +
    +
    + + +
    +
    +

    tests/unit/models/addon-test.js

    +
    + +
    +'use strict';
    +
    +const fs = require('fs-extra');
    +const path = require('path');
    +const Project = require('../../../lib/models/project');
    +const Addon = require('../../../lib/models/addon');
    +const expect = require('chai').expect;
    +const findWhere = require('ember-cli-lodash-subset').find;
    +const MockUI = require('console-ui/mock');
    +const MockCLI = require('../../helpers/mock-cli');
    +const mkTmpDirIn = require('../../../lib/utilities/mk-tmp-dir-in');
    +
    +const broccoli = require('broccoli-builder');
    +const walkSync = require('walk-sync');
    +const td = require('testdouble');
    +
    +let root = process.cwd();
    +let tmproot = path.join(root, 'tmp');
    +
    +let fixturePath = path.resolve(__dirname, '../../fixtures/addon');
    +
    +describe('models/addon.js', function () {
    +  let addon, project, projectPath;
    +
    +  describe('root property', function () {
    +    it('is required', function () {
    +      expect(() => {
    +        let TheAddon = Addon.extend({ root: undefined });
    +        new TheAddon();
    +      }).to.throw(/root/);
    +    });
    +  });
    +
    +  describe('old core object compat', function () {
    +    it('treeGenerator works without .project', function () {
    +      let warning;
    +      let TheAddon = Addon.extend({
    +        name: 'such name',
    +        root: path.resolve(fixturePath, 'simple'),
    +        _warn(message) {
    +          warning = `${message}`;
    +        },
    +      });
    +      let addon = new TheAddon();
    +      expect(() => {
    +        addon.treeGenerator('foo');
    +      }).to.not.throw();
    +      expect(warning).to.match(/Addon: `such name` is missing addon.project/);
    +    });
    +  });
    +
    +  describe('treePaths and treeForMethods', function () {
    +    let FirstAddon, SecondAddon;
    +
    +    beforeEach(function () {
    +      projectPath = path.resolve(fixturePath, 'simple');
    +      const packageContents = require(path.join(projectPath, 'package.json'));
    +      let cli = new MockCLI();
    +
    +      project = new Project(projectPath, packageContents, cli.ui, cli);
    +
    +      FirstAddon = Addon.extend({
    +        name: 'first',
    +        root: projectPath,
    +
    +        init() {
    +          this._super.apply(this, arguments);
    +          this.treePaths.vendor = 'blazorz';
    +          this.treeForMethods.public = 'huzzah!';
    +        },
    +      });
    +
    +      SecondAddon = Addon.extend({
    +        name: 'first',
    +        root: projectPath,
    +
    +        init() {
    +          this._super.apply(this, arguments);
    +          this.treePaths.vendor = 'blammo';
    +          this.treeForMethods.public = 'boooo';
    +        },
    +      });
    +    });
    +
    +    describe('.jshintAddonTree', function () {
    +      let addon;
    +
    +      beforeEach(function () {
    +        addon = new FirstAddon(project, project);
    +
    +        // TODO: fix config story...
    +        addon.app = {
    +          options: { jshintrc: {} },
    +          addonLintTree(type, tree) {
    +            return tree;
    +          },
    +        };
    +
    +        addon.jshintTrees = function () {};
    +      });
    +
    +      it('lints the files before preprocessing', function () {
    +        addon.preprocessJs = function () {
    +          throw new Error('should not preprocess files');
    +        };
    +
    +        let root = path.join(fixturePath, 'with-styles');
    +        addon.root = root;
    +
    +        addon.jshintAddonTree();
    +      });
    +    });
    +
    +    it('modifying a treePath does not affect other addons', function () {
    +      let first = new FirstAddon(project);
    +      let second = new SecondAddon(project);
    +
    +      expect(first.treePaths.vendor).to.equal('blazorz');
    +      expect(second.treePaths.vendor).to.equal('blammo');
    +    });
    +
    +    it('modifying a treeForMethod does not affect other addons', function () {
    +      let first = new FirstAddon(project);
    +      let second = new SecondAddon(project);
    +
    +      expect(first.treeForMethods.public).to.equal('huzzah!');
    +      expect(second.treeForMethods.public).to.equal('boooo');
    +    });
    +  });
    +
    +  describe('initialized addon', function () {
    +    this.timeout(40000);
    +    beforeEach(function () {
    +      projectPath = path.resolve(fixturePath, 'simple');
    +      const packageContents = require(path.join(projectPath, 'package.json'));
    +      let ui = new MockUI();
    +      let cli = new MockCLI({ ui });
    +      project = new Project(projectPath, packageContents, ui, cli);
    +      project.initializeAddons();
    +    });
    +
    +    describe('generated addon', function () {
    +      beforeEach(function () {
    +        addon = findWhere(project.addons, { name: 'ember-generated-with-export-addon' });
    +
    +        // Clear the caches
    +        delete addon._moduleName;
    +      });
    +
    +      it('sets its project', function () {
    +        expect(addon.project.name).to.equal(project.name);
    +      });
    +
    +      it('sets its parent', function () {
    +        expect(addon.parent.name).to.equal(project.name);
    +      });
    +
    +      it('sets the root', function () {
    +        expect(addon.root).to.not.equal(undefined);
    +      });
    +
    +      it('sets the pkg', function () {
    +        expect(addon.pkg).to.not.equal(undefined);
    +      });
    +
    +      describe('trees for its treePaths', function () {
    +        it('app', function () {
    +          let tree = addon.treeFor('app');
    +          expect(typeof (tree.read || tree.rebuild)).to.equal('function');
    +        });
    +
    +        it('styles', function () {
    +          let tree = addon.treeFor('styles');
    +          expect(typeof (tree.read || tree.rebuild)).to.equal('function');
    +        });
    +
    +        it('templates', function () {
    +          let tree = addon.treeFor('templates');
    +          expect(typeof (tree.read || tree.rebuild)).to.equal('function');
    +        });
    +
    +        it('addon-templates', function () {
    +          let tree = addon.treeFor('addon-templates');
    +          expect(typeof (tree.read || tree.rebuild)).to.equal('function');
    +        });
    +
    +        it('vendor', function () {
    +          let tree = addon.treeFor('vendor');
    +          expect(typeof (tree.read || tree.rebuild)).to.equal('function');
    +        });
    +
    +        it('addon', function () {
    +          let app = {
    +            importWhitelist: {},
    +            options: {},
    +          };
    +          addon.registry = {
    +            app: addon,
    +            load() {
    +              return [
    +                {
    +                  toTree(tree) {
    +                    return tree;
    +                  },
    +                },
    +              ];
    +            },
    +
    +            extensionsForType() {
    +              return ['js'];
    +            },
    +          };
    +          addon.app = app;
    +          let tree = addon.treeFor('addon');
    +          expect(typeof (tree.read || tree.rebuild)).to.equal('function');
    +        });
    +      });
    +
    +      describe('custom treeFor methods', function () {
    +        it('can define treeForApp', function () {
    +          addon.treeForApp = td.function();
    +          addon.treeFor('app');
    +          td.verify(addon.treeForApp(), { ignoreExtraArgs: true });
    +        });
    +
    +        it('can define treeForStyles', function () {
    +          addon.treeForStyles = td.function();
    +          addon.treeFor('styles');
    +          td.verify(addon.treeForStyles(), { ignoreExtraArgs: true });
    +        });
    +
    +        it('can define treeForVendor', function () {
    +          addon.treeForVendor = td.function();
    +          addon.treeFor('vendor');
    +          td.verify(addon.treeForVendor(), { ignoreExtraArgs: true });
    +        });
    +
    +        it('can define treeForTemplates', function () {
    +          addon.treeForTemplates = td.function();
    +          addon.treeFor('templates');
    +          td.verify(addon.treeForTemplates(), { ignoreExtraArgs: true });
    +        });
    +
    +        it('can define treeForAddonTemplates', function () {
    +          addon.treeForAddonTemplates = td.function();
    +          addon.treeFor('addon-templates');
    +          td.verify(addon.treeForAddonTemplates(), { ignoreExtraArgs: true });
    +        });
    +
    +        it('can define treeForPublic', function () {
    +          addon.treeForPublic = td.function();
    +          addon.treeFor('public');
    +          td.verify(addon.treeForPublic(), { ignoreExtraArgs: true });
    +        });
    +      });
    +    });
    +
    +    describe('addon with dependencies', function () {
    +      beforeEach(function () {
    +        addon = findWhere(project.addons, { name: 'ember-addon-with-dependencies' });
    +      });
    +
    +      it("returns a listing of all dependencies in the addon's package.json", function () {
    +        let expected = {
    +          'ember-cli': 'latest',
    +          'something-else': 'latest',
    +        };
    +
    +        expect(addon.dependencies()).to.deep.equal(expected);
    +      });
    +    });
    +
    +    it('must define a `name` property', function () {
    +      let Foo = Addon.extend({ root: 'foo' });
    +
    +      expect(() => {
    +        new Foo(project);
    +      }).to.throw(/An addon must define a `name` property./);
    +    });
    +
    +    describe('isDevelopingAddon', function () {
    +      let originalEnvValue, addon, project;
    +
    +      beforeEach(function () {
    +        let MyAddon = Addon.extend({
    +          name: 'test-project',
    +          root: 'foo',
    +        });
    +
    +        let projectPath = path.resolve(fixturePath, 'simple');
    +        const packageContents = require(path.join(projectPath, 'package.json'));
    +        let cli = new MockCLI();
    +
    +        project = new Project(projectPath, packageContents, cli.ui, cli);
    +
    +        addon = new MyAddon(project, project);
    +
    +        originalEnvValue = process.env.EMBER_ADDON_ENV;
    +      });
    +
    +      afterEach(function () {
    +        if (originalEnvValue === undefined) {
    +          delete process.env.EMBER_ADDON_ENV;
    +        } else {
    +          process.env.EMBER_ADDON_ENV = originalEnvValue;
    +        }
    +
    +        delete process.env.EMBER_CLI_IGNORE_ADDON_NAME_MISMATCH;
    +      });
    +
    +      it('returns true when `EMBER_ADDON_ENV` is set to development', function () {
    +        process.env.EMBER_ADDON_ENV = 'development';
    +
    +        expect(addon.isDevelopingAddon(), 'addon is being developed').to.eql(true);
    +      });
    +
    +      it('throws when the addon name is prefixed in package.json and not in index.js', function () {
    +        process.env.EMBER_ADDON_ENV = 'development';
    +        project.root = 'foo';
    +        project.name = () => '@foo/my-addon';
    +        addon.name = 'my-addon';
    +        expect(() => addon.isDevelopingAddon()).to.throw(/Your names in package.json and index.js should match*/);
    +      });
    +
    +      it('does not throw for a mismatched addon name when process.env.EMBER_CLI_IGNORE_ADDON_NAME_MISMATCH is set', function () {
    +        process.env.EMBER_CLI_IGNORE_ADDON_NAME_MISMATCH = 'true';
    +        process.env.EMBER_ADDON_ENV = 'development';
    +        project.root = 'foo';
    +        project.name = () => '@foo/my-addon';
    +        addon.name = 'my-addon';
    +        expect(addon.isDevelopingAddon()).to.eql(true);
    +      });
    +
    +      it('throws an error if addon name is different in package.json and index.js ', function () {
    +        process.env.EMBER_ADDON_ENV = 'development';
    +        project.root = 'foo';
    +        project.name = () => 'foo-my-addon';
    +        addon.name = 'my-addon';
    +        expect(() => addon.isDevelopingAddon()).to.throw(/Your names in package.json and index.js should match*/);
    +      });
    +
    +      it('returns false when `EMBER_ADDON_ENV` is not set', function () {
    +        delete process.env.EMBER_ADDON_ENV;
    +
    +        expect(addon.isDevelopingAddon()).to.eql(false);
    +      });
    +
    +      it('returns false when `EMBER_ADDON_ENV` is something other than `development`', function () {
    +        process.env.EMBER_ADDON_ENV = 'production';
    +
    +        expect(addon.isDevelopingAddon()).to.equal(false);
    +      });
    +
    +      it('returns false when the addon is not the one being developed', function () {
    +        process.env.EMBER_ADDON_ENV = 'development';
    +
    +        addon.name = 'my-addon';
    +        expect(addon.isDevelopingAddon(), 'addon is not being developed').to.eql(false);
    +      });
    +    });
    +
    +    describe('findOwnAddonByName', function () {
    +      let ThisAddon = Addon.extend({
    +        root: 'foo',
    +        name: 'this-addon',
    +      });
    +
    +      it('it has the given addon', function () {
    +        let addon = new ThisAddon();
    +        let ownAddon = { name: 'my-cool-addon' };
    +        addon.addons = [ownAddon];
    +        expect(addon.findOwnAddonByName('my-cool-addon')).to.eql(ownAddon);
    +      });
    +
    +      it('it does not have the given addon', function () {
    +        let addon = new ThisAddon();
    +        let ownAddon = { name: 'my-cool-addon' };
    +        addon.addons = [ownAddon];
    +        expect(addon.findOwnAddonByName('my-non-existentcool-addon')).to.eql(undefined);
    +      });
    +    });
    +
    +    describe('hintingEnabled', function () {
    +      /**
    +        Tests the various configuration options that affect the hintingEnabled method.
    +
    +       | configuration | test1 | test2 | test3 | test4 | test5 |
    +       | ------------- | ----- | ----- | ----- | ----- | ----- |
    +       | hinting       | true  | true  | true  | false | unset |
    +       | environment   | dev   | N/A   | prod  | N\A   | N\A   |
    +       | test_command  | set   | set   | unset | set   | set   |
    +       | RESULT        | true  | true  | false | false | true  |
    +
    +        @method hintingEnabled
    +       */
    +
    +      let originalEnvValue, originalEmberEnvValue, originalTestCommand, addon, project;
    +
    +      beforeEach(function () {
    +        let MyAddon = Addon.extend({
    +          name: 'test-project',
    +          root: 'foo',
    +        });
    +
    +        let projectPath = path.resolve(fixturePath, 'simple');
    +        const packageContents = require(path.join(projectPath, 'package.json'));
    +        let cli = new MockCLI();
    +
    +        project = new Project(projectPath, packageContents, cli.ui, cli);
    +
    +        addon = new MyAddon(project);
    +
    +        originalEmberEnvValue = process.env.EMBER_ENV;
    +        originalEnvValue = process.env.EMBER_ADDON_ENV;
    +        originalTestCommand = process.env.EMBER_CLI_TEST_COMMAND;
    +      });
    +
    +      afterEach(function () {
    +        addon.app = {
    +          options: {},
    +        };
    +
    +        if (originalEnvValue === undefined) {
    +          delete process.env.EMBER_ADDON_ENV;
    +        } else {
    +          process.env.EMBER_ADDON_ENV = originalEnvValue;
    +        }
    +
    +        if (originalTestCommand === undefined) {
    +          delete process.env.EMBER_CLI_TEST_COMMAND;
    +        } else {
    +          process.env.EMBER_CLI_TEST_COMMAND = originalTestCommand;
    +        }
    +
    +        if (originalEmberEnvValue === undefined) {
    +          delete process.env.EMBER_ENV;
    +        } else {
    +          process.env.EMBER_ENV = originalEmberEnvValue;
    +        }
    +      });
    +
    +      it('returns true when `EMBER_ENV` is not set to production and options.hinting is true', function () {
    +        process.env.EMBER_ENV = 'development';
    +
    +        addon.app = {
    +          options: { hinting: true },
    +        };
    +
    +        expect(addon.hintingEnabled()).to.be.true;
    +      });
    +
    +      it('returns true when `EMBER_CLI_TEST_COMMAND` is set and options.hinting is true', function () {
    +        addon.app = {
    +          options: { hinting: true },
    +        };
    +
    +        expect(addon.hintingEnabled()).to.be.true;
    +      });
    +
    +      it('returns false when `EMBER_ENV` is set to production, `EMBER_CLI_TEST_COMMAND` is unset and options.hinting is true', function () {
    +        process.env.EMBER_ENV = 'production';
    +        delete process.env.EMBER_CLI_TEST_COMMAND;
    +
    +        addon.app = {
    +          options: { hinting: true },
    +        };
    +
    +        expect(addon.hintingEnabled()).to.be.false;
    +      });
    +
    +      it('returns false when options.hinting is set to false', function () {
    +        addon.app = {
    +          options: { hinting: false },
    +        };
    +
    +        expect(addon.hintingEnabled()).to.be.false;
    +      });
    +
    +      it('returns true when options.hinting is not set', function () {
    +        expect(addon.hintingEnabled()).to.be.ok;
    +      });
    +    });
    +
    +    describe('treeGenerator', function () {
    +      it('watch tree when developing the addon itself', function () {
    +        addon.isDevelopingAddon = function () {
    +          return true;
    +        };
    +
    +        let tree = addon.treeGenerator('foo/bar');
    +
    +        expect(tree.__broccoliGetInfo__()).to.have.property('watched', true);
    +      });
    +
    +      it('uses UnwatchedDir when not developing the addon itself', function () {
    +        addon.isDevelopingAddon = function () {
    +          return false;
    +        };
    +
    +        let tree = addon.treeGenerator('foo/bar');
    +
    +        expect(tree.__broccoliGetInfo__()).to.have.property('watched', false);
    +      });
    +    });
    +
    +    describe('blueprintsPath', function () {
    +      let tmpdir;
    +
    +      beforeEach(async function () {
    +        tmpdir = await mkTmpDirIn(tmproot);
    +        addon.root = tmpdir;
    +      });
    +
    +      afterEach(function () {
    +        return fs.remove(tmproot);
    +      });
    +
    +      it('returns undefined if the `blueprint` folder does not exist', function () {
    +        let returnedPath = addon.blueprintsPath();
    +
    +        expect(returnedPath).to.equal(undefined);
    +      });
    +
    +      it('returns blueprint path if the folder exists', function () {
    +        let blueprintsDir = path.join(tmpdir, 'blueprints');
    +        fs.mkdirSync(blueprintsDir);
    +
    +        let returnedPath = addon.blueprintsPath();
    +
    +        expect(returnedPath).to.equal(blueprintsDir);
    +      });
    +    });
    +
    +    describe('config', function () {
    +      it('returns undefined if `config/environment.js` does not exist', function () {
    +        addon.root = path.join(fixturePath, 'no-config');
    +        let result = addon.config();
    +
    +        expect(result).to.equal(undefined);
    +      });
    +
    +      it('returns blueprint path if the folder exists', function () {
    +        addon.root = path.join(fixturePath, 'with-config');
    +        let appConfig = {};
    +
    +        addon.config('development', appConfig);
    +
    +        expect(appConfig.addon).to.equal('with-config');
    +      });
    +    });
    +  });
    +
    +  describe('compileTemplates', function () {
    +    beforeEach(function () {
    +      projectPath = path.resolve(fixturePath, 'simple');
    +      const packageContents = require(path.join(projectPath, 'package.json'));
    +      let cli = new MockCLI();
    +
    +      project = new Project(projectPath, packageContents, cli.ui, cli);
    +
    +      project.initializeAddons();
    +
    +      addon = findWhere(project.addons, { name: 'ember-generated-with-export-addon' });
    +    });
    +
    +    it('should not throw an error if addon/templates is present but empty', function () {
    +      addon.root = path.join(fixturePath, 'with-empty-addon-templates');
    +
    +      expect(() => {
    +        addon.compileTemplates();
    +      }).not.to.throw();
    +    });
    +  });
    +
    +  describe('_fileSystemInfo', function () {
    +    beforeEach(function () {
    +      projectPath = path.resolve(fixturePath, 'simple');
    +      const packageContents = require(path.join(projectPath, 'package.json'));
    +      let cli = new MockCLI();
    +
    +      project = new Project(projectPath, packageContents, cli.ui, cli);
    +
    +      project.initializeAddons();
    +
    +      addon = findWhere(project.addons, { name: 'ember-generated-with-export-addon' });
    +    });
    +
    +    it('should not call _getAddonTemplatesTreeFiles when default treePath is used', function () {
    +      let wasCalled = false;
    +      addon._getAddonTemplatesTreeFiles = function () {
    +        wasCalled = true;
    +        return [];
    +      };
    +
    +      addon._fileSystemInfo();
    +
    +      expect(wasCalled).to.not.be.ok;
    +    });
    +
    +    it("should call _getAddonTemplatesTreeFiles when custom treePaths['addon-templates'] is used", function () {
    +      addon.treePaths['addon-templates'] = 'foo';
    +      let wasCalled = false;
    +      addon._getAddonTemplatesTreeFiles = function () {
    +        wasCalled = true;
    +        return [];
    +      };
    +
    +      addon._fileSystemInfo();
    +
    +      expect(wasCalled).to.be.ok;
    +    });
    +
    +    it('hasPodTemplates when pod templates found', function () {
    +      addon._getAddonTreeFiles = function () {
    +        return ['foo-bar/', 'foo-bar/component.js', 'foo-bar/template.hbs'];
    +      };
    +
    +      expect(addon._fileSystemInfo()).to.deep.equal({
    +        hasJSFiles: true,
    +        hasTemplates: true,
    +        hasPodTemplates: true,
    +      });
    +    });
    +
    +    it('does not hasPodTemplates when no pod templates found', function () {
    +      addon._getAddonTreeFiles = function () {
    +        return ['templates/', 'templates/components/', 'templates/components/foo-bar.hbs'];
    +      };
    +
    +      expect(addon._fileSystemInfo()).to.deep.equal({
    +        hasJSFiles: false,
    +        hasTemplates: true,
    +        hasPodTemplates: false,
    +      });
    +    });
    +
    +    it('does not hasPodTemplates when no pod templates found (pod-like structure in `addon/templates/`)', function () {
    +      addon._getAddonTreeFiles = function () {
    +        return [
    +          'templates/',
    +          // this doesn't need "pod template handling" because
    +          // it is actually in the addon-templates tree
    +          'templates/foo-bar/template.hbs',
    +        ];
    +      };
    +
    +      expect(addon._fileSystemInfo()).to.deep.equal({
    +        hasJSFiles: false,
    +        hasTemplates: true,
    +        hasPodTemplates: false,
    +      });
    +    });
    +
    +    it('does not hasTemplates when no templates found', function () {
    +      addon._getAddonTreeFiles = function () {
    +        return ['components/', 'components/foo-bar.js', 'templates/', 'templates/components/'];
    +      };
    +
    +      expect(addon._fileSystemInfo()).to.deep.equal({
    +        hasJSFiles: true,
    +        hasTemplates: false,
    +        hasPodTemplates: false,
    +      });
    +    });
    +
    +    it('does not hasJSFiles when none found', function () {
    +      addon._getAddonTreeFiles = function () {
    +        return ['components/', 'templates/', 'templates/components/', 'styles/foo.css'];
    +      };
    +
    +      expect(addon._fileSystemInfo()).to.deep.equal({
    +        hasJSFiles: false,
    +        hasTemplates: false,
    +        hasPodTemplates: false,
    +      });
    +    });
    +  });
    +
    +  describe('packageInfoCache', function () {
    +    let packageInfoCache, addon, ui;
    +
    +    beforeEach(function () {
    +      projectPath = path.resolve(fixturePath, 'simple');
    +      const packageContents = require(path.join(projectPath, 'package.json'));
    +
    +      ui = new MockUI();
    +      let cli = new MockCLI({ ui });
    +      project = new Project(projectPath, packageContents, ui, cli);
    +
    +      let AddonTemp = Addon.extend({
    +        name: 'temp',
    +        root: 'foo',
    +      });
    +
    +      addon = new AddonTemp(project, project);
    +      packageInfoCache = addon.packageInfoCache;
    +    });
    +
    +    it("is provided with the parent's `packageInfoCache` object", function () {
    +      expect(packageInfoCache).to.equal(project.packageInfoCache);
    +    });
    +  });
    +
    +  describe('treeForStyles', function () {
    +    let builder, addon;
    +
    +    beforeEach(function () {
    +      projectPath = path.resolve(fixturePath, 'with-app-styles');
    +      const packageContents = require(path.join(projectPath, 'package.json'));
    +      let cli = new MockCLI();
    +
    +      project = new Project(projectPath, packageContents, cli.ui, cli);
    +
    +      let BaseAddon = Addon.extend({
    +        name: 'test-project',
    +        root: projectPath,
    +      });
    +
    +      addon = new BaseAddon(project, project);
    +    });
    +
    +    afterEach(function () {
    +      if (builder) {
    +        return builder.cleanup();
    +      }
    +    });
    +
    +    it('should move files in the root of the addons app/styles tree into the app/styles path', async function () {
    +      builder = new broccoli.Builder(addon.treeFor('styles'));
    +
    +      let results = await builder.build();
    +      let outputPath = results.directory;
    +
    +      let expected = ['app/', 'app/styles/', 'app/styles/foo-bar.css'];
    +
    +      expect(walkSync(outputPath)).to.eql(expected);
    +    });
    +  });
    +
    +  describe('._eachProjectAddonInvoke', function () {
    +    beforeEach(function () {
    +      let MyAddon = Addon.extend({
    +        name: 'test-project',
    +        root: 'foo',
    +      });
    +
    +      let projectPath = path.resolve(fixturePath, 'simple');
    +      const packageContents = require(path.join(projectPath, 'package.json'));
    +      let cli = new MockCLI();
    +
    +      project = new Project(projectPath, packageContents, cli.ui, cli);
    +      addon = new MyAddon(project, project);
    +    });
    +
    +    it('should invoke the method on each of the project addons', function () {
    +      let counter = 0;
    +      project.addons = [
    +        {
    +          foo(num) {
    +            counter += num;
    +          },
    +        },
    +        {
    +          foo(num) {
    +            counter += num;
    +          },
    +        },
    +      ];
    +
    +      addon._eachProjectAddonInvoke('foo', [1]);
    +      expect(counter).to.eql(2);
    +    });
    +
    +    it('should provide default arguments if none are specified', function () {
    +      let counter = 0;
    +      project.addons = [
    +        {
    +          foo() {
    +            counter += 1;
    +          },
    +        },
    +        {
    +          foo() {
    +            counter += 1;
    +          },
    +        },
    +      ];
    +
    +      addon._eachProjectAddonInvoke('foo');
    +      expect(counter).to.eql(2);
    +    });
    +  });
    +
    +  describe('addon tree caching', function () {
    +    let projectPath = path.resolve(fixturePath, 'simple');
    +    const packageContents = require(path.join(projectPath, 'package.json'));
    +
    +    function createAddon(Addon) {
    +      let cli = new MockCLI();
    +      let project = new Project(projectPath, packageContents, cli.ui, cli);
    +      return new Addon(project, project);
    +    }
    +
    +    describe('cacheKeyForTree', function () {
    +      it('returns null if `treeForApp` methods are implemented for the app tree', function () {
    +        let addon = createAddon(
    +          Addon.extend({
    +            name: 'test-project',
    +            root: 'foo',
    +            treeForApp() {},
    +          })
    +        );
    +
    +        expect(addon.cacheKeyForTree('app')).to.equal(null);
    +      });
    +
    +      it('returns null if `compileAddon` methods are implemented for the addon tree', function () {
    +        let addon = createAddon(
    +          Addon.extend({
    +            name: 'test-project',
    +            root: 'foo',
    +            compileAddon() {},
    +          })
    +        );
    +
    +        expect(addon.cacheKeyForTree('addon')).to.equal(null);
    +      });
    +
    +      it('returns null if `treeForMethods` is modified', function () {
    +        let addon = createAddon(
    +          Addon.extend({
    +            name: 'test-project',
    +            root: 'foo',
    +            init() {
    +              this._super && this._super.init.apply(this, arguments);
    +
    +              this.treeForMethods['app'] = 'treeForZOMG_WHY!?!';
    +            },
    +          })
    +        );
    +
    +        expect(addon.cacheKeyForTree('app')).to.equal(null);
    +      });
    +
    +      it('returns stable value for repeated invocations', function () {
    +        let addon = createAddon(
    +          Addon.extend({
    +            name: 'test-project',
    +            root: 'foo',
    +          })
    +        );
    +
    +        let firstResult = addon.cacheKeyForTree('app');
    +        let secondResult = addon.cacheKeyForTree('app');
    +
    +        expect(firstResult).to.equal(secondResult);
    +      });
    +    });
    +
    +    describe('treeFor caching', function () {
    +      it('defining custom treeForAddon without modifying cacheKeyForTree does not cache', function () {
    +        let addon = createAddon(
    +          Addon.extend({
    +            name: 'test-project',
    +            root: path.join(projectPath, 'node_modules', 'ember-generated-with-export-addon'),
    +            treeForAddon(tree) {
    +              return tree;
    +            },
    +          })
    +        );
    +
    +        let firstTree = addon.treeFor('addon');
    +        let secondTree = addon.treeFor('addon');
    +
    +        expect(firstTree).not.to.equal(secondTree);
    +      });
    +
    +      it('defining custom cacheKeyForTree allows addon control of cache', function () {
    +        let addonProto = {
    +          name: 'test-project',
    +          root: path.join(projectPath, 'node_modules', 'ember-generated-with-export-addon'),
    +          treeForAddon(tree) {
    +            return tree;
    +          },
    +        };
    +        addonProto.cacheKeyForTree = function (type) {
    +          return type;
    +        };
    +
    +        let addon = createAddon(Addon.extend(addonProto));
    +        let firstTree = addon.treeFor('addon');
    +        let secondTree = addon.treeFor('addon');
    +
    +        expect(firstTree).to.equal(secondTree);
    +      });
    +    });
    +  });
    +});
    +
    +
    + +
    +
    +
    +
    + + + + + diff --git a/api/index.html b/api/index.html index 58a67aa..ff2498b 100644 --- a/api/index.html +++ b/api/index.html @@ -42,15 +42,19 @@

    Classes

  • Builder
  • CLI
  • Command
  • +
  • CommandGenerator
  • DefaultPackager
  • EmberAddon
  • EmberApp
  • +
  • HardwareInfo
  • HistorySupportAddon
  • Instrumentation
  • NodeModulesList
  • NpmTask
  • +
  • PackageCache
  • PackageInfo
  • PackageInfoCache
  • +
  • PrivateTestHelpers
  • Project
  • ServeFilesAddon
  • TestsServerAddon
  • @@ -65,7 +69,7 @@

    Classes

    - Version: 3.8.1--84707b2801 + Version: 3.21.2
    @@ -73,14 +77,13 @@

    Classes

    ember-cli

    Latest npm release -TravisCI Build Status -AppVeyor Build Status +GitHub Actions CI Test Coverage Code Climate

    The Ember.js command line utility.

    Features