@donotdev/core 0.2.1 → 0.2.3
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/functions/index.js +13 -13
- package/i18n/locales/eager/dndev_ar.json +4 -0
- package/i18n/locales/eager/dndev_da.json +4 -0
- package/i18n/locales/eager/dndev_de.json +4 -0
- package/i18n/locales/eager/dndev_en.json +4 -0
- package/i18n/locales/eager/dndev_es.json +4 -0
- package/i18n/locales/eager/dndev_fr.json +4 -0
- package/i18n/locales/eager/dndev_it.json +4 -0
- package/i18n/locales/eager/dndev_ja.json +4 -0
- package/i18n/locales/eager/dndev_ko.json +4 -0
- package/i18n/locales/eager/dndev_nl.json +4 -0
- package/i18n/locales/eager/dndev_pl.json +636 -0
- package/i18n/locales/eager/dndev_pt.json +4 -0
- package/i18n/locales/eager/dndev_zh.json +4 -0
- package/i18n/locales/lazy/auth_ar.json +5 -2
- package/i18n/locales/lazy/auth_da.json +5 -2
- package/i18n/locales/lazy/auth_de.json +5 -2
- package/i18n/locales/lazy/auth_en.json +5 -2
- package/i18n/locales/lazy/auth_es.json +5 -2
- package/i18n/locales/lazy/auth_fr.json +5 -2
- package/i18n/locales/lazy/auth_it.json +5 -2
- package/i18n/locales/lazy/auth_ja.json +5 -2
- package/i18n/locales/lazy/auth_ko.json +5 -2
- package/i18n/locales/lazy/auth_nl.json +5 -2
- package/i18n/locales/lazy/auth_pl.json +195 -0
- package/i18n/locales/lazy/auth_pt.json +5 -2
- package/i18n/locales/lazy/auth_zh.json +5 -2
- package/i18n/locales/lazy/billing_pl.json +93 -0
- package/i18n/locales/lazy/blog_pl.json +9 -0
- package/i18n/locales/lazy/cookies_pl.json +35 -0
- package/i18n/locales/lazy/crud_ar.json +40 -3
- package/i18n/locales/lazy/crud_da.json +39 -4
- package/i18n/locales/lazy/crud_de.json +40 -3
- package/i18n/locales/lazy/crud_en.json +38 -4
- package/i18n/locales/lazy/crud_es.json +40 -3
- package/i18n/locales/lazy/crud_fr.json +39 -3
- package/i18n/locales/lazy/crud_it.json +40 -3
- package/i18n/locales/lazy/crud_ja.json +40 -3
- package/i18n/locales/lazy/crud_ko.json +40 -3
- package/i18n/locales/lazy/crud_nl.json +39 -4
- package/i18n/locales/lazy/crud_pl.json +582 -0
- package/i18n/locales/lazy/crud_pt.json +39 -4
- package/i18n/locales/lazy/crud_zh.json +39 -4
- package/i18n/locales/lazy/homeTemplate_pl.json +52 -0
- package/i18n/locales/lazy/legalNotice_de.json +55 -0
- package/i18n/locales/lazy/legalNotice_pl.json +55 -0
- package/i18n/locales/lazy/oauth_pl.json +11 -0
- package/i18n/locales/lazy/privacy_pl.json +178 -0
- package/i18n/locales/lazy/terms_pl.json +200 -0
- package/index.d.ts +899 -165
- package/index.js +6 -6
- package/next/index.d.ts +129 -4
- package/next/index.js +527 -152
- package/next/runtime.js +3 -0
- package/package.json +5 -3
- package/server.d.ts +759 -139
- package/server.js +1 -1
- package/symbol-index.json +1 -1
- package/vite/index.js +68 -68
package/next/runtime.js
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
import{readFileSync as b,existsSync as v}from"node:fs";import{join as M}from"node:path";var d=null,w=0,E=6e4;function P(){let e=Date.now();if(d&&e-w<E)return d;try{let i=M(process.cwd(),"public","metadata-manifest.json");if(!v(i))return null;let n=b(i,"utf-8");return d=JSON.parse(n),w=e,d}catch{return null}}function S(e,i,n){let o=P(),a={title:n?.siteName||"Site"};if(!o)return a;let c=e.startsWith("/")?e:`/${e}`,s=o[c];if(!s)return a;let p=i||s.defaultLocale||"en",t=s.locales[p]||s.locales[s.defaultLocale]||Object.values(s.locales)[0];if(!t)return a;let r=process.env.NEXT_PUBLIC_APP_URL,l={title:t.title,...r&&{metadataBase:new URL(r)}};return t.description&&(l.description=t.description),t.keywords&&(l.keywords=t.keywords),l.openGraph={title:t.title,type:t.type||"website",...t.description&&{description:t.description},...t.image&&{images:[t.image]},...n?.siteName&&{siteName:n.siteName}},l.twitter={card:"summary_large_image",title:t.title,...t.description&&{description:t.description},...t.image&&{images:[t.image]}},t.noindex&&(l.robots={index:!1,follow:!1}),l}function k(){d=null,w=0}function C(e){return e.split("/").filter(i=>i.startsWith(":")).map(i=>i.slice(1))}async function g(e,i,n){let o=[];for(let a of e){let c=C(a.path);if(c.length===0){o.push({route:a,path:a.path});continue}let s=c[0];if(c.length>1||!a.collection||!s)throw new Error(`[dndev] Cannot list the public URLs of route "${a.path}". Only single-param routes of an entity collection are expanded. Mark the page \`seo: { noindex: true }\` to keep it out of the sitemap and llms.txt.`);if(!i)throw new Error(`[dndev] Route "${a.path}" lists "${a.collection}" records but no server CRUD reader was given.`);let p=await i.query(a.collection,{where:[{field:"status",operator:"not-in",value:[...n]}],limit:1e3});for(let t of p.items){let r=t[s];typeof r!="string"&&typeof r!="number"||o.push({route:a,path:a.path.replace(`:${s}`,encodeURIComponent(String(r))),record:t})}}return o}function y(e){return String(e).replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">").replace(/"/g,""").replace(/'/g,"'")}async function F(e,{baseUrl:i,routing:n,crud:o,languageUrls:a,hiddenStatuses:c}){let s=[],p=(t,r)=>{let l=a(t,i,n),f=n.languages.length>1?{alternates:{languages:l}}:{};for(let u of n.languages)s.push({url:l[u],...r,...f})};for(let{route:t,path:r,record:l}of await g(e,o,c)){if(!l){p(r,{changeFrequency:t.changeFrequency??"weekly",priority:t.priority??(r==="/"?1:.8),...t.lastModified&&{lastModified:t.lastModified}});continue}let f=l.updatedAt instanceof Date?l.updatedAt.toISOString():l.updatedAt;p(r,{changeFrequency:t.changeFrequency??"weekly",priority:t.priority??.7,...typeof f=="string"&&{lastModified:f}})}return s}function L(e){let n=['<?xml version="1.0" encoding="UTF-8"?>',`<urlset xmlns="http://www.sitemaps.org/schemas/sitemap/0.9"${e.some(o=>o.alternates)?' xmlns:xhtml="http://www.w3.org/1999/xhtml"':""}>`];for(let o of e){n.push(" <url>",` <loc>${y(o.url)}</loc>`);for(let[a,c]of Object.entries(o.alternates?.languages??{}))n.push(` <xhtml:link rel="alternate" hreflang="${y(a)}" href="${y(c)}" />`);o.lastModified&&n.push(` <lastmod>${y(o.lastModified)}</lastmod>`),o.changeFrequency&&n.push(` <changefreq>${o.changeFrequency}</changefreq>`),o.priority!==void 0&&n.push(` <priority>${o.priority}</priority>`),n.push(" </url>")}return n.push("</urlset>",""),n.join(`
|
|
2
|
+
`)}import R from"i18next";function m(e){return e.replace(/\s+/g," ").trim()}function $(e){let i=[`# ${m(e.name)}`,""];e.summary&&i.push(`> ${m(e.summary)}`,"");for(let n of e.sections)if(n.links.length!==0){i.push(`## ${m(n.heading)}`,"");for(let o of n.links){let a=`- [${m(o.title)}](${o.url})`;i.push(o.description?`${a}: ${m(o.description)}`:a)}i.push("")}return i.join(`
|
|
3
|
+
`)}function T(e){let i=new Map;for(let n of Object.values(e))typeof n=="object"&&n!==null&&"collection"in n&&"fields"in n&&i.set(n.collection,n);return i}function A(e,i){let n=R.createInstance();return n.init({lng:e,resources:{[e]:i},ns:Object.keys(i),interpolation:{escapeValue:!1},initAsync:!1}),o=>n.getFixedT(e,[o,"crud"])}async function _(e){let{crud:i,deriveEntitySeo:n,hiddenStatuses:o}=e,a=T(e.entities),c,s=new Map,p=t=>{let r=s.get(t);return r||(r={heading:t,links:[]},s.set(t,r)),r};p(e.pagesHeading);for(let{route:t,path:r,record:l}of await g(e.routes,i,o)){let f=`${e.baseUrl}${r}`;if(!l){if(!t.title)throw new Error(`[dndev] llms.txt: page "${t.path}" has no label in the app language.`);p(t.section??e.pagesHeading).links.push({title:t.title,url:f,...t.description&&{description:t.description}});continue}let u=a.get(t.collection);if(!u)throw new Error(`[dndev] llms.txt: no entity definition for collection "${t.collection}" (route "${t.path}"). Export it from the app's \`entities\` package.`);let x=t.section??(u.namespace?e.entityHeadings[u.namespace]:void 0);if(!x)throw new Error(`[dndev] llms.txt: no heading for route "${t.path}". Add "namePlural" to the ${u.namespace??`entity-${u.name.toLowerCase()}`} translations.`);if(!c){if(!e.language||!e.translations)throw new Error("[dndev] llms.txt: source has no language/translations (getLlmsTxtSource writes them).");c=A(e.language,e.translations)}let h=n(u,l,{t:c(u.namespace),locale:e.language});if(!h.title)throw new Error(`[dndev] llms.txt: published "${t.collection}" record at "${r}" has no title (listCardFields title fields, or first text field, are empty).`);p(x).links.push({title:h.title,url:f,...h.description&&{description:h.description}})}return $({name:e.name,...e.summary&&{summary:e.summary},sections:[...s.values()]})}export{_ as buildLlmsTxt,F as buildSitemap,k as clearMetadataCache,L as formatSitemapXml,S as getMetadataForPath};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@donotdev/core",
|
|
3
|
-
"version": "0.2.
|
|
3
|
+
"version": "0.2.3",
|
|
4
4
|
"private": false,
|
|
5
5
|
"type": "module",
|
|
6
6
|
"license": "MIT",
|
|
@@ -10,6 +10,7 @@
|
|
|
10
10
|
"exports": {
|
|
11
11
|
".": {
|
|
12
12
|
"types": "./index.d.ts",
|
|
13
|
+
"react-server": "./server.js",
|
|
13
14
|
"import": "./index.js",
|
|
14
15
|
"default": "./index.js"
|
|
15
16
|
},
|
|
@@ -25,6 +26,7 @@
|
|
|
25
26
|
},
|
|
26
27
|
"./next": {
|
|
27
28
|
"types": "./next/index.d.ts",
|
|
29
|
+
"react-server": "./next/runtime.js",
|
|
28
30
|
"import": "./next/index.js",
|
|
29
31
|
"default": "./next/index.js"
|
|
30
32
|
},
|
|
@@ -53,7 +55,7 @@
|
|
|
53
55
|
],
|
|
54
56
|
"sideEffects": false,
|
|
55
57
|
"peerDependencies": {
|
|
56
|
-
"@donotdev/components": "^0.2.
|
|
58
|
+
"@donotdev/components": "^0.2.3",
|
|
57
59
|
"@sentry/react": "^10.39.0",
|
|
58
60
|
"i18next": "^26.7.2",
|
|
59
61
|
"i18next-browser-languagedetector": "^8.3.0",
|
|
@@ -98,7 +100,7 @@
|
|
|
98
100
|
"@babel/core": "^7.29.13",
|
|
99
101
|
"@babel/plugin-transform-destructuring": "^7.29.13",
|
|
100
102
|
"@babel/plugin-transform-parameters": "^7.29.7",
|
|
101
|
-
"@clack/prompts": "^1.
|
|
103
|
+
"@clack/prompts": "^1.9.0",
|
|
102
104
|
"@rollup/plugin-strip": "^3.0.4",
|
|
103
105
|
"@tanstack/react-query": "^5.107.1",
|
|
104
106
|
"@vitejs/plugin-basic-ssl": "^2.3.0",
|