alex-c-line 2.9.1 → 2.9.2
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/index.cjs +70 -70
- package/dist/index.js +70 -70
- package/package.json +13 -13
package/dist/index.cjs
CHANGED
|
@@ -284,78 +284,12 @@ function internalCheckLockfileVersionDiscrepancy(program) {
|
|
|
284
284
|
});
|
|
285
285
|
}
|
|
286
286
|
//#endregion
|
|
287
|
-
//#region src/configs/helpers/preCommit/definePreCommitConfig.ts
|
|
288
|
-
const preCommitStepOptionsSchema = zod.default.strictObject({ arguments: zod.default.array(zod.default.string()).optional() });
|
|
289
|
-
const preCommitConfigSchema = zod.default.strictObject({
|
|
290
|
-
packageManager: zod.default.enum(_alextheman_utility_internal.PackageManager).optional(),
|
|
291
|
-
allowNoStagedChanges: zod.default.boolean().optional(),
|
|
292
|
-
steps: zod.default.array(zod.default.union([
|
|
293
|
-
zod.default.function({
|
|
294
|
-
input: [zod.default.function()],
|
|
295
|
-
output: zod.default.any()
|
|
296
|
-
}),
|
|
297
|
-
zod.default.string(),
|
|
298
|
-
zod.default.tuple([zod.default.string(), preCommitStepOptionsSchema])
|
|
299
|
-
])),
|
|
300
|
-
updateIndex: zod.default.boolean().optional()
|
|
301
|
-
});
|
|
302
|
-
//#endregion
|
|
303
|
-
//#region src/configs/helpers/template/pullRequest/defineTemplatePullRequestSchema.ts
|
|
304
|
-
const templatePullRequestBaseSchema = zod.default.strictObject({ projectName: zod.default.string().optional() });
|
|
305
|
-
const templatePullRequestSchema = zod.default.discriminatedUnion("category", [templatePullRequestBaseSchema.extend({
|
|
306
|
-
category: zod.default.literal("general"),
|
|
307
|
-
projectType: zod.default.string()
|
|
308
|
-
}), templatePullRequestBaseSchema.extend({
|
|
309
|
-
category: zod.default.literal("infrastructure"),
|
|
310
|
-
infrastructureProvider: zod.default.string(),
|
|
311
|
-
requireConfirmationFrom: zod.default.string()
|
|
312
|
-
})]);
|
|
313
|
-
function parseTemplatePullRequestConfig(input) {
|
|
314
|
-
return _alextheman_utility.az.with(templatePullRequestSchema).parse(input);
|
|
315
|
-
}
|
|
316
|
-
//#endregion
|
|
317
|
-
//#region src/configs/helpers/defineAlexCLineConfig.ts
|
|
318
|
-
const alexCLineConfigSchema = zod.default.strictObject({
|
|
319
|
-
preCommit: preCommitConfigSchema,
|
|
320
|
-
template: zod.default.object({ pullRequest: templatePullRequestSchema })
|
|
321
|
-
}).partial();
|
|
322
|
-
async function parseAlexCLineConfig(input) {
|
|
323
|
-
return await _alextheman_utility.az.with(alexCLineConfigSchema).parseAsync(input);
|
|
324
|
-
}
|
|
325
|
-
//#endregion
|
|
326
|
-
//#region src/configs/types/ConfigFileName.ts
|
|
327
|
-
const ConfigFileName = {
|
|
328
|
-
STANDARD_JAVASCRIPT: "alex-c-line.config.js",
|
|
329
|
-
ES_MODULES_JAVASCRIPT: "alex-c-line.config.mjs",
|
|
330
|
-
COMMON_JS_JAVASCRIPT: "alex-c-line.config.cjs"
|
|
331
|
-
};
|
|
332
|
-
const PrivateConfigFileName = {
|
|
333
|
-
STANDARD_JAVASCRIPT: ".alex-c-line.private.config.js",
|
|
334
|
-
ES_MODULES_JAVASCRIPT: ".alex-c-line.private.config.mjs",
|
|
335
|
-
COMMON_JS_JAVASCRIPT: ".alex-c-line.private.config.cjs"
|
|
336
|
-
};
|
|
337
|
-
//#endregion
|
|
338
287
|
//#region src/configs/types/template/pullRequest/PullRequestTemplateCategory.ts
|
|
339
288
|
const PullRequestTemplateCategory = {
|
|
340
289
|
GENERAL: "general",
|
|
341
290
|
INFRASTRUCTURE: "infrastructure"
|
|
342
291
|
};
|
|
343
292
|
//#endregion
|
|
344
|
-
//#region src/configs/helpers/defineAlexCLinePrivateConfig.ts
|
|
345
|
-
const alexCLinePrivateConfigSchema = zod.default.object({ localPackage: zod.default.strictObject({
|
|
346
|
-
enableCache: zod.default.boolean().optional(),
|
|
347
|
-
localPackages: zod.default.record(zod.default.string(), zod.default.strictObject({
|
|
348
|
-
packageManager: zod.default.enum(_alextheman_utility_internal.PackageManager),
|
|
349
|
-
path: zod.default.string(),
|
|
350
|
-
prepareScript: zod.default.string().optional(),
|
|
351
|
-
dependencyGroup: zod.default.enum(_alextheman_utility_internal.DependencyGroup).optional(),
|
|
352
|
-
keepOldTarballs: zod.default.boolean().optional()
|
|
353
|
-
}))
|
|
354
|
-
}) });
|
|
355
|
-
function parseAlexCLinePrivateConfig(data) {
|
|
356
|
-
return _alextheman_utility.az.with(alexCLinePrivateConfigSchema).parse(data);
|
|
357
|
-
}
|
|
358
|
-
//#endregion
|
|
359
293
|
//#region src/utility/fileSystem/findPackageRoot.ts
|
|
360
294
|
async function findPackageRoot(startDirectory, packageName) {
|
|
361
295
|
let directory = startDirectory;
|
|
@@ -695,6 +629,18 @@ async function loadAlexCLineProjectCache(cachePath = node_path.default.join(".al
|
|
|
695
629
|
}
|
|
696
630
|
}
|
|
697
631
|
//#endregion
|
|
632
|
+
//#region src/configs/types/ConfigFileName.ts
|
|
633
|
+
const ConfigFileName = {
|
|
634
|
+
STANDARD_JAVASCRIPT: "alex-c-line.config.js",
|
|
635
|
+
ES_MODULES_JAVASCRIPT: "alex-c-line.config.mjs",
|
|
636
|
+
COMMON_JS_JAVASCRIPT: "alex-c-line.config.cjs"
|
|
637
|
+
};
|
|
638
|
+
const PrivateConfigFileName = {
|
|
639
|
+
STANDARD_JAVASCRIPT: ".alex-c-line.private.config.js",
|
|
640
|
+
ES_MODULES_JAVASCRIPT: ".alex-c-line.private.config.mjs",
|
|
641
|
+
COMMON_JS_JAVASCRIPT: ".alex-c-line.private.config.cjs"
|
|
642
|
+
};
|
|
643
|
+
//#endregion
|
|
698
644
|
//#region src/utility/fileSystem/doesFileExist.ts
|
|
699
645
|
async function doesFileExist(filePath) {
|
|
700
646
|
try {
|
|
@@ -718,6 +664,21 @@ async function findAlexCLineConfig(cwd, validConfigFileNames = [
|
|
|
718
664
|
}
|
|
719
665
|
}
|
|
720
666
|
//#endregion
|
|
667
|
+
//#region src/configs/helpers/defineAlexCLinePrivateConfig.ts
|
|
668
|
+
const alexCLinePrivateConfigSchema = zod.default.object({ localPackage: zod.default.strictObject({
|
|
669
|
+
enableCache: zod.default.boolean().optional(),
|
|
670
|
+
localPackages: zod.default.record(zod.default.string(), zod.default.strictObject({
|
|
671
|
+
packageManager: zod.default.enum(_alextheman_utility_internal.PackageManager),
|
|
672
|
+
path: zod.default.string(),
|
|
673
|
+
prepareScript: zod.default.string().optional(),
|
|
674
|
+
dependencyGroup: zod.default.enum(_alextheman_utility_internal.DependencyGroup).optional(),
|
|
675
|
+
keepOldTarballs: zod.default.boolean().optional()
|
|
676
|
+
}))
|
|
677
|
+
}) });
|
|
678
|
+
function parseAlexCLinePrivateConfig(data) {
|
|
679
|
+
return _alextheman_utility.az.with(alexCLinePrivateConfigSchema).parse(data);
|
|
680
|
+
}
|
|
681
|
+
//#endregion
|
|
721
682
|
//#region src/utility/configs/loadAlexCLinePrivateConfig.ts
|
|
722
683
|
const require$2 = (0, node_module.createRequire)(require("url").pathToFileURL(__filename).href);
|
|
723
684
|
async function loadAlexCLinePrivateConfig(filePath) {
|
|
@@ -952,6 +913,45 @@ function getCommandArguments(program, script, scripts, args) {
|
|
|
952
913
|
return result;
|
|
953
914
|
}
|
|
954
915
|
//#endregion
|
|
916
|
+
//#region src/configs/helpers/preCommit/definePreCommitConfig.ts
|
|
917
|
+
const preCommitStepOptionsSchema = zod.default.strictObject({ arguments: zod.default.array(zod.default.string()).optional() });
|
|
918
|
+
const preCommitConfigSchema = zod.default.strictObject({
|
|
919
|
+
packageManager: zod.default.enum(_alextheman_utility_internal.PackageManager).optional(),
|
|
920
|
+
allowNoStagedChanges: zod.default.boolean().optional(),
|
|
921
|
+
steps: zod.default.array(zod.default.union([
|
|
922
|
+
zod.default.function({
|
|
923
|
+
input: [zod.default.function()],
|
|
924
|
+
output: zod.default.any()
|
|
925
|
+
}),
|
|
926
|
+
zod.default.string(),
|
|
927
|
+
zod.default.tuple([zod.default.string(), preCommitStepOptionsSchema])
|
|
928
|
+
])),
|
|
929
|
+
updateIndex: zod.default.boolean().optional()
|
|
930
|
+
});
|
|
931
|
+
//#endregion
|
|
932
|
+
//#region src/configs/helpers/template/pullRequest/defineTemplatePullRequestSchema.ts
|
|
933
|
+
const templatePullRequestBaseSchema = zod.default.strictObject({ projectName: zod.default.string().optional() });
|
|
934
|
+
const templatePullRequestSchema = zod.default.discriminatedUnion("category", [templatePullRequestBaseSchema.extend({
|
|
935
|
+
category: zod.default.literal("general"),
|
|
936
|
+
projectType: zod.default.string()
|
|
937
|
+
}), templatePullRequestBaseSchema.extend({
|
|
938
|
+
category: zod.default.literal("infrastructure"),
|
|
939
|
+
infrastructureProvider: zod.default.string(),
|
|
940
|
+
requireConfirmationFrom: zod.default.string()
|
|
941
|
+
})]);
|
|
942
|
+
function parseTemplatePullRequestConfig(input) {
|
|
943
|
+
return _alextheman_utility.az.with(templatePullRequestSchema).parse(input);
|
|
944
|
+
}
|
|
945
|
+
//#endregion
|
|
946
|
+
//#region src/configs/helpers/defineAlexCLineConfig.ts
|
|
947
|
+
const alexCLineConfigSchema = zod.default.strictObject({
|
|
948
|
+
preCommit: preCommitConfigSchema,
|
|
949
|
+
template: zod.default.object({ pullRequest: templatePullRequestSchema })
|
|
950
|
+
}).partial();
|
|
951
|
+
async function parseAlexCLineConfig(input) {
|
|
952
|
+
return await _alextheman_utility.az.with(alexCLineConfigSchema).parseAsync(input);
|
|
953
|
+
}
|
|
954
|
+
//#endregion
|
|
955
955
|
//#region src/utility/configs/loadAlexCLineConfig.ts
|
|
956
956
|
const require$1 = (0, node_module.createRequire)(require("url").pathToFileURL(__filename).href);
|
|
957
957
|
async function loadAlexCLineConfig(filePath) {
|
|
@@ -965,7 +965,7 @@ async function loadAlexCLineConfig(filePath) {
|
|
|
965
965
|
//#endregion
|
|
966
966
|
//#region src/cli/commands/root/pre-commit/pre-commit.ts
|
|
967
967
|
function preCommit(program) {
|
|
968
|
-
program.command("pre-commit").description("Run the pre-commit scripts specified in the alex-c-line config (v2 experiment).").option("--allow-no-staged-changes", "Run even if nothing is staged").option("--no-update-index"
|
|
968
|
+
program.command("pre-commit").description("Run the pre-commit scripts specified in the alex-c-line config (v2 experiment).").option("--allow-no-staged-changes", "Run even if nothing is staged").option("--no-update-index", "Update the git index after the run").action(async (options) => {
|
|
969
969
|
const configPath = await findAlexCLineConfig(process.cwd());
|
|
970
970
|
if (!configPath) throw new _alextheman_utility_v6.DataError({ configPath }, "ALEX_C_LINE_CONFIG_NOT_FOUND", "Could not find the path to the alex-c-line config file. Does it exist?");
|
|
971
971
|
const { preCommit: preCommitConfig } = await loadAlexCLineConfig(configPath);
|
|
@@ -1356,7 +1356,7 @@ function template(program) {
|
|
|
1356
1356
|
//#endregion
|
|
1357
1357
|
//#region package.json
|
|
1358
1358
|
var name = "alex-c-line";
|
|
1359
|
-
var version$1 = "2.9.
|
|
1359
|
+
var version$1 = "2.9.2";
|
|
1360
1360
|
var description = "Command-line tool with commands to streamline the developer workflow.";
|
|
1361
1361
|
//#endregion
|
|
1362
1362
|
//#region src/utility/updates/checkUpdate.ts
|
|
@@ -1444,7 +1444,7 @@ const versionFormatOptionsSchema = zod.default.discriminatedUnion("minor", [vers
|
|
|
1444
1444
|
function versionFormat(program) {
|
|
1445
1445
|
program.command("format").description("Format the given version number based on a series of options.").argument("<version>", "The version to format", (rawVersion) => {
|
|
1446
1446
|
return new _alextheman_utility.VersionNumber(rawVersion);
|
|
1447
|
-
}).option("--no-prefix", "Omit the `v` prefix from the output.").option("--
|
|
1447
|
+
}).option("--no-prefix", "Omit the `v` prefix from the output.").option("--no-minor", "Omit the minor version number from the output (will also omit the patch version)").option("--no-patch", "Omit the patch version number from the output.").action((version, options) => {
|
|
1448
1448
|
const { prefix, minor, patch } = parseZodSchemaForProgram(program, versionFormatOptionsSchema, options.minor === false ? (0, _alextheman_utility.omitProperties)(options, "patch") : options);
|
|
1449
1449
|
console.info(version.format({
|
|
1450
1450
|
omitPrefix: !prefix,
|
|
@@ -1464,7 +1464,7 @@ function versionIncrement(program) {
|
|
|
1464
1464
|
- "major": Change the major version v1.2.3 → v2.0.0
|
|
1465
1465
|
- "minor": Change the minor version v1.2.3 → v1.3.0
|
|
1466
1466
|
- "patch": Change the patch version v1.2.3 → v1.2.4
|
|
1467
|
-
`, _alextheman_utility.parseVersionType).option("--no-prefix", "Omit the `v` prefix from the output.").
|
|
1467
|
+
`, _alextheman_utility.parseVersionType).option("--no-prefix", "Omit the `v` prefix from the output.").action((version, incrementType, { prefix }) => {
|
|
1468
1468
|
console.info(version.increment(incrementType).format({ omitPrefix: !prefix }));
|
|
1469
1469
|
});
|
|
1470
1470
|
}
|
package/dist/index.js
CHANGED
|
@@ -253,78 +253,12 @@ function internalCheckLockfileVersionDiscrepancy(program) {
|
|
|
253
253
|
});
|
|
254
254
|
}
|
|
255
255
|
//#endregion
|
|
256
|
-
//#region src/configs/helpers/preCommit/definePreCommitConfig.ts
|
|
257
|
-
const preCommitStepOptionsSchema = z.strictObject({ arguments: z.array(z.string()).optional() });
|
|
258
|
-
const preCommitConfigSchema = z.strictObject({
|
|
259
|
-
packageManager: z.enum(PackageManager).optional(),
|
|
260
|
-
allowNoStagedChanges: z.boolean().optional(),
|
|
261
|
-
steps: z.array(z.union([
|
|
262
|
-
z.function({
|
|
263
|
-
input: [z.function()],
|
|
264
|
-
output: z.any()
|
|
265
|
-
}),
|
|
266
|
-
z.string(),
|
|
267
|
-
z.tuple([z.string(), preCommitStepOptionsSchema])
|
|
268
|
-
])),
|
|
269
|
-
updateIndex: z.boolean().optional()
|
|
270
|
-
});
|
|
271
|
-
//#endregion
|
|
272
|
-
//#region src/configs/helpers/template/pullRequest/defineTemplatePullRequestSchema.ts
|
|
273
|
-
const templatePullRequestBaseSchema = z.strictObject({ projectName: z.string().optional() });
|
|
274
|
-
const templatePullRequestSchema = z.discriminatedUnion("category", [templatePullRequestBaseSchema.extend({
|
|
275
|
-
category: z.literal("general"),
|
|
276
|
-
projectType: z.string()
|
|
277
|
-
}), templatePullRequestBaseSchema.extend({
|
|
278
|
-
category: z.literal("infrastructure"),
|
|
279
|
-
infrastructureProvider: z.string(),
|
|
280
|
-
requireConfirmationFrom: z.string()
|
|
281
|
-
})]);
|
|
282
|
-
function parseTemplatePullRequestConfig(input) {
|
|
283
|
-
return az.with(templatePullRequestSchema).parse(input);
|
|
284
|
-
}
|
|
285
|
-
//#endregion
|
|
286
|
-
//#region src/configs/helpers/defineAlexCLineConfig.ts
|
|
287
|
-
const alexCLineConfigSchema = z.strictObject({
|
|
288
|
-
preCommit: preCommitConfigSchema,
|
|
289
|
-
template: z.object({ pullRequest: templatePullRequestSchema })
|
|
290
|
-
}).partial();
|
|
291
|
-
async function parseAlexCLineConfig(input) {
|
|
292
|
-
return await az.with(alexCLineConfigSchema).parseAsync(input);
|
|
293
|
-
}
|
|
294
|
-
//#endregion
|
|
295
|
-
//#region src/configs/types/ConfigFileName.ts
|
|
296
|
-
const ConfigFileName = {
|
|
297
|
-
STANDARD_JAVASCRIPT: "alex-c-line.config.js",
|
|
298
|
-
ES_MODULES_JAVASCRIPT: "alex-c-line.config.mjs",
|
|
299
|
-
COMMON_JS_JAVASCRIPT: "alex-c-line.config.cjs"
|
|
300
|
-
};
|
|
301
|
-
const PrivateConfigFileName = {
|
|
302
|
-
STANDARD_JAVASCRIPT: ".alex-c-line.private.config.js",
|
|
303
|
-
ES_MODULES_JAVASCRIPT: ".alex-c-line.private.config.mjs",
|
|
304
|
-
COMMON_JS_JAVASCRIPT: ".alex-c-line.private.config.cjs"
|
|
305
|
-
};
|
|
306
|
-
//#endregion
|
|
307
256
|
//#region src/configs/types/template/pullRequest/PullRequestTemplateCategory.ts
|
|
308
257
|
const PullRequestTemplateCategory = {
|
|
309
258
|
GENERAL: "general",
|
|
310
259
|
INFRASTRUCTURE: "infrastructure"
|
|
311
260
|
};
|
|
312
261
|
//#endregion
|
|
313
|
-
//#region src/configs/helpers/defineAlexCLinePrivateConfig.ts
|
|
314
|
-
const alexCLinePrivateConfigSchema = z.object({ localPackage: z.strictObject({
|
|
315
|
-
enableCache: z.boolean().optional(),
|
|
316
|
-
localPackages: z.record(z.string(), z.strictObject({
|
|
317
|
-
packageManager: z.enum(PackageManager),
|
|
318
|
-
path: z.string(),
|
|
319
|
-
prepareScript: z.string().optional(),
|
|
320
|
-
dependencyGroup: z.enum(DependencyGroup).optional(),
|
|
321
|
-
keepOldTarballs: z.boolean().optional()
|
|
322
|
-
}))
|
|
323
|
-
}) });
|
|
324
|
-
function parseAlexCLinePrivateConfig(data) {
|
|
325
|
-
return az.with(alexCLinePrivateConfigSchema).parse(data);
|
|
326
|
-
}
|
|
327
|
-
//#endregion
|
|
328
262
|
//#region src/utility/fileSystem/findPackageRoot.ts
|
|
329
263
|
async function findPackageRoot(startDirectory, packageName) {
|
|
330
264
|
let directory = startDirectory;
|
|
@@ -664,6 +598,18 @@ async function loadAlexCLineProjectCache(cachePath = path.join(".alex-c-line", "
|
|
|
664
598
|
}
|
|
665
599
|
}
|
|
666
600
|
//#endregion
|
|
601
|
+
//#region src/configs/types/ConfigFileName.ts
|
|
602
|
+
const ConfigFileName = {
|
|
603
|
+
STANDARD_JAVASCRIPT: "alex-c-line.config.js",
|
|
604
|
+
ES_MODULES_JAVASCRIPT: "alex-c-line.config.mjs",
|
|
605
|
+
COMMON_JS_JAVASCRIPT: "alex-c-line.config.cjs"
|
|
606
|
+
};
|
|
607
|
+
const PrivateConfigFileName = {
|
|
608
|
+
STANDARD_JAVASCRIPT: ".alex-c-line.private.config.js",
|
|
609
|
+
ES_MODULES_JAVASCRIPT: ".alex-c-line.private.config.mjs",
|
|
610
|
+
COMMON_JS_JAVASCRIPT: ".alex-c-line.private.config.cjs"
|
|
611
|
+
};
|
|
612
|
+
//#endregion
|
|
667
613
|
//#region src/utility/fileSystem/doesFileExist.ts
|
|
668
614
|
async function doesFileExist(filePath) {
|
|
669
615
|
try {
|
|
@@ -687,6 +633,21 @@ async function findAlexCLineConfig(cwd, validConfigFileNames = [
|
|
|
687
633
|
}
|
|
688
634
|
}
|
|
689
635
|
//#endregion
|
|
636
|
+
//#region src/configs/helpers/defineAlexCLinePrivateConfig.ts
|
|
637
|
+
const alexCLinePrivateConfigSchema = z.object({ localPackage: z.strictObject({
|
|
638
|
+
enableCache: z.boolean().optional(),
|
|
639
|
+
localPackages: z.record(z.string(), z.strictObject({
|
|
640
|
+
packageManager: z.enum(PackageManager),
|
|
641
|
+
path: z.string(),
|
|
642
|
+
prepareScript: z.string().optional(),
|
|
643
|
+
dependencyGroup: z.enum(DependencyGroup).optional(),
|
|
644
|
+
keepOldTarballs: z.boolean().optional()
|
|
645
|
+
}))
|
|
646
|
+
}) });
|
|
647
|
+
function parseAlexCLinePrivateConfig(data) {
|
|
648
|
+
return az.with(alexCLinePrivateConfigSchema).parse(data);
|
|
649
|
+
}
|
|
650
|
+
//#endregion
|
|
690
651
|
//#region src/utility/configs/loadAlexCLinePrivateConfig.ts
|
|
691
652
|
const require$1 = createRequire(import.meta.url);
|
|
692
653
|
async function loadAlexCLinePrivateConfig(filePath) {
|
|
@@ -921,6 +882,45 @@ function getCommandArguments(program, script, scripts, args) {
|
|
|
921
882
|
return result;
|
|
922
883
|
}
|
|
923
884
|
//#endregion
|
|
885
|
+
//#region src/configs/helpers/preCommit/definePreCommitConfig.ts
|
|
886
|
+
const preCommitStepOptionsSchema = z.strictObject({ arguments: z.array(z.string()).optional() });
|
|
887
|
+
const preCommitConfigSchema = z.strictObject({
|
|
888
|
+
packageManager: z.enum(PackageManager).optional(),
|
|
889
|
+
allowNoStagedChanges: z.boolean().optional(),
|
|
890
|
+
steps: z.array(z.union([
|
|
891
|
+
z.function({
|
|
892
|
+
input: [z.function()],
|
|
893
|
+
output: z.any()
|
|
894
|
+
}),
|
|
895
|
+
z.string(),
|
|
896
|
+
z.tuple([z.string(), preCommitStepOptionsSchema])
|
|
897
|
+
])),
|
|
898
|
+
updateIndex: z.boolean().optional()
|
|
899
|
+
});
|
|
900
|
+
//#endregion
|
|
901
|
+
//#region src/configs/helpers/template/pullRequest/defineTemplatePullRequestSchema.ts
|
|
902
|
+
const templatePullRequestBaseSchema = z.strictObject({ projectName: z.string().optional() });
|
|
903
|
+
const templatePullRequestSchema = z.discriminatedUnion("category", [templatePullRequestBaseSchema.extend({
|
|
904
|
+
category: z.literal("general"),
|
|
905
|
+
projectType: z.string()
|
|
906
|
+
}), templatePullRequestBaseSchema.extend({
|
|
907
|
+
category: z.literal("infrastructure"),
|
|
908
|
+
infrastructureProvider: z.string(),
|
|
909
|
+
requireConfirmationFrom: z.string()
|
|
910
|
+
})]);
|
|
911
|
+
function parseTemplatePullRequestConfig(input) {
|
|
912
|
+
return az.with(templatePullRequestSchema).parse(input);
|
|
913
|
+
}
|
|
914
|
+
//#endregion
|
|
915
|
+
//#region src/configs/helpers/defineAlexCLineConfig.ts
|
|
916
|
+
const alexCLineConfigSchema = z.strictObject({
|
|
917
|
+
preCommit: preCommitConfigSchema,
|
|
918
|
+
template: z.object({ pullRequest: templatePullRequestSchema })
|
|
919
|
+
}).partial();
|
|
920
|
+
async function parseAlexCLineConfig(input) {
|
|
921
|
+
return await az.with(alexCLineConfigSchema).parseAsync(input);
|
|
922
|
+
}
|
|
923
|
+
//#endregion
|
|
924
924
|
//#region src/utility/configs/loadAlexCLineConfig.ts
|
|
925
925
|
const require = createRequire(import.meta.url);
|
|
926
926
|
async function loadAlexCLineConfig(filePath) {
|
|
@@ -934,7 +934,7 @@ async function loadAlexCLineConfig(filePath) {
|
|
|
934
934
|
//#endregion
|
|
935
935
|
//#region src/cli/commands/root/pre-commit/pre-commit.ts
|
|
936
936
|
function preCommit(program) {
|
|
937
|
-
program.command("pre-commit").description("Run the pre-commit scripts specified in the alex-c-line config (v2 experiment).").option("--allow-no-staged-changes", "Run even if nothing is staged").option("--no-update-index"
|
|
937
|
+
program.command("pre-commit").description("Run the pre-commit scripts specified in the alex-c-line config (v2 experiment).").option("--allow-no-staged-changes", "Run even if nothing is staged").option("--no-update-index", "Update the git index after the run").action(async (options) => {
|
|
938
938
|
const configPath = await findAlexCLineConfig(process.cwd());
|
|
939
939
|
if (!configPath) throw new DataError({ configPath }, "ALEX_C_LINE_CONFIG_NOT_FOUND", "Could not find the path to the alex-c-line config file. Does it exist?");
|
|
940
940
|
const { preCommit: preCommitConfig } = await loadAlexCLineConfig(configPath);
|
|
@@ -1325,7 +1325,7 @@ function template(program) {
|
|
|
1325
1325
|
//#endregion
|
|
1326
1326
|
//#region package.json
|
|
1327
1327
|
var name = "alex-c-line";
|
|
1328
|
-
var version$1 = "2.9.
|
|
1328
|
+
var version$1 = "2.9.2";
|
|
1329
1329
|
var description = "Command-line tool with commands to streamline the developer workflow.";
|
|
1330
1330
|
//#endregion
|
|
1331
1331
|
//#region src/utility/updates/checkUpdate.ts
|
|
@@ -1413,7 +1413,7 @@ const versionFormatOptionsSchema = z.discriminatedUnion("minor", [versionFormatO
|
|
|
1413
1413
|
function versionFormat(program) {
|
|
1414
1414
|
program.command("format").description("Format the given version number based on a series of options.").argument("<version>", "The version to format", (rawVersion) => {
|
|
1415
1415
|
return new VersionNumber(rawVersion);
|
|
1416
|
-
}).option("--no-prefix", "Omit the `v` prefix from the output.").option("--
|
|
1416
|
+
}).option("--no-prefix", "Omit the `v` prefix from the output.").option("--no-minor", "Omit the minor version number from the output (will also omit the patch version)").option("--no-patch", "Omit the patch version number from the output.").action((version, options) => {
|
|
1417
1417
|
const { prefix, minor, patch } = parseZodSchemaForProgram(program, versionFormatOptionsSchema, options.minor === false ? omitProperties(options, "patch") : options);
|
|
1418
1418
|
console.info(version.format({
|
|
1419
1419
|
omitPrefix: !prefix,
|
|
@@ -1433,7 +1433,7 @@ function versionIncrement(program) {
|
|
|
1433
1433
|
- "major": Change the major version v1.2.3 → v2.0.0
|
|
1434
1434
|
- "minor": Change the minor version v1.2.3 → v1.3.0
|
|
1435
1435
|
- "patch": Change the patch version v1.2.3 → v1.2.4
|
|
1436
|
-
`, parseVersionType).option("--no-prefix", "Omit the `v` prefix from the output.").
|
|
1436
|
+
`, parseVersionType).option("--no-prefix", "Omit the `v` prefix from the output.").action((version, incrementType, { prefix }) => {
|
|
1437
1437
|
console.info(version.increment(incrementType).format({ omitPrefix: !prefix }));
|
|
1438
1438
|
});
|
|
1439
1439
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "alex-c-line",
|
|
3
|
-
"version": "2.9.
|
|
3
|
+
"version": "2.9.2",
|
|
4
4
|
"description": "Command-line tool with commands to streamline the developer workflow.",
|
|
5
5
|
"repository": {
|
|
6
6
|
"type": "git",
|
|
@@ -34,43 +34,43 @@
|
|
|
34
34
|
"templates"
|
|
35
35
|
],
|
|
36
36
|
"dependencies": {
|
|
37
|
-
"@alextheman/utility": "5.19.
|
|
38
|
-
"@inquirer/prompts": "8.5.
|
|
39
|
-
"axios": "1.
|
|
37
|
+
"@alextheman/utility": "5.19.2",
|
|
38
|
+
"@inquirer/prompts": "8.5.2",
|
|
39
|
+
"axios": "1.17.0",
|
|
40
40
|
"boxen": "8.0.1",
|
|
41
41
|
"chalk": "5.6.2",
|
|
42
|
-
"commander": "
|
|
42
|
+
"commander": "15.0.0",
|
|
43
43
|
"dotenv": "17.4.2",
|
|
44
44
|
"dotenv-stringify": "3.0.1",
|
|
45
45
|
"env-paths": "4.0.0",
|
|
46
46
|
"execa": "9.6.1",
|
|
47
47
|
"figlet": "1.11.0",
|
|
48
48
|
"gray-matter": "4.0.3",
|
|
49
|
-
"semver": "7.8.
|
|
49
|
+
"semver": "7.8.2",
|
|
50
50
|
"supports-color": "10.2.2",
|
|
51
51
|
"toml": "4.1.1",
|
|
52
52
|
"zod": "4.4.3"
|
|
53
53
|
},
|
|
54
54
|
"devDependencies": {
|
|
55
|
-
"@alextheman/eslint-plugin": "5.
|
|
56
|
-
"@commander-js/extra-typings": "
|
|
55
|
+
"@alextheman/eslint-plugin": "5.17.0",
|
|
56
|
+
"@commander-js/extra-typings": "15.0.0",
|
|
57
57
|
"@types/eslint": "9.6.1",
|
|
58
58
|
"@types/node": "25.9.1",
|
|
59
59
|
"@types/semver": "7.7.1",
|
|
60
60
|
"@types/update-notifier": "6.0.8",
|
|
61
61
|
"cross-env": "10.1.0",
|
|
62
62
|
"dotenv-cli": "11.0.0",
|
|
63
|
-
"eslint": "10.4.
|
|
63
|
+
"eslint": "10.4.1",
|
|
64
64
|
"husky": "9.1.7",
|
|
65
65
|
"markdownlint-cli2": "0.22.1",
|
|
66
66
|
"prettier": "3.8.3",
|
|
67
67
|
"tempy": "3.2.0",
|
|
68
68
|
"ts-node": "10.9.2",
|
|
69
|
-
"tsdown": "0.22.
|
|
69
|
+
"tsdown": "0.22.2",
|
|
70
70
|
"typescript": "6.0.3",
|
|
71
|
-
"typescript-eslint": "8.60.
|
|
72
|
-
"vite": "8.0.
|
|
73
|
-
"vitest": "4.1.
|
|
71
|
+
"typescript-eslint": "8.60.1",
|
|
72
|
+
"vite": "8.0.16",
|
|
73
|
+
"vitest": "4.1.8"
|
|
74
74
|
},
|
|
75
75
|
"engines": {
|
|
76
76
|
"node": ">=22.3.0"
|