Compare commits

...

14 Commits

Author SHA1 Message Date
f16103a632 8.0.3 2017-07-31 14:43:56 +02:00
befed099c5 update highlighting 2017-07-31 14:43:50 +02:00
6c0fa380a9 remove old Changelog 2017-07-31 14:39:46 +02:00
22de2c784f 8.0.2 2017-07-31 14:36:38 +02:00
e8fe4f1720 update docs and description 2017-07-31 14:36:33 +02:00
d7443bbf17 8.0.1 2017-07-30 22:39:55 +02:00
c4668bc0a6 add docs 2017-07-30 22:39:42 +02:00
bc489b6bf3 8.0.0 2017-07-30 22:27:59 +02:00
e2d0a7a939 update to more favorable testfile loading approach 2017-07-30 22:27:51 +02:00
0f5e451e60 7.2.10 2017-07-28 17:33:31 +02:00
3595bf3590 fix module testimport recognition 2017-07-28 17:33:28 +02:00
efe73d0fd0 7.2.9 2017-07-28 17:16:17 +02:00
c52322ec12 add smart replacer 2017-07-28 17:16:14 +02:00
b7cf9949bf update docs 2017-07-28 01:27:21 +02:00
11 changed files with 2498 additions and 389 deletions

View File

@ -1,11 +0,0 @@
Please view this file on the master branch, on stable branches it's out of date.
v 6.0.0 (released)
- remove TypeDoc, please look at npmpage
- check package.json
v 7.0.0
- switch from mocha to tap
- run tests in SubProcesses with coverage
- improve ES6 handling
- add smartanalytics

3
dist/mod02/index.js vendored
View File

@ -37,9 +37,6 @@ let tap = function (configArg) {
experimentalDecorators: true, experimentalDecorators: true,
lib: ['DOM', 'ES5', 'ES2015.Promise', 'ES2015.Generator', 'ES2015.Iterable'] lib: ['DOM', 'ES5', 'ES2015.Promise', 'ES2015.Generator', 'ES2015.Iterable']
}), }),
plugins.gulpFunction.forEach((file) => __awaiter(this, void 0, void 0, function* () {
file.path = file.path.replace(paths.tsDir, paths.distDir);
})),
plugins.gulpSourcemaps.write(), plugins.gulpSourcemaps.write(),
npmtsTapBuffer.pipeTestableFiles(), npmtsTapBuffer.pipeTestableFiles(),
plugins.smartstream.cleanPipe() plugins.smartstream.cleanPipe()

9
docs/changelog.md Normal file
View File

@ -0,0 +1,9 @@
# Changelog
## 2017-07-30: Version 7.x.x -> 8.x.x
Testfiles in ./test/ can now import files directly from the ts dir:
```javascript
// ./test/test.ts
import * as myModule from '../ts/index
```

View File

@ -39,11 +39,12 @@ with default behaviour.
| key | default value | description | | key | default value | description |
| --- | --- | --- | | --- | --- | --- |
| `"mode"` | `"default"` | "default" will do default stuff and override , "custom" only does what you specify | | `"mode"` | `"default"` | "default" will do default stuff and override , "custom" only does what you specify, "merge" will merge default options with whatever you specify on your own |
| `"test"` | `true` | test your module | | `"test"` | `true` | test your module |
| `"ts"` | `{"./ts/*.ts":"./","./test/test.ts":"./test/"}` | allows you to define multiple ts portions | | `"ts"` | `{"./ts/*.ts":"./","./test/test.ts":"./test/"}` | allows you to define multiple ts portions |
| `"tsOptions"` | `{"target":"ES5", "declaration":"true"}` | specify options for tsc | | `"tsOptions"` | `{"target":"ES5", "declaration":"true"}` | specify options for tsc |
| `"cli"` | "false" | some modules are designed to be used from cli. If set to true NPMTS will create a cli.js that wires you dist files up for cli use. | | `"cli"` | `"false"` | some modules are designed to be used from cli. If set to true NPMTS will create a cli.js that wires you dist files up for cli use. |
| `"testConfig"` | `{ parallel: true, coverage: true }` | allows you to control test behaviour. `"parallel"` controls wether testfiles are run sequentially or in parallel, and `"coverage` wether to create coverage reports |
### TypeScript ### TypeScript
by default npmts looks for `./ts/*.ts` and `./test/test.ts` that will compile to by default npmts looks for `./ts/*.ts` and `./test/test.ts` that will compile to

38
docs/getstarted.md Normal file
View File

@ -0,0 +1,38 @@
---
name: Get Started
description: learn how to quickly write npm TypeScript modules
---
# Get Started with NPMTS
and learn how to quickly write npm TypeScript modules
## Step1: Install the tools
To use npmts install it using npm or yarn:
```sh
npm install -g npmts # install with npm
yarn global add npmts # install with yarn
```
For the puspose of getting started quickly also install **gitzone**.
It'll proovide awesome scaffolding for new npmts npm modules and also updates them later on.
```sh
npm install -g gitzone # install with npm
yarn global add gitzone # install with yarn
```
You can make sure npmts and gitzone are installed correctly by typing `npmts -v && gitzone -v`.
## Scaffold a new module
To scaffold a new module type
```shell
gitzone template npm
```
This will run you through a series of question to get gitzone to know the specifics of your module.
Enter all information accordingly.
## Run NPMTS for the first time

View File

@ -1,8 +1,9 @@
--- ---
name: Start name: Index
description: best practice npm TypeScript modules
--- ---
# npmts # npmts
Write npm modules with TypeScript without hassle. TypeScript ready. Fully ES6. best practice npm TypeScript modules
## Availabililty ## Availabililty
[![npm](https://gitzone.gitlab.io/assets/repo-button-npm.svg)](https://www.npmjs.com/package/npmts) [![npm](https://gitzone.gitlab.io/assets/repo-button-npm.svg)](https://www.npmjs.com/package/npmts)

2745
package-lock.json generated

File diff suppressed because it is too large Load Diff

View File

@ -1,7 +1,7 @@
{ {
"name": "npmts", "name": "npmts",
"version": "7.2.8", "version": "8.0.3",
"description": "Write npm modules with TypeScript without hassle. TypeScript ready. Fully ES6.", "description": "best practice npm TypeScript modules",
"main": "dist/index.js", "main": "dist/index.js",
"bin": { "bin": {
"npmts": "assets/cliNpmts.js" "npmts": "assets/cliNpmts.js"
@ -58,7 +58,7 @@
"smartstream": "^1.0.10", "smartstream": "^1.0.10",
"smartstring": "^2.0.24", "smartstring": "^2.0.24",
"smartsystem": "^1.0.18", "smartsystem": "^1.0.18",
"tapbuffer": "^1.0.24", "tapbuffer": "^1.0.29",
"through2": "^2.0.3", "through2": "^2.0.3",
"tsn": "^2.0.15", "tsn": "^2.0.15",
"typescript": "^2.4.2", "typescript": "^2.4.2",

View File

@ -1,5 +1,5 @@
# npmts # npmts
Write npm modules with TypeScript without hassle. TypeScript ready. Fully ES6. best practice npm TypeScript modules
## Availabililty ## Availabililty
[![npm](https://gitzone.gitlab.io/assets/repo-button-npm.svg)](https://www.npmjs.com/package/npmts) [![npm](https://gitzone.gitlab.io/assets/repo-button-npm.svg)](https://www.npmjs.com/package/npmts)
@ -38,6 +38,9 @@ For more information about how to best write tap tests check out the [tapbundle
This works on your machine and in CI. There is a prebuild docker image available that includes npmts to make CI a breeze: 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/) [hosttoday/ht-docker-node:npmts on Dockerhub](https://hub.docker.com/r/hosttoday/ht-docker-node/)
## Changelog
For breaking changes please see the [changelog](https://gitzone.gitlab.io/npmts/changelog.html).
For further information read the linked docs at the top of this README. For further information read the linked docs at the top of this README.
> MIT licensed | **©** [Lossless GmbH](https://lossless.gmbh) > MIT licensed | **©** [Lossless GmbH](https://lossless.gmbh)

View File

@ -6,7 +6,9 @@ import paths = require('../npmts.paths')
import * as q from 'smartq' import * as q from 'smartq'
// interfaces
import { INpmtsConfig } from '../npmts.config' import { INpmtsConfig } from '../npmts.config'
import { Smartfile } from 'smartfile'
/** /**
* runs mocha * runs mocha
@ -34,9 +36,6 @@ let tap = function (configArg: INpmtsConfig) {
experimentalDecorators: true, experimentalDecorators: true,
lib: [ 'DOM', 'ES5', 'ES2015.Promise', 'ES2015.Generator', 'ES2015.Iterable' ] lib: [ 'DOM', 'ES5', 'ES2015.Promise', 'ES2015.Generator', 'ES2015.Iterable' ]
}), }),
plugins.gulpFunction.forEach(async file => {
file.path = file.path.replace(paths.tsDir, paths.distDir)
}),
plugins.gulpSourcemaps.write(), plugins.gulpSourcemaps.write(),
npmtsTapBuffer.pipeTestableFiles(), npmtsTapBuffer.pipeTestableFiles(),
plugins.smartstream.cleanPipe() plugins.smartstream.cleanPipe()

View File

@ -80,10 +80,6 @@
version "2.0.29" version "2.0.29"
resolved "https://registry.yarnpkg.com/@types/minimatch/-/minimatch-2.0.29.tgz#5002e14f75e2d71e564281df0431c8c1b4a2a36a" resolved "https://registry.yarnpkg.com/@types/minimatch/-/minimatch-2.0.29.tgz#5002e14f75e2d71e564281df0431c8c1b4a2a36a"
"@types/mocha@^2.2.31":
version "2.2.41"
resolved "https://registry.yarnpkg.com/@types/mocha/-/mocha-2.2.41.tgz#e27cf0817153eb9f2713b2d3f6c68f1e1c3ca608"
"@types/node@*", "@types/node@^8.0.10": "@types/node@*", "@types/node@^8.0.10":
version "8.0.17" version "8.0.17"
resolved "https://registry.yarnpkg.com/@types/node/-/node-8.0.17.tgz#677bc8c118cfb76013febb62ede1f31d2c7222a1" resolved "https://registry.yarnpkg.com/@types/node/-/node-8.0.17.tgz#677bc8c118cfb76013febb62ede1f31d2c7222a1"
@ -106,9 +102,9 @@
dependencies: dependencies:
"@types/node" "*" "@types/node" "*"
"@types/source-map-support@^0.2.28": "@types/source-map-support@^0.4.0":
version "0.2.28" version "0.4.0"
resolved "https://registry.yarnpkg.com/@types/source-map-support/-/source-map-support-0.2.28.tgz#ce6497dfa9c9fbd21a753955b4a51d8993d759dd" resolved "https://registry.yarnpkg.com/@types/source-map-support/-/source-map-support-0.4.0.tgz#a62a1866614af68c888173c001481f242aaf148b"
dependencies: dependencies:
"@types/node" "*" "@types/node" "*"
@ -1596,8 +1592,8 @@ js-tokens@^3.0.0:
resolved "https://registry.yarnpkg.com/js-tokens/-/js-tokens-3.0.2.tgz#9866df395102130e38f7f996bceb65443209c25b" resolved "https://registry.yarnpkg.com/js-tokens/-/js-tokens-3.0.2.tgz#9866df395102130e38f7f996bceb65443209c25b"
js-yaml@3.x, js-yaml@^3.2.7, js-yaml@^3.3.1, js-yaml@^3.4.2, js-yaml@^3.7.0, js-yaml@^3.8.3: js-yaml@3.x, js-yaml@^3.2.7, js-yaml@^3.3.1, js-yaml@^3.4.2, js-yaml@^3.7.0, js-yaml@^3.8.3:
version "3.9.0" version "3.9.1"
resolved "https://registry.yarnpkg.com/js-yaml/-/js-yaml-3.9.0.tgz#4ffbbf25c2ac963b8299dc74da7e3740de1c18ce" resolved "https://registry.yarnpkg.com/js-yaml/-/js-yaml-3.9.1.tgz#08775cebdfdd359209f0d2acd383c8f86a6904a0"
dependencies: dependencies:
argparse "^1.0.7" argparse "^1.0.7"
esprima "^4.0.0" esprima "^4.0.0"
@ -1860,8 +1856,8 @@ map-obj@^1.0.0, map-obj@^1.0.1:
resolved "https://registry.yarnpkg.com/map-obj/-/map-obj-1.0.1.tgz#d933ceb9205d82bdcf4886f6742bdc2b4dea146d" resolved "https://registry.yarnpkg.com/map-obj/-/map-obj-1.0.1.tgz#d933ceb9205d82bdcf4886f6742bdc2b4dea146d"
mathjs@^3.10.3: mathjs@^3.10.3:
version "3.14.2" version "3.15.0"
resolved "https://registry.yarnpkg.com/mathjs/-/mathjs-3.14.2.tgz#bb79b7dc878b7f586ce408ab067a9a42db2e7a2d" resolved "https://registry.yarnpkg.com/mathjs/-/mathjs-3.15.0.tgz#520390fc6447f8e0e580b34a43427691c9ce671e"
dependencies: dependencies:
complex.js "2.0.4" complex.js "2.0.4"
decimal.js "7.2.3" decimal.js "7.2.3"
@ -2757,17 +2753,15 @@ smartgulp@^1.0.6:
smartstream "^1.0.8" smartstream "^1.0.8"
typings-global "^1.0.16" typings-global "^1.0.16"
smartinject@^1.0.1: smartinject@^1.0.15:
version "1.0.1" version "1.0.15"
resolved "https://registry.yarnpkg.com/smartinject/-/smartinject-1.0.1.tgz#c345e8035b6c8349acda3da64ff6c684f649919a" resolved "https://registry.yarnpkg.com/smartinject/-/smartinject-1.0.15.tgz#9b25e4311e92b586aab5b01cbd28f8482b3f11fe"
dependencies: dependencies:
"@types/source-map-support" "^0.2.28" "@types/source-map-support" "^0.4.0"
"@types/through2" "^2.0.32" "@types/through2" "^2.0.33"
smartchai "^1.0.3" source-map-support "^0.4.15"
source-map-support "^0.4.11"
through2 "^2.0.3" through2 "^2.0.3"
typings-global "^1.0.14" typings-global "^1.0.20"
typings-test "^1.0.3"
smartipc@^1.0.9: smartipc@^1.0.9:
version "1.0.9" version "1.0.9"
@ -2872,7 +2866,7 @@ source-map-resolve@^0.3.0:
source-map-url "~0.3.0" source-map-url "~0.3.0"
urix "~0.1.0" urix "~0.1.0"
source-map-support@^0.4.11, source-map-support@^0.4.15: source-map-support@^0.4.15:
version "0.4.15" version "0.4.15"
resolved "https://registry.yarnpkg.com/source-map-support/-/source-map-support-0.4.15.tgz#03202df65c06d2bd8c7ec2362a193056fef8d3b1" resolved "https://registry.yarnpkg.com/source-map-support/-/source-map-support-0.4.15.tgz#03202df65c06d2bd8c7ec2362a193056fef8d3b1"
dependencies: dependencies:
@ -3086,9 +3080,9 @@ tap-parser@^5.1.0:
optionalDependencies: optionalDependencies:
readable-stream "^2" readable-stream "^2"
tapbuffer@^1.0.24: tapbuffer@^1.0.29:
version "1.0.24" version "1.0.29"
resolved "https://registry.yarnpkg.com/tapbuffer/-/tapbuffer-1.0.24.tgz#5f6779061f3d45261cda78edcde69736c91090a3" resolved "https://registry.yarnpkg.com/tapbuffer/-/tapbuffer-1.0.29.tgz#dbff08197a889912ea5be68ad9bfa37b6ca98dd1"
dependencies: dependencies:
"@types/istanbul" "^0.4.29" "@types/istanbul" "^0.4.29"
beautylog "^6.1.10" beautylog "^6.1.10"
@ -3097,12 +3091,12 @@ tapbuffer@^1.0.24:
remap-istanbul "^0.9.5" remap-istanbul "^0.9.5"
smarterror "^1.0.3" smarterror "^1.0.3"
smartfile "^4.2.17" smartfile "^4.2.17"
smartinject "^1.0.1" smartinject "^1.0.15"
smartipc "^1.0.9" smartipc "^1.0.9"
smartq "^1.1.6" smartq "^1.1.6"
smartshell "^1.0.13" smartshell "^1.0.13"
tap-mocha-reporter "^3.0.6" tap-mocha-reporter "^3.0.6"
typings-global "^1.0.19" typings-global "^1.0.20"
tar-pack@^3.4.0: tar-pack@^3.4.0:
version "3.4.0" version "3.4.0"
@ -3255,20 +3249,13 @@ typescript@^2.1.5, typescript@^2.4.2:
version "2.4.2" version "2.4.2"
resolved "https://registry.yarnpkg.com/typescript/-/typescript-2.4.2.tgz#f8395f85d459276067c988aa41837a8f82870844" resolved "https://registry.yarnpkg.com/typescript/-/typescript-2.4.2.tgz#f8395f85d459276067c988aa41837a8f82870844"
typings-global@*, typings-global@^1.0.14, typings-global@^1.0.16, typings-global@^1.0.17, typings-global@^1.0.19, typings-global@^1.0.20, typings-global@^1.0.3: typings-global@^1.0.14, typings-global@^1.0.16, typings-global@^1.0.17, typings-global@^1.0.19, typings-global@^1.0.20, typings-global@^1.0.3:
version "1.0.20" version "1.0.20"
resolved "https://registry.yarnpkg.com/typings-global/-/typings-global-1.0.20.tgz#3da769c54db538247c5d877d1d9e97eb2ec981ff" resolved "https://registry.yarnpkg.com/typings-global/-/typings-global-1.0.20.tgz#3da769c54db538247c5d877d1d9e97eb2ec981ff"
dependencies: dependencies:
semver "^5.3.0" semver "^5.3.0"
smartshell "^1.0.6" smartshell "^1.0.6"
typings-test@^1.0.3:
version "1.0.3"
resolved "https://registry.yarnpkg.com/typings-test/-/typings-test-1.0.3.tgz#fbab895eb3f0c44842e73db059f65946b971e369"
dependencies:
"@types/mocha" "^2.2.31"
typings-global "*"
uglify-js@^2.6: uglify-js@^2.6:
version "2.8.29" version "2.8.29"
resolved "https://registry.yarnpkg.com/uglify-js/-/uglify-js-2.8.29.tgz#29c5733148057bb4e1f75df35b7a9cb72e6a59dd" resolved "https://registry.yarnpkg.com/uglify-js/-/uglify-js-2.8.29.tgz#29c5733148057bb4e1f75df35b7a9cb72e6a59dd"