Giter VIP home page Giter VIP logo

pkl-swift's Introduction

pkl-swift

This library exposes Swift bindings for the Pkl configuration language.

It allows you to embed Pkl into your Swift application, complete with code generation for full type safety and ease of use.

The full documentation for this library can be found on our documentation site.

To get up and going, reference the quick start guide.

When upgrading pkl-swift, reference the changelog for details.

pkl-swift's People

Contributors

bioball avatar bricklife avatar holzensp avatar josephplusplus avatar krzysztofzablocki avatar redryerye avatar shsw228 avatar stackoverflow avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

pkl-swift's Issues

Add VisionOs Supported?

I'm working on a visionOS project and planning to use pkl for configuration.
In ChildProcessMessageTransport will show me the "Cannot find type 'Process' in scope" when I build the project.
Does PKL support visionOS future?

Xcode: 15.3
pkl-swift: 0.2.3
visionOS: 1.1
Project Status: Just Initialization

Default values in structs?

I would like to generate an analytics event like this:

struct LoginEvent {
    let name: String = "Login"
}

But the only way I have found is that I can create a template and evaluate values from a file. Pkl example:

module LoginEvent

name = "Login"

The result is fully mutable and lost default values:

struct LoginEvent {
    var name: String
}

Is there any way to provide a default value during code generation and make let properties?

Sendable compliance for code generated types

Making code generated types Sendable (when possible) would be nice in anticipation of Swift 6.

There's also those warnings about registeredIdentifier not being concurrency-safe. Is there any particular reason why this property is not a let constant ?

public struct Module: PklRegisteredType, Decodable, Hashable {
-    public static var registeredIdentifier: String = "Foo"
+    public static let registeredIdentifier: String = "Foo"

    // ...
}

Package plugins?

Is there an example package plugin somewhere (command or build) that either uses a reference to an installed version of the tool (see homebrew issue) or a binaryTarget to automate updating the swift code using pkl-gen-swift?

Plans to offer something as a product?

"is only available is iOS 16 or newer"

I am trying to use pkl swift in my ios project. Here are my steps.

  1. Project -> package dependencies -> add
  2. Add: "https://github.com/apple/pkl-swift.git"
  3. MessagePack -> None, PklSwift -> Added to target, pkl-gen-swift -> None
  4. Build to simulator or device
  5. I get errors: "checkouts/pkl-swift/Sources/PklSwift/API/Duration.swift:65:44 'Duration' is only available in iOS 16.0 or newer"
  6. My minimum deployment is set to 17.

Any ideas? Can you use this on iOS?

Add HomeBrew support

Hey team,

could we add pkl-swift to homebrew (pkl is already available, see apple/pkl#13).

Having unified way to install the tool via CLI would be great!

eg brew instal pkl-swift.

Thanks!

Rename module from `PklSwift` to `Pkl`

Since we are importing the module inside Swift it is redundant to suffix the module with Swift. This is followed pretty closely throughout the ecosystem.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.