From a2bc232ea29408d3b046b6d1154eab5fc88725e3 Mon Sep 17 00:00:00 2001 From: Nacho Vazquez Date: Sun, 6 Aug 2023 15:12:16 -0300 Subject: [PATCH] fix: generation of publish command (#11) * fix: generation of publish command * fix: failing tests --- packages/plugins/nx-cloudflare/executors.json | 2 +- .../plugins/nx-cloudflare/src/executors/publish/compat.ts | 5 +++++ .../src/executors/publish/{publish.ts => publish.impl.ts} | 0 .../src/generators/application/application.spec.ts | 4 ++-- .../nx-cloudflare/src/generators/application/application.ts | 4 ++-- 5 files changed, 10 insertions(+), 5 deletions(-) create mode 100644 packages/plugins/nx-cloudflare/src/executors/publish/compat.ts rename packages/plugins/nx-cloudflare/src/executors/publish/{publish.ts => publish.impl.ts} (100%) diff --git a/packages/plugins/nx-cloudflare/executors.json b/packages/plugins/nx-cloudflare/executors.json index b45d8775a..76503c338 100644 --- a/packages/plugins/nx-cloudflare/executors.json +++ b/packages/plugins/nx-cloudflare/executors.json @@ -6,7 +6,7 @@ "description": "Serve cloudflare worker locally" }, "publish": { - "implementation": "./src/executors/publish/publish", + "implementation": "./src/executors/publish/publish.impl", "schema": "./src/executors/publish/schema.json", "description": "Publish worker to Cloudflare" } diff --git a/packages/plugins/nx-cloudflare/src/executors/publish/compat.ts b/packages/plugins/nx-cloudflare/src/executors/publish/compat.ts new file mode 100644 index 000000000..0a1c3f31a --- /dev/null +++ b/packages/plugins/nx-cloudflare/src/executors/publish/compat.ts @@ -0,0 +1,5 @@ +import { convertNxExecutor } from '@nx/devkit'; + +import esbuildExecutor from './publish.impl'; + +export default convertNxExecutor(esbuildExecutor); diff --git a/packages/plugins/nx-cloudflare/src/executors/publish/publish.ts b/packages/plugins/nx-cloudflare/src/executors/publish/publish.impl.ts similarity index 100% rename from packages/plugins/nx-cloudflare/src/executors/publish/publish.ts rename to packages/plugins/nx-cloudflare/src/executors/publish/publish.impl.ts diff --git a/packages/plugins/nx-cloudflare/src/generators/application/application.spec.ts b/packages/plugins/nx-cloudflare/src/generators/application/application.spec.ts index 384bb3fa5..324fe69d9 100644 --- a/packages/plugins/nx-cloudflare/src/generators/application/application.spec.ts +++ b/packages/plugins/nx-cloudflare/src/generators/application/application.spec.ts @@ -37,8 +37,8 @@ describe('app', () => { }, }, - deploy: { - executor: '@naxodev/nx-cloudflare:deploy', + publish: { + executor: '@naxodev/nx-cloudflare:publish', }, }) ); diff --git a/packages/plugins/nx-cloudflare/src/generators/application/application.ts b/packages/plugins/nx-cloudflare/src/generators/application/application.ts index 3a09fa910..71a75f2e8 100644 --- a/packages/plugins/nx-cloudflare/src/generators/application/application.ts +++ b/packages/plugins/nx-cloudflare/src/generators/application/application.ts @@ -105,8 +105,8 @@ function addTargets(tree: Tree, options: NormalizedSchema) { }, }, - deploy: { - executor: '@naxodev/nx-cloudflare:deploy', + publish: { + executor: '@naxodev/nx-cloudflare:publish', }, };