fix(core): update

This commit is contained in:
Philipp Kunz 2019-10-26 23:45:35 +02:00
parent 390e0f7b9e
commit 1244956187
10 changed files with 1440 additions and 429 deletions

18
.gitignore vendored
View File

@ -1,6 +1,22 @@
.nogit/
node_modules/
# artifacts
coverage/
public/
pages/
# installs
node_modules/
# caches
.yarn/
.cache/
.rpt2_cache
# builds
dist/
dist_web/
dist_serve/
dist_ts_web/
# custom

View File

@ -1,5 +1,5 @@
# gitzone standard
image: hosttoday/ht-docker-node:npmci
# gitzone ci_default
image: registry.gitlab.com/hosttoday/ht-docker-node:npmci
cache:
paths:
@ -37,32 +37,8 @@ snyk:
# ====================
# test stage
# ====================
testLEGACY:
stage: test
script:
- npmci npm prepare
- npmci node install legacy
- npmci npm install
- npmci npm test
coverage: /\d+.?\d+?\%\s*coverage/
tags:
- docker
- notpriv
allow_failure: true
testLTS:
stage: test
script:
- npmci npm prepare
- npmci node install lts
- npmci npm install
- npmci npm test
coverage: /\d+.?\d+?\%\s*coverage/
tags:
- docker
- notpriv
testSTABLE:
testStable:
stage: test
script:
- npmci npm prepare
@ -72,6 +48,18 @@ testSTABLE:
coverage: /\d+.?\d+?\%\s*coverage/
tags:
- docker
- priv
testBuild:
stage: test
script:
- npmci npm prepare
- npmci node install stable
- npmci npm install
- npmci command npm run build
coverage: /\d+.?\d+?\%\s*coverage/
tags:
- docker
- notpriv
release:
@ -90,19 +78,12 @@ release:
# ====================
codequality:
stage: metadata
image: docker:stable
allow_failure: true
services:
- docker:stable-dind
script:
- export SP_VERSION=$(echo "$CI_SERVER_VERSION" | sed 's/^\([0-9]*\)\.\([0-9]*\).*/\1-\2-stable/')
- docker run
--env SOURCE_CODE="$PWD"
--volume "$PWD":/code
--volume /var/run/docker.sock:/var/run/docker.sock
"registry.gitlab.com/gitlab-org/security-products/codequality:$SP_VERSION" /code
artifacts:
paths: [codeclimate.json]
- npmci command npm install -g tslint typescript
- npmci npm prepare
- npmci npm install
- npmci command "tslint -c tslint.json ./ts/**/*.ts"
tags:
- docker
- priv
@ -118,13 +99,13 @@ trigger:
- notpriv
pages:
image: hosttoday/ht-docker-node:npmci
stage: metadata
script:
- npmci command npm install -g typedoc typescript
- npmci node install lts
- npmci command npm install -g @gitzone/tsdoc
- npmci npm prepare
- npmci npm install
- npmci command typedoc --module "commonjs" --target "ES2016" --out public/ ts/
- npmci command tsdoc
tags:
- docker
- notpriv
@ -135,13 +116,3 @@ pages:
paths:
- public
allow_failure: true
windowsCompatibility:
image: stefanscherer/node-windows:10-build-tools
stage: metadata
script:
- npm install & npm test
coverage: /\d+.?\d+?\%\s*coverage/
tags:
- windows
allow_failure: true

View File

@ -5,5 +5,15 @@
"ts-node"
],
"npmAccessLevel": "public"
},
"gitzone": {
"module": {
"githost": "gitlab.com",
"gitscope": "pushrocks",
"gitrepo": "smartmail",
"shortDescription": "a unified format for representing and dealing with mails",
"npmPackagename": "@pushrocks/smartmail",
"license": "MIT"
}
}
}
}

1647
package-lock.json generated

File diff suppressed because it is too large Load Diff

View File

@ -13,11 +13,27 @@
"build": "(tsbuild)"
},
"devDependencies": {
"@gitzone/tsbuild": "^2.0.22",
"@gitzone/tsrun": "^1.1.12",
"@gitzone/tstest": "^1.0.15",
"@pushrocks/tapbundle": "^3.0.7",
"@types/node": "^10.11.3"
"@gitzone/tsbuild": "^2.1.17",
"@gitzone/tsrun": "^1.2.8",
"@gitzone/tstest": "^1.0.28",
"@pushrocks/tapbundle": "^3.0.13",
"@types/node": "^12.11.7",
"tslint": "^5.20.0",
"tslint-config-prettier": "^1.18.0"
},
"dependencies": {}
"dependencies": {
"@pushrocks/smartfile": "^7.0.6",
"@pushrocks/smartmustache": "^2.0.8"
},
"files": [
"ts/**/*",
"ts_web/**/*",
"dist/**/*",
"dist_web/**/*",
"dist_ts_web/**/*",
"assets/**/*",
"cli.js",
"npmextra.json",
"readme.md"
]
}

26
readme.md Normal file
View File

@ -0,0 +1,26 @@
# @pushrocks/smartmail
a unified format for representing and dealing with mails
## Availabililty and Links
* [npmjs.org (npm package)](https://www.npmjs.com/package/@pushrocks/smartmail)
* [gitlab.com (source)](https://gitlab.com/pushrocks/smartmail)
* [github.com (source mirror)](https://github.com/pushrocks/smartmail)
* [docs (typedoc)](https://pushrocks.gitlab.io/smartmail/)
## Status for master
[![build status](https://gitlab.com/pushrocks/smartmail/badges/master/build.svg)](https://gitlab.com/pushrocks/smartmail/commits/master)
[![coverage report](https://gitlab.com/pushrocks/smartmail/badges/master/coverage.svg)](https://gitlab.com/pushrocks/smartmail/commits/master)
[![npm downloads per month](https://img.shields.io/npm/dm/@pushrocks/smartmail.svg)](https://www.npmjs.com/package/@pushrocks/smartmail)
[![Known Vulnerabilities](https://snyk.io/test/npm/@pushrocks/smartmail/badge.svg)](https://snyk.io/test/npm/@pushrocks/smartmail)
[![TypeScript](https://img.shields.io/badge/TypeScript->=%203.x-blue.svg)](https://nodejs.org/dist/latest-v10.x/docs/api/)
[![node](https://img.shields.io/badge/node->=%2010.x.x-blue.svg)](https://nodejs.org/dist/latest-v10.x/docs/api/)
[![JavaScript Style Guide](https://img.shields.io/badge/code%20style-prettier-ff69b4.svg)](https://prettier.io/)
## Usage
For further information read the linked docs at the top of this readme.
> MIT licensed | **©** [Lossless GmbH](https://lossless.gmbh)
| By using this npm module you agree to our [privacy policy](https://lossless.gmbH/privacy)
[![repo-footer](https://lossless.gitlab.io/publicrelations/repofooter.svg)](https://maintainedby.lossless.com)

View File

@ -2,7 +2,11 @@ import { expect, tap } from '@pushrocks/tapbundle';
import * as smartmail from '../ts/index';
tap.test('first test', async () => {
const testSmartmail = new smartmail.Smartmail();
const testSmartmail = new smartmail.Smartmail({
body: 'hi there',
from: 'noreply@mail.lossless.com',
subject: 'hi from here'
});
expect(testSmartmail).to.be.instanceof(smartmail.Smartmail);
});

View File

@ -1,11 +1,33 @@
import * as plugins from './smartmail.plugins';
export interface ISmartmailOptions {
from: string;
subject: string;
body: string;
}
/**
* a standard representation for mails
*/
export class Smartmail {
from: string;
to: string;
body: string;
attachments: any[];
public options: ISmartmailOptions;
public attachments: plugins.smartfile.Smartfile[];
constructor(optionsArg: ISmartmailOptions) {
this.options = optionsArg;
}
public addAttachment(smartfileArg: plugins.smartfile.Smartfile) {
this.attachments.push(smartfileArg);
}
public getSubject(dataArg: any = {}) {
const smartmustache = new plugins.smartmustache.SmartMustache(this.options.subject);
return smartmustache.applyData(dataArg);
}
public getBody(dataArg: any = {}) {
const smartmustache = new plugins.smartmustache.SmartMustache(this.options.body);
return smartmustache.applyData(dataArg);
}
}

View File

@ -1,2 +1,7 @@
const removeme = {};
export { removeme };
import * as smartfile from '@pushrocks/smartfile';
import * as smartmustache from '@pushrocks/smartmustache';
export {
smartfile,
smartmustache
};

View File

@ -1,7 +1,17 @@
{
"extends": ["tslint:latest", "tslint-config-prettier"],
"rules": {
"semicolon": [true, "always"]
"extends": ["tslint:latest", "tslint-config-prettier"],
"rules": {
"semicolon": [true, "always"],
"no-console": false,
"ordered-imports": false,
"object-literal-sort-keys": false,
"member-ordering": {
"options":{
"order": [
"static-method"
]
}
}
}
},
"defaultSeverity": "warning"
}