framer-code-link 0.2.5 → 0.2.6

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/index.mjs +13 -12
  2. package/package.json +2 -2
package/dist/index.mjs CHANGED
@@ -160,9 +160,9 @@ function logWithDedupe(message, writer, isFileSync = false) {
160
160
  /**
161
161
  * Print the startup banner - one colored line
162
162
  */
163
- function banner(version, port) {
163
+ function banner(version$1, port) {
164
164
  console.log();
165
- let message = ` ${import_picocolors.default.cyan(import_picocolors.default.bold("⚡ Code Link"))} ${import_picocolors.default.dim(`v${version}`)}`;
165
+ let message = ` ${import_picocolors.default.cyan(import_picocolors.default.bold("⚡ Code Link"))} ${import_picocolors.default.dim(`v${version$1}`)}`;
166
166
  if (currentLevel <= LogLevel.DEBUG) message += ` ${import_picocolors.default.dim("Port")} ${import_picocolors.default.yellow(port)}`;
167
167
  console.log(message);
168
168
  console.log();
@@ -909,7 +909,7 @@ async function detectConflicts(remoteFiles, filesDir, options = {}) {
909
909
  };
910
910
  }
911
911
  function autoResolveConflicts(conflicts, versions, options = {}) {
912
- const versionMap = new Map(versions.map((version) => [version.fileName, version.latestRemoteVersionMs]));
912
+ const versionMap = new Map(versions.map((version$1) => [version$1.fileName, version$1.latestRemoteVersionMs]));
913
913
  const remoteDriftMs = options.remoteDriftMs ?? DEFAULT_REMOTE_DRIFT_MS;
914
914
  const autoResolvedLocal = [];
915
915
  const autoResolvedRemote = [];
@@ -1247,9 +1247,9 @@ var Installer = class {
1247
1247
  const response = await fetch(`https://registry.npmjs.org/${pkgName}`);
1248
1248
  if (!response.ok) return;
1249
1249
  const npmData = await response.json();
1250
- const version = npmData["dist-tags"]?.latest;
1251
- if (!version || !npmData.versions?.[version]) return;
1252
- const pkg = npmData.versions[version];
1250
+ const version$1 = npmData["dist-tags"]?.latest;
1251
+ if (!version$1 || !npmData.versions?.[version$1]) return;
1252
+ const pkg = npmData.versions[version$1];
1253
1253
  if (pkg.exports && typeof pkg.exports === "object") {
1254
1254
  const fixExport = (value) => {
1255
1255
  if (typeof value === "string") return { types: value.replace(/\.js$/, ".d.ts").replace(/\.cjs$/, ".d.cts") };
@@ -1377,11 +1377,11 @@ declare module "*.json"
1377
1377
  if (await this.hasTypePackage(reactDomDir, REACT_DOM_TYPES_VERSION, reactDomFiles)) debug("📦 React DOM types (from cache)");
1378
1378
  else await this.downloadTypePackage("@types/react-dom", REACT_DOM_TYPES_VERSION, reactDomDir, reactDomFiles);
1379
1379
  }
1380
- async hasTypePackage(destinationDir, version, files) {
1380
+ async hasTypePackage(destinationDir, version$1, files) {
1381
1381
  try {
1382
1382
  const pkgJsonPath = path.join(destinationDir, "package.json");
1383
1383
  const pkgJson = await fs.readFile(pkgJsonPath, "utf-8");
1384
- if (JSON.parse(pkgJson).version !== version) return false;
1384
+ if (JSON.parse(pkgJson).version !== version$1) return false;
1385
1385
  for (const file of files) {
1386
1386
  if (file === "package.json") continue;
1387
1387
  await fs.access(path.join(destinationDir, file));
@@ -1391,8 +1391,8 @@ declare module "*.json"
1391
1391
  return false;
1392
1392
  }
1393
1393
  }
1394
- async downloadTypePackage(pkgName, version, destinationDir, files) {
1395
- const baseUrl = `https://unpkg.com/${pkgName}@${version}`;
1394
+ async downloadTypePackage(pkgName, version$1, destinationDir, files) {
1395
+ const baseUrl = `https://unpkg.com/${pkgName}@${version$1}`;
1396
1396
  await fs.mkdir(destinationDir, { recursive: true });
1397
1397
  await Promise.all(files.map(async (file) => {
1398
1398
  const destination = path.join(destinationDir, file);
@@ -2553,6 +2553,7 @@ async function start(config) {
2553
2553
  * Entry point for the CLI tool. Parses command-line arguments and starts
2554
2554
  * the controller with the appropriate configuration.
2555
2555
  */
2556
+ const version = "0.2.5";
2556
2557
  const program = new Command();
2557
2558
  program.exitOverride((err) => {
2558
2559
  if (err.code === "commander.missingArgument") {
@@ -2561,7 +2562,7 @@ program.exitOverride((err) => {
2561
2562
  }
2562
2563
  throw err;
2563
2564
  });
2564
- program.name("framer-code-link").description("Sync Framer code components to your local filesystem").version("0.1.0").argument("[projectHash]", "Framer Project ID Hash (auto-detected from package.json if omitted)").option("-n, --name <name>", "Project name (optional)").option("-d, --dir <directory>", "Explicit project directory").option("-v, --verbose", "Enable verbose logging").option("--log-level <level>", "Set log level (debug, info, warn, error)").option("--dangerously-auto-delete", "Automatically delete remote files without confirmation").option("--unsupported-npm", "Allow type acquisition for unsupported npm packages").action(async (projectHash, options) => {
2565
+ program.name("framer-code-link").description("Sync Framer code components to your local filesystem").version(version).argument("[projectHash]", "Framer Project ID Hash (auto-detected from package.json if omitted)").option("-n, --name <name>", "Project name (optional)").option("-d, --dir <directory>", "Explicit project directory").option("-v, --verbose", "Enable verbose logging").option("--log-level <level>", "Set log level (debug, info, warn, error)").option("--dangerously-auto-delete", "Automatically delete remote files without confirmation").option("--unsupported-npm", "Allow type acquisition for unsupported npm packages").action(async (projectHash, options) => {
2565
2566
  if (!projectHash) {
2566
2567
  const detected = await getProjectHashFromCwd();
2567
2568
  if (detected) projectHash = detected;
@@ -2582,7 +2583,7 @@ program.name("framer-code-link").description("Sync Framer code components to you
2582
2583
  if (level !== void 0) setLogLevel(level);
2583
2584
  } else if (options.verbose || isDev) setLogLevel(LogLevel.DEBUG);
2584
2585
  const port = getPortFromHash(projectHash);
2585
- banner("0.1.3", port);
2586
+ banner(version, port);
2586
2587
  const config = {
2587
2588
  port,
2588
2589
  projectHash,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "framer-code-link",
3
- "version": "0.2.5",
3
+ "version": "0.2.6",
4
4
  "description": "CLI tool for syncing Framer code components - controller-centric architecture",
5
5
  "main": "dist/index.mjs",
6
6
  "type": "module",
@@ -10,7 +10,7 @@
10
10
  ],
11
11
  "scripts": {
12
12
  "dev": "NODE_ENV=development tsx src/index.ts",
13
- "build": "tsdown src/index.ts",
13
+ "build": "tsdown src/index.ts --define.__VERSION__=\"\\\"$npm_package_version\\\"\"",
14
14
  "start": "node dist/index.mjs",
15
15
  "test": "vitest run"
16
16
  },