From 5f93379004542fda1d04237d1c83b5f9b7fbe8d1 Mon Sep 17 00:00:00 2001 From: John Martin Date: Sun, 24 Nov 2024 01:10:26 +0000 Subject: [PATCH 1/2] feat(nx-internal): add config file option --- tools/nx-internal/package.json | 2 +- .../src/executors/build-devcontainer-image/executor.ts | 1 + .../src/executors/build-devcontainer-image/schema.d.ts | 1 + .../src/executors/build-devcontainer-image/schema.json | 5 +++++ 4 files changed, 8 insertions(+), 1 deletion(-) diff --git a/tools/nx-internal/package.json b/tools/nx-internal/package.json index 7d90315..a262ccb 100644 --- a/tools/nx-internal/package.json +++ b/tools/nx-internal/package.json @@ -8,7 +8,7 @@ "dependencies": { "@swc/helpers": "~0.5.11", "@ebizbase/nx-devkit": "1.0.0", - "@nx/devkit": "20.1.3", + "@nx/devkit": "^20.1.3", "semver": "^7.6.3" }, "devDependencies": {}, diff --git a/tools/nx-internal/src/executors/build-devcontainer-image/executor.ts b/tools/nx-internal/src/executors/build-devcontainer-image/executor.ts index 7bd165b..395f001 100644 --- a/tools/nx-internal/src/executors/build-devcontainer-image/executor.ts +++ b/tools/nx-internal/src/executors/build-devcontainer-image/executor.ts @@ -60,6 +60,7 @@ const buildExecutor: PromiseExecutor = async (options, cont const workspaceFolderArgs = [ `--workspace-folder=${join(projectUtils.getProjectRoot(), options.workspaceFolder ?? '.')}`, + `--config=${join(projectUtils.getProjectRoot(), options.configFile ?? 'devcontainer.json')}`, ]; options.tags = (options.tags ?? []).map((tag) => tag diff --git a/tools/nx-internal/src/executors/build-devcontainer-image/schema.d.ts b/tools/nx-internal/src/executors/build-devcontainer-image/schema.d.ts index 40e6bbb..a6052f3 100644 --- a/tools/nx-internal/src/executors/build-devcontainer-image/schema.d.ts +++ b/tools/nx-internal/src/executors/build-devcontainer-image/schema.d.ts @@ -1,5 +1,6 @@ export interface BuildExecutorSchema { workspaceFolder?: string; + configFile?: string; tags: Array; push: boolean; registries: Array; diff --git a/tools/nx-internal/src/executors/build-devcontainer-image/schema.json b/tools/nx-internal/src/executors/build-devcontainer-image/schema.json index e7c72a9..f06343d 100644 --- a/tools/nx-internal/src/executors/build-devcontainer-image/schema.json +++ b/tools/nx-internal/src/executors/build-devcontainer-image/schema.json @@ -10,6 +10,11 @@ "default": ".", "description": "The workspace folder to build the image (The parrent directory contain .devcontainer/devcontainer.json)" }, + "configFile": { + "type": "string", + "default": "devcontainer.json", + "description": "The path to the devcontainer.json file" + }, "registries": { "type": "array", "items": { From 54c2e7e89693264039d3e0101578bbf20db43ec1 Mon Sep 17 00:00:00 2001 From: John Martin Date: Sun, 24 Nov 2024 01:11:41 +0000 Subject: [PATCH 2/2] refactor: move devcontainter.json --- .../base-devcontainer/{.devcontainer => }/devcontainer.json | 0 .../node-devcontainer/{.devcontainer => }/devcontainer.json | 0 .../node-dind-devcontainer/{.devcontainer => }/devcontainer.json | 0 .../{.devcontainer => }/devcontainer.json | 0 .../{.devcontainer => }/devcontainer.json | 0 5 files changed, 0 insertions(+), 0 deletions(-) rename devcontainer-images/base-devcontainer/{.devcontainer => }/devcontainer.json (100%) rename devcontainer-images/node-devcontainer/{.devcontainer => }/devcontainer.json (100%) rename devcontainer-images/node-dind-devcontainer/{.devcontainer => }/devcontainer.json (100%) rename devcontainer-images/node-dind-playwright-devcontainer/{.devcontainer => }/devcontainer.json (100%) rename devcontainer-images/node-playwright-devcontainer/{.devcontainer => }/devcontainer.json (100%) diff --git a/devcontainer-images/base-devcontainer/.devcontainer/devcontainer.json b/devcontainer-images/base-devcontainer/devcontainer.json similarity index 100% rename from devcontainer-images/base-devcontainer/.devcontainer/devcontainer.json rename to devcontainer-images/base-devcontainer/devcontainer.json diff --git a/devcontainer-images/node-devcontainer/.devcontainer/devcontainer.json b/devcontainer-images/node-devcontainer/devcontainer.json similarity index 100% rename from devcontainer-images/node-devcontainer/.devcontainer/devcontainer.json rename to devcontainer-images/node-devcontainer/devcontainer.json diff --git a/devcontainer-images/node-dind-devcontainer/.devcontainer/devcontainer.json b/devcontainer-images/node-dind-devcontainer/devcontainer.json similarity index 100% rename from devcontainer-images/node-dind-devcontainer/.devcontainer/devcontainer.json rename to devcontainer-images/node-dind-devcontainer/devcontainer.json diff --git a/devcontainer-images/node-dind-playwright-devcontainer/.devcontainer/devcontainer.json b/devcontainer-images/node-dind-playwright-devcontainer/devcontainer.json similarity index 100% rename from devcontainer-images/node-dind-playwright-devcontainer/.devcontainer/devcontainer.json rename to devcontainer-images/node-dind-playwright-devcontainer/devcontainer.json diff --git a/devcontainer-images/node-playwright-devcontainer/.devcontainer/devcontainer.json b/devcontainer-images/node-playwright-devcontainer/devcontainer.json similarity index 100% rename from devcontainer-images/node-playwright-devcontainer/.devcontainer/devcontainer.json rename to devcontainer-images/node-playwright-devcontainer/devcontainer.json