mirror of
https://github.com/dzeiocom/libs.git
synced 2025-04-22 02:42:13 +00:00
feat: add support for easy-sitemap for ESM and CJS
Some checks failed
CodeQL / Analyze (javascript) (push) Failing after 2m18s
Some checks failed
CodeQL / Analyze (javascript) (push) Failing after 2m18s
Signed-off-by: Avior <github@avior.me>
This commit is contained in:
parent
df43d5c2c0
commit
2f1e72d77b
@ -7,6 +7,12 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
|
||||
|
||||
## [Unreleased]()
|
||||
|
||||
## [1.2.0] - 2023-08-16
|
||||
|
||||
### Added
|
||||
|
||||
- Full support for both ESM and CommonJS builds
|
||||
|
||||
## [1.1.0] - 2021-03-16
|
||||
|
||||
### Added
|
||||
|
@ -1,19 +1,19 @@
|
||||
// Jest Snapshot v1, https://goo.gl/fbAQLP
|
||||
|
||||
exports[`Basic Sitemap Tests should not add changefreq if value is incorrect 1`] = `"<?xml version=\\"1.0\\" encoding=\\"UTF-8\\"?><urlset xmlns=\\"http://www.sitemaps.org/schemas/sitemap/0.9\\" xmlns:image=\\"http://www.google.com/schemas/sitemap-image/1.1\\"><url><loc>https://www.example.com/path</loc></url></urlset>"`;
|
||||
exports[`Basic Sitemap Tests should not add changefreq if value is incorrect 1`] = `"<?xml version="1.0" encoding="UTF-8"?><urlset xmlns="http://www.sitemaps.org/schemas/sitemap/0.9" xmlns:image="http://www.google.com/schemas/sitemap-image/1.1"><url><loc>https://www.example.com/path</loc></url></urlset>"`;
|
||||
|
||||
exports[`Basic Sitemap Tests should not add priority when it is incorrect 1`] = `"<?xml version=\\"1.0\\" encoding=\\"UTF-8\\"?><urlset xmlns=\\"http://www.sitemaps.org/schemas/sitemap/0.9\\" xmlns:image=\\"http://www.google.com/schemas/sitemap-image/1.1\\"><url><loc>https://www.example.com/path</loc></url></urlset>"`;
|
||||
exports[`Basic Sitemap Tests should not add priority when it is incorrect 1`] = `"<?xml version="1.0" encoding="UTF-8"?><urlset xmlns="http://www.sitemaps.org/schemas/sitemap/0.9" xmlns:image="http://www.google.com/schemas/sitemap-image/1.1"><url><loc>https://www.example.com/path</loc></url></urlset>"`;
|
||||
|
||||
exports[`Basic Sitemap Tests should return a basic sitemap 1`] = `"<?xml version=\\"1.0\\" encoding=\\"UTF-8\\"?><urlset xmlns=\\"http://www.sitemaps.org/schemas/sitemap/0.9\\" xmlns:image=\\"http://www.google.com/schemas/sitemap-image/1.1\\"><url><loc>https://www.example.com/path</loc></url><url><loc>https://www.example.com/</loc></url></urlset>"`;
|
||||
exports[`Basic Sitemap Tests should return a basic sitemap 1`] = `"<?xml version="1.0" encoding="UTF-8"?><urlset xmlns="http://www.sitemaps.org/schemas/sitemap/0.9" xmlns:image="http://www.google.com/schemas/sitemap-image/1.1"><url><loc>https://www.example.com/path</loc></url><url><loc>https://www.example.com/</loc></url></urlset>"`;
|
||||
|
||||
exports[`Basic Sitemap Tests should return a sitemap 1`] = `"<?xml version=\\"1.0\\" encoding=\\"UTF-8\\"?><urlset xmlns=\\"http://www.sitemaps.org/schemas/sitemap/0.9\\" xmlns:image=\\"http://www.google.com/schemas/sitemap-image/1.1\\"><url><loc>https://www.example.com/path</loc><changefreq>always</changefreq><lastmod>2021-01-20T00:00:00.000Z</lastmod><priority>1</priority></url><url><loc>https://www.example.com/</loc></url></urlset>"`;
|
||||
exports[`Basic Sitemap Tests should return a sitemap 1`] = `"<?xml version="1.0" encoding="UTF-8"?><urlset xmlns="http://www.sitemaps.org/schemas/sitemap/0.9" xmlns:image="http://www.google.com/schemas/sitemap-image/1.1"><url><loc>https://www.example.com/path</loc><changefreq>always</changefreq><lastmod>2021-01-20T00:00:00.000Z</lastmod><priority>1</priority></url><url><loc>https://www.example.com/</loc></url></urlset>"`;
|
||||
|
||||
exports[`Basic Sitemap Tests should return an empty sitemap 1`] = `"<?xml version=\\"1.0\\" encoding=\\"UTF-8\\"?><urlset xmlns=\\"http://www.sitemaps.org/schemas/sitemap/0.9\\" xmlns:image=\\"http://www.google.com/schemas/sitemap-image/1.1\\"></urlset>"`;
|
||||
exports[`Basic Sitemap Tests should return an empty sitemap 1`] = `"<?xml version="1.0" encoding="UTF-8"?><urlset xmlns="http://www.sitemaps.org/schemas/sitemap/0.9" xmlns:image="http://www.google.com/schemas/sitemap-image/1.1"></urlset>"`;
|
||||
|
||||
exports[`image:image tests should build corretcly with multiple image:image 1`] = `"<?xml version=\\"1.0\\" encoding=\\"UTF-8\\"?><urlset xmlns=\\"http://www.sitemaps.org/schemas/sitemap/0.9\\" xmlns:image=\\"http://www.google.com/schemas/sitemap-image/1.1\\"><url><loc>https://www.example.com/path</loc><image:image><image:loc>https://www.example.com/test</image:loc><image:caption>Image Caption</image:caption><image:geo_location>Nantes</image:geo_location><image:title>Title</image:title><image:license>Example license url</image:license></image:image><image:image><image:loc>https://www.example.com/test-2</image:loc><image:caption>Image Caption2</image:caption><image:geo_location>Paris</image:geo_location><image:title>Title2</image:title><image:license>Example license url</image:license></image:image></url></urlset>"`;
|
||||
exports[`image:image tests should build corretcly with multiple image:image 1`] = `"<?xml version="1.0" encoding="UTF-8"?><urlset xmlns="http://www.sitemaps.org/schemas/sitemap/0.9" xmlns:image="http://www.google.com/schemas/sitemap-image/1.1"><url><loc>https://www.example.com/path</loc><image:image><image:loc>https://www.example.com/test</image:loc><image:caption>Image Caption</image:caption><image:geo_location>Nantes</image:geo_location><image:title>Title</image:title><image:license>Example license url</image:license></image:image><image:image><image:loc>https://www.example.com/test-2</image:loc><image:caption>Image Caption2</image:caption><image:geo_location>Paris</image:geo_location><image:title>Title2</image:title><image:license>Example license url</image:license></image:image></url></urlset>"`;
|
||||
|
||||
exports[`image:image tests should build corretcly with single image:image 1`] = `"<?xml version=\\"1.0\\" encoding=\\"UTF-8\\"?><urlset xmlns=\\"http://www.sitemaps.org/schemas/sitemap/0.9\\" xmlns:image=\\"http://www.google.com/schemas/sitemap-image/1.1\\"><url><loc>https://www.example.com/path</loc><image:image><image:loc>https://www.example.com/test</image:loc><image:caption>Image Caption</image:caption><image:geo_location>Nantes</image:geo_location><image:title>Title</image:title><image:license>Example license url</image:license></image:image></url></urlset>"`;
|
||||
exports[`image:image tests should build corretcly with single image:image 1`] = `"<?xml version="1.0" encoding="UTF-8"?><urlset xmlns="http://www.sitemaps.org/schemas/sitemap/0.9" xmlns:image="http://www.google.com/schemas/sitemap-image/1.1"><url><loc>https://www.example.com/path</loc><image:image><image:loc>https://www.example.com/test</image:loc><image:caption>Image Caption</image:caption><image:geo_location>Nantes</image:geo_location><image:title>Title</image:title><image:license>Example license url</image:license></image:image></url></urlset>"`;
|
||||
|
||||
exports[`image:image tests should skip image:image if no location is set 1`] = `"<?xml version=\\"1.0\\" encoding=\\"UTF-8\\"?><urlset xmlns=\\"http://www.sitemaps.org/schemas/sitemap/0.9\\" xmlns:image=\\"http://www.google.com/schemas/sitemap-image/1.1\\"><url><loc>https://www.example.com/path</loc></url></urlset>"`;
|
||||
exports[`image:image tests should skip image:image if no location is set 1`] = `"<?xml version="1.0" encoding="UTF-8"?><urlset xmlns="http://www.sitemaps.org/schemas/sitemap/0.9" xmlns:image="http://www.google.com/schemas/sitemap-image/1.1"><url><loc>https://www.example.com/path</loc></url></urlset>"`;
|
||||
|
||||
exports[`image:image tests should skip image:image if there is more than 1000 images 1`] = `"<?xml version=\\"1.0\\" encoding=\\"UTF-8\\"?><urlset xmlns=\\"http://www.sitemaps.org/schemas/sitemap/0.9\\" xmlns:image=\\"http://www.google.com/schemas/sitemap-image/1.1\\"><url><loc>https://www.example.com/path</loc></url></urlset>"`;
|
||||
exports[`image:image tests should skip image:image if there is more than 1000 images 1`] = `"<?xml version="1.0" encoding="UTF-8"?><urlset xmlns="http://www.sitemaps.org/schemas/sitemap/0.9" xmlns:image="http://www.google.com/schemas/sitemap-image/1.1"><url><loc>https://www.example.com/path</loc></url></urlset>"`;
|
||||
|
7984
packages/easy-sitemap/package-lock.json
generated
7984
packages/easy-sitemap/package-lock.json
generated
File diff suppressed because it is too large
Load Diff
@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "easy-sitemap",
|
||||
"version": "1.1.2",
|
||||
"version": "1.2.0",
|
||||
"description": "A very easy sitemap maker library",
|
||||
"repository": {
|
||||
"type": "git",
|
||||
@ -10,11 +10,27 @@
|
||||
"homepage": "https://github.com/dzeiocom/libs/tree/master/packages/easy-sitemap#readme",
|
||||
"author": "Aviortheking",
|
||||
"license": "MIT",
|
||||
"files": [
|
||||
"dist"
|
||||
],
|
||||
"main": "./dist/Sitemap.js",
|
||||
"module": "./dist/Sitemap.mjs",
|
||||
"types": "./dist/Sitemap.d.ts",
|
||||
"exports": {
|
||||
".": {
|
||||
"require": {
|
||||
"types": "./dist/Sitemap.d.ts",
|
||||
"default": "./dist/Sitemap.js"
|
||||
},
|
||||
"import": {
|
||||
"types": "./dist/Sitemap.d.mts",
|
||||
"default": "./dist/Sitemap.mjs"
|
||||
}
|
||||
}
|
||||
},
|
||||
"scripts": {
|
||||
"prepublishOnly": "yarn build",
|
||||
"build": "tsc",
|
||||
"prepublishOnly": "npm run build",
|
||||
"build": "tsup ./src/Sitemap.ts --format cjs,esm --dts --clean",
|
||||
"test": "jest --coverage"
|
||||
},
|
||||
"keywords": [
|
||||
@ -25,5 +41,13 @@
|
||||
"generator",
|
||||
"SEO",
|
||||
"search-engine"
|
||||
]
|
||||
],
|
||||
"devDependencies": {
|
||||
"@types/jest": "^29",
|
||||
"jest": "^29",
|
||||
"jest-sonar-reporter": "^2.0.0",
|
||||
"ts-jest": "^29.1.1",
|
||||
"tsup": "^7",
|
||||
"typescript": "^5"
|
||||
}
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user