~sirn/fanboi2

061a0439d7f0d493c81ce55065b97a0c9512e51b — Kridsada Thanabulpong 5 years ago 6c25f12
Use Typings instead of TSD.

TSD is now deprecated. See also GitHub issue:
https://github.com/DefinitelyTyped/tsd/issues/269
17 files changed, 52 insertions(+), 88 deletions(-)

M .gitignore
M README.rst
M Vagrantfile
M assets/app/javascripts/app.ts
M assets/app/javascripts/components/board_selector.ts
M assets/app/javascripts/components/inline_quote.ts
M assets/app/javascripts/models/board.ts
M assets/app/javascripts/models/post.ts
M assets/app/javascripts/models/topic.ts
M assets/app/javascripts/utils/element_id.ts
M gulpfile.js
M package.json
M tsconfig.json
D tsd.json
A typings.json
R assets/app/javascripts/typings/dom4/dom4.d.ts => typings/vendor/dom4.d.ts
R assets/app/javascripts/typings/lodash.merge/lodash.merge.d.ts => typings/vendor/lodash.merge.d.ts
M .gitignore => .gitignore +2 -1
@@ 13,7 13,8 @@ tmp/
*.dump

# Assets
assets/app/javascripts/typings
typings/*
!typings/vendor/

# IDE stuff
out/

M README.rst => README.rst +5 -5
@@ 38,7 38,7 @@ If you don't really want to use Vagrant, you can also install everything using y
2. `PostgreSQL 9.2 <http://www.postgresql.org/>`_.
3. `Redis 2.8 <http://redis.io/>`_.
4. `Memcached 1.4 <http://www.memcached.org/>`_.
5. `Node.js 4.2 <http://nodejs.org/>`_ with `Gulp`_ and `TSD`_.
5. `Node.js 4.2 <http://nodejs.org/>`_ with `Gulp`_ and `Typings`_.

After the package above are up and running, you may now setup the application::



@@ 53,9 53,9 @@ And you're done! You can now proceed to the Management Scripts section below.
Assets
------

The application doesn't come with assets compiled by default and are done externally via `Gulp`_ and `TSD`_. Once you've setup the environment, you can use these two commands to build assets:
The application doesn't come with assets compiled by default and are done externally via `Gulp`_ and `Typings`_. Once you've setup the environment, you can use these two commands to build assets:

1. ``tsd install`` to download `TypeScript <http://www.typescriptlang.org/>`_ definition for dependencies.
1. ``typings install`` to download `TypeScript <http://www.typescriptlang.org/>`_ definition for dependencies.
2. ``gulp`` to build assets with `Gulp`_ (or use ``gulp watch`` to auto-reload).

Once these two commands are run, assets will be compiled to ``fanboi2/static`` in which you should point the web server to it. You should do this on every deploy.


@@ 107,5 107,5 @@ Redistribution and use in source and binary forms, with or without modification,
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

.. _Vagrant: https://www.vagrantup.com/
.. _Gulp: https://github.com/gulpjs/gulp/
.. _TSD: http://definitelytyped.org/tsd/
.. _Gulp: https://github.com/gulpjs/gulp
.. _Typings: https://github.com/typings/typings

M Vagrantfile => Vagrantfile +2 -2
@@ 41,7 41,7 @@ Vagrant.configure("2") do |config|

    npm config set prefix $HOME/nodejs
    npm install -g gulp
    npm install -g tsd
    npm install -g typings

    echo 'EDITOR=vi; export EDITOR' > $HOME/.profile
    echo 'PAGER=more; export PAGER' >> $HOME/.profile


@@ 62,7 62,7 @@ Vagrant.configure("2") do |config|
    $HOME/pypy3/bin/alembic upgrade head

    npm install --no-bin-link
    $HOME/nodejs/bin/tsd install
    $HOME/nodejs/bin/typings install
    $HOME/nodejs/bin/gulp
  EOF
end

M assets/app/javascripts/app.ts => assets/app/javascripts/app.ts +0 -3
@@ 1,6 1,3 @@
/// <reference path="typings/domready/domready.d.ts" />
/// <reference path="typings/whatwg-fetch/whatwg-fetch.d.ts" />

import 'whatwg-fetch';

import domready = require('domready');

M assets/app/javascripts/components/board_selector.ts => assets/app/javascripts/components/board_selector.ts +0 -4
@@ 1,7 1,3 @@
/// <reference path="../typings/virtual-dom/virtual-dom.d.ts" />
/// <reference path="../typings/es6-promise/es6-promise.d.ts" />
/// <reference path="../typings/lodash.merge/lodash.merge.d.ts" />

import vdom = require('virtual-dom');
import board = require('../models/board');


M assets/app/javascripts/components/inline_quote.ts => assets/app/javascripts/components/inline_quote.ts +0 -3
@@ 1,6 1,3 @@
/// <reference path="../typings/dom4/dom4.d.ts" />
/// <reference path="../typings/virtual-dom/virtual-dom.d.ts" />

import vdom = require('virtual-dom');
import dateFormatter = require('../utils/date_formatter');
import elementId = require('../utils/element_id');

M assets/app/javascripts/models/board.ts => assets/app/javascripts/models/board.ts +0 -3
@@ 1,6 1,3 @@
/// <reference path="../typings/whatwg-fetch/whatwg-fetch.d.ts" />
/// <reference path="../typings/es6-promise/es6-promise.d.ts" />

import topic = require('./topic');



M assets/app/javascripts/models/post.ts => assets/app/javascripts/models/post.ts +0 -4
@@ 1,7 1,3 @@
/// <reference path="../typings/whatwg-fetch/whatwg-fetch.d.ts" />
/// <reference path="../typings/es6-promise/es6-promise.d.ts" />


export class Post {
    type: string;
    id: number;

M assets/app/javascripts/models/topic.ts => assets/app/javascripts/models/topic.ts +0 -3
@@ 1,6 1,3 @@
/// <reference path="../typings/whatwg-fetch/whatwg-fetch.d.ts" />
/// <reference path="../typings/es6-promise/es6-promise.d.ts" />

import post = require('./post');



M assets/app/javascripts/utils/element_id.ts => assets/app/javascripts/utils/element_id.ts +1 -0
@@ 1,5 1,6 @@
import uuid = require('./uuid');


export function getElementId(element: Element): string {
    let elementId = element.getAttribute('data-element-id');


M gulpfile.js => gulpfile.js +4 -3
@@ 29,7 29,8 @@ var paths = {
        javascripts: {
            glob: 'assets/app/javascripts/**/*.ts',
            base: 'assets/app/javascripts/',
            entry: 'app.ts'
            typings: 'typings/browser.d.ts',
            entry: 'assets/app/javascripts/app.ts'
        }
    },



@@ 118,14 119,14 @@ var externalDependencies = [
    'dom4',
    'domready',
    'es6-promise',
    'lodash.merge',
    'virtual-dom',
    'whatwg-fetch'
];

gulp.task('javascripts/app', function(){
    return browserify({basedir: paths.app.javascripts.base, debug: true}).
    return browserify({debug: true}).
        plugin(tsify).
        require(paths.app.javascripts.typings, {entry: true}).
        require(paths.app.javascripts.entry, {entry: true}).
        external(externalDependencies).
        bundle().

M package.json => package.json +21 -27
@@ 6,33 6,27 @@
  "repository": "https://github.com/pxfs/fanboi2.git",
  "license": "BSD-3-Clause",
  "dependencies": {
    "gulp":                    "^3.9.0",
    "gulp-sequence":           "^0.1.0",
    "gulp-sourcemaps":         "^1.6.0",
    "gulp-concat":             "^2.6.0",
    "event-stream":            "^3.3.2",

    "gulp-sass":               "^2.1.0",
    "gulp-postcss":            "^6.0.1",
    "autoprefixer":            "^6.0.3",
    "autoprefixer": "^6.0.3",
    "browserify": "^12.0.1",
    "css-mqpacker": "^4.0.0",
    "csswring": "^4.0.0",
    "dom4": "^1.5.2",
    "domready": "^1.0.8",
    "es6-promise": "^3.0.2",
    "event-stream": "^3.3.2",
    "gulp": "^3.9.0",
    "gulp-concat": "^2.6.0",
    "gulp-postcss": "^6.0.1",
    "gulp-sass": "^2.1.0",
    "gulp-sequence": "^0.1.0",
    "gulp-sourcemaps": "^1.6.0",
    "gulp-uglify": "^1.4.2",
    "postcss-round-subpixels": "^1.0.0",
    "postcss-urlrev":          "^1.1.2",
    "css-mqpacker":            "^4.0.0",
    "csswring":                "^4.0.0",

    "tsd":                     "^0.6.5",
    "gulp-uglify":             "^1.4.2",
    "vinyl-source-stream":     "^1.1.0",
    "vinyl-buffer":            "^1.0.0",
    "browserify":              "^12.0.1",
    "tsify":                   "^0.12.2",

    "whatwg-fetch":            "^0.10.1",
    "es6-promise":             "^3.0.2",
    "virtual-dom":             "^2.1.1",
    "domready":                "^1.0.8",
    "dom4":                    "^1.5.2",

    "lodash.merge":            "^4.0.1"
    "postcss-urlrev": "^1.1.2",
    "tsify": "^0.12.2",
    "vinyl-buffer": "^1.0.0",
    "vinyl-source-stream": "^1.1.0",
    "virtual-dom": "^2.1.1",
    "whatwg-fetch": "^0.10.1"
  }
}

M tsconfig.json => tsconfig.json +4 -6
@@ 3,10 3,8 @@
    "module": "commonjs",
    "noImplicitAny": true
  },
  "exclude": [
    "examples",
    "fanboi2",
    "migration",
    "node_modules"
  "files": [
    "typings/browser.d.ts",
    "assets/app/javascripts/app.ts"
  ]
}
\ No newline at end of file
}

D tsd.json => tsd.json +0 -24
@@ 1,24 0,0 @@
{
  "version": "v4",
  "repo": "borisyankov/DefinitelyTyped",
  "ref": "master",
  "path": "assets/app/javascripts/typings",
  "bundle": "assets/app/javascripts/typings/tsd.d.ts",
  "installed": {
    "virtual-dom/virtual-dom.d.ts": {
      "commit": "35989a3ab4834b8e8b2b56788f1d4fc46a25dc8d"
    },
    "domready/domready.d.ts": {
      "commit": "35989a3ab4834b8e8b2b56788f1d4fc46a25dc8d"
    },
    "whatwg-fetch/whatwg-fetch.d.ts": {
      "commit": "138ad74b9e8e6c08af7633964962835add4c91e2"
    },
    "es6-promise/es6-promise.d.ts": {
      "commit": "138ad74b9e8e6c08af7633964962835add4c91e2"
    },
    "lodash/lodash.d.ts": {
      "commit": "70bf7e2bfeb0d5b1b651ef3219bcc65c8eec117e"
    }
  }
}

A typings.json => typings.json +13 -0
@@ 0,0 1,13 @@
{
  "name": "fanboi2",
  "dependencies": {
    "domready": "github:typed-typings/npm-domready#f46b2ea5466978ea3bdd703591d1c16d7ae3832c"
  },
  "devDependencies": {},
  "ambientDependencies": {
    "dom4": "file:typings/vendor/dom4.d.ts",
    "es6-promise": "github:DefinitelyTyped/DefinitelyTyped/es6-promise/es6-promise.d.ts#830e8ebd9ef137d039d5c7ede24a421f08595f83",
    "virtual-dom": "github:DefinitelyTyped/DefinitelyTyped/virtual-dom/virtual-dom.d.ts#df507c636cf0c799a8a20f35af89a3d0caae6c32",
    "whatwg-fetch": "github:DefinitelyTyped/DefinitelyTyped/whatwg-fetch/whatwg-fetch.d.ts#9027703c0bd831319dcdf7f3169f7a468537f448"
  }
}

R assets/app/javascripts/typings/dom4/dom4.d.ts => typings/vendor/dom4.d.ts +0 -0
R assets/app/javascripts/typings/lodash.merge/lodash.merge.d.ts => typings/vendor/lodash.merge.d.ts +0 -0