@pnpm/fs.packlist 1.0.2 → 2.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/LICENSE CHANGED
@@ -1,7 +1,7 @@
1
1
  The MIT License (MIT)
2
2
 
3
3
  Copyright (c) 2015-2016 Rico Sta. Cruz and other contributors
4
- Copyright (c) 2016-2023 Zoltan Kochan and other contributors
4
+ Copyright (c) 2016-2024 Zoltan Kochan and other contributors
5
5
 
6
6
  Permission is hereby granted, free of charge, to any person obtaining a copy
7
7
  of this software and associated documentation files (the "Software"), to deal
package/lib/index.d.ts CHANGED
@@ -1 +1,3 @@
1
- export declare function packlist(pkgDir: string): Promise<string[]>;
1
+ export declare function packlist(pkgDir: string, opts?: {
2
+ packageJsonCache?: Record<string, Record<string, unknown>>;
3
+ }): Promise<string[]>;
package/lib/index.js CHANGED
@@ -5,8 +5,11 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
5
5
  Object.defineProperty(exports, "__esModule", { value: true });
6
6
  exports.packlist = void 0;
7
7
  const npm_packlist_1 = __importDefault(require("npm-packlist"));
8
- async function packlist(pkgDir) {
9
- const files = await (0, npm_packlist_1.default)({ path: pkgDir });
8
+ async function packlist(pkgDir, opts) {
9
+ const packageJsonCacheMap = opts?.packageJsonCache
10
+ ? new Map(Object.entries(opts.packageJsonCache))
11
+ : undefined;
12
+ const files = await (0, npm_packlist_1.default)({ path: pkgDir, packageJsonCache: packageJsonCacheMap });
10
13
  // There's a bug in the npm-packlist version that we use,
11
14
  // it sometimes returns duplicates.
12
15
  // Related issue: https://github.com/pnpm/pnpm/issues/6997
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";;;;;;AAAA,gEAAsC;AAE/B,KAAK,UAAU,QAAQ,CAAE,MAAc,EAAE,IAE/C;IACC,MAAM,mBAAmB,GAAG,IAAI,EAAE,gBAAgB;QAChD,CAAC,CAAC,IAAI,GAAG,CAAC,MAAM,CAAC,OAAO,CAAC,IAAI,CAAC,gBAAgB,CAAC,CAAC;QAChD,CAAC,CAAC,SAAS,CAAA;IACb,MAAM,KAAK,GAAG,MAAM,IAAA,sBAAW,EAAC,EAAE,IAAI,EAAE,MAAM,EAAE,gBAAgB,EAAE,mBAAmB,EAAE,CAAC,CAAA;IACxF,yDAAyD;IACzD,mCAAmC;IACnC,0DAA0D;IAC1D,+CAA+C;IAC/C,gDAAgD;IAChD,OAAO,KAAK,CAAC,IAAI,CAAC,IAAI,GAAG,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,IAAI,CAAC,OAAO,CAAC,UAAU,EAAE,EAAE,CAAC,CAAC,CAAC,CAAC,CAAA;AAC/E,CAAC;AAbD,4BAaC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@pnpm/fs.packlist",
3
- "version": "1.0.2",
3
+ "version": "2.0.0",
4
4
  "description": "Get a list of the files to add from a directory into an npm package",
5
5
  "main": "lib/index.js",
6
6
  "files": [
@@ -10,10 +10,10 @@
10
10
  "types": "lib/index.d.ts",
11
11
  "repository": "https://github.com/pnpm/pnpm/blob/main/fs/packlist",
12
12
  "keywords": [
13
- "pnpm8"
13
+ "pnpm9"
14
14
  ],
15
15
  "engines": {
16
- "node": ">=16.14"
16
+ "node": ">=18.12"
17
17
  },
18
18
  "license": "MIT",
19
19
  "bugs": {
@@ -25,7 +25,7 @@
25
25
  },
26
26
  "funding": "https://opencollective.com/pnpm",
27
27
  "devDependencies": {
28
- "@pnpm/fs.packlist": "1.0.2"
28
+ "@pnpm/fs.packlist": "2.0.0"
29
29
  },
30
30
  "exports": {
31
31
  ".": "./lib/index.js"