diff --git a/packages/pages-components/CHANGELOG.md b/packages/pages-components/CHANGELOG.md index c65f5a27..ca920d0d 100644 --- a/packages/pages-components/CHANGELOG.md +++ b/packages/pages-components/CHANGELOG.md @@ -2,23 +2,23 @@ ##### Chores -* upgrade storybook/test-runner ([#128](https://github.com/yext/js/pull/128)) ([c8730380](https://github.com/yext/js/commit/c87303805625f6615aa45ea7e711bc0805076420)) +- upgrade storybook/test-runner ([#128](https://github.com/yext/js/pull/128)) ([c8730380](https://github.com/yext/js/commit/c87303805625f6615aa45ea7e711bc0805076420)) ##### New Features -* **pages-components:** add openingHoursSpecification schema helper ([#129](https://github.com/yext/js/pull/129)) ([8ad76b49](https://github.com/yext/js/commit/8ad76b4956210832b9ada6fe995bdaf34b5834a7)) +- **pages-components:** add openingHoursSpecification schema helper ([#129](https://github.com/yext/js/pull/129)) ([8ad76b49](https://github.com/yext/js/commit/8ad76b4956210832b9ada6fe995bdaf34b5834a7)) ##### Bug Fixes -* update getDirections encoding ([#132](https://github.com/yext/js/pull/132)) ([b0b0dc7f](https://github.com/yext/js/commit/b0b0dc7fff5137329aa4be7cc4301a4982d946f2)) +- update getDirections encoding ([#132](https://github.com/yext/js/pull/132)) ([b0b0dc7f](https://github.com/yext/js/commit/b0b0dc7fff5137329aa4be7cc4301a4982d946f2)) ##### Other Changes -* drop React 19 and add React/Node matrix tests ([#131](https://github.com/yext/js/pull/131)) ([ad28ab88](https://github.com/yext/js/commit/ad28ab88820c99f442664ac2cd7e7acb0a8b582e)) +- drop React 19 and add React/Node matrix tests ([#131](https://github.com/yext/js/pull/131)) ([ad28ab88](https://github.com/yext/js/commit/ad28ab88820c99f442664ac2cd7e7acb0a8b582e)) ##### Reverts -* prior changes and build with React 18 ([#127](https://github.com/yext/js/pull/127)) ([5b2fd083](https://github.com/yext/js/commit/5b2fd0839cef7bffd14a316dfb101a8b38e7a1fb)) +- prior changes and build with React 18 ([#127](https://github.com/yext/js/pull/127)) ([5b2fd083](https://github.com/yext/js/commit/5b2fd0839cef7bffd14a316dfb101a8b38e7a1fb)) #### 1.2.2 (2025-11-19) diff --git a/packages/pages-components/package.json b/packages/pages-components/package.json index 03c521ed..e003749d 100644 --- a/packages/pages-components/package.json +++ b/packages/pages-components/package.json @@ -20,12 +20,17 @@ "dist", "THIRD-PARTY-NOTICES" ], + "main": "./dist/index.cjs", "module": "./dist/index.js", "exports": { ".": { "import": { "types": "./dist/index.d.ts", "default": "./dist/index.js" + }, + "require": { + "types": "./dist/index.d.cts", + "default": "./dist/index.cjs" } }, "./style.css": "./dist/index.css" diff --git a/packages/pages-components/vite.config.ts b/packages/pages-components/vite.config.ts index 97ecfcfd..ccd1af5a 100644 --- a/packages/pages-components/vite.config.ts +++ b/packages/pages-components/vite.config.ts @@ -11,7 +11,7 @@ export default defineConfig(() => ({ entry: path.resolve(__dirname, "src/index.ts"), name: "pages-components", fileName: "index", - formats: ["es"] as LibraryFormats[], // typescript is unhappy without this forced type definition + formats: ["es", "cjs"] as LibraryFormats[], // typescript is unhappy without this forced type definition }, rollupOptions: { external: ["react", "react-dom", "mapbox-gl"], @@ -44,7 +44,7 @@ const dts = (): Plugin => ({ return; } - exec("tsup src/index.ts --format esm --dts-only", (err) => { + exec("tsup src/index.ts --format esm,cjs --dts-only", (err) => { if (err) { throw new Error("Failed to generate declaration files"); }