Skip to content
This repository was archived by the owner on Oct 12, 2022. It is now read-only.

Commit 3e3d454

Browse files
committed
Merge pull request #49 from johnnyreilly/master
Added es6-babel-react-flux-karma
2 parents 24eff26 + ca89d3e commit 3e3d454

30 files changed

+1180
-0
lines changed

es6-babel-react-flux-karma/.gitignore

Lines changed: 201 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,201 @@
1+
## Ignore Visual Studio temporary files, build results, and
2+
## files generated by popular Visual Studio add-ons.
3+
4+
# User-specific files
5+
*.suo
6+
*.user
7+
*.userosscache
8+
*.sln.docstates
9+
10+
# User-specific files (MonoDevelop/Xamarin Studio)
11+
*.userprefs
12+
13+
# Build results
14+
[Dd]ebug/
15+
[Dd]ebugPublic/
16+
[Rr]elease/
17+
[Rr]eleases/
18+
x64/
19+
x86/
20+
build/
21+
bld/
22+
[Bb]in/
23+
[Oo]bj/
24+
dist/
25+
26+
# Visual Studo 2015 cache/options directory
27+
.vs/
28+
29+
# MSTest test Results
30+
[Tt]est[Rr]esult*/
31+
[Bb]uild[Ll]og.*
32+
33+
# NUNIT
34+
*.VisualState.xml
35+
TestResult.xml
36+
37+
# JUnit test results
38+
test-results
39+
40+
# Build Results of an ATL Project
41+
[Dd]ebugPS/
42+
[Rr]eleasePS/
43+
dlldata.c
44+
45+
*_i.c
46+
*_p.c
47+
*_i.h
48+
*.ilk
49+
*.meta
50+
*.obj
51+
*.pch
52+
*.pdb
53+
*.pgc
54+
*.pgd
55+
*.rsp
56+
*.sbr
57+
*.tlb
58+
*.tli
59+
*.tlh
60+
*.tmp
61+
*.tmp_proj
62+
*.log
63+
*.vspscc
64+
*.vssscc
65+
.builds
66+
*.pidb
67+
*.svclog
68+
*.scc
69+
70+
# Chutzpah Test files
71+
_Chutzpah*
72+
73+
# Visual C++ cache files
74+
ipch/
75+
*.aps
76+
*.ncb
77+
*.opensdf
78+
*.sdf
79+
*.cachefile
80+
81+
# Visual Studio profiler
82+
*.psess
83+
*.vsp
84+
*.vspx
85+
86+
# TFS 2012 Local Workspace
87+
$tf/
88+
89+
# Guidance Automation Toolkit
90+
*.gpState
91+
92+
# ReSharper is a .NET coding add-in
93+
_ReSharper*/
94+
*.[Rr]e[Ss]harper
95+
*.DotSettings.user
96+
97+
# JustCode is a .NET coding addin-in
98+
.JustCode
99+
100+
# TeamCity is a build add-in
101+
_TeamCity*
102+
103+
# DotCover is a Code Coverage Tool
104+
*.dotCover
105+
106+
# NCrunch
107+
_NCrunch_*
108+
.*crunch*.local.xml
109+
110+
# MightyMoose
111+
*.mm.*
112+
AutoTest.Net/
113+
114+
# Web workbench (sass)
115+
.sass-cache/
116+
117+
# Installshield output folder
118+
[Ee]xpress/
119+
120+
# DocProject is a documentation generator add-in
121+
DocProject/buildhelp/
122+
DocProject/Help/*.HxT
123+
DocProject/Help/*.HxC
124+
DocProject/Help/*.hhc
125+
DocProject/Help/*.hhk
126+
DocProject/Help/*.hhp
127+
DocProject/Help/Html2
128+
DocProject/Help/html
129+
130+
# Click-Once directory
131+
publish/
132+
133+
# Publish Web Output
134+
*.[Pp]ublish.xml
135+
*.azurePubxml
136+
# TODO: Comment the next line if you want to checkin your web deploy settings
137+
# but database connection strings (with potential passwords) will be unencrypted
138+
*.pubxml
139+
*.publishproj
140+
141+
# NuGet Packages
142+
*.nupkg
143+
# The packages folder can be ignored because of Package Restore
144+
**/packages/*
145+
# except build/, which is used as an MSBuild target.
146+
!**/packages/build/
147+
# Uncomment if necessary however generally it will be regenerated when needed
148+
#!**/packages/repositories.config
149+
150+
# Windows Azure Build Output
151+
csx/
152+
*.build.csdef
153+
154+
# Windows Store app package directory
155+
AppPackages/
156+
157+
# Others
158+
*.[Cc]ache
159+
ClientBin/
160+
[Ss]tyle[Cc]op.*
161+
~$*
162+
*~
163+
*.dbmdl
164+
*.dbproj.schemaview
165+
*.pfx
166+
*.publishsettings
167+
node_modules/
168+
bower_components/
169+
typings/
170+
171+
# RIA/Silverlight projects
172+
Generated_Code/
173+
174+
# Backup & report files from converting an old project file
175+
# to a newer Visual Studio version. Backup files are not needed,
176+
# because we have git ;-)
177+
_UpgradeReport_Files/
178+
Backup*/
179+
UpgradeLog*.XML
180+
UpgradeLog*.htm
181+
182+
# SQL Server files
183+
*.mdf
184+
*.ldf
185+
186+
# Business Intelligence projects
187+
*.rdl.data
188+
*.bim.layout
189+
*.bim_*.settings
190+
191+
# Microsoft Fakes
192+
FakesAssemblies/
193+
194+
# Node.js Tools for Visual Studio
195+
.ntvs_analysis.dat
196+
197+
# Visual Studio 6 build log
198+
*.plg
199+
200+
# Visual Studio 6 workspace options file
201+
*.opt

es6-babel-react-flux-karma/LICENSE

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
The MIT License (MIT)
2+
3+
Copyright (c) 2015 John Reilly
4+
5+
Permission is hereby granted, free of charge, to any person obtaining a copy
6+
of this software and associated documentation files (the "Software"), to deal
7+
in the Software without restriction, including without limitation the rights
8+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9+
copies of the Software, and to permit persons to whom the Software is
10+
furnished to do so, subject to the following conditions:
11+
12+
The above copyright notice and this permission notice shall be included in all
13+
copies or substantial portions of the Software.
14+
15+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21+
SOFTWARE.
22+

es6-babel-react-flux-karma/README.md

Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
1+
# ES6 + TypeScript + Babel + React + Karma: The Secret Recipe
2+
3+
## Getting started
4+
5+
You'll need [node / npm](https://nodejs.org/) and [tsd](http://definitelytyped.org/tsd/) installed globally. To get up and running just enter:
6+
7+
```
8+
npm install
9+
tsd install
10+
npm run watch
11+
```
12+
13+
This will:
14+
15+
1. Download the npm packages you need
16+
2. Download the typings from DefinitelyTyped that you need.
17+
3. Compile the code and serve it up at [http://localhost:8080](http://localhost:8080)
18+
19+
Now you need dev tools. There's a world of choice out there; there's [Atom](https://atom.io/), there's [VS Code](https://www.visualstudio.com/en-us/products/code-vs.aspx), there's [Sublime](http://www.sublimetext.com/). There's even something called [Visual Studio](http://www.visualstudio.com). It's all your choice really.
20+
21+
For myself I've been using Atom combined with the mighty [atom-typescript package](https://atom.io/packages/atom-typescript). I advise you to give it a go. You won't look back.
22+
23+
## I want to have an ASP.Net project and use Visual Studio + IIS Express to serve this instead
24+
25+
If you drop this code into an empty Visual Studio ASP.Net project should should be good to go. You'll need this section in your `web.config` to ensure Visual Studio serves from the `dist` directory:
26+
27+
```
28+
<configuration>
29+
<system.webServer>
30+
<rewrite>
31+
<rules>
32+
<rule name="Map all requests to 'dist' directory" stopProcessing="true">
33+
<match url="^(.*)$" />
34+
<action type="Rewrite" url="/dist/{R:1}" />
35+
</rule>
36+
</rules>
37+
</rewrite>
38+
</system.webServer>
39+
</configuration>
40+
```
41+
42+
And rather than running `npm run serve` you'll want to use `npm run watch`. (This builds / watches your code / runs tests etc but does **not** spin up a web server.)
43+
44+
Finally you'll want to set the following TypeScript options for your project
45+
46+
- ECMAScript Version: ECMAScript 6
47+
- JSX compilation in TSX files: Preserve
Lines changed: 59 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,59 @@
1+
{
2+
"root": true,
3+
"env": {
4+
"commonjs": true,
5+
},
6+
"rules": {
7+
"no-alert": 2,
8+
"no-array-constructor": 2,
9+
"no-caller": 2,
10+
"no-catch-shadow": 2,
11+
"no-empty-label": 2,
12+
"no-eval": 2,
13+
"no-extend-native": 2,
14+
"no-extra-bind": 2,
15+
"no-implied-eval": 2,
16+
"no-iterator": 2,
17+
"no-label-var": 2,
18+
"no-labels": 2,
19+
"no-lone-blocks": 2,
20+
"no-loop-func": 2,
21+
"no-multi-str": 2,
22+
"no-native-reassign": 2,
23+
"no-new": 2,
24+
"no-new-func": 2,
25+
"no-new-object": 2,
26+
"no-new-wrappers": 2,
27+
"no-octal-escape": 2,
28+
"no-proto": 2,
29+
"no-return-assign": 2,
30+
"no-script-url": 2,
31+
"no-sequences": 2,
32+
"no-shadow": 2,
33+
"no-shadow-restricted-names": 2,
34+
"no-spaced-func": 2,
35+
"no-trailing-spaces": 2,
36+
"no-undef-init": 2,
37+
"no-unused-expressions": 2,
38+
"no-use-before-define": [2, "nofunc"],
39+
"no-with": 2,
40+
"camelcase": 2,
41+
"comma-spacing": 1,
42+
"consistent-return": 2,
43+
"curly": [2, "all"],
44+
"dot-notation": [2, { "allowKeywords": true }],
45+
"eol-last": 2,
46+
"no-extra-parens": [2, "functions"],
47+
"eqeqeq": 2,
48+
"new-cap": 2,
49+
"new-parens": 2,
50+
"quotes": [1, "single"],
51+
"semi": 2,
52+
"semi-spacing": [2, {"before": false, "after": true}],
53+
"space-infix-ops": 2,
54+
"space-return-throw-case": 2,
55+
"space-unary-ops": [2, { "words": true, "nonwords": false }],
56+
"strict": [2, "global"],
57+
"yoda": [2, "never"]
58+
}
59+
}
Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
'use strict';
2+
3+
var del = require('del');
4+
var gutil = require('gulp-util');
5+
var fs = require('fs');
6+
7+
function run(done) {
8+
fs.stat('./dist', function(err){
9+
if (err) {
10+
// Never existed
11+
done();
12+
}
13+
else {
14+
del(['./dist'], { force: true })
15+
.then(function(paths) {
16+
gutil.log('Deleted files/folders:\n', paths.join('\n'));
17+
done();
18+
})
19+
.catch(function(error) {
20+
gutil.log('Problem deleting:\n', error);
21+
done();
22+
});
23+
}
24+
});
25+
}
26+
27+
module.exports = {
28+
run: function(done) { return run(done); }
29+
};

0 commit comments

Comments
 (0)