Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@batijs/build

Package Overview
Dependencies
Maintainers
2
Versions
314
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@batijs/build - npm Package Compare versions

Comparing version 0.0.12 to 0.0.13

22

./dist/exec.js

@@ -39,2 +39,4 @@ // src/exec.ts

case ".js":
case ".tsx":
case ".jsx":
return fileContent;

@@ -47,2 +49,6 @@ case ".json":

}
async function fileContainsVikeMeta(filepath) {
const code = await readFile(filepath, { encoding: "utf-8" });
return code.includes("import.meta.VIKE_");
}
async function main(options, meta) {

@@ -57,9 +63,2 @@ const sources = Array.isArray(options.source) ? options.source : [options.source];

continue;
} else if (parsed.name.startsWith("$$") && parsed.ext.match(/\.[tj]sx?$/)) {
const mod = await loadFile(p);
const fileContent = await transformAndGenerate(mod.$ast, meta);
if (fileContent) {
await safeWriteFile(target, fileContent);
}
targets.set(target, () => fileContent);
} else if (parsed.name.startsWith("$") && parsed.ext.match(/\.tsx?$/)) {

@@ -74,2 +73,11 @@ throw new Error(`Typescript file needs to be compiled before it can be executed: '${p}'`);

targets.set(target, () => fileContent);
} else if (parsed.ext.match(/\.[tj]sx?$/) && await fileContainsVikeMeta(p)) {
const mod = await loadFile(p);
const fileContent = await transformAndGenerate(mod.$ast, meta, {
filepath: p
});
if (fileContent) {
await safeWriteFile(target, fileContent);
}
targets.set(target, () => fileContent);
} else {

@@ -76,0 +84,0 @@ await safeCopyFile(p, target);

@@ -39,2 +39,4 @@ // src/exec.ts

case ".js":
case ".tsx":
case ".jsx":
return fileContent;

@@ -47,2 +49,6 @@ case ".json":

}
async function fileContainsVikeMeta(filepath) {
const code = await readFile(filepath, { encoding: "utf-8" });
return code.includes("import.meta.VIKE_");
}
async function main(options, meta) {

@@ -57,9 +63,2 @@ const sources = Array.isArray(options.source) ? options.source : [options.source];

continue;
} else if (parsed.name.startsWith("$$") && parsed.ext.match(/\.[tj]sx?$/)) {
const mod = await loadFile(p);
const fileContent = await transformAndGenerate(mod.$ast, meta);
if (fileContent) {
await safeWriteFile(target, fileContent);
}
targets.set(target, () => fileContent);
} else if (parsed.name.startsWith("$") && parsed.ext.match(/\.tsx?$/)) {

@@ -74,2 +73,11 @@ throw new Error(`Typescript file needs to be compiled before it can be executed: '${p}'`);

targets.set(target, () => fileContent);
} else if (parsed.ext.match(/\.[tj]sx?$/) && await fileContainsVikeMeta(p)) {
const mod = await loadFile(p);
const fileContent = await transformAndGenerate(mod.$ast, meta, {
filepath: p
});
if (fileContent) {
await safeWriteFile(target, fileContent);
}
targets.set(target, () => fileContent);
} else {

@@ -76,0 +84,0 @@ await safeCopyFile(p, target);

{
"name": "@batijs/build",
"version": "0.0.12",
"version": "0.0.13",
"description": "",

@@ -11,6 +11,6 @@ "type": "module",

"@types/node": "^16.18.27",
"@batijs/tsup": "0.0.12"
"@batijs/tsup": "0.0.13"
},
"dependencies": {
"@batijs/core": "0.0.12"
"@batijs/core": "0.0.13"
},

@@ -17,0 +17,0 @@ "main": "./dist/exec.js",

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc