UI for Zipcoin Blue

serve.js 6.0KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155
  1. "use strict";
  2. Object.defineProperty(exports, "__esModule", { value: true });
  3. const tslib_1 = require("tslib");
  4. const chalk_1 = require("chalk");
  5. const command_1 = require("@ionic/cli-utils/lib/command");
  6. const serve_1 = require("@ionic/cli-utils/lib/serve");
  7. let ServeCommand = class ServeCommand extends command_1.Command {
  8. preRun(inputs, options) {
  9. return tslib_1.__awaiter(this, void 0, void 0, function* () {
  10. if (options['nolivereload']) {
  11. this.env.log.warn(`The ${chalk_1.default.green('--nolivereload')} option has been deprecated. Please use ${chalk_1.default.green('--no-livereload')}.`);
  12. options['livereload'] = false;
  13. }
  14. if (options['nobrowser']) {
  15. this.env.log.warn(`The ${chalk_1.default.green('--nobrowser')} option has been deprecated. Please use ${chalk_1.default.green('--no-open')}.`);
  16. options['open'] = false;
  17. }
  18. if (options['b']) {
  19. options['open'] = false;
  20. }
  21. if (options['noproxy']) {
  22. this.env.log.warn(`The ${chalk_1.default.green('--noproxy')} option has been deprecated. Please use ${chalk_1.default.green('--no-proxy')}.`);
  23. options['proxy'] = false;
  24. }
  25. if (options['x']) {
  26. options['proxy'] = false;
  27. }
  28. });
  29. }
  30. run(inputs, options) {
  31. return tslib_1.__awaiter(this, void 0, void 0, function* () {
  32. const { serve } = yield Promise.resolve().then(() => require('@ionic/cli-utils/commands/serve'));
  33. yield serve(this.env, inputs, options);
  34. });
  35. }
  36. };
  37. ServeCommand = tslib_1.__decorate([
  38. command_1.CommandMetadata({
  39. name: 'serve',
  40. type: 'project',
  41. description: 'Start a local dev server for app dev/testing',
  42. longDescription: `
  43. Easily spin up a development server which launches in your browser. It watches for changes in your source files and automatically reloads with the updated build.
  44. By default, ${chalk_1.default.green('ionic serve')} boots up a development server on all network interfaces and prints the external address(es) on which your app is being served. It also broadcasts your app to the Ionic DevApp on your network. To disable the DevApp and bind to ${chalk_1.default.green('localhost')}, use ${chalk_1.default.green('--local')}.
  45. Try the ${chalk_1.default.green('--lab')} option to see multiple platforms at once.
  46. `,
  47. exampleCommands: ['-c', '--lab -c'],
  48. options: [
  49. {
  50. name: 'consolelogs',
  51. description: 'Print app console logs to Ionic CLI',
  52. type: Boolean,
  53. aliases: ['c'],
  54. },
  55. {
  56. name: 'serverlogs',
  57. description: 'Print dev server logs to Ionic CLI',
  58. type: Boolean,
  59. aliases: ['s'],
  60. visible: false,
  61. },
  62. {
  63. name: 'address',
  64. description: 'Use specific address for the dev server',
  65. default: serve_1.BIND_ALL_ADDRESS,
  66. advanced: true,
  67. },
  68. {
  69. name: 'port',
  70. description: 'Use specific port for HTTP',
  71. default: String(serve_1.DEFAULT_SERVER_PORT),
  72. aliases: ['p'],
  73. advanced: true,
  74. },
  75. {
  76. name: 'livereload',
  77. description: 'Spin up server to live-reload www files',
  78. type: Boolean,
  79. default: true,
  80. visible: false,
  81. },
  82. {
  83. name: 'livereload-port',
  84. description: 'Use specific port for live-reload',
  85. default: String(serve_1.DEFAULT_LIVERELOAD_PORT),
  86. aliases: ['r'],
  87. advanced: true,
  88. },
  89. {
  90. name: 'dev-logger-port',
  91. description: 'Use specific port for dev server communication',
  92. default: String(serve_1.DEFAULT_DEV_LOGGER_PORT),
  93. advanced: true,
  94. },
  95. {
  96. name: 'devapp',
  97. description: 'Do not publish DevApp service',
  98. type: Boolean,
  99. default: true,
  100. advanced: true,
  101. },
  102. {
  103. name: 'open',
  104. description: 'Do not open a browser window',
  105. type: Boolean,
  106. default: true,
  107. },
  108. {
  109. name: 'local',
  110. description: 'Disable external network usage',
  111. type: Boolean,
  112. },
  113. {
  114. name: 'proxy',
  115. description: 'Do not add proxies',
  116. type: Boolean,
  117. default: true,
  118. advanced: true,
  119. },
  120. {
  121. name: 'browser',
  122. description: `Specifies the browser to use (${serve_1.BROWSERS.map(b => chalk_1.default.green(b)).join(', ')})`,
  123. aliases: ['w'],
  124. advanced: true,
  125. },
  126. {
  127. name: 'browseroption',
  128. description: `Specifies a path to open to (${chalk_1.default.green('/#/tab/dash')})`,
  129. aliases: ['o'],
  130. advanced: true,
  131. },
  132. {
  133. name: 'lab',
  134. description: 'Test your apps on multiple platform types in the browser',
  135. type: Boolean,
  136. aliases: ['l'],
  137. },
  138. {
  139. name: 'platform',
  140. description: `Start serve with a specific platform (${['android', 'ios'].map(t => chalk_1.default.green(t)).join(', ')})`,
  141. aliases: ['t'],
  142. },
  143. {
  144. name: 'auth',
  145. description: 'HTTP Basic Auth password to secure the server on your local network',
  146. type: String,
  147. visible: false,
  148. },
  149. ],
  150. })
  151. ], ServeCommand);
  152. exports.ServeCommand = ServeCommand;