Skip to content
This repository has been archived by the owner on Aug 18, 2018. It is now read-only.

Commit

Permalink
gulp generate definitions without any triple slash reference. package…
Browse files Browse the repository at this point in the history
….json has a typings reference now
  • Loading branch information
pablorsk committed Aug 6, 2016
1 parent f447361 commit cb30cf2
Show file tree
Hide file tree
Showing 5 changed files with 46 additions and 44 deletions.
2 changes: 0 additions & 2 deletions dist/ts-angular-jsonapi.js

Large diffs are not rendered by default.

48 changes: 24 additions & 24 deletions dist/tsd.d.ts
Expand Up @@ -129,7 +129,7 @@ declare module Jsonapi {
}
}

/// <reference path="_all.d.ts" />


declare module Jsonapi {
class Base {
Expand All @@ -141,7 +141,7 @@ declare module Jsonapi {
}
}

/// <reference path="../_all.d.ts" />

declare module Jsonapi {
class Http {
protected $http: any;
Expand Down Expand Up @@ -193,7 +193,7 @@ declare module Jsonapi {
}
}

/// <reference path="_all.d.ts" />

declare module Jsonapi {
class Core implements Jsonapi.ICore {
protected rsJsonapiConfig: any;
Expand Down Expand Up @@ -262,27 +262,27 @@ declare module Jsonapi {
}
}

/// <reference path="interfaces/document.d.ts" />
/// <reference path="interfaces/data-collection.d.ts" />
/// <reference path="interfaces/data-object.d.ts" />
/// <reference path="interfaces/data-resource.d.ts" />
/// <reference path="interfaces/params.d.ts" />
/// <reference path="interfaces/errors.d.ts" />
/// <reference path="interfaces/links.d.ts" />
/// <reference path="interfaces/schema.d.ts" />
/// <reference path="interfaces/core.d.ts" />
/// <reference path="interfaces/collection.d.ts" />
/// <reference path="interfaces/resource.d.ts" />
/// <reference path="app.module.d.ts" />
/// <reference path="services/base.d.ts" />
/// <reference path="services/http.service.d.ts" />
/// <reference path="services/filter.d.ts" />
/// <reference path="services/path-maker.d.ts" />
/// <reference path="services/resource-converter.d.ts" />
/// <reference path="core.d.ts" />
/// <reference path="resource.d.ts" />

/// <reference path="../_all.d.ts" />





















declare module Jsonapi {
class CoreServices {
protected JsonapiHttp: any;
Expand Down
13 changes: 6 additions & 7 deletions gulpfile.js
Expand Up @@ -77,6 +77,7 @@ gulp.task('lib', function() {
});

var merge = require('merge-stream');
var stripLine = require('gulp-strip-line');
gulp.task('dist', function() {

// get ts interfaces
Expand All @@ -92,22 +93,20 @@ gulp.task('dist', function() {
}));
var content1 = tsResult.dts;

// get ts definitions
var content2 = gulp.src(['src/library/**/*.d.ts'])
.pipe(sourcemaps.init()) // This means sourcemaps will be generated
.pipe(concat('ts-angular-jsonapi.d.ts')) // You can use other plugins that also support gulp-sourcemaps
.pipe(sourcemaps.write()) // Now the sourcemaps are added to the .js file
;
// // get ts definitions
var content2 = gulp.src(['src/library/**/*.d.ts']);

// put all ts information
var final_content = merge(content1, content2);
final_content
.pipe(concat('tsd.d.ts'))
// remove lines with triple-slash references
// ref: https://www.typescriptlang.org/docs/handbook/typings-for-npm-packages.html
.pipe(stripLine([/^\/\/\//, 'use strict']))
.pipe(gulp.dest('dist'))

// get all ts information for compression
var tsResult = gulp.src(['src/library/**/*.ts', 'src/*.ts'])
.pipe(sourcemaps.init()) // This means sourcemaps will be generated
.pipe(ts({
sortOutput: true,
}));
Expand Down
8 changes: 8 additions & 0 deletions index.js
@@ -0,0 +1,8 @@
// Should already be required, here for clarity
require('angular');

// Now load Ts Angular Jsonapi
require('./dist/ts-angular-jsonapi.js');

// Export namespace
module.exports = 'ts-angular-jsonapi';
19 changes: 8 additions & 11 deletions package.json
@@ -1,23 +1,18 @@
{
"name": "ts-angular-jsonapi",
"version": "0.0.3",
"description": "ts-angular-jsonapi",
"contributors": [
{
"name": "Pablo Reyes",
"email": "pablo@reyesoft.com"
}
],
"version": "0.0.7",
"description": "JSONAPI library developed for AngularJS in Typescript",
"repository": {
"type": "git",
"url": "https://github.com/DanWahlin/AngularIn20TypeScript"
"url": "https://github.com/reyesoft/ts-angular-jsonapi"
},
"bugs": {
"url": "https://github.com/reyesoft/ts-angular-jsonapi/issues"
},
"main": "dist/ts-angular-jsonapi.js",
"main": "index.js",
"typings": "./dist/tsd.d.ts",
"files": [
"dist/ts-angular-jsonapi.js",
"index.js",
"dist/**",
"LICENSE",
"README.md",
Expand All @@ -30,6 +25,7 @@
},
"keywords": [
"angularjs",
"jsonapi",
"typescript"
],
"license": "ISC",
Expand All @@ -43,6 +39,7 @@
"gulp-inject": "^4.0.0",
"gulp-ng-annotate": "^2.0.0",
"gulp-sourcemaps": "^1.6.0",
"gulp-strip-line": "0.0.1",
"gulp-tslint": "^5.0.0",
"gulp-typescript": "^2.13.0",
"gulp-uglify": "^1.5.3",
Expand Down

0 comments on commit cb30cf2

Please sign in to comment.