@salesforce/webapp-template-cli-experimental 1.42.0 → 1.43.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.
@@ -1 +1 @@
1
- {"version":3,"file":"executor.d.ts","sourceRoot":"","sources":["../../../../src/nx-plugin/executors/apply-patches/executor.ts"],"names":[],"mappings":"AAOA,OAAO,EAAE,KAAK,eAAe,EAAU,MAAM,YAAY,CAAC;AAC1D,OAAO,KAAK,EAAE,2BAA2B,EAAE,MAAM,UAAU,CAAC;AAE5D;;GAEG;AACH,MAAM,WAAW,0BAA0B;IAC1C,OAAO,EAAE,OAAO,CAAC;CACjB;AAED;;;;;;;;;GASG;AACH,wBAA8B,WAAW,CACxC,OAAO,EAAE,2BAA2B,EACpC,OAAO,EAAE,eAAe,GACtB,OAAO,CAAC,0BAA0B,CAAC,CAiFrC"}
1
+ {"version":3,"file":"executor.d.ts","sourceRoot":"","sources":["../../../../src/nx-plugin/executors/apply-patches/executor.ts"],"names":[],"mappings":"AAOA,OAAO,EAAE,KAAK,eAAe,EAAU,MAAM,YAAY,CAAC;AAC1D,OAAO,KAAK,EAAE,2BAA2B,EAAE,MAAM,UAAU,CAAC;AAG5D;;GAEG;AACH,MAAM,WAAW,0BAA0B;IAC1C,OAAO,EAAE,OAAO,CAAC;CACjB;AAED;;;;;;;;;GASG;AACH,wBAA8B,WAAW,CACxC,OAAO,EAAE,2BAA2B,EACpC,OAAO,EAAE,eAAe,GACtB,OAAO,CAAC,0BAA0B,CAAC,CA6DrC"}
@@ -4,8 +4,9 @@
4
4
  * For full license text, see the LICENSE.txt file
5
5
  */
6
6
  import { execSync } from "child_process";
7
- import { basename, join } from "path";
7
+ import { join } from "path";
8
8
  import { logger } from "@nx/devkit";
9
+ import { createProjectPaths } from "../utils";
9
10
  /**
10
11
  * Nx executor for applying template patches
11
12
  *
@@ -18,30 +19,18 @@ import { logger } from "@nx/devkit";
18
19
  */
19
20
  export default async function runExecutor(options, context) {
20
21
  try {
21
- // Validate that we have a project name
22
- if (!context.projectName) {
23
- logger.error("Project name is required");
24
- return { success: false };
25
- }
26
- // Get project configuration
27
- const project = context.projectGraph?.nodes[context.projectName];
28
- if (!project) {
29
- logger.error(`Project ${context.projectName} not found in project graph`);
22
+ const projectPaths = createProjectPaths(context);
23
+ if (!projectPaths) {
30
24
  return { success: false };
31
25
  }
32
26
  // Get workspace root (absolute path)
33
27
  const workspaceRoot = context.root;
34
- // Get project root (relative to workspace root)
35
- const projectRoot = project.data.root;
36
- // Get the folder name from the project root path
37
- const projectFolderName = basename(projectRoot);
38
28
  // Build paths for CLI command
29
+ const featurePath = projectPaths.root;
39
30
  const baseAppPath = options.baseAppPath || "packages/template/base-app/base-react-app";
40
- const outputPath = join(projectRoot, "dist");
41
- // Build the path to webapp
42
- const webAppPath = join(outputPath, "force-app/main/default/webapplications", projectFolderName);
31
+ const outputPath = projectPaths.dist;
43
32
  logger.info(`Applying patches for ${context.projectName}...`);
44
- logger.info(` Feature path: ${projectRoot}`);
33
+ logger.info(` Feature path: ${featurePath}`);
45
34
  logger.info(` Base app: ${baseAppPath}`);
46
35
  logger.info(` Output: ${outputPath}`);
47
36
  // Execute the CLI command via npx tsx
@@ -51,7 +40,7 @@ export default async function runExecutor(options, context) {
51
40
  * when it comes to `feature.ts`
52
41
  */
53
42
  // Build command with arguments
54
- let command = `npx tsx ${cliPath} apply-patches ${projectRoot} ${baseAppPath} ${outputPath}`;
43
+ let command = `npx tsx ${cliPath} apply-patches ${featurePath} ${baseAppPath} ${outputPath}`;
55
44
  // Add flags
56
45
  if (options.reset !== false) {
57
46
  command += " --reset";
@@ -66,7 +55,7 @@ export default async function runExecutor(options, context) {
66
55
  env: process.env,
67
56
  });
68
57
  // Clean up node_modules to prevent it from being cached
69
- const nodeModulesPath = join(webAppPath, "node_modules");
58
+ const nodeModulesPath = join(projectPaths.webApp, "node_modules");
70
59
  logger.info(`\n\nRemoving ${nodeModulesPath} to exclude from Nx cache...`);
71
60
  execSync(`rm -rf "${nodeModulesPath}"`, {
72
61
  cwd: workspaceRoot,
@@ -1 +1 @@
1
- {"version":3,"file":"executor.js","sourceRoot":"","sources":["../../../../src/nx-plugin/executors/apply-patches/executor.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AACH,OAAO,EAAE,QAAQ,EAAE,MAAM,eAAe,CAAC;AACzC,OAAO,EAAE,QAAQ,EAAE,IAAI,EAAE,MAAM,MAAM,CAAC;AACtC,OAAO,EAAwB,MAAM,EAAE,MAAM,YAAY,CAAC;AAU1D;;;;;;;;;GASG;AACH,MAAM,CAAC,OAAO,CAAC,KAAK,UAAU,WAAW,CACxC,OAAoC,EACpC,OAAwB;IAExB,IAAI,CAAC;QACJ,uCAAuC;QACvC,IAAI,CAAC,OAAO,CAAC,WAAW,EAAE,CAAC;YAC1B,MAAM,CAAC,KAAK,CAAC,0BAA0B,CAAC,CAAC;YACzC,OAAO,EAAE,OAAO,EAAE,KAAK,EAAE,CAAC;QAC3B,CAAC;QAED,4BAA4B;QAC5B,MAAM,OAAO,GAAG,OAAO,CAAC,YAAY,EAAE,KAAK,CAAC,OAAO,CAAC,WAAW,CAAC,CAAC;QACjE,IAAI,CAAC,OAAO,EAAE,CAAC;YACd,MAAM,CAAC,KAAK,CAAC,WAAW,OAAO,CAAC,WAAW,6BAA6B,CAAC,CAAC;YAC1E,OAAO,EAAE,OAAO,EAAE,KAAK,EAAE,CAAC;QAC3B,CAAC;QAED,qCAAqC;QACrC,MAAM,aAAa,GAAG,OAAO,CAAC,IAAI,CAAC;QAEnC,gDAAgD;QAChD,MAAM,WAAW,GAAG,OAAO,CAAC,IAAI,CAAC,IAAI,CAAC;QAEtC,iDAAiD;QACjD,MAAM,iBAAiB,GAAG,QAAQ,CAAC,WAAW,CAAC,CAAC;QAEhD,8BAA8B;QAC9B,MAAM,WAAW,GAAG,OAAO,CAAC,WAAW,IAAI,2CAA2C,CAAC;QACvF,MAAM,UAAU,GAAG,IAAI,CAAC,WAAW,EAAE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AK,CAAC,4BAA4B,YAAY,EAAE,CAAC,CAAC;QACzD,OAAO,EAAE,OAAO,EAAE,KAAK,EAAE,CAAC;IAC3B,CAAC;AACF,CAAC"}
@@ -1 +1 @@
1
- {"version":3,"file":"executor.d.ts","sourceRoot":"","sources":["../../../../src/nx-plugin/executors/build-dist-app/executor.ts"],"names":[],"mappings":"AAOA,OAAO,EAAE,KAAK,eAAe,EAAU,MAAM,YAAY,CAAC;AAC1D,OAAO,KAAK,EAAE,2BAA2B,EAAE,MAAM,UAAU,CAAC;AAE5D;;GAEG;AACH,MAAM,WAAW,0BAA0B;IAC1C,OAAO,EAAE,OAAO,CAAC;CACjB;AAED;;;;;;;;GAQG;AACH,wBAA8B,WAAW,CACxC,OAAO,EAAE,2BAA2B,EACpC,OAAO,EAAE,eAAe,GACtB,OAAO,CAAC,0BAA0B,CAAC,CAyDrC"}
1
+ {"version":3,"file":"executor.d.ts","sourceRoot":"","sources":["../../../../src/nx-plugin/executors/build-dist-app/executor.ts"],"names":[],"mappings":"AAOA,OAAO,EAAE,KAAK,eAAe,EAAU,MAAM,YAAY,CAAC;AAC1D,OAAO,KAAK,EAAE,2BAA2B,EAAE,MAAM,UAAU,CAAC;AAG5D;;GAEG;AACH,MAAM,WAAW,0BAA0B;IAC1C,OAAO,EAAE,OAAO,CAAC;CACjB;AAED;;;;;;;;GAQG;AACH,wBAA8B,WAAW,CACxC,OAAO,EAAE,2BAA2B,EACpC,OAAO,EAAE,eAAe,GACtB,OAAO,CAAC,0BAA0B,CAAC,CA6BrC"}
@@ -4,8 +4,9 @@
4
4
  * For full license text, see the LICENSE.txt file
5
5
  */
6
6
  import { execSync } from "child_process";
7
- import { join, basename } from "path";
7
+ import { join } from "path";
8
8
  import { logger } from "@nx/devkit";
9
+ import { createProjectPaths } from "../utils";
9
10
  /**
10
11
  * Nx executor for building the application in the dist folder
11
12
  *
@@ -17,40 +18,20 @@ import { logger } from "@nx/devkit";
17
18
  */
18
19
  export default async function runExecutor(options, context) {
19
20
  try {
20
- // Validate that we have a project name
21
- if (!context.projectName) {
22
- logger.error("Project name is required");
21
+ const projectPaths = createProjectPaths(context);
22
+ if (!projectPaths) {
23
23
  return { success: false };
24
24
  }
25
- // Get project configuration
26
- const project = context.projectGraph?.nodes[context.projectName];
27
- if (!project) {
28
- logger.error(`Project ${context.projectName} not found in project graph`);
29
- return { success: false };
30
- }
31
- // Get workspace root (absolute path)
32
- const workspaceRoot = context.root;
33
- // Get project root (relative to workspace root)
34
- const projectRoot = project.data.root;
35
- // Get the folder name from the project root path
36
- const projectFolderName = basename(projectRoot);
37
- // Build the path to the dist folder (static path)
38
- const targetPath = join(workspaceRoot, projectRoot, "dist/force-app/main/default/webapplications", projectFolderName);
25
+ // Build absolute path to the web app
26
+ const targetPath = join(context.root, projectPaths.webApp);
39
27
  logger.info(`Building application in ${targetPath}...`);
28
+ const options = { cwd: targetPath, stdio: "inherit", env: process.env };
40
29
  // Execute npm ci
41
30
  logger.info("Running npm ci...");
42
- execSync("npm ci", {
43
- cwd: targetPath,
44
- stdio: "inherit",
45
- env: process.env,
46
- });
31
+ execSync("npm ci", options);
47
32
  // Execute npm run build
48
33
  logger.info("Running npm run build...");
49
- execSync("npm run build", {
50
- cwd: targetPath,
51
- stdio: "inherit",
52
- env: process.env,
53
- });
34
+ execSync("npm run build", options);
54
35
  logger.info("Build completed successfully");
55
36
  return { success: true };
56
37
  }
@@ -1 +1 @@
1
- {"version":3,"file":"executor.js","sourceRoot":"","sources":["../../../../src/nx-plugin/executors/build-dist-app/executor.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AACH,OAAO,EAAE,QAAQ,EAAE,MAAM,eAAe,CAAC;AACzC,OAAO,EAAE,IAAI,EAAE,QAAQ,EAAE,MAAM,MAAM,CAAC;AACtC,OAAO,EAAwB,MAAM,EAAE,MAAM,YAAY,CAAC;AAU1D;;;;;;;;GAQG;AACH,MAAM,CAAC,OAAO,CAAC,KAAK,UAAU,WAAW,CACxC,OAAoC,EACpC,O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EAAE,SAAS,EAAE,GAAG,EAAE,OAAO,CAAC,GAAG,EAAE,CAAC;QAEzF,iBAAiB;QACjB,MAAM,CAAC,IAAI,CAAC,mBAAmB,CAAC,CAAC;QACjC,QAAQ,CAAC,QAAQ,EAAE,OAAO,CAAC,CAAC;QAE5B,wBAAwB;QACxB,MAAM,CAAC,IAAI,CAAC,0BAA0B,CAAC,CAAC;QACxC,QAAQ,CAAC,eAAe,EAAE,OAAO,CAAC,CAAC;QAEnC,MAAM,CAAC,IAAI,CAAC,8BAA8B,CAAC,CAAC;QAC5C,OAAO,EAAE,OAAO,EAAE,IAAI,EAAE,CAAC;IAC1B,CAAC;IAAC,OAAO,KAAK,EAAE,CAAC;QAChB,MAAM,YAAY,GAAG,KAAK,YAAY,KAAK,CAAC,CAAC,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC;QAC5E,MAAM,CAAC,KAAK,CAAC,6BAA6B,YAAY,EAAE,CAAC,CAAC;QAC1D,OAAO,EAAE,OAAO,EAAE,KAAK,EAAE,CAAC;IAC3B,CAAC;AACF,CAAC"}
@@ -0,0 +1,20 @@
1
+ import { type ExecutorContext } from "@nx/devkit";
2
+ import type { DevServerExecutorOptions } from "./schema";
3
+ /**
4
+ * Result of the executor
5
+ */
6
+ export interface DevServerExecutorResult {
7
+ success: boolean;
8
+ }
9
+ /**
10
+ * Nx executor for starting the dev server
11
+ *
12
+ * This executor starts a Vite dev server for the web application.
13
+ * It runs npm install first, then starts the dev server asynchronously.
14
+ *
15
+ * @param options - Executor options
16
+ * @param context - Nx executor context
17
+ * @returns Async generator yielding executor results
18
+ */
19
+ export default function runExecutor(options: DevServerExecutorOptions, context: ExecutorContext): AsyncGenerator<DevServerExecutorResult>;
20
+ //# sourceMappingURL=executor.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"executor.d.ts","sourceRoot":"","sources":["../../../../src/nx-plugin/executors/dev-server/executor.ts"],"names":[],"mappings":"AAOA,OAAO,EAAE,KAAK,eAAe,EAAU,MAAM,YAAY,CAAC;AAC1D,OAAO,KAAK,EAAE,wBAAwB,EAAE,MAAM,UAAU,CAAC;AAGzD;;GAEG;AACH,MAAM,WAAW,uBAAuB;IACvC,OAAO,EAAE,OAAO,CAAC;CACjB;AAED;;;;;;;;;GASG;AACH,wBAA+B,WAAW,CACzC,OAAO,EAAE,wBAAwB,EACjC,OAAO,EAAE,eAAe,GACtB,cAAc,CAAC,uBAAuB,CAAC,CA8CzC"}
@@ -0,0 +1,62 @@
1
+ /**
2
+ * Copyright (c) 2026, Salesforce, Inc.,
3
+ * All rights reserved.
4
+ * For full license text, see the LICENSE.txt file
5
+ */
6
+ import { execSync, spawn } from "child_process";
7
+ import { join } from "path";
8
+ import { logger } from "@nx/devkit";
9
+ import { createProjectPaths } from "../utils";
10
+ /**
11
+ * Nx executor for starting the dev server
12
+ *
13
+ * This executor starts a Vite dev server for the web application.
14
+ * It runs npm install first, then starts the dev server asynchronously.
15
+ *
16
+ * @param options - Executor options
17
+ * @param context - Nx executor context
18
+ * @returns Async generator yielding executor results
19
+ */
20
+ export default async function* runExecutor(options, context) {
21
+ try {
22
+ const projectPaths = createProjectPaths(context);
23
+ if (!projectPaths) {
24
+ yield { success: false };
25
+ return;
26
+ }
27
+ // Build absolute path to the web app
28
+ const targetPath = join(context.root, projectPaths.webApp);
29
+ logger.info(`Starting application dev server in ${targetPath}...`);
30
+ // Execute npm install synchronously (short-lived)
31
+ logger.info("Running npm install...");
32
+ execSync("npm install", { cwd: targetPath, stdio: "inherit", env: process.env });
33
+ // Start dev server asynchronously (long-running)
34
+ logger.info("Running npm run dev...");
35
+ const devServer = spawn("npm", ["run", "dev"], {
36
+ cwd: targetPath,
37
+ stdio: "inherit",
38
+ shell: true,
39
+ env: process.env,
40
+ });
41
+ yield { success: true };
42
+ // Keep running until process exits
43
+ await new Promise((resolve, reject) => {
44
+ devServer.on("exit", (code) => {
45
+ if (code === 0) {
46
+ resolve();
47
+ }
48
+ else {
49
+ reject(new Error(`Dev server exited with code ${code}`));
50
+ }
51
+ });
52
+ devServer.on("error", reject);
53
+ });
54
+ yield { success: true };
55
+ }
56
+ catch (error) {
57
+ const errorMessage = error instanceof Error ? error.message : String(error);
58
+ logger.error(`Failed to start dev server: ${errorMessage}`);
59
+ yield { success: false };
60
+ }
61
+ }
62
+ //# sourceMappingURL=executor.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"executor.js","sourceRoot":"","sources":["../../../../src/nx-plugin/executors/dev-server/executor.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AACH,OAAO,EAAE,QAAQ,EAAE,KAAK,EAAE,MAAM,eAAe,CAAC;AAChD,OAAO,EAAE,IAAI,EAAE,MAAM,MAAM,CAAC;AAC5B,OAAO,EAAwB,MAAM,EAAE,MAAM,YAAY,CAAC;AAE1D,OAAO,EAAE,kBAAkB,EAAE,MAAM,UAAU,CAAC;AAS9C;;;;;;;;;GASG;AACH,MAAM,CAAC,OAAO,CAAC,KAAK,SAAS,CAAC,CAAC,WAAW,CACzC,OAAiC,EACjC,OAAwB;IAExB,IAAI,CAAC;QACJ,MAAM,YAAY,GAAG,kBAAkB,CAAC,OAAO,CAAC,CAAC;QACjD,IAAI,CAAC,YAAY,EAAE,CAAC;YACnB,MAAM,EAAE,OAAO,EAAE,KAAK,EAAE,CAAC;YACzB,OAAO;QACR,CAAC;QAED,qCAAqC;QACrC,MAAM,UAAU,GAAG,IAAI,CAAC,OAAO,CAAC,IAAI,EAAE,YAAY,CAAC,MAAM,CAAC,CAAC;QAE3D,MAAM,CAAC,IAAI,CAAC,sCAAsC,UAAU,KAAK,CAAC,CAAC;QAEnE,kDAAkD;QAClD,MAAM,CAAC,IAAI,CAAC,wBAAwB,CAAC,CAAC;QACtC,QAAQ,CAAC,aAAa,EAAE,EAAE,GAAG,EAAE,UAAU,EAAE,KAAK,EAAE,SAAS,EAAE,GAAG,EAAE,OAAO,CAAC,GAAG,EAAE,CAAC,C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
+ export declare function createProjectPaths(context: ExecutorContext): null | Paths;
8
+ export {};
9
+ //# sourceMappingURL=utils.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../../../src/nx-plugin/executors/utils.ts"],"names":[],"mappings":"AAMA,OAAO,EAAE,KAAK,eAAe,EAAU,MAAM,YAAY,CAAC;AAE1D,UAAU,KAAK;IACd,IAAI,EAAE,MAAM,CAAC;IACb,IAAI,EAAE,MAAM,CAAC;IACb,MAAM,EAAE,MAAM,CAAC;CACf;AAED,wBAAgB,kBAAkB,CAAC,OAAO,EAAE,eAAe,GAAG,IAAI,GAAG,KAAK,CAmBzE"}
@@ -0,0 +1,25 @@
1
+ /**
2
+ * Copyright (c) 2026, Salesforce, Inc.,
3
+ * All rights reserved.
4
+ * For full license text, see the LICENSE.txt file
5
+ */
6
+ import { basename, join } from "path";
7
+ import { logger } from "@nx/devkit";
8
+ export function createProjectPaths(context) {
9
+ // Validate that we have a project name
10
+ if (!context.projectName) {
11
+ logger.error("Project name is required");
12
+ return null;
13
+ }
14
+ // Get project configuration
15
+ const project = context.projectGraph?.nodes[context.projectName];
16
+ if (!project) {
17
+ logger.error(`Project ${context.projectName} not found in project graph`);
18
+ return null;
19
+ }
20
+ const root = project.data.root;
21
+ const dist = join(root, "dist");
22
+ const webApp = join(dist, "force-app/main/default/webapplications", basename(root));
23
+ return { root, dist, webApp };
24
+ }
25
+ //# sourceMappingURL=utils.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"utils.js","sourceRoot":"","sources":["../../../src/nx-plugin/executors/utils.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AACH,OAAO,EAAE,QAAQ,EAAE,IAAI,EAAE,MAAM,MAAM,CAAC;AACtC,OAAO,EAAwB,MAAM,EAAE,MAAM,YAAY,CAAC;AAQ1D,MAAM,UAAU,kBAAkB,CAAC,OAAwB;IAC1D,uCAAuC;IACvC,IAAI,CAAC,OAAO,CAAC,WAAW,EAAE,CAAC;QAC1B,MAAM,CAAC,KAAK,CAAC,0BAA0B,CAAC,CAAC;QACzC,OAAO,IAAI,CAAC;IACb,CAAC;IAED,4BAA4B;IAC5B,MAAM,OAAO,GAAG,OAAO,CAAC,YAAY,EAAE,KAAK,CAAC,OAAO,CAAC,WAAW,CAAC,CAAC;IACjE,IAAI,CAAC,OAAO,EAAE,CAAC;QACd,MAAM,CAAC,KAAK,CAAC,WAAW,OAAO,CAAC,WAAW,6BAA6B,CAAC,CAAC;QAC1E,OAAO,IAAI,CAAC;IACb,CAAC;IAED,MAAM,IAAI,GAAG,OAAO,CAAC,IAAI,CAAC,IAAI,CAAC;IAC/B,MAAM,IAAI,GAAG,IAAI,CAAC,IAAI,EAAE,MAAM,CAAC,CAAC;IAChC,MAAM,MAAM,GAAG,IAAI,CAAC,IAAI,EAAE,wCAAwC,EAAE,QAAQ,CAAC,IAAI,CAAC,CAAC,CAAC;IAEpF,OAAO,EAAE,IAAI,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC;AAC/B,CAAC"}
@@ -0,0 +1,20 @@
1
+ import { type ExecutorContext } from "@nx/devkit";
2
+ import type { WatchPatchesExecutorOptions } from "./schema";
3
+ /**
4
+ * Result of the executor
5
+ */
6
+ export interface WatchPatchesExecutorResult {
7
+ success: boolean;
8
+ }
9
+ /**
10
+ * Nx executor for watching template patches
11
+ *
12
+ * This executor wraps the apply-patches CLI command in watch mode and automatically
13
+ * determines paths based on the Nx project configuration.
14
+ *
15
+ * @param options - Executor options
16
+ * @param context - Nx executor context
17
+ * @returns Async generator yielding executor results
18
+ */
19
+ export default function runExecutor(options: WatchPatchesExecutorOptions, context: ExecutorContext): AsyncGenerator<WatchPatchesExecutorResult>;
20
+ //# sourceMappingURL=executor.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"executor.d.ts","sourceRoot":"","sources":["../../../../src/nx-plugin/executors/watch-patches/executor.ts"],"names":[],"mappings":"AAMA,OAAO,EAAE,KAAK,eAAe,EAAU,MAAM,YAAY,CAAC;AAC1D,OAAO,KAAK,EAAE,2BAA2B,EAAE,MAAM,UAAU,CAAC;AAG5D;;GAEG;AACH,MAAM,WAAW,0BAA0B;IAC1C,OAAO,EAAE,OAAO,CAAC;CACjB;AAED;;;;;;;;;GASG;AACH,wBAA+B,WAAW,CACzC,OAAO,EAAE,2BAA2B,EACpC,OAAO,EAAE,eAAe,GACtB,cAAc,CAAC,0BAA0B,CAAC,CA4D5C"}
@@ -0,0 +1,71 @@
1
+ /**
2
+ * Copyright (c) 2026, Salesforce, Inc.,
3
+ * All rights reserved.
4
+ * For full license text, see the LICENSE.txt file
5
+ */
6
+ import { spawn } from "child_process";
7
+ import { logger } from "@nx/devkit";
8
+ import { createProjectPaths } from "../utils";
9
+ /**
10
+ * Nx executor for watching template patches
11
+ *
12
+ * This executor wraps the apply-patches CLI command in watch mode and automatically
13
+ * determines paths based on the Nx project configuration.
14
+ *
15
+ * @param options - Executor options
16
+ * @param context - Nx executor context
17
+ * @returns Async generator yielding executor results
18
+ */
19
+ export default async function* runExecutor(options, context) {
20
+ try {
21
+ const projectPaths = createProjectPaths(context);
22
+ if (!projectPaths) {
23
+ yield { success: false };
24
+ return;
25
+ }
26
+ // Get workspace root (absolute path)
27
+ const workspaceRoot = context.root;
28
+ // Build paths for CLI command
29
+ const featurePath = projectPaths.root;
30
+ const baseAppPath = options.baseAppPath || "packages/template/base-app/base-react-app";
31
+ const outputPath = projectPaths.dist;
32
+ logger.info(`Watching patches for ${context.projectName}...`);
33
+ logger.info(` Feature path: ${featurePath}`);
34
+ logger.info(` Base app: ${baseAppPath}`);
35
+ logger.info(` Output: ${outputPath}`);
36
+ // Execute the CLI command via npx tsx
37
+ const cliPath = "packages/template/cli/src/index.ts";
38
+ /*
39
+ * Just in case watchPatchesCommand has issues like applyPatchesCommand (see `apply` executor)
40
+ */
41
+ // Build command with arguments
42
+ const command = `npx tsx ${cliPath} watch-patches ${featurePath} ${baseAppPath} ${outputPath}`;
43
+ logger.info(` Executing: ${command}`);
44
+ const watchProcess = spawn(command, {
45
+ cwd: workspaceRoot,
46
+ stdio: "inherit",
47
+ shell: true,
48
+ env: process.env,
49
+ });
50
+ yield { success: true };
51
+ // Keep running until process exits
52
+ await new Promise((resolve, reject) => {
53
+ watchProcess.on("exit", (code) => {
54
+ if (code === 0) {
55
+ resolve();
56
+ }
57
+ else {
58
+ reject(new Error(`Watch process exited with code ${code}`));
59
+ }
60
+ });
61
+ watchProcess.on("error", reject);
62
+ });
63
+ yield { success: true };
64
+ }
65
+ catch (error) {
66
+ const errorMessage = error instanceof Error ? error.message : String(error);
67
+ logger.error(`Failed to watch patches: ${errorMessage}`);
68
+ yield { success: false };
69
+ }
70
+ }
71
+ //# sourceMappingURL=executor.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"executor.js","sourceRoot":"","sources":["../../../../src/nx-plugin/executors/watch-patches/executor.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AACH,OAAO,EAAE,KAAK,EAAE,MAAM,eAAe,CAAC;AACtC,OAAO,EAAwB,MAAM,EAAE,MAAM,YAAY,CAAC;AAE1D,OAAO,EAAE,kBAAkB,EAAE,MAAM,UAAU,CAAC;AAS9C;;;;;;;;;GASG;AACH,MAAM,CAAC,OAAO,CAAC,KAAK,SAAS,CAAC,CAAC,WAAW,CACzC,OAAoC,EACpC,OAAwB;IAExB,IAAI,CAAC;QACJ,MAAM,YAAY,GAAG,kBAAkB,CAAC,OAAO,CAAC,CAAC;QACjD,IAAI,CAAC,YAAY,EAAE,CAAC;YACnB,MAAM,EAAE,OAAO,EAAE,KAAK,EAAE,CAAC;YACzB,OAAO;QACR,CAAC;QAED,qCAAqC;QACrC,MAAM,aAAa,GAAG,OAAO,CAAC,IAAI,CAAC;QAEnC,8BAA8B;QAC9B,MAAM,WAAW,GAAG,YAAY,CAAC,IAAI,CAAC;QACtC,MAAM,WAAW,GAAG,OAAO,CAAC,WAAW,IAAI,2CAA2C,CAAC;QACvF,MAAM,UAAU,G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ACzB,CAAC;IAAC,OAAO,KAAK,EAAE,CAAC;QAChB,MAAM,YAAY,GAAG,KAAK,YAAY,KAAK,CAAC,CAAC,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC;QAC5E,MAAM,CAAC,KAAK,CAAC,4BAA4B,YAAY,EAAE,CAAC,CAAC;QACzD,MAAM,EAAE,OAAO,EAAE,KAAK,EAAE,CAAC;IAC1B,CAAC;AACF,CAAC"}
package/executors.json CHANGED
@@ -5,10 +5,20 @@
5
5
  "schema": "./src/nx-plugin/executors/apply-patches/schema.json",
6
6
  "description": "Applies template patches to create feature apps"
7
7
  },
8
+ "watch-patches": {
9
+ "implementation": "./src/nx-plugin/executors/watch-patches/executor.ts",
10
+ "schema": "./src/nx-plugin/executors/watch-patches/schema.json",
11
+ "description": "Watches template patches to create feature apps"
12
+ },
8
13
  "build-dist-app": {
9
14
  "implementation": "./src/nx-plugin/executors/build-dist-app/executor.ts",
10
15
  "schema": "./src/nx-plugin/executors/build-dist-app/schema.json",
11
16
  "description": "Builds the application in the dist folder by running npm ci and npm run build"
17
+ },
18
+ "dev-server": {
19
+ "implementation": "./src/nx-plugin/executors/dev-server/executor.ts",
20
+ "schema": "./src/nx-plugin/executors/dev-server/schema.json",
21
+ "description": "Runs the dev server for the application in the dist folder"
12
22
  }
13
23
  }
14
24
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@salesforce/webapp-template-cli-experimental",
3
- "version": "1.42.0",
3
+ "version": "1.43.0",
4
4
  "description": "CLI tool for applying feature patches to base apps",
5
5
  "license": "SEE LICENSE IN LICENSE.txt",
6
6
  "type": "module",
@@ -45,5 +45,5 @@
45
45
  "typescript": "~5.9.3",
46
46
  "vitest": "^4.0.17"
47
47
  },
48
- "gitHead": "5bb3d5e71e337e5eacad83240b8e344fdfd1d6c7"
48
+ "gitHead": "6987ff60e5d99e64b34cbe2383e54cda1727e151"
49
49
  }