@batijs/core 0.0.544 → 0.0.548
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/index.d.ts +1 -0
- package/dist/index.js +2 -2
- package/package.json +2 -2
package/dist/index.d.ts
CHANGED
|
@@ -93,6 +93,7 @@ declare class MarkdownV2 implements StringTransformer {
|
|
|
93
93
|
interface PackageJsonDeps {
|
|
94
94
|
dependencies?: Record<string, string>;
|
|
95
95
|
devDependencies?: Record<string, string>;
|
|
96
|
+
peerDependencies?: Record<string, string>;
|
|
96
97
|
}
|
|
97
98
|
interface PackageJsonScripts {
|
|
98
99
|
scripts?: Record<string, string>;
|
package/dist/index.js
CHANGED
|
@@ -1135,7 +1135,7 @@ ${t}
|
|
|
1135
1135
|
Old \`scripts.${t}\`: ${zct(e)}
|
|
1136
1136
|
New \`scripts.${t}\`: ${zct(r)}
|
|
1137
1137
|
You can check https://batijs.dev for more details.
|
|
1138
|
-
`))}var HIe=class t{static previousScripts={};static forcedDependencies=new Set;static dependenciesScriptsRelation=new Map;pendingAddedDependencies;pendingReplacedScripts;packageJson;scopedPackageJson;constructor(e,r){this.packageJson=structuredClone(e),this.scopedPackageJson=r,this.pendingAddedDependencies=[],this.pendingReplacedScripts=[]}setScript(e,r,i=!0){if(!i)return this;let a=t.previousScripts[e]??{precedence:-1/0};return r.precedence>a.precedence?(a.warnIfReplaced&&a.value&&cir(e,a.value,r.value),this.packageJson.scripts??={},this.packageJson.scripts[e]=r.value,t.previousScripts[e]=Object.assign({precedence:-1/0},r),a.value&&this.pendingReplacedScripts.push(e)):r.warnIfReplaced&&a.value&&cir(e,r.value,a.value),this}removeScript(e,r=!0){return r?(t.previousScripts[e]={precedence:-1/0},this.pendingReplacedScripts.push(e),delete this.packageJson.scripts[e],this):this}addDependencies(e,r,i){return typeof r=="boolean"?(i=r,r=[]):typeof i!="boolean"&&(i=!0,r??=[]),i?(this._addDependencies("dependencies",e),this._onlyUsedBy(e,r),this):this}addDevDependencies(e,r,i){return typeof r=="boolean"?(i=r,r=[]):typeof i!="boolean"&&(i=!0,r??=[]),i?(this._addDependencies("devDependencies",e),this._onlyUsedBy(e,r),this):this}finalize(){for(let e of this.pendingAddedDependencies)t.dependenciesScriptsRelation.has(e)||t.forcedDependencies.add(e);for(let e of this.pendingReplacedScripts)if(!t.forcedDependencies.has(e))for(let[r,i]of t.dependenciesScriptsRelation.entries())i.has(e)&&(i.delete(e),i.size===0&&(this.removeDependency(r),t.dependenciesScriptsRelation.delete(r)));return JSON.stringify(this.packageJson,void 0,2)}static clear(){t.previousScripts={},t.forcedDependencies=new Set,t.dependenciesScriptsRelation=new Map}_onlyUsedBy(e,r=[]){for(let i of e){t.dependenciesScriptsRelation.has(i)||t.dependenciesScriptsRelation.set(i,new Set);for(let a of r)t.dependenciesScriptsRelation.get(i).add(a)}}_addDependencies(e,r){let i=e==="devDependencies"?"dependencies":"devDependencies";this.packageJson[e]??={};let a=new Map(uni(this.scopedPackageJson));for(let[l,u]of pni(a,r)){let f=this.packageJson[i]??{};l in f||(this.packageJson[e][l]=u,this.pendingAddedDependencies.push(l))}}removeDependency(e){return this.packageJson.devDependencies?.[e]&&delete this.packageJson.devDependencies[e],this.packageJson.dependencies?.[e]&&delete this.packageJson.dependencies[e],this.packageJson}};async function PEs({readfile:t}){let e=await t?.();return tir(e??"")}async function kEs({readfile:t,source:e,target:r}){let i=await t?.();return Ehe(typeof i=="string",`Unable to load previous JSON module ("${e}" -> "${r}")`),JSON.parse(i)}async function NEs({readfile:t,source:e,target:r},i){let a=await t?.();return Ehe(typeof a=="string",`Unable to load previous JSON module ("${e}" -> "${r}")`),new HIe(JSON.parse(a),i)}async function IEs({readfile:t,source:e,target:r}){let i=await t?.();return Ehe(typeof i=="string",`Unable to load previous module ("${e}" -> "${r}")`),Wme(i)}async function OEs(t,e){let r=dni(e.url),i=fni(r);return ANe(_ni(i,t))}async function FEs({readfile:t,source:e,target:r},i){let a=await t?.();return Ehe(typeof a=="string"||i?.fallbackEmpty,`Unable to load previous YAML module ("${e}" -> "${r}")`),(0,lir.parseDocument)(a??"",i)}function uir(t,e){if(typeof e=="object"&&e!==null)for(let r in e){let i=t[r],a=e[r];i!==a&&(typeof i=="object"&&i!==null&&typeof a=="object"&&a!==null?uir(i,a):t[r]=a)}}function mni(t){return pir(t.exports.default)}function hni(t){if(t.exports.default.$type!=="identifier")throw new NT(`Not supported: Cannot modify this kind of default export (${t.exports.default.$type})`);let e=t.exports.default.$name;for(let r of t.$ast.body)if(r.type==="VariableDeclaration"){for(let i of r.declarations)if(i.id.type==="Identifier"&&i.id.name===e&&i.init){let a=aR(i.init.type==="TSSatisfiesExpression"?i.init.expression:i.init).code;return{declaration:i,config:pir(CNe(a))}}}throw new NT("Couldn't find config declaration")}function pir(t){return t.$type==="function-call"?t.$args[0]:t}function gni(t,e){let r=mni(t);return r.$type==="identifier"?yni(t,e):fir(e,r),t.imports.$prepend({from:e.from,local:e.constructor,imported:e.imported||"default"}),!0}function yni(t,e){let{config:r,declaration:i}=hni(t);fir(e,r),i.init&&(i.init.type==="ObjectExpression"?i.init=aR(r).code:i.init.type==="CallExpression"&&i.init.callee.type==="Identifier"?i.init=aR(EK.functionCall(i.init.callee.name,r)).code:i.init.type==="TSSatisfiesExpression"&&(i.init.expression.type==="ObjectExpression"&&(i.init.expression=aR(r).code),i.init.expression.type==="CallExpression"&&i.init.expression.callee.type==="Identifier"&&(i.init.expression=aR(EK.functionCall(i.init.expression.callee.name,r)).code)))}function fir(t,e){let r=t.index??e.plugins?.length??0;e.plugins||=[],e.plugins.splice(r,0,t.options?EK.functionCall(t.constructor,t.options):EK.functionCall(t.constructor))}var Mkr=w_(Gie(),1);import Lkr from"path";function uye(t,e){let r=t.replace(/[\\/]+/g,"/"),i=e.replace(/[\\/]+/g,"/"),a=Lkr.posix.relative(Lkr.dirname(r),i);return a.startsWith("../")?a:`./${a}`}function c6e(t){return t.match(/^@batijs\/[^/]+\/(.+)$/)}function l6e(t,e){let r=c6e(e.source.value),i=Hie(t);if(r){let a=uye(t.filename,r[1]);i?.addImport(a),t.report({node:e,message:"bati/module-imports",*fix(l){yield l.replaceTextRange([e.source.range[0]+1,e.source.range[1]-1],a)}})}else(e.source.value.startsWith("./")||e.source.value.startsWith("../"))&&i?.addImport(e.source.value)}function owi(){return new Mkr.Linter({configType:"flat"})}var Bmt=class{flags;imports;filename;constructor(e){this.filename=e,this.flags=new Set,this.imports=new Set}addImport(e){let r=c6e(e);r?this.imports.add(uye(this.filename,r[1])):this.imports.add(e)}deleteImport(e){let r=c6e(e);r?this.imports.delete(uye(this.filename,r[1])):this.imports.delete(e)}addFlag(e){this.flags.add(e)}};function Hie(t){return t.settings?.extractor}function Rkr(t,e,r){let i=owi(),a=new Bmt(r),l=i.verifyAndFix(t.replaceAll("eslint-disable-next-line","__BATI_EDNL"),[...e,{settings:{extractor:a}}],{filename:r});if(l.messages.length>0)throw new Error(`[eslint] Error while parsing or fixing file ${r}:
|
|
1138
|
+
`))}var HIe=class t{static previousScripts={};static forcedDependencies=new Set;static dependenciesScriptsRelation=new Map;pendingAddedDependencies;pendingReplacedScripts;packageJson;scopedPackageJson;constructor(e,r){this.packageJson=structuredClone(e),this.scopedPackageJson=r,this.pendingAddedDependencies=[],this.pendingReplacedScripts=[]}setScript(e,r,i=!0){if(!i)return this;let a=t.previousScripts[e]??{precedence:-1/0};return r.precedence>a.precedence?(a.warnIfReplaced&&a.value&&cir(e,a.value,r.value),this.packageJson.scripts??={},this.packageJson.scripts[e]=r.value,t.previousScripts[e]=Object.assign({precedence:-1/0},r),a.value&&this.pendingReplacedScripts.push(e)):r.warnIfReplaced&&a.value&&cir(e,r.value,a.value),this}removeScript(e,r=!0){return r?(t.previousScripts[e]={precedence:-1/0},this.pendingReplacedScripts.push(e),delete this.packageJson.scripts[e],this):this}addDependencies(e,r,i){return typeof r=="boolean"?(i=r,r=[]):typeof i!="boolean"&&(i=!0,r??=[]),i?(this._addDependencies("dependencies",e),this._onlyUsedBy(e,r),this):this}addDevDependencies(e,r,i){return typeof r=="boolean"?(i=r,r=[]):typeof i!="boolean"&&(i=!0,r??=[]),i?(this._addDependencies("devDependencies",e),this._onlyUsedBy(e,r),this):this}finalize(){for(let e of this.pendingAddedDependencies)t.dependenciesScriptsRelation.has(e)||t.forcedDependencies.add(e);for(let e of this.pendingReplacedScripts)if(!t.forcedDependencies.has(e))for(let[r,i]of t.dependenciesScriptsRelation.entries())i.has(e)&&(i.delete(e),i.size===0&&(this.removeDependency(r),t.dependenciesScriptsRelation.delete(r)));return this.packageJson.dependencies&&(this.packageJson.dependencies=Object.fromEntries(Object.entries(this.packageJson.dependencies).sort(([e],[r])=>e.localeCompare(r)))),this.packageJson.devDependencies&&(this.packageJson.devDependencies=Object.fromEntries(Object.entries(this.packageJson.devDependencies).sort(([e],[r])=>e.localeCompare(r)))),this.packageJson.peerDependencies&&(this.packageJson.peerDependencies=Object.fromEntries(Object.entries(this.packageJson.peerDependencies).sort(([e],[r])=>e.localeCompare(r)))),JSON.stringify(this.packageJson,void 0,2)}static clear(){t.previousScripts={},t.forcedDependencies=new Set,t.dependenciesScriptsRelation=new Map}_onlyUsedBy(e,r=[]){for(let i of e){t.dependenciesScriptsRelation.has(i)||t.dependenciesScriptsRelation.set(i,new Set);for(let a of r)t.dependenciesScriptsRelation.get(i).add(a)}}_addDependencies(e,r){let i=e==="devDependencies"?"dependencies":"devDependencies";this.packageJson[e]??={};let a=new Map(uni(this.scopedPackageJson));for(let[l,u]of pni(a,r)){let f=this.packageJson[i]??{};l in f||(this.packageJson[e][l]=u,this.pendingAddedDependencies.push(l))}}removeDependency(e){return this.packageJson.devDependencies?.[e]&&delete this.packageJson.devDependencies[e],this.packageJson.dependencies?.[e]&&delete this.packageJson.dependencies[e],this.packageJson}};async function PEs({readfile:t}){let e=await t?.();return tir(e??"")}async function kEs({readfile:t,source:e,target:r}){let i=await t?.();return Ehe(typeof i=="string",`Unable to load previous JSON module ("${e}" -> "${r}")`),JSON.parse(i)}async function NEs({readfile:t,source:e,target:r},i){let a=await t?.();return Ehe(typeof a=="string",`Unable to load previous JSON module ("${e}" -> "${r}")`),new HIe(JSON.parse(a),i)}async function IEs({readfile:t,source:e,target:r}){let i=await t?.();return Ehe(typeof i=="string",`Unable to load previous module ("${e}" -> "${r}")`),Wme(i)}async function OEs(t,e){let r=dni(e.url),i=fni(r);return ANe(_ni(i,t))}async function FEs({readfile:t,source:e,target:r},i){let a=await t?.();return Ehe(typeof a=="string"||i?.fallbackEmpty,`Unable to load previous YAML module ("${e}" -> "${r}")`),(0,lir.parseDocument)(a??"",i)}function uir(t,e){if(typeof e=="object"&&e!==null)for(let r in e){let i=t[r],a=e[r];i!==a&&(typeof i=="object"&&i!==null&&typeof a=="object"&&a!==null?uir(i,a):t[r]=a)}}function mni(t){return pir(t.exports.default)}function hni(t){if(t.exports.default.$type!=="identifier")throw new NT(`Not supported: Cannot modify this kind of default export (${t.exports.default.$type})`);let e=t.exports.default.$name;for(let r of t.$ast.body)if(r.type==="VariableDeclaration"){for(let i of r.declarations)if(i.id.type==="Identifier"&&i.id.name===e&&i.init){let a=aR(i.init.type==="TSSatisfiesExpression"?i.init.expression:i.init).code;return{declaration:i,config:pir(CNe(a))}}}throw new NT("Couldn't find config declaration")}function pir(t){return t.$type==="function-call"?t.$args[0]:t}function gni(t,e){let r=mni(t);return r.$type==="identifier"?yni(t,e):fir(e,r),t.imports.$prepend({from:e.from,local:e.constructor,imported:e.imported||"default"}),!0}function yni(t,e){let{config:r,declaration:i}=hni(t);fir(e,r),i.init&&(i.init.type==="ObjectExpression"?i.init=aR(r).code:i.init.type==="CallExpression"&&i.init.callee.type==="Identifier"?i.init=aR(EK.functionCall(i.init.callee.name,r)).code:i.init.type==="TSSatisfiesExpression"&&(i.init.expression.type==="ObjectExpression"&&(i.init.expression=aR(r).code),i.init.expression.type==="CallExpression"&&i.init.expression.callee.type==="Identifier"&&(i.init.expression=aR(EK.functionCall(i.init.expression.callee.name,r)).code)))}function fir(t,e){let r=t.index??e.plugins?.length??0;e.plugins||=[],e.plugins.splice(r,0,t.options?EK.functionCall(t.constructor,t.options):EK.functionCall(t.constructor))}var Mkr=w_(Gie(),1);import Lkr from"path";function uye(t,e){let r=t.replace(/[\\/]+/g,"/"),i=e.replace(/[\\/]+/g,"/"),a=Lkr.posix.relative(Lkr.dirname(r),i);return a.startsWith("../")?a:`./${a}`}function c6e(t){return t.match(/^@batijs\/[^/]+\/(.+)$/)}function l6e(t,e){let r=c6e(e.source.value),i=Hie(t);if(r){let a=uye(t.filename,r[1]);i?.addImport(a),t.report({node:e,message:"bati/module-imports",*fix(l){yield l.replaceTextRange([e.source.range[0]+1,e.source.range[1]-1],a)}})}else(e.source.value.startsWith("./")||e.source.value.startsWith("../"))&&i?.addImport(e.source.value)}function owi(){return new Mkr.Linter({configType:"flat"})}var Bmt=class{flags;imports;filename;constructor(e){this.filename=e,this.flags=new Set,this.imports=new Set}addImport(e){let r=c6e(e);r?this.imports.add(uye(this.filename,r[1])):this.imports.add(e)}deleteImport(e){let r=c6e(e);r?this.imports.delete(uye(this.filename,r[1])):this.imports.delete(e)}addFlag(e){this.flags.add(e)}};function Hie(t){return t.settings?.extractor}function Rkr(t,e,r){let i=owi(),a=new Bmt(r),l=i.verifyAndFix(t.replaceAll("eslint-disable-next-line","__BATI_EDNL"),[...e,{settings:{extractor:a}}],{filename:r});if(l.messages.length>0)throw new Error(`[eslint] Error while parsing or fixing file ${r}:
|
|
1139
1139
|
${l.messages.map(u=>`${r}:${u.line}:${u.column} => ${u.message}`).join(`
|
|
1140
1140
|
`)}`);return{code:l.output.replaceAll("__BATI_EDNL","eslint-disable-next-line"),context:a}}var rRr=w_(W8e(),1);var n5r=w_(ns(),1),l5r=w_(ns(),1),n5e=w_(ns(),1),f5r=w_(ns(),1),d5r=w_(ns(),1),i5e=w_(ns(),1),g5r=w_(ns(),1),b5r=w_(ns(),1),s5e=w_(ns(),1),a5e=w_(ns(),1),S5r=w_(zMr(),1),x5r=w_(ns(),1),A5r=w_(ns(),1),w5r=w_(ns(),1),k5r=w_(ns(),1),I5r=w_(ns(),1),o5e=w_(ns(),1),L5r=w_(ns(),1),c5e=w_(ns(),1),R5r=w_(T3e(),1),B5r=w_(ns(),1),l5e=w_(ns(),1),V5r=w_(WMr(),1),z5r=w_(KMr(),1);var t8r=w_(e8r(),1);function r8r(t,e){let r=null;if(!t||typeof t!="string")return r;let i=(0,t8r.default)(t),a=typeof e=="function";return i.forEach(l=>{if(l.type!=="declaration")return;let{property:u,value:f}=l;a?e(u,f,l):f&&(r=r||{},r[u]=f)}),r}var W5r=w_(ns(),1);var t5r=Object.getOwnPropertyNames;var D0=(t,e)=>function(){return t&&(e=(0,t[t5r(t)[0]])(t=0)),e},r5r=(t,e)=>function(){return e||(0,t[t5r(t)[0]])((e={exports:{}}).exports,e),e.exports};function bA(t){return typeof t.getSourceCode=="function"?t.getSourceCode():t.sourceCode}function f0e(t,e){let r=bA(t);return typeof r.getScope=="function"?r.getScope(e):typeof t.getScope=="function"?t.getScope():t.sourceCode.getScope(e)}function dL(t,e){return n5r.ASTUtils.findVariable(f0e(t,e),e)}function x1t(t,e,r){typeof t.markVariableAsUsed=="function"?t.markVariableAsUsed(e):bA(t).markVariableAsUsed(e,r)}var ON=D0({"src/compat.ts"(){"use strict"}});function C1t(t,e){return t.parent?L1t(t.parent,e):null}function _0e(t,e){if(t.type==="Identifier"){let r=dL(e,t);if(!r)return t;let i=r.defs[0];switch(i?.type){case"FunctionName":case"ClassName":case"ImportBinding":return i.node;case"Variable":if((i.node.parent.kind==="const"||r.references.every(a=>a.init||a.isReadOnly()))&&i.node.id.type==="Identifier"&&i.node.init)return _0e(i.node.init,e)}}return t}function O1t(t,e=!1){if(t.type==="TSAsExpression"||t.type==="TSNonNullExpression"||t.type==="TSSatisfiesExpression"){let r=e?t.parent:t.expression;if(r)return O1t(r,e)}return t}function CWi(t,e,r){let i=L1t(t,a=>a===e||r(a));return i===e&&!r(t)?null:i}function i5r(t,e,r,i){let a=i.join(", "),u=r.specifiers.slice().reverse().find(_=>_.type==="ImportSpecifier");if(u)return t.insertTextAfter(u,`, ${a}`);let f=r.specifiers.find(_=>_.type==="ImportDefaultSpecifier"||_.type==="ImportNamespaceSpecifier");if(f)return t.insertTextAfter(f,`, { ${a} }`);if(r.specifiers.length===0){let[_,g]=e.getFirstTokens(r,{count:2});return g?.value==="{"?t.insertTextAfter(g,` ${a} `):_?t.insertTextAfter(_,` { ${a} } from`):null}return null}function s5r(t,e,r,i,a,l=!1){let u=i.join(", "),f=e.ast,_=a??f.body.find(g=>g.type==="ImportDeclaration");return _?t.insertTextBeforeRange((c5r(_,e)??_).range,`import ${l?"type ":""}{ ${u} } from "${r}";
|
|
1141
1141
|
`):t.insertTextBeforeRange([0,0],`import ${l?"type ":""}{ ${u} } from "${r}";
|
|
@@ -1157,7 +1157,7 @@ ${R} return (`),yield _.insertTextAfter(z,`);
|
|
|
1157
1157
|
|
|
1158
1158
|
`+a.message+`
|
|
1159
1159
|
`+Array(a.message.length+1).join("=")+`
|
|
1160
|
-
`+IWr(t,r)):a}}var VEt=da("fs"),REt=da("path"),Nps=/^\uFEFF/;function jEt(t,e,r){var i=REt.resolve(r?e:REt.dirname(e),t),a=REt.extname(t);return a||(i+=".sqrl"),i}function Ips(t,e){var r,i,a=e.views,l=/^[A-Za-z]+:\\|^\//.exec(t);if(l&&l.length)r=jEt(t.replace(/^\/*/,""),e.root||"/",!0);else if(e.filename&&(i=jEt(t,e.filename),VEt.existsSync(i)&&(r=i)),r||Array.isArray(a)&&a.some(function(u){return i=jEt(t,u,!0),VEt.existsSync(i)})&&(r=i),!r)throw Zv('Could not find the include file "'+t+'"');return r}function jWr(t){return VEt.readFileSync(t).toString().replace(Nps,"")}function Ops(t,e){var r=m7e(e),i=jWr(t);try{var a=YEt(i,r);return r.storage.templates.define(r.filename,a),a}catch{throw Zv("Loading file: "+t+" failed")}}function Fps(t){var e=t.filename;if(t.cache){var r=t.storage.templates.get(e);return r||Ops(e,t)}return YEt(jWr(e),t)}function BWr(t,e){var r=m7e({filename:Ips(t,e)},e);return Fps(r)}function Lps(t,e,r){if(e&&e.length>0)throw Zv("Helper 'includeFile' doesn't accept blocks");return BWr(t.params[0],r)(t.params[1],r)}function Mps(t,e,r){var i=t.params[1]||{};i.content=t.exec();for(var a=0;a<e.length;a++){var l=e[a];i[l.name]=l.exec()}return BWr(t.params[0],r)(i,r)}function BEt(t,e){var r;return e.cache&&e.name&&e.storage.templates.get(e.name)?e.storage.templates.get(e.name):(typeof t=="function"?r=t:r=YEt(t,e),e.cache&&e.name&&e.storage.templates.define(e.name,r),r)}function UWr(t,e,r,i){var a=m7e(r||{});if(a.async){var l;if(i)try{BEt(t,a)(e,a,i)}catch(u){return i(u)}else{if(typeof kWr=="function")return new kWr(function(u,f){try{l=BEt(t,a)(e,a),u(l)}catch(_){f(_)}});throw Zv("Please provide a callback function, this env doesn't support Promises")}}else return BEt(t,a)(e,a)}zEt.define("includeFile",Lps);zEt.define("extendsFile",Mps);var WEt=["/*{","}*/"];function qWr(t,e){return UWr(t,e,{tags:WEt})}function Rps(t,e){return{eslint:(t.includes("BATI.has")||t.includes("BATI_TEST")||t.includes("/*# BATI ")||t.includes("@batijs/")||e.endsWith(".ts")||e.endsWith(".tsx"))&&!e.endsWith(".css"),squirelly:t.includes(WEt[0])}}var jps=/\/\/\s*eslint(?:-disable|-enable|-disable-next-line|-disable-line)?[^\n]*/gim,Bps=/\/\/\s*biome-ignore[^\n]*/gim,Ups=/\/\*+\s*eslint(?:-disable|-enable|-disable-next-line|-disable-line)?[^\n*]*\*+\//gim,qps=/\/\*+\s*biome-ignore[^\n*]*\*+\//gim,VWr=new RegExp(`${jps.source}|${Ups.source}`,"gim"),zWr=new RegExp(`${Bps.source}|${qps.source}`,"gim");async function Vps(t,e,r){let{eslint:i,squirelly:a}=Rps(t,r.filepath),l=t,u,f=!1;if(a&&(l=qWr(l,e),f=!0),i){let _=PWr(l,r.filepath,e);l=_.code,u=_.context,f=!0}return!e.BATI.has("eslint")&&VWr.test(l)&&(l=l.replace(VWr,""),f=!0),!e.BATI.has("biome")&&zWr.test(l)&&(l=l.replace(zWr,""),f=!0),{code:f?await lst(l,r):l,context:u}}import{randomBytes as cjs}from"crypto";var JEt={name:"@batijs/core",version:"0.0.
|
|
1160
|
+
`+IWr(t,r)):a}}var VEt=da("fs"),REt=da("path"),Nps=/^\uFEFF/;function jEt(t,e,r){var i=REt.resolve(r?e:REt.dirname(e),t),a=REt.extname(t);return a||(i+=".sqrl"),i}function Ips(t,e){var r,i,a=e.views,l=/^[A-Za-z]+:\\|^\//.exec(t);if(l&&l.length)r=jEt(t.replace(/^\/*/,""),e.root||"/",!0);else if(e.filename&&(i=jEt(t,e.filename),VEt.existsSync(i)&&(r=i)),r||Array.isArray(a)&&a.some(function(u){return i=jEt(t,u,!0),VEt.existsSync(i)})&&(r=i),!r)throw Zv('Could not find the include file "'+t+'"');return r}function jWr(t){return VEt.readFileSync(t).toString().replace(Nps,"")}function Ops(t,e){var r=m7e(e),i=jWr(t);try{var a=YEt(i,r);return r.storage.templates.define(r.filename,a),a}catch{throw Zv("Loading file: "+t+" failed")}}function Fps(t){var e=t.filename;if(t.cache){var r=t.storage.templates.get(e);return r||Ops(e,t)}return YEt(jWr(e),t)}function BWr(t,e){var r=m7e({filename:Ips(t,e)},e);return Fps(r)}function Lps(t,e,r){if(e&&e.length>0)throw Zv("Helper 'includeFile' doesn't accept blocks");return BWr(t.params[0],r)(t.params[1],r)}function Mps(t,e,r){var i=t.params[1]||{};i.content=t.exec();for(var a=0;a<e.length;a++){var l=e[a];i[l.name]=l.exec()}return BWr(t.params[0],r)(i,r)}function BEt(t,e){var r;return e.cache&&e.name&&e.storage.templates.get(e.name)?e.storage.templates.get(e.name):(typeof t=="function"?r=t:r=YEt(t,e),e.cache&&e.name&&e.storage.templates.define(e.name,r),r)}function UWr(t,e,r,i){var a=m7e(r||{});if(a.async){var l;if(i)try{BEt(t,a)(e,a,i)}catch(u){return i(u)}else{if(typeof kWr=="function")return new kWr(function(u,f){try{l=BEt(t,a)(e,a),u(l)}catch(_){f(_)}});throw Zv("Please provide a callback function, this env doesn't support Promises")}}else return BEt(t,a)(e,a)}zEt.define("includeFile",Lps);zEt.define("extendsFile",Mps);var WEt=["/*{","}*/"];function qWr(t,e){return UWr(t,e,{tags:WEt})}function Rps(t,e){return{eslint:(t.includes("BATI.has")||t.includes("BATI_TEST")||t.includes("/*# BATI ")||t.includes("@batijs/")||e.endsWith(".ts")||e.endsWith(".tsx"))&&!e.endsWith(".css"),squirelly:t.includes(WEt[0])}}var jps=/\/\/\s*eslint(?:-disable|-enable|-disable-next-line|-disable-line)?[^\n]*/gim,Bps=/\/\/\s*biome-ignore[^\n]*/gim,Ups=/\/\*+\s*eslint(?:-disable|-enable|-disable-next-line|-disable-line)?[^\n*]*\*+\//gim,qps=/\/\*+\s*biome-ignore[^\n*]*\*+\//gim,VWr=new RegExp(`${jps.source}|${Ups.source}`,"gim"),zWr=new RegExp(`${Bps.source}|${qps.source}`,"gim");async function Vps(t,e,r){let{eslint:i,squirelly:a}=Rps(t,r.filepath),l=t,u,f=!1;if(a&&(l=qWr(l,e),f=!0),i){let _=PWr(l,r.filepath,e);l=_.code,u=_.context,f=!0}return!e.BATI.has("eslint")&&VWr.test(l)&&(l=l.replace(VWr,""),f=!0),!e.BATI.has("biome")&&zWr.test(l)&&(l=l.replace(zWr,""),f=!0),{code:f?await lst(l,r):l,context:u}}import{randomBytes as cjs}from"crypto";var JEt={name:"@batijs/core",version:"0.0.548",description:"",type:"module",types:"./dist/index.d.ts",scripts:{"check-types":"tsc --noEmit",vue:"tsx src/parse/linters/vue.ts",test:"vitest run","test:ci":"vitest run",build:"tsup"},keywords:[],author:"Jo\xEBl Charles <joel.charles91@gmail.com>",repository:"https://github.com/vikejs/bati",license:"MIT",devDependencies:{"@batijs/features":"workspace:*","@types/eslint":"^9.6.1","@types/estree":"^1.0.8","@types/node":"^20.19.25","@types/which":"^3.0.4","@typescript-eslint/parser":"^8.48.1","@typescript-eslint/utils":"^8.48.1","attributes-parser":"^2.2.3",colorette:"^2.0.20",esbuild:"^0.27.1",eslint:"^9.39.1","eslint-plugin-solid":"^0.14.5","eslint-rule-composer":"^0.3.0",espree:"^11.0.0",magicast:"^0.5.1","mdast-builder":"^1.1.1","mdast-util-from-markdown":"^2.0.2","mdast-util-to-markdown":"^2.1.2","mdast-util-to-string":"^4.0.0","mdast-util-toc":"^7.1.0",prettier:"^3.7.4",squirrelly:"^9.1.0",tsup:"^8.5.1",tsx:"^4.21.0",typescript:"^5.9.3","unplugin-purge-polyfills":"^0.1.0",vitest:"^4.0.15","vue-eslint-parser":"^10.2.0",which:"^6.0.0",yaml:"^2.8.2"},exports:{".":"./dist/index.js","./config":"./dist/config.js","./types":{types:"./global.d.ts"}},typesVersions:{"*":{config:["./dist/config.d.ts"],types:["./global.d.ts"]}},files:["dist/"]};function Yps(){return process.env.npm_config_user_agent?Wps(process.env.npm_config_user_agent):{name:"npm",run:"npm run",exec:"npx"}}function Wps(t){let e=t.split(" ")[0],r=e.lastIndexOf("/"),i=e.substring(0,r);i=i==="npminstall"?"cnpm":i;let a;switch(i){case"pnpm":a="pnpm dlx";break;case"yarn":a="yarn dlx";break;case"bun":a="bunx";break;case"cnpm":a="cnpx";break;default:a="npx"}return{name:i,version:e.substring(r+1),run:i==="npm"?"npm run":i,exec:a}}function fjs(){switch(Yps().name){case"pnpm":return"pnpm create vike@latest";case"yarn":return"yarn create vike@latest";case"bun":return"bun create vike@latest";default:return"npm create vike@latest ---"}}function _js(){let t=JEt.version.split("."),e=t[0],r=t[1],i=t.slice(2).join(".");return{version:JEt.version,semver:[e,r,i]}}function mjs(t,e,r,i){t??="",t.endsWith(`
|
|
1161
1161
|
|
|
1162
1162
|
`)||(t.endsWith(`
|
|
1163
1163
|
`)?t=`${t}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@batijs/core",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.548",
|
|
4
4
|
"description": "",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"types": "./dist/index.d.ts",
|
|
@@ -38,7 +38,7 @@
|
|
|
38
38
|
"vue-eslint-parser": "^10.2.0",
|
|
39
39
|
"which": "^6.0.0",
|
|
40
40
|
"yaml": "^2.8.2",
|
|
41
|
-
"@batijs/features": "0.0.
|
|
41
|
+
"@batijs/features": "0.0.548"
|
|
42
42
|
},
|
|
43
43
|
"exports": {
|
|
44
44
|
".": "./dist/index.js",
|