@agimon-ai/vibe-lint-plugin-doom-cli 0.0.1-alpha.10
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/LICENSE +21 -0
- package/README.md +3 -0
- package/dist/_virtual/_rolldown/runtime.cjs +1 -0
- package/dist/index.cjs +3 -0
- package/dist/index.cjs.map +1 -0
- package/dist/index.d.cts +8 -0
- package/dist/index.d.cts.map +1 -0
- package/dist/index.d.mts +8 -0
- package/dist/index.d.mts.map +1 -0
- package/dist/index.mjs +3 -0
- package/dist/index.mjs.map +1 -0
- package/package.json +65 -0
package/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 Vuong Ngo
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
package/README.md
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
var e=Object.create,t=Object.defineProperty,n=Object.getOwnPropertyDescriptor,r=Object.getOwnPropertyNames,i=Object.getPrototypeOf,a=Object.prototype.hasOwnProperty,o=(e,i,o,s)=>{if(i&&typeof i==`object`||typeof i==`function`)for(var c=r(i),l=0,u=c.length,d;l<u;l++)d=c[l],!a.call(e,d)&&d!==o&&t(e,d,{get:(e=>i[e]).bind(null,d),enumerable:!(s=n(i,d))||s.enumerable});return e},s=(n,r,s)=>(s=n==null?{}:e(i(n)),o(r||!n||!n.__esModule||!a.call(n,`default`)?t(s,`default`,{value:n,enumerable:!0}):s,n));exports.__toESM=s;
|
package/dist/index.cjs
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:`Module`}});const e=require("./_virtual/_rolldown/runtime.cjs");let t=require("node:fs");t=e.__toESM(t,1);let n=require("node:path");n=e.__toESM(n,1);let r=require("typescript");r=e.__toESM(r,1);const i=new Set([`bin`,`cli`,`composition`,`builders`,`compiler`,`extensions`,`exports`,`prompts`]),a={preflight:!0,rule:`Keep Doompi cli ownership explicit in folders, imports, and package exports`,rationale:`Core owns reusable runtime logic. CLI builders and composition select and wire features. Feature-specific policies remain in their owning packages.`,check(e,a){if(!t.default.existsSync(e))return null;let o=n.default.relative(a,e).replaceAll(n.default.sep,`/`),s=[];if(o.startsWith(`src/`)&&!i.has(o.split(`/`)[1])&&s.push(`Unsupported source folder: ${o}`),o.startsWith(`src/`)&&/\.[cm]?tsx?$/.test(o)){let i=r.default.createSourceFile(e,t.default.readFileSync(e,`utf8`),r.default.ScriptTarget.Latest,!0),c=t=>{let r=t.startsWith(`.`)?n.default.relative(a,n.default.resolve(n.default.dirname(e),t)).split(n.default.sep).join(`/`):void 0;(o.startsWith(`src/builders/`)||o.startsWith(`src/composition/`))&&r?.startsWith(`src/cli/`)&&s.push(`Subsystem code cannot depend on command handling: ${t}`),o.startsWith(`src/compiler/`)&&r&&/^src\/(?:cli|builders|composition)\//.test(r)&&s.push(`Compiler mechanics cannot depend on distribution policy: ${t}`)},l=e=>{if((r.default.isImportDeclaration(e)||r.default.isExportDeclaration(e))&&e.moduleSpecifier&&r.default.isStringLiteralLike(e.moduleSpecifier)){let t=e.moduleSpecifier.text;c(t),/doompi-(?:extension-contracts|web-contracts|kernel)(?:\/|$)/.test(t)&&s.push(`Removed package: ${t}`),t.includes(`/src/`)&&s.push(`Import a package capability export: ${t}`)}r.default.isCallExpression(e)&&e.expression.kind===r.default.SyntaxKind.ImportKeyword&&e.arguments[0]&&r.default.isStringLiteralLike(e.arguments[0])&&c(e.arguments[0].text),r.default.forEachChild(e,l)};l(i)}return s.length?[...new Set(s)].join(`
|
|
2
|
+
`):null}},o={preflight:!0,rule:`Keep the generated Pi dispatcher marker fixed at 1`,rationale:`Generated content determines freshness. Changing the ownership marker creates needless migration code.`,check(e,i){if(n.default.relative(i,e).replaceAll(n.default.sep,`/`)!==`src/builders/cli/piExtensionDispatcher/index.ts`||!t.default.existsSync(e))return null;let a=r.default.createSourceFile(e,t.default.readFileSync(e,`utf8`),r.default.ScriptTarget.Latest,!0);for(let e of a.statements)if(r.default.isVariableStatement(e)){for(let t of e.declarationList.declarations)if(r.default.isIdentifier(t.name)&&t.name.text===`PI_DISPATCHER_VERSION`)return t.initializer&&r.default.isNumericLiteral(t.initializer)&&t.initializer.text===`1`?null:`PI_DISPATCHER_VERSION must remain 1`}return`PI_DISPATCHER_VERSION must remain 1`}},s={name:`doom-cli`,rules:{"doom-cli-architecture":a,"stable-dispatcher-marker":o},patterns:{ownership:{description:a.rule,includes:[`src/**/*.ts`,`package.json`]}},configs:{recommended:{rules:{"doom-cli-architecture":`error`,"stable-dispatcher-marker":`error`}}}};exports.architecture=a,exports.default=s,exports.stableDispatcherMarker=o;
|
|
3
|
+
//# sourceMappingURL=index.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.cjs","names":["fs","path","ts"],"sources":["../src/index.ts"],"sourcesContent":["import fs from 'node:fs';\nimport path from 'node:path';\n\nimport type { RuleDefinition, VibeLintPlugin } from '@agimon-ai/vibe-lint';\nimport ts from 'typescript';\nconst folders = new Set(['bin', 'cli', 'composition', 'builders', 'compiler', 'extensions', 'exports', 'prompts']);\nexport const architecture: RuleDefinition = {\n preflight: true,\n rule: 'Keep Doompi cli ownership explicit in folders, imports, and package exports',\n rationale:\n 'Core owns reusable runtime logic. CLI builders and composition select and wire features. Feature-specific policies remain in their owning packages.',\n check(filePath, configRoot) {\n if (!fs.existsSync(filePath)) return null;\n const relative = path.relative(configRoot, filePath).replaceAll(path.sep, '/');\n const problems: string[] = [];\n if (relative.startsWith('src/') && !folders.has(relative.split('/')[1]!))\n problems.push(`Unsupported source folder: ${relative}`);\n if (relative.startsWith('src/') && /\\.[cm]?tsx?$/.test(relative)) {\n const source = ts.createSourceFile(filePath, fs.readFileSync(filePath, 'utf8'), ts.ScriptTarget.Latest, true);\n const checkReference = (reference: string): void => {\n const target = reference.startsWith('.')\n ? path\n .relative(configRoot, path.resolve(path.dirname(filePath), reference))\n .split(path.sep)\n .join('/')\n : undefined;\n if (\n (relative.startsWith('src/builders/') || relative.startsWith('src/composition/')) &&\n target?.startsWith('src/cli/')\n )\n problems.push(`Subsystem code cannot depend on command handling: ${reference}`);\n if (relative.startsWith('src/compiler/') && target && /^src\\/(?:cli|builders|composition)\\//.test(target))\n problems.push(`Compiler mechanics cannot depend on distribution policy: ${reference}`);\n };\n const visit = (node: ts.Node): void => {\n if (\n (ts.isImportDeclaration(node) || ts.isExportDeclaration(node)) &&\n node.moduleSpecifier &&\n ts.isStringLiteralLike(node.moduleSpecifier)\n ) {\n const reference = node.moduleSpecifier.text;\n checkReference(reference);\n if (/doompi-(?:extension-contracts|web-contracts|kernel)(?:\\/|$)/.test(reference))\n problems.push(`Removed package: ${reference}`);\n if (reference.includes('/src/')) problems.push(`Import a package capability export: ${reference}`);\n }\n if (\n ts.isCallExpression(node) &&\n node.expression.kind === ts.SyntaxKind.ImportKeyword &&\n node.arguments[0] &&\n ts.isStringLiteralLike(node.arguments[0])\n )\n checkReference(node.arguments[0].text);\n ts.forEachChild(node, visit);\n };\n visit(source);\n }\n return problems.length ? [...new Set(problems)].join('\\n') : null;\n },\n};\n\nexport const stableDispatcherMarker: RuleDefinition = {\n preflight: true,\n rule: 'Keep the generated Pi dispatcher marker fixed at 1',\n rationale: 'Generated content determines freshness. Changing the ownership marker creates needless migration code.',\n check(filePath, configRoot) {\n const relative = path.relative(configRoot, filePath).replaceAll(path.sep, '/');\n if (relative !== 'src/builders/cli/piExtensionDispatcher/index.ts' || !fs.existsSync(filePath)) return null;\n const source = ts.createSourceFile(filePath, fs.readFileSync(filePath, 'utf8'), ts.ScriptTarget.Latest, true);\n for (const statement of source.statements) {\n if (!ts.isVariableStatement(statement)) continue;\n for (const declaration of statement.declarationList.declarations) {\n if (ts.isIdentifier(declaration.name) && declaration.name.text === 'PI_DISPATCHER_VERSION') {\n return declaration.initializer &&\n ts.isNumericLiteral(declaration.initializer) &&\n declaration.initializer.text === '1'\n ? null\n : 'PI_DISPATCHER_VERSION must remain 1';\n }\n }\n }\n return 'PI_DISPATCHER_VERSION must remain 1';\n },\n};\n\nconst plugin: VibeLintPlugin = {\n name: 'doom-cli',\n rules: {\n 'doom-cli-architecture': architecture,\n 'stable-dispatcher-marker': stableDispatcherMarker,\n },\n patterns: { ownership: { description: architecture.rule, includes: ['src/**/*.ts', 'package.json'] } },\n configs: {\n recommended: {\n rules: { 'doom-cli-architecture': 'error', 'stable-dispatcher-marker': 'error' },\n },\n },\n};\nexport default plugin;\n"],"mappings":"sRAKA,MAAM,EAAU,IAAI,IAAI,CAAC,MAAO,MAAO,cAAe,WAAY,WAAY,aAAc,UAAW,SAAS,CAAC,EACpG,EAA+B,CAC1C,U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,CAAE,wBAAyB,QAAS,2BAA4B,OAAQ,CACjF,CACF,CACF"}
|
package/dist/index.d.cts
ADDED
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { RuleDefinition, VibeLintPlugin } from "@agimon-ai/vibe-lint";
|
|
2
|
+
//#region src/index.d.ts
|
|
3
|
+
export declare const architecture: RuleDefinition;
|
|
4
|
+
export declare const stableDispatcherMarker: RuleDefinition;
|
|
5
|
+
declare const plugin: VibeLintPlugin;
|
|
6
|
+
//#endregion
|
|
7
|
+
export { plugin as default };
|
|
8
|
+
//# sourceMappingURL=index.d.cts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.cts","names":[],"sources":["../src/index.ts"],"mappings":";;qBAMa,cAAc;qBAuDd,wBAAwB;cAwB/B,QAAQ"}
|
package/dist/index.d.mts
ADDED
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { RuleDefinition, VibeLintPlugin } from "@agimon-ai/vibe-lint";
|
|
2
|
+
//#region src/index.d.ts
|
|
3
|
+
export declare const architecture: RuleDefinition;
|
|
4
|
+
export declare const stableDispatcherMarker: RuleDefinition;
|
|
5
|
+
declare const plugin: VibeLintPlugin;
|
|
6
|
+
//#endregion
|
|
7
|
+
export { plugin as default };
|
|
8
|
+
//# sourceMappingURL=index.d.mts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.mts","names":[],"sources":["../src/index.ts"],"mappings":";;qBAMa,cAAc;qBAuDd,wBAAwB;cAwB/B,QAAQ"}
|
package/dist/index.mjs
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
import e from"node:fs";import t from"node:path";import n from"typescript";const r=new Set([`bin`,`cli`,`composition`,`builders`,`compiler`,`extensions`,`exports`,`prompts`]),i={preflight:!0,rule:`Keep Doompi cli ownership explicit in folders, imports, and package exports`,rationale:`Core owns reusable runtime logic. CLI builders and composition select and wire features. Feature-specific policies remain in their owning packages.`,check(i,a){if(!e.existsSync(i))return null;let o=t.relative(a,i).replaceAll(t.sep,`/`),s=[];if(o.startsWith(`src/`)&&!r.has(o.split(`/`)[1])&&s.push(`Unsupported source folder: ${o}`),o.startsWith(`src/`)&&/\.[cm]?tsx?$/.test(o)){let r=n.createSourceFile(i,e.readFileSync(i,`utf8`),n.ScriptTarget.Latest,!0),c=e=>{let n=e.startsWith(`.`)?t.relative(a,t.resolve(t.dirname(i),e)).split(t.sep).join(`/`):void 0;(o.startsWith(`src/builders/`)||o.startsWith(`src/composition/`))&&n?.startsWith(`src/cli/`)&&s.push(`Subsystem code cannot depend on command handling: ${e}`),o.startsWith(`src/compiler/`)&&n&&/^src\/(?:cli|builders|composition)\//.test(n)&&s.push(`Compiler mechanics cannot depend on distribution policy: ${e}`)},l=e=>{if((n.isImportDeclaration(e)||n.isExportDeclaration(e))&&e.moduleSpecifier&&n.isStringLiteralLike(e.moduleSpecifier)){let t=e.moduleSpecifier.text;c(t),/doompi-(?:extension-contracts|web-contracts|kernel)(?:\/|$)/.test(t)&&s.push(`Removed package: ${t}`),t.includes(`/src/`)&&s.push(`Import a package capability export: ${t}`)}n.isCallExpression(e)&&e.expression.kind===n.SyntaxKind.ImportKeyword&&e.arguments[0]&&n.isStringLiteralLike(e.arguments[0])&&c(e.arguments[0].text),n.forEachChild(e,l)};l(r)}return s.length?[...new Set(s)].join(`
|
|
2
|
+
`):null}},a={preflight:!0,rule:`Keep the generated Pi dispatcher marker fixed at 1`,rationale:`Generated content determines freshness. Changing the ownership marker creates needless migration code.`,check(r,i){if(t.relative(i,r).replaceAll(t.sep,`/`)!==`src/builders/cli/piExtensionDispatcher/index.ts`||!e.existsSync(r))return null;let a=n.createSourceFile(r,e.readFileSync(r,`utf8`),n.ScriptTarget.Latest,!0);for(let e of a.statements)if(n.isVariableStatement(e)){for(let t of e.declarationList.declarations)if(n.isIdentifier(t.name)&&t.name.text===`PI_DISPATCHER_VERSION`)return t.initializer&&n.isNumericLiteral(t.initializer)&&t.initializer.text===`1`?null:`PI_DISPATCHER_VERSION must remain 1`}return`PI_DISPATCHER_VERSION must remain 1`}},o={name:`doom-cli`,rules:{"doom-cli-architecture":i,"stable-dispatcher-marker":a},patterns:{ownership:{description:i.rule,includes:[`src/**/*.ts`,`package.json`]}},configs:{recommended:{rules:{"doom-cli-architecture":`error`,"stable-dispatcher-marker":`error`}}}};export{i as architecture,o as default,a as stableDispatcherMarker};
|
|
3
|
+
//# sourceMappingURL=index.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.mjs","names":[],"sources":["../src/index.ts"],"sourcesContent":["import fs from 'node:fs';\nimport path from 'node:path';\n\nimport type { RuleDefinition, VibeLintPlugin } from '@agimon-ai/vibe-lint';\nimport ts from 'typescript';\nconst folders = new Set(['bin', 'cli', 'composition', 'builders', 'compiler', 'extensions', 'exports', 'prompts']);\nexport const architecture: RuleDefinition = {\n preflight: true,\n rule: 'Keep Doompi cli ownership explicit in folders, imports, and package exports',\n rationale:\n 'Core owns reusable runtime logic. CLI builders and composition select and wire features. Feature-specific policies remain in their owning packages.',\n check(filePath, configRoot) {\n if (!fs.existsSync(filePath)) return null;\n const relative = path.relative(configRoot, filePath).replaceAll(path.sep, '/');\n const problems: string[] = [];\n if (relative.startsWith('src/') && !folders.has(relative.split('/')[1]!))\n problems.push(`Unsupported source folder: ${relative}`);\n if (relative.startsWith('src/') && /\\.[cm]?tsx?$/.test(relative)) {\n const source = ts.createSourceFile(filePath, fs.readFileSync(filePath, 'utf8'), ts.ScriptTarget.Latest, true);\n const checkReference = (reference: string): void => {\n const target = reference.startsWith('.')\n ? path\n .relative(configRoot, path.resolve(path.dirname(filePath), reference))\n .split(path.sep)\n .join('/')\n : undefined;\n if (\n (relative.startsWith('src/builders/') || relative.startsWith('src/composition/')) &&\n target?.startsWith('src/cli/')\n )\n problems.push(`Subsystem code cannot depend on command handling: ${reference}`);\n if (relative.startsWith('src/compiler/') && target && /^src\\/(?:cli|builders|composition)\\//.test(target))\n problems.push(`Compiler mechanics cannot depend on distribution policy: ${reference}`);\n };\n const visit = (node: ts.Node): void => {\n if (\n (ts.isImportDeclaration(node) || ts.isExportDeclaration(node)) &&\n node.moduleSpecifier &&\n ts.isStringLiteralLike(node.moduleSpecifier)\n ) {\n const reference = node.moduleSpecifier.text;\n checkReference(reference);\n if (/doompi-(?:extension-contracts|web-contracts|kernel)(?:\\/|$)/.test(reference))\n problems.push(`Removed package: ${reference}`);\n if (reference.includes('/src/')) problems.push(`Import a package capability export: ${reference}`);\n }\n if (\n ts.isCallExpression(node) &&\n node.expression.kind === ts.SyntaxKind.ImportKeyword &&\n node.arguments[0] &&\n ts.isStringLiteralLike(node.arguments[0])\n )\n checkReference(node.arguments[0].text);\n ts.forEachChild(node, visit);\n };\n visit(source);\n }\n return problems.length ? [...new Set(problems)].join('\\n') : null;\n },\n};\n\nexport const stableDispatcherMarker: RuleDefinition = {\n preflight: true,\n rule: 'Keep the generated Pi dispatcher marker fixed at 1',\n rationale: 'Generated content determines freshness. Changing the ownership marker creates needless migration code.',\n check(filePath, configRoot) {\n const relative = path.relative(configRoot, filePath).replaceAll(path.sep, '/');\n if (relative !== 'src/builders/cli/piExtensionDispatcher/index.ts' || !fs.existsSync(filePath)) return null;\n const source = ts.createSourceFile(filePath, fs.readFileSync(filePath, 'utf8'), ts.ScriptTarget.Latest, true);\n for (const statement of source.statements) {\n if (!ts.isVariableStatement(statement)) continue;\n for (const declaration of statement.declarationList.declarations) {\n if (ts.isIdentifier(declaration.name) && declaration.name.text === 'PI_DISPATCHER_VERSION') {\n return declaration.initializer &&\n ts.isNumericLiteral(declaration.initializer) &&\n declaration.initializer.text === '1'\n ? null\n : 'PI_DISPATCHER_VERSION must remain 1';\n }\n }\n }\n return 'PI_DISPATCHER_VERSION must remain 1';\n },\n};\n\nconst plugin: VibeLintPlugin = {\n name: 'doom-cli',\n rules: {\n 'doom-cli-architecture': architecture,\n 'stable-dispatcher-marker': stableDispatcherMarker,\n },\n patterns: { ownership: { description: architecture.rule, includes: ['src/**/*.ts', 'package.json'] } },\n configs: {\n recommended: {\n rules: { 'doom-cli-architecture': 'error', 'stable-dispatcher-marker': 'error' },\n },\n },\n};\nexport default plugin;\n"],"mappings":"0EAKA,MAAM,EAAU,IAAI,IAAI,CAAC,MAAO,MAAO,cAAe,WAAY,WAAY,aAAc,UAAW,SAAS,CAAC,EACpG,EAA+B,CAC1C,UAAW,GACX,KAAM,8EACN,UACE,sJACF,MAAM,EAAU,EAAY,CAC1B,GAAI,CAAC,EAAG,WAAW,CAAQ,EAAG,OAAO,KACrC,IAAM,EAAW,EAAK,SAAS,EAAY,CAAQ,CAAC,CAAC,WAAW,EAAK,IAAK,GAAG,EACvE,EAAqB,CAAC,EAG5B,GAFI,EAAS,WAAW,MAAM,GAAK,CAAC,EAAQ,IAAI,EAAS,MAAM,GAAG,CAAC,CAAC,EAAG,GACrE,EAAS,KAAK,8BAA8B,GAAU,EACpD,EAAS,WAAW,MAAM,GAAK,eAAe,KAAK,CAAQ,EAAG,CAChE,IAAM,EAAS,EAAG,iBAAiB,EAAU,EAAG,aAAa,EAAU,MAAM,EAAG,EAAG,aAAa,OAAQ,EAAI,EACtG,EAAkB,GAA4B,CAClD,IAAM,EAAS,EAAU,WAAW,GAAG,EACnC,EACG,SAAS,EAAY,EAAK,QAAQ,EAAK,QAAQ,CAAQ,EAAG,CAAS,CAAC,CAAC,CACrE,MAAM,EAAK,GAAG,CAAC,CACf,KAAK,GAAG,EACX,IAAA,IAED,EAAS,WAAW,eAAe,GAAK,EAAS,WAAW,kBAAkB,IAC/E,GAAQ,WAAW,UAAU,GAE7B,EAAS,KAAK,qDAAqD,GAAW,EAC5E,EAAS,WAAW,eAAe,GAAK,GAAU,uCAAuC,KAAK,CAAM,GACtG,EAAS,KAAK,4DAA4D,GAAW,CACzF,EACM,EAAS,GAAwB,CACrC,IACG,EAAG,oBAAoB,CAAI,GAAK,EAAG,oBAAoB,CAAI,IAC5D,EAAK,iBACL,EAAG,oBAAo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E,CAAE,EACrG,QAAS,CACP,YAAa,CACX,MAAO,CAAE,wBAAyB,QAAS,2BAA4B,OAAQ,CACjF,CACF,CACF"}
|
package/package.json
ADDED
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@agimon-ai/vibe-lint-plugin-doom-cli",
|
|
3
|
+
"version": "0.0.1-alpha.10",
|
|
4
|
+
"description": "Architecture rules for Doompi cli packages",
|
|
5
|
+
"keywords": [
|
|
6
|
+
"doompi",
|
|
7
|
+
"lint",
|
|
8
|
+
"typescript",
|
|
9
|
+
"vibe-lint"
|
|
10
|
+
],
|
|
11
|
+
"homepage": "https://agimon.ai",
|
|
12
|
+
"bugs": {
|
|
13
|
+
"url": "https://github.com/AgiFlow/doompi/issues"
|
|
14
|
+
},
|
|
15
|
+
"license": "MIT",
|
|
16
|
+
"author": "Vuong Ngo",
|
|
17
|
+
"repository": {
|
|
18
|
+
"type": "git",
|
|
19
|
+
"url": "git+https://github.com/AgiFlow/doompi.git",
|
|
20
|
+
"directory": "packages/tooling/vibe-lint-plugin-doom-cli"
|
|
21
|
+
},
|
|
22
|
+
"files": [
|
|
23
|
+
"dist",
|
|
24
|
+
"README.md"
|
|
25
|
+
],
|
|
26
|
+
"type": "module",
|
|
27
|
+
"sideEffects": false,
|
|
28
|
+
"main": "./dist/index.cjs",
|
|
29
|
+
"module": "./dist/index.mjs",
|
|
30
|
+
"types": "./dist/index.d.mts",
|
|
31
|
+
"exports": {
|
|
32
|
+
".": {
|
|
33
|
+
"types": "./dist/index.d.mts",
|
|
34
|
+
"import": "./dist/index.mjs",
|
|
35
|
+
"require": "./dist/index.cjs"
|
|
36
|
+
},
|
|
37
|
+
"./package.json": "./package.json"
|
|
38
|
+
},
|
|
39
|
+
"publishConfig": {
|
|
40
|
+
"access": "public"
|
|
41
|
+
},
|
|
42
|
+
"dependencies": {
|
|
43
|
+
"typescript": "6.0.3"
|
|
44
|
+
},
|
|
45
|
+
"devDependencies": {
|
|
46
|
+
"@agimon-ai/vibe-lint": "0.0.1-alpha.35",
|
|
47
|
+
"@types/node": "26.5.1",
|
|
48
|
+
"@vitest/coverage-v8": "5.0.0",
|
|
49
|
+
"tsdown": "0.23.0",
|
|
50
|
+
"vitest": "5.0.0"
|
|
51
|
+
},
|
|
52
|
+
"peerDependencies": {
|
|
53
|
+
"@agimon-ai/vibe-lint": "0.0.1-alpha.35"
|
|
54
|
+
},
|
|
55
|
+
"engines": {
|
|
56
|
+
"node": ">=22.19.0"
|
|
57
|
+
},
|
|
58
|
+
"scripts": {
|
|
59
|
+
"build": "tsdown",
|
|
60
|
+
"test": "vitest --run",
|
|
61
|
+
"typecheck": "tsc --noEmit",
|
|
62
|
+
"lint": "oxlint . && oxfmt . --check",
|
|
63
|
+
"fixcode": "oxlint . --fix && oxfmt ."
|
|
64
|
+
}
|
|
65
|
+
}
|