castle-web-cli 0.4.2 → 0.4.3

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.
Files changed (2) hide show
  1. package/dist/init.js +8 -5
  2. package/package.json +1 -1
package/dist/init.js CHANGED
@@ -142,11 +142,14 @@ function scaffoldFromKit(kit, projectDir) {
142
142
  // For a deck scaffolded from a globally-installed castle-web, rewrite to
143
143
  // the published packages instead.
144
144
  const sdkPath = getSdkPackagePath();
145
- const cliEntry = getCliEntryPath();
146
- const sdkIsLocal = fs.existsSync(sdkPath);
147
- const cliIsLocal = fs.existsSync(cliEntry);
148
- const sdkRef = sdkIsLocal ? `file:${toPosixPath(sdkPath)}` : `^${PUBLISHED_SDK_VERSION}`;
149
- const cliDistAbs = cliIsLocal ? toPosixPath(path.dirname(cliEntry)) : null;
145
+ // "Workspace mode" = the cli is running from a castle-experimental-web
146
+ // checkout (sdk/ exists next to cli/). Otherwise we're a globally-
147
+ // installed npm package and need to use the published refs + binary.
148
+ const workspaceMode = fs.existsSync(sdkPath);
149
+ const sdkRef = workspaceMode ? `file:${toPosixPath(sdkPath)}` : `^${PUBLISHED_SDK_VERSION}`;
150
+ const cliDistAbs = workspaceMode
151
+ ? toPosixPath(path.dirname(getCliEntryPath()))
152
+ : null;
150
153
  if (pkg.dependencies &&
151
154
  typeof pkg.dependencies['castle-web-sdk'] === 'string' &&
152
155
  pkg.dependencies['castle-web-sdk'].startsWith('file:')) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "castle-web-cli",
3
- "version": "0.4.2",
3
+ "version": "0.4.3",
4
4
  "type": "module",
5
5
  "bin": {
6
6
  "castle-web": "./dist/index.js"