Compare commits
5 Commits
Author | SHA1 | Date | |
---|---|---|---|
0f5e451e60 | |||
3595bf3590 | |||
efe73d0fd0 | |||
c52322ec12 | |||
b7cf9949bf |
8
dist/mod02/index.js
vendored
8
dist/mod02/index.js
vendored
@ -49,6 +49,14 @@ let tap = function (configArg) {
|
||||
*/
|
||||
let testFilesSmartstream = new plugins.smartstream.Smartstream([
|
||||
plugins.smartgulp.src([plugins.path.join(paths.cwd, 'test/*.ts')]),
|
||||
plugins.gulpFunction.forEach((fileArg) => __awaiter(this, void 0, void 0, function* () {
|
||||
let stringToModify = fileArg.contents.toString();
|
||||
let testRegex = /\/\/\smodule\stestimport\nimport[a-zA-Z0-9\*\s]*\sfrom\s'(..\/ts\/index)'/;
|
||||
let replacer = (match, group1, offset, completeString) => {
|
||||
return match.replace(group1, '../dist/index');
|
||||
};
|
||||
fileArg.contents = Buffer.from(stringToModify.replace(testRegex, replacer));
|
||||
})),
|
||||
plugins.gulpSourcemaps.init(),
|
||||
plugins.gulpTypeScript({
|
||||
target: 'ES5',
|
||||
|
@ -39,11 +39,12 @@ with default behaviour.
|
||||
|
||||
| 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 |
|
||||
| `"ts"` | `{"./ts/*.ts":"./","./test/test.ts":"./test/"}` | allows you to define multiple ts portions |
|
||||
| `"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
|
||||
by default npmts looks for `./ts/*.ts` and `./test/test.ts` that will compile to
|
||||
|
2
package-lock.json
generated
2
package-lock.json
generated
@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "npmts",
|
||||
"version": "7.2.8",
|
||||
"version": "7.2.10",
|
||||
"lockfileVersion": 1,
|
||||
"dependencies": {
|
||||
"@gulp-sourcemaps/identity-map": {
|
||||
|
@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "npmts",
|
||||
"version": "7.2.8",
|
||||
"version": "7.2.10",
|
||||
"description": "Write npm modules with TypeScript without hassle. TypeScript ready. Fully ES6.",
|
||||
"main": "dist/index.js",
|
||||
"bin": {
|
||||
|
@ -6,7 +6,9 @@ import paths = require('../npmts.paths')
|
||||
|
||||
import * as q from 'smartq'
|
||||
|
||||
// interfaces
|
||||
import { INpmtsConfig } from '../npmts.config'
|
||||
import { Smartfile } from 'smartfile'
|
||||
|
||||
/**
|
||||
* runs mocha
|
||||
@ -47,6 +49,14 @@ let tap = function (configArg: INpmtsConfig) {
|
||||
*/
|
||||
let testFilesSmartstream = new plugins.smartstream.Smartstream([
|
||||
plugins.smartgulp.src([ plugins.path.join(paths.cwd, 'test/*.ts') ]),
|
||||
plugins.gulpFunction.forEach(async (fileArg: Smartfile) => {
|
||||
let stringToModify = fileArg.contents.toString()
|
||||
let testRegex = /\/\/\smodule\stestimport\nimport[a-zA-Z0-9\*\s]*\sfrom\s'(..\/ts\/index)'/
|
||||
let replacer = (match: string, group1: string, offset: number, completeString: string) => {
|
||||
return match.replace(group1, '../dist/index')
|
||||
}
|
||||
fileArg.contents = Buffer.from(stringToModify.replace(testRegex, replacer))
|
||||
}),
|
||||
plugins.gulpSourcemaps.init(),
|
||||
plugins.gulpTypeScript({
|
||||
target: 'ES5',
|
||||
|
Reference in New Issue
Block a user