Compare commits
10 Commits
Author | SHA1 | Date | |
---|---|---|---|
d312d6ae5a | |||
8ca254595d | |||
7661ae506d | |||
4e8dd83839 | |||
7ab1a4eec7 | |||
3098fbec89 | |||
1caa8a7c31 | |||
c689a3c349 | |||
a8a0778708 | |||
82ebb181a0 |
@ -1,20 +1,31 @@
|
|||||||
image: hosttoday/ht-docker-node:npmts
|
# gitzone standard
|
||||||
|
image: hosttoday/ht-docker-node:npmci
|
||||||
|
|
||||||
|
cache:
|
||||||
|
paths:
|
||||||
|
- .yarn/
|
||||||
|
key: "$CI_BUILD_STAGE"
|
||||||
|
|
||||||
stages:
|
stages:
|
||||||
- test
|
- test
|
||||||
- release
|
- release
|
||||||
- trigger
|
- trigger
|
||||||
- page
|
- pages
|
||||||
|
|
||||||
testLEGACY:
|
testLEGACY:
|
||||||
stage: test
|
stage: test
|
||||||
script:
|
script:
|
||||||
- npmci test legacy
|
- npmci test legacy
|
||||||
|
coverage: /\d+.?\d+?\%\s*coverage/
|
||||||
tags:
|
tags:
|
||||||
- docker
|
- docker
|
||||||
allow_failure: true
|
allow_failure: true
|
||||||
|
|
||||||
testLTS:
|
testLTS:
|
||||||
stage: test
|
stage: test
|
||||||
script:
|
script:
|
||||||
- npmci test lts
|
- npmci test lts
|
||||||
|
coverage: /\d+.?\d+?\%\s*coverage/
|
||||||
tags:
|
tags:
|
||||||
- docker
|
- docker
|
||||||
|
|
||||||
@ -22,8 +33,10 @@ testSTABLE:
|
|||||||
stage: test
|
stage: test
|
||||||
script:
|
script:
|
||||||
- npmci test stable
|
- npmci test stable
|
||||||
|
coverage: /\d+.?\d+?\%\s*coverage/
|
||||||
tags:
|
tags:
|
||||||
- docker
|
- docker
|
||||||
|
|
||||||
release:
|
release:
|
||||||
stage: release
|
stage: release
|
||||||
script:
|
script:
|
||||||
@ -32,6 +45,7 @@ release:
|
|||||||
- tags
|
- tags
|
||||||
tags:
|
tags:
|
||||||
- docker
|
- docker
|
||||||
|
|
||||||
trigger:
|
trigger:
|
||||||
stage: trigger
|
stage: trigger
|
||||||
script:
|
script:
|
||||||
@ -40,11 +54,15 @@ trigger:
|
|||||||
- tags
|
- tags
|
||||||
tags:
|
tags:
|
||||||
- docker
|
- docker
|
||||||
|
|
||||||
pages:
|
pages:
|
||||||
image: hosttoday/ht-docker-node:npmpage
|
image: hosttoday/ht-docker-node:npmci
|
||||||
stage: page
|
stage: pages
|
||||||
script:
|
script:
|
||||||
- npmci command npmpage --host gitlab
|
- npmci command yarn global add npmpage
|
||||||
|
- npmci command npmpage
|
||||||
|
tags:
|
||||||
|
- docker
|
||||||
only:
|
only:
|
||||||
- tags
|
- tags
|
||||||
artifacts:
|
artifacts:
|
||||||
|
44
README.md
44
README.md
@ -2,14 +2,15 @@
|
|||||||
simplifies lazy loading with TypeScript
|
simplifies lazy loading with TypeScript
|
||||||
|
|
||||||
## Availabililty
|
## Availabililty
|
||||||
[](https://www.npmjs.com/package/smartsystem)
|
[](https://www.npmjs.com/package/smartsystem)
|
||||||
[](https://gitlab.com/pushrocks/smartsystem)
|
[](https://GitLab.com/pushrocks/smartsystem)
|
||||||
[](https://github.com/pushrocks/smartsystem)
|
[](https://github.com/pushrocks/smartsystem)
|
||||||
[](https://pushrocks.gitlab.io/smartsystem/)
|
[](https://pushrocks.gitlab.io/smartsystem/)
|
||||||
|
|
||||||
## Status for master
|
## Status for master
|
||||||
[](https://gitlab.com/pushrocks/smartsystem/commits/master)
|
[](https://GitLab.com/pushrocks/smartsystem/commits/master)
|
||||||
[](https://gitlab.com/pushrocks/smartsystem/commits/master)
|
[](https://GitLab.com/pushrocks/smartsystem/commits/master)
|
||||||
|
[](https://www.npmjs.com/package/smartsystem)
|
||||||
[](https://david-dm.org/pushrocks/smartsystem)
|
[](https://david-dm.org/pushrocks/smartsystem)
|
||||||
[](https://www.bithound.io/github/pushrocks/smartsystem/master/dependencies/npm)
|
[](https://www.bithound.io/github/pushrocks/smartsystem/master/dependencies/npm)
|
||||||
[](https://www.bithound.io/github/pushrocks/smartsystem)
|
[](https://www.bithound.io/github/pushrocks/smartsystem)
|
||||||
@ -22,27 +23,42 @@ We recommend the use of TypeScript for best Intellisense
|
|||||||
|
|
||||||
smartsystem supports both npm and SystemJs as module loader.
|
smartsystem supports both npm and SystemJs as module loader.
|
||||||
|
|
||||||
```typescript
|
```javascript
|
||||||
import { LazyModule } from 'smartsystem'
|
import { LazyModule } from 'smartsystem'
|
||||||
|
|
||||||
import * as _myPlugin from 'myPlugin' // plugin does not get loaded here at runtime
|
// plugin does not get loaded here at runtime
|
||||||
let myPluginLazy = new LazyModule<typeof _myPlugin>('myPlugin')
|
import * as _myPlugin from 'myPlugin'
|
||||||
myPluginLazy.setLoader('npm') // sets the loader, defaults to npm anyway
|
|
||||||
|
|
||||||
|
// define the lazy module
|
||||||
|
let myLazyModule = new LazyModule<typeof _myPlugin>('myPlugin', __dirname)
|
||||||
|
|
||||||
|
// set the loader, defaults to npm anyway, can be systemjs alternatively
|
||||||
|
myLazyModule.setLoader('npm')
|
||||||
|
|
||||||
|
// another plugin
|
||||||
import * as _anotherPlugin from 'anotherPlugin' // plugin does not get loaded here at runtime
|
import * as _anotherPlugin from 'anotherPlugin' // plugin does not get loaded here at runtime
|
||||||
let anotherPluginLazy = new LazyModule<typeof _anotherPlugin>('anotherPlugin')
|
|
||||||
|
// define lazy module
|
||||||
|
let anotherLazyModule = new LazyModule<typeof _anotherPlugin>('anotherPlugin', __dirname)
|
||||||
anotherPluginLazy.setLoader('systemjs') // sets the loader to systemjs
|
anotherPluginLazy.setLoader('systemjs') // sets the loader to systemjs
|
||||||
|
|
||||||
myPluginLazy.whenLoaded.then(myPlugin => {
|
myLazyModule.whenLoaded.then(myPlugin => {
|
||||||
/* do something with myPlugin.
|
/* do something with myPlugin.
|
||||||
myPlugin receives the typings flow from LazyModule class
|
myPlugin receives the typings flow from LazyModule class
|
||||||
This does NOT load the module during runtime
|
This does NOT load the module during runtime
|
||||||
The promise whenLoaded will be resolved whenever load() is called for the first time */
|
The promise whenLoaded will be resolved whenever load() is called for the first time */
|
||||||
})
|
})
|
||||||
|
|
||||||
myPluginLazy.load().then(myPlugin => {
|
myLazyModule.load().then(myPlugin => {
|
||||||
/* do something with myPlugin.
|
/* do something with myPlugin.
|
||||||
myPlugin receives the typings flow from LazyModule class
|
myPlugin receives the typings flow from LazyModule class
|
||||||
This DOES LOAD the module */
|
This DOES LOAD the module */
|
||||||
})
|
})
|
||||||
```
|
```
|
||||||
|
|
||||||
|
For further information read the linked docs at the top of this README.
|
||||||
|
|
||||||
|
> MIT licensed | **©** [Lossless GmbH](https://lossless.gmbh)
|
||||||
|
| By using this npm module you agree to our [privacy policy](https://lossless.gmbH/privacy.html)
|
||||||
|
|
||||||
|
[](https://push.rocks)
|
||||||
|
7
npmextra.json
Normal file
7
npmextra.json
Normal file
@ -0,0 +1,7 @@
|
|||||||
|
{
|
||||||
|
"npmci": {
|
||||||
|
"globalNpmTools": [
|
||||||
|
"npmts"
|
||||||
|
]
|
||||||
|
}
|
||||||
|
}
|
@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "smartsystem",
|
"name": "smartsystem",
|
||||||
"version": "1.0.10",
|
"version": "1.0.15",
|
||||||
"description": "simplifies lazy loading with TypeScript",
|
"description": "simplifies lazy loading with TypeScript",
|
||||||
"main": "dist/index.js",
|
"main": "dist/index.js",
|
||||||
"typings": "dist/index.d.ts",
|
"typings": "dist/index.d.ts",
|
||||||
|
Reference in New Issue
Block a user