Revert "♻️ Make the exporter build as esm module"

This reverts commit d0f34f06a9.
This commit is contained in:
Andrey Antukh
2025-10-01 10:47:47 +02:00
parent d0f34f06a9
commit 3b81c1d750
9 changed files with 30 additions and 38 deletions

View File

@@ -14,7 +14,7 @@
:dev
{:extra-deps
{thheller/shadow-cljs {:mvn/version "3.2.1"}}}
{thheller/shadow-cljs {:mvn/version "3.1.5"}}}
:shadow-cljs
{:main-opts ["-m" "shadow.cljs.devtools.cli"]

View File

@@ -9,14 +9,13 @@
"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",

View File

@@ -13,6 +13,9 @@ 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/;

View File

@@ -3,22 +3,13 @@
:builds
{:main
{:target :esm
:runtime :node
:output-dir "target/"
{:target :node-script
:main app.core/main
:output-to "target/app.js"
:output-dir "target/app/"
: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}

View File

@@ -7,7 +7,7 @@
(ns app.browser
(:require
["generic-pool" :as gp]
["generic-pool/lib/errors.js" :as gpe]
["generic-pool/lib/errors" :as gpe]
["playwright" :as pw]
[app.common.exceptions :as ex]
[app.common.logging :as l]

View File

@@ -6,7 +6,7 @@
(ns app.core
(:require
["node:process" :as proc]
["process" :as proc]
[app.browser :as bwr]
[app.common.logging :as l]
[app.config :as cf]
@@ -41,9 +41,9 @@
(http/stop)
(done)))
(.on proc/default "uncaughtException"
(proc/on "uncaughtException"
(fn [cause]
(js/console.error cause)))
(.on proc/default "SIGTERM" (fn [] (proc/exit 0)))
(.on proc/default "SIGINT" (fn [] (proc/exit 0)))
(proc/on "SIGTERM" (fn [] (proc/exit 0)))
(proc/on "SIGINT" (fn [] (proc/exit 0)))

View File

@@ -6,11 +6,11 @@
(ns app.http
(:require
["cookies$default" :as Cookies]
["inflation$default" :as inflate]
["node:http" :as http]
["node:stream$default" :as stream]
["raw-body$default" :as raw-body]
["cookies" :as Cookies]
["http" :as http]
["inflation" :as inflate]
["raw-body" :as raw-body]
["stream" :as stream]
[app.common.logging :as l]
[app.common.transit :as t]
[app.config :as cf]
@@ -169,7 +169,6 @@
(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"

View File

@@ -18,7 +18,7 @@
(defn- create-client
[uri]
(let [^js client (new redis/default uri)]
(let [^js client (new redis uri)]
(.on client "connect"
(fn [] (l/info :hint "redis connection established" :uri uri)))
(.on client "error"

View File

@@ -411,13 +411,6 @@ __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"
@@ -560,10 +553,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"
@@ -866,6 +859,13 @@ __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"