@batijs/cli 0.0.511 → 0.0.513

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.
Files changed (120) hide show
  1. package/dist/boilerplates/@batijs/auth0/bati.config.js +17 -0
  2. package/dist/boilerplates/@batijs/auth0/files/$.env.js +1 -1
  3. package/dist/boilerplates/@batijs/auth0/files/$TODO.md.js +1 -1
  4. package/dist/boilerplates/@batijs/authjs/bati.config.js +17 -0
  5. package/dist/boilerplates/@batijs/authjs/files/$package.json.js +1 -11
  6. package/dist/boilerplates/@batijs/aws/bati.config.js +18 -0
  7. package/dist/boilerplates/@batijs/aws/files/$README.md.js +1 -5
  8. package/dist/boilerplates/@batijs/aws/files/$TODO.md.js +7 -1
  9. package/dist/boilerplates/@batijs/aws/files/$package.json.js +1 -7
  10. package/dist/boilerplates/@batijs/aws/files/$tsconfig.json.js +1 -1
  11. package/dist/boilerplates/@batijs/biome/bati.config.js +17 -0
  12. package/dist/boilerplates/@batijs/biome/files/$package.json.js +2 -7
  13. package/dist/boilerplates/@batijs/cloudflare/bati.config.js +18 -0
  14. package/dist/boilerplates/@batijs/cloudflare/files/$package.json.js +1 -7
  15. package/dist/boilerplates/@batijs/compiled/bati.config.js +17 -0
  16. package/dist/boilerplates/@batijs/compiled/files/$package.json.js +2 -7
  17. package/dist/boilerplates/@batijs/compiled/files/$vite.config.ts.js +1 -1
  18. package/dist/boilerplates/@batijs/d1/bati.config.js +17 -0
  19. package/dist/boilerplates/@batijs/d1/files/$TODO.md.js +1 -1
  20. package/dist/boilerplates/@batijs/d1/files/$package.json.js +1 -14
  21. package/dist/boilerplates/@batijs/d1/files/$tsconfig.json.js +1 -1
  22. package/dist/boilerplates/@batijs/d1-sqlite/bati.config.js +17 -0
  23. package/dist/boilerplates/@batijs/d1-sqlite/files/$package.json.js +1 -11
  24. package/dist/boilerplates/@batijs/drizzle/bati.config.js +17 -0
  25. package/dist/boilerplates/@batijs/drizzle/files/$.env.js +1 -1
  26. package/dist/boilerplates/@batijs/drizzle/files/$TODO.md.js +1 -1
  27. package/dist/boilerplates/@batijs/drizzle/files/$package.json.js +1 -6
  28. package/dist/boilerplates/@batijs/eslint/bati.config.js +17 -0
  29. package/dist/boilerplates/@batijs/eslint/files/$package.json.js +1 -6
  30. package/dist/boilerplates/@batijs/express/bati.config.js +17 -0
  31. package/dist/boilerplates/@batijs/express/files/$package.json.js +1 -6
  32. package/dist/boilerplates/@batijs/fastify/bati.config.js +17 -0
  33. package/dist/boilerplates/@batijs/fastify/files/$package.json.js +1 -6
  34. package/dist/boilerplates/@batijs/google-analytics/bati.config.js +17 -0
  35. package/dist/boilerplates/@batijs/google-analytics/files/$.env.js +1 -1
  36. package/dist/boilerplates/@batijs/h3/bati.config.js +17 -0
  37. package/dist/boilerplates/@batijs/h3/files/$package.json.js +1 -6
  38. package/dist/boilerplates/@batijs/hono/bati.config.js +17 -0
  39. package/dist/boilerplates/@batijs/hono/files/$package.json.js +1 -6
  40. package/dist/boilerplates/@batijs/hono/files/entry_aws_lambda.ts +2 -2
  41. package/dist/boilerplates/@batijs/mantine/bati.config.js +18 -0
  42. package/dist/boilerplates/@batijs/mantine/files/$README.md.js +1 -1
  43. package/dist/boilerplates/@batijs/mantine/files/$package.json.js +1 -12
  44. package/dist/boilerplates/@batijs/photon/bati.config.js +17 -0
  45. package/dist/boilerplates/@batijs/photon/files/$README.md.js +4 -1
  46. package/dist/boilerplates/@batijs/photon/files/$package.json.js +1 -15
  47. package/dist/boilerplates/@batijs/plausible.io/bati.config.js +17 -0
  48. package/dist/boilerplates/@batijs/plausible.io/files/$TODO.md.js +1 -1
  49. package/dist/boilerplates/@batijs/pnpm/bati.config.js +18 -0
  50. package/dist/boilerplates/@batijs/pnpm/files/$pnpm-workspace.yaml.js +1 -1
  51. package/dist/boilerplates/@batijs/prettier/bati.config.js +17 -0
  52. package/dist/boilerplates/@batijs/prettier/files/$package.json.js +2 -7
  53. package/dist/boilerplates/@batijs/prisma/bati.config.js +17 -0
  54. package/dist/boilerplates/@batijs/prisma/files/$.env.js +1 -1
  55. package/dist/boilerplates/@batijs/prisma/files/$TODO.md.js +1 -1
  56. package/dist/boilerplates/@batijs/prisma/files/$package.json.js +2 -7
  57. package/dist/boilerplates/@batijs/react/bati.config.js +17 -0
  58. package/dist/boilerplates/@batijs/react/files/$README.md.js +5 -2
  59. package/dist/boilerplates/@batijs/react/files/$package.json.js +1 -6
  60. package/dist/boilerplates/@batijs/react/files/$tsconfig.json.js +1 -1
  61. package/dist/boilerplates/@batijs/react/files/$vite.config.ts.js +1 -1
  62. package/dist/boilerplates/@batijs/react/files/pages/todo/TodoList.tsx +1 -1
  63. package/dist/boilerplates/@batijs/react-sentry/bati.config.js +17 -0
  64. package/dist/boilerplates/@batijs/react-sentry/files/$package.json.js +1 -11
  65. package/dist/boilerplates/@batijs/sentry/bati.config.js +17 -0
  66. package/dist/boilerplates/@batijs/sentry/files/$.env.js +1 -1
  67. package/dist/boilerplates/@batijs/sentry/files/$README.md.js +1 -1
  68. package/dist/boilerplates/@batijs/sentry/files/$TODO.md.js +1 -1
  69. package/dist/boilerplates/@batijs/sentry/files/$package.json.js +1 -6
  70. package/dist/boilerplates/@batijs/sentry/files/$vite.config.ts.js +1 -1
  71. package/dist/boilerplates/@batijs/sentry/files/pages/$+client.ts.js +1 -1
  72. package/dist/boilerplates/@batijs/shadcn-ui/bati.config.js +17 -0
  73. package/dist/boilerplates/@batijs/shadcn-ui/files/$README.md.js +1 -1
  74. package/dist/boilerplates/@batijs/shadcn-ui/files/$package.json.js +1 -6
  75. package/dist/boilerplates/@batijs/shadcn-ui/files/$tsconfig.json.js +1 -1
  76. package/dist/boilerplates/@batijs/shadcn-ui/files/$vite.config.ts.js +1 -1
  77. package/dist/boilerplates/@batijs/shared/bati.config.js +15 -0
  78. package/dist/boilerplates/@batijs/shared/files/$README.md.js +1 -1
  79. package/dist/boilerplates/@batijs/shared/files/$TODO.md.js +1 -1
  80. package/dist/boilerplates/@batijs/shared-db/bati.config.js +17 -0
  81. package/dist/boilerplates/@batijs/shared-server/bati.config.js +17 -0
  82. package/dist/boilerplates/@batijs/shared-server/files/$package.json.js +1 -13
  83. package/dist/boilerplates/@batijs/shared-todo/bati.config.js +15 -0
  84. package/dist/boilerplates/@batijs/solid/bati.config.js +17 -0
  85. package/dist/boilerplates/@batijs/solid/files/$README.md.js +5 -2
  86. package/dist/boilerplates/@batijs/solid/files/$package.json.js +1 -6
  87. package/dist/boilerplates/@batijs/solid/files/$tsconfig.json.js +1 -1
  88. package/dist/boilerplates/@batijs/solid/files/$vite.config.ts.js +1 -1
  89. package/dist/boilerplates/@batijs/solid/files/pages/todo/TodoList.tsx +1 -1
  90. package/dist/boilerplates/@batijs/solid-sentry/bati.config.js +17 -0
  91. package/dist/boilerplates/@batijs/solid-sentry/files/$package.json.js +1 -11
  92. package/dist/boilerplates/@batijs/sqlite/bati.config.js +17 -0
  93. package/dist/boilerplates/@batijs/sqlite/files/$.env.js +1 -1
  94. package/dist/boilerplates/@batijs/sqlite/files/$TODO.md.js +1 -1
  95. package/dist/boilerplates/@batijs/sqlite/files/$package.json.js +1 -15
  96. package/dist/boilerplates/@batijs/tailwindcss/bati.config.js +17 -0
  97. package/dist/boilerplates/@batijs/tailwindcss/files/$package.json.js +2 -7
  98. package/dist/boilerplates/@batijs/tailwindcss/files/$vite.config.ts.js +1 -1
  99. package/dist/boilerplates/@batijs/telefunc/bati.config.js +17 -0
  100. package/dist/boilerplates/@batijs/telefunc/files/$package.json.js +1 -6
  101. package/dist/boilerplates/@batijs/telefunc/files/$vite.config.ts.js +1 -1
  102. package/dist/boilerplates/@batijs/trpc/bati.config.js +17 -0
  103. package/dist/boilerplates/@batijs/trpc/files/$package.json.js +1 -6
  104. package/dist/boilerplates/@batijs/ts-rest/bati.config.js +17 -0
  105. package/dist/boilerplates/@batijs/ts-rest/files/$package.json.js +1 -6
  106. package/dist/boilerplates/@batijs/vercel/bati.config.js +17 -0
  107. package/dist/boilerplates/@batijs/vercel/files/$package.json.js +2 -7
  108. package/dist/boilerplates/@batijs/vercel/files/pages/$+config.ts.js +1 -1
  109. package/dist/boilerplates/@batijs/vue/bati.config.js +17 -0
  110. package/dist/boilerplates/@batijs/vue/files/$README.md.js +5 -2
  111. package/dist/boilerplates/@batijs/vue/files/$package.json.js +1 -6
  112. package/dist/boilerplates/@batijs/vue/files/$tsconfig.json.js +1 -1
  113. package/dist/boilerplates/@batijs/vue/files/$vite.config.ts.js +1 -1
  114. package/dist/boilerplates/@batijs/vue/files/pages/todo/TodoList.vue +2 -2
  115. package/dist/boilerplates/@batijs/vue-sentry/bati.config.js +17 -0
  116. package/dist/boilerplates/@batijs/vue-sentry/files/$package.json.js +1 -11
  117. package/dist/boilerplates/boilerplates.json +0 -264
  118. package/dist/{chunk-RB7SP54Q.js → chunk-7Z4ESLVZ.js} +1 -1
  119. package/dist/index.js +23 -795
  120. package/package.json +5 -6
package/dist/index.js CHANGED
@@ -10,7 +10,7 @@ import {
10
10
  ffs,
11
11
  gir,
12
12
  ufs
13
- } from "./chunk-RB7SP54Q.js";
13
+ } from "./chunk-7Z4ESLVZ.js";
14
14
  import "./chunk-IAWYWZSL.js";
15
15
  import {
16
16
  __commonJS,
@@ -16149,790 +16149,10 @@ var {
16149
16149
  bgWhiteBright
16150
16150
  } = createColors2();
16151
16151
 
16152
- // ../../node_modules/.pnpm/sift@17.1.3/node_modules/sift/es5m/index.js
16153
- var extendStatics = function(d, b2) {
16154
- extendStatics = Object.setPrototypeOf || { __proto__: [] } instanceof Array && function(d2, b3) {
16155
- d2.__proto__ = b3;
16156
- } || function(d2, b3) {
16157
- for (var p in b3) if (Object.prototype.hasOwnProperty.call(b3, p)) d2[p] = b3[p];
16158
- };
16159
- return extendStatics(d, b2);
16160
- };
16161
- function __extends(d, b2) {
16162
- if (typeof b2 !== "function" && b2 !== null)
16163
- throw new TypeError("Class extends value " + String(b2) + " is not a constructor or null");
16164
- extendStatics(d, b2);
16165
- function __() {
16166
- this.constructor = d;
16167
- }
16168
- d.prototype = b2 === null ? Object.create(b2) : (__.prototype = b2.prototype, new __());
16169
- }
16170
- var typeChecker = function(type) {
16171
- var typeString = "[object " + type + "]";
16172
- return function(value) {
16173
- return getClassName(value) === typeString;
16174
- };
16175
- };
16176
- var getClassName = function(value) {
16177
- return Object.prototype.toString.call(value);
16178
- };
16179
- var comparable = function(value) {
16180
- if (value instanceof Date) {
16181
- return value.getTime();
16182
- } else if (isArray(value)) {
16183
- return value.map(comparable);
16184
- } else if (value && typeof value.toJSON === "function") {
16185
- return value.toJSON();
16186
- }
16187
- return value;
16188
- };
16189
- var coercePotentiallyNull = function(value) {
16190
- return value == null ? null : value;
16191
- };
16192
- var isArray = typeChecker("Array");
16193
- var isObject = typeChecker("Object");
16194
- var isFunction = typeChecker("Function");
16195
- var isProperty = function(item, key) {
16196
- return item.hasOwnProperty(key) && !isFunction(item[key]);
16197
- };
16198
- var isVanillaObject = function(value) {
16199
- return value && (value.constructor === Object || value.constructor === Array || value.constructor.toString() === "function Object() { [native code] }" || value.constructor.toString() === "function Array() { [native code] }") && !value.toJSON;
16200
- };
16201
- var equals = function(a2, b2) {
16202
- if (a2 == null && a2 == b2) {
16203
- return true;
16204
- }
16205
- if (a2 === b2) {
16206
- return true;
16207
- }
16208
- if (Object.prototype.toString.call(a2) !== Object.prototype.toString.call(b2)) {
16209
- return false;
16210
- }
16211
- if (isArray(a2)) {
16212
- if (a2.length !== b2.length) {
16213
- return false;
16214
- }
16215
- for (var i2 = 0, length_1 = a2.length; i2 < length_1; i2++) {
16216
- if (!equals(a2[i2], b2[i2]))
16217
- return false;
16218
- }
16219
- return true;
16220
- } else if (isObject(a2)) {
16221
- if (Object.keys(a2).length !== Object.keys(b2).length) {
16222
- return false;
16223
- }
16224
- for (var key in a2) {
16225
- if (!equals(a2[key], b2[key]))
16226
- return false;
16227
- }
16228
- return true;
16229
- }
16230
- return false;
16231
- };
16232
- var walkKeyPathValues = function(item, keyPath, next, depth, key, owner) {
16233
- var currentKey = keyPath[depth];
16234
- if (isArray(item) && isNaN(Number(currentKey)) && !isProperty(item, currentKey)) {
16235
- for (var i2 = 0, length_1 = item.length; i2 < length_1; i2++) {
16236
- if (!walkKeyPathValues(item[i2], keyPath, next, depth, i2, item)) {
16237
- return false;
16238
- }
16239
- }
16240
- }
16241
- if (depth === keyPath.length || item == null) {
16242
- return next(item, key, owner, depth === 0, depth === keyPath.length);
16243
- }
16244
- return walkKeyPathValues(item[currentKey], keyPath, next, depth + 1, currentKey, item);
16245
- };
16246
- var BaseOperation = (
16247
- /** @class */
16248
- (function() {
16249
- function BaseOperation2(params, owneryQuery, options, name) {
16250
- this.params = params;
16251
- this.owneryQuery = owneryQuery;
16252
- this.options = options;
16253
- this.name = name;
16254
- this.init();
16255
- }
16256
- BaseOperation2.prototype.init = function() {
16257
- };
16258
- BaseOperation2.prototype.reset = function() {
16259
- this.done = false;
16260
- this.keep = false;
16261
- };
16262
- return BaseOperation2;
16263
- })()
16264
- );
16265
- var GroupOperation = (
16266
- /** @class */
16267
- (function(_super) {
16268
- __extends(GroupOperation2, _super);
16269
- function GroupOperation2(params, owneryQuery, options, children) {
16270
- var _this = _super.call(this, params, owneryQuery, options) || this;
16271
- _this.children = children;
16272
- return _this;
16273
- }
16274
- GroupOperation2.prototype.reset = function() {
16275
- this.keep = false;
16276
- this.done = false;
16277
- for (var i2 = 0, length_2 = this.children.length; i2 < length_2; i2++) {
16278
- this.children[i2].reset();
16279
- }
16280
- };
16281
- GroupOperation2.prototype.childrenNext = function(item, key, owner, root, leaf) {
16282
- var done = true;
16283
- var keep = true;
16284
- for (var i2 = 0, length_3 = this.children.length; i2 < length_3; i2++) {
16285
- var childOperation = this.children[i2];
16286
- if (!childOperation.done) {
16287
- childOperation.next(item, key, owner, root, leaf);
16288
- }
16289
- if (!childOperation.keep) {
16290
- keep = false;
16291
- }
16292
- if (childOperation.done) {
16293
- if (!childOperation.keep) {
16294
- break;
16295
- }
16296
- } else {
16297
- done = false;
16298
- }
16299
- }
16300
- this.done = done;
16301
- this.keep = keep;
16302
- };
16303
- return GroupOperation2;
16304
- })(BaseOperation)
16305
- );
16306
- var NamedGroupOperation = (
16307
- /** @class */
16308
- (function(_super) {
16309
- __extends(NamedGroupOperation2, _super);
16310
- function NamedGroupOperation2(params, owneryQuery, options, children, name) {
16311
- var _this = _super.call(this, params, owneryQuery, options, children) || this;
16312
- _this.name = name;
16313
- return _this;
16314
- }
16315
- return NamedGroupOperation2;
16316
- })(GroupOperation)
16317
- );
16318
- var QueryOperation = (
16319
- /** @class */
16320
- (function(_super) {
16321
- __extends(QueryOperation2, _super);
16322
- function QueryOperation2() {
16323
- var _this = _super !== null && _super.apply(this, arguments) || this;
16324
- _this.propop = true;
16325
- return _this;
16326
- }
16327
- QueryOperation2.prototype.next = function(item, key, parent, root) {
16328
- this.childrenNext(item, key, parent, root);
16329
- };
16330
- return QueryOperation2;
16331
- })(GroupOperation)
16332
- );
16333
- var NestedOperation = (
16334
- /** @class */
16335
- (function(_super) {
16336
- __extends(NestedOperation2, _super);
16337
- function NestedOperation2(keyPath, params, owneryQuery, options, children) {
16338
- var _this = _super.call(this, params, owneryQuery, options, children) || this;
16339
- _this.keyPath = keyPath;
16340
- _this.propop = true;
16341
- _this._nextNestedValue = function(value, key, owner, root, leaf) {
16342
- _this.childrenNext(value, key, owner, root, leaf);
16343
- return !_this.done;
16344
- };
16345
- return _this;
16346
- }
16347
- NestedOperation2.prototype.next = function(item, key, parent) {
16348
- walkKeyPathValues(item, this.keyPath, this._nextNestedValue, 0, key, parent);
16349
- };
16350
- return NestedOperation2;
16351
- })(GroupOperation)
16352
- );
16353
- var createTester = function(a2, compare) {
16354
- if (a2 instanceof Function) {
16355
- return a2;
16356
- }
16357
- if (a2 instanceof RegExp) {
16358
- return function(b2) {
16359
- var result = typeof b2 === "string" && a2.test(b2);
16360
- a2.lastIndex = 0;
16361
- return result;
16362
- };
16363
- }
16364
- var comparableA = comparable(a2);
16365
- return function(b2) {
16366
- return compare(comparableA, comparable(b2));
16367
- };
16368
- };
16369
- var EqualsOperation = (
16370
- /** @class */
16371
- (function(_super) {
16372
- __extends(EqualsOperation2, _super);
16373
- function EqualsOperation2() {
16374
- var _this = _super !== null && _super.apply(this, arguments) || this;
16375
- _this.propop = true;
16376
- return _this;
16377
- }
16378
- EqualsOperation2.prototype.init = function() {
16379
- this._test = createTester(this.params, this.options.compare);
16380
- };
16381
- EqualsOperation2.prototype.next = function(item, key, parent) {
16382
- if (!Array.isArray(parent) || parent.hasOwnProperty(key)) {
16383
- if (this._test(item, key, parent)) {
16384
- this.done = true;
16385
- this.keep = true;
16386
- }
16387
- }
16388
- };
16389
- return EqualsOperation2;
16390
- })(BaseOperation)
16391
- );
16392
- var numericalOperationCreator = function(createNumericalOperation) {
16393
- return function(params, owneryQuery, options, name) {
16394
- return createNumericalOperation(params, owneryQuery, options, name);
16395
- };
16396
- };
16397
- var numericalOperation = function(createTester2) {
16398
- return numericalOperationCreator(function(params, owneryQuery, options, name) {
16399
- var typeofParams = typeof comparable(params);
16400
- var test = createTester2(params);
16401
- return new EqualsOperation(function(b2) {
16402
- var actualValue = coercePotentiallyNull(b2);
16403
- return typeof comparable(actualValue) === typeofParams && test(actualValue);
16404
- }, owneryQuery, options, name);
16405
- });
16406
- };
16407
- var createNamedOperation = function(name, params, parentQuery, options) {
16408
- var operationCreator = options.operations[name];
16409
- if (!operationCreator) {
16410
- throwUnsupportedOperation(name);
16411
- }
16412
- return operationCreator(params, parentQuery, options, name);
16413
- };
16414
- var throwUnsupportedOperation = function(name) {
16415
- throw new Error("Unsupported operation: ".concat(name));
16416
- };
16417
- var containsOperation = function(query, options) {
16418
- for (var key in query) {
16419
- if (options.operations.hasOwnProperty(key) || key.charAt(0) === "$")
16420
- return true;
16421
- }
16422
- return false;
16423
- };
16424
- var createNestedOperation = function(keyPath, nestedQuery, parentKey, owneryQuery, options) {
16425
- if (containsOperation(nestedQuery, options)) {
16426
- var _a = createQueryOperations(nestedQuery, parentKey, options), selfOperations = _a[0], nestedOperations = _a[1];
16427
- if (nestedOperations.length) {
16428
- throw new Error("Property queries must contain only operations, or exact objects.");
16429
- }
16430
- return new NestedOperation(keyPath, nestedQuery, owneryQuery, options, selfOperations);
16431
- }
16432
- return new NestedOperation(keyPath, nestedQuery, owneryQuery, options, [
16433
- new EqualsOperation(nestedQuery, owneryQuery, options)
16434
- ]);
16435
- };
16436
- var createQueryOperation = function(query, owneryQuery, _a) {
16437
- if (owneryQuery === void 0) {
16438
- owneryQuery = null;
16439
- }
16440
- var _b = _a === void 0 ? {} : _a, compare = _b.compare, operations = _b.operations;
16441
- var options = {
16442
- compare: compare || equals,
16443
- operations: Object.assign({}, operations || {})
16444
- };
16445
- var _c = createQueryOperations(query, null, options), selfOperations = _c[0], nestedOperations = _c[1];
16446
- var ops = [];
16447
- if (selfOperations.length) {
16448
- ops.push(new NestedOperation([], query, owneryQuery, options, selfOperations));
16449
- }
16450
- ops.push.apply(ops, nestedOperations);
16451
- if (ops.length === 1) {
16452
- return ops[0];
16453
- }
16454
- return new QueryOperation(query, owneryQuery, options, ops);
16455
- };
16456
- var createQueryOperations = function(query, parentKey, options) {
16457
- var selfOperations = [];
16458
- var nestedOperations = [];
16459
- if (!isVanillaObject(query)) {
16460
- selfOperations.push(new EqualsOperation(query, query, options));
16461
- return [selfOperations, nestedOperations];
16462
- }
16463
- for (var key in query) {
16464
- if (options.operations.hasOwnProperty(key)) {
16465
- var op = createNamedOperation(key, query[key], query, options);
16466
- if (op) {
16467
- if (!op.propop && parentKey && !options.operations[parentKey]) {
16468
- throw new Error("Malformed query. ".concat(key, " cannot be matched against property."));
16469
- }
16470
- }
16471
- if (op != null) {
16472
- selfOperations.push(op);
16473
- }
16474
- } else if (key.charAt(0) === "$") {
16475
- throwUnsupportedOperation(key);
16476
- } else {
16477
- nestedOperations.push(createNestedOperation(key.split("."), query[key], key, query, options));
16478
- }
16479
- }
16480
- return [selfOperations, nestedOperations];
16481
- };
16482
- var createOperationTester = function(operation) {
16483
- return function(item, key, owner) {
16484
- operation.reset();
16485
- operation.next(item, key, owner);
16486
- return operation.keep;
16487
- };
16488
- };
16489
- var $Ne = (
16490
- /** @class */
16491
- (function(_super) {
16492
- __extends($Ne2, _super);
16493
- function $Ne2() {
16494
- var _this = _super !== null && _super.apply(this, arguments) || this;
16495
- _this.propop = true;
16496
- return _this;
16497
- }
16498
- $Ne2.prototype.init = function() {
16499
- this._test = createTester(this.params, this.options.compare);
16500
- };
16501
- $Ne2.prototype.reset = function() {
16502
- _super.prototype.reset.call(this);
16503
- this.keep = true;
16504
- };
16505
- $Ne2.prototype.next = function(item) {
16506
- if (this._test(item)) {
16507
- this.done = true;
16508
- this.keep = false;
16509
- }
16510
- };
16511
- return $Ne2;
16512
- })(BaseOperation)
16513
- );
16514
- var $ElemMatch = (
16515
- /** @class */
16516
- (function(_super) {
16517
- __extends($ElemMatch2, _super);
16518
- function $ElemMatch2() {
16519
- var _this = _super !== null && _super.apply(this, arguments) || this;
16520
- _this.propop = true;
16521
- return _this;
16522
- }
16523
- $ElemMatch2.prototype.init = function() {
16524
- if (!this.params || typeof this.params !== "object") {
16525
- throw new Error("Malformed query. $elemMatch must by an object.");
16526
- }
16527
- this._queryOperation = createQueryOperation(this.params, this.owneryQuery, this.options);
16528
- };
16529
- $ElemMatch2.prototype.reset = function() {
16530
- _super.prototype.reset.call(this);
16531
- this._queryOperation.reset();
16532
- };
16533
- $ElemMatch2.prototype.next = function(item) {
16534
- if (isArray(item)) {
16535
- for (var i2 = 0, length_1 = item.length; i2 < length_1; i2++) {
16536
- this._queryOperation.reset();
16537
- var child = item[i2];
16538
- this._queryOperation.next(child, i2, item, false);
16539
- this.keep = this.keep || this._queryOperation.keep;
16540
- }
16541
- this.done = true;
16542
- } else {
16543
- this.done = false;
16544
- this.keep = false;
16545
- }
16546
- };
16547
- return $ElemMatch2;
16548
- })(BaseOperation)
16549
- );
16550
- var $Not = (
16551
- /** @class */
16552
- (function(_super) {
16553
- __extends($Not2, _super);
16554
- function $Not2() {
16555
- var _this = _super !== null && _super.apply(this, arguments) || this;
16556
- _this.propop = true;
16557
- return _this;
16558
- }
16559
- $Not2.prototype.init = function() {
16560
- this._queryOperation = createQueryOperation(this.params, this.owneryQuery, this.options);
16561
- };
16562
- $Not2.prototype.reset = function() {
16563
- _super.prototype.reset.call(this);
16564
- this._queryOperation.reset();
16565
- };
16566
- $Not2.prototype.next = function(item, key, owner, root) {
16567
- this._queryOperation.next(item, key, owner, root);
16568
- this.done = this._queryOperation.done;
16569
- this.keep = !this._queryOperation.keep;
16570
- };
16571
- return $Not2;
16572
- })(BaseOperation)
16573
- );
16574
- var $Size = (
16575
- /** @class */
16576
- (function(_super) {
16577
- __extends($Size2, _super);
16578
- function $Size2() {
16579
- var _this = _super !== null && _super.apply(this, arguments) || this;
16580
- _this.propop = true;
16581
- return _this;
16582
- }
16583
- $Size2.prototype.init = function() {
16584
- };
16585
- $Size2.prototype.next = function(item) {
16586
- if (isArray(item) && item.length === this.params) {
16587
- this.done = true;
16588
- this.keep = true;
16589
- }
16590
- };
16591
- return $Size2;
16592
- })(BaseOperation)
16593
- );
16594
- var assertGroupNotEmpty = function(values) {
16595
- if (values.length === 0) {
16596
- throw new Error("$and/$or/$nor must be a nonempty array");
16597
- }
16598
- };
16599
- var $Or = (
16600
- /** @class */
16601
- (function(_super) {
16602
- __extends($Or2, _super);
16603
- function $Or2() {
16604
- var _this = _super !== null && _super.apply(this, arguments) || this;
16605
- _this.propop = false;
16606
- return _this;
16607
- }
16608
- $Or2.prototype.init = function() {
16609
- var _this = this;
16610
- assertGroupNotEmpty(this.params);
16611
- this._ops = this.params.map(function(op) {
16612
- return createQueryOperation(op, null, _this.options);
16613
- });
16614
- };
16615
- $Or2.prototype.reset = function() {
16616
- this.done = false;
16617
- this.keep = false;
16618
- for (var i2 = 0, length_2 = this._ops.length; i2 < length_2; i2++) {
16619
- this._ops[i2].reset();
16620
- }
16621
- };
16622
- $Or2.prototype.next = function(item, key, owner) {
16623
- var done = false;
16624
- var success = false;
16625
- for (var i2 = 0, length_3 = this._ops.length; i2 < length_3; i2++) {
16626
- var op = this._ops[i2];
16627
- op.next(item, key, owner);
16628
- if (op.keep) {
16629
- done = true;
16630
- success = op.keep;
16631
- break;
16632
- }
16633
- }
16634
- this.keep = success;
16635
- this.done = done;
16636
- };
16637
- return $Or2;
16638
- })(BaseOperation)
16639
- );
16640
- var $Nor = (
16641
- /** @class */
16642
- (function(_super) {
16643
- __extends($Nor2, _super);
16644
- function $Nor2() {
16645
- var _this = _super !== null && _super.apply(this, arguments) || this;
16646
- _this.propop = false;
16647
- return _this;
16648
- }
16649
- $Nor2.prototype.next = function(item, key, owner) {
16650
- _super.prototype.next.call(this, item, key, owner);
16651
- this.keep = !this.keep;
16652
- };
16653
- return $Nor2;
16654
- })($Or)
16655
- );
16656
- var $In = (
16657
- /** @class */
16658
- (function(_super) {
16659
- __extends($In2, _super);
16660
- function $In2() {
16661
- var _this = _super !== null && _super.apply(this, arguments) || this;
16662
- _this.propop = true;
16663
- return _this;
16664
- }
16665
- $In2.prototype.init = function() {
16666
- var _this = this;
16667
- var params = Array.isArray(this.params) ? this.params : [this.params];
16668
- this._testers = params.map(function(value) {
16669
- if (containsOperation(value, _this.options)) {
16670
- throw new Error("cannot nest $ under ".concat(_this.name.toLowerCase()));
16671
- }
16672
- return createTester(value, _this.options.compare);
16673
- });
16674
- };
16675
- $In2.prototype.next = function(item, key, owner) {
16676
- var done = false;
16677
- var success = false;
16678
- for (var i2 = 0, length_4 = this._testers.length; i2 < length_4; i2++) {
16679
- var test = this._testers[i2];
16680
- if (test(item)) {
16681
- done = true;
16682
- success = true;
16683
- break;
16684
- }
16685
- }
16686
- this.keep = success;
16687
- this.done = done;
16688
- };
16689
- return $In2;
16690
- })(BaseOperation)
16691
- );
16692
- var $Nin = (
16693
- /** @class */
16694
- (function(_super) {
16695
- __extends($Nin2, _super);
16696
- function $Nin2(params, ownerQuery, options, name) {
16697
- var _this = _super.call(this, params, ownerQuery, options, name) || this;
16698
- _this.propop = true;
16699
- _this._in = new $In(params, ownerQuery, options, name);
16700
- return _this;
16701
- }
16702
- $Nin2.prototype.next = function(item, key, owner, root) {
16703
- this._in.next(item, key, owner);
16704
- if (isArray(owner) && !root) {
16705
- if (this._in.keep) {
16706
- this.keep = false;
16707
- this.done = true;
16708
- } else if (key == owner.length - 1) {
16709
- this.keep = true;
16710
- this.done = true;
16711
- }
16712
- } else {
16713
- this.keep = !this._in.keep;
16714
- this.done = true;
16715
- }
16716
- };
16717
- $Nin2.prototype.reset = function() {
16718
- _super.prototype.reset.call(this);
16719
- this._in.reset();
16720
- };
16721
- return $Nin2;
16722
- })(BaseOperation)
16723
- );
16724
- var $Exists = (
16725
- /** @class */
16726
- (function(_super) {
16727
- __extends($Exists2, _super);
16728
- function $Exists2() {
16729
- var _this = _super !== null && _super.apply(this, arguments) || this;
16730
- _this.propop = true;
16731
- return _this;
16732
- }
16733
- $Exists2.prototype.next = function(item, key, owner, root, leaf) {
16734
- if (!leaf) {
16735
- this.done = true;
16736
- this.keep = !this.params;
16737
- } else if (owner.hasOwnProperty(key) === this.params) {
16738
- this.done = true;
16739
- this.keep = true;
16740
- }
16741
- };
16742
- return $Exists2;
16743
- })(BaseOperation)
16744
- );
16745
- var $And = (
16746
- /** @class */
16747
- (function(_super) {
16748
- __extends($And2, _super);
16749
- function $And2(params, owneryQuery, options, name) {
16750
- var _this = _super.call(this, params, owneryQuery, options, params.map(function(query) {
16751
- return createQueryOperation(query, owneryQuery, options);
16752
- }), name) || this;
16753
- _this.propop = false;
16754
- assertGroupNotEmpty(params);
16755
- return _this;
16756
- }
16757
- $And2.prototype.next = function(item, key, owner, root) {
16758
- this.childrenNext(item, key, owner, root);
16759
- };
16760
- return $And2;
16761
- })(NamedGroupOperation)
16762
- );
16763
- var $All = (
16764
- /** @class */
16765
- (function(_super) {
16766
- __extends($All2, _super);
16767
- function $All2(params, owneryQuery, options, name) {
16768
- var _this = _super.call(this, params, owneryQuery, options, params.map(function(query) {
16769
- return createQueryOperation(query, owneryQuery, options);
16770
- }), name) || this;
16771
- _this.propop = true;
16772
- return _this;
16773
- }
16774
- $All2.prototype.next = function(item, key, owner, root) {
16775
- this.childrenNext(item, key, owner, root);
16776
- };
16777
- return $All2;
16778
- })(NamedGroupOperation)
16779
- );
16780
- var $eq = function(params, owneryQuery, options) {
16781
- return new EqualsOperation(params, owneryQuery, options);
16782
- };
16783
- var $ne = function(params, owneryQuery, options, name) {
16784
- return new $Ne(params, owneryQuery, options, name);
16785
- };
16786
- var $or = function(params, owneryQuery, options, name) {
16787
- return new $Or(params, owneryQuery, options, name);
16788
- };
16789
- var $nor = function(params, owneryQuery, options, name) {
16790
- return new $Nor(params, owneryQuery, options, name);
16791
- };
16792
- var $elemMatch = function(params, owneryQuery, options, name) {
16793
- return new $ElemMatch(params, owneryQuery, options, name);
16794
- };
16795
- var $nin = function(params, owneryQuery, options, name) {
16796
- return new $Nin(params, owneryQuery, options, name);
16797
- };
16798
- var $in = function(params, owneryQuery, options, name) {
16799
- return new $In(params, owneryQuery, options, name);
16800
- };
16801
- var $lt = numericalOperation(function(params) {
16802
- return function(b2) {
16803
- return b2 != null && b2 < params;
16804
- };
16805
- });
16806
- var $lte = numericalOperation(function(params) {
16807
- return function(b2) {
16808
- return b2 === params || b2 <= params;
16809
- };
16810
- });
16811
- var $gt = numericalOperation(function(params) {
16812
- return function(b2) {
16813
- return b2 != null && b2 > params;
16814
- };
16815
- });
16816
- var $gte = numericalOperation(function(params) {
16817
- return function(b2) {
16818
- return b2 === params || b2 >= params;
16819
- };
16820
- });
16821
- var $mod = function(_a, owneryQuery, options) {
16822
- var mod = _a[0], equalsValue = _a[1];
16823
- return new EqualsOperation(function(b2) {
16824
- return comparable(b2) % mod === equalsValue;
16825
- }, owneryQuery, options);
16826
- };
16827
- var $exists = function(params, owneryQuery, options, name) {
16828
- return new $Exists(params, owneryQuery, options, name);
16829
- };
16830
- var $regex = function(pattern, owneryQuery, options) {
16831
- return new EqualsOperation(new RegExp(pattern, owneryQuery.$options), owneryQuery, options);
16832
- };
16833
- var $not = function(params, owneryQuery, options, name) {
16834
- return new $Not(params, owneryQuery, options, name);
16835
- };
16836
- var typeAliases = {
16837
- number: function(v) {
16838
- return typeof v === "number";
16839
- },
16840
- string: function(v) {
16841
- return typeof v === "string";
16842
- },
16843
- bool: function(v) {
16844
- return typeof v === "boolean";
16845
- },
16846
- array: function(v) {
16847
- return Array.isArray(v);
16848
- },
16849
- null: function(v) {
16850
- return v === null;
16851
- },
16852
- timestamp: function(v) {
16853
- return v instanceof Date;
16854
- }
16855
- };
16856
- var $type = function(clazz, owneryQuery, options) {
16857
- return new EqualsOperation(function(b2) {
16858
- if (typeof clazz === "string") {
16859
- if (!typeAliases[clazz]) {
16860
- throw new Error("Type alias does not exist");
16861
- }
16862
- return typeAliases[clazz](b2);
16863
- }
16864
- return b2 != null ? b2 instanceof clazz || b2.constructor === clazz : false;
16865
- }, owneryQuery, options);
16866
- };
16867
- var $and = function(params, ownerQuery, options, name) {
16868
- return new $And(params, ownerQuery, options, name);
16869
- };
16870
- var $all = function(params, ownerQuery, options, name) {
16871
- return new $All(params, ownerQuery, options, name);
16872
- };
16873
- var $size = function(params, ownerQuery, options) {
16874
- return new $Size(params, ownerQuery, options, "$size");
16875
- };
16876
- var $options = function() {
16877
- return null;
16878
- };
16879
- var $where = function(params, ownerQuery, options) {
16880
- var test;
16881
- if (isFunction(params)) {
16882
- test = params;
16883
- } else if (!process.env.CSP_ENABLED) {
16884
- test = new Function("obj", "return " + params);
16885
- } else {
16886
- throw new Error('In CSP mode, sift does not support strings in "$where" condition');
16887
- }
16888
- return new EqualsOperation(function(b2) {
16889
- return test.bind(b2)(b2);
16890
- }, ownerQuery, options);
16891
- };
16892
- var defaultOperations = /* @__PURE__ */ Object.freeze({
16893
- __proto__: null,
16894
- $Size,
16895
- $all,
16896
- $and,
16897
- $elemMatch,
16898
- $eq,
16899
- $exists,
16900
- $gt,
16901
- $gte,
16902
- $in,
16903
- $lt,
16904
- $lte,
16905
- $mod,
16906
- $ne,
16907
- $nin,
16908
- $nor,
16909
- $not,
16910
- $options,
16911
- $or,
16912
- $regex,
16913
- $size,
16914
- $type,
16915
- $where
16916
- });
16917
- var createDefaultQueryOperation = function(query, ownerQuery, _a) {
16918
- var _b = _a === void 0 ? {} : _a, compare = _b.compare, operations = _b.operations;
16919
- return createQueryOperation(query, ownerQuery, {
16920
- compare,
16921
- operations: Object.assign({}, defaultOperations, operations || {})
16922
- });
16923
- };
16924
- var createDefaultQueryTester = function(query, options) {
16925
- if (options === void 0) {
16926
- options = {};
16927
- }
16928
- var op = createDefaultQueryOperation(query, null, options);
16929
- return createOperationTester(op);
16930
- };
16931
-
16932
16152
  // package.json
16933
16153
  var package_default = {
16934
16154
  name: "@batijs/cli",
16935
- version: "0.0.511",
16155
+ version: "0.0.513",
16936
16156
  type: "module",
16937
16157
  scripts: {
16938
16158
  "check-types": "tsc --noEmit",
@@ -16954,7 +16174,6 @@ var package_default = {
16954
16174
  colorette: "^2.0.20",
16955
16175
  esbuild: "^0.27.0",
16956
16176
  execa: "^9.6.0",
16957
- sift: "^17.1.3",
16958
16177
  tsup: "^8.5.0",
16959
16178
  typescript: "^5.9.3",
16960
16179
  "unplugin-purge-polyfills": "^0.1.0",
@@ -17036,8 +16255,19 @@ function boilerplatesDir() {
17036
16255
  }
17037
16256
  throw new Error("Missing boilerplates.json file. Run `pnpm run build`");
17038
16257
  }
17039
- async function parseBoilerplates(dir) {
17040
- return JSON.parse(await readFile2(join(dir, "boilerplates.json"), "utf-8"));
16258
+ async function loadBoilerplates(dir) {
16259
+ const boilerplates = JSON.parse(await readFile2(join(dir, "boilerplates.json"), "utf-8"));
16260
+ return await Promise.all(
16261
+ boilerplates.map(async (bl) => {
16262
+ const batiConfigFile = join(dir, bl.folder, "bati.config.js");
16263
+ const importFile = isWin2 ? `file://${batiConfigFile}` : batiConfigFile;
16264
+ const { default: batiConfig } = await import(importFile);
16265
+ return {
16266
+ ...bl,
16267
+ config: batiConfig
16268
+ };
16269
+ })
16270
+ );
17041
16271
  }
17042
16272
  function toArg(flag, description) {
17043
16273
  if (!flag) return {};
@@ -17290,11 +16520,9 @@ async function retrieveHooks(hooks) {
17290
16520
  }
17291
16521
  return map;
17292
16522
  }
17293
- function testFlags(flags2, bl) {
16523
+ function testFlags(meta, bl) {
17294
16524
  if (bl.config.if) {
17295
- return createDefaultQueryTester(bl.config.if)(
17296
- flags2.map((f2) => ({ flag: f2, packageManager: pm?.name }))
17297
- );
16525
+ return bl.config.if(meta, pm?.name);
17298
16526
  }
17299
16527
  return true;
17300
16528
  }
@@ -17328,7 +16556,7 @@ function gitInit(cwd) {
17328
16556
  }
17329
16557
  async function run() {
17330
16558
  const dir = boilerplatesDir();
17331
- const boilerplates = await parseBoilerplates(dir);
16559
+ const boilerplates = await loadBoilerplates(dir);
17332
16560
  const main2 = defineCommand({
17333
16561
  meta: {
17334
16562
  name: package_default.name,
@@ -17355,6 +16583,10 @@ async function run() {
17355
16583
  checkFlagsExist(flags2);
17356
16584
  await checkFlagsIncludesUiFramework(flags2);
17357
16585
  checkRules(flags2);
16586
+ const meta = {
16587
+ BATI: new BatiSet(flags2, features),
16588
+ BATI_TEST: Boolean(process.env.BATI_TEST)
16589
+ };
17358
16590
  boilerplates.sort((b1, b2) => {
17359
16591
  if (b1.config.enforce === "pre") return -1;
17360
16592
  if (b1.config.enforce === "post") return 1;
@@ -17363,7 +16595,7 @@ async function run() {
17363
16595
  return 0;
17364
16596
  });
17365
16597
  for (const bl of boilerplates) {
17366
- if (testFlags(flags2, bl)) {
16598
+ if (testFlags(meta, bl)) {
17367
16599
  if (bl.subfolders.includes("files")) {
17368
16600
  sources.push(join(dir, bl.folder, "files"));
17369
16601
  }
@@ -17373,10 +16605,6 @@ async function run() {
17373
16605
  }
17374
16606
  }
17375
16607
  const hooksMap = await retrieveHooks(hooks);
17376
- const meta = {
17377
- BATI: new BatiSet(flags2, features),
17378
- BATI_TEST: Boolean(process.env.BATI_TEST)
17379
- };
17380
16608
  await main(
17381
16609
  {
17382
16610
  source: sources,