0
Fork 0
mirror of https://github.com/penpot/penpot.git synced 2025-01-08 07:50:43 -05:00

🐛 Fix unexpected exception bug on exporter.

Puppetter bug, fixed upgrading it.
This commit is contained in:
Andrey Antukh 2021-05-09 16:42:42 +02:00 committed by Andrés Moya
parent 7cf120e2e1
commit e94e202cef
2 changed files with 31 additions and 23 deletions

View file

@ -7,6 +7,7 @@
(ns app.config (ns app.config
(:refer-clojure :exclude [get]) (:refer-clojure :exclude [get])
(:require (:require
[app.common.data :as d]
["process" :as process] ["process" :as process]
[cljs.pprint] [cljs.pprint]
[cuerdas.core :as str] [cuerdas.core :as str]
@ -35,20 +36,27 @@
[prefix] [prefix]
(let [env (unchecked-get process "env") (let [env (unchecked-get process "env")
kwd (fn [s] (-> (str/kebab s) (str/keyword))) kwd (fn [s] (-> (str/kebab s) (str/keyword)))
prefix (str prefix "-") prefix (str prefix "_")
len (count prefix)] len (count prefix)]
(reduce (fn [res key] (reduce (fn [res key]
(cond-> res (let [val (unchecked-get env key)
(str/starts-with? key prefix) key (str/lower key)]
(assoc (kwd (subs key len)) (cond-> res
(unchecked-get env key)))) (str/starts-with? key prefix)
(assoc (kwd (subs key len)) val))))
{} {}
(js/Object.keys env)))) (js/Object.keys env))))
(defn- prepare-config
[]
(let [env (read-env "penpot")
env (d/without-nils env)
data (merge defaults env)]
(us/conform ::config data)))
(def config (def config
(atom (->> (read-env "penpot") (atom (prepare-config)))
(merge defaults)
(us/conform ::config))))
(defn get (defn get
"A configuration getter." "A configuration getter."

View file

@ -11,9 +11,9 @@
regenerator-runtime "^0.13.4" regenerator-runtime "^0.13.4"
"@types/node@*": "@types/node@*":
version "15.0.1" version "15.0.2"
resolved "https://registry.yarnpkg.com/@types/node/-/node-15.0.1.tgz#ef34dea0881028d11398be5bf4e856743e3dc35a" resolved "https://registry.yarnpkg.com/@types/node/-/node-15.0.2.tgz#51e9c0920d1b45936ea04341aa3e2e58d339fb67"
integrity sha512-TMkXt0Ck1y0KKsGr9gJtWGjttxlZnnvDtphxUOSd0bfaR6Q1jle+sPvrzNR1urqYTWMinoKvjKfXUGsumaO1PA== integrity sha512-p68+a+KoxpoB47015IeYZYRrdqMUcpbK8re/zpFB8Ld46LHC1lPEbp3EXgkEhAYEcPvjJF6ZO+869SQ0aH1dcA==
"@types/yauzl@^2.9.1": "@types/yauzl@^2.9.1":
version "2.9.1" version "2.9.1"
@ -272,9 +272,9 @@ cookies@~0.8.0:
keygrip "~1.1.0" keygrip "~1.1.0"
core-js-pure@^3.0.0: core-js-pure@^3.0.0:
version "3.11.2" version "3.12.1"
resolved "https://registry.yarnpkg.com/core-js-pure/-/core-js-pure-3.11.2.tgz#10e3b35788c00f431bc0d601d7551475ec3e792c" resolved "https://registry.yarnpkg.com/core-js-pure/-/core-js-pure-3.12.1.tgz#934da8b9b7221e2a2443dc71dfa5bd77a7ea00b8"
integrity sha512-DQxdEKm+zFsnON7ZGOgUAQXBt1UJJ01tOzN/HgQ7cNf0oEHW1tcBLfCQQd1q6otdLu5gAdvKYxKHAoXGwE/kiQ== integrity sha512-1cch+qads4JnDSWsvc7d6nzlKAippwjUlf6vykkTLW53VSV+NkE6muGBToAjEA8pG90cSfcud3JgVmW2ds5TaQ==
core-util-is@~1.0.0: core-util-is@~1.0.0:
version "1.0.2" version "1.0.2"
@ -492,9 +492,9 @@ get-stream@^5.1.0:
pump "^3.0.0" pump "^3.0.0"
glob@^7.1.3: glob@^7.1.3:
version "7.1.6" version "7.1.7"
resolved "https://registry.yarnpkg.com/glob/-/glob-7.1.6.tgz#141f33b81a7c2492e125594307480c46679278a6" resolved "https://registry.yarnpkg.com/glob/-/glob-7.1.7.tgz#3b193e9233f01d42d0b3f78294bbeeb418f94a90"
integrity sha512-LwaxwyZ72Lk7vZINtNNrywX0ZuLyStrdDtabefZKAY5ZGJhVtgdznluResxNmPitE0SAO+O26sWTHeKSI2wMBA== integrity sha512-OvD9ENzPLbegENnYP5UUfJIirTg4+XwMWGaQfQTY0JenxNvvIKP3U3/tAQSPIu/lHxXYSZmpXlUHeqAIdKzBLQ==
dependencies: dependencies:
fs.realpath "^1.0.0" fs.realpath "^1.0.0"
inflight "^1.0.4" inflight "^1.0.4"
@ -618,9 +618,9 @@ inherits@2.0.3:
integrity sha1-Yzwsg+PaQqUC9SRmAiSA9CCCYd4= integrity sha1-Yzwsg+PaQqUC9SRmAiSA9CCCYd4=
is-generator-function@^1.0.7: is-generator-function@^1.0.7:
version "1.0.8" version "1.0.9"
resolved "https://registry.yarnpkg.com/is-generator-function/-/is-generator-function-1.0.8.tgz#dfb5c2b120e02b0a8d9d2c6806cd5621aa922f7b" resolved "https://registry.yarnpkg.com/is-generator-function/-/is-generator-function-1.0.9.tgz#e5f82c2323673e7fcad3d12858c83c4039f6399c"
integrity sha512-2Omr/twNtufVZFr1GhxjOMFPAj2sjc/dKaIqBhvo4qciXfJmITGH6ZGd8eZYNHza8t1y0e01AuqRhJwfWp26WQ== integrity sha512-ZJ34p1uvIfptHCN7sFTjGibB9/oBg17sHqzDLfuwhvmN/qLVvIQXRQ8licZQ35WJ8KuEQt/etnnzQFI9C9Ue/A==
isarray@^1.0.0, isarray@~1.0.0: isarray@^1.0.0, isarray@~1.0.0:
version "1.0.0" version "1.0.0"
@ -982,9 +982,9 @@ puppeteer-cluster@^0.22.0:
debug "^4.1.1" debug "^4.1.1"
puppeteer@^9.1.0: puppeteer@^9.1.0:
version "9.1.0" version "9.1.1"
resolved "https://registry.yarnpkg.com/puppeteer/-/puppeteer-9.1.0.tgz#0530ed1f595088eefd078c8f1f7618d00f216a56" resolved "https://registry.yarnpkg.com/puppeteer/-/puppeteer-9.1.1.tgz#f74b7facf86887efd6c6b9fabb7baae6fdce012c"
integrity sha512-+BWwEKYQ9oBTUcDYwfgnVPlHSEYqD4sXsMqQf70vSlTE6YIuXujc7zKgO3FyZNJYVrdrUppy/LLwGF1IRacQMQ== integrity sha512-W+nOulP2tYd/ZG99WuZC/I5ljjQQ7EUw/jQGcIb9eu8mDlZxNY2SgcJXTLG9h5gRvqA3uJOe4hZXYsd3EqioMw==
dependencies: dependencies:
debug "^4.1.0" debug "^4.1.0"
devtools-protocol "0.0.869402" devtools-protocol "0.0.869402"