| /interface/sdk-js/build-tools/collect_application_api/src/ |
| D | api_recognizer.js | 38 visitNode(node, fileName) { argument 39 this.recognizeDecorators(node, fileName, undefined); 40 if (this.isArkUIRenderMethod(node)) { 41 this.visitUIRenderNode(node.body, fileName); 43 this.visitNormalNode(node, fileName); 47 recognizeDecorators(node, fileName, position) { argument 49 if (node.decorators) { 50 decoratorArray = node.decorators; 51 } else if (node.modifiers) { 52 decoratorArray = node.modifiers; [all …]
|
| /interface/sdk-js/build-tools/api_check_plugin/src/ |
| D | check_hump.js | 46 function getName(node) { argument 47 if (node.name.escapedText) { 48 return node.name.escapedText.toString(); 49 } else if (node.name.text) { 50 return node.name.text.toString(); 55 function isConstantDecorator(node, name) { argument 56 return hasAPINote(node) && getApiInfo(node).isConstant && !checkAllUppercaseHump(name); 59 function filterApiVersion(node, version) { argument 60 const apiVersion = getApiVersion(node); 64 function checkAPINameOfHump(node, sourcefile, fileName) { argument [all …]
|
| D | check_event_subscription.js | 22 function checkOnAndOffAppearInPair(node, sourcefile, fileName, onEventAllNames, onEventCheckNames, … argument 26 …addAPICheckErrorLogs(node, sourcefile, fileName, ErrorType.API_PAIR_ERRORS, checkErrorResult, LogT… 33 …addAPICheckErrorLogs(node, sourcefile, fileName, ErrorType.API_PAIR_ERRORS, checkErrorResult, LogT… 39 function checkTheFirstParameter(node, sourcefile, fileName) { argument 41 if (!checkVersionNeedCheck(node)) { 44 if (node.parameters && node.parameters.length > 0 && node.parameters[0].type) { 45 const firstParameterType = node.parameters[0].type; 53 …addAPICheckErrorLogs(node, sourcefile, fileName, ErrorType.PARAMETER_ERRORS, checkErrorResult, Log… 65 …addAPICheckErrorLogs(node, sourcefile, fileName, ErrorType.PARAMETER_ERRORS, checkErrorResult, Log… 71 function isBasicType(node) { argument [all …]
|
| D | api_check_plugin.js | 78 return (node) => { 79 checkAPIFileName(node, fileName); 80 checkAllNode(node, node, fileName); 81 return node; 86 function checkAllNode(node, sourcefile, fileName) { argument 87 if (!ts.isImportDeclaration(node) && !ts.isSourceFile(node)) { 89 checkAPINameOfHump(node, sourcefile, fileName); 91 if (hasAPINote(node)) { 93 checkAPIDecorators(node, sourcefile, fileName); 95 checkSpelling(node, sourcefile, fileName); [all …]
|
| D | compile_info.js | 31 function addAPICheckErrorLogs(node, sourcefile, fileName, errorType, errorInfo, type, level) { argument 36 const posOfNode = sourcefile.getLineAndCharacterOfPosition(node.getStart()); 39 const needMask = checkMarkError(node, errorMessage, baseFileName); 52 version: getApiInfo(node).version, 55 apiName: node.symbol ? node.symbol.escapedName : '', 56 apiFullText: node.getFullText(), 69 function checkMarkError(node, errorMessage, baseFileName) { argument 72 if (node.name?.text) { 73 apiName = node.name.text; 74 } else if (node.escapedText) { [all …]
|
| D | check_naming.js | 29 function checkNaming(node, sourcefile, fileName) { argument 31 const apiVersion = Number(getApiVersion(node)); 37 checkApiNaming(node, sourcefile, fileName); 40 checkApiNaming(node, sourcefile, fileName); 47 function checkApiNaming(node, sourcefile, fileName) { argument 48 const lowIdentifier = node.getText().toLowerCase(); 50 getParentkind(node, apiParentKind); 51 if (node.parent.kind === ts.SyntaxKind.TypeReference|| apiParentKind.includes('JSDoc')) { 54 checkApiNamingWords(node, sourcefile, fileName, lowIdentifier); 55 checkApiNamingScenario(node, sourcefile, fileName, lowIdentifier); [all …]
|
| D | check_legality.js | 24 function checkJsDocLegality(node, comments, checkInfoMap) { argument 26 legalityCheck(node, comments, commentNodeWhiteList, ['since'], true, checkInfoMap); 28 …legalityCheck(node, comments, getIllegalKinds([ts.SyntaxKind.ModuleDeclaration, ts.SyntaxKind.Clas… 31 legalityCheck(node, comments, [ts.SyntaxKind.VariableStatement], ['constant'], true, checkInfoMap, 37 legalityCheck(node, comments, [ts.SyntaxKind.EnumDeclaration], ['enum'], true, checkInfoMap); 39 legalityCheck(node, comments, [ts.SyntaxKind.ClassDeclaration], ['extends'], true, checkInfoMap, 54 …legalityCheck(node, comments, [ts.SyntaxKind.ModuleDeclaration], ['namespace'], true, checkInfoMap… 56 legalityCheck(node, comments, [ts.SyntaxKind.FunctionDeclaration, ts.SyntaxKind.MethodSignature, 67 legalityCheck(node, comments, [ts.SyntaxKind.FunctionDeclaration, ts.SyntaxKind.MethodSignature, 80 legalityCheck(node, comments, commentNodeWhiteList, ['useinstead'], true, checkInfoMap, [all …]
|
| D | check_any.js | 21 function checkAnyInAPI(node, sourcefile, fileName) { argument 22 if (node.kind === ts.SyntaxKind.AnyKeyword && checkVersionNeedCheck(node)) { 23 …addAPICheckErrorLogs(node, sourcefile, fileName, ErrorType.ILLEGAL_ANY, ErrorValueInfo.ILLEGAL_USE…
|
| D | check_decorator.js | 23 function checkAPIDecorators(node, sourcefile, fileName) { argument 24 const apiNote = getAPINote(node); 25 if (API_ERROR_DECORATOR_POS.has(node.pos)) { 49 API_ERROR_DECORATOR_POS.add(node.pos); 51 …addAPICheckErrorLogs(node, sourcefile, fileName, ErrorType.UNKNOW_DECORATOR, errorInfo, FileType.J…
|
| D | check_spelling.js | 30 function checkSpelling(node, sourcefile, fileName) { argument 31 if (ts.isIdentifier(node) && node.escapedText) { 32 checkWordSpelling(node.escapedText.toString(), node, sourcefile, fileName, FileType.API); 33 } else if (hasAPINote(node)) { 34 const apiNote = getAPINote(node); 37 checkWordSpelling(word, node, sourcefile, fileName, FileType.JSDOC); 43 function checkWordSpelling(nodeText, node, sourcefile, fileName, type) { argument 70 …addAPICheckErrorLogs(node, sourcefile, fileName, ErrorType.MISSPELL_WORDS, errorInfo, type, ErrorL…
|
| D | check_diff_changes.js | 91 function checkApiChangeVersion(currentJSDoc, lastJSDoc, node) { argument 97 node: node, property 155 function checkCurrentJSDocChange(newNodeJSDocs, statusCode, node) { argument 162 checkApiChangeVersion(currentJSDoc, lastJSDoc, node); 168 node: node, property 192 node: node, property 229 node: change.newNode, property 236 node: change.newNode, property 242 node: change.newNode, property 292 node: change.newNode, property [all …]
|
| D | utils.js | 59 function getAPINote(node) { argument 60 const apiLength = node.getText().length; 61 const apiFullLength = node.getFullText().length; 62 return node.getFullText().substring(0, apiFullLength - apiLength); 66 function hasAPINote(node) { argument 67 if (!node) { 70 const apiNote = getAPINote(node).replace(/[\s]/g, ''); 223 function getApiInfo(node) { argument 224 const notesStr = getAPINote(node); 274 function getApiVersion(node) { argument [all …]
|
| /interface/sdk-js/build-tools/jsdoc_format_plugin/src/core/ |
| D | apiSplitProcessor.ts | 43 onTransformNode(node: comment.CommentNode): ts.Node | undefined { 44 if (node.astNode === undefined) { 47 const nodeProcessor = nodeProcessorMap.get(node.astNode.kind); 48 return nodeProcessor ? nodeProcessor(node.astNode, this.context) : undefined; 57 static splitEventValues(node: ts.Node): string[] { 59 …if (ts.isFunctionDeclaration(node) || ts.isMethodDeclaration(node) || ts.isMethodSignature(node)) { 61 if (node.name && ts.isIdentifier(node.name)) { 62 functionName = node.name.getText(); 67 if ((node.parameters[0].type) && (node.parameters[0].type.kind === ts.SyntaxKind.UnionType)) { 68 … const types: ts.NodeArray<ts.TypeNode> = (node.parameters[0].type as ts.UnionTypeNode).types; [all …]
|
| D | modificationProcessor.ts | 48 onVisitNode(node: comment.CommentNode): void { 49 if (node.astNode) { 50 const curNode: ts.Node = node.astNode; 52 …const checkResults = apiChecker.checkJSDoc(node.astNode, node.astNode?.getSourceFile(), this.conte… 54 … const newCommentInfos: comment.CommentInfo[] = node.commentInfos ? [...node.commentInfos] : []; 60 …this.addInheritTags(node, curNode, commentInfo, newCommentInfos, index === newCommentInfos.length … 64 if (newCommentIndexs.length > 0 && node.commentInfos) { 72 …this.addMissingTags(node, curNode, curCommentInfo, newCommentInfos, checkResult.missingTags, index… 88 CommentHelper.setComment(node.astNode, newCommentInfos); 91 addInheritTags(node: comment.CommentNode, curNode: ts.Node, commentInfo: comment.CommentInfo, [all …]
|
| D | rawCodeProcessor.ts | 35 onVisitNode(node: comment.CommentNode): void { 36 if (node.astNode) { 37 const nodeSignature = AstNodeHelper.getNodeSignature(node.astNode); 41 const sourceFile = node.astNode.getSourceFile(); 45 const { line, character } = sourceFile.getLineAndCharacterOfPosition(node.astNode.getStart()); 46 this.rawSourceCodeInfo?.addRawNodeInfo(nodeSignature, node.astNode, line + 1, character);
|
| D | outputProcessor.ts | 54 onVisitNode(node: comment.CommentNode): void { 55 if (node.astNode && node.commentInfos && node.commentInfos.length > 0) { 56 CommentHelper.addComment(node.astNode, node.commentInfos); 92 private nodeVisitor(node: ts.Node): void { 93 if (!ts.isNumericLiteral(node)) { 94 node.forEachChild((child) => { 98 const value = node.getText().trim(); 114 this.content = StringUtils.replaceAt(this.content!, node.getStart(), replacement);
|
| D | coreImpls.ts | 134 function getCommentNode(node: ts.Node, parentNode: comment.CommentNode | undefined, sourceFile: ts.… 135 …const leadingComments: comment.CommentInfo[] = CommentHelper.getNodeLeadingComments(node, sourceFi… 137 astNode: node, 170 private shouldNotify(node: ts.Node): boolean { 172 return this.commentNodeWhiteList.includes(node.kind); 175 private shouldForEachChildren(node: ts.Node): boolean { 195 function visitor(node: ts.Node): ts.Node { 196 const commentNode = getCommentNode(node, undefined, transformSourceFile!); 198 return ts.visitEachChild(newNode ? newNode : node, visitor, context); 221 …function nodeVisitor(node: ts.Node, parentNode: comment.CommentNode | undefined, sourceFile: ts.So… [all …]
|
| D | asynchronousFunctionProcessor.ts | 47 logReportProcess(node: MethodNodeType, comments: Array<comment.CommentInfo>): void { 48 const apiName: string = node.name ? node.name.getText() : ''; constant 50 …const modifyLogResult: ModifyLogResult = LogResult.createModifyResult(node, comments, description,… 107 isAsynchronousFunction(node: MethodNodeType): boolean { 108 if (node.type && (node.type.kind === ts.SyntaxKind.TypeReference) && 109 (node.type as ts.TypeReferenceNode).typeName.getText() === 'Promise') { 112 if (node.parameters.length !== 0) { 113 for (let i = node.parameters.length - 1; i >= 0; i--) { 114 const param: ts.ParameterDeclaration = node.parameters[i];
|
| /interface/sdk-js/build-tools/ |
| D | delete_systemapi_plugin.js | 353 return (node) => { 354 sourceFile = node; 355 collectAllIdentifier(node); // 获取所有标识符 356 formatValue = formatAllNodes(url, node, allIdentifierSet); // 获取所有节点 357 node = formatValue.node; 363 if (!isEmptyFile(node)) { 365 let result = printer.printNode(ts.EmitHint.Unspecified, node, sourceFile); 370 copyrightMessage = node.getFullText().replace(node.getText(), ''); 381 return node; 383 function collectAllIdentifier(node) { argument [all …]
|
| /interface/sdk-js/build-tools/dts_parser/src/coreImpl/parser/ |
| D | NodeProcessor.ts | 81 …static processNode(node: ts.Node, parentMap: FileInfoMap | ApiInfosMap, parentApiInfo: BasicApiInf… 82 const nodeProcessor: NodeProcessorInterface | undefined = nodeProcessorMap.get(node.kind); 86 const apiInfo: BasicApiInfo = nodeProcessor(node, parentApiInfo); 87 const currentMap: BasicApiInfoMap = NodeProcessorHelper.setApiInfo(apiInfo, parentMap, node); 88 const childNodes: ts.NodeArray<ts.Node> | undefined = NodeProcessorHelper.getChildNodes(node); 105 …static setApiInfo(apiInfo: BasicApiInfo, parentMap: FileInfoMap | ApiInfosMap, node: ts.Node): Bas… 111 apiInfos = NodeProcessorHelper.processOnOrOffMethod(apiInfo, node); 158 static processOnOrOffMethod(apiInfo: BasicApiInfo, node: ts.Node): BasicApiInfo[] { 162 node as MethodType 247 static getChildNodes(node: ts.Node): ts.NodeArray<ts.Node> | undefined { [all …]
|
| /interface/sdk-js/build-tools/api_check_plugin/src/check_jsdoc_value/ |
| D | check_rest_value.js | 21 function checkExtendsValue(tag, node, fileName) { argument 28 if (ts.isClassDeclaration(node) || ts.isInterfaceDeclaration(node)) { 29 const apiValue = node.heritageClauses ? node.heritageClauses[0].types[0].getText() : ''; 39 function checkEnumValue(tag, node, fileName) { argument 57 function checkSinceValue(tag, node, fileName) { argument 64 if (!checkNumber && commentNodeWhiteList.includes(node.kind)) { 72 function checkReturnsValue(tag, node, fileName) { argument 79 if (!commentNodeWhiteList.includes(node.kind)) { 82 let apiReturnsValue = getDeclareValue(node.type); 100 function checkParamValue(tag, node, fileName, tagIndex) { argument [all …]
|
| D | check_order.js | 96 function checkAPITagName(tag, node, sourcefile, fileName, JSDocIndec) { argument 104 if (!decoratorRuleSet.has(tagName) && commentNodeWhiteList.includes(node.kind)) { 107 …addAPICheckErrorLogs(node, sourcefile, fileName, ErrorType.WRONG_SCENE, APITagNameResult.errorInfo, 114 function checkParentInheritTag(node, inheritTag, inheritResult, JSocIndex) { argument 116 if (ts.isSourceFile(node.parent)) { 119 if (!ts.isModuleBlock(node.parent)) { 120 const comments = parseJsDoc(node.parent); 129 checkParentInheritTag(node.parent, inheritTag, inheritResult, JSocIndex); 132 } else if (ts.isModuleBlock(node.parent)) { 133 checkParentInheritTag(node.parent, inheritTag, inheritResult, JSocIndex); [all …]
|
| /interface/sdk-js/build-tools/api_diff/src/ |
| D | jsdoc_diff.js | 167 while (!syscap && !ts.isSourceFile(curApi.node)) { 170 if (!syscap && ts.isSourceFile(curApi.node)) { 171 const fileContent = curApi.node.getFullText(); 189 while (curApi && !ts.isSourceFile(curApi.node)) { 308 oldApi.node, 309 newApi.node 319 oldApi.node, 320 newApi.node 349 oldApi.node, 350 newApi.node [all …]
|
| /interface/sdk-js/build-tools/dts_parser/ |
| D | README_zh.md | 81 node --nolazy -r ts-node/register ./src/main.ts -N diff --old 旧版本目录/文件(sdk/windows/ets) --new 新版本目录… 98 node --nolazy -r ts-node/register ./src/main.ts -N collect -C 目录路径/文件路径 --output 报告输出目录 --format ex… 105 通过commander调用相关工具,[调用入口](src/main.ts)只有(src/main.ts),到当前目录下,执行命令 ts-node ./src/main.ts 后接相关参数。 124 ts-node ./src/main.ts '-N' 'diff' '-C' '.\test\ut\parser\ut_jsdoc_constant_001.d.ts' '--old' '.\tes… 128 node --nolazy -r ts-node/register ./src/main.ts '-N' 'diff' '-C' '.\test\ut\parser\ut_jsdoc_constan… 132 node ./package/JS_API_OPTIMIZE_PLUGIN.js '-N' 'diff' '-C' '.\test\ut\parser\ut_jsdoc_constant_001.… 147 1. 先确认本地node版本是否为14版本,本工具只支持使用14版本的node 174 3、根据上方的工具调用说明,通过node和参数来调用相关方法 179 node ./package/JS_API_OPTIMIZE_PLUGIN.js '-N' 'diff' '-C' '.\test\ut\parser\ut_jsdoc_constant_001.d…
|
| /interface/sdk-js/build-tools/collect_application_api/ |
| D | README_zh.md | 16 node .\src\entry\main.js --app 工程根目录 --sdk sdk根目录/9/ets --output 报告的输出路径 --format excel 22 node .\src\entry\main.js --appDir --sdkRoot sdk根目录 --output 报告的输出路径 --format excel 42 node api-collector.js -h 69 node api-collector.js --app 工程根目录 --sdk sdk根目录/9/ets --output 报告的输出路径 --format excel 82 node api-collector.js --app 工程根目录 --sdkRoot sdk根目录 88 node api-collector.js --app 工程根目录 --sdk sdk根目录/9/ets 94 node .\src\entry\main.js --appDir --sdkRoot sdk根目录 --output 报告的输出路径 --format excel 105 node api-collector.js --appDir 文件夹路径 --sdkRoot sdk根目录
|