@samitouri / QOS-React-2 / commits / 94bc29b400

Remove react-tools completely

Paul O’Shannessy committed Jun 15, 2015 at 00:27 UTC 94bc29b400f487aa84c4ff6686e9f41e78b2ccc5
6 files changed -245
Gruntfile.js
-6
@@ -71,10 +71,6 @@ module.exports = function(grunt) {
71 grunt.registerTask('npm-react:release', npmReactTasks.buildRelease);
72 grunt.registerTask('npm-react:pack', npmReactTasks.packRelease);
73
74 - var npmReactToolsTasks = require('./grunt/tasks/npm-react-tools');
75 - grunt.registerTask('npm-react-tools:release', npmReactToolsTasks.buildRelease);
76 - grunt.registerTask('npm-react-tools:pack', npmReactToolsTasks.packRelease);
77 -
74 var npmReactDOMTasks = require('./grunt/tasks/npm-react-dom');
75 grunt.registerTask('npm-react-dom:pack', npmReactDOMTasks.packRelease);
76
@@ -133,8 +129,6 @@ module.exports = function(grunt) {
129 'browserify:addonsMin',
130 'npm-react:release',
131 'npm-react:pack',
136 - 'npm-react-tools:release',
137 - 'npm-react-tools:pack',
132 'npm-react-dom:pack',
133 'npm-react-addons:release',
134 'npm-react-addons:pack',
grunt/tasks/npm-react-tools.js deleted
-53
@@ -1,53 +0,0 @@
1 -'use strict';
2 -
3 -var fs = require('fs');
4 -var grunt = require('grunt');
5 -
6 -var src = 'npm-react-tools';
7 -var srcSrc = 'src/**/*.js';
8 -var dest = 'build/npm-react-tools/';
9 -
10 -function buildRelease() {
11 - if (grunt.file.exists(dest)) {
12 - grunt.file.delete(dest);
13 - }
14 -
15 - // copy all files from src first, includes custom README
16 - var mappings = grunt.file.expandMapping('**/*', dest, {cwd: src});
17 -
18 - // Also copy all files from src/ (for react-native)
19 - mappings = mappings.concat(
20 - grunt.file.expandMapping(srcSrc, dest)
21 - );
22 -
23 - mappings.forEach(function(mapping) {
24 - var mappingSrc = mapping.src[0];
25 - var mappingDest = mapping.dest;
26 - if (grunt.file.isDir(mappingSrc)) {
27 - grunt.file.mkdir(mappingDest);
28 - } else {
29 - grunt.file.copy(mappingSrc, mappingDest);
30 - }
31 - });
32 -}
33 -
34 -function packRelease() {
35 - var done = this.async();
36 - var spawnCmd = {
37 - cmd: 'npm',
38 - args: ['pack', 'npm-react-tools'],
39 - opts: {
40 - cwd: 'build/',
41 - },
42 - };
43 - grunt.util.spawn(spawnCmd, function() {
44 - var buildSrc = 'build/react-tools-' + grunt.config.data.pkg.version + '.tgz';
45 - var buildDest = 'build/react-tools.tgz';
46 - fs.rename(buildSrc, buildDest, done);
47 - });
48 -}
49 -
50 -module.exports = {
51 - buildRelease: buildRelease,
52 - packRelease: packRelease,
53 -};
npm-react-tools/README.md deleted
-65
@@ -1,65 +0,0 @@
1 -# react-tools
2 -
3 -This package compliments the usage of [React](https://facebook.github.io/react/). It ships with tools that are often used in conjunction.
4 -
5 -## JSX
6 -
7 -This package installs a `jsx` executable that can be used to transform JSX into vanilla JS. This is often used as part of a build step. This transform is also exposed as an API.
8 -
9 -By default JSX files with a `.js` extension are transformed. Use the `-x` option to transform files with a `.jsx` extension.
10 -
11 -## Usage
12 -
13 -### Command Line
14 -
15 - Usage: jsx [options] <source directory> <output directory> [<module ID> [<module ID> ...]]
16 -
17 - Options:
18 -
19 - -h, --help output usage information
20 - -V, --version output the version number
21 - -c, --config [file] JSON configuration file (no file or - means STDIN)
22 - -w, --watch Continually rebuild
23 - -x, --extension <js | coffee | ...> File extension to assume when resolving module identifiers (default: js)
24 - --relativize Rewrite all module identifiers to be relative
25 - --follow-requires Scan modules for required dependencies
26 - --cache-dir <directory> Alternate directory to use for disk cache
27 - --no-cache-dir Disable the disk cache
28 - --source-charset <utf8 | win1252 | ...> Charset of source (default: utf8)
29 - --output-charset <utf8 | win1252 | ...> Charset of output (default: utf8)
30 - --harmony Turns on JS transformations such as ES6 Classes etc.
31 - --source-map-inline Embed inline sourcemap in transformed source
32 - --strip-types Strips out type annotations
33 - --es6module Parses the file as a valid ES6 module
34 - --non-strict-es6module Parses the file as an ES6 module, except disables implicit strict-mode (i.e. CommonJS modules et al are allowed)
35 - --target <version> Target version of ECMAScript. Valid values are "es3" and "es5". Use "es3" for legacy browsers like IE8.
36 -
37 -## API
38 -
39 -### `transform(inputString, options)`
40 -
41 -option | values | default
42 --------|--------|---------
43 -`sourceMap` | `true`: append inline source map at the end of the transformed source | `false`
44 -`harmony` | `true`: enable ES6 features | `false`
45 -`sourceFilename` | the output filename for the source map | `"source.js"`
46 -`stripTypes` | `true`: strips out type annotations | `false`
47 -`es6module` | `true`: parses the file as an ES6 module | `false`
48 -`nonStrictEs6module` | `true`: parses the file as an ES6 module, except disables implicit strict-mode (i.e. CommonJS modules et al are allowed) | `false`
49 -`target` | `"es3"`: ECMAScript 3<br>`"es5"`: ECMAScript 5| `"es5"`
50 -
51 -```js
52 -var reactTools = require('react-tools');
53 -
54 -reactTools.transform(string, options);
55 -```
56 -
57 -### `transformWithDetails(inputString, options)`
58 -
59 -Just like `transform`, but outputs an object:
60 -```js
61 -{
62 - code: outputString,
63 - sourceMap: theSourceMap // Only if the `sourceMap` option is `true`.
64 -}
65 -```
npm-react-tools/bin/jsx deleted
-51
@@ -1,51 +0,0 @@
1 -#!/usr/bin/env node
2 -// -*- mode: js -*-
3 -'use strict';
4 -
5 -var transform = require('../main').transform;
6 -
7 -require('commoner').version(
8 - require('../package.json').version
9 -).resolve(function(id) {
10 - return this.readModuleP(id);
11 -}).option(
12 - '--harmony',
13 - 'Turns on JS transformations such as ES6 Classes etc.'
14 -).option(
15 - '--target [version]',
16 - 'Specify your target version of ECMAScript. Valid values are "es3" and ' +
17 - '"es5". The default is "es5". "es3" will avoid uses of defineProperty and ' +
18 - 'will quote reserved words. WARNING: "es5" is not properly supported, even ' +
19 - 'with the use of es5shim, es5sham. If you need to support IE8, use "es3".',
20 - 'es5'
21 -).option(
22 - '--strip-types',
23 - 'Strips out type annotations.'
24 -).option(
25 - '--es6module',
26 - 'Parses the file as a valid ES6 module. ' +
27 - '(Note that this means implicit strict mode)'
28 -).option(
29 - '--non-strict-es6module',
30 - 'Parses the file as an ES6 module, except disables implicit strict-mode. ' +
31 - '(This is useful if you\'re porting non-ES6 modules to ES6, but haven\'t ' +
32 - 'yet verified that they are strict-mode safe yet)'
33 -).option(
34 - '--source-map-inline',
35 - 'Embed inline sourcemap in transformed source'
36 -).process(function(id, source) {
37 - // This is where JSX, ES6, etc. desugaring happens.
38 - // We don't do any pre-processing of options so that the command line and the
39 - // JS API both expose the same set of options. We do extract the options that
40 - // we care about from commoner though so we aren't passing too many things
41 - // along.
42 - var options = {
43 - harmony: this.options.harmony,
44 - sourceMap: this.options.sourceMapInline,
45 - stripTypes: this.options.stripTypes,
46 - es6module: this.options.es6module,
47 - nonStrictEs6module: this.options.nonStrictEs6module,
48 - target: this.options.target
49 - };
50 - return transform(source, options);
51 -});
npm-react-tools/main.js deleted
-38
@@ -1,38 +0,0 @@
1 -/**
2 - * Copyright 2013-2015, Facebook, Inc.
3 - * All rights reserved.
4 - *
5 - * This source code is licensed under the BSD-style license found in the
6 - * LICENSE file in the root directory of this source tree. An additional grant
7 - * of patent rights can be found in the PATENTS file in the same directory.
8 - */
9 -
10 -'use strict';
11 -
12 -var jstransform = require('jstransform/simple');
13 -
14 -function transformWithDetails(code, opts) {
15 - opts = opts || {};
16 -
17 - // Copy out the values we need and make sure they are compatible with
18 - // jstransform options. Always set react:true.
19 - var options = {
20 - react: true,
21 - harmony: opts.harmony,
22 - stripTypes: opts.stripTypes,
23 - sourceMapInline: opts.sourceMap,
24 - sourceFilename: opts.sourceFilename,
25 - es6module: opts.es6module,
26 - nonStrictEs6module: opts.nonStrictEs6module,
27 - target: opts.target,
28 - };
29 -
30 - return jstransform.transform(code, options);
31 -}
32 -
33 -module.exports = {
34 - transform: function(input, options) {
35 - return transformWithDetails(input, options).code;
36 - },
37 - transformWithDetails: transformWithDetails,
38 -};
npm-react-tools/package.json deleted
-32
@@ -1,32 +0,0 @@
1 -{
2 - "name": "react-tools",
3 - "description": "A set of complementary tools to React, including the JSX transformer.",
4 - "version": "0.14.0-alpha3",
5 - "keywords": [
6 - "react",
7 - "jsx",
8 - "transformer",
9 - "view"
10 - ],
11 - "homepage": "https://facebook.github.io/react",
12 - "bugs": "https://github.com/facebook/react/issues",
13 - "license": "BSD-3-Clause",
14 - "files": [
15 - "main.js",
16 - "bin/jsx",
17 - "src/"
18 - ],
19 - "main": "main.js",
20 - "bin": {
21 - "jsx": "./bin/jsx"
22 - },
23 - "repository": "facebook/react",
24 - "dependencies": {
25 - "commoner": "^0.10.0",
26 - "jstransform": "^11.0.0"
27 - },
28 - "engines": {
29 - "node": ">=0.10.0"
30 - },
31 - "preferGlobal": true
32 -}