13 Commits

Author SHA1 Message Date
b0bc321cc2 2.0.1 2023-06-11 22:25:13 +02:00
8c3214b872 fix(core): update 2023-06-11 22:25:12 +02:00
bc1a89e3c7 2.0.0 2023-06-11 22:17:05 +02:00
92ae017d0f BREAKING CHANGE(core): update 2023-06-11 22:17:04 +02:00
405f87d744 1.0.9 2023-06-11 22:16:29 +02:00
aefa8795dd fix(core): update 2023-06-11 22:16:28 +02:00
90d722de00 1.0.8 2020-01-30 12:56:45 +00:00
0639e0f4e5 fix(core): update 2020-01-30 12:56:44 +00:00
dc5457996b 1.0.7 2020-01-30 11:50:36 +00:00
065592df59 fix(core): update 2020-01-30 11:50:35 +00:00
4d4e2483cf 1.0.6 2019-06-15 18:35:10 +02:00
7f3b28f27b 1.0.5 2019-06-15 18:10:09 +02:00
e3d6dced15 fix(core): update 2019-06-15 18:10:09 +02:00
15 changed files with 4670 additions and 1889 deletions

4
.gitignore vendored
View File

@ -15,8 +15,6 @@ node_modules/
# builds # builds
dist/ dist/
dist_web/ dist_*/
dist_serve/
dist_ts_web/
# custom # custom

View File

@ -1,10 +1,10 @@
# gitzone standard # gitzone ci_default
image: hosttoday/ht-docker-node:npmci image: registry.gitlab.com/hosttoday/ht-docker-node:npmci
cache: cache:
paths: paths:
- .npmci_cache/ - .npmci_cache/
key: "$CI_BUILD_STAGE" key: '$CI_BUILD_STAGE'
stages: stages:
- security - security
@ -12,55 +12,62 @@ stages:
- release - release
- metadata - metadata
before_script:
- pnpm install -g pnpm
- pnpm install -g @shipzone/npmci
- npmci npm prepare
# ==================== # ====================
# security stage # security stage
# ==================== # ====================
mirror: # ====================
# security stage
# ====================
auditProductionDependencies:
image: registry.gitlab.com/hosttoday/ht-docker-node:npmci
stage: security stage: security
script: script:
- npmci git mirror - npmci command npm config set registry https://registry.npmjs.org
- npmci command pnpm audit --audit-level=high --prod
tags: tags:
- lossless
- docker - docker
- notpriv allow_failure: true
snyk: auditDevDependencies:
image: registry.gitlab.com/hosttoday/ht-docker-node:npmci
stage: security stage: security
script: script:
- npmci npm prepare - npmci command npm config set registry https://registry.npmjs.org
- npmci command npm install -g snyk - npmci command pnpm audit --audit-level=high --dev
- npmci command npm install --ignore-scripts
- npmci command snyk test
tags: tags:
- lossless
- docker - docker
- notpriv allow_failure: true
# ==================== # ====================
# test stage # test stage
# ==================== # ====================
testLTS: testStable:
stage: test stage: test
script: script:
- npmci npm prepare
- npmci node install lts
- npmci npm install
- npmci npm test
coverage: /\d+.?\d+?\%\s*coverage/
tags:
- docker
- notpriv
testSTABLE:
stage: test
script:
- npmci npm prepare
- npmci node install stable - npmci node install stable
- npmci npm install - npmci npm install
- npmci npm test - npmci npm test
coverage: /\d+.?\d+?\%\s*coverage/ coverage: /\d+.?\d+?\%\s*coverage/
tags: tags:
- docker - docker
- notpriv
testBuild:
stage: test
script:
- npmci node install stable
- npmci npm install
- npmci npm build
coverage: /\d+.?\d+?\%\s*coverage/
tags:
- docker
release: release:
stage: release stage: release
@ -70,6 +77,7 @@ release:
only: only:
- tags - tags
tags: tags:
- lossless
- docker - docker
- notpriv - notpriv
@ -78,20 +86,15 @@ release:
# ==================== # ====================
codequality: codequality:
stage: metadata stage: metadata
image: docker:stable
allow_failure: true allow_failure: true
services: only:
- docker:stable-dind - tags
script: script:
- export SP_VERSION=$(echo "$CI_SERVER_VERSION" | sed 's/^\([0-9]*\)\.\([0-9]*\).*/\1-\2-stable/') - npmci command npm install -g typescript
- docker run - npmci npm prepare
--env SOURCE_CODE="$PWD" - npmci npm install
--volume "$PWD":/code
--volume /var/run/docker.sock:/var/run/docker.sock
"registry.gitlab.com/gitlab-org/security-products/codequality:$SP_VERSION" /code
artifacts:
paths: [codeclimate.json]
tags: tags:
- lossless
- docker - docker
- priv - priv
@ -102,18 +105,18 @@ trigger:
only: only:
- tags - tags
tags: tags:
- lossless
- docker - docker
- notpriv - notpriv
pages: pages:
image: hosttoday/ht-docker-node:npmci
stage: metadata stage: metadata
script: script:
- npmci command npm install -g @gitzone/tsdoc - npmci node install stable
- npmci npm prepare
- npmci npm install - npmci npm install
- npmci command tsdoc - npmci command npm run buildDocs
tags: tags:
- lossless
- docker - docker
- notpriv - notpriv
only: only:

11
.vscode/launch.json vendored Normal file
View File

@ -0,0 +1,11 @@
{
"version": "0.2.0",
"configurations": [
{
"command": "npm test",
"name": "Run npm test",
"request": "launch",
"type": "node-terminal"
}
]
}

26
.vscode/settings.json vendored Normal file
View File

@ -0,0 +1,26 @@
{
"json.schemas": [
{
"fileMatch": ["/npmextra.json"],
"schema": {
"type": "object",
"properties": {
"npmci": {
"type": "object",
"description": "settings for npmci"
},
"gitzone": {
"type": "object",
"description": "settings for gitzone",
"properties": {
"projectType": {
"type": "string",
"enum": ["website", "element", "service", "npm", "wcc"]
}
}
}
}
}
}
]
}

View File

@ -1,10 +1,11 @@
{ {
"gitzone": { "gitzone": {
"projectType": "npm",
"module": { "module": {
"githost": "gitlab.com", "githost": "gitlab.com",
"gitscope": "pushrocks", "gitscope": "pushrocks",
"gitrepo": "smartmanifest", "gitrepo": "smartmanifest",
"shortDescription": "a module for creating web app manifests", "description": "a module for creating web app manifests",
"npmPackagename": "@pushrocks/smartmanifest", "npmPackagename": "@pushrocks/smartmanifest",
"license": "MIT", "license": "MIT",
"projectDomain": "push.rocks" "projectDomain": "push.rocks"

1772
package-lock.json generated

File diff suppressed because it is too large Load Diff

View File

@ -1,24 +1,39 @@
{ {
"name": "@pushrocks/smartmanifest", "name": "@pushrocks/smartmanifest",
"version": "1.0.4", "version": "2.0.1",
"private": false, "private": false,
"description": "a module for creating web app manifests", "description": "a module for creating web app manifests",
"main": "dist/index.js", "main": "dist_ts/index.js",
"typings": "dist/index.d.ts", "typings": "dist_ts/index.d.ts",
"author": "Lossless GmbH", "author": "Lossless GmbH",
"license": "MIT", "license": "MIT",
"scripts": { "scripts": {
"test": "(tstest test/)", "test": "(tstest test/)",
"build": "(tsbuild)", "build": "(tsbuild)",
"format": "(gitzone format)" "format": "(gitzone format)",
"buildDocs": "tsdoc"
}, },
"devDependencies": { "devDependencies": {
"@gitzone/tsbuild": "^2.0.22", "@gitzone/tsbuild": "^2.1.66",
"@gitzone/tstest": "^1.0.24", "@gitzone/tsrun": "^1.2.42",
"@pushrocks/tapbundle": "^3.0.7", "@gitzone/tstest": "^1.0.74",
"@types/node": "^12.0.8", "@pushrocks/tapbundle": "^5.0.4",
"tslint": "^5.17.0", "@types/node": "^20.3.0"
"tslint-config-prettier": "^1.15.0"
}, },
"dependencies": {} "files": [
"ts/**/*",
"ts_web/**/*",
"dist/**/*",
"dist_*/**/*",
"dist_ts/**/*",
"dist_ts_web/**/*",
"assets/**/*",
"cli.js",
"npmextra.json",
"readme.md"
],
"type": "module",
"browserslist": [
"last 1 chrome versions"
]
} }

4441
pnpm-lock.yaml generated Normal file

File diff suppressed because it is too large Load Diff

40
readme.md Normal file
View File

@ -0,0 +1,40 @@
# @pushrocks/smartmanifest
a module for creating web app manifests
## Availabililty and Links
* [npmjs.org (npm package)](https://www.npmjs.com/package/@pushrocks/smartmanifest)
* [gitlab.com (source)](https://gitlab.com/pushrocks/smartmanifest)
* [github.com (source mirror)](https://github.com/pushrocks/smartmanifest)
* [docs (typedoc)](https://pushrocks.gitlab.io/smartmanifest/)
## Status for master
Status Category | Status Badge
-- | --
GitLab Pipelines | [![pipeline status](https://gitlab.com/pushrocks/smartmanifest/badges/master/pipeline.svg)](https://lossless.cloud)
GitLab Pipline Test Coverage | [![coverage report](https://gitlab.com/pushrocks/smartmanifest/badges/master/coverage.svg)](https://lossless.cloud)
npm | [![npm downloads per month](https://badgen.net/npm/dy/@pushrocks/smartmanifest)](https://lossless.cloud)
Snyk | [![Known Vulnerabilities](https://badgen.net/snyk/pushrocks/smartmanifest)](https://lossless.cloud)
TypeScript Support | [![TypeScript](https://badgen.net/badge/TypeScript/>=%203.x/blue?icon=typescript)](https://lossless.cloud)
node Support | [![node](https://img.shields.io/badge/node->=%2010.x.x-blue.svg)](https://nodejs.org/dist/latest-v10.x/docs/api/)
Code Style | [![Code Style](https://badgen.net/badge/style/prettier/purple)](https://lossless.cloud)
PackagePhobia (total standalone install weight) | [![PackagePhobia](https://badgen.net/packagephobia/install/@pushrocks/smartmanifest)](https://lossless.cloud)
PackagePhobia (package size on registry) | [![PackagePhobia](https://badgen.net/packagephobia/publish/@pushrocks/smartmanifest)](https://lossless.cloud)
BundlePhobia (total size when bundled) | [![BundlePhobia](https://badgen.net/bundlephobia/minzip/@pushrocks/smartmanifest)](https://lossless.cloud)
## Usage
## Contribution
We are always happy for code contributions. If you are not the code contributing type that is ok. Still, maintaining Open Source repositories takes considerable time and thought. If you like the quality of what we do and our modules are useful to you we would appreciate a little monthly contribution: You can [contribute one time](https://lossless.link/contribute-onetime) or [contribute monthly](https://lossless.link/contribute). :)
## Contribution
We are always happy for code contributions. If you are not the code contributing type that is ok. Still, maintaining Open Source repositories takes considerable time and thought. If you like the quality of what we do and our modules are useful to you we would appreciate a little monthly contribution: You can [contribute one time](https://lossless.link/contribute-onetime) or [contribute monthly](https://lossless.link/contribute). :)
For further information read the linked docs at the top of this readme.
## 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)

View File

@ -1,14 +1,14 @@
import { expect, tap } from '@pushrocks/tapbundle'; import { expect, tap } from '@pushrocks/tapbundle';
import * as smartmanifest from '../ts/index'; import * as smartmanifest from '../ts/index.js';
let testSmartManifest: smartmanifest.SmartManifest; let testSmartManifest: smartmanifest.SmartManifest;
tap.test('first test', async () => { tap.test('first test', async () => {
testSmartManifest = new smartmanifest.SmartManifest({ testSmartManifest = new smartmanifest.SmartManifest({
name: 'test app', name: 'test app',
short_name: 'app' short_name: 'app',
}); });
expect(testSmartManifest).to.be.instanceOf(smartmanifest.SmartManifest); expect(testSmartManifest).toBeInstanceOf(smartmanifest.SmartManifest);
}); });
tap.test('should produce a web app manifest', async () => { tap.test('should produce a web app manifest', async () => {

8
ts/00_commitinfo_data.ts Normal file
View File

@ -0,0 +1,8 @@
/**
* autocreated commitinfo by @pushrocks/commitinfo
*/
export const commitinfo = {
name: '@pushrocks/smartmanifest',
version: '2.0.1',
description: 'a module for creating web app manifests'
}

View File

@ -1,20 +1,25 @@
import * as plugins from './smartmanifest.plugins'; import * as plugins from './smartmanifest.plugins.js';
export interface ISmartManifestConstructorOptions { export interface ISmartManifestConstructorOptions {
name: string; name: string;
short_name: string; short_name: string;
start_url?: '/'; start_url?: '/';
display?: string; display?: 'standalone';
orientation?: string; orientation?: 'any';
background_color?: string; background_color?: string;
theme_color?: string; theme_color?: string;
icons?: [ icons?: Array<{
{
src: string; src: string;
type: string; type: string;
sizes: string; sizes: string;
} }>;
]; related_applications?: Array<{
platform: 'play' | string;
id: string;
}>;
scope: string;
lang: string;
display_override: 'window-controls-overlay'[];
} }
const defaultConstructorOptions: ISmartManifestConstructorOptions = { const defaultConstructorOptions: ISmartManifestConstructorOptions = {
@ -23,23 +28,37 @@ const defaultConstructorOptions: ISmartManifestConstructorOptions = {
start_url: '/', start_url: '/',
display: 'standalone', display: 'standalone',
orientation: 'any', orientation: 'any',
background_color: '#fff', background_color: '#000000',
theme_color: '#f78f21', theme_color: '#000000',
icons: [ icons: [
{ {
src: '/assets/icon-large.png', src: '/assetbroker/manifest/icon-large.png',
type: 'image/png', type: 'image/png',
sizes: '1024x1024', sizes: '1024x1024',
} },
] {
} src: '/assetbroker/manifest/icon-144x144.png',
sizes: '144x144',
type: 'image/png',
},
{
src: '/assetbroker/manifest/icon-512x512.png',
sizes: '512x512',
type: 'image/png',
},
],
related_applications: [],
scope: '/',
lang: 'en',
display_override: ['window-controls-overlay'],
};
export class SmartManifest { export class SmartManifest {
public options: ISmartManifestConstructorOptions; public options: ISmartManifestConstructorOptions;
constructor(optionsArg: ISmartManifestConstructorOptions) { constructor(optionsArg: ISmartManifestConstructorOptions) {
this.options = { this.options = {
...defaultConstructorOptions, ...defaultConstructorOptions,
...optionsArg ...optionsArg,
}; };
} }

View File

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

10
tsconfig.json Normal file
View File

@ -0,0 +1,10 @@
{
"compilerOptions": {
"experimentalDecorators": true,
"useDefineForClassFields": false,
"target": "ES2022",
"module": "ES2022",
"moduleResolution": "nodenext",
"esModuleInterop": true
}
}

View File

@ -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"
}