Compare commits
8 Commits
Author | SHA1 | Date | |
---|---|---|---|
851653a6ae | |||
9229cd79dd | |||
86fb639c82 | |||
d536e6aa8c | |||
c91ff6ef4a | |||
2c88c889bf | |||
d3f8ea0433 | |||
d57b05c6d0 |
14
README.md
14
README.md
@ -5,7 +5,7 @@ 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)
|
||||
@ -32,11 +32,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/gitbook/index.html)
|
||||
2. [Install](https://pushrocks.gitlab.io/npmts/gitbook/install.html)
|
||||
3. [Default Behaviour](https://pushrocks.gitlab.io/npmts/gitbook/default.html)
|
||||
4. [Configuration](https://pushrocks.gitlab.io/npmts/gitbook/config.html)
|
||||
5. [Examples](https://pushrocks.gitlab.io/npmts/gitbook/examples.html)
|
||||
6. [Info](https://pushrocks.gitlab.io/npmts/gitbook/info.html)
|
||||
|
||||
[](https://push.rocks)
|
||||
|
18
dist/npmts.clean.js
vendored
18
dist/npmts.clean.js
vendored
@ -3,10 +3,27 @@ require("typings-global");
|
||||
const plugins = require("./npmts.plugins");
|
||||
const paths = require("./npmts.paths");
|
||||
const npmts_promisechain_1 = require("./npmts.promisechain");
|
||||
/**
|
||||
* removes the dist directory which will be entirely rebuild
|
||||
*/
|
||||
let removeDist = function () {
|
||||
npmts_promisechain_1.npmtsOra.text('cleaning dist folder');
|
||||
return plugins.smartfile.fs.remove(paths.distDir);
|
||||
};
|
||||
/**
|
||||
* remove .d.ts files from testDirctory
|
||||
*/
|
||||
let removeTestDeclarations = function () {
|
||||
let done = plugins.q.defer();
|
||||
plugins.smartfile.fs.listFileTree('./test/', '**/*.d.ts').then(fileArray => {
|
||||
let fileArrayToRemove = plugins.smartpath.transform.toAbsolute(fileArray, process.cwd() + '//test/');
|
||||
plugins.smartfile.fs.removeManySync(fileArrayToRemove);
|
||||
done.resolve();
|
||||
});
|
||||
};
|
||||
/**
|
||||
* remove old pages
|
||||
*/
|
||||
let removePages = function () {
|
||||
npmts_promisechain_1.npmtsOra.text('cleaning pages folder');
|
||||
return plugins.smartfile.fs.remove(paths.pagesDir);
|
||||
@ -15,6 +32,7 @@ exports.run = function (configArg) {
|
||||
npmts_promisechain_1.npmtsOra.text('cleaning up from previous builds...');
|
||||
let done = plugins.q.defer();
|
||||
removeDist()
|
||||
.then(removeTestDeclarations)
|
||||
.then(removePages)
|
||||
.then(function () {
|
||||
plugins.beautylog.ok('Cleaned up from previous builds!');
|
||||
|
4
dist/npmts.compile.js
vendored
4
dist/npmts.compile.js
vendored
@ -11,11 +11,11 @@ exports.run = function (configArg) {
|
||||
.then(() => {
|
||||
plugins.beautylog.ok('compiled main TypeScript!');
|
||||
plugins.beautylog.log('now compiling tests!');
|
||||
return plugins.tsn.compileGlobStringObject(config.testTs);
|
||||
return plugins.tsn.compileGlobStringObject(config.testTs, config.tsOptions, paths.cwd);
|
||||
})
|
||||
.then(function () {
|
||||
plugins.beautylog.ok('compiled all TypeScript!');
|
||||
done.resolve(config);
|
||||
});
|
||||
}).catch(err => { console.log(err); });
|
||||
return done.promise;
|
||||
};
|
||||
|
4
dist/npmts.options.js
vendored
4
dist/npmts.options.js
vendored
@ -38,10 +38,10 @@ exports.run = function (argvArg) {
|
||||
// handle default mode
|
||||
if (config.mode === 'default') {
|
||||
config.ts = {
|
||||
['./ts/**/*.ts']: './dist/'
|
||||
'./ts/**/*.ts': './dist/'
|
||||
};
|
||||
config.testTs = {
|
||||
['./test/test.ts']: './test/'
|
||||
'./test/**/*.ts': './test/'
|
||||
};
|
||||
}
|
||||
;
|
||||
|
1
dist/npmts.tests.js
vendored
1
dist/npmts.tests.js
vendored
@ -39,7 +39,6 @@ let mocha = function (configArg) {
|
||||
localSmartstream.run()
|
||||
.then(() => { done.resolve(configArg); }, (err) => {
|
||||
plugins.beautylog.error('Tests failed!');
|
||||
configArg.watch = true;
|
||||
if (configArg.watch) {
|
||||
done.resolve(configArg);
|
||||
}
|
||||
|
@ -1,15 +0,0 @@
|
||||
{
|
||||
"structure": {
|
||||
"readme": "index.md"
|
||||
},
|
||||
"plugins": [
|
||||
"tonic",
|
||||
"edit-link"
|
||||
],
|
||||
"pluginsConfig": {
|
||||
"edit-link": {
|
||||
"base": "https://gitlab.com/pushrocks/npmts/edit/master/docs/",
|
||||
"label": "Edit on GitLab"
|
||||
}
|
||||
}
|
||||
}
|
@ -1,42 +0,0 @@
|
||||
# npmts
|
||||
Write npm modules with TypeScript without hassle. TypeScript ready. Fully ES6.
|
||||
|
||||
## Availabililty
|
||||
[](https://www.npmjs.com/package/npmts)
|
||||
[](https://gitlab.com/pushrocks/npmts)
|
||||
[](https://github.com/pushrocks/npmts)
|
||||
[](https://pushrocks.gitlab.io/npmts/gitbook)
|
||||
|
||||
## Status for master
|
||||
[](https://gitlab.com/pushrocks/npmts/commits/master)
|
||||
[](https://gitlab.com/pushrocks/npmts/commits/master)
|
||||
[](https://david-dm.org/pushrocks/npmts)
|
||||
[](https://www.bithound.io/github/pushrocks/npmts/master/dependencies/npm)
|
||||
[](https://www.bithound.io/github/pushrocks/npmts)
|
||||
[](https://nodejs.org/dist/latest-v6.x/docs/api/)
|
||||
[](https://nodejs.org/dist/latest-v6.x/docs/api/)
|
||||
[](http://standardjs.com/)
|
||||
|
||||
## Introduction
|
||||
NPMTS is your friend when writing, testing, publishing and documenting npm modules written in TypeScript.
|
||||
|
||||
npmts will
|
||||
|
||||
1. check your dependencies and package.json
|
||||
1. transpile your code with tsc,
|
||||
1. document your code with typedoc,
|
||||
1. test your code with mocha
|
||||
1. create coverage with istanbul
|
||||
|
||||
This works on your machine and in CI. There is a prebuild docker image available that includes npmts to make CI a breeze:
|
||||
[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)
|
||||
|
||||
[](https://push.rocks)
|
@ -1,32 +0,0 @@
|
||||
0 info it worked if it ends with ok
|
||||
1 verbose cli [ '/Users/philkunz/.nvm/versions/node/v6.5.0/bin/node',
|
||||
1 verbose cli '/Users/philkunz/.nvm/versions/node/v6.5.0/bin/npm',
|
||||
1 verbose cli 'version',
|
||||
1 verbose cli 'patch' ]
|
||||
2 info using npm@3.10.3
|
||||
3 info using node@v6.5.0
|
||||
4 info git [ 'status', '--porcelain' ]
|
||||
5 verbose stack Error: Git working directory not clean.
|
||||
5 verbose stack M README.md
|
||||
5 verbose stack M gitbook/index.md
|
||||
5 verbose stack at /Users/philkunz/.nvm/versions/node/v6.5.0/lib/node_modules/npm/lib/version.js:247:19
|
||||
5 verbose stack at /Users/philkunz/.nvm/versions/node/v6.5.0/lib/node_modules/npm/lib/utils/no-progress-while-running.js:21:8
|
||||
5 verbose stack at ChildProcess.exithandler (child_process.js:197:7)
|
||||
5 verbose stack at emitTwo (events.js:106:13)
|
||||
5 verbose stack at ChildProcess.emit (events.js:191:7)
|
||||
5 verbose stack at maybeClose (internal/child_process.js:877:16)
|
||||
5 verbose stack at Socket.<anonymous> (internal/child_process.js:334:11)
|
||||
5 verbose stack at emitOne (events.js:96:13)
|
||||
5 verbose stack at Socket.emit (events.js:188:7)
|
||||
5 verbose stack at Pipe._handle.close [as _onclose] (net.js:493:12)
|
||||
6 verbose cwd /Users/philkunz/gitlab/pushrocks/npmts
|
||||
7 error Darwin 16.0.0
|
||||
8 error argv "/Users/philkunz/.nvm/versions/node/v6.5.0/bin/node" "/Users/philkunz/.nvm/versions/node/v6.5.0/bin/npm" "version" "patch"
|
||||
9 error node v6.5.0
|
||||
10 error npm v3.10.3
|
||||
11 error Git working directory not clean.
|
||||
11 error M README.md
|
||||
11 error M gitbook/index.md
|
||||
12 error If you need help, you may report this error at:
|
||||
12 error <https://github.com/npm/npm/issues>
|
||||
13 verbose exit [ 1, true ]
|
12
package.json
12
package.json
@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "npmts",
|
||||
"version": "5.4.38",
|
||||
"version": "5.4.42",
|
||||
"description": "Write npm modules with TypeScript without hassle. TypeScript ready. Fully ES6.",
|
||||
"main": "dist/index.js",
|
||||
"bin": {
|
||||
@ -38,7 +38,7 @@
|
||||
"@types/minimatch": "^2.0.29",
|
||||
"@types/q": "^0.x.x",
|
||||
"@types/shelljs": "^0.3.31",
|
||||
"babel-preset-es2015": "^6.14.0",
|
||||
"babel-preset-es2015": "^6.16.0",
|
||||
"beautylog": "5.0.23",
|
||||
"depcheck": "^0.6.4",
|
||||
"early": "^2.0.35",
|
||||
@ -50,7 +50,7 @@
|
||||
"gulp-mocha": "^3.0.1",
|
||||
"gulp-sourcemaps": "^1.6.0",
|
||||
"gulp-typedoc": "^2.0.0",
|
||||
"lodash": "^4.16.1",
|
||||
"lodash": "^4.16.2",
|
||||
"npmextra": "^2.0.3",
|
||||
"projectinfo": "1.0.3",
|
||||
"q": "^1.4.1",
|
||||
@ -59,12 +59,12 @@
|
||||
"smartcli": "1.0.9",
|
||||
"smartcov": "1.0.0",
|
||||
"smartenv": "1.2.5",
|
||||
"smartfile": "4.0.21",
|
||||
"smartfile": "4.0.22",
|
||||
"smartpath": "3.2.2",
|
||||
"smartstream": "^1.0.5",
|
||||
"smartstring": "^2.0.17",
|
||||
"source-map-support": "^0.4.2",
|
||||
"tsn": "^2.0.3",
|
||||
"source-map-support": "^0.4.3",
|
||||
"tsn": "^2.0.4",
|
||||
"typedoc": "^0.4.5",
|
||||
"typescript": "next",
|
||||
"typings-global": "^1.0.14"
|
||||
|
@ -1,24 +1,43 @@
|
||||
import 'typings-global'
|
||||
import plugins = require('./npmts.plugins')
|
||||
import paths = require('./npmts.paths')
|
||||
import {npmtsOra} from './npmts.promisechain'
|
||||
import { npmtsOra } from './npmts.promisechain'
|
||||
|
||||
let removeDist = function(){
|
||||
/**
|
||||
* removes the dist directory which will be entirely rebuild
|
||||
*/
|
||||
let removeDist = function () {
|
||||
npmtsOra.text('cleaning dist folder')
|
||||
return plugins.smartfile.fs.remove(paths.distDir)
|
||||
}
|
||||
|
||||
let removePages = function(){
|
||||
/**
|
||||
* remove .d.ts files from testDirctory
|
||||
*/
|
||||
let removeTestDeclarations = function () {
|
||||
let done = plugins.q.defer()
|
||||
plugins.smartfile.fs.listFileTree('./test/', '**/*.d.ts').then(fileArray => {
|
||||
let fileArrayToRemove = plugins.smartpath.transform.toAbsolute(fileArray, process.cwd() + '//test/')
|
||||
plugins.smartfile.fs.removeManySync(fileArrayToRemove)
|
||||
done.resolve()
|
||||
})
|
||||
}
|
||||
|
||||
/**
|
||||
* remove old pages
|
||||
*/
|
||||
let removePages = function () {
|
||||
npmtsOra.text('cleaning pages folder')
|
||||
return plugins.smartfile.fs.remove(paths.pagesDir)
|
||||
}
|
||||
|
||||
export let run = function(configArg){
|
||||
export let run = function (configArg) {
|
||||
npmtsOra.text('cleaning up from previous builds...')
|
||||
let done = plugins.q.defer()
|
||||
removeDist()
|
||||
.then(removeTestDeclarations)
|
||||
.then(removePages)
|
||||
.then(function(){
|
||||
.then(function () {
|
||||
plugins.beautylog.ok('Cleaned up from previous builds!')
|
||||
done.resolve(configArg)
|
||||
})
|
||||
|
@ -11,11 +11,11 @@ export let run = function (configArg) {
|
||||
.then(() => {
|
||||
plugins.beautylog.ok('compiled main TypeScript!')
|
||||
plugins.beautylog.log('now compiling tests!')
|
||||
return plugins.tsn.compileGlobStringObject(config.testTs)
|
||||
return plugins.tsn.compileGlobStringObject(config.testTs,config.tsOptions,paths.cwd)
|
||||
})
|
||||
.then(function () {
|
||||
plugins.beautylog.ok('compiled all TypeScript!')
|
||||
done.resolve(config)
|
||||
})
|
||||
}).catch(err => { console.log(err) })
|
||||
return done.promise
|
||||
}
|
||||
|
@ -59,10 +59,10 @@ export var run = function (argvArg) {
|
||||
// handle default mode
|
||||
if (config.mode === 'default') {
|
||||
config.ts = {
|
||||
['./ts/**/*.ts']: './dist/'
|
||||
'./ts/**/*.ts': './dist/'
|
||||
}
|
||||
config.testTs = {
|
||||
['./test/test.ts']: './test/'
|
||||
'./test/**/*.ts': './test/'
|
||||
}
|
||||
};
|
||||
|
||||
|
Reference in New Issue
Block a user