Compare commits
20 Commits
Author | SHA1 | Date | |
---|---|---|---|
74deee70a3 | |||
019864a484 | |||
80db0fc581 | |||
9a25b4ef91 | |||
9f42a20e4b | |||
dbb8fd0fff | |||
4368713ad5 | |||
58cea5cb48 | |||
329e0dc101 | |||
da45d002a3 | |||
59e811247f | |||
7bcd2f4f5d | |||
78d77c003c | |||
aca85d2ff3 | |||
f03c4a45c2 | |||
faf55e4e31 | |||
b78fe35e88 | |||
7ab4561727 | |||
200f44a792 | |||
312dc4bd7f |
@ -1,3 +1,4 @@
|
||||
# standard ci
|
||||
image: hosttoday/ht-docker-node:npmci
|
||||
|
||||
stages:
|
||||
@ -50,7 +51,7 @@ pages:
|
||||
image: hosttoday/ht-docker-node:npmpage
|
||||
stage: pages
|
||||
script:
|
||||
- npmci command npmpage --host gitlab
|
||||
- npmci command npmpage --publish gitlab
|
||||
only:
|
||||
- tags
|
||||
artifacts:
|
||||
|
@ -1,4 +1,3 @@
|
||||
.idea/
|
||||
compile/
|
||||
coverage/
|
||||
test/
|
||||
|
@ -1,7 +1,5 @@
|
||||
Please view this file on the master branch, on stable branches it's out of date.
|
||||
|
||||
v 6.0.0 (unreleased)
|
||||
- handle bithound
|
||||
- check package.json
|
||||
- check .gitlab-ci-yml
|
||||
- check appveyor.yml
|
||||
v 6.0.0 (released)
|
||||
- remove TypeDoc, please look at npmpage
|
||||
- check package.json
|
4
dist/mod00/index.d.ts
vendored
4
dist/mod00/index.d.ts
vendored
@ -1,4 +1,2 @@
|
||||
/// <reference types="q" />
|
||||
import * as q from 'q';
|
||||
import { INpmtsConfig } from '../npmts.config';
|
||||
export declare let run: (configArg: INpmtsConfig) => q.Promise<INpmtsConfig>;
|
||||
export declare let run: (configArg: INpmtsConfig) => Promise<INpmtsConfig>;
|
||||
|
2
dist/mod00/index.js
vendored
2
dist/mod00/index.js
vendored
@ -2,7 +2,7 @@
|
||||
/* ------------------------------------------
|
||||
* This module compiles TypeScript files
|
||||
* -------------------------------------------- */
|
||||
const q = require("q");
|
||||
const q = require("smartq");
|
||||
const npmts_log_1 = require("../npmts.log");
|
||||
const NpmtsAssets = require("./mod00.assets");
|
||||
const NpmtsCheck = require("./mod00.check");
|
||||
|
4
dist/mod00/mod00.assets.d.ts
vendored
4
dist/mod00/mod00.assets.d.ts
vendored
@ -1,3 +1 @@
|
||||
/// <reference types="q" />
|
||||
import * as q from 'q';
|
||||
export declare var run: (configArg: any) => q.Promise<{}>;
|
||||
export declare let run: (configArg: any) => Promise<{}>;
|
||||
|
2
dist/mod00/mod00.assets.js
vendored
2
dist/mod00/mod00.assets.js
vendored
@ -1,5 +1,5 @@
|
||||
"use strict";
|
||||
const q = require("q");
|
||||
const q = require("smartq");
|
||||
const paths = require("../npmts.paths");
|
||||
const npmts_log_1 = require("../npmts.log");
|
||||
const plugins = require("./mod00.plugins");
|
||||
|
4
dist/mod00/mod00.check.d.ts
vendored
4
dist/mod00/mod00.check.d.ts
vendored
@ -1,5 +1,3 @@
|
||||
/// <reference types="q" />
|
||||
import * as q from 'q';
|
||||
import { ProjectinfoNpm } from 'projectinfo';
|
||||
export declare let projectInfo: ProjectinfoNpm;
|
||||
export declare let run: (configArg: any) => q.Promise<{}>;
|
||||
export declare let run: (configArg: any) => Promise<{}>;
|
||||
|
2
dist/mod00/mod00.check.js
vendored
2
dist/mod00/mod00.check.js
vendored
@ -1,5 +1,5 @@
|
||||
"use strict";
|
||||
const q = require("q");
|
||||
const q = require("smartq");
|
||||
const projectinfo_1 = require("projectinfo");
|
||||
const paths = require("../npmts.paths");
|
||||
const npmts_log_1 = require("../npmts.log");
|
||||
|
4
dist/mod00/mod00.clean.d.ts
vendored
4
dist/mod00/mod00.clean.d.ts
vendored
@ -1,3 +1 @@
|
||||
/// <reference types="q" />
|
||||
import * as q from 'q';
|
||||
export declare let run: (configArg: any) => q.Promise<{}>;
|
||||
export declare let run: (configArg: any) => Promise<{}>;
|
||||
|
2
dist/mod00/mod00.clean.js
vendored
2
dist/mod00/mod00.clean.js
vendored
@ -1,5 +1,5 @@
|
||||
"use strict";
|
||||
const q = require("q");
|
||||
const q = require("smartq");
|
||||
const paths = require("../npmts.paths");
|
||||
const npmts_log_1 = require("../npmts.log");
|
||||
const plugins = require("./mod00.plugins");
|
||||
|
4
dist/mod00/mod00.compile.d.ts
vendored
4
dist/mod00/mod00.compile.d.ts
vendored
@ -1,3 +1 @@
|
||||
/// <reference types="q" />
|
||||
import * as q from 'q';
|
||||
export declare let run: (configArg: any) => q.Promise<{}>;
|
||||
export declare let run: (configArg: any) => Promise<{}>;
|
||||
|
2
dist/mod00/mod00.compile.js
vendored
2
dist/mod00/mod00.compile.js
vendored
@ -1,5 +1,5 @@
|
||||
"use strict";
|
||||
const q = require("q");
|
||||
const q = require("smartq");
|
||||
const paths = require("../npmts.paths");
|
||||
const npmts_log_1 = require("../npmts.log");
|
||||
const plugins = require("./mod00.plugins");
|
||||
|
3
dist/mod00/mod00.plugins.d.ts
vendored
3
dist/mod00/mod00.plugins.d.ts
vendored
@ -1,6 +1,5 @@
|
||||
export * from '../npmts.plugins';
|
||||
import * as tsn from 'tsn';
|
||||
import * as shelljs from 'shelljs';
|
||||
import * as smartchok from 'smartchok';
|
||||
import * as smartstream from 'smartstream';
|
||||
export { tsn, shelljs, smartchok, smartstream };
|
||||
export { tsn, smartchok, smartstream };
|
||||
|
2
dist/mod00/mod00.plugins.js
vendored
2
dist/mod00/mod00.plugins.js
vendored
@ -5,8 +5,6 @@ function __export(m) {
|
||||
__export(require("../npmts.plugins"));
|
||||
const tsn = require("tsn");
|
||||
exports.tsn = tsn;
|
||||
const shelljs = require("shelljs");
|
||||
exports.shelljs = shelljs;
|
||||
const smartchok = require("smartchok");
|
||||
exports.smartchok = smartchok;
|
||||
const smartstream = require("smartstream");
|
||||
|
4
dist/mod01/index.d.ts
vendored
4
dist/mod01/index.d.ts
vendored
@ -1,4 +1,2 @@
|
||||
/// <reference types="q" />
|
||||
import * as q from 'q';
|
||||
import { INpmtsConfig } from '../npmts.config';
|
||||
export declare let run: (configArg: INpmtsConfig) => q.Promise<INpmtsConfig>;
|
||||
export declare let run: (configArg: INpmtsConfig) => Promise<INpmtsConfig>;
|
||||
|
48
dist/mod01/index.js
vendored
48
dist/mod01/index.js
vendored
@ -2,53 +2,9 @@
|
||||
/* ------------------------------------------
|
||||
* This module creates TypeScript documentation
|
||||
* -------------------------------------------- */
|
||||
const q = require("q");
|
||||
const paths = require("../npmts.paths");
|
||||
const npmts_log_1 = require("../npmts.log");
|
||||
const plugins = require("./mod01.plugins");
|
||||
const mod00_check_1 = require("../mod00/mod00.check");
|
||||
let genTypeDoc = function (configArg) {
|
||||
let done = q.defer();
|
||||
npmts_log_1.npmtsOra.text('now generating ' + 'TypeDoc documentation'.yellow);
|
||||
plugins.beautylog.log('TypeDoc Output:');
|
||||
let localSmartstream = new plugins.smartstream.Smartstream([
|
||||
plugins.gulp.src(plugins.path.join(paths.tsDir, '**/*.ts')),
|
||||
plugins.gulpTypedoc({
|
||||
// TypeScript options (see typescript docs)
|
||||
module: 'commonjs',
|
||||
target: 'es6',
|
||||
includeDeclarations: true,
|
||||
// Output options (see typedoc docs)
|
||||
out: paths.pagesApiDir,
|
||||
json: plugins.path.join(paths.pagesApiDir, 'file.json'),
|
||||
// TypeDoc options (see typedoc docs)
|
||||
name: mod00_check_1.projectInfo.name,
|
||||
readme: plugins.path.join(paths.cwd, 'README.md'),
|
||||
// theme: "default",
|
||||
version: true
|
||||
})
|
||||
]);
|
||||
localSmartstream.run().then(() => {
|
||||
plugins.beautylog.ok('TypeDoc documentation generated!');
|
||||
done.resolve(configArg);
|
||||
}, (err) => {
|
||||
plugins.beautylog.warn('TypeDoc documentation generation failed!');
|
||||
console.log(err);
|
||||
done.resolve(configArg);
|
||||
});
|
||||
return done.promise;
|
||||
};
|
||||
const q = require("smartq");
|
||||
exports.run = function (configArg) {
|
||||
let done = q.defer();
|
||||
if (configArg.docs) {
|
||||
genTypeDoc(configArg)
|
||||
.then(() => {
|
||||
done.resolve(configArg);
|
||||
});
|
||||
}
|
||||
else {
|
||||
done.resolve(configArg);
|
||||
}
|
||||
;
|
||||
done.resolve(configArg);
|
||||
return done.promise;
|
||||
};
|
||||
|
3
dist/mod01/mod01.plugins.d.ts
vendored
3
dist/mod01/mod01.plugins.d.ts
vendored
@ -1,4 +1 @@
|
||||
export * from '../npmts.plugins';
|
||||
import * as gulp from 'gulp';
|
||||
declare let gulpTypedoc: any;
|
||||
export { gulp, gulpTypedoc };
|
||||
|
4
dist/mod01/mod01.plugins.js
vendored
4
dist/mod01/mod01.plugins.js
vendored
@ -3,7 +3,3 @@ function __export(m) {
|
||||
for (var p in m) if (!exports.hasOwnProperty(p)) exports[p] = m[p];
|
||||
}
|
||||
__export(require("../npmts.plugins"));
|
||||
const gulp = require("gulp");
|
||||
exports.gulp = gulp;
|
||||
let gulpTypedoc = require('gulp-typedoc');
|
||||
exports.gulpTypedoc = gulpTypedoc;
|
||||
|
4
dist/mod02/index.d.ts
vendored
4
dist/mod02/index.d.ts
vendored
@ -1,4 +1,2 @@
|
||||
/// <reference types="q" />
|
||||
import * as q from 'q';
|
||||
import { INpmtsConfig } from '../npmts.config';
|
||||
export declare let run: (configArg: INpmtsConfig) => q.Promise<INpmtsConfig>;
|
||||
export declare let run: (configArg: INpmtsConfig) => Promise<INpmtsConfig>;
|
||||
|
36
dist/mod02/index.js
vendored
36
dist/mod02/index.js
vendored
@ -1,10 +1,18 @@
|
||||
"use strict";
|
||||
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
||||
return new (P || (P = Promise))(function (resolve, reject) {
|
||||
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
||||
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
||||
function step(result) { result.done ? resolve(result.value) : new P(function (resolve) { resolve(result.value); }).then(fulfilled, rejected); }
|
||||
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
||||
});
|
||||
};
|
||||
/* ------------------------------------------
|
||||
* This module tests the compiled TypeScript files
|
||||
* -------------------------------------------- */
|
||||
const plugins = require("./mod02.plugins");
|
||||
const paths = require("../npmts.paths");
|
||||
const q = require("q");
|
||||
const q = require("smartq");
|
||||
const npmts_log_1 = require("../npmts.log");
|
||||
/**
|
||||
* runs mocha
|
||||
@ -15,29 +23,33 @@ let mocha = function (configArg) {
|
||||
npmts_log_1.npmtsOra.end(); // end npmtsOra for tests.
|
||||
let done = q.defer();
|
||||
let coverageSmartstream = new plugins.smartstream.Smartstream([
|
||||
plugins.gulp.src([plugins.path.join(paths.cwd, './dist/**/*.js')]),
|
||||
plugins.gulp.src([plugins.path.join(paths.cwd, './ts/**/*.ts')]),
|
||||
plugins.gulpSourcemaps.init(),
|
||||
plugins.gulpBabel({
|
||||
presets: [
|
||||
require.resolve('babel-preset-es2015')
|
||||
]
|
||||
plugins.gulpTypeScript({
|
||||
target: 'ES5',
|
||||
emitDecoratorMetadata: true,
|
||||
experimentalDecorators: true,
|
||||
lib: ['ES2015.Promise', 'ES5', 'ES2015.Generator', 'ES2015.Iterable']
|
||||
}),
|
||||
plugins.gulpIstanbul({}),
|
||||
plugins.gulpSourcemaps.write(),
|
||||
plugins.gulpFunction.forEach((file) => __awaiter(this, void 0, void 0, function* () {
|
||||
file.path = file.path.replace(paths.tsDir, paths.distDir);
|
||||
})),
|
||||
plugins.gulpInjectModules(),
|
||||
plugins.through2.obj((file, enc, cb) => {
|
||||
console.log(file);
|
||||
cb();
|
||||
}, (cb) => {
|
||||
cb();
|
||||
})
|
||||
]);
|
||||
let localSmartstream = new plugins.smartstream.Smartstream([
|
||||
plugins.gulp.src([plugins.path.join(paths.cwd, 'test/test.js')]),
|
||||
plugins.gulpBabel({
|
||||
presets: [
|
||||
require.resolve('babel-preset-es2015')
|
||||
]
|
||||
plugins.gulp.src([plugins.path.join(paths.cwd, 'test/test.ts')]),
|
||||
plugins.gulpTypeScript({
|
||||
target: 'ES5',
|
||||
emitDecoratorMetadata: true,
|
||||
experimentalDecorators: true,
|
||||
lib: ['ES2015.Promise', 'ES5', 'ES2015.Generator', 'ES2015.Iterable']
|
||||
}),
|
||||
plugins.gulpInjectModules(),
|
||||
plugins.gulpMocha(),
|
||||
|
6
dist/mod02/mod02.plugins.d.ts
vendored
6
dist/mod02/mod02.plugins.d.ts
vendored
@ -1,9 +1,9 @@
|
||||
export * from '../npmts.plugins';
|
||||
import * as gulp from 'gulp';
|
||||
import * as gulpBabel from 'gulp-babel';
|
||||
import * as gulpIstanbul from 'gulp-istanbul';
|
||||
import * as gulpFunction from 'gulp-function';
|
||||
import * as gulpIstanbul from 'gulp-istanbul';
|
||||
declare let gulpInjectModules: any;
|
||||
import * as gulpMocha from 'gulp-mocha';
|
||||
import * as gulpSourcemaps from 'gulp-sourcemaps';
|
||||
export { gulp, gulpBabel, gulpIstanbul, gulpFunction, gulpInjectModules, gulpMocha, gulpSourcemaps };
|
||||
import * as gulpTypeScript from 'gulp-typescript';
|
||||
export { gulp, gulpFunction, gulpIstanbul, gulpInjectModules, gulpMocha, gulpSourcemaps, gulpTypeScript };
|
||||
|
8
dist/mod02/mod02.plugins.js
vendored
8
dist/mod02/mod02.plugins.js
vendored
@ -5,15 +5,15 @@ function __export(m) {
|
||||
__export(require("../npmts.plugins"));
|
||||
const gulp = require("gulp");
|
||||
exports.gulp = gulp;
|
||||
const gulpBabel = require("gulp-babel");
|
||||
exports.gulpBabel = gulpBabel;
|
||||
const gulpIstanbul = require("gulp-istanbul");
|
||||
exports.gulpIstanbul = gulpIstanbul;
|
||||
const gulpFunction = require("gulp-function");
|
||||
exports.gulpFunction = gulpFunction;
|
||||
const gulpIstanbul = require("gulp-istanbul");
|
||||
exports.gulpIstanbul = gulpIstanbul;
|
||||
let gulpInjectModules = require('gulp-inject-modules');
|
||||
exports.gulpInjectModules = gulpInjectModules;
|
||||
const gulpMocha = require("gulp-mocha");
|
||||
exports.gulpMocha = gulpMocha;
|
||||
const gulpSourcemaps = require("gulp-sourcemaps");
|
||||
exports.gulpSourcemaps = gulpSourcemaps;
|
||||
const gulpTypeScript = require("gulp-typescript");
|
||||
exports.gulpTypeScript = gulpTypeScript;
|
||||
|
4
dist/npmts.cli.d.ts
vendored
4
dist/npmts.cli.d.ts
vendored
@ -1,3 +1 @@
|
||||
/// <reference types="q" />
|
||||
import * as q from 'q';
|
||||
export declare let run: () => q.Promise<{}>;
|
||||
export declare let run: () => Promise<{}>;
|
||||
|
2
dist/npmts.cli.js
vendored
2
dist/npmts.cli.js
vendored
@ -1,5 +1,5 @@
|
||||
"use strict";
|
||||
const q = require("q");
|
||||
const q = require("smartq");
|
||||
const plugins = require("./npmts.plugins");
|
||||
const paths = require("./npmts.paths");
|
||||
const NpmtsConfig = require("./npmts.config");
|
||||
|
5
dist/npmts.config.d.ts
vendored
5
dist/npmts.config.d.ts
vendored
@ -1,10 +1,7 @@
|
||||
/// <reference types="q" />
|
||||
import * as q from 'q';
|
||||
export declare type npmtsMode = 'default' | 'custom';
|
||||
export interface INpmtsConfig {
|
||||
argv: any;
|
||||
coverageTreshold: number;
|
||||
docs: boolean;
|
||||
mode: npmtsMode;
|
||||
test: boolean;
|
||||
testTs: any;
|
||||
@ -12,4 +9,4 @@ export interface INpmtsConfig {
|
||||
tsOptions: any;
|
||||
watch: boolean;
|
||||
}
|
||||
export declare var run: (argvArg: any) => q.Promise<{}>;
|
||||
export declare let run: (argvArg: any) => Promise<{}>;
|
||||
|
7
dist/npmts.config.js
vendored
7
dist/npmts.config.js
vendored
@ -1,7 +1,7 @@
|
||||
"use strict";
|
||||
const plugins = require("./npmts.plugins");
|
||||
const paths = require("./npmts.paths");
|
||||
const q = require("q");
|
||||
const q = require("smartq");
|
||||
const npmts_log_1 = require("./npmts.log");
|
||||
;
|
||||
exports.run = function (argvArg) {
|
||||
@ -9,7 +9,6 @@ exports.run = function (argvArg) {
|
||||
let defaultConfig = {
|
||||
argv: undefined,
|
||||
coverageTreshold: 70,
|
||||
docs: true,
|
||||
mode: 'default',
|
||||
test: true,
|
||||
testTs: {},
|
||||
@ -50,10 +49,6 @@ exports.run = function (argvArg) {
|
||||
config.test = false;
|
||||
}
|
||||
;
|
||||
if (config.argv.nodocs) {
|
||||
config.docs = false;
|
||||
}
|
||||
;
|
||||
if (config.argv.watch) {
|
||||
config.watch = true;
|
||||
}
|
||||
|
2
dist/npmts.ship.js
vendored
2
dist/npmts.ship.js
vendored
@ -1,5 +1,5 @@
|
||||
"use strict";
|
||||
const q = require("q");
|
||||
const q = require("smartq");
|
||||
const plugins = require("./npmts.plugins");
|
||||
exports.run = (configArg) => {
|
||||
let done = q.defer();
|
||||
|
4
dist/npmts.watch.d.ts
vendored
4
dist/npmts.watch.d.ts
vendored
@ -1,4 +1,2 @@
|
||||
/// <reference types="q" />
|
||||
import * as q from 'q';
|
||||
import { INpmtsConfig } from './npmts.config';
|
||||
export declare let run: (configArg: INpmtsConfig) => q.Promise<{}>;
|
||||
export declare let run: (configArg: INpmtsConfig) => Promise<{}>;
|
||||
|
2
dist/npmts.watch.js
vendored
2
dist/npmts.watch.js
vendored
@ -1,5 +1,5 @@
|
||||
"use strict";
|
||||
const q = require("q");
|
||||
const q = require("smartq");
|
||||
const smartchok = require("smartchok");
|
||||
const plugins = require("./npmts.plugins");
|
||||
const cli = require("./npmts.cli");
|
||||
|
@ -20,7 +20,6 @@ with default behaviour.
|
||||
```json
|
||||
{
|
||||
"mode":"custom",
|
||||
"docs":false,
|
||||
"test":true,
|
||||
"npmts":{
|
||||
"ts":{
|
||||
@ -38,7 +37,6 @@ with default behaviour.
|
||||
| key | default value | description |
|
||||
| --- | --- | --- |
|
||||
| `"mode"` | `"default"` | "default" will do default stuff and override , "custom" only does what you specify |
|
||||
| `"docs"` | `true` | create docs for your module |
|
||||
| `"test"` | `true` | test your module |
|
||||
| `"ts"` | `{"./ts/*.ts":"./","./test/test.ts":"./test/"}` | allows you to define multiple ts portions |
|
||||
| `"tsOptions"` | `{"target":"ES5", "declaration":"true"}` | specify options for tsc |
|
||||
@ -63,11 +61,6 @@ This is in line with the latest TypeScript best practices.
|
||||
You can then import plugins via the TypeScript `import` Syntax
|
||||
and tsc will pick up the declaration file automatically.
|
||||
|
||||
### TypeDoc
|
||||
By default TypeDoc will create docs for your module in `./pages/api/` directory.
|
||||
> Note: Use [npmpage](https://www.npmjs.com/package/npmpage) to build a website for the module.
|
||||
It also allows you to integrate api docs with a gitbook located in `./docs/`
|
||||
|
||||
## Some notes:
|
||||
#### Typings for third party modules that do not bundle declaration files
|
||||
NPMTS no longer supports typings.json. Instead use the new TypeScript 2.x approach to typings using the @types/ npm scope.
|
||||
|
@ -4,5 +4,4 @@
|
||||
1. **Clean:** Clean up from any previous builds (old js files)
|
||||
1. **Check:** Check project for typings declaration in package.json, unused dependencies and missing dependencies
|
||||
1. **Transpile:** Transpile TypeScript with **inline sourcemaps** and **declaration files** to ES target
|
||||
1. **Documentation:** Create TypeDoc Documentation from TypeScript files
|
||||
1. **Test:** Babelify ES6 to ES5 on the fly, instrumentalize ES5 JavaScript with istanbul and run tests with Mocha.
|
@ -5,11 +5,13 @@ Write npm modules with TypeScript without hassle. TypeScript ready. Fully ES6.
|
||||
[](https://www.npmjs.com/package/npmts)
|
||||
[](https://gitlab.com/pushrocks/npmts)
|
||||
[](https://github.com/pushrocks/npmts)
|
||||
[](https://pushrocks.gitlab.io/npmts/gitbook)
|
||||
[](https://pushrocks.gitlab.io/npmts/)
|
||||
|
||||
## Status for master
|
||||
[](https://gitlab.com/pushrocks/npmts/commits/master)
|
||||
[](https://gitlab.com/pushrocks/npmts/commits/master)
|
||||
[](https://www.npmjs.com/package/npmts)
|
||||
[](https://hub.docker.com/r/hosttoday/ht-docker-node/)
|
||||
[](https://david-dm.org/pushrocks/npmts)
|
||||
[](https://www.bithound.io/github/pushrocks/npmts/master/dependencies/npm)
|
||||
[](https://www.bithound.io/github/pushrocks/npmts)
|
||||
@ -32,11 +34,11 @@ This works on your machine and in CI. There is a prebuild docker image available
|
||||
[hosttoday/ht-docker-node:npmts on Dockerhub](https://hub.docker.com/r/hosttoday/ht-docker-node/)
|
||||
|
||||
For further information read the docs:
|
||||
* [1. Intro](https://pushrocks.gitlab.io/npmts/gitbook/index.md)
|
||||
* [2. Install](https://pushrocks.gitlab.io/npmts/gitbook/install.md)
|
||||
* [3. Default Behaviour](https://pushrocks.gitlab.io/npmts/gitbook/default.md)
|
||||
* [4. Configuration](https://pushrocks.gitlab.io/npmts/gitbook/config.md)
|
||||
* [5. Examples](https://pushrocks.gitlab.io/npmts/gitbook/examples.md)
|
||||
* [6. Info](https://pushrocks.gitlab.io/npmts/gitbook/info.md)
|
||||
1. [Intro](https://pushrocks.gitlab.io/npmts/index.html)
|
||||
2. [Install](https://pushrocks.gitlab.io/npmts/install.html)
|
||||
3. [Default Behaviour](https://pushrocks.gitlab.io/npmts/default.html)
|
||||
4. [Configuration](https://pushrocks.gitlab.io/npmts/config.html)
|
||||
5. [Examples](https://pushrocks.gitlab.io/npmts/examples.html)
|
||||
6. [Info](https://pushrocks.gitlab.io/npmts/info.html)
|
||||
|
||||
[](https://push.rocks)
|
||||
|
39
package.json
39
package.json
@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "npmts",
|
||||
"version": "5.5.9",
|
||||
"version": "6.1.4",
|
||||
"description": "Write npm modules with TypeScript without hassle. TypeScript ready. Fully ES6.",
|
||||
"main": "dist/index.js",
|
||||
"bin": {
|
||||
@ -35,49 +35,42 @@
|
||||
"homepage": "https://gitlab.com/pushrocks/npmts#readme",
|
||||
"dependencies": {
|
||||
"@types/gulp": "^3.8.32",
|
||||
"@types/gulp-babel": "^6.1.29",
|
||||
"@types/gulp-istanbul": "^0.9.30",
|
||||
"@types/gulp-mocha": "0.0.29",
|
||||
"@types/gulp-sourcemaps": "0.0.29",
|
||||
"@types/minimatch": "^2.0.29",
|
||||
"@types/q": "^0.x.x",
|
||||
"@types/shelljs": "^0.3.33",
|
||||
"@types/through2": "^2.0.32",
|
||||
"babel-preset-es2015": "^6.18.0",
|
||||
"beautylog": "6.0.0",
|
||||
"depcheck": "^0.6.5",
|
||||
"depcheck": "^0.6.7",
|
||||
"early": "^2.0.35",
|
||||
"gulp": "3.9.1",
|
||||
"gulp-babel": "^6.1.2",
|
||||
"gulp-function": "^2.2.2",
|
||||
"gulp-function": "^2.2.3",
|
||||
"gulp-inject-modules": "^1.0.0",
|
||||
"gulp-istanbul": "^1.1.1",
|
||||
"gulp-mocha": "^3.0.1",
|
||||
"gulp-sourcemaps": "^2.2.0",
|
||||
"gulp-typedoc": "^2.0.0",
|
||||
"lodash": "^4.17.2",
|
||||
"gulp-sourcemaps": "^2.4.0",
|
||||
"gulp-typescript": "^3.1.4",
|
||||
"lodash": "^4.17.4",
|
||||
"npmextra": "^2.0.3",
|
||||
"projectinfo": "1.0.4",
|
||||
"q": "^1.4.1",
|
||||
"shelljs": "^0.7.5",
|
||||
"projectinfo": "3.0.1",
|
||||
"smartchok": "^1.0.4",
|
||||
"smartcli": "1.0.15",
|
||||
"smartcli": "2.0.1",
|
||||
"smartcov": "1.0.0",
|
||||
"smartenv": "2.0.0",
|
||||
"smartfile": "4.1.0",
|
||||
"smartpath": "3.2.5",
|
||||
"smartfile": "4.1.2",
|
||||
"smartpath": "3.2.7",
|
||||
"smartq": "^1.0.2",
|
||||
"smartstream": "^1.0.5",
|
||||
"smartstring": "^2.0.22",
|
||||
"smartsystem": "^1.0.9",
|
||||
"source-map-support": "^0.4.6",
|
||||
"through2": "^2.0.1",
|
||||
"tsn": "^2.0.13",
|
||||
"typedoc": "^0.5.1",
|
||||
"smartsystem": "^1.0.12",
|
||||
"source-map-support": "^0.4.8",
|
||||
"through2": "^2.0.3",
|
||||
"tsn": "^2.0.14",
|
||||
"typescript": "next",
|
||||
"typings-global": "^1.0.14"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@types/should": "^8.1.30",
|
||||
"should": "^11.1.1"
|
||||
"should": "^11.1.2"
|
||||
}
|
||||
}
|
||||
|
@ -1,7 +1,7 @@
|
||||
/* ------------------------------------------
|
||||
* This module compiles TypeScript files
|
||||
* -------------------------------------------- */
|
||||
import * as q from 'q'
|
||||
import * as q from 'smartq'
|
||||
|
||||
import { npmtsOra } from '../npmts.log'
|
||||
import { INpmtsConfig } from '../npmts.config'
|
||||
@ -13,7 +13,7 @@ import * as NpmtsCheck from './mod00.check'
|
||||
import * as NpmtsClean from './mod00.clean'
|
||||
import * as NpmtsCompile from './mod00.compile'
|
||||
|
||||
export let run = function(configArg: INpmtsConfig): q.Promise<INpmtsConfig> {
|
||||
export let run = function(configArg: INpmtsConfig): Promise<INpmtsConfig> {
|
||||
let done = q.defer<INpmtsConfig>()
|
||||
npmtsOra.text('starting TypeScript Compilation')
|
||||
NpmtsClean.run(configArg)
|
||||
|
@ -1,4 +1,4 @@
|
||||
import * as q from 'q'
|
||||
import * as q from 'smartq'
|
||||
|
||||
import paths = require('../npmts.paths')
|
||||
import { npmtsOra } from '../npmts.log'
|
||||
@ -6,7 +6,7 @@ import { npmtsOra } from '../npmts.log'
|
||||
import plugins = require('./mod00.plugins')
|
||||
import { projectInfo } from '../mod00/mod00.check'
|
||||
|
||||
export var run = function(configArg){
|
||||
export let run = function(configArg){
|
||||
let done = q.defer()
|
||||
let config = configArg
|
||||
npmtsOra.text('now looking at ' + 'required assets'.yellow)
|
||||
|
@ -1,4 +1,4 @@
|
||||
import * as q from 'q'
|
||||
import * as q from 'smartq'
|
||||
import { ProjectinfoNpm } from 'projectinfo'
|
||||
|
||||
import * as paths from '../npmts.paths'
|
||||
@ -11,7 +11,7 @@ export let projectInfo: ProjectinfoNpm
|
||||
let checkProjectTypings = (configArg) => {
|
||||
let done = q.defer()
|
||||
npmtsOra.text('Check Module: Check Project Typings...')
|
||||
projectInfo = new ProjectinfoNpm(paths.cwd)
|
||||
projectInfo = new ProjectinfoNpm(paths.cwd)
|
||||
if (typeof projectInfo.packageJson.typings === 'undefined') {
|
||||
plugins.beautylog.error(`please add typings field to package.json`)
|
||||
process.exit(1)
|
||||
|
@ -1,4 +1,4 @@
|
||||
import * as q from 'q'
|
||||
import * as q from 'smartq'
|
||||
import paths = require('../npmts.paths')
|
||||
|
||||
import { npmtsOra } from '../npmts.log'
|
||||
|
@ -1,4 +1,4 @@
|
||||
import * as q from 'q'
|
||||
import * as q from 'smartq'
|
||||
|
||||
import * as paths from '../npmts.paths'
|
||||
import { npmtsOra } from '../npmts.log'
|
||||
|
@ -1,13 +1,11 @@
|
||||
export * from '../npmts.plugins'
|
||||
|
||||
import * as tsn from 'tsn'
|
||||
import * as shelljs from 'shelljs'
|
||||
import * as smartchok from 'smartchok'
|
||||
import * as smartstream from 'smartstream'
|
||||
|
||||
export {
|
||||
tsn,
|
||||
shelljs,
|
||||
smartchok,
|
||||
smartstream
|
||||
}
|
||||
|
@ -1,7 +1,7 @@
|
||||
/* ------------------------------------------
|
||||
* This module creates TypeScript documentation
|
||||
* -------------------------------------------- */
|
||||
import * as q from 'q'
|
||||
import * as q from 'smartq'
|
||||
|
||||
import * as paths from '../npmts.paths'
|
||||
import { npmtsOra } from '../npmts.log'
|
||||
@ -9,55 +9,8 @@ import { INpmtsConfig } from '../npmts.config'
|
||||
|
||||
import * as plugins from './mod01.plugins'
|
||||
|
||||
|
||||
import { projectInfo } from '../mod00/mod00.check'
|
||||
|
||||
let genTypeDoc = function (configArg: INpmtsConfig) {
|
||||
let done = q.defer()
|
||||
npmtsOra.text('now generating ' + 'TypeDoc documentation'.yellow)
|
||||
plugins.beautylog.log('TypeDoc Output:')
|
||||
let localSmartstream = new plugins.smartstream.Smartstream([
|
||||
plugins.gulp.src(plugins.path.join(paths.tsDir, '**/*.ts')),
|
||||
plugins.gulpTypedoc({
|
||||
// TypeScript options (see typescript docs)
|
||||
module: 'commonjs',
|
||||
target: 'es6',
|
||||
includeDeclarations: true,
|
||||
|
||||
// Output options (see typedoc docs)
|
||||
out: paths.pagesApiDir,
|
||||
json: plugins.path.join(paths.pagesApiDir, 'file.json'),
|
||||
|
||||
// TypeDoc options (see typedoc docs)
|
||||
name: projectInfo.name,
|
||||
readme: plugins.path.join(paths.cwd, 'README.md'),
|
||||
// theme: "default",
|
||||
version: true
|
||||
})
|
||||
])
|
||||
localSmartstream.run().then(
|
||||
() => {
|
||||
plugins.beautylog.ok('TypeDoc documentation generated!')
|
||||
done.resolve(configArg)
|
||||
},
|
||||
(err) => {
|
||||
plugins.beautylog.warn('TypeDoc documentation generation failed!')
|
||||
console.log(err)
|
||||
done.resolve(configArg)
|
||||
}
|
||||
)
|
||||
return done.promise
|
||||
}
|
||||
|
||||
export let run = function (configArg: INpmtsConfig) {
|
||||
let done = q.defer<INpmtsConfig>()
|
||||
if (configArg.docs) {
|
||||
genTypeDoc(configArg)
|
||||
.then(() => {
|
||||
done.resolve(configArg)
|
||||
})
|
||||
} else {
|
||||
done.resolve(configArg)
|
||||
};
|
||||
done.resolve(configArg)
|
||||
return done.promise
|
||||
}
|
||||
|
@ -1,9 +1,2 @@
|
||||
export * from '../npmts.plugins'
|
||||
|
||||
import * as gulp from 'gulp'
|
||||
let gulpTypedoc = require('gulp-typedoc')
|
||||
|
||||
export {
|
||||
gulp,
|
||||
gulpTypedoc
|
||||
}
|
||||
|
@ -4,7 +4,7 @@
|
||||
import plugins = require('./mod02.plugins')
|
||||
import paths = require('../npmts.paths')
|
||||
|
||||
import * as q from 'q'
|
||||
import * as q from 'smartq'
|
||||
|
||||
import { npmtsOra } from '../npmts.log'
|
||||
import { INpmtsConfig } from '../npmts.config'
|
||||
@ -19,16 +19,20 @@ let mocha = function (configArg: INpmtsConfig) {
|
||||
let done = q.defer()
|
||||
|
||||
let coverageSmartstream = new plugins.smartstream.Smartstream([
|
||||
plugins.gulp.src([plugins.path.join(paths.cwd, './dist/**/*.js')]),
|
||||
plugins.gulp.src([plugins.path.join(paths.cwd, './ts/**/*.ts')]),
|
||||
plugins.gulpSourcemaps.init(),
|
||||
plugins.gulpBabel({
|
||||
presets: [
|
||||
require.resolve('babel-preset-es2015')
|
||||
]
|
||||
plugins.gulpTypeScript({
|
||||
target: 'ES5',
|
||||
emitDecoratorMetadata: true,
|
||||
experimentalDecorators: true,
|
||||
lib: ['ES2015.Promise', 'ES5', 'ES2015.Generator', 'ES2015.Iterable']
|
||||
}),
|
||||
plugins.gulpIstanbul({
|
||||
}),
|
||||
plugins.gulpSourcemaps.write(),
|
||||
plugins.gulpFunction.forEach(async file => {
|
||||
file.path = file.path.replace(paths.tsDir, paths.distDir)
|
||||
}),
|
||||
plugins.gulpInjectModules(),
|
||||
plugins.through2.obj(
|
||||
(file, enc, cb) => {
|
||||
@ -41,11 +45,12 @@ let mocha = function (configArg: INpmtsConfig) {
|
||||
])
|
||||
|
||||
let localSmartstream = new plugins.smartstream.Smartstream([
|
||||
plugins.gulp.src([plugins.path.join(paths.cwd, 'test/test.js')]),
|
||||
plugins.gulpBabel({
|
||||
presets: [
|
||||
require.resolve('babel-preset-es2015')
|
||||
]
|
||||
plugins.gulp.src([plugins.path.join(paths.cwd, 'test/test.ts')]),
|
||||
plugins.gulpTypeScript({
|
||||
target: 'ES5',
|
||||
emitDecoratorMetadata: true,
|
||||
experimentalDecorators: true,
|
||||
lib: ['ES2015.Promise', 'ES5', 'ES2015.Generator', 'ES2015.Iterable']
|
||||
}),
|
||||
plugins.gulpInjectModules(),
|
||||
plugins.gulpMocha(),
|
||||
|
@ -1,19 +1,19 @@
|
||||
export * from '../npmts.plugins'
|
||||
|
||||
import * as gulp from 'gulp'
|
||||
import * as gulpBabel from 'gulp-babel'
|
||||
import * as gulpIstanbul from 'gulp-istanbul'
|
||||
import * as gulpFunction from 'gulp-function'
|
||||
import * as gulpIstanbul from 'gulp-istanbul'
|
||||
let gulpInjectModules = require('gulp-inject-modules')
|
||||
import * as gulpMocha from 'gulp-mocha'
|
||||
import * as gulpSourcemaps from 'gulp-sourcemaps'
|
||||
import * as gulpTypeScript from 'gulp-typescript'
|
||||
|
||||
export {
|
||||
gulp,
|
||||
gulpBabel,
|
||||
gulpIstanbul,
|
||||
gulpFunction,
|
||||
gulpIstanbul,
|
||||
gulpInjectModules,
|
||||
gulpMocha,
|
||||
gulpSourcemaps
|
||||
gulpSourcemaps,
|
||||
gulpTypeScript
|
||||
}
|
||||
|
@ -1,4 +1,4 @@
|
||||
import * as q from 'q'
|
||||
import * as q from 'smartq'
|
||||
|
||||
import * as plugins from './npmts.plugins'
|
||||
import * as paths from './npmts.paths'
|
||||
|
@ -1,7 +1,7 @@
|
||||
import plugins = require('./npmts.plugins')
|
||||
import paths = require('./npmts.paths')
|
||||
|
||||
import * as q from 'q'
|
||||
import * as q from 'smartq'
|
||||
|
||||
import { npmtsOra } from './npmts.log'
|
||||
|
||||
@ -10,7 +10,6 @@ export type npmtsMode = 'default' | 'custom'
|
||||
export interface INpmtsConfig {
|
||||
argv: any,
|
||||
coverageTreshold: number,
|
||||
docs: boolean,
|
||||
mode: npmtsMode,
|
||||
test: boolean,
|
||||
testTs: any,
|
||||
@ -20,12 +19,11 @@ export interface INpmtsConfig {
|
||||
|
||||
};
|
||||
|
||||
export var run = function (argvArg) {
|
||||
export let run = function (argvArg) {
|
||||
let done = q.defer()
|
||||
let defaultConfig: INpmtsConfig = {
|
||||
argv: undefined,
|
||||
coverageTreshold: 70,
|
||||
docs: true,
|
||||
mode: 'default',
|
||||
test: true,
|
||||
testTs: {},
|
||||
@ -72,9 +70,6 @@ export var run = function (argvArg) {
|
||||
if (config.argv.notest) {
|
||||
config.test = false
|
||||
};
|
||||
if (config.argv.nodocs) {
|
||||
config.docs = false
|
||||
};
|
||||
if (config.argv.watch) {
|
||||
config.watch = true
|
||||
};
|
||||
|
@ -1,4 +1,4 @@
|
||||
import * as q from 'q'
|
||||
import * as q from 'smartq'
|
||||
|
||||
import * as plugins from './npmts.plugins'
|
||||
|
||||
|
@ -1,4 +1,4 @@
|
||||
import * as q from 'q'
|
||||
import * as q from 'smartq'
|
||||
import * as smartchok from 'smartchok'
|
||||
|
||||
import * as plugins from './npmts.plugins'
|
||||
|
Reference in New Issue
Block a user