established cljs

This commit is contained in:
jem 2021-06-18 16:18:46 +02:00
parent b7bc7da053
commit f62baf0cd0
11 changed files with 73 additions and 11 deletions

View file

@ -4,7 +4,19 @@ stages:
- security - security
- upload - upload
.clj-uploadjob: &clj .cljs-job: &cljs
image: domaindrivenarchitecture/shadow-cljs
cache:
key: ${CI_COMMIT_REF_SLUG}
paths:
- node_modules/
- .shadow-cljs/
- .m2
before_script:
- echo "//registry.npmjs.org/:_authToken=$NPM_TOKEN" > ~/.npmrc
- npm install
.clj-job: &clj
image: domaindrivenarchitecture/lein image: domaindrivenarchitecture/lein
cache: cache:
key: ${CI_COMMIT_REF_SLUG} key: ${CI_COMMIT_REF_SLUG}
@ -20,6 +32,12 @@ test-clj:
script: script:
- lein test - lein test
test-cljs:
<<: *cljs
stage: build_and_test
script:
- shadow-cljs compile test
upload-clj-prerelease: upload-clj-prerelease:
<<: *clj <<: *clj
stage: upload stage: upload

32
package.json Normal file
View file

@ -0,0 +1,32 @@
{
"name": "c4k-common",
"description": "Contains predicates and tools for c4k",
"author": "meissa GmbH",
"version": "0.1.0-SNAPSHOT",
"homepage": "https://gitlab.com/domaindrivenarchitecture/c4k-common#readme",
"repository": "https://www.npmjs.com/package/c4k-common",
"license": "APACHE2",
"main": "c4k-common.js",
"bin": {
"c4k-common": "./c4k-common.js"
},
"keywords": [
"cljs",
"k8s",
"c4k",
"deployment",
"yaml",
"convention4kubernetes"
],
"bugs": {
"url": "https://gitlab.com/domaindrivenarchitecture/c4k-common/issues"
},
"dependencies": {
"js-base64": "^3.6.1",
"js-yaml": "^4.0.0"
},
"devDependencies": {
"shadow-cljs": "^2.11.18",
"source-map-support": "^0.5.19"
}
}

View file

@ -16,7 +16,8 @@
["releases" :clojars]] ["releases" :clojars]]
:deploy-repositories [["snapshots" :clojars] :deploy-repositories [["snapshots" :clojars]
["releases" :clojars]] ["releases" :clojars]]
:profiles {:test {:test-paths ["src/test/cljc"] :profiles {:test {:test-paths ["src/test/clj"
"src/test/cljc"]
:resource-paths ["src/test/resources"] :resource-paths ["src/test/resources"]
:dependencies [[dda/data-test "0.1.1"]]} :dependencies [[dda/data-test "0.1.1"]]}
:dev {:plugins [[lein-shell "0.5.0"]]}} :dev {:plugins [[lein-shell "0.5.0"]]}}

12
shadow-cljs.edn Normal file
View file

@ -0,0 +1,12 @@
{:source-paths ["src/main/cljc"
"src/main/cljs"
"src/main/resources"
"src/test/cljc"
"src/test/resources"]
:dependencies [[aero "1.1.6"]
[orchestra "2021.01.01-1"]
[expound "0.8.9"]]
:builds {:test {:target :node-test
:output-to "target/node-tests.js"
:autorun true
:repl-pprint true}}}

View file

@ -1,4 +1,4 @@
(ns dda.c4k_common.base64 (ns dda.c4k-common.base64
(:import (java.util Base64))) (:import (java.util Base64)))
(defn encode (defn encode

View file

@ -1,4 +1,4 @@
(ns dda.c4k_common.yaml (ns dda.c4k-common.yaml
(:require (:require
[clojure.java.io :as io] [clojure.java.io :as io]
[clj-yaml.core :as yaml] [clj-yaml.core :as yaml]

View file

@ -1,4 +1,4 @@
(ns dda.c4k_common.common (ns dda.c4k-common.common
(:require (:require
[clojure.walk])) [clojure.walk]))

View file

@ -1,4 +1,4 @@
(ns dda.c4k_common.base64 (ns dda.c4k-common.base64
(:require (:require
["js-base64" :as b64])) ["js-base64" :as b64]))

View file

@ -1,8 +1,7 @@
(ns dda.c4k_common.browser (ns dda.c4k-common.browser
(:require (:require
[clojure.string :as st] [clojure.string :as st]
[clojure.spec.alpha :as s] [clojure.spec.alpha :as s]
[clojure.tools.reader.edn :as edn]
[expound.alpha :as expound] [expound.alpha :as expound]
[orchestra.core :refer-macros [defn-spec]])) [orchestra.core :refer-macros [defn-spec]]))

View file

@ -1,4 +1,4 @@
(ns dda.c4k_common.yaml (ns dda.c4k-common.yaml
(:require (:require
["js-yaml" :as yaml] ["js-yaml" :as yaml]
[shadow.resource :as rc])) [shadow.resource :as rc]))

View file

@ -1,8 +1,8 @@
(ns dda.c4k_common.yaml-test (ns dda.c4k-common.yaml-test
(:require (:require
#?(:clj [clojure.test :refer [deftest is are testing run-tests]] #?(:clj [clojure.test :refer [deftest is are testing run-tests]]
:cljs [cljs.test :refer-macros [deftest is are testing run-tests]]) :cljs [cljs.test :refer-macros [deftest is are testing run-tests]])
[dda.c4k_common.yaml :as cut])) [dda.c4k-common.yaml :as cut]))
(deftest should-parse-yaml-string (deftest should-parse-yaml-string
(is (= {:hallo "welt"} (is (= {:hallo "welt"}