From 248949f9054c1cb2d458d677a3e1c71e4c2464a0 Mon Sep 17 00:00:00 2001 From: Emily Xiong Date: Fri, 17 May 2024 14:35:12 -0400 Subject: [PATCH 1/2] feat(graph): change gradle and nextjs svg (#23201) ## Current Behavior ## Expected Behavior change the SVG to match cloud https://github.com/nrwl/ocean/pull/4907/files ## Related Issue(s) Fixes # --- graph/ui-icons/src/lib/technologies/gradle.tsx | 4 ++-- graph/ui-icons/src/lib/technologies/nextjs.tsx | 2 +- nx-dev/nx-dev/public/images/icons/gradle.svg | 9 ++++++++- nx-dev/nx-dev/public/images/icons/nextdotjs.svg | 9 ++++++++- 4 files changed, 19 insertions(+), 5 deletions(-) diff --git a/graph/ui-icons/src/lib/technologies/gradle.tsx b/graph/ui-icons/src/lib/technologies/gradle.tsx index 5cb00cecd1df3..e491d3b81ddd2 100644 --- a/graph/ui-icons/src/lib/technologies/gradle.tsx +++ b/graph/ui-icons/src/lib/technologies/gradle.tsx @@ -3,12 +3,12 @@ import { FC, SVGProps } from 'react'; export const GradleIcon: FC> = (props) => ( Gradle - + ); diff --git a/graph/ui-icons/src/lib/technologies/nextjs.tsx b/graph/ui-icons/src/lib/technologies/nextjs.tsx index 2f950bc8dc6af..99e86baa23464 100644 --- a/graph/ui-icons/src/lib/technologies/nextjs.tsx +++ b/graph/ui-icons/src/lib/technologies/nextjs.tsx @@ -9,6 +9,6 @@ export const NextJSIcon: FC> = (props) => ( {...props} > Next.js - + ); diff --git a/nx-dev/nx-dev/public/images/icons/gradle.svg b/nx-dev/nx-dev/public/images/icons/gradle.svg index 774740e6a96bf..d8467ba9af86b 100644 --- a/nx-dev/nx-dev/public/images/icons/gradle.svg +++ b/nx-dev/nx-dev/public/images/icons/gradle.svg @@ -1 +1,8 @@ -Gradle \ No newline at end of file + + Gradle + + \ No newline at end of file diff --git a/nx-dev/nx-dev/public/images/icons/nextdotjs.svg b/nx-dev/nx-dev/public/images/icons/nextdotjs.svg index 9972859e301db..f8b980d847e59 100644 --- a/nx-dev/nx-dev/public/images/icons/nextdotjs.svg +++ b/nx-dev/nx-dev/public/images/icons/nextdotjs.svg @@ -1 +1,8 @@ -Next.js \ No newline at end of file + + Next.js + + \ No newline at end of file From 53345f22418c04b52dbe1f9ddb2cc577572c38c2 Mon Sep 17 00:00:00 2001 From: Jack Hsu Date: Fri, 17 May 2024 14:50:47 -0400 Subject: [PATCH 2/2] fix(nextjs): additional experimental HTTPS options (#23334) There are three additional flags if user wishes to generate their own key, cert, ca files rather than the auto-generated ones by Next.js. ## Current Behavior Cannot pass additional CLI options. ## Expected Behavior Can pass additional CLI options for custom files. ## Related Issue(s) Closes https://github.com/nrwl/nx/discussions/23331 --- .../packages/next/executors/server.json | 12 ++++++++ .../next/src/executors/server/schema.json | 12 ++++++++ .../next/src/executors/server/server.impl.ts | 29 ++++++++++++++----- packages/next/src/utils/types.ts | 3 ++ 4 files changed, 49 insertions(+), 7 deletions(-) diff --git a/docs/generated/packages/next/executors/server.json b/docs/generated/packages/next/executors/server.json index f63fca1e2daf7..ac191a5d16d9d 100644 --- a/docs/generated/packages/next/executors/server.json +++ b/docs/generated/packages/next/executors/server.json @@ -60,6 +60,18 @@ "type": "boolean", "description": "Enable HTTPS support for the Next.js development server." }, + "experimentalHttpsKey": { + "type": "string", + "description": "Path to a HTTPS key file." + }, + "experimentalHttpsCert": { + "type": "string", + "description": "Path to a HTTPS certificate file." + }, + "experimentalHttpsCa": { + "type": "string", + "description": "Path to a HTTPS certificate authority file." + }, "customServerHttps:": { "type": "boolean", "description": "Enable HTTPS support for the custom server." diff --git a/packages/next/src/executors/server/schema.json b/packages/next/src/executors/server/schema.json index 4dc1b5b3d14f9..4b0a3a3e1610f 100644 --- a/packages/next/src/executors/server/schema.json +++ b/packages/next/src/executors/server/schema.json @@ -57,6 +57,18 @@ "type": "boolean", "description": "Enable HTTPS support for the Next.js development server." }, + "experimentalHttpsKey": { + "type": "string", + "description": "Path to a HTTPS key file." + }, + "experimentalHttpsCert": { + "type": "string", + "description": "Path to a HTTPS certificate file." + }, + "experimentalHttpsCa": { + "type": "string", + "description": "Path to a HTTPS certificate authority file." + }, "customServerHttps:": { "type": "boolean", "description": "Enable HTTPS support for the custom server." diff --git a/packages/next/src/executors/server/server.impl.ts b/packages/next/src/executors/server/server.impl.ts index 68e298a97d258..1745b09f71074 100644 --- a/packages/next/src/executors/server/server.impl.ts +++ b/packages/next/src/executors/server/server.impl.ts @@ -3,7 +3,7 @@ import { parseTargetString, readTargetOptions, } from '@nx/devkit'; -import { join, resolve } from 'path'; +import { resolve } from 'path'; import { NextBuildBuilderOptions, @@ -54,16 +54,18 @@ export default async function* serveExecutor( const mode = options.dev ? 'dev' : 'start'; const turbo = options.turbo && options.dev ? '--turbo' : ''; - const experimentalHttps = - options.experimentalHttps && options.dev ? '--experimental-https' : ''; const nextBin = require.resolve('next/dist/bin/next'); yield* createAsyncIterable<{ success: boolean; baseUrl: string }>( async ({ done, next, error }) => { - const server = fork(nextBin, [mode, ...args, turbo, experimentalHttps], { - cwd: options.dev ? projectRoot : nextDir, - stdio: 'inherit', - }); + const server = fork( + nextBin, + [mode, ...args, turbo, ...getExperimentalHttpsFlags(options)], + { + cwd: options.dev ? projectRoot : nextDir, + stdio: 'inherit', + } + ); server.once('exit', (code) => { if (code === 0) { @@ -92,3 +94,16 @@ export default async function* serveExecutor( } ); } + +function getExperimentalHttpsFlags(options: NextServeBuilderOptions): string[] { + if (!options.dev) return []; + const flags: string[] = []; + if (options.experimentalHttps) flags.push('--experimental-https'); + if (options.experimentalHttpsKey) + flags.push(`--experimental-https-key=${options.experimentalHttpsKey}`); + if (options.experimentalHttpsCert) + flags.push(`--experimental-https-cert=${options.experimentalHttpsCert}`); + if (options.experimentalHttpsCa) + flags.push(`--experimental-https-ca=${options.experimentalHttpsCa}`); + return flags; +} diff --git a/packages/next/src/utils/types.ts b/packages/next/src/utils/types.ts index 00be1509a87d9..63696f6007cdb 100644 --- a/packages/next/src/utils/types.ts +++ b/packages/next/src/utils/types.ts @@ -53,6 +53,9 @@ export interface NextServeBuilderOptions { keepAliveTimeout?: number; turbo?: boolean; experimentalHttps?: boolean; + experimentalHttpsKey?: string; + experimentalHttpsCert?: string; + experimentalHttpsCa?: string; customServerHttps?: boolean; }