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.
- package/dist/init.js +8 -5
- 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
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
const
|
|
149
|
-
const
|
|
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:')) {
|