Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: upgrade esbuild to 0.16.0 #279

Merged
merged 2 commits into from
Dec 18, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .projen/deps.json

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

21 changes: 20 additions & 1 deletion .projenrc.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { awscdk, github, javascript, release, vscode } from 'projen';
import { SourceFile } from 'ts-morph';
import { GetAccessorDeclaration, SourceFile, SyntaxKind } from 'ts-morph';
import { tagOnNpm, TypeScriptSourceFile } from './projenrc';
import { Esbuild } from './src/esbuild-source';

Expand Down Expand Up @@ -254,8 +254,27 @@ new TypeScriptSourceFile(project, 'src/esbuild-types.ts', {
properties.forEach(property => interfaceDeclaration?.getProperty(property)?.remove());
};

const convertAccessors = (name: string) => {
const interfaceObj = esbuildTypes.getInterface(name);
if (interfaceObj) {
const structure = interfaceObj.getStructure();
const getters = interfaceObj.getMembers().filter(m => m.getKind() === SyntaxKind.GetAccessor);
for (const getter of getters) {
structure.properties?.push({
name: (getter as unknown as GetAccessorDeclaration).getName(),
type: (getter as unknown as GetAccessorDeclaration).getReturnType().getText(),
docs: (getter as unknown as GetAccessorDeclaration).getJsDocs().map(d => d.getStructure()),
});
}

interfaceObj.remove();
esbuildTypes.addInterface(structure);
}
};


['CommonOptions', 'BuildOptions', 'TransformOptions'].forEach(readonlyInterface);
['OutputFile'].forEach(convertAccessors);
removeFromInterface('BuildOptions', ['entryPoints', 'stdin', 'plugins', 'watch']);
esbuildTypes.getInterface('CommonOptions')?.getProperty('mangleProps')?.setType('any');
esbuildTypes.getInterface('CommonOptions')?.getProperty('reserveProps')?.setType('any');
Expand Down
12 changes: 12 additions & 0 deletions API.md

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

Loading