mirror of
https://github.com/logseq/logseq.git
synced 2026-02-01 22:47:36 +00:00
add timestamp version to invalid cache
This commit is contained in:
3
deps/publish/package.json
vendored
3
deps/publish/package.json
vendored
@@ -7,7 +7,8 @@
|
||||
"watch": "clojure -M:cljs watch publish-worker",
|
||||
"release": "clojure -M:cljs release publish-worker",
|
||||
"clean": "rm -rf ./worker/dist/",
|
||||
"deploy": "yarn clean && yarn release && cd ./worker && wrangler deploy --env prod"
|
||||
"bump-publish-version": "node ./scripts/bump-publish-version.js",
|
||||
"deploy": "yarn bump-publish-version && yarn clean && yarn release && cd ./worker && wrangler deploy --env prod"
|
||||
},
|
||||
"dependencies": {
|
||||
"shadow-cljs": "^3.3.4"
|
||||
|
||||
17
deps/publish/scripts/bump-publish-version.js
vendored
Normal file
17
deps/publish/scripts/bump-publish-version.js
vendored
Normal file
@@ -0,0 +1,17 @@
|
||||
const fs = require("fs");
|
||||
const path = require("path");
|
||||
|
||||
const renderPath = path.join(__dirname, "..", "src", "logseq", "publish", "render.cljs");
|
||||
const source = fs.readFileSync(renderPath, "utf8");
|
||||
const timestamp = Date.now();
|
||||
|
||||
const next = source.replace(
|
||||
/\(defonce version [^)]+\)/,
|
||||
`(defonce version ${timestamp})`
|
||||
);
|
||||
|
||||
if (next === source) {
|
||||
throw new Error("Failed to update logseq.publish.render/version.");
|
||||
}
|
||||
|
||||
fs.writeFileSync(renderPath, next);
|
||||
8
deps/publish/src/logseq/publish/render.cljs
vendored
8
deps/publish/src/logseq/publish/render.cljs
vendored
@@ -9,6 +9,8 @@
|
||||
[logseq.publish.common :as publish-common]
|
||||
[logseq.publish.model :as publish-model]))
|
||||
|
||||
(defonce version 1767012226301)
|
||||
|
||||
(def ref-regex
|
||||
(js/RegExp. "\\[\\[([0-9a-fA-F-]{36})\\]\\]|\\(\\(([0-9a-fA-F-]{36})\\)\\)" "g"))
|
||||
|
||||
@@ -133,7 +135,7 @@
|
||||
|
||||
(defn- publish-script
|
||||
[]
|
||||
[:script {:type "module" :src "/static/publish.js"}])
|
||||
[:script {:type "module" :src (str "/static/publish.js?v=" version)}])
|
||||
|
||||
(defn- icon-runtime-script
|
||||
[]
|
||||
@@ -151,8 +153,8 @@
|
||||
[:script {:defer true :src "/static/tabler.ext.js"}]
|
||||
[:link {:rel "stylesheet"
|
||||
:href "https://cdn.jsdelivr.net/npm/@tabler/icons-webfont@3.0/dist/tabler-icons.min.css"}]
|
||||
[:link {:rel "stylesheet" :href "/static/tabler-extension.css"}]
|
||||
[:link {:rel "stylesheet" :href "/static/publish.css"}]])
|
||||
[:link {:rel "stylesheet" :href (str "/static/tabler-extension.css?v=" version)}]
|
||||
[:link {:rel "stylesheet" :href (str "/static/publish.css?v=" version)}]])
|
||||
|
||||
(defn property-type
|
||||
[prop-key property-type-by-ident]
|
||||
|
||||
Reference in New Issue
Block a user