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.resolvePreset = exports.resolvePlugin = 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 _resolvePlugin = require("../helpers/resolve-plugin");
  43.  
  44. Object.defineProperty(exports, "resolvePlugin", {
  45.   enumerable: true,
  46.   get: function get() {
  47.     return _interopRequireDefault(_resolvePlugin).default;
  48.   }
  49. });
  50.  
  51. var _resolvePreset = require("../helpers/resolve-preset");
  52.  
  53. Object.defineProperty(exports, "resolvePreset", {
  54.   enumerable: true,
  55.   get: function get() {
  56.     return _interopRequireDefault(_resolvePreset).default;
  57.   }
  58. });
  59.  
  60. var _package = require("../../package");
  61.  
  62. Object.defineProperty(exports, "version", {
  63.   enumerable: true,
  64.   get: function get() {
  65.     return _package.version;
  66.   }
  67. });
  68. exports.Plugin = Plugin;
  69. exports.transformFile = transformFile;
  70. exports.transformFileSync = transformFileSync;
  71.  
  72. var _fs = require("fs");
  73.  
  74. var _fs2 = _interopRequireDefault(_fs);
  75.  
  76. var _util = require("../util");
  77.  
  78. var util = _interopRequireWildcard(_util);
  79.  
  80. var _babelMessages = require("babel-messages");
  81.  
  82. var messages = _interopRequireWildcard(_babelMessages);
  83.  
  84. var _babelTypes = require("babel-types");
  85.  
  86. var t = _interopRequireWildcard(_babelTypes);
  87.  
  88. var _babelTraverse = require("babel-traverse");
  89.  
  90. var _babelTraverse2 = _interopRequireDefault(_babelTraverse);
  91.  
  92. var _optionManager = require("../transformation/file/options/option-manager");
  93.  
  94. var _optionManager2 = _interopRequireDefault(_optionManager);
  95.  
  96. var _pipeline = require("../transformation/pipeline");
  97.  
  98. var _pipeline2 = _interopRequireDefault(_pipeline);
  99.  
  100. 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; } }
  101.  
  102. function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
  103.  
  104. exports.util = util;
  105. exports.messages = messages;
  106. exports.types = t;
  107. exports.traverse = _babelTraverse2.default;
  108. exports.OptionManager = _optionManager2.default;
  109. function Plugin(alias) {
  110.   throw new Error("The (" + alias + ") Babel 5 plugin is being run with Babel 6.");
  111. }
  112.  
  113. exports.Pipeline = _pipeline2.default;
  114.  
  115.  
  116. var pipeline = new _pipeline2.default();
  117. var analyse = exports.analyse = pipeline.analyse.bind(pipeline);
  118. var transform = exports.transform = pipeline.transform.bind(pipeline);
  119. var transformFromAst = exports.transformFromAst = pipeline.transformFromAst.bind(pipeline);
  120.  
  121. function transformFile(filename, opts, callback) {
  122.   if (typeof opts === "function") {
  123.     callback = opts;
  124.     opts = {};
  125.   }
  126.  
  127.   opts.filename = filename;
  128.  
  129.   _fs2.default.readFile(filename, function (err, code) {
  130.     var result = void 0;
  131.  
  132.     if (!err) {
  133.       try {
  134.         result = transform(code, opts);
  135.       } catch (_err) {
  136.         err = _err;
  137.       }
  138.     }
  139.  
  140.     if (err) {
  141.       callback(err);
  142.     } else {
  143.       callback(null, result);
  144.     }
  145.   });
  146. }
  147.  
  148. function transformFileSync(filename) {
  149.   var opts = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
  150.  
  151.   opts.filename = filename;
  152.   return transform(_fs2.default.readFileSync(filename, "utf8"), opts);
  153. }
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