adamantite 0.15.0 → 0.16.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/README.md +1 -1
- package/dist/index.js +17 -11
- package/package.json +2 -2
package/README.md
CHANGED
|
@@ -72,7 +72,7 @@ npm install --save-dev adamantite @biomejs/biome
|
|
|
72
72
|
echo '{ "extends": ["adamantite"] }' > biome.jsonc
|
|
73
73
|
|
|
74
74
|
# Extend TypeScript configuration
|
|
75
|
-
echo '{ "extends": "adamantite/
|
|
75
|
+
echo '{ "extends": "adamantite/typescript" }' > tsconfig.json
|
|
76
76
|
```
|
|
77
77
|
|
|
78
78
|
## 📋 Commands
|
package/dist/index.js
CHANGED
|
@@ -418,7 +418,7 @@ import { join as join5 } from "node:path";
|
|
|
418
418
|
import { Fault as Fault9 } from "faultier";
|
|
419
419
|
import { fromPromise as fromPromise5, ok as ok9, safeTry as safeTry9 } from "neverthrow";
|
|
420
420
|
var tsconfig = {
|
|
421
|
-
config: { extends: "adamantite/
|
|
421
|
+
config: { extends: "adamantite/typescript" },
|
|
422
422
|
exists: () => checkIfExists(join5(process.cwd(), "tsconfig.json")),
|
|
423
423
|
create: () => fromPromise5(writeFile4(join5(process.cwd(), "tsconfig.json"), JSON.stringify(tsconfig.config, null, 2)), (error) => Fault9.wrap(error).withTag("FAILED_TO_WRITE_FILE").withDescription("Failed to write tsconfig.json", "We're unable to write the tsconfig.json file in the current directory.")),
|
|
424
424
|
update: () => safeTry9(async function* () {
|
|
@@ -490,6 +490,9 @@ var addScripts = (scripts) => safeTry10(async function* () {
|
|
|
490
490
|
case "format":
|
|
491
491
|
packageJson.scripts.format = "adamantite format";
|
|
492
492
|
break;
|
|
493
|
+
case "typecheck":
|
|
494
|
+
packageJson.scripts.typecheck = "tsc --noEmit";
|
|
495
|
+
break;
|
|
493
496
|
case "check:monorepo":
|
|
494
497
|
packageJson.scripts["check:monorepo"] = "adamantite monorepo";
|
|
495
498
|
break;
|
|
@@ -566,6 +569,11 @@ var init_default = defineCommand({
|
|
|
566
569
|
value: "format",
|
|
567
570
|
hint: "recommended"
|
|
568
571
|
},
|
|
572
|
+
{
|
|
573
|
+
label: "typecheck - type-check your code using strict TypeScript preset",
|
|
574
|
+
value: "typecheck",
|
|
575
|
+
hint: "extends the `adamantite/typescript` preset in your `tsconfig.json`"
|
|
576
|
+
},
|
|
569
577
|
{
|
|
570
578
|
label: "check:monorepo - check for monorepo-specific issues using Sherif",
|
|
571
579
|
value: "check:monorepo",
|
|
@@ -583,12 +591,6 @@ var init_default = defineCommand({
|
|
|
583
591
|
if (p.isCancel(scripts)) {
|
|
584
592
|
return err4(Fault10.create("OPERATION_CANCELLED"));
|
|
585
593
|
}
|
|
586
|
-
const typescriptPreset = yield* fromSafePromise(p.confirm({
|
|
587
|
-
message: "Adamantite provides a TypeScript preset to enforce strict type-safety. Would you like to install it?"
|
|
588
|
-
}));
|
|
589
|
-
if (p.isCancel(typescriptPreset)) {
|
|
590
|
-
return err4(Fault10.create("OPERATION_CANCELLED"));
|
|
591
|
-
}
|
|
592
594
|
const editors = yield* fromSafePromise(p.multiselect({
|
|
593
595
|
message: "Which editors do you want to configure? (optional)",
|
|
594
596
|
options: [
|
|
@@ -603,6 +605,7 @@ var init_default = defineCommand({
|
|
|
603
605
|
const hasBiome = scripts.includes("check") || scripts.includes("fix");
|
|
604
606
|
const hasOxfmt = scripts.includes("format");
|
|
605
607
|
const hasSherif = scripts.includes("check:monorepo") || scripts.includes("fix:monorepo");
|
|
608
|
+
const hasTypecheck = scripts.includes("typecheck");
|
|
606
609
|
const dependencies = ["adamantite"];
|
|
607
610
|
if (hasBiome) {
|
|
608
611
|
dependencies.push(`${biome.name}@${biome.version}`);
|
|
@@ -613,6 +616,9 @@ var init_default = defineCommand({
|
|
|
613
616
|
if (hasSherif) {
|
|
614
617
|
dependencies.push(`${sherif.name}@${sherif.version}`);
|
|
615
618
|
}
|
|
619
|
+
if (hasTypecheck) {
|
|
620
|
+
dependencies.push("typescript");
|
|
621
|
+
}
|
|
616
622
|
yield* installDependencies(dependencies);
|
|
617
623
|
if (hasOxfmt) {
|
|
618
624
|
yield* setupOxfmtConfig();
|
|
@@ -621,7 +627,7 @@ var init_default = defineCommand({
|
|
|
621
627
|
yield* setupBiomeConfig();
|
|
622
628
|
}
|
|
623
629
|
yield* addScripts(scripts);
|
|
624
|
-
if (
|
|
630
|
+
if (hasTypecheck) {
|
|
625
631
|
yield* setupTypescript();
|
|
626
632
|
}
|
|
627
633
|
yield* setupEditors(editors);
|
|
@@ -679,7 +685,7 @@ var monorepo_default = defineCommand({
|
|
|
679
685
|
|
|
680
686
|
// src/commands/update.ts
|
|
681
687
|
import process9 from "node:process";
|
|
682
|
-
import { cancel as cancel2, confirm
|
|
688
|
+
import { cancel as cancel2, confirm, intro as intro2, isCancel as isCancel2, log as log7, outro as outro2, spinner as spinner2 } from "@clack/prompts";
|
|
683
689
|
import { Fault as Fault12 } from "faultier";
|
|
684
690
|
import { err as err5, fromPromise as fromPromise7, fromSafePromise as fromSafePromise2, ok as ok12, safeTry as safeTry12 } from "neverthrow";
|
|
685
691
|
import { addDevDependency as addDevDependency2 } from "nypm";
|
|
@@ -713,7 +719,7 @@ var update_default = defineCommand({
|
|
|
713
719
|
log7.message(` ${dep.name}: ${dep.currentVersion} → ${dep.targetVersion}`);
|
|
714
720
|
}
|
|
715
721
|
log7.message("");
|
|
716
|
-
const shouldUpdate = yield* fromSafePromise2(
|
|
722
|
+
const shouldUpdate = yield* fromSafePromise2(confirm({
|
|
717
723
|
message: "Do you want to proceed with these updates?"
|
|
718
724
|
}));
|
|
719
725
|
if (isCancel2(shouldUpdate)) {
|
|
@@ -754,4 +760,4 @@ var update_default = defineCommand({
|
|
|
754
760
|
});
|
|
755
761
|
|
|
756
762
|
// src/index.ts
|
|
757
|
-
yargs(hideBin(process.argv)).scriptName("adamantite").version("0.
|
|
763
|
+
yargs(hideBin(process.argv)).scriptName("adamantite").version("0.16.0").command(check_default).command(ci_default).command(fix_default).command(format_default).command(init_default).command(monorepo_default).command(update_default).demandCommand(1).strict().help().parse();
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "adamantite",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.16.0",
|
|
4
4
|
"description": "An strict and opinionated set of presets for modern TypeScript applications",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"adamantite",
|
|
@@ -37,7 +37,7 @@
|
|
|
37
37
|
"exports": {
|
|
38
38
|
".": "./presets/biome.jsonc",
|
|
39
39
|
"./biome": "./presets/biome.jsonc",
|
|
40
|
-
"./
|
|
40
|
+
"./typescript": "./presets/tsconfig.json",
|
|
41
41
|
"./presets/*": "./presets/*"
|
|
42
42
|
},
|
|
43
43
|
"scripts": {
|