github.com/anth0d/nomad@v0.0.0-20221214183521-ae3a0a2cad06/ui/config/environment.js (about)

     1  /* eslint-env node */
     2  
     3  let USE_MIRAGE = true;
     4  
     5  if (process.env.USE_MIRAGE) {
     6    USE_MIRAGE = process.env.USE_MIRAGE == 'true';
     7  }
     8  
     9  let USE_PERCY = true;
    10  
    11  if (process.env.USE_PERCY) {
    12    USE_PERCY = process.env.USE_PERCY == 'true';
    13  }
    14  
    15  module.exports = function (environment) {
    16    let ENV = {
    17      modulePrefix: 'nomad-ui',
    18      environment: environment,
    19      rootURL: '/ui/',
    20      locationType: 'auto',
    21      EmberENV: {
    22        FEATURES: {
    23          // Here you can enable experimental features on an ember canary build
    24          // e.g. EMBER_NATIVE_DECORATOR_SUPPORT: true
    25        },
    26        EXTEND_PROTOTYPES: {
    27          // Prevent Ember Data from overriding Date.parse.
    28          Date: false,
    29        },
    30      },
    31  
    32      APP: {
    33        blockingQueries: true,
    34        mirageScenario: 'smallCluster',
    35        mirageWithNamespaces: true,
    36        mirageWithTokens: true,
    37        mirageWithRegions: true,
    38        showStorybookLink: process.env.STORYBOOK_LINK === 'true',
    39      },
    40  
    41      percy: {
    42        enabled: USE_PERCY,
    43      },
    44    };
    45  
    46    if (environment === 'development') {
    47      // ENV.APP.LOG_RESOLVER = true;
    48      // ENV.APP.LOG_ACTIVE_GENERATION = true;
    49      // ENV.APP.LOG_TRANSITIONS = true;
    50      // ENV.APP.LOG_TRANSITIONS_INTERNAL = true;
    51      // ENV.APP.LOG_VIEW_LOOKUPS = true;
    52  
    53      ENV['ember-cli-mirage'] = {
    54        enabled: USE_MIRAGE,
    55        excludeFilesFromBuild: !USE_MIRAGE,
    56      };
    57  
    58      if (process.env.STORYBOOK === 'true') {
    59        ENV.APP.autoboot = false;
    60        ENV.rootURL = '/';
    61      }
    62    }
    63  
    64    if (environment === 'test') {
    65      // Testem prefers this...
    66      ENV.locationType = 'none';
    67  
    68      // keep test console output quieter
    69      ENV.APP.LOG_ACTIVE_GENERATION = false;
    70      ENV.APP.LOG_VIEW_LOOKUPS = false;
    71  
    72      ENV.APP.rootElement = '#ember-testing';
    73      ENV.APP.autoboot = false;
    74  
    75      ENV.browserify = {
    76        tests: true,
    77      };
    78  
    79      ENV['ember-cli-mirage'] = {
    80        trackRequests: true,
    81      };
    82    }
    83  
    84    // if (environment === 'production') {
    85    // }
    86  
    87    return ENV;
    88  };