@netlify/build-info
Advanced tools
Comparing version 7.7.2 to 7.7.3
@@ -49,3 +49,3 @@ import { BaseBuildTool, type Command } from './build-system.js'; | ||
private detectWorkspaceFile; | ||
/** detect workspace pacakges with the project.json files */ | ||
/** detect workspace packages with the project.json files */ | ||
private detectProjectJson; | ||
@@ -52,0 +52,0 @@ detect(): Promise<this | undefined>; |
@@ -71,2 +71,5 @@ import { NPM_BUILD_SCRIPTS, NPM_DEV_SCRIPTS } from '../get-commands.js'; | ||
const executor = this.getExecutorFromTarget(target); | ||
if (!executor) { | ||
return null; | ||
} | ||
switch (executor) { | ||
@@ -177,32 +180,31 @@ case '@nxtensions/astro:dev': | ||
} | ||
/** detect workspace pacakges with the project.json files */ | ||
/** detect workspace packages with the project.json files */ | ||
async detectProjectJson() { | ||
const fs = this.project.fs; | ||
try { | ||
const { workspaceLayout = { appsDir: 'apps' } } = await fs.readJSON(fs.join(this.project.jsWorkspaceRoot, 'nx.json'), { | ||
const { workspaceLayout } = await fs.readJSON(fs.join(this.project.jsWorkspaceRoot, 'nx.json'), { | ||
fail: true, | ||
}); | ||
// if an apps dir is specified get it. | ||
if (workspaceLayout?.appsDir?.length) { | ||
const identifyPkg = async ({ entry, directory, packagePath }) => { | ||
// ignore e2e test applications as there is no need to deploy them | ||
if (entry === 'project.json' && !packagePath.endsWith('-e2e')) { | ||
try { | ||
// we need to check the project json for application types (we don't care about libraries) | ||
const { projectType, name, targets } = await fs.readJSON(fs.join(directory, entry)); | ||
if (projectType === 'application') { | ||
const targetsWithName = Object.entries(targets || {}).map(([name, target]) => ({ ...target, name })); | ||
const forcedFramework = await this.detectFramework(targetsWithName); | ||
this.targets.set(fs.join(packagePath), targetsWithName); | ||
return { name, path: fs.join(packagePath), forcedFramework }; | ||
} | ||
const appDirs = workspaceLayout?.appsDir ? [workspaceLayout.appsDir] : ['apps', 'packages']; | ||
const identifyPkg = async ({ entry, directory, packagePath }) => { | ||
// ignore e2e test applications as there is no need to deploy them | ||
if (entry === 'project.json' && !packagePath.endsWith('-e2e')) { | ||
try { | ||
// we need to check the project json for application types (we don't care about libraries) | ||
const { projectType, name, targets } = await fs.readJSON(fs.join(directory, entry)); | ||
if (projectType === 'application') { | ||
const targetsWithName = Object.entries(targets || {}).map(([name, target]) => ({ ...target, name })); | ||
const forcedFramework = await this.detectFramework(targetsWithName); | ||
this.targets.set(fs.join(packagePath), targetsWithName); | ||
return { name, path: fs.join(packagePath), forcedFramework }; | ||
} | ||
catch { | ||
// noop | ||
} | ||
} | ||
return null; | ||
}; | ||
return findPackages(this.project, workspaceLayout.appsDir, identifyPkg, '*'); | ||
} | ||
catch { | ||
// noop | ||
} | ||
} | ||
return null; | ||
}; | ||
const pkgs = await Promise.all(appDirs.map(async (appDir) => findPackages(this.project, appDir, identifyPkg, '*').catch(() => []))); | ||
return pkgs.flat(); | ||
} | ||
@@ -209,0 +211,0 @@ catch { |
{ | ||
"name": "@netlify/build-info", | ||
"version": "7.7.2", | ||
"version": "7.7.3", | ||
"description": "Build info utility", | ||
@@ -76,3 +76,3 @@ "type": "module", | ||
}, | ||
"gitHead": "5ec40f6abb92de09175fc27977a0bd6be8ef0d27" | ||
"gitHead": "8ef136a291cebc832ea84ec8326dd3c9cade6663" | ||
} |
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
306795
5691