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

24
.vscode/launch.json vendored
View File

@ -2,28 +2,10 @@
"version": "0.2.0", "version": "0.2.0",
"configurations": [ "configurations": [
{ {
"name": "current file", "command": "npm test",
"type": "node", "name": "Run npm test",
"request": "launch", "request": "launch",
"args": [ "type": "node-terminal"
"${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"
} }
] ]
} }

View File

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

View File

@ -12,7 +12,7 @@
"githost": "gitlab.com", "githost": "gitlab.com",
"gitscope": "pushrocks", "gitscope": "pushrocks",
"gitrepo": "smartmail", "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", "npmPackagename": "@pushrocks/smartmail",
"license": "MIT" "license": "MIT"
} }

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

View File

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

View File

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

View File

@ -1,14 +1,13 @@
// node native scope // node native scope
import * as path from 'path'; import * as path from 'path';
export { export { path };
path
};
// pushrocks scope // pushrocks scope
import * as smartdns from '@pushrocks/smartdns'; import * as smartdns from '@pushrocks/smartdns';
import * as smartfile from '@pushrocks/smartfile'; import * as smartfile from '@pushrocks/smartfile';
import * as smartmustache from '@pushrocks/smartmustache'; import * as smartmustache from '@pushrocks/smartmustache';
import * as smartpath from '@pushrocks/smartpath';
import * as smartrequest from '@pushrocks/smartrequest'; 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"
}