Skip to content

Commit

Permalink
feat(nextjs): remove "--server=..." app generator option
Browse files Browse the repository at this point in the history
  • Loading branch information
jaysoo committed Apr 14, 2023
1 parent 5da650a commit 83a3858
Show file tree
Hide file tree
Showing 13 changed files with 4 additions and 100 deletions.
5 changes: 0 additions & 5 deletions docs/generated/packages/next/executors/server.json
Original file line number Diff line number Diff line change
Expand Up @@ -39,11 +39,6 @@
"type": "string",
"description": "Target which builds the custom server."
},
"customServerPath": {
"type": "string",
"description": "Use a custom server script.",
"x-deprecated": "Use `customServerTarget` instead."
},
"hostname": {
"type": "string",
"description": "Hostname on which the application is served."
Expand Down
10 changes: 0 additions & 10 deletions docs/generated/packages/next/generators/application.json
Original file line number Diff line number Diff line change
Expand Up @@ -61,10 +61,6 @@
]
}
},
"server": {
"description": "The server script path to be used with next.",
"type": "string"
},
"linter": {
"description": "The tool to use for running lint checks.",
"type": "string",
Expand Down Expand Up @@ -104,12 +100,6 @@
"description": "Whether or not to configure the ESLint `parserOptions.project` option. We do not do this by default for lint performance reasons.",
"default": false
},
"standaloneConfig": {
"description": "Split the project configuration into `<projectRoot>/project.json` rather than including it inside `workspace.json`",
"type": "boolean",
"default": true,
"x-deprecated": "Nx only supports standaloneConfig"
},
"swc": {
"description": "Enable the Rust-based compiler SWC to compile JS/TS files.",
"type": "boolean",
Expand Down
6 changes: 0 additions & 6 deletions docs/generated/packages/next/generators/library.json
Original file line number Diff line number Diff line change
Expand Up @@ -141,12 +141,6 @@
"description": "Whether or not to configure the ESLint `parserOptions.project` option. We do not do this by default for lint performance reasons.",
"default": false
},
"standaloneConfig": {
"description": "Split the project configuration into `<projectRoot>/project.json` rather than including it inside `workspace.json`",
"type": "boolean",
"default": true,
"x-deprecated": "Nx only supports standaloneConfig"
},
"skipPackageJson": {
"type": "boolean",
"default": false,
Expand Down
23 changes: 0 additions & 23 deletions packages/next/src/executors/server/lib/custom-server.ts

This file was deleted.

5 changes: 0 additions & 5 deletions packages/next/src/executors/server/schema.json
Original file line number Diff line number Diff line change
Expand Up @@ -36,11 +36,6 @@
"type": "string",
"description": "Target which builds the custom server."
},
"customServerPath": {
"type": "string",
"description": "Use a custom server script.",
"x-deprecated": "Use `customServerTarget` instead."
},
"hostname": {
"type": "string",
"description": "Hostname on which the application is served."
Expand Down
11 changes: 1 addition & 10 deletions packages/next/src/executors/server/server.impl.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,11 +13,9 @@ import { join, resolve } from 'path';
import {
NextBuildBuilderOptions,
NextServeBuilderOptions,
NextServer,
NextServerOptions,
ProxyConfig,
} from '../../utils/types';
import { customServer } from './lib/custom-server';
import { defaultServer } from './lib/default-server';

export default async function* serveExecutor(
Expand Down Expand Up @@ -61,15 +59,8 @@ async function* runNextDevServer(
port: options.port,
customServer: !!options.customServerTarget,
hostname: options.hostname || 'localhost',

// TOOD(jack): Remove in Nx 15
path: options.customServerPath,
};

const server: NextServer = options.customServerPath
? customServer
: defaultServer;

// look for the proxy.conf.json
let proxyConfig: ProxyConfig;
const proxyConfigPath = options.proxyConfig
Expand All @@ -85,7 +76,7 @@ async function* runNextDevServer(
}

try {
await server(settings, proxyConfig);
await defaultServer(settings, proxyConfig);
logger.info(`[ ${chalk.green('ready')} ] on ${baseUrl}`);

yield {
Expand Down
18 changes: 3 additions & 15 deletions packages/next/src/generators/application/lib/add-project.ts
Original file line number Diff line number Diff line change
Expand Up @@ -44,13 +44,6 @@ export function addProject(host: Tree, options: NormalizedSchema) {
},
};

if (options.server) {
targets.serve.options = {
...targets.serve.options,
customServerPath: options.server,
};
}

targets.export = {
executor: '@nrwl/next:export',
options: {
Expand All @@ -66,12 +59,7 @@ export function addProject(host: Tree, options: NormalizedSchema) {
tags: options.parsedTags,
};

addProjectConfiguration(
host,
options.projectName,
{
...project,
},
options.standaloneConfig
);
addProjectConfiguration(host, options.projectName, {
...project,
});
}
2 changes: 0 additions & 2 deletions packages/next/src/generators/application/schema.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ import { SupportedStyles } from '@nrwl/react';
export interface Schema {
name: string;
style?: SupportedStyles;
server?: string;
skipFormat?: boolean;
directory?: string;
tags?: string;
Expand All @@ -13,7 +12,6 @@ export interface Schema {
linter?: Linter;
js?: boolean;
setParserOptionsProject?: boolean;
standaloneConfig?: boolean;
swc?: boolean;
customServer?: boolean;
skipPackageJson?: boolean;
Expand Down
10 changes: 0 additions & 10 deletions packages/next/src/generators/application/schema.json
Original file line number Diff line number Diff line change
Expand Up @@ -64,10 +64,6 @@
]
}
},
"server": {
"description": "The server script path to be used with next.",
"type": "string"
},
"linter": {
"description": "The tool to use for running lint checks.",
"type": "string",
Expand Down Expand Up @@ -107,12 +103,6 @@
"description": "Whether or not to configure the ESLint `parserOptions.project` option. We do not do this by default for lint performance reasons.",
"default": false
},
"standaloneConfig": {
"description": "Split the project configuration into `<projectRoot>/project.json` rather than including it inside `workspace.json`",
"type": "boolean",
"default": true,
"x-deprecated": "Nx only supports standaloneConfig"
},
"swc": {
"description": "Enable the Rust-based compiler SWC to compile JS/TS files.",
"type": "boolean",
Expand Down
3 changes: 0 additions & 3 deletions packages/next/src/generators/library/library.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,7 @@ import {
convertNxGenerator,
formatFiles,
GeneratorCallback,
getImportPath,
getWorkspaceLayout,
joinPathFragments,
names,
runTasksInSerial,
Tree,
updateJson,
Expand Down
1 change: 0 additions & 1 deletion packages/next/src/generators/library/schema.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,5 @@ export interface Schema {
globalCss?: boolean;
strict?: boolean;
setParserOptionsProject?: boolean;
standaloneConfig?: boolean;
skipPackageJson?: boolean;
}
6 changes: 0 additions & 6 deletions packages/next/src/generators/library/schema.json
Original file line number Diff line number Diff line change
Expand Up @@ -144,12 +144,6 @@
"description": "Whether or not to configure the ESLint `parserOptions.project` option. We do not do this by default for lint performance reasons.",
"default": false
},
"standaloneConfig": {
"description": "Split the project configuration into `<projectRoot>/project.json` rather than including it inside `workspace.json`",
"type": "boolean",
"default": true,
"x-deprecated": "Nx only supports standaloneConfig"
},
"skipPackageJson": {
"type": "boolean",
"default": false,
Expand Down
4 changes: 0 additions & 4 deletions packages/next/src/utils/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@ export interface NextServerOptions {
staticMarkup: boolean;
quiet: boolean;
port: number;
path: string;
hostname: string;
customServer?: boolean;
}
Expand Down Expand Up @@ -47,9 +46,6 @@ export interface NextServeBuilderOptions {
quiet: boolean;
buildTarget: string;
customServerTarget?: string;
/** @deprecated Use customServerTarget
*/
customServerPath?: string;
hostname?: string;
proxyConfig?: string;
buildLibsFromSource?: boolean;
Expand Down

0 comments on commit 83a3858

Please sign in to comment.