@series-inc/stowkit-cli 0.1.2 → 0.1.4

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 +6 -16
  2. package/package.json +3 -1
package/dist/cli.js CHANGED
@@ -2,14 +2,12 @@
2
2
  import * as path from 'node:path';
3
3
  import { existsSync } from 'node:fs';
4
4
  import { fileURLToPath } from 'node:url';
5
- import { createRequire } from 'node:module';
6
5
  import { fullBuild, scanProject, showStatus } from './orchestrator.js';
7
6
  import { startServer } from './server.js';
8
7
  import { initProject } from './init.js';
9
8
  import { cleanupProject } from './cleanup.js';
10
9
  const args = process.argv.slice(2);
11
10
  const thisDir = path.dirname(fileURLToPath(import.meta.url));
12
- const req = createRequire(import.meta.url);
13
11
  function printUsage() {
14
12
  console.log(`
15
13
  Usage:
@@ -32,21 +30,13 @@ Options:
32
30
  }
33
31
  function resolveAppDir(packageName, monorepoFolder) {
34
32
  const candidates = [
35
- path.resolve(thisDir, `../../${monorepoFolder}/dist`), // monorepo dev
33
+ // Monorepo dev: sibling folder
34
+ path.resolve(thisDir, `../../${monorepoFolder}/dist`),
35
+ // Installed as dep of CLI: nested node_modules
36
+ path.resolve(thisDir, `../node_modules/${packageName}/dist`),
37
+ // Hoisted in global node_modules
38
+ path.resolve(thisDir, `../../../${packageName}/dist`),
36
39
  ];
37
- // Try resolving from CLI package location
38
- try {
39
- const pkgJson = req.resolve(`${packageName}/package.json`);
40
- candidates.push(path.join(path.dirname(pkgJson), 'dist'));
41
- }
42
- catch { /* not installed next to CLI */ }
43
- // Try resolving from user's project (npx runs CLI from global cache)
44
- try {
45
- const projectReq = createRequire(path.join(process.cwd(), 'package.json'));
46
- const pkgJson = projectReq.resolve(`${packageName}/package.json`);
47
- candidates.push(path.join(path.dirname(pkgJson), 'dist'));
48
- }
49
- catch { /* not installed in project */ }
50
40
  for (const dir of candidates) {
51
41
  if (existsSync(path.join(dir, 'index.html')))
52
42
  return dir;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@series-inc/stowkit-cli",
3
- "version": "0.1.2",
3
+ "version": "0.1.4",
4
4
  "type": "module",
5
5
  "bin": {
6
6
  "stowkit": "./dist/cli.js"
@@ -16,6 +16,8 @@
16
16
  "dev": "tsc --watch"
17
17
  },
18
18
  "dependencies": {
19
+ "@series-inc/stowkit-packer-gui": "^0.1.1",
20
+ "@series-inc/stowkit-editor": "^0.1.1",
19
21
  "draco3d": "^1.5.7",
20
22
  "fbx-parser": "^2.1.3",
21
23
  "ffmpeg-static": "^5.2.0",