🆙 Add cms i using 🆙

This commit is contained in:
Remco
2025-11-25 22:42:56 +01:00
parent 94704e0925
commit d44196149e
35591 changed files with 3601123 additions and 0 deletions
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
@@ -0,0 +1,11 @@
/**
* Formats php comment
*
* @param comment
* @returns string
*/
export declare function formatPhpComment(comment: string): string;
declare const _default: {
formatPhpComment: typeof formatPhpComment;
};
export default _default;
@@ -0,0 +1,2 @@
export default class FormatError extends Error {
}
@@ -0,0 +1,216 @@
import detectIndent from 'detect-indent';
import { FormatterOption, CLIOption, BladeFormatterOption } from './main';
import * as util from './util';
export default class Formatter {
argumentCheck: any;
bladeBraces: any;
bladeComments: any;
bladeDirectives: any;
htmlAttributes: Array<string>;
currentIndentLevel: number;
diffs: any;
indentCharacter: any;
indentSize: any;
inlineDirectives: any;
conditions: any;
inlinePhpDirectives: any;
isInsideCommentBlock: any;
oniguruma: any;
options: FormatterOption & CLIOption;
rawBladeBraces: any;
ignoredLines: any;
curlyBracesWithJSs: any;
rawBlocks: any;
rawPhpTags: any;
rawPropsBlocks: any;
result: any;
nonnativeScripts: Array<string>;
scripts: any;
xData: any;
xInit: any;
htmlTags: Array<string>;
shouldBeIndent: any;
stack: any;
templatingStrings: any;
stringLiteralInPhp: Array<string>;
shorthandBindings: Array<string>;
componentAttributes: Array<string>;
customDirectives: Array<string>;
directivesInScript: Array<string>;
unbalancedDirectives: Array<string>;
escapedBladeDirectives: Array<string>;
phpComments: Array<string>;
vsctm: any;
wrapAttributes: any;
wrapLineLength: any;
defaultPhpFormatOption: util.FormatPhpOption;
endOfLine: string;
bladeDirectivesInStyle: Array<string>;
constructor(options: BladeFormatterOption);
formatContent(content: any): Promise<any>;
formatAsHtml(data: any): Promise<any>;
sortTailwindcssClasses(content: any): Promise<any>;
preserveIgnoredLines(content: any): Promise<any>;
preserveCurlyBraceForJS(content: any): Promise<any>;
preservePhpBlock(content: any): Promise<any>;
preservePropsBlock(content: any): Promise<any>;
preserveRawPhpBlock(content: any): Promise<any>;
preserveHtmlTags(content: string): Promise<any>;
/**
* preserve custom directives
* @param content
* @returns
*/
preserveCustomDirective(content: string): string;
preserveInlineDirective(content: string): string;
preserveInlinePhpDirective(content: any): Promise<any>;
preserveBladeDirectivesInScripts(content: any): any;
preserveBladeDirectivesInStyles(content: string): any;
/**
*
* @param content string between <script>~</script>
* @returns string
*/
preserveCustomDirectiveInScript(content: string): string;
/**
* Recursively insert line break before and after directives
* @param content string
* @returns
*/
breakLineBeforeAndAfterDirective(content: string): string;
preserveEscapedBladeDirective(content: string): Promise<any>;
preserveBladeComment(content: any): Promise<any>;
preservePhpComment(content: string): any;
preserveBladeBrace(content: any): Promise<any>;
preserveRawBladeBrace(content: any): Promise<any>;
preserveConditions(content: any): Promise<any>;
/**
* preserve unbalanced directive like @hasSection
*/
preserveUnbalancedDirective(content: any): string;
preserveRawPhpTags(content: any): Promise<any>;
preserveNonnativeScripts(content: string): Promise<any>;
preserveScripts(content: any): Promise<any>;
preserveHtmlAttributes(content: any): Promise<any>;
sortHtmlAttributes(content: string): Promise<string>;
preserveShorthandBinding(content: string): Promise<any>;
preserveComponentAttribute(content: string): Promise<any>;
formatXData(content: any): Promise<any>;
formatXInit(content: any): Promise<any>;
preserveStringLiteralInPhp(content: any): any;
storeIgnoredLines(value: any): any;
storeCurlyBraceForJS(value: any): any;
storeRawBlock(value: any): any;
storeInlineDirective(value: any): any;
storeConditions(value: any): any;
storeInlinePhpDirective(value: any): any;
storeRawPropsBlock(value: any): any;
storeBladeDirective(value: any): any;
storeBladeDirectiveInStyle(value: string): any;
storeEscapedBladeDirective(value: string): any;
storeBladeComment(value: any): any;
storePhpComment(value: string): any;
storeHtmlTag(value: string): any;
storeInlineCustomDirective(value: string): any;
storeBeginCustomDirective(value: string): any;
storeElseCustomDirective(value: string): any;
storeEndCustomDirective(value: string): any;
storeUnbalancedDirective(value: string): any;
storeBladeBrace(value: any, length: any): any;
storeRawBladeBrace(value: any): any;
storeRawPhpTags(value: any): any;
storeNonnativeScripts(value: string): any;
storeScripts(value: any): any;
storeHtmlAttribute(value: string): any;
storeShorthandBinding(value: any): any;
storeComponentAttribute(value: any): any;
storeXData(value: any): any;
storeXInit(value: any): any;
storeTemplatingString(value: any): any;
storeStringLiteralInPhp(value: any): any;
storeBladeDirectiveInScript(value: string): any;
getIgnoredLinePlaceholder(replace: any): any;
getCurlyBraceForJSPlaceholder(replace: any): any;
getRawPlaceholder(replace: any): any;
getInlinePlaceholder(replace: any, length?: number): any;
getConditionPlaceholder(replace: any): any;
getInlinePhpPlaceholder(replace: any): any;
getRawPropsPlaceholder(replace: any): any;
getBladeDirectivePlaceholder(replace: any): any;
getBladeDirectiveInStylePlaceholder(replace: string): any;
getEscapedBladeDirectivePlaceholder(replace: string): any;
getBladeCommentPlaceholder(replace: any): any;
getPhpCommentPlaceholder(replace: string): any;
getBladeBracePlaceholder(replace: any, length?: number): any;
getRawBladeBracePlaceholder(replace: any): any;
getRawPhpTagPlaceholder(replace: any): any;
getNonnativeScriptPlaceholder(replace: string): any;
getScriptPlaceholder(replace: any): any;
getHtmlTagPlaceholder(replace: string): any;
getInlineCustomDirectivePlaceholder(replace: string): any;
getBeginCustomDirectivePlaceholder(replace: string): any;
getElseCustomDirectivePlaceholder(replace: string): any;
getEndCustomDirectivePlaceholder(replace: string): any;
getUnbalancedDirectivePlaceholder(replace: string): any;
getHtmlAttributePlaceholder(replace: string, length: any): any;
getShorthandBindingPlaceholder(replace: string, length?: any): any;
getComponentAttributePlaceholder(replace: string): any;
getXInitPlaceholder(replace: any): any;
getPlaceholder(attribute: string, replace: any, length?: any): any;
getXDataPlaceholder(replace: any): any;
getTemplatingStringPlaceholder(replace: any): any;
getStringLiteralInPhpPlaceholder(replace: any): any;
getBladeDirectiveInScriptPlaceholder(replace: any): any;
restoreIgnoredLines(content: any): any;
restoreCurlyBraceForJS(content: any): any;
restorePhpBlock(content: any): Promise<any>;
restoreRawPhpBlock(content: any): Promise<any>;
restoreRawPropsBlock(content: any): Promise<any>;
isInline(content: any): boolean;
isMultilineStatement(rawBlock: any): boolean;
indentRawBlock(indent: detectIndent.Indent, content: any): any;
indentBladeDirectiveBlock(indent: detectIndent.Indent, content: any): any;
indentScriptBlock(indent: detectIndent.Indent, content: any): any;
indentRawPhpBlock(indent: detectIndent.Indent, content: any): any;
indentComponentAttribute(prefix: string, content: string): any;
indentPhpComment(indent: detectIndent.Indent, content: string): any;
restoreBladeDirectivesInStyles(content: string): any;
restoreBladeDirectivesInScripts(content: any): any;
formatPreservedBladeDirectives(directives: any): Promise<any[]>;
restoreBladeComment(content: any): Promise<any>;
restorePhpComment(content: string): any;
restoreEscapedBladeDirective(content: any): Promise<any>;
restoreBladeBrace(content: any): Promise<any>;
restoreRawBladeBrace(content: any): Promise<any>;
restoreInlineDirective(content: any): Promise<any>;
restoreConditions(content: any): Promise<any>;
restoreUnbalancedDirective(content: any): Promise<any>;
restoreInlinePhpDirective(content: any): Promise<any>;
restoreRawPhpTags(content: any): Promise<any>;
restoreNonnativeScripts(content: string): any;
restoreScripts(content: any): Promise<any>;
restoreCustomDirective(content: string): Promise<any>;
restoreInlineCustomDirective(content: string): Promise<any>;
restoreBeginCustomDirective(content: string): Promise<any>;
restoreElseCustomDirective(content: string): Promise<any>;
restoreEndCustomDirective(content: string): Promise<any>;
restoreHtmlTags(content: any): Promise<any>;
restoreHtmlAttributes(content: string): any;
restoreXData(content: any): any;
restoreXInit(content: any): any;
restoreTemplatingString(content: any): any;
restoreStringLiteralInPhp(content: any): any;
restoreComponentAttribute(content: string): string;
restoreShorthandBinding(content: any): any;
formatAsBlade(content: any): Promise<any>;
formatTokenizedLines(splitedLines: any, tokenizedLines: any): any;
processLine(tokenizeLineResult: any, originalLine: any): void;
processKeyword(token: any): void;
processToken(tokenStruct: any, token: any): void;
processTokenizeResult(tokenizeLineResult: any, originalLine: any): void;
insertFormattedLineToResult(originalLine: any): void;
incrementIndentLevel(level?: number): void;
decrementIndentLevel(level?: number): void;
formatExpressionInsideBladeDirective(matchedExpression: string, indent: detectIndent.Indent, wrapLength?: number | undefined): any;
formatJS(jsCode: string): string;
}
@@ -0,0 +1,22 @@
export declare const directivePrefix = "@";
export declare const indentStartTokens: string[];
export declare const indentStartTokensWithoutPrefix: any;
export declare const indentEndTokens: string[];
export declare const indentElseTokens: string[];
export declare const optionalStartWithoutEndTokens: {
'@section': number;
'@push': number;
'@prepend': number;
'@slot': number;
};
export declare const tokenForIndentStartOrElseTokens: string[];
export declare const indentStartOrElseTokens: string[];
export declare const indentStartAndEndTokens: string[];
export declare const phpKeywordStartTokens: string[];
export declare const phpKeywordEndTokens: string[];
export declare const inlinePhpDirectives: string[];
export declare const inlineFunctionTokens: string[];
export declare const conditionalTokens: string[];
export declare const unbalancedStartTokens: string[];
export declare const cssAtRuleTokens: string[];
export declare function hasStartAndEndToken(tokenizeLineResult: any, originalLine: any): boolean;
@@ -0,0 +1,67 @@
import { Config as TailwindConfig } from 'tailwindcss/types/config';
import Formatter from './formatter';
import { EndOfLine, RuntimeConfig, SortHtmlAttributes, WrapAttributes } from './runtimeConfig';
export type CLIOption = {
write?: boolean;
diff?: boolean;
checkFormatted?: boolean;
progress?: boolean;
ignoreFilePath?: string;
runtimeConfigPath?: string;
};
export type FormatterOption = {
indentSize?: number;
wrapLineLength?: number;
wrapAttributes?: WrapAttributes;
endWithNewline?: boolean;
endOfLine?: EndOfLine;
useTabs?: boolean;
sortTailwindcssClasses?: true;
tailwindcssConfigPath?: string;
tailwindcssConfig?: TailwindConfig;
sortHtmlAttributes?: SortHtmlAttributes;
customHtmlAttributesOrder?: string[] | string;
noMultipleEmptyLines?: boolean;
noPhpSyntaxCheck?: boolean;
};
export type BladeFormatterOption = CLIOption & FormatterOption;
declare class BladeFormatter {
diffs: any;
errors: any;
formattedFiles: any;
ignoreFile: any;
options: FormatterOption & CLIOption;
outputs: any;
currentTargetPath: string;
paths: any;
targetFiles: any;
fulFillFiles: any;
static targetFiles: any;
runtimeConfigPath: string | null;
runtimeConfigCache: RuntimeConfig;
constructor(options?: BladeFormatterOption, paths?: any);
format(content: any, opts?: BladeFormatterOption): Promise<any>;
formatFromCLI(): Promise<void>;
fileExists(filepath: string): any;
readIgnoreFile(filePath: string): Promise<void>;
findTailwindConfig(filePath: string): Promise<void>;
readRuntimeConfig(filePath: string): Promise<RuntimeConfig | undefined>;
processPaths(): Promise<void>;
processPath(path: any): Promise<void>;
static globFiles(path: any): Promise<unknown>;
filterFiles(paths: any): Promise<any>;
static fulFillFiles(paths: any): Promise<any>;
formatFiles(paths: any): Promise<void>;
formatFile(path: any): Promise<void>;
checkFormatted(path: any, formatted: any): Promise<any>;
printFormattedOutput(path: any, formatted: any): void;
writeToFile(path: any, content: any): void;
handleError(path: any, error: any): void;
printPreamble(): void;
printResults(): Promise<void>;
printDescription(): void;
printFormattedFiles(): void;
printDifferences(): void;
printErrors(): void;
}
export { BladeFormatter, Formatter };
@@ -0,0 +1 @@
export declare const nestedParenthesisRegex = "\\(((?:[^)(]+|\\((?:[^)(]+|\\((?:[^)(]+|\\((?:[^)(]+|\\([^)(]*\\))*\\))*\\))*\\))*)\\)?";
@@ -0,0 +1,19 @@
export type WrapAttributes = 'auto' | 'force' | 'force-aligned' | 'force-expand-multiline' | 'aligned-multiple' | 'preserve' | 'preserve-aligned';
export type SortHtmlAttributes = 'none' | 'alphabetical' | 'code-guide' | 'idiomatic' | 'vuejs' | 'custom';
export type EndOfLine = 'LF' | 'CRLF';
export interface RuntimeConfig {
indentSize?: number;
wrapLineLength?: number;
wrapAttributes?: WrapAttributes;
endWithNewline?: boolean;
endOfLine?: EndOfLine;
useTabs?: boolean;
sortTailwindcssClasses?: boolean;
tailwindcssConfigPath?: string;
sortHtmlAttributes?: SortHtmlAttributes;
customHtmlAttributesOrder?: string[] | string;
noMultipleEmptyLines?: boolean;
noPhpSyntaxCheck?: boolean;
}
export declare function findRuntimeConfig(filePath: string): string | null;
export declare function readRuntimeConfig(filePath: string | null): Promise<RuntimeConfig | undefined>;
@@ -0,0 +1,6 @@
/**
* Adjust spaces in blade directives
* @param content
* @returns
*/
export declare function adjustSpaces(content: string): string;
@@ -0,0 +1,35 @@
import { EndOfLine } from './runtimeConfig';
export declare const optional: (obj: any) => any;
export declare function readFile(path: any): Promise<unknown>;
export declare function splitByLines(content: any): any;
export type FormatPhpOption = {
noPhpSyntaxCheck?: boolean;
printWidth?: number;
trailingCommaPHP?: boolean;
phpVersion?: string;
singleQuote?: boolean;
};
export declare const printWidthForInline = 1000;
export declare function formatStringAsPhp(content: any, params?: FormatPhpOption): any;
export declare function formatRawStringAsPhp(content: string, params?: FormatPhpOption): any;
export declare function getArgumentsCount(expression: any): any;
export declare function normalizeIndentLevel(length: any): any;
export declare function printDiffs(diffs: any): Promise<any>;
export declare function generateDiff(path: any, originalLines: any, formattedLines: any): any;
export declare function prettifyPhpContentWithUnescapedTags(content: any): Promise<any>;
export declare function prettifyPhpContentWithEscapedTags(content: any): Promise<any>;
export declare function removeSemicolon(content: any): Promise<any>;
export declare function formatAsPhp(content: any): Promise<any>;
export declare function preserveOriginalPhpTagInHtml(content: any): Promise<any>;
export declare function revertOriginalPhpTagInHtml(content: any): Promise<any>;
export declare function indent(content: any, level: any, options: any): any;
export declare function unindent(directive: any, content: any, level: any, options: any): any;
export declare function preserveDirectives(content: any): Promise<any>;
export declare function preserveDirectivesInTag(content: any): Promise<unknown>;
export declare function revertDirectives(content: any): Promise<any>;
export declare function revertDirectivesInTag(content: any): Promise<any>;
export declare function printDescription(): void;
export declare function checkResult(formatted: any): any;
export declare function escapeReplacementString(string: string): string;
export declare function debugLog(...content: any): any;
export declare function getEndOfLine(endOfLine?: EndOfLine): string;
@@ -0,0 +1,14 @@
export declare class VscodeTextmate {
oniguruma: any;
registry: any;
vsctm: any;
initCalled: any;
constructor(vsctm: any, oniguruma: any);
loadWasm(): Promise<void>;
createRegistry(): any;
tokenizeLines(splitedLines: any, grammar: any): any;
}
declare const _default: {
VscodeTextmate: typeof VscodeTextmate;
};
export default _default;