transitions-refine 0.3.17 → 0.3.18

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/bin/cli.mjs +14 -2
  2. package/package.json +1 -1
package/bin/cli.mjs CHANGED
@@ -19,7 +19,7 @@
19
19
  // 4. starts the local refine relay (serves the panel at /inject.js).
20
20
 
21
21
  import { spawn, spawnSync } from "node:child_process";
22
- import { existsSync, readFileSync, writeFileSync, mkdirSync, cpSync } from "node:fs";
22
+ import { existsSync, readFileSync, writeFileSync, mkdirSync, cpSync, realpathSync } from "node:fs";
23
23
  import { dirname, join, resolve } from "node:path";
24
24
  import { fileURLToPath } from "node:url";
25
25
  import { homedir } from "node:os";
@@ -387,7 +387,19 @@ function main() {
387
387
 
388
388
  // Run only when invoked as the CLI entry (npx / node bin/cli.mjs), so tests can
389
389
  // import the resolver helpers without triggering a live run.
390
- if (process.argv[1] && fileURLToPath(import.meta.url) === process.argv[1]) {
390
+ // Run only when invoked as the CLI entry (npx / global install / node bin/cli.mjs).
391
+ // We must resolve symlinks: npx and global installs invoke this via a `.bin/refine`
392
+ // symlink, so process.argv[1] is the symlink path while import.meta.url is the real
393
+ // file. Comparing raw paths fails through the symlink and silently skips main().
394
+ function isCliEntry() {
395
+ if (!process.argv[1]) return false;
396
+ const self = fileURLToPath(import.meta.url);
397
+ const resolve = (p) => {
398
+ try { return realpathSync(p); } catch { return p; }
399
+ };
400
+ return resolve(process.argv[1]) === resolve(self);
401
+ }
402
+ if (isCliEntry()) {
391
403
  main();
392
404
  }
393
405
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "transitions-refine",
3
- "version": "0.3.17",
3
+ "version": "0.3.18",
4
4
  "description": "Live, agent-driven Refine panel for CSS/Motion transitions — injects a timeline + Refine UI and runs transitions.dev suggestions via your coding agent.",
5
5
  "type": "module",
6
6
  "bin": {