framer-code-link 0.21.0-alpha.6 → 0.21.0-alpha.8

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 +8 -6
  2. package/package.json +1 -1
package/dist/index.mjs CHANGED
@@ -1601,7 +1601,7 @@ var Installer = class {
1601
1601
  pkg.dependencies = sortDependencyMap(dependencies);
1602
1602
  pkg.devDependencies = sortDependencyMap(devDependencies);
1603
1603
  await fs.writeFile(packagePath, JSON.stringify(pkg, null, 4));
1604
- success("Updated dependencies. Run your package manager to install them.");
1604
+ success("Updated project dependencies in package.json. Run your package manager to install them.");
1605
1605
  debug(`Updated package.json dependency versions for ${uniquePackageNames.join(", ")}`);
1606
1606
  }
1607
1607
  /**
@@ -1935,9 +1935,14 @@ async function getProjectHashFromCwd() {
1935
1935
  }
1936
1936
  async function findOrCreateProjectDirectory(options) {
1937
1937
  const { projectHash, projectName, explicitDirectory, baseDirectory } = options;
1938
+ const codeLinkDefaults = {
1939
+ shortProjectHash: shortProjectHash(projectHash),
1940
+ framerProjectName: projectName
1941
+ };
1938
1942
  if (explicitDirectory) {
1939
1943
  const resolved = path.resolve(explicitDirectory);
1940
1944
  await fs.mkdir(path.join(resolved, "files"), { recursive: true });
1945
+ await readAndMigratePackageJson(path.join(resolved, "package.json"), codeLinkDefaults);
1941
1946
  return {
1942
1947
  directory: resolved,
1943
1948
  created: false
@@ -1946,10 +1951,7 @@ async function findOrCreateProjectDirectory(options) {
1946
1951
  const cwd = baseDirectory ?? process.cwd();
1947
1952
  const existing = await findExistingProjectDirectory(cwd, projectHash);
1948
1953
  if (existing) {
1949
- await readAndMigratePackageJson(path.join(existing, "package.json"), {
1950
- shortProjectHash: shortProjectHash(projectHash),
1951
- framerProjectName: projectName
1952
- });
1954
+ await readAndMigratePackageJson(path.join(existing, "package.json"), codeLinkDefaults);
1953
1955
  return {
1954
1956
  directory: existing,
1955
1957
  created: false
@@ -4006,7 +4008,7 @@ function parseUnsupportedNpmMode(mode) {
4006
4008
  if (mode === "acquire-types" || mode === "package-manager") return mode;
4007
4009
  throw new InvalidArgumentError("unsupported npm mode must be 'acquire-types' or 'package-manager'");
4008
4010
  }
4009
- 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("--once", "Exit after the initial sync completes").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").addOption(new Option("--unsupported-npm [mode]", "Handle unsupported npm packages (default without mode: acquire-types; modes: acquire-types, package-manager)").argParser(parseUnsupportedNpmMode).preset("acquire-types")).action(async (projectHash, options) => {
4011
+ 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("--once", "Exit after the initial sync completes").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").addOption(new Option("--unsupported-npm [mode]", "Unsupported feature: Handle non-built-in npm packages. Modes: acquire-types (fetches type definitions into node_modules automatically), package-manager (adds the packages to package.json so your package manager can install them) (default: acquire-types).").argParser(parseUnsupportedNpmMode).preset("acquire-types")).action(async (projectHash, options) => {
4010
4012
  if (!projectHash) {
4011
4013
  const detected = await getProjectHashFromCwd();
4012
4014
  if (detected) projectHash = detected;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "framer-code-link",
3
- "version": "0.21.0-alpha.6",
3
+ "version": "0.21.0-alpha.8",
4
4
  "description": "CLI tool for syncing Framer code components - controller-centric architecture",
5
5
  "main": "dist/index.mjs",
6
6
  "type": "module",