Compare commits

..

10 Commits

Author SHA1 Message Date
269e658967 2.0.1 2019-07-16 18:54:19 +02:00
9008aca718 fix(core): update 2019-07-16 18:54:19 +02:00
74d73a0d21 2.0.0 2019-07-16 18:49:16 +02:00
5496c8c482 BREAKING CHANGE(core): remove serviceworker 2019-07-16 18:49:15 +02:00
c748c5102c 1.0.8 2019-03-27 14:58:24 +01:00
308133fe4f fix(core): update 2019-03-27 14:58:24 +01:00
cb80b4df75 1.0.7 2019-03-27 14:46:42 +01:00
74ed988da0 fix(core): update 2019-03-27 14:46:41 +01:00
d1793f9084 1.0.6 2019-03-27 14:40:07 +01:00
4a45262124 fix(core): update 2019-03-27 14:40:06 +01:00
9 changed files with 65 additions and 56 deletions

View File

@ -1,4 +1,4 @@
# gitzone standard
# gitzone ci_default
image: hosttoday/ht-docker-node:npmci
cache:
@ -34,28 +34,6 @@ snyk:
- docker
- notpriv
sast:
stage: security
image: docker:stable
variables:
DOCKER_DRIVER: overlay2
allow_failure: true
services:
- docker:stable-dind
script:
- export SP_VERSION=$(echo "$CI_SERVER_VERSION" | sed 's/^\([0-9]*\)\.\([0-9]*\).*/\1-\2-stable/')
- docker run
--env SAST_CONFIDENCE_LEVEL="${SAST_CONFIDENCE_LEVEL:-3}"
--volume "$PWD:/code"
--volume /var/run/docker.sock:/var/run/docker.sock
"registry.gitlab.com/gitlab-org/security-products/sast:$SP_VERSION" /app/bin/run /code
artifacts:
reports:
sast: gl-sast-report.json
tags:
- docker
- priv
# ====================
# test stage
# ====================

View File

@ -2,5 +2,15 @@
"npmci": {
"npmGlobalTools": [],
"npmAccessLevel": "public"
},
"gitzone": {
"module": {
"githost": "gitlab.com",
"gitscope": "pushrocks",
"gitrepo": "websetup",
"shortDescription": "setup basic page properties",
"npmPackagename": "@pushrocks/websetup",
"license": "MIT"
}
}
}

2
package-lock.json generated
View File

@ -1,6 +1,6 @@
{
"name": "@pushrocks/websetup",
"version": "1.0.5",
"version": "2.0.1",
"lockfileVersion": 1,
"requires": true,
"dependencies": {

View File

@ -1,6 +1,6 @@
{
"name": "@pushrocks/websetup",
"version": "1.0.5",
"version": "2.0.1",
"private": false,
"description": "setup basic page properties",
"main": "dist/index.js",
@ -9,7 +9,7 @@
"license": "MIT",
"scripts": {
"test": "(tstest test/)",
"build": "(tsbuild)",
"build": "(tsbuild --web)",
"format": "(gitzone format)"
},
"keywords": [
@ -23,5 +23,15 @@
"tslint": "^5.11.0",
"tslint-config-prettier": "^1.15.0"
},
"dependencies": {}
"dependencies": {},
"files": [
"ts/*",
"ts_web/*",
"dist/*",
"dist_web/*",
"assets/*",
"cli.js",
"npmextra.json",
"readme.md"
]
}

26
readme.md Normal file
View File

@ -0,0 +1,26 @@
# @pushrocks/websetup
setup basic page properties
## Availabililty and Links
* [npmjs.org (npm package)](https://www.npmjs.com/package/@pushrocks/websetup)
* [gitlab.com (source)](https://gitlab.com/pushrocks/websetup)
* [github.com (source mirror)](https://github.com/pushrocks/websetup)
* [docs (typedoc)](https://pushrocks.gitlab.io/websetup/)
## Status for master
[![build status](https://gitlab.com/pushrocks/websetup/badges/master/build.svg)](https://gitlab.com/pushrocks/websetup/commits/master)
[![coverage report](https://gitlab.com/pushrocks/websetup/badges/master/coverage.svg)](https://gitlab.com/pushrocks/websetup/commits/master)
[![npm downloads per month](https://img.shields.io/npm/dm/@pushrocks/websetup.svg)](https://www.npmjs.com/package/@pushrocks/websetup)
[![Known Vulnerabilities](https://snyk.io/test/npm/@pushrocks/websetup/badge.svg)](https://snyk.io/test/npm/@pushrocks/websetup)
[![TypeScript](https://img.shields.io/badge/TypeScript->=%203.x-blue.svg)](https://nodejs.org/dist/latest-v10.x/docs/api/)
[![node](https://img.shields.io/badge/node->=%2010.x.x-blue.svg)](https://nodejs.org/dist/latest-v10.x/docs/api/)
[![JavaScript Style Guide](https://img.shields.io/badge/code%20style-prettier-ff69b4.svg)](https://prettier.io/)
## Usage
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)
[![repo-footer](https://pushrocks.gitlab.io/assets/repo-footer.svg)](https://maintainedby.lossless.com)

View File

@ -1,8 +1,8 @@
import { expect, tap } from '@pushrocks/tapbundle';
import * as websetup from '../ts/index'
import * as websetup from '../ts/index';
tap.test('first test', async () => {
console.log('Waiting for proper puppeteer support here');
})
});
tap.start();

View File

@ -2,36 +2,32 @@ import * as plugins from './websetup.plugins';
import { setupGoogleAnalytics } from './tools/ganalytics';
import { setupFullStory } from './tools/fullstory';
import { setupServiceWoker } from './serviceworker';
import { IMetaObject, setupMetaInformation } from './meta';
export interface IWebSetupConstructorOptions {
googleAnalyticsCode?: string;
fsCode?: string;
metaObject: IMetaObject;
serviceworker?: boolean;
}
/**
* the main WebSetup class
*/
export class WebSetup {
public options: IWebSetupConstructorOptions;
constructor(optionsArg: IWebSetupConstructorOptions) {
// most important, lets get the meta information in place
this.setup(optionsArg);
this.options = optionsArg;
}
async setup(optionsArg: IWebSetupConstructorOptions) {
if(optionsArg.serviceworker) {
await setupServiceWoker()
public async setup() {
await setupMetaInformation(this.options.metaObject);
if (this.options.googleAnalyticsCode) {
await setupGoogleAnalytics(this.options.googleAnalyticsCode);
}
if (optionsArg.googleAnalyticsCode) {
await setupGoogleAnalytics(optionsArg.googleAnalyticsCode);
}
if (optionsArg.fsCode) {
await setupFullStory(optionsArg.fsCode)
if (this.options.fsCode) {
await setupFullStory(this.options.fsCode);
}
}
}

View File

@ -1,9 +0,0 @@
export const setupServiceWoker = async () => {
// serviceworker
const script = document.createElement('script');
script.onload = () => {
console.log('Loaded Serviceworker. The serviceworker helps us with notifications and offline capabilities, so you can also read this site when your device is offline.');
};
script.src = 'serviceworker/mainthread.js';
document.head.appendChild(script);
};

View File

@ -1,4 +1,2 @@
const removeme = {};
export {
removeme
}
export { removeme };