MCPcopy Create free account
hub / github.com/vercel/vercel / handleFileCreated

Method handleFileCreated

packages/cli/src/util/dev/server.ts:425–449  ·  view source on GitHub ↗
(
    fsPath: string,
    changed: Set<string>,
    removed: Set<string>
  )

Source from the content-addressed store, hash-verified

423 }
424
425 async handleFileCreated(
426 fsPath: string,
427 changed: Set<string>,
428 removed: Set<string>
429 ): Promise<void> {
430 const name = relative(this.cwd, fsPath);
431 try {
432 await this.getVercelConfig();
433
434 this.files[name] = await FileFsRef.fromFsPath({ fsPath });
435 const extensionless = this.getExtensionlessFile(name);
436 if (extensionless) {
437 this.files[extensionless] = await FileFsRef.fromFsPath({ fsPath });
438 }
439 fileChanged(name, changed, removed);
440 output.debug(`File created: ${name}`);
441 } catch (err: unknown) {
442 if (isErrnoException(err) && err.code === 'ENOENT') {
443 output.debug(`File created, but has since been deleted: ${name}`);
444 fileRemoved(name, this.files, changed, removed);
445 } else {
446 throw err;
447 }
448 }
449 }
450
451 handleFileDeleted(
452 fsPath: string,

Callers 1

Calls 7

getVercelConfigMethod · 0.95
relativeFunction · 0.90
isErrnoExceptionFunction · 0.90
fileChangedFunction · 0.85
fileRemovedFunction · 0.85
fromFsPathMethod · 0.80
debugMethod · 0.80

Tested by

no test coverage detected