Skip to content

Commit

Permalink
Refactor codebase
Browse files Browse the repository at this point in the history
  • Loading branch information
niwinz committed Dec 21, 2023
1 parent 8723e71 commit e7135e0
Show file tree
Hide file tree
Showing 27 changed files with 3,790 additions and 3,950 deletions.
28 changes: 18 additions & 10 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,16 +1,24 @@
/target
/classes
/checkouts
pom.xml.asc
*.jar
!.yarn/patches
!.yarn/plugins
!.yarn/releases
!.yarn/sdks
!.yarn/versions
*.class
*.jar
.pnp.*
.shadow-cljs
.yarn/*
/*-init.clj
/.cpcache
/.lein-*
/.nrepl-port
/*-init.clj
/.rebel*
/checkouts
/classes
/doc/dist
/nashorn_code_cache
/node_modules
/out
/repl
/node_modules
/nashorn_code_cache
/.cpcache
/.rebel*
/target
pom.xml.asc
9 changes: 9 additions & 0 deletions .yarnrc.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
enableGlobalCache: true

enableImmutableCache: false

enableImmutableInstalls: false

enableTelemetry: false

nodeLinker: node-modules
50 changes: 49 additions & 1 deletion CHANGES.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,54 @@
# Changelog #

## Version 2.2 ##

- Fix recursion error on ignore operator

## Version 2.1 ##

- Make seed optional for `reduce`
- Make seed optional for `scan`


## Version 2.0 ##

This version few numer of BREAKING CHANGES that should be considered
before upgrade. All of them are pretty easy to adapt.

As this is a breaking change, we decide to rename the `beicon.core`
namespace with `beicon.v2` namespace, so the people can continue using
the old API and the old package if they want without a conflict with
the new version.

This is a major API cleanup and adapt it more to RX convention of
using `rx/pipe` operator for compose transformations.

Relevant changes:

- The internal `rx/pipe` function inverts the arguments order for to
be easy to use with `->>`.
- Make the `rx/pipe` as public API useful for use custom defined
operators.
- Add `beicon.v2.ops` with operator only functions.
- Remove the `flat-map` alias (use `merge-map`).
- The `first` operator now becomes an alias for `(take 1)`.
- The `last` operator becomes an alias for `(take-last 1)`.
- Make the `seed` parameter to `reduce` as mandatory.
- Make the `seed` parameter to `scan` as mandatory.
- Replace multiarity `with-latest-from` with a specific operator
`with-latest-from*` that can be used through the `rx/pipe`
observable chain helper. Mainly for reduce code complexity.
- Remove the `do` alias for `tap`
- Remove the `log` and `pr-log` operator
- Replace `dedupe` and `dedupe'` with operator only
`distinct-contiguous*` and `distinct*` for make it more similar to
rxjs API.
- The `delay-when` operator arguments order changed to be the same as
rxjs
- Remove `delay-emit`
- Replace `subs` with `subs!`


## Version 2021.07.05-1 ##

- Fix bug on `delay-emit` operator.
Expand All @@ -21,7 +70,6 @@ BREAKING CHANGES: `zip` no longer accepts acoomulator function.
- Minor improvements on `concat` and `zip` constructors.



## Version 2021.06.02-0 ##

- Update bundled rxjs to 7.1.0
Expand Down
2 changes: 1 addition & 1 deletion LICENSE
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
Copyright (c) 2015-2016 Andrey Antukh <[email protected]>
Copyright (c) 2015-2024 Andrey Antukh <[email protected]>

All rights reserved.

Expand Down
46 changes: 46 additions & 0 deletions build.clj
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
(ns build
(:refer-clojure :exclude [compile])
(:require
[clojure.tools.build.api :as b]
[cljs.build.api :as api]))

(def lib 'funcool/beicon2)
(def version (format "2.0-%s" (b/git-count-revs nil)))
(def class-dir "target/classes")
(def basis (b/create-basis {:project "deps.edn"}))
(def jar-file (format "target/%s-%s.jar" (name lib) version))

(defn clean [_]
(b/delete {:path "target"}))

(defn jar [_]
(b/write-pom
{:class-dir class-dir
:lib lib
:version version
:basis basis
:src-dirs ["src"]})

(b/copy-dir
{:src-dirs ["src" "resources"]
:target-dir class-dir})

(b/jar
{:class-dir class-dir
:jar-file jar-file}))

(defn install [_]
(b/install {:basis basis
:lib lib
:version version
:jar-file jar-file
:class-dir class-dir}))

(defn clojars [_]
(b/process
{:command-args ["mvn"
"deploy:deploy-file"
(str "-Dfile=" jar-file)
"-DpomFile=target/classes/META-INF/maven/funcool/beicon/pom.xml"
"-DrepositoryId=clojars"
"-Durl=https://clojars.org/repo/"]}))
38 changes: 24 additions & 14 deletions deps.edn
Original file line number Diff line number Diff line change
@@ -1,27 +1,37 @@
{:paths ["src" "assets"]
{:paths ["src" "resources" "target/classes"],
:aliases
{:dev
{:extra-deps
{org.clojure/clojurescript {:mvn/version "1.10.844"}
org.clojure/clojure {:mvn/version "1.10.3"}
com.bhauman/rebel-readline-cljs {:mvn/version "RELEASE"}
com.bhauman/rebel-readline {:mvn/version "RELEASE"}
funcool/promesa {:mvn/version "RELEASE"}}
:extra-paths ["test" "dev-resources"]}
{com.bhauman/rebel-readline-cljs {:mvn/version "RELEASE"},
com.bhauman/rebel-readline {:mvn/version "RELEASE"},
org.clojure/tools.namespace {:mvn/version "RELEASE"},
org.clojure/core.async {:mvn/version "1.6.673"}
criterium/criterium {:mvn/version "RELEASE"}
thheller/shadow-cljs {:mvn/version "RELEASE"}}
:extra-paths ["test" "dev" "src"]}

:ancient
{:main-opts ["-m" "deps-ancient.deps-ancient"],
:extra-deps {deps-ancient/deps-ancient {:mvn/version "RELEASE"}}}
:repl
{:main-opts ["-m" "rebel-readline.main"]}

:shadow-cljs
{:main-opts ["-m" "shadow.cljs.devtools.cli"]}

:codox
{:extra-deps
{codox/codox {:mvn/version "RELEASE"}
org.clojure/tools.reader {:mvn/version "RELEASE"}
codox-theme-rdash/codox-theme-rdash {:mvn/version "RELEASE"}}}

:jar
{:replace-deps {com.github.seancorfield/depstar {:mvn/version "RELEASE"}}
:exec-fn hf.depstar/jar
:exec-args {:jar "target/beicon.jar"}}}}

:build
{:extra-deps
{io.github.clojure/tools.build {:git/tag "v0.9.3" :git/sha "e537cd1"}
org.clojure/clojurescript {:mvn/version "RELEASE"}
org.clojure/tools.deps.alpha {:mvn/version "RELEASE"}}
:ns-default build}

:outdated
{:extra-deps
{com.github.liquidz/antq {:mvn/version "RELEASE"}
org.slf4j/slf4j-nop {:mvn/version "RELEASE"}}
:main-opts ["-m" "antq.core"]}}}
Loading

0 comments on commit e7135e0

Please sign in to comment.