Compare commits

..

104 Commits

Author SHA1 Message Date
727d26fae4 2.0.37 2017-03-26 22:02:21 +02:00
0f2b71ebc3 add new ci 2017-03-26 22:02:18 +02:00
638c1a8c8c now testing properly 2017-03-26 22:01:33 +02:00
c54644949e 2.0.36 2017-02-17 18:57:06 +01:00
53c26d4634 clean up and update deps 2017-02-17 18:56:58 +01:00
e3b1ec0633 improve README 2017-02-03 15:15:36 +01:00
1892bd6df1 2.0.35 2016-09-19 20:50:09 +02:00
20bdf70686 Update description 2016-09-19 20:50:01 +02:00
7787330d63 2.0.34 2016-09-19 20:48:23 +02:00
67c3efdd59 improve README 2016-09-19 20:48:11 +02:00
7655ba749a 2.0.33 2016-09-19 00:44:12 +02:00
0a089b6f10 removed unnecessary import 2016-09-19 00:43:58 +02:00
29bf694db6 2.0.32 2016-09-19 00:34:50 +02:00
019d8deadd update 2016-09-19 00:34:45 +02:00
bfef45cab3 update 2016-09-19 00:34:38 +02:00
eddc64b891 2.0.31 2016-09-18 23:45:00 +02:00
e47df19015 fix 2016-09-18 23:44:56 +02:00
af96ab531b add bithoundrc 2016-09-18 23:22:55 +02:00
b96206e8f7 2.0.30 2016-09-18 23:13:03 +02:00
f96bfc0875 improve README 2016-09-18 23:12:58 +02:00
62f3dbabda 2.0.29 2016-09-18 23:11:34 +02:00
5486e268ed prevent segmentation fault error by directly communicating with process 2016-09-18 23:11:26 +02:00
6d61043379 2.0.28 2016-09-15 14:59:33 +02:00
ac92f355d4 now passing required loading time through promise 2016-09-15 14:59:22 +02:00
140bfb4f5e 2.0.27 2016-09-15 14:46:02 +02:00
4ed87cac7e now adhering to standardjs 2016-09-15 14:45:58 +02:00
d2182a6d0f 2.0.26 2016-08-21 17:29:46 +02:00
b7e48313e1 improve typings 2016-08-21 17:29:38 +02:00
9f8e30526f 2.0.25 2016-08-20 09:09:07 +02:00
8dd5c97f3b finally fixed Segmentation error caused by readline in child process 2016-08-20 09:09:03 +02:00
58b6a9a328 2.0.24 2016-08-20 08:42:42 +02:00
1c4020824d switch from process.hrtime() to Date.now() 2016-08-20 08:42:39 +02:00
521e5740e5 2.0.23 2016-08-20 08:29:25 +02:00
ce76702d53 make it even more foolproof 2016-08-20 08:29:18 +02:00
4590c8f64e 2.0.22 2016-08-20 08:06:47 +02:00
ab7155f198 fix 2016-08-20 08:06:41 +02:00
feba451f90 2.0.21 2016-08-20 07:51:41 +02:00
1ba1b0447b fixed CI console output 2016-08-20 07:51:04 +02:00
e4db3ba7ee 2.0.20 2016-08-20 07:46:42 +02:00
da209ecc06 2.0.19 2016-08-20 07:42:04 +02:00
e010b01c42 fixed error 2016-08-20 07:41:56 +02:00
225c46a788 2.0.18 2016-08-20 07:32:48 +02:00
7883f1cb7d add npmextra.json 2016-08-20 07:32:44 +02:00
394dd88a1d 2.0.17 2016-08-20 07:29:30 +02:00
1d8fee1506 fixed small error 2016-08-20 07:29:27 +02:00
88d5409c40 2.0.16 2016-08-20 07:15:55 +02:00
b8c9508d21 try catch for execution time 2016-08-20 07:15:52 +02:00
59f97c3254 2.0.15 2016-08-20 07:12:24 +02:00
0491493b2e fixed typo 2016-08-20 07:12:19 +02:00
aca45165f8 2.0.14 2016-08-20 07:04:03 +02:00
569c597f8b improved early and added loading time 2016-08-20 07:03:49 +02:00
5f17ea48ed 2.0.13 2016-06-12 00:42:24 +02:00
6a9cdd297a fix 2016-06-12 00:42:04 +02:00
0a363b441c 2.0.12 2016-06-12 00:38:17 +02:00
3af6edd5e6 move new line to main process 2016-06-12 00:38:11 +02:00
9a26f1367d 2.0.11 2016-06-12 00:30:14 +02:00
15dd17e7a7 now inserting new line 2016-06-12 00:30:10 +02:00
3b704dbde5 2.0.10 2016-06-12 00:12:46 +02:00
48aeb16dfd fix some readline closing issue 2016-06-12 00:12:40 +02:00
b40d8452ec 2.0.9 2016-06-11 23:53:55 +02:00
d8281f098a fix promise for CI 2016-06-11 23:53:48 +02:00
3ffee9d0d6 2.0.8 2016-06-11 23:47:57 +02:00
03dfdda812 now removing readline correcctly 2016-06-11 23:47:52 +02:00
24cce5d9b2 2.0.7 2016-06-10 06:08:06 +02:00
295e568097 now preventing async readline clutter 2016-06-10 06:08:03 +02:00
846bcf66db 2.0.6 2016-06-10 05:59:24 +02:00
fc7d7fd27f now clearing correctly 2016-06-10 05:59:21 +02:00
9829c7bb1e 2.0.5 2016-06-10 05:43:39 +02:00
6827999cf8 fix another issue 2016-06-10 05:43:27 +02:00
b318fa2076 2.0.4 2016-06-10 05:36:09 +02:00
0c751e1bca fix CI issue 2016-06-10 05:36:06 +02:00
cb489552f2 2.0.3 2016-06-10 05:21:47 +02:00
addd66091f fix gitlab ci base image 2016-06-10 05:21:44 +02:00
c2f8199f0b 2.0.2 2016-06-10 05:18:07 +02:00
5e5696cce1 now paying respect to commandline 2016-06-10 05:18:03 +02:00
44d9782487 update project to use gitlab-ci 2016-05-30 05:58:56 +02:00
41592a4d2f 2.0.1 2016-05-23 05:17:07 +02:00
23367249ec update REAMDE 2016-05-23 05:17:02 +02:00
b415bf4ee7 2.0.0 2016-05-23 05:16:05 +02:00
86b6a6c3c4 update README 2016-05-23 05:15:58 +02:00
ffbfc29628 1.0.12 2016-05-23 05:11:10 +02:00
9c6e452801 another small fix 2016-05-23 05:11:03 +02:00
96c421e96e 1.0.11 2016-05-23 05:02:58 +02:00
84af99ba80 fixed CI detection in child process 2016-05-23 05:02:49 +02:00
6bb20dbc7b 1.0.10 2016-05-23 04:58:02 +02:00
66a7fc2afe small log fix 2016-05-23 04:57:41 +02:00
a42faf36d2 1.0.9 2016-05-23 04:51:50 +02:00
6db7cc0e14 fix path 2016-05-23 04:51:45 +02:00
102d384de5 1.0.8 2016-05-23 04:40:09 +02:00
1ceae01a49 now forking a seperate process to work when node is busy 2016-05-23 04:40:04 +02:00
7f4adbfe9f 1.0.7 2016-05-22 01:00:18 +02:00
eb72e2dccc add typings tag to package.json 2016-05-22 00:59:12 +02:00
839c80f5dd 1.0.6 2016-05-22 00:50:08 +02:00
e7e96972ad add npmts.json 2016-05-22 00:49:54 +02:00
799c2a58ca 1.0.5 2016-05-22 00:43:59 +02:00
1955dadba3 small fix 2016-05-22 00:43:54 +02:00
c14fadadf7 1.0.4 2016-05-22 00:38:28 +02:00
3f1a05d3e0 now working with CI 2016-05-22 00:38:14 +02:00
5908dc8b6f 1.0.3 2016-05-21 20:35:17 +02:00
d7ecf8e320 add travis 2016-05-21 20:35:14 +02:00
8b73f7a6bb 1.0.2 2016-05-21 20:33:20 +02:00
00d9ad0af1 now ready for use 2016-05-21 20:33:13 +02:00
ef20c00999 started using readline 2016-05-20 19:44:52 +02:00
4dab0f250a initial 2016-05-20 19:06:25 +02:00
12 changed files with 1952 additions and 12 deletions

4
.gitignore vendored Normal file
View File

@ -0,0 +1,4 @@
node_modules/
pages/
public/
coverage/

71
.gitlab-ci.yml Normal file
View File

@ -0,0 +1,71 @@
# gitzone standard
image: hosttoday/ht-docker-node:npmci
cache:
paths:
- .yarn/
key: "$CI_BUILD_STAGE"
stages:
- test
- release
- trigger
- pages
testLEGACY:
stage: test
script:
- npmci test legacy
coverage: /\d+.?\d+?\%\s*coverage/
tags:
- docker
allow_failure: true
testLTS:
stage: test
script:
- npmci test lts
coverage: /\d+.?\d+?\%\s*coverage/
tags:
- docker
testSTABLE:
stage: test
script:
- npmci test stable
coverage: /\d+.?\d+?\%\s*coverage/
tags:
- docker
release:
stage: release
script:
- npmci publish
only:
- tags
tags:
- docker
trigger:
stage: trigger
script:
- npmci trigger
only:
- tags
tags:
- docker
pages:
image: hosttoday/ht-docker-node:npmci
stage: pages
script:
- npmci command yarn global add npmpage
- npmci command npmpage --publish gitlab
tags:
- docker
only:
- tags
artifacts:
expire_in: 1 week
paths:
- public

View File

@ -1,6 +1,6 @@
The MIT License (MIT) The MIT License (MIT)
Copyright (c) 2016 Push.Rocks Copyright (c) 2016 Lossless GmbH
Permission is hereby granted, free of charge, to any person obtaining a copy Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal of this software and associated documentation files (the "Software"), to deal

View File

@ -1,12 +1,40 @@
# early # early
nice module loading animation for modules that need a little starting time. minimal and fast loading plugin for startup time measuring
> **note: this package is NOT READY YET** ## Availabililty
[![npm](https://pushrocks.gitlab.io/assets/repo-button-npm.svg)](https://www.npmjs.com/package/early)
[![git](https://pushrocks.gitlab.io/assets/repo-button-git.svg)](https://GitLab.com/pushrocks/early)
[![git](https://pushrocks.gitlab.io/assets/repo-button-mirror.svg)](https://github.com/pushrocks/early)
[![docs](https://pushrocks.gitlab.io/assets/repo-button-docs.svg)](https://pushrocks.gitlab.io/early/)
```typscript ## Status for master
[![build status](https://GitLab.com/pushrocks/early/badges/master/build.svg)](https://GitLab.com/pushrocks/early/commits/master)
[![coverage report](https://GitLab.com/pushrocks/early/badges/master/coverage.svg)](https://GitLab.com/pushrocks/early/commits/master)
[![npm downloads per month](https://img.shields.io/npm/dm/early.svg)](https://www.npmjs.com/package/early)
[![Dependency Status](https://david-dm.org/pushrocks/early.svg)](https://david-dm.org/pushrocks/early)
[![bitHound Dependencies](https://www.bithound.io/github/pushrocks/early/badges/dependencies.svg)](https://www.bithound.io/github/pushrocks/early/master/dependencies/npm)
[![bitHound Code](https://www.bithound.io/github/pushrocks/early/badges/code.svg)](https://www.bithound.io/github/pushrocks/early)
[![TypeScript](https://img.shields.io/badge/TypeScript-2.x-blue.svg)](https://nodejs.org/dist/latest-v6.x/docs/api/)
[![node](https://img.shields.io/badge/node->=%206.x.x-blue.svg)](https://nodejs.org/dist/latest-v6.x/docs/api/)
[![JavaScript Style Guide](https://img.shields.io/badge/code%20style-standard-brightgreen.svg)](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"; import * as early from "early";
early.start(); early.start("myModuleName");
// do your loading stuff /*
early.stop(); 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)
[![repo-footer](https://pushrocks.gitlab.io/assets/repo-footer.svg)](https://push.rocks)

6
dist/index.d.ts vendored Normal file
View File

@ -0,0 +1,6 @@
import 'typings-global';
/**
* start the loading
*/
export declare let start: (moduleNameArg?: string, loaderLengthArg?: string) => void;
export declare let stop: () => Promise<number>;

30
dist/index.js vendored Normal file
View File

@ -0,0 +1,30 @@
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
require("typings-global");
const beautycolor = require("beautycolor");
const smartq = require("smartq");
let doText = false;
let moduleName = 'undefined module name';
let startTime = Date.now();
if (process.argv.indexOf('-v') === -1) {
doText = true;
}
/**
* start the loading
*/
exports.start = function (moduleNameArg = '', loaderLengthArg = '10') {
moduleName = moduleNameArg;
if (doText) {
console.log(`**** starting ${beautycolor.coloredString(moduleNameArg, 'green')} ****`);
}
};
exports.stop = () => {
let done = smartq.defer();
let endTime = Date.now();
let earlyExecutionTime = (endTime - startTime);
let earlyExecutionTimeString = (earlyExecutionTime / 1000).toString();
console.log(`OK! -> finished loading within ${beautycolor.coloredString(earlyExecutionTimeString, 'blue')}`);
done.resolve(earlyExecutionTime);
return done.promise;
};
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiaW5kZXguanMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyIuLi90cy9pbmRleC50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiOztBQUFBLDBCQUF1QjtBQUN2QiwyQ0FBMEM7QUFDMUMsaUNBQWdDO0FBRWhDLElBQUksTUFBTSxHQUFZLEtBQUssQ0FBQTtBQUMzQixJQUFJLFVBQVUsR0FBVyx1QkFBdUIsQ0FBQTtBQUNoRCxJQUFJLFNBQVMsR0FBRyxJQUFJLENBQUMsR0FBRyxFQUFFLENBQUE7QUFFMUIsRUFBRSxDQUFDLENBQUMsT0FBTyxDQUFDLElBQUksQ0FBQyxPQUFPLENBQUMsSUFBSSxDQUFDLEtBQUssQ0FBQyxDQU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name": "early", "name": "early",
"version": "1.0.1", "version": "2.0.37",
"description": "nice module loading animation for modules that need a little starting time.", "description": "minimal and fast loading plugin for startup time measuring",
"main": "dist/index.js", "main": "dist/index.js",
"typings": "dist/index.d.ts",
"scripts": { "scripts": {
"test": "(npmts)" "test": "(npmts)"
}, },
"repository": { "repository": {
"type": "git", "type": "git",
"url": "git+https://github.com/pushrocks/early.git" "url": "git+https://gitlab.com/pushrocks/early.git"
}, },
"keywords": [ "keywords": [
"preloader" "preloader"
@ -16,7 +17,16 @@
"author": "Lossless GmbH", "author": "Lossless GmbH",
"license": "MIT", "license": "MIT",
"bugs": { "bugs": {
"url": "https://github.com/pushrocks/early/issues" "url": "https://gitlab.com/pushrocks/early/issues"
}, },
"homepage": "https://github.com/pushrocks/early#readme" "homepage": "https://gitlab.com/pushrocks/early#readme",
"devDependencies": {
"smartdelay": "^1.0.1",
"tapbundle": "^1.0.5"
},
"dependencies": {
"beautycolor": "^1.0.7",
"smartq": "^1.1.1",
"typings-global": "^1.0.14"
}
} }

11
test/test.ts Normal file
View File

@ -0,0 +1,11 @@
import { expect, tap } from 'tapbundle'
import * as smartdelay from 'smartdelay'
import early = require('../dist/index')
tap.test('.start()', async () => {
early.start('early')
await smartdelay.delayFor(2000)
})
tap.test('.stop()', async () => {
await early.stop()
})

31
ts/index.ts Normal file
View File

@ -0,0 +1,31 @@
import 'typings-global'
import * as beautycolor from 'beautycolor'
import * as smartq from 'smartq'
let doText: boolean = false
let moduleName: string = 'undefined module name'
let startTime = Date.now()
if (process.argv.indexOf('-v') === -1) {
doText = true
}
/**
* start the loading
*/
export let start = function (moduleNameArg: string = '', loaderLengthArg: string = '10') {
moduleName = moduleNameArg
if (doText) {
console.log(`**** starting ${beautycolor.coloredString(moduleNameArg, 'green')} ****`)
}
}
export let stop = (): Promise<number> => {
let done = smartq.defer<number>()
let endTime = Date.now()
let earlyExecutionTime: number = (endTime - startTime)
let earlyExecutionTimeString: string = (earlyExecutionTime / 1000).toString()
console.log(`OK! -> finished loading within ${beautycolor.coloredString(earlyExecutionTimeString, 'blue')}`)
done.resolve(earlyExecutionTime)
return done.promise
}

3
tslint.json Normal file
View File

@ -0,0 +1,3 @@
{
"extends": "tslint-config-standard"
}

1741
yarn.lock Normal file

File diff suppressed because it is too large Load Diff