From 1f75ec8c33c1fe5a716f4e6e6e2042a7c6eaac00 Mon Sep 17 00:00:00 2001 From: hrmny <8845940+ForsakenHarmony@users.noreply.github.com> Date: Tue, 24 Sep 2024 17:35:59 +0200 Subject: [PATCH] chore: auto-format generated types with prettier --- .../next/src/build/swc/generated-wasm.d.ts | 24 +++++++++---------- scripts/build-native.cjs | 8 +++++++ scripts/build-wasm.cjs | 8 +++++++ 3 files changed, 28 insertions(+), 12 deletions(-) diff --git a/packages/next/src/build/swc/generated-wasm.d.ts b/packages/next/src/build/swc/generated-wasm.d.ts index e1175f6c118e3..19be5f54ba11f 100644 --- a/packages/next/src/build/swc/generated-wasm.d.ts +++ b/packages/next/src/build/swc/generated-wasm.d.ts @@ -3,18 +3,6 @@ /* tslint:disable */ /* eslint-disable */ -/** - * @param {string} value - * @param {any} opts - * @returns {any} - */ -export function mdxCompileSync(value: string, opts: any): any -/** - * @param {string} value - * @param {any} opts - * @returns {Promise} - */ -export function mdxCompile(value: string, opts: any): Promise /** * @param {string} s * @param {any} opts @@ -51,3 +39,15 @@ export function parseSync(s: string, opts: any): any * @returns {Promise} */ export function parse(s: string, opts: any): Promise +/** + * @param {string} value + * @param {any} opts + * @returns {any} + */ +export function mdxCompileSync(value: string, opts: any): any +/** + * @param {string} value + * @param {any} opts + * @returns {Promise} + */ +export function mdxCompile(value: string, opts: any): Promise diff --git a/scripts/build-native.cjs b/scripts/build-native.cjs index 1de8cd81660fa..b073e228778c3 100755 --- a/scripts/build-native.cjs +++ b/scripts/build-native.cjs @@ -5,6 +5,7 @@ const { booleanArg, execAsyncWithOutput, execFn, + exec, namedValueArg, } = require('./pack-util.cjs') const fs = require('fs') @@ -85,4 +86,11 @@ function writeTypes() { vendoredTypes + generatedTypesMarker + generatedNotice + generatedTypes fs.writeFileSync(vendoredTypesPath, vendoredTypes) + + exec('Prettify generated types', [ + 'pnpm', + 'prettier', + '--write', + vendoredTypesPath, + ]) } diff --git a/scripts/build-wasm.cjs b/scripts/build-wasm.cjs index d46793d2699ae..50d4b99b6eb33 100755 --- a/scripts/build-wasm.cjs +++ b/scripts/build-wasm.cjs @@ -5,6 +5,7 @@ const { booleanArg, execAsyncWithOutput, execFn, + exec, namedValueArg, } = require('./pack-util.cjs') const fs = require('fs') @@ -79,4 +80,11 @@ function writeTypes() { const vendoredTypes = generatedNotice + generatedTypes fs.writeFileSync(vendoredTypesPath, vendoredTypes) + + exec('Prettify generated types', [ + 'pnpm', + 'prettier', + '--write', + vendoredTypesPath, + ]) }