@zubyjs/sitemap 1.0.79 → 1.0.81

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (3) hide show
  1. package/index.d.ts +1 -1
  2. package/index.js +9 -9
  3. package/package.json +39 -38
package/index.d.ts CHANGED
@@ -1,4 +1,4 @@
1
- import { ZubyPlugin } from 'zuby/types.js';
1
+ import type { ZubyPlugin } from 'zuby/types.js';
2
2
  export interface SitemapPluginOptions {
3
3
  /**
4
4
  * The filter function that filters the paths that should be included in the sitemap.
package/index.js CHANGED
@@ -38,33 +38,33 @@ export default ({ filter = () => true, customPaths = [], entryLimit = 45000, fil
38
38
  };
39
39
  const paths = new Set(customPaths);
40
40
  if (includePrerendered) {
41
- prerenderPaths.forEach(path => paths.add(normalizePath(path)));
41
+ prerenderPaths.forEach((path) => paths.add(normalizePath(path)));
42
42
  }
43
43
  if (includePages) {
44
44
  const pageStaticPaths = templates
45
45
  ?.filter(({ templateType, pathType }) => {
46
- return templateType === TEMPLATES.page && pathType == PATH_TYPES.static;
46
+ return templateType === TEMPLATES.page && pathType === PATH_TYPES.static;
47
47
  })
48
48
  .map(({ path }) => path);
49
- pageStaticPaths.forEach(path => paths.add(normalizePath(path)));
49
+ pageStaticPaths.forEach((path) => paths.add(normalizePath(path)));
50
50
  }
51
51
  if (includeHandlers) {
52
52
  const handlerStaticPaths = templates
53
53
  ?.filter(({ templateType, pathType }) => {
54
- return templateType === TEMPLATES.handler && pathType == PATH_TYPES.static;
54
+ return templateType === TEMPLATES.handler && pathType === PATH_TYPES.static;
55
55
  })
56
56
  .map(({ path }) => path);
57
- handlerStaticPaths.forEach(path => paths.add(normalizePath(path)));
57
+ handlerStaticPaths.forEach((path) => paths.add(normalizePath(path)));
58
58
  }
59
59
  const filteredPaths = Array.from(paths).filter(filter);
60
- const entries = filteredPaths.map(path => {
60
+ const entries = filteredPaths.map((path) => {
61
61
  const localizedPaths = i18n
62
- ? filteredPaths.filter(filteredPath => {
62
+ ? filteredPaths.filter((filteredPath) => {
63
63
  return removeLocale(path) === removeLocale(filteredPath);
64
64
  })
65
65
  : [];
66
- const alternateLinks = localizedPaths.map(path => {
67
- const locale = i18n.locales.find(locale => path.startsWith(`/${locale}`)) || i18n.defaultLocale;
66
+ const alternateLinks = localizedPaths.map((path) => {
67
+ const locale = i18n.locales.find((locale) => path.startsWith(`/${locale}`)) || i18n.defaultLocale;
68
68
  return `<xhtml:link rel="alternate" hreflang="${locale}" href="${new URL(path, config.site).href}" />`;
69
69
  });
70
70
  return `<url><loc>${new URL(path, config.site).href}</loc>${alternateLinks.join('')}</url>`;
package/package.json CHANGED
@@ -1,40 +1,41 @@
1
1
  {
2
- "name": "@zubyjs/sitemap",
3
- "version": "1.0.79",
4
- "description": "Zuby.js sitemap plugin",
5
- "type": "module",
6
- "main": "index.js",
7
- "scripts": {
8
- "release": "cd ./dist && npm publish --access public && cd ..",
9
- "bump-version": "npm version patch",
10
- "build": "rm -rf dist/ stage/ && mkdir dist && tsc && cp -rf package.json README.md stage/sitemap/src/* dist/ && rm -rf stage/",
11
- "push-build": "npm run build && cd dist && yalc push --force && cd ..",
12
- "test": "exit 0"
13
- },
14
- "publishConfig": {
15
- "directory": "dist",
16
- "linkDirectory": true
17
- },
18
- "peerDependencies": {
19
- "zuby": "^1.0.0"
20
- },
21
- "bugs": {
22
- "url": "https://gitlab.com/futrou/zuby.js/-/issues",
23
- "email": "zuby@futrou.com"
24
- },
25
- "license": "MIT",
26
- "repository": {
27
- "type": "git",
28
- "url": "git+https://gitlab.com/futrou/zuby.js.git"
29
- },
30
- "homepage": "https://zubyjs.com",
31
- "keywords": [
32
- "zuby-plugin",
33
- "zuby",
34
- "sitemap",
35
- "seo"
36
- ],
37
- "engines": {
38
- "node": ">=18"
39
- }
2
+ "name": "@zubyjs/sitemap",
3
+ "version": "1.0.81",
4
+ "description": "Zuby.js sitemap plugin",
5
+ "type": "module",
6
+ "main": "index.js",
7
+ "scripts": {
8
+ "release": "cd ./dist && npm publish --access public && cd ..",
9
+ "bump-version": "npm version patch",
10
+ "build": "rm -rf dist/ stage/ && mkdir dist && tsc && cp -rf package.json README.md stage/sitemap/src/* dist/ && rm -rf stage/",
11
+ "push-build": "npm run build && cd dist && yalc push --force && cd ..",
12
+ "test": "vitest run",
13
+ "test:coverage": "vitest run --coverage"
14
+ },
15
+ "publishConfig": {
16
+ "directory": "dist",
17
+ "linkDirectory": true
18
+ },
19
+ "peerDependencies": {
20
+ "zuby": "^1.0.0"
21
+ },
22
+ "bugs": {
23
+ "url": "https://gitlab.com/futrou/zuby.js/-/issues",
24
+ "email": "zuby@futrou.com"
25
+ },
26
+ "license": "MIT",
27
+ "repository": {
28
+ "type": "git",
29
+ "url": "git+https://gitlab.com/futrou/zuby.js.git"
30
+ },
31
+ "homepage": "https://zubyjs.com",
32
+ "keywords": [
33
+ "zuby-plugin",
34
+ "zuby",
35
+ "sitemap",
36
+ "seo"
37
+ ],
38
+ "engines": {
39
+ "node": ">=18"
40
+ }
40
41
  }