Skip to content
Merged
Show file tree
Hide file tree
Changes from 2 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
4 changes: 2 additions & 2 deletions .github/workflows/lint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -30,10 +30,10 @@ jobs:
- name: Install Pnpm
run: corepack enable

- name: Setup Node.js 18.x
- name: Setup Node.js 20
uses: actions/setup-node@v4
with:
node-version: 18.x
node-version: 20
cache: 'pnpm'

- name: Install Dependencies
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/release-pull-request.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,10 +29,10 @@ jobs:
- name: Install Pnpm
run: corepack enable

- name: Setup Node.js 18
- name: Setup Node.js 20
uses: actions/setup-node@v4
with:
node-version: '18'
node-version: 20
cache: 'pnpm'

- name: Install Dependencies
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -37,10 +37,10 @@ jobs:
- name: Install Pnpm
run: corepack enable

- name: Setup Node.js 18
- name: Setup Node.js 20
uses: actions/setup-node@v4
with:
node-version: '18'
node-version: 20
cache: 'pnpm'

- name: Install Dependencies
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/test-ubuntu.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ jobs:
runs-on: ubuntu-latest
strategy:
matrix:
node-version: [18.x]
node-version: [20]

# Steps represent a sequence of tasks that will be executed as part of the job
steps:
Expand Down Expand Up @@ -64,7 +64,7 @@ jobs:
runs-on: ubuntu-latest
strategy:
matrix:
node-version: [18.x]
node-version: [20]

# Steps represent a sequence of tasks that will be executed as part of the job
steps:
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/test-windows.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ jobs:
runs-on: windows-latest
strategy:
matrix:
node-version: [18.x]
node-version: [20]

# Steps represent a sequence of tasks that will be executed as part of the job
steps:
Expand Down Expand Up @@ -69,7 +69,7 @@ jobs:
runs-on: windows-latest
strategy:
matrix:
node-version: [18.x]
node-version: [20]

# Steps represent a sequence of tasks that will be executed as part of the job
steps:
Expand Down
2 changes: 1 addition & 1 deletion .nvmrc
Original file line number Diff line number Diff line change
@@ -1 +1 @@
v18.20.2
20
2 changes: 1 addition & 1 deletion CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ Thanks for that you are interested in contributing to Rslib. Before starting you

## Install Node.js

Use [fnm](https://github.com/Schniz/fnm) or [nvm](https://github.com/nvm-sh/nvm) to run the command below. This will switch to the Node.js version (currently 18) specified in the project's `.nvmrc` file.
Use [fnm](https://github.com/Schniz/fnm) or [nvm](https://github.com/nvm-sh/nvm) to run the command below. This will switch to the Node.js version (currently 20) specified in the project's `.nvmrc` file.

```bash
# with fnm
Expand Down
20 changes: 13 additions & 7 deletions packages/core/src/config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -227,21 +227,27 @@ export const composeAutoExternalConfig = (options: {
return {};
}

// User externals configuration has higher priority than autoExternal
// eg: autoExternal: ['react'], user: output: { externals: { react: 'react-1' } }
// Only handle the case where the externals type is object, string / string[] does not need to be processed, other types are too complex.
const userExternalKeys =
userExternals && isObject(userExternals) ? Object.keys(userExternals) : [];

const externalOptions = {
dependencies: true,
optionalDependencies: true,
peerDependencies: true,
devDependencies: false,
...(autoExternal === true ? {} : autoExternal),
};

// User externals configuration has higher priority than autoExternal
// eg: autoExternal: ['react'], user: output: { externals: { react: 'react-1' } }
// Only handle the case where the externals type is object, string / string[] does not need to be processed, other types are too complex.
const userExternalKeys =
userExternals && isObject(userExternals) ? Object.keys(userExternals) : [];

const externals = (
['dependencies', 'peerDependencies', 'devDependencies'] as const
[
'dependencies',
'peerDependencies',
'devDependencies',
'optionalDependencies',
] as const
)
.reduce<string[]>((prev, type) => {
if (externalOptions[type]) {
Expand Down
3 changes: 2 additions & 1 deletion packages/core/src/types/utils.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
export type PkgJson = {
type?: 'module' | 'commonjs';
dependencies?: Record<string, string>;
peerDependencies?: Record<string, string>;
devDependencies?: Record<string, string>;
[key: string]: unknown;
optionalDependencies?: Record<string, string>;
};
2 changes: 2 additions & 0 deletions packages/plugin-dts/src/dts.ts
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ export const calcBundledPackages = (options: {
dependencies?: Record<string, string>;
peerDependencies?: Record<string, string>;
devDependencies?: Record<string, string>;
optionalDependencies?: Record<string, string>;
};

try {
Expand All @@ -42,6 +43,7 @@ export const calcBundledPackages = (options: {
? {
dependencies: true,
peerDependencies: true,
optionalDependencies: true,
devDependencies: false,
...(autoExternal === true ? {} : autoExternal),
}
Expand Down
Loading