MCPcopy
hub / github.com/QwikDev/qwik / createTypesApi

Function createTypesApi

scripts/api.ts:206–260  ·  view source on GitHub ↗
(
  config: BuildConfig,
  inPath: string,
  outPath: string,
  relativePath?: string
)

Source from the content-addressed store, hash-verified

204}
205
206function createTypesApi(
207 config: BuildConfig,
208 inPath: string,
209 outPath: string,
210 relativePath?: string
211) {
212 const extractorConfigPath = join(inPath, 'api-extractor.json');
213 const extractorConfig = ExtractorConfig.loadFileAndPrepare(extractorConfigPath);
214 const result = Extractor.invoke(extractorConfig, {
215 localBuild: !!config.dev,
216 showVerboseMessages: true,
217 showDiagnostics: true,
218 messageCallback(msg) {
219 msg.handled = true;
220 if (msg.logLevel === 'verbose') {
221 return;
222 }
223 if (msg.text.includes('Analysis will use')) {
224 return;
225 }
226 if (msg.messageId === 'console-api-report-copied') {
227 if (config.dev) {
228 return;
229 }
230 console.error(
231 `❌ API Extractor, submodule: "${inPath}"\n${extractorConfigPath} has API changes.\n`
232 );
233 return;
234 }
235 if (
236 msg.messageId === 'console-compiler-version-notice' ||
237 msg.messageId === 'ae-undocumented'
238 ) {
239 return;
240 }
241 console.error(`❌ API Extractor, submodule: "${inPath}"\n${extractorConfigPath}\n`, msg);
242 },
243 });
244 if (!result.succeeded) {
245 console.log(
246 'API build results: API changed',
247 result.apiReportChanged,
248 'errors',
249 result.errorCount,
250 'warnings',
251 result.warningCount
252 );
253 panic(
254 `Use "pnpm api.update" to automatically update the .md files if the api changes were expected`
255 );
256 }
257 const srcPath = result.extractorConfig.untrimmedFilePath;
258 const content = fixDtsContent(config, srcPath, relativePath);
259 writeFileSync(outPath, content);
260}
261
262function generateQwikCityReferenceModules(config: BuildConfig) {
263 const srcModulesPath = join(config.packagesDir, 'qwik-city', 'lib');

Callers 2

apiExtractorQwikFunction · 0.85
apiExtractorQwikCityFunction · 0.85

Calls 3

panicFunction · 0.90
joinFunction · 0.85
fixDtsContentFunction · 0.85

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…