Skip to content

Commit fdd896e

Browse files
committed
jsZip implementation
1 parent 93a5664 commit fdd896e

File tree

15 files changed

+1184
-541
lines changed

15 files changed

+1184
-541
lines changed

.pnp.cjs

+458-215
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

.yarnrc.yml

+2
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,8 @@ immutablePatterns:
1515

1616
initScope: yarnpkg
1717

18+
experimentalZipImplementation: js
19+
1820
npmPublishAccess: public
1921

2022
packageExtensions:

packages/plugin-pnp/sources/PnpLinker.ts

+1
Original file line numberDiff line numberDiff line change
@@ -285,6 +285,7 @@ export class PnpInstaller implements Installer {
285285
fallbackExclusionList,
286286
fallbackPool,
287287
ignorePattern,
288+
experimentalZipImplementation: this.opts.project.configuration.get(`experimentalZipImplementation`) ?? `libzip`,
288289
packageRegistry,
289290
shebang,
290291
});

packages/plugin-pnp/sources/index.ts

+17
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
import {Hooks as CoreHooks, Plugin, Project, SettingsType, WindowsLinkType} from '@yarnpkg/core';
22
import {Filename, PortablePath, npath, ppath, xfs} from '@yarnpkg/fslib';
33
import {Hooks as StageHooks} from '@yarnpkg/plugin-stage';
4+
import {ExperimentalZipImplementation} from '@yarnpkg/pnp';
45
import {pathToFileURL} from 'url';
56

67
import {PnpLinker} from './PnpLinker';
@@ -70,12 +71,14 @@ declare module '@yarnpkg/core' {
7071
nodeLinker: string;
7172
winLinkType: string;
7273
pnpMode: string;
74+
minizip: boolean;
7375
pnpShebang: string;
7476
pnpIgnorePatterns: Array<string>;
7577
pnpEnableEsmLoader: boolean;
7678
pnpEnableInlining: boolean;
7779
pnpFallbackMode: string;
7880
pnpUnpluggedFolder: PortablePath;
81+
experimentalZipImplementation: ExperimentalZipImplementation;
7982
}
8083
}
8184

@@ -90,6 +93,11 @@ const plugin: Plugin<CoreHooks & StageHooks> = {
9093
type: SettingsType.STRING,
9194
default: `pnp`,
9295
},
96+
minizip: {
97+
description: `Whether Yarn should use minizip to extract archives`,
98+
type: SettingsType.BOOLEAN,
99+
default: false,
100+
},
93101
winLinkType: {
94102
description: `Whether Yarn should use Windows Junctions or symlinks when creating links on Windows.`,
95103
type: SettingsType.STRING,
@@ -115,6 +123,15 @@ const plugin: Plugin<CoreHooks & StageHooks> = {
115123
default: [],
116124
isArray: true,
117125
},
126+
experimentalZipImplementation: {
127+
description: `Whether to use the experimental js implementation for the ZipFS`,
128+
type: SettingsType.STRING,
129+
values: [
130+
`libzip`,
131+
`js`,
132+
],
133+
default: `libzip`,
134+
},
118135
pnpEnableEsmLoader: {
119136
description: `If true, Yarn will generate an ESM loader (\`.pnp.loader.mjs\`). If this is not explicitly set Yarn tries to automatically detect whether ESM support is required.`,
120137
type: SettingsType.BOOLEAN,

0 commit comments

Comments
 (0)