-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix(misc): ensure
exports
are generated for several lib generators …
…in ts solution setup (nrwl#29588) - Update React Native, React, Remix and Vue library generators to produce `exports` in the `package.json` for the TS solution setup - Fix an issue in `@nx/rollup/with-nx` where an unhandled `undefined` plugin was causing an error to be thrown - Fix output path of the build task for React Native libraries in the TS solution setup <!-- Please make sure you have read the submission guidelines before posting an PR --> <!-- https://github.com/nrwl/nx/blob/master/CONTRIBUTING.md#-submitting-a-pr --> <!-- Please make sure that your commit message follows our format --> <!-- Example: `fix(nx): must begin with lowercase` --> <!-- If this is a particularly complex change or feature addition, you can request a dedicated Nx release for this pull request branch. Mention someone from the Nx team or the `@nrwl/nx-pipelines-reviewers` and they will confirm if the PR warrants its own release for testing purposes, and generate it for you if appropriate. --> ## Current Behavior <!-- This is the behavior we have today --> ## Expected Behavior <!-- This is the behavior we should expect with the changes in this PR --> ## Related Issue(s) <!-- Please link the issue being fixed so it gets closed when this is merged. --> Fixes #
- Loading branch information
1 parent
cbea062
commit 9dbebbe
Showing
12 changed files
with
146 additions
and
45 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
25 changes: 25 additions & 0 deletions
25
packages/react/src/generators/library/lib/determine-entry-fields.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
import type { PackageJson } from 'nx/src/utils/package-json'; | ||
import type { NormalizedSchema } from '../schema'; | ||
|
||
export function determineEntryFields( | ||
options: NormalizedSchema | ||
): Pick<PackageJson, 'main' | 'types' | 'exports'> { | ||
if (options.bundler !== 'none') { | ||
return {}; | ||
} | ||
|
||
return { | ||
main: options.js ? './src/index.js' : './src/index.ts', | ||
types: options.js ? './src/index.js' : './src/index.ts', | ||
exports: { | ||
'.': options.js | ||
? './src/index.js' | ||
: { | ||
types: './src/index.ts', | ||
import: './src/index.ts', | ||
default: './src/index.ts', | ||
}, | ||
'./package.json': './package.json', | ||
}, | ||
}; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
28 changes: 28 additions & 0 deletions
28
packages/vue/src/generators/library/lib/determine-entry-fields.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
import type { PackageJson } from 'nx/src/utils/package-json'; | ||
import type { NormalizedSchema } from '../schema'; | ||
|
||
export function determineEntryFields( | ||
options: NormalizedSchema | ||
): Pick<PackageJson, 'module' | 'types' | 'exports'> { | ||
if (options.bundler === 'none') { | ||
return { | ||
module: options.js ? './src/index.js' : './src/index.ts', | ||
types: options.js ? './src/index.js' : './src/index.ts', | ||
exports: { | ||
'.': options.js | ||
? './src/index.js' | ||
: { | ||
types: './src/index.ts', | ||
import: './src/index.ts', | ||
default: './src/index.ts', | ||
}, | ||
'./package.json': './package.json', | ||
}, | ||
}; | ||
} | ||
|
||
return { | ||
module: './dist/index.mjs', | ||
types: './dist/index.d.ts', | ||
}; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters