From c0ce7d17e18a8a1c9723cd5cfc5cf2717961bacb Mon Sep 17 00:00:00 2001 From: Mattes Mohr Date: Fri, 3 Jul 2026 22:30:23 +0200 Subject: [PATCH] Drop the converter --- Package.swift | 38 - Plugins/ConverterPlugin/Plugin.swift | 74 - .../Commands/Converter/ConvertCommand.swift | 69 - Sources/HTMLKitConverter/Converter.swift | 113 - .../HTMLKitConverter/InitRepresentable.swift | 39 - Sources/HTMLKitConverter/Parser.swift | 1823 ----------------- .../Conversion/articles/article.html | 4 - .../Conversion/component.html | 29 - .../Conversion/index.html | 16 - .../ConversionTests.swift | 36 - 10 files changed, 2241 deletions(-) delete mode 100644 Plugins/ConverterPlugin/Plugin.swift delete mode 100644 Sources/Commands/Converter/ConvertCommand.swift delete mode 100644 Sources/HTMLKitConverter/Converter.swift delete mode 100644 Sources/HTMLKitConverter/InitRepresentable.swift delete mode 100644 Sources/HTMLKitConverter/Parser.swift delete mode 100644 Tests/HTMLKitConverterTests/Conversion/articles/article.html delete mode 100644 Tests/HTMLKitConverterTests/Conversion/component.html delete mode 100644 Tests/HTMLKitConverterTests/Conversion/index.html delete mode 100644 Tests/HTMLKitConverterTests/ConversionTests.swift diff --git a/Package.swift b/Package.swift index 8ebf8ecc..59c3e310 100644 --- a/Package.swift +++ b/Package.swift @@ -15,10 +15,6 @@ let package = Package( .plugin( name: "ComponentsPlugin", targets: ["ComponentsPlugin"] - ), - .plugin( - name: "ConverterPlugin", - targets: ["ConverterPlugin"] ) ], dependencies: [ @@ -40,12 +36,6 @@ let package = Package( .enableExperimentalFeature("StrictConcurrency=complete") ] ), - .target( - name: "HTMLKitConverter", - dependencies: [ - .target(name: "HTMLKit") - ] - ), .target( name: "HTMLKitComponents", dependencies: [ @@ -79,15 +69,6 @@ let package = Package( .copy("Localization") ] ), - .testTarget( - name: "HTMLKitConverterTests", - dependencies: [ - .target(name: "HTMLKitConverter") - ], - resources: [ - .process("Conversion") - ] - ), .testTarget( name: "HTMLKitComponentsTests", dependencies: [ @@ -115,13 +96,6 @@ let package = Package( .target(name: "Minifier"), ] ), - .executableTarget( - name: "ConvertCommand", - dependencies: [ - .target(name: "HTMLKitConverter") - ], - path: "Sources/Commands/Converter" - ), .executableTarget( name: "DeployCommand", dependencies: [ @@ -130,18 +104,6 @@ let package = Package( ], path: "Sources/Commands/Components" ), - .plugin( - name: "ConverterPlugin", - capability: .command( - intent: .custom( - verb: "convert", - description: "Converts HTML markup into Swift syntax."), - permissions: [.writeToPackageDirectory(reason: "The command needs the permission to create the file.")] - ), - dependencies: [ - .target(name: "ConvertCommand") - ] - ), .plugin( name: "ComponentsPlugin", capability: .command( diff --git a/Plugins/ConverterPlugin/Plugin.swift b/Plugins/ConverterPlugin/Plugin.swift deleted file mode 100644 index 6472d7c2..00000000 --- a/Plugins/ConverterPlugin/Plugin.swift +++ /dev/null @@ -1,74 +0,0 @@ -import PackagePlugin -import Foundation - -@main -struct ConverterPlugin: CommandPlugin { - - func performCommand(context: PluginContext, arguments: [String]) async throws { - - let outputOptions = ["debug", "file"] - - let tool = try context.tool(named: "ConvertCommand") - - var extractor = ArgumentExtractor(arguments) - - let usageArgument = extractor.extractFlag(named: "command-usage") - - if usageArgument > 0 { - - let explanation = """ - USAGE: convert --output-option