Skip to content

Commit 0144a1f

Browse files
authored
Merge pull request #47 from larsendaniel/feature/typescript2.0
Feature/typescript2.0
2 parents 134ae7a + 679c9c7 commit 0144a1f

File tree

76 files changed

+58
-210
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

76 files changed

+58
-210
lines changed

README.md

Lines changed: 7 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -15,19 +15,13 @@ From the root of this project, run:
1515
$ npm install
1616
```
1717

18-
### 4. Setup the external d.ts files and link the non-published npm packages
19-
From the root of this project, run:
20-
```sh
21-
$ gulp setup
22-
```
23-
24-
### 5. Build and Test
18+
### 4. Build and Test
2519
The default gulp command is to build and test:
2620
```sh
2721
$ gulp
2822
```
2923
- Compiles LESS and TypeScript into /build
30-
- Bundles the JavaScript modules together into /bundle
24+
- Bundles the JavaScript modules together into /build/bundles
3125
- Exports all the needed files to /target
3226

3327
## Congratulations!
@@ -41,3 +35,8 @@ $ gulp clean
4135
```
4236
Removes all of the generated files from `build`
4337

38+
#### Gulp watch
39+
```sh
40+
$ gulp watch
41+
```
42+
Automatically rebuilds the project when files are saved

WebClipper.csproj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
<Content Include="serverRoot\server.js" />
1414
<Content Include="src\**\*" Exclude="src\**\*.ts*" />
1515
<TypeScriptCompile Include="src\**\*.ts*" />
16-
<TypeScriptCompile Include="typings\main\**\*.d.ts" />
16+
<TypeScriptCompile Include="node_modules\@types\**\*.d.ts*" />
1717
</ItemGroup>
1818
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Debug|AnyCPU'">
1919
<TypeScriptCompileOnSaveEnabled>False</TypeScriptCompileOnSaveEnabled>

WebClipper.sln

Lines changed: 1 addition & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,9 @@
11

22
Microsoft Visual Studio Solution File, Format Version 12.00
33
# Visual Studio 14
4-
VisualStudioVersion = 14.0.24720.0
4+
VisualStudioVersion = 14.0.25420.1
55
MinimumVisualStudioVersion = 10.0.40219.1
66
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "WebClipper", "WebClipper.csproj", "{CEC9A52E-3052-4CB5-8644-9D0C1F346E35}"
7-
ProjectSection(ProjectDependencies) = postProject
8-
{523C9308-B7F5-4C53-8A33-FCA2F34F6AE3} = {523C9308-B7F5-4C53-8A33-FCA2F34F6AE3}
9-
{0923A3FD-7F48-4E89-827B-2035750EB8E7} = {0923A3FD-7F48-4E89-827B-2035750EB8E7}
10-
EndProjectSection
11-
EndProject
12-
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "OneNoteApi", "..\OneNoteApi\OneNoteApi.csproj", "{523C9308-B7F5-4C53-8A33-FCA2F34F6AE3}"
13-
EndProject
14-
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "OneNotePicker-JS", "..\OneNotePicker-JS\OneNotePicker-JS.csproj", "{0923A3FD-7F48-4E89-827B-2035750EB8E7}"
15-
ProjectSection(ProjectDependencies) = postProject
16-
{523C9308-B7F5-4C53-8A33-FCA2F34F6AE3} = {523C9308-B7F5-4C53-8A33-FCA2F34F6AE3}
17-
EndProjectSection
187
EndProject
198
Global
209
GlobalSection(SolutionConfigurationPlatforms) = preSolution
@@ -23,10 +12,6 @@ Global
2312
GlobalSection(ProjectConfigurationPlatforms) = postSolution
2413
{CEC9A52E-3052-4CB5-8644-9D0C1F346E35}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
2514
{CEC9A52E-3052-4CB5-8644-9D0C1F346E35}.Debug|Any CPU.Build.0 = Debug|Any CPU
26-
{523C9308-B7F5-4C53-8A33-FCA2F34F6AE3}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
27-
{523C9308-B7F5-4C53-8A33-FCA2F34F6AE3}.Debug|Any CPU.Build.0 = Debug|Any CPU
28-
{0923A3FD-7F48-4E89-827B-2035750EB8E7}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
29-
{0923A3FD-7F48-4E89-827B-2035750EB8E7}.Debug|Any CPU.Build.0 = Debug|Any CPU
3015
EndGlobalSection
3116
GlobalSection(SolutionProperties) = preSolution
3217
HideSolutionNode = FALSE

WebClipper.sln.DotSettings

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
<s:String x:Key="/Default/CodeInspection/ExcludedFiles/FilesAndFoldersToSkip2/=523C9308_002DB7F5_002D4C53_002D8A33_002DFCA2F34F6AE3_002Fd_003Asrc_002Ff_003AoneNoteApi_002Emodules_002Ed_002Ets/@EntryIndexedValue">ExplicitlyExcluded</s:String>
44
<s:String x:Key="/Default/CodeInspection/ExcludedFiles/FilesAndFoldersToSkip2/=0923A3FD_002D7F48_002D4E89_002D827B_002D2035750EB8E7_002Fd_003Asrc_002Ff_003AoneNotePicker_002Ed_002Ets/@EntryIndexedValue">ExplicitlyExcluded</s:String>
55
<s:String x:Key="/Default/CodeInspection/Highlighting/AnalysisEnabled/@EntryValue">SOLUTION</s:String>
6-
<s:String x:Key="/Default/CodeInspection/TypeScriptInspections/Level/@EntryValue">TypeScript16</s:String>
6+
<s:String x:Key="/Default/CodeInspection/TypeScriptInspections/Level/@EntryValue">TypeScript20</s:String>
77
<s:String x:Key="/Default/CodeStyle/CodeFormatting/JavaScriptCodeFormatting/FORCE_CONTROL_STATEMENTS_BRACES/@EntryValue">ALWAYS_ADD</s:String>
88
<s:Boolean x:Key="/Default/CodeStyle/CodeFormatting/JavaScriptCodeFormatting/INDENT_CASE_FROM_SWITCH/@EntryValue">True</s:Boolean>
99
<s:Int64 x:Key="/Default/CodeStyle/CodeFormatting/JavaScriptCodeFormatting/KEEP_BLANK_LINES_BETWEEN_DECLARATIONS/@EntryValue">1</s:Int64>
@@ -12,7 +12,9 @@
1212
<s:String x:Key="/Default/CodeStyle/CodeFormatting/JavaScriptCodeFormatting/SINGLE_STATEMENT_FUNCTION_STYLE/@EntryValue">LINE_BREAK</s:String>
1313
<s:Boolean x:Key="/Default/CodeStyle/CodeFormatting/JavaScriptCodeFormatting/SPACE_WITHIN_EMPTY_OBJECT_LITERAL_BRACES/@EntryValue">True</s:Boolean>
1414
<s:String x:Key="/Default/CodeStyle/Naming/JavaScriptNaming/UserRules/=JS_005FBLOCK_005FSCOPE_005FCONSTANT/@EntryIndexedValue">&lt;Policy Inspect="True" Prefix="" Suffix="" Style="aaBb" /&gt;</s:String>
15+
<s:String x:Key="/Default/CodeStyle/Naming/JavaScriptNaming/UserRules/=JS_005FBLOCK_005FSCOPE_005FFUNCTION/@EntryIndexedValue">&lt;Policy Inspect="True" Prefix="" Suffix="" Style="aaBb" /&gt;</s:String>
1516
<s:String x:Key="/Default/CodeStyle/Naming/JavaScriptNaming/UserRules/=JS_005FBLOCK_005FSCOPE_005FVARIABLE/@EntryIndexedValue">&lt;Policy Inspect="True" Prefix="" Suffix="" Style="aaBb" /&gt;</s:String>
17+
<s:String x:Key="/Default/CodeStyle/Naming/JavaScriptNaming/UserRules/=JS_005FCLASS/@EntryIndexedValue">&lt;Policy Inspect="True" Prefix="" Suffix="" Style="aaBb" /&gt;</s:String>
1618
<s:String x:Key="/Default/CodeStyle/Naming/JavaScriptNaming/UserRules/=JS_005FCONSTRUCTOR/@EntryIndexedValue">&lt;Policy Inspect="True" Prefix="" Suffix="" Style="AaBb" /&gt;</s:String>
1719
<s:String x:Key="/Default/CodeStyle/Naming/JavaScriptNaming/UserRules/=JS_005FFUNCTION/@EntryIndexedValue">&lt;Policy Inspect="True" Prefix="" Suffix="" Style="aaBb" /&gt;</s:String>
1820
<s:String x:Key="/Default/CodeStyle/Naming/JavaScriptNaming/UserRules/=JS_005FGLOBAL_005FVARIABLE/@EntryIndexedValue">&lt;Policy Inspect="True" Prefix="" Suffix="" Style="AaBb" /&gt;</s:String>

gulpfile.js

Lines changed: 2 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -25,12 +25,9 @@ var shell = require("gulp-shell");
2525
var source = require("vinyl-source-stream");
2626
var ts = require("gulp-typescript");
2727
var tslint = require("gulp-tslint");
28-
var typings = require("gulp-typings");
2928
var uglify = require("gulp-uglify");
3029
var zip = require("gulp-zip");
3130

32-
var tsProject = ts.createProject("./tsconfig.json");
33-
3431
var PATHS = {
3532
SRC: {
3633
ROOT: "src/",
@@ -39,7 +36,6 @@ var PATHS = {
3936
BUILDROOT: "build/",
4037
BUNDLEROOT: "build/bundles/",
4138
LIBROOT: "lib/",
42-
DEFINITIONS: "typings/",
4339
SERVERROOT: "serverRoot/root/",
4440
TARGET: {
4541
ROOT: "target/",
@@ -70,27 +66,6 @@ function printGlobResults(glob) {
7066
});
7167
}
7268

73-
////////////////////////////////////////
74-
// SETUP
75-
////////////////////////////////////////
76-
gulp.task("cleanDefinitions", function(callback) {
77-
return del([
78-
PATHS.DEFINITIONS
79-
], callback);
80-
});
81-
82-
gulp.task("definitions", function() {
83-
return gulp.src("./typings.json")
84-
.pipe(typings());
85-
});
86-
87-
gulp.task("setup", function(callback) {
88-
runSequence(
89-
"cleanDefinitions",
90-
"definitions",
91-
callback);
92-
});
93-
9469
////////////////////////////////////////
9570
// CLEAN
9671
////////////////////////////////////////
@@ -187,8 +162,8 @@ gulp.task("preCompileInternal", function (callback) {
187162
});
188163

189164
gulp.task("compileTypeScript", ["copyStrings", "mergeSettings", "preCompileInternal"], function () {
190-
return gulp.src([PATHS.SRC.ROOT + "**/*.+(ts|tsx)", PATHS.DEFINITIONS + "main/**/*.d.ts"])
191-
.pipe(ts(tsProject))
165+
return gulp.src([PATHS.SRC.ROOT + "**/*.+(ts|tsx)"])
166+
.pipe(ts(ts.createProject("./tsconfig.json", { typescript: require('typescript') })))
192167
.pipe(gulp.dest(PATHS.BUILDROOT));
193168
});
194169

package.json

Lines changed: 13 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,18 @@
1111
"url": "git+https://github.com/OneNoteDev/WebClipper.git"
1212
},
1313
"devDependencies": {
14+
"@types/chrome": "0.0.33",
15+
"@types/es6-promise": "0.0.32",
16+
"@types/jquery": "^2.0.32",
17+
"@types/mithril": "0.0.31",
18+
"@types/pdf": "0.0.31",
19+
"@types/qunit": "^1.16.30",
20+
"@types/rangy": "0.0.27",
21+
"@types/safari-extension": "0.0.27",
22+
"@types/sanitize-html": "^1.13.31",
23+
"@types/sinon": "^1.16.30",
24+
"@types/urijs": "^1.15.30",
25+
"@types/velocity-animate": "^1.2.27",
1426
"browserify": "^13.0.0",
1527
"del": "^2.0.2",
1628
"es5-shim": "^4.5.8",
@@ -31,7 +43,6 @@
3143
"gulp-shell": "^0.5.1",
3244
"gulp-tslint": "^5.0.0",
3345
"gulp-typescript": "^2.13.6",
34-
"gulp-typings": "~1.1.0",
3546
"gulp-uglify": "^1.5.3",
3647
"gulp-zip": "^3.2.0",
3748
"json3": "^3.3.2",
@@ -49,7 +60,7 @@
4960
"sinon-qunit": "^2.0.0",
5061
"ssl-root-cas": "^1.1.10",
5162
"tslint": "^3.9.0",
52-
"typings": "~0.6.8",
63+
"typescript": "^2.0.3",
5364
"urijs": "^1.18.1",
5465
"velocity-animate": "^1.2.3",
5566
"vinyl-source-stream": "^1.1.0",

src/scripts/clipperUI/animations/animationHelper.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
/// <reference path="../../../../typings/main/ambient/velocity-animate/velocity-animate.d.ts"/>
21
declare var Velocity: jquery.velocity.VelocityStatic;
32

43
export class AnimationHelper {

src/scripts/clipperUI/animations/expandFromRightAnimationStrategy.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
/// <reference path="../../../../typings/main/ambient/velocity-animate/velocity-animate.d.ts"/>
21
declare var Velocity: jquery.velocity.VelocityStatic;
32

43
import {Constants} from "../../constants";

src/scripts/clipperUI/animations/slideFromRightAnimationStrategy.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
/// <reference path="../../../../typings/main/ambient/velocity-animate/velocity-animate.d.ts"/>
21
declare var Velocity: jquery.velocity.VelocityStatic;
32

43
import {AnimationState} from "./animationState";

src/scripts/clipperUI/animations/slidingHeightAnimationStrategy.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
/// <reference path="../../../../typings/main/ambient/velocity-animate/velocity-animate.d.ts"/>
21
declare var Velocity: jquery.velocity.VelocityStatic;
32

43
import {Constants} from "../../constants";

0 commit comments

Comments
 (0)