adamantite 0.7.1 → 0.8.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,212 @@
1
1
  <p align="center">
2
- <h1 align="center">💠 <code>adamantite</code></h1>
3
-
2
+ <img src="https://github.com/adelrodriguez/adamantite/raw/main/.github/assets/logo.svg" alt="Adamantite" width="120" height="120">
3
+ <h1 align="center">💠 Adamantite</h1>
4
4
  <p align="center">
5
5
  <em><strong>Bulletproof your code.</strong></em>
6
6
  </p>
7
+ <p align="center">
8
+ Opinionated linting, formatting, and type-safety presets for modern TypeScript applications.<br>
9
+ Designed for humans and AI.
10
+ </p>
7
11
  </p>
8
12
 
9
- Opinionated linting, formatting, and type-safety presets for modern TypeScript applications. Designed for humans and AI.
13
+ <p align="center">
14
+ <a href="https://www.npmjs.com/package/adamantite">
15
+ <img src="https://img.shields.io/npm/v/adamantite.svg" alt="npm version">
16
+ </a>
17
+ <a href="https://www.npmjs.com/package/adamantite">
18
+ <img src="https://img.shields.io/npm/dm/adamantite.svg" alt="npm downloads">
19
+ </a>
20
+ <a href="https://github.com/adelrodriguez/adamantite/blob/main/LICENSE">
21
+ <img src="https://img.shields.io/github/license/adelrodriguez/adamantite.svg" alt="license">
22
+ </a>
23
+ </p>
24
+
25
+ ---
26
+
27
+ ## Quick Start
28
+
29
+ Run the following command on your project to get started:
30
+
31
+ ```shell
32
+ npx adamantite init
33
+ ```
34
+
35
+ Adamantite will automatically configure your project with linting, formatting, and type-safety rules.
36
+
37
+ ## Features
38
+
39
+ - **⚡ Fast performance**: Built on Biome's Rust-based architecture for efficient linting and formatting
40
+ - **🔍 Extensive linting**: 200+ rules covering correctness, performance, security, and accessibility
41
+ - **🎯 Zero configuration**: Works out of the box with sensible defaults, no setup required
42
+ - **🔧 Single tool solution**: Replaces ESLint + Prettier + multiple config files with one unified approach
43
+ - **🛡️ Strict type safety**: Comes with a strict TypeScript preset to improve type safety across your codebase
44
+ - **🏗️ Monorepo support**: Unified configuration and dependency management across workspace packages
45
+ - **🤖 AI-friendly patterns**: Consistent code style designed for effective AI collaboration
46
+
47
+ ## Installation
48
+
49
+ ### Automatic Setup (Recommended)
50
+
51
+ ```shell
52
+ npx adamantite init
53
+ ```
54
+
55
+ This interactive command will:
56
+
57
+ - Install Adamantite and [Biome](https://biomejs.dev/) as dev dependencies
58
+ - Create `biome.jsonc` with opinionated presets
59
+ - Set up `tsconfig.json` with strict TypeScript rules
60
+ - Add lint/format scripts to your `package.json`
61
+ - Configure editor settings (VSCode/Cursor/Windsurf)
62
+ - Install [Sherif](https://github.com/QuiiBz/sherif) for monorepo support
63
+
64
+ ### Manual Setup
65
+
66
+ If you prefer manual configuration:
67
+
68
+ ```shell
69
+ # Install dependencies
70
+ npm install --save-dev adamantite @biomejs/biome
71
+
72
+ # Extend the Biome configuration
73
+ echo '{ "extends": ["adamantite"] }' > biome.jsonc
74
+
75
+ # Extend TypeScript configuration
76
+ echo '{ "extends": "adamantite/presets/tsconfig.json" }' > tsconfig.json
77
+ ```
78
+
79
+ ## 📋 Commands
80
+
81
+ Adamantite provides a comprehensive CLI for all your code quality needs:
82
+
83
+ ### `adamantite check`
84
+
85
+ Check your code for issues without automatically fixing them:
86
+
87
+ ```shell
88
+ # Check all files
89
+ adamantite check
90
+
91
+ # Check specific files
92
+ adamantite check src/components/**/*.ts
93
+
94
+ # Show summary of results
95
+ adamantite check --summary
96
+ ```
97
+
98
+ ### `adamantite fix`
99
+
100
+ Fix issues in your code with automatic formatting and safe fixes:
101
+
102
+ ```shell
103
+ # Fix all files
104
+ adamantite fix
105
+
106
+ # Fix specific files
107
+ adamantite fix src/utils.ts
108
+
109
+ # Apply unsafe fixes
110
+ adamantite fix --unsafe
111
+ ```
112
+
113
+ ### `adamantite ci`
114
+
115
+ Run in continuous integration environments:
116
+
117
+ ```shell
118
+ # Basic CI check
119
+ adamantite ci
120
+
121
+ # With GitHub reporter (for PR comments)
122
+ adamantite ci --github
123
+
124
+ # Include monorepo checks
125
+ adamantite ci --monorepo
126
+ ```
127
+
128
+ ### `adamantite monorepo`
129
+
130
+ Special tooling for monorepo projects using [Sherif](https://github.com/QuiiBz/sherif):
131
+
132
+ ```shell
133
+ # Lint and fix monorepo-specific issues
134
+ adamantite monorepo
135
+ ```
136
+
137
+ Automatically detects and fixes:
138
+
139
+ - Inconsistent dependency versions across packages
140
+ - Missing dependencies in package.json
141
+ - Unused dependencies
142
+ - Package.json formatting issues
143
+
144
+ ### `adamantite update`
145
+
146
+ Keep your dependencies current:
147
+
148
+ ```shell
149
+ # Update to latest compatible versions
150
+ adamantite update
151
+ ```
152
+
153
+ ## Presets
154
+
155
+ ### Biome Configuration ([biome.jsonc](./biome.jsonc))
156
+
157
+ Adamantite's Biome preset includes:
158
+
159
+ - **Formatting**: 2-space indentation, 80-character line width, LF line endings
160
+ - **Import Organization**: Automatic import sorting with custom groups (Bun → Node → Packages → Aliases)
161
+ - **Linting Rules**: 200+ rules covering:
162
+ - Code correctness and bug prevention
163
+ - Performance optimizations
164
+ - Security best practices
165
+ - Accessibility guidelines
166
+ - React/JSX patterns
167
+ - **File Patterns**: Pre-configured for TypeScript, JavaScript, JSON, and more
168
+
169
+ ### TypeScript Configuration ([presets/tsconfig.json](./presets/tsconfig.json))
170
+
171
+ The TypeScript preset includes strict settings for maximum type safety:
172
+
173
+ ```json
174
+ {
175
+ "compilerOptions": {
176
+ "strict": true,
177
+ "noUncheckedIndexedAccess": true,
178
+ "noImplicitOverride": true,
179
+ "forceConsistentCasingInFileNames": true,
180
+ "noImplicitReturns": true,
181
+ "verbatimModuleSyntax": true
182
+ }
183
+ }
184
+ ```
185
+
186
+ These settings catch errors at compile-time that would otherwise cause runtime failures.
187
+
188
+ ## 🛠️ Development
189
+
190
+ This project uses Bun for all development tasks:
191
+
192
+ ```shell
193
+ # Install dependencies
194
+ bun install
195
+
196
+ # Run tests
197
+ bun test
198
+
199
+ # Build CLI
200
+ bun run build
201
+
202
+ # Type checking
203
+ bun run typecheck
204
+ ```
205
+
206
+ ## 🤝 Contributing
207
+
208
+ Contributions are welcome! Please read our [contributing guidelines](CONTRIBUTING.md) first.
209
+
210
+ ## 📄 License
211
+
212
+ MIT © [Adel Rodriguez](https://github.com/adelrodriguez)
package/biome.jsonc CHANGED
@@ -1,5 +1,5 @@
1
1
  {
2
- "$schema": "https://biomejs.dev/schemas/2.2.0/schema.json",
2
+ "$schema": "https://biomejs.dev/schemas/2.2.2/schema.json",
3
3
 
4
4
  // ---------------------------- FORMATTER -----------------------------
5
5
  // These are the generic settings that apply to all files in the project.
package/dist/index.js CHANGED
@@ -12,5 +12,5 @@ import{Command as e}from"commander";import{execSync as t}from"child_process";imp
12
12
  ┏━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┓
13
13
  ┃ ADAMANTITE ┃
14
14
  ┗━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┛
15
- `}async function O({github:e,monorepo:n}){try{let r=await S(),a=[{package:`@biomejs/biome`,args:[`ci`,...e?[`--reporter`,`github`]:[]]},...n?[{package:`sherif`,args:[]}]:[]];for(let e of a)t(i(r,e.package,{args:e.args}),{stdio:`inherit`})}catch(e){C(e)}}async function k(e,n){try{let r=await S(),a=[`check`,`--write`];n.unsafe&&a.push(`--unsafe`),e.length>0&&a.push(...e),t(i(r,`@biomejs/biome`,{args:a}),{stdio:`inherit`})}catch(e){C(e)}}const A={config:{extends:`adamantite/presets/tsconfig.json`},async exists(){return await w(l(process.cwd(),`tsconfig.json`))},async create(){await c(l(process.cwd(),`tsconfig.json`),JSON.stringify(this.config,null,2))},async update(){let e=await s(l(process.cwd(),`tsconfig.json`),`utf-8`),t=b(e),n=y(this.config,t);await c(l(process.cwd(),`tsconfig.json`),JSON.stringify(n,null,2))}},j={version:`2.2.0`,config:{$schema:`./node_modules/@biomejs/biome/configuration_schema.json`},async exists(){return await w(l(process.cwd(),`biome.jsonc`))},async create(){await c(l(process.cwd(),`biome.jsonc`),JSON.stringify({...this.config,extends:[`adamantite`]},null,2))},async update(){let e=await w(l(process.cwd(),`biome.jsonc`))?l(process.cwd(),`biome.jsonc`):l(process.cwd(),`biome.json`),t=await s(e,`utf-8`),n=b(t),r={...n};Array.isArray(r.extends)||(r.extends=r.extends?[r.extends]:[]),r.extends.includes(`adamantite`)||r.extends.push(`adamantite`);let i=y(this.config,r);await c(l(process.cwd(),`biome.jsonc`),JSON.stringify(i,null,2))}},M={config:{"typescript.tsdk":`node_modules/typescript/lib`,"editor.formatOnSave":!0,"editor.formatOnPaste":!0,"editor.codeActionsOnSave":{"source.organizeImports.biome":`explicit`,"source.fixAll.biome":`explicit`},"[javascript][typescript][javascriptreact][typescriptreact][json][jsonc][css][graphql]":{"editor.defaultFormatter":`biomejs.biome`}},async exists(){return await w(l(process.cwd(),`.vscode`,`settings.json`))},async create(){let e=l(process.cwd(),`.vscode`);await o(e,{recursive:!0}),await c(l(e,`settings.json`),JSON.stringify(this.config,null,2))},async update(){let e=l(process.cwd(),`.vscode`,`settings.json`),t=await s(e,`utf-8`),n=b(t),r=y(this.config,n);await c(l(process.cwd(),`.vscode`,`settings.json`),JSON.stringify(r,null,2))}},N={version:`1.6.1`};async function P(){let e=u.cwd();if(await w(l(e,`pnpm-workspace.yaml`)))return!0;try{let e=await T();return e.workspaces!==void 0}catch{return!1}}async function F(){let e=v();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,monorepo:n}){let r=v();r.start("Adding scripts to your `package.json`...");try{let i=await T();i.scripts||={},e&&(i.scripts.lint=`adamantite lint`),t&&(i.scripts.format=`adamantite format`),n&&(i.scripts[`lint:monorepo`]=`adamantite monorepo`),await E(i),r.stop("Scripts added to your `package.json`")}catch(e){throw r.stop(`Failed to add scripts`),Error(`Failed to modify package.json: ${e instanceof Error?e.message:`Unknown error`}`)}}async function L(){let e=v();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(){let e=await g({message:`Which editors do you want to configure (recommended)?`,options:[{label:`VSCode / Cursor / Windsurf`,value:`vscode`},{label:`Zed (coming soon)`,value:`zed`}],required:!1});if(m(e))throw Error(`Operation cancelled`);return e}async function z(e){if(!e||e.length===0)return;let t=v();e.includes(`vscode`)&&(await M.exists()?(t.start(`VSCode settings found, updating...`),await M.update(),t.stop(`VSCode settings updated with Adamantite preset`)):(t.start(`VSCode settings not found, creating...`),await M.create(),t.stop(`VSCode settings created with Adamantite preset`))),e.includes(`zed`)&&(t.start(`Zed configuration coming soon...`),t.stop(`Zed configuration coming soon...`))}async function B(e){let t=await f({message:e});if(m(t))throw Error(`Operation cancelled`);return t}async function V(e){let t=v();t.start(`Installing dependencies...`);try{await n(`adamantite`);let r=j.version;await n(`@biomejs/biome@${r}`),e?.monorepo&&await n(`sherif@${N.version}`),t.stop(`Dependencies installed successfully`)}catch(e){throw t.stop(`Failed to install dependencies`),Error(`Failed to install dependencies: ${e instanceof Error?e.message:`Unknown error`}`)}}async function H(){p(D());try{let e=await P(),t=await B("Do you want to add the `format` and `lint` scripts to your `package.json`?"),n=e?await B(`We've detected a monorepo setup in your project. Would you like to install monorepo linting scripts?`):!1,r=await B(`Adamantite provides a TypeScript preset to enforce strict type-safety. Would you like to install it?`),i=await R();await V({monorepo:n}),await F(),(t||n)&&await I({lint:t,format:t,monorepo:n}),r&&await L(),await z(i),_(`💠 Adamantite initialized successfully!`)}catch(e){h.error(`${e instanceof Error?e.message:`Unknown error`}`),d(`Failed to initialize Adamantite`)}}async function U(e,{summary:n}){try{let r=await S(),a=[`lint`,`--fix`];n&&a.push(`--reporter`,`summary`),e.length>0&&a.push(...e),t(i(r,`@biomejs/biome`,{args:a}),{stdio:`inherit`})}catch(e){C(e)}}async function W(){try{let e=await S();t(i(e,`sherif`,{args:[`--fix`]}),{stdio:`inherit`})}catch(e){C(e)}}async function G(){let e=[];try{let t=await T(),n=t.devDependencies?.[`@biomejs/biome`];n&&n!==j.version&&e.push({name:`@biomejs/biome`,currentVersion:n,targetVersion:j.version,isDevDependency:!0});let r=t.devDependencies?.sherif;return r&&r!==N.version&&e.push({name:`sherif`,currentVersion:r,targetVersion:N.version,isDevDependency:!0}),e}catch(e){throw Error(`Failed to read package.json: ${e instanceof Error?e.message:`Unknown error`}`)}}async function K(e){let t=v();t.start(`Updating dependencies...`);try{let r=e.map(e=>n(`${e.name}@${e.targetVersion}`)),i=await Promise.allSettled(r),a=[],o=[];for(let[t,n]of i.entries()){let r=e[t];if(!r)continue;let i=r.name;n.status===`fulfilled`?o.push(i):a.push(`${i}: ${n.reason?.message||`Unknown error`}`)}if(a.length===0)t.stop(`Dependencies updated successfully`);else if(o.length===0)throw t.stop(`Failed to update dependencies`),Error(`All dependency updates failed:\n${a.join(`
16
- `)}`);else{t.stop(`Partial update completed`),h.warn(`Some dependencies failed to update:`);for(let e of a)h.warn(` ${e}`);h.success(`Successfully updated: ${o.join(`, `)}`)}}catch(e){throw t.stop(`Failed to update dependencies`),e}}async function q(e){h.message(`The following dependencies will be updated:`),h.message(``);for(let t of e)h.message(` ${t.name}: ${t.currentVersion} → ${t.targetVersion}`);h.message(``);let t=await f({message:`Do you want to proceed with these updates?`});if(m(t))throw Error(`Operation cancelled`);return t}async function J(){p(D());try{let e=await G();if(e.length===0){h.success(`All adamantite dependencies are already up to date!`),_(`💠 No updates needed`);return}let t=await q(e);if(!t){_(`💠 Update cancelled`);return}await K(e),_(`💠 Dependencies updated successfully!`)}catch(e){h.error(`${e instanceof Error?e.message:`Unknown error`}`),d(`Failed to update dependencies`)}}function Y(){let e=JSON.parse(x(l(process.cwd(),`package.json`),`utf-8`));return e.version}const X=Y();var Z=X;const Q=new e;Q.version(Z),Q.name(`adamantite`).description(`An opinionated set of presets for modern TypeScript applications`),Q.command(`init`).description(`Initialize Adamantite in the current directory`).action(H),Q.command(`lint`).description(`Run Biome linter and fix files`).argument(`[files...]`,`specific files to lint (optional)`).option(`--summary`,`show summary of lint results`).action(async(e,t)=>{await U(e,t)}),Q.command(`format`).description(`Run Biome formatter and fix files`).argument(`[files...]`,`specific files to format (optional)`).option(`--unsafe`,`apply unsafe fixes`).action(async(e,t)=>{await k(e,t)}),Q.command(`monorepo`).description(`Lint and automatically fix monorepo-specific issues using Sherif`).action(W),Q.command(`ci`).description(`Run Biome CI`).option(`--monorepo`,`run additional monorepo-specific checks`).option(`--github`,`use GitHub reporter`).action(async e=>{await O(e)}),Q.command(`update`).description(`Update adamantite dependencies to latest compatible versions`).action(J),Q.parse();
15
+ `}async function O(e,{summary:n}){try{let r=await S(),a=[`check`];n&&a.push(`--reporter`,`summary`),e.length>0&&a.push(...e),t(i(r,`@biomejs/biome`,{args:a}),{stdio:`inherit`})}catch(e){C(e)}}async function k({github:e,monorepo:n}){try{let r=await S(),a=[{package:`@biomejs/biome`,args:[`ci`,...e?[`--reporter`,`github`]:[]]},...n?[{package:`sherif`,args:[]}]:[]];for(let e of a)t(i(r,e.package,{args:e.args}),{stdio:`inherit`})}catch(e){C(e)}}async function A(e,n){try{let r=await S(),a=[`check`,`--write`];n.unsafe&&a.push(`--unsafe`),e.length>0&&a.push(...e),t(i(r,`@biomejs/biome`,{args:a}),{stdio:`inherit`})}catch(e){C(e)}}const j={config:{extends:`adamantite/presets/tsconfig.json`},async exists(){return await w(l(process.cwd(),`tsconfig.json`))},async create(){await c(l(process.cwd(),`tsconfig.json`),JSON.stringify(this.config,null,2))},async update(){let e=await s(l(process.cwd(),`tsconfig.json`),`utf-8`),t=b(e),n=y(this.config,t);await c(l(process.cwd(),`tsconfig.json`),JSON.stringify(n,null,2))}},M={version:`2.2.2`,config:{$schema:`./node_modules/@biomejs/biome/configuration_schema.json`},async exists(){return await w(l(process.cwd(),`biome.jsonc`))},async create(){await c(l(process.cwd(),`biome.jsonc`),JSON.stringify({...this.config,extends:[`adamantite`]},null,2))},async update(){let e=await w(l(process.cwd(),`biome.jsonc`))?l(process.cwd(),`biome.jsonc`):l(process.cwd(),`biome.json`),t=await s(e,`utf-8`),n=b(t),r={...n};Array.isArray(r.extends)||(r.extends=r.extends?[r.extends]:[]),r.extends.includes(`adamantite`)||r.extends.push(`adamantite`);let i=y(this.config,r);await c(l(process.cwd(),`biome.jsonc`),JSON.stringify(i,null,2))}},N={config:{"typescript.tsdk":`node_modules/typescript/lib`,"editor.formatOnSave":!0,"editor.formatOnPaste":!0,"editor.codeActionsOnSave":{"source.organizeImports.biome":`explicit`,"source.fixAll.biome":`explicit`},"[javascript][typescript][javascriptreact][typescriptreact][json][jsonc][css][graphql]":{"editor.defaultFormatter":`biomejs.biome`}},async exists(){return await w(l(process.cwd(),`.vscode`,`settings.json`))},async create(){let e=l(process.cwd(),`.vscode`);await o(e,{recursive:!0}),await c(l(e,`settings.json`),JSON.stringify(this.config,null,2))},async update(){let e=l(process.cwd(),`.vscode`,`settings.json`),t=await s(e,`utf-8`),n=b(t),r=y(this.config,n);await c(l(process.cwd(),`.vscode`,`settings.json`),JSON.stringify(r,null,2))}},P={version:`1.6.1`};async function F(){let e=u.cwd();if(await w(l(e,`pnpm-workspace.yaml`)))return!0;try{let e=await T();return e.workspaces!==void 0}catch{return!1}}async function I(){let e=v();await M.exists()?(e.start(`Biome config found, updating...`),await M.update(),e.stop(`Biome config updated with Adamantite preset`)):(e.start(`Biome config not found, creating...`),await M.create(),e.stop(`Biome config created with Adamantite preset`))}async function L({check:e,fix:t,monorepo:n}){let r=v();r.start("Adding scripts to your `package.json`...");try{let i=await T();i.scripts||={},e&&(i.scripts.check=`adamantite check`),t&&(i.scripts.fix=`adamantite fix`),n&&(i.scripts[`lint:monorepo`]=`adamantite monorepo`),await E(i),r.stop("Scripts added to your `package.json`")}catch(e){throw r.stop(`Failed to add scripts`),Error(`Failed to modify package.json: ${e instanceof Error?e.message:`Unknown error`}`)}}async function R(){let e=v();await j.exists()?(e.start("`tsconfig.json` found, updating..."),await j.update(),e.stop("Updated `tsconfig.json` with preset")):(e.start("`tsconfig.json` not found, creating..."),await j.create(),e.stop("Created `tsconfig.json` with preset"))}async function z(){let e=await g({message:`Which editors do you want to configure (recommended)?`,options:[{label:`VSCode / Cursor / Windsurf`,value:`vscode`},{label:`Zed (coming soon)`,value:`zed`}],required:!1});if(m(e))throw Error(`Operation cancelled`);return e}async function B(e){if(!e||e.length===0)return;let t=v();e.includes(`vscode`)&&(await N.exists()?(t.start(`VSCode settings found, updating...`),await N.update(),t.stop(`VSCode settings updated with Adamantite preset`)):(t.start(`VSCode settings not found, creating...`),await N.create(),t.stop(`VSCode settings created with Adamantite preset`))),e.includes(`zed`)&&(t.start(`Zed configuration coming soon...`),t.stop(`Zed configuration coming soon...`))}async function V(e){let t=await f({message:e});if(m(t))throw Error(`Operation cancelled`);return t}async function H(e){let t=v();t.start(`Installing dependencies...`);try{await n(`adamantite`);let r=M.version;await n(`@biomejs/biome@${r}`),e?.monorepo&&await n(`sherif@${P.version}`),t.stop(`Dependencies installed successfully`)}catch(e){throw t.stop(`Failed to install dependencies`),Error(`Failed to install dependencies: ${e instanceof Error?e.message:`Unknown error`}`)}}async function U(){p(D());try{let e=await F(),t=await V("Do you want to add the `check` and `fix` scripts to your `package.json`?"),n=e?await V(`We've detected a monorepo setup in your project. Would you like to install monorepo linting scripts?`):!1,r=await V(`Adamantite provides a TypeScript preset to enforce strict type-safety. Would you like to install it?`),i=await z();await H({monorepo:n}),await I(),(t||n)&&await L({check:t,fix:t,monorepo:n}),r&&await R(),await B(i),_(`💠 Adamantite initialized successfully!`)}catch(e){h.error(`${e instanceof Error?e.message:`Unknown error`}`),d(`Failed to initialize Adamantite`)}}async function W(){try{let e=await S();t(i(e,`sherif`,{args:[`--fix`]}),{stdio:`inherit`})}catch(e){C(e)}}async function G(){let e=[];try{let t=await T(),n=t.devDependencies?.[`@biomejs/biome`];n&&n!==M.version&&e.push({name:`@biomejs/biome`,currentVersion:n,targetVersion:M.version,isDevDependency:!0});let r=t.devDependencies?.sherif;return r&&r!==P.version&&e.push({name:`sherif`,currentVersion:r,targetVersion:P.version,isDevDependency:!0}),e}catch(e){throw Error(`Failed to read package.json: ${e instanceof Error?e.message:`Unknown error`}`)}}async function K(e){let t=v();t.start(`Updating dependencies...`);try{let r=e.map(e=>n(`${e.name}@${e.targetVersion}`)),i=await Promise.allSettled(r),a=[],o=[];for(let[t,n]of i.entries()){let r=e[t];if(!r)continue;let i=r.name;n.status===`fulfilled`?o.push(i):a.push(`${i}: ${n.reason?.message||`Unknown error`}`)}if(a.length===0)t.stop(`Dependencies updated successfully`);else if(o.length===0)throw t.stop(`Failed to update dependencies`),Error(`All dependency updates failed:\n${a.join(`
16
+ `)}`);else{t.stop(`Partial update completed`),h.warn(`Some dependencies failed to update:`);for(let e of a)h.warn(` ${e}`);h.success(`Successfully updated: ${o.join(`, `)}`)}}catch(e){throw t.stop(`Failed to update dependencies`),e}}async function q(e){h.message(`The following dependencies will be updated:`),h.message(``);for(let t of e)h.message(` ${t.name}: ${t.currentVersion} → ${t.targetVersion}`);h.message(``);let t=await f({message:`Do you want to proceed with these updates?`});if(m(t))throw Error(`Operation cancelled`);return t}async function J(){p(D());try{let e=await G();if(e.length===0){h.success(`All adamantite dependencies are already up to date!`),_(`💠 No updates needed`);return}let t=await q(e);if(!t){_(`💠 Update cancelled`);return}await K(e),_(`💠 Dependencies updated successfully!`)}catch(e){h.error(`${e instanceof Error?e.message:`Unknown error`}`),d(`Failed to update dependencies`)}}function Y(){let e=JSON.parse(x(l(process.cwd(),`package.json`),`utf-8`));return e.version}const X=Y();var Z=X;const Q=new e;Q.version(Z),Q.name(`adamantite`).description(`An opinionated set of presets for modern TypeScript applications`),Q.command(`init`).description(`Initialize Adamantite in the current directory`).action(U),Q.command(`check`).description(`Run Biome linter and check files for issues`).argument(`[files...]`,`specific files to lint (optional)`).option(`--summary`,`show summary of lint results`).action(async(e,t)=>{await O(e,t)}),Q.command(`fix`).description(`Run Biome linter and fix issues in files`).argument(`[files...]`,`specific files to fix (optional)`).option(`--unsafe`,`apply unsafe fixes`).action(async(e,t)=>{await A(e,t)}),Q.command(`monorepo`).description(`Lint and automatically fix monorepo-specific issues using Sherif`).action(W),Q.command(`ci`).description(`Run Adamantitte in a CI environment`).option(`--monorepo`,`run additional monorepo-specific checks`).option(`--github`,`use GitHub reporter`).action(async e=>{await k(e)}),Q.command(`update`).description(`Update adamantite dependencies to latest compatible versions`).action(J),Q.parse();
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "adamantite",
3
- "version": "0.7.1",
3
+ "version": "0.8.0",
4
4
  "description": "An strict and opinionated set of presets for modern TypeScript applications",
5
5
  "keywords": [
6
6
  "adamantite",
@@ -26,15 +26,16 @@
26
26
  "adamantite": "bin/adamantite"
27
27
  },
28
28
  "files": [
29
+ "bin",
29
30
  "biome.jsonc",
30
- "presets/tsconfig.json",
31
- "dist"
31
+ "dist",
32
+ "presets/tsconfig.json"
32
33
  ],
33
34
  "scripts": {
34
35
  "build": "tsdown",
35
36
  "dev": "tsdown --watch",
36
- "format": "biome check --write",
37
- "lint": "biome lint --fix",
37
+ "check": "biome check",
38
+ "fix": "biome check --write",
38
39
  "release": "changeset publish",
39
40
  "test": "bun test",
40
41
  "test:watch": "bun --watch test",
@@ -50,11 +51,11 @@
50
51
  "nypm": "0.6.1"
51
52
  },
52
53
  "devDependencies": {
53
- "@biomejs/biome": "2.2.0",
54
+ "@biomejs/biome": "2.2.2",
54
55
  "@changesets/cli": "2.29.6",
55
56
  "@types/bun": "1.2.20",
56
57
  "sherif": "1.6.1",
57
- "tsdown": "0.14.1",
58
+ "tsdown": "0.14.2",
58
59
  "type-fest": "4.41.0",
59
60
  "typescript": "5.9.2"
60
61
  },