@bamboocss/parser 1.12.0 → 1.12.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@bamboocss/parser",
3
- "version": "1.12.0",
3
+ "version": "1.12.2",
4
4
  "description": "The static parser for bamboo css",
5
5
  "homepage": "https://bamboo-css.com",
6
6
  "license": "MIT",
@@ -34,17 +34,17 @@
34
34
  "dependencies": {
35
35
  "ts-morph": "28.0.0",
36
36
  "ts-pattern": "5.9.0",
37
- "@bamboocss/config": "^1.12.0",
38
- "@bamboocss/shared": "1.12.0",
39
- "@bamboocss/logger": "1.12.0",
40
- "@bamboocss/core": "^1.12.0",
41
- "@bamboocss/extractor": "1.12.0",
42
- "@bamboocss/types": "1.12.0"
37
+ "@bamboocss/config": "^1.12.2",
38
+ "@bamboocss/core": "^1.12.2",
39
+ "@bamboocss/logger": "1.12.2",
40
+ "@bamboocss/shared": "1.12.2",
41
+ "@bamboocss/types": "1.12.2",
42
+ "@bamboocss/extractor": "1.12.2"
43
43
  },
44
44
  "devDependencies": {
45
- "@bamboocss/generator": "1.12.0",
46
- "@bamboocss/plugin-svelte": "1.12.0",
47
- "@bamboocss/plugin-vue": "1.12.0"
45
+ "@bamboocss/generator": "1.12.2",
46
+ "@bamboocss/plugin-vue": "1.12.2",
47
+ "@bamboocss/plugin-svelte": "1.12.2"
48
48
  },
49
49
  "scripts": {
50
50
  "build": "tsdown src/index.ts --format=esm,cjs --dts",
package/dist/index.d.cts DELETED
@@ -1,137 +0,0 @@
1
- import { Context, ParserOptions, StyleDecoder, Stylesheet } from "@bamboocss/core";
2
- import { ArtifactId, BambooHooks, ConfigTsOptions, CssArtifactType, JsxFactoryResultTransform, LoadConfigResult, ParserResultConfigureOptions, ParserResultInterface, ResultItem, Runtime, SpecFile, SpecType, SpecTypeMap } from "@bamboocss/types";
3
- import { FileSystemRefreshResult, Project as Project$1, ProjectOptions as ProjectOptions$1, SourceFile } from "ts-morph";
4
-
5
- //#region ../generator/dist/index.d.cts
6
- //#region src/generator.d.ts
7
- interface SplitCssArtifact {
8
- type: 'layer' | 'recipe' | 'theme';
9
- name: string;
10
- file: string;
11
- code: string;
12
- /** Directory relative to styles/ */
13
- dir?: string;
14
- }
15
- interface SplitCssResult {
16
- /** Layer CSS files (reset, global, tokens, utilities) */
17
- layers: SplitCssArtifact[];
18
- /** Recipe CSS files */
19
- recipes: SplitCssArtifact[];
20
- /** Theme CSS files (not auto-imported) */
21
- themes: SplitCssArtifact[];
22
- /** Content for recipes.css */
23
- recipesIndex: string;
24
- /** Content for main styles.css */
25
- index: string;
26
- }
27
- declare class Generator extends Context {
28
- constructor(conf: LoadConfigResult);
29
- getArtifacts: (ids?: ArtifactId[] | undefined) => import("@bamboocss/types").Artifact[];
30
- appendCssOfType: (type: CssArtifactType, sheet: Stylesheet) => void;
31
- appendLayerParams: (sheet: Stylesheet) => void;
32
- appendBaselineCss: (sheet: Stylesheet) => void;
33
- appendParserCss: (sheet: Stylesheet) => void;
34
- getParserCss: (decoder: StyleDecoder) => string;
35
- getCss: (stylesheet?: Stylesheet) => string;
36
- /**
37
- * Get CSS for a specific layer from the stylesheet
38
- */
39
- getLayerCss: (sheet: Stylesheet, layer: "reset" | "base" | "tokens" | "recipes" | "utilities") => string;
40
- /**
41
- * Get CSS for a specific recipe
42
- */
43
- getRecipeCss: (recipeName: string) => string;
44
- /**
45
- * Get all recipe names from the decoder
46
- */
47
- getRecipeNames: () => string[];
48
- /**
49
- * Get all split CSS artifacts for the stylesheet
50
- * Used when --splitting flag is enabled
51
- */
52
- getSplitCssArtifacts: (sheet: Stylesheet) => SplitCssResult;
53
- getSpec: () => SpecFile[];
54
- getSpecOfType: <T extends SpecType>(type: T) => T extends "color-palette" | "themes" ? SpecTypeMap[T] | undefined : SpecTypeMap[T];
55
- } //#endregion
56
- //#region src/artifacts/js/themes.d.ts
57
- /**
58
- * Get CSS for a specific theme
59
- */
60
- //#endregion
61
- //#region src/parser-result.d.ts
62
- declare class ParserResult implements ParserResultInterface {
63
- private context;
64
- /** Ordered list of all ResultItem */
65
- all: ResultItem[];
66
- jsx: Set<ResultItem>;
67
- css: Set<ResultItem>;
68
- cva: Set<ResultItem>;
69
- sva: Set<ResultItem>;
70
- token: Set<ResultItem>;
71
- recipe: Map<string, Set<ResultItem>>;
72
- pattern: Map<string, Set<ResultItem>>;
73
- filePath: string | undefined;
74
- encoder: ParserOptions['encoder'];
75
- constructor(context: ParserOptions, encoder?: ParserOptions['encoder']);
76
- append(result: ResultItem): ResultItem;
77
- set(name: 'cva' | 'css' | 'sva' | 'token', result: ResultItem): void;
78
- setCss(result: ResultItem): void;
79
- setCva(result: ResultItem): void;
80
- setSva(result: ResultItem): void;
81
- setToken(result: ResultItem): void;
82
- setJsx(result: ResultItem): void;
83
- setPattern(name: string, result: ResultItem): void;
84
- setRecipe(recipeName: string, result: ResultItem): void;
85
- isEmpty(): boolean;
86
- setFilePath(filePath: string): this;
87
- merge(result: ParserResult): this;
88
- toArray(): ResultItem[];
89
- toJSON(): {
90
- css: ResultItem[];
91
- cva: ResultItem[];
92
- sva: ResultItem[];
93
- token: ResultItem[];
94
- jsx: ResultItem[];
95
- recipe: {
96
- [k: string]: ResultItem[];
97
- };
98
- pattern: {
99
- [k: string]: ResultItem[];
100
- };
101
- };
102
- }
103
- //#endregion
104
- //#region src/parser.d.ts
105
- declare function createParser(context: ParserOptions): (sourceFile: SourceFile | undefined, encoder?: Generator["encoder"], options?: ParserResultConfigureOptions & Partial<JsxFactoryResultTransform>) => ParserResult | undefined;
106
- //#endregion
107
- //#region src/project.d.ts
108
- interface ProjectOptions extends ProjectOptions$1 {
109
- readFile: Runtime['fs']['readFileSync'];
110
- getFiles(): string[];
111
- hooks: Partial<BambooHooks>;
112
- parserOptions: ParserOptions;
113
- tsOptions?: ConfigTsOptions;
114
- }
115
- declare class Project {
116
- private options;
117
- project: Project$1;
118
- parser: ReturnType<typeof createParser>;
119
- get parserOptions(): ParserOptions;
120
- constructor(options: ProjectOptions);
121
- get files(): string[];
122
- getSourceFile: (filePath: string) => SourceFile | undefined;
123
- createSourceFile: (filePath: string) => SourceFile;
124
- createSourceFiles: () => void;
125
- addSourceFile: (filePath: string, content: string) => SourceFile;
126
- removeSourceFile: (filePath: string) => boolean;
127
- reloadSourceFile: (filePath: string) => FileSystemRefreshResult | undefined;
128
- reloadSourceFiles: () => void;
129
- get readFile(): (filePath: string) => string;
130
- get getFiles(): () => string[];
131
- parseJson: (filePath: string) => ParserResult;
132
- parseSourceFile: (filePath: string, encoder?: ParserOptions["encoder"]) => ParserResult | undefined;
133
- transformFile: (_filePath: string, content: string) => string;
134
- classify: (fileMap: Map<string, ParserResultInterface>) => import("@bamboocss/types").ClassifyReport;
135
- }
136
- //#endregion
137
- export { ParserResult, Project, ProjectOptions };
package/dist/index.d.mts DELETED
@@ -1,137 +0,0 @@
1
- import { FileSystemRefreshResult, Project as Project$1, ProjectOptions as ProjectOptions$1, SourceFile } from "ts-morph";
2
- import { Context, ParserOptions, StyleDecoder, Stylesheet } from "@bamboocss/core";
3
- import { ArtifactId, BambooHooks, ConfigTsOptions, CssArtifactType, JsxFactoryResultTransform, LoadConfigResult, ParserResultConfigureOptions, ParserResultInterface, ResultItem, Runtime, SpecFile, SpecType, SpecTypeMap } from "@bamboocss/types";
4
-
5
- //#region ../generator/dist/index.d.cts
6
- //#region src/generator.d.ts
7
- interface SplitCssArtifact {
8
- type: 'layer' | 'recipe' | 'theme';
9
- name: string;
10
- file: string;
11
- code: string;
12
- /** Directory relative to styles/ */
13
- dir?: string;
14
- }
15
- interface SplitCssResult {
16
- /** Layer CSS files (reset, global, tokens, utilities) */
17
- layers: SplitCssArtifact[];
18
- /** Recipe CSS files */
19
- recipes: SplitCssArtifact[];
20
- /** Theme CSS files (not auto-imported) */
21
- themes: SplitCssArtifact[];
22
- /** Content for recipes.css */
23
- recipesIndex: string;
24
- /** Content for main styles.css */
25
- index: string;
26
- }
27
- declare class Generator extends Context {
28
- constructor(conf: LoadConfigResult);
29
- getArtifacts: (ids?: ArtifactId[] | undefined) => import("@bamboocss/types").Artifact[];
30
- appendCssOfType: (type: CssArtifactType, sheet: Stylesheet) => void;
31
- appendLayerParams: (sheet: Stylesheet) => void;
32
- appendBaselineCss: (sheet: Stylesheet) => void;
33
- appendParserCss: (sheet: Stylesheet) => void;
34
- getParserCss: (decoder: StyleDecoder) => string;
35
- getCss: (stylesheet?: Stylesheet) => string;
36
- /**
37
- * Get CSS for a specific layer from the stylesheet
38
- */
39
- getLayerCss: (sheet: Stylesheet, layer: "reset" | "base" | "tokens" | "recipes" | "utilities") => string;
40
- /**
41
- * Get CSS for a specific recipe
42
- */
43
- getRecipeCss: (recipeName: string) => string;
44
- /**
45
- * Get all recipe names from the decoder
46
- */
47
- getRecipeNames: () => string[];
48
- /**
49
- * Get all split CSS artifacts for the stylesheet
50
- * Used when --splitting flag is enabled
51
- */
52
- getSplitCssArtifacts: (sheet: Stylesheet) => SplitCssResult;
53
- getSpec: () => SpecFile[];
54
- getSpecOfType: <T extends SpecType>(type: T) => T extends "color-palette" | "themes" ? SpecTypeMap[T] | undefined : SpecTypeMap[T];
55
- } //#endregion
56
- //#region src/artifacts/js/themes.d.ts
57
- /**
58
- * Get CSS for a specific theme
59
- */
60
- //#endregion
61
- //#region src/parser-result.d.ts
62
- declare class ParserResult implements ParserResultInterface {
63
- private context;
64
- /** Ordered list of all ResultItem */
65
- all: ResultItem[];
66
- jsx: Set<ResultItem>;
67
- css: Set<ResultItem>;
68
- cva: Set<ResultItem>;
69
- sva: Set<ResultItem>;
70
- token: Set<ResultItem>;
71
- recipe: Map<string, Set<ResultItem>>;
72
- pattern: Map<string, Set<ResultItem>>;
73
- filePath: string | undefined;
74
- encoder: ParserOptions['encoder'];
75
- constructor(context: ParserOptions, encoder?: ParserOptions['encoder']);
76
- append(result: ResultItem): ResultItem;
77
- set(name: 'cva' | 'css' | 'sva' | 'token', result: ResultItem): void;
78
- setCss(result: ResultItem): void;
79
- setCva(result: ResultItem): void;
80
- setSva(result: ResultItem): void;
81
- setToken(result: ResultItem): void;
82
- setJsx(result: ResultItem): void;
83
- setPattern(name: string, result: ResultItem): void;
84
- setRecipe(recipeName: string, result: ResultItem): void;
85
- isEmpty(): boolean;
86
- setFilePath(filePath: string): this;
87
- merge(result: ParserResult): this;
88
- toArray(): ResultItem[];
89
- toJSON(): {
90
- css: ResultItem[];
91
- cva: ResultItem[];
92
- sva: ResultItem[];
93
- token: ResultItem[];
94
- jsx: ResultItem[];
95
- recipe: {
96
- [k: string]: ResultItem[];
97
- };
98
- pattern: {
99
- [k: string]: ResultItem[];
100
- };
101
- };
102
- }
103
- //#endregion
104
- //#region src/parser.d.ts
105
- declare function createParser(context: ParserOptions): (sourceFile: SourceFile | undefined, encoder?: Generator["encoder"], options?: ParserResultConfigureOptions & Partial<JsxFactoryResultTransform>) => ParserResult | undefined;
106
- //#endregion
107
- //#region src/project.d.ts
108
- interface ProjectOptions extends ProjectOptions$1 {
109
- readFile: Runtime['fs']['readFileSync'];
110
- getFiles(): string[];
111
- hooks: Partial<BambooHooks>;
112
- parserOptions: ParserOptions;
113
- tsOptions?: ConfigTsOptions;
114
- }
115
- declare class Project {
116
- private options;
117
- project: Project$1;
118
- parser: ReturnType<typeof createParser>;
119
- get parserOptions(): ParserOptions;
120
- constructor(options: ProjectOptions);
121
- get files(): string[];
122
- getSourceFile: (filePath: string) => SourceFile | undefined;
123
- createSourceFile: (filePath: string) => SourceFile;
124
- createSourceFiles: () => void;
125
- addSourceFile: (filePath: string, content: string) => SourceFile;
126
- removeSourceFile: (filePath: string) => boolean;
127
- reloadSourceFile: (filePath: string) => FileSystemRefreshResult | undefined;
128
- reloadSourceFiles: () => void;
129
- get readFile(): (filePath: string) => string;
130
- get getFiles(): () => string[];
131
- parseJson: (filePath: string) => ParserResult;
132
- parseSourceFile: (filePath: string, encoder?: ParserOptions["encoder"]) => ParserResult | undefined;
133
- transformFile: (_filePath: string, content: string) => string;
134
- classify: (fileMap: Map<string, ParserResultInterface>) => import("@bamboocss/types").ClassifyReport;
135
- }
136
- //#endregion
137
- export { ParserResult, Project, ProjectOptions };