Compare commits
4 Commits
Author | SHA1 | Date | |
---|---|---|---|
af837f5303 | |||
9145cc890c | |||
e3fa407c1c | |||
865e58b190 |
@ -19,6 +19,8 @@ mirror:
|
|||||||
stage: security
|
stage: security
|
||||||
script:
|
script:
|
||||||
- npmci git mirror
|
- npmci git mirror
|
||||||
|
only:
|
||||||
|
- tags
|
||||||
tags:
|
tags:
|
||||||
- lossless
|
- lossless
|
||||||
- docker
|
- docker
|
||||||
@ -33,9 +35,7 @@ audit:
|
|||||||
- 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
|
||||||
tags:
|
tags:
|
||||||
- lossless
|
|
||||||
- docker
|
- docker
|
||||||
- notpriv
|
|
||||||
|
|
||||||
# ====================
|
# ====================
|
||||||
# test stage
|
# test stage
|
||||||
@ -50,9 +50,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 +61,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,6 +81,8 @@ 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 tslint typescript
|
||||||
- npmci npm prepare
|
- npmci npm prepare
|
||||||
|
2
.vscode/settings.json
vendored
2
.vscode/settings.json
vendored
@ -15,7 +15,7 @@
|
|||||||
"properties": {
|
"properties": {
|
||||||
"projectType": {
|
"projectType": {
|
||||||
"type": "string",
|
"type": "string",
|
||||||
"enum": ["website", "element", "service", "npm"]
|
"enum": ["website", "element", "service", "npm", "wcc"]
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -1,44 +0,0 @@
|
|||||||
# early
|
|
||||||
|
|
||||||
minimal and fast loading plugin for startup time measuring
|
|
||||||
|
|
||||||
## Availabililty
|
|
||||||
|
|
||||||
[](https://www.npmjs.com/package/early)
|
|
||||||
[](https://GitLab.com/pushrocks/early)
|
|
||||||
[](https://github.com/pushrocks/early)
|
|
||||||
[](https://pushrocks.gitlab.io/early/)
|
|
||||||
|
|
||||||
## Status for master
|
|
||||||
|
|
||||||
[](https://GitLab.com/pushrocks/early/commits/master)
|
|
||||||
[](https://GitLab.com/pushrocks/early/commits/master)
|
|
||||||
[](https://www.npmjs.com/package/early)
|
|
||||||
[](https://david-dm.org/pushrocks/early)
|
|
||||||
[](https://www.bithound.io/github/pushrocks/early/master/dependencies/npm)
|
|
||||||
[](https://www.bithound.io/github/pushrocks/early)
|
|
||||||
[](https://nodejs.org/dist/latest-v6.x/docs/api/)
|
|
||||||
[](https://nodejs.org/dist/latest-v6.x/docs/api/)
|
|
||||||
[](http://standardjs.com/)
|
|
||||||
|
|
||||||
## Usage
|
|
||||||
|
|
||||||
Use TypeScript for best in class instellisense.
|
|
||||||
|
|
||||||
```javascript
|
|
||||||
// Put the following at the start of your module
|
|
||||||
import * as early from 'early';
|
|
||||||
early.start('myModuleName');
|
|
||||||
/*
|
|
||||||
do your loading stuff
|
|
||||||
*/
|
|
||||||
early.stop().then((loadingTime: number) => {
|
|
||||||
// loadingTime in milliseconds
|
|
||||||
}); // stop "early" when your module is ready
|
|
||||||
```
|
|
||||||
|
|
||||||
For further information read the linked docs at the top of this README.
|
|
||||||
|
|
||||||
> MIT licensed | **©** [Lossless GmbH](https://lossless.gmbh)
|
|
||||||
|
|
||||||
[](https://push.rocks)
|
|
@ -1,8 +1,6 @@
|
|||||||
{
|
{
|
||||||
"npmci": {
|
"npmci": {
|
||||||
"npmGlobalTools": [
|
"npmGlobalTools": [],
|
||||||
"@gitzone/npmts"
|
|
||||||
],
|
|
||||||
"npmAccessLevel": "public"
|
"npmAccessLevel": "public"
|
||||||
},
|
},
|
||||||
"gitzone": {
|
"gitzone": {
|
||||||
|
18274
package-lock.json
generated
18274
package-lock.json
generated
File diff suppressed because it is too large
Load Diff
22
package.json
22
package.json
@ -1,13 +1,14 @@
|
|||||||
{
|
{
|
||||||
"name": "@pushrocks/early",
|
"name": "@pushrocks/early",
|
||||||
"version": "3.0.5",
|
"version": "3.0.7",
|
||||||
"private": false,
|
"private": false,
|
||||||
"description": "minimal and fast loading plugin for startup time measuring",
|
"description": "minimal and fast loading plugin for startup time measuring",
|
||||||
"main": "dist_ts/index.js",
|
"main": "dist_ts/index.js",
|
||||||
"typings": "dist_ts/index.d.ts",
|
"typings": "dist_ts/index.d.ts",
|
||||||
|
"type": "module",
|
||||||
"scripts": {
|
"scripts": {
|
||||||
"test": "(tsrun test/test.ts)",
|
"test": "(tstest test/)",
|
||||||
"build": "(npmts)"
|
"build": "(tsbuild --web)"
|
||||||
},
|
},
|
||||||
"repository": {
|
"repository": {
|
||||||
"type": "git",
|
"type": "git",
|
||||||
@ -23,15 +24,15 @@
|
|||||||
},
|
},
|
||||||
"homepage": "https://gitlab.com/pushrocks/early#readme",
|
"homepage": "https://gitlab.com/pushrocks/early#readme",
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
"@gitzone/tsrun": "^1.2.8",
|
"@gitzone/tsrun": "^1.2.31",
|
||||||
"@pushrocks/smartdelay": "^2.0.6",
|
"@gitzone/tstest": "^1.0.69",
|
||||||
"@pushrocks/tapbundle": "^3.2.1",
|
"@pushrocks/smartdelay": "^2.0.13",
|
||||||
"tslint": "^6.1.2",
|
"@pushrocks/tapbundle": "^5.0.2"
|
||||||
"tslint-config-prettier": "^1.18.0"
|
|
||||||
},
|
},
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
|
"@gitzone/tsbuild": "^2.1.60",
|
||||||
"@pushrocks/consolecolor": "^2.0.1",
|
"@pushrocks/consolecolor": "^2.0.1",
|
||||||
"@pushrocks/smartpromise": "^3.0.6"
|
"@pushrocks/smartpromise": "^3.1.7"
|
||||||
},
|
},
|
||||||
"files": [
|
"files": [
|
||||||
"ts/**/*",
|
"ts/**/*",
|
||||||
@ -44,5 +45,8 @@
|
|||||||
"cli.js",
|
"cli.js",
|
||||||
"npmextra.json",
|
"npmextra.json",
|
||||||
"readme.md"
|
"readme.md"
|
||||||
|
],
|
||||||
|
"browserslist": [
|
||||||
|
"last 1 chrome versions"
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
|
34
readme.md
34
readme.md
@ -8,16 +8,36 @@ minimal and fast loading plugin for startup time measuring
|
|||||||
* [docs (typedoc)](https://pushrocks.gitlab.io/early/)
|
* [docs (typedoc)](https://pushrocks.gitlab.io/early/)
|
||||||
|
|
||||||
## Status for master
|
## Status for master
|
||||||
[](https://gitlab.com/pushrocks/early/commits/master)
|
|
||||||
[](https://gitlab.com/pushrocks/early/commits/master)
|
Status Category | Status Badge
|
||||||
[](https://www.npmjs.com/package/@pushrocks/early)
|
-- | --
|
||||||
[](https://snyk.io/test/npm/@pushrocks/early)
|
GitLab Pipelines | [](https://lossless.cloud)
|
||||||
[](https://nodejs.org/dist/latest-v10.x/docs/api/)
|
GitLab Pipline Test Coverage | [](https://lossless.cloud)
|
||||||
[](https://nodejs.org/dist/latest-v10.x/docs/api/)
|
npm | [](https://lossless.cloud)
|
||||||
[](https://prettier.io/)
|
Snyk | [](https://lossless.cloud)
|
||||||
|
TypeScript Support | [](https://lossless.cloud)
|
||||||
|
node Support | [](https://nodejs.org/dist/latest-v10.x/docs/api/)
|
||||||
|
Code Style | [](https://lossless.cloud)
|
||||||
|
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
|
## Usage
|
||||||
|
|
||||||
|
Use TypeScript for best in class instellisense.
|
||||||
|
|
||||||
|
```javascript
|
||||||
|
// Put the following at the start of your module
|
||||||
|
import * as early from 'early';
|
||||||
|
early.start('myModuleName');
|
||||||
|
/*
|
||||||
|
do your loading stuff
|
||||||
|
*/
|
||||||
|
early.stop().then((loadingTime: number) => {
|
||||||
|
// loadingTime in milliseconds
|
||||||
|
}); // stop "early" when your module is ready
|
||||||
|
```
|
||||||
|
|
||||||
## Contribution
|
## Contribution
|
||||||
|
|
||||||
|
@ -1,8 +1,10 @@
|
|||||||
import { expect, tap } from '@pushrocks/tapbundle';
|
import { expect, expectAsync, tap } from '@pushrocks/tapbundle';
|
||||||
import * as smartdelay from '@pushrocks/smartdelay';
|
import * as smartdelay from '@pushrocks/smartdelay';
|
||||||
import early = require('../ts/index');
|
|
||||||
|
import * as early from '../ts/index.js'
|
||||||
|
|
||||||
tap.test('.start()', async () => {
|
tap.test('.start()', async () => {
|
||||||
|
process.env.CLI_CALL_MODULENAME = 'early';
|
||||||
early.start('early');
|
early.start('early');
|
||||||
await smartdelay.delayFor(2000);
|
await smartdelay.delayFor(2000);
|
||||||
});
|
});
|
||||||
@ -17,7 +19,7 @@ tap.test('hrTime Measurement', async () => {
|
|||||||
await smartdelay.delayFor(1000);
|
await smartdelay.delayFor(1000);
|
||||||
let measuredTime = earlyHr.stop();
|
let measuredTime = earlyHr.stop();
|
||||||
console.log(measuredTime);
|
console.log(measuredTime);
|
||||||
return expect(measuredTime.milliSeconds).to.be.greaterThan(999);
|
return expect(measuredTime.milliSeconds).toBeGreaterThan(999);
|
||||||
});
|
});
|
||||||
|
|
||||||
tap.start();
|
tap.start();
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
import * as consolecolor from '@pushrocks/consolecolor';
|
import * as consolecolor from '@pushrocks/consolecolor';
|
||||||
import * as smartpromise from '@pushrocks/smartpromise';
|
import * as smartpromise from '@pushrocks/smartpromise';
|
||||||
import { HrtMeasurement } from './early.hrtMeasurement';
|
import { HrtMeasurement } from './early.hrtMeasurement.js';
|
||||||
|
|
||||||
export { HrtMeasurement };
|
export { HrtMeasurement };
|
||||||
|
|
||||||
@ -15,7 +15,7 @@ if (process.argv.indexOf('-v') === -1) {
|
|||||||
/**
|
/**
|
||||||
* start the loading
|
* start the loading
|
||||||
*/
|
*/
|
||||||
export let start = function(moduleNameArg: string = '', loaderLengthArg: string = '10') {
|
export let start = function (moduleNameArg: string = '', loaderLengthArg: string = '10') {
|
||||||
moduleName = moduleNameArg;
|
moduleName = moduleNameArg;
|
||||||
startHrt = new HrtMeasurement();
|
startHrt = new HrtMeasurement();
|
||||||
startHrt.start();
|
startHrt.start();
|
||||||
|
7
tsconfig.json
Normal file
7
tsconfig.json
Normal file
@ -0,0 +1,7 @@
|
|||||||
|
{
|
||||||
|
"compilerOptions": {
|
||||||
|
"target": "ES2022",
|
||||||
|
"module": "ES2022",
|
||||||
|
"moduleResolution": "nodenext"
|
||||||
|
}
|
||||||
|
}
|
17
tslint.json
17
tslint.json
@ -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"
|
|
||||||
}
|
|
Reference in New Issue
Block a user