full site update
This commit is contained in:
17
node_modules/astro/dist/actions/utils.js
generated
vendored
17
node_modules/astro/dist/actions/utils.js
generated
vendored
@@ -26,20 +26,20 @@ async function isActionsFilePresent(fs, srcDir) {
|
||||
if (!actionsFile) return false;
|
||||
let contents;
|
||||
try {
|
||||
contents = fs.readFileSync(actionsFile, "utf-8");
|
||||
contents = fs.readFileSync(actionsFile.url, "utf-8");
|
||||
} catch {
|
||||
return false;
|
||||
}
|
||||
const [, exports] = eslexer.parse(contents, actionsFile.pathname);
|
||||
const [, exports] = eslexer.parse(contents, actionsFile.url.pathname);
|
||||
for (const exp of exports) {
|
||||
if (exp.n === "server") {
|
||||
return true;
|
||||
return actionsFile.filename;
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
function search(fs, srcDir) {
|
||||
const paths = [
|
||||
const filenames = [
|
||||
"actions.mjs",
|
||||
"actions.js",
|
||||
"actions.mts",
|
||||
@@ -48,10 +48,11 @@ function search(fs, srcDir) {
|
||||
"actions/index.js",
|
||||
"actions/index.mts",
|
||||
"actions/index.ts"
|
||||
].map((p) => new URL(p, srcDir));
|
||||
for (const file of paths) {
|
||||
if (fs.existsSync(file)) {
|
||||
return file;
|
||||
];
|
||||
for (const filename of filenames) {
|
||||
const url = new URL(filename, srcDir);
|
||||
if (fs.existsSync(url)) {
|
||||
return { filename, url };
|
||||
}
|
||||
}
|
||||
return void 0;
|
||||
|
Reference in New Issue
Block a user