fix(core): update

This commit is contained in:
Philipp Kunz 2022-08-07 11:38:07 +02:00
parent 93a9bf437d
commit e25c885ddf
15 changed files with 11589 additions and 9427 deletions

View File

@ -12,30 +12,35 @@ stages:
- release
- metadata
before_script:
- npm install -g @shipzone/npmci
# ====================
# security stage
# ====================
mirror:
auditProductionDependencies:
image: registry.gitlab.com/hosttoday/ht-docker-node:npmci
stage: security
script:
- npmci git mirror
- npmci npm prepare
- npmci command npm install --production --ignore-scripts
- npmci command npm config set registry https://registry.npmjs.org
- npmci command npm audit --audit-level=high --only=prod --production
tags:
- lossless
- docker
- notpriv
allow_failure: true
audit:
auditDevDependencies:
image: registry.gitlab.com/hosttoday/ht-docker-node:npmci
stage: security
script:
- npmci npm prepare
- npmci command npm install --ignore-scripts
- npmci command npm config set registry https://registry.npmjs.org
- npmci command npm audit --audit-level=high
- npmci command npm audit --audit-level=high --only=dev
tags:
- lossless
- docker
- notpriv
allow_failure: true
# ====================
# test stage
@ -50,9 +55,7 @@ testStable:
- npmci npm test
coverage: /\d+.?\d+?\%\s*coverage/
tags:
- lossless
- docker
- priv
testBuild:
stage: test
@ -63,9 +66,7 @@ testBuild:
- npmci command npm run build
coverage: /\d+.?\d+?\%\s*coverage/
tags:
- lossless
- docker
- notpriv
release:
stage: release
@ -85,11 +86,12 @@ release:
codequality:
stage: metadata
allow_failure: true
only:
- tags
script:
- npmci command npm install -g tslint typescript
- npmci command npm install -g typescript
- npmci npm prepare
- npmci npm install
- npmci command "tslint -c tslint.json ./ts/**/*.ts"
tags:
- lossless
- docker
@ -109,11 +111,10 @@ trigger:
pages:
stage: metadata
script:
- npmci node install lts
- npmci command npm install -g @gitzone/tsdoc
- npmci node install stable
- npmci npm prepare
- npmci npm install
- npmci command tsdoc
- npmci command npm run buildDocs
tags:
- lossless
- docker

24
.vscode/launch.json vendored
View File

@ -2,28 +2,10 @@
"version": "0.2.0",
"configurations": [
{
"name": "current file",
"type": "node",
"command": "npm test",
"name": "Run npm test",
"request": "launch",
"args": [
"${relativeFile}"
],
"runtimeArgs": ["-r", "@gitzone/tsrun"],
"cwd": "${workspaceRoot}",
"protocol": "inspector",
"internalConsoleOptions": "openOnSessionStart"
},
{
"name": "test.ts",
"type": "node",
"request": "launch",
"args": [
"test/test.ts"
],
"runtimeArgs": ["-r", "@gitzone/tsrun"],
"cwd": "${workspaceRoot}",
"protocol": "inspector",
"internalConsoleOptions": "openOnSessionStart"
"type": "node-terminal"
}
]
}

View File

@ -15,7 +15,7 @@
"properties": {
"projectType": {
"type": "string",
"enum": ["website", "element", "service", "npm"]
"enum": ["website", "element", "service", "npm", "wcc"]
}
}
}

View File

@ -12,7 +12,7 @@
"githost": "gitlab.com",
"gitscope": "pushrocks",
"gitrepo": "smartmail",
"shortDescription": "a unified format for representing and dealing with mails",
"description": "a unified format for representing and dealing with mails",
"npmPackagename": "@pushrocks/smartmail",
"license": "MIT"
}

20826
package-lock.json generated

File diff suppressed because it is too large Load Diff

View File

@ -5,27 +5,27 @@
"description": "a unified format for representing and dealing with mails",
"main": "dist_ts/index.js",
"typings": "dist_ts/index.d.ts",
"type": "module",
"author": "Lossless GmbH",
"license": "UNLICENSED",
"scripts": {
"test": "(tstest test/)",
"format": "(gitzone format)",
"build": "(tsbuild --web)"
"build": "(tsbuild --web)",
"buildDocs": "tsdoc"
},
"devDependencies": {
"@gitzone/tsbuild": "^2.1.24",
"@gitzone/tsrun": "^1.2.12",
"@gitzone/tstest": "^1.0.43",
"@pushrocks/tapbundle": "^3.2.9",
"@types/node": "^14.0.27",
"tslint": "^6.1.3",
"tslint-config-prettier": "^1.18.0"
"@gitzone/tsbuild": "^2.1.65",
"@gitzone/tsrun": "^1.2.37",
"@gitzone/tstest": "^1.0.73",
"@pushrocks/tapbundle": "^5.0.4",
"@types/node": "^18.6.4"
},
"dependencies": {
"@pushrocks/smartdns": "^4.0.4",
"@pushrocks/smartfile": "^8.0.0",
"@pushrocks/smartmustache": "^2.0.9",
"@pushrocks/smartrequest": "^1.1.47"
"@pushrocks/smartdns": "^5.0.2",
"@pushrocks/smartfile": "^10.0.4",
"@pushrocks/smartmustache": "^2.0.12",
"@pushrocks/smartrequest": "^2.0.10"
},
"files": [
"ts/**/*",
@ -38,5 +38,8 @@
"cli.js",
"npmextra.json",
"readme.md"
],
"browserslist": [
"last 1 chrome versions"
]
}

View File

@ -1,31 +1,31 @@
import { expect, tap } from '@pushrocks/tapbundle';
import * as smartmail from '../ts/index';
import * as smartmail from '../ts/index.js';
let emailAddressValidatorInstance: smartmail.EmailAddressValidator;
tap.test('should create an instance of EmailAddressValidator', async () => {
emailAddressValidatorInstance = new smartmail.EmailAddressValidator();
expect(emailAddressValidatorInstance).to.be.instanceOf(smartmail.EmailAddressValidator);
expect(emailAddressValidatorInstance).toBeInstanceOf(smartmail.EmailAddressValidator);
});
tap.test('should validate an email', async () => {
const result = await emailAddressValidatorInstance.validate('sandbox@bleu.de');
expect(result.freemail).to.be.false;
expect(result.disposable).to.be.false;
expect(result.freemail).toBeFalse();
expect(result.disposable).toBeFalse();
console.log(result);
});
tap.test('should recognize an email as freemail', async () => {
const result = await emailAddressValidatorInstance.validate('sandbox@gmail.com');
expect(result.freemail).to.be.true;
expect(result.disposable).to.be.false;
expect(result.freemail).toBeTrue();
expect(result.disposable).toBeFalse();
console.log(result);
});
tap.test('should recognize an email as disposable', async () => {
const result = await emailAddressValidatorInstance.validate('sandbox@gmx.de');
expect(result.freemail).to.be.false;
expect(result.disposable).to.be.true;
expect(result.freemail).toBeFalse();
expect(result.disposable).toBeTrue();
console.log(result);
});
@ -33,9 +33,9 @@ tap.test('should create a SmartMail', async () => {
const testSmartmail = new smartmail.Smartmail({
body: 'hi there',
from: 'noreply@mail.lossless.com',
subject: 'hi from here'
subject: 'hi from here',
});
expect(testSmartmail).to.be.instanceof(smartmail.Smartmail);
expect(testSmartmail).toBeInstanceOf(smartmail.Smartmail);
});
tap.start();

8
ts/00_commitinfo_data.ts Normal file
View File

@ -0,0 +1,8 @@
/**
* autocreated commitinfo by @pushrocks/commitinfo
*/
export const commitinfo = {
name: '@pushrocks/smartmail',
version: '1.0.19',
description: 'a unified format for representing and dealing with mails'
}

View File

@ -1,2 +1,2 @@
export * from './smartmail.classes.smartmail';
export * from './smartmail.classes.emailaddressvalidator';
export * from './smartmail.classes.smartmail.js';
export * from './smartmail.classes.emailaddressvalidator.js';

View File

@ -1,5 +1,5 @@
import * as plugins from './smartmail.plugins';
import * as paths from './smartmail.paths';
import * as plugins from './smartmail.plugins.js';
import * as paths from './smartmail.paths.js';
export interface IEmailValidationResult {
valid: boolean;
@ -9,7 +9,7 @@ export interface IEmailValidationResult {
}
export class EmailAddressValidator {
public domainMap: { [key: string]: 'disposable' | 'freemail'};
public domainMap: { [key: string]: 'disposable' | 'freemail' };
public smartdns = new plugins.smartdns.Smartdns({});
@ -23,7 +23,7 @@ export class EmailAddressValidator {
valid: !!result,
reason: 'todo',
disposable: this.domainMap[emailArray[1]] === 'disposable',
freemail: this.domainMap[emailArray[1]] === 'freemail'
freemail: this.domainMap[emailArray[1]] === 'freemail',
};
}
@ -34,7 +34,6 @@ export class EmailAddressValidator {
);
const localFileObject = JSON.parse(localFileString);
let onlineFileObject: any;
try {
onlineFileObject = (
@ -49,9 +48,7 @@ export class EmailAddressValidator {
} catch (e) {
this.domainMap = localFileObject;
console.log(e);
console.log(
'smartmail EmailAddressValidator: Using local email list for email validation'
);
console.log('smartmail EmailAddressValidator: Using local email list for email validation');
}
}
}

View File

@ -1,4 +1,4 @@
import * as plugins from './smartmail.plugins';
import * as plugins from './smartmail.plugins.js';
export interface ISmartmailOptions<T> {
from: string;

View File

@ -1,4 +1,7 @@
import * as plugins from './smartmail.plugins';
import * as plugins from './smartmail.plugins.js';
export const packageDir = plugins.path.join(__dirname, '../');
export const packageDir = plugins.path.join(
plugins.smartpath.get.dirnameFromImportMetaUrl(import.meta.url),
'../'
);
export const assetDir = plugins.path.join(packageDir, './assets');

View File

@ -1,14 +1,13 @@
// node native scope
import * as path from 'path';
export {
path
};
export { path };
// pushrocks scope
import * as smartdns from '@pushrocks/smartdns';
import * as smartfile from '@pushrocks/smartfile';
import * as smartmustache from '@pushrocks/smartmustache';
import * as smartpath from '@pushrocks/smartpath';
import * as smartrequest from '@pushrocks/smartrequest';
export { smartdns, smartfile, smartmustache, smartrequest };
export { smartdns, smartfile, smartmustache, smartpath, smartrequest };

10
tsconfig.json Normal file
View File

@ -0,0 +1,10 @@
{
"compilerOptions": {
"experimentalDecorators": true,
"useDefineForClassFields": false,
"target": "ES2022",
"module": "ES2022",
"moduleResolution": "nodenext",
"esModuleInterop": true
}
}

View File

@ -1,17 +0,0 @@
{
"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"
}