Skip to content

Conversation

johnbute
Copy link
Contributor

@johnbute johnbute commented Oct 2, 2025

Motivation:

Currently, SwiftPM supports a handful of hardcoded templates that act as a starting point for user projects. These built-in templates, accessible via swift package init, allow users to initialize basic packages such as libraries, tools, executables, and macros. While swift package init remains valuable for initializing simple packages, many Swift developers face more complex requirements when starting a new project, whether that may be initializing an HTTPS server or creating a package that implements an OpenAPI specification. These more complex package initializations have to be achieved through third-party command-line tools or custom scripts, many of which operate outside the SwiftPM ecosystem. This disconnect increases the complexity and makes it harder for users to discover, share, or customize initialization workflows.

Modifications:

Modifying Package.swift to store template metadata, added template utilities, new init function that supports old workflow and new template workflow, test template function, prompting system. Added show-templates function.

Result:

Now, users can initialize packages based on templates from local disk, git, or registry. Furthermore, they can author templates and test them with test template. For more, read documentation.

John Bute added 30 commits May 14, 2025 13:45
… and retuning the build result of the plugin delegate collections, will need to revisit in a future
…ert back to major, minor once demo completed
@cmcgee1024
Copy link
Member

@swift-ci please test

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.