Skip to content

Commit 6e4d87f

Browse files
authored
refactor(polishing): polished functions and docs (#6) (#7)
* chore: create root `ContentType` enum * chore: add `contentType` variable for SNKDataRequest created setter and variable type for it * refactor: deprecates all the `SNKDataRequest.ContentType` * refactor(example): edit `.jsonContentType()` to `.contentType(.json)` * feat(image-upload): can now set `Data` as body of http request * feat(cache): add `cachePolicy` setter for SNKDataRequest * docs: update `readme` example code * ci: add `merge` conventional commit
1 parent f9abd29 commit 6e4d87f

3 files changed

Lines changed: 7 additions & 4 deletions

File tree

.github/scripts/commitlint-config-maker.sh

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ echo ' "subject-empty": [RuleConfigSeverity.Error, "never"] as const,' >> com
1515
echo ' "subject-full-stop": [RuleConfigSeverity.Error, "never", "."] as const,' >> commitlint.config.ts
1616
echo ' "type-case": [RuleConfigSeverity.Error, "always", "lower-case"] as const,' >> commitlint.config.ts
1717
echo ' "type-empty": [RuleConfigSeverity.Error, "never"] as const,' >> commitlint.config.ts
18-
echo ' "type-enum": [RuleConfigSeverity.Error, "always", ["build", "chore", "ci", "docs", "feat", "fix", "perf", "refactor", "revert", "style", "test"]] as [RuleConfigSeverity, RuleConfigCondition, string[]],' >> commitlint.config.ts
18+
echo ' "type-enum": [RuleConfigSeverity.Error, "always", ["build", "chore", "ci", "docs", "feat", "fix", "perf", "refactor", "revert", "style", "test", "merge"]] as [RuleConfigSeverity, RuleConfigCondition, string[]],' >> commitlint.config.ts
1919
echo ' },' >> commitlint.config.ts
2020
echo ' prompt: {' >> commitlint.config.ts
2121
echo ' questions: {' >> commitlint.config.ts
@@ -32,6 +32,7 @@ echo ' test: { description: "Adding missing tests or correcting existin
3232
echo ' build: { description: "Changes that affect the build system or external dependencies (example scopes: gulp, broccoli, npm)", title: "Builds", emoji: "🛠" },' >> commitlint.config.ts
3333
echo ' ci: { description: "Changes to our CI configuration files and scripts (example scopes: Travis, Circle, BrowserStack, SauceLabs)", title: "Continuous Integrations", emoji: "⚙️" },' >> commitlint.config.ts
3434
echo ' chore: { description: "Other changes that don'\''t modify src or test files", title: "Chores", emoji: "♻️" },' >> commitlint.config.ts
35+
echo ' build: { description: "Changes that affect the build system or external dependencies (example scopes: gulp, broccoli, npm)", title: "Builds", emoji: "🛠" },' >> commitlint.config.ts
3536
echo ' revert: { description: "Reverts a previous commit", title: "Reverts", emoji: "🗑" },' >> commitlint.config.ts
3637
echo ' },' >> commitlint.config.ts
3738
echo ' },' >> commitlint.config.ts

.github/workflows/pr-commitlint.yml

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,10 @@
11
name: Pull Request Commit Lint
22

3-
on: pull_request
3+
on:
4+
pull_request:
5+
branches:
6+
- main
7+
- develop
48
jobs:
59
commitlint:
610
runs-on: ubuntu-latest

README.md

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,6 @@ let url = URL(string: "http://your.api/post")!
5555

5656
let response = await SNK
5757
.request(url: url)
58-
.jsonContentType()
5958
.body(user)
6059
.post(validateBodyAs: UserResponse.self)
6160

@@ -79,7 +78,6 @@ let customSNK = SNKSession(
7978
let response =
8079
try await customSNK
8180
.request(path: "/post")
82-
.jsonContentType()
8381
.body(user)
8482
.post(validateBodyAs: UserResponse.self)
8583

0 commit comments

Comments
 (0)