mirror of
https://github.com/penpot/penpot.git
synced 2025-12-11 22:14:05 +01:00
♻️ Make the exporter build as esm module
This commit is contained in:
@@ -14,7 +14,7 @@
|
||||
|
||||
:dev
|
||||
{:extra-deps
|
||||
{thheller/shadow-cljs {:mvn/version "3.1.5"}}}
|
||||
{thheller/shadow-cljs {:mvn/version "3.2.1"}}}
|
||||
|
||||
:shadow-cljs
|
||||
{:main-opts ["-m" "shadow.cljs.devtools.cli"]
|
||||
|
||||
@@ -9,13 +9,14 @@
|
||||
"type": "git",
|
||||
"url": "https://github.com/penpot/penpot"
|
||||
},
|
||||
"type": "module",
|
||||
"dependencies": {
|
||||
"archiver": "^7.0.1",
|
||||
"cookies": "^0.9.1",
|
||||
"date-fns": "^4.1.0",
|
||||
"generic-pool": "^3.9.0",
|
||||
"inflation": "^2.1.0",
|
||||
"ioredis": "^5.6.1",
|
||||
"luxon": "^3.6.1",
|
||||
"playwright": "^1.53.0",
|
||||
"raw-body": "^3.0.0",
|
||||
"svgo": "penpot/svgo#v3.1",
|
||||
|
||||
@@ -13,9 +13,6 @@ rm -rf target
|
||||
# Build the application
|
||||
clojure -M:dev:shadow-cljs release main;
|
||||
|
||||
# Remove source
|
||||
rm -rf target/app;
|
||||
|
||||
# Copy package*.json files
|
||||
cp ../.yarnrc.yml target/;
|
||||
cp yarn.lock target/;
|
||||
|
||||
@@ -3,13 +3,22 @@
|
||||
|
||||
:builds
|
||||
{:main
|
||||
{:target :node-script
|
||||
:main app.core/main
|
||||
:output-to "target/app.js"
|
||||
:output-dir "target/app/"
|
||||
{:target :esm
|
||||
:runtime :node
|
||||
:output-dir "target/"
|
||||
:devtools {:before-load-async app.core/stop
|
||||
:after-load app.core/start}
|
||||
|
||||
:modules
|
||||
{:app
|
||||
{:entries []
|
||||
:init-fn app.core/main}}
|
||||
|
||||
:js-options
|
||||
{:entry-keys ["module" "browser" "main"]
|
||||
:export-conditions ["module" "import", "browser" "require" "default"]
|
||||
:js-provider :import}
|
||||
|
||||
:compiler-options
|
||||
{:output-feature-set :es2020
|
||||
:output-wrapper false}
|
||||
|
||||
@@ -7,7 +7,7 @@
|
||||
(ns app.browser
|
||||
(:require
|
||||
["generic-pool" :as gp]
|
||||
["generic-pool/lib/errors" :as gpe]
|
||||
["generic-pool/lib/errors.js" :as gpe]
|
||||
["playwright" :as pw]
|
||||
[app.common.exceptions :as ex]
|
||||
[app.common.logging :as l]
|
||||
|
||||
@@ -6,7 +6,7 @@
|
||||
|
||||
(ns app.core
|
||||
(:require
|
||||
["process" :as proc]
|
||||
["node:process" :as proc]
|
||||
[app.browser :as bwr]
|
||||
[app.common.logging :as l]
|
||||
[app.config :as cf]
|
||||
@@ -41,9 +41,9 @@
|
||||
(http/stop)
|
||||
(done)))
|
||||
|
||||
(proc/on "uncaughtException"
|
||||
(fn [cause]
|
||||
(js/console.error cause)))
|
||||
(.on proc/default "uncaughtException"
|
||||
(fn [cause]
|
||||
(js/console.error cause)))
|
||||
|
||||
(proc/on "SIGTERM" (fn [] (proc/exit 0)))
|
||||
(proc/on "SIGINT" (fn [] (proc/exit 0)))
|
||||
(.on proc/default "SIGTERM" (fn [] (proc/exit 0)))
|
||||
(.on proc/default "SIGINT" (fn [] (proc/exit 0)))
|
||||
|
||||
@@ -6,11 +6,11 @@
|
||||
|
||||
(ns app.http
|
||||
(:require
|
||||
["cookies" :as Cookies]
|
||||
["http" :as http]
|
||||
["inflation" :as inflate]
|
||||
["raw-body" :as raw-body]
|
||||
["stream" :as stream]
|
||||
["cookies$default" :as Cookies]
|
||||
["inflation$default" :as inflate]
|
||||
["node:http" :as http]
|
||||
["node:stream$default" :as stream]
|
||||
["raw-body$default" :as raw-body]
|
||||
[app.common.logging :as l]
|
||||
[app.common.transit :as t]
|
||||
[app.config :as cf]
|
||||
@@ -169,6 +169,7 @@
|
||||
(wrap-error handlers/on-error))
|
||||
server (create-server handler)
|
||||
port (cf/get :http-server-port 6061)]
|
||||
|
||||
(.listen server port)
|
||||
(l/info :hint "welcome to penpot"
|
||||
:module "exporter"
|
||||
|
||||
@@ -18,7 +18,7 @@
|
||||
|
||||
(defn- create-client
|
||||
[uri]
|
||||
(let [^js client (new redis uri)]
|
||||
(let [^js client (new redis/default uri)]
|
||||
(.on client "connect"
|
||||
(fn [] (l/info :hint "redis connection established" :uri uri)))
|
||||
(.on client "error"
|
||||
|
||||
@@ -411,6 +411,13 @@ __metadata:
|
||||
languageName: node
|
||||
linkType: hard
|
||||
|
||||
"date-fns@npm:^4.1.0":
|
||||
version: 4.1.0
|
||||
resolution: "date-fns@npm:4.1.0"
|
||||
checksum: 10c0/b79ff32830e6b7faa009590af6ae0fb8c3fd9ffad46d930548fbb5acf473773b4712ae887e156ba91a7b3dc30591ce0f517d69fd83bd9c38650fdc03b4e0bac8
|
||||
languageName: node
|
||||
linkType: hard
|
||||
|
||||
"debug@npm:4, debug@npm:^4.3.4":
|
||||
version: 4.4.1
|
||||
resolution: "debug@npm:4.4.1"
|
||||
@@ -553,10 +560,10 @@ __metadata:
|
||||
dependencies:
|
||||
archiver: "npm:^7.0.1"
|
||||
cookies: "npm:^0.9.1"
|
||||
date-fns: "npm:^4.1.0"
|
||||
generic-pool: "npm:^3.9.0"
|
||||
inflation: "npm:^2.1.0"
|
||||
ioredis: "npm:^5.6.1"
|
||||
luxon: "npm:^3.6.1"
|
||||
playwright: "npm:^1.53.0"
|
||||
raw-body: "npm:^3.0.0"
|
||||
source-map-support: "npm:^0.5.21"
|
||||
@@ -859,13 +866,6 @@ __metadata:
|
||||
languageName: node
|
||||
linkType: hard
|
||||
|
||||
"luxon@npm:^3.6.1":
|
||||
version: 3.6.1
|
||||
resolution: "luxon@npm:3.6.1"
|
||||
checksum: 10c0/906d57a9dc4d1de9383f2e9223e378c298607c1b4d17b6657b836a3cd120feb1c1de3b5d06d846a3417e1ca764de8476e8c23b3cd4083b5cdb870adcb06a99d5
|
||||
languageName: node
|
||||
linkType: hard
|
||||
|
||||
"make-fetch-happen@npm:^14.0.3":
|
||||
version: 14.0.3
|
||||
resolution: "make-fetch-happen@npm:14.0.3"
|
||||
|
||||
Reference in New Issue
Block a user