Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add .js to imports in the sitemap package #3661

Merged
merged 3 commits into from
Jun 21, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions .changeset/gold-walls-pretend.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'@astrojs/sitemap': patch
---

Fixes the last build
3 changes: 2 additions & 1 deletion packages/integrations/sitemap/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down
2 changes: 1 addition & 1 deletion packages/integrations/sitemap/src/config-defaults.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import type { SitemapOptions } from './index';
import type { SitemapOptions } from './index.js';

export const SITEMAP_CONFIG_DEFAULTS: SitemapOptions & any = {
entryLimit: 45000,
Expand Down
4 changes: 2 additions & 2 deletions packages/integrations/sitemap/src/generate-sitemap.ts
Original file line number Diff line number Diff line change
@@ -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}\/?$/;

Expand Down
6 changes: 3 additions & 3 deletions packages/integrations/sitemap/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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<
Expand Down
2 changes: 1 addition & 1 deletion packages/integrations/sitemap/src/schema.ts
Original file line number Diff line number Diff line change
@@ -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);

Expand Down
4 changes: 2 additions & 2 deletions packages/integrations/sitemap/src/validate-options.ts
Original file line number Diff line number Diff line change
@@ -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) => {
Expand Down
3 changes: 3 additions & 0 deletions packages/integrations/sitemap/test/smoke.test.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
import '../dist/index.js';

// Just a smoke test, this would fail if there's a problem.