🚀 Socket Launch Week Day 5:Introducing Repository Access Permissions and Custom Roles.Learn more
Sign In

@bamboocss/parser

Package Overview
Dependencies
Maintainers
1
Versions
8
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@bamboocss/parser - npm Package Compare versions

Comparing version
1.12.0
to
1.12.1
+10
-10
package.json
{
"name": "@bamboocss/parser",
"version": "1.12.0",
"version": "1.12.1",
"description": "The static parser for bamboo css",

@@ -37,13 +37,13 @@ "homepage": "https://bamboo-css.com",

"ts-pattern": "5.9.0",
"@bamboocss/config": "^1.12.0",
"@bamboocss/shared": "1.12.0",
"@bamboocss/logger": "1.12.0",
"@bamboocss/core": "^1.12.0",
"@bamboocss/extractor": "1.12.0",
"@bamboocss/types": "1.12.0"
"@bamboocss/core": "^1.12.1",
"@bamboocss/config": "^1.12.1",
"@bamboocss/logger": "1.12.1",
"@bamboocss/types": "1.12.1",
"@bamboocss/shared": "1.12.1",
"@bamboocss/extractor": "1.12.1"
},
"devDependencies": {
"@bamboocss/generator": "1.12.0",
"@bamboocss/plugin-svelte": "1.12.0",
"@bamboocss/plugin-vue": "1.12.0"
"@bamboocss/plugin-vue": "1.12.1",
"@bamboocss/generator": "1.12.1",
"@bamboocss/plugin-svelte": "1.12.1"
},

@@ -50,0 +50,0 @@ "scripts": {

import { Context, ParserOptions, StyleDecoder, Stylesheet } from "@bamboocss/core";
import { ArtifactId, BambooHooks, ConfigTsOptions, CssArtifactType, JsxFactoryResultTransform, LoadConfigResult, ParserResultConfigureOptions, ParserResultInterface, ResultItem, Runtime, SpecFile, SpecType, SpecTypeMap } from "@bamboocss/types";
import { FileSystemRefreshResult, Project as Project$1, ProjectOptions as ProjectOptions$1, SourceFile } from "ts-morph";
//#region ../generator/dist/index.d.cts
//#region src/generator.d.ts
interface SplitCssArtifact {
type: 'layer' | 'recipe' | 'theme';
name: string;
file: string;
code: string;
/** Directory relative to styles/ */
dir?: string;
}
interface SplitCssResult {
/** Layer CSS files (reset, global, tokens, utilities) */
layers: SplitCssArtifact[];
/** Recipe CSS files */
recipes: SplitCssArtifact[];
/** Theme CSS files (not auto-imported) */
themes: SplitCssArtifact[];
/** Content for recipes.css */
recipesIndex: string;
/** Content for main styles.css */
index: string;
}
declare class Generator extends Context {
constructor(conf: LoadConfigResult);
getArtifacts: (ids?: ArtifactId[] | undefined) => import("@bamboocss/types").Artifact[];
appendCssOfType: (type: CssArtifactType, sheet: Stylesheet) => void;
appendLayerParams: (sheet: Stylesheet) => void;
appendBaselineCss: (sheet: Stylesheet) => void;
appendParserCss: (sheet: Stylesheet) => void;
getParserCss: (decoder: StyleDecoder) => string;
getCss: (stylesheet?: Stylesheet) => string;
/**
* Get CSS for a specific layer from the stylesheet
*/
getLayerCss: (sheet: Stylesheet, layer: "reset" | "base" | "tokens" | "recipes" | "utilities") => string;
/**
* Get CSS for a specific recipe
*/
getRecipeCss: (recipeName: string) => string;
/**
* Get all recipe names from the decoder
*/
getRecipeNames: () => string[];
/**
* Get all split CSS artifacts for the stylesheet
* Used when --splitting flag is enabled
*/
getSplitCssArtifacts: (sheet: Stylesheet) => SplitCssResult;
getSpec: () => SpecFile[];
getSpecOfType: <T extends SpecType>(type: T) => T extends "color-palette" | "themes" ? SpecTypeMap[T] | undefined : SpecTypeMap[T];
} //#endregion
//#region src/artifacts/js/themes.d.ts
/**
* Get CSS for a specific theme
*/
//#endregion
//#region src/parser-result.d.ts
declare class ParserResult implements ParserResultInterface {
private context;
/** Ordered list of all ResultItem */
all: ResultItem[];
jsx: Set<ResultItem>;
css: Set<ResultItem>;
cva: Set<ResultItem>;
sva: Set<ResultItem>;
token: Set<ResultItem>;
recipe: Map<string, Set<ResultItem>>;
pattern: Map<string, Set<ResultItem>>;
filePath: string | undefined;
encoder: ParserOptions['encoder'];
constructor(context: ParserOptions, encoder?: ParserOptions['encoder']);
append(result: ResultItem): ResultItem;
set(name: 'cva' | 'css' | 'sva' | 'token', result: ResultItem): void;
setCss(result: ResultItem): void;
setCva(result: ResultItem): void;
setSva(result: ResultItem): void;
setToken(result: ResultItem): void;
setJsx(result: ResultItem): void;
setPattern(name: string, result: ResultItem): void;
setRecipe(recipeName: string, result: ResultItem): void;
isEmpty(): boolean;
setFilePath(filePath: string): this;
merge(result: ParserResult): this;
toArray(): ResultItem[];
toJSON(): {
css: ResultItem[];
cva: ResultItem[];
sva: ResultItem[];
token: ResultItem[];
jsx: ResultItem[];
recipe: {
[k: string]: ResultItem[];
};
pattern: {
[k: string]: ResultItem[];
};
};
}
//#endregion
//#region src/parser.d.ts
declare function createParser(context: ParserOptions): (sourceFile: SourceFile | undefined, encoder?: Generator["encoder"], options?: ParserResultConfigureOptions & Partial<JsxFactoryResultTransform>) => ParserResult | undefined;
//#endregion
//#region src/project.d.ts
interface ProjectOptions extends ProjectOptions$1 {
readFile: Runtime['fs']['readFileSync'];
getFiles(): string[];
hooks: Partial<BambooHooks>;
parserOptions: ParserOptions;
tsOptions?: ConfigTsOptions;
}
declare class Project {
private options;
project: Project$1;
parser: ReturnType<typeof createParser>;
get parserOptions(): ParserOptions;
constructor(options: ProjectOptions);
get files(): string[];
getSourceFile: (filePath: string) => SourceFile | undefined;
createSourceFile: (filePath: string) => SourceFile;
createSourceFiles: () => void;
addSourceFile: (filePath: string, content: string) => SourceFile;
removeSourceFile: (filePath: string) => boolean;
reloadSourceFile: (filePath: string) => FileSystemRefreshResult | undefined;
reloadSourceFiles: () => void;
get readFile(): (filePath: string) => string;
get getFiles(): () => string[];
parseJson: (filePath: string) => ParserResult;
parseSourceFile: (filePath: string, encoder?: ParserOptions["encoder"]) => ParserResult | undefined;
transformFile: (_filePath: string, content: string) => string;
classify: (fileMap: Map<string, ParserResultInterface>) => import("@bamboocss/types").ClassifyReport;
}
//#endregion
export { ParserResult, Project, ProjectOptions };
import { FileSystemRefreshResult, Project as Project$1, ProjectOptions as ProjectOptions$1, SourceFile } from "ts-morph";
import { Context, ParserOptions, StyleDecoder, Stylesheet } from "@bamboocss/core";
import { ArtifactId, BambooHooks, ConfigTsOptions, CssArtifactType, JsxFactoryResultTransform, LoadConfigResult, ParserResultConfigureOptions, ParserResultInterface, ResultItem, Runtime, SpecFile, SpecType, SpecTypeMap } from "@bamboocss/types";
//#region ../generator/dist/index.d.cts
//#region src/generator.d.ts
interface SplitCssArtifact {
type: 'layer' | 'recipe' | 'theme';
name: string;
file: string;
code: string;
/** Directory relative to styles/ */
dir?: string;
}
interface SplitCssResult {
/** Layer CSS files (reset, global, tokens, utilities) */
layers: SplitCssArtifact[];
/** Recipe CSS files */
recipes: SplitCssArtifact[];
/** Theme CSS files (not auto-imported) */
themes: SplitCssArtifact[];
/** Content for recipes.css */
recipesIndex: string;
/** Content for main styles.css */
index: string;
}
declare class Generator extends Context {
constructor(conf: LoadConfigResult);
getArtifacts: (ids?: ArtifactId[] | undefined) => import("@bamboocss/types").Artifact[];
appendCssOfType: (type: CssArtifactType, sheet: Stylesheet) => void;
appendLayerParams: (sheet: Stylesheet) => void;
appendBaselineCss: (sheet: Stylesheet) => void;
appendParserCss: (sheet: Stylesheet) => void;
getParserCss: (decoder: StyleDecoder) => string;
getCss: (stylesheet?: Stylesheet) => string;
/**
* Get CSS for a specific layer from the stylesheet
*/
getLayerCss: (sheet: Stylesheet, layer: "reset" | "base" | "tokens" | "recipes" | "utilities") => string;
/**
* Get CSS for a specific recipe
*/
getRecipeCss: (recipeName: string) => string;
/**
* Get all recipe names from the decoder
*/
getRecipeNames: () => string[];
/**
* Get all split CSS artifacts for the stylesheet
* Used when --splitting flag is enabled
*/
getSplitCssArtifacts: (sheet: Stylesheet) => SplitCssResult;
getSpec: () => SpecFile[];
getSpecOfType: <T extends SpecType>(type: T) => T extends "color-palette" | "themes" ? SpecTypeMap[T] | undefined : SpecTypeMap[T];
} //#endregion
//#region src/artifacts/js/themes.d.ts
/**
* Get CSS for a specific theme
*/
//#endregion
//#region src/parser-result.d.ts
declare class ParserResult implements ParserResultInterface {
private context;
/** Ordered list of all ResultItem */
all: ResultItem[];
jsx: Set<ResultItem>;
css: Set<ResultItem>;
cva: Set<ResultItem>;
sva: Set<ResultItem>;
token: Set<ResultItem>;
recipe: Map<string, Set<ResultItem>>;
pattern: Map<string, Set<ResultItem>>;
filePath: string | undefined;
encoder: ParserOptions['encoder'];
constructor(context: ParserOptions, encoder?: ParserOptions['encoder']);
append(result: ResultItem): ResultItem;
set(name: 'cva' | 'css' | 'sva' | 'token', result: ResultItem): void;
setCss(result: ResultItem): void;
setCva(result: ResultItem): void;
setSva(result: ResultItem): void;
setToken(result: ResultItem): void;
setJsx(result: ResultItem): void;
setPattern(name: string, result: ResultItem): void;
setRecipe(recipeName: string, result: ResultItem): void;
isEmpty(): boolean;
setFilePath(filePath: string): this;
merge(result: ParserResult): this;
toArray(): ResultItem[];
toJSON(): {
css: ResultItem[];
cva: ResultItem[];
sva: ResultItem[];
token: ResultItem[];
jsx: ResultItem[];
recipe: {
[k: string]: ResultItem[];
};
pattern: {
[k: string]: ResultItem[];
};
};
}
//#endregion
//#region src/parser.d.ts
declare function createParser(context: ParserOptions): (sourceFile: SourceFile | undefined, encoder?: Generator["encoder"], options?: ParserResultConfigureOptions & Partial<JsxFactoryResultTransform>) => ParserResult | undefined;
//#endregion
//#region src/project.d.ts
interface ProjectOptions extends ProjectOptions$1 {
readFile: Runtime['fs']['readFileSync'];
getFiles(): string[];
hooks: Partial<BambooHooks>;
parserOptions: ParserOptions;
tsOptions?: ConfigTsOptions;
}
declare class Project {
private options;
project: Project$1;
parser: ReturnType<typeof createParser>;
get parserOptions(): ParserOptions;
constructor(options: ProjectOptions);
get files(): string[];
getSourceFile: (filePath: string) => SourceFile | undefined;
createSourceFile: (filePath: string) => SourceFile;
createSourceFiles: () => void;
addSourceFile: (filePath: string, content: string) => SourceFile;
removeSourceFile: (filePath: string) => boolean;
reloadSourceFile: (filePath: string) => FileSystemRefreshResult | undefined;
reloadSourceFiles: () => void;
get readFile(): (filePath: string) => string;
get getFiles(): () => string[];
parseJson: (filePath: string) => ParserResult;
parseSourceFile: (filePath: string, encoder?: ParserOptions["encoder"]) => ParserResult | undefined;
transformFile: (_filePath: string, content: string) => string;
classify: (fileMap: Map<string, ParserResultInterface>) => import("@bamboocss/types").ClassifyReport;
}
//#endregion
export { ParserResult, Project, ProjectOptions };