adamantite 0.28.0 → 0.28.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/dist/index.js +32 -16
- package/package.json +13 -13
package/dist/index.js
CHANGED
|
@@ -1,24 +1,25 @@
|
|
|
1
1
|
// src/index.ts
|
|
2
2
|
import process5 from "node:process";
|
|
3
3
|
import { Command as Command9 } from "@effect/cli";
|
|
4
|
+
import { Runtime } from "@effect/platform";
|
|
4
5
|
import { NodeContext, NodeRuntime } from "@effect/platform-node";
|
|
5
6
|
import { Effect as Effect19, Layer as Layer3 } from "effect";
|
|
7
|
+
import * as Exit from "effect/Exit";
|
|
6
8
|
|
|
7
9
|
// src/commands/analyze.ts
|
|
8
10
|
import { Command, Options } from "@effect/cli";
|
|
9
11
|
import { Command as ShellCommand2 } from "@effect/platform";
|
|
10
12
|
import { Effect as Effect4 } from "effect";
|
|
11
13
|
|
|
12
|
-
// src/helpers/packages/knip.ts
|
|
13
|
-
import { FileSystem as FileSystem2, Path as Path2 } from "@effect/platform";
|
|
14
|
-
import { Effect as Effect3 } from "effect";
|
|
15
|
-
|
|
16
14
|
// src/errors.ts
|
|
17
15
|
import { Data } from "effect";
|
|
18
16
|
|
|
19
17
|
class CliNotFound extends Data.TaggedError("CliNotFound") {
|
|
20
18
|
}
|
|
21
19
|
|
|
20
|
+
class CommandFailed extends Data.TaggedError("CommandFailed") {
|
|
21
|
+
}
|
|
22
|
+
|
|
22
23
|
class FailedToCreateDirectory extends Data.TaggedError("FailedToCreateDirectory") {
|
|
23
24
|
}
|
|
24
25
|
|
|
@@ -60,6 +61,10 @@ class UnknownScript extends Data.TaggedError("UnknownScript") {
|
|
|
60
61
|
|
|
61
62
|
class VscodeCliNotFound extends Data.TaggedError("VscodeCliNotFound") {
|
|
62
63
|
}
|
|
64
|
+
|
|
65
|
+
// src/helpers/packages/knip.ts
|
|
66
|
+
import { FileSystem as FileSystem2, Path as Path2 } from "@effect/platform";
|
|
67
|
+
import { Effect as Effect3 } from "effect";
|
|
63
68
|
// presets/knip.json
|
|
64
69
|
var knip_default = {
|
|
65
70
|
$schema: "https://unpkg.com/knip@5/schema.json",
|
|
@@ -216,7 +221,7 @@ var knip = {
|
|
|
216
221
|
yield* fs.writeFileString(configPath, `${JSON.stringify(mergedConfig, null, 2)}
|
|
217
222
|
`).pipe(Effect3.mapError((cause) => new FailedToWriteFile({ cause, path: configPath })));
|
|
218
223
|
}),
|
|
219
|
-
version: "5.
|
|
224
|
+
version: "5.83.1"
|
|
220
225
|
};
|
|
221
226
|
|
|
222
227
|
// src/commands/analyze.ts
|
|
@@ -230,7 +235,7 @@ var analyze_default = Command.make("analyze", { fix, strict }).pipe(Command.with
|
|
|
230
235
|
if (strict2) {
|
|
231
236
|
args.push("--production", "--strict");
|
|
232
237
|
}
|
|
233
|
-
return yield* ShellCommand2.make(knip.name, ...args).pipe(ShellCommand2.stdout("inherit"), ShellCommand2.stderr("inherit"), ShellCommand2.exitCode);
|
|
238
|
+
return yield* ShellCommand2.make(knip.name, ...args).pipe(ShellCommand2.stdout("inherit"), ShellCommand2.stderr("inherit"), ShellCommand2.exitCode, Effect4.filterOrFail((exitCode) => exitCode === 0, (exitCode) => new CommandFailed({ command: knip.name, exitCode })), Effect4.asVoid);
|
|
234
239
|
})));
|
|
235
240
|
|
|
236
241
|
// src/commands/check.ts
|
|
@@ -295,11 +300,11 @@ var oxlint = {
|
|
|
295
300
|
yield* fs.writeFileString(configPath, `${JSON.stringify(mergedConfig, null, 2)}
|
|
296
301
|
`).pipe(Effect5.mapError((cause) => new FailedToWriteFile({ cause, path: configPath })));
|
|
297
302
|
}),
|
|
298
|
-
version: "1.
|
|
303
|
+
version: "1.43.0"
|
|
299
304
|
};
|
|
300
305
|
var tsgolint = {
|
|
301
306
|
name: "oxlint-tsgolint",
|
|
302
|
-
version: "0.11.
|
|
307
|
+
version: "0.11.5"
|
|
303
308
|
};
|
|
304
309
|
|
|
305
310
|
// src/commands/check.ts
|
|
@@ -309,7 +314,7 @@ var check_default = Command2.make("check", { files }).pipe(Command2.withDescript
|
|
|
309
314
|
if (Option.isSome(files2)) {
|
|
310
315
|
args.push(...files2.value);
|
|
311
316
|
}
|
|
312
|
-
return yield* ShellCommand3.make(oxlint.name, ...args).pipe(ShellCommand3.stdout("inherit"), ShellCommand3.stderr("inherit"), ShellCommand3.exitCode);
|
|
317
|
+
return yield* ShellCommand3.make(oxlint.name, ...args).pipe(ShellCommand3.stdout("inherit"), ShellCommand3.stderr("inherit"), ShellCommand3.exitCode, Effect6.filterOrFail((exitCode) => exitCode === 0, (exitCode) => new CommandFailed({ command: oxlint.name, exitCode })), Effect6.asVoid);
|
|
313
318
|
})));
|
|
314
319
|
|
|
315
320
|
// src/commands/fix.ts
|
|
@@ -333,7 +338,7 @@ var fix_default = Command3.make("fix", { all, dangerous, files: files2, suggeste
|
|
|
333
338
|
args.add(file);
|
|
334
339
|
}
|
|
335
340
|
}
|
|
336
|
-
return yield* ShellCommand4.make(oxlint.name, ...args).pipe(ShellCommand4.stdout("inherit"), ShellCommand4.stderr("inherit"), ShellCommand4.exitCode);
|
|
341
|
+
return yield* ShellCommand4.make(oxlint.name, ...args).pipe(ShellCommand4.stdout("inherit"), ShellCommand4.stderr("inherit"), ShellCommand4.exitCode, Effect7.filterOrFail((exitCode) => exitCode === 0, (exitCode) => new CommandFailed({ command: oxlint.name, exitCode })), Effect7.asVoid);
|
|
337
342
|
})));
|
|
338
343
|
|
|
339
344
|
// src/commands/format.ts
|
|
@@ -436,7 +441,7 @@ var oxfmt = {
|
|
|
436
441
|
yield* fs.writeFileString(configPath, `${JSON.stringify(mergedConfig, null, 2)}
|
|
437
442
|
`).pipe(Effect8.mapError((cause) => new FailedToWriteFile({ cause, path: configPath })));
|
|
438
443
|
}),
|
|
439
|
-
version: "0.
|
|
444
|
+
version: "0.28.0"
|
|
440
445
|
};
|
|
441
446
|
|
|
442
447
|
// src/commands/format.ts
|
|
@@ -450,7 +455,7 @@ var format_default2 = Command4.make("format", { check, files: files3 }).pipe(Com
|
|
|
450
455
|
if (Option3.isSome(files4)) {
|
|
451
456
|
args.push(...files4.value);
|
|
452
457
|
}
|
|
453
|
-
return yield* ShellCommand5.make(oxfmt.name, ...args).pipe(ShellCommand5.stdout("inherit"), ShellCommand5.stderr("inherit"), ShellCommand5.exitCode);
|
|
458
|
+
return yield* ShellCommand5.make(oxfmt.name, ...args).pipe(ShellCommand5.stdout("inherit"), ShellCommand5.stderr("inherit"), ShellCommand5.exitCode, Effect9.filterOrFail((exitCode) => exitCode === 0, (exitCode) => new CommandFailed({ command: oxfmt.name, exitCode })), Effect9.asVoid);
|
|
454
459
|
})));
|
|
455
460
|
|
|
456
461
|
// src/commands/init.ts
|
|
@@ -1274,7 +1279,7 @@ var monorepo_default = Command6.make("monorepo", { fix: fix2 }).pipe(Command6.wi
|
|
|
1274
1279
|
if (fix3) {
|
|
1275
1280
|
args.push("--fix");
|
|
1276
1281
|
}
|
|
1277
|
-
return yield* ShellCommand7.make(sherif.name, ...args).pipe(ShellCommand7.stdin("inherit"), ShellCommand7.stdout("inherit"), ShellCommand7.stderr("inherit"), ShellCommand7.exitCode);
|
|
1282
|
+
return yield* ShellCommand7.make(sherif.name, ...args).pipe(ShellCommand7.stdin("inherit"), ShellCommand7.stdout("inherit"), ShellCommand7.stderr("inherit"), ShellCommand7.exitCode, Effect16.filterOrFail((exitCode) => exitCode === 0, (exitCode) => new CommandFailed({ command: sherif.name, exitCode })), Effect16.asVoid);
|
|
1278
1283
|
})));
|
|
1279
1284
|
|
|
1280
1285
|
// src/commands/typecheck.ts
|
|
@@ -1293,7 +1298,7 @@ var typecheck_default = Command7.make("typecheck", { project, watch }).pipe(Comm
|
|
|
1293
1298
|
if (watch2) {
|
|
1294
1299
|
args.push("--watch");
|
|
1295
1300
|
}
|
|
1296
|
-
return yield* ShellCommand8.make(typescript.command, ...args).pipe(ShellCommand8.workingDirectory(currentDir), ShellCommand8.stdout("inherit"), ShellCommand8.stderr("inherit"), ShellCommand8.exitCode);
|
|
1301
|
+
return yield* ShellCommand8.make(typescript.command, ...args).pipe(ShellCommand8.workingDirectory(currentDir), ShellCommand8.stdout("inherit"), ShellCommand8.stderr("inherit"), ShellCommand8.exitCode, Effect17.filterOrFail((exitCode) => exitCode === 0, (exitCode) => new CommandFailed({ command: typescript.command, exitCode })), Effect17.asVoid);
|
|
1297
1302
|
})));
|
|
1298
1303
|
|
|
1299
1304
|
// src/commands/update.ts
|
|
@@ -1372,6 +1377,17 @@ var update_default = Command8.make("update").pipe(Command8.withDescription("Upda
|
|
|
1372
1377
|
|
|
1373
1378
|
// src/index.ts
|
|
1374
1379
|
var main = Command9.make("adamantite").pipe(Command9.withDescription("Opinionated preset package for modern TypeScript applications"), Command9.withSubcommands([analyze_default, check_default, fix_default, format_default2, init_default, monorepo_default, typecheck_default, update_default]));
|
|
1375
|
-
var version = await "0.28.
|
|
1380
|
+
var version = await "0.28.1";
|
|
1376
1381
|
var program = Command9.run(main, { name: "adamantite", version });
|
|
1377
|
-
|
|
1382
|
+
var teardown = (exit, onExit) => {
|
|
1383
|
+
if (Exit.isSuccess(exit)) {
|
|
1384
|
+
const value = exit.value;
|
|
1385
|
+
if (typeof value === "number" && Number.isInteger(value) && value >= 0 && value <= 255) {
|
|
1386
|
+
onExit(value);
|
|
1387
|
+
return;
|
|
1388
|
+
}
|
|
1389
|
+
}
|
|
1390
|
+
Runtime.defaultTeardown(exit, onExit);
|
|
1391
|
+
};
|
|
1392
|
+
var exitCode = program(process5.argv).pipe(Effect19.as(0), Effect19.catchTag("CommandFailed", (error) => Effect19.succeed(error.exitCode)), Effect19.tapErrorCause((cause) => Effect19.logError(cause)), Effect19.catchAll(() => Effect19.succeed(1)));
|
|
1393
|
+
exitCode.pipe(Effect19.provide(Layer3.mergeAll(NodeContext.layer, PrompterLive, CwdLive)), NodeRuntime.runMain({ teardown }));
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "adamantite",
|
|
3
|
-
"version": "0.28.
|
|
3
|
+
"version": "0.28.1",
|
|
4
4
|
"description": "An strict and opinionated set of presets for modern TypeScript applications",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"adamantite",
|
|
@@ -59,25 +59,25 @@
|
|
|
59
59
|
"version": "changeset version"
|
|
60
60
|
},
|
|
61
61
|
"dependencies": {
|
|
62
|
-
"@clack/prompts": "1.0.0
|
|
63
|
-
"@effect/cli": "0.73.
|
|
64
|
-
"@effect/platform": "0.94.
|
|
62
|
+
"@clack/prompts": "1.0.0",
|
|
63
|
+
"@effect/cli": "0.73.2",
|
|
64
|
+
"@effect/platform": "0.94.4",
|
|
65
65
|
"@effect/platform-node": "0.104.1",
|
|
66
66
|
"defu": "6.1.4",
|
|
67
|
-
"effect": "3.19.
|
|
67
|
+
"effect": "3.19.16",
|
|
68
68
|
"jsonc-parser": "3.3.1",
|
|
69
|
-
"nypm": "0.6.
|
|
69
|
+
"nypm": "0.6.5"
|
|
70
70
|
},
|
|
71
71
|
"devDependencies": {
|
|
72
72
|
"@changesets/cli": "2.29.8",
|
|
73
|
-
"@types/bun": "1.3.
|
|
74
|
-
"bunup": "0.16.
|
|
75
|
-
"knip": "5.
|
|
76
|
-
"oxfmt": "0.
|
|
77
|
-
"oxlint": "1.
|
|
78
|
-
"oxlint-tsgolint": "0.11.
|
|
73
|
+
"@types/bun": "1.3.8",
|
|
74
|
+
"bunup": "0.16.25",
|
|
75
|
+
"knip": "5.83.1",
|
|
76
|
+
"oxfmt": "0.28.0",
|
|
77
|
+
"oxlint": "1.43.0",
|
|
78
|
+
"oxlint-tsgolint": "0.11.5",
|
|
79
79
|
"sherif": "1.10.0",
|
|
80
|
-
"type-fest": "5.4.
|
|
80
|
+
"type-fest": "5.4.4",
|
|
81
81
|
"typescript": "5.9.3"
|
|
82
82
|
},
|
|
83
83
|
"engines": {
|