@bamboocss/dev 1.41.1 → 1.42.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 +29 -66
- package/dist/cli-default.mjs +29 -66
- package/dist/cli-main.cjs +30 -67
- package/dist/cli-main.mjs +30 -67
- package/dist/interactive.cjs +13 -30
- package/dist/interactive.d.cts +1 -1
- package/dist/interactive.d.mts +1 -1
- package/dist/interactive.mjs +13 -30
- package/dist/{mcp-init-1esym2Iu.cjs → mcp-init-Aivuh6s_.cjs} +1 -1
- package/dist/{mcp-init-BVu0e1CG.mjs → mcp-init-D4hhlivG.mjs} +1 -1
- package/dist/{package-D2RBCsDj.cjs → package-5wFLi_7C.cjs} +1 -1
- package/dist/{package-QimQHMG9.mjs → package-CN190FwT.mjs} +1 -1
- package/dist/presets.d.cts +1 -0
- package/dist/presets.d.mts +1 -0
- package/dist/types.d.cts +2 -2
- package/dist/types.d.mts +2 -2
- package/package.json +9 -9
package/dist/cli-default.cjs
CHANGED
|
@@ -7627,7 +7627,7 @@ function isLocError(error) {
|
|
|
7627
7627
|
//#endregion
|
|
7628
7628
|
//#region package.json
|
|
7629
7629
|
var name = "@bamboocss/dev";
|
|
7630
|
-
var version = "1.
|
|
7630
|
+
var version = "1.42.0";
|
|
7631
7631
|
//#endregion
|
|
7632
7632
|
//#region src/interactive.ts
|
|
7633
7633
|
/**
|
|
@@ -7678,22 +7678,15 @@ const interactive = async (options = {}) => {
|
|
|
7678
7678
|
}]
|
|
7679
7679
|
}),
|
|
7680
7680
|
withStrictTokens: () => _clack_prompts.select({
|
|
7681
|
-
message: "
|
|
7682
|
-
initialValue: "
|
|
7683
|
-
options: [
|
|
7684
|
-
|
|
7685
|
-
|
|
7686
|
-
|
|
7687
|
-
|
|
7688
|
-
|
|
7689
|
-
|
|
7690
|
-
label: "Reject a value that is neither a token nor a css keyword"
|
|
7691
|
-
},
|
|
7692
|
-
{
|
|
7693
|
-
value: "yes",
|
|
7694
|
-
label: "Only tokens — every raw value is written `[14px]`"
|
|
7695
|
-
}
|
|
7696
|
-
]
|
|
7681
|
+
message: "Must every style value be a token?",
|
|
7682
|
+
initialValue: "no",
|
|
7683
|
+
options: [{
|
|
7684
|
+
value: "no",
|
|
7685
|
+
label: "No — raw css values are fine"
|
|
7686
|
+
}, {
|
|
7687
|
+
value: "yes",
|
|
7688
|
+
label: "Yes — every raw value is written `[14px]`"
|
|
7689
|
+
}]
|
|
7697
7690
|
}),
|
|
7698
7691
|
shouldUpdateGitignore: () => _clack_prompts.select({
|
|
7699
7692
|
message: "Update gitignore?",
|
|
@@ -7714,39 +7707,21 @@ const interactive = async (options = {}) => {
|
|
|
7714
7707
|
return {
|
|
7715
7708
|
postcss: initFlags.usePostcss === "yes",
|
|
7716
7709
|
outExtension: initFlags.useMjsExtension === "yes" ? "mjs" : "js",
|
|
7717
|
-
|
|
7710
|
+
strictValues: strictValuesFrom(initFlags.withStrictTokens),
|
|
7718
7711
|
gitignore: initFlags.shouldUpdateGitignore === "yes"
|
|
7719
7712
|
};
|
|
7720
7713
|
};
|
|
7721
|
-
/**
|
|
7722
|
-
|
|
7723
|
-
*
|
|
7724
|
-
* "No" is `false`, not `undefined`. `undefined` now means "nothing was said", which the caller
|
|
7725
|
-
* reads as the default — so returning it here would hand the middle mode to someone who had
|
|
7726
|
-
* just declined it.
|
|
7727
|
-
*/
|
|
7728
|
-
const strictTokensFrom = (answer) => {
|
|
7729
|
-
if (answer === "yes") return true;
|
|
7730
|
-
if (answer === "unknown-tokens") return "unknown-tokens";
|
|
7731
|
-
return false;
|
|
7732
|
-
};
|
|
7714
|
+
/** `'yes'` is the historical spelling of `true`. */
|
|
7715
|
+
const strictValuesFrom = (answer) => answer === "yes" ? true : void 0;
|
|
7733
7716
|
//#endregion
|
|
7734
7717
|
//#region src/cli-main.ts
|
|
7735
7718
|
/**
|
|
7736
|
-
*
|
|
7719
|
+
* The negative spellings, answered here rather than left to cac, which only recognises
|
|
7720
|
+
* `--no-strict-values`. A user writing `--strict-values=false` means the same thing.
|
|
7737
7721
|
*
|
|
7738
|
-
*
|
|
7739
|
-
*
|
|
7740
|
-
*
|
|
7741
|
-
*
|
|
7742
|
-
* Anything else is refused rather than coerced. Mapping the unknown to `true` is the worst
|
|
7743
|
-
* available answer: `--strict-tokens=false` would turn it *on*, and a typo in the middle mode's
|
|
7744
|
-
* name would silently pick the strictest setting there is — every raw CSS value in the project
|
|
7745
|
-
* becoming a type error, with nothing naming the mistake. Refusing costs one message and is
|
|
7746
|
-
* always readable.
|
|
7747
|
-
*
|
|
7748
|
-
* The negative spellings are answered here rather than left to cac, which only recognises
|
|
7749
|
-
* `--no-strict-tokens`. A user writing `--strict-tokens=false` means the same thing.
|
|
7722
|
+
* Anything unrecognised is refused rather than coerced. Mapping the unknown to `true` is the
|
|
7723
|
+
* worst available answer: `--strict-values=false` would turn it *on*, and every raw CSS value in
|
|
7724
|
+
* the project would become a type error with nothing naming the mistake.
|
|
7750
7725
|
*/
|
|
7751
7726
|
const OFF = new Set([
|
|
7752
7727
|
"false",
|
|
@@ -7756,45 +7731,33 @@ const OFF = new Set([
|
|
|
7756
7731
|
""
|
|
7757
7732
|
]);
|
|
7758
7733
|
/**
|
|
7759
|
-
*
|
|
7760
|
-
*
|
|
7761
|
-
* `'unknown-tokens'` rather than nothing, because the default is the setting a project keeps.
|
|
7762
|
-
* Unchecked, `css({ color: 'mutedd' })` type-checks, builds, and ships `color: mutedd` — which
|
|
7763
|
-
* parses, so nothing objects and the browser drops it at compute time. `true` catches that and
|
|
7764
|
-
* rejects every raw value with it, which is a 468-error migration on one five-page app, so it is
|
|
7765
|
-
* realistically a day-one decision and a project that did not make it then never will.
|
|
7766
|
-
*
|
|
7767
|
-
* This one costs no migration: every literal value stays writable, and what it rejects is a bare
|
|
7768
|
-
* identifier that names neither a token nor a keyword the property enumerates. Run across this
|
|
7769
|
-
* repo's own documentation site it reported four, all of them real — `zIndex: 'overlay'` and
|
|
7770
|
-
* `'modal'` against a theme with no `zIndex` tokens, and a `transform: 'auto'` that is not css —
|
|
7771
|
-
* each shipping a declaration the browser discards.
|
|
7734
|
+
* `--strict-values` writes a *policy*, so nothing is written unless it is asked for.
|
|
7772
7735
|
*
|
|
7773
|
-
*
|
|
7774
|
-
*
|
|
7736
|
+
* It used to default to the middle mode, because leaving it off meant `css({ color: 'mutedd' })`
|
|
7737
|
+
* type-checked, built, and shipped a declaration the browser discards. The build reports that
|
|
7738
|
+
* now — see `unresolvedToken` — so what is left here is the question this setting was always
|
|
7739
|
+
* really about: must every raw CSS value be written `'[14px]'`? That is a team's decision about
|
|
7740
|
+
* their design system, and a default cannot make it for them.
|
|
7775
7741
|
*/
|
|
7776
|
-
const DEFAULT_STRICT_TOKENS = "unknown-tokens";
|
|
7777
7742
|
const normalizeStrictTokens = (value) => {
|
|
7778
|
-
if (value === void 0) return
|
|
7779
|
-
if (value === false) return void 0;
|
|
7743
|
+
if (value === void 0 || value === false) return void 0;
|
|
7780
7744
|
if (value === true) return true;
|
|
7781
7745
|
const named = String(value);
|
|
7782
7746
|
if (OFF.has(named)) return void 0;
|
|
7783
|
-
if (named === "unknown-tokens") return "unknown-tokens";
|
|
7784
7747
|
if (named === "true" || named === "yes" || named === "on") return true;
|
|
7785
|
-
throw new _bamboocss_shared.BambooError("CONFIG_ERROR", `\`--strict-
|
|
7748
|
+
throw new _bamboocss_shared.BambooError("CONFIG_ERROR", `\`--strict-values ${named}\` is not a setting. Pass it bare to require every value to be a token.`);
|
|
7786
7749
|
};
|
|
7787
7750
|
async function main() {
|
|
7788
7751
|
const cli = (0, cac.cac)("bamboo");
|
|
7789
7752
|
const cwd = process.cwd();
|
|
7790
|
-
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("-p, --postcss", "Emit postcss 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-
|
|
7753
|
+
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("-p, --postcss", "Emit postcss 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 = {}) => {
|
|
7791
7754
|
let options = {};
|
|
7792
7755
|
if (initFlags.interactive) options = await interactive({ cwd: (0, path.resolve)(initFlags.cwd ?? "") });
|
|
7793
7756
|
const flags = {
|
|
7794
7757
|
...initFlags,
|
|
7795
7758
|
...options
|
|
7796
7759
|
};
|
|
7797
|
-
const { force, postcss, silent, gitignore, outExtension,
|
|
7760
|
+
const { force, postcss, silent, gitignore, outExtension, strictValues, config: configPath } = flags;
|
|
7798
7761
|
const cwd = (0, path.resolve)(flags.cwd ?? "");
|
|
7799
7762
|
if (silent) _bamboocss_logger.logger.level = "silent";
|
|
7800
7763
|
const stream = (0, _bamboocss_node.setLogStream)({
|
|
@@ -7808,7 +7771,7 @@ async function main() {
|
|
|
7808
7771
|
force,
|
|
7809
7772
|
outExtension,
|
|
7810
7773
|
outdir: flags.outdir,
|
|
7811
|
-
|
|
7774
|
+
strictValues: normalizeStrictTokens(strictValues)
|
|
7812
7775
|
}));
|
|
7813
7776
|
const ctx = await (0, _bamboocss_node.loadConfigAndCreateContext)({
|
|
7814
7777
|
cwd,
|
package/dist/cli-default.mjs
CHANGED
|
@@ -7630,7 +7630,7 @@ function isLocError(error) {
|
|
|
7630
7630
|
//#endregion
|
|
7631
7631
|
//#region package.json
|
|
7632
7632
|
var name = "@bamboocss/dev";
|
|
7633
|
-
var version = "1.
|
|
7633
|
+
var version = "1.42.0";
|
|
7634
7634
|
//#endregion
|
|
7635
7635
|
//#region src/interactive.ts
|
|
7636
7636
|
/**
|
|
@@ -7681,22 +7681,15 @@ const interactive = async (options = {}) => {
|
|
|
7681
7681
|
}]
|
|
7682
7682
|
}),
|
|
7683
7683
|
withStrictTokens: () => p.select({
|
|
7684
|
-
message: "
|
|
7685
|
-
initialValue: "
|
|
7686
|
-
options: [
|
|
7687
|
-
|
|
7688
|
-
|
|
7689
|
-
|
|
7690
|
-
|
|
7691
|
-
|
|
7692
|
-
|
|
7693
|
-
label: "Reject a value that is neither a token nor a css keyword"
|
|
7694
|
-
},
|
|
7695
|
-
{
|
|
7696
|
-
value: "yes",
|
|
7697
|
-
label: "Only tokens — every raw value is written `[14px]`"
|
|
7698
|
-
}
|
|
7699
|
-
]
|
|
7684
|
+
message: "Must every style value be a token?",
|
|
7685
|
+
initialValue: "no",
|
|
7686
|
+
options: [{
|
|
7687
|
+
value: "no",
|
|
7688
|
+
label: "No — raw css values are fine"
|
|
7689
|
+
}, {
|
|
7690
|
+
value: "yes",
|
|
7691
|
+
label: "Yes — every raw value is written `[14px]`"
|
|
7692
|
+
}]
|
|
7700
7693
|
}),
|
|
7701
7694
|
shouldUpdateGitignore: () => p.select({
|
|
7702
7695
|
message: "Update gitignore?",
|
|
@@ -7717,39 +7710,21 @@ const interactive = async (options = {}) => {
|
|
|
7717
7710
|
return {
|
|
7718
7711
|
postcss: initFlags.usePostcss === "yes",
|
|
7719
7712
|
outExtension: initFlags.useMjsExtension === "yes" ? "mjs" : "js",
|
|
7720
|
-
|
|
7713
|
+
strictValues: strictValuesFrom(initFlags.withStrictTokens),
|
|
7721
7714
|
gitignore: initFlags.shouldUpdateGitignore === "yes"
|
|
7722
7715
|
};
|
|
7723
7716
|
};
|
|
7724
|
-
/**
|
|
7725
|
-
|
|
7726
|
-
*
|
|
7727
|
-
* "No" is `false`, not `undefined`. `undefined` now means "nothing was said", which the caller
|
|
7728
|
-
* reads as the default — so returning it here would hand the middle mode to someone who had
|
|
7729
|
-
* just declined it.
|
|
7730
|
-
*/
|
|
7731
|
-
const strictTokensFrom = (answer) => {
|
|
7732
|
-
if (answer === "yes") return true;
|
|
7733
|
-
if (answer === "unknown-tokens") return "unknown-tokens";
|
|
7734
|
-
return false;
|
|
7735
|
-
};
|
|
7717
|
+
/** `'yes'` is the historical spelling of `true`. */
|
|
7718
|
+
const strictValuesFrom = (answer) => answer === "yes" ? true : void 0;
|
|
7736
7719
|
//#endregion
|
|
7737
7720
|
//#region src/cli-main.ts
|
|
7738
7721
|
/**
|
|
7739
|
-
*
|
|
7722
|
+
* The negative spellings, answered here rather than left to cac, which only recognises
|
|
7723
|
+
* `--no-strict-values`. A user writing `--strict-values=false` means the same thing.
|
|
7740
7724
|
*
|
|
7741
|
-
*
|
|
7742
|
-
*
|
|
7743
|
-
*
|
|
7744
|
-
*
|
|
7745
|
-
* Anything else is refused rather than coerced. Mapping the unknown to `true` is the worst
|
|
7746
|
-
* available answer: `--strict-tokens=false` would turn it *on*, and a typo in the middle mode's
|
|
7747
|
-
* name would silently pick the strictest setting there is — every raw CSS value in the project
|
|
7748
|
-
* becoming a type error, with nothing naming the mistake. Refusing costs one message and is
|
|
7749
|
-
* always readable.
|
|
7750
|
-
*
|
|
7751
|
-
* The negative spellings are answered here rather than left to cac, which only recognises
|
|
7752
|
-
* `--no-strict-tokens`. A user writing `--strict-tokens=false` means the same thing.
|
|
7725
|
+
* Anything unrecognised is refused rather than coerced. Mapping the unknown to `true` is the
|
|
7726
|
+
* worst available answer: `--strict-values=false` would turn it *on*, and every raw CSS value in
|
|
7727
|
+
* the project would become a type error with nothing naming the mistake.
|
|
7753
7728
|
*/
|
|
7754
7729
|
const OFF = new Set([
|
|
7755
7730
|
"false",
|
|
@@ -7759,45 +7734,33 @@ const OFF = new Set([
|
|
|
7759
7734
|
""
|
|
7760
7735
|
]);
|
|
7761
7736
|
/**
|
|
7762
|
-
*
|
|
7763
|
-
*
|
|
7764
|
-
* `'unknown-tokens'` rather than nothing, because the default is the setting a project keeps.
|
|
7765
|
-
* Unchecked, `css({ color: 'mutedd' })` type-checks, builds, and ships `color: mutedd` — which
|
|
7766
|
-
* parses, so nothing objects and the browser drops it at compute time. `true` catches that and
|
|
7767
|
-
* rejects every raw value with it, which is a 468-error migration on one five-page app, so it is
|
|
7768
|
-
* realistically a day-one decision and a project that did not make it then never will.
|
|
7769
|
-
*
|
|
7770
|
-
* This one costs no migration: every literal value stays writable, and what it rejects is a bare
|
|
7771
|
-
* identifier that names neither a token nor a keyword the property enumerates. Run across this
|
|
7772
|
-
* repo's own documentation site it reported four, all of them real — `zIndex: 'overlay'` and
|
|
7773
|
-
* `'modal'` against a theme with no `zIndex` tokens, and a `transform: 'auto'` that is not css —
|
|
7774
|
-
* each shipping a declaration the browser discards.
|
|
7737
|
+
* `--strict-values` writes a *policy*, so nothing is written unless it is asked for.
|
|
7775
7738
|
*
|
|
7776
|
-
*
|
|
7777
|
-
*
|
|
7739
|
+
* It used to default to the middle mode, because leaving it off meant `css({ color: 'mutedd' })`
|
|
7740
|
+
* type-checked, built, and shipped a declaration the browser discards. The build reports that
|
|
7741
|
+
* now — see `unresolvedToken` — so what is left here is the question this setting was always
|
|
7742
|
+
* really about: must every raw CSS value be written `'[14px]'`? That is a team's decision about
|
|
7743
|
+
* their design system, and a default cannot make it for them.
|
|
7778
7744
|
*/
|
|
7779
|
-
const DEFAULT_STRICT_TOKENS = "unknown-tokens";
|
|
7780
7745
|
const normalizeStrictTokens = (value) => {
|
|
7781
|
-
if (value === void 0) return
|
|
7782
|
-
if (value === false) return void 0;
|
|
7746
|
+
if (value === void 0 || value === false) return void 0;
|
|
7783
7747
|
if (value === true) return true;
|
|
7784
7748
|
const named = String(value);
|
|
7785
7749
|
if (OFF.has(named)) return void 0;
|
|
7786
|
-
if (named === "unknown-tokens") return "unknown-tokens";
|
|
7787
7750
|
if (named === "true" || named === "yes" || named === "on") return true;
|
|
7788
|
-
throw new BambooError("CONFIG_ERROR", `\`--strict-
|
|
7751
|
+
throw new BambooError("CONFIG_ERROR", `\`--strict-values ${named}\` is not a setting. Pass it bare to require every value to be a token.`);
|
|
7789
7752
|
};
|
|
7790
7753
|
async function main() {
|
|
7791
7754
|
const cli = cac("bamboo");
|
|
7792
7755
|
const cwd = process.cwd();
|
|
7793
|
-
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("-p, --postcss", "Emit postcss 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-
|
|
7756
|
+
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("-p, --postcss", "Emit postcss 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 = {}) => {
|
|
7794
7757
|
let options = {};
|
|
7795
7758
|
if (initFlags.interactive) options = await interactive({ cwd: resolve(initFlags.cwd ?? "") });
|
|
7796
7759
|
const flags = {
|
|
7797
7760
|
...initFlags,
|
|
7798
7761
|
...options
|
|
7799
7762
|
};
|
|
7800
|
-
const { force, postcss, silent, gitignore, outExtension,
|
|
7763
|
+
const { force, postcss, silent, gitignore, outExtension, strictValues, config: configPath } = flags;
|
|
7801
7764
|
const cwd = resolve(flags.cwd ?? "");
|
|
7802
7765
|
if (silent) logger.level = "silent";
|
|
7803
7766
|
const stream = setLogStream({
|
|
@@ -7811,7 +7774,7 @@ async function main() {
|
|
|
7811
7774
|
force,
|
|
7812
7775
|
outExtension,
|
|
7813
7776
|
outdir: flags.outdir,
|
|
7814
|
-
|
|
7777
|
+
strictValues: normalizeStrictTokens(strictValues)
|
|
7815
7778
|
}));
|
|
7816
7779
|
const ctx = await loadConfigAndCreateContext({
|
|
7817
7780
|
cwd,
|
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-5wFLi_7C.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");
|
|
@@ -56,22 +56,15 @@ const interactive = async (options = {}) => {
|
|
|
56
56
|
}]
|
|
57
57
|
}),
|
|
58
58
|
withStrictTokens: () => _clack_prompts.select({
|
|
59
|
-
message: "
|
|
60
|
-
initialValue: "
|
|
61
|
-
options: [
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
label: "Reject a value that is neither a token nor a css keyword"
|
|
69
|
-
},
|
|
70
|
-
{
|
|
71
|
-
value: "yes",
|
|
72
|
-
label: "Only tokens — every raw value is written `[14px]`"
|
|
73
|
-
}
|
|
74
|
-
]
|
|
59
|
+
message: "Must every style value be a token?",
|
|
60
|
+
initialValue: "no",
|
|
61
|
+
options: [{
|
|
62
|
+
value: "no",
|
|
63
|
+
label: "No — raw css values are fine"
|
|
64
|
+
}, {
|
|
65
|
+
value: "yes",
|
|
66
|
+
label: "Yes — every raw value is written `[14px]`"
|
|
67
|
+
}]
|
|
75
68
|
}),
|
|
76
69
|
shouldUpdateGitignore: () => _clack_prompts.select({
|
|
77
70
|
message: "Update gitignore?",
|
|
@@ -92,39 +85,21 @@ const interactive = async (options = {}) => {
|
|
|
92
85
|
return {
|
|
93
86
|
postcss: initFlags.usePostcss === "yes",
|
|
94
87
|
outExtension: initFlags.useMjsExtension === "yes" ? "mjs" : "js",
|
|
95
|
-
|
|
88
|
+
strictValues: strictValuesFrom(initFlags.withStrictTokens),
|
|
96
89
|
gitignore: initFlags.shouldUpdateGitignore === "yes"
|
|
97
90
|
};
|
|
98
91
|
};
|
|
99
|
-
/**
|
|
100
|
-
|
|
101
|
-
*
|
|
102
|
-
* "No" is `false`, not `undefined`. `undefined` now means "nothing was said", which the caller
|
|
103
|
-
* reads as the default — so returning it here would hand the middle mode to someone who had
|
|
104
|
-
* just declined it.
|
|
105
|
-
*/
|
|
106
|
-
const strictTokensFrom = (answer) => {
|
|
107
|
-
if (answer === "yes") return true;
|
|
108
|
-
if (answer === "unknown-tokens") return "unknown-tokens";
|
|
109
|
-
return false;
|
|
110
|
-
};
|
|
92
|
+
/** `'yes'` is the historical spelling of `true`. */
|
|
93
|
+
const strictValuesFrom = (answer) => answer === "yes" ? true : void 0;
|
|
111
94
|
//#endregion
|
|
112
95
|
//#region src/cli-main.ts
|
|
113
96
|
/**
|
|
114
|
-
*
|
|
115
|
-
*
|
|
116
|
-
* Bare is `true`, which is what the flag has always meant, and a named mode is passed through
|
|
117
|
-
* so the middle setting is reachable from the CLI at all — it would otherwise be a config-file
|
|
118
|
-
* feature `bamboo init` could not produce.
|
|
97
|
+
* The negative spellings, answered here rather than left to cac, which only recognises
|
|
98
|
+
* `--no-strict-values`. A user writing `--strict-values=false` means the same thing.
|
|
119
99
|
*
|
|
120
|
-
* Anything
|
|
121
|
-
* available answer: `--strict-
|
|
122
|
-
*
|
|
123
|
-
* becoming a type error, with nothing naming the mistake. Refusing costs one message and is
|
|
124
|
-
* always readable.
|
|
125
|
-
*
|
|
126
|
-
* The negative spellings are answered here rather than left to cac, which only recognises
|
|
127
|
-
* `--no-strict-tokens`. A user writing `--strict-tokens=false` means the same thing.
|
|
100
|
+
* Anything unrecognised is refused rather than coerced. Mapping the unknown to `true` is the
|
|
101
|
+
* worst available answer: `--strict-values=false` would turn it *on*, and every raw CSS value in
|
|
102
|
+
* the project would become a type error with nothing naming the mistake.
|
|
128
103
|
*/
|
|
129
104
|
const OFF = new Set([
|
|
130
105
|
"false",
|
|
@@ -134,45 +109,33 @@ const OFF = new Set([
|
|
|
134
109
|
""
|
|
135
110
|
]);
|
|
136
111
|
/**
|
|
137
|
-
*
|
|
138
|
-
*
|
|
139
|
-
* `'unknown-tokens'` rather than nothing, because the default is the setting a project keeps.
|
|
140
|
-
* Unchecked, `css({ color: 'mutedd' })` type-checks, builds, and ships `color: mutedd` — which
|
|
141
|
-
* parses, so nothing objects and the browser drops it at compute time. `true` catches that and
|
|
142
|
-
* rejects every raw value with it, which is a 468-error migration on one five-page app, so it is
|
|
143
|
-
* realistically a day-one decision and a project that did not make it then never will.
|
|
144
|
-
*
|
|
145
|
-
* This one costs no migration: every literal value stays writable, and what it rejects is a bare
|
|
146
|
-
* identifier that names neither a token nor a keyword the property enumerates. Run across this
|
|
147
|
-
* repo's own documentation site it reported four, all of them real — `zIndex: 'overlay'` and
|
|
148
|
-
* `'modal'` against a theme with no `zIndex` tokens, and a `transform: 'auto'` that is not css —
|
|
149
|
-
* each shipping a declaration the browser discards.
|
|
112
|
+
* `--strict-values` writes a *policy*, so nothing is written unless it is asked for.
|
|
150
113
|
*
|
|
151
|
-
*
|
|
152
|
-
*
|
|
114
|
+
* It used to default to the middle mode, because leaving it off meant `css({ color: 'mutedd' })`
|
|
115
|
+
* type-checked, built, and shipped a declaration the browser discards. The build reports that
|
|
116
|
+
* now — see `unresolvedToken` — so what is left here is the question this setting was always
|
|
117
|
+
* really about: must every raw CSS value be written `'[14px]'`? That is a team's decision about
|
|
118
|
+
* their design system, and a default cannot make it for them.
|
|
153
119
|
*/
|
|
154
|
-
const DEFAULT_STRICT_TOKENS = "unknown-tokens";
|
|
155
120
|
const normalizeStrictTokens = (value) => {
|
|
156
|
-
if (value === void 0) return
|
|
157
|
-
if (value === false) return void 0;
|
|
121
|
+
if (value === void 0 || value === false) return void 0;
|
|
158
122
|
if (value === true) return true;
|
|
159
123
|
const named = String(value);
|
|
160
124
|
if (OFF.has(named)) return void 0;
|
|
161
|
-
if (named === "unknown-tokens") return "unknown-tokens";
|
|
162
125
|
if (named === "true" || named === "yes" || named === "on") return true;
|
|
163
|
-
throw new _bamboocss_shared.BambooError("CONFIG_ERROR", `\`--strict-
|
|
126
|
+
throw new _bamboocss_shared.BambooError("CONFIG_ERROR", `\`--strict-values ${named}\` is not a setting. Pass it bare to require every value to be a token.`);
|
|
164
127
|
};
|
|
165
128
|
async function main() {
|
|
166
129
|
const cli = (0, cac.cac)("bamboo");
|
|
167
130
|
const cwd = process.cwd();
|
|
168
|
-
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("-p, --postcss", "Emit postcss 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-
|
|
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("-p, --postcss", "Emit postcss 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 = {}) => {
|
|
169
132
|
let options = {};
|
|
170
133
|
if (initFlags.interactive) options = await interactive({ cwd: (0, path.resolve)(initFlags.cwd ?? "") });
|
|
171
134
|
const flags = {
|
|
172
135
|
...initFlags,
|
|
173
136
|
...options
|
|
174
137
|
};
|
|
175
|
-
const { force, postcss, silent, gitignore, outExtension,
|
|
138
|
+
const { force, postcss, silent, gitignore, outExtension, strictValues, config: configPath } = flags;
|
|
176
139
|
const cwd = (0, path.resolve)(flags.cwd ?? "");
|
|
177
140
|
if (silent) _bamboocss_logger.logger.level = "silent";
|
|
178
141
|
const stream = (0, _bamboocss_node.setLogStream)({
|
|
@@ -186,7 +149,7 @@ async function main() {
|
|
|
186
149
|
force,
|
|
187
150
|
outExtension,
|
|
188
151
|
outdir: flags.outdir,
|
|
189
|
-
|
|
152
|
+
strictValues: normalizeStrictTokens(strictValues)
|
|
190
153
|
}));
|
|
191
154
|
const ctx = await (0, _bamboocss_node.loadConfigAndCreateContext)({
|
|
192
155
|
cwd,
|
|
@@ -494,7 +457,7 @@ async function main() {
|
|
|
494
457
|
process.exitCode = 1;
|
|
495
458
|
});
|
|
496
459
|
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) => {
|
|
497
|
-
const { initMcpConfig } = await Promise.resolve().then(() => require("./mcp-init-
|
|
460
|
+
const { initMcpConfig } = await Promise.resolve().then(() => require("./mcp-init-Aivuh6s_.cjs"));
|
|
498
461
|
const resolvedCwd = (0, path.resolve)(mcpInitFlags.cwd ?? cwd);
|
|
499
462
|
let clients;
|
|
500
463
|
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,4 +1,4 @@
|
|
|
1
|
-
import { t as version } from "./package-
|
|
1
|
+
import { t as version } from "./package-CN190FwT.mjs";
|
|
2
2
|
import { logger } from "@bamboocss/logger";
|
|
3
3
|
import { BambooContext, analyze, buildInfo, codegen, cssgen, debug, findViteConfig, generate, generatePackageExports, hasUncompilableSources, loadConfigAndCreateContext, setLogStream, setupConfig, setupGitIgnore, setupPostcss, spec, startProfiling } from "@bamboocss/node";
|
|
4
4
|
import { BambooError, compact } from "@bamboocss/shared";
|
|
@@ -54,22 +54,15 @@ const interactive = async (options = {}) => {
|
|
|
54
54
|
}]
|
|
55
55
|
}),
|
|
56
56
|
withStrictTokens: () => p.select({
|
|
57
|
-
message: "
|
|
58
|
-
initialValue: "
|
|
59
|
-
options: [
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
label: "Reject a value that is neither a token nor a css keyword"
|
|
67
|
-
},
|
|
68
|
-
{
|
|
69
|
-
value: "yes",
|
|
70
|
-
label: "Only tokens — every raw value is written `[14px]`"
|
|
71
|
-
}
|
|
72
|
-
]
|
|
57
|
+
message: "Must every style value be a token?",
|
|
58
|
+
initialValue: "no",
|
|
59
|
+
options: [{
|
|
60
|
+
value: "no",
|
|
61
|
+
label: "No — raw css values are fine"
|
|
62
|
+
}, {
|
|
63
|
+
value: "yes",
|
|
64
|
+
label: "Yes — every raw value is written `[14px]`"
|
|
65
|
+
}]
|
|
73
66
|
}),
|
|
74
67
|
shouldUpdateGitignore: () => p.select({
|
|
75
68
|
message: "Update gitignore?",
|
|
@@ -90,39 +83,21 @@ const interactive = async (options = {}) => {
|
|
|
90
83
|
return {
|
|
91
84
|
postcss: initFlags.usePostcss === "yes",
|
|
92
85
|
outExtension: initFlags.useMjsExtension === "yes" ? "mjs" : "js",
|
|
93
|
-
|
|
86
|
+
strictValues: strictValuesFrom(initFlags.withStrictTokens),
|
|
94
87
|
gitignore: initFlags.shouldUpdateGitignore === "yes"
|
|
95
88
|
};
|
|
96
89
|
};
|
|
97
|
-
/**
|
|
98
|
-
|
|
99
|
-
*
|
|
100
|
-
* "No" is `false`, not `undefined`. `undefined` now means "nothing was said", which the caller
|
|
101
|
-
* reads as the default — so returning it here would hand the middle mode to someone who had
|
|
102
|
-
* just declined it.
|
|
103
|
-
*/
|
|
104
|
-
const strictTokensFrom = (answer) => {
|
|
105
|
-
if (answer === "yes") return true;
|
|
106
|
-
if (answer === "unknown-tokens") return "unknown-tokens";
|
|
107
|
-
return false;
|
|
108
|
-
};
|
|
90
|
+
/** `'yes'` is the historical spelling of `true`. */
|
|
91
|
+
const strictValuesFrom = (answer) => answer === "yes" ? true : void 0;
|
|
109
92
|
//#endregion
|
|
110
93
|
//#region src/cli-main.ts
|
|
111
94
|
/**
|
|
112
|
-
*
|
|
113
|
-
*
|
|
114
|
-
* Bare is `true`, which is what the flag has always meant, and a named mode is passed through
|
|
115
|
-
* so the middle setting is reachable from the CLI at all — it would otherwise be a config-file
|
|
116
|
-
* feature `bamboo init` could not produce.
|
|
95
|
+
* The negative spellings, answered here rather than left to cac, which only recognises
|
|
96
|
+
* `--no-strict-values`. A user writing `--strict-values=false` means the same thing.
|
|
117
97
|
*
|
|
118
|
-
* Anything
|
|
119
|
-
* available answer: `--strict-
|
|
120
|
-
*
|
|
121
|
-
* becoming a type error, with nothing naming the mistake. Refusing costs one message and is
|
|
122
|
-
* always readable.
|
|
123
|
-
*
|
|
124
|
-
* The negative spellings are answered here rather than left to cac, which only recognises
|
|
125
|
-
* `--no-strict-tokens`. A user writing `--strict-tokens=false` means the same thing.
|
|
98
|
+
* Anything unrecognised is refused rather than coerced. Mapping the unknown to `true` is the
|
|
99
|
+
* worst available answer: `--strict-values=false` would turn it *on*, and every raw CSS value in
|
|
100
|
+
* the project would become a type error with nothing naming the mistake.
|
|
126
101
|
*/
|
|
127
102
|
const OFF = new Set([
|
|
128
103
|
"false",
|
|
@@ -132,45 +107,33 @@ const OFF = new Set([
|
|
|
132
107
|
""
|
|
133
108
|
]);
|
|
134
109
|
/**
|
|
135
|
-
*
|
|
136
|
-
*
|
|
137
|
-
* `'unknown-tokens'` rather than nothing, because the default is the setting a project keeps.
|
|
138
|
-
* Unchecked, `css({ color: 'mutedd' })` type-checks, builds, and ships `color: mutedd` — which
|
|
139
|
-
* parses, so nothing objects and the browser drops it at compute time. `true` catches that and
|
|
140
|
-
* rejects every raw value with it, which is a 468-error migration on one five-page app, so it is
|
|
141
|
-
* realistically a day-one decision and a project that did not make it then never will.
|
|
142
|
-
*
|
|
143
|
-
* This one costs no migration: every literal value stays writable, and what it rejects is a bare
|
|
144
|
-
* identifier that names neither a token nor a keyword the property enumerates. Run across this
|
|
145
|
-
* repo's own documentation site it reported four, all of them real — `zIndex: 'overlay'` and
|
|
146
|
-
* `'modal'` against a theme with no `zIndex` tokens, and a `transform: 'auto'` that is not css —
|
|
147
|
-
* each shipping a declaration the browser discards.
|
|
110
|
+
* `--strict-values` writes a *policy*, so nothing is written unless it is asked for.
|
|
148
111
|
*
|
|
149
|
-
*
|
|
150
|
-
*
|
|
112
|
+
* It used to default to the middle mode, because leaving it off meant `css({ color: 'mutedd' })`
|
|
113
|
+
* type-checked, built, and shipped a declaration the browser discards. The build reports that
|
|
114
|
+
* now — see `unresolvedToken` — so what is left here is the question this setting was always
|
|
115
|
+
* really about: must every raw CSS value be written `'[14px]'`? That is a team's decision about
|
|
116
|
+
* their design system, and a default cannot make it for them.
|
|
151
117
|
*/
|
|
152
|
-
const DEFAULT_STRICT_TOKENS = "unknown-tokens";
|
|
153
118
|
const normalizeStrictTokens = (value) => {
|
|
154
|
-
if (value === void 0) return
|
|
155
|
-
if (value === false) return void 0;
|
|
119
|
+
if (value === void 0 || value === false) return void 0;
|
|
156
120
|
if (value === true) return true;
|
|
157
121
|
const named = String(value);
|
|
158
122
|
if (OFF.has(named)) return void 0;
|
|
159
|
-
if (named === "unknown-tokens") return "unknown-tokens";
|
|
160
123
|
if (named === "true" || named === "yes" || named === "on") return true;
|
|
161
|
-
throw new BambooError("CONFIG_ERROR", `\`--strict-
|
|
124
|
+
throw new BambooError("CONFIG_ERROR", `\`--strict-values ${named}\` is not a setting. Pass it bare to require every value to be a token.`);
|
|
162
125
|
};
|
|
163
126
|
async function main() {
|
|
164
127
|
const cli = cac("bamboo");
|
|
165
128
|
const cwd = process.cwd();
|
|
166
|
-
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("-p, --postcss", "Emit postcss 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-
|
|
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("-p, --postcss", "Emit postcss 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 = {}) => {
|
|
167
130
|
let options = {};
|
|
168
131
|
if (initFlags.interactive) options = await interactive({ cwd: resolve(initFlags.cwd ?? "") });
|
|
169
132
|
const flags = {
|
|
170
133
|
...initFlags,
|
|
171
134
|
...options
|
|
172
135
|
};
|
|
173
|
-
const { force, postcss, silent, gitignore, outExtension,
|
|
136
|
+
const { force, postcss, silent, gitignore, outExtension, strictValues, config: configPath } = flags;
|
|
174
137
|
const cwd = resolve(flags.cwd ?? "");
|
|
175
138
|
if (silent) logger.level = "silent";
|
|
176
139
|
const stream = setLogStream({
|
|
@@ -184,7 +147,7 @@ async function main() {
|
|
|
184
147
|
force,
|
|
185
148
|
outExtension,
|
|
186
149
|
outdir: flags.outdir,
|
|
187
|
-
|
|
150
|
+
strictValues: normalizeStrictTokens(strictValues)
|
|
188
151
|
}));
|
|
189
152
|
const ctx = await loadConfigAndCreateContext({
|
|
190
153
|
cwd,
|
|
@@ -492,7 +455,7 @@ async function main() {
|
|
|
492
455
|
process.exitCode = 1;
|
|
493
456
|
});
|
|
494
457
|
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) => {
|
|
495
|
-
const { initMcpConfig } = await import("./mcp-init-
|
|
458
|
+
const { initMcpConfig } = await import("./mcp-init-D4hhlivG.mjs");
|
|
496
459
|
const resolvedCwd = resolve(mcpInitFlags.cwd ?? cwd);
|
|
497
460
|
let clients;
|
|
498
461
|
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
|
@@ -25,7 +25,7 @@ let _bamboocss_node = require("@bamboocss/node");
|
|
|
25
25
|
let _clack_prompts = require("@clack/prompts");
|
|
26
26
|
_clack_prompts = __toESM(_clack_prompts);
|
|
27
27
|
//#region package.json
|
|
28
|
-
var version = "1.
|
|
28
|
+
var version = "1.42.0";
|
|
29
29
|
//#endregion
|
|
30
30
|
//#region src/interactive.ts
|
|
31
31
|
/**
|
|
@@ -76,22 +76,15 @@ const interactive = async (options = {}) => {
|
|
|
76
76
|
}]
|
|
77
77
|
}),
|
|
78
78
|
withStrictTokens: () => _clack_prompts.select({
|
|
79
|
-
message: "
|
|
80
|
-
initialValue: "
|
|
81
|
-
options: [
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
label: "Reject a value that is neither a token nor a css keyword"
|
|
89
|
-
},
|
|
90
|
-
{
|
|
91
|
-
value: "yes",
|
|
92
|
-
label: "Only tokens — every raw value is written `[14px]`"
|
|
93
|
-
}
|
|
94
|
-
]
|
|
79
|
+
message: "Must every style value be a token?",
|
|
80
|
+
initialValue: "no",
|
|
81
|
+
options: [{
|
|
82
|
+
value: "no",
|
|
83
|
+
label: "No — raw css values are fine"
|
|
84
|
+
}, {
|
|
85
|
+
value: "yes",
|
|
86
|
+
label: "Yes — every raw value is written `[14px]`"
|
|
87
|
+
}]
|
|
95
88
|
}),
|
|
96
89
|
shouldUpdateGitignore: () => _clack_prompts.select({
|
|
97
90
|
message: "Update gitignore?",
|
|
@@ -112,22 +105,12 @@ const interactive = async (options = {}) => {
|
|
|
112
105
|
return {
|
|
113
106
|
postcss: initFlags.usePostcss === "yes",
|
|
114
107
|
outExtension: initFlags.useMjsExtension === "yes" ? "mjs" : "js",
|
|
115
|
-
|
|
108
|
+
strictValues: strictValuesFrom(initFlags.withStrictTokens),
|
|
116
109
|
gitignore: initFlags.shouldUpdateGitignore === "yes"
|
|
117
110
|
};
|
|
118
111
|
};
|
|
119
|
-
/**
|
|
120
|
-
|
|
121
|
-
*
|
|
122
|
-
* "No" is `false`, not `undefined`. `undefined` now means "nothing was said", which the caller
|
|
123
|
-
* reads as the default — so returning it here would hand the middle mode to someone who had
|
|
124
|
-
* just declined it.
|
|
125
|
-
*/
|
|
126
|
-
const strictTokensFrom = (answer) => {
|
|
127
|
-
if (answer === "yes") return true;
|
|
128
|
-
if (answer === "unknown-tokens") return "unknown-tokens";
|
|
129
|
-
return false;
|
|
130
|
-
};
|
|
112
|
+
/** `'yes'` is the historical spelling of `true`. */
|
|
113
|
+
const strictValuesFrom = (answer) => answer === "yes" ? true : void 0;
|
|
131
114
|
//#endregion
|
|
132
115
|
exports.interactive = interactive;
|
|
133
116
|
exports.suggestPostcss = suggestPostcss;
|
package/dist/interactive.d.cts
CHANGED
package/dist/interactive.d.mts
CHANGED
package/dist/interactive.mjs
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { findViteConfig, hasUncompilableSources } from "@bamboocss/node";
|
|
2
2
|
import * as p from "@clack/prompts";
|
|
3
3
|
//#region package.json
|
|
4
|
-
var version = "1.
|
|
4
|
+
var version = "1.42.0";
|
|
5
5
|
//#endregion
|
|
6
6
|
//#region src/interactive.ts
|
|
7
7
|
/**
|
|
@@ -52,22 +52,15 @@ const interactive = async (options = {}) => {
|
|
|
52
52
|
}]
|
|
53
53
|
}),
|
|
54
54
|
withStrictTokens: () => p.select({
|
|
55
|
-
message: "
|
|
56
|
-
initialValue: "
|
|
57
|
-
options: [
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
label: "Reject a value that is neither a token nor a css keyword"
|
|
65
|
-
},
|
|
66
|
-
{
|
|
67
|
-
value: "yes",
|
|
68
|
-
label: "Only tokens — every raw value is written `[14px]`"
|
|
69
|
-
}
|
|
70
|
-
]
|
|
55
|
+
message: "Must every style value be a token?",
|
|
56
|
+
initialValue: "no",
|
|
57
|
+
options: [{
|
|
58
|
+
value: "no",
|
|
59
|
+
label: "No — raw css values are fine"
|
|
60
|
+
}, {
|
|
61
|
+
value: "yes",
|
|
62
|
+
label: "Yes — every raw value is written `[14px]`"
|
|
63
|
+
}]
|
|
71
64
|
}),
|
|
72
65
|
shouldUpdateGitignore: () => p.select({
|
|
73
66
|
message: "Update gitignore?",
|
|
@@ -88,21 +81,11 @@ const interactive = async (options = {}) => {
|
|
|
88
81
|
return {
|
|
89
82
|
postcss: initFlags.usePostcss === "yes",
|
|
90
83
|
outExtension: initFlags.useMjsExtension === "yes" ? "mjs" : "js",
|
|
91
|
-
|
|
84
|
+
strictValues: strictValuesFrom(initFlags.withStrictTokens),
|
|
92
85
|
gitignore: initFlags.shouldUpdateGitignore === "yes"
|
|
93
86
|
};
|
|
94
87
|
};
|
|
95
|
-
/**
|
|
96
|
-
|
|
97
|
-
*
|
|
98
|
-
* "No" is `false`, not `undefined`. `undefined` now means "nothing was said", which the caller
|
|
99
|
-
* reads as the default — so returning it here would hand the middle mode to someone who had
|
|
100
|
-
* just declined it.
|
|
101
|
-
*/
|
|
102
|
-
const strictTokensFrom = (answer) => {
|
|
103
|
-
if (answer === "yes") return true;
|
|
104
|
-
if (answer === "unknown-tokens") return "unknown-tokens";
|
|
105
|
-
return false;
|
|
106
|
-
};
|
|
88
|
+
/** `'yes'` is the historical spelling of `true`. */
|
|
89
|
+
const strictValuesFrom = (answer) => answer === "yes" ? true : void 0;
|
|
107
90
|
//#endregion
|
|
108
91
|
export { interactive, suggestPostcss };
|
|
@@ -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.42.0";
|
|
25
25
|
//#endregion
|
|
26
26
|
Object.defineProperty(exports, "__toESM", {
|
|
27
27
|
enumerable: true,
|
package/dist/presets.d.cts
CHANGED
|
@@ -1743,6 +1743,7 @@ declare const defaultPresets: ({
|
|
|
1743
1743
|
value: string;
|
|
1744
1744
|
};
|
|
1745
1745
|
};
|
|
1746
|
+
zIndex: import("@bamboocss/types").Recursive<import("@bamboocss/types").Token<string | number>> | undefined;
|
|
1746
1747
|
};
|
|
1747
1748
|
mixins: import("@bamboocss/types").Mixins;
|
|
1748
1749
|
containerSizes: {
|
package/dist/presets.d.mts
CHANGED
|
@@ -1743,6 +1743,7 @@ declare const defaultPresets: ({
|
|
|
1743
1743
|
value: string;
|
|
1744
1744
|
};
|
|
1745
1745
|
};
|
|
1746
|
+
zIndex: import("@bamboocss/types").Recursive<import("@bamboocss/types").Token<string | number>> | undefined;
|
|
1746
1747
|
};
|
|
1747
1748
|
mixins: import("@bamboocss/types").Mixins;
|
|
1748
1749
|
containerSizes: {
|
package/dist/types.d.cts
CHANGED
|
@@ -3,11 +3,11 @@ import { Config } from "@bamboocss/types";
|
|
|
3
3
|
//#region src/types.d.ts
|
|
4
4
|
interface InitCommandFlags extends Pick<Config, 'cwd' | 'poll' | 'watch' | 'gitignore' | 'outExtension' | 'outdir'> {
|
|
5
5
|
/**
|
|
6
|
-
* `--strict-
|
|
6
|
+
* `--strict-values`, which cac gives as `true` when bare and otherwise as whatever followed
|
|
7
7
|
* it — a string, or a number where that looked numeric. `normalizeStrictTokens` is what turns
|
|
8
8
|
* any of those into a setting, or refuses.
|
|
9
9
|
*/
|
|
10
|
-
|
|
10
|
+
strictValues?: boolean | string | number;
|
|
11
11
|
force?: boolean;
|
|
12
12
|
postcss?: boolean;
|
|
13
13
|
silent?: boolean;
|
package/dist/types.d.mts
CHANGED
|
@@ -3,11 +3,11 @@ import { Config } from "@bamboocss/types";
|
|
|
3
3
|
//#region src/types.d.ts
|
|
4
4
|
interface InitCommandFlags extends Pick<Config, 'cwd' | 'poll' | 'watch' | 'gitignore' | 'outExtension' | 'outdir'> {
|
|
5
5
|
/**
|
|
6
|
-
* `--strict-
|
|
6
|
+
* `--strict-values`, which cac gives as `true` when bare and otherwise as whatever followed
|
|
7
7
|
* it — a string, or a number where that looked numeric. `normalizeStrictTokens` is what turns
|
|
8
8
|
* any of those into a setting, or refuses.
|
|
9
9
|
*/
|
|
10
|
-
|
|
10
|
+
strictValues?: boolean | string | number;
|
|
11
11
|
force?: boolean;
|
|
12
12
|
postcss?: boolean;
|
|
13
13
|
silent?: boolean;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@bamboocss/dev",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.42.0",
|
|
4
4
|
"description": "Build-time, type-safe, zero-runtime CSS-in-JS",
|
|
5
5
|
"homepage": "https://bamboocss.com",
|
|
6
6
|
"license": "MIT",
|
|
@@ -54,14 +54,14 @@
|
|
|
54
54
|
"dependencies": {
|
|
55
55
|
"@clack/prompts": "0.11.0",
|
|
56
56
|
"cac": "6.7.14",
|
|
57
|
-
"@bamboocss/
|
|
58
|
-
"@bamboocss/
|
|
59
|
-
"@bamboocss/
|
|
60
|
-
"@bamboocss/preset-
|
|
61
|
-
"@bamboocss/
|
|
62
|
-
"@bamboocss/shared": "1.
|
|
63
|
-
"@bamboocss/token-dictionary": "1.
|
|
64
|
-
"@bamboocss/types": "1.
|
|
57
|
+
"@bamboocss/node": "1.42.0",
|
|
58
|
+
"@bamboocss/postcss": "1.42.0",
|
|
59
|
+
"@bamboocss/preset-bamboo": "1.42.0",
|
|
60
|
+
"@bamboocss/preset-base": "1.42.0",
|
|
61
|
+
"@bamboocss/logger": "1.42.0",
|
|
62
|
+
"@bamboocss/shared": "1.42.0",
|
|
63
|
+
"@bamboocss/token-dictionary": "1.42.0",
|
|
64
|
+
"@bamboocss/types": "1.42.0"
|
|
65
65
|
},
|
|
66
66
|
"devDependencies": {
|
|
67
67
|
"@types/update-notifier": "6.0.8",
|