@salesforce/webapp-template-cli-experimental 1.58.1 → 1.59.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.
@@ -9,8 +9,8 @@ export interface BuildDistAppExecutorResult {
9
9
  /**
10
10
  * Nx executor for building the application in the dist folder
11
11
  *
12
- * This executor navigates to the project's dist folder and runs npm ci (or npm install when
13
- * no package-lock.json exists) followed by npm run build.
12
+ * This executor navigates to the project's dist folder and runs npm install (no lockfile),
13
+ * installs internal @salesforce packages from workspace via file:, then npm run build.
14
14
  *
15
15
  * @param options - Executor options
16
16
  * @param context - Nx executor context
@@ -1 +1 @@
1
- {"version":3,"file":"executor.d.ts","sourceRoot":"","sources":["../../../../src/nx-plugin/executors/build-dist-app/executor.ts"],"names":[],"mappings":"AAQA,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,CAkCrC"}
1
+ {"version":3,"file":"executor.d.ts","sourceRoot":"","sources":["../../../../src/nx-plugin/executors/build-dist-app/executor.ts"],"names":[],"mappings":"AAQA,OAAO,EAAE,KAAK,eAAe,EAAU,MAAM,YAAY,CAAC;AAC1D,OAAO,KAAK,EAAE,2BAA2B,EAAE,MAAM,UAAU,CAAC;AAkB5D;;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,CA+CrC"}
@@ -4,15 +4,28 @@
4
4
  * For full license text, see the LICENSE.txt file
5
5
  */
6
6
  import { execSync } from "child_process";
7
- import { existsSync } from "fs";
7
+ import { existsSync, readFileSync } from "fs";
8
8
  import { join } from "path";
9
9
  import { logger } from "@nx/devkit";
10
10
  import { createProjectPaths } from "../utils";
11
+ const NO_PACKAGE_LOCK = "--package-lock=false";
12
+ /** Workspace-relative paths for internal @salesforce packages to install from file (not template/app/feature packages). */
13
+ const INTERNAL_PACKAGE_PATHS = [
14
+ "packages/sdk/sdk-core",
15
+ "packages/sdk/sdk-data",
16
+ "packages/sdk/sdk-chat",
17
+ "packages/sdk/sdk-lightning",
18
+ "packages/sdk/sdk-view",
19
+ "packages/webapps",
20
+ "packages/vite-plugin-webapps",
21
+ "packages/micro-frontends",
22
+ "packages/agentforceConversationClient",
23
+ ];
11
24
  /**
12
25
  * Nx executor for building the application in the dist folder
13
26
  *
14
- * This executor navigates to the project's dist folder and runs npm ci (or npm install when
15
- * no package-lock.json exists) followed by npm run build.
27
+ * This executor navigates to the project's dist folder and runs npm install (no lockfile),
28
+ * installs internal @salesforce packages from workspace via file:, then npm run build.
16
29
  *
17
30
  * @param options - Executor options
18
31
  * @param context - Nx executor context
@@ -28,14 +41,29 @@ export default async function runExecutor(options, context) {
28
41
  const targetPath = join(context.root, projectPaths.webApp);
29
42
  logger.info(`Building application in ${targetPath}...`);
30
43
  const execOptions = { cwd: targetPath, stdio: "inherit", env: process.env };
31
- const hasLockfile = existsSync(join(targetPath, "package-lock.json"));
32
- if (hasLockfile) {
33
- logger.info("Running npm ci...");
34
- execSync("npm ci", execOptions);
35
- }
36
- else {
37
- logger.info("No package-lock.json found; running npm install...");
38
- execSync("npm install", execOptions);
44
+ // Always npm install without generating a lockfile so dist is safe for publishing
45
+ logger.info("Running npm install (no package lock)...");
46
+ execSync(`npm install ${NO_PACKAGE_LOCK}`, execOptions);
47
+ // Install internal @salesforce packages from workspace so dist app uses local builds (also no lockfile)
48
+ for (const relPath of INTERNAL_PACKAGE_PATHS) {
49
+ const pkgPath = join(context.root, relPath);
50
+ const pkgJsonPath = join(pkgPath, "package.json");
51
+ if (!existsSync(pkgJsonPath))
52
+ continue;
53
+ const distPath = join(pkgPath, "dist");
54
+ if (!existsSync(distPath))
55
+ continue;
56
+ let name;
57
+ try {
58
+ name = JSON.parse(readFileSync(pkgJsonPath, "utf8")).name;
59
+ }
60
+ catch {
61
+ continue;
62
+ }
63
+ if (!name || !name.startsWith("@salesforce/"))
64
+ continue;
65
+ logger.info(`Installing local ${name} from workspace...`);
66
+ execSync(`npm install ${name}@file:${pkgPath} ${NO_PACKAGE_LOCK}`, execOptions);
39
67
  }
40
68
  // Execute npm run build
41
69
  logger.info("Running npm run build...");
@@ -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,EAAwB,MAAM,eAAe,CAAC;AAC/D,OAAO,EAAE,UAAU,EAAE,MAAM,IAAI,CAAC;AAChC,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,UAAU,WAAW,CACxC,OAAoC,EACpC,OAAwB;IAExB,IAAI,CAAC;QACJ,MAAM,YAAY,GAAG,kBAAkB,CAAC,OAAO,CAAC,CAAC;QACjD,IAAI,CAAC,YAAY,EAAE,CAAC;YACnB,OAAO,EAAE,OAAO,EAAE,KAAK,EAAE,CAAC;QAC3B,CAAC;QAED,qCAAqC;QACrC,MAAM,UAAU,GAAG,IAAI,CAAC,OAAO,CAAC,IAAI,EAAE,YAAY,CAAC,MAAM,CAAC,CAAC;QAE3D,MAAM,CAAC,IAAI,CAAC,2BAA2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@
1
1
  {
2
2
  "name": "@salesforce/webapp-template-cli-experimental",
3
- "version": "1.58.1",
3
+ "version": "1.59.1",
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": "3ca21b4efdb09c459fac018f54284b3637fc02e7"
48
+ "gitHead": "740f822d2897cd524c245f3c9f94d6e4dae78d93"
49
49
  }