@radicool/throughline 0.12.0 → 0.12.1

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@radicool/throughline",
3
- "version": "0.12.0",
3
+ "version": "0.12.1",
4
4
  "description": "Build a complete design system end to end — author in Figma, sync tokens to code, generate Storybook. Usable from Claude Code, Cursor, Codex, or any AGENTS.md agent.",
5
5
  "type": "module",
6
6
  "bin": {
@@ -1,5 +1,5 @@
1
1
  #!/usr/bin/env node
2
- import { readFileSync, writeFileSync, mkdirSync, existsSync, readdirSync, copyFileSync } from 'node:fs';
2
+ import { readFileSync, writeFileSync, mkdirSync, existsSync, readdirSync, copyFileSync, realpathSync } from 'node:fs';
3
3
  import { join, dirname, relative, sep } from 'node:path';
4
4
  import { fileURLToPath, pathToFileURL } from 'node:url';
5
5
  import { rewritePluginRoot } from './adapters/translate.mjs';
@@ -129,7 +129,14 @@ export function install({ target, dir, pkgRoot = PKG_ROOT }) {
129
129
  return { target, dir, written, payload };
130
130
  }
131
131
 
132
- if (process.argv[1] && import.meta.url === pathToFileURL(process.argv[1]).href) {
132
+ function isDirectInvocation() {
133
+ if (!process.argv[1]) return false;
134
+ let invoked = process.argv[1];
135
+ try { invoked = realpathSync(invoked); } catch { /* keep original */ }
136
+ return import.meta.url === pathToFileURL(invoked).href;
137
+ }
138
+
139
+ if (isDirectInvocation()) {
133
140
  const args = parseArgs(process.argv.slice(2));
134
141
  if (args.help) { console.log(USAGE); process.exit(0); }
135
142
  if (args.cmd !== 'init') { console.error(`✗ unknown command; expected "init"\n\n${USAGE}`); process.exit(1); }