Skip to content

Commit

Permalink
fix: Bump Package Versions (#103)
Browse files Browse the repository at this point in the history
Fixes #93.
Fixes #96.
  • Loading branch information
maticzav authored Nov 1, 2022
1 parent 8f7e6f1 commit a10506d
Show file tree
Hide file tree
Showing 4 changed files with 17 additions and 19 deletions.
18 changes: 8 additions & 10 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ Hey :wave:! This library is a collaborative effort of many people and we are all

> If you have any questions about the library or just want to share ideas, feel free to reach out to Matic at `matic.zavadlal [at] gmail.com` or `@maticzav` on Twitter.

## Roadmap

Feel free to contribute in any way possible. We are excited about your ideas and want to share them with the rest of the world. It's often even more helpful to write a well documented idea than to write code because ["code is the easy part"](https://www.youtube.com/watch?v=DSjbTC-hvqQ).
Expand All @@ -19,7 +18,6 @@ We are currently investing our efforts into

If you decide to contribute in any of these topics, you'll' get a lot of attention and have top priority.


## Code Organization

SwiftGraphQL is split into multiple packages that serve different purposes.
Expand All @@ -33,13 +31,6 @@ SwiftGraphQL is split into multiple packages that serve different purposes.

This package is best developed using Swift command line tools.

> NOTE: SwiftGraphQL depends on `swift-format` that relies on `SwiftSyntax` that is distributed as part of the Swift toolchain. It's important that you set the correct version of Swift Command Line Tools when developing so that the tools match the version of `swift-format` used.
```sh
swift package tools-version --set 5.5
```


## Creating a Pull Request

> Every PR should follow a common structure. This way, it's easier for people to navigate the code, look back at the PRs and understand why library has evolved the way it has.
Expand All @@ -58,9 +49,16 @@ You can test the generators by running
swift run swift-graphql http://localhost:4000/graphql
```


## Building Binary and Documentation

```sh
swift build -c release --product swift-graphql --disable-sandbox
```

You can run the following two scripts to regenerate APIs for both examples.

```sh
swift run swift-graphql https://api.github.com/graphql --config examples/GitHubStars/swiftgraphql.yml --output examples/GitHubStars/GitHubStars/GraphQL/API.swift --header "Authorization: bearer TOKEN"

swift run swift-graphql http://localhost:4000/graphql --config examples/thesocialnetwork/ios/TheSocialNetwork/swiftgraphql.yml --output examples/thesocialnetwork/ios/TheSocialNetwork/Shared/GraphQL/API.swift
```
6 changes: 3 additions & 3 deletions Package.swift
Original file line number Diff line number Diff line change
Expand Up @@ -25,12 +25,12 @@ let package = Package(
dependencies: [
// .package(url: "https://github.com/apple/swift-docc-plugin", from: "1.0.0"),
.package(url: "https://github.com/apple/swift-argument-parser", from: "1.0.0"),
.package(url: "https://github.com/apple/swift-format", from: "0.50600.1"),
.package(url: "https://github.com/apple/swift-format", branch: "main"),
.package(url: "https://github.com/apple/swift-log.git", from: "1.0.0"),
.package(url: "https://github.com/daltoniam/Starscream.git", from: "4.0.0"),
.package(url: "https://github.com/dominicegginton/Spinner", from: "1.0.0"),
.package(url: "https://github.com/dominicegginton/Spinner", from: "2.0.0"),
.package(url: "https://github.com/JohnSundell/Files", from: "4.0.0"),
.package(url: "https://github.com/jpsim/Yams.git", from: "4.0.4"),
.package(url: "https://github.com/jpsim/Yams.git", from: "5.0.0"),
],
targets: [
// Spec
Expand Down
2 changes: 1 addition & 1 deletion Sources/SwiftGraphQL/Document/Scalar.swift
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ extension Optional: GraphQLScalar where Wrapped: GraphQLScalar {
case is NSNull:
self = nil
#endif
case is Void, nil:
case is Void:
self = nil
case Optional<AnyDecodable>.none:
self = nil
Expand Down
10 changes: 5 additions & 5 deletions Sources/SwiftGraphQLCLI/main.swift
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,7 @@ struct SwiftGraphQLCLI: ParsableCommand {
SwiftGraphQLCLI.exit(withError: .unreachable)
}

loadSchemaSpinner.succeed("Schema loaded!")
loadSchemaSpinner.success("Schema loaded!")

// Generate the code.
let generateCodeSpinner = Spinner(.dots, "Generating API")
Expand All @@ -116,14 +116,14 @@ struct SwiftGraphQLCLI: ParsableCommand {

do {
code = try generator.generate(schema: schema)
generateCodeSpinner.succeed("API generated successfully!")
generateCodeSpinner.success("API generated successfully!")
} catch CodegenError.formatting(let err) {
generateCodeSpinner.failure(err.localizedDescription)
generateCodeSpinner.error(err.localizedDescription)
SwiftGraphQLCLI.exit(withError: .formatting)
} catch IntrospectionError.emptyfile, IntrospectionError.unknown {
SwiftGraphQLCLI.exit(withError: .introspection)
} catch IntrospectionError.error(let err) {
generateCodeSpinner.failure(err.localizedDescription)
generateCodeSpinner.error(err.localizedDescription)
SwiftGraphQLCLI.exit(withError: .introspection)
} catch {
SwiftGraphQLCLI.exit(withError: .unknown)
Expand All @@ -142,7 +142,7 @@ struct SwiftGraphQLCLI: ParsableCommand {
// Warn about the unused scalars.
let ignoredScalars = try schema.missing(from: scalars)
guard !ignoredScalars.isEmpty else {
analyzeSchemaSpinner.succeed("SwiftGraphQL Ready!")
analyzeSchemaSpinner.success("SwiftGraphQL Ready!")
return
}

Expand Down

1 comment on commit a10506d

@vercel
Copy link

@vercel vercel bot commented on a10506d Nov 1, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please sign in to comment.