Skip to content

Commit

Permalink
fix(anatomy): resolve an issue with generated exports
Browse files Browse the repository at this point in the history
  • Loading branch information
cschroeter committed Feb 27, 2024
1 parent 1a3267f commit 6a43975
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 5 deletions.
4 changes: 4 additions & 0 deletions packages/anatomy/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
## [Unreleased]

### Fixed

- Resolved an issue where the `package.json` is missing export specifiers.

## [2.3.0] - 2024-02-27

### Changed
Expand Down
12 changes: 7 additions & 5 deletions packages/scripts/src/prepare-release.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import path, { dirname } from 'path'
import { match } from 'ts-pattern'

const generateExports = (dirName: string) => {
const paths = globbySync('src/**/index.ts{x}')
const paths = globbySync('src/**/index.ts')
const exports: Record<string, unknown> = {}

for (const p of paths) {
Expand All @@ -16,10 +16,12 @@ const generateExports = (dirName: string) => {
require: `${keyPath}/index.cjs`,
}
}
exports['./factory'] = {
types: './factory.d.ts',
import: './factory.mjs',
require: './factory.cjs',
if (dirName !== 'anatomy') {
exports['./factory'] = {
types: './factory.d.ts',
import: './factory.mjs',
require: './factory.cjs',
}
}

if (dirName === 'react') {
Expand Down

0 comments on commit 6a43975

Please sign in to comment.