Skip to content

Commit af70cc5

Browse files
authored
Merge pull request #135 from angular-ui/modules
Modules
2 parents 5b16a0e + 81c9a68 commit af70cc5

File tree

136 files changed

+3661
-4555
lines changed

Some content is hidden

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

136 files changed

+3661
-4555
lines changed

.gitignore

+1-1
Original file line numberDiff line numberDiff line change
@@ -3,4 +3,4 @@ public
33
node_modules
44
temp
55
/nbproject/private/
6-
local_development
6+
*.log

.npmignore

+10
Original file line numberDiff line numberDiff line change
@@ -1 +1,11 @@
11
/node_modules/
2+
/src
3+
/temp
4+
/test
5+
.gitignore
6+
.jshintrc
7+
.npmignore
8+
.travis.yml
9+
bower.json
10+
Gruntfile.js
11+
webpack.config.js

.travis.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
language: node_js
22

33
node_js:
4-
- '0.10'
4+
- '6'
55

66
before_install:
77
- export DISPLAY=:99.0

Gruntfile.js

+70-114
Original file line numberDiff line numberDiff line change
@@ -1,28 +1,32 @@
1-
// Build configurations.
21
module.exports = function (grunt) {
32
grunt.loadNpmTasks('grunt-karma');
4-
grunt.loadNpmTasks('grunt-babel');
53
grunt.loadNpmTasks('grunt-contrib-connect');
64
grunt.loadNpmTasks('grunt-contrib-watch');
75
grunt.loadNpmTasks('grunt-contrib-jshint');
8-
grunt.loadNpmTasks('grunt-contrib-concat');
9-
grunt.loadNpmTasks('grunt-contrib-uglify');
6+
grunt.loadNpmTasks('grunt-contrib-copy');
7+
grunt.loadNpmTasks('grunt-contrib-clean');
8+
grunt.loadNpmTasks('grunt-webpack');
9+
10+
var webpackSettings = require('./webpack.config.js');
1011

1112
grunt.initConfig({
12-
packageBower: grunt.file.readJSON('./bower.json'),
13-
timestamp: (new Date()).toISOString(),
14-
releaseData: '/*!\n' +
15-
' * <%= packageBower.name %>\n' +
16-
' * <%= packageBower.homepage %>\n' +
17-
' * Version: <%= packageBower.version %> -- <%= timestamp %>\n' +
18-
' * License: <%= packageBower.license %>\n' +
19-
' */\n',
2013
connect: {
2114
app: {
2215
options: {
23-
base: './',
24-
middleware: require('./server/middleware'),
25-
port: 5001
16+
port: 5005,
17+
base: './demo',
18+
middleware: function (connect, options, middlewares) {
19+
middlewares.unshift(function (req, res, next) {
20+
var files = ['ui-scroll.js', 'ui-scroll-grid.js', 'ui-scroll.js.map', 'ui-scroll-grid.js.map'];
21+
for (var i = 0; i < files.length; i++) {
22+
if (req.url === '/dist/' + files[i]) {
23+
res.end(grunt.file.read('./temp/' + files[i]));
24+
}
25+
}
26+
next();
27+
});
28+
return middlewares;
29+
}
2630
}
2731
}
2832
},
@@ -35,108 +39,66 @@ module.exports = function (grunt) {
3539
files: [
3640
'src/**/*.js'
3741
],
38-
tasks: 'buildWatcher'
42+
tasks: 'webpack:default'
3943
}
4044
},
4145
karma: {
42-
unit: {
43-
options: {
44-
autoWatch: true,
45-
colors: true,
46-
configFile: './test/karma.conf.js',
47-
keepalive: true,
48-
port: 8082,
49-
runnerPort: 9100
50-
}
46+
options: {
47+
configFile: './test/karma.conf.js',
48+
runnerPort: 9100
5149
},
52-
travis: {
50+
default: {},
51+
compressed: {
5352
options: {
54-
colors: true,
55-
configFile: './test/karma.conf.js',
56-
runnerPort: 9100,
53+
files: require('./test/karma.conf.files.js').compressedFiles,
54+
port: 9876,
55+
autoWatch: false,
56+
keepalive: false,
5757
singleRun: true
5858
}
5959
}
6060
},
61-
babel: {
62-
options: {
63-
//sourceMap: true,
64-
babelrc: false,
65-
presets: ['es2015']
61+
webpack: {
62+
options: webpackSettings.config,
63+
default: {},
64+
compressed: {
65+
plugins: webpackSettings.compressedPlugins,
66+
output: {
67+
filename: '[name].min.js'
68+
}
69+
}
70+
},
71+
clean: {
72+
temp: ['temp']
73+
},
74+
copy: {
75+
sources: {
76+
files: [
77+
{expand: true, src: ['*'], cwd: 'temp', dest: 'dist/'},
78+
]
6679
},
67-
dist: {
80+
jqLiteExtrasFake: {
6881
files: [
82+
{expand: true, src: ['ui-scroll-jqlite.js'], cwd: 'src', dest: 'dist/'},
6983
{
70-
expand: true,
71-
cwd: 'src/',
72-
src: ['**/*.js'],
73-
dest: 'temp/',
74-
ext: '.js'
84+
expand: true, src: ['ui-scroll-jqlite.js'], cwd: 'src', dest: 'dist/', rename: function (dest, src) {
85+
return dest + src.replace(/\.js$/, ".min.js");
86+
}
7587
}
7688
]
7789
}
7890
},
79-
concat: {
80-
options: {
81-
banner: '<%= releaseData %> \n\n (function () {\n',
82-
footer: '}());',
83-
stripBanners: true,
84-
process: function (src, filepath) {
85-
var singleQuotes, strings;
86-
console.log("Processing " + filepath + " ...");
87-
strings = /("(?:(?:\\")|[^"])*")/g;
88-
singleQuotes = /'/g;
89-
return src.replace(strings, function (match) {
90-
var result;
91-
console.log("match: " + match);
92-
result = "'" + match.substring(1, match.length - 1).replace(singleQuotes, "\\'") + "'";
93-
console.log("replaced with: " + result);
94-
return result;
95-
});
96-
}
97-
},
98-
dynamic_mappings: {
99-
files: {
100-
'dist/ui-scroll.js': ['./temp/**/ui-scroll.js'],
101-
'dist/ui-scroll-grid.js': ['./temp/**/ui-scroll-grid.js'],
102-
'dist/ui-scroll-jqlite.js': ['./temp/**/ui-scroll-jqlite.js']
103-
}
104-
}
105-
},
106-
uglify: {
107-
options: {
108-
banner: '<%= releaseData %>'
109-
},
110-
common: {
111-
files: {
112-
'./dist/ui-scroll.min.js': ['./dist/ui-scroll.js'],
113-
'./dist/ui-scroll-grid.min.js': ['./dist/ui-scroll-grid.js'],
114-
'./dist/ui-scroll-jqlite.min.js': ['./dist/ui-scroll-jqlite.js']
115-
}
116-
}
117-
},
11891
jshint: {
119-
dist: {
92+
sources: {
12093
files: {
12194
src: [
122-
'./dist/ui-scroll.js',
123-
'./dist/ui-scroll-jqlite.js'
124-
]
125-
},
126-
options: {
127-
jshintrc: '.jshintrc'
128-
}
129-
},
130-
src: {
131-
files: {
132-
src: [
133-
'./src/ui-scroll.js',
134-
'./src/ui-scroll-jqlite.js'
95+
'./src/*.js',
96+
'./src/modules/*.js'
13597
]
13698
},
13799
options: grunt.util._.extend({}, grunt.file.readJSON('.jshintrc'), grunt.file.readJSON('./src/.jshintrc'))
138100
},
139-
test: {
101+
tests: {
140102
files: {
141103
src: ['./test/*Spec.js']
142104
},
@@ -163,39 +125,33 @@ module.exports = function (grunt) {
163125
}
164126
});
165127

166-
/**
167-
* Starts a web server
168-
* Enter the following command at the command line to execute this task:
169-
* grunt server
170-
*/
171128
grunt.registerTask('server', [
129+
'webpack:default',
172130
'connect',
173131
'watch'
174132
]);
175133

176134
grunt.registerTask('default', ['server']);
177135

178136
grunt.registerTask('test', [
179-
'babel',
180-
'karma:unit'
181-
]);
182-
183-
grunt.registerTask('buildWatcher', [
184-
'babel',
185-
'concat'
137+
'clean:temp',
138+
'webpack:default',
139+
'karma:default'
186140
]);
187141

188142
grunt.registerTask('build', [
189-
'jshint:test',
190-
'jshint:src',
191-
'babel',
192-
'karma:travis',
193-
'concat',
194-
'uglify:common'
143+
'jshint:tests',
144+
'jshint:sources',
145+
'clean:temp',
146+
'webpack:compressed',
147+
'karma:compressed',
148+
'webpack:default',
149+
'copy:sources',
150+
'copy:jqLiteExtrasFake'
195151
]);
196152

197153
grunt.registerTask('travis', [
198-
'babel',
199-
'karma:travis'
154+
'webpack:compressed',
155+
'karma:compressed'
200156
]);
201157
};

LICENSE

+21
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
The MIT License
2+
3+
Copyright (c) 2013-2017 Hill30 INC, https://github.com/Hill30
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
13+
all 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
21+
THE SOFTWARE.

LICENSE-MIT

-22
This file was deleted.

0 commit comments

Comments
 (0)