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:
Matthew Phillips 2022-06-21 11:29:18 -04:00 committed by GitHub
parent 195f88bf0b
commit 2ff11df438
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
8 changed files with 19 additions and 10 deletions

View file

@ -0,0 +1,5 @@
---
'@astrojs/sitemap': patch
---
Fixes the last build

View file

@ -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",

View file

@ -1,4 +1,4 @@
import type { SitemapOptions } from './index';
import type { SitemapOptions } from './index.js';
export const SITEMAP_CONFIG_DEFAULTS: SitemapOptions & any = {
entryLimit: 45000,

View file

@ -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}\/?$/;

View file

@ -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<

View file

@ -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);

View file

@ -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) => {

View file

@ -0,0 +1,3 @@
import '../dist/index.js';
// Just a smoke test, this would fail if there's a problem.