Skip to content

Commit

Permalink
fix: revert pkg-dir version
Browse files Browse the repository at this point in the history
  • Loading branch information
kshutkin committed Nov 8, 2023
1 parent 83d270a commit 31f85ef
Show file tree
Hide file tree
Showing 5 changed files with 46 additions and 18 deletions.
5 changes: 5 additions & 0 deletions .changeset/new-insects-cough.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@rollup-extras/plugin-externals": patch
---

revert pkg-dir version because we still use commonjs
6 changes: 3 additions & 3 deletions plugin-externals/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@
},
"./package.json": "./package.json"
},
"types": "./dist/index.d.ts",
"files": [
"dist",
"LICENSE"
Expand Down Expand Up @@ -45,7 +46,7 @@
"dependencies": {
"@niceties/logger": "^1.1.4",
"is-builtin-module": "^3.2.0",
"pkg-dir": "8.0.0",
"pkg-dir": "5.0.0",
"@rollup-extras/utils": "^1.4.5"
},
"peerDependencies": {
Expand All @@ -55,6 +56,5 @@
"rollup": {
"optional": true
}
},
"types": "./dist/index.d.ts"
}
}
2 changes: 1 addition & 1 deletion plugin-externals/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import { getOptionsObject } from '@rollup-extras/utils/options';
import { LogLevel } from '@niceties/logger';
import logger from '@rollup-extras/utils/logger';
import { ExternalsPluginOptions } from './types';
import { packageDirectory } from 'pkg-dir';
import packageDirectory from 'pkg-dir';

const factories = { logger };

Expand Down
8 changes: 5 additions & 3 deletions plugin-externals/tests/index.spec.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import { createLogger, LogLevel } from '@niceties/logger';
import { packageDirectory } from 'pkg-dir';
import packageDirectory from 'pkg-dir';
// import path from 'path';
import plugin from '../src';

let log: jest.Mock;
Expand All @@ -10,8 +11,9 @@ jest.mock('@niceties/logger', () => ({
}));

jest.mock('pkg-dir', () => ({
packageDirectory: jest.fn(() => Promise.resolve('')),
__esModule: true
...jest.requireActual('pkg-dir'),
__esModule: true,
default: jest.fn(() => Promise.resolve(''))
}));

describe('@rollup-extras/plugin-externals', () => {
Expand Down
43 changes: 32 additions & 11 deletions pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit 31f85ef

Please sign in to comment.