fix(core): update
This commit is contained in:
		| @@ -12,40 +12,36 @@ stages: | ||||
|   - release | ||||
|   - metadata | ||||
|  | ||||
| before_script: | ||||
|   - pnpm install -g pnpm | ||||
|   - pnpm install -g @shipzone/npmci | ||||
|   - npmci npm prepare | ||||
|  | ||||
| # ==================== | ||||
| # security stage | ||||
| # ==================== | ||||
| # ==================== | ||||
| # security stage | ||||
| # ==================== | ||||
| mirror: | ||||
|   stage: security | ||||
|   script: | ||||
|     - npmci git mirror | ||||
|   only: | ||||
|     - tags | ||||
|   tags: | ||||
|     - lossless | ||||
|     - docker | ||||
|     - notpriv | ||||
|  | ||||
| auditProductionDependencies: | ||||
|   image: registry.gitlab.com/hosttoday/ht-docker-node:npmci | ||||
|   stage: security | ||||
|   script: | ||||
|     - 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 | ||||
|      - npmci command npm config set registry https://registry.npmjs.org | ||||
|      - npmci command pnpm audit --audit-level=high --prod | ||||
|   tags: | ||||
|     - lossless | ||||
|     - docker | ||||
|   allow_failure: true | ||||
|  | ||||
| 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 --only=dev | ||||
|     - npmci command pnpm audit --audit-level=high --dev | ||||
|   tags: | ||||
|     - lossless | ||||
|     - docker | ||||
|   allow_failure: true | ||||
|  | ||||
| @@ -56,7 +52,6 @@ auditDevDependencies: | ||||
| testStable: | ||||
|   stage: test | ||||
|   script: | ||||
|     - npmci npm prepare | ||||
|     - npmci node install stable | ||||
|     - npmci npm install | ||||
|     - npmci npm test | ||||
| @@ -67,10 +62,9 @@ testStable: | ||||
| testBuild: | ||||
|   stage: test | ||||
|   script: | ||||
|     - npmci npm prepare | ||||
|     - npmci node install stable | ||||
|     - npmci npm install | ||||
|     - npmci command npm run build | ||||
|     - npmci npm build | ||||
|   coverage: /\d+.?\d+?\%\s*coverage/ | ||||
|   tags: | ||||
|     - docker | ||||
| @@ -96,10 +90,9 @@ codequality: | ||||
|   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 | ||||
| @@ -119,11 +112,9 @@ trigger: | ||||
| pages: | ||||
|   stage: metadata | ||||
|   script: | ||||
|     - npmci node install lts | ||||
|     - npmci command npm install -g @gitzone/tsdoc | ||||
|     - npmci npm prepare | ||||
|     - npmci node install stable | ||||
|     - npmci npm install | ||||
|     - npmci command tsdoc | ||||
|     - npmci command npm run buildDocs | ||||
|   tags: | ||||
|     - lossless | ||||
|     - docker | ||||
|   | ||||
							
								
								
									
										24
									
								
								.vscode/launch.json
									
									
									
									
										vendored
									
									
								
							
							
						
						
									
										24
									
								
								.vscode/launch.json
									
									
									
									
										vendored
									
									
								
							| @@ -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" | ||||
|     } | ||||
|   ] | ||||
| } | ||||
|   | ||||
							
								
								
									
										18587
									
								
								package-lock.json
									
									
									
										generated
									
									
									
								
							
							
						
						
									
										18587
									
								
								package-lock.json
									
									
									
										generated
									
									
									
								
							
										
											
												File diff suppressed because it is too large
												Load Diff
											
										
									
								
							
							
								
								
									
										11
									
								
								package.json
									
									
									
									
									
								
							
							
						
						
									
										11
									
								
								package.json
									
									
									
									
									
								
							| @@ -8,7 +8,8 @@ | ||||
|   "scripts": { | ||||
|     "test": "(tstest test/ --web)", | ||||
|     "build": "(tsbuild --web --allowimplicitany && tsbundle npm)", | ||||
|     "testbrowser": "(npm test) && (node testbrowser.js)" | ||||
|     "testbrowser": "(npm test) && (node testbrowser.js)", | ||||
|     "buildDocs": "tsdoc" | ||||
|   }, | ||||
|   "repository": { | ||||
|     "type": "git", | ||||
| @@ -28,12 +29,12 @@ | ||||
|   }, | ||||
|   "devDependencies": { | ||||
|     "@gitzone/tsbuild": "^2.1.56", | ||||
|     "@gitzone/tsbundle": "^1.0.98", | ||||
|     "@gitzone/tsbundle": "^2.0.7", | ||||
|     "@gitzone/tsrun": "^1.2.31", | ||||
|     "@gitzone/tstest": "^1.0.68", | ||||
|     "@pushrocks/tapbundle": "^5.0.2", | ||||
|     "@types/npm": "^7.19.0", | ||||
|     "@types/node": "^17.0.21" | ||||
|     "@types/node": "^18.11.18", | ||||
|     "@types/npm": "^7.19.0" | ||||
|   }, | ||||
|   "private": false, | ||||
|   "files": [ | ||||
| @@ -51,4 +52,4 @@ | ||||
|   "browserslist": [ | ||||
|     "last 1 chrome versions" | ||||
|   ] | ||||
| } | ||||
| } | ||||
							
								
								
									
										4382
									
								
								pnpm-lock.yaml
									
									
									
										generated
									
									
									
										Normal file
									
								
							
							
						
						
									
										4382
									
								
								pnpm-lock.yaml
									
									
									
										generated
									
									
									
										Normal file
									
								
							
										
											
												File diff suppressed because it is too large
												Load Diff
											
										
									
								
							| @@ -21,7 +21,6 @@ Code Style | [](htt | ||||
| PackagePhobia (total standalone install weight) | [](https://lossless.cloud) | ||||
| PackagePhobia (package size on registry) | [](https://lossless.cloud) | ||||
| BundlePhobia (total size when bundled) | [](https://lossless.cloud) | ||||
| Platform support | [](https://lossless.cloud) [](https://lossless.cloud) | ||||
|  | ||||
| ## 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. | ||||
|  | ||||
| > 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) | ||||
|  | ||||
| [](https://maintainedby.lossless.com) | ||||
|   | ||||
| @@ -3,6 +3,6 @@ | ||||
|  */ | ||||
| export const commitinfo = { | ||||
|   name: '@pushrocks/smartenv', | ||||
|   version: '5.0.3', | ||||
|   version: '5.0.4', | ||||
|   description: 'store things about your environment and let them travel across modules' | ||||
| } | ||||
|   | ||||
| @@ -17,10 +17,14 @@ export class Smartenv { | ||||
|     getFunction: () => any; | ||||
|   }) { | ||||
|     if (this.isNode) { | ||||
|       const moduleResult = await  this.getSafeNodeModule(optionsArg.nodeModuleName); | ||||
|       const moduleResult = await this.getSafeNodeModule(optionsArg.nodeModuleName); | ||||
|       return moduleResult; | ||||
|     } 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 { | ||||
|       console.error('platform for loading not supported by smartenv'); | ||||
|     } | ||||
| @@ -32,7 +36,7 @@ export class Smartenv { | ||||
|       return; | ||||
|     } | ||||
|     // 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[] = []; | ||||
| @@ -41,13 +45,13 @@ export class Smartenv { | ||||
|       console.error('You tried to load a web module in a wrong context'); | ||||
|       return; | ||||
|     } | ||||
|      | ||||
|  | ||||
|     if (this.loadedScripts.includes(urlArg)) { | ||||
|       return getFunctionArg(); | ||||
|     } else { | ||||
|       this.loadedScripts.push(urlArg); | ||||
|     } | ||||
|      | ||||
|  | ||||
|     const done = plugins.smartpromise.defer(); | ||||
|     if (globalThis.importScripts) { | ||||
|       globalThis.importScripts(urlArg); | ||||
| @@ -138,9 +142,7 @@ export class Smartenv { | ||||
|   public async printEnv() { | ||||
|     if (this.isNode) { | ||||
|       console.log('running on NODE'); | ||||
|       console.log( | ||||
|         'node version is ' + this.nodeVersion | ||||
|       ); | ||||
|       console.log('node version is ' + this.nodeVersion); | ||||
|     } else { | ||||
|       console.log('running on BROWSER'); | ||||
|       console.log('browser is ' + this.userAgent); | ||||
|   | ||||
		Reference in New Issue
	
	Block a user