@bamboocss/node 1.32.0 → 1.33.0
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/README.md +1 -1
- package/dist/index.cjs +7 -7
- package/dist/index.mjs +7 -7
- package/package.json +12 -12
package/README.md
CHANGED
|
@@ -14,7 +14,7 @@ Everything below is exported from `@bamboocss/node`.
|
|
|
14
14
|
### Context
|
|
15
15
|
|
|
16
16
|
- `loadConfigAndCreateContext({ cwd?, config?, configPath? })` – resolve the config file, merge presets and inline
|
|
17
|
-
overrides, auto-inject the built-in plugins (`vue`, `svelte
|
|
17
|
+
overrides, auto-inject the built-in plugins (`vue`, `svelte`), and return a `BambooContext`.
|
|
18
18
|
- `BambooContext` – the resolved config plus everything derived from it: tokens, utilities, conditions, recipes,
|
|
19
19
|
patterns, the `ts-morph` project, the output engine and the diff engine.
|
|
20
20
|
- `Builder` – the incremental driver the bundler plugins use. It owns context setup, tracks which files and config
|
package/dist/index.cjs
CHANGED
|
@@ -25,12 +25,12 @@ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__ge
|
|
|
25
25
|
let _bamboocss_reporter = require("@bamboocss/reporter");
|
|
26
26
|
let _bamboocss_logger = require("@bamboocss/logger");
|
|
27
27
|
let _bamboocss_config = require("@bamboocss/config");
|
|
28
|
+
let _bamboocss_core = require("@bamboocss/core");
|
|
28
29
|
let _bamboocss_shared = require("@bamboocss/shared");
|
|
29
30
|
let fs = require("fs");
|
|
30
31
|
let path = require("path");
|
|
31
32
|
let _bamboocss_plugin_svelte = require("@bamboocss/plugin-svelte");
|
|
32
33
|
let _bamboocss_plugin_vue = require("@bamboocss/plugin-vue");
|
|
33
|
-
let _bamboocss_core = require("@bamboocss/core");
|
|
34
34
|
let _bamboocss_generator = require("@bamboocss/generator");
|
|
35
35
|
let _bamboocss_parser = require("@bamboocss/parser");
|
|
36
36
|
let perfect_debounce = require("perfect-debounce");
|
|
@@ -2754,7 +2754,7 @@ const keyframeNames = (ctx) => Object.keys(ctx.config.theme?.keyframes ?? {});
|
|
|
2754
2754
|
*
|
|
2755
2755
|
* Lowercase-initial only, so a JSX component (`<Button />`) is not mistaken for an element.
|
|
2756
2756
|
* That cuts the other way too — a component rendering `<button>` inside a dependency is
|
|
2757
|
-
* invisible here, which is why `prune
|
|
2757
|
+
* invisible here, which is why `preflight.prune` is opt-in.
|
|
2758
2758
|
*
|
|
2759
2759
|
* The commoner blind spot is nearer than a dependency: this reads `include`, and `include`
|
|
2760
2760
|
* conventionally covers components rather than markup. An entry template — `index.html`,
|
|
@@ -2958,7 +2958,7 @@ var Builder = class {
|
|
|
2958
2958
|
if (layerParams) ctx.appendLayerParams(sheet);
|
|
2959
2959
|
ctx.appendBaselineCss(sheet);
|
|
2960
2960
|
pruneTokensForBuild(ctx, sheet, []);
|
|
2961
|
-
if (ctx.config.
|
|
2961
|
+
if ((0, _bamboocss_core.prunesPreflight)(ctx.config.preflight)) ctx.prunePreflight(sheet, collectRenderedElements(ctx));
|
|
2962
2962
|
if (ctx.config.prune?.keyframes) ctx.pruneKeyframes(sheet, collectKeyframeReferences(ctx, keyframeNames(ctx)));
|
|
2963
2963
|
return ctx.getCss(sheet);
|
|
2964
2964
|
};
|
|
@@ -3047,7 +3047,7 @@ const cssgen = async (ctx, options) => {
|
|
|
3047
3047
|
if (type) {
|
|
3048
3048
|
const done = _bamboocss_logger.logger.time.info(ctx.messages.cssArtifactComplete(type));
|
|
3049
3049
|
ctx.appendCssOfType(type, sheet);
|
|
3050
|
-
if (type === "preflight" && ctx.config.
|
|
3050
|
+
if (type === "preflight" && (0, _bamboocss_core.prunesPreflight)(ctx.config.preflight)) ctx.prunePreflight(sheet, collectRenderedElements(ctx));
|
|
3051
3051
|
if (outfile) {
|
|
3052
3052
|
const css = ctx.getCss(sheet);
|
|
3053
3053
|
_bamboocss_logger.logger.info("css", ctx.runtime.path.resolve(outfile));
|
|
@@ -3061,7 +3061,7 @@ const cssgen = async (ctx, options) => {
|
|
|
3061
3061
|
ctx.appendBaselineCss(sheet);
|
|
3062
3062
|
ctx.appendParserCss(sheet);
|
|
3063
3063
|
pruneTokensForBuild(ctx, sheet, results);
|
|
3064
|
-
if (ctx.config.
|
|
3064
|
+
if ((0, _bamboocss_core.prunesPreflight)(ctx.config.preflight)) ctx.prunePreflight(sheet, collectRenderedElements(ctx));
|
|
3065
3065
|
if (ctx.config.prune?.keyframes) ctx.pruneKeyframes(sheet, collectKeyframeReferences(ctx, keyframeNames(ctx)));
|
|
3066
3066
|
if (splitting) await ctx.writeSplitCss(sheet);
|
|
3067
3067
|
else if (outfile) {
|
|
@@ -3133,7 +3133,7 @@ async function build(ctx, artifactIds) {
|
|
|
3133
3133
|
const parsed = ctx.parseFiles();
|
|
3134
3134
|
ctx.appendParserCss(sheet);
|
|
3135
3135
|
pruneTokensForBuild(ctx, sheet, parsed.results);
|
|
3136
|
-
if (ctx.config.
|
|
3136
|
+
if ((0, _bamboocss_core.prunesPreflight)(ctx.config.preflight)) ctx.prunePreflight(sheet, collectRenderedElements(ctx));
|
|
3137
3137
|
if (ctx.config.prune?.keyframes) ctx.pruneKeyframes(sheet, collectKeyframeReferences(ctx, keyframeNames(ctx)));
|
|
3138
3138
|
await ctx.writeCss(sheet);
|
|
3139
3139
|
done(ctx.messages.buildComplete(parsed.files.length));
|
|
@@ -3179,7 +3179,7 @@ async function generate(config, configPath) {
|
|
|
3179
3179
|
ctx.appendBaselineCss(sheet);
|
|
3180
3180
|
ctx.appendParserCss(sheet);
|
|
3181
3181
|
pruneTokensForBuild(ctx, sheet, []);
|
|
3182
|
-
if (ctx.config.
|
|
3182
|
+
if ((0, _bamboocss_core.prunesPreflight)(ctx.config.preflight)) ctx.prunePreflight(sheet, collectRenderedElements(ctx));
|
|
3183
3183
|
if (ctx.config.prune?.keyframes) ctx.pruneKeyframes(sheet, collectKeyframeReferences(ctx, keyframeNames(ctx)));
|
|
3184
3184
|
const css = ctx.getCss(sheet);
|
|
3185
3185
|
await ctx.runtime.fs.writeFile(outfile, css);
|
package/dist/index.mjs
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
import { Reporter, formatRecipeReport, formatTokenReport } from "@bamboocss/reporter";
|
|
2
2
|
import { colors, logger, quote } from "@bamboocss/logger";
|
|
3
3
|
import { convertTsPathsToRegexes, diffConfigs, findConfig, getConfigDependencies, loadConfig, mergeHooks } from "@bamboocss/config";
|
|
4
|
+
import { checkNamingAgreement, formatNamingDisagreement, messages, prunesPreflight } from "@bamboocss/core";
|
|
4
5
|
import { BambooError, cssVarRefs, uniq } from "@bamboocss/shared";
|
|
5
6
|
import { appendFileSync, existsSync, readFileSync, statSync, writeFileSync } from "fs";
|
|
6
7
|
import { dirname, extname, isAbsolute, join, normalize, parse, relative, resolve, sep } from "path";
|
|
7
8
|
import { pluginSvelte } from "@bamboocss/plugin-svelte";
|
|
8
9
|
import { pluginVue } from "@bamboocss/plugin-vue";
|
|
9
|
-
import { checkNamingAgreement, formatNamingDisagreement, messages } from "@bamboocss/core";
|
|
10
10
|
import { Generator, generatePackageExports } from "@bamboocss/generator";
|
|
11
11
|
import { Project } from "@bamboocss/parser";
|
|
12
12
|
import { debounce } from "perfect-debounce";
|
|
@@ -2740,7 +2740,7 @@ const keyframeNames = (ctx) => Object.keys(ctx.config.theme?.keyframes ?? {});
|
|
|
2740
2740
|
*
|
|
2741
2741
|
* Lowercase-initial only, so a JSX component (`<Button />`) is not mistaken for an element.
|
|
2742
2742
|
* That cuts the other way too — a component rendering `<button>` inside a dependency is
|
|
2743
|
-
* invisible here, which is why `prune
|
|
2743
|
+
* invisible here, which is why `preflight.prune` is opt-in.
|
|
2744
2744
|
*
|
|
2745
2745
|
* The commoner blind spot is nearer than a dependency: this reads `include`, and `include`
|
|
2746
2746
|
* conventionally covers components rather than markup. An entry template — `index.html`,
|
|
@@ -2944,7 +2944,7 @@ var Builder = class {
|
|
|
2944
2944
|
if (layerParams) ctx.appendLayerParams(sheet);
|
|
2945
2945
|
ctx.appendBaselineCss(sheet);
|
|
2946
2946
|
pruneTokensForBuild(ctx, sheet, []);
|
|
2947
|
-
if (ctx.config.
|
|
2947
|
+
if (prunesPreflight(ctx.config.preflight)) ctx.prunePreflight(sheet, collectRenderedElements(ctx));
|
|
2948
2948
|
if (ctx.config.prune?.keyframes) ctx.pruneKeyframes(sheet, collectKeyframeReferences(ctx, keyframeNames(ctx)));
|
|
2949
2949
|
return ctx.getCss(sheet);
|
|
2950
2950
|
};
|
|
@@ -3033,7 +3033,7 @@ const cssgen = async (ctx, options) => {
|
|
|
3033
3033
|
if (type) {
|
|
3034
3034
|
const done = logger.time.info(ctx.messages.cssArtifactComplete(type));
|
|
3035
3035
|
ctx.appendCssOfType(type, sheet);
|
|
3036
|
-
if (type === "preflight" && ctx.config.
|
|
3036
|
+
if (type === "preflight" && prunesPreflight(ctx.config.preflight)) ctx.prunePreflight(sheet, collectRenderedElements(ctx));
|
|
3037
3037
|
if (outfile) {
|
|
3038
3038
|
const css = ctx.getCss(sheet);
|
|
3039
3039
|
logger.info("css", ctx.runtime.path.resolve(outfile));
|
|
@@ -3047,7 +3047,7 @@ const cssgen = async (ctx, options) => {
|
|
|
3047
3047
|
ctx.appendBaselineCss(sheet);
|
|
3048
3048
|
ctx.appendParserCss(sheet);
|
|
3049
3049
|
pruneTokensForBuild(ctx, sheet, results);
|
|
3050
|
-
if (ctx.config.
|
|
3050
|
+
if (prunesPreflight(ctx.config.preflight)) ctx.prunePreflight(sheet, collectRenderedElements(ctx));
|
|
3051
3051
|
if (ctx.config.prune?.keyframes) ctx.pruneKeyframes(sheet, collectKeyframeReferences(ctx, keyframeNames(ctx)));
|
|
3052
3052
|
if (splitting) await ctx.writeSplitCss(sheet);
|
|
3053
3053
|
else if (outfile) {
|
|
@@ -3119,7 +3119,7 @@ async function build(ctx, artifactIds) {
|
|
|
3119
3119
|
const parsed = ctx.parseFiles();
|
|
3120
3120
|
ctx.appendParserCss(sheet);
|
|
3121
3121
|
pruneTokensForBuild(ctx, sheet, parsed.results);
|
|
3122
|
-
if (ctx.config.
|
|
3122
|
+
if (prunesPreflight(ctx.config.preflight)) ctx.prunePreflight(sheet, collectRenderedElements(ctx));
|
|
3123
3123
|
if (ctx.config.prune?.keyframes) ctx.pruneKeyframes(sheet, collectKeyframeReferences(ctx, keyframeNames(ctx)));
|
|
3124
3124
|
await ctx.writeCss(sheet);
|
|
3125
3125
|
done(ctx.messages.buildComplete(parsed.files.length));
|
|
@@ -3165,7 +3165,7 @@ async function generate(config, configPath) {
|
|
|
3165
3165
|
ctx.appendBaselineCss(sheet);
|
|
3166
3166
|
ctx.appendParserCss(sheet);
|
|
3167
3167
|
pruneTokensForBuild(ctx, sheet, []);
|
|
3168
|
-
if (ctx.config.
|
|
3168
|
+
if (prunesPreflight(ctx.config.preflight)) ctx.prunePreflight(sheet, collectRenderedElements(ctx));
|
|
3169
3169
|
if (ctx.config.prune?.keyframes) ctx.pruneKeyframes(sheet, collectKeyframeReferences(ctx, keyframeNames(ctx)));
|
|
3170
3170
|
const css = ctx.getCss(sheet);
|
|
3171
3171
|
await ctx.runtime.fs.writeFile(outfile, css);
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@bamboocss/node",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.33.0",
|
|
4
4
|
"description": "The core css bamboo library",
|
|
5
5
|
"homepage": "https://bamboocss.com",
|
|
6
6
|
"license": "MIT",
|
|
@@ -52,17 +52,17 @@
|
|
|
52
52
|
"postcss": "8.5.26",
|
|
53
53
|
"ts-morph": "28.0.0",
|
|
54
54
|
"ts-pattern": "5.9.0",
|
|
55
|
-
"@bamboocss/config": "1.
|
|
56
|
-
"@bamboocss/core": "1.
|
|
57
|
-
"@bamboocss/generator": "1.
|
|
58
|
-
"@bamboocss/logger": "1.
|
|
59
|
-
"@bamboocss/parser": "1.
|
|
60
|
-
"@bamboocss/plugin-svelte": "1.
|
|
61
|
-
"@bamboocss/plugin-vue": "1.
|
|
62
|
-
"@bamboocss/reporter": "1.
|
|
63
|
-
"@bamboocss/shared": "1.
|
|
64
|
-
"@bamboocss/token-dictionary": "1.
|
|
65
|
-
"@bamboocss/types": "1.
|
|
55
|
+
"@bamboocss/config": "1.33.0",
|
|
56
|
+
"@bamboocss/core": "1.33.0",
|
|
57
|
+
"@bamboocss/generator": "1.33.0",
|
|
58
|
+
"@bamboocss/logger": "1.33.0",
|
|
59
|
+
"@bamboocss/parser": "1.33.0",
|
|
60
|
+
"@bamboocss/plugin-svelte": "1.33.0",
|
|
61
|
+
"@bamboocss/plugin-vue": "1.33.0",
|
|
62
|
+
"@bamboocss/reporter": "1.33.0",
|
|
63
|
+
"@bamboocss/shared": "1.33.0",
|
|
64
|
+
"@bamboocss/token-dictionary": "1.33.0",
|
|
65
|
+
"@bamboocss/types": "1.33.0"
|
|
66
66
|
},
|
|
67
67
|
"devDependencies": {
|
|
68
68
|
"@types/fs-extra": "11.0.4",
|