@nx/esbuild 20.1.0-canary.20241012-37a7eb1 → 20.1.0-canary.20241015-1badac8

Sign up to get free protection for your applications and to get access to all the features.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@nx/esbuild",
3
- "version": "20.1.0-canary.20241012-37a7eb1",
3
+ "version": "20.1.0-canary.20241015-1badac8",
4
4
  "private": false,
5
5
  "description": "The Nx Plugin for esbuild contains executors and generators that support building applications using esbuild",
6
6
  "repository": {
@@ -31,8 +31,8 @@
31
31
  "migrations": "./migrations.json"
32
32
  },
33
33
  "dependencies": {
34
- "@nx/devkit": "20.1.0-canary.20241012-37a7eb1",
35
- "@nx/js": "20.1.0-canary.20241012-37a7eb1",
34
+ "@nx/devkit": "20.1.0-canary.20241015-1badac8",
35
+ "@nx/js": "20.1.0-canary.20241015-1badac8",
36
36
  "fast-glob": "3.2.7",
37
37
  "picocolors": "^1.1.0",
38
38
  "tsconfig-paths": "^4.1.2",
@@ -1,3 +1,3 @@
1
- import { EsBuildExecutorOptions, NormalizedEsBuildExecutorOptions } from '../schema';
2
- import { ExecutorContext } from '@nx/devkit';
1
+ import { type ExecutorContext } from '@nx/devkit';
2
+ import type { EsBuildExecutorOptions, NormalizedEsBuildExecutorOptions } from '../schema';
3
3
  export declare function normalizeOptions(options: EsBuildExecutorOptions, context: ExecutorContext): NormalizedEsBuildExecutorOptions;
@@ -1,25 +1,29 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.normalizeOptions = normalizeOptions;
4
+ const devkit_1 = require("@nx/devkit");
5
+ const js_1 = require("@nx/js");
6
+ const ts_solution_setup_1 = require("@nx/js/src/utils/typescript/ts-solution-setup");
4
7
  const fs = require("fs");
5
8
  const path = require("path");
6
- const devkit_1 = require("@nx/devkit");
7
9
  const pc = require("picocolors");
8
- const js_1 = require("@nx/js");
9
10
  function normalizeOptions(options, context) {
11
+ const isTsSolutionSetup = (0, ts_solution_setup_1.isUsingTsSolutionSetup)();
12
+ if (isTsSolutionSetup && options.generatePackageJson) {
13
+ throw new Error(`Setting 'generatePackageJson: true' is not allowed with the current TypeScript setup. Please update the 'package.json' file at the project root as needed and don't set the 'generatePackageJson' option.`);
14
+ }
10
15
  const tsConfig = (0, js_1.readTsConfig)(options.tsConfig);
11
- // If we're not generating package.json file, then copy it as-is as an asset.
12
- const assets = options.generatePackageJson
16
+ // If we're not generating package.json file, then copy it as-is as an asset when not using ts solution setup.
17
+ const assets = options.generatePackageJson || isTsSolutionSetup
13
18
  ? options.assets
14
19
  : [
15
20
  ...options.assets,
16
21
  (0, devkit_1.joinPathFragments)(context.projectGraph.nodes[context.projectName].data.root, 'package.json'),
17
22
  ];
18
23
  if (!options.bundle && options.thirdParty) {
19
- devkit_1.logger.info(pc.yellow(`Your build has conflicting options, ${pc.bold('bundle:false')} and ${pc.bold('thirdParty:true')}. Your package.json depedencies might not be generated correctly so we added an update ${pc.bold('thirdParty:false')}`));
24
+ devkit_1.logger.info(pc.yellow(`Your build has conflicting options, ${pc.bold('bundle:false')} and ${pc.bold('thirdParty:true')}. Your package.json dependencies might not be generated correctly so we added an update ${pc.bold('thirdParty:false')}`));
20
25
  }
21
26
  const thirdParty = !options.bundle ? false : options.thirdParty;
22
- const { root: projectRoot } = context.projectsConfigurations.projects[context.projectName];
23
27
  const declarationRootDir = options.declarationRootDir
24
28
  ? path.join(context.root, options.declarationRootDir)
25
29
  : undefined;