@iwsdk/create 0.3.0 → 0.3.2

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/cli.js +29 -6
  2. package/package.json +1 -1
package/dist/cli.js CHANGED
@@ -1,5 +1,5 @@
1
1
  #!/usr/bin/env node
2
- import require$$0$2, { execSync, spawn as spawn$1 } from 'child_process';
2
+ import require$$0$2, { execSync, spawn as spawn$1, execFileSync } from 'child_process';
3
3
  import fs$2 from 'fs';
4
4
  import path$4, { dirname, join } from 'path';
5
5
  import { fileURLToPath } from 'url';
@@ -10960,6 +10960,12 @@ async function installDependenciesFromBundle(outDir, source) {
10960
10960
  throw e;
10961
10961
  }
10962
10962
  }
10963
+ function printReferenceWarmupGuidance() {
10964
+ console.log(stdoutColor.gray(' # @iwsdk/reference downloads its pinned model automatically during warmup'));
10965
+ console.log(stdoutColor.gray(' # optional for bundle/internal or unpublished corpus payloads: set IWSDK_REFERENCE_ASSETS_BASE_URL to the hosted reference-assets dist URL'));
10966
+ console.log(stdoutColor.gray(' # warmup still needs access to the baked public model file URLs unless the shared cache is already pre-warmed'));
10967
+ console.log(stdoutColor.gray(' # then run: npx iwsdk reference warmup'));
10968
+ }
10963
10969
  function printNextSteps(appName, installed, actionItems = []) {
10964
10970
  const startCmd = 'npm run dev';
10965
10971
  console.log('\nNext steps:');
@@ -10983,6 +10989,7 @@ function printNextSteps(appName, installed, actionItems = []) {
10983
10989
  if (!installed) {
10984
10990
  console.log(stdoutColor.gray(' npm install'));
10985
10991
  }
10992
+ printReferenceWarmupGuidance();
10986
10993
  console.log(stdoutColor.gray(` ${startCmd}`));
10987
10994
  }
10988
10995
  function printPrerequisites(prereqs = []) {
@@ -19526,7 +19533,11 @@ async function detectMSEVersion(platform) {
19526
19533
  }
19527
19534
  function isVersionSufficient(installed, required = MSE_MIN_VERSION) {
19528
19535
  try {
19529
- return semver$1.gte(installed, required);
19536
+ const coerced = semver$1.coerce(installed);
19537
+ if (!coerced) {
19538
+ return false;
19539
+ }
19540
+ return semver$1.gte(coerced, required);
19530
19541
  }
19531
19542
  catch {
19532
19543
  return false;
@@ -20404,7 +20415,7 @@ async function scaffoldProject(recipes, outDir) {
20404
20415
  }
20405
20416
  }
20406
20417
 
20407
- const VERSION = "0.3.0";
20418
+ const VERSION = "0.3.2";
20408
20419
  const NODE_ENGINE = ">=20.19.0";
20409
20420
 
20410
20421
  /**
@@ -20898,9 +20909,6 @@ IWSDK Create CLI v${VERSION}\nNode ${process.version}`;
20898
20909
  }
20899
20910
  const xrLiteral = `{ ${entries.join(', ')} }`;
20900
20911
  resolvedRecipe.edits['@xrFeaturesStr'] = xrLiteral;
20901
- // MCP tool selection for vite.config.ts
20902
- const mcpToolsLiteral = `[${res.aiTools.map((t) => `'${t}'`).join(', ')}]`;
20903
- resolvedRecipe.edits['@mcpToolsStr'] = mcpToolsLiteral;
20904
20912
  const outDir = join(process.cwd(), res.name);
20905
20913
  // Check if target directory already exists and is non-empty
20906
20914
  if (fs$2.existsSync(outDir) && fs$2.readdirSync(outDir).length > 0) {
@@ -21006,6 +21014,21 @@ IWSDK Create CLI v${VERSION}\nNode ${process.version}`;
21006
21014
  await installDependencies(outDir);
21007
21015
  }
21008
21016
  }
21017
+ // Write MCP adapter configs for the selected AI tools
21018
+ if (res.installNow && res.aiTools.length > 0) {
21019
+ try {
21020
+ execFileSync(process.execPath, [
21021
+ join(outDir, 'node_modules/@iwsdk/cli/dist/cli.js'),
21022
+ 'adapter',
21023
+ 'sync',
21024
+ '--tools',
21025
+ res.aiTools.join(','),
21026
+ ], { cwd: outDir, stdio: 'ignore', timeout: 15000 });
21027
+ }
21028
+ catch {
21029
+ // Non-fatal: adapter sync failure shouldn't block project creation
21030
+ }
21031
+ }
21009
21032
  // Build prerequisites list (e.g., Meta Spatial Editor), including path-aware notes
21010
21033
  const prereqs = [...(res.prerequisites || [])];
21011
21034
  if (res.metaspatial) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@iwsdk/create",
3
- "version": "0.3.0",
3
+ "version": "0.3.2",
4
4
  "description": "Interactive CLI to scaffold Immersive Web SDK starter apps",
5
5
  "type": "module",
6
6
  "private": false,