@dreher-media/dm-js-lib 0.0.1 → 0.0.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +28 -11
- package/dist/dm-js-lib.min.js +1 -1
- package/package.json +4 -4
package/README.md
CHANGED
|
@@ -32,27 +32,45 @@ npm run format:check
|
|
|
32
32
|
|
|
33
33
|
## Release Workflow
|
|
34
34
|
|
|
35
|
-
###
|
|
35
|
+
### Standard Release
|
|
36
36
|
|
|
37
37
|
```bash
|
|
38
|
-
npm run release:patch # 1.0.0 -> 1.0.1 (builds, versions, and
|
|
39
|
-
npm run release:minor # 1.0.0 -> 1.1.0 (builds, versions, and
|
|
40
|
-
npm run release:major # 1.0.0 -> 2.0.0 (builds, versions, and
|
|
38
|
+
npm run release:patch # 1.0.0 -> 1.0.1 (builds, versions, publishes, and pushes tags)
|
|
39
|
+
npm run release:minor # 1.0.0 -> 1.1.0 (builds, versions, publishes, and pushes tags)
|
|
40
|
+
npm run release:major # 1.0.0 -> 2.0.0 (builds, versions, publishes, and pushes tags)
|
|
41
41
|
```
|
|
42
42
|
|
|
43
43
|
The release script will:
|
|
44
|
+
|
|
44
45
|
1. Update the version in `package.json`
|
|
45
|
-
2.
|
|
46
|
-
3.
|
|
46
|
+
2. Create a git commit with the version change
|
|
47
|
+
3. **Create a git tag** (e.g., `v1.2.3`) - automatically done by `npm version`
|
|
48
|
+
4. Build the project (via `prepublishOnly` hook)
|
|
49
|
+
5. Publish to npm
|
|
50
|
+
6. Push commits and tags to remote
|
|
51
|
+
|
|
52
|
+
### Patching an Old Version
|
|
47
53
|
|
|
48
|
-
|
|
54
|
+
To create a patch for an older version (e.g., patch v1.2.0 while main is at v1.5.0):
|
|
49
55
|
|
|
50
56
|
```bash
|
|
51
|
-
|
|
52
|
-
git
|
|
53
|
-
|
|
57
|
+
# 1. Checkout the old version tag
|
|
58
|
+
git checkout v1.2.0
|
|
59
|
+
|
|
60
|
+
# 2. Create a branch for the patch
|
|
61
|
+
git checkout -b patch-1.2.1
|
|
62
|
+
|
|
63
|
+
# 3. Make your fixes, then release
|
|
64
|
+
npm version patch
|
|
65
|
+
npm publish
|
|
66
|
+
git push origin patch-1.2.1 --follow-tags
|
|
67
|
+
|
|
68
|
+
# 4. Switch back to main
|
|
69
|
+
git checkout main
|
|
54
70
|
```
|
|
55
71
|
|
|
72
|
+
See `RELEASE_WORKFLOW.md` for detailed workflow documentation.
|
|
73
|
+
|
|
56
74
|
## CDN Usage
|
|
57
75
|
|
|
58
76
|
jsDelivr automatically serves from npm with full semantic versioning support:
|
|
@@ -145,4 +163,3 @@ The library integrates with these external services (loaded separately):
|
|
|
145
163
|
## License
|
|
146
164
|
|
|
147
165
|
MIT
|
|
148
|
-
|
package/dist/dm-js-lib.min.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
!function(){"use strict";!function(){let e=!1;const t=()=>{window.FsCC?(e||(window.FsCC.consentController.on("updateconsents",()=>{t()}),e=!0),document.querySelectorAll("[fs-cc-reject]").forEach(e=>{const t=e.getAttribute("fs-cc-reject");if(!t)return;const o=window.FsCC?.store.consents[t]??!1,n=document.querySelector(`[fs-cc="${t}"]`);o?(e.style.display="none",n&&(n.style.display="block")):(e.style.display="block",n&&(n.style.display="none"))})):setTimeout(t,200)};document.addEventListener("DOMContentLoaded",t)}(),void 0!==window.Webflow&&window.Webflow.push(()=>{document.querySelectorAll(".copyright-year").forEach(e=>{e.textContent=(new Date).getFullYear().toString()});const e=sessionStorage.getItem("selected_lang");if(e){const t=document.querySelector(`.biography-lang-links .tab-link[data-lang="${e}"]`);t?.click?.()}}),function(){const e=e=>{const t=(e||"").replace(/\/+$/,"").replace(/\.html?$/i,"");return""===t?"/":t};window.addEventListener("load",()=>{const t=e(window.location.pathname);document.querySelectorAll("a[href]").forEach(o=>{const n=o.getAttribute("href");if(!n)return;if(n.startsWith("#")||n.toLowerCase().startsWith("javascript:"))return;let a;try{a=new URL(n,window.location.href)}catch{return}if(a.origin!==window.location.origin)return;e(a.pathname)===t&&o.classList.add("w--current")})})}(),document.querySelectorAll("[data-separator]").forEach(e=>{const t=e.getAttribute("data-separator");if(!t)return;const o=Array.from(e.children);o.forEach((e,n)=>{if(n<o.length-1){const o=document.createElement("span");o.innerHTML=` ${t} `,e.insertAdjacentElement("afterend",o)}})}),document.querySelectorAll(".tab-link").forEach(e=>{e.addEventListener("click",e=>{const t=e.currentTarget,o=t.parentNode;if(o){const e=o.querySelector(".tab-link.active");e&&e.classList.remove("active"),t.classList.add("active")}})}),document.querySelectorAll(".biography-lang-links .tab-link[data-lang]").forEach(e=>{e.addEventListener("click",e=>{const t=e.currentTarget,o=t.dataset?.lang;o&&(sessionStorage.setItem("selected_lang",o),document.querySelectorAll(`.biography-text:not(.${o})`).forEach(e=>{e.style.display="none"}),document.querySelectorAll(`.biography-text.${o}`).forEach(e=>{e.style.display="block"}),document.querySelectorAll(`.biography-lang-links .tab-link:not([data-lang="${o}"])`).forEach(e=>{e.classList.remove("active")}),document.querySelectorAll(`.biography-lang-links .tab-link[data-lang="${o}"]`).forEach(e=>{e.classList.add("active")}))})}),
|
|
1
|
+
!function(){"use strict";!function(){let e=!1;const t=()=>{window.FsCC?(e||(window.FsCC.consentController.on("updateconsents",()=>{t()}),e=!0),document.querySelectorAll("[fs-cc-reject]").forEach(e=>{const t=e.getAttribute("fs-cc-reject");if(!t)return;const o=window.FsCC?.store.consents[t]??!1,n=document.querySelector(`[fs-cc="${t}"]`);o?(e.style.display="none",n&&(n.style.display="block")):(e.style.display="block",n&&(n.style.display="none"))})):setTimeout(t,200)};document.addEventListener("DOMContentLoaded",t)}(),void 0!==window.Webflow&&window.Webflow.push(()=>{document.querySelectorAll(".copyright-year").forEach(e=>{e.textContent=(new Date).getFullYear().toString()});const e=sessionStorage.getItem("selected_lang");if(e){const t=document.querySelector(`.biography-lang-links .tab-link[data-lang="${e}"]`);t?.click?.()}}),function(){const e=e=>{const t=(e||"").replace(/\/+$/,"").replace(/\.html?$/i,"");return""===t?"/":t};window.addEventListener("load",()=>{const t=e(window.location.pathname);document.querySelectorAll("a[href]").forEach(o=>{const n=o.getAttribute("href");if(!n)return;if(n.startsWith("#")||n.toLowerCase().startsWith("javascript:"))return;let a;try{a=new URL(n,window.location.href)}catch{return}if(a.origin!==window.location.origin)return;e(a.pathname)===t&&o.classList.add("w--current")})})}(),document.addEventListener("DOMContentLoaded",()=>{document.querySelectorAll("[data-separator]").forEach(e=>{const t=e.getAttribute("data-separator");if(!t)return;const o=Array.from(e.children);o.forEach((e,n)=>{if(n<o.length-1){const o=document.createElement("span");o.innerHTML=` ${t} `,e.insertAdjacentElement("afterend",o)}})})}),document.addEventListener("DOMContentLoaded",()=>{document.querySelectorAll(".tab-link").forEach(e=>{e.addEventListener("click",e=>{const t=e.currentTarget,o=t.parentNode;if(o){const e=o.querySelector(".tab-link.active");e&&e.classList.remove("active"),t.classList.add("active")}})})}),document.addEventListener("DOMContentLoaded",()=>{document.querySelectorAll(".biography-lang-links .tab-link[data-lang]").forEach(e=>{e.addEventListener("click",e=>{const t=e.currentTarget,o=t.dataset?.lang;o&&(sessionStorage.setItem("selected_lang",o),document.querySelectorAll(`.biography-text:not(.${o})`).forEach(e=>{e.style.display="none"}),document.querySelectorAll(`.biography-text.${o}`).forEach(e=>{e.style.display="block"}),document.querySelectorAll(`.biography-lang-links .tab-link:not([data-lang="${o}"])`).forEach(e=>{e.classList.remove("active")}),document.querySelectorAll(`.biography-lang-links .tab-link[data-lang="${o}"]`).forEach(e=>{e.classList.add("active")}))})})}),document.addEventListener("DOMContentLoaded",()=>{void 0!==window.Plyr&&window.Plyr.setup("._init-plyr");const e=document.querySelectorAll(".youtube"),t={};let o=!1;const n=(e=null)=>{for(const[o,n]of Object.entries(t))e!==o&&("youtube"===n.type?n.player.pauseVideo():("vimeo"===n.type||"dailymotion"===n.type)&&n.player.pause())},a=e=>{n(e),"undefined"!=typeof videoSwipers&&videoSwipers&&videoSwipers.forEach(e=>{e.autoplay.stop()})},r=e=>{"undefined"!=typeof videoSwipers&&videoSwipers&&videoSwipers.forEach(e=>{e.autoplay.start()})},d=()=>{o=!0,e.forEach(e=>{e.addEventListener("click",()=>{const o=e.querySelector("[data-custom-embed]");o&&(e.innerHTML=o.innerHTML);const n=e,d=`player_${n.dataset.id}`,i=n.dataset.type,l=n.dataset.videoId,c=parseInt(n.dataset.time||"0",10);if(l&&i)if(a(d),"youtube"===i&&window.YT){const e=new window.YT.Player(d,{videoId:l,playerVars:{start:c},events:{onReady:e=>{e.target.playVideo()},onStateChange:e=>{e.data===window.YT.PlayerState.PLAYING?a(d):e.data!==window.YT.PlayerState.PAUSED&&e.data!==window.YT.PlayerState.ENDED||r()}}});t[d]={type:i,player:e}}else if("vimeo"===i&&window.Vimeo){const e=document.getElementById(d);e&&(e.innerHTML="");const o=new window.Vimeo.Player(d,{id:l,autoplay:!0,start:c});o.on("play",()=>a(d)),o.on("pause",()=>r()),t[d]={type:i,player:o}}else"dailymotion"===i&&window.dailymotion&&window.dailymotion.createPlayer(d,{video:l,params:{autoplay:1,start:c,mute:!1}}).then(e=>{e.on("play",()=>a(d)),e.on("pause",()=>r()),e.on("ended",()=>r()),t[d]={type:"dailymotion",player:e}}).catch(e=>{console.error("Error initializing Dailymotion player:",e)})})})};window.onYouTubeIframeAPIReady=d,"undefined"!=typeof videoSwipers&&videoSwipers&&videoSwipers.forEach(e=>{e.on("slideChange",()=>{n()})}),setTimeout(()=>{o||d()},500)}),document.addEventListener("DOMContentLoaded",()=>{const e=["maxresdefault","sddefault","hqdefault","mqdefault","default"],t=(o,n=0)=>{if(o.naturalWidth>120)return;if(n>=e.length)return;const a=e[n],r=o.src,d=new Image;d.onload=()=>{d.naturalWidth>120?o.src=d.src:t(o,n+1)},d.onerror=()=>{t(o,n+1)},d.src=r.replace(/maxresdefault/,a)};document.querySelectorAll(".youtube img").forEach(e=>{t(e)})}),document.addEventListener("DOMContentLoaded",()=>{document.querySelectorAll("[data-download-href]").forEach(e=>{e.addEventListener("click",t=>{t.preventDefault(),t.stopPropagation();const o=e.getAttribute("data-download-href"),n=e.getAttribute("data-download-filename");o&&((e,t)=>{const o=document.createElement("a");o.href=e,o.download=t||e.split("/").pop()||"download",document.body.appendChild(o),o.click(),document.body.removeChild(o)})(o,n)})})})}();
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@dreher-media/dm-js-lib",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.2",
|
|
4
4
|
"description": "Centralized JavaScript library for Dreher.Media websites with CDN delivery",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "dist/dm-js-lib.min.js",
|
|
@@ -13,9 +13,9 @@
|
|
|
13
13
|
"format": "prettier --write \"src/**/*.{ts,js}\" \"*.{js,json,md}\"",
|
|
14
14
|
"format:check": "prettier --check \"src/**/*.{ts,js}\" \"*.{js,json,md}\"",
|
|
15
15
|
"prepublishOnly": "npm run build",
|
|
16
|
-
"release:patch": "npm version patch && npm publish",
|
|
17
|
-
"release:minor": "npm version minor && npm publish",
|
|
18
|
-
"release:major": "npm version major && npm publish"
|
|
16
|
+
"release:patch": "npm version patch && npm publish && git push --follow-tags",
|
|
17
|
+
"release:minor": "npm version minor && npm publish && git push --follow-tags",
|
|
18
|
+
"release:major": "npm version major && npm publish && git push --follow-tags"
|
|
19
19
|
},
|
|
20
20
|
"keywords": [
|
|
21
21
|
"cdn",
|