adamantite 0.1.0 β†’ 0.2.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 CHANGED
@@ -1,9 +1,9 @@
1
1
  <p align="center">
2
- <h1 align="center">β–ΆπŸ’  <code>adamantite</code></h1>
2
+ <h1 align="center">πŸ’  <code>adamantite</code></h1>
3
3
 
4
4
  <p align="center">
5
- <em><strong>Ship faster, with confidence.</strong></em>
5
+ <em><strong>Bulletproof your code.</strong></em>
6
6
  </p>
7
7
  </p>
8
8
 
9
- An opinionated set of presets for linting, formatting and type-safety. Built for modern TypeScript applications and AI-ready.
9
+ Opinionated linting, formatting, and type-safety presets for modern TypeScript applications. Designed for humans and AI.
package/biome.jsonc CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "$schema": "https://biomejs.dev/schemas/2.1.2/schema.json",
3
3
 
4
- // ----------------------------- FORMATTER -----------------------------
4
+ // ---------------------------- FORMATTER -----------------------------
5
5
  // These are the generic settings that apply to all files in the project.
6
6
  "formatter": {
7
7
  "enabled": true,
@@ -20,7 +20,7 @@
20
20
  "bracketSpacing": true
21
21
  },
22
22
 
23
- // ----------------------------- ASSIST -----------------------------
23
+ // ------------------------------ ASSIST ------------------------------
24
24
  // Help with code organization.
25
25
  "assist": {
26
26
  "actions": {
@@ -42,7 +42,7 @@
42
42
  }
43
43
  },
44
44
 
45
- // ----------------------------- LINTER -----------------------------
45
+ // ------------------------------ LINTER ------------------------------
46
46
 
47
47
  "linter": {
48
48
  "enabled": true,
@@ -102,8 +102,7 @@
102
102
  "useWhile": "error"
103
103
  },
104
104
  "correctness": {
105
- // --------- JavaScript ---------
106
-
105
+ // ----------------------- JavaScript ------------------------
107
106
  "noChildrenProp": "error",
108
107
  "noConstantCondition": "error",
109
108
  "noConstantMathMinMaxClamp": "error",
@@ -147,7 +146,7 @@
147
146
  "useValidTypeof": "error",
148
147
  "useYield": "error",
149
148
 
150
- // --------- CSS ---------
149
+ // --------------------------- CSS ---------------------------
151
150
  "noInvalidDirectionInLinearGradient": "error",
152
151
  "noInvalidGridAreas": "error",
153
152
  "noInvalidPositionAtImportRule": "error",
@@ -162,8 +161,7 @@
162
161
  "noUnmatchableAnbSelector": "error"
163
162
  },
164
163
  "nursery": {
165
- // --------- JavaScript ---------
166
-
164
+ // ----------------------- JavaScript ------------------------
167
165
  "noAwaitInLoop": "error",
168
166
  "noBitwiseOperators": "error",
169
167
  "noConstantBinaryExpression": "error",
@@ -212,13 +210,13 @@
212
210
  "noImportCycles": "off",
213
211
  "noUnresolvedImports": "off",
214
212
 
215
- // --------- CSS ---------
213
+ // --------------------------- CSS ---------------------------
216
214
  "noImportantStyles": "error",
217
215
  // Disabling this rule since we need custom at-rules for Tailwind
218
216
  "noUnknownAtRule": "off"
219
217
  },
220
218
  "performance": {
221
- // --------- JavaScript ---------
219
+ // ----------------------- JavaScript ------------------------
222
220
 
223
221
  "noAccumulatingSpread": "error",
224
222
  "noBarrelFile": "off",
@@ -230,15 +228,14 @@
230
228
  "useTopLevelRegex": "error"
231
229
  },
232
230
  "security": {
233
- // --------- JavaScript ---------
234
-
231
+ // ----------------------- JavaScript ------------------------
235
232
  "noBlankTarget": "error",
236
233
  "noDangerouslySetInnerHtml": "error",
237
234
  "noDangerouslySetInnerHtmlWithChildren": "error",
238
235
  "noGlobalEval": "error"
239
236
  },
240
237
  "style": {
241
- // --------- JavaScript ---------
238
+ // ----------------------- JavaScript ------------------------
242
239
  "noCommonJs": "off",
243
240
  "noDefaultExport": "off",
244
241
  "noDoneCallback": "error",
@@ -305,7 +302,7 @@
305
302
  "useThrowOnlyError": "error",
306
303
  "useTrimStartEnd": "error",
307
304
 
308
- // --------- CSS ---------
305
+ // --------------------------- CSS ---------------------------
309
306
  "noDescendingSpecificity": "error",
310
307
  "noValueAtRule": "error"
311
308
  },
@@ -384,7 +381,7 @@
384
381
  "useNumberToFixedDigitsArgument": "error",
385
382
  "useStrictMode": "error",
386
383
 
387
- // --------- CSS ---------
384
+ // --------------------------- CSS ---------------------------
388
385
  "noDuplicateAtImportRules": "error",
389
386
  "noDuplicateCustomProperties": "error",
390
387
  "noDuplicateFontNames": "error",
@@ -396,7 +393,7 @@
396
393
  }
397
394
  }
398
395
  },
399
- // ------------------------------ JAVASCRIPT ------------------------------
396
+ // ---------------------------- JAVASCRIPT ----------------------------
400
397
  // Options for JavaScript and TypeScript files.
401
398
  "javascript": {
402
399
  "formatter": {
@@ -415,7 +412,7 @@
415
412
  "trailingCommas": "es5"
416
413
  }
417
414
  },
418
- // --------------------------------- CSS -------------------------------
415
+ // ------------------------------- CSS -------------------------------
419
416
  "css": {
420
417
  "formatter": {
421
418
  "quoteStyle": "double"
@@ -425,7 +422,7 @@
425
422
  "cssModules": false
426
423
  }
427
424
  },
428
- // ------------------------------- JSON ------------------------------
425
+ // ------------------------------ JSON -------------------------------
429
426
  "json": {
430
427
  "assist": {
431
428
  "enabled": true
package/dist/index.js CHANGED
@@ -1,5 +1,5 @@
1
1
  #!/usr/bin/env node
2
- import{Command as e}from"commander";import t from"process";import{execSync as n}from"child_process";import{access as r,readFile as i,writeFile as a}from"fs/promises";import{join as o}from"path";import{confirm as s,intro as c,isCancel as l,log as u,outro as d,select as f,spinner as p}from"@clack/prompts";import m from"defu";import{parse as h}from"jsonc-parser";import{readFileSync as g}from"fs";const _=`2.1.2`;let v=null,y=null;function b(e,t=[],r={}){let i=`${e} ${t.join(` `)}`;n(i,{...r,stdio:`inherit`})}async function x(e){try{return await r(e),!0}catch{return!1}}async function S(e=process.cwd()){let t=o(e,`package.json`);if(v&&y===t)return v;if(!await x(t))throw Error(`package.json not found in the current directory`);try{let e=await i(t,`utf-8`),n=JSON.parse(e);return v=n,y=t,n}catch(e){throw Error(`Failed to parse package.json: ${e instanceof Error?e.message:`Unknown error`}`)}}async function C(e,t=process.cwd()){let n=o(t,`package.json`);try{await a(n,JSON.stringify(e,null,2)),y===n&&(v=e)}catch(e){throw Error(`Failed to write package.json: ${e instanceof Error?e.message:`Unknown error`}`)}}async function w(e,t=process.cwd()){try{let n=await S(t);return n.dependencies?.[e]||n.devDependencies?.[e]||null}catch{return null}}async function T(e,t,n=process.cwd()){let r=await w(e,n);return r===t}function E(e,t){switch(e){case`npm`:b(`npm`,[`install`,`--save-dev`,t]);break;case`yarn`:b(`yarn`,[`add`,`--dev`,t]);break;case`pnpm`:b(`pnpm`,[`add`,`--save-dev`,t]);break;case`bun`:b(`bun`,[`add`,`--dev`,t]);break;default:throw Error(`Invalid package manager: ${e}`)}}function D(e,n){try{let t=[`@biomejs/biome`,`check`,`--write`];n.unsafe&&t.push(`--unsafe`),e.length>0&&t.push(...e),b(`npx`,t)}catch(e){let n=e instanceof Error?e.message:`An unknown error occurred`;console.error(`Failed to run Adamantite:`,n),t.exit(1)}}const O=[`npm`,`yarn`,`pnpm`,`bun`];async function k(){let e=process.cwd(),t=await x(o(e,`package-lock.json`));if(t)return`npm`;let n=await x(o(e,`yarn.lock`));if(n)return`yarn`;let r=await x(o(e,`pnpm-lock.yaml`));if(r)return`pnpm`;let i=await x(o(e,`bun.lockb`))||await x(o(e,`bun.lock`));return i?`bun`:null}const A={config:{extends:`adamantite/presets/tsconfig.json`},async exists(){return await x(o(process.cwd(),`tsconfig.json`))},async create(){await a(o(process.cwd(),`tsconfig.json`),JSON.stringify(this.config,null,2))},async update(){let e=await i(o(process.cwd(),`tsconfig.json`),`utf-8`),t=h(e),n=m(t,this.config);await a(o(process.cwd(),`tsconfig.json`),JSON.stringify(n,null,2))}},j={config:{$schema:`./node_modules/@biomejs/biome/configuration_schema.json`},async exists(){return await x(o(process.cwd(),`biome.jsonc`))},async create(){await a(o(process.cwd(),`biome.jsonc`),JSON.stringify({...this.config,extends:[`adamantite`]},null,2))},async update(){let e=await x(o(process.cwd(),`biome.jsonc`))?o(process.cwd(),`biome.jsonc`):o(process.cwd(),`biome.json`),t=await i(e,`utf-8`),n=h(t),r={...n};Array.isArray(r.extends)||(r.extends=r.extends?[r.extends]:[]),r.extends.includes(`adamantite`)||r.extends.push(`adamantite`);let s=m(r,this.config);await a(o(process.cwd(),`biome.jsonc`),JSON.stringify(s,null,2))},async install(e){let t=await T(`@biomejs/biome`,_);if(t)return`@biomejs/biome@${_} is already installed`;let n=await w(`@biomejs/biome`),r=n?`updated`:`installed`;return E(e,`@biomejs/biome@${_}`),`@biomejs/biome@${_} ${r} successfully`}},M=`
2
+ import{exists as e,readPackageJson as t,runProcess as n,writePackageJson as r}from"./utils-Clt8lmBo.js";import{Command as i}from"commander";import a from"process";import{readFile as o,writeFile as s}from"fs/promises";import{join as c}from"path";import{confirm as l,intro as u,isCancel as d,log as f,outro as p,select as m,spinner as h}from"@clack/prompts";import g from"defu";import{parse as _}from"jsonc-parser";import{readFileSync as v}from"fs";function y(e,t){try{let r=[`@biomejs/biome`,`check`,`--write`];t.unsafe&&r.push(`--unsafe`),e.length>0&&r.push(...e),n(`npx`,r)}catch(e){let t=e instanceof Error?e.message:`An unknown error occurred`;console.error(`Failed to run Adamantite:`,t),a.exit(1)}}const b=[`npm`,`yarn`,`pnpm`,`bun`];async function x(){let t=process.cwd(),n=await e(c(t,`package-lock.json`));if(n)return`npm`;let r=await e(c(t,`yarn.lock`));if(r)return`yarn`;let i=await e(c(t,`pnpm-lock.yaml`));if(i)return`pnpm`;let a=await e(c(t,`bun.lockb`))||await e(c(t,`bun.lock`));return a?`bun`:null}const S={config:{extends:`adamantite/presets/tsconfig.json`},async exists(){return await e(c(process.cwd(),`tsconfig.json`))},async create(){await s(c(process.cwd(),`tsconfig.json`),JSON.stringify(this.config,null,2))},async update(){let e=await o(c(process.cwd(),`tsconfig.json`),`utf-8`),t=_(e),n=g(t,this.config);await s(c(process.cwd(),`tsconfig.json`),JSON.stringify(n,null,2))}},C={config:{$schema:`./node_modules/@biomejs/biome/configuration_schema.json`},async exists(){return await e(c(process.cwd(),`biome.jsonc`))},async create(){await s(c(process.cwd(),`biome.jsonc`),JSON.stringify({...this.config,extends:[`adamantite`]},null,2))},async update(){let t=await e(c(process.cwd(),`biome.jsonc`))?c(process.cwd(),`biome.jsonc`):c(process.cwd(),`biome.json`),n=await o(t,`utf-8`),r=_(n),i={...r};Array.isArray(i.extends)||(i.extends=i.extends?[i.extends]:[]),i.extends.includes(`adamantite`)||i.extends.push(`adamantite`);let a=g(i,this.config);await s(c(process.cwd(),`biome.jsonc`),JSON.stringify(a,null,2))}},w=`
3
3
  β–ˆβ–ˆβ–ˆβ–ˆβ–ˆ β–ˆβ–ˆβ–ˆβ–ˆβ–ˆ β–ˆβ–ˆβ–ˆ β–ˆβ–ˆβ–ˆβ–ˆβ–ˆ
4
4
  β–‘β–‘β–ˆβ–ˆβ–ˆ β–‘β–‘β–ˆβ–ˆβ–ˆ β–‘β–‘β–‘ β–‘β–‘β–ˆβ–ˆβ–ˆ
5
5
  β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆ β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆ β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆ β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆ β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆ β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆ β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆ β–ˆβ–ˆβ–ˆβ–ˆ β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆ β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆ
@@ -8,4 +8,4 @@ import{Command as e}from"commander";import t from"process";import{execSync as n}
8
8
  β–ˆβ–ˆβ–ˆβ–‘β–‘β–ˆβ–ˆβ–ˆ β–‘β–ˆβ–ˆβ–ˆ β–‘β–ˆβ–ˆβ–ˆ β–ˆβ–ˆβ–ˆβ–‘β–‘β–ˆβ–ˆβ–ˆ β–‘β–ˆβ–ˆβ–ˆ β–‘β–ˆβ–ˆβ–ˆ β–‘β–ˆβ–ˆβ–ˆ β–ˆβ–ˆβ–ˆβ–‘β–‘β–ˆβ–ˆβ–ˆ β–‘β–ˆβ–ˆβ–ˆ β–‘β–ˆβ–ˆβ–ˆ β–‘β–ˆβ–ˆβ–ˆ β–ˆβ–ˆβ–ˆ β–‘β–ˆβ–ˆβ–ˆ β–‘β–ˆβ–ˆβ–ˆ β–ˆβ–ˆβ–ˆβ–‘β–ˆβ–ˆβ–ˆβ–‘β–‘β–‘
9
9
  β–‘β–‘β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–‘β–‘β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–‘β–‘β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆ β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–‘β–ˆβ–ˆβ–ˆ β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–‘β–‘β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆ β–ˆβ–ˆβ–ˆβ–ˆ β–ˆβ–ˆβ–ˆβ–ˆβ–ˆ β–‘β–‘β–ˆβ–ˆβ–ˆβ–ˆβ–ˆ β–ˆβ–ˆβ–ˆβ–ˆβ–ˆ β–‘β–‘β–ˆβ–ˆβ–ˆβ–ˆβ–ˆ β–‘β–‘β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆ
10
10
  β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘ β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘ β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘ β–‘β–‘β–‘β–‘β–‘ β–‘β–‘β–‘ β–‘β–‘β–‘β–‘β–‘ β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘ β–‘β–‘β–‘β–‘ β–‘β–‘β–‘β–‘β–‘ β–‘β–‘β–‘β–‘β–‘ β–‘β–‘β–‘β–‘β–‘ β–‘β–‘β–‘β–‘β–‘ β–‘β–‘β–‘β–‘β–‘β–‘
11
- `;async function N(){let e=await f({message:`Select your package manager`,options:O.map(e=>({label:e,value:e})),initialValue:await k()});if(l(e)||e===null)throw Error(`No package manager selected`);if(e===void 0)throw Error(`Invalid package manager selected`);return e}async function P(){let e=t.cwd();if(await x(o(e,`pnpm-workspace.yaml`)))return!0;try{let e=await S();return e.workspaces!==void 0}catch{return!1}}async function F(){let e=p();await j.exists()?(e.start(`Biome config found, updating...`),await j.update(),e.stop(`Biome config updated with Adamantite preset`)):(e.start(`Biome config not found, creating...`),await j.create(),e.stop(`Biome config created with Adamantite preset`))}async function I({lint:e,format:t}){let n=p();n.start("Adding scripts to your `package.json`...");try{let r=await S();r.scripts||={},e&&(r.scripts.lint=`adamantite lint`),t&&(r.scripts.format=`adamantite format`),await C(r),n.stop("Scripts added to your `package.json`")}catch(e){throw n.stop(`Failed to add scripts`),Error(`Failed to modify package.json: ${e instanceof Error?e.message:`Unknown error`}`)}}async function L(){let e=p();await A.exists()?(e.start("`tsconfig.json` found, updating..."),await A.update(),e.stop("Updated `tsconfig.json` with preset")):(e.start("`tsconfig.json` not found, creating..."),await A.create(),e.stop("Created `tsconfig.json` with preset"))}async function R(e){let t=await s({message:e});if(l(t))throw Error(`Operation cancelled`);return t}async function z(e){let t=p();t.start(`Checking and installing dependencies...`);try{let n=await j.install(e);t.stop(n)}catch(n){if(t.stop(`Failed to install dependencies`),n instanceof Error){if(n.message.includes(`EACCES`)||n.message.includes(`permission`))throw Error(`Failed to install dependencies: Permission denied. Try running with elevated permissions or check file permissions.`);if(n.message.includes(`ENOTFOUND`)||n.message.includes(`network`))throw Error(`Failed to install dependencies: Network error. Check your internet connection and try again.`);if(n.message.includes(`Invalid package manager`))throw Error(`Failed to install dependencies: Unsupported package manager: ${e}. Please use npm, yarn, pnpm, or bun.`)}throw Error(`Failed to install dependencies: ${n instanceof Error?n.message:`Unknown error`}`)}}async function B(){c(M);try{let e=await N(),t=await P(),n=await R("Do you want to add the `format` and `lint` scripts to your `package.json`?"),r=t?await R(`We've detected a monorepo setup in your project. Would you like to install monorepo linting scripts?`):!1,i=await R(`Adamantite provides a TypeScript preset to enforce strict type-safety. Would you like to install it?`);await z(e),await F(),(n||r)&&await I({lint:n,format:n,monorepoLinting:r}),i&&await L(),d(`πŸ’  Adamantite initialized successfully!`)}catch(e){u.error(`${e instanceof Error?e.message:`Unknown error`}`),d(`Failed to initialize Adamantite`)}}function V(e){try{let t=[`@biomejs/biome`,`lint`,`--fix`];e.length>0&&t.push(...e),b(`npx`,t)}catch(e){let n=e instanceof Error?e.message:`An unknown error occurred`;console.error(`Failed to run Adamantite:`,n),t.exit(1)}}function H(){let e=JSON.parse(g(o(process.cwd(),`package.json`),`utf-8`));return e.version}const U=H();var W=U;const G=new e;G.version(W),G.name(`Adamantite`).description(`An opinionated set of presets for modern TypeScript applications.`),G.command(`init`).description(`Initialize Adamantite in the current directory`).action(B),G.command(`lint`).description(`Run Biome linter and fix files`).argument(`[files...]`,`specific files to lint (optional)`).action(V),G.command(`format`).description(`Run Biome formatter and fix files`).argument(`[files...]`,`specific files to format (optional)`).option(`--unsafe`,`apply unsafe fixes`).action(D),G.parse();
11
+ `;async function T(){let e=await m({message:`Select your package manager`,options:b.map(e=>({label:e,value:e})),initialValue:await x()});if(d(e)||e===null)throw Error(`No package manager selected`);if(e===void 0)throw Error(`Invalid package manager selected`);return e}async function E(){let n=a.cwd();if(await e(c(n,`pnpm-workspace.yaml`)))return!0;try{let e=await t();return e.workspaces!==void 0}catch{return!1}}async function D(){let e=h();await C.exists()?(e.start(`Biome config found, updating...`),await C.update(),e.stop(`Biome config updated with Adamantite preset`)):(e.start(`Biome config not found, creating...`),await C.create(),e.stop(`Biome config created with Adamantite preset`))}async function O({lint:e,format:n}){let i=h();i.start("Adding scripts to your `package.json`...");try{let a=await t();a.scripts||={},e&&(a.scripts.lint=`adamantite lint`),n&&(a.scripts.format=`adamantite format`),await r(a),i.stop("Scripts added to your `package.json`")}catch(e){throw i.stop(`Failed to add scripts`),Error(`Failed to modify package.json: ${e instanceof Error?e.message:`Unknown error`}`)}}async function k(){let e=h();await S.exists()?(e.start("`tsconfig.json` found, updating..."),await S.update(),e.stop("Updated `tsconfig.json` with preset")):(e.start("`tsconfig.json` not found, creating..."),await S.create(),e.stop("Created `tsconfig.json` with preset"))}async function A(e){let t=await l({message:e});if(d(t))throw Error(`Operation cancelled`);return t}async function j(e){let t=h();t.start(`Installing dependencies...`);try{let{runProcess:n,BIOME_VERSION:r}=await import(`./utils-YzGovySo.js`);switch(e){case`npm`:n(`npm`,[`install`,`--save-dev`,`--exact`,`adamantite`,`@biomejs/biome@${r}`]);break;case`yarn`:n(`yarn`,[`add`,`--dev`,`--exact`,`adamantite`,`@biomejs/biome@${r}`]);break;case`pnpm`:n(`pnpm`,[`add`,`--save-dev`,`--save-exact`,`adamantite`,`@biomejs/biome@${r}`]);break;case`bun`:n(`bun`,[`add`,`--dev`,`--exact`,`adamantite`,`@biomejs/biome@${r}`]);break;default:throw Error(`Invalid package manager: ${e}`)}t.stop(`Dependencies installed successfully`)}catch(n){if(t.stop(`Failed to install dependencies`),n instanceof Error){if(n.message.includes(`EACCES`)||n.message.includes(`permission`))throw Error(`Failed to install dependencies: Permission denied. Try running with elevated permissions or check file permissions.`);if(n.message.includes(`ENOTFOUND`)||n.message.includes(`network`))throw Error(`Failed to install dependencies: Network error. Check your internet connection and try again.`);if(n.message.includes(`Invalid package manager`))throw Error(`Failed to install dependencies: Unsupported package manager: ${e}. Please use npm, yarn, pnpm, or bun.`)}throw Error(`Failed to install dependencies: ${n instanceof Error?n.message:`Unknown error`}`)}}async function M(){u(w);try{let e=await T(),t=await E(),n=await A("Do you want to add the `format` and `lint` scripts to your `package.json`?"),r=t?await A(`We've detected a monorepo setup in your project. Would you like to install monorepo linting scripts?`):!1,i=await A(`Adamantite provides a TypeScript preset to enforce strict type-safety. Would you like to install it?`);await j(e),await D(),(n||r)&&await O({lint:n,format:n,monorepoLinting:r}),i&&await k(),p(`πŸ’  Adamantite initialized successfully!`)}catch(e){f.error(`${e instanceof Error?e.message:`Unknown error`}`),p(`Failed to initialize Adamantite`)}}function N(e){try{let t=[`@biomejs/biome`,`lint`,`--fix`];e.length>0&&t.push(...e),n(`npx`,t)}catch(e){let t=e instanceof Error?e.message:`An unknown error occurred`;console.error(`Failed to run Adamantite:`,t),a.exit(1)}}function P(){let e=JSON.parse(v(c(process.cwd(),`package.json`),`utf-8`));return e.version}const F=P();var I=F;const L=new i;L.version(I),L.name(`Adamantite`).description(`An opinionated set of presets for modern TypeScript applications.`),L.command(`init`).description(`Initialize Adamantite in the current directory`).action(M),L.command(`lint`).description(`Run Biome linter and fix files`).argument(`[files...]`,`specific files to lint (optional)`).action(N),L.command(`format`).description(`Run Biome formatter and fix files`).argument(`[files...]`,`specific files to format (optional)`).option(`--unsafe`,`apply unsafe fixes`).action(y),L.parse();
@@ -0,0 +1 @@
1
+ import{execSync as e}from"child_process";import{access as t,readFile as n,writeFile as r}from"fs/promises";import{join as i}from"path";const a=`2.1.2`;let o=null,s=null;function c(t,n=[],r={}){let i=`${t} ${n.join(` `)}`;e(i,{...r,stdio:`inherit`})}async function l(e){try{return await t(e),!0}catch{return!1}}async function u(e=process.cwd()){let t=i(e,`package.json`);if(o&&s===t)return o;if(!await l(t))throw Error(`package.json not found in the current directory`);try{let e=await n(t,`utf-8`),r=JSON.parse(e);return o=r,s=t,r}catch(e){throw Error(`Failed to parse package.json: ${e instanceof Error?e.message:`Unknown error`}`)}}async function d(e,t=process.cwd()){let n=i(t,`package.json`);try{await r(n,JSON.stringify(e,null,2)),s===n&&(o=e)}catch(e){throw Error(`Failed to write package.json: ${e instanceof Error?e.message:`Unknown error`}`)}}export{a as BIOME_VERSION,l as exists,u as readPackageJson,c as runProcess,d as writePackageJson};
@@ -0,0 +1 @@
1
+ import{BIOME_VERSION as e,exists as t,readPackageJson as n,runProcess as r,writePackageJson as i}from"./utils-Clt8lmBo.js";export{e as BIOME_VERSION,r as runProcess};
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "adamantite",
3
- "version": "0.1.0",
3
+ "version": "0.2.0",
4
4
  "description": "An strict and opinionated set of presets for modern TypeScript applications",
5
5
  "keywords": [
6
6
  "adamantite",
@@ -9,14 +9,13 @@
9
9
  "resolveJsonModule": true,
10
10
  "moduleDetection": "force",
11
11
 
12
- // Strictness and best practices
12
+ // Strictness and best practices. We only recommend settings that are not
13
+ // covered by linting rules.
13
14
  "strict": true,
14
15
  "noUncheckedIndexedAccess": true,
15
- "noFallthroughCasesInSwitch": true,
16
16
  "noImplicitOverride": true,
17
17
  "forceConsistentCasingInFileNames": true,
18
- "noUnusedParameters": true,
19
- "noPropertyAccessFromIndexSignature": true,
18
+ "noImplicitAny": true,
20
19
  "noImplicitThis": true,
21
20
  "noImplicitReturns": true
22
21
  }