• Home
  • Raw
  • Download

Lines Matching refs:filePath

87   let filePath: string;
90 filePath = node.moduleSpecifier.getText().replace(/'|"/g, '');
115 filePath = node.moduleReference.expression.text;
124 const fileResolvePath: string = getFileFullPath(filePath, pagesDir);
132 sourceFile = generateSourceFileAST(fileResolvePath, filePath);
143 function generateSourceFileAST(fileResolvePath: string, filePath: string): ts.SourceFile {
550 function isModule(filePath: string): boolean {
575 function isPackageJsonEntry(filePath: string): boolean {
576 const packageJsonPath: string = path.join(filePath, projectConfig.packageJson);
588 if (entryExist(filePath, entryTypes)) {
589 packageJsonEntry = path.resolve(filePath, entryTypes);
591 } else if (entryExist(filePath, entryMain)) {
592 packageJsonEntry = path.resolve(filePath, entryMain);
598 function entryExist(filePath: string, entry: string): boolean {
599 return typeof entry === 'string' && fs.existsSync(path.resolve(filePath, entry)) &&
600 fs.statSync(path.resolve(filePath, entry)).isFile();
603 function getModuleFilePath(filePath: string): string {
604 if (filePath && path.extname(filePath) !== EXTNAME_ETS && isModule(filePath)) {
605 filePath += EXTNAME_ETS;
607 return filePath;
610 function getFileResolvePath(fileResolvePath: string, pagesDir: string, filePath: string,
612 const moduleFilePath: string = getModuleFilePath(filePath);
619 if (new RegExp(`^@(${sdkConfigPrefix})\\.`).test(filePath.trim())) {
621 const systemModule: string = path.resolve(sdkConfigs[i].apiPath, filePath + '.d.ets');
642 if (filePath.indexOf(projectConfig.packageDir) > -1) {
643 fileResolvePath = path.join(curPageDir, filePath);
645 fileResolvePath = path.join(curPageDir, projectConfig.packageDir, filePath);
671 function getFileFullPath(filePath: string, pagesDir: string): string {
672 if (filePath && path.extname(filePath) !== EXTNAME_ETS && path.extname(filePath) !== EXTNAME_TS &&
673 !isModule(filePath)) {
674 const dirIndexEtsPath: string = path.resolve(path.resolve(pagesDir, filePath), INDEX_ETS);
675 const dirIndexTsPath: string = path.resolve(path.resolve(pagesDir, filePath), INDEX_TS);
676 …if (/^(\.|\.\.)\//.test(filePath) && !fs.existsSync(path.resolve(pagesDir, filePath + EXTNAME_ETS)…
678 filePath = dirIndexEtsPath;
679 …} else if (/^(\.|\.\.)\//.test(filePath) && !fs.existsSync(path.resolve(pagesDir, filePath + EXTNA…
681 filePath = dirIndexTsPath;
683 filePath += getExtensionIfUnfullySpecifiedFilepath(path.resolve(pagesDir, filePath));
688 if (/^(\.|\.\.)\//.test(filePath) && filePath.indexOf(projectConfig.packageDir) < 0) {
689 fileResolvePath = path.resolve(pagesDir, filePath);
690 } else if (/^\//.test(filePath) && filePath.indexOf(projectConfig.packageDir) < 0 ||
691 fs.existsSync(filePath) && fs.statSync(filePath).isFile()) {
692 fileResolvePath = filePath;
694 …fileResolvePath = getFileResolvePath(fileResolvePath, pagesDir, filePath, projectConfig.projectPat…