BVB Source Codes

reactide Show node.js Source code

Return Download reactide: download node.js Source code - Download reactide Source code - Type:.js
  1. "use strict";
  2.  
  3. exports.__esModule = true;
  4. exports.transformFromAst = exports.transform = exports.analyse = exports.Pipeline = exports.OptionManager = exports.traverse = exports.types = exports.messages = exports.util = exports.version = exports.template = exports.buildExternalHelpers = exports.options = exports.File = undefined;
  5.  
  6. var _file = require("../transformation/file");
  7.  
  8. Object.defineProperty(exports, "File", {
  9.   enumerable: true,
  10.   get: function get() {
  11.     return _interopRequireDefault(_file).default;
  12.   }
  13. });
  14.  
  15. var _config = require("../transformation/file/options/config");
  16.  
  17. Object.defineProperty(exports, "options", {
  18.   enumerable: true,
  19.   get: function get() {
  20.     return _interopRequireDefault(_config).default;
  21.   }
  22. });
  23.  
  24. var _buildExternalHelpers = require("../tools/build-external-helpers");
  25.  
  26. Object.defineProperty(exports, "buildExternalHelpers", {
  27.   enumerable: true,
  28.   get: function get() {
  29.     return _interopRequireDefault(_buildExternalHelpers).default;
  30.   }
  31. });
  32.  
  33. var _babelTemplate = require("babel-template");
  34.  
  35. Object.defineProperty(exports, "template", {
  36.   enumerable: true,
  37.   get: function get() {
  38.     return _interopRequireDefault(_babelTemplate).default;
  39.   }
  40. });
  41.  
  42. var _package = require("../../package");
  43.  
  44. Object.defineProperty(exports, "version", {
  45.   enumerable: true,
  46.   get: function get() {
  47.     return _package.version;
  48.   }
  49. });
  50. exports.Plugin = Plugin;
  51. exports.transformFile = transformFile;
  52. exports.transformFileSync = transformFileSync;
  53.  
  54. var _isFunction = require("lodash/isFunction");
  55.  
  56. var _isFunction2 = _interopRequireDefault(_isFunction);
  57.  
  58. var _fs = require("fs");
  59.  
  60. var _fs2 = _interopRequireDefault(_fs);
  61.  
  62. var _util = require("../util");
  63.  
  64. var util = _interopRequireWildcard(_util);
  65.  
  66. var _babelMessages = require("babel-messages");
  67.  
  68. var messages = _interopRequireWildcard(_babelMessages);
  69.  
  70. var _babelTypes = require("babel-types");
  71.  
  72. var t = _interopRequireWildcard(_babelTypes);
  73.  
  74. var _babelTraverse = require("babel-traverse");
  75.  
  76. var _babelTraverse2 = _interopRequireDefault(_babelTraverse);
  77.  
  78. var _optionManager = require("../transformation/file/options/option-manager");
  79.  
  80. var _optionManager2 = _interopRequireDefault(_optionManager);
  81.  
  82. var _pipeline = require("../transformation/pipeline");
  83.  
  84. var _pipeline2 = _interopRequireDefault(_pipeline);
  85.  
  86. function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) newObj[key] = obj[key]; } } newObj.default = obj; return newObj; } }
  87.  
  88. function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
  89.  
  90. //
  91.  
  92. exports.util = util;
  93. exports.messages = messages;
  94. exports.types = t;
  95. exports.traverse = _babelTraverse2.default;
  96. exports.OptionManager = _optionManager2.default;
  97. function Plugin(alias) {
  98.   throw new Error("The (" + alias + ") Babel 5 plugin is being run with Babel 6.");
  99. }
  100.  
  101. //
  102.  
  103. exports.Pipeline = _pipeline2.default;
  104.  
  105.  
  106. var pipeline = new _pipeline2.default();
  107. var analyse = exports.analyse = pipeline.analyse.bind(pipeline);
  108. var transform = exports.transform = pipeline.transform.bind(pipeline);
  109. var transformFromAst = exports.transformFromAst = pipeline.transformFromAst.bind(pipeline);
  110.  
  111. //
  112.  
  113. function transformFile(filename, opts, callback) {
  114.   if ((0, _isFunction2.default)(opts)) {
  115.     callback = opts;
  116.     opts = {};
  117.   }
  118.  
  119.   opts.filename = filename;
  120.  
  121.   _fs2.default.readFile(filename, function (err, code) {
  122.     var result = void 0;
  123.  
  124.     if (!err) {
  125.       try {
  126.         result = transform(code, opts);
  127.       } catch (_err) {
  128.         err = _err;
  129.       }
  130.     }
  131.  
  132.     if (err) {
  133.       callback(err);
  134.     } else {
  135.       callback(null, result);
  136.     }
  137.   });
  138. }
  139.  
  140. function transformFileSync(filename) {
  141.   var opts = arguments.length <= 1 || arguments[1] === undefined ? {} : arguments[1];
  142.  
  143.   opts.filename = filename;
  144.   return transform(_fs2.default.readFileSync(filename, "utf8"), opts);
  145. }
downloadnode.js Source code - Download reactide Source code
Related Source Codes/Software:
rkt - rkt is a pod-native container engine for Linux. It... 2017-06-11
uWebSockets - Tiny WebSockets https://for... 2017-06-11
realworld - TodoMVC for the RealWorld - Exemplary fullstack Me... 2017-06-11
goreplay - GoReplay is an open-source tool for capturing and ... 2017-06-10
pyenv - Simple Python version management 2017-06-10
postal - 2017-06-11
CRYENGINE - CRYENGINE is a powerful real-time game development... 2017-06-11
reactide - Reactide is the first dedicated IDE for React web ... 2017-06-11
redux-saga - An alternative side effect model for Redux apps ... 2017-06-10
angular-starter - 2017-06-10

 Back to top