fix(metadata): update package metadata and align company schema integration with latest tsclass types
This commit is contained in:
@@ -0,0 +1,42 @@
|
|||||||
|
{
|
||||||
|
"@ship.zone/szci": {
|
||||||
|
"npmGlobalTools": [],
|
||||||
|
"npmRegistryUrl": "registry.npmjs.org"
|
||||||
|
},
|
||||||
|
"@git.zone/cli": {
|
||||||
|
"projectType": "npm",
|
||||||
|
"module": {
|
||||||
|
"githost": "code.foss.global",
|
||||||
|
"gitscope": "push.rocks",
|
||||||
|
"gitrepo": "websetup",
|
||||||
|
"shortDescription": "web metadata setup utilities",
|
||||||
|
"description": "A library for setting up basic properties of a web page including meta tags, OpenGraph tags, JSON-LD structured data, with support for dynamic content.",
|
||||||
|
"npmPackagename": "@push.rocks/websetup",
|
||||||
|
"license": "MIT",
|
||||||
|
"keywords": [
|
||||||
|
"web development",
|
||||||
|
"SEO",
|
||||||
|
"OpenGraph",
|
||||||
|
"JSON-LD",
|
||||||
|
"meta tags",
|
||||||
|
"structured data",
|
||||||
|
"TypeScript",
|
||||||
|
"dynamic content",
|
||||||
|
"website setup",
|
||||||
|
"smart delay",
|
||||||
|
"smart promise",
|
||||||
|
"tag management"
|
||||||
|
]
|
||||||
|
},
|
||||||
|
"release": {
|
||||||
|
"registries": [
|
||||||
|
"https://verdaccio.lossless.digital",
|
||||||
|
"https://registry.npmjs.org"
|
||||||
|
],
|
||||||
|
"accessLevel": "public"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"@git.zone/tsdoc": {
|
||||||
|
"legal": "\n## License and Legal Information\n\nThis repository contains open-source code that is licensed under the MIT License. A copy of the MIT License can be found in the [license](license) file within this repository. \n\n**Please note:** The MIT License does not grant permission to use the trade names, trademarks, service marks, or product names of the project, except as required for reasonable and customary use in describing the origin of the work and reproducing the content of the NOTICE file.\n\n### Trademarks\n\nThis project is owned and maintained by Task Venture Capital GmbH. The names and logos associated with Task Venture Capital GmbH and any related products or services are trademarks of Task Venture Capital GmbH and are not included within the scope of the MIT license granted herein. Use of these trademarks must comply with Task Venture Capital GmbH's Trademark Guidelines, and any usage must be approved in writing by Task Venture Capital GmbH.\n\n### Company Information\n\nTask Venture Capital GmbH \nRegistered at District court Bremen HRB 35230 HB, Germany\n\nFor any legal inquiries or if you require further information, please contact us via email at hello@task.vc.\n\nBy using this repository, you acknowledge that you have read this section, agree to comply with its terms, and understand that the licensing of the code does not imply endorsement by Task Venture Capital GmbH of any derivative works.\n"
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,52 @@
|
|||||||
|
# Changelog
|
||||||
|
|
||||||
|
## 2026-05-01 - 3.0.20 - fix(metadata)
|
||||||
|
update package metadata and align company schema integration with latest tsclass types
|
||||||
|
|
||||||
|
- migrates build and test tooling to the @git.zone packages and adds package exports
|
||||||
|
- updates company-related metadata handling from legacy contact fields to the newer business type shape
|
||||||
|
- makes product publisher data optional and adds safer fallbacks for OpenGraph and JSON-LD tag generation
|
||||||
|
- replaces the browser test with the current chromium-based test entrypoint
|
||||||
|
|
||||||
|
## 2026-03-01 - 3.0.19 - maintenance
|
||||||
|
Repository housekeeping and metadata updates were consolidated for this release line.
|
||||||
|
|
||||||
|
- Removed `.gitlab-ci.yml`
|
||||||
|
- Updated project description
|
||||||
|
- Updated `tsconfig`
|
||||||
|
- Updated `npmextra.json` git host settings
|
||||||
|
|
||||||
|
## 2023-05-08 - 3.0.18 - core
|
||||||
|
Applied a core update as part of the 3.0.16–3.0.18 patch series.
|
||||||
|
|
||||||
|
- Summarized repeated `fix(core): update` changes across versions 3.0.16, 3.0.17, and 3.0.18
|
||||||
|
|
||||||
|
## 2021-12-10 - 3.0.15 - core
|
||||||
|
Applied a core update as part of the 3.0.0–3.0.15 patch series.
|
||||||
|
|
||||||
|
- Summarized repeated `fix(core): update` changes across versions 3.0.0 through 3.0.15
|
||||||
|
|
||||||
|
## 2020-09-22 - 3.0.0 - core
|
||||||
|
Introduced a breaking core update for the 3.0 release line.
|
||||||
|
|
||||||
|
- Breaking change from version 2.0.18 to 3.0.0 due to core update
|
||||||
|
|
||||||
|
## 2020-07-08 - 2.0.18 - core
|
||||||
|
Introduced a breaking core update for the 2.x release line.
|
||||||
|
|
||||||
|
- Breaking change from version 1.0.8 to 2.0.18 due to core update
|
||||||
|
|
||||||
|
## 2020-06-27 - 2.0.17 - core
|
||||||
|
Routine core maintenance updates were released across the 2.0.3–2.0.17 range.
|
||||||
|
|
||||||
|
- Summarized repeated `fix(core): update` changes across versions 2.0.3 through 2.0.17
|
||||||
|
|
||||||
|
## 2019-07-16 - 1.0.8 - core
|
||||||
|
Removed service worker support in a breaking core change.
|
||||||
|
|
||||||
|
- BREAKING CHANGE: remove serviceworker
|
||||||
|
|
||||||
|
## 2019-03-27 - 1.0.7 - core
|
||||||
|
Routine core maintenance updates were released across the 1.0.1–1.0.7 range.
|
||||||
|
|
||||||
|
- Summarized repeated `fix(core): update` changes across versions 1.0.1 through 1.0.7
|
||||||
@@ -1,4 +1,4 @@
|
|||||||
Copyright (c) 2018 Lossless GmbH (hello@lossless.com)
|
Copyright (c) 2026 Task Venture Capital GmbH <hello@task.vc>
|
||||||
|
|
||||||
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
|
||||||
@@ -16,4 +16,4 @@ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|||||||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||||
SOFTWARE.
|
SOFTWARE.
|
||||||
|
|||||||
+13
-5
@@ -1,14 +1,15 @@
|
|||||||
{
|
{
|
||||||
"npmci": {
|
"@ship.zone/szci": {
|
||||||
"npmGlobalTools": [],
|
"npmGlobalTools": [],
|
||||||
"npmAccessLevel": "public"
|
"npmRegistryUrl": "registry.npmjs.org"
|
||||||
},
|
},
|
||||||
"gitzone": {
|
"@git.zone/cli": {
|
||||||
"projectType": "npm",
|
"projectType": "npm",
|
||||||
"module": {
|
"module": {
|
||||||
"githost": "code.foss.global",
|
"githost": "code.foss.global",
|
||||||
"gitscope": "push.rocks",
|
"gitscope": "push.rocks",
|
||||||
"gitrepo": "websetup",
|
"gitrepo": "websetup",
|
||||||
|
"shortDescription": "web metadata setup utilities",
|
||||||
"description": "A library for setting up basic properties of a web page including meta tags, OpenGraph tags, JSON-LD structured data, with support for dynamic content.",
|
"description": "A library for setting up basic properties of a web page including meta tags, OpenGraph tags, JSON-LD structured data, with support for dynamic content.",
|
||||||
"npmPackagename": "@push.rocks/websetup",
|
"npmPackagename": "@push.rocks/websetup",
|
||||||
"license": "MIT",
|
"license": "MIT",
|
||||||
@@ -26,9 +27,16 @@
|
|||||||
"smart promise",
|
"smart promise",
|
||||||
"tag management"
|
"tag management"
|
||||||
]
|
]
|
||||||
|
},
|
||||||
|
"release": {
|
||||||
|
"registries": [
|
||||||
|
"https://verdaccio.lossless.digital",
|
||||||
|
"https://registry.npmjs.org"
|
||||||
|
],
|
||||||
|
"accessLevel": "public"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"tsdoc": {
|
"@git.zone/tsdoc": {
|
||||||
"legal": "\n## License and Legal Information\n\nThis repository contains open-source code that is licensed under the MIT License. A copy of the MIT License can be found in the [license](license) file within this repository. \n\n**Please note:** The MIT License does not grant permission to use the trade names, trademarks, service marks, or product names of the project, except as required for reasonable and customary use in describing the origin of the work and reproducing the content of the NOTICE file.\n\n### Trademarks\n\nThis project is owned and maintained by Task Venture Capital GmbH. The names and logos associated with Task Venture Capital GmbH and any related products or services are trademarks of Task Venture Capital GmbH and are not included within the scope of the MIT license granted herein. Use of these trademarks must comply with Task Venture Capital GmbH's Trademark Guidelines, and any usage must be approved in writing by Task Venture Capital GmbH.\n\n### Company Information\n\nTask Venture Capital GmbH \nRegistered at District court Bremen HRB 35230 HB, Germany\n\nFor any legal inquiries or if you require further information, please contact us via email at hello@task.vc.\n\nBy using this repository, you acknowledge that you have read this section, agree to comply with its terms, and understand that the licensing of the code does not imply endorsement by Task Venture Capital GmbH of any derivative works.\n"
|
"legal": "\n## License and Legal Information\n\nThis repository contains open-source code that is licensed under the MIT License. A copy of the MIT License can be found in the [license](license) file within this repository. \n\n**Please note:** The MIT License does not grant permission to use the trade names, trademarks, service marks, or product names of the project, except as required for reasonable and customary use in describing the origin of the work and reproducing the content of the NOTICE file.\n\n### Trademarks\n\nThis project is owned and maintained by Task Venture Capital GmbH. The names and logos associated with Task Venture Capital GmbH and any related products or services are trademarks of Task Venture Capital GmbH and are not included within the scope of the MIT license granted herein. Use of these trademarks must comply with Task Venture Capital GmbH's Trademark Guidelines, and any usage must be approved in writing by Task Venture Capital GmbH.\n\n### Company Information\n\nTask Venture Capital GmbH \nRegistered at District court Bremen HRB 35230 HB, Germany\n\nFor any legal inquiries or if you require further information, please contact us via email at hello@task.vc.\n\nBy using this repository, you acknowledge that you have read this section, agree to comply with its terms, and understand that the licensing of the code does not imply endorsement by Task Venture Capital GmbH of any derivative works.\n"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
+15
-11
@@ -3,13 +3,16 @@
|
|||||||
"version": "3.0.19",
|
"version": "3.0.19",
|
||||||
"private": false,
|
"private": false,
|
||||||
"description": "A library for setting up basic properties of a web page including meta tags, OpenGraph tags, JSON-LD structured data, with support for dynamic content.",
|
"description": "A library for setting up basic properties of a web page including meta tags, OpenGraph tags, JSON-LD structured data, with support for dynamic content.",
|
||||||
|
"exports": {
|
||||||
|
".": "./dist_ts/index.js"
|
||||||
|
},
|
||||||
"main": "dist_ts/index.js",
|
"main": "dist_ts/index.js",
|
||||||
"typings": "dist_ts/index.d.ts",
|
"typings": "dist_ts/index.d.ts",
|
||||||
"author": "Lossless GmbH",
|
"author": "Task Venture Capital GmbH <hello@task.vc>",
|
||||||
"license": "MIT",
|
"license": "MIT",
|
||||||
"scripts": {
|
"scripts": {
|
||||||
"test": "(tstest test/)",
|
"test": "tstest test/",
|
||||||
"build": "(tsbuild --web --allowimplicitany && tsbundle npm)",
|
"build": "tsbuild --web && tsbundle npm",
|
||||||
"buildDocs": "tsdoc"
|
"buildDocs": "tsdoc"
|
||||||
},
|
},
|
||||||
"keywords": [
|
"keywords": [
|
||||||
@@ -27,15 +30,14 @@
|
|||||||
"tag management"
|
"tag management"
|
||||||
],
|
],
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
"@gitzone/tsbuild": "^2.1.65",
|
"@git.zone/tsbuild": "^4.4.0",
|
||||||
"@gitzone/tsbundle": "^2.0.7",
|
"@git.zone/tsbundle": "^2.10.1",
|
||||||
"@gitzone/tstest": "^1.0.74",
|
"@git.zone/tstest": "^3.6.3",
|
||||||
"@pushrocks/tapbundle": "^5.0.4"
|
"@types/node": "^25.6.0"
|
||||||
},
|
},
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@pushrocks/smartdelay": "^3.0.1",
|
"@push.rocks/smartpromise": "^4.2.4",
|
||||||
"@pushrocks/smartpromise": "^4.0.2",
|
"@tsclass/tsclass": "^9.5.1"
|
||||||
"@tsclass/tsclass": "^4.0.41"
|
|
||||||
},
|
},
|
||||||
"files": [
|
"files": [
|
||||||
"ts/**/*",
|
"ts/**/*",
|
||||||
@@ -46,6 +48,8 @@
|
|||||||
"dist_ts_web/**/*",
|
"dist_ts_web/**/*",
|
||||||
"assets/**/*",
|
"assets/**/*",
|
||||||
"cli.js",
|
"cli.js",
|
||||||
|
".smartconfig.json",
|
||||||
|
"license",
|
||||||
"npmextra.json",
|
"npmextra.json",
|
||||||
"readme.md"
|
"readme.md"
|
||||||
],
|
],
|
||||||
@@ -58,4 +62,4 @@
|
|||||||
"type": "git",
|
"type": "git",
|
||||||
"url": "https://code.foss.global/push.rocks/websetup.git"
|
"url": "https://code.foss.global/push.rocks/websetup.git"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Generated
+6928
-3836
File diff suppressed because it is too large
Load Diff
@@ -1,5 +1,4 @@
|
|||||||
import { expect, tap, webhelpers } from '@pushrocks/tapbundle';
|
import { expect, tap } from '@git.zone/tstest/tapbundle';
|
||||||
webhelpers.enable();
|
|
||||||
|
|
||||||
import * as websetup from '../ts/index.js';
|
import * as websetup from '../ts/index.js';
|
||||||
|
|
||||||
@@ -15,4 +14,4 @@ tap.test('first test', async () => {
|
|||||||
expect(document.title).toEqual('mytitle');
|
expect(document.title).toEqual('mytitle');
|
||||||
});
|
});
|
||||||
|
|
||||||
tap.start();
|
export default tap.start();
|
||||||
@@ -1,8 +1,8 @@
|
|||||||
/**
|
/**
|
||||||
* autocreated commitinfo by @pushrocks/commitinfo
|
* autocreated commitinfo by @push.rocks/commitinfo
|
||||||
*/
|
*/
|
||||||
export const commitinfo = {
|
export const commitinfo = {
|
||||||
name: '@pushrocks/websetup',
|
name: '@push.rocks/websetup',
|
||||||
version: '3.0.19',
|
version: '3.0.20',
|
||||||
description: 'setup basic page properties'
|
description: 'A library for setting up basic properties of a web page including meta tags, OpenGraph tags, JSON-LD structured data, with support for dynamic content.'
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -3,7 +3,7 @@ export interface IMetaObject {
|
|||||||
title: string;
|
title: string;
|
||||||
description?: string;
|
description?: string;
|
||||||
canonicalDomain?: string;
|
canonicalDomain?: string;
|
||||||
ldCompany?: plugins.tsclass.business.ICompany;
|
ldCompany?: plugins.tsclass.business.TCompany;
|
||||||
ldProduct?: plugins.tsclass.saas.IProduct;
|
ldProduct?: plugins.tsclass.saas.IProduct;
|
||||||
|
|
||||||
// handles
|
// handles
|
||||||
|
|||||||
@@ -4,7 +4,7 @@ import * as interfaces from './interfaces/index.js';
|
|||||||
import { Tag } from './websetup.classes.tag.js';
|
import { Tag } from './websetup.classes.tag.js';
|
||||||
|
|
||||||
export class JsonLdTag extends Tag {
|
export class JsonLdTag extends Tag {
|
||||||
public static createCompanyJsonLd(companyDataArg: plugins.tsclass.business.ICompany) {
|
public static createCompanyJsonLd(companyDataArg: plugins.tsclass.business.TCompany) {
|
||||||
// STATIC
|
// STATIC
|
||||||
// lets care about linked data
|
// lets care about linked data
|
||||||
const companyLd = {
|
const companyLd = {
|
||||||
@@ -12,24 +12,26 @@ export class JsonLdTag extends Tag {
|
|||||||
'@type': 'Corporation',
|
'@type': 'Corporation',
|
||||||
name: companyDataArg.name,
|
name: companyDataArg.name,
|
||||||
alternateName: companyDataArg.name.replace(' GmbH', ''),
|
alternateName: companyDataArg.name.replace(' GmbH', ''),
|
||||||
url: companyDataArg.contact.website,
|
url: companyDataArg.website,
|
||||||
logo: companyDataArg.contact.logoUrl,
|
logo: companyDataArg.logoUrl,
|
||||||
contactPoint: {
|
contactPoint: {
|
||||||
'@type': 'ContactPoint',
|
'@type': 'ContactPoint',
|
||||||
telephone: companyDataArg.contact.phone,
|
telephone: companyDataArg.phone,
|
||||||
contactType: 'customer service',
|
contactType: 'customer service',
|
||||||
areaServed: 'DE',
|
areaServed: 'DE',
|
||||||
availableLanguage: ['en', 'German'],
|
availableLanguage: ['en', 'German'],
|
||||||
},
|
},
|
||||||
sameAs: [],
|
sameAs: [] as string[],
|
||||||
};
|
};
|
||||||
|
|
||||||
if (companyDataArg.contact.facebookUrl) {
|
const facebookUrl = companyDataArg.socials?.find((socialArg) => socialArg.type === 'facebook')?.url;
|
||||||
companyLd.sameAs.push(companyDataArg.contact.facebookUrl);
|
if (facebookUrl) {
|
||||||
|
companyLd.sameAs.push(facebookUrl);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (companyDataArg.contact.twitterUrl) {
|
const twitterUrl = companyDataArg.socials?.find((socialArg) => socialArg.type === 'twitter')?.url;
|
||||||
companyLd.sameAs.push(companyDataArg.contact.twitterUrl);
|
if (twitterUrl) {
|
||||||
|
companyLd.sameAs.push(twitterUrl);
|
||||||
}
|
}
|
||||||
|
|
||||||
const ldTag = new JsonLdTag(companyLd);
|
const ldTag = new JsonLdTag(companyLd);
|
||||||
@@ -67,7 +69,7 @@ export class JsonLdTag extends Tag {
|
|||||||
}
|
}
|
||||||
public static createProductJsonLd(
|
public static createProductJsonLd(
|
||||||
productArg: plugins.tsclass.saas.IProduct,
|
productArg: plugins.tsclass.saas.IProduct,
|
||||||
publisherArg: plugins.tsclass.business.ICompany
|
publisherArg?: plugins.tsclass.business.TCompany
|
||||||
) {
|
) {
|
||||||
const productLd = {
|
const productLd = {
|
||||||
'@context': 'https://schema.org',
|
'@context': 'https://schema.org',
|
||||||
@@ -87,7 +89,7 @@ export class JsonLdTag extends Tag {
|
|||||||
priceCurrency: 'EUR',
|
priceCurrency: 'EUR',
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
publisher: this.createCompanyJsonLd(publisherArg).elementRef.textContent,
|
publisher: publisherArg ? this.createCompanyJsonLd(publisherArg).elementRef.textContent : undefined,
|
||||||
screenshot: 'https://www.social.io/screenshot.png',
|
screenshot: 'https://www.social.io/screenshot.png',
|
||||||
url: 'https://www.social.io/',
|
url: 'https://www.social.io/',
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -3,9 +3,7 @@ import { Tag } from './websetup.classes.tag.js';
|
|||||||
export class LinkTag extends Tag {
|
export class LinkTag extends Tag {
|
||||||
constructor(relArg: string, hrefArg: string) {
|
constructor(relArg: string, hrefArg: string) {
|
||||||
super();
|
super();
|
||||||
const linkElement = !!document.querySelector("link[rel='canonical']")
|
const linkElement = document.querySelector("link[rel='canonical']") ?? document.createElement('link');
|
||||||
? document.querySelector("link[rel='canonical']")
|
|
||||||
: document.createElement('link');
|
|
||||||
linkElement.setAttribute('rel', relArg);
|
linkElement.setAttribute('rel', relArg);
|
||||||
linkElement.setAttribute('href', hrefArg);
|
linkElement.setAttribute('href', hrefArg);
|
||||||
this.elementRef = linkElement;
|
this.elementRef = linkElement;
|
||||||
|
|||||||
@@ -4,10 +4,10 @@ import { Tag } from './websetup.classes.tag.js';
|
|||||||
export class OpengraphTag extends Tag {
|
export class OpengraphTag extends Tag {
|
||||||
public static createNewsArticleOgTags(newsArticleArg: plugins.tsclass.content.IArticle) {
|
public static createNewsArticleOgTags(newsArticleArg: plugins.tsclass.content.IArticle) {
|
||||||
const tagArray: OpengraphTag[] = [];
|
const tagArray: OpengraphTag[] = [];
|
||||||
tagArray.push(new OpengraphTag('og:url', newsArticleArg.url));
|
tagArray.push(new OpengraphTag('og:url', newsArticleArg.url ?? globalThis.location.href));
|
||||||
tagArray.push(new OpengraphTag('og:title', newsArticleArg.title));
|
tagArray.push(new OpengraphTag('og:title', newsArticleArg.title));
|
||||||
tagArray.push(new OpengraphTag('og:description', newsArticleArg.content));
|
tagArray.push(new OpengraphTag('og:description', newsArticleArg.content));
|
||||||
tagArray.push(new OpengraphTag('og:image', newsArticleArg.featuredImageUrl));
|
tagArray.push(new OpengraphTag('og:image', newsArticleArg.featuredImageUrl ?? ''));
|
||||||
return tagArray;
|
return tagArray;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -16,20 +16,20 @@ export class OpengraphTag extends Tag {
|
|||||||
tagArray.push(new OpengraphTag('og:type', 'product'));
|
tagArray.push(new OpengraphTag('og:type', 'product'));
|
||||||
tagArray.push(new OpengraphTag('og:url', globalThis.location.href));
|
tagArray.push(new OpengraphTag('og:url', globalThis.location.href));
|
||||||
tagArray.push(new OpengraphTag('og:title', `${productArg.name} - ${productArg.slogan}`));
|
tagArray.push(new OpengraphTag('og:title', `${productArg.name} - ${productArg.slogan}`));
|
||||||
tagArray.push(new OpengraphTag('og:site_name', productArg.name))
|
tagArray.push(new OpengraphTag('og:site_name', productArg.name));
|
||||||
tagArray.push(new OpengraphTag('og:description', productArg.description));
|
tagArray.push(new OpengraphTag('og:description', productArg.description));
|
||||||
tagArray.push(new OpengraphTag('og:image', productArg.logoLink));
|
tagArray.push(new OpengraphTag('og:image', productArg.logoLink));
|
||||||
return tagArray;
|
return tagArray;
|
||||||
}
|
}
|
||||||
|
|
||||||
public static createCompanyOgTags(companyArg: plugins.tsclass.business.ICompany) {
|
public static createCompanyOgTags(companyArg: plugins.tsclass.business.TCompany) {
|
||||||
const tagArray: OpengraphTag[] = [];
|
const tagArray: OpengraphTag[] = [];
|
||||||
tagArray.push(new OpengraphTag('og:type', 'company'));
|
tagArray.push(new OpengraphTag('og:type', 'company'));
|
||||||
tagArray.push(new OpengraphTag('og:url', globalThis.location.href));
|
tagArray.push(new OpengraphTag('og:url', globalThis.location.href));
|
||||||
tagArray.push(new OpengraphTag('og:title', `${companyArg.name} - ${companyArg.slogan}`));
|
tagArray.push(new OpengraphTag('og:title', companyArg.name));
|
||||||
tagArray.push(new OpengraphTag('og:site_name', companyArg.name))
|
tagArray.push(new OpengraphTag('og:site_name', companyArg.name));
|
||||||
tagArray.push(new OpengraphTag('og:description', companyArg.description));
|
tagArray.push(new OpengraphTag('og:description', companyArg.description));
|
||||||
tagArray.push(new OpengraphTag('og:image', companyArg.logoLink));
|
tagArray.push(new OpengraphTag('og:image', companyArg.logoUrl ?? ''));
|
||||||
return tagArray;
|
return tagArray;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -1,9 +1,9 @@
|
|||||||
import * as plugins from './websetup.plugins.js';
|
import * as plugins from './websetup.plugins.js';
|
||||||
|
|
||||||
export class Tag {
|
export class Tag {
|
||||||
public elementRef: Element;
|
public elementRef!: Element;
|
||||||
|
|
||||||
public tagLevel: 'global' | 'levelbound';
|
public tagLevel: 'global' | 'levelbound' = 'levelbound';
|
||||||
|
|
||||||
public appendToDom() {
|
public appendToDom() {
|
||||||
if (!this.elementRef.parentElement && !this.elementRef.parentNode) {
|
if (!this.elementRef.parentElement && !this.elementRef.parentNode) {
|
||||||
|
|||||||
@@ -11,14 +11,14 @@ export type TLevelState = 'enabled' | 'disabled';
|
|||||||
export class TagLevel {
|
export class TagLevel {
|
||||||
public tagManagerRef: TagManager;
|
public tagManagerRef: TagManager;
|
||||||
|
|
||||||
private titleStore: string;
|
private titleStore?: string;
|
||||||
public set title(titleArg: string) {
|
public set title(titleArg: string) {
|
||||||
this.titleStore = titleArg;
|
this.titleStore = titleArg;
|
||||||
if (this.state === 'enabled') {
|
if (this.state === 'enabled') {
|
||||||
document.title = this.titleStore;
|
document.title = this.titleStore;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
public get title() {
|
public get title(): string | undefined {
|
||||||
return this.titleStore;
|
return this.titleStore;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -29,6 +29,7 @@ export class TagLevel {
|
|||||||
|
|
||||||
constructor(tagManagerRefArg: TagManager, levelType: TBaseLevelType) {
|
constructor(tagManagerRefArg: TagManager, levelType: TBaseLevelType) {
|
||||||
this.tagManagerRef = tagManagerRefArg;
|
this.tagManagerRef = tagManagerRefArg;
|
||||||
|
this.type = levelType;
|
||||||
}
|
}
|
||||||
|
|
||||||
public addTag(tagArg: Tag | Tag[]) {
|
public addTag(tagArg: Tag | Tag[]) {
|
||||||
@@ -44,34 +45,34 @@ export class TagLevel {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public async addCompanyInfo(companyDataArg: plugins.tsclass.business.ICompany) {
|
public async addCompanyInfo(companyDataArg: plugins.tsclass.business.TCompany) {
|
||||||
this.addTag(JsonLdTag.createCompanyJsonLd(companyDataArg));
|
this.addTag(JsonLdTag.createCompanyJsonLd(companyDataArg));
|
||||||
|
|
||||||
// lets care about open graph
|
// lets care about open graph
|
||||||
this.addTag(new OpengraphTag('og:type', 'business.business'));
|
this.addTag(new OpengraphTag('og:type', 'business.business'));
|
||||||
this.addTag(new OpengraphTag('og:title', companyDataArg.name));
|
this.addTag(new OpengraphTag('og:title', companyDataArg.name));
|
||||||
this.addTag(new OpengraphTag('og:url', companyDataArg.contact.website));
|
this.addTag(new OpengraphTag('og:url', companyDataArg.website ?? ''));
|
||||||
this.addTag(new OpengraphTag('og:image', companyDataArg.contact.logoUrl));
|
this.addTag(new OpengraphTag('og:image', companyDataArg.logoUrl ?? ''));
|
||||||
this.addTag(
|
this.addTag(
|
||||||
new OpengraphTag(
|
new OpengraphTag(
|
||||||
'business:contact_data:street_address',
|
'business:contact_data:street_address',
|
||||||
`${companyDataArg.contact.address.streetName} ${companyDataArg.contact.address.houseNumber}`
|
`${companyDataArg.address.streetName} ${companyDataArg.address.houseNumber}`
|
||||||
)
|
)
|
||||||
);
|
);
|
||||||
this.addTag(
|
this.addTag(
|
||||||
new OpengraphTag('business:contact_data:locality', companyDataArg.contact.address.postalCode)
|
new OpengraphTag('business:contact_data:locality', companyDataArg.address.postalCode)
|
||||||
);
|
);
|
||||||
this.addTag(
|
this.addTag(
|
||||||
new OpengraphTag('business:contact_data:region', companyDataArg.contact.address.city)
|
new OpengraphTag('business:contact_data:region', companyDataArg.address.city)
|
||||||
);
|
);
|
||||||
this.addTag(
|
this.addTag(
|
||||||
new OpengraphTag(
|
new OpengraphTag(
|
||||||
'business:contact_data:postal_code',
|
'business:contact_data:postal_code',
|
||||||
companyDataArg.contact.address.postalCode
|
companyDataArg.address.postalCode
|
||||||
)
|
)
|
||||||
);
|
);
|
||||||
this.addTag(
|
this.addTag(
|
||||||
new OpengraphTag('business:contact_data:country_name', companyDataArg.contact.address.country)
|
new OpengraphTag('business:contact_data:country_name', companyDataArg.address.country)
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -80,7 +81,7 @@ export class TagLevel {
|
|||||||
this.addTag(OpengraphTag.createNewsArticleOgTags(articleArg));
|
this.addTag(OpengraphTag.createNewsArticleOgTags(articleArg));
|
||||||
}
|
}
|
||||||
|
|
||||||
public addProductInfo(productArg: plugins.tsclass.saas.IProduct, companyArg: plugins.tsclass.business.ICompany) {
|
public addProductInfo(productArg: plugins.tsclass.saas.IProduct, companyArg?: plugins.tsclass.business.TCompany) {
|
||||||
this.addTag(JsonLdTag.createProductJsonLd(productArg, companyArg));
|
this.addTag(JsonLdTag.createProductJsonLd(productArg, companyArg));
|
||||||
this.addTag(OpengraphTag.createProductOgTags(productArg));
|
this.addTag(OpengraphTag.createProductOgTags(productArg));
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -10,7 +10,7 @@ export class TagManager {
|
|||||||
|
|
||||||
public baseLevel: TagLevel = new TagLevel(this, 'base');
|
public baseLevel: TagLevel = new TagLevel(this, 'base');
|
||||||
|
|
||||||
public activeLevel: TagLevel;
|
public activeLevel!: TagLevel;
|
||||||
|
|
||||||
public async setup(metaObjectArg: interfaces.IMetaObject) {
|
public async setup(metaObjectArg: interfaces.IMetaObject) {
|
||||||
// global tag level
|
// global tag level
|
||||||
|
|||||||
@@ -1,8 +1,7 @@
|
|||||||
// pushrocks scope
|
// pushrocks scope
|
||||||
import * as smartdelay from '@pushrocks/smartdelay';
|
import * as smartpromise from '@push.rocks/smartpromise';
|
||||||
import * as smartpromise from '@pushrocks/smartpromise';
|
|
||||||
|
|
||||||
export { smartdelay, smartpromise };
|
export { smartpromise };
|
||||||
|
|
||||||
// tsclass scope
|
// tsclass scope
|
||||||
import * as tsclass from '@tsclass/tsclass';
|
import * as tsclass from '@tsclass/tsclass';
|
||||||
|
|||||||
+3
-1
@@ -5,8 +5,10 @@
|
|||||||
"target": "ES2022",
|
"target": "ES2022",
|
||||||
"module": "NodeNext",
|
"module": "NodeNext",
|
||||||
"moduleResolution": "NodeNext",
|
"moduleResolution": "NodeNext",
|
||||||
|
"noImplicitAny": true,
|
||||||
"esModuleInterop": true,
|
"esModuleInterop": true,
|
||||||
"verbatimModuleSyntax": true
|
"verbatimModuleSyntax": true,
|
||||||
|
"types": ["node"]
|
||||||
},
|
},
|
||||||
"exclude": [
|
"exclude": [
|
||||||
"dist_*/**/*.d.ts"
|
"dist_*/**/*.d.ts"
|
||||||
|
|||||||
Reference in New Issue
Block a user