Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Documentation Fixes #10

Open
wants to merge 3 commits into
base: main
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
30 changes: 15 additions & 15 deletions Sources/SwiftyESBuild/SwiftyESBuild.swift
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,8 @@ public class SwiftyESBuild {
/**
Default initializer.
- Parameters:
- version: The version of Tailwind to use. You can specify a fixed version or use the latest one.
- directory: The directory where the executables will be downloaded. When not provided, it defaults to the system's default temporary directory.
- version: The version of ESBuild to use. You can specify a fixed version or use the latest one.
- directory: The directory where the executables will be downloaded. When not provided, it defaults to the system's default temporary directory.
*/
public convenience init(version: ESBuildVersion = .latest, directory: AbsolutePath) {
self.init(version: version, directory: directory, downloader: Downloader(), executor: Executor())
Expand All @@ -22,7 +22,7 @@ public class SwiftyESBuild {
/**
Default initializer.
- Parameters:
- version: The version of ESBuild to use. You can specify a fixed version or use the latest one.
- version: The version of ESBuild to use. You can specify a fixed version or use the latest one.
*/
public convenience init(version: ESBuildVersion = .latest) {
self.init(version: version, directory: Downloader.defaultDownloadDirectory(), downloader: Downloader(), executor: Executor())
Expand All @@ -43,8 +43,8 @@ public class SwiftyESBuild {
Downloads the executable if needed and runs it with the given options. By default it runs the executable from the directory containing the entry point Javascript module.

- Parameters:
- entryPoint: The path to the entry point Javascript module that ESBuild will use to traverse the module graph and generate the output bundle.
- options: A set of options to pass to the ESBuild executable to configure the bundling.
- entryPoint: The path to the entry point Javascript module that ESBuild will use to traverse the module graph and generate the output bundle.
- options: A set of options to pass to the ESBuild executable to configure the bundling.
*/
public func run(entryPoint: AbsolutePath,
options: RunOption...) async throws
Expand All @@ -56,9 +56,9 @@ public class SwiftyESBuild {
Downloads the executable if needed and runs it with the given options.

- Parameters:
- entryPoint: The path to the entry point Javascript module that ESBuild will use to traverse the module graph and generate the output bundle.
- directory: Working directory from where to run the ESBuild executable.
- options: A set of options to pass to the ESBuild executable to configure the bundling.
- entryPoint: The path to the entry point Javascript module that ESBuild will use to traverse the module graph and generate the output bundle.
- directory: Working directory from where to run the ESBuild executable.
- options: A set of options to pass to the ESBuild executable to configure the bundling.
*/
public func run(entryPoint: AbsolutePath,
directory: AbsolutePath,
Expand All @@ -71,9 +71,9 @@ public class SwiftyESBuild {
Downloads the executable if needed and runs it with the given options.

- Parameters:
- entryPoint: The path to the entry point Javascript module that ESBuild will use to traverse the module graph and generate the output bundle.
- directory: Working directory from where to run the ESBuild executable.
- options: A set of options to pass to the ESBuild executable to configure the bundling.
- entryPoint: The path to the entry point Javascript module that ESBuild will use to traverse the module graph and generate the output bundle.
- directory: Working directory from where to run the ESBuild executable.
- options: A set of options to pass to the ESBuild executable to configure the bundling.
*/
public func run(entryPoint: AbsolutePath,
directory: AbsolutePath,
Expand All @@ -86,7 +86,7 @@ public class SwiftyESBuild {
}

/**
Downloads the Tailwind portable executable
Downloads the ESBuild portable executable.
*/
private func download() async throws -> AbsolutePath {
try await downloader.download(version: version, directory: directory)
Expand All @@ -95,7 +95,7 @@ public class SwiftyESBuild {

extension Set<SwiftyESBuild.RunOption> {
/**
Returns the flags to pass to the Tailwind CLI when invoking the `init` command.
Returns the flags to pass to the ESBuild CLI when invoking the `init` command.
*/
var executableFlags: [String] {
map(\.flag).flatMap { $0 }
Expand Down Expand Up @@ -185,14 +185,14 @@ public extension SwiftyESBuild {
/**
To bundle a file means to inline any imported dependencies into the file itself. This process is recursive so dependencies of dependencies (and so on) will also be inlined. By default esbuild will not bundle the input files.
- [Documentation](https://esbuild.github.io/api/#bundle)
- **Flag:** --bundle
- **Flag:** `--bundle`
*/
case bundle

/**
This option sets the output file name for the build operation. This is only applicable if there is a single entry point. If there are multiple entry points, you must use the outdir option instead to specify an output directory.
- [Documentation](https://esbuild.github.io/api/#outfile)
- **Flag:** --outfile
- **Flag:** `--outfile`
*/
case outfile(AbsolutePath)

Expand Down