From 53517c0f0e35a73355470ac85e8f613ec39c2c12 Mon Sep 17 00:00:00 2001 From: Nicholas Cunningham Date: Mon, 23 Jan 2023 15:05:28 -0700 Subject: [PATCH] fix(node): remove connect framework from node app generator --- .../packages/node/generators/application.json | 2 +- .../node/src/generators/application/application.ts | 6 ------ .../application/files/connect/src/main.ts__tmpl__ | 13 ------------- .../node/src/generators/application/schema.d.ts | 7 +------ .../node/src/generators/application/schema.json | 2 +- packages/node/src/utils/versions.ts | 3 --- 6 files changed, 3 insertions(+), 30 deletions(-) delete mode 100644 packages/node/src/generators/application/files/connect/src/main.ts__tmpl__ diff --git a/docs/generated/packages/node/generators/application.json b/docs/generated/packages/node/generators/application.json index 0dd6d1ee16f89..2d45bfd014e40 100644 --- a/docs/generated/packages/node/generators/application.json +++ b/docs/generated/packages/node/generators/application.json @@ -87,7 +87,7 @@ "framework": { "description": "Generate the node application using a framework", "type": "string", - "enum": ["express", "koa", "fastify", "connect", "none"], + "enum": ["express", "koa", "fastify", "none"], "default": "none", "x-prompt": "Which framework do you want to use?", "x-priority": "important" diff --git a/packages/node/src/generators/application/application.ts b/packages/node/src/generators/application/application.ts index a242881e73d26..a4a9c32ef5c63 100644 --- a/packages/node/src/generators/application/application.ts +++ b/packages/node/src/generators/application/application.ts @@ -31,8 +31,6 @@ import { Schema } from './schema'; import { initGenerator } from '../init/init'; import { getRelativePathToRootTsConfig } from '@nrwl/workspace/src/utilities/typescript'; import { - connectTypingsVersion, - connectVersion, esbuildVersion, expressTypingsVersion, expressVersion, @@ -277,10 +275,6 @@ function addProjectDependencies( fastify: { fastify: fastifyVersion, }, - connect: { - connect: connectVersion, - '@types/connect': connectTypingsVersion, - }, }; return addDependenciesToPackageJson( tree, diff --git a/packages/node/src/generators/application/files/connect/src/main.ts__tmpl__ b/packages/node/src/generators/application/files/connect/src/main.ts__tmpl__ deleted file mode 100644 index abb5dd17808b4..0000000000000 --- a/packages/node/src/generators/application/files/connect/src/main.ts__tmpl__ +++ /dev/null @@ -1,13 +0,0 @@ -import connect from 'connect'; - -const port = process.env.PORT ? Number(process.env.PORT) : <%= port %>; - -const app = connect(); - -app.use((req, res) => { - res.end(JSON.stringify({ 'message': 'Hello API' })); -}); - -app.listen(port, () => { - console.log(`[ ready ] http://localhost:${port}`); -}) diff --git a/packages/node/src/generators/application/schema.d.ts b/packages/node/src/generators/application/schema.d.ts index a2de32706631b..2503ef9016405 100644 --- a/packages/node/src/generators/application/schema.d.ts +++ b/packages/node/src/generators/application/schema.d.ts @@ -22,9 +22,4 @@ export interface Schema { docker?: boolean; } -export type NodeJsFrameWorks = - | 'express' - | 'koa' - | 'fastify' - | 'connect' - | 'none'; +export type NodeJsFrameWorks = 'express' | 'koa' | 'fastify' | 'none'; diff --git a/packages/node/src/generators/application/schema.json b/packages/node/src/generators/application/schema.json index 3bfda4f5e7f8a..a70e62cac6aa5 100644 --- a/packages/node/src/generators/application/schema.json +++ b/packages/node/src/generators/application/schema.json @@ -87,7 +87,7 @@ "framework": { "description": "Generate the node application using a framework", "type": "string", - "enum": ["express", "koa", "fastify", "connect", "none"], + "enum": ["express", "koa", "fastify", "none"], "default": "none", "x-prompt": "Which framework do you want to use?", "x-priority": "important" diff --git a/packages/node/src/utils/versions.ts b/packages/node/src/utils/versions.ts index 677b5905e466b..c79bbc66979d5 100644 --- a/packages/node/src/utils/versions.ts +++ b/packages/node/src/utils/versions.ts @@ -14,7 +14,4 @@ export const koaTypingsVersion = '2.13.5'; export const fastifyVersion = '4.11.0'; -export const connectVersion = '3.7.0'; -export const connectTypingsVersion = '3.4.35'; - export const axiosVersion = '^1.0.0';