Add .js to imports in the sitemap package (#3661)
* Add .js to imports in the sitemap package * Adds a smoke test * Adds a changeset
This commit is contained in:
parent
195f88bf0b
commit
2ff11df438
8 changed files with 19 additions and 10 deletions
5
.changeset/gold-walls-pretend.md
Normal file
5
.changeset/gold-walls-pretend.md
Normal file
|
@ -0,0 +1,5 @@
|
|||
---
|
||||
'@astrojs/sitemap': patch
|
||||
---
|
||||
|
||||
Fixes the last build
|
|
@ -28,7 +28,8 @@
|
|||
"scripts": {
|
||||
"build": "astro-scripts build \"src/**/*.ts\" && tsc",
|
||||
"build:ci": "astro-scripts build \"src/**/*.ts\"",
|
||||
"dev": "astro-scripts dev \"src/**/*.ts\""
|
||||
"dev": "astro-scripts dev \"src/**/*.ts\"",
|
||||
"test": "mocha --timeout 20000"
|
||||
},
|
||||
"dependencies": {
|
||||
"sitemap": "^7.1.1",
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
import type { SitemapOptions } from './index';
|
||||
import type { SitemapOptions } from './index.js';
|
||||
|
||||
export const SITEMAP_CONFIG_DEFAULTS: SitemapOptions & any = {
|
||||
entryLimit: 45000,
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
import type { SitemapItem, SitemapOptions } from './index';
|
||||
import { parseUrl } from './utils/parse-url';
|
||||
import type { SitemapItem, SitemapOptions } from './index.js';
|
||||
import { parseUrl } from './utils/parse-url.js';
|
||||
|
||||
const STATUS_CODE_PAGE_REGEXP = /\/[0-9]{3}\/?$/;
|
||||
|
||||
|
|
|
@ -8,9 +8,9 @@ import {
|
|||
import { fileURLToPath } from 'url';
|
||||
import { ZodError } from 'zod';
|
||||
|
||||
import { generateSitemap } from './generate-sitemap';
|
||||
import { Logger } from './utils/logger';
|
||||
import { validateOptions } from './validate-options';
|
||||
import { generateSitemap } from './generate-sitemap.js';
|
||||
import { Logger } from './utils/logger.js';
|
||||
import { validateOptions } from './validate-options.js';
|
||||
|
||||
export type ChangeFreq = EnumChangefreq;
|
||||
export type SitemapItem = Pick<
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
import { EnumChangefreq as ChangeFreq } from 'sitemap';
|
||||
import { z } from 'zod';
|
||||
import { SITEMAP_CONFIG_DEFAULTS } from './config-defaults';
|
||||
import { SITEMAP_CONFIG_DEFAULTS } from './config-defaults.js';
|
||||
|
||||
const localeKeySchema = z.string().min(1);
|
||||
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
import { z } from 'zod';
|
||||
import type { SitemapOptions } from './index';
|
||||
import { SitemapOptionsSchema } from './schema';
|
||||
import type { SitemapOptions } from './index.js';
|
||||
import { SitemapOptionsSchema } from './schema.js';
|
||||
|
||||
// @internal
|
||||
export const validateOptions = (site: string | undefined, opts: SitemapOptions) => {
|
||||
|
|
3
packages/integrations/sitemap/test/smoke.test.js
Normal file
3
packages/integrations/sitemap/test/smoke.test.js
Normal file
|
@ -0,0 +1,3 @@
|
|||
import '../dist/index.js';
|
||||
|
||||
// Just a smoke test, this would fail if there's a problem.
|
Loading…
Reference in a new issue