@donotdev/core 0.0.15 → 0.0.17
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 +1 -1
- package/index.d.ts +1 -1
- package/package.json +2 -8
- package/vite/index.js +17 -17
- package/eslint/index.d.ts +0 -79
- package/eslint/index.js +0 -206
package/functions/index.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
var Y=(n,e)=>()=>(n&&(e=n(n=0)),e);function V(n,e=null){let t=R[n];if(!t)throw new Error(`Unknown pattern type: ${n}`);return e&&t.framework?{...t,framework:t.framework.map(r=>`${e}/${r}`)}:t}function Z(n){return q[n]||q.base}var U,R,q,K=Y(()=>{"use strict";P();U={SOURCE_ROOT:"packages/core/i18n",SOURCE_LOCALES:"packages/core/i18n/locales",SOURCE_EAGER:"packages/core/i18n/locales/eager",SOURCE_LAZY:"packages/core/i18n/locales/lazy",PUBLISHED_ROOT:"i18n",PUBLISHED_LOCALES:"i18n/locales",PUBLISHED_EAGER:"i18n/locales/eager",PUBLISHED_LAZY:"i18n/locales/lazy"},R={routes:{consumer:["src/**/*Page.tsx","src/pages/**/*Page.tsx"],exclude:["**/node_modules/**","**/dist/**","**/build/**","**/*.test.tsx","**/*.stories.tsx"],extensions:[".tsx"]},css:{consumer:["src/**/*.css"],themes:["src/**/*.css"],extensions:[".css",".scss",".sass"],framework:["packages/ui/src/**/*.css","packages/core/components/src/**/*.css","packages/core/templates/src/**/*.css"]},i18n:{eager:["src/locales/*_*.json"],lazy:["src/**/locales/*_*.json","!src/locales/*_*.json"],framework:{eager:[`${U.SOURCE_EAGER}/*_*.json`],lazy:[`${U.SOURCE_LAZY}/*_*.json`]},extensions:[".json"]},assets:{consumer:["public/**/*"],fallback:["manifest.json"],modern:["logo.svg","favicon.svg","apple-touch-icon.png","android-chrome-192x192.png","android-chrome-512x512.png"],patterns:["favicon.svg","favicon.ico","favicon-*.png","logo.svg","logo.png","logo.webp","logo.avif","apple-touch-icon*.png","android-chrome-*.png","manifest.json"],fonts:["fonts/**/*.woff2","fonts/**/*.woff","fonts/**/*.ttf"],framework:["packages/ui/assets/**/*"]},pwa:{consumer:["public/manifest.json","public/service-worker.js","public/sw.js","public/icon-192x192.png","public/icon-512x512.png","public/favicon.ico","public/favicon.svg","public/apple-touch-icon.png","public/logo.svg"],exclude:["**/node_modules/**","**/dist/**","**/build/**"],extensions:[".json",".js",".png",".svg",".ico"],framework:["packages/ui/assets/**/*"]},globalIgnore:["**/node_modules/**","**/dist/**","**/build/**","**/.git/**","**/coverage/**","**/test/**"]},q={base:{absolute:!0,onlyFiles:!0,ignore:R.globalIgnore},css:{absolute:!0,onlyFiles:!0,ignore:[...R.globalIgnore,"**/*.test.css"]},routes:{absolute:!0,onlyFiles:!0,ignore:[...R.globalIgnore,"**/*.test.tsx","**/*.stories.tsx"]},i18n:{absolute:!0,onlyFiles:!0,ignore:R.globalIgnore},assets:{absolute:!0,onlyFiles:!0,ignore:R.globalIgnore}}});import{Buffer as w}from"node:buffer";import{createRequire as pe}from"node:module";import{dirname as fe,resolve as _e}from"node:path";import y from"node:process";import{fileURLToPath as de}from"node:url";var he,F,A,P=Y(()=>{"use strict";he=pe(import.meta.url),F=de(import.meta.url),A=fe(F);typeof globalThis<"u"&&(globalThis.require=he,globalThis.__filename=F,globalThis.__dirname=A,globalThis.Buffer=w,globalThis.process=y,typeof global>"u"&&(globalThis.global=globalThis))});P();P();P();import W from"node:fs";import b from"node:path";import{fileURLToPath as me}from"node:url";var ge=me(import.meta.url),Te=b.dirname(ge);function X(){let n=y.cwd(),e=10;for(let t=0;t<e;t++){let r=b.join(n,"package.json");if(W.existsSync(r))try{let o=JSON.parse(W.readFileSync(r,"utf8")),s=o.workspaces&&Array.isArray(o.workspaces);if(s&&o.workspaces.some(c=>c==="packages/**"||c.startsWith("packages/"))&&(W.existsSync(b.join(n,"packages","core"))||W.existsSync(b.join(n,"packages","functions"))))return{type:"dndev",root:n};if(s&&o.workspaces.some(c=>c.includes("dndev/packages"))){let f=o.workspaces.find(d=>d.includes("dndev/packages")).replace(/\/packages.*$/,""),m=b.resolve(n,f);if(W.existsSync(b.join(m,"packages","core")))return{type:"dndev",root:m}}}catch{}let i=b.dirname(n);if(i===n)break;n=i}return{type:"npm",root:y.cwd()}}function ve(n){return n.type==="dndev"?n.root:null}function Q(n){let e={};if(n.type==="dndev"){let t=ve(n);t&&(e["@donotdev/types"]=b.join(t,"packages","core","types","src"),e["@donotdev/functions"]=b.join(t,"packages","functions","src"),e["@donotdev/utils"]=b.join(t,"packages","core","utils","src"),e["@donotdev/schemas"]=b.join(t,"packages","core","schemas","src"),e["@donotdev/core"]=b.join(t,"packages","core"))}return e}P();import{createRequire as ye}from"node:module";import{resolve as M,join as x,dirname as E,relative as J,normalize as Pe,sep as ee,extname as be}from"node:path";import{fileURLToPath as ke}from"node:url";import*as p from"node:fs";K();import we from"fast-glob";var _={getGlobOptionsFor:Z||void 0,SCAN_PATTERNS:R||void 0,getPatternsFor:V||void 0,I18N_PATHS:U||void 0},g={error:(n,e)=>{},warn:(n,e)=>{},info:n=>{}};function te(n,e){return n().catch(t=>{throw new Error(`${e}: ${t instanceof Error?t.message:String(t)}`)})}var re={CLI:"packages/cli",COMPONENTS:"packages/core/components",CONFIG:"packages/core/config",CORE:"packages/core",CRUD:"packages/core/crud",FEATURES:"packages/features",HOOKS:"packages/core/hooks",I18N:"packages/core/i18n",SCHEMAS:"packages/core/schemas",STORES:"packages/core/stores",TEMPLATES:"packages/templates",TOOLING:"packages/tooling",TYPES:"packages/core/types",UI:"packages/ui",UTILS:"packages/core/utils",AUTH:"packages/features/auth",BILLING:"packages/features/billing",OAUTH:"packages/features/oauth",FIREBASE:"packages/providers/firebase",FUNCTIONS:"packages/functions"},B=class n{static _instance=null;options;_repoRoot;_appRoot=null;static getInstance(e={}){return n._instance||(n._instance=new n(e)),n._instance}static _reset(){n._instance=null}constructor(e={}){if(n._instance)return n._instance;this.options={maxLevels:e.maxLevels??10,customMarkers:e.customMarkers||[],cache:e.cache??!1,debug:e.debug??!1};try{let t=y.cwd();if(!t)throw new Error("PathResolver: process.cwd() returned undefined. This should never happen.");this._repoRoot=this._findRepoRoot(t)}catch(t){throw new Error(`PathResolver constructor failed: ${t instanceof Error?t.message:String(t)}. cwd: ${y.cwd()}`)}this._appRoot=null,n._instance=this}normalizePath(e){if(!e)return"";try{return Pe(e).split(ee).join("/")}catch{return String(e).split(ee).join("/")}}getRelativePath(e){let t=this.getAppRoot(),r=J(t,e);return this.normalizePath(r)}getBasename(e){if(!e)return"";let r=this.normalizePath(e).split("/");return r[r.length-1]||""}getDirname(e){return e?this.normalizePath(E(e)):""}resolvePackage(e,t=null){try{let r=t||this.getAppRoot(),o=ye(x(r,"package.json")).resolve(e);return this.normalizePath(o)}catch{return null}}resolveFrameworkPackage(e,t=null){let r=this.resolvePackage(`${e}/package.json`,t);if(r)return this.getDirname(r);if(this.isMonorepo()&&e.startsWith("@donotdev/")){let s=e.replace("@donotdev/",""),a=this.resolveRepoPath(`packages/${s}`);if(this.pathExists(a))return a;if(["auth","billing","crud","oauth"].includes(s)){let l=this.resolveRepoPath(`packages/features/${s}`);if(this.pathExists(l))return l}if(s==="firebase"){let l=this.resolveRepoPath(`packages/providers/${s}`);if(this.pathExists(l))return l}}let i=this.resolveAppPath(`node_modules/${e}`);if(this.pathExists(i))return i;let o=this.resolveRepoPath(`node_modules/${e}`);return this.pathExists(o)?o:null}resolvePackageAsset(e,t=null){return this.resolvePackage(e,t)}resolveAppPath(e){let t=this.getAppRoot(),r=M(t,e);return this.normalizePath(r)}resolveRepoPath(e){let t=this.getRepoRoot(),r=this.normalizePath(e),i=M(t,r);return this.normalizePath(i)}resolvePath(e,t){let r=this.normalizePath(t),i=this.normalizePath(e),o=M(r,i);return this.normalizePath(o)}createImportPath(e){return"./"+this.getRelativePath(e)}getFileInfo(e){try{let t=p.statSync(e);return{absolutePath:this.normalizePath(e),relativePath:this.getRelativePath(e),importPath:this.createImportPath(e),size:t.size,isFile:t.isFile(),isDirectory:t.isDirectory()}}catch{return null}}_detectFormat(e,t){return t&&t!=="auto"?t:be(e).toLowerCase()===".json"?"json":"text"}async read(e,t={}){let{format:r="auto",encoding:i="utf8"}=t,o=this._detectFormat(e,r);try{if(o==="buffer")return await p.promises.readFile(e);let s=await p.promises.readFile(e,i),a=this.stripBom(s);return o==="json"?JSON.parse(a):a}catch(s){return this.options.debug&&g.warn(`Failed to read file: ${e}`,s),null}}readSync(e,t={}){let{format:r="auto",encoding:i="utf8"}=t,o=this._detectFormat(e,r);try{if(o==="buffer")return p.readFileSync(e);let s=p.readFileSync(e,i),a=this.stripBom(s);return o==="json"?JSON.parse(a):a}catch(s){return this.options.debug&&g.warn(`Failed to read file: ${e}`,s),null}}async write(e,t,r={}){let{format:i="auto",overwrite:o=!1,dryRun:s=!1,verbose:a=!1}=r,l=this.normalizePath(e),h=this.normalizePath(E(l)),c=this.pathExists(l);if(c&&!o)return a&&g.info(`Skipping existing file: ${l}`),!1;if(s)return g.info(`[DRY RUN] Would write file: ${l}`),!0;try{await p.promises.mkdir(h,{recursive:!0})}catch(d){if(d?.code!=="EEXIST")throw d}let f=this._detectFormat(e,i),m;w.isBuffer(t)?m=t:f==="json"&&typeof t=="object"?m=JSON.stringify(t,null,2):m=String(t);try{return await te(async()=>(w.isBuffer(m)?await p.promises.writeFile(l,m):await p.promises.writeFile(l,m,"utf8"),a&&g.info(`${c?"Updated":"Created"} file: ${l}`),!0),`Failed to write file: ${l}`)}catch{return!1}}writeSync(e,t,r={}){let{format:i="auto",overwrite:o=!1,dryRun:s=!1,verbose:a=!1}=r,l=this.normalizePath(e),h=this.normalizePath(E(l)),c=this.pathExists(l);if(c&&!o)return a&&g.info(`Skipping existing file: ${l}`),!1;if(s)return g.info(`[DRY RUN] Would write file: ${l}`),!0;try{p.mkdirSync(h,{recursive:!0})}catch(d){if(d?.code!=="EEXIST")throw d}let f=this._detectFormat(e,i),m;w.isBuffer(t)?m=t:f==="json"&&typeof t=="object"?m=JSON.stringify(t,null,2):m=String(t);try{return w.isBuffer(m)?p.writeFileSync(l,m):p.writeFileSync(l,m,"utf8"),a&&g.info(`${c?"Updated":"Created"} file: ${l}`),!0}catch(d){throw new Error(`Failed to write file: ${l}: ${d instanceof Error?d.message:String(d)}`)}}async copy(e,t,r={}){let{overwrite:i=!1,dryRun:o=!1,verbose:s=!1}=r,a=this.normalizePath(t),l=this.pathExists(a);if(l&&!i)return s&&g.info(`Skipping existing file: ${a}`),!1;if(o)return g.info(`[DRY RUN] Would copy file: ${a}`),!0;let h=this.normalizePath(E(a));try{await p.promises.mkdir(h,{recursive:!0})}catch(c){if(c?.code!=="EEXIST")throw c}try{return await te(async()=>(await p.promises.copyFile(e,a),s&&g.info(`${l?"Updated":"Created"} file: ${a}`),!0),`Failed to copy file from ${e} to ${a}`)}catch{return!1}}copySync(e,t,r={}){let{overwrite:i=!1,dryRun:o=!1,verbose:s=!1}=r,a=this.normalizePath(t),l=this.pathExists(a);if(l&&!i)return s&&g.info(`Skipping existing file: ${a}`),!1;if(o)return g.info(`[DRY RUN] Would copy file: ${a}`),!0;let h=this.normalizePath(E(a));try{p.mkdirSync(h,{recursive:!0})}catch(c){if(c?.code!=="EEXIST")throw c}try{return p.copyFileSync(e,a),s&&g.info(`${l?"Updated":"Created"} file: ${a}`),!0}catch{return!1}}pathExists(e,t=!1){try{return p.existsSync(e)}catch(r){return t||g.error(`Error checking path existence: ${e}`,r),!1}}mkdir(e){try{let t=e.startsWith("/")||e.match(/^[A-Z]:/)?this.normalizePath(e):this.resolveAppPath(e);return p.existsSync(t)||p.mkdirSync(t,{recursive:!0}),!0}catch{return!1}}readdirSync(e,t){try{return p.readdirSync(e,t)}catch(r){return this.options.debug&&g.warn(`Failed to read directory: ${e}`,r),t&&typeof t=="object"&&"withFileTypes"in t&&t.withFileTypes?[]:[]}}statSync(e){try{return p.statSync(e)}catch(t){return this.options.debug&&g.warn(`Failed to stat file: ${e}`,t),null}}lstatSync(e){try{return p.lstatSync(e)}catch(t){return this.options.debug&&g.warn(`Failed to lstat file: ${e}`,t),null}}async ensureDir(e){try{await p.promises.mkdir(e,{recursive:!0})}catch(t){if(t?.code!=="EEXIST")throw t}}ensureDirSync(e){try{p.mkdirSync(e,{recursive:!0})}catch(t){if(t?.code!=="EEXIST")throw t}}async remove(e){await p.promises.rm(e,{recursive:!0,force:!0})}removeSync(e){p.rmSync(e,{recursive:!0,force:!0})}async readdir(e,t){return p.promises.readdir(e,t)}stripBom(e){return e.charCodeAt(0)===65279?e.slice(1):e}getRepoRoot(){return this._repoRoot||y.cwd()}getAppRoot(){return this._appRoot?this._appRoot:this._repoRoot}setAppRoot(e){if(!e)throw new Error("PathResolver.setAppRoot: root cannot be undefined or null");this._appRoot=this.normalizePath(e)}isMonorepo(){let e=x(this._repoRoot,"packages");return this.pathExists(e)}isWithinApp(e){let t=this.normalizePath(M(e)),r=this.getAppRoot(),i=J(r,t),o=this.normalizePath(i);return!o.startsWith("../")&&!o.startsWith("/")}async findFiles(e,t,r={}){let i=this.normalizePath(x(e,t)),o=this.getAppRoot(),s=this.normalizePath(o),a=i.startsWith(s)?i.slice(s.length+1):i,l={absolute:!0,onlyFiles:!0,braceExpansion:!0,extglob:!0,globstar:!0,cwd:o,ignore:_.SCAN_PATTERNS?.globalIgnore||["**/node_modules/**","**/dist/**","**/build/**","**/.git/**"]};return await this._globWithNormalization([a],{...l,...r})}clearCache(){}async _resolveFrameworkI18nPattern(e){let t=_.I18N_PATHS;if(!t)return null;let r=e.replace(t.SOURCE_ROOT+"/",""),i=this.resolveFrameworkPackage("@donotdev/core");if(!i)return null;let o=this.normalizePath(x(i,t.PUBLISHED_ROOT,r)),s=o.replace(/\/[^/]*\*.*$/,"");return this.pathExists(s),o}async _globWithNormalization(e,t){return(await we(e,t)).map(i=>{let o=typeof i=="string"?i:i.path;return this.normalizePath(o)})}async resolveFiles(e,t="css"){if(!e||typeof e!="object")return{frameworkFiles:[],consumerFiles:[]};if(t==="i18n")return{frameworkFiles:[],consumerFiles:[]};if(Array.isArray(e.framework)||(e.framework=[]),!Array.isArray(e.consumer))return{frameworkFiles:[],consumerFiles:[]};let r=[...e.framework,...e.consumer];for(let c of r)if(typeof c!="string"||c.trim()==="")return{frameworkFiles:[],consumerFiles:[]};let i=this.getAppRoot(),o=_.getGlobOptionsFor?_.getGlobOptionsFor(t):{ignore:["**/node_modules/**","**/dist/**","**/build/**"]},s=this.normalizePath(i),a=e.framework.map(c=>{let f=this.normalizePath(c);return f.startsWith(s)?f.slice(s.length+1):f}),l=e.consumer.map(c=>{let f=this.normalizePath(c);return f.startsWith(s)?f.slice(s.length+1):f}),h={...o,onlyFiles:!0,absolute:!0,braceExpansion:!0,extglob:!0,globstar:!0,cwd:i};try{let c=a.length>0?await this._globWithNormalization(a,h):[],f=await this._globWithNormalization(l,h);return{frameworkFiles:c,consumerFiles:f}}catch{return this.options.debug,{frameworkFiles:[],consumerFiles:[]}}}async resolvePatterns(e){if(!_.getPatternsFor)return{framework:[],consumer:[],all:[]};let t=this.getAppRoot(),r=this.getRepoRoot();if(e==="i18n"&&(!t||t===r))throw new Error(`Cannot resolve i18n patterns: appRoot not set (appRoot: ${t}, repoRoot: ${r}). Ensure configResolved hook has run before discovery.`);let i=_.getPatternsFor(e),o=this.isMonorepo();if(e==="i18n"){let l=i,h={eager:l.eager.map(c=>c.startsWith("!")?"!"+this.resolveAppPath(c.slice(1)):this.resolveAppPath(c)),lazy:l.lazy.map(c=>c.startsWith("!")?"!"+this.resolveAppPath(c.slice(1)):this.resolveAppPath(c)),framework:{eager:o?(l.framework?.eager||[]).map(c=>this.resolveRepoPath(c)).filter(Boolean):await Promise.all((l.framework?.eager||[]).map(c=>this._resolveFrameworkI18nPattern(c))).then(c=>c.filter(Boolean)),lazy:o?(l.framework?.lazy||[]).map(c=>this.resolveRepoPath(c)).filter(Boolean):await Promise.all((l.framework?.lazy||[]).map(c=>this._resolveFrameworkI18nPattern(c))).then(c=>c.filter(Boolean))},all:[]};return h.all=[...h.eager,...h.lazy,...h.framework.eager,...h.framework.lazy],h}let s=i,a={framework:o?(s.framework||[]).map(l=>this.resolveRepoPath(l)).filter(Boolean):[],consumer:(s.consumer||[]).map(l=>this.resolveAppPath(l)),all:[]};return a.all=[...a.consumer,...a.framework],a}getEmptyModulePath(e=!1){if(e)return"@donotdev/core/empty";let t=this.resolvePackage("@donotdev/core/empty");if(t)return t;let r=E(ke(import.meta.url));return this.normalizePath(x(r,"../empty.js"))}_findRepoRoot(e){let t=this.normalizePath(e),r=0,i=this.options.maxLevels;for(;r<i;){let o=this.normalizePath(x(t,re.TOOLING)),s=this.normalizePath(x(t,re.CORE));if(this.pathExists(o)&&this.pathExists(s))return t;let a=x(t,"apps");if(this.pathExists(a)&&this.statSync(a)?.isDirectory())return this.normalizePath(t);let l=this.normalizePath(x(t,"package.json"));if(this.pathExists(l)&&this.normalizePath(E(t))===t)return t;let h=this.normalizePath(E(t));if(h===t)break;t=h,r++}return this.normalizePath(e)}};function se(n={}){let{entry:e="src/index.ts",outDir:t="lib",minify:r=!1,sourcemap:i=!0,platform:o="firebase",workspace:s,bundleWorkspaceDeps:a=!1,importFramework:l=!1,external:h=!1,...c}=n,f=B.getInstance(),m=Q(s),d={entryPoints:[e],bundle:!0,platform:"node",target:"node20",format:"esm",outdir:t,outExtension:{".js":".js"},minify:r,sourcemap:i,metafile:!0,logLevel:"info",loader:{".ts":"ts",".tsx":"tsx",".css":"empty"},keepNames:!0,treeShaking:!0,...c};a&&Object.keys(m).length>0&&(d.alias=Object.fromEntries(Object.entries(m).map(([k,u])=>[k,f.normalizePath(u)]))),d.mainFields=["module","main"],d.conditions=["import","module","node"];let ce=["fs","path","crypto","util","stream","events","buffer","url","querystring","http","https","zlib","os","child_process","assert","constants","domain","punycode","string_decoder","timers","tty","vm","worker_threads","perf_hooks","async_hooks"],G=[];if(a)try{let k=s?.root||y.cwd(),u=y.cwd(),v=10;for(let S=0;S<v;S++){let H=f.normalizePath(`${u}/package.json`);if(f.pathExists(H)){let z=f.readSync(H,{format:"json"});if(z&&Array.isArray(z.workspaces)){k=f.normalizePath(u);for(let $ of z.workspaces)$==="apps/*"||$==="functions"||!$.includes("*")&&!$.includes("/")&&G.push($);break}}let L=f.getDirname(u);if(L===u)break;u=L}}catch{}let le={name:"external-node-modules",setup(k){k.onResolve({filter:/^firebase($|\/)/},u=>{if(u.path==="firebase-admin"||u.path.startsWith("firebase-admin/")||u.path==="firebase-functions"||u.path.startsWith("firebase-functions/"))return null;let v;if(s?.type==="dndev"&&s.root)v=f.normalizePath(`${s.root}/packages/core/config/functions/firebase-stub.js`);else{let S=import.meta.url,L=new URL(S).pathname.replace(/^\/([A-Z]:)/i,"$1"),z=f.getDirname(L);v=f.normalizePath(`${z}/firebase-stub.js`)}return{path:v}}),k.onResolve({filter:/.*/},u=>{if(u.kind==="entry-point")return null;if(u.path.match(/@donotdev\/functions\/.+/)&&a&&s?.type==="dndev"){let v=u.path.replace("@donotdev/functions/","");return{path:f.normalizePath(`${s.root}/packages/functions/src/${v}/index.ts`)}}if(u.path==="@donotdev/utils")return s?.type==="dndev"?{path:f.normalizePath(`${s.root}/packages/core/utils/src/server/index.ts`)}:k.resolve("@donotdev/utils/server",{kind:u.kind,resolveDir:u.resolveDir});if(u.path.match(/@donotdev\/utils\/.+/)&&s?.type==="dndev"){let v=u.path.replace("@donotdev/utils/","");return{path:f.normalizePath(`${s.root}/packages/core/utils/src/${v}/index.ts`)}}if(u.path==="@donotdev/core")return s?.type==="dndev"?{path:f.normalizePath(`${s.root}/packages/core/server.ts`)}:k.resolve("@donotdev/core/server",{kind:u.kind,resolveDir:u.resolveDir});if(u.path.match(/@donotdev\/core\/.+/)&&a&&s?.type==="dndev"){let v=u.path.replace("@donotdev/core/","");return{path:f.normalizePath(`${s.root}/packages/core/${v}.ts`)}}if(u.path==="firebase-admin"||u.path.startsWith("firebase-admin/")||u.path==="firebase-functions"||u.path.startsWith("firebase-functions/"))return{path:u.path,external:!0};if(u.path.match(/@donotdev\/core\/.+/)&&a&&s?.type==="dndev"){let v=u.path.replace("@donotdev/core/","");return{path:f.normalizePath(`${s.root}/packages/core/${v}.ts`)}}if(u.path.startsWith("@donotdev/")||u.path==="valibot"||u.path.startsWith("valibot/"))return null;if(G.length>0){let v=u.path.split("/")[0];if(G.includes(v))return null}return u.path.startsWith(".")||u.path.startsWith("/")?null:{path:u.path,external:!0}})}};if(d.external=[...ce,"firebase-admin","firebase-functions"],d.plugins=[le,...d.plugins||[]],d.define={"process.env.NODE_ENV":JSON.stringify(y.env.NODE_ENV||"production"),...d.define||{}},l&&s.type==="dndev"){let k=s.root,u=f.normalizePath(`${k}/functions/lib`);d.alias={...d.alias,"@donotdev/functions":u}}return o==="framework"&&(d.entryPoints={"firebase/index":"src/firebase/index.ts","vercel/api/index":"src/vercel/api/index.ts","shared/index":"src/shared/index.ts"}),d}P();var oe=["create","get","list","listCard","update","delete"];function ne(n,e=0){let t=" ".repeat(e),r="";for(let[i,o]of Object.entries(n))if(o!=null)if(typeof o=="object"&&!Array.isArray(o))Object.keys(o).length===0?r+=`${t}${i}: {}
|
|
1
|
+
var Y=(n,e)=>()=>(n&&(e=n(n=0)),e);function V(n,e=null){let t=R[n];if(!t)throw new Error(`Unknown pattern type: ${n}`);return e&&t.framework?{...t,framework:t.framework.map(r=>`${e}/${r}`)}:t}function Z(n){return q[n]||q.base}var U,R,q,K=Y(()=>{"use strict";P();U={SOURCE_ROOT:"packages/core/i18n",SOURCE_LOCALES:"packages/core/i18n/locales",SOURCE_EAGER:"packages/core/i18n/locales/eager",SOURCE_LAZY:"packages/core/i18n/locales/lazy",PUBLISHED_ROOT:"i18n",PUBLISHED_LOCALES:"i18n/locales",PUBLISHED_EAGER:"i18n/locales/eager",PUBLISHED_LAZY:"i18n/locales/lazy"},R={routes:{consumer:["src/**/*Page.tsx","src/pages/**/*Page.tsx"],exclude:["**/node_modules/**","**/dist/**","**/build/**","**/*.test.tsx","**/*.stories.tsx"],extensions:[".tsx"]},css:{consumer:["src/**/*.css"],themes:["src/**/*.css"],extensions:[".css",".scss",".sass"],framework:["packages/ui/src/**/*.css","packages/core/components/src/**/*.css","packages/core/templates/src/**/*.css"]},i18n:{eager:["src/locales/*_*.json"],lazy:["src/**/locales/*_*.json","!src/locales/*_*.json"],framework:{eager:[`${U.SOURCE_EAGER}/*_*.json`],lazy:[`${U.SOURCE_LAZY}/*_*.json`]},extensions:[".json"]},assets:{consumer:["public/**/*"],fallback:["manifest.json"],modern:["logo.svg","favicon.svg","apple-touch-icon.png","android-chrome-192x192.png","android-chrome-512x512.png"],patterns:["favicon.svg","favicon.ico","favicon-*.png","logo.svg","logo.png","logo.webp","logo.avif","apple-touch-icon*.png","android-chrome-*.png","manifest.json"],fonts:["fonts/**/*.woff2","fonts/**/*.woff","fonts/**/*.ttf"],framework:["packages/ui/assets/**/*"]},pwa:{consumer:["public/manifest.json","public/service-worker.js","public/sw.js","public/icon-192x192.png","public/icon-512x512.png","public/favicon.ico","public/favicon.svg","public/apple-touch-icon.png","public/logo.svg"],exclude:["**/node_modules/**","**/dist/**","**/build/**"],extensions:[".json",".js",".png",".svg",".ico"],framework:["packages/ui/assets/**/*"]},globalIgnore:["**/node_modules/**","**/dist/**","**/build/**","**/.git/**","**/coverage/**","**/test/**"]},q={base:{absolute:!0,onlyFiles:!0,ignore:R.globalIgnore},css:{absolute:!0,onlyFiles:!0,ignore:[...R.globalIgnore,"**/*.test.css"]},routes:{absolute:!0,onlyFiles:!0,ignore:[...R.globalIgnore,"**/*.test.tsx","**/*.stories.tsx"]},i18n:{absolute:!0,onlyFiles:!0,ignore:R.globalIgnore},assets:{absolute:!0,onlyFiles:!0,ignore:R.globalIgnore}}});import{Buffer as w}from"node:buffer";import{createRequire as pe}from"node:module";import{dirname as fe,resolve as _e}from"node:path";import y from"node:process";import{fileURLToPath as de}from"node:url";var he,F,A,P=Y(()=>{"use strict";he=pe(import.meta.url),F=de(import.meta.url),A=fe(F);typeof globalThis<"u"&&(globalThis.require=he,globalThis.__filename=F,globalThis.__dirname=A,globalThis.Buffer=w,globalThis.process=y,typeof global>"u"&&(globalThis.global=globalThis))});P();P();P();import W from"node:fs";import b from"node:path";import{fileURLToPath as me}from"node:url";var ge=me(import.meta.url),Ce=b.dirname(ge);function X(){let n=y.cwd(),e=10;for(let t=0;t<e;t++){let r=b.join(n,"package.json");if(W.existsSync(r))try{let o=JSON.parse(W.readFileSync(r,"utf8")),s=o.workspaces&&Array.isArray(o.workspaces);if(s&&o.workspaces.some(c=>c==="packages/**"||c.startsWith("packages/"))&&(W.existsSync(b.join(n,"packages","core"))||W.existsSync(b.join(n,"packages","functions"))))return{type:"dndev",root:n};if(s&&o.workspaces.some(c=>c.includes("dndev/packages"))){let f=o.workspaces.find(d=>d.includes("dndev/packages")).replace(/\/packages.*$/,""),m=b.resolve(n,f);if(W.existsSync(b.join(m,"packages","core")))return{type:"dndev",root:m}}}catch{}let i=b.dirname(n);if(i===n)break;n=i}return{type:"npm",root:y.cwd()}}function ve(n){return n.type==="dndev"?n.root:null}function Q(n){let e={};if(n.type==="dndev"){let t=ve(n);t&&(e["@donotdev/types"]=b.join(t,"packages","core","types","src"),e["@donotdev/functions"]=b.join(t,"packages","functions","src"),e["@donotdev/utils"]=b.join(t,"packages","core","utils","src"),e["@donotdev/schemas"]=b.join(t,"packages","core","schemas","src"),e["@donotdev/core"]=b.join(t,"packages","core"))}return e}P();import{createRequire as ye}from"node:module";import{resolve as B,join as x,dirname as E,relative as J,normalize as Pe,sep as ee,extname as be}from"node:path";import{fileURLToPath as ke}from"node:url";import*as p from"node:fs";K();import we from"fast-glob";var _={getGlobOptionsFor:Z||void 0,SCAN_PATTERNS:R||void 0,getPatternsFor:V||void 0,I18N_PATHS:U||void 0},g={error:(n,e)=>{},warn:(n,e)=>{},info:n=>{}};function te(n,e){return n().catch(t=>{throw new Error(`${e}: ${t instanceof Error?t.message:String(t)}`)})}var re={CLI:"packages/cli",COMPONENTS:"packages/core/components",CONFIG:"packages/core/config",CORE:"packages/core",CRUD:"packages/core/crud",FEATURES:"packages/features",HOOKS:"packages/core/hooks",I18N:"packages/core/i18n",SCHEMAS:"packages/core/schemas",STORES:"packages/core/stores",TEMPLATES:"packages/templates",TOOLING:"packages/tooling",TYPES:"packages/core/types",UI:"packages/ui",UTILS:"packages/core/utils",AUTH:"packages/features/auth",BILLING:"packages/features/billing",OAUTH:"packages/features/oauth",FIREBASE:"packages/providers/firebase",FUNCTIONS:"packages/functions"},M=class n{static _instance=null;options;_repoRoot;_appRoot=null;static getInstance(e={}){return n._instance||(n._instance=new n(e)),n._instance}static _reset(){n._instance=null}constructor(e={}){if(n._instance)return n._instance;this.options={maxLevels:e.maxLevels??10,customMarkers:e.customMarkers||[],cache:e.cache??!1,debug:e.debug??!1};try{let t=y.cwd();if(!t)throw new Error("PathResolver: process.cwd() returned undefined. This should never happen.");this._repoRoot=this._findRepoRoot(t)}catch(t){throw new Error(`PathResolver constructor failed: ${t instanceof Error?t.message:String(t)}. cwd: ${y.cwd()}`)}this._appRoot=null,n._instance=this}normalizePath(e){if(!e)return"";try{return Pe(e).split(ee).join("/")}catch{return String(e).split(ee).join("/")}}getRelativePath(e){let t=this.getAppRoot(),r=J(t,e);return this.normalizePath(r)}getBasename(e){if(!e)return"";let r=this.normalizePath(e).split("/");return r[r.length-1]||""}getDirname(e){return e?this.normalizePath(E(e)):""}resolvePackage(e,t=null){try{let r=t||this.getAppRoot(),o=ye(x(r,"package.json")).resolve(e);return this.normalizePath(o)}catch{return null}}resolveFrameworkPackage(e,t=null){let r=this.resolvePackage(`${e}/package.json`,t);if(r)return this.getDirname(r);if(this.isMonorepo()&&e.startsWith("@donotdev/")){let s=e.replace("@donotdev/",""),a=this.resolveRepoPath(`packages/${s}`);if(this.pathExists(a))return a;if(["auth","billing","crud","oauth"].includes(s)){let l=this.resolveRepoPath(`packages/features/${s}`);if(this.pathExists(l))return l}if(s==="firebase"){let l=this.resolveRepoPath(`packages/providers/${s}`);if(this.pathExists(l))return l}}let i=this.resolveAppPath(`node_modules/${e}`);if(this.pathExists(i))return i;let o=this.resolveRepoPath(`node_modules/${e}`);return this.pathExists(o)?o:null}resolvePackageAsset(e,t=null){return this.resolvePackage(e,t)}resolveAppPath(e){let t=this.getAppRoot(),r=B(t,e);return this.normalizePath(r)}resolveRepoPath(e){let t=this.getRepoRoot(),r=this.normalizePath(e),i=B(t,r);return this.normalizePath(i)}resolvePath(e,t){let r=this.normalizePath(t),i=this.normalizePath(e),o=B(r,i);return this.normalizePath(o)}createImportPath(e){return"./"+this.getRelativePath(e)}getFileInfo(e){try{let t=p.statSync(e);return{absolutePath:this.normalizePath(e),relativePath:this.getRelativePath(e),importPath:this.createImportPath(e),size:t.size,isFile:t.isFile(),isDirectory:t.isDirectory()}}catch{return null}}_detectFormat(e,t){return t&&t!=="auto"?t:be(e).toLowerCase()===".json"?"json":"text"}async read(e,t={}){let{format:r="auto",encoding:i="utf8"}=t,o=this._detectFormat(e,r);try{if(o==="buffer")return await p.promises.readFile(e);let s=await p.promises.readFile(e,i),a=this.stripBom(s);return o==="json"?JSON.parse(a):a}catch(s){return this.options.debug&&g.warn(`Failed to read file: ${e}`,s),null}}readSync(e,t={}){let{format:r="auto",encoding:i="utf8"}=t,o=this._detectFormat(e,r);try{if(o==="buffer")return p.readFileSync(e);let s=p.readFileSync(e,i),a=this.stripBom(s);return o==="json"?JSON.parse(a):a}catch(s){return this.options.debug&&g.warn(`Failed to read file: ${e}`,s),null}}async write(e,t,r={}){let{format:i="auto",overwrite:o=!1,dryRun:s=!1,verbose:a=!1}=r,l=this.normalizePath(e),h=this.normalizePath(E(l)),c=this.pathExists(l);if(c&&!o)return a&&g.info(`Skipping existing file: ${l}`),!1;if(s)return g.info(`[DRY RUN] Would write file: ${l}`),!0;try{await p.promises.mkdir(h,{recursive:!0})}catch(d){if(d?.code!=="EEXIST")throw d}let f=this._detectFormat(e,i),m;w.isBuffer(t)?m=t:f==="json"&&typeof t=="object"?m=JSON.stringify(t,null,2):m=String(t);try{return await te(async()=>(w.isBuffer(m)?await p.promises.writeFile(l,m):await p.promises.writeFile(l,m,"utf8"),a&&g.info(`${c?"Updated":"Created"} file: ${l}`),!0),`Failed to write file: ${l}`)}catch{return!1}}writeSync(e,t,r={}){let{format:i="auto",overwrite:o=!1,dryRun:s=!1,verbose:a=!1}=r,l=this.normalizePath(e),h=this.normalizePath(E(l)),c=this.pathExists(l);if(c&&!o)return a&&g.info(`Skipping existing file: ${l}`),!1;if(s)return g.info(`[DRY RUN] Would write file: ${l}`),!0;try{p.mkdirSync(h,{recursive:!0})}catch(d){if(d?.code!=="EEXIST")throw d}let f=this._detectFormat(e,i),m;w.isBuffer(t)?m=t:f==="json"&&typeof t=="object"?m=JSON.stringify(t,null,2):m=String(t);try{return w.isBuffer(m)?p.writeFileSync(l,m):p.writeFileSync(l,m,"utf8"),a&&g.info(`${c?"Updated":"Created"} file: ${l}`),!0}catch(d){throw new Error(`Failed to write file: ${l}: ${d instanceof Error?d.message:String(d)}`)}}async copy(e,t,r={}){let{overwrite:i=!1,dryRun:o=!1,verbose:s=!1}=r,a=this.normalizePath(t),l=this.pathExists(a);if(l&&!i)return s&&g.info(`Skipping existing file: ${a}`),!1;if(o)return g.info(`[DRY RUN] Would copy file: ${a}`),!0;let h=this.normalizePath(E(a));try{await p.promises.mkdir(h,{recursive:!0})}catch(c){if(c?.code!=="EEXIST")throw c}try{return await te(async()=>(await p.promises.copyFile(e,a),s&&g.info(`${l?"Updated":"Created"} file: ${a}`),!0),`Failed to copy file from ${e} to ${a}`)}catch{return!1}}copySync(e,t,r={}){let{overwrite:i=!1,dryRun:o=!1,verbose:s=!1}=r,a=this.normalizePath(t),l=this.pathExists(a);if(l&&!i)return s&&g.info(`Skipping existing file: ${a}`),!1;if(o)return g.info(`[DRY RUN] Would copy file: ${a}`),!0;let h=this.normalizePath(E(a));try{p.mkdirSync(h,{recursive:!0})}catch(c){if(c?.code!=="EEXIST")throw c}try{return p.copyFileSync(e,a),s&&g.info(`${l?"Updated":"Created"} file: ${a}`),!0}catch{return!1}}pathExists(e,t=!1){try{return p.existsSync(e)}catch(r){return t||g.error(`Error checking path existence: ${e}`,r),!1}}mkdir(e){try{let t=e.startsWith("/")||e.match(/^[A-Z]:/)?this.normalizePath(e):this.resolveAppPath(e);return p.existsSync(t)||p.mkdirSync(t,{recursive:!0}),!0}catch{return!1}}readdirSync(e,t){try{return p.readdirSync(e,t)}catch(r){return this.options.debug&&g.warn(`Failed to read directory: ${e}`,r),t&&typeof t=="object"&&"withFileTypes"in t&&t.withFileTypes?[]:[]}}statSync(e){try{return p.statSync(e)}catch(t){return this.options.debug&&g.warn(`Failed to stat file: ${e}`,t),null}}lstatSync(e){try{return p.lstatSync(e)}catch(t){return this.options.debug&&g.warn(`Failed to lstat file: ${e}`,t),null}}async ensureDir(e){try{await p.promises.mkdir(e,{recursive:!0})}catch(t){if(t?.code!=="EEXIST")throw t}}ensureDirSync(e){try{p.mkdirSync(e,{recursive:!0})}catch(t){if(t?.code!=="EEXIST")throw t}}async remove(e){await p.promises.rm(e,{recursive:!0,force:!0})}removeSync(e){p.rmSync(e,{recursive:!0,force:!0})}async readdir(e,t){return p.promises.readdir(e,t)}stripBom(e){return e.charCodeAt(0)===65279?e.slice(1):e}getRepoRoot(){return this._repoRoot||y.cwd()}getAppRoot(){return this._appRoot?this._appRoot:this._repoRoot}setAppRoot(e){if(!e)throw new Error("PathResolver.setAppRoot: root cannot be undefined or null");this._appRoot=this.normalizePath(e)}isMonorepo(){let e=x(this._repoRoot,"packages");return this.pathExists(e)}isWithinApp(e){let t=this.normalizePath(B(e)),r=this.getAppRoot(),i=J(r,t),o=this.normalizePath(i);return!o.startsWith("../")&&!o.startsWith("/")}async findFiles(e,t,r={}){let i=this.normalizePath(x(e,t)),o=this.getAppRoot(),s=this.normalizePath(o),a=i.startsWith(s)?i.slice(s.length+1):i,l={absolute:!0,onlyFiles:!0,braceExpansion:!0,extglob:!0,globstar:!0,cwd:o,ignore:_.SCAN_PATTERNS?.globalIgnore||["**/node_modules/**","**/dist/**","**/build/**","**/.git/**"]};return await this._globWithNormalization([a],{...l,...r})}clearCache(){}async _resolveFrameworkI18nPattern(e){let t=_.I18N_PATHS;if(!t)return null;let r=e.replace(t.SOURCE_ROOT+"/",""),i=this.resolveFrameworkPackage("@donotdev/core");if(!i)return null;let o=this.normalizePath(x(i,t.PUBLISHED_ROOT,r)),s=o.replace(/\/[^/]*\*.*$/,"");return this.pathExists(s),o}async _globWithNormalization(e,t){return(await we(e,t)).map(i=>{let o=typeof i=="string"?i:i.path;return this.normalizePath(o)})}async resolveFiles(e,t="css"){if(!e||typeof e!="object")return{frameworkFiles:[],consumerFiles:[]};if(t==="i18n")return{frameworkFiles:[],consumerFiles:[]};if(Array.isArray(e.framework)||(e.framework=[]),!Array.isArray(e.consumer))return{frameworkFiles:[],consumerFiles:[]};let r=[...e.framework,...e.consumer];for(let c of r)if(typeof c!="string"||c.trim()==="")return{frameworkFiles:[],consumerFiles:[]};let i=this.getAppRoot(),o=_.getGlobOptionsFor?_.getGlobOptionsFor(t):{ignore:["**/node_modules/**","**/dist/**","**/build/**"]},s=this.normalizePath(i),a=e.framework.map(c=>{let f=this.normalizePath(c);return f.startsWith(s)?f.slice(s.length+1):f}),l=e.consumer.map(c=>{let f=this.normalizePath(c);return f.startsWith(s)?f.slice(s.length+1):f}),h={...o,onlyFiles:!0,absolute:!0,braceExpansion:!0,extglob:!0,globstar:!0,cwd:i};try{let c=a.length>0?await this._globWithNormalization(a,h):[],f=await this._globWithNormalization(l,h);return{frameworkFiles:c,consumerFiles:f}}catch{return this.options.debug,{frameworkFiles:[],consumerFiles:[]}}}async resolvePatterns(e){if(!_.getPatternsFor)return{framework:[],consumer:[],all:[]};let t=this.getAppRoot(),r=this.getRepoRoot();if(e==="i18n"&&(!t||t===r))throw new Error(`Cannot resolve i18n patterns: appRoot not set (appRoot: ${t}, repoRoot: ${r}). Ensure configResolved hook has run before discovery.`);let i=_.getPatternsFor(e),o=this.isMonorepo();if(e==="i18n"){let l=i,h={eager:l.eager.map(c=>c.startsWith("!")?"!"+this.resolveAppPath(c.slice(1)):this.resolveAppPath(c)),lazy:l.lazy.map(c=>c.startsWith("!")?"!"+this.resolveAppPath(c.slice(1)):this.resolveAppPath(c)),framework:{eager:o?(l.framework?.eager||[]).map(c=>this.resolveRepoPath(c)).filter(Boolean):await Promise.all((l.framework?.eager||[]).map(c=>this._resolveFrameworkI18nPattern(c))).then(c=>c.filter(Boolean)),lazy:o?(l.framework?.lazy||[]).map(c=>this.resolveRepoPath(c)).filter(Boolean):await Promise.all((l.framework?.lazy||[]).map(c=>this._resolveFrameworkI18nPattern(c))).then(c=>c.filter(Boolean))},all:[]};return h.all=[...h.eager,...h.lazy,...h.framework.eager,...h.framework.lazy],h}let s=i,a={framework:o?(s.framework||[]).map(l=>this.resolveRepoPath(l)).filter(Boolean):[],consumer:(s.consumer||[]).map(l=>this.resolveAppPath(l)),all:[]};return a.all=[...a.consumer,...a.framework],a}getEmptyModulePath(e=!1){if(e)return"@donotdev/core/empty";let t=this.resolvePackage("@donotdev/core/empty");if(t)return t;let r=E(ke(import.meta.url));return this.normalizePath(x(r,"../empty.js"))}_findRepoRoot(e){let t=this.normalizePath(e),r=0,i=this.options.maxLevels;for(;r<i;){let o=this.normalizePath(x(t,re.TOOLING)),s=this.normalizePath(x(t,re.CORE));if(this.pathExists(o)&&this.pathExists(s))return t;let a=x(t,"apps");if(this.pathExists(a)&&this.statSync(a)?.isDirectory())return this.normalizePath(t);let l=this.normalizePath(x(t,"package.json"));if(this.pathExists(l)&&this.normalizePath(E(t))===t)return t;let h=this.normalizePath(E(t));if(h===t)break;t=h,r++}return this.normalizePath(e)}};function se(n={}){let{entry:e="src/index.ts",outDir:t="lib",minify:r=!1,sourcemap:i=!0,platform:o="firebase",workspace:s,bundleWorkspaceDeps:a=!1,importFramework:l=!1,external:h=!1,...c}=n,f=M.getInstance(),m=Q(s),d={entryPoints:[e],bundle:!0,platform:"node",target:"node20",format:"esm",outdir:t,outExtension:{".js":".js"},minify:r,sourcemap:i,metafile:!0,logLevel:"info",loader:{".ts":"ts",".tsx":"tsx",".css":"empty"},keepNames:!0,treeShaking:!0,...c};a&&Object.keys(m).length>0&&(d.alias=Object.fromEntries(Object.entries(m).map(([k,u])=>[k,f.normalizePath(u)]))),d.mainFields=["module","main"],d.conditions=["import","module","node"];let ce=["fs","path","crypto","util","stream","events","buffer","url","querystring","http","https","zlib","os","child_process","assert","constants","domain","punycode","string_decoder","timers","tty","vm","worker_threads","perf_hooks","async_hooks"],G=[];if(a)try{let k=s?.root||y.cwd(),u=y.cwd(),v=10;for(let S=0;S<v;S++){let H=f.normalizePath(`${u}/package.json`);if(f.pathExists(H)){let z=f.readSync(H,{format:"json"});if(z&&Array.isArray(z.workspaces)){k=f.normalizePath(u);for(let $ of z.workspaces)$==="apps/*"||$==="functions"||!$.includes("*")&&!$.includes("/")&&G.push($);break}}let L=f.getDirname(u);if(L===u)break;u=L}}catch{}let le={name:"external-node-modules",setup(k){k.onResolve({filter:/^firebase($|\/)/},u=>{if(u.path==="firebase-admin"||u.path.startsWith("firebase-admin/")||u.path==="firebase-functions"||u.path.startsWith("firebase-functions/"))return null;let v;if(s?.type==="dndev"&&s.root)v=f.normalizePath(`${s.root}/packages/core/config/functions/firebase-stub.js`);else{let S=import.meta.url,L=new URL(S).pathname.replace(/^\/([A-Z]:)/i,"$1"),z=f.getDirname(L);v=f.normalizePath(`${z}/firebase-stub.js`)}return{path:v}}),k.onResolve({filter:/.*/},u=>{if(u.kind==="entry-point")return null;if(u.path.match(/@donotdev\/functions\/.+/)&&a&&s?.type==="dndev"){let v=u.path.replace("@donotdev/functions/","");return{path:f.normalizePath(`${s.root}/packages/functions/src/${v}/index.ts`)}}if(u.path==="@donotdev/utils")return s?.type==="dndev"?{path:f.normalizePath(`${s.root}/packages/core/utils/src/server/index.ts`)}:k.resolve("@donotdev/utils/server",{kind:u.kind,resolveDir:u.resolveDir});if(u.path.match(/@donotdev\/utils\/.+/)&&s?.type==="dndev"){let v=u.path.replace("@donotdev/utils/","");return{path:f.normalizePath(`${s.root}/packages/core/utils/src/${v}/index.ts`)}}if(u.path==="@donotdev/core")return s?.type==="dndev"?{path:f.normalizePath(`${s.root}/packages/core/server.ts`)}:k.resolve("@donotdev/core/server",{kind:u.kind,resolveDir:u.resolveDir});if(u.path.match(/@donotdev\/core\/.+/)&&a&&s?.type==="dndev"){let v=u.path.replace("@donotdev/core/","");return{path:f.normalizePath(`${s.root}/packages/core/${v}.ts`)}}if(u.path==="firebase-admin"||u.path.startsWith("firebase-admin/")||u.path==="firebase-functions"||u.path.startsWith("firebase-functions/"))return{path:u.path,external:!0};if(u.path.match(/@donotdev\/core\/.+/)&&a&&s?.type==="dndev"){let v=u.path.replace("@donotdev/core/","");return{path:f.normalizePath(`${s.root}/packages/core/${v}.ts`)}}if(u.path.startsWith("@donotdev/")||u.path==="valibot"||u.path.startsWith("valibot/"))return null;if(G.length>0){let v=u.path.split("/")[0];if(G.includes(v))return null}return u.path.startsWith(".")||u.path.startsWith("/")?null:{path:u.path,external:!0}})}};if(d.external=[...ce,"firebase-admin","firebase-functions"],d.plugins=[le,...d.plugins||[]],d.define={"process.env.NODE_ENV":JSON.stringify(y.env.NODE_ENV||"production"),...d.define||{}},l&&s.type==="dndev"){let k=s.root,u=f.normalizePath(`${k}/functions/lib`);d.alias={...d.alias,"@donotdev/functions":u}}return o==="framework"&&(d.entryPoints={"firebase/index":"src/firebase/index.ts","vercel/api/index":"src/vercel/api/index.ts","shared/index":"src/shared/index.ts"}),d}P();var oe=["create","get","list","listCard","update","delete"];function ne(n,e=0){let t=" ".repeat(e),r="";for(let[i,o]of Object.entries(n))if(o!=null)if(typeof o=="object"&&!Array.isArray(o))Object.keys(o).length===0?r+=`${t}${i}: {}
|
|
2
2
|
`:r+=`${t}${i}:
|
|
3
3
|
${ne(o,e+1)}`;else if(Array.isArray(o))if(o.length===0)r+=`${t}${i}: []
|
|
4
4
|
`;else{r+=`${t}${i}:
|
package/index.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import * as v from 'valibot';
|
|
2
2
|
import * as React$1 from 'react';
|
|
3
|
-
import { ReactNode,
|
|
3
|
+
import { ReactNode, ReactElement, ComponentType } from 'react';
|
|
4
4
|
export { ReactNode } from 'react';
|
|
5
5
|
import * as zustand from 'zustand';
|
|
6
6
|
import { UseBoundStore, StoreApi as StoreApi$1 } from 'zustand';
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@donotdev/core",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.17",
|
|
4
4
|
"private": false,
|
|
5
5
|
"type": "module",
|
|
6
6
|
"license": "SEE LICENSE IN LICENSE.md",
|
|
@@ -33,11 +33,6 @@
|
|
|
33
33
|
"import": "./functions/index.js",
|
|
34
34
|
"default": "./functions/index.js"
|
|
35
35
|
},
|
|
36
|
-
"./eslint": {
|
|
37
|
-
"types": "./eslint/index.d.ts",
|
|
38
|
-
"import": "./eslint/index.js",
|
|
39
|
-
"default": "./eslint/index.js"
|
|
40
|
-
},
|
|
41
36
|
"./empty": {
|
|
42
37
|
"import": "./empty.js",
|
|
43
38
|
"default": "./empty.js"
|
|
@@ -52,12 +47,11 @@
|
|
|
52
47
|
"vite",
|
|
53
48
|
"next",
|
|
54
49
|
"functions",
|
|
55
|
-
"eslint",
|
|
56
50
|
"i18n/locales"
|
|
57
51
|
],
|
|
58
52
|
"sideEffects": false,
|
|
59
53
|
"peerDependencies": {
|
|
60
|
-
"@donotdev/components": "^0.0.
|
|
54
|
+
"@donotdev/components": "^0.0.13",
|
|
61
55
|
"@sentry/react": "^10.33.0",
|
|
62
56
|
"lucide-react": "^0.562.0",
|
|
63
57
|
"react": "^19.2.3",
|