castle-web-cli 0.4.136 → 0.4.137

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 +11 -1
  2. package/package.json +1 -1
package/dist/init.js CHANGED
@@ -3,7 +3,7 @@ import * as path from 'path';
3
3
  import { COMMON_INSTRUCTIONS } from './commonInstructions.js';
4
4
  import { installDeps } from './install.js';
5
5
  import { deckMainFile, deckStarterScene } from './castleJson.js';
6
- import { addImportTo, IMPORTS_DIR, lockImportTree } from './imports.js';
6
+ import { addImportTo, IMPORTS_DIR, lockImportTree, restoreMissingImports, syncImportDependencies, } from './imports.js';
7
7
  import { discardParentSource, fetchParentSource, unpackParentSource, writeRemixIdentity, } from './remix.js';
8
8
  import { getCliEntryPath, getKitsDir, getRepoRoot, getSdkPackagePath, toPosixPath, } from './localPaths.js';
9
9
  import { serve } from './serve.js';
@@ -470,6 +470,16 @@ async function scaffoldFromRemix(parentDeckId, projectDir, identity) {
470
470
  }
471
471
  else {
472
472
  await unpackParentSource(source, projectDir);
473
+ // `imports/` is left out of the source archive, so a copied deck arrives
474
+ // with its pins and none of the files -- same as get-deck, which leaves
475
+ // this to `install`. Its declared deps then have to reach package.json
476
+ // before the install below.
477
+ for (const alias of await restoreMissingImports(projectDir)) {
478
+ console.log(`Restored import ${alias}`);
479
+ }
480
+ for (const dep of syncImportDependencies(projectDir)) {
481
+ console.log(`Added dependency ${dep} from an import`);
482
+ }
473
483
  }
474
484
  }
475
485
  finally {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "castle-web-cli",
3
- "version": "0.4.136",
3
+ "version": "0.4.137",
4
4
  "type": "module",
5
5
  "bin": {
6
6
  "castle-web": "./dist/index.js"