Skip to content

Commit 96b4b1c

Browse files
committed
fix(sdks): support Prettier v3
1 parent 4927819 commit 96b4b1c

3 files changed

Lines changed: 9 additions & 4 deletions

File tree

.yarn/versions/5a966911.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
releases:
2+
"@yarnpkg/sdks": patch

packages/yarnpkg-sdks/sources/generateSdk.ts

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -205,7 +205,7 @@ export class Wrapper {
205205
this.target = target;
206206
}
207207

208-
async writeManifest() {
208+
async writeManifest(rawManifest: Record<string, any> = {}) {
209209
const absWrapperPath = ppath.join(this.target, this.name, `package.json`);
210210

211211
const topLevelInformation = this.pnpApi.getPackageInformation(this.pnpApi.topLevel)!;
@@ -223,10 +223,11 @@ export class Wrapper {
223223
version: `${manifest.version}-sdk`,
224224
main: manifest.main,
225225
type: `commonjs`,
226+
...rawManifest,
226227
});
227228
}
228229

229-
async writeBinary(relPackagePath: PortablePath, options: TemplateOptions = {}) {
230+
async writeBinary(relPackagePath: PortablePath, options: TemplateOptions & {requirePath?: PortablePath} = {}) {
230231
await this.writeFile(relPackagePath, {...options, mode: 0o755});
231232
}
232233

packages/yarnpkg-sdks/sources/sdks/base.ts

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,9 +27,11 @@ export const generateEslintBaseWrapper: GenerateBaseWrapper = async (pnpApi: Pnp
2727
export const generatePrettierBaseWrapper: GenerateBaseWrapper = async (pnpApi: PnpApi, target: PortablePath) => {
2828
const wrapper = new Wrapper(`prettier` as PortablePath, {pnpApi, target});
2929

30-
await wrapper.writeManifest();
30+
await wrapper.writeManifest({
31+
main: `./index.js`,
32+
});
3133

32-
await wrapper.writeBinary(`index.js` as PortablePath);
34+
await wrapper.writeBinary(`index.js` as PortablePath, {requirePath: `` as PortablePath});
3335

3436
return wrapper;
3537
};

0 commit comments

Comments
 (0)