adamantite 0.4.1 → 0.5.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/biome.jsonc +60 -44
- package/dist/index.js +2 -2
- package/package.json +3 -3
package/biome.jsonc
CHANGED
|
@@ -1,10 +1,11 @@
|
|
|
1
1
|
{
|
|
2
|
-
"$schema": "https://biomejs.dev/schemas/2.
|
|
2
|
+
"$schema": "https://biomejs.dev/schemas/2.2.0/schema.json",
|
|
3
3
|
|
|
4
4
|
// ---------------------------- FORMATTER -----------------------------
|
|
5
5
|
// These are the generic settings that apply to all files in the project.
|
|
6
6
|
"formatter": {
|
|
7
7
|
"enabled": true,
|
|
8
|
+
|
|
8
9
|
// Format the code even if there are errors.
|
|
9
10
|
"formatWithErrors": true,
|
|
10
11
|
// Use spaces for indentation.
|
|
@@ -23,6 +24,8 @@
|
|
|
23
24
|
// ------------------------------ ASSIST ------------------------------
|
|
24
25
|
// Help with code organization.
|
|
25
26
|
"assist": {
|
|
27
|
+
"enabled": true,
|
|
28
|
+
|
|
26
29
|
"actions": {
|
|
27
30
|
"source": {
|
|
28
31
|
// Sort imports in a certain order. We prioritize runtime imports
|
|
@@ -34,7 +37,9 @@
|
|
|
34
37
|
"groups": [":BUN:", ":NODE:", ":PACKAGE:", ":ALIAS:"]
|
|
35
38
|
}
|
|
36
39
|
},
|
|
40
|
+
// Enforce that the attributes of a JSX element are sorted.
|
|
37
41
|
"useSortedAttributes": "on",
|
|
42
|
+
// Enforce that CSS properties are sorted.
|
|
38
43
|
"useSortedProperties": "on",
|
|
39
44
|
// Don't sort the keys of an object.
|
|
40
45
|
"useSortedKeys": "off"
|
|
@@ -48,9 +53,13 @@
|
|
|
48
53
|
"enabled": true,
|
|
49
54
|
"rules": {
|
|
50
55
|
"a11y": {
|
|
56
|
+
// Enforce that the `accesskey` attribute is not used on any HTML element.
|
|
51
57
|
"noAccessKey": "error",
|
|
58
|
+
// Enforce that the `aria-hidden` attribute is not used on any focusable element.
|
|
52
59
|
"noAriaHiddenOnFocusable": "error",
|
|
60
|
+
// Enforce that the `aria-unsupported-elements` attribute is not used on any HTML element.
|
|
53
61
|
"noAriaUnsupportedElements": "error",
|
|
62
|
+
// Enforce that the `distracting-elements` attribute is not used on any HTML element.
|
|
54
63
|
"noDistractingElements": "error",
|
|
55
64
|
"noHeaderScope": "error",
|
|
56
65
|
"noInteractiveElementToNoninteractiveRole": "error",
|
|
@@ -83,7 +92,8 @@
|
|
|
83
92
|
"useValidAutocomplete": "error",
|
|
84
93
|
"useValidLang": "error",
|
|
85
94
|
"noAutofocus": "off",
|
|
86
|
-
"useGenericFontNames": "error"
|
|
95
|
+
"useGenericFontNames": "error",
|
|
96
|
+
"noNoninteractiveElementInteractions": "error"
|
|
87
97
|
},
|
|
88
98
|
"complexity": {
|
|
89
99
|
"noAdjacentSpacesInRegex": "error",
|
|
@@ -99,7 +109,11 @@
|
|
|
99
109
|
},
|
|
100
110
|
"noExcessiveNestedTestSuites": "error",
|
|
101
111
|
"useSimplifiedLogicExpression": "error",
|
|
102
|
-
"useWhile": "error"
|
|
112
|
+
"useWhile": "error",
|
|
113
|
+
"useIndexOf": "error",
|
|
114
|
+
|
|
115
|
+
// --------------------------- CSS ---------------------------
|
|
116
|
+
"noImportantStyles": "error"
|
|
103
117
|
},
|
|
104
118
|
"correctness": {
|
|
105
119
|
// ----------------------- JavaScript ------------------------
|
|
@@ -158,43 +172,27 @@
|
|
|
158
172
|
"noUnknownPseudoElement": "error",
|
|
159
173
|
"noUnknownTypeSelector": "error",
|
|
160
174
|
"noUnknownUnit": "error",
|
|
161
|
-
"noUnmatchableAnbSelector": "error"
|
|
162
|
-
},
|
|
163
|
-
"nursery": {
|
|
164
|
-
// ----------------------- JavaScript ------------------------
|
|
165
|
-
"noAwaitInLoop": "error",
|
|
166
|
-
"noBitwiseOperators": "error",
|
|
167
|
-
"noConstantBinaryExpression": "error",
|
|
175
|
+
"noUnmatchableAnbSelector": "error",
|
|
168
176
|
"noGlobalDirnameFilename": "error",
|
|
169
177
|
"noNestedComponentDefinitions": "error",
|
|
170
|
-
"
|
|
171
|
-
"noReactPropAssign": "error",
|
|
178
|
+
"noReactPropAssignments": "error",
|
|
172
179
|
"noRestrictedElements": "error",
|
|
180
|
+
"useJsonImportAttributes": "error",
|
|
181
|
+
"useParseIntRadix": "error",
|
|
182
|
+
"useSingleJsDocAsterisk": "error",
|
|
183
|
+
|
|
184
|
+
"noProcessGlobal": "off",
|
|
185
|
+
"useUniqueElementIds": "off"
|
|
186
|
+
},
|
|
187
|
+
"nursery": {
|
|
188
|
+
// ----------------------- JavaScript ------------------------
|
|
173
189
|
"noShadow": "error",
|
|
174
|
-
"noTsIgnore": "error",
|
|
175
|
-
"noUnwantedPolyfillio": "error",
|
|
176
|
-
"noUselessBackrefInRegex": "error",
|
|
177
|
-
"noUselessEscapeInString": "error",
|
|
178
190
|
"noUselessUndefined": "error",
|
|
179
|
-
"useAdjacentGetterSetter": "error",
|
|
180
|
-
"useConsistentObjectDefinition": "error",
|
|
181
|
-
"useConsistentResponse": "error",
|
|
182
191
|
"useExhaustiveSwitchCases": "error",
|
|
183
|
-
"
|
|
184
|
-
"useIndexOf": "error",
|
|
185
|
-
"useIterableCallbackReturn": "error",
|
|
186
|
-
"useJsonImportAttribute": "error",
|
|
187
|
-
"useNumericSeparators": "error",
|
|
188
|
-
"useObjectSpread": "error",
|
|
189
|
-
"useParseIntRadix": "error",
|
|
190
|
-
"useSingleJsDocAsterisk": "error",
|
|
191
|
-
"useSymbolDescription": "error",
|
|
192
|
+
"noNonNullAssertedOptionalChain": "error",
|
|
192
193
|
|
|
193
194
|
"useExplicitType": "off",
|
|
194
|
-
|
|
195
|
-
"noProcessGlobal": "off",
|
|
196
195
|
"noSecrets": "off",
|
|
197
|
-
"useExportsLast": "off",
|
|
198
196
|
"useSortedClasses": {
|
|
199
197
|
"fix": "safe",
|
|
200
198
|
"level": "error",
|
|
@@ -203,29 +201,28 @@
|
|
|
203
201
|
"functions": ["clsx", "cva", "tw", "twMerge", "cn", "twJoin", "tv"]
|
|
204
202
|
}
|
|
205
203
|
},
|
|
206
|
-
"useUniqueElementIds": "off",
|
|
207
204
|
|
|
208
|
-
// These rules should be enabled
|
|
205
|
+
// These rules should be enabled once improvements are made to
|
|
206
|
+
// performance
|
|
209
207
|
"noFloatingPromises": "off",
|
|
210
208
|
"noImportCycles": "off",
|
|
211
209
|
"noUnresolvedImports": "off",
|
|
212
|
-
|
|
213
|
-
// --------------------------- CSS ---------------------------
|
|
214
|
-
"noImportantStyles": "error",
|
|
215
|
-
// Disabling this rule since we need custom at-rules for Tailwind
|
|
216
|
-
"noUnknownAtRule": "off"
|
|
210
|
+
"noMisusedPromises": "off"
|
|
217
211
|
},
|
|
218
212
|
"performance": {
|
|
219
213
|
// ----------------------- JavaScript ------------------------
|
|
220
214
|
|
|
221
215
|
"noAccumulatingSpread": "error",
|
|
222
|
-
"
|
|
216
|
+
"noAwaitInLoops": "error",
|
|
217
|
+
"noBarrelFile": "error",
|
|
223
218
|
"noDelete": "error",
|
|
224
219
|
"noDynamicNamespaceImportAccess": "error",
|
|
225
220
|
"noImgElement": "error",
|
|
226
221
|
"noNamespaceImport": "off",
|
|
227
222
|
"noReExportAll": "off",
|
|
228
|
-
"useTopLevelRegex": "error"
|
|
223
|
+
"useTopLevelRegex": "error",
|
|
224
|
+
"noUnwantedPolyfillio": "error",
|
|
225
|
+
"useGoogleFontPreconnect": "error"
|
|
229
226
|
},
|
|
230
227
|
"security": {
|
|
231
228
|
// ----------------------- JavaScript ------------------------
|
|
@@ -304,7 +301,13 @@
|
|
|
304
301
|
|
|
305
302
|
// --------------------------- CSS ---------------------------
|
|
306
303
|
"noDescendingSpecificity": "error",
|
|
307
|
-
"noValueAtRule": "error"
|
|
304
|
+
"noValueAtRule": "error",
|
|
305
|
+
"useGroupedAccessorPairs": "error",
|
|
306
|
+
"useConsistentObjectDefinitions": "error",
|
|
307
|
+
"useNumericSeparators": "error",
|
|
308
|
+
"useObjectSpread": "error",
|
|
309
|
+
"useSymbolDescription": "error",
|
|
310
|
+
"useExportsLast": "off"
|
|
308
311
|
},
|
|
309
312
|
"suspicious": {
|
|
310
313
|
"noApproximativeNumericConstant": "error",
|
|
@@ -389,7 +392,19 @@
|
|
|
389
392
|
"noDuplicateSelectorsKeyframeBlock": "error",
|
|
390
393
|
"noEmptyBlock": "error",
|
|
391
394
|
"noImportantInKeyframe": "error",
|
|
392
|
-
"noShorthandPropertyOverrides": "error"
|
|
395
|
+
"noShorthandPropertyOverrides": "error",
|
|
396
|
+
"noBitwiseOperators": "error",
|
|
397
|
+
"noConstantBinaryExpressions": "error",
|
|
398
|
+
"noTsIgnore": "error",
|
|
399
|
+
"noUselessRegexBackrefs": "error",
|
|
400
|
+
"noUselessEscapeInString": "error",
|
|
401
|
+
"useStaticResponseMethods": "error",
|
|
402
|
+
"useIterableCallbackReturn": "error",
|
|
403
|
+
// Disabling this rule since we need custom at-rules for Tailwind
|
|
404
|
+
"noUnknownAtRules": "off",
|
|
405
|
+
|
|
406
|
+
// --------------------------- JSON ---------------------------
|
|
407
|
+
"useBiomeIgnoreFolder": "error"
|
|
393
408
|
}
|
|
394
409
|
}
|
|
395
410
|
},
|
|
@@ -397,12 +412,13 @@
|
|
|
397
412
|
// Options for JavaScript and TypeScript files.
|
|
398
413
|
"javascript": {
|
|
399
414
|
"formatter": {
|
|
415
|
+
"enabled": true,
|
|
416
|
+
|
|
400
417
|
"arrowParentheses": "always",
|
|
401
418
|
"attributePosition": "auto",
|
|
402
419
|
"bracketSameLine": false,
|
|
403
420
|
"bracketSpacing": true,
|
|
404
|
-
"
|
|
405
|
-
"indentStyle": "space",
|
|
421
|
+
"expand": "auto",
|
|
406
422
|
"jsxQuoteStyle": "double",
|
|
407
423
|
"quoteProperties": "asNeeded",
|
|
408
424
|
"quoteStyle": "double",
|
package/dist/index.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{Command as e}from"commander";import t from"process";import{
|
|
1
|
+
import{Command as e}from"commander";import t from"process";import{spawnSync as n}from"child_process";import{access as r,mkdir as i,readFile as a,writeFile as o}from"fs/promises";import{join as s}from"path";import{cancel as c,confirm as l,intro as u,isCancel as d,log as f,multiselect as p,outro as m,select as h,spinner as g}from"@clack/prompts";import _ from"defu";import{parse as v}from"jsonc-parser";import{readFileSync as y}from"fs";function b(e,t=[],r={}){let i=n(e,t,{...r,stdio:`inherit`});if(i.error)throw i.error;if(i.status!==0)throw Error(`Process exited with code ${i.status}`)}async function x(e){try{return await r(e),!0}catch{return!1}}async function S(e=process.cwd()){let t=s(e,`package.json`);if(!await x(t))throw Error(`package.json not found in the current directory`);try{let e=await a(t,`utf-8`),n=JSON.parse(e);return 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=s(t,`package.json`);try{await o(n,JSON.stringify(e,null,2))}catch(e){throw Error(`Failed to write package.json: ${e instanceof Error?e.message:`Unknown error`}`)}}const w=[`npm`,`yarn`,`pnpm`,`bun`];async function T(){let e=process.cwd(),t=await x(s(e,`package-lock.json`));if(t)return`npm`;let n=await x(s(e,`yarn.lock`));if(n)return`yarn`;let r=await x(s(e,`pnpm-lock.yaml`));if(r)return`pnpm`;let i=await x(s(e,`bun.lockb`))||await x(s(e,`bun.lock`));return i?`bun`:null}function E(e){switch(e){case`npm`:return`npx`;case`yarn`:return`yarn dlx`;case`pnpm`:return`pnpm dlx`;case`bun`:return`bunx`;default:return`npx`}}function D(){let e=process.stdout.columns||80;return e>=120?`
|
|
2
2
|
█████ █████ ███ █████
|
|
3
3
|
░░███ ░░███ ░░░ ░░███
|
|
4
4
|
██████ ███████ ██████ █████████████ ██████ ████████ ███████ ████ ███████ ██████
|
|
@@ -11,4 +11,4 @@ import{Command as e}from"commander";import t from"process";import{execSync as n}
|
|
|
11
11
|
┏━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┓
|
|
12
12
|
┃ ADAMANTITE ┃
|
|
13
13
|
┗━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┛
|
|
14
|
-
`}async function O(e,n){try{let t=await T(),r=E(t),i=[`@biomejs/biome`,`check`,`--write`];n.unsafe&&i.push(`--unsafe`),e.length>0&&i.push(...e),b(r,i)}catch(e){let n=e instanceof Error?e.message:`An unknown error occurred`;console.error(`Failed to run Adamantite:`,n),t.exit(1)}}const k={config:{extends:`adamantite/presets/tsconfig.json`},async exists(){return await x(s(process.cwd(),`tsconfig.json`))},async create(){await o(s(process.cwd(),`tsconfig.json`),JSON.stringify(this.config,null,2))},async update(){let e=await a(s(process.cwd(),`tsconfig.json`),`utf-8`),t=v(e),n=_(this.config,t);await o(s(process.cwd(),`tsconfig.json`),JSON.stringify(n,null,2))}},A={version:`2.
|
|
14
|
+
`}async function O(e,n){try{let t=await T(),r=E(t),i=[`@biomejs/biome`,`check`,`--write`];n.unsafe&&i.push(`--unsafe`),e.length>0&&i.push(...e),b(r,i)}catch(e){let n=e instanceof Error?e.message:`An unknown error occurred`;console.error(`Failed to run Adamantite:`,n),t.exit(1)}}const k={config:{extends:`adamantite/presets/tsconfig.json`},async exists(){return await x(s(process.cwd(),`tsconfig.json`))},async create(){await o(s(process.cwd(),`tsconfig.json`),JSON.stringify(this.config,null,2))},async update(){let e=await a(s(process.cwd(),`tsconfig.json`),`utf-8`),t=v(e),n=_(this.config,t);await o(s(process.cwd(),`tsconfig.json`),JSON.stringify(n,null,2))}},A={version:`2.2.0`,config:{$schema:`./node_modules/@biomejs/biome/configuration_schema.json`},async exists(){return await x(s(process.cwd(),`biome.jsonc`))},async create(){await o(s(process.cwd(),`biome.jsonc`),JSON.stringify({...this.config,extends:[`adamantite`]},null,2))},async update(){let e=await x(s(process.cwd(),`biome.jsonc`))?s(process.cwd(),`biome.jsonc`):s(process.cwd(),`biome.json`),t=await a(e,`utf-8`),n=v(t),r={...n};Array.isArray(r.extends)||(r.extends=r.extends?[r.extends]:[]),r.extends.includes(`adamantite`)||r.extends.push(`adamantite`);let i=_(this.config,r);await o(s(process.cwd(),`biome.jsonc`),JSON.stringify(i,null,2))}},j={config:{"typescript.tsdk":`node_modules/typescript/lib`,"editor.defaultFormatter":`esbenp.prettier-vscode`,"editor.formatOnSave":!0,"editor.formatOnPaste":!0,"editor.codeActionsOnSave":{"quickfix.biome":`explicit`,"source.organizeImports.biome":`explicit`,"source.fixAll.biome":`explicit`},"[javascript][typescript][javascriptreact][typescriptreact][json][jsonc][css][graphql]":{"editor.defaultFormatter":`biomejs.biome`}},async exists(){return await x(s(process.cwd(),`.vscode`,`settings.json`))},async create(){let e=s(process.cwd(),`.vscode`);await i(e,{recursive:!0}),await o(s(e,`settings.json`),JSON.stringify(this.config,null,2))},async update(){let e=(await x(s(process.cwd(),`.vscode`,`settings.json`)),s(process.cwd(),`.vscode`,`settings.json`)),t=await a(e,`utf-8`),n=v(t),r=_(this.config,n);await o(s(process.cwd(),`.vscode`,`settings.json`),JSON.stringify(r,null,2))}},M={version:`1.6.1`};async function N(){let e=await h({message:`Select your package manager`,options:w.map(e=>({label:e,value:e})),initialValue:await T()});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 P(){let e=t.cwd();if(await x(s(e,`pnpm-workspace.yaml`)))return!0;try{let e=await S();return e.workspaces!==void 0}catch{return!1}}async function F(){let e=g();await A.exists()?(e.start(`Biome config found, updating...`),await A.update(),e.stop(`Biome config updated with Adamantite preset`)):(e.start(`Biome config not found, creating...`),await A.create(),e.stop(`Biome config created with Adamantite preset`))}async function I({lint:e,format:t,monorepo:n}){let r=g();r.start("Adding scripts to your `package.json`...");try{let i=await S();i.scripts||={},e&&(i.scripts.lint=`adamantite lint`),t&&(i.scripts.format=`adamantite format`),n&&(i.scripts[`lint:monorepo`]=`adamantite monorepo`),await C(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=g();await k.exists()?(e.start("`tsconfig.json` found, updating..."),await k.update(),e.stop("Updated `tsconfig.json` with preset")):(e.start("`tsconfig.json` not found, creating..."),await k.create(),e.stop("Created `tsconfig.json` with preset"))}async function R(){let e=await p({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(d(e))throw Error(`Operation cancelled`);return e}async function z(e){if(!e||e.length===0)return;let t=g();e.includes(`vscode`)&&(await j.exists()?(t.start(`VSCode settings found, updating...`),await j.update(),t.stop(`VSCode settings updated with Adamantite preset`)):(t.start(`VSCode settings not found, creating...`),await j.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 l({message:e});if(d(t))throw Error(`Operation cancelled`);return t}function V(e,t){let n=g();n.start(`Installing dependencies...`);try{let r=A.version,i=[`adamantite`,`@biomejs/biome@^${r}`];switch(t?.monorepo&&i.push(`sherif@${M.version}`),e){case`npm`:b(`npm`,[`install`,`--save-dev`,`--exact`,...i]);break;case`yarn`:b(`yarn`,[`add`,`--dev`,`--exact`,...i]);break;case`pnpm`:b(`pnpm`,[`add`,`--save-dev`,`--save-exact`,...i]);break;case`bun`:b(`bun`,[`add`,`--dev`,`--exact`,...i]);break;default:throw Error(`Invalid package manager: ${e}`)}n.stop(`Dependencies installed successfully`)}catch(e){throw n.stop(`Failed to install dependencies`),Error(`Failed to install dependencies: ${e instanceof Error?e.message:`Unknown error`}`)}}async function H(){u(D());try{let e=await N(),t=await P(),n=await B("Do you want to add the `format` and `lint` scripts to your `package.json`?"),r=t?await B(`We've detected a monorepo setup in your project. Would you like to install monorepo linting scripts?`):!1,i=await B(`Adamantite provides a TypeScript preset to enforce strict type-safety. Would you like to install it?`),a=await R();V(e,{monorepo:r}),await F(),(n||r)&&await I({lint:n,format:n,monorepo:r}),i&&await L(),await z(a),m(`💠 Adamantite initialized successfully!`)}catch(e){f.error(`${e instanceof Error?e.message:`Unknown error`}`),c(`Failed to initialize Adamantite`)}}async function U(e){try{let t=await T(),n=E(t),r=[`@biomejs/biome`,`lint`,`--fix`];e.length>0&&r.push(...e),b(n,r)}catch(e){let n=e instanceof Error?e.message:`An unknown error occurred`;console.error(`Failed to run Adamantite:`,n),t.exit(1)}}async function W(){try{let e=await T(),t=E(e);b(t,[`sherif`,`--fix`])}catch(e){let n=e instanceof Error?e.message:`An unknown error occurred`;console.error(`Failed to run Adamantite:`,n),t.exit(1)}}async function G(){let e=[];try{let t=await S(),n=t.devDependencies?.[`@biomejs/biome`];n&&n!==A.version&&e.push({name:`@biomejs/biome`,currentVersion:n,targetVersion:A.version,isDevDependency:!0});let r=t.devDependencies?.sherif;return r&&r!==M.version&&e.push({name:`sherif`,currentVersion:r,targetVersion:M.version,isDevDependency:!0}),e}catch(e){throw Error(`Failed to read package.json: ${e instanceof Error?e.message:`Unknown error`}`)}}function K(e,t){let n=g();n.start(`Updating dependencies...`);try{let r=t.map(e=>`${e.name}@${e.targetVersion}`);switch(e){case`npm`:b(`npm`,[`install`,`--save-dev`,`--save-exact`,...r]);break;case`yarn`:b(`yarn`,[`add`,`--dev`,`--exact`,...r]);break;case`pnpm`:b(`pnpm`,[`add`,`--save-dev`,`--save-exact`,...r]);break;case`bun`:b(`bun`,[`add`,`--dev`,`--exact`,...r]);break;default:throw Error(`Invalid package manager: ${e}`)}n.stop(`Dependencies updated successfully`)}catch(e){throw n.stop(`Failed to update dependencies`),Error(`Failed to update dependencies: ${e instanceof Error?e.message:`Unknown error`}`)}}async function q(e){f.message(`The following dependencies will be updated:`),f.message(``);for(let t of e)f.message(` ${t.name}: ${t.currentVersion} → ${t.targetVersion}`);f.message(``);let t=await l({message:`Do you want to proceed with these updates?`});if(d(t))throw Error(`Operation cancelled`);return t}async function J(){u(D());try{let e=await T();if(!e)throw Error(`Unable to detect package manager. Please ensure you have a lock file (package-lock.json, yarn.lock, pnpm-lock.yaml, or bun.lock/bun.lockb) in your project.`);let t=await G();if(t.length===0){f.success(`All adamantite dependencies are already up to date!`),m(`💠 No updates needed`);return}let n=await q(t);if(!n){m(`💠 Update cancelled`);return}K(e,t),m(`💠 Dependencies updated successfully!`)}catch(e){f.error(`${e instanceof Error?e.message:`Unknown error`}`),c(`Failed to update dependencies`)}}function Y(){let e=JSON.parse(y(s(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)`).action(U),Q.command(`format`).description(`Run Biome formatter and fix files`).argument(`[files...]`,`specific files to format (optional)`).option(`--unsafe`,`apply unsafe fixes`).action(O),Q.command(`monorepo`).description(`Lint and automatically fix monorepo-specific issues using Sherif`).action(W),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.
|
|
3
|
+
"version": "0.5.1",
|
|
4
4
|
"description": "An strict and opinionated set of presets for modern TypeScript applications",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"adamantite",
|
|
@@ -48,8 +48,8 @@
|
|
|
48
48
|
"jsonc-parser": "3.3.1"
|
|
49
49
|
},
|
|
50
50
|
"devDependencies": {
|
|
51
|
-
"@biomejs/biome": "2.
|
|
52
|
-
"@changesets/cli": "2.29.
|
|
51
|
+
"@biomejs/biome": "2.2.0",
|
|
52
|
+
"@changesets/cli": "2.29.6",
|
|
53
53
|
"@types/bun": "1.2.20",
|
|
54
54
|
"sherif": "1.6.1",
|
|
55
55
|
"tsdown": "0.14.1",
|