@nx/express 24.0.0-pr.37405.acdaf31 → 24.0.0-rc.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -35,10 +35,30 @@ app.get('/api', (req, res) => {
35
35
  });
36
36
 
37
37
  const port = process.env.PORT || 3333;
38
- const server = app.listen(port, () => {
38
+ const server = app.listen(port, async (error${options.js ? '' : '?: Error'}) => {
39
+ // A failed listen also reaches the 'error' listener below
40
+ if (error) {
41
+ return;
42
+ }
39
43
  console.log(\`Listening at http://localhost:\${port}/api\`);
44
+ // Set when Nx waits for this server to be ready
45
+ if (process.env.NX_READY_SIGNAL_SOCKET) {
46
+ try {
47
+ // Function keeps TypeScript and bundlers from rewriting or bundling the import
48
+ const load = new Function('s', 'return import(s)')${options.js ? '' : ' as (s: string) => Promise<{ emitReadySignal(server: unknown): boolean }>'};
49
+ (await load('@nx/js/ready-signal')).emitReadySignal(server);
50
+ } catch {
51
+ // @nx/js isn't installed
52
+ }
53
+ }
54
+ });
55
+ server.on('error', (error) => {
56
+ console.error(error);
57
+ // Errors after listen, such as a failed accept, leave the server running
58
+ if (!server.listening) {
59
+ process.exit(1);
60
+ }
40
61
  });
41
- server.on('error', console.error);
42
62
  `);
43
63
  if (options.js) {
44
64
  (0, devkit_1.toJS)(tree);
@@ -46,7 +66,6 @@ server.on('error', console.error);
46
66
  }
47
67
  async function applicationGenerator(tree, schema) {
48
68
  return await applicationGeneratorInternal(tree, {
49
- addPlugin: false,
50
69
  useProjectJson: true,
51
70
  ...schema,
52
71
  });
@@ -82,10 +101,6 @@ async function normalizeOptions(host, options) {
82
101
  projectType: 'application',
83
102
  directory: options.directory,
84
103
  });
85
- const nxJson = (0, devkit_1.readNxJson)(host);
86
- const addPlugin = process.env.NX_ADD_PLUGINS !== 'false' &&
87
- nxJson.useInferencePlugins !== false;
88
- options.addPlugin ??= addPlugin;
89
104
  const useProjectJson = options.useProjectJson ?? !(0, internal_2.isUsingTsSolutionSetup)(host);
90
105
  return {
91
106
  ...options,
@@ -17,11 +17,6 @@ export interface Schema {
17
17
  babelJest?: boolean;
18
18
  js: boolean;
19
19
  enableTypedLinting?: boolean;
20
- /**
21
- * @deprecated Use `enableTypedLinting` instead. This option will be removed in Nx v24.
22
- */
23
- setParserOptionsProject?: boolean;
24
- addPlugin?: boolean;
25
20
  useProjectJson?: boolean;
26
21
  keepExistingVersions?: boolean;
27
22
  }
@@ -72,12 +72,6 @@
72
72
  "description": "Whether to enable typed linting. For flat configs, this configures the recommended `parserOptions.projectService` and `tsconfigRootDir`. For legacy `.eslintrc` configs, this configures `parserOptions.project`. We do not enable this by default for lint performance reasons.",
73
73
  "default": false
74
74
  },
75
- "setParserOptionsProject": {
76
- "type": "boolean",
77
- "description": "Deprecated alias for `enableTypedLinting`.",
78
- "default": false,
79
- "x-deprecated": "Use `enableTypedLinting` instead. This option will be removed in Nx v24."
80
- },
81
75
  "useProjectJson": {
82
76
  "type": "boolean",
83
77
  "description": "Use a `project.json` configuration file instead of inlining the Nx configuration in the `package.json` file."
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@nx/express",
3
- "version": "24.0.0-pr.37405.acdaf31",
3
+ "version": "24.0.0-rc.1",
4
4
  "private": false,
5
5
  "description": "The Nx Plugin for Express contains executors and generators for allowing your workspace to create powerful Express Node applications and APIs.",
6
6
  "repository": {
@@ -39,9 +39,9 @@
39
39
  "supportsOptionalMigrations": true
40
40
  },
41
41
  "dependencies": {
42
- "@nx/devkit": "24.0.0-pr.37405.acdaf31",
43
- "@nx/js": "24.0.0-pr.37405.acdaf31",
44
- "@nx/node": "24.0.0-pr.37405.acdaf31",
42
+ "@nx/devkit": "24.0.0-rc.1",
43
+ "@nx/js": "24.0.0-rc.1",
44
+ "@nx/node": "24.0.0-rc.1",
45
45
  "semver": "^7.6.3",
46
46
  "tslib": "^2.3.0"
47
47
  },