@circlesac/lint 0.0.1 → 0.0.2
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/main.js +3 -3
- package/dist/main.js.map +2 -2
- package/package.json +3 -6
package/dist/main.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
var
|
|
2
|
+
var m={name:"@circlesac/lint",version:"0.0.2",type:"module",main:"dist/main.js",exports:{"./eslint":"./eslint.config.mjs","./prettier":"./prettier.config.mjs","./biome":"./biome.jsonc"},bin:{lint:"dist/main.js"},description:"🔧 A zero-config lint tool that uses ESLint, Prettier, and Biome",files:["dist","eslint.config.mjs","prettier.config.mjs","biome.jsonc"],keywords:["cli","lint","eslint","prettier","biome","zeroconf"],private:!1,publishConfig:{access:"public"},dependencies:{"@tszen/trycatch":"^0.1.0",chalk:"^4.1.2",commander:"^14.0.0",eslint:"^9.34.0","read-package-up":"^11.0.0"},devDependencies:{"@tsed/barrels":"^6.6.3","@types/bun":"^1.2.21","@types/node":"^24.3.0","@vitest/coverage-v8":"3.2.4",globals:"^16.3.0",typescript:"^5.9.2","typescript-eslint":"^8.42.0",vitest:"^3.2.4"},scripts:{build:"barrels && bun lint && tsc --noEmit && bun run build.ts",dev:"bun run src/main.ts",start:"bun run build && bun run dist/main.js",lint:"bun dev --all",test:"vitest run --coverage","version:patch":"npm version patch","version:minor":"npm version minor","version:major":"npm version major",prepublishOnly:"bun run build"},license:"MIT"};import{Command as o}from"commander";import v from"chalk";class a{static instance;static getInstance(){if(!a.instance)a.instance=new a;return a.instance}constructor(){}error(n,e){if(e.includes(`
|
|
3
3
|
`))console.error(`${v.red(n)}:
|
|
4
|
-
${e}`);else console.error(`${v.red(n)}: ${e}`)}}var c=
|
|
4
|
+
${e}`);else console.error(`${v.red(n)}: ${e}`)}}var c=a.getInstance();class b extends o{constructor(n){super(n);this.action(this.executeInternal.bind(this))}async executeInternal(...n){try{await this.execute(...n)}catch(e){this.logError(e)}}logError(...n){console.error();for(let e of n)if(e instanceof Error){if(c.error("Error",e.message),e.stack)console.error(),c.error("Stack trace",e.stack);if(e.cause)console.error(),c.error("Caused by",String(e.cause))}else c.error("Message",String(e));console.error(),c.error("Command",this.name()),c.error("Time",Date.now().toString())}}import{execSync as y}from"child_process";import{dirname as j,resolve as d}from"path";import{readPackageUp as w}from"read-package-up";import{fileURLToPath as x}from"url";async function f(n){let e=await E(),i=d(e,n.configFile),s=[...n.args];s.push(n.configArg,i);try{let r=`${n.command} ${s.join(" ")}`;return console.info(`\uD83D\uDD27 Running ${n.title}...`),console.info(` Command: ${r}`),y(r,{stdio:"pipe",cwd:process.cwd(),encoding:"utf8"}),console.info(`✅ ${n.title} completed`),!0}catch(r){if(console.info(`❌ ${n.title} failed`),r instanceof Error&&"stdout"in r)console.error(r.stdout);else if(r instanceof Error&&"stderr"in r)console.error(r.stderr);else console.error(String(r));return!1}}async function E(){let n=x(import.meta.url),e=j(n),i=await w({cwd:e});if(!i)throw new Error("Could not find package.json");return d(i.path,"..")}var g=[{name:"eslint",title:"ESLint",command:"npx eslint",args:["--fix"],configArg:"--config",configFile:"eslint.config.mjs"},{name:"prettier",title:"Prettier",command:"npx prettier",args:["'**/*.{ts,tsx,js,jsx,json,md,cjs,mjs,mts,yml,yaml}'","--write"],configArg:"--config",configFile:"prettier.config.mjs"},{name:"biome",title:"Biome",command:"npx @biomejs/biome",args:["check","--write"],configArg:"--config-path",configFile:"biome.jsonc"}];class u extends b{constructor(){super("lint");this.option("--all","Run all tools");for(let n of g)this.option(`--${n.name}`,`Run ${n.title}`)}async execute(n){console.info("\uD83D\uDD27 Running lint tools...");let e=this.getEnabledTools(g,n),i=[];for(let t of e)i.push({tool:t.name,success:await f(t)});let s=i.filter((t)=>!t.success).map((t)=>t.tool),r=i.filter((t)=>t.success).map((t)=>t.tool);if(r.length>0)console.info(`✓ Completed: ${r.join(", ")}`);if(s.length>0)console.error(`✗ Failed: ${s.join(", ")}`)}getEnabledTools(n,e){if(e.all)return n;let i=n.filter((s)=>e[s.name]);if(i.length!==0)return i;this.help()}}var p=new u;p.name(m.name);p.description(m.description);p.version(m.version);p.parse();
|
|
5
5
|
|
|
6
|
-
//# debugId=
|
|
6
|
+
//# debugId=E9CE7EF9039B0C1564756E2164756E21
|
package/dist/main.js.map
CHANGED
|
@@ -8,7 +8,7 @@
|
|
|
8
8
|
"import { BaseCommand } from \"../utils/base.js\"\nimport { runTool, type ToolConfig } from \"../utils/tools.js\"\n\nconst tools: ToolConfig[] = [\n\t{\n\t\tname: \"eslint\",\n\t\ttitle: \"ESLint\",\n\t\tcommand: \"npx eslint\",\n\t\targs: [\"--fix\"],\n\t\tconfigArg: \"--config\",\n\t\tconfigFile: \"eslint.config.mjs\"\n\t},\n\t{\n\t\tname: \"prettier\",\n\t\ttitle: \"Prettier\",\n\t\tcommand: \"npx prettier\",\n\t\targs: [\"'**/*.{ts,tsx,js,jsx,json,md,cjs,mjs,mts,yml,yaml}'\", \"--write\"],\n\t\tconfigArg: \"--config\",\n\t\tconfigFile: \"prettier.config.mjs\"\n\t},\n\t{\n\t\tname: \"biome\",\n\t\ttitle: \"Biome\",\n\t\tcommand: \"npx @biomejs/biome\",\n\t\targs: [\"check\", \"--write\"],\n\t\tconfigArg: \"--config-path\",\n\t\tconfigFile: \"biome.jsonc\"\n\t}\n]\n\nexport class LintCommand extends BaseCommand {\n\tconstructor() {\n\t\tsuper(\"lint\")\n\t\tthis.option(\"--all\", \"Run all tools\")\n\t\tfor (const tool of tools) {\n\t\t\tthis.option(`--${tool.name}`, `Run ${tool.title}`)\n\t\t}\n\t}\n\n\tprotected async execute(options: Record<string, boolean>) {\n\t\tconsole.info(\"🔧 Running lint tools...\")\n\n\t\t// Validate options and determine which tools to run\n\t\tconst enabledTools = this.getEnabledTools(tools, options)\n\n\t\t// Run enabled tools sequentially\n\t\tconst results: { tool: string; success: boolean }[] = []\n\t\tfor (const tool of enabledTools) {\n\t\t\tresults.push({\n\t\t\t\ttool: tool.name,\n\t\t\t\tsuccess: await runTool(tool)\n\t\t\t})\n\t\t}\n\n\t\t// Report results\n\t\tconst failedTools = results.filter((r) => !r.success).map((r) => r.tool)\n\t\tconst successfulTools = results.filter((r) => r.success).map((r) => r.tool)\n\n\t\tif (successfulTools.length > 0) {\n\t\t\tconsole.info(`✓ Completed: ${successfulTools.join(\", \")}`)\n\t\t}\n\n\t\tif (failedTools.length > 0) {\n\t\t\tconsole.error(`✗ Failed: ${failedTools.join(\", \")}`)\n\t\t}\n\t}\n\n\tprivate getEnabledTools(tools: ToolConfig[], options: Record<string, boolean>) {\n\t\t// If --all is specified, run all tools (regardless of individual tool options)\n\t\tif (options.all) return tools\n\n\t\t// Find all specified individual tool options\n\t\tconst selectedTools = tools.filter((tool) => options[tool.name])\n\t\tif (selectedTools.length !== 0) return selectedTools\n\n\t\tthis.help()\n\t}\n}\n",
|
|
9
9
|
"#!/usr/bin/env node\n\nimport packageJson from \"../package.json\" with { type: \"json\" }\nimport { LintCommand } from \"./commands/lint.js\"\n\nconst program = new LintCommand()\nprogram.name(packageJson.name)\nprogram.description(packageJson.description)\nprogram.version(packageJson.version)\n\nprogram.parse()\n"
|
|
10
10
|
],
|
|
11
|
-
"mappings": ";
|
|
12
|
-
"debugId": "
|
|
11
|
+
"mappings": ";u5BAAA,kBAAS,kBCAT,qBAEO,MAAM,CAAO,OACJ,gBAER,YAAW,EAAW,CAC5B,IAAK,EAAO,SACX,EAAO,SAAW,IAAI,EAEvB,OAAO,EAAO,SAGP,WAAW,EAAG,EAEtB,KAAK,CAAC,EAAe,EAAiB,CAErC,GADkB,EAAQ,SAAS;AAAA,CAAI,EAEtC,QAAQ,MAAM,GAAG,EAAM,IAAI,CAAK;AAAA,EAAO,GAAS,EAEhD,aAAQ,MAAM,GAAG,EAAM,IAAI,CAAK,MAAM,GAAS,EAGlD,CAEO,IAAM,EAAS,EAAO,YAAY,EDpBlC,MAAe,UAAoB,CAAQ,CACjD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M,EAAE,IAAI,EAE1E,GAAI,EAAgB,OAAS,EAC5B,QAAQ,KAAK,gBAAe,EAAgB,KAAK,IAAI,GAAG,EAGzD,GAAI,EAAY,OAAS,EACxB,QAAQ,MAAM,aAAY,EAAY,KAAK,IAAI,GAAG,EAI5C,eAAe,CAAC,EAAqB,EAAkC,CAE9E,GAAI,EAAQ,IAAK,OAAO,EAGxB,IAAM,EAAgB,EAAM,OAAO,CAAC,IAAS,EAAQ,EAAK,KAAK,EAC/D,GAAI,EAAc,SAAW,EAAG,OAAO,EAEvC,KAAK,KAAK,EAEZ,CCxEA,IAAM,EAAU,IAAI,EACpB,EAAQ,KAAK,EAAY,IAAI,EAC7B,EAAQ,YAAY,EAAY,WAAW,EAC3C,EAAQ,QAAQ,EAAY,OAAO,EAEnC,EAAQ,MAAM",
|
|
12
|
+
"debugId": "E9CE7EF9039B0C1564756E2164756E21",
|
|
13
13
|
"names": []
|
|
14
14
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@circlesac/lint",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.2",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"main": "dist/main.js",
|
|
6
6
|
"exports": {
|
|
@@ -34,6 +34,7 @@
|
|
|
34
34
|
"@tszen/trycatch": "^0.1.0",
|
|
35
35
|
"chalk": "^4.1.2",
|
|
36
36
|
"commander": "^14.0.0",
|
|
37
|
+
"eslint": "^9.34.0",
|
|
37
38
|
"read-package-up": "^11.0.0"
|
|
38
39
|
},
|
|
39
40
|
"devDependencies": {
|
|
@@ -41,7 +42,6 @@
|
|
|
41
42
|
"@types/bun": "^1.2.21",
|
|
42
43
|
"@types/node": "^24.3.0",
|
|
43
44
|
"@vitest/coverage-v8": "3.2.4",
|
|
44
|
-
"eslint": "^9.34.0",
|
|
45
45
|
"globals": "^16.3.0",
|
|
46
46
|
"typescript": "^5.9.2",
|
|
47
47
|
"typescript-eslint": "^8.42.0",
|
|
@@ -51,10 +51,7 @@
|
|
|
51
51
|
"build": "barrels && bun lint && tsc --noEmit && bun run build.ts",
|
|
52
52
|
"dev": "bun run src/main.ts",
|
|
53
53
|
"start": "bun run build && bun run dist/main.js",
|
|
54
|
-
"lint": "bun
|
|
55
|
-
"lint:eslint": "eslint . --fix",
|
|
56
|
-
"lint:prettier": "prettier '**/*.{ts,tsx,js,jsx,json,md,cjs,mjs,mts,yml,yaml}' --write",
|
|
57
|
-
"lint:biome": "biome check --write",
|
|
54
|
+
"lint": "bun dev --all",
|
|
58
55
|
"test": "vitest run --coverage",
|
|
59
56
|
"version:patch": "npm version patch",
|
|
60
57
|
"version:minor": "npm version minor",
|