@netlify/build-info
Advanced tools
Comparing version
@@ -30,3 +30,3 @@ import { FileSystem } from '../file-system.js'; | ||
if (!response.ok) { | ||
Promise.reject(json); | ||
throw new Error(JSON.stringify(json)); | ||
} | ||
@@ -57,3 +57,3 @@ return json; | ||
try { | ||
this.readFile(path); | ||
await this.readFile(path); | ||
return true; | ||
@@ -60,0 +60,0 @@ } |
@@ -1,2 +0,2 @@ | ||
import { BaseFramework, Category, Framework } from './framework.js'; | ||
import { BaseFramework, Category, DetectedFramework, Framework } from './framework.js'; | ||
export declare class Astro extends BaseFramework implements Framework { | ||
@@ -25,2 +25,3 @@ readonly id = "astro"; | ||
}; | ||
detect(): Promise<DetectedFramework | undefined>; | ||
} |
@@ -0,1 +1,2 @@ | ||
import { lt } from 'semver'; | ||
import { BaseFramework, Category } from './framework.js'; | ||
@@ -10,3 +11,3 @@ export class Astro extends BaseFramework { | ||
dev = { | ||
port: 3000, | ||
port: 4321, | ||
command: 'astro dev', | ||
@@ -24,3 +25,13 @@ pollingStrategies: [{ name: 'TCP' }, { name: 'HTTP' }], | ||
}; | ||
async detect() { | ||
await super.detect(); | ||
if (this.detected) { | ||
// Less than 3.x.x. uses port 3000 | ||
if (this.version && lt(this.version, '3.0.0')) { | ||
this.dev.port = 3000; | ||
} | ||
return this; | ||
} | ||
} | ||
} | ||
//# sourceMappingURL=astro.js.map |
@@ -60,2 +60,3 @@ import type { Client, NotifiableError } from '@bugsnag/js'; | ||
getCurrentNodeVersion(): Promise<SemVer | null>; | ||
isRedwoodProject(): Promise<boolean>; | ||
constructor(fs: FileSystem, baseDirectory?: string, root?: string); | ||
@@ -62,0 +63,0 @@ /** Set's the environment for the project */ |
@@ -72,2 +72,5 @@ import { coerce, parse } from 'semver'; | ||
} | ||
async isRedwoodProject() { | ||
return await this.fs.fileExists(this.fs.resolve(this.fs.cwd, 'redwood.toml')); | ||
} | ||
constructor(fs, baseDirectory, root) { | ||
@@ -74,0 +77,0 @@ this.fs = fs; |
@@ -60,2 +60,5 @@ import { parse } from 'yaml'; | ||
} | ||
if (await project.isRedwoodProject()) { | ||
return null; | ||
} | ||
const pkgJSON = await project.getRootPackageJSON(); | ||
@@ -62,0 +65,0 @@ const workspaceGlobs = project.packageManager.name === "pnpm" /* PkgManager.PNPM */ |
{ | ||
"name": "@netlify/build-info", | ||
"version": "7.7.4", | ||
"version": "7.8.0", | ||
"description": "Build info utility", | ||
@@ -76,3 +76,3 @@ "type": "module", | ||
}, | ||
"gitHead": "a9c6b1395091aee39c6634f0df41299b73e7628a" | ||
"gitHead": "0eb6dbbfd00ba11941b1ef638811eded8a030a17" | ||
} |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
308399
0.39%5717
0.33%