diff --git a/apps/agora/apex/project.json b/apps/agora/apex/project.json index 99b20f8d5a..f2fc3481d8 100644 --- a/apps/agora/apex/project.json +++ b/apps/agora/apex/project.json @@ -16,17 +16,6 @@ "command": "docker/agora/serve-detach.sh agora-apex" } }, - "build-image": { - "executor": "@nx-tools/nx-container:build", - "options": { - "context": "apps/agora/apex", - "metadata": { - "images": ["ghcr.io/sage-bionetworks/agora-apex"], - "tags": ["type=edge,branch=main", "type=raw,value=local", "type=sha"] - }, - "push": false - } - }, "publish-image": { "executor": "@nx-tools/nx-container:build", "options": { diff --git a/apps/agora/api-docs/project.json b/apps/agora/api-docs/project.json index 31210d5db6..cd2b8640fa 100644 --- a/apps/agora/api-docs/project.json +++ b/apps/agora/api-docs/project.json @@ -30,18 +30,6 @@ "command": "docker/agora/serve-detach.sh agora-api-docs" } }, - "build-image": { - "executor": "@nx-tools/nx-container:build", - "options": { - "context": "apps/agora/api-docs", - "metadata": { - "images": ["ghcr.io/sage-bionetworks/agora-api-docs"], - "tags": ["type=edge,branch=main", "type=raw,value=local", "type=sha"] - }, - "push": false - }, - "dependsOn": ["build"] - }, "publish-image": { "executor": "@nx-tools/nx-container:build", "options": { diff --git a/apps/agora/api/project.json b/apps/agora/api/project.json index a3cfa9178a..382343566a 100644 --- a/apps/agora/api/project.json +++ b/apps/agora/api/project.json @@ -60,18 +60,6 @@ "fix": true } }, - "build-image": { - "executor": "@nx-tools/nx-container:build", - "options": { - "context": ".", - "metadata": { - "images": ["ghcr.io/sage-bionetworks/agora-api"], - "tags": ["type=edge,branch=main", "type=raw,value=local", "type=sha"] - }, - "push": false - }, - "dependsOn": ["build"] - }, "publish-image": { "executor": "@nx-tools/nx-container:build", "options": { diff --git a/apps/agora/app/project.json b/apps/agora/app/project.json index 49949794a2..f40b11c50a 100644 --- a/apps/agora/app/project.json +++ b/apps/agora/app/project.json @@ -156,18 +156,6 @@ }, "defaultConfiguration": "development" }, - "build-image": { - "executor": "@nx-tools/nx-container:build", - "options": { - "context": ".", - "metadata": { - "images": ["ghcr.io/sage-bionetworks/agora-app"], - "tags": ["type=edge,branch=main", "type=raw,value=local", "type=sha"] - }, - "push": false - }, - "dependsOn": ["server"] - }, "publish-image": { "executor": "@nx-tools/nx-container:build", "options": { diff --git a/apps/agora/data/project.json b/apps/agora/data/project.json index 349121a7ee..e69cf249e7 100644 --- a/apps/agora/data/project.json +++ b/apps/agora/data/project.json @@ -31,22 +31,6 @@ "command": "docker/agora/serve-detach.sh {projectName}" } }, - "build-image": { - "executor": "@nx-tools/nx-container:build", - "options": { - "context": "{projectRoot}", - "metadata": { - "images": ["ghcr.io/sage-bionetworks/{projectName}"], - "tags": [ - "type=edge,branch=main", - "type=raw,value=local", - "type=sha", - "type=raw,value=$DATA_FILE.$DATA_VERSION" - ] - }, - "push": false - } - }, "publish-image": { "executor": "@nx-tools/nx-container:build", "options": { diff --git a/apps/agora/mongo/project.json b/apps/agora/mongo/project.json index 1524d33936..26af2efef3 100644 --- a/apps/agora/mongo/project.json +++ b/apps/agora/mongo/project.json @@ -18,17 +18,6 @@ "command": "docker/agora/serve-detach.sh {projectName}" } }, - "build-image": { - "executor": "@nx-tools/nx-container:build", - "options": { - "context": "apps/agora/mongo", - "metadata": { - "images": ["ghcr.io/sage-bionetworks/{projectName}"], - "tags": ["type=edge,branch=main", "type=raw,value=local", "type=sha"] - }, - "push": false - } - }, "publish-image": { "executor": "@nx-tools/nx-container:build", "options": { diff --git a/libs/sage-monorepo/nx-plugin/src/plugins/plugin.ts b/libs/sage-monorepo/nx-plugin/src/plugins/plugin.ts index c3f317dee6..64a0e23f2f 100644 --- a/libs/sage-monorepo/nx-plugin/src/plugins/plugin.ts +++ b/libs/sage-monorepo/nx-plugin/src/plugins/plugin.ts @@ -20,10 +20,10 @@ import { buildProjectConfiguration } from './build-project-configuration'; import { ProjectConfigurationBuilderOptions } from './project-configuration-builder-options'; import { inferProjectMetadata } from './project-metadata'; -function readProjectCOnfigurationsCache( +function readProjectConfigurationsCache( cachePath: string, ): Record { - console.log(`cachePath: ${cachePath}`); + // console.log(`cachePath: ${cachePath}`); return existsSync(cachePath) ? readJsonFile(cachePath) : {}; } @@ -34,7 +34,7 @@ function writeProjectConfigurationsToCache( writeJsonFile(cachePath, results); } -const projectFilePattern = '{apps,libs}/openchallenges/**/project.json'; +const projectFilePattern = '{apps,libs}/{openchallenges,agora}/**/project.json'; export const createNodesV2: CreateNodesV2 = [ projectFilePattern, @@ -44,7 +44,7 @@ export const createNodesV2: CreateNodesV2 = [ // Reads the cached targets for all the projects const cachePath = join(workspaceDataDirectory, `sage-monorepo-${optionsHash}.hash`); - const projectConfigurationsCache = readProjectCOnfigurationsCache(cachePath); + const projectConfigurationsCache = readProjectConfigurationsCache(cachePath); try { return await createNodesFromFiles( (configFile, options, context) => { diff --git a/libs/sage-monorepo/nx-plugin/src/plugins/project-metadata.ts b/libs/sage-monorepo/nx-plugin/src/plugins/project-metadata.ts index f6cdb19aa0..092befae1a 100644 --- a/libs/sage-monorepo/nx-plugin/src/plugins/project-metadata.ts +++ b/libs/sage-monorepo/nx-plugin/src/plugins/project-metadata.ts @@ -46,6 +46,7 @@ function inferProjectType(projectRoot: string): ProjectType { } else if (projectRoot.startsWith('libs/')) { return 'library'; } + throw new Error(`Unknown project type for project root: ${projectRoot}`); } @@ -55,16 +56,19 @@ function inferBuilder( ): Builder | null { if (siblingFiles.includes('poetry.lock')) return 'poetry'; if (siblingFiles.includes('build.gradle')) return 'gradle'; - if ( - localProjectConfiguration?.targets?.['build']?.executor === - '@angular-devkit/build-angular:browser' - ) { + + const executor = localProjectConfiguration?.targets?.['build']?.executor ?? ''; + const webpackExecutors = ['@angular-devkit/build-angular:browser', '@nx/webpack:webpack']; + + if (webpackExecutors.includes(executor)) { return 'webpack'; } + return null; } function inferContainerType(siblingFiles: string[]): ContainerType | null { if (siblingFiles.includes('Dockerfile')) return 'Docker'; + return null; }