Compare commits
11 Commits
Author | SHA1 | Date | |
---|---|---|---|
b0bc321cc2 | |||
8c3214b872 | |||
bc1a89e3c7 | |||
92ae017d0f | |||
405f87d744 | |||
aefa8795dd | |||
90d722de00 | |||
0639e0f4e5 | |||
dc5457996b | |||
065592df59 | |||
4d4e2483cf |
4
.gitignore
vendored
4
.gitignore
vendored
@ -15,8 +15,6 @@ node_modules/
|
||||
|
||||
# builds
|
||||
dist/
|
||||
dist_web/
|
||||
dist_serve/
|
||||
dist_ts_web/
|
||||
dist_*/
|
||||
|
||||
# custom
|
113
.gitlab-ci.yml
113
.gitlab-ci.yml
@ -1,77 +1,85 @@
|
||||
# gitzone ci_default
|
||||
image: hosttoday/ht-docker-node:npmci
|
||||
image: registry.gitlab.com/hosttoday/ht-docker-node:npmci
|
||||
|
||||
cache:
|
||||
paths:
|
||||
- .npmci_cache/
|
||||
key: "$CI_BUILD_STAGE"
|
||||
- .npmci_cache/
|
||||
key: '$CI_BUILD_STAGE'
|
||||
|
||||
stages:
|
||||
- security
|
||||
- test
|
||||
- release
|
||||
- metadata
|
||||
- security
|
||||
- test
|
||||
- release
|
||||
- metadata
|
||||
|
||||
before_script:
|
||||
- pnpm install -g pnpm
|
||||
- pnpm install -g @shipzone/npmci
|
||||
- npmci npm prepare
|
||||
|
||||
# ====================
|
||||
# security stage
|
||||
# ====================
|
||||
mirror:
|
||||
# ====================
|
||||
# security stage
|
||||
# ====================
|
||||
auditProductionDependencies:
|
||||
image: registry.gitlab.com/hosttoday/ht-docker-node:npmci
|
||||
stage: security
|
||||
script:
|
||||
- npmci git mirror
|
||||
- npmci command npm config set registry https://registry.npmjs.org
|
||||
- npmci command pnpm audit --audit-level=high --prod
|
||||
tags:
|
||||
- docker
|
||||
- notpriv
|
||||
- lossless
|
||||
- docker
|
||||
allow_failure: true
|
||||
|
||||
snyk:
|
||||
auditDevDependencies:
|
||||
image: registry.gitlab.com/hosttoday/ht-docker-node:npmci
|
||||
stage: security
|
||||
script:
|
||||
- npmci npm prepare
|
||||
- npmci command npm install -g snyk
|
||||
- npmci command npm install --ignore-scripts
|
||||
- npmci command snyk test
|
||||
- npmci command npm config set registry https://registry.npmjs.org
|
||||
- npmci command pnpm audit --audit-level=high --dev
|
||||
tags:
|
||||
- docker
|
||||
- notpriv
|
||||
- lossless
|
||||
- docker
|
||||
allow_failure: true
|
||||
|
||||
# ====================
|
||||
# test stage
|
||||
# ====================
|
||||
|
||||
testLTS:
|
||||
testStable:
|
||||
stage: test
|
||||
script:
|
||||
- npmci npm prepare
|
||||
- npmci node install lts
|
||||
- npmci npm install
|
||||
- npmci npm test
|
||||
- npmci node install stable
|
||||
- npmci npm install
|
||||
- npmci npm test
|
||||
coverage: /\d+.?\d+?\%\s*coverage/
|
||||
tags:
|
||||
- docker
|
||||
- notpriv
|
||||
|
||||
testSTABLE:
|
||||
- docker
|
||||
|
||||
testBuild:
|
||||
stage: test
|
||||
script:
|
||||
- npmci npm prepare
|
||||
- npmci node install stable
|
||||
- npmci npm install
|
||||
- npmci npm test
|
||||
- npmci node install stable
|
||||
- npmci npm install
|
||||
- npmci npm build
|
||||
coverage: /\d+.?\d+?\%\s*coverage/
|
||||
tags:
|
||||
- docker
|
||||
- notpriv
|
||||
- docker
|
||||
|
||||
release:
|
||||
stage: release
|
||||
script:
|
||||
- npmci node install stable
|
||||
- npmci npm publish
|
||||
- npmci node install stable
|
||||
- npmci npm publish
|
||||
only:
|
||||
- tags
|
||||
- tags
|
||||
tags:
|
||||
- docker
|
||||
- notpriv
|
||||
- lossless
|
||||
- docker
|
||||
- notpriv
|
||||
|
||||
# ====================
|
||||
# metadata stage
|
||||
@ -79,33 +87,36 @@ release:
|
||||
codequality:
|
||||
stage: metadata
|
||||
allow_failure: true
|
||||
only:
|
||||
- tags
|
||||
script:
|
||||
- npmci command npm install -g tslint typescript
|
||||
- npmci command npm install -g typescript
|
||||
- npmci npm prepare
|
||||
- npmci npm install
|
||||
- npmci command "tslint -c tslint.json ./ts/**/*.ts"
|
||||
tags:
|
||||
- docker
|
||||
- priv
|
||||
- lossless
|
||||
- docker
|
||||
- priv
|
||||
|
||||
trigger:
|
||||
stage: metadata
|
||||
script:
|
||||
- npmci trigger
|
||||
- npmci trigger
|
||||
only:
|
||||
- tags
|
||||
- tags
|
||||
tags:
|
||||
- docker
|
||||
- notpriv
|
||||
- lossless
|
||||
- docker
|
||||
- notpriv
|
||||
|
||||
pages:
|
||||
image: hosttoday/ht-docker-node:npmci
|
||||
stage: metadata
|
||||
script:
|
||||
- npmci command npm install -g @gitzone/tsdoc
|
||||
- npmci npm prepare
|
||||
- npmci node install stable
|
||||
- npmci npm install
|
||||
- npmci command tsdoc
|
||||
- npmci command npm run buildDocs
|
||||
tags:
|
||||
- lossless
|
||||
- docker
|
||||
- notpriv
|
||||
only:
|
||||
@ -113,5 +124,5 @@ pages:
|
||||
artifacts:
|
||||
expire_in: 1 week
|
||||
paths:
|
||||
- public
|
||||
- public
|
||||
allow_failure: true
|
||||
|
11
.vscode/launch.json
vendored
Normal file
11
.vscode/launch.json
vendored
Normal 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
26
.vscode/settings.json
vendored
Normal 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"]
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
]
|
||||
}
|
@ -1,10 +1,11 @@
|
||||
{
|
||||
"gitzone": {
|
||||
"projectType": "npm",
|
||||
"module": {
|
||||
"githost": "gitlab.com",
|
||||
"gitscope": "pushrocks",
|
||||
"gitrepo": "smartmanifest",
|
||||
"shortDescription": "a module for creating web app manifests",
|
||||
"description": "a module for creating web app manifests",
|
||||
"npmPackagename": "@pushrocks/smartmanifest",
|
||||
"license": "MIT",
|
||||
"projectDomain": "push.rocks"
|
||||
|
1772
package-lock.json
generated
1772
package-lock.json
generated
File diff suppressed because it is too large
Load Diff
37
package.json
37
package.json
@ -1,34 +1,39 @@
|
||||
{
|
||||
"name": "@pushrocks/smartmanifest",
|
||||
"version": "1.0.5",
|
||||
"version": "2.0.1",
|
||||
"private": false,
|
||||
"description": "a module for creating web app manifests",
|
||||
"main": "dist/index.js",
|
||||
"typings": "dist/index.d.ts",
|
||||
"main": "dist_ts/index.js",
|
||||
"typings": "dist_ts/index.d.ts",
|
||||
"author": "Lossless GmbH",
|
||||
"license": "MIT",
|
||||
"scripts": {
|
||||
"test": "(tstest test/)",
|
||||
"build": "(tsbuild)",
|
||||
"format": "(gitzone format)"
|
||||
"format": "(gitzone format)",
|
||||
"buildDocs": "tsdoc"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@gitzone/tsbuild": "^2.0.22",
|
||||
"@gitzone/tstest": "^1.0.24",
|
||||
"@pushrocks/tapbundle": "^3.0.7",
|
||||
"@types/node": "^12.0.8",
|
||||
"tslint": "^5.17.0",
|
||||
"tslint-config-prettier": "^1.15.0"
|
||||
"@gitzone/tsbuild": "^2.1.66",
|
||||
"@gitzone/tsrun": "^1.2.42",
|
||||
"@gitzone/tstest": "^1.0.74",
|
||||
"@pushrocks/tapbundle": "^5.0.4",
|
||||
"@types/node": "^20.3.0"
|
||||
},
|
||||
"dependencies": {},
|
||||
"files": [
|
||||
"ts/*",
|
||||
"ts_web/*",
|
||||
"dist/*",
|
||||
"dist_web/*",
|
||||
"assets/*",
|
||||
"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
4441
pnpm-lock.yaml
generated
Normal file
File diff suppressed because it is too large
Load Diff
36
readme.md
36
readme.md
@ -8,19 +8,33 @@ a module for creating web app manifests
|
||||
* [docs (typedoc)](https://pushrocks.gitlab.io/smartmanifest/)
|
||||
|
||||
## Status for master
|
||||
[](https://gitlab.com/pushrocks/smartmanifest/commits/master)
|
||||
[](https://gitlab.com/pushrocks/smartmanifest/commits/master)
|
||||
[](https://www.npmjs.com/package/@pushrocks/smartmanifest)
|
||||
[](https://snyk.io/test/npm/@pushrocks/smartmanifest)
|
||||
[](https://nodejs.org/dist/latest-v10.x/docs/api/)
|
||||
[](https://nodejs.org/dist/latest-v10.x/docs/api/)
|
||||
[](https://prettier.io/)
|
||||
|
||||
Status Category | Status Badge
|
||||
-- | --
|
||||
GitLab Pipelines | [](https://lossless.cloud)
|
||||
GitLab Pipline Test Coverage | [](https://lossless.cloud)
|
||||
npm | [](https://lossless.cloud)
|
||||
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)
|
||||
|
||||
## 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.
|
||||
|
||||
> MIT licensed | **©** [Lossless GmbH](https://lossless.gmbh)
|
||||
| By using this npm module you agree to our [privacy policy](https://lossless.gmbH/privacy.html)
|
||||
|
||||
[](https://maintainedby.lossless.com)
|
||||
## 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)
|
||||
|
@ -1,14 +1,14 @@
|
||||
import { expect, tap } from '@pushrocks/tapbundle';
|
||||
import * as smartmanifest from '../ts/index';
|
||||
import * as smartmanifest from '../ts/index.js';
|
||||
|
||||
let testSmartManifest: smartmanifest.SmartManifest;
|
||||
|
||||
tap.test('first test', async () => {
|
||||
testSmartManifest = new smartmanifest.SmartManifest({
|
||||
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 () => {
|
||||
|
8
ts/00_commitinfo_data.ts
Normal file
8
ts/00_commitinfo_data.ts
Normal 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'
|
||||
}
|
53
ts/index.ts
53
ts/index.ts
@ -1,20 +1,25 @@
|
||||
import * as plugins from './smartmanifest.plugins';
|
||||
import * as plugins from './smartmanifest.plugins.js';
|
||||
|
||||
export interface ISmartManifestConstructorOptions {
|
||||
name: string;
|
||||
short_name: string;
|
||||
start_url?: '/';
|
||||
display?: string;
|
||||
orientation?: string;
|
||||
display?: 'standalone';
|
||||
orientation?: 'any';
|
||||
background_color?: string;
|
||||
theme_color?: string;
|
||||
icons?: [
|
||||
{
|
||||
src: string;
|
||||
type: string;
|
||||
sizes: string;
|
||||
}
|
||||
];
|
||||
icons?: Array<{
|
||||
src: string;
|
||||
type: string;
|
||||
sizes: string;
|
||||
}>;
|
||||
related_applications?: Array<{
|
||||
platform: 'play' | string;
|
||||
id: string;
|
||||
}>;
|
||||
scope: string;
|
||||
lang: string;
|
||||
display_override: 'window-controls-overlay'[];
|
||||
}
|
||||
|
||||
const defaultConstructorOptions: ISmartManifestConstructorOptions = {
|
||||
@ -23,15 +28,29 @@ const defaultConstructorOptions: ISmartManifestConstructorOptions = {
|
||||
start_url: '/',
|
||||
display: 'standalone',
|
||||
orientation: 'any',
|
||||
background_color: '#fff',
|
||||
theme_color: '#f78f21',
|
||||
background_color: '#000000',
|
||||
theme_color: '#000000',
|
||||
icons: [
|
||||
{
|
||||
src: '/assets/icon-large.png',
|
||||
src: '/assetbroker/manifest/icon-large.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 {
|
||||
@ -39,7 +58,7 @@ export class SmartManifest {
|
||||
constructor(optionsArg: ISmartManifestConstructorOptions) {
|
||||
this.options = {
|
||||
...defaultConstructorOptions,
|
||||
...optionsArg
|
||||
...optionsArg,
|
||||
};
|
||||
}
|
||||
|
||||
|
10
tsconfig.json
Normal file
10
tsconfig.json
Normal file
@ -0,0 +1,10 @@
|
||||
{
|
||||
"compilerOptions": {
|
||||
"experimentalDecorators": true,
|
||||
"useDefineForClassFields": false,
|
||||
"target": "ES2022",
|
||||
"module": "ES2022",
|
||||
"moduleResolution": "nodenext",
|
||||
"esModuleInterop": true
|
||||
}
|
||||
}
|
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