Skip to content
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.

Commit 28740df

Browse files
committedSep 22, 2015
migration
1 parent 99d60d6 commit 28740df

File tree

8 files changed

+53
-28
lines changed

8 files changed

+53
-28
lines changed
 

‎.gitignore

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
node_modules/
2-
dist/
2+
bundle/
33
*.swp

‎package.json

Lines changed: 8 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@
44
"description": "play your code",
55
"main": "app.js",
66
"scripts": {
7-
"build": "node build.js"
87
},
98
"keywords": [
109
"code",
@@ -15,27 +14,20 @@
1514
"license": "MIT",
1615
"dependencies": {},
1716
"devDependencies": {
18-
"browserify": "^10.2.3",
17+
"babel-core": "^5.8.25",
18+
"babel-loader": "^5.3.2",
1919
"camelcase": "^1.1.0",
20-
"factor-bundle": "^2.4.1",
21-
"gulp": "^3.9.0",
22-
"gulp-less": "^3.0.3",
23-
"gulp-util": "^3.0.5",
20+
"css-loader": "^0.18.0",
2421
"highlight.js": "^8.6.0",
22+
"less": "^2.5.1",
23+
"less-loader": "^2.2.1",
2524
"lodash": "^3.9.3",
26-
"node-lessify": "0.0.10",
2725
"react": "^0.13.3",
28-
"reactify": "^1.1.1",
2926
"soundbank-reverb": "^1.1.2",
27+
"style-loader": "^0.12.4",
3028
"through2": "^0.6.5",
31-
"uglifyify": "^3.0.1",
32-
"vinyl-source-stream": "^1.1.0",
29+
"webpack": "^1.12.2",
30+
"webpack-dev-server": "^1.11.0",
3331
"xtend": "^4.0.0"
34-
},
35-
"browserify": {
36-
"transform": [
37-
"node-lessify",
38-
"reactify"
39-
]
4032
}
4133
}

‎src/core/player.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,9 +24,10 @@ function Player(params){
2424
reverb.dry.value = 1;
2525
reverb.wet.value = 0.5;
2626

27-
this.output = Rack([
27+
this.rack = Rack([
2828
reverb
2929
]);
30+
this.output = this.rack.output;
3031
this.output.connect(this.ctx.destination);
3132

3233
this._updateUnit();

‎src/core/rack.js

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -10,14 +10,10 @@ function RackFactory(components){
1010
components[i-1].connect(components[i]);
1111
}
1212

13-
input.connect = function(dest){
14-
output.connect(dest);
13+
return {
14+
input: input,
15+
output: output
1516
};
16-
input.disconnect = function(dest){
17-
output.disconnect(dest);
18-
};
19-
20-
return input;
2117
}
2218

2319
module.exports = RackFactory;

‎src/core/track.js

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,11 +15,13 @@ function Track(params){
1515
gain.gain.value = params.volume || 0.5;
1616

1717
this.instrument = params.instrument || new Instrument();
18-
this.output = Rack([
18+
this.rack = Rack([
1919
this.instrument.output,
2020
gain,
2121
panner
2222
]);
23+
this.input = this.rack.input;
24+
this.output = this.rack.output;
2325
this.notes = params.notes || {};
2426
this.length = _.result(_.max(this.notes, function(note){
2527
return note.index;

‎webpack.config.js

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
var path = require('path');
2+
3+
module.exports = {
4+
context: path.join(__dirname, 'src'),
5+
entry: {
6+
index: './index',
7+
app: './app'
8+
},
9+
output: {
10+
path: path.join(__dirname, 'www'),
11+
filename: '[name].js'
12+
},
13+
module: {
14+
loaders: [
15+
{
16+
test: /\.less$/,
17+
loader: 'style!css!less'
18+
},
19+
{
20+
test: /\.css$/,
21+
loader: 'style!css'
22+
},
23+
{
24+
test: /\.jsx?$/,
25+
loader: 'babel',
26+
exclude: /node_modules/
27+
}
28+
],
29+
},
30+
31+
// dev related
32+
devtool: 'eval-source-map',
33+
devServer: {
34+
contentBase: path.join(__dirname, 'dist')
35+
}
36+
};

‎app.html renamed to ‎www/app.html

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,6 @@
66
<body>
77
<div id="code-player">
88
</div>
9-
<script src="common.js" type="text/javascript"></script>
109
<script src="app.js" type="text/javascript"></script>
1110
</body>
1211
</html>

‎index.html renamed to ‎www/index.html

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,6 @@
66
<body>
77
<div id="container"></div>
88
<style>#forkongithub a{background:#000;color:#fff;text-decoration:none;font-family:arial,sans-serif;text-align:center;font-weight:bold;padding:5px 40px;font-size:1rem;line-height:2rem;position:relative;transition:0.5s;}#forkongithub a:hover{background:#c11;color:#fff;}#forkongithub a::before,#forkongithub a::after{content:"";width:100%;display:block;position:absolute;top:1px;left:0;height:1px;background:#fff;}#forkongithub a::after{bottom:1px;top:auto;}@media screen and (min-width:800px){#forkongithub{position:fixed;display:block;top:0;right:0;width:200px;overflow:hidden;height:200px;z-index:9999;}#forkongithub a{width:200px;position:absolute;top:60px;right:-60px;transform:rotate(45deg);-webkit-transform:rotate(45deg);-ms-transform:rotate(45deg);-moz-transform:rotate(45deg);-o-transform:rotate(45deg);box-shadow:4px 4px 10px rgba(0,0,0,0.8);}}</style><span id="forkongithub"><a href="https://github.com/jcppman/code-player">Fork me on GitHub</a></span>
9-
<script src="common.js" type="text/javascript"></script>
109
<script src="index.js" type="text/javascript"></script>
1110
</body>
1211
</html>

0 commit comments

Comments
 (0)
Please sign in to comment.