Commit ab487c5c authored by Mark Stenglein's avatar Mark Stenglein

Adds initial TypeScript support

- still playing around here to make it work. Nothing real is
  implemented just yet.

- Also adds working gulp configuration.
parent fb89f577
.DS_Store
/ical-generator.sublime-workspace
/ical-generator.sublime-project
/node_modules/
/coverage/
# Logs
logs
*.log
/.idea/
# Dependency Directory
node_modules
coverage/**
node_modules/**
\ No newline at end of file
{
"maxerr": 50,
"quotmark": "single",
"node": true,
"mocha": true
}
\ No newline at end of file
language: node_js
node_js:
- "4.1"
- "4.0"
- "0.12"
- "0.11"
- "0.10"
- "iojs"
before_script:
- npm install -g grunt-cli
sudo: false
// Place your settings in this file to overwrite default and user settings.
{
}
\ No newline at end of file
"use strict";
function sayHello(name) {
return "Hello from " + name;
}
exports.sayHello = sayHello;
"use strict";
var greet_1 = require("./greet");
console.log(greet_1.sayHello("TypeScript"));
let gulp = require("gulp");
let ts = require("gulp-typescript");
let tsProject = ts.createProject("./tsconfig.json");
let tslint = require("gulp-tslint");
gulp.task("lint:ts", function() {
return gulp.src("src/**/*.ts")
.pipe(tslint({
formatter: "verbose"
}))
.pipe(tslint.report())
});
gulp.task("compile:ts", ["lint:ts"], function () {
return tsProject.src()
.pipe(tsProject())
.js.pipe(gulp.dest("dist"));
});
gulp.task("test:js", ["compile:ts"], function () {
});
gulp.task("default", ["compile:ts"], function () {
});
......@@ -3,6 +3,10 @@
"version": "0.0.1",
"description": "Node implementation of RFC 5545 generation and parsing",
"main": "./dist/main.js",
"typings": "lib/index",
"files": [
"dist/"
],
"scripts": {
"test": "echo \"Error: no test specified\" && exit 1"
},
......@@ -11,5 +15,15 @@
"url": "git@git.gmu.edu:srct/lib-ics.git"
},
"author": "Mark Stenglein",
"license": "MIT"
"license": "MIT",
"devDependencies": {
"gulp": "^3.9.1",
"gulp-tslint": "^7.1.0",
"gulp-typescript": "^3.1.5",
"tslint": "^4.4.2",
"typescript": "^2.1.6"
},
"dependencies": {
"@types/moment-timezone": "^0.2.34"
}
}
export function sayHello(name: string) {
return `Hello from ${name}`;
}
import { sayHello } from "./greet";
console.log(sayHello("TypeScript"));
{
"files": [
"src/**/*.ts",
],
"compilerOptions": {
"module": "commonjs",
"declaration": true,
"noImplicitAny": true,
"target": "es5"
}
}
{
"jsRules": {
"class-name": true,
"comment-format": [
true,
"check-space"
],
"indent": [
true,
"spaces"
],
"no-duplicate-variable": true,
"no-eval": true,
"no-trailing-whitespace": true,
"no-unsafe-finally": true,
"one-line": [
true,
"check-open-brace",
"check-whitespace"
],
"quotemark": [
true,
"double"
],
"semicolon": [
true,
"always"
],
"triple-equals": [
true,
"allow-null-check"
],
"variable-name": [
true,
"ban-keywords"
],
"whitespace": [
true,
"check-branch",
"check-decl",
"check-operator",
"check-separator",
"check-type"
]
},
"rules": {
"class-name": true,
"comment-format": [
true,
"check-space"
],
"indent": [
true,
"spaces"
],
"no-eval": true,
"no-internal-module": true,
"no-trailing-whitespace": true,
"no-unsafe-finally": true,
"no-var-keyword": true,
"one-line": [
true,
"check-open-brace",
"check-whitespace"
],
"quotemark": [
true,
"double"
],
"semicolon": [
true,
"always"
],
"triple-equals": [
true,
"allow-null-check"
],
"typedef-whitespace": [
true,
{
"call-signature": "nospace",
"index-signature": "nospace",
"parameter": "nospace",
"property-declaration": "nospace",
"variable-declaration": "nospace"
}
],
"variable-name": [
true,
"ban-keywords"
],
"whitespace": [
true,
"check-branch",
"check-decl",
"check-operator",
"check-separator",
"check-type"
]
}
}
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment