Commit 107cdd2d authored by DatHV's avatar DatHV
Browse files

update build x-app-sdk

parent 9bb8aadd
Pipeline #2082 failed with stages
in 0 seconds
{"version":3,"file":"SourceFileLocationFormatter.d.ts","sourceRoot":"","sources":["../../src/analyzer/SourceFileLocationFormatter.ts"],"names":[],"mappings":"AAKA,OAAO,KAAK,KAAK,EAAE,MAAM,YAAY,CAAC;AAItC,MAAM,WAAW,gCAAgC;IAC/C,cAAc,CAAC,EAAE,MAAM,CAAC;IACxB,gBAAgB,CAAC,EAAE,MAAM,CAAC;IAC1B,wBAAwB,CAAC,EAAE,MAAM,CAAC;CACnC;AAED,qBAAa,2BAA2B;IACtC;;;OAGG;WACW,iBAAiB,CAAC,IAAI,EAAE,EAAE,CAAC,IAAI,EAAE,wBAAwB,CAAC,EAAE,MAAM,GAAG,MAAM;WAW3E,UAAU,CAAC,cAAc,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE,gCAAgC,GAAG,MAAM;CA+BrG"}
\ No newline at end of file
"use strict";
// Copyright (c) Microsoft Corporation. All rights reserved. Licensed under the MIT license.
// See LICENSE in the project root for license information.
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
if (k2 === undefined) k2 = k;
var desc = Object.getOwnPropertyDescriptor(m, k);
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
desc = { enumerable: true, get: function() { return m[k]; } };
}
Object.defineProperty(o, k2, desc);
}) : (function(o, m, k, k2) {
if (k2 === undefined) k2 = k;
o[k2] = m[k];
}));
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
Object.defineProperty(o, "default", { enumerable: true, value: v });
}) : function(o, v) {
o["default"] = v;
});
var __importStar = (this && this.__importStar) || (function () {
var ownKeys = function(o) {
ownKeys = Object.getOwnPropertyNames || function (o) {
var ar = [];
for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
return ar;
};
return ownKeys(o);
};
return function (mod) {
if (mod && mod.__esModule) return mod;
var result = {};
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
__setModuleDefault(result, mod);
return result;
};
})();
Object.defineProperty(exports, "__esModule", { value: true });
exports.SourceFileLocationFormatter = void 0;
const path = __importStar(require("node:path"));
const node_core_library_1 = require("@rushstack/node-core-library");
class SourceFileLocationFormatter {
/**
* Returns a string such as this, based on the context information in the provided node:
* "[C:\Folder\File.ts#123]"
*/
static formatDeclaration(node, workingPackageFolderPath) {
const sourceFile = node.getSourceFile();
const lineAndCharacter = sourceFile.getLineAndCharacterOfPosition(node.getStart());
return SourceFileLocationFormatter.formatPath(sourceFile.fileName, {
sourceFileLine: lineAndCharacter.line + 1,
sourceFileColumn: lineAndCharacter.character + 1,
workingPackageFolderPath
});
}
static formatPath(sourceFilePath, options) {
if (!options) {
options = {};
}
let result = '';
// Make the path relative to the workingPackageFolderPath
let scrubbedPath = sourceFilePath;
if (options.workingPackageFolderPath) {
// If it's under the working folder, make it a relative path
if (node_core_library_1.Path.isUnderOrEqual(sourceFilePath, options.workingPackageFolderPath)) {
scrubbedPath = path.relative(options.workingPackageFolderPath, sourceFilePath);
}
}
// Convert it to a Unix-style path
scrubbedPath = node_core_library_1.Text.replaceAll(scrubbedPath, '\\', '/');
result += scrubbedPath;
if (options.sourceFileLine) {
result += `:${options.sourceFileLine}`;
if (options.sourceFileColumn) {
result += `:${options.sourceFileColumn}`;
}
}
return result;
}
}
exports.SourceFileLocationFormatter = SourceFileLocationFormatter;
//# sourceMappingURL=SourceFileLocationFormatter.js.map
\ No newline at end of file
{"version":3,"file":"SourceFileLocationFormatter.js","sourceRoot":"","sources":["../../src/analyzer/SourceFileLocationFormatter.ts"],"names":[],"mappings":";AAAA,4FAA4F;AAC5F,2DAA2D;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAE3D,gDAAkC;AAIlC,oEAA0D;AAQ1D,MAAa,2BAA2B;IACtC;;;OAGG;IACI,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AC;QAED,OAAO,MAAM,CAAC;IAChB,CAAC;CACF;AA/CD,kEA+CC","sourcesContent":["// Copyright (c) Microsoft Corporation. All rights reserved. Licensed under the MIT license.\n// See LICENSE in the project root for license information.\n\nimport * as path from 'node:path';\n\nimport type * as ts from 'typescript';\n\nimport { Path, Text } from '@rushstack/node-core-library';\n\nexport interface ISourceFileLocationFormatOptions {\n sourceFileLine?: number;\n sourceFileColumn?: number;\n workingPackageFolderPath?: string;\n}\n\nexport class SourceFileLocationFormatter {\n /**\n * Returns a string such as this, based on the context information in the provided node:\n * \"[C:\\Folder\\File.ts#123]\"\n */\n public static formatDeclaration(node: ts.Node, workingPackageFolderPath?: string): string {\n const sourceFile: ts.SourceFile = node.getSourceFile();\n const lineAndCharacter: ts.LineAndCharacter = sourceFile.getLineAndCharacterOfPosition(node.getStart());\n\n return SourceFileLocationFormatter.formatPath(sourceFile.fileName, {\n sourceFileLine: lineAndCharacter.line + 1,\n sourceFileColumn: lineAndCharacter.character + 1,\n workingPackageFolderPath\n });\n }\n\n public static formatPath(sourceFilePath: string, options?: ISourceFileLocationFormatOptions): string {\n if (!options) {\n options = {};\n }\n\n let result: string = '';\n\n // Make the path relative to the workingPackageFolderPath\n let scrubbedPath: string = sourceFilePath;\n\n if (options.workingPackageFolderPath) {\n // If it's under the working folder, make it a relative path\n if (Path.isUnderOrEqual(sourceFilePath, options.workingPackageFolderPath)) {\n scrubbedPath = path.relative(options.workingPackageFolderPath, sourceFilePath);\n }\n }\n\n // Convert it to a Unix-style path\n scrubbedPath = Text.replaceAll(scrubbedPath, '\\\\', '/');\n result += scrubbedPath;\n\n if (options.sourceFileLine) {\n result += `:${options.sourceFileLine}`;\n\n if (options.sourceFileColumn) {\n result += `:${options.sourceFileColumn}`;\n }\n }\n\n return result;\n }\n}\n"]}
\ No newline at end of file
import * as ts from 'typescript';
import { IndentedWriter } from '../generators/IndentedWriter';
/**
* Choices for SpanModification.indentDocComment.
*/
export declare enum IndentDocCommentScope {
/**
* Do not detect and indent comments.
*/
None = 0,
/**
* Look for one doc comment in the {@link Span.prefix} text only.
*/
PrefixOnly = 1,
/**
* Look for one doc comment potentially distributed across the Span and its children.
*/
SpanAndChildren = 2
}
/**
* Specifies various transformations that will be performed by Span.getModifiedText().
*/
export declare class SpanModification {
/**
* If true, all of the child spans will be omitted from the Span.getModifiedText() output.
* @remarks
* Also, the modify() operation will not recurse into these spans.
*/
omitChildren: boolean;
/**
* If true, then the Span.separator will be removed from the Span.getModifiedText() output.
*/
omitSeparatorAfter: boolean;
/**
* If true, then Span.getModifiedText() will sort the immediate children according to their Span.sortKey
* property. The separators will also be fixed up to ensure correct indentation. If the Span.sortKey is undefined
* for some items, those items will not be moved, i.e. their array indexes will be unchanged.
*/
sortChildren: boolean;
/**
* Used if the parent span has Span.sortChildren=true.
*/
sortKey: string | undefined;
/**
* Optionally configures getModifiedText() to search for a "/*" doc comment and indent it.
* At most one comment is detected.
*
* @remarks
* The indentation can be applied to the `Span.modifier.prefix` only, or it can be applied to the
* full subtree of nodes (as needed for `ts.SyntaxKind.JSDocComment` trees). However the enabled
* scopes must not overlap.
*
* This feature is enabled selectively because (1) we do not want to accidentally match `/*` appearing
* in a string literal or other expression that is not a comment, and (2) parsing comments is relatively
* expensive.
*/
indentDocComment: IndentDocCommentScope;
private readonly _span;
private _prefix;
private _suffix;
constructor(span: Span);
/**
* Allows the Span.prefix text to be changed.
*/
get prefix(): string;
set prefix(value: string);
/**
* Allows the Span.suffix text to be changed.
*/
get suffix(): string;
set suffix(value: string);
/**
* Reverts any modifications made to this object.
*/
reset(): void;
/**
* Effectively deletes the Span from the tree, by skipping its children, skipping its separator,
* and setting its prefix/suffix to the empty string.
*/
skipAll(): void;
}
/**
* The Span class provides a simple way to rewrite TypeScript source files
* based on simple syntax transformations, i.e. without having to process deeper aspects
* of the underlying grammar. An example transformation might be deleting JSDoc comments
* from a source file.
*
* @remarks
* TypeScript's abstract syntax tree (AST) is represented using Node objects.
* The Node text ignores its surrounding whitespace, and does not have an ordering guarantee.
* For example, a JSDocComment node can be a child of a FunctionDeclaration node, even though
* the actual comment precedes the function in the input stream.
*
* The Span class is a wrapper for a single Node, that provides access to every character
* in the input stream, such that Span.getText() will exactly reproduce the corresponding
* full Node.getText() output.
*
* A Span is comprised of these parts, which appear in sequential order:
* - A prefix
* - A collection of child spans
* - A suffix
* - A separator (e.g. whitespace between this span and the next item in the tree)
*
* These parts can be modified via Span.modification. The modification is applied by
* calling Span.getModifiedText().
*/
export declare class Span {
readonly node: ts.Node;
readonly startIndex: number;
readonly endIndex: number;
readonly children: Span[];
readonly modification: SpanModification;
private _parent;
private _previousSibling;
private _nextSibling;
private _separatorStartIndex;
private _separatorEndIndex;
constructor(node: ts.Node);
get kind(): ts.SyntaxKind;
/**
* The parent Span, if any.
* NOTE: This will be undefined for a root Span, even though the corresponding Node
* may have a parent in the AST.
*/
get parent(): Span | undefined;
/**
* If the current object is this.parent.children[i], then previousSibling corresponds
* to this.parent.children[i-1] if it exists.
* NOTE: This will be undefined for a root Span, even though the corresponding Node
* may have a previous sibling in the AST.
*/
get previousSibling(): Span | undefined;
/**
* If the current object is this.parent.children[i], then previousSibling corresponds
* to this.parent.children[i+1] if it exists.
* NOTE: This will be undefined for a root Span, even though the corresponding Node
* may have a previous sibling in the AST.
*/
get nextSibling(): Span | undefined;
/**
* The text associated with the underlying Node, up to its first child.
*/
get prefix(): string;
/**
* The text associated with the underlying Node, after its last child.
* If there are no children, this is always an empty string.
*/
get suffix(): string;
/**
* Whitespace that appeared after this node, and before the "next" node in the tree.
* Here we mean "next" according to an inorder traversal, not necessarily a sibling.
*/
get separator(): string;
/**
* Returns the separator of this Span, or else recursively calls getLastInnerSeparator()
* on the last child.
*/
getLastInnerSeparator(): string;
/**
* Returns the first parent node with the specified SyntaxKind, or undefined if there is no match.
*/
findFirstParent(kindToMatch: ts.SyntaxKind): Span | undefined;
/**
* Recursively invokes the callback on this Span and all its children. The callback
* can make changes to Span.modification for each node.
*/
forEach(callback: (span: Span) => void): void;
/**
* Returns the original unmodified text represented by this Span.
*/
getText(): string;
/**
* Returns the text represented by this Span, after applying all requested modifications.
*/
getModifiedText(): string;
writeModifiedText(output: IndentedWriter): void;
/**
* Returns a diagnostic dump of the tree, showing the prefix/suffix/separator for
* each node.
*/
getDump(indent?: string): string;
/**
* Returns a diagnostic dump of the tree, showing the SpanModification settings for each nodde.
*/
getModifiedDump(indent?: string): string;
/**
* Recursive implementation of `getModifiedText()` and `writeModifiedText()`.
*/
private _writeModifiedText;
private _beginIndentDocComment;
private _endIndentDocComment;
/**
* Writes one chunk of `text` to the `options.writer`, applying the `indentDocComment` rewriting.
*/
private _write;
private _getTrimmed;
private _getSubstring;
}
//# sourceMappingURL=Span.d.ts.map
\ No newline at end of file
{"version":3,"file":"Span.d.ts","sourceRoot":"","sources":["../../src/analyzer/Span.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,MAAM,YAAY,CAAC;AAIjC,OAAO,EAAE,cAAc,EAAE,MAAM,8BAA8B,CAAC;AA2B9D;;GAEG;AACH,oBAAY,qBAAqB;IAC/B;;OAEG;IACH,IAAI,IAAI;IAER;;OAEG;IACH,UAAU,IAAI;IAEd;;OAEG;IACH,eAAe,IAAI;CACpB;AAED;;GAEG;AACH,qBAAa,gBAAgB;IAC3B;;;;OAIG;IACI,YAAY,EAAE,OAAO,CAAS;IAErC;;OAEG;IACI,kBAAkB,EAAE,OAAO,CAAS;IAE3C;;;;OAIG;IACI,YAAY,EAAE,OAAO,CAAS;IAErC;;OAEG;IACI,OAAO,EAAE,MAAM,GAAG,SAAS,CAAC;IAEnC;;;;;;;;;;;;OAYG;IACI,gBAAgB,EAAE,qBAAqB,CAA8B;IAE5E,OAAO,CAAC,QAAQ,CAAC,KAAK,CAAO;IAC7B,OAAO,CAAC,OAAO,CAAqB;IACpC,OAAO,CAAC,OAAO,CAAqB;gBAEjB,IAAI,EAAE,IAAI;IAK7B;;OAEG;IACH,IAAW,MAAM,IAAI,MAAM,CAE1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OAAO,CAAC,QAAQ,EAAE,CAAC,IAAI,EAAE,IAAI,KAAK,IAAI,GAAG,IAAI;IAOpD;;OAEG;IACI,OAAO,IAAI,MAAM;IAcxB;;OAEG;IACI,eAAe,IAAI,MAAM;IAazB,iBAAiB,CAAC,MAAM,EAAE,cAAc,GAAG,IAAI;IAQtD;;;OAGG;IACI,OAAO,CAAC,MAAM,GAAE,MAAW,GAAG,MAAM;IAqB3C;;OAEG;IACI,eAAe,CAAC,MAAM,GAAE,MAAW,GAAG,MAAM;IAwCnD;;OAEG;IACH,OAAO,CAAC,kBAAkB;IAqH1B,OAAO,CAAC,sBAAsB;IAO9B,OAAO,CAAC,oBAAoB;IAO5B;;OAEG;IACH,OAAO,CAAC,MAAM;IA8Bd,OAAO,CAAC,WAAW;IAInB,OAAO,CAAC,aAAa;CAMtB"}
\ No newline at end of file
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment