@betty-blocks/cli 25.109.0-beta.1 → 26.0.0-alpha.1
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/assets/app-functions/wasm-template/.wasm-functions +0 -0
- package/assets/app-functions/wasm-template/functions/say-hello/1.0/Cargo.lock +449 -0
- package/assets/app-functions/wasm-template/functions/say-hello/1.0/Cargo.toml +10 -0
- package/assets/app-functions/wasm-template/functions/say-hello/1.0/Justfile +6 -0
- package/assets/app-functions/wasm-template/functions/say-hello/1.0/function.json +35 -0
- package/assets/app-functions/wasm-template/functions/say-hello/1.0/src/lib.rs +19 -0
- package/assets/app-functions/wasm-template/functions/say-hello/1.0/wit/world.wit +13 -0
- package/build/src/bb-blocks-new.js +5361 -2181
- package/build/src/bb-blocks-publish.js +11493 -18303
- package/build/src/bb-blocks-release.js +65 -46
- package/build/src/bb-blocks.js +32 -32
- package/build/src/bb-bundle-init.js +1542 -912
- package/build/src/bb-bundle.js +35 -32
- package/build/src/bb-components-build.js +34965 -7598
- package/build/src/bb-components-create.js +1542 -912
- package/build/src/bb-components-generate.js +1542 -912
- package/build/src/bb-components-publish-bundle.js +1519 -889
- package/build/src/bb-components-publish.js +1522 -892
- package/build/src/bb-components-serve.js +1524 -894
- package/build/src/bb-components.js +32 -32
- package/build/src/bb-functions-bump.js +6047 -2733
- package/build/src/bb-functions-init.js +100 -593
- package/build/src/bb-functions-login.js +65 -46
- package/build/src/bb-functions-logout.js +65 -46
- package/build/src/bb-functions-new.js +5464 -2195
- package/build/src/bb-functions-publish.js +15134 -76022
- package/build/src/bb-functions-validate.js +7262 -3950
- package/build/src/bb-functions.js +35 -37
- package/build/src/bb.js +76 -74
- package/package.json +41 -42
- package/assets/app-functions/templates/test/helpers.js +0 -3
- package/assets/app-functions/templates/test/say-hello.test.js +0 -4
- package/assets/functions/packer/package.json +0 -9
- package/assets/functions/packer/webpack.config.js +0 -12
- package/assets/functions/templates/functions.json +0 -14
- package/assets/functions/templates/package.json +0 -11
- package/assets/functions/templates/src/all-users.js +0 -14
- package/assets/functions/templates/src/get-json.js +0 -9
- package/assets/functions/templates/src/index.js +0 -5
- package/assets/functions/templates/src/say-hello.js +0 -13
- package/build/src/bb-functions-build.js +0 -4285
- package/src/bb.ts +0 -31
- /package/assets/app-functions/{templates → js-template}/.app-functions +0 -0
- /package/assets/app-functions/{templates → js-template}/functions/say-hello/1.0/function.json +0 -0
- /package/assets/app-functions/{templates → js-template}/functions/say-hello/1.0/index.js +0 -0
- /package/assets/app-functions/{templates → js-template}/package.json +0 -0
|
@@ -78,7 +78,7 @@ var require_argument = __commonJS((exports) => {
|
|
|
78
78
|
this._name = name;
|
|
79
79
|
break;
|
|
80
80
|
}
|
|
81
|
-
if (this._name.
|
|
81
|
+
if (this._name.endsWith("...")) {
|
|
82
82
|
this.variadic = true;
|
|
83
83
|
this._name = this._name.slice(0, -3);
|
|
84
84
|
}
|
|
@@ -86,11 +86,12 @@ var require_argument = __commonJS((exports) => {
|
|
|
86
86
|
name() {
|
|
87
87
|
return this._name;
|
|
88
88
|
}
|
|
89
|
-
|
|
89
|
+
_collectValue(value, previous) {
|
|
90
90
|
if (previous === this.defaultValue || !Array.isArray(previous)) {
|
|
91
91
|
return [value];
|
|
92
92
|
}
|
|
93
|
-
|
|
93
|
+
previous.push(value);
|
|
94
|
+
return previous;
|
|
94
95
|
}
|
|
95
96
|
default(value, description) {
|
|
96
97
|
this.defaultValue = value;
|
|
@@ -108,7 +109,7 @@ var require_argument = __commonJS((exports) => {
|
|
|
108
109
|
throw new InvalidArgumentError(`Allowed choices are ${this.argChoices.join(", ")}.`);
|
|
109
110
|
}
|
|
110
111
|
if (this.variadic) {
|
|
111
|
-
return this.
|
|
112
|
+
return this._collectValue(arg, previous);
|
|
112
113
|
}
|
|
113
114
|
return arg;
|
|
114
115
|
};
|
|
@@ -555,11 +556,12 @@ var require_option = __commonJS((exports) => {
|
|
|
555
556
|
this.hidden = !!hide;
|
|
556
557
|
return this;
|
|
557
558
|
}
|
|
558
|
-
|
|
559
|
+
_collectValue(value, previous) {
|
|
559
560
|
if (previous === this.defaultValue || !Array.isArray(previous)) {
|
|
560
561
|
return [value];
|
|
561
562
|
}
|
|
562
|
-
|
|
563
|
+
previous.push(value);
|
|
564
|
+
return previous;
|
|
563
565
|
}
|
|
564
566
|
choices(values) {
|
|
565
567
|
this.argChoices = values.slice();
|
|
@@ -568,7 +570,7 @@ var require_option = __commonJS((exports) => {
|
|
|
568
570
|
throw new InvalidArgumentError(`Allowed choices are ${this.argChoices.join(", ")}.`);
|
|
569
571
|
}
|
|
570
572
|
if (this.variadic) {
|
|
571
|
-
return this.
|
|
573
|
+
return this._collectValue(arg, previous);
|
|
572
574
|
}
|
|
573
575
|
return arg;
|
|
574
576
|
};
|
|
@@ -874,7 +876,10 @@ var require_command = __commonJS((exports) => {
|
|
|
874
876
|
configureOutput(configuration) {
|
|
875
877
|
if (configuration === undefined)
|
|
876
878
|
return this._outputConfiguration;
|
|
877
|
-
this._outputConfiguration =
|
|
879
|
+
this._outputConfiguration = {
|
|
880
|
+
...this._outputConfiguration,
|
|
881
|
+
...configuration
|
|
882
|
+
};
|
|
878
883
|
return this;
|
|
879
884
|
}
|
|
880
885
|
showHelpAfterError(displayHelp = true) {
|
|
@@ -923,7 +928,7 @@ var require_command = __commonJS((exports) => {
|
|
|
923
928
|
}
|
|
924
929
|
addArgument(argument) {
|
|
925
930
|
const previousArgument = this.registeredArguments.slice(-1)[0];
|
|
926
|
-
if (previousArgument
|
|
931
|
+
if (previousArgument?.variadic) {
|
|
927
932
|
throw new Error(`only the last argument can be variadic '${previousArgument.name()}'`);
|
|
928
933
|
}
|
|
929
934
|
if (argument.required && argument.defaultValue !== undefined && argument.parseArg === undefined) {
|
|
@@ -1078,7 +1083,7 @@ Expecting one of '${allowedValues.join("', '")}'`);
|
|
|
1078
1083
|
if (val !== null && option.parseArg) {
|
|
1079
1084
|
val = this._callParseArg(option, val, oldValue, invalidValueMessage);
|
|
1080
1085
|
} else if (val !== null && option.variadic) {
|
|
1081
|
-
val = option.
|
|
1086
|
+
val = option._collectValue(val, oldValue);
|
|
1082
1087
|
}
|
|
1083
1088
|
if (val == null) {
|
|
1084
1089
|
if (option.negate) {
|
|
@@ -1453,7 +1458,7 @@ Expecting one of '${allowedValues.join("', '")}'`);
|
|
|
1453
1458
|
this.processedArgs = processedArgs;
|
|
1454
1459
|
}
|
|
1455
1460
|
_chainOrCall(promise, fn) {
|
|
1456
|
-
if (promise
|
|
1461
|
+
if (promise?.then && typeof promise.then === "function") {
|
|
1457
1462
|
return promise.then(() => fn());
|
|
1458
1463
|
}
|
|
1459
1464
|
return fn();
|
|
@@ -1530,7 +1535,7 @@ Expecting one of '${allowedValues.join("', '")}'`);
|
|
|
1530
1535
|
promiseChain = this._chainOrCallHooks(promiseChain, "postAction");
|
|
1531
1536
|
return promiseChain;
|
|
1532
1537
|
}
|
|
1533
|
-
if (this.parent
|
|
1538
|
+
if (this.parent?.listenerCount(commandEvent)) {
|
|
1534
1539
|
checkForUnknownOptions();
|
|
1535
1540
|
this._processArguments();
|
|
1536
1541
|
this.parent.emit(commandEvent, operands, unknown);
|
|
@@ -1592,11 +1597,10 @@ Expecting one of '${allowedValues.join("', '")}'`);
|
|
|
1592
1597
|
cmd._checkForConflictingLocalOptions();
|
|
1593
1598
|
});
|
|
1594
1599
|
}
|
|
1595
|
-
parseOptions(
|
|
1600
|
+
parseOptions(args) {
|
|
1596
1601
|
const operands = [];
|
|
1597
1602
|
const unknown = [];
|
|
1598
1603
|
let dest = operands;
|
|
1599
|
-
const args = argv.slice();
|
|
1600
1604
|
function maybeOption(arg) {
|
|
1601
1605
|
return arg.length > 1 && arg[0] === "-";
|
|
1602
1606
|
}
|
|
@@ -1606,12 +1610,15 @@ Expecting one of '${allowedValues.join("', '")}'`);
|
|
|
1606
1610
|
return !this._getCommandAndAncestors().some((cmd) => cmd.options.map((opt) => opt.short).some((short) => /^-\d$/.test(short)));
|
|
1607
1611
|
};
|
|
1608
1612
|
let activeVariadicOption = null;
|
|
1609
|
-
|
|
1610
|
-
|
|
1613
|
+
let activeGroup = null;
|
|
1614
|
+
let i = 0;
|
|
1615
|
+
while (i < args.length || activeGroup) {
|
|
1616
|
+
const arg = activeGroup ?? args[i++];
|
|
1617
|
+
activeGroup = null;
|
|
1611
1618
|
if (arg === "--") {
|
|
1612
1619
|
if (dest === unknown)
|
|
1613
1620
|
dest.push(arg);
|
|
1614
|
-
dest.push(...args);
|
|
1621
|
+
dest.push(...args.slice(i));
|
|
1615
1622
|
break;
|
|
1616
1623
|
}
|
|
1617
1624
|
if (activeVariadicOption && (!maybeOption(arg) || negativeNumberArg(arg))) {
|
|
@@ -1623,14 +1630,14 @@ Expecting one of '${allowedValues.join("', '")}'`);
|
|
|
1623
1630
|
const option = this._findOption(arg);
|
|
1624
1631
|
if (option) {
|
|
1625
1632
|
if (option.required) {
|
|
1626
|
-
const value = args
|
|
1633
|
+
const value = args[i++];
|
|
1627
1634
|
if (value === undefined)
|
|
1628
1635
|
this.optionMissingArgument(option);
|
|
1629
1636
|
this.emit(`option:${option.name()}`, value);
|
|
1630
1637
|
} else if (option.optional) {
|
|
1631
1638
|
let value = null;
|
|
1632
|
-
if (args.length
|
|
1633
|
-
value = args
|
|
1639
|
+
if (i < args.length && (!maybeOption(args[i]) || negativeNumberArg(args[i]))) {
|
|
1640
|
+
value = args[i++];
|
|
1634
1641
|
}
|
|
1635
1642
|
this.emit(`option:${option.name()}`, value);
|
|
1636
1643
|
} else {
|
|
@@ -1647,7 +1654,7 @@ Expecting one of '${allowedValues.join("', '")}'`);
|
|
|
1647
1654
|
this.emit(`option:${option.name()}`, arg.slice(2));
|
|
1648
1655
|
} else {
|
|
1649
1656
|
this.emit(`option:${option.name()}`);
|
|
1650
|
-
|
|
1657
|
+
activeGroup = `-${arg.slice(2)}`;
|
|
1651
1658
|
}
|
|
1652
1659
|
continue;
|
|
1653
1660
|
}
|
|
@@ -1666,25 +1673,18 @@ Expecting one of '${allowedValues.join("', '")}'`);
|
|
|
1666
1673
|
if ((this._enablePositionalOptions || this._passThroughOptions) && operands.length === 0 && unknown.length === 0) {
|
|
1667
1674
|
if (this._findCommand(arg)) {
|
|
1668
1675
|
operands.push(arg);
|
|
1669
|
-
|
|
1670
|
-
unknown.push(...args);
|
|
1676
|
+
unknown.push(...args.slice(i));
|
|
1671
1677
|
break;
|
|
1672
1678
|
} else if (this._getHelpCommand() && arg === this._getHelpCommand().name()) {
|
|
1673
|
-
operands.push(arg);
|
|
1674
|
-
if (args.length > 0)
|
|
1675
|
-
operands.push(...args);
|
|
1679
|
+
operands.push(arg, ...args.slice(i));
|
|
1676
1680
|
break;
|
|
1677
1681
|
} else if (this._defaultCommandName) {
|
|
1678
|
-
unknown.push(arg);
|
|
1679
|
-
if (args.length > 0)
|
|
1680
|
-
unknown.push(...args);
|
|
1682
|
+
unknown.push(arg, ...args.slice(i));
|
|
1681
1683
|
break;
|
|
1682
1684
|
}
|
|
1683
1685
|
}
|
|
1684
1686
|
if (this._passThroughOptions) {
|
|
1685
|
-
dest.push(arg);
|
|
1686
|
-
if (args.length > 0)
|
|
1687
|
-
dest.push(...args);
|
|
1687
|
+
dest.push(arg, ...args.slice(i));
|
|
1688
1688
|
break;
|
|
1689
1689
|
}
|
|
1690
1690
|
dest.push(arg);
|