@nx/web 17.1.2 → 17.2.0-beta.0

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.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@nx/web",
3
- "version": "17.1.2",
3
+ "version": "17.2.0-beta.0",
4
4
  "private": false,
5
5
  "description": "The Nx Plugin for Web Components contains generators for managing Web Component applications and libraries within an Nx workspace. It provides:\n\n\n- Integration with libraries such as Jest, Cypress, and Storybook.\n\n- Scaffolding for creating buildable libraries that can be published to npm.\n\n- Utilities for automatic workspace refactoring.",
6
6
  "repository": {
@@ -34,9 +34,9 @@
34
34
  "detect-port": "^1.5.1",
35
35
  "http-server": "^14.1.0",
36
36
  "tslib": "^2.3.0",
37
- "@nx/devkit": "17.1.2",
38
- "@nx/js": "17.1.2",
39
- "@nrwl/web": "17.1.2"
37
+ "@nx/devkit": "17.2.0-beta.0",
38
+ "@nx/js": "17.2.0-beta.0",
39
+ "@nrwl/web": "17.2.0-beta.0"
40
40
  },
41
41
  "publishConfig": {
42
42
  "access": "public"
@@ -91,31 +91,39 @@ function createFileWatcher(project, changeHandler) {
91
91
  });
92
92
  }
93
93
  async function* fileServerExecutor(options, context) {
94
+ if (!options.buildTarget && !options.staticFilePath) {
95
+ throw new Error("You must set either 'buildTarget' or 'staticFilePath'.");
96
+ }
97
+ if (options.watch && !options.buildTarget) {
98
+ throw new Error("Watch error: You can only specify 'watch' when 'buildTarget' is set.");
99
+ }
94
100
  let running = false;
95
- const run = () => {
96
- if (!running) {
97
- running = true;
98
- try {
99
- const args = getBuildTargetCommand(options);
100
- (0, child_process_1.execFileSync)(pmCmd, args, {
101
- stdio: [0, 1, 2],
102
- });
103
- }
104
- catch {
105
- throw new Error(`Build target failed: ${chalk.bold(options.buildTarget)}`);
106
- }
107
- finally {
108
- running = false;
101
+ let disposeWatch;
102
+ if (options.buildTarget) {
103
+ const run = () => {
104
+ if (!running) {
105
+ running = true;
106
+ try {
107
+ const args = getBuildTargetCommand(options);
108
+ (0, child_process_1.execFileSync)(pmCmd, args, {
109
+ stdio: [0, 1, 2],
110
+ });
111
+ }
112
+ catch {
113
+ throw new Error(`Build target failed: ${chalk.bold(options.buildTarget)}`);
114
+ }
115
+ finally {
116
+ running = false;
117
+ }
109
118
  }
119
+ };
120
+ if (options.watch) {
121
+ const projectRoot = context.projectsConfigurations.projects[context.projectName].root;
122
+ disposeWatch = await createFileWatcher(context.projectName, run);
110
123
  }
111
- };
112
- let disposeWatch;
113
- if (options.watch) {
114
- const projectRoot = context.projectsConfigurations.projects[context.projectName].root;
115
- disposeWatch = await createFileWatcher(context.projectName, run);
124
+ // perform initial run
125
+ run();
116
126
  }
117
- // perform initial run
118
- run();
119
127
  const outputPath = getBuildTargetOutputPath(options, context);
120
128
  if (options.spa) {
121
129
  const src = (0, path_1.join)(outputPath, 'index.html');
@@ -5,7 +5,7 @@ export interface Schema {
5
5
  sslKey?: string;
6
6
  sslCert?: string;
7
7
  proxyUrl?: string;
8
- buildTarget: string;
8
+ buildTarget?: string;
9
9
  parallel: boolean;
10
10
  maxParallel?: number;
11
11
  withDeps: boolean;
@@ -94,6 +94,5 @@
94
94
  "default": -1
95
95
  }
96
96
  },
97
- "additionalProperties": false,
98
- "required": ["buildTarget"]
97
+ "additionalProperties": false
99
98
  }