Ver código fonte

removes the directory types from the dist

Matheus Giovani 2 anos atrás
pai
commit
a6553f9d7a

+ 0 - 12
packages/compiler/types/core/Lexer.d.ts

@@ -1,12 +0,0 @@
-import type PugLexer from "pug-lexer";
-import type Token from "./lexer/Token";
-export default class Lexer {
-    static Tokens: typeof Token[];
-    /**
-     * Checks if a given expression is valid
-     * @param lexer The pug lexer instance
-     * @param exp The expression to be checked against
-     * @returns
-     */
-    isExpression(lexer: PugLexer.Lexer, exp: string): boolean;
-}

+ 0 - 37
packages/compiler/types/core/Plugin.d.ts

@@ -1,37 +0,0 @@
-import Lexer from "./Lexer";
-import { PugPlugin, PugToken, PugAST, PugNode, Options } from "pug";
-import PupperCompiler from "..";
-export { PugToken, PugAST, PugNode };
-/**
- * Documentation for this class is available in the PugPlugin interface
- */
-export default class Plugin implements PugPlugin {
-    compiler: PupperCompiler;
-    options: Options & {
-        contents?: string;
-    };
-    /**
-     * The instances of the tokens that will be used to parse the template file
-     */
-    private tokens;
-    /**
-     * A handler for the plugin hooks
-     */
-    private hooks;
-    /**
-     * Any data to be shared between hooks and phases
-     */
-    sharedData: Record<any, any>;
-    lex: Lexer;
-    constructor(compiler: PupperCompiler, options: Options & {
-        contents?: string;
-    });
-    getOptions(): Options & {
-        contents?: string;
-    };
-    addHook(hook: string, callback: Function): number;
-    applyFilters(hook: string, initialValue: any): any;
-    preParse(tokens: PugToken[]): any;
-    postParse(block: PugAST): any;
-    postCodeGen(code: string): string;
-}

+ 0 - 37
packages/compiler/types/core/lexer/Token.d.ts

@@ -1,37 +0,0 @@
-import Plugin, { PugAST } from "../Plugin";
-import { PugToken, PugNode } from "pug";
-export default class Token {
-    protected plugin: Plugin;
-    static readonly REGEX: RegExp;
-    constructor(plugin: Plugin);
-    /**
-     * Tests if the token matches with the given expression
-     * @param exp The expression to be tested
-     * @returns
-     */
-    static testExpression(exp: string): boolean;
-    /**
-     * Lexes the given token and return new ones
-     * @param tokens The tokens to be parsed
-     * @returns Parsed tokens
-     */
-    lex(tokens: PugToken[]): PugToken[];
-    /**
-     * Parses the given token and return new ones
-     * @param nodes The nodes to be parsed
-     * @returns Parsed nodes
-     */
-    parse(nodes: PugNode[]): PugNode[];
-    /**
-     * Called before the AST is compiled into Javascript
-     * @param ast The pug AST to be compiled
-     * @returns
-     */
-    beforeCompile(ast: PugAST): PugAST;
-    /**
-     * Called after the AST is compiled into Javascript
-     * @param code The generated Javascript code
-     * @returns
-     */
-    afterCompile(code: string): string;
-}

+ 0 - 24
packages/compiler/types/core/lexer/tokens/Component.d.ts

@@ -1,24 +0,0 @@
-import { PugNode } from "../../Plugin";
-import Token from "../Token";
-export interface IComponent {
-    name: string | symbol;
-    template: string;
-    script?: string;
-    setupScript?: string;
-    style?: string;
-    exported?: boolean;
-}
-export default class Component extends Token {
-    /**
-     * Parses a pug node into a component.
-     * @param node The pug node to be parsed.
-     * @returns
-     */
-    parseNode(node: PugNode, nextNode: PugNode): IComponent;
-    /**
-     * The imports that will later be putted into the template header
-     */
-    protected components: Record<string | symbol, IComponent>;
-    parse(nodes: PugNode[]): PugNode[];
-    afterCompile(code: string): string;
-}

+ 0 - 5
packages/compiler/types/core/lexer/tokens/ForEach.d.ts

@@ -1,5 +0,0 @@
-import { PugNode } from "../../Plugin";
-import Token from "../Token";
-export default class ForEach extends Token {
-    parse(nodes: PugNode[]): PugNode[];
-}

+ 0 - 5
packages/compiler/types/core/lexer/tokens/If.d.ts

@@ -1,5 +0,0 @@
-import { PugNode } from "../../Plugin";
-import Token from "../Token";
-export default class ForEach extends Token {
-    parse(nodes: PugNode[]): PugNode[];
-}

+ 0 - 11
packages/compiler/types/core/lexer/tokens/Import.d.ts

@@ -1,11 +0,0 @@
-import { PugNode } from "../../Plugin";
-import Token from "../Token";
-export default class Import extends Token {
-    private static readonly IMPORT_CONDITION;
-    /**
-     * The imports that will later be putted into the template header
-     */
-    protected imports: Record<string, string>;
-    parse(nodes: PugNode[]): PugNode[];
-    afterCompile(code: string): string;
-}

+ 0 - 15
packages/compiler/types/core/lexer/tokens/Property.d.ts

@@ -1,15 +0,0 @@
-import { PugToken } from "../../Plugin";
-import Token from "../Token";
-export default class Property extends Token {
-    /**
-     * The regex to test if an expression is a valid reactive item
-     */
-    static REGEX: RegExp;
-    /**
-     * Tests if the token matches with the given expression
-     * @param exp The expression to be tested
-     * @returns
-     */
-    static testExpression(exp: string): boolean;
-    lex(tokens: PugToken[]): PugToken[];
-}

+ 0 - 6
packages/compiler/types/core/lexer/tokens/PupperToAlpine.d.ts

@@ -1,6 +0,0 @@
-import { PugToken } from "../../Plugin";
-import Token from "../Token";
-export default class PupperToAlpine extends Token {
-    static Directives: Record<string, string>;
-    lex(tokens: PugToken[]): PugToken[];
-}

+ 0 - 21
packages/compiler/types/core/lexer/tokens/component/ScriptParser.d.ts

@@ -1,21 +0,0 @@
-import { SourceFile } from "ts-morph";
-import Plugin from "../../../Plugin";
-import { IComponent } from "../Component";
-export declare class ScriptParser {
-    protected component: IComponent;
-    protected fileName: string;
-    protected availableComponents: Record<string, IComponent>;
-    protected plugin: Plugin;
-    protected sourceFile: SourceFile;
-    constructor(component: IComponent, fileName: string, availableComponents: Record<string, IComponent>, plugin: Plugin);
-    /**
-     * Parses a script contents
-     * @returns
-     */
-    parse(): string;
-    private processImportedComponents;
-    private findComponentImportedComponentsObj;
-    private processDefaultComponent;
-    private findComponentPropsObj;
-    private findDefaultExport;
-}

+ 0 - 11
packages/compiler/types/core/lexer/tokens/component/StyleParser.d.ts

@@ -1,11 +0,0 @@
-import { IComponent } from "../Component";
-export declare class StyleParser {
-    protected content: string;
-    protected availableComponents: Record<string, IComponent>;
-    constructor(content: string, availableComponents: Record<string, IComponent>);
-    /**
-     * Parses a script contents
-     * @returns
-     */
-    parse(): string;
-}

+ 0 - 69
packages/compiler/types/index.d.ts

@@ -1,69 +0,0 @@
-import pug from "pug";
-interface ICompilerOptions {
-    /**
-     * If set to true, the function source will be included in the compiled template
-     * for better error messages. It is not enabled by default.
-     */
-    debug?: boolean;
-    /**
-     * Any configurations to be passed to pug
-     */
-    pug?: pug.Options;
-}
-declare const _default: {
-    new (): {
-        /**
-         * Compiles a pupper template to a Javascript module
-         * @param template The template to be compiled
-         * @param options
-         * @returns
-         */
-        compileToString(template: string, options?: ICompilerOptions): string;
-        /**
-         * Compiles a pupper template into HTML.
-         * @param template The template to be compiled
-         * @param options
-         * @returns
-         */
-        compileTemplate(template: string, options?: ICompilerOptions): string;
-        /**
-         * Parses the compiler options into pug options
-         * and put our plugins into it
-         * @param options The compiler options
-         * @returns
-         */
-        getPugOptions(options?: ICompilerOptions): pug.Options & {
-            contents?: string;
-        };
-    };
-    /**
-     * Creates a new pupper.js compiler
-     * @returns
-     */
-    createCompiler(): {
-        /**
-         * Compiles a pupper template to a Javascript module
-         * @param template The template to be compiled
-         * @param options
-         * @returns
-         */
-        compileToString(template: string, options?: ICompilerOptions): string;
-        /**
-         * Compiles a pupper template into HTML.
-         * @param template The template to be compiled
-         * @param options
-         * @returns
-         */
-        compileTemplate(template: string, options?: ICompilerOptions): string;
-        /**
-         * Parses the compiler options into pug options
-         * and put our plugins into it
-         * @param options The compiler options
-         * @returns
-         */
-        getPugOptions(options?: ICompilerOptions): pug.Options & {
-            contents?: string;
-        };
-    };
-};
-export = _default;