payload-subscribers-plugin 0.0.17 → 0.0.18
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.
|
@@ -1,27 +1,11 @@
|
|
|
1
1
|
'use server';
|
|
2
2
|
const getServerSideURL = ()=>{
|
|
3
|
-
|
|
4
|
-
//
|
|
3
|
+
// Use NEXT_PUBLIC_WEBSITE_URL for dev and production
|
|
4
|
+
// Otherwise use VERCEL_URL
|
|
5
|
+
const serverSideURL = process.env.NEXT_PUBLIC_WEBSITE_URL ? process.env.NEXT_PUBLIC_WEBSITE_URL : `https://${process.env.VERCEL_URL}`;
|
|
5
6
|
// console.log(`serverSideURL: ${serverSideURL}`)
|
|
6
7
|
return serverSideURL || '';
|
|
7
8
|
};
|
|
8
|
-
// const canUseDOM = !!(
|
|
9
|
-
// typeof window !== 'undefined' &&
|
|
10
|
-
// window.document &&
|
|
11
|
-
// window.document.createElement
|
|
12
|
-
// )
|
|
13
|
-
// const getClientSideURL = () => {
|
|
14
|
-
// if (canUseDOM) {
|
|
15
|
-
// const protocol = window.location.protocol
|
|
16
|
-
// const domain = window.location.hostname
|
|
17
|
-
// const port = window.location.port
|
|
18
|
-
// // `${window.location.protocol}//${window.location.host}
|
|
19
|
-
// const clientSideURL = `${protocol}//${domain}${port ? `:${port}` : ''}`
|
|
20
|
-
// // console.log(`clientSideURL: ${clientSideURL}`)
|
|
21
|
-
// return clientSideURL
|
|
22
|
-
// }
|
|
23
|
-
// return getServerSideURL()
|
|
24
|
-
// }
|
|
25
9
|
// eslint-disable-next-line @typescript-eslint/require-await
|
|
26
10
|
export const getServerUrl = async ()=>{
|
|
27
11
|
return {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/server-functions/serverUrl.ts"],"sourcesContent":["'use server'\n\nconst getServerSideURL = () => {\n const serverSideURL = process.env.
|
|
1
|
+
{"version":3,"sources":["../../src/server-functions/serverUrl.ts"],"sourcesContent":["'use server'\n\nconst getServerSideURL = () => {\n // Use NEXT_PUBLIC_WEBSITE_URL for dev and production\n // Otherwise use VERCEL_URL\n const serverSideURL = process.env.NEXT_PUBLIC_WEBSITE_URL\n ? process.env.NEXT_PUBLIC_WEBSITE_URL\n : `https://${process.env.VERCEL_URL}`\n // console.log(`serverSideURL: ${serverSideURL}`)\n return serverSideURL || ''\n}\n\n// eslint-disable-next-line @typescript-eslint/require-await\nexport const getServerUrl = async (): Promise<{ serverURL: string }> => {\n return { serverURL: getServerSideURL() }\n}\n"],"names":["getServerSideURL","serverSideURL","process","env","NEXT_PUBLIC_WEBSITE_URL","VERCEL_URL","getServerUrl","serverURL"],"mappings":"AAAA;AAEA,MAAMA,mBAAmB;IACvB,qDAAqD;IACrD,2BAA2B;IAC3B,MAAMC,gBAAgBC,QAAQC,GAAG,CAACC,uBAAuB,GACrDF,QAAQC,GAAG,CAACC,uBAAuB,GACnC,CAAC,QAAQ,EAAEF,QAAQC,GAAG,CAACE,UAAU,EAAE;IACvC,iDAAiD;IACjD,OAAOJ,iBAAiB;AAC1B;AAEA,4DAA4D;AAC5D,OAAO,MAAMK,eAAe;IAC1B,OAAO;QAAEC,WAAWP;IAAmB;AACzC,EAAC"}
|
package/package.json
CHANGED
|
@@ -69,7 +69,7 @@
|
|
|
69
69
|
},
|
|
70
70
|
"registry": "https://registry.npmjs.org/",
|
|
71
71
|
"dependencies": {},
|
|
72
|
-
"version": "0.0.
|
|
72
|
+
"version": "0.0.18",
|
|
73
73
|
"scripts": {
|
|
74
74
|
"build": "pnpm copyfiles && pnpm build:types && pnpm build:swc",
|
|
75
75
|
"build:swc": "swc ./src -d ./dist --config-file .swcrc --strip-leading-paths",
|