@@ -143,18 +143,7 @@ module.exports = function (grunt) {
143
143
}
144
144
} ,
145
145
typings :{
146
- src : [ 'src/validation/Validation.ts' , 'src/validation/Utils.ts' , 'src/validation/FormSchema.ts' ] ,
147
- dest : 'typings/<%= pkg.name %>' ,
148
- options : {
149
- basePath : 'src/validation' ,
150
- module : 'commonjs' ,
151
- target : 'es5' ,
152
- declaration : true ,
153
- comments :false
154
- }
155
- } ,
156
- otherTypings : {
157
- src : [ 'src/validation/BasicValidators.ts' ] ,
146
+ src : [ 'src/validation/*.ts' ] ,
158
147
dest : 'typings/<%= pkg.name %>' ,
159
148
options : {
160
149
basePath : 'src/validation' ,
@@ -243,29 +232,22 @@ module.exports = function (grunt) {
243
232
banner : '// Type definitions for <%= pkg.name %> - v<%= pkg.version %>\n' +
244
233
'// Project: https://github.com/rsamec/form\n' +
245
234
'// Definitions by: Roman Samec <https://github.com/rsamec>\n' +
246
- '// Definitions: https://github.com/borisyankov/DefinitelyTyped\n\n' ,
235
+ '// Definitions: https://github.com/borisyankov/DefinitelyTyped\n\n' +
236
+ '\n' +
237
+ '/// <reference path="../../typings/q/Q.d.ts" />\n' +
238
+ '/// <reference path="../../typings/underscore/underscore.d.ts" />\n' +
239
+ '/// <reference path="../../typings/hashmap/hashmap.d.ts" />\n' +
240
+ '/// <reference path="../../typings/node/node.d.ts" />\n' ,
241
+ footer :'declare module "business-rule-engine" {export = Validation;}' ,
247
242
process : function ( src , filepath ) {
248
243
return '// Source: ' + filepath + '\n' +
249
- src . replace ( / [ \t ] * e x p o r t = ( \w * ) ; ? / g, 'declare module "business-rule-engine" {export = $1;}' ) ;
244
+ src . replace ( / .* < r e f e r e n c e p a t h = .* / g, '' ) //remove references
245
+ . replace ( / e x p o r t .* / g, '' ) //remove exports
246
+ . replace ( / i m p o r t .* / g, '' ) ; // + //remove imports
250
247
}
251
248
} ,
252
249
files : {
253
- 'typings/<%= pkg.name %>/<%= pkg.name %>.d.ts' : [ 'typings/<%= pkg.name %>/Validation.d.ts' ]
254
- }
255
- } ,
256
- otherTypings :{
257
-
258
- options :{
259
- process : function ( src , filepath ) {
260
- return '// Source: ' + filepath + '\n' +
261
- src . replace ( / [ \t ] * e x p o r t = ( \w * ) ; ? / g, 'declare module "node-$1" {export = $1;}' ) ;
262
- }
263
- } ,
264
- files : {
265
- 'typings/<%= pkg.name %>/BasicValidators.d.ts' : [ 'typings/<%= pkg.name %>/BasicValidators.d.ts' ] ,
266
- 'typings/<%= pkg.name %>/Utils.d.ts' : [ 'typings/<%= pkg.name %>/Utils.d.ts' ] ,
267
- 'typings/<%= pkg.name %>/FormSchema.d.ts' : [ 'typings/<%= pkg.name %>/FormSchema.d.ts' ]
268
-
250
+ 'typings/<%= pkg.name %>/<%= pkg.name %>.d.ts' : [ 'typings/<%= pkg.name %>/Utils.d.ts' , 'typings/<%= pkg.name %>/Validation.d.ts' , 'typings/<%= pkg.name %>/BasicValidators.d.ts' , 'typings/<%= pkg.name %>/FormSchema.d.ts' ]
269
251
}
270
252
}
271
253
}
@@ -286,8 +268,8 @@ module.exports = function (grunt) {
286
268
287
269
288
270
grunt . registerTask ( 'test' , [ 'typescript:src' , 'typescript:test' , 'mochacli' , 'watch' ] ) ;
289
- grunt . registerTask ( 'ci' , [ 'complexity' , 'jshint' , 'mochacli' ] ) ;
271
+ // grunt.registerTask('ci', ['complexity', 'jshint', 'mochacli']);
290
272
grunt . registerTask ( 'dist' , [ 'typescript:commonjs' , 'typescript:amd' , 'typescript:customValidatorsCommonjs' , 'typescript:customValidatorsAmd' , 'typescript:localCommonjs' , 'typescript:localAmd' , 'copy' , 'concat:module' , 'uglify:dist' ] ) ;
291
- grunt . registerTask ( 'typings' , [ 'typescript:typings' , 'concat:typings' , 'typescript:otherTypings' , 'concat:otherTypings' ] ) ;
273
+ grunt . registerTask ( 'typings' , [ 'typescript:typings' , 'concat:typings' ] ) ;
292
274
grunt . registerTask ( 'document' , [ 'typedoc' ] ) ;
293
275
} ;
0 commit comments