fix(core): update

This commit is contained in:
Philipp Kunz 2022-12-28 19:43:48 +01:00
parent 76e777a3ac
commit 6de2f36964
8 changed files with 4422 additions and 18653 deletions

View File

@ -12,40 +12,36 @@ stages:
- release - release
- metadata - metadata
before_script:
- pnpm install -g pnpm
- pnpm install -g @shipzone/npmci
- npmci npm prepare
# ====================
# security stage
# ====================
# ==================== # ====================
# security stage # security stage
# ==================== # ====================
mirror:
stage: security
script:
- npmci git mirror
only:
- tags
tags:
- lossless
- docker
- notpriv
auditProductionDependencies: auditProductionDependencies:
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 command npm config set registry https://registry.npmjs.org
- npmci command npm install --production --ignore-scripts - npmci command pnpm audit --audit-level=high --prod
- 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
allow_failure: true
auditDevDependencies: 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 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 --only=dev - npmci command pnpm audit --audit-level=high --dev
tags: tags:
- lossless
- docker - docker
allow_failure: true allow_failure: true
@ -56,7 +52,6 @@ auditDevDependencies:
testStable: testStable:
stage: test stage: test
script: script:
- npmci npm prepare
- npmci node install stable - npmci node install stable
- npmci npm install - npmci npm install
- npmci npm test - npmci npm test
@ -67,10 +62,9 @@ testStable:
testBuild: testBuild:
stage: test stage: test
script: script:
- npmci npm prepare
- npmci node install stable - npmci node install stable
- npmci npm install - npmci npm install
- npmci command npm run build - npmci npm build
coverage: /\d+.?\d+?\%\s*coverage/ coverage: /\d+.?\d+?\%\s*coverage/
tags: tags:
- docker - docker
@ -96,10 +90,9 @@ codequality:
only: only:
- tags - 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
@ -119,11 +112,9 @@ 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 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"
} }
] ]
} }

18587
package-lock.json generated

File diff suppressed because it is too large Load Diff

View File

@ -8,7 +8,8 @@
"scripts": { "scripts": {
"test": "(tstest test/ --web)", "test": "(tstest test/ --web)",
"build": "(tsbuild --web --allowimplicitany && tsbundle npm)", "build": "(tsbuild --web --allowimplicitany && tsbundle npm)",
"testbrowser": "(npm test) && (node testbrowser.js)" "testbrowser": "(npm test) && (node testbrowser.js)",
"buildDocs": "tsdoc"
}, },
"repository": { "repository": {
"type": "git", "type": "git",
@ -28,12 +29,12 @@
}, },
"devDependencies": { "devDependencies": {
"@gitzone/tsbuild": "^2.1.56", "@gitzone/tsbuild": "^2.1.56",
"@gitzone/tsbundle": "^1.0.98", "@gitzone/tsbundle": "^2.0.7",
"@gitzone/tsrun": "^1.2.31", "@gitzone/tsrun": "^1.2.31",
"@gitzone/tstest": "^1.0.68", "@gitzone/tstest": "^1.0.68",
"@pushrocks/tapbundle": "^5.0.2", "@pushrocks/tapbundle": "^5.0.2",
"@types/npm": "^7.19.0", "@types/node": "^18.11.18",
"@types/node": "^17.0.21" "@types/npm": "^7.19.0"
}, },
"private": false, "private": false,
"files": [ "files": [
@ -51,4 +52,4 @@
"browserslist": [ "browserslist": [
"last 1 chrome versions" "last 1 chrome versions"
] ]
} }

4382
pnpm-lock.yaml Normal file

File diff suppressed because it is too large Load Diff

View File

@ -21,7 +21,6 @@ Code Style | [![Code Style](https://badgen.net/badge/style/prettier/purple)](htt
PackagePhobia (total standalone install weight) | [![PackagePhobia](https://badgen.net/packagephobia/install/@pushrocks/smartenv)](https://lossless.cloud) PackagePhobia (total standalone install weight) | [![PackagePhobia](https://badgen.net/packagephobia/install/@pushrocks/smartenv)](https://lossless.cloud)
PackagePhobia (package size on registry) | [![PackagePhobia](https://badgen.net/packagephobia/publish/@pushrocks/smartenv)](https://lossless.cloud) PackagePhobia (package size on registry) | [![PackagePhobia](https://badgen.net/packagephobia/publish/@pushrocks/smartenv)](https://lossless.cloud)
BundlePhobia (total size when bundled) | [![BundlePhobia](https://badgen.net/bundlephobia/minzip/@pushrocks/smartenv)](https://lossless.cloud) BundlePhobia (total size when bundled) | [![BundlePhobia](https://badgen.net/bundlephobia/minzip/@pushrocks/smartenv)](https://lossless.cloud)
Platform support | [![Supports Windows 10](https://badgen.net/badge/supports%20Windows%2010/yes/green?icon=windows)](https://lossless.cloud) [![Supports Mac OS X](https://badgen.net/badge/supports%20Mac%20OS%20X/yes/green?icon=apple)](https://lossless.cloud)
## Usage ## Usage
@ -33,7 +32,6 @@ We are always happy for code contributions. If you are not the code contributing
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) ## Legal
> MIT licensed | **©** [Task Venture Capital GmbH](https://task.vc)
| By using this npm module you agree to our [privacy policy](https://lossless.gmbH/privacy) | 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

@ -3,6 +3,6 @@
*/ */
export const commitinfo = { export const commitinfo = {
name: '@pushrocks/smartenv', name: '@pushrocks/smartenv',
version: '5.0.3', version: '5.0.4',
description: 'store things about your environment and let them travel across modules' description: 'store things about your environment and let them travel across modules'
} }

View File

@ -17,10 +17,14 @@ export class Smartenv {
getFunction: () => any; getFunction: () => any;
}) { }) {
if (this.isNode) { if (this.isNode) {
const moduleResult = await this.getSafeNodeModule(optionsArg.nodeModuleName); const moduleResult = await this.getSafeNodeModule(optionsArg.nodeModuleName);
return moduleResult; return moduleResult;
} else if (this.isBrowser) { } else if (this.isBrowser) {
const moduleResult = await this.getSafeWebModule(optionsArg.webUrlArg, optionsArg.getFunction); const moduleResult = await this.getSafeWebModule(
optionsArg.webUrlArg,
optionsArg.getFunction
);
return moduleResult;
} else { } else {
console.error('platform for loading not supported by smartenv'); console.error('platform for loading not supported by smartenv');
} }
@ -32,7 +36,7 @@ export class Smartenv {
return; return;
} }
// tslint:disable-next-line: function-constructor // tslint:disable-next-line: function-constructor
return (new Function(`return import('${moduleNameArg}')`))() as Promise<T>; return new Function(`return import('${moduleNameArg}')`)() as Promise<T>;
} }
public loadedScripts: string[] = []; public loadedScripts: string[] = [];
@ -41,13 +45,13 @@ export class Smartenv {
console.error('You tried to load a web module in a wrong context'); console.error('You tried to load a web module in a wrong context');
return; return;
} }
if (this.loadedScripts.includes(urlArg)) { if (this.loadedScripts.includes(urlArg)) {
return getFunctionArg(); return getFunctionArg();
} else { } else {
this.loadedScripts.push(urlArg); this.loadedScripts.push(urlArg);
} }
const done = plugins.smartpromise.defer(); const done = plugins.smartpromise.defer();
if (globalThis.importScripts) { if (globalThis.importScripts) {
globalThis.importScripts(urlArg); globalThis.importScripts(urlArg);
@ -138,9 +142,7 @@ export class Smartenv {
public async printEnv() { public async printEnv() {
if (this.isNode) { if (this.isNode) {
console.log('running on NODE'); console.log('running on NODE');
console.log( console.log('node version is ' + this.nodeVersion);
'node version is ' + this.nodeVersion
);
} else { } else {
console.log('running on BROWSER'); console.log('running on BROWSER');
console.log('browser is ' + this.userAgent); console.log('browser is ' + this.userAgent);