Skip to content

Commit

Permalink
Revert "Merge pull request logseq#1158 from logseq/refacotor/add-cljs…
Browse files Browse the repository at this point in the history
…-env"

This reverts commit d82555a, reversing
changes made to df1da26.
  • Loading branch information
defclass committed Feb 2, 2021
1 parent c1a908f commit f75bf5e
Show file tree
Hide file tree
Showing 8 changed files with 29 additions and 82 deletions.
5 changes: 3 additions & 2 deletions .github/workflows/build-stage.yml
Original file line number Diff line number Diff line change
Expand Up @@ -37,11 +37,12 @@ jobs:
run: yarn cache clean && yarn install --frozen-lockfile

- name: Build Released-Web
run: yarn gulp:build && rm -Rf .shadow-cljs && ENV=staging clojure -M:cljs release app --config-merge '{:asset-path "${{env.asset-path}}"}'
run: yarn gulp:build && clojure -M:cljs release app --config-merge '{:asset-path "${{env.asset-path}}"}'

- uses: jakejarvis/s3-sync-action@master
with:
args: --acl public-read --follow-symlinks --delete
#args: --acl public-read --follow-symlinks --delete
args: --acl public-read --follow-symlinks
env:
AWS_S3_BUCKET: ${{ secrets.AWS_S3_BUCKET }}
AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }}
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ Open <http://localhost:3001>.
### 4. Build a release

``` bash
yarn release
yarn release
```

### 5. Run tests
Expand Down
10 changes: 3 additions & 7 deletions deps.edn
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
{:paths ["src/main" "resources"]
{:paths ["src/main"]
:deps
{org.clojure/clojure {:mvn/version "1.10.0"}
cheshire/cheshire {:mvn/version "5.10.0"}
Expand Down Expand Up @@ -37,16 +37,12 @@
:aliases {:cljs {:extra-paths ["src/dev-cljs/" "src/test/" "src/electron/"]
:extra-deps {org.clojure/clojurescript {:mvn/version "1.10.764"}
org.clojure/tools.namespace {:mvn/version "0.2.11"}
cider/cider-nrepl {:mvn/version "0.25.5"}
aero/aero {:mvn/version "1.1.6"}
mhuebert/shadow-env {:mvn/version "0.1.6"}}
cider/cider-nrepl {:mvn/version "0.25.5"}}
:main-opts ["-m" "shadow.cljs.devtools.cli"]}
:test
{:extra-paths ["src/test/"]
:extra-deps {org.clojure/clojurescript {:mvn/version "1.10.764"}
org.clojure/test.check {:mvn/version "RELEASE"}
aero/aero {:mvn/version "1.1.6"}
mhuebert/shadow-env {:mvn/version "0.1.6"}}
org.clojure/test.check {:mvn/version "RELEASE"}}
:main-opts ["-m" "shadow.cljs.devtools.cli"]}

:test-clj
Expand Down
11 changes: 5 additions & 6 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -27,14 +27,13 @@
"scripts": {
"watch": "run-p gulp:build gulp:watch cljs:watch",
"electron-watch": "run-p gulp:build gulp:watch cljs:electron-watch",
"release": "ENV=prod run-s gulp:build cljs:release",
"release-staging": "ENV=staging run-s gulp:build cljs:release",
"release": "run-s gulp:build cljs:release",
"watch-app": "run-p gulp:watch cljs:watch-app",
"release-app": "ENV=prod run-s gulp:build cljs:release-app",
"release-publishing": "ENV=prod run-s gulp:build cljs:release-publishing",
"dev-release-app": "ENV=prod run-s gulp:build cljs:dev-release-app",
"release-app": "run-s gulp:build cljs:release-app",
"release-publishing": "run-s gulp:build cljs:release-publishing",
"dev-release-app": "run-s gulp:build cljs:dev-release-app",
"dev-electron-app": "gulp electron",
"release-electron": "gulp build && ENV=prod gulp electronMaker",
"release-electron": "gulp build && gulp electronMaker",
"debug-electron": "cd static/ && yarn electron:debug",
"clean": "gulp clean",
"test": "run-s cljs:test cljs:run-test",
Expand Down
17 changes: 0 additions & 17 deletions resources/config.edn

This file was deleted.

9 changes: 3 additions & 6 deletions shadow-cljs.edn
Original file line number Diff line number Diff line change
Expand Up @@ -31,8 +31,7 @@
:http-root "public"
:http-port 3001
:watch-path "static"
:preloads [devtools.preload]}
:build-hooks [(shadow-env.core/hook)]}
:preloads [devtools.preload]}}

:electron {:target :node-script
:output-to "static/electron.js"
Expand All @@ -45,8 +44,7 @@
{:target :node-test
:output-to "static/tests.js"
:closure-defines {frontend.util/NODETEST true}
:devtools {:enabled false}
:build-hooks [(shadow-env.core/hook)]}
:devtools {:enabled false}}

:publishing
{:target :browser
Expand All @@ -72,5 +70,4 @@
{:before-load frontend.core/stop
;; after live-reloading finishes call this function
:after-load frontend.core/start
:preloads [devtools.preload]}
:build-hooks [(shadow-env.core/hook)]}}}
:preloads [devtools.preload]}}}}
34 changes: 14 additions & 20 deletions src/main/frontend/config.cljs
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,7 @@
(:require [clojure.set :as set]
[clojure.string :as string]
[frontend.state :as state]
[frontend.util :as util]
[frontend.env :as env]))
[frontend.util :as util]))

(goog-define DEV-RELEASE false)
(defonce dev-release? DEV-RELEASE)
Expand All @@ -14,33 +13,28 @@

;; :TODO: How to do this?
;; (defonce desktop? ^boolean goog.DESKTOP)
(def test? (= :test (env/get-static :runtime)))
(def staging? (= :staging (env/get-static :runtime)))
(def prod? (= :prod (env/get-static :runtime)))

(def app-name "logseq")
(def website
(if dev?
"http://localhost:3000"
(util/format "https://%s.com" app-name)))


(def website (env/get-static :website))
(def api (env/get-static :api))
(def asset-domain (env/get-static :asset-domain))
(def github-app-name (env/get-static :github-app-name))
(def api
(if dev?
"http://localhost:3000/api/v1/"
(str website "/api/v1/")))

(defn asset-uri
[path]
(cond
(util/file-protocol?)
(if (util/file-protocol?)
(string/replace path "/static/" "./")
(if dev? path
(str asset-domain path))))

dev? path

staging?
(if-let [branch (-> (state/get-me) :git-branch)]
(str asset-domain "/" branch path)
(str asset-domain path))
(goog-define GITHUB_APP_NAME "logseq-test")

:else
(str asset-domain path)))
(def github-app-name (if dev? GITHUB_APP_NAME "logseq"))

(defn git-pull-secs
[]
Expand Down
23 changes: 0 additions & 23 deletions src/main/frontend/env.cljc

This file was deleted.

0 comments on commit f75bf5e

Please sign in to comment.