chore(dotnet): stop generating adapters (#7513)
This commit is contained in:
parent
d1170b30fc
commit
61365b21ce
|
|
@ -48,9 +48,8 @@ const apiDir = path.join(outputDir, 'API', 'Generated');
|
||||||
const optionsDir = path.join(outputDir, 'API', 'Generated', 'Options');
|
const optionsDir = path.join(outputDir, 'API', 'Generated', 'Options');
|
||||||
const enumsDir = path.join(outputDir, 'API', 'Generated', 'Enums');
|
const enumsDir = path.join(outputDir, 'API', 'Generated', 'Enums');
|
||||||
const typesDir = path.join(outputDir, 'API', 'Generated', 'Types');
|
const typesDir = path.join(outputDir, 'API', 'Generated', 'Types');
|
||||||
const adaptersDir = path.join(outputDir, 'Generated', 'Adapters');
|
|
||||||
|
|
||||||
for (const dir of [apiDir, optionsDir, enumsDir, typesDir, adaptersDir])
|
for (const dir of [apiDir, optionsDir, enumsDir, typesDir])
|
||||||
fs.mkdirSync(dir, { recursive: true });
|
fs.mkdirSync(dir, { recursive: true });
|
||||||
|
|
||||||
const documentation = parseApi(path.join(PROJECT_DIR, 'docs', 'src', 'api'));
|
const documentation = parseApi(path.join(PROJECT_DIR, 'docs', 'src', 'api'));
|
||||||
|
|
@ -152,42 +151,6 @@ function renderClass(clazz) {
|
||||||
clazz.extends ? `I${toTitleCase(clazz.extends)}` : null);
|
clazz.extends ? `I${toTitleCase(clazz.extends)}` : null);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* @param {Documentation.Class} clazz
|
|
||||||
*/
|
|
||||||
function renderBaseClass(clazz) {
|
|
||||||
const name = clazz.name;
|
|
||||||
if (name === 'TimeoutException')
|
|
||||||
return;
|
|
||||||
|
|
||||||
const methodsWithOptions = [];
|
|
||||||
for (const member of clazz.membersArray) {
|
|
||||||
if (member.kind !== 'method')
|
|
||||||
continue;
|
|
||||||
if (member.argsArray.find(a => a.name === 'options'))
|
|
||||||
methodsWithOptions.push(member);
|
|
||||||
}
|
|
||||||
|
|
||||||
if (!methodsWithOptions.length)
|
|
||||||
return;
|
|
||||||
|
|
||||||
const body = [];
|
|
||||||
for (const member of methodsWithOptions) {
|
|
||||||
if (member.alias.startsWith('RunAnd'))
|
|
||||||
renderMethod(member, clazz, toMemberName(member), { mode: 'base', nodocs: true, public: true, trimRunAndPrefix: true }, body);
|
|
||||||
renderMethod(member, clazz, toMemberName(member), { mode: 'base', nodocs: true, public: true }, body);
|
|
||||||
}
|
|
||||||
|
|
||||||
writeFile(
|
|
||||||
'internal partial class',
|
|
||||||
name,
|
|
||||||
[],
|
|
||||||
body,
|
|
||||||
adaptersDir,
|
|
||||||
null,
|
|
||||||
'Microsoft.Playwright.Core');
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @param {string} name
|
* @param {string} name
|
||||||
* @param {Documentation.Type} type
|
* @param {Documentation.Type} type
|
||||||
|
|
@ -250,7 +213,6 @@ function renderOptionType(name, type) {
|
||||||
|
|
||||||
for (const element of documentation.classesArray) {
|
for (const element of documentation.classesArray) {
|
||||||
renderClass(element);
|
renderClass(element);
|
||||||
renderBaseClass(element);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
for (let [name, type] of optionTypes)
|
for (let [name, type] of optionTypes)
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue