feat: Implement atomic design system core structure and recursive Figma import
This commit is contained in:
18
dss-cli.py
18
dss-cli.py
@@ -8,6 +8,7 @@ pipelines and other automated workflows.
|
||||
"""
|
||||
|
||||
import argparse
|
||||
import asyncio
|
||||
import json
|
||||
import os
|
||||
import sys
|
||||
@@ -22,7 +23,6 @@ try:
|
||||
from dss.analyze.project_analyzer import run_project_analysis, export_project_context
|
||||
from dss.project.manager import ProjectManager
|
||||
from dss import StorybookScanner, StoryGenerator, ThemeGenerator
|
||||
from dss.project.figma import FigmaProjectSync
|
||||
except ImportError as e:
|
||||
print(f"Error: Could not import DSS modules. Make sure dss-mvp1 is in the PYTHONPATH.", file=sys.stderr)
|
||||
print(f"Import error: {e}", file=sys.stderr)
|
||||
@@ -48,6 +48,8 @@ def main():
|
||||
required=True,
|
||||
help="The root path to the project directory to be analyzed."
|
||||
)
|
||||
analyze_parser.add_argument("--verbose", "-v", action="store_true", help="Verbose output")
|
||||
|
||||
|
||||
# =========================================================================
|
||||
# 'export-context' command
|
||||
@@ -120,6 +122,9 @@ def main():
|
||||
"--figma-token",
|
||||
help="Your Figma personal access token. If not provided, it will try to use the FIGMA_TOKEN environment variable."
|
||||
)
|
||||
sync_parser.add_argument("--verbose", "-v", action="store_true", help="Verbose output")
|
||||
sync_parser.add_argument("--force", action="store_true", help="Force sync, ignoring cache")
|
||||
|
||||
|
||||
args = parser.parse_args()
|
||||
|
||||
@@ -189,12 +194,21 @@ def main():
|
||||
sys.exit(1)
|
||||
|
||||
print("Synchronizing tokens from Figma...")
|
||||
manager.sync(project, figma_token=args.figma_token)
|
||||
# The manager.sync method is now async
|
||||
asyncio.run(manager.sync(
|
||||
project,
|
||||
figma_token=args.figma_token,
|
||||
force=args.force,
|
||||
verbose=args.verbose
|
||||
))
|
||||
print("Token synchronization complete.")
|
||||
|
||||
except Exception as e:
|
||||
print(json.dumps({"success": False, "error": str(e)}), file=sys.stderr)
|
||||
import traceback
|
||||
traceback.print_exc()
|
||||
sys.exit(1)
|
||||
|
||||
if __name__ == "__main__":
|
||||
# The main function now handles both sync and async command dispatches
|
||||
main()
|
||||
|
||||
Reference in New Issue
Block a user