@bamboocss/dev 1.46.3 → 1.47.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/dist/cli-default.cjs +439 -98
- package/dist/cli-default.mjs +440 -99
- package/dist/cli-main.cjs +6 -41
- package/dist/cli-main.mjs +7 -42
- package/dist/interactive.cjs +2 -38
- package/dist/interactive.d.cts +2 -21
- package/dist/interactive.d.mts +2 -21
- package/dist/interactive.mjs +3 -38
- package/dist/{mcp-init-U670EyAl.mjs → mcp-init-CgugXHRM.mjs} +1 -1
- package/dist/{mcp-init-D5B_CAwE.cjs → mcp-init-M6gFdjmf.cjs} +1 -1
- package/dist/{package-BPevzsO6.cjs → package-BRkKiL7R.cjs} +1 -1
- package/dist/{package-gsYR9yUr.mjs → package-Dm7-Xv-5.mjs} +1 -1
- package/dist/types.d.cts +0 -1
- package/dist/types.d.mts +0 -1
- package/package.json +9 -12
- package/postcss.d.ts +0 -2
- package/postcss.js +0 -3
package/dist/cli-main.cjs
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
2
|
-
const require_package = require("./package-
|
|
2
|
+
const require_package = require("./package-BRkKiL7R.cjs");
|
|
3
3
|
let _bamboocss_logger = require("@bamboocss/logger");
|
|
4
4
|
let _bamboocss_node = require("@bamboocss/node");
|
|
5
5
|
let _bamboocss_shared = require("@bamboocss/shared");
|
|
@@ -8,42 +8,9 @@ let path = require("path");
|
|
|
8
8
|
let _clack_prompts = require("@clack/prompts");
|
|
9
9
|
_clack_prompts = require_package.__toESM(_clack_prompts);
|
|
10
10
|
//#region src/interactive.ts
|
|
11
|
-
|
|
12
|
-
* Which integration this project wants, before anybody is asked.
|
|
13
|
-
*
|
|
14
|
-
* The question is not really a preference. `@bamboocss/vite` compiles every `css()` and `cva()`
|
|
15
|
-
* call to a literal class string; `@bamboocss/postcss` emits the stylesheet and compiles
|
|
16
|
-
* nothing, so those calls stay runtime calls and the style engine ships to the client. Which of
|
|
17
|
-
* the two applies is decided by the bundler, and the answer is on disk: a Vite config means the
|
|
18
|
-
* compiler is available.
|
|
19
|
-
*
|
|
20
|
-
* Asked cold, with `yes` preselected, this steered every Vite project onto the runtime path by
|
|
21
|
-
* pressing Enter — and both setups render identically, so nothing afterwards reveals the
|
|
22
|
-
* choice. That is the same defect the React Router guide had, reached by a different door.
|
|
23
|
-
*
|
|
24
|
-
* Svelte, Vue and Astro are the exception in the other direction: their components are
|
|
25
|
-
* templates the compiler does not transform, so PostCSS is the integration they should be on
|
|
26
|
-
* and the default stays `yes`.
|
|
27
|
-
*/
|
|
28
|
-
const suggestPostcss = (cwd) => {
|
|
29
|
-
if (!(0, _bamboocss_node.findViteConfig)(cwd)) return "yes";
|
|
30
|
-
return (0, _bamboocss_node.hasUncompilableSources)({ cwd }) ? "yes" : "no";
|
|
31
|
-
};
|
|
32
|
-
const interactive = async (options = {}) => {
|
|
33
|
-
const postcssDefault = suggestPostcss(options.cwd ?? process.cwd());
|
|
11
|
+
const interactive = async (_options = {}) => {
|
|
34
12
|
_clack_prompts.intro(`bamboo v${require_package.version}`);
|
|
35
13
|
const initFlags = await _clack_prompts.group({
|
|
36
|
-
usePostcss: () => _clack_prompts.select({
|
|
37
|
-
message: postcssDefault === "no" ? "Emit the stylesheet through PostCSS? This project has a Vite config, and `@bamboocss/vite` compiles your style calls away instead." : "Emit the stylesheet through PostCSS?",
|
|
38
|
-
initialValue: postcssDefault,
|
|
39
|
-
options: [{
|
|
40
|
-
value: "yes",
|
|
41
|
-
label: "Yes"
|
|
42
|
-
}, {
|
|
43
|
-
value: "no",
|
|
44
|
-
label: "No"
|
|
45
|
-
}]
|
|
46
|
-
}),
|
|
47
14
|
useMjsExtension: () => _clack_prompts.select({
|
|
48
15
|
message: "Use the mjs extension ?",
|
|
49
16
|
initialValue: "yes",
|
|
@@ -83,7 +50,6 @@ const interactive = async (options = {}) => {
|
|
|
83
50
|
} });
|
|
84
51
|
_clack_prompts.outro("Let's get started! 🎋");
|
|
85
52
|
return {
|
|
86
|
-
postcss: initFlags.usePostcss === "yes",
|
|
87
53
|
outExtension: initFlags.useMjsExtension === "yes" ? "mjs" : "js",
|
|
88
54
|
strictValues: strictValuesFrom(initFlags.withStrictTokens),
|
|
89
55
|
gitignore: initFlags.shouldUpdateGitignore === "yes"
|
|
@@ -128,14 +94,14 @@ const normalizeStrictTokens = (value) => {
|
|
|
128
94
|
async function main() {
|
|
129
95
|
const cli = (0, cac.cac)("bamboo");
|
|
130
96
|
const cwd = process.cwd();
|
|
131
|
-
cli.command("init", "Initialize the bamboo config file").option("-i, --interactive", "Run in interactive mode", { default: false }).option("-f, --force", "Force overwrite existing config file").option("-
|
|
97
|
+
cli.command("init", "Initialize the bamboo config file").option("-i, --interactive", "Run in interactive mode", { default: false }).option("-f, --force", "Force overwrite existing config file").option("-c, --config <path>", "Path to bamboo config file").option("--cwd <cwd>", "Current working directory", { default: cwd }).option("--silent", "Suppress all messages except errors").option("--no-gitignore", "Don't update the .gitignore").option("--no-codegen", "Don't run the codegen logic").option("--out-extension <ext>", "The extension of the generated js files (default: 'mjs')").option("--outdir <dir>", "The output directory for the generated files").option("--strict-values [mode]", "Require every style value to be a token, so a raw css value is written `[14px]`").option("--logfile <file>", "Outputs logs to a file").action(async (initFlags = {}) => {
|
|
132
98
|
let options = {};
|
|
133
99
|
if (initFlags.interactive) options = await interactive({ cwd: (0, path.resolve)(initFlags.cwd ?? "") });
|
|
134
100
|
const flags = {
|
|
135
101
|
...initFlags,
|
|
136
102
|
...options
|
|
137
103
|
};
|
|
138
|
-
const { force,
|
|
104
|
+
const { force, silent, gitignore, outExtension, strictValues, config: configPath } = flags;
|
|
139
105
|
const cwd = (0, path.resolve)(flags.cwd ?? "");
|
|
140
106
|
if (silent) _bamboocss_logger.logger.level = "silent";
|
|
141
107
|
const stream = (0, _bamboocss_node.setLogStream)({
|
|
@@ -144,7 +110,6 @@ async function main() {
|
|
|
144
110
|
});
|
|
145
111
|
_bamboocss_logger.logger.info("cli", `Bamboo v${require_package.version}\n`);
|
|
146
112
|
const done = _bamboocss_logger.logger.time.info("✨ Bamboo initialized");
|
|
147
|
-
if (postcss) await (0, _bamboocss_node.setupPostcss)(cwd);
|
|
148
113
|
await (0, _bamboocss_node.setupConfig)(cwd, (0, _bamboocss_shared.compact)({
|
|
149
114
|
force,
|
|
150
115
|
outExtension,
|
|
@@ -201,7 +166,7 @@ async function main() {
|
|
|
201
166
|
else stream.end();
|
|
202
167
|
stopProfiling();
|
|
203
168
|
});
|
|
204
|
-
cli.command("cssgen [globOrType]", "Generate the css from files, or generate the css from the specified type which can be: preflight, tokens, static, global, keyframes").option("--silent", "Don't print any logs").option("-m, --minify", "Minify generated code").option("--clean", "Clean the output before generating").option("-c, --config <path>", "Path to bamboo config file").option("-w, --watch", "Watch files and rebuild").option("--polyfill", "Polyfill CSS @layers at-rules for older browsers.").option("-p, --poll", "Use polling instead of filesystem events when watching").option("-o, --outfile [file]", "Output file for extracted css, default to './styled-system/styles.css'").option("--splitting", "Emit CSS as separate files per layer (reset, global, tokens, utilities)
|
|
169
|
+
cli.command("cssgen [globOrType]", "Generate the css from files, or generate the css from the specified type which can be: preflight, tokens, static, global, keyframes").option("--silent", "Don't print any logs").option("-m, --minify", "Minify generated code").option("--clean", "Clean the output before generating").option("-c, --config <path>", "Path to bamboo config file").option("-w, --watch", "Watch files and rebuild").option("--polyfill", "Polyfill CSS @layers at-rules for older browsers.").option("-p, --poll", "Use polling instead of filesystem events when watching").option("-o, --outfile [file]", "Output file for extracted css, default to './styled-system/styles.css'").option("--splitting", "Emit CSS as separate files per layer (reset, global, tokens, utilities)").option("--cwd <cwd>", "Current working directory", { default: cwd }).option("--cpu-prof", "Generates a `.cpuprofile` to help debug performance issues").option("--logfile <file>", "Outputs logs to a file").action(async (maybeGlob, flags = {}) => {
|
|
205
170
|
const { silent, config: configPath, outfile, watch, poll, splitting, ...rest } = flags;
|
|
206
171
|
const cwd = (0, path.resolve)(flags.cwd ?? "");
|
|
207
172
|
const stream = (0, _bamboocss_node.setLogStream)({
|
|
@@ -459,7 +424,7 @@ async function main() {
|
|
|
459
424
|
process.exitCode = 1;
|
|
460
425
|
});
|
|
461
426
|
cli.command("init-mcp", "Initialize MCP configuration for AI clients").option("--cwd <cwd>", "Current working directory", { default: cwd }).option("--client <clients>", "AI clients to configure (claude, cursor, vscode, windsurf, codex)").action(async (mcpInitFlags) => {
|
|
462
|
-
const { initMcpConfig } = await Promise.resolve().then(() => require("./mcp-init-
|
|
427
|
+
const { initMcpConfig } = await Promise.resolve().then(() => require("./mcp-init-M6gFdjmf.cjs"));
|
|
463
428
|
const resolvedCwd = (0, path.resolve)(mcpInitFlags.cwd ?? cwd);
|
|
464
429
|
let clients;
|
|
465
430
|
if (mcpInitFlags.client) clients = (Array.isArray(mcpInitFlags.client) ? mcpInitFlags.client : [mcpInitFlags.client]).flatMap((c) => c.split(",")).map((c) => c.trim());
|
package/dist/cli-main.mjs
CHANGED
|
@@ -1,47 +1,14 @@
|
|
|
1
|
-
import { t as version } from "./package-
|
|
1
|
+
import { t as version } from "./package-Dm7-Xv-5.mjs";
|
|
2
2
|
import { logger } from "@bamboocss/logger";
|
|
3
|
-
import { BambooContext, analyze, buildInfo, codegen, cssgen, debug,
|
|
3
|
+
import { BambooContext, analyze, buildInfo, codegen, cssgen, debug, generate, generatePackageExports, loadConfigAndCreateContext, setLogStream, setupConfig, setupGitIgnore, spec, startProfiling } from "@bamboocss/node";
|
|
4
4
|
import { BambooError, compact } from "@bamboocss/shared";
|
|
5
5
|
import { cac } from "cac";
|
|
6
6
|
import { join, resolve } from "path";
|
|
7
7
|
import * as p from "@clack/prompts";
|
|
8
8
|
//#region src/interactive.ts
|
|
9
|
-
|
|
10
|
-
* Which integration this project wants, before anybody is asked.
|
|
11
|
-
*
|
|
12
|
-
* The question is not really a preference. `@bamboocss/vite` compiles every `css()` and `cva()`
|
|
13
|
-
* call to a literal class string; `@bamboocss/postcss` emits the stylesheet and compiles
|
|
14
|
-
* nothing, so those calls stay runtime calls and the style engine ships to the client. Which of
|
|
15
|
-
* the two applies is decided by the bundler, and the answer is on disk: a Vite config means the
|
|
16
|
-
* compiler is available.
|
|
17
|
-
*
|
|
18
|
-
* Asked cold, with `yes` preselected, this steered every Vite project onto the runtime path by
|
|
19
|
-
* pressing Enter — and both setups render identically, so nothing afterwards reveals the
|
|
20
|
-
* choice. That is the same defect the React Router guide had, reached by a different door.
|
|
21
|
-
*
|
|
22
|
-
* Svelte, Vue and Astro are the exception in the other direction: their components are
|
|
23
|
-
* templates the compiler does not transform, so PostCSS is the integration they should be on
|
|
24
|
-
* and the default stays `yes`.
|
|
25
|
-
*/
|
|
26
|
-
const suggestPostcss = (cwd) => {
|
|
27
|
-
if (!findViteConfig(cwd)) return "yes";
|
|
28
|
-
return hasUncompilableSources({ cwd }) ? "yes" : "no";
|
|
29
|
-
};
|
|
30
|
-
const interactive = async (options = {}) => {
|
|
31
|
-
const postcssDefault = suggestPostcss(options.cwd ?? process.cwd());
|
|
9
|
+
const interactive = async (_options = {}) => {
|
|
32
10
|
p.intro(`bamboo v${version}`);
|
|
33
11
|
const initFlags = await p.group({
|
|
34
|
-
usePostcss: () => p.select({
|
|
35
|
-
message: postcssDefault === "no" ? "Emit the stylesheet through PostCSS? This project has a Vite config, and `@bamboocss/vite` compiles your style calls away instead." : "Emit the stylesheet through PostCSS?",
|
|
36
|
-
initialValue: postcssDefault,
|
|
37
|
-
options: [{
|
|
38
|
-
value: "yes",
|
|
39
|
-
label: "Yes"
|
|
40
|
-
}, {
|
|
41
|
-
value: "no",
|
|
42
|
-
label: "No"
|
|
43
|
-
}]
|
|
44
|
-
}),
|
|
45
12
|
useMjsExtension: () => p.select({
|
|
46
13
|
message: "Use the mjs extension ?",
|
|
47
14
|
initialValue: "yes",
|
|
@@ -81,7 +48,6 @@ const interactive = async (options = {}) => {
|
|
|
81
48
|
} });
|
|
82
49
|
p.outro("Let's get started! 🎋");
|
|
83
50
|
return {
|
|
84
|
-
postcss: initFlags.usePostcss === "yes",
|
|
85
51
|
outExtension: initFlags.useMjsExtension === "yes" ? "mjs" : "js",
|
|
86
52
|
strictValues: strictValuesFrom(initFlags.withStrictTokens),
|
|
87
53
|
gitignore: initFlags.shouldUpdateGitignore === "yes"
|
|
@@ -126,14 +92,14 @@ const normalizeStrictTokens = (value) => {
|
|
|
126
92
|
async function main() {
|
|
127
93
|
const cli = cac("bamboo");
|
|
128
94
|
const cwd = process.cwd();
|
|
129
|
-
cli.command("init", "Initialize the bamboo config file").option("-i, --interactive", "Run in interactive mode", { default: false }).option("-f, --force", "Force overwrite existing config file").option("-
|
|
95
|
+
cli.command("init", "Initialize the bamboo config file").option("-i, --interactive", "Run in interactive mode", { default: false }).option("-f, --force", "Force overwrite existing config file").option("-c, --config <path>", "Path to bamboo config file").option("--cwd <cwd>", "Current working directory", { default: cwd }).option("--silent", "Suppress all messages except errors").option("--no-gitignore", "Don't update the .gitignore").option("--no-codegen", "Don't run the codegen logic").option("--out-extension <ext>", "The extension of the generated js files (default: 'mjs')").option("--outdir <dir>", "The output directory for the generated files").option("--strict-values [mode]", "Require every style value to be a token, so a raw css value is written `[14px]`").option("--logfile <file>", "Outputs logs to a file").action(async (initFlags = {}) => {
|
|
130
96
|
let options = {};
|
|
131
97
|
if (initFlags.interactive) options = await interactive({ cwd: resolve(initFlags.cwd ?? "") });
|
|
132
98
|
const flags = {
|
|
133
99
|
...initFlags,
|
|
134
100
|
...options
|
|
135
101
|
};
|
|
136
|
-
const { force,
|
|
102
|
+
const { force, silent, gitignore, outExtension, strictValues, config: configPath } = flags;
|
|
137
103
|
const cwd = resolve(flags.cwd ?? "");
|
|
138
104
|
if (silent) logger.level = "silent";
|
|
139
105
|
const stream = setLogStream({
|
|
@@ -142,7 +108,6 @@ async function main() {
|
|
|
142
108
|
});
|
|
143
109
|
logger.info("cli", `Bamboo v${version}\n`);
|
|
144
110
|
const done = logger.time.info("✨ Bamboo initialized");
|
|
145
|
-
if (postcss) await setupPostcss(cwd);
|
|
146
111
|
await setupConfig(cwd, compact({
|
|
147
112
|
force,
|
|
148
113
|
outExtension,
|
|
@@ -199,7 +164,7 @@ async function main() {
|
|
|
199
164
|
else stream.end();
|
|
200
165
|
stopProfiling();
|
|
201
166
|
});
|
|
202
|
-
cli.command("cssgen [globOrType]", "Generate the css from files, or generate the css from the specified type which can be: preflight, tokens, static, global, keyframes").option("--silent", "Don't print any logs").option("-m, --minify", "Minify generated code").option("--clean", "Clean the output before generating").option("-c, --config <path>", "Path to bamboo config file").option("-w, --watch", "Watch files and rebuild").option("--polyfill", "Polyfill CSS @layers at-rules for older browsers.").option("-p, --poll", "Use polling instead of filesystem events when watching").option("-o, --outfile [file]", "Output file for extracted css, default to './styled-system/styles.css'").option("--splitting", "Emit CSS as separate files per layer (reset, global, tokens, utilities)
|
|
167
|
+
cli.command("cssgen [globOrType]", "Generate the css from files, or generate the css from the specified type which can be: preflight, tokens, static, global, keyframes").option("--silent", "Don't print any logs").option("-m, --minify", "Minify generated code").option("--clean", "Clean the output before generating").option("-c, --config <path>", "Path to bamboo config file").option("-w, --watch", "Watch files and rebuild").option("--polyfill", "Polyfill CSS @layers at-rules for older browsers.").option("-p, --poll", "Use polling instead of filesystem events when watching").option("-o, --outfile [file]", "Output file for extracted css, default to './styled-system/styles.css'").option("--splitting", "Emit CSS as separate files per layer (reset, global, tokens, utilities)").option("--cwd <cwd>", "Current working directory", { default: cwd }).option("--cpu-prof", "Generates a `.cpuprofile` to help debug performance issues").option("--logfile <file>", "Outputs logs to a file").action(async (maybeGlob, flags = {}) => {
|
|
203
168
|
const { silent, config: configPath, outfile, watch, poll, splitting, ...rest } = flags;
|
|
204
169
|
const cwd = resolve(flags.cwd ?? "");
|
|
205
170
|
const stream = setLogStream({
|
|
@@ -457,7 +422,7 @@ async function main() {
|
|
|
457
422
|
process.exitCode = 1;
|
|
458
423
|
});
|
|
459
424
|
cli.command("init-mcp", "Initialize MCP configuration for AI clients").option("--cwd <cwd>", "Current working directory", { default: cwd }).option("--client <clients>", "AI clients to configure (claude, cursor, vscode, windsurf, codex)").action(async (mcpInitFlags) => {
|
|
460
|
-
const { initMcpConfig } = await import("./mcp-init-
|
|
425
|
+
const { initMcpConfig } = await import("./mcp-init-CgugXHRM.mjs");
|
|
461
426
|
const resolvedCwd = resolve(mcpInitFlags.cwd ?? cwd);
|
|
462
427
|
let clients;
|
|
463
428
|
if (mcpInitFlags.client) clients = (Array.isArray(mcpInitFlags.client) ? mcpInitFlags.client : [mcpInitFlags.client]).flatMap((c) => c.split(",")).map((c) => c.trim());
|
package/dist/interactive.cjs
CHANGED
|
@@ -21,49 +21,15 @@ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__ge
|
|
|
21
21
|
enumerable: true
|
|
22
22
|
}) : target, mod));
|
|
23
23
|
//#endregion
|
|
24
|
-
let _bamboocss_node = require("@bamboocss/node");
|
|
25
24
|
let _clack_prompts = require("@clack/prompts");
|
|
26
25
|
_clack_prompts = __toESM(_clack_prompts);
|
|
27
26
|
//#region package.json
|
|
28
|
-
var version = "1.
|
|
27
|
+
var version = "1.47.0";
|
|
29
28
|
//#endregion
|
|
30
29
|
//#region src/interactive.ts
|
|
31
|
-
|
|
32
|
-
* Which integration this project wants, before anybody is asked.
|
|
33
|
-
*
|
|
34
|
-
* The question is not really a preference. `@bamboocss/vite` compiles every `css()` and `cva()`
|
|
35
|
-
* call to a literal class string; `@bamboocss/postcss` emits the stylesheet and compiles
|
|
36
|
-
* nothing, so those calls stay runtime calls and the style engine ships to the client. Which of
|
|
37
|
-
* the two applies is decided by the bundler, and the answer is on disk: a Vite config means the
|
|
38
|
-
* compiler is available.
|
|
39
|
-
*
|
|
40
|
-
* Asked cold, with `yes` preselected, this steered every Vite project onto the runtime path by
|
|
41
|
-
* pressing Enter — and both setups render identically, so nothing afterwards reveals the
|
|
42
|
-
* choice. That is the same defect the React Router guide had, reached by a different door.
|
|
43
|
-
*
|
|
44
|
-
* Svelte, Vue and Astro are the exception in the other direction: their components are
|
|
45
|
-
* templates the compiler does not transform, so PostCSS is the integration they should be on
|
|
46
|
-
* and the default stays `yes`.
|
|
47
|
-
*/
|
|
48
|
-
const suggestPostcss = (cwd) => {
|
|
49
|
-
if (!(0, _bamboocss_node.findViteConfig)(cwd)) return "yes";
|
|
50
|
-
return (0, _bamboocss_node.hasUncompilableSources)({ cwd }) ? "yes" : "no";
|
|
51
|
-
};
|
|
52
|
-
const interactive = async (options = {}) => {
|
|
53
|
-
const postcssDefault = suggestPostcss(options.cwd ?? process.cwd());
|
|
30
|
+
const interactive = async (_options = {}) => {
|
|
54
31
|
_clack_prompts.intro(`bamboo v${version}`);
|
|
55
32
|
const initFlags = await _clack_prompts.group({
|
|
56
|
-
usePostcss: () => _clack_prompts.select({
|
|
57
|
-
message: postcssDefault === "no" ? "Emit the stylesheet through PostCSS? This project has a Vite config, and `@bamboocss/vite` compiles your style calls away instead." : "Emit the stylesheet through PostCSS?",
|
|
58
|
-
initialValue: postcssDefault,
|
|
59
|
-
options: [{
|
|
60
|
-
value: "yes",
|
|
61
|
-
label: "Yes"
|
|
62
|
-
}, {
|
|
63
|
-
value: "no",
|
|
64
|
-
label: "No"
|
|
65
|
-
}]
|
|
66
|
-
}),
|
|
67
33
|
useMjsExtension: () => _clack_prompts.select({
|
|
68
34
|
message: "Use the mjs extension ?",
|
|
69
35
|
initialValue: "yes",
|
|
@@ -103,7 +69,6 @@ const interactive = async (options = {}) => {
|
|
|
103
69
|
} });
|
|
104
70
|
_clack_prompts.outro("Let's get started! 🎋");
|
|
105
71
|
return {
|
|
106
|
-
postcss: initFlags.usePostcss === "yes",
|
|
107
72
|
outExtension: initFlags.useMjsExtension === "yes" ? "mjs" : "js",
|
|
108
73
|
strictValues: strictValuesFrom(initFlags.withStrictTokens),
|
|
109
74
|
gitignore: initFlags.shouldUpdateGitignore === "yes"
|
|
@@ -113,4 +78,3 @@ const interactive = async (options = {}) => {
|
|
|
113
78
|
const strictValuesFrom = (answer) => answer === "yes" ? true : void 0;
|
|
114
79
|
//#endregion
|
|
115
80
|
exports.interactive = interactive;
|
|
116
|
-
exports.suggestPostcss = suggestPostcss;
|
package/dist/interactive.d.cts
CHANGED
|
@@ -1,29 +1,10 @@
|
|
|
1
1
|
//#region src/interactive.d.ts
|
|
2
|
-
|
|
3
|
-
* Which integration this project wants, before anybody is asked.
|
|
4
|
-
*
|
|
5
|
-
* The question is not really a preference. `@bamboocss/vite` compiles every `css()` and `cva()`
|
|
6
|
-
* call to a literal class string; `@bamboocss/postcss` emits the stylesheet and compiles
|
|
7
|
-
* nothing, so those calls stay runtime calls and the style engine ships to the client. Which of
|
|
8
|
-
* the two applies is decided by the bundler, and the answer is on disk: a Vite config means the
|
|
9
|
-
* compiler is available.
|
|
10
|
-
*
|
|
11
|
-
* Asked cold, with `yes` preselected, this steered every Vite project onto the runtime path by
|
|
12
|
-
* pressing Enter — and both setups render identically, so nothing afterwards reveals the
|
|
13
|
-
* choice. That is the same defect the React Router guide had, reached by a different door.
|
|
14
|
-
*
|
|
15
|
-
* Svelte, Vue and Astro are the exception in the other direction: their components are
|
|
16
|
-
* templates the compiler does not transform, so PostCSS is the integration they should be on
|
|
17
|
-
* and the default stays `yes`.
|
|
18
|
-
*/
|
|
19
|
-
declare const suggestPostcss: (cwd: string) => "yes" | "no";
|
|
20
|
-
declare const interactive: (options?: {
|
|
2
|
+
declare const interactive: (_options?: {
|
|
21
3
|
cwd?: string;
|
|
22
4
|
}) => Promise<{
|
|
23
|
-
postcss: boolean;
|
|
24
5
|
outExtension: "mjs" | "js";
|
|
25
6
|
strictValues: boolean | undefined;
|
|
26
7
|
gitignore: boolean;
|
|
27
8
|
}>;
|
|
28
9
|
//#endregion
|
|
29
|
-
export { interactive
|
|
10
|
+
export { interactive };
|
package/dist/interactive.d.mts
CHANGED
|
@@ -1,29 +1,10 @@
|
|
|
1
1
|
//#region src/interactive.d.ts
|
|
2
|
-
|
|
3
|
-
* Which integration this project wants, before anybody is asked.
|
|
4
|
-
*
|
|
5
|
-
* The question is not really a preference. `@bamboocss/vite` compiles every `css()` and `cva()`
|
|
6
|
-
* call to a literal class string; `@bamboocss/postcss` emits the stylesheet and compiles
|
|
7
|
-
* nothing, so those calls stay runtime calls and the style engine ships to the client. Which of
|
|
8
|
-
* the two applies is decided by the bundler, and the answer is on disk: a Vite config means the
|
|
9
|
-
* compiler is available.
|
|
10
|
-
*
|
|
11
|
-
* Asked cold, with `yes` preselected, this steered every Vite project onto the runtime path by
|
|
12
|
-
* pressing Enter — and both setups render identically, so nothing afterwards reveals the
|
|
13
|
-
* choice. That is the same defect the React Router guide had, reached by a different door.
|
|
14
|
-
*
|
|
15
|
-
* Svelte, Vue and Astro are the exception in the other direction: their components are
|
|
16
|
-
* templates the compiler does not transform, so PostCSS is the integration they should be on
|
|
17
|
-
* and the default stays `yes`.
|
|
18
|
-
*/
|
|
19
|
-
declare const suggestPostcss: (cwd: string) => "yes" | "no";
|
|
20
|
-
declare const interactive: (options?: {
|
|
2
|
+
declare const interactive: (_options?: {
|
|
21
3
|
cwd?: string;
|
|
22
4
|
}) => Promise<{
|
|
23
|
-
postcss: boolean;
|
|
24
5
|
outExtension: "mjs" | "js";
|
|
25
6
|
strictValues: boolean | undefined;
|
|
26
7
|
gitignore: boolean;
|
|
27
8
|
}>;
|
|
28
9
|
//#endregion
|
|
29
|
-
export { interactive
|
|
10
|
+
export { interactive };
|
package/dist/interactive.mjs
CHANGED
|
@@ -1,45 +1,11 @@
|
|
|
1
|
-
import { findViteConfig, hasUncompilableSources } from "@bamboocss/node";
|
|
2
1
|
import * as p from "@clack/prompts";
|
|
3
2
|
//#region package.json
|
|
4
|
-
var version = "1.
|
|
3
|
+
var version = "1.47.0";
|
|
5
4
|
//#endregion
|
|
6
5
|
//#region src/interactive.ts
|
|
7
|
-
|
|
8
|
-
* Which integration this project wants, before anybody is asked.
|
|
9
|
-
*
|
|
10
|
-
* The question is not really a preference. `@bamboocss/vite` compiles every `css()` and `cva()`
|
|
11
|
-
* call to a literal class string; `@bamboocss/postcss` emits the stylesheet and compiles
|
|
12
|
-
* nothing, so those calls stay runtime calls and the style engine ships to the client. Which of
|
|
13
|
-
* the two applies is decided by the bundler, and the answer is on disk: a Vite config means the
|
|
14
|
-
* compiler is available.
|
|
15
|
-
*
|
|
16
|
-
* Asked cold, with `yes` preselected, this steered every Vite project onto the runtime path by
|
|
17
|
-
* pressing Enter — and both setups render identically, so nothing afterwards reveals the
|
|
18
|
-
* choice. That is the same defect the React Router guide had, reached by a different door.
|
|
19
|
-
*
|
|
20
|
-
* Svelte, Vue and Astro are the exception in the other direction: their components are
|
|
21
|
-
* templates the compiler does not transform, so PostCSS is the integration they should be on
|
|
22
|
-
* and the default stays `yes`.
|
|
23
|
-
*/
|
|
24
|
-
const suggestPostcss = (cwd) => {
|
|
25
|
-
if (!findViteConfig(cwd)) return "yes";
|
|
26
|
-
return hasUncompilableSources({ cwd }) ? "yes" : "no";
|
|
27
|
-
};
|
|
28
|
-
const interactive = async (options = {}) => {
|
|
29
|
-
const postcssDefault = suggestPostcss(options.cwd ?? process.cwd());
|
|
6
|
+
const interactive = async (_options = {}) => {
|
|
30
7
|
p.intro(`bamboo v${version}`);
|
|
31
8
|
const initFlags = await p.group({
|
|
32
|
-
usePostcss: () => p.select({
|
|
33
|
-
message: postcssDefault === "no" ? "Emit the stylesheet through PostCSS? This project has a Vite config, and `@bamboocss/vite` compiles your style calls away instead." : "Emit the stylesheet through PostCSS?",
|
|
34
|
-
initialValue: postcssDefault,
|
|
35
|
-
options: [{
|
|
36
|
-
value: "yes",
|
|
37
|
-
label: "Yes"
|
|
38
|
-
}, {
|
|
39
|
-
value: "no",
|
|
40
|
-
label: "No"
|
|
41
|
-
}]
|
|
42
|
-
}),
|
|
43
9
|
useMjsExtension: () => p.select({
|
|
44
10
|
message: "Use the mjs extension ?",
|
|
45
11
|
initialValue: "yes",
|
|
@@ -79,7 +45,6 @@ const interactive = async (options = {}) => {
|
|
|
79
45
|
} });
|
|
80
46
|
p.outro("Let's get started! 🎋");
|
|
81
47
|
return {
|
|
82
|
-
postcss: initFlags.usePostcss === "yes",
|
|
83
48
|
outExtension: initFlags.useMjsExtension === "yes" ? "mjs" : "js",
|
|
84
49
|
strictValues: strictValuesFrom(initFlags.withStrictTokens),
|
|
85
50
|
gitignore: initFlags.shouldUpdateGitignore === "yes"
|
|
@@ -88,4 +53,4 @@ const interactive = async (options = {}) => {
|
|
|
88
53
|
/** `'yes'` is the historical spelling of `true`. */
|
|
89
54
|
const strictValuesFrom = (answer) => answer === "yes" ? true : void 0;
|
|
90
55
|
//#endregion
|
|
91
|
-
export { interactive
|
|
56
|
+
export { interactive };
|
|
@@ -21,7 +21,7 @@ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__ge
|
|
|
21
21
|
}) : target, mod));
|
|
22
22
|
//#endregion
|
|
23
23
|
//#region package.json
|
|
24
|
-
var version = "1.
|
|
24
|
+
var version = "1.47.0";
|
|
25
25
|
//#endregion
|
|
26
26
|
Object.defineProperty(exports, "__toESM", {
|
|
27
27
|
enumerable: true,
|
package/dist/types.d.cts
CHANGED
package/dist/types.d.mts
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@bamboocss/dev",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.47.0",
|
|
4
4
|
"description": "Build-time, type-safe, zero-runtime CSS-in-JS",
|
|
5
5
|
"homepage": "https://bamboocss.com",
|
|
6
6
|
"license": "MIT",
|
|
@@ -19,8 +19,7 @@
|
|
|
19
19
|
"bin",
|
|
20
20
|
"app",
|
|
21
21
|
"bin.js",
|
|
22
|
-
"*.d.ts"
|
|
23
|
-
"postcss.js"
|
|
22
|
+
"*.d.ts"
|
|
24
23
|
],
|
|
25
24
|
"sideEffects": false,
|
|
26
25
|
"main": "dist/index.cjs",
|
|
@@ -45,7 +44,6 @@
|
|
|
45
44
|
"default": "./dist/presets.mjs"
|
|
46
45
|
}
|
|
47
46
|
},
|
|
48
|
-
"./postcss": "./postcss.js",
|
|
49
47
|
"./package.json": "./package.json"
|
|
50
48
|
},
|
|
51
49
|
"publishConfig": {
|
|
@@ -54,14 +52,13 @@
|
|
|
54
52
|
"dependencies": {
|
|
55
53
|
"@clack/prompts": "0.11.0",
|
|
56
54
|
"cac": "6.7.14",
|
|
57
|
-
"@bamboocss/logger": "1.
|
|
58
|
-
"@bamboocss/node": "1.
|
|
59
|
-
"@bamboocss/
|
|
60
|
-
"@bamboocss/preset-
|
|
61
|
-
"@bamboocss/
|
|
62
|
-
"@bamboocss/
|
|
63
|
-
"@bamboocss/
|
|
64
|
-
"@bamboocss/types": "1.46.3"
|
|
55
|
+
"@bamboocss/logger": "1.47.0",
|
|
56
|
+
"@bamboocss/node": "1.47.0",
|
|
57
|
+
"@bamboocss/preset-bamboo": "1.47.0",
|
|
58
|
+
"@bamboocss/preset-base": "1.47.0",
|
|
59
|
+
"@bamboocss/shared": "1.47.0",
|
|
60
|
+
"@bamboocss/token-dictionary": "1.47.0",
|
|
61
|
+
"@bamboocss/types": "1.47.0"
|
|
65
62
|
},
|
|
66
63
|
"devDependencies": {
|
|
67
64
|
"@types/update-notifier": "6.0.8",
|
package/postcss.d.ts
DELETED
package/postcss.js
DELETED