Skip to content
This repository has been archived by the owner on Mar 10, 2024. It is now read-only.

Commit

Permalink
Add deprecation notice (#66)
Browse files Browse the repository at this point in the history
* Update .gitignore targets

* Linter errors

* Add deprecation notice

* Publish final version
  • Loading branch information
nnichols authored Mar 10, 2024
1 parent d9a6448 commit c1091b4
Show file tree
Hide file tree
Showing 12 changed files with 315 additions and 39 deletions.
3 changes: 3 additions & 0 deletions .cljstyle
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{:files {:extensions #{"clj" "cljs" "cljc" "cljx" "edn"}
:ignore #{"target" ".git" ".idea" ".vscode" "node_modules"}}
:rules {:namespaces {:enabled? false}}}
52 changes: 52 additions & 0 deletions .github/workflows/deploy_to_clojars.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
name: Deploy to Clojars

on:
workflow_dispatch:


jobs:
deploy:

runs-on: ubuntu-latest

steps:
- name: Checkout Repository
uses: actions/[email protected]

- name: Cache maven dependencies
uses: actions/cache@v4
env:
cache-name: cache-maven
with:
path: ~/.m2
save-always: true
key: ${{ runner.os }}-clj-${{ hashFiles('**/project.clj') }}
restore-keys: |
${{ runner.os }}-clj
- name: Install Clojure dependencies
run: |
lein deps && lein project-version
- name: Run sanity tests
run: lein test

- name: Run build test
run: lein jar

- name: Publish to Clojars
env:
CLOJARS_USER: ${{ secrets.CLOJARS_USER }}
CLOJARS_PASS: ${{ secrets.CLOJARS_PASS }}
run: lein deploy clojars

- name: Resolve version
id: versionchk
run: echo "::set-output name=VERSION::$(lein project-version)"

- name: Push Tag
uses: hole19/[email protected]
env:
TAG: v${{ steps.versionchk.outputs.VERSION }}
GITHUB_TOKEN: ${{ secrets.WALL_BREW_BOT_PAT }}

108 changes: 101 additions & 7 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,14 +1,108 @@
pom.xml
## Linter Caches

### clj-kondo
**/.clj-kondo/.cache
/.clj-kondo/.cache
/cli/.clj-kondo/
/.clj-kondo/.cache
.clj-kondo/.cache/

### Clojure LSP
**/.lsp/.cache
/.lsp/.cache
/clojure-lsp
lib/clojure-lsp.integration-test.out
.lsp/

## Editors

### Calva
*.calva
/.calva/output-window
output.calva-repl

### VSCode
.vscode/*
!.vscode/settings.json
!.vscode/tasks.json
!.vscode/launch.json
!.vscode/extensions.json

### IntelliJ / Cursive
.idea
/.idea

### Emacs
/.emacs.desktop
/.emacs.desktop.lock
*.elc
auto-save-list
tramp

### Vim
*.swp
*.swo
Session.vim
Sessionx.vim

## Operating System Files

### OSX
.DS_Store
/.DS_Store
.DS_Store?

### Windows
Thumbs.db
ehthumbs.db
ehthumbs_vista.db

## Build Tools

### Leiningen
/.lein-failures
/.lein-repl-history
/.lh
/*.jar
/.classpath
/.project
/.settings/
/reports
/test.clj
/.cpcache
/.rebel_readline_history
/.rebel_readline_history.lock
.lein-deps-sum
.lein-repl-history
.lein-plugins/
.lein-failures
.nrepl-port

### Homebrew
.cask/
.planck_cache
.yagni

### Maven
pom.xml.asc
*.jar
*.class
/lib/
/classes/
/target/
/checkouts/
.lein-deps-sum
.lein-repl-history
.lein-plugins/
.lein-failures
.nrepl-port

### Tools.deps
.cpcache/

### NPM (Used for ClojureScript)
/dist
/tmp
/out-tsc
node_modules/
jspm_packages/
.npm
.eslintcache
.node_repl_history

# This file was automatically copied and populated by rebroadcast
# Do not edit this file directly, instead modify the source at https://github.com/Wall-Brew-Co/rebroadcast/blob/master/sources/clojure/.gitignore
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
## v1.1.0 / 2024 Mar 10

> This release marks the library as deprecated
## v1.0.0 / 2021 Oct 22

> This release adds all initial functionality
5 changes: 5 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,11 @@ A [clj-http](https://github.com/dakrone/clj-http) client to integrate with [Stra

This repository follows the guidelines and standards of the [Wall Brew Open Source Policy.](https://github.com/Wall-Brew-Co/open-source "Our open source guidelines")

## DEPRECATION NOTICE

As of 2024-03-10, this library has been deprecated and will no longer receive updates.
If you wish to continue using the functionality within this library, feel free to fork this repository or to reuse the contents within: As a reminder, this code is provided under the MIT License.

## Installation

A deployed copy of the most recent version of [strawpoll-client can be found on clojars.](https://clojars.org/com.wallbrew/strawpoll-client)
Expand Down
99 changes: 99 additions & 0 deletions pom.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,99 @@
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>com.wallbrew</groupId>
<artifactId>strawpoll-client</artifactId>
<packaging>jar</packaging>
<version>1.1.0</version>
<name>strawpoll-client</name>
<description>A clj-http client library for https://strawpoll.com/</description>
<url>https://github.com/Wall-Brew-Co/strawpoll-client</url>
<licenses>
<license>
<name>MIT</name>
<url>https://opensource.org/licenses/MIT</url>
</license>
</licenses>
<scm>
<url>https://github.com/Wall-Brew-Co/strawpoll-client</url>
<connection>scm:git:git://github.com/Wall-Brew-Co/strawpoll-client.git</connection>
<developerConnection>scm:git:ssh://[email protected]/Wall-Brew-Co/strawpoll-client.git</developerConnection>
<tag>a950d5a52f4a77010c121b95b5b7a78f94971021</tag>
</scm>
<build>
<sourceDirectory>src</sourceDirectory>
<testSourceDirectory>test</testSourceDirectory>
<resources>
<resource>
<directory>resources</directory>
</resource>
</resources>
<testResources>
<testResource>
<directory>resources</directory>
</testResource>
</testResources>
<directory>target</directory>
<outputDirectory>target/classes</outputDirectory>
<plugins/>
</build>
<repositories>
<repository>
<id>central</id>
<url>https://repo1.maven.org/maven2/</url>
<snapshots>
<enabled>false</enabled>
</snapshots>
<releases>
<enabled>true</enabled>
</releases>
</repository>
<repository>
<id>clojars</id>
<url>https://repo.clojars.org/</url>
<snapshots>
<enabled>true</enabled>
</snapshots>
<releases>
<enabled>true</enabled>
</releases>
</repository>
</repositories>
<dependencyManagement>
<dependencies/>
</dependencyManagement>
<dependencies>
<dependency>
<groupId>cheshire</groupId>
<artifactId>cheshire</artifactId>
<version>5.12.0</version>
</dependency>
<dependency>
<groupId>clj-http</groupId>
<artifactId>clj-http</artifactId>
<version>3.12.3</version>
</dependency>
<dependency>
<groupId>org.clojure</groupId>
<artifactId>clojure</artifactId>
<version>1.11.2</version>
</dependency>
<dependency>
<groupId>circleci</groupId>
<artifactId>bond</artifactId>
<version>0.6.0</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>clj-http-fake</groupId>
<artifactId>clj-http-fake</artifactId>
<version>1.0.4</version>
<scope>test</scope>
</dependency>
</dependencies>
</project>

<!-- This file was autogenerated by Leiningen.
Please do not edit it directly; instead edit project.clj and regenerate it.
It should not be considered canonical data. For more information see
https://codeberg.org/leiningen/leiningen -->
26 changes: 21 additions & 5 deletions project.clj
Original file line number Diff line number Diff line change
@@ -1,12 +1,28 @@
(defproject com.wallbrew/strawpoll-client "1.0.0"
(defproject com.wallbrew/strawpoll-client "1.1.0"
:description "A clj-http client library for https://strawpoll.com/"
:url "https://github.com/Wall-Brew-Co/strawpoll-client"
:license {:name "MIT"
:url "https://opensource.org/licenses/MIT"}
:license {:name "MIT"
:url "https://opensource.org/licenses/MIT"
:distribution :repo
:comments "Same-as all Wall-Brew projects."}
:scm {:name "git"
:url "https://github.com/Wall-Brew-Co/strawpoll-client"}
:dependencies [[cheshire "5.12.0"]
[clj-http "3.12.3"]
[org.clojure/clojure "1.11.2"]]
:plugins [[com.github.clj-kondo/lein-clj-kondo "2024.03.05"]
[com.wallbrew/lein-sealog "1.2.0"]
[lein-cljsbuild "1.1.8"]
[lein-project-version "0.1.0"]
[mvxcvi/cljstyle "0.16.630"]
[ns-sort "1.0.3"]]
:profiles {:uberjar {:aot :all}
:dev {:dependencies [[circleci/bond "0.6.0"]
[clj-http-fake "1.0.4"]]}}
:dev {:dependencies [[circleci/bond "0.6.0"]
[clj-http-fake "1.0.4"]]}}
:resource-paths ["resources"]
:deploy-branches ["master"]
:deploy-repositories [["clojars" {:url "https://clojars.org/repo"
:username :env/clojars_user
:password :env/clojars_pass
:sign-releases false}]]
:min-lein-version "2.5.3")
20 changes: 11 additions & 9 deletions src/strawpoll_client/core.clj
Original file line number Diff line number Diff line change
@@ -1,12 +1,11 @@
(ns strawpoll-client.core
"Basic functions to interact with [Strawpoll](https://strawpoll.com/en/api-docs/)"
(:require
[cheshire.core :as json]
[clj-http.client :as client]
[strawpoll-client.impl :as impl]))
(:require [cheshire.core :as json]
[clj-http.client :as client]
[strawpoll-client.impl :as impl]))


(defn ->client
(defn ^:deprecated ->client
"Create a client, which is the required first argument to `create-poll!`, `get-poll-results!`, and `delete-poll!`.
This function expects an option map, with the following key sets:
- :api-key - The Strawpoll API key for your project.
Expand All @@ -20,7 +19,7 @@
:clj-http-opts clj-http-opts})


(defn create-poll!
(defn ^:deprecated create-poll!
"Create a poll using the provided `client` titled `title` with `answers`.
`client` is expected to be the return value of `strawpoll-client.core/->client`
`title` is a string representing the title of the poll you wish to create.
Expand Down Expand Up @@ -73,13 +72,16 @@
(:body (client/post (impl/->url "/poll") request-opts)))))


(defn ->poll-id
#_{:clj-kondo/ignore [:clojure-lsp/unused-public-var]}


(defn ^:deprecated ->poll-id
"A convenience function to extract the identifier of a poll from the return value of `strawpoll-client.core/create-poll!`"
[create-poll!-response]
(:content_id create-poll!-response))


(defn get-poll-results!
(defn ^:deprecated get-poll-results!
"Get the current results of `poll-id` using the provided client.
The poll-id is encoded in the response of `strawpoll-client.core/create-poll!` as `content_id`, which may be retreived by `strawpoll-client.core/->poll-id`"
[{:keys [api-key clj-http-opts]} poll-id]
Expand All @@ -91,7 +93,7 @@
(:body (client/get (impl/->url "/poll/" poll-id) request-opts))))


(defn delete-poll!
(defn ^:deprecated delete-poll!
"Permanently delete `poll-id` using the provided client.
The poll-id is encoded in the response of `strawpoll-client.core/create-poll!` as `content_id`, which may be retreived by `strawpoll-client.core/->poll-id`"
[{:keys [api-key clj-http-opts]} poll-id]
Expand Down
Loading

0 comments on commit c1091b4

Please sign in to comment.