@better-t-stack/template-generator 3.13.2-dev.6c6cffb

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.
Files changed (425) hide show
  1. package/dist/fs-writer.d.mts +8 -0
  2. package/dist/fs-writer.d.mts.map +1 -0
  3. package/dist/fs-writer.mjs +50 -0
  4. package/dist/fs-writer.mjs.map +1 -0
  5. package/dist/index.d.mts +182 -0
  6. package/dist/index.d.mts.map +1 -0
  7. package/dist/index.mjs +26727 -0
  8. package/dist/index.mjs.map +1 -0
  9. package/dist/template-reader.d.mts +30 -0
  10. package/dist/template-reader.d.mts.map +1 -0
  11. package/dist/template-reader.mjs +2860 -0
  12. package/dist/template-reader.mjs.map +1 -0
  13. package/dist/types-BubFnV2d.d.mts +36 -0
  14. package/dist/types-BubFnV2d.d.mts.map +1 -0
  15. package/package.json +66 -0
  16. package/scripts/generate-templates.ts +97 -0
  17. package/templates/addons/biome/biome.json.hbs +96 -0
  18. package/templates/addons/husky/.husky/pre-commit +1 -0
  19. package/templates/addons/pwa/apps/web/next/public/favicon/apple-touch-icon.png +0 -0
  20. package/templates/addons/pwa/apps/web/next/public/favicon/favicon-96x96.png +0 -0
  21. package/templates/addons/pwa/apps/web/next/public/favicon/favicon.svg +6 -0
  22. package/templates/addons/pwa/apps/web/next/public/favicon/site.webmanifest.hbs +21 -0
  23. package/templates/addons/pwa/apps/web/next/public/favicon/web-app-manifest-192x192.png +0 -0
  24. package/templates/addons/pwa/apps/web/next/public/favicon/web-app-manifest-512x512.png +0 -0
  25. package/templates/addons/pwa/apps/web/next/src/app/manifest.ts.hbs +26 -0
  26. package/templates/addons/pwa/apps/web/vite/public/logo.png +0 -0
  27. package/templates/addons/pwa/apps/web/vite/pwa-assets.config.ts.hbs +12 -0
  28. package/templates/addons/ruler/.ruler/bts.md.hbs +142 -0
  29. package/templates/addons/ruler/.ruler/ruler.toml.hbs +80 -0
  30. package/templates/addons/turborepo/turbo.json.hbs +74 -0
  31. package/templates/addons/ultracite/biome.json.hbs +26 -0
  32. package/templates/api/orpc/fullstack/next/src/app/api/rpc/[[...rest]]/route.ts.hbs +50 -0
  33. package/templates/api/orpc/fullstack/tanstack-start/src/routes/api/rpc/$.ts.hbs +58 -0
  34. package/templates/api/orpc/native/utils/orpc.ts.hbs +39 -0
  35. package/templates/api/orpc/server/_gitignore +34 -0
  36. package/templates/api/orpc/server/package.json.hbs +15 -0
  37. package/templates/api/orpc/server/src/context.ts.hbs +148 -0
  38. package/templates/api/orpc/server/src/index.ts.hbs +21 -0
  39. package/templates/api/orpc/server/src/routers/index.ts.hbs +55 -0
  40. package/templates/api/orpc/server/tsconfig.json.hbs +10 -0
  41. package/templates/api/orpc/web/nuxt/app/plugins/orpc.ts.hbs +32 -0
  42. package/templates/api/orpc/web/nuxt/app/plugins/vue-query.ts.hbs +44 -0
  43. package/templates/api/orpc/web/react/base/src/utils/orpc.ts.hbs +113 -0
  44. package/templates/api/orpc/web/solid/src/utils/orpc.ts.hbs +30 -0
  45. package/templates/api/orpc/web/svelte/src/lib/orpc.ts.hbs +30 -0
  46. package/templates/api/trpc/fullstack/next/src/app/api/trpc/[trpc]/route.ts.hbs +14 -0
  47. package/templates/api/trpc/fullstack/tanstack-start/src/routes/api/trpc/$.ts.hbs +22 -0
  48. package/templates/api/trpc/native/utils/trpc.ts.hbs +37 -0
  49. package/templates/api/trpc/server/_gitignore +34 -0
  50. package/templates/api/trpc/server/package.json.hbs +14 -0
  51. package/templates/api/trpc/server/src/context.ts.hbs +148 -0
  52. package/templates/api/trpc/server/src/index.ts.hbs +26 -0
  53. package/templates/api/trpc/server/src/routers/index.ts.hbs +55 -0
  54. package/templates/api/trpc/server/tsconfig.json.hbs +10 -0
  55. package/templates/api/trpc/web/react/base/src/utils/trpc.ts.hbs +97 -0
  56. package/templates/auth/better-auth/convex/backend/convex/auth.config.ts.hbs +6 -0
  57. package/templates/auth/better-auth/convex/backend/convex/auth.ts.hbs +68 -0
  58. package/templates/auth/better-auth/convex/backend/convex/http.ts.hbs +12 -0
  59. package/templates/auth/better-auth/convex/backend/convex/privateData.ts.hbs +17 -0
  60. package/templates/auth/better-auth/convex/native/bare/components/sign-in.tsx.hbs +127 -0
  61. package/templates/auth/better-auth/convex/native/bare/components/sign-up.tsx.hbs +138 -0
  62. package/templates/auth/better-auth/convex/native/base/lib/auth-client.ts.hbs +18 -0
  63. package/templates/auth/better-auth/convex/native/unistyles/components/sign-in.tsx.hbs +127 -0
  64. package/templates/auth/better-auth/convex/native/unistyles/components/sign-up.tsx.hbs +145 -0
  65. package/templates/auth/better-auth/convex/native/uniwind/components/sign-in.tsx.hbs +73 -0
  66. package/templates/auth/better-auth/convex/native/uniwind/components/sign-up.tsx.hbs +85 -0
  67. package/templates/auth/better-auth/convex/web/react/next/src/app/api/auth/[...all]/route.ts.hbs +3 -0
  68. package/templates/auth/better-auth/convex/web/react/next/src/app/dashboard/page.tsx.hbs +40 -0
  69. package/templates/auth/better-auth/convex/web/react/next/src/components/sign-in-form.tsx.hbs +129 -0
  70. package/templates/auth/better-auth/convex/web/react/next/src/components/sign-up-form.tsx.hbs +154 -0
  71. package/templates/auth/better-auth/convex/web/react/next/src/components/user-menu.tsx.hbs +48 -0
  72. package/templates/auth/better-auth/convex/web/react/next/src/lib/auth-client.ts.hbs +6 -0
  73. package/templates/auth/better-auth/convex/web/react/next/src/lib/auth-server.ts.hbs +16 -0
  74. package/templates/auth/better-auth/convex/web/react/tanstack-router/src/components/sign-in-form.tsx.hbs +133 -0
  75. package/templates/auth/better-auth/convex/web/react/tanstack-router/src/components/sign-up-form.tsx.hbs +158 -0
  76. package/templates/auth/better-auth/convex/web/react/tanstack-router/src/components/user-menu.tsx.hbs +52 -0
  77. package/templates/auth/better-auth/convex/web/react/tanstack-router/src/lib/auth-client.ts.hbs +11 -0
  78. package/templates/auth/better-auth/convex/web/react/tanstack-router/src/routes/dashboard.tsx.hbs +43 -0
  79. package/templates/auth/better-auth/convex/web/react/tanstack-start/src/components/sign-in-form.tsx.hbs +133 -0
  80. package/templates/auth/better-auth/convex/web/react/tanstack-start/src/components/sign-up-form.tsx.hbs +158 -0
  81. package/templates/auth/better-auth/convex/web/react/tanstack-start/src/components/user-menu.tsx.hbs +47 -0
  82. package/templates/auth/better-auth/convex/web/react/tanstack-start/src/lib/auth-client.ts.hbs +6 -0
  83. package/templates/auth/better-auth/convex/web/react/tanstack-start/src/lib/auth-server.ts.hbs +13 -0
  84. package/templates/auth/better-auth/convex/web/react/tanstack-start/src/routes/api/auth/$.ts.hbs +11 -0
  85. package/templates/auth/better-auth/convex/web/react/tanstack-start/src/routes/dashboard.tsx.hbs +43 -0
  86. package/templates/auth/better-auth/fullstack/next/src/app/api/auth/[...all]/route.ts.hbs +4 -0
  87. package/templates/auth/better-auth/fullstack/tanstack-start/src/routes/api/auth/$.ts.hbs +15 -0
  88. package/templates/auth/better-auth/native/bare/app/(drawer)/index.tsx.hbs +186 -0
  89. package/templates/auth/better-auth/native/bare/components/sign-in.tsx.hbs +131 -0
  90. package/templates/auth/better-auth/native/bare/components/sign-up.tsx.hbs +150 -0
  91. package/templates/auth/better-auth/native/base/lib/auth-client.ts.hbs +16 -0
  92. package/templates/auth/better-auth/native/unistyles/app/(drawer)/index.tsx.hbs +187 -0
  93. package/templates/auth/better-auth/native/unistyles/components/sign-in.tsx.hbs +139 -0
  94. package/templates/auth/better-auth/native/unistyles/components/sign-up.tsx.hbs +157 -0
  95. package/templates/auth/better-auth/native/uniwind/app/(drawer)/index.tsx.hbs +123 -0
  96. package/templates/auth/better-auth/native/uniwind/components/sign-in.tsx.hbs +87 -0
  97. package/templates/auth/better-auth/native/uniwind/components/sign-up.tsx.hbs +128 -0
  98. package/templates/auth/better-auth/server/base/_gitignore +34 -0
  99. package/templates/auth/better-auth/server/base/package.json.hbs +14 -0
  100. package/templates/auth/better-auth/server/base/src/index.ts.hbs +304 -0
  101. package/templates/auth/better-auth/server/base/tsconfig.json.hbs +10 -0
  102. package/templates/auth/better-auth/server/db/drizzle/mysql/src/schema/auth.ts.hbs +100 -0
  103. package/templates/auth/better-auth/server/db/drizzle/postgres/src/schema/auth.ts.hbs +93 -0
  104. package/templates/auth/better-auth/server/db/drizzle/sqlite/src/schema/auth.ts.hbs +107 -0
  105. package/templates/auth/better-auth/server/db/mongoose/mongodb/src/models/auth.model.ts.hbs +68 -0
  106. package/templates/auth/better-auth/server/db/prisma/mongodb/prisma/schema/auth.prisma.hbs +62 -0
  107. package/templates/auth/better-auth/server/db/prisma/mysql/prisma/schema/auth.prisma.hbs +62 -0
  108. package/templates/auth/better-auth/server/db/prisma/postgres/prisma/schema/auth.prisma.hbs +62 -0
  109. package/templates/auth/better-auth/server/db/prisma/sqlite/prisma/schema/auth.prisma.hbs +62 -0
  110. package/templates/auth/better-auth/web/nuxt/app/components/SignInForm.vue.hbs +82 -0
  111. package/templates/auth/better-auth/web/nuxt/app/components/SignUpForm.vue.hbs +91 -0
  112. package/templates/auth/better-auth/web/nuxt/app/components/UserMenu.vue.hbs +42 -0
  113. package/templates/auth/better-auth/web/nuxt/app/middleware/auth.ts.hbs +14 -0
  114. package/templates/auth/better-auth/web/nuxt/app/pages/dashboard.vue.hbs +99 -0
  115. package/templates/auth/better-auth/web/nuxt/app/pages/login.vue.hbs +27 -0
  116. package/templates/auth/better-auth/web/nuxt/app/plugins/auth-client.ts.hbs +21 -0
  117. package/templates/auth/better-auth/web/react/base/src/lib/auth-client.ts.hbs +16 -0
  118. package/templates/auth/better-auth/web/react/next/src/app/dashboard/dashboard.tsx.hbs +60 -0
  119. package/templates/auth/better-auth/web/react/next/src/app/dashboard/page.tsx.hbs +42 -0
  120. package/templates/auth/better-auth/web/react/next/src/app/login/page.tsx.hbs +16 -0
  121. package/templates/auth/better-auth/web/react/next/src/components/sign-in-form.tsx.hbs +135 -0
  122. package/templates/auth/better-auth/web/react/next/src/components/sign-up-form.tsx.hbs +160 -0
  123. package/templates/auth/better-auth/web/react/next/src/components/user-menu.tsx.hbs +62 -0
  124. package/templates/auth/better-auth/web/react/react-router/src/components/sign-in-form.tsx.hbs +135 -0
  125. package/templates/auth/better-auth/web/react/react-router/src/components/sign-up-form.tsx.hbs +160 -0
  126. package/templates/auth/better-auth/web/react/react-router/src/components/user-menu.tsx.hbs +61 -0
  127. package/templates/auth/better-auth/web/react/react-router/src/routes/dashboard.tsx.hbs +80 -0
  128. package/templates/auth/better-auth/web/react/react-router/src/routes/login.tsx.hbs +13 -0
  129. package/templates/auth/better-auth/web/react/tanstack-router/src/components/sign-in-form.tsx.hbs +135 -0
  130. package/templates/auth/better-auth/web/react/tanstack-router/src/components/sign-up-form.tsx.hbs +160 -0
  131. package/templates/auth/better-auth/web/react/tanstack-router/src/components/user-menu.tsx.hbs +63 -0
  132. package/templates/auth/better-auth/web/react/tanstack-router/src/routes/dashboard.tsx.hbs +71 -0
  133. package/templates/auth/better-auth/web/react/tanstack-router/src/routes/login.tsx.hbs +18 -0
  134. package/templates/auth/better-auth/web/react/tanstack-start/src/components/sign-in-form.tsx.hbs +135 -0
  135. package/templates/auth/better-auth/web/react/tanstack-start/src/components/sign-up-form.tsx.hbs +160 -0
  136. package/templates/auth/better-auth/web/react/tanstack-start/src/components/user-menu.tsx.hbs +63 -0
  137. package/templates/auth/better-auth/web/react/tanstack-start/src/functions/get-user.ts.hbs +6 -0
  138. package/templates/auth/better-auth/web/react/tanstack-start/src/middleware/auth.ts.hbs +31 -0
  139. package/templates/auth/better-auth/web/react/tanstack-start/src/routes/dashboard.tsx.hbs +84 -0
  140. package/templates/auth/better-auth/web/react/tanstack-start/src/routes/login.tsx.hbs +18 -0
  141. package/templates/auth/better-auth/web/solid/src/components/sign-in-form.tsx.hbs +124 -0
  142. package/templates/auth/better-auth/web/solid/src/components/sign-up-form.tsx.hbs +148 -0
  143. package/templates/auth/better-auth/web/solid/src/components/user-menu.tsx.hbs +55 -0
  144. package/templates/auth/better-auth/web/solid/src/lib/auth-client.ts.hbs +12 -0
  145. package/templates/auth/better-auth/web/solid/src/routes/dashboard.tsx.hbs +67 -0
  146. package/templates/auth/better-auth/web/solid/src/routes/login.tsx.hbs +23 -0
  147. package/templates/auth/better-auth/web/svelte/src/components/SignInForm.svelte.hbs +109 -0
  148. package/templates/auth/better-auth/web/svelte/src/components/SignUpForm.svelte.hbs +142 -0
  149. package/templates/auth/better-auth/web/svelte/src/components/UserMenu.svelte.hbs +52 -0
  150. package/templates/auth/better-auth/web/svelte/src/lib/auth-client.ts.hbs +12 -0
  151. package/templates/auth/better-auth/web/svelte/src/routes/dashboard/+page.svelte.hbs +59 -0
  152. package/templates/auth/better-auth/web/svelte/src/routes/login/+page.svelte.hbs +12 -0
  153. package/templates/auth/clerk/convex/backend/convex/auth.config.ts.hbs +12 -0
  154. package/templates/auth/clerk/convex/backend/convex/privateData.ts.hbs +16 -0
  155. package/templates/auth/clerk/convex/native/base/app/(auth)/_layout.tsx.hbs +12 -0
  156. package/templates/auth/clerk/convex/native/base/app/(auth)/sign-in.tsx.hbs +67 -0
  157. package/templates/auth/clerk/convex/native/base/app/(auth)/sign-up.tsx.hbs +110 -0
  158. package/templates/auth/clerk/convex/native/base/components/sign-out-button.tsx.hbs +27 -0
  159. package/templates/auth/clerk/convex/web/react/next/src/app/dashboard/page.tsx.hbs +29 -0
  160. package/templates/auth/clerk/convex/web/react/next/src/middleware.ts.hbs +12 -0
  161. package/templates/auth/clerk/convex/web/react/react-router/src/routes/dashboard.tsx.hbs +32 -0
  162. package/templates/auth/clerk/convex/web/react/tanstack-router/src/routes/dashboard.tsx.hbs +37 -0
  163. package/templates/auth/clerk/convex/web/react/tanstack-start/src/routes/dashboard.tsx.hbs +37 -0
  164. package/templates/auth/clerk/convex/web/react/tanstack-start/src/start.ts.hbs +8 -0
  165. package/templates/backend/convex/packages/backend/_gitignore +2 -0
  166. package/templates/backend/convex/packages/backend/convex/README.md +90 -0
  167. package/templates/backend/convex/packages/backend/convex/convex.config.ts.hbs +17 -0
  168. package/templates/backend/convex/packages/backend/convex/healthCheck.ts.hbs +7 -0
  169. package/templates/backend/convex/packages/backend/convex/schema.ts.hbs +11 -0
  170. package/templates/backend/convex/packages/backend/convex/tsconfig.json.hbs +25 -0
  171. package/templates/backend/convex/packages/backend/package.json.hbs +15 -0
  172. package/templates/backend/server/base/_gitignore +55 -0
  173. package/templates/backend/server/base/package.json.hbs +17 -0
  174. package/templates/backend/server/base/tsconfig.json.hbs +13 -0
  175. package/templates/backend/server/base/tsdown.config.ts.hbs +9 -0
  176. package/templates/backend/server/elysia/src/index.ts.hbs +122 -0
  177. package/templates/backend/server/express/src/index.ts.hbs +126 -0
  178. package/templates/backend/server/fastify/src/index.ts.hbs +187 -0
  179. package/templates/backend/server/hono/src/index.ts.hbs +171 -0
  180. package/templates/base/_gitignore +50 -0
  181. package/templates/base/package.json.hbs +10 -0
  182. package/templates/base/tsconfig.json.hbs +3 -0
  183. package/templates/db/base/_gitignore +35 -0
  184. package/templates/db/base/package.json.hbs +14 -0
  185. package/templates/db/base/tsconfig.json.hbs +10 -0
  186. package/templates/db/drizzle/base/src/schema/index.ts.hbs +7 -0
  187. package/templates/db/drizzle/mysql/drizzle.config.ts.hbs +19 -0
  188. package/templates/db/drizzle/mysql/src/index.ts.hbs +54 -0
  189. package/templates/db/drizzle/postgres/drizzle.config.ts.hbs +19 -0
  190. package/templates/db/drizzle/postgres/src/index.ts.hbs +44 -0
  191. package/templates/db/drizzle/sqlite/drizzle.config.ts.hbs +28 -0
  192. package/templates/db/drizzle/sqlite/src/index.ts.hbs +39 -0
  193. package/templates/db/mongoose/mongodb/src/index.ts.hbs +10 -0
  194. package/templates/db/prisma/mongodb/prisma/schema/schema.prisma.hbs +19 -0
  195. package/templates/db/prisma/mongodb/prisma.config.ts.hbs +18 -0
  196. package/templates/db/prisma/mongodb/src/index.ts.hbs +5 -0
  197. package/templates/db/prisma/mysql/prisma/schema/schema.prisma.hbs +21 -0
  198. package/templates/db/prisma/mysql/prisma.config.ts.hbs +21 -0
  199. package/templates/db/prisma/mysql/src/index.ts.hbs +55 -0
  200. package/templates/db/prisma/postgres/prisma/schema/schema.prisma.hbs +21 -0
  201. package/templates/db/prisma/postgres/prisma.config.ts.hbs +21 -0
  202. package/templates/db/prisma/postgres/src/index.ts.hbs +69 -0
  203. package/templates/db/prisma/sqlite/prisma/schema/schema.prisma.hbs +18 -0
  204. package/templates/db/prisma/sqlite/prisma.config.ts.hbs +25 -0
  205. package/templates/db/prisma/sqlite/src/index.ts.hbs +25 -0
  206. package/templates/db-setup/docker-compose/mongodb/docker-compose.yml.hbs +23 -0
  207. package/templates/db-setup/docker-compose/mysql/docker-compose.yml.hbs +24 -0
  208. package/templates/db-setup/docker-compose/postgres/docker-compose.yml.hbs +23 -0
  209. package/templates/examples/ai/convex/packages/backend/convex/agent.ts.hbs +9 -0
  210. package/templates/examples/ai/convex/packages/backend/convex/chat.ts.hbs +67 -0
  211. package/templates/examples/ai/fullstack/next/src/app/api/ai/route.ts.hbs +20 -0
  212. package/templates/examples/ai/fullstack/tanstack-start/src/routes/api/ai/$.ts.hbs +36 -0
  213. package/templates/examples/ai/native/bare/app/(drawer)/ai.tsx.hbs +586 -0
  214. package/templates/examples/ai/native/bare/polyfills.js +22 -0
  215. package/templates/examples/ai/native/unistyles/app/(drawer)/ai.tsx.hbs +588 -0
  216. package/templates/examples/ai/native/unistyles/polyfills.js +22 -0
  217. package/templates/examples/ai/native/uniwind/app/(drawer)/ai.tsx.hbs +331 -0
  218. package/templates/examples/ai/native/uniwind/polyfills.js +22 -0
  219. package/templates/examples/ai/web/nuxt/app/pages/ai.vue.hbs +54 -0
  220. package/templates/examples/ai/web/react/next/src/app/ai/page.tsx.hbs +267 -0
  221. package/templates/examples/ai/web/react/react-router/src/routes/ai.tsx.hbs +235 -0
  222. package/templates/examples/ai/web/react/tanstack-router/src/routes/ai.tsx.hbs +242 -0
  223. package/templates/examples/ai/web/react/tanstack-start/src/routes/ai.tsx.hbs +243 -0
  224. package/templates/examples/ai/web/svelte/src/routes/ai/+page.svelte.hbs +107 -0
  225. package/templates/examples/todo/convex/packages/backend/convex/todos.ts.hbs +42 -0
  226. package/templates/examples/todo/native/bare/app/(drawer)/todos.tsx.hbs +521 -0
  227. package/templates/examples/todo/native/unistyles/app/(drawer)/todos.tsx.hbs +340 -0
  228. package/templates/examples/todo/native/uniwind/app/(drawer)/todos.tsx.hbs +282 -0
  229. package/templates/examples/todo/server/drizzle/base/src/routers/todo.ts.hbs +75 -0
  230. package/templates/examples/todo/server/drizzle/mysql/src/schema/todo.ts +7 -0
  231. package/templates/examples/todo/server/drizzle/postgres/src/schema/todo.ts +7 -0
  232. package/templates/examples/todo/server/drizzle/sqlite/src/schema/todo.ts +7 -0
  233. package/templates/examples/todo/server/mongoose/base/src/routers/todo.ts.hbs +66 -0
  234. package/templates/examples/todo/server/mongoose/mongodb/src/models/todo.model.ts.hbs +24 -0
  235. package/templates/examples/todo/server/prisma/base/src/routers/todo.ts.hbs +116 -0
  236. package/templates/examples/todo/server/prisma/mongodb/prisma/schema/todo.prisma.hbs +7 -0
  237. package/templates/examples/todo/server/prisma/mysql/prisma/schema/todo.prisma.hbs +7 -0
  238. package/templates/examples/todo/server/prisma/postgres/prisma/schema/todo.prisma.hbs +7 -0
  239. package/templates/examples/todo/server/prisma/sqlite/prisma/schema/todo.prisma.hbs +7 -0
  240. package/templates/examples/todo/web/nuxt/app/pages/todos.vue.hbs +220 -0
  241. package/templates/examples/todo/web/react/next/src/app/todos/page.tsx.hbs +245 -0
  242. package/templates/examples/todo/web/react/react-router/src/routes/todos.tsx.hbs +242 -0
  243. package/templates/examples/todo/web/react/tanstack-router/src/routes/todos.tsx.hbs +247 -0
  244. package/templates/examples/todo/web/react/tanstack-start/src/routes/todos.tsx.hbs +272 -0
  245. package/templates/examples/todo/web/solid/src/routes/todos.tsx.hbs +132 -0
  246. package/templates/examples/todo/web/svelte/src/routes/todos/+page.svelte.hbs +317 -0
  247. package/templates/extras/_npmrc.hbs +5 -0
  248. package/templates/extras/bunfig.toml.hbs +6 -0
  249. package/templates/extras/pnpm-workspace.yaml +3 -0
  250. package/templates/frontend/native/bare/_gitignore +18 -0
  251. package/templates/frontend/native/bare/app/(drawer)/(tabs)/_layout.tsx.hbs +41 -0
  252. package/templates/frontend/native/bare/app/(drawer)/(tabs)/index.tsx.hbs +43 -0
  253. package/templates/frontend/native/bare/app/(drawer)/(tabs)/two.tsx.hbs +43 -0
  254. package/templates/frontend/native/bare/app/(drawer)/_layout.tsx.hbs +90 -0
  255. package/templates/frontend/native/bare/app/(drawer)/index.tsx.hbs +234 -0
  256. package/templates/frontend/native/bare/app/+not-found.tsx.hbs +65 -0
  257. package/templates/frontend/native/bare/app/_layout.tsx.hbs +165 -0
  258. package/templates/frontend/native/bare/app/modal.tsx.hbs +34 -0
  259. package/templates/frontend/native/bare/app.json.hbs +50 -0
  260. package/templates/frontend/native/bare/components/container.tsx.hbs +25 -0
  261. package/templates/frontend/native/bare/components/header-button.tsx.hbs +47 -0
  262. package/templates/frontend/native/bare/components/tabbar-icon.tsx.hbs +9 -0
  263. package/templates/frontend/native/bare/lib/android-navigation-bar.tsx.hbs +12 -0
  264. package/templates/frontend/native/bare/lib/constants.ts.hbs +19 -0
  265. package/templates/frontend/native/bare/lib/use-color-scheme.ts.hbs +20 -0
  266. package/templates/frontend/native/bare/metro.config.js.hbs +9 -0
  267. package/templates/frontend/native/bare/package.json.hbs +51 -0
  268. package/templates/frontend/native/bare/tsconfig.json.hbs +11 -0
  269. package/templates/frontend/native/base/assets/images/android-icon-background.png +0 -0
  270. package/templates/frontend/native/base/assets/images/android-icon-foreground.png +0 -0
  271. package/templates/frontend/native/base/assets/images/android-icon-monochrome.png +0 -0
  272. package/templates/frontend/native/base/assets/images/favicon.png +0 -0
  273. package/templates/frontend/native/base/assets/images/icon.png +0 -0
  274. package/templates/frontend/native/base/assets/images/partial-react-logo.png +0 -0
  275. package/templates/frontend/native/base/assets/images/react-logo.png +0 -0
  276. package/templates/frontend/native/base/assets/images/react-logo@2x.png +0 -0
  277. package/templates/frontend/native/base/assets/images/react-logo@3x.png +0 -0
  278. package/templates/frontend/native/base/assets/images/splash-icon.png +0 -0
  279. package/templates/frontend/native/unistyles/_gitignore +24 -0
  280. package/templates/frontend/native/unistyles/app/(drawer)/(tabs)/_layout.tsx.hbs +39 -0
  281. package/templates/frontend/native/unistyles/app/(drawer)/(tabs)/index.tsx.hbs +37 -0
  282. package/templates/frontend/native/unistyles/app/(drawer)/(tabs)/two.tsx.hbs +37 -0
  283. package/templates/frontend/native/unistyles/app/(drawer)/_layout.tsx.hbs +87 -0
  284. package/templates/frontend/native/unistyles/app/(drawer)/index.tsx.hbs +333 -0
  285. package/templates/frontend/native/unistyles/app/+not-found.tsx.hbs +65 -0
  286. package/templates/frontend/native/unistyles/app/_layout.tsx.hbs +169 -0
  287. package/templates/frontend/native/unistyles/app/modal.tsx.hbs +33 -0
  288. package/templates/frontend/native/unistyles/app.json.hbs +49 -0
  289. package/templates/frontend/native/unistyles/babel.config.js.hbs +21 -0
  290. package/templates/frontend/native/unistyles/breakpoints.ts.hbs +9 -0
  291. package/templates/frontend/native/unistyles/components/container.tsx.hbs +15 -0
  292. package/templates/frontend/native/unistyles/components/header-button.tsx.hbs +36 -0
  293. package/templates/frontend/native/unistyles/components/tabbar-icon.tsx.hbs +8 -0
  294. package/templates/frontend/native/unistyles/index.js.hbs +2 -0
  295. package/templates/frontend/native/unistyles/metro.config.js.hbs +5 -0
  296. package/templates/frontend/native/unistyles/package.json.hbs +51 -0
  297. package/templates/frontend/native/unistyles/theme.ts.hbs +98 -0
  298. package/templates/frontend/native/unistyles/tsconfig.json.hbs +12 -0
  299. package/templates/frontend/native/unistyles/unistyles.ts.hbs +27 -0
  300. package/templates/frontend/native/uniwind/_gitignore +21 -0
  301. package/templates/frontend/native/uniwind/app/(drawer)/(tabs)/_layout.tsx.hbs +46 -0
  302. package/templates/frontend/native/uniwind/app/(drawer)/(tabs)/index.tsx.hbs +15 -0
  303. package/templates/frontend/native/uniwind/app/(drawer)/(tabs)/two.tsx.hbs +15 -0
  304. package/templates/frontend/native/uniwind/app/(drawer)/_layout.tsx.hbs +91 -0
  305. package/templates/frontend/native/uniwind/app/(drawer)/index.tsx.hbs +191 -0
  306. package/templates/frontend/native/uniwind/app/+not-found.tsx.hbs +27 -0
  307. package/templates/frontend/native/uniwind/app/_layout.tsx.hbs +132 -0
  308. package/templates/frontend/native/uniwind/app/modal.tsx.hbs +37 -0
  309. package/templates/frontend/native/uniwind/app.json.hbs +19 -0
  310. package/templates/frontend/native/uniwind/components/container.tsx.hbs +33 -0
  311. package/templates/frontend/native/uniwind/components/theme-toggle.tsx.hbs +35 -0
  312. package/templates/frontend/native/uniwind/contexts/app-theme-context.tsx.hbs +62 -0
  313. package/templates/frontend/native/uniwind/global.css +5 -0
  314. package/templates/frontend/native/uniwind/metro.config.js.hbs +13 -0
  315. package/templates/frontend/native/uniwind/package.json.hbs +54 -0
  316. package/templates/frontend/native/uniwind/tsconfig.json.hbs +14 -0
  317. package/templates/frontend/nuxt/_gitignore +27 -0
  318. package/templates/frontend/nuxt/app/app.config.ts.hbs +15 -0
  319. package/templates/frontend/nuxt/app/app.vue.hbs +17 -0
  320. package/templates/frontend/nuxt/app/assets/css/main.css +2 -0
  321. package/templates/frontend/nuxt/app/components/Header.vue.hbs +40 -0
  322. package/templates/frontend/nuxt/app/layouts/default.vue.hbs +10 -0
  323. package/templates/frontend/nuxt/app/pages/index.vue.hbs +97 -0
  324. package/templates/frontend/nuxt/nuxt.config.ts.hbs +29 -0
  325. package/templates/frontend/nuxt/package.json.hbs +24 -0
  326. package/templates/frontend/nuxt/public/favicon.ico +0 -0
  327. package/templates/frontend/nuxt/public/robots.txt +2 -0
  328. package/templates/frontend/nuxt/server/tsconfig.json +3 -0
  329. package/templates/frontend/nuxt/tsconfig.json.hbs +18 -0
  330. package/templates/frontend/react/next/next-env.d.ts.hbs +5 -0
  331. package/templates/frontend/react/next/next.config.ts.hbs +22 -0
  332. package/templates/frontend/react/next/package.json.hbs +34 -0
  333. package/templates/frontend/react/next/postcss.config.mjs.hbs +5 -0
  334. package/templates/frontend/react/next/src/app/favicon.ico +0 -0
  335. package/templates/frontend/react/next/src/app/layout.tsx.hbs +76 -0
  336. package/templates/frontend/react/next/src/app/page.tsx.hbs +79 -0
  337. package/templates/frontend/react/next/src/components/mode-toggle.tsx.hbs +37 -0
  338. package/templates/frontend/react/next/src/components/providers.tsx.hbs +89 -0
  339. package/templates/frontend/react/next/src/components/theme-provider.tsx.hbs +11 -0
  340. package/templates/frontend/react/next/tsconfig.json.hbs +41 -0
  341. package/templates/frontend/react/react-router/package.json.hbs +42 -0
  342. package/templates/frontend/react/react-router/public/favicon.ico +0 -0
  343. package/templates/frontend/react/react-router/react-router.config.ts +6 -0
  344. package/templates/frontend/react/react-router/src/components/mode-toggle.tsx.hbs +29 -0
  345. package/templates/frontend/react/react-router/src/components/theme-provider.tsx.hbs +11 -0
  346. package/templates/frontend/react/react-router/src/root.tsx.hbs +190 -0
  347. package/templates/frontend/react/react-router/src/routes/_index.tsx.hbs +85 -0
  348. package/templates/frontend/react/react-router/src/routes.ts +4 -0
  349. package/templates/frontend/react/react-router/tsconfig.json.hbs +27 -0
  350. package/templates/frontend/react/react-router/vite.config.ts.hbs +12 -0
  351. package/templates/frontend/react/tanstack-router/index.html.hbs +13 -0
  352. package/templates/frontend/react/tanstack-router/package.json.hbs +41 -0
  353. package/templates/frontend/react/tanstack-router/src/components/mode-toggle.tsx.hbs +29 -0
  354. package/templates/frontend/react/tanstack-router/src/components/theme-provider.tsx.hbs +11 -0
  355. package/templates/frontend/react/tanstack-router/src/main.tsx.hbs +90 -0
  356. package/templates/frontend/react/tanstack-router/src/routes/__root.tsx.hbs +103 -0
  357. package/templates/frontend/react/tanstack-router/src/routes/index.tsx.hbs +85 -0
  358. package/templates/frontend/react/tanstack-router/tsconfig.json.hbs +18 -0
  359. package/templates/frontend/react/tanstack-router/vite.config.ts.hbs +21 -0
  360. package/templates/frontend/react/tanstack-start/package.json.hbs +43 -0
  361. package/templates/frontend/react/tanstack-start/public/robots.txt +3 -0
  362. package/templates/frontend/react/tanstack-start/src/router.tsx.hbs +144 -0
  363. package/templates/frontend/react/tanstack-start/src/routes/__root.tsx.hbs +208 -0
  364. package/templates/frontend/react/tanstack-start/src/routes/index.tsx.hbs +85 -0
  365. package/templates/frontend/react/tanstack-start/tsconfig.json.hbs +28 -0
  366. package/templates/frontend/react/tanstack-start/vite.config.ts.hbs +22 -0
  367. package/templates/frontend/react/web-base/_gitignore +60 -0
  368. package/templates/frontend/react/web-base/components.json +24 -0
  369. package/templates/frontend/react/web-base/src/components/header.tsx.hbs +78 -0
  370. package/templates/frontend/react/web-base/src/components/loader.tsx.hbs +9 -0
  371. package/templates/frontend/react/web-base/src/components/ui/button.tsx.hbs +57 -0
  372. package/templates/frontend/react/web-base/src/components/ui/card.tsx.hbs +103 -0
  373. package/templates/frontend/react/web-base/src/components/ui/checkbox.tsx.hbs +26 -0
  374. package/templates/frontend/react/web-base/src/components/ui/dropdown-menu.tsx.hbs +262 -0
  375. package/templates/frontend/react/web-base/src/components/ui/input.tsx.hbs +20 -0
  376. package/templates/frontend/react/web-base/src/components/ui/label.tsx.hbs +20 -0
  377. package/templates/frontend/react/web-base/src/components/ui/skeleton.tsx.hbs +13 -0
  378. package/templates/frontend/react/web-base/src/components/ui/sonner.tsx.hbs +44 -0
  379. package/templates/frontend/react/web-base/src/index.css.hbs +131 -0
  380. package/templates/frontend/react/web-base/src/lib/utils.ts.hbs +6 -0
  381. package/templates/frontend/solid/_gitignore +11 -0
  382. package/templates/frontend/solid/index.html +13 -0
  383. package/templates/frontend/solid/package.json.hbs +24 -0
  384. package/templates/frontend/solid/public/robots.txt +3 -0
  385. package/templates/frontend/solid/src/components/header.tsx.hbs +38 -0
  386. package/templates/frontend/solid/src/components/loader.tsx +9 -0
  387. package/templates/frontend/solid/src/main.tsx.hbs +41 -0
  388. package/templates/frontend/solid/src/routes/__root.tsx.hbs +34 -0
  389. package/templates/frontend/solid/src/routes/index.tsx.hbs +72 -0
  390. package/templates/frontend/solid/src/styles.css +5 -0
  391. package/templates/frontend/solid/tsconfig.json.hbs +29 -0
  392. package/templates/frontend/solid/vite.config.ts.hbs +21 -0
  393. package/templates/frontend/svelte/_gitignore +24 -0
  394. package/templates/frontend/svelte/_npmrc +1 -0
  395. package/templates/frontend/svelte/package.json.hbs +27 -0
  396. package/templates/frontend/svelte/src/app.css +5 -0
  397. package/templates/frontend/svelte/src/app.d.ts +13 -0
  398. package/templates/frontend/svelte/src/app.html +12 -0
  399. package/templates/frontend/svelte/src/components/Header.svelte.hbs +40 -0
  400. package/templates/frontend/svelte/src/lib/index.ts +2 -0
  401. package/templates/frontend/svelte/src/routes/+layout.svelte.hbs +54 -0
  402. package/templates/frontend/svelte/src/routes/+page.svelte.hbs +92 -0
  403. package/templates/frontend/svelte/static/favicon.png +0 -0
  404. package/templates/frontend/svelte/svelte.config.js.hbs +18 -0
  405. package/templates/frontend/svelte/tsconfig.json.hbs +19 -0
  406. package/templates/frontend/svelte/vite.config.ts.hbs +7 -0
  407. package/templates/packages/config/package.json.hbs +5 -0
  408. package/templates/packages/config/tsconfig.base.json.hbs +33 -0
  409. package/templates/packages/env/env.d.ts.hbs +16 -0
  410. package/templates/packages/env/package.json.hbs +7 -0
  411. package/templates/packages/env/src/native.ts.hbs +21 -0
  412. package/templates/packages/env/src/server.ts.hbs +39 -0
  413. package/templates/packages/env/src/web.ts.hbs +98 -0
  414. package/templates/packages/env/tsconfig.json.hbs +3 -0
  415. package/templates/packages/infra/alchemy.run.ts.hbs +271 -0
  416. package/templates/packages/infra/package.json.hbs +10 -0
  417. package/templates/payments/polar/server/base/src/lib/payments.ts.hbs +7 -0
  418. package/templates/payments/polar/web/nuxt/app/pages/success.vue.hbs +11 -0
  419. package/templates/payments/polar/web/react/next/src/app/success/page.tsx.hbs +15 -0
  420. package/templates/payments/polar/web/react/react-router/src/routes/success.tsx.hbs +13 -0
  421. package/templates/payments/polar/web/react/tanstack-router/src/routes/success.tsx.hbs +19 -0
  422. package/templates/payments/polar/web/react/tanstack-start/src/functions/get-payment.ts.hbs +15 -0
  423. package/templates/payments/polar/web/react/tanstack-start/src/routes/success.tsx.hbs +19 -0
  424. package/templates/payments/polar/web/solid/src/routes/success.tsx.hbs +23 -0
  425. package/templates/payments/polar/web/svelte/src/routes/success/+page.svelte.hbs +12 -0
@@ -0,0 +1 @@
1
+ {"version":3,"file":"template-reader.mjs","names":["binaryExtensions","binaryExtensions","normalize","path","fs","dirname","depth","nativeFs","POSIX_REGEX_SOURCE","path","utils","scan","glob","constants","utils","parse","START_ANCHOR","opts","DOTS_SLASH","DOT_LITERAL","QMARK","value","ONE_CHAR","posix","SLASH_LITERAL","PLUS_LITERAL","source","utils","picomatch","glob","state","posix","picomatch","glob","picomatch","path$1","scan","path","relative","fileURLToPath","fdir"],"sources":["../../../node_modules/.bun/binary-extensions@3.1.0/node_modules/binary-extensions/binary-extensions.json","../../../node_modules/.bun/binary-extensions@3.1.0/node_modules/binary-extensions/index.js","../../../node_modules/.bun/is-binary-path@3.0.0/node_modules/is-binary-path/index.js","../../../node_modules/.bun/fdir@6.5.0+a185e370e160e74e/node_modules/fdir/dist/index.mjs","../../../node_modules/.bun/picomatch@4.0.3/node_modules/picomatch/lib/constants.js","../../../node_modules/.bun/picomatch@4.0.3/node_modules/picomatch/lib/utils.js","../../../node_modules/.bun/picomatch@4.0.3/node_modules/picomatch/lib/scan.js","../../../node_modules/.bun/picomatch@4.0.3/node_modules/picomatch/lib/parse.js","../../../node_modules/.bun/picomatch@4.0.3/node_modules/picomatch/lib/picomatch.js","../../../node_modules/.bun/picomatch@4.0.3/node_modules/picomatch/index.js","../../../node_modules/.bun/tinyglobby@0.2.15/node_modules/tinyglobby/dist/index.mjs","../src/core/template-reader.ts"],"sourcesContent":["[\n\t\"3dm\",\n\t\"3ds\",\n\t\"3g2\",\n\t\"3gp\",\n\t\"7z\",\n\t\"a\",\n\t\"aac\",\n\t\"adp\",\n\t\"afdesign\",\n\t\"afphoto\",\n\t\"afpub\",\n\t\"ai\",\n\t\"aif\",\n\t\"aiff\",\n\t\"alz\",\n\t\"ape\",\n\t\"apk\",\n\t\"appimage\",\n\t\"ar\",\n\t\"arj\",\n\t\"asf\",\n\t\"au\",\n\t\"avi\",\n\t\"bak\",\n\t\"baml\",\n\t\"bh\",\n\t\"bin\",\n\t\"bk\",\n\t\"bmp\",\n\t\"btif\",\n\t\"bz2\",\n\t\"bzip2\",\n\t\"cab\",\n\t\"caf\",\n\t\"cgm\",\n\t\"class\",\n\t\"cmx\",\n\t\"cpio\",\n\t\"cr2\",\n\t\"cr3\",\n\t\"cur\",\n\t\"dat\",\n\t\"dcm\",\n\t\"deb\",\n\t\"dex\",\n\t\"djvu\",\n\t\"dll\",\n\t\"dmg\",\n\t\"dng\",\n\t\"doc\",\n\t\"docm\",\n\t\"docx\",\n\t\"dot\",\n\t\"dotm\",\n\t\"dra\",\n\t\"DS_Store\",\n\t\"dsk\",\n\t\"dts\",\n\t\"dtshd\",\n\t\"dvb\",\n\t\"dwg\",\n\t\"dxf\",\n\t\"ecelp4800\",\n\t\"ecelp7470\",\n\t\"ecelp9600\",\n\t\"egg\",\n\t\"eol\",\n\t\"eot\",\n\t\"epub\",\n\t\"exe\",\n\t\"f4v\",\n\t\"fbs\",\n\t\"fh\",\n\t\"fla\",\n\t\"flac\",\n\t\"flatpak\",\n\t\"fli\",\n\t\"flv\",\n\t\"fpx\",\n\t\"fst\",\n\t\"fvt\",\n\t\"g3\",\n\t\"gh\",\n\t\"gif\",\n\t\"graffle\",\n\t\"gz\",\n\t\"gzip\",\n\t\"h261\",\n\t\"h263\",\n\t\"h264\",\n\t\"icns\",\n\t\"ico\",\n\t\"ief\",\n\t\"img\",\n\t\"ipa\",\n\t\"iso\",\n\t\"jar\",\n\t\"jpeg\",\n\t\"jpg\",\n\t\"jpgv\",\n\t\"jpm\",\n\t\"jxr\",\n\t\"key\",\n\t\"ktx\",\n\t\"lha\",\n\t\"lib\",\n\t\"lvp\",\n\t\"lz\",\n\t\"lzh\",\n\t\"lzma\",\n\t\"lzo\",\n\t\"m3u\",\n\t\"m4a\",\n\t\"m4v\",\n\t\"mar\",\n\t\"mdi\",\n\t\"mht\",\n\t\"mid\",\n\t\"midi\",\n\t\"mj2\",\n\t\"mka\",\n\t\"mkv\",\n\t\"mmr\",\n\t\"mng\",\n\t\"mobi\",\n\t\"mov\",\n\t\"movie\",\n\t\"mp3\",\n\t\"mp4\",\n\t\"mp4a\",\n\t\"mpeg\",\n\t\"mpg\",\n\t\"mpga\",\n\t\"mxu\",\n\t\"nef\",\n\t\"npx\",\n\t\"numbers\",\n\t\"nupkg\",\n\t\"o\",\n\t\"odp\",\n\t\"ods\",\n\t\"odt\",\n\t\"oga\",\n\t\"ogg\",\n\t\"ogv\",\n\t\"otf\",\n\t\"ott\",\n\t\"pages\",\n\t\"pbm\",\n\t\"pcx\",\n\t\"pdb\",\n\t\"pdf\",\n\t\"pea\",\n\t\"pgm\",\n\t\"pic\",\n\t\"png\",\n\t\"pnm\",\n\t\"pot\",\n\t\"potm\",\n\t\"potx\",\n\t\"ppa\",\n\t\"ppam\",\n\t\"ppm\",\n\t\"pps\",\n\t\"ppsm\",\n\t\"ppsx\",\n\t\"ppt\",\n\t\"pptm\",\n\t\"pptx\",\n\t\"psd\",\n\t\"pya\",\n\t\"pyc\",\n\t\"pyo\",\n\t\"pyv\",\n\t\"qt\",\n\t\"rar\",\n\t\"ras\",\n\t\"raw\",\n\t\"resources\",\n\t\"rgb\",\n\t\"rip\",\n\t\"rlc\",\n\t\"rmf\",\n\t\"rmvb\",\n\t\"rpm\",\n\t\"rtf\",\n\t\"rz\",\n\t\"s3m\",\n\t\"s7z\",\n\t\"scpt\",\n\t\"sgi\",\n\t\"shar\",\n\t\"snap\",\n\t\"sil\",\n\t\"sketch\",\n\t\"slk\",\n\t\"smv\",\n\t\"snk\",\n\t\"so\",\n\t\"stl\",\n\t\"suo\",\n\t\"sub\",\n\t\"swf\",\n\t\"tar\",\n\t\"tbz\",\n\t\"tbz2\",\n\t\"tga\",\n\t\"tgz\",\n\t\"thmx\",\n\t\"tif\",\n\t\"tiff\",\n\t\"tlz\",\n\t\"ttc\",\n\t\"ttf\",\n\t\"txz\",\n\t\"udf\",\n\t\"uvh\",\n\t\"uvi\",\n\t\"uvm\",\n\t\"uvp\",\n\t\"uvs\",\n\t\"uvu\",\n\t\"viv\",\n\t\"vob\",\n\t\"war\",\n\t\"wav\",\n\t\"wax\",\n\t\"wbmp\",\n\t\"wdp\",\n\t\"weba\",\n\t\"webm\",\n\t\"webp\",\n\t\"whl\",\n\t\"wim\",\n\t\"wm\",\n\t\"wma\",\n\t\"wmv\",\n\t\"wmx\",\n\t\"woff\",\n\t\"woff2\",\n\t\"wrm\",\n\t\"wvx\",\n\t\"xbm\",\n\t\"xif\",\n\t\"xla\",\n\t\"xlam\",\n\t\"xls\",\n\t\"xlsb\",\n\t\"xlsm\",\n\t\"xlsx\",\n\t\"xlt\",\n\t\"xltm\",\n\t\"xltx\",\n\t\"xm\",\n\t\"xmind\",\n\t\"xpi\",\n\t\"xpm\",\n\t\"xwd\",\n\t\"xz\",\n\t\"z\",\n\t\"zip\",\n\t\"zipx\"\n]\n","import binaryExtensions from './binary-extensions.json' with {type: 'json'};\n\nexport default binaryExtensions;\n","import path from 'node:path';\nimport binaryExtensions from 'binary-extensions';\n\nconst extensions = new Set(binaryExtensions);\n\nexport default function isBinaryPath(filePath) {\n\treturn extensions.has(path.extname(filePath).slice(1).toLowerCase());\n}\n","import { createRequire } from \"module\";\nimport { basename, dirname, normalize, relative, resolve, sep } from \"path\";\nimport * as nativeFs from \"fs\";\n\n//#region rolldown:runtime\nvar __require = /* @__PURE__ */ createRequire(import.meta.url);\n\n//#endregion\n//#region src/utils.ts\nfunction cleanPath(path) {\n\tlet normalized = normalize(path);\n\tif (normalized.length > 1 && normalized[normalized.length - 1] === sep) normalized = normalized.substring(0, normalized.length - 1);\n\treturn normalized;\n}\nconst SLASHES_REGEX = /[\\\\/]/g;\nfunction convertSlashes(path, separator) {\n\treturn path.replace(SLASHES_REGEX, separator);\n}\nconst WINDOWS_ROOT_DIR_REGEX = /^[a-z]:[\\\\/]$/i;\nfunction isRootDirectory(path) {\n\treturn path === \"/\" || WINDOWS_ROOT_DIR_REGEX.test(path);\n}\nfunction normalizePath(path, options) {\n\tconst { resolvePaths, normalizePath: normalizePath$1, pathSeparator } = options;\n\tconst pathNeedsCleaning = process.platform === \"win32\" && path.includes(\"/\") || path.startsWith(\".\");\n\tif (resolvePaths) path = resolve(path);\n\tif (normalizePath$1 || pathNeedsCleaning) path = cleanPath(path);\n\tif (path === \".\") return \"\";\n\tconst needsSeperator = path[path.length - 1] !== pathSeparator;\n\treturn convertSlashes(needsSeperator ? path + pathSeparator : path, pathSeparator);\n}\n\n//#endregion\n//#region src/api/functions/join-path.ts\nfunction joinPathWithBasePath(filename, directoryPath) {\n\treturn directoryPath + filename;\n}\nfunction joinPathWithRelativePath(root, options) {\n\treturn function(filename, directoryPath) {\n\t\tconst sameRoot = directoryPath.startsWith(root);\n\t\tif (sameRoot) return directoryPath.slice(root.length) + filename;\n\t\telse return convertSlashes(relative(root, directoryPath), options.pathSeparator) + options.pathSeparator + filename;\n\t};\n}\nfunction joinPath(filename) {\n\treturn filename;\n}\nfunction joinDirectoryPath(filename, directoryPath, separator) {\n\treturn directoryPath + filename + separator;\n}\nfunction build$7(root, options) {\n\tconst { relativePaths, includeBasePath } = options;\n\treturn relativePaths && root ? joinPathWithRelativePath(root, options) : includeBasePath ? joinPathWithBasePath : joinPath;\n}\n\n//#endregion\n//#region src/api/functions/push-directory.ts\nfunction pushDirectoryWithRelativePath(root) {\n\treturn function(directoryPath, paths) {\n\t\tpaths.push(directoryPath.substring(root.length) || \".\");\n\t};\n}\nfunction pushDirectoryFilterWithRelativePath(root) {\n\treturn function(directoryPath, paths, filters) {\n\t\tconst relativePath = directoryPath.substring(root.length) || \".\";\n\t\tif (filters.every((filter) => filter(relativePath, true))) paths.push(relativePath);\n\t};\n}\nconst pushDirectory = (directoryPath, paths) => {\n\tpaths.push(directoryPath || \".\");\n};\nconst pushDirectoryFilter = (directoryPath, paths, filters) => {\n\tconst path = directoryPath || \".\";\n\tif (filters.every((filter) => filter(path, true))) paths.push(path);\n};\nconst empty$2 = () => {};\nfunction build$6(root, options) {\n\tconst { includeDirs, filters, relativePaths } = options;\n\tif (!includeDirs) return empty$2;\n\tif (relativePaths) return filters && filters.length ? pushDirectoryFilterWithRelativePath(root) : pushDirectoryWithRelativePath(root);\n\treturn filters && filters.length ? pushDirectoryFilter : pushDirectory;\n}\n\n//#endregion\n//#region src/api/functions/push-file.ts\nconst pushFileFilterAndCount = (filename, _paths, counts, filters) => {\n\tif (filters.every((filter) => filter(filename, false))) counts.files++;\n};\nconst pushFileFilter = (filename, paths, _counts, filters) => {\n\tif (filters.every((filter) => filter(filename, false))) paths.push(filename);\n};\nconst pushFileCount = (_filename, _paths, counts, _filters) => {\n\tcounts.files++;\n};\nconst pushFile = (filename, paths) => {\n\tpaths.push(filename);\n};\nconst empty$1 = () => {};\nfunction build$5(options) {\n\tconst { excludeFiles, filters, onlyCounts } = options;\n\tif (excludeFiles) return empty$1;\n\tif (filters && filters.length) return onlyCounts ? pushFileFilterAndCount : pushFileFilter;\n\telse if (onlyCounts) return pushFileCount;\n\telse return pushFile;\n}\n\n//#endregion\n//#region src/api/functions/get-array.ts\nconst getArray = (paths) => {\n\treturn paths;\n};\nconst getArrayGroup = () => {\n\treturn [\"\"].slice(0, 0);\n};\nfunction build$4(options) {\n\treturn options.group ? getArrayGroup : getArray;\n}\n\n//#endregion\n//#region src/api/functions/group-files.ts\nconst groupFiles = (groups, directory, files) => {\n\tgroups.push({\n\t\tdirectory,\n\t\tfiles,\n\t\tdir: directory\n\t});\n};\nconst empty = () => {};\nfunction build$3(options) {\n\treturn options.group ? groupFiles : empty;\n}\n\n//#endregion\n//#region src/api/functions/resolve-symlink.ts\nconst resolveSymlinksAsync = function(path, state, callback$1) {\n\tconst { queue, fs, options: { suppressErrors } } = state;\n\tqueue.enqueue();\n\tfs.realpath(path, (error, resolvedPath) => {\n\t\tif (error) return queue.dequeue(suppressErrors ? null : error, state);\n\t\tfs.stat(resolvedPath, (error$1, stat) => {\n\t\t\tif (error$1) return queue.dequeue(suppressErrors ? null : error$1, state);\n\t\t\tif (stat.isDirectory() && isRecursive(path, resolvedPath, state)) return queue.dequeue(null, state);\n\t\t\tcallback$1(stat, resolvedPath);\n\t\t\tqueue.dequeue(null, state);\n\t\t});\n\t});\n};\nconst resolveSymlinks = function(path, state, callback$1) {\n\tconst { queue, fs, options: { suppressErrors } } = state;\n\tqueue.enqueue();\n\ttry {\n\t\tconst resolvedPath = fs.realpathSync(path);\n\t\tconst stat = fs.statSync(resolvedPath);\n\t\tif (stat.isDirectory() && isRecursive(path, resolvedPath, state)) return;\n\t\tcallback$1(stat, resolvedPath);\n\t} catch (e) {\n\t\tif (!suppressErrors) throw e;\n\t}\n};\nfunction build$2(options, isSynchronous) {\n\tif (!options.resolveSymlinks || options.excludeSymlinks) return null;\n\treturn isSynchronous ? resolveSymlinks : resolveSymlinksAsync;\n}\nfunction isRecursive(path, resolved, state) {\n\tif (state.options.useRealPaths) return isRecursiveUsingRealPaths(resolved, state);\n\tlet parent = dirname(path);\n\tlet depth = 1;\n\twhile (parent !== state.root && depth < 2) {\n\t\tconst resolvedPath = state.symlinks.get(parent);\n\t\tconst isSameRoot = !!resolvedPath && (resolvedPath === resolved || resolvedPath.startsWith(resolved) || resolved.startsWith(resolvedPath));\n\t\tif (isSameRoot) depth++;\n\t\telse parent = dirname(parent);\n\t}\n\tstate.symlinks.set(path, resolved);\n\treturn depth > 1;\n}\nfunction isRecursiveUsingRealPaths(resolved, state) {\n\treturn state.visited.includes(resolved + state.options.pathSeparator);\n}\n\n//#endregion\n//#region src/api/functions/invoke-callback.ts\nconst onlyCountsSync = (state) => {\n\treturn state.counts;\n};\nconst groupsSync = (state) => {\n\treturn state.groups;\n};\nconst defaultSync = (state) => {\n\treturn state.paths;\n};\nconst limitFilesSync = (state) => {\n\treturn state.paths.slice(0, state.options.maxFiles);\n};\nconst onlyCountsAsync = (state, error, callback$1) => {\n\treport(error, callback$1, state.counts, state.options.suppressErrors);\n\treturn null;\n};\nconst defaultAsync = (state, error, callback$1) => {\n\treport(error, callback$1, state.paths, state.options.suppressErrors);\n\treturn null;\n};\nconst limitFilesAsync = (state, error, callback$1) => {\n\treport(error, callback$1, state.paths.slice(0, state.options.maxFiles), state.options.suppressErrors);\n\treturn null;\n};\nconst groupsAsync = (state, error, callback$1) => {\n\treport(error, callback$1, state.groups, state.options.suppressErrors);\n\treturn null;\n};\nfunction report(error, callback$1, output, suppressErrors) {\n\tif (error && !suppressErrors) callback$1(error, output);\n\telse callback$1(null, output);\n}\nfunction build$1(options, isSynchronous) {\n\tconst { onlyCounts, group, maxFiles } = options;\n\tif (onlyCounts) return isSynchronous ? onlyCountsSync : onlyCountsAsync;\n\telse if (group) return isSynchronous ? groupsSync : groupsAsync;\n\telse if (maxFiles) return isSynchronous ? limitFilesSync : limitFilesAsync;\n\telse return isSynchronous ? defaultSync : defaultAsync;\n}\n\n//#endregion\n//#region src/api/functions/walk-directory.ts\nconst readdirOpts = { withFileTypes: true };\nconst walkAsync = (state, crawlPath, directoryPath, currentDepth, callback$1) => {\n\tstate.queue.enqueue();\n\tif (currentDepth < 0) return state.queue.dequeue(null, state);\n\tconst { fs } = state;\n\tstate.visited.push(crawlPath);\n\tstate.counts.directories++;\n\tfs.readdir(crawlPath || \".\", readdirOpts, (error, entries = []) => {\n\t\tcallback$1(entries, directoryPath, currentDepth);\n\t\tstate.queue.dequeue(state.options.suppressErrors ? null : error, state);\n\t});\n};\nconst walkSync = (state, crawlPath, directoryPath, currentDepth, callback$1) => {\n\tconst { fs } = state;\n\tif (currentDepth < 0) return;\n\tstate.visited.push(crawlPath);\n\tstate.counts.directories++;\n\tlet entries = [];\n\ttry {\n\t\tentries = fs.readdirSync(crawlPath || \".\", readdirOpts);\n\t} catch (e) {\n\t\tif (!state.options.suppressErrors) throw e;\n\t}\n\tcallback$1(entries, directoryPath, currentDepth);\n};\nfunction build(isSynchronous) {\n\treturn isSynchronous ? walkSync : walkAsync;\n}\n\n//#endregion\n//#region src/api/queue.ts\n/**\n* This is a custom stateless queue to track concurrent async fs calls.\n* It increments a counter whenever a call is queued and decrements it\n* as soon as it completes. When the counter hits 0, it calls onQueueEmpty.\n*/\nvar Queue = class {\n\tcount = 0;\n\tconstructor(onQueueEmpty) {\n\t\tthis.onQueueEmpty = onQueueEmpty;\n\t}\n\tenqueue() {\n\t\tthis.count++;\n\t\treturn this.count;\n\t}\n\tdequeue(error, output) {\n\t\tif (this.onQueueEmpty && (--this.count <= 0 || error)) {\n\t\t\tthis.onQueueEmpty(error, output);\n\t\t\tif (error) {\n\t\t\t\toutput.controller.abort();\n\t\t\t\tthis.onQueueEmpty = void 0;\n\t\t\t}\n\t\t}\n\t}\n};\n\n//#endregion\n//#region src/api/counter.ts\nvar Counter = class {\n\t_files = 0;\n\t_directories = 0;\n\tset files(num) {\n\t\tthis._files = num;\n\t}\n\tget files() {\n\t\treturn this._files;\n\t}\n\tset directories(num) {\n\t\tthis._directories = num;\n\t}\n\tget directories() {\n\t\treturn this._directories;\n\t}\n\t/**\n\t* @deprecated use `directories` instead\n\t*/\n\t/* c8 ignore next 3 */\n\tget dirs() {\n\t\treturn this._directories;\n\t}\n};\n\n//#endregion\n//#region src/api/aborter.ts\n/**\n* AbortController is not supported on Node 14 so we use this until we can drop\n* support for Node 14.\n*/\nvar Aborter = class {\n\taborted = false;\n\tabort() {\n\t\tthis.aborted = true;\n\t}\n};\n\n//#endregion\n//#region src/api/walker.ts\nvar Walker = class {\n\troot;\n\tisSynchronous;\n\tstate;\n\tjoinPath;\n\tpushDirectory;\n\tpushFile;\n\tgetArray;\n\tgroupFiles;\n\tresolveSymlink;\n\twalkDirectory;\n\tcallbackInvoker;\n\tconstructor(root, options, callback$1) {\n\t\tthis.isSynchronous = !callback$1;\n\t\tthis.callbackInvoker = build$1(options, this.isSynchronous);\n\t\tthis.root = normalizePath(root, options);\n\t\tthis.state = {\n\t\t\troot: isRootDirectory(this.root) ? this.root : this.root.slice(0, -1),\n\t\t\tpaths: [\"\"].slice(0, 0),\n\t\t\tgroups: [],\n\t\t\tcounts: new Counter(),\n\t\t\toptions,\n\t\t\tqueue: new Queue((error, state) => this.callbackInvoker(state, error, callback$1)),\n\t\t\tsymlinks: /* @__PURE__ */ new Map(),\n\t\t\tvisited: [\"\"].slice(0, 0),\n\t\t\tcontroller: new Aborter(),\n\t\t\tfs: options.fs || nativeFs\n\t\t};\n\t\tthis.joinPath = build$7(this.root, options);\n\t\tthis.pushDirectory = build$6(this.root, options);\n\t\tthis.pushFile = build$5(options);\n\t\tthis.getArray = build$4(options);\n\t\tthis.groupFiles = build$3(options);\n\t\tthis.resolveSymlink = build$2(options, this.isSynchronous);\n\t\tthis.walkDirectory = build(this.isSynchronous);\n\t}\n\tstart() {\n\t\tthis.pushDirectory(this.root, this.state.paths, this.state.options.filters);\n\t\tthis.walkDirectory(this.state, this.root, this.root, this.state.options.maxDepth, this.walk);\n\t\treturn this.isSynchronous ? this.callbackInvoker(this.state, null) : null;\n\t}\n\twalk = (entries, directoryPath, depth) => {\n\t\tconst { paths, options: { filters, resolveSymlinks: resolveSymlinks$1, excludeSymlinks, exclude, maxFiles, signal, useRealPaths, pathSeparator }, controller } = this.state;\n\t\tif (controller.aborted || signal && signal.aborted || maxFiles && paths.length > maxFiles) return;\n\t\tconst files = this.getArray(this.state.paths);\n\t\tfor (let i = 0; i < entries.length; ++i) {\n\t\t\tconst entry = entries[i];\n\t\t\tif (entry.isFile() || entry.isSymbolicLink() && !resolveSymlinks$1 && !excludeSymlinks) {\n\t\t\t\tconst filename = this.joinPath(entry.name, directoryPath);\n\t\t\t\tthis.pushFile(filename, files, this.state.counts, filters);\n\t\t\t} else if (entry.isDirectory()) {\n\t\t\t\tlet path = joinDirectoryPath(entry.name, directoryPath, this.state.options.pathSeparator);\n\t\t\t\tif (exclude && exclude(entry.name, path)) continue;\n\t\t\t\tthis.pushDirectory(path, paths, filters);\n\t\t\t\tthis.walkDirectory(this.state, path, path, depth - 1, this.walk);\n\t\t\t} else if (this.resolveSymlink && entry.isSymbolicLink()) {\n\t\t\t\tlet path = joinPathWithBasePath(entry.name, directoryPath);\n\t\t\t\tthis.resolveSymlink(path, this.state, (stat, resolvedPath) => {\n\t\t\t\t\tif (stat.isDirectory()) {\n\t\t\t\t\t\tresolvedPath = normalizePath(resolvedPath, this.state.options);\n\t\t\t\t\t\tif (exclude && exclude(entry.name, useRealPaths ? resolvedPath : path + pathSeparator)) return;\n\t\t\t\t\t\tthis.walkDirectory(this.state, resolvedPath, useRealPaths ? resolvedPath : path + pathSeparator, depth - 1, this.walk);\n\t\t\t\t\t} else {\n\t\t\t\t\t\tresolvedPath = useRealPaths ? resolvedPath : path;\n\t\t\t\t\t\tconst filename = basename(resolvedPath);\n\t\t\t\t\t\tconst directoryPath$1 = normalizePath(dirname(resolvedPath), this.state.options);\n\t\t\t\t\t\tresolvedPath = this.joinPath(filename, directoryPath$1);\n\t\t\t\t\t\tthis.pushFile(resolvedPath, files, this.state.counts, filters);\n\t\t\t\t\t}\n\t\t\t\t});\n\t\t\t}\n\t\t}\n\t\tthis.groupFiles(this.state.groups, directoryPath, files);\n\t};\n};\n\n//#endregion\n//#region src/api/async.ts\nfunction promise(root, options) {\n\treturn new Promise((resolve$1, reject) => {\n\t\tcallback(root, options, (err, output) => {\n\t\t\tif (err) return reject(err);\n\t\t\tresolve$1(output);\n\t\t});\n\t});\n}\nfunction callback(root, options, callback$1) {\n\tlet walker = new Walker(root, options, callback$1);\n\twalker.start();\n}\n\n//#endregion\n//#region src/api/sync.ts\nfunction sync(root, options) {\n\tconst walker = new Walker(root, options);\n\treturn walker.start();\n}\n\n//#endregion\n//#region src/builder/api-builder.ts\nvar APIBuilder = class {\n\tconstructor(root, options) {\n\t\tthis.root = root;\n\t\tthis.options = options;\n\t}\n\twithPromise() {\n\t\treturn promise(this.root, this.options);\n\t}\n\twithCallback(cb) {\n\t\tcallback(this.root, this.options, cb);\n\t}\n\tsync() {\n\t\treturn sync(this.root, this.options);\n\t}\n};\n\n//#endregion\n//#region src/builder/index.ts\nlet pm = null;\n/* c8 ignore next 6 */\ntry {\n\t__require.resolve(\"picomatch\");\n\tpm = __require(\"picomatch\");\n} catch {}\nvar Builder = class {\n\tglobCache = {};\n\toptions = {\n\t\tmaxDepth: Infinity,\n\t\tsuppressErrors: true,\n\t\tpathSeparator: sep,\n\t\tfilters: []\n\t};\n\tglobFunction;\n\tconstructor(options) {\n\t\tthis.options = {\n\t\t\t...this.options,\n\t\t\t...options\n\t\t};\n\t\tthis.globFunction = this.options.globFunction;\n\t}\n\tgroup() {\n\t\tthis.options.group = true;\n\t\treturn this;\n\t}\n\twithPathSeparator(separator) {\n\t\tthis.options.pathSeparator = separator;\n\t\treturn this;\n\t}\n\twithBasePath() {\n\t\tthis.options.includeBasePath = true;\n\t\treturn this;\n\t}\n\twithRelativePaths() {\n\t\tthis.options.relativePaths = true;\n\t\treturn this;\n\t}\n\twithDirs() {\n\t\tthis.options.includeDirs = true;\n\t\treturn this;\n\t}\n\twithMaxDepth(depth) {\n\t\tthis.options.maxDepth = depth;\n\t\treturn this;\n\t}\n\twithMaxFiles(limit) {\n\t\tthis.options.maxFiles = limit;\n\t\treturn this;\n\t}\n\twithFullPaths() {\n\t\tthis.options.resolvePaths = true;\n\t\tthis.options.includeBasePath = true;\n\t\treturn this;\n\t}\n\twithErrors() {\n\t\tthis.options.suppressErrors = false;\n\t\treturn this;\n\t}\n\twithSymlinks({ resolvePaths = true } = {}) {\n\t\tthis.options.resolveSymlinks = true;\n\t\tthis.options.useRealPaths = resolvePaths;\n\t\treturn this.withFullPaths();\n\t}\n\twithAbortSignal(signal) {\n\t\tthis.options.signal = signal;\n\t\treturn this;\n\t}\n\tnormalize() {\n\t\tthis.options.normalizePath = true;\n\t\treturn this;\n\t}\n\tfilter(predicate) {\n\t\tthis.options.filters.push(predicate);\n\t\treturn this;\n\t}\n\tonlyDirs() {\n\t\tthis.options.excludeFiles = true;\n\t\tthis.options.includeDirs = true;\n\t\treturn this;\n\t}\n\texclude(predicate) {\n\t\tthis.options.exclude = predicate;\n\t\treturn this;\n\t}\n\tonlyCounts() {\n\t\tthis.options.onlyCounts = true;\n\t\treturn this;\n\t}\n\tcrawl(root) {\n\t\treturn new APIBuilder(root || \".\", this.options);\n\t}\n\twithGlobFunction(fn) {\n\t\tthis.globFunction = fn;\n\t\treturn this;\n\t}\n\t/**\n\t* @deprecated Pass options using the constructor instead:\n\t* ```ts\n\t* new fdir(options).crawl(\"/path/to/root\");\n\t* ```\n\t* This method will be removed in v7.0\n\t*/\n\t/* c8 ignore next 4 */\n\tcrawlWithOptions(root, options) {\n\t\tthis.options = {\n\t\t\t...this.options,\n\t\t\t...options\n\t\t};\n\t\treturn new APIBuilder(root || \".\", this.options);\n\t}\n\tglob(...patterns) {\n\t\tif (this.globFunction) return this.globWithOptions(patterns);\n\t\treturn this.globWithOptions(patterns, ...[{ dot: true }]);\n\t}\n\tglobWithOptions(patterns, ...options) {\n\t\tconst globFn = this.globFunction || pm;\n\t\t/* c8 ignore next 5 */\n\t\tif (!globFn) throw new Error(\"Please specify a glob function to use glob matching.\");\n\t\tvar isMatch = this.globCache[patterns.join(\"\\0\")];\n\t\tif (!isMatch) {\n\t\t\tisMatch = globFn(patterns, ...options);\n\t\t\tthis.globCache[patterns.join(\"\\0\")] = isMatch;\n\t\t}\n\t\tthis.options.filters.push((path) => isMatch(path));\n\t\treturn this;\n\t}\n};\n\n//#endregion\nexport { Builder as fdir };","'use strict';\n\nconst WIN_SLASH = '\\\\\\\\/';\nconst WIN_NO_SLASH = `[^${WIN_SLASH}]`;\n\n/**\n * Posix glob regex\n */\n\nconst DOT_LITERAL = '\\\\.';\nconst PLUS_LITERAL = '\\\\+';\nconst QMARK_LITERAL = '\\\\?';\nconst SLASH_LITERAL = '\\\\/';\nconst ONE_CHAR = '(?=.)';\nconst QMARK = '[^/]';\nconst END_ANCHOR = `(?:${SLASH_LITERAL}|$)`;\nconst START_ANCHOR = `(?:^|${SLASH_LITERAL})`;\nconst DOTS_SLASH = `${DOT_LITERAL}{1,2}${END_ANCHOR}`;\nconst NO_DOT = `(?!${DOT_LITERAL})`;\nconst NO_DOTS = `(?!${START_ANCHOR}${DOTS_SLASH})`;\nconst NO_DOT_SLASH = `(?!${DOT_LITERAL}{0,1}${END_ANCHOR})`;\nconst NO_DOTS_SLASH = `(?!${DOTS_SLASH})`;\nconst QMARK_NO_DOT = `[^.${SLASH_LITERAL}]`;\nconst STAR = `${QMARK}*?`;\nconst SEP = '/';\n\nconst POSIX_CHARS = {\n DOT_LITERAL,\n PLUS_LITERAL,\n QMARK_LITERAL,\n SLASH_LITERAL,\n ONE_CHAR,\n QMARK,\n END_ANCHOR,\n DOTS_SLASH,\n NO_DOT,\n NO_DOTS,\n NO_DOT_SLASH,\n NO_DOTS_SLASH,\n QMARK_NO_DOT,\n STAR,\n START_ANCHOR,\n SEP\n};\n\n/**\n * Windows glob regex\n */\n\nconst WINDOWS_CHARS = {\n ...POSIX_CHARS,\n\n SLASH_LITERAL: `[${WIN_SLASH}]`,\n QMARK: WIN_NO_SLASH,\n STAR: `${WIN_NO_SLASH}*?`,\n DOTS_SLASH: `${DOT_LITERAL}{1,2}(?:[${WIN_SLASH}]|$)`,\n NO_DOT: `(?!${DOT_LITERAL})`,\n NO_DOTS: `(?!(?:^|[${WIN_SLASH}])${DOT_LITERAL}{1,2}(?:[${WIN_SLASH}]|$))`,\n NO_DOT_SLASH: `(?!${DOT_LITERAL}{0,1}(?:[${WIN_SLASH}]|$))`,\n NO_DOTS_SLASH: `(?!${DOT_LITERAL}{1,2}(?:[${WIN_SLASH}]|$))`,\n QMARK_NO_DOT: `[^.${WIN_SLASH}]`,\n START_ANCHOR: `(?:^|[${WIN_SLASH}])`,\n END_ANCHOR: `(?:[${WIN_SLASH}]|$)`,\n SEP: '\\\\'\n};\n\n/**\n * POSIX Bracket Regex\n */\n\nconst POSIX_REGEX_SOURCE = {\n alnum: 'a-zA-Z0-9',\n alpha: 'a-zA-Z',\n ascii: '\\\\x00-\\\\x7F',\n blank: ' \\\\t',\n cntrl: '\\\\x00-\\\\x1F\\\\x7F',\n digit: '0-9',\n graph: '\\\\x21-\\\\x7E',\n lower: 'a-z',\n print: '\\\\x20-\\\\x7E ',\n punct: '\\\\-!\"#$%&\\'()\\\\*+,./:;<=>?@[\\\\]^_`{|}~',\n space: ' \\\\t\\\\r\\\\n\\\\v\\\\f',\n upper: 'A-Z',\n word: 'A-Za-z0-9_',\n xdigit: 'A-Fa-f0-9'\n};\n\nmodule.exports = {\n MAX_LENGTH: 1024 * 64,\n POSIX_REGEX_SOURCE,\n\n // regular expressions\n REGEX_BACKSLASH: /\\\\(?![*+?^${}(|)[\\]])/g,\n REGEX_NON_SPECIAL_CHARS: /^[^@![\\].,$*+?^{}()|\\\\/]+/,\n REGEX_SPECIAL_CHARS: /[-*+?.^${}(|)[\\]]/,\n REGEX_SPECIAL_CHARS_BACKREF: /(\\\\?)((\\W)(\\3*))/g,\n REGEX_SPECIAL_CHARS_GLOBAL: /([-*+?.^${}(|)[\\]])/g,\n REGEX_REMOVE_BACKSLASH: /(?:\\[.*?[^\\\\]\\]|\\\\(?=.))/g,\n\n // Replace globs with equivalent patterns to reduce parsing time.\n REPLACEMENTS: {\n __proto__: null,\n '***': '*',\n '**/**': '**',\n '**/**/**': '**'\n },\n\n // Digits\n CHAR_0: 48, /* 0 */\n CHAR_9: 57, /* 9 */\n\n // Alphabet chars.\n CHAR_UPPERCASE_A: 65, /* A */\n CHAR_LOWERCASE_A: 97, /* a */\n CHAR_UPPERCASE_Z: 90, /* Z */\n CHAR_LOWERCASE_Z: 122, /* z */\n\n CHAR_LEFT_PARENTHESES: 40, /* ( */\n CHAR_RIGHT_PARENTHESES: 41, /* ) */\n\n CHAR_ASTERISK: 42, /* * */\n\n // Non-alphabetic chars.\n CHAR_AMPERSAND: 38, /* & */\n CHAR_AT: 64, /* @ */\n CHAR_BACKWARD_SLASH: 92, /* \\ */\n CHAR_CARRIAGE_RETURN: 13, /* \\r */\n CHAR_CIRCUMFLEX_ACCENT: 94, /* ^ */\n CHAR_COLON: 58, /* : */\n CHAR_COMMA: 44, /* , */\n CHAR_DOT: 46, /* . */\n CHAR_DOUBLE_QUOTE: 34, /* \" */\n CHAR_EQUAL: 61, /* = */\n CHAR_EXCLAMATION_MARK: 33, /* ! */\n CHAR_FORM_FEED: 12, /* \\f */\n CHAR_FORWARD_SLASH: 47, /* / */\n CHAR_GRAVE_ACCENT: 96, /* ` */\n CHAR_HASH: 35, /* # */\n CHAR_HYPHEN_MINUS: 45, /* - */\n CHAR_LEFT_ANGLE_BRACKET: 60, /* < */\n CHAR_LEFT_CURLY_BRACE: 123, /* { */\n CHAR_LEFT_SQUARE_BRACKET: 91, /* [ */\n CHAR_LINE_FEED: 10, /* \\n */\n CHAR_NO_BREAK_SPACE: 160, /* \\u00A0 */\n CHAR_PERCENT: 37, /* % */\n CHAR_PLUS: 43, /* + */\n CHAR_QUESTION_MARK: 63, /* ? */\n CHAR_RIGHT_ANGLE_BRACKET: 62, /* > */\n CHAR_RIGHT_CURLY_BRACE: 125, /* } */\n CHAR_RIGHT_SQUARE_BRACKET: 93, /* ] */\n CHAR_SEMICOLON: 59, /* ; */\n CHAR_SINGLE_QUOTE: 39, /* ' */\n CHAR_SPACE: 32, /* */\n CHAR_TAB: 9, /* \\t */\n CHAR_UNDERSCORE: 95, /* _ */\n CHAR_VERTICAL_LINE: 124, /* | */\n CHAR_ZERO_WIDTH_NOBREAK_SPACE: 65279, /* \\uFEFF */\n\n /**\n * Create EXTGLOB_CHARS\n */\n\n extglobChars(chars) {\n return {\n '!': { type: 'negate', open: '(?:(?!(?:', close: `))${chars.STAR})` },\n '?': { type: 'qmark', open: '(?:', close: ')?' },\n '+': { type: 'plus', open: '(?:', close: ')+' },\n '*': { type: 'star', open: '(?:', close: ')*' },\n '@': { type: 'at', open: '(?:', close: ')' }\n };\n },\n\n /**\n * Create GLOB_CHARS\n */\n\n globChars(win32) {\n return win32 === true ? WINDOWS_CHARS : POSIX_CHARS;\n }\n};\n","/*global navigator*/\n'use strict';\n\nconst {\n REGEX_BACKSLASH,\n REGEX_REMOVE_BACKSLASH,\n REGEX_SPECIAL_CHARS,\n REGEX_SPECIAL_CHARS_GLOBAL\n} = require('./constants');\n\nexports.isObject = val => val !== null && typeof val === 'object' && !Array.isArray(val);\nexports.hasRegexChars = str => REGEX_SPECIAL_CHARS.test(str);\nexports.isRegexChar = str => str.length === 1 && exports.hasRegexChars(str);\nexports.escapeRegex = str => str.replace(REGEX_SPECIAL_CHARS_GLOBAL, '\\\\$1');\nexports.toPosixSlashes = str => str.replace(REGEX_BACKSLASH, '/');\n\nexports.isWindows = () => {\n if (typeof navigator !== 'undefined' && navigator.platform) {\n const platform = navigator.platform.toLowerCase();\n return platform === 'win32' || platform === 'windows';\n }\n\n if (typeof process !== 'undefined' && process.platform) {\n return process.platform === 'win32';\n }\n\n return false;\n};\n\nexports.removeBackslashes = str => {\n return str.replace(REGEX_REMOVE_BACKSLASH, match => {\n return match === '\\\\' ? '' : match;\n });\n};\n\nexports.escapeLast = (input, char, lastIdx) => {\n const idx = input.lastIndexOf(char, lastIdx);\n if (idx === -1) return input;\n if (input[idx - 1] === '\\\\') return exports.escapeLast(input, char, idx - 1);\n return `${input.slice(0, idx)}\\\\${input.slice(idx)}`;\n};\n\nexports.removePrefix = (input, state = {}) => {\n let output = input;\n if (output.startsWith('./')) {\n output = output.slice(2);\n state.prefix = './';\n }\n return output;\n};\n\nexports.wrapOutput = (input, state = {}, options = {}) => {\n const prepend = options.contains ? '' : '^';\n const append = options.contains ? '' : '$';\n\n let output = `${prepend}(?:${input})${append}`;\n if (state.negated === true) {\n output = `(?:^(?!${output}).*$)`;\n }\n return output;\n};\n\nexports.basename = (path, { windows } = {}) => {\n const segs = path.split(windows ? /[\\\\/]/ : '/');\n const last = segs[segs.length - 1];\n\n if (last === '') {\n return segs[segs.length - 2];\n }\n\n return last;\n};\n","'use strict';\n\nconst utils = require('./utils');\nconst {\n CHAR_ASTERISK, /* * */\n CHAR_AT, /* @ */\n CHAR_BACKWARD_SLASH, /* \\ */\n CHAR_COMMA, /* , */\n CHAR_DOT, /* . */\n CHAR_EXCLAMATION_MARK, /* ! */\n CHAR_FORWARD_SLASH, /* / */\n CHAR_LEFT_CURLY_BRACE, /* { */\n CHAR_LEFT_PARENTHESES, /* ( */\n CHAR_LEFT_SQUARE_BRACKET, /* [ */\n CHAR_PLUS, /* + */\n CHAR_QUESTION_MARK, /* ? */\n CHAR_RIGHT_CURLY_BRACE, /* } */\n CHAR_RIGHT_PARENTHESES, /* ) */\n CHAR_RIGHT_SQUARE_BRACKET /* ] */\n} = require('./constants');\n\nconst isPathSeparator = code => {\n return code === CHAR_FORWARD_SLASH || code === CHAR_BACKWARD_SLASH;\n};\n\nconst depth = token => {\n if (token.isPrefix !== true) {\n token.depth = token.isGlobstar ? Infinity : 1;\n }\n};\n\n/**\n * Quickly scans a glob pattern and returns an object with a handful of\n * useful properties, like `isGlob`, `path` (the leading non-glob, if it exists),\n * `glob` (the actual pattern), `negated` (true if the path starts with `!` but not\n * with `!(`) and `negatedExtglob` (true if the path starts with `!(`).\n *\n * ```js\n * const pm = require('picomatch');\n * console.log(pm.scan('foo/bar/*.js'));\n * { isGlob: true, input: 'foo/bar/*.js', base: 'foo/bar', glob: '*.js' }\n * ```\n * @param {String} `str`\n * @param {Object} `options`\n * @return {Object} Returns an object with tokens and regex source string.\n * @api public\n */\n\nconst scan = (input, options) => {\n const opts = options || {};\n\n const length = input.length - 1;\n const scanToEnd = opts.parts === true || opts.scanToEnd === true;\n const slashes = [];\n const tokens = [];\n const parts = [];\n\n let str = input;\n let index = -1;\n let start = 0;\n let lastIndex = 0;\n let isBrace = false;\n let isBracket = false;\n let isGlob = false;\n let isExtglob = false;\n let isGlobstar = false;\n let braceEscaped = false;\n let backslashes = false;\n let negated = false;\n let negatedExtglob = false;\n let finished = false;\n let braces = 0;\n let prev;\n let code;\n let token = { value: '', depth: 0, isGlob: false };\n\n const eos = () => index >= length;\n const peek = () => str.charCodeAt(index + 1);\n const advance = () => {\n prev = code;\n return str.charCodeAt(++index);\n };\n\n while (index < length) {\n code = advance();\n let next;\n\n if (code === CHAR_BACKWARD_SLASH) {\n backslashes = token.backslashes = true;\n code = advance();\n\n if (code === CHAR_LEFT_CURLY_BRACE) {\n braceEscaped = true;\n }\n continue;\n }\n\n if (braceEscaped === true || code === CHAR_LEFT_CURLY_BRACE) {\n braces++;\n\n while (eos() !== true && (code = advance())) {\n if (code === CHAR_BACKWARD_SLASH) {\n backslashes = token.backslashes = true;\n advance();\n continue;\n }\n\n if (code === CHAR_LEFT_CURLY_BRACE) {\n braces++;\n continue;\n }\n\n if (braceEscaped !== true && code === CHAR_DOT && (code = advance()) === CHAR_DOT) {\n isBrace = token.isBrace = true;\n isGlob = token.isGlob = true;\n finished = true;\n\n if (scanToEnd === true) {\n continue;\n }\n\n break;\n }\n\n if (braceEscaped !== true && code === CHAR_COMMA) {\n isBrace = token.isBrace = true;\n isGlob = token.isGlob = true;\n finished = true;\n\n if (scanToEnd === true) {\n continue;\n }\n\n break;\n }\n\n if (code === CHAR_RIGHT_CURLY_BRACE) {\n braces--;\n\n if (braces === 0) {\n braceEscaped = false;\n isBrace = token.isBrace = true;\n finished = true;\n break;\n }\n }\n }\n\n if (scanToEnd === true) {\n continue;\n }\n\n break;\n }\n\n if (code === CHAR_FORWARD_SLASH) {\n slashes.push(index);\n tokens.push(token);\n token = { value: '', depth: 0, isGlob: false };\n\n if (finished === true) continue;\n if (prev === CHAR_DOT && index === (start + 1)) {\n start += 2;\n continue;\n }\n\n lastIndex = index + 1;\n continue;\n }\n\n if (opts.noext !== true) {\n const isExtglobChar = code === CHAR_PLUS\n || code === CHAR_AT\n || code === CHAR_ASTERISK\n || code === CHAR_QUESTION_MARK\n || code === CHAR_EXCLAMATION_MARK;\n\n if (isExtglobChar === true && peek() === CHAR_LEFT_PARENTHESES) {\n isGlob = token.isGlob = true;\n isExtglob = token.isExtglob = true;\n finished = true;\n if (code === CHAR_EXCLAMATION_MARK && index === start) {\n negatedExtglob = true;\n }\n\n if (scanToEnd === true) {\n while (eos() !== true && (code = advance())) {\n if (code === CHAR_BACKWARD_SLASH) {\n backslashes = token.backslashes = true;\n code = advance();\n continue;\n }\n\n if (code === CHAR_RIGHT_PARENTHESES) {\n isGlob = token.isGlob = true;\n finished = true;\n break;\n }\n }\n continue;\n }\n break;\n }\n }\n\n if (code === CHAR_ASTERISK) {\n if (prev === CHAR_ASTERISK) isGlobstar = token.isGlobstar = true;\n isGlob = token.isGlob = true;\n finished = true;\n\n if (scanToEnd === true) {\n continue;\n }\n break;\n }\n\n if (code === CHAR_QUESTION_MARK) {\n isGlob = token.isGlob = true;\n finished = true;\n\n if (scanToEnd === true) {\n continue;\n }\n break;\n }\n\n if (code === CHAR_LEFT_SQUARE_BRACKET) {\n while (eos() !== true && (next = advance())) {\n if (next === CHAR_BACKWARD_SLASH) {\n backslashes = token.backslashes = true;\n advance();\n continue;\n }\n\n if (next === CHAR_RIGHT_SQUARE_BRACKET) {\n isBracket = token.isBracket = true;\n isGlob = token.isGlob = true;\n finished = true;\n break;\n }\n }\n\n if (scanToEnd === true) {\n continue;\n }\n\n break;\n }\n\n if (opts.nonegate !== true && code === CHAR_EXCLAMATION_MARK && index === start) {\n negated = token.negated = true;\n start++;\n continue;\n }\n\n if (opts.noparen !== true && code === CHAR_LEFT_PARENTHESES) {\n isGlob = token.isGlob = true;\n\n if (scanToEnd === true) {\n while (eos() !== true && (code = advance())) {\n if (code === CHAR_LEFT_PARENTHESES) {\n backslashes = token.backslashes = true;\n code = advance();\n continue;\n }\n\n if (code === CHAR_RIGHT_PARENTHESES) {\n finished = true;\n break;\n }\n }\n continue;\n }\n break;\n }\n\n if (isGlob === true) {\n finished = true;\n\n if (scanToEnd === true) {\n continue;\n }\n\n break;\n }\n }\n\n if (opts.noext === true) {\n isExtglob = false;\n isGlob = false;\n }\n\n let base = str;\n let prefix = '';\n let glob = '';\n\n if (start > 0) {\n prefix = str.slice(0, start);\n str = str.slice(start);\n lastIndex -= start;\n }\n\n if (base && isGlob === true && lastIndex > 0) {\n base = str.slice(0, lastIndex);\n glob = str.slice(lastIndex);\n } else if (isGlob === true) {\n base = '';\n glob = str;\n } else {\n base = str;\n }\n\n if (base && base !== '' && base !== '/' && base !== str) {\n if (isPathSeparator(base.charCodeAt(base.length - 1))) {\n base = base.slice(0, -1);\n }\n }\n\n if (opts.unescape === true) {\n if (glob) glob = utils.removeBackslashes(glob);\n\n if (base && backslashes === true) {\n base = utils.removeBackslashes(base);\n }\n }\n\n const state = {\n prefix,\n input,\n start,\n base,\n glob,\n isBrace,\n isBracket,\n isGlob,\n isExtglob,\n isGlobstar,\n negated,\n negatedExtglob\n };\n\n if (opts.tokens === true) {\n state.maxDepth = 0;\n if (!isPathSeparator(code)) {\n tokens.push(token);\n }\n state.tokens = tokens;\n }\n\n if (opts.parts === true || opts.tokens === true) {\n let prevIndex;\n\n for (let idx = 0; idx < slashes.length; idx++) {\n const n = prevIndex ? prevIndex + 1 : start;\n const i = slashes[idx];\n const value = input.slice(n, i);\n if (opts.tokens) {\n if (idx === 0 && start !== 0) {\n tokens[idx].isPrefix = true;\n tokens[idx].value = prefix;\n } else {\n tokens[idx].value = value;\n }\n depth(tokens[idx]);\n state.maxDepth += tokens[idx].depth;\n }\n if (idx !== 0 || value !== '') {\n parts.push(value);\n }\n prevIndex = i;\n }\n\n if (prevIndex && prevIndex + 1 < input.length) {\n const value = input.slice(prevIndex + 1);\n parts.push(value);\n\n if (opts.tokens) {\n tokens[tokens.length - 1].value = value;\n depth(tokens[tokens.length - 1]);\n state.maxDepth += tokens[tokens.length - 1].depth;\n }\n }\n\n state.slashes = slashes;\n state.parts = parts;\n }\n\n return state;\n};\n\nmodule.exports = scan;\n","'use strict';\n\nconst constants = require('./constants');\nconst utils = require('./utils');\n\n/**\n * Constants\n */\n\nconst {\n MAX_LENGTH,\n POSIX_REGEX_SOURCE,\n REGEX_NON_SPECIAL_CHARS,\n REGEX_SPECIAL_CHARS_BACKREF,\n REPLACEMENTS\n} = constants;\n\n/**\n * Helpers\n */\n\nconst expandRange = (args, options) => {\n if (typeof options.expandRange === 'function') {\n return options.expandRange(...args, options);\n }\n\n args.sort();\n const value = `[${args.join('-')}]`;\n\n try {\n /* eslint-disable-next-line no-new */\n new RegExp(value);\n } catch (ex) {\n return args.map(v => utils.escapeRegex(v)).join('..');\n }\n\n return value;\n};\n\n/**\n * Create the message for a syntax error\n */\n\nconst syntaxError = (type, char) => {\n return `Missing ${type}: \"${char}\" - use \"\\\\\\\\${char}\" to match literal characters`;\n};\n\n/**\n * Parse the given input string.\n * @param {String} input\n * @param {Object} options\n * @return {Object}\n */\n\nconst parse = (input, options) => {\n if (typeof input !== 'string') {\n throw new TypeError('Expected a string');\n }\n\n input = REPLACEMENTS[input] || input;\n\n const opts = { ...options };\n const max = typeof opts.maxLength === 'number' ? Math.min(MAX_LENGTH, opts.maxLength) : MAX_LENGTH;\n\n let len = input.length;\n if (len > max) {\n throw new SyntaxError(`Input length: ${len}, exceeds maximum allowed length: ${max}`);\n }\n\n const bos = { type: 'bos', value: '', output: opts.prepend || '' };\n const tokens = [bos];\n\n const capture = opts.capture ? '' : '?:';\n\n // create constants based on platform, for windows or posix\n const PLATFORM_CHARS = constants.globChars(opts.windows);\n const EXTGLOB_CHARS = constants.extglobChars(PLATFORM_CHARS);\n\n const {\n DOT_LITERAL,\n PLUS_LITERAL,\n SLASH_LITERAL,\n ONE_CHAR,\n DOTS_SLASH,\n NO_DOT,\n NO_DOT_SLASH,\n NO_DOTS_SLASH,\n QMARK,\n QMARK_NO_DOT,\n STAR,\n START_ANCHOR\n } = PLATFORM_CHARS;\n\n const globstar = opts => {\n return `(${capture}(?:(?!${START_ANCHOR}${opts.dot ? DOTS_SLASH : DOT_LITERAL}).)*?)`;\n };\n\n const nodot = opts.dot ? '' : NO_DOT;\n const qmarkNoDot = opts.dot ? QMARK : QMARK_NO_DOT;\n let star = opts.bash === true ? globstar(opts) : STAR;\n\n if (opts.capture) {\n star = `(${star})`;\n }\n\n // minimatch options support\n if (typeof opts.noext === 'boolean') {\n opts.noextglob = opts.noext;\n }\n\n const state = {\n input,\n index: -1,\n start: 0,\n dot: opts.dot === true,\n consumed: '',\n output: '',\n prefix: '',\n backtrack: false,\n negated: false,\n brackets: 0,\n braces: 0,\n parens: 0,\n quotes: 0,\n globstar: false,\n tokens\n };\n\n input = utils.removePrefix(input, state);\n len = input.length;\n\n const extglobs = [];\n const braces = [];\n const stack = [];\n let prev = bos;\n let value;\n\n /**\n * Tokenizing helpers\n */\n\n const eos = () => state.index === len - 1;\n const peek = state.peek = (n = 1) => input[state.index + n];\n const advance = state.advance = () => input[++state.index] || '';\n const remaining = () => input.slice(state.index + 1);\n const consume = (value = '', num = 0) => {\n state.consumed += value;\n state.index += num;\n };\n\n const append = token => {\n state.output += token.output != null ? token.output : token.value;\n consume(token.value);\n };\n\n const negate = () => {\n let count = 1;\n\n while (peek() === '!' && (peek(2) !== '(' || peek(3) === '?')) {\n advance();\n state.start++;\n count++;\n }\n\n if (count % 2 === 0) {\n return false;\n }\n\n state.negated = true;\n state.start++;\n return true;\n };\n\n const increment = type => {\n state[type]++;\n stack.push(type);\n };\n\n const decrement = type => {\n state[type]--;\n stack.pop();\n };\n\n /**\n * Push tokens onto the tokens array. This helper speeds up\n * tokenizing by 1) helping us avoid backtracking as much as possible,\n * and 2) helping us avoid creating extra tokens when consecutive\n * characters are plain text. This improves performance and simplifies\n * lookbehinds.\n */\n\n const push = tok => {\n if (prev.type === 'globstar') {\n const isBrace = state.braces > 0 && (tok.type === 'comma' || tok.type === 'brace');\n const isExtglob = tok.extglob === true || (extglobs.length && (tok.type === 'pipe' || tok.type === 'paren'));\n\n if (tok.type !== 'slash' && tok.type !== 'paren' && !isBrace && !isExtglob) {\n state.output = state.output.slice(0, -prev.output.length);\n prev.type = 'star';\n prev.value = '*';\n prev.output = star;\n state.output += prev.output;\n }\n }\n\n if (extglobs.length && tok.type !== 'paren') {\n extglobs[extglobs.length - 1].inner += tok.value;\n }\n\n if (tok.value || tok.output) append(tok);\n if (prev && prev.type === 'text' && tok.type === 'text') {\n prev.output = (prev.output || prev.value) + tok.value;\n prev.value += tok.value;\n return;\n }\n\n tok.prev = prev;\n tokens.push(tok);\n prev = tok;\n };\n\n const extglobOpen = (type, value) => {\n const token = { ...EXTGLOB_CHARS[value], conditions: 1, inner: '' };\n\n token.prev = prev;\n token.parens = state.parens;\n token.output = state.output;\n const output = (opts.capture ? '(' : '') + token.open;\n\n increment('parens');\n push({ type, value, output: state.output ? '' : ONE_CHAR });\n push({ type: 'paren', extglob: true, value: advance(), output });\n extglobs.push(token);\n };\n\n const extglobClose = token => {\n let output = token.close + (opts.capture ? ')' : '');\n let rest;\n\n if (token.type === 'negate') {\n let extglobStar = star;\n\n if (token.inner && token.inner.length > 1 && token.inner.includes('/')) {\n extglobStar = globstar(opts);\n }\n\n if (extglobStar !== star || eos() || /^\\)+$/.test(remaining())) {\n output = token.close = `)$))${extglobStar}`;\n }\n\n if (token.inner.includes('*') && (rest = remaining()) && /^\\.[^\\\\/.]+$/.test(rest)) {\n // Any non-magical string (`.ts`) or even nested expression (`.{ts,tsx}`) can follow after the closing parenthesis.\n // In this case, we need to parse the string and use it in the output of the original pattern.\n // Suitable patterns: `/!(*.d).ts`, `/!(*.d).{ts,tsx}`, `**/!(*-dbg).@(js)`.\n //\n // Disabling the `fastpaths` option due to a problem with parsing strings as `.ts` in the pattern like `**/!(*.d).ts`.\n const expression = parse(rest, { ...options, fastpaths: false }).output;\n\n output = token.close = `)${expression})${extglobStar})`;\n }\n\n if (token.prev.type === 'bos') {\n state.negatedExtglob = true;\n }\n }\n\n push({ type: 'paren', extglob: true, value, output });\n decrement('parens');\n };\n\n /**\n * Fast paths\n */\n\n if (opts.fastpaths !== false && !/(^[*!]|[/()[\\]{}\"])/.test(input)) {\n let backslashes = false;\n\n let output = input.replace(REGEX_SPECIAL_CHARS_BACKREF, (m, esc, chars, first, rest, index) => {\n if (first === '\\\\') {\n backslashes = true;\n return m;\n }\n\n if (first === '?') {\n if (esc) {\n return esc + first + (rest ? QMARK.repeat(rest.length) : '');\n }\n if (index === 0) {\n return qmarkNoDot + (rest ? QMARK.repeat(rest.length) : '');\n }\n return QMARK.repeat(chars.length);\n }\n\n if (first === '.') {\n return DOT_LITERAL.repeat(chars.length);\n }\n\n if (first === '*') {\n if (esc) {\n return esc + first + (rest ? star : '');\n }\n return star;\n }\n return esc ? m : `\\\\${m}`;\n });\n\n if (backslashes === true) {\n if (opts.unescape === true) {\n output = output.replace(/\\\\/g, '');\n } else {\n output = output.replace(/\\\\+/g, m => {\n return m.length % 2 === 0 ? '\\\\\\\\' : (m ? '\\\\' : '');\n });\n }\n }\n\n if (output === input && opts.contains === true) {\n state.output = input;\n return state;\n }\n\n state.output = utils.wrapOutput(output, state, options);\n return state;\n }\n\n /**\n * Tokenize input until we reach end-of-string\n */\n\n while (!eos()) {\n value = advance();\n\n if (value === '\\u0000') {\n continue;\n }\n\n /**\n * Escaped characters\n */\n\n if (value === '\\\\') {\n const next = peek();\n\n if (next === '/' && opts.bash !== true) {\n continue;\n }\n\n if (next === '.' || next === ';') {\n continue;\n }\n\n if (!next) {\n value += '\\\\';\n push({ type: 'text', value });\n continue;\n }\n\n // collapse slashes to reduce potential for exploits\n const match = /^\\\\+/.exec(remaining());\n let slashes = 0;\n\n if (match && match[0].length > 2) {\n slashes = match[0].length;\n state.index += slashes;\n if (slashes % 2 !== 0) {\n value += '\\\\';\n }\n }\n\n if (opts.unescape === true) {\n value = advance();\n } else {\n value += advance();\n }\n\n if (state.brackets === 0) {\n push({ type: 'text', value });\n continue;\n }\n }\n\n /**\n * If we're inside a regex character class, continue\n * until we reach the closing bracket.\n */\n\n if (state.brackets > 0 && (value !== ']' || prev.value === '[' || prev.value === '[^')) {\n if (opts.posix !== false && value === ':') {\n const inner = prev.value.slice(1);\n if (inner.includes('[')) {\n prev.posix = true;\n\n if (inner.includes(':')) {\n const idx = prev.value.lastIndexOf('[');\n const pre = prev.value.slice(0, idx);\n const rest = prev.value.slice(idx + 2);\n const posix = POSIX_REGEX_SOURCE[rest];\n if (posix) {\n prev.value = pre + posix;\n state.backtrack = true;\n advance();\n\n if (!bos.output && tokens.indexOf(prev) === 1) {\n bos.output = ONE_CHAR;\n }\n continue;\n }\n }\n }\n }\n\n if ((value === '[' && peek() !== ':') || (value === '-' && peek() === ']')) {\n value = `\\\\${value}`;\n }\n\n if (value === ']' && (prev.value === '[' || prev.value === '[^')) {\n value = `\\\\${value}`;\n }\n\n if (opts.posix === true && value === '!' && prev.value === '[') {\n value = '^';\n }\n\n prev.value += value;\n append({ value });\n continue;\n }\n\n /**\n * If we're inside a quoted string, continue\n * until we reach the closing double quote.\n */\n\n if (state.quotes === 1 && value !== '\"') {\n value = utils.escapeRegex(value);\n prev.value += value;\n append({ value });\n continue;\n }\n\n /**\n * Double quotes\n */\n\n if (value === '\"') {\n state.quotes = state.quotes === 1 ? 0 : 1;\n if (opts.keepQuotes === true) {\n push({ type: 'text', value });\n }\n continue;\n }\n\n /**\n * Parentheses\n */\n\n if (value === '(') {\n increment('parens');\n push({ type: 'paren', value });\n continue;\n }\n\n if (value === ')') {\n if (state.parens === 0 && opts.strictBrackets === true) {\n throw new SyntaxError(syntaxError('opening', '('));\n }\n\n const extglob = extglobs[extglobs.length - 1];\n if (extglob && state.parens === extglob.parens + 1) {\n extglobClose(extglobs.pop());\n continue;\n }\n\n push({ type: 'paren', value, output: state.parens ? ')' : '\\\\)' });\n decrement('parens');\n continue;\n }\n\n /**\n * Square brackets\n */\n\n if (value === '[') {\n if (opts.nobracket === true || !remaining().includes(']')) {\n if (opts.nobracket !== true && opts.strictBrackets === true) {\n throw new SyntaxError(syntaxError('closing', ']'));\n }\n\n value = `\\\\${value}`;\n } else {\n increment('brackets');\n }\n\n push({ type: 'bracket', value });\n continue;\n }\n\n if (value === ']') {\n if (opts.nobracket === true || (prev && prev.type === 'bracket' && prev.value.length === 1)) {\n push({ type: 'text', value, output: `\\\\${value}` });\n continue;\n }\n\n if (state.brackets === 0) {\n if (opts.strictBrackets === true) {\n throw new SyntaxError(syntaxError('opening', '['));\n }\n\n push({ type: 'text', value, output: `\\\\${value}` });\n continue;\n }\n\n decrement('brackets');\n\n const prevValue = prev.value.slice(1);\n if (prev.posix !== true && prevValue[0] === '^' && !prevValue.includes('/')) {\n value = `/${value}`;\n }\n\n prev.value += value;\n append({ value });\n\n // when literal brackets are explicitly disabled\n // assume we should match with a regex character class\n if (opts.literalBrackets === false || utils.hasRegexChars(prevValue)) {\n continue;\n }\n\n const escaped = utils.escapeRegex(prev.value);\n state.output = state.output.slice(0, -prev.value.length);\n\n // when literal brackets are explicitly enabled\n // assume we should escape the brackets to match literal characters\n if (opts.literalBrackets === true) {\n state.output += escaped;\n prev.value = escaped;\n continue;\n }\n\n // when the user specifies nothing, try to match both\n prev.value = `(${capture}${escaped}|${prev.value})`;\n state.output += prev.value;\n continue;\n }\n\n /**\n * Braces\n */\n\n if (value === '{' && opts.nobrace !== true) {\n increment('braces');\n\n const open = {\n type: 'brace',\n value,\n output: '(',\n outputIndex: state.output.length,\n tokensIndex: state.tokens.length\n };\n\n braces.push(open);\n push(open);\n continue;\n }\n\n if (value === '}') {\n const brace = braces[braces.length - 1];\n\n if (opts.nobrace === true || !brace) {\n push({ type: 'text', value, output: value });\n continue;\n }\n\n let output = ')';\n\n if (brace.dots === true) {\n const arr = tokens.slice();\n const range = [];\n\n for (let i = arr.length - 1; i >= 0; i--) {\n tokens.pop();\n if (arr[i].type === 'brace') {\n break;\n }\n if (arr[i].type !== 'dots') {\n range.unshift(arr[i].value);\n }\n }\n\n output = expandRange(range, opts);\n state.backtrack = true;\n }\n\n if (brace.comma !== true && brace.dots !== true) {\n const out = state.output.slice(0, brace.outputIndex);\n const toks = state.tokens.slice(brace.tokensIndex);\n brace.value = brace.output = '\\\\{';\n value = output = '\\\\}';\n state.output = out;\n for (const t of toks) {\n state.output += (t.output || t.value);\n }\n }\n\n push({ type: 'brace', value, output });\n decrement('braces');\n braces.pop();\n continue;\n }\n\n /**\n * Pipes\n */\n\n if (value === '|') {\n if (extglobs.length > 0) {\n extglobs[extglobs.length - 1].conditions++;\n }\n push({ type: 'text', value });\n continue;\n }\n\n /**\n * Commas\n */\n\n if (value === ',') {\n let output = value;\n\n const brace = braces[braces.length - 1];\n if (brace && stack[stack.length - 1] === 'braces') {\n brace.comma = true;\n output = '|';\n }\n\n push({ type: 'comma', value, output });\n continue;\n }\n\n /**\n * Slashes\n */\n\n if (value === '/') {\n // if the beginning of the glob is \"./\", advance the start\n // to the current index, and don't add the \"./\" characters\n // to the state. This greatly simplifies lookbehinds when\n // checking for BOS characters like \"!\" and \".\" (not \"./\")\n if (prev.type === 'dot' && state.index === state.start + 1) {\n state.start = state.index + 1;\n state.consumed = '';\n state.output = '';\n tokens.pop();\n prev = bos; // reset \"prev\" to the first token\n continue;\n }\n\n push({ type: 'slash', value, output: SLASH_LITERAL });\n continue;\n }\n\n /**\n * Dots\n */\n\n if (value === '.') {\n if (state.braces > 0 && prev.type === 'dot') {\n if (prev.value === '.') prev.output = DOT_LITERAL;\n const brace = braces[braces.length - 1];\n prev.type = 'dots';\n prev.output += value;\n prev.value += value;\n brace.dots = true;\n continue;\n }\n\n if ((state.braces + state.parens) === 0 && prev.type !== 'bos' && prev.type !== 'slash') {\n push({ type: 'text', value, output: DOT_LITERAL });\n continue;\n }\n\n push({ type: 'dot', value, output: DOT_LITERAL });\n continue;\n }\n\n /**\n * Question marks\n */\n\n if (value === '?') {\n const isGroup = prev && prev.value === '(';\n if (!isGroup && opts.noextglob !== true && peek() === '(' && peek(2) !== '?') {\n extglobOpen('qmark', value);\n continue;\n }\n\n if (prev && prev.type === 'paren') {\n const next = peek();\n let output = value;\n\n if ((prev.value === '(' && !/[!=<:]/.test(next)) || (next === '<' && !/<([!=]|\\w+>)/.test(remaining()))) {\n output = `\\\\${value}`;\n }\n\n push({ type: 'text', value, output });\n continue;\n }\n\n if (opts.dot !== true && (prev.type === 'slash' || prev.type === 'bos')) {\n push({ type: 'qmark', value, output: QMARK_NO_DOT });\n continue;\n }\n\n push({ type: 'qmark', value, output: QMARK });\n continue;\n }\n\n /**\n * Exclamation\n */\n\n if (value === '!') {\n if (opts.noextglob !== true && peek() === '(') {\n if (peek(2) !== '?' || !/[!=<:]/.test(peek(3))) {\n extglobOpen('negate', value);\n continue;\n }\n }\n\n if (opts.nonegate !== true && state.index === 0) {\n negate();\n continue;\n }\n }\n\n /**\n * Plus\n */\n\n if (value === '+') {\n if (opts.noextglob !== true && peek() === '(' && peek(2) !== '?') {\n extglobOpen('plus', value);\n continue;\n }\n\n if ((prev && prev.value === '(') || opts.regex === false) {\n push({ type: 'plus', value, output: PLUS_LITERAL });\n continue;\n }\n\n if ((prev && (prev.type === 'bracket' || prev.type === 'paren' || prev.type === 'brace')) || state.parens > 0) {\n push({ type: 'plus', value });\n continue;\n }\n\n push({ type: 'plus', value: PLUS_LITERAL });\n continue;\n }\n\n /**\n * Plain text\n */\n\n if (value === '@') {\n if (opts.noextglob !== true && peek() === '(' && peek(2) !== '?') {\n push({ type: 'at', extglob: true, value, output: '' });\n continue;\n }\n\n push({ type: 'text', value });\n continue;\n }\n\n /**\n * Plain text\n */\n\n if (value !== '*') {\n if (value === '$' || value === '^') {\n value = `\\\\${value}`;\n }\n\n const match = REGEX_NON_SPECIAL_CHARS.exec(remaining());\n if (match) {\n value += match[0];\n state.index += match[0].length;\n }\n\n push({ type: 'text', value });\n continue;\n }\n\n /**\n * Stars\n */\n\n if (prev && (prev.type === 'globstar' || prev.star === true)) {\n prev.type = 'star';\n prev.star = true;\n prev.value += value;\n prev.output = star;\n state.backtrack = true;\n state.globstar = true;\n consume(value);\n continue;\n }\n\n let rest = remaining();\n if (opts.noextglob !== true && /^\\([^?]/.test(rest)) {\n extglobOpen('star', value);\n continue;\n }\n\n if (prev.type === 'star') {\n if (opts.noglobstar === true) {\n consume(value);\n continue;\n }\n\n const prior = prev.prev;\n const before = prior.prev;\n const isStart = prior.type === 'slash' || prior.type === 'bos';\n const afterStar = before && (before.type === 'star' || before.type === 'globstar');\n\n if (opts.bash === true && (!isStart || (rest[0] && rest[0] !== '/'))) {\n push({ type: 'star', value, output: '' });\n continue;\n }\n\n const isBrace = state.braces > 0 && (prior.type === 'comma' || prior.type === 'brace');\n const isExtglob = extglobs.length && (prior.type === 'pipe' || prior.type === 'paren');\n if (!isStart && prior.type !== 'paren' && !isBrace && !isExtglob) {\n push({ type: 'star', value, output: '' });\n continue;\n }\n\n // strip consecutive `/**/`\n while (rest.slice(0, 3) === '/**') {\n const after = input[state.index + 4];\n if (after && after !== '/') {\n break;\n }\n rest = rest.slice(3);\n consume('/**', 3);\n }\n\n if (prior.type === 'bos' && eos()) {\n prev.type = 'globstar';\n prev.value += value;\n prev.output = globstar(opts);\n state.output = prev.output;\n state.globstar = true;\n consume(value);\n continue;\n }\n\n if (prior.type === 'slash' && prior.prev.type !== 'bos' && !afterStar && eos()) {\n state.output = state.output.slice(0, -(prior.output + prev.output).length);\n prior.output = `(?:${prior.output}`;\n\n prev.type = 'globstar';\n prev.output = globstar(opts) + (opts.strictSlashes ? ')' : '|$)');\n prev.value += value;\n state.globstar = true;\n state.output += prior.output + prev.output;\n consume(value);\n continue;\n }\n\n if (prior.type === 'slash' && prior.prev.type !== 'bos' && rest[0] === '/') {\n const end = rest[1] !== void 0 ? '|$' : '';\n\n state.output = state.output.slice(0, -(prior.output + prev.output).length);\n prior.output = `(?:${prior.output}`;\n\n prev.type = 'globstar';\n prev.output = `${globstar(opts)}${SLASH_LITERAL}|${SLASH_LITERAL}${end})`;\n prev.value += value;\n\n state.output += prior.output + prev.output;\n state.globstar = true;\n\n consume(value + advance());\n\n push({ type: 'slash', value: '/', output: '' });\n continue;\n }\n\n if (prior.type === 'bos' && rest[0] === '/') {\n prev.type = 'globstar';\n prev.value += value;\n prev.output = `(?:^|${SLASH_LITERAL}|${globstar(opts)}${SLASH_LITERAL})`;\n state.output = prev.output;\n state.globstar = true;\n consume(value + advance());\n push({ type: 'slash', value: '/', output: '' });\n continue;\n }\n\n // remove single star from output\n state.output = state.output.slice(0, -prev.output.length);\n\n // reset previous token to globstar\n prev.type = 'globstar';\n prev.output = globstar(opts);\n prev.value += value;\n\n // reset output with globstar\n state.output += prev.output;\n state.globstar = true;\n consume(value);\n continue;\n }\n\n const token = { type: 'star', value, output: star };\n\n if (opts.bash === true) {\n token.output = '.*?';\n if (prev.type === 'bos' || prev.type === 'slash') {\n token.output = nodot + token.output;\n }\n push(token);\n continue;\n }\n\n if (prev && (prev.type === 'bracket' || prev.type === 'paren') && opts.regex === true) {\n token.output = value;\n push(token);\n continue;\n }\n\n if (state.index === state.start || prev.type === 'slash' || prev.type === 'dot') {\n if (prev.type === 'dot') {\n state.output += NO_DOT_SLASH;\n prev.output += NO_DOT_SLASH;\n\n } else if (opts.dot === true) {\n state.output += NO_DOTS_SLASH;\n prev.output += NO_DOTS_SLASH;\n\n } else {\n state.output += nodot;\n prev.output += nodot;\n }\n\n if (peek() !== '*') {\n state.output += ONE_CHAR;\n prev.output += ONE_CHAR;\n }\n }\n\n push(token);\n }\n\n while (state.brackets > 0) {\n if (opts.strictBrackets === true) throw new SyntaxError(syntaxError('closing', ']'));\n state.output = utils.escapeLast(state.output, '[');\n decrement('brackets');\n }\n\n while (state.parens > 0) {\n if (opts.strictBrackets === true) throw new SyntaxError(syntaxError('closing', ')'));\n state.output = utils.escapeLast(state.output, '(');\n decrement('parens');\n }\n\n while (state.braces > 0) {\n if (opts.strictBrackets === true) throw new SyntaxError(syntaxError('closing', '}'));\n state.output = utils.escapeLast(state.output, '{');\n decrement('braces');\n }\n\n if (opts.strictSlashes !== true && (prev.type === 'star' || prev.type === 'bracket')) {\n push({ type: 'maybe_slash', value: '', output: `${SLASH_LITERAL}?` });\n }\n\n // rebuild the output if we had to backtrack at any point\n if (state.backtrack === true) {\n state.output = '';\n\n for (const token of state.tokens) {\n state.output += token.output != null ? token.output : token.value;\n\n if (token.suffix) {\n state.output += token.suffix;\n }\n }\n }\n\n return state;\n};\n\n/**\n * Fast paths for creating regular expressions for common glob patterns.\n * This can significantly speed up processing and has very little downside\n * impact when none of the fast paths match.\n */\n\nparse.fastpaths = (input, options) => {\n const opts = { ...options };\n const max = typeof opts.maxLength === 'number' ? Math.min(MAX_LENGTH, opts.maxLength) : MAX_LENGTH;\n const len = input.length;\n if (len > max) {\n throw new SyntaxError(`Input length: ${len}, exceeds maximum allowed length: ${max}`);\n }\n\n input = REPLACEMENTS[input] || input;\n\n // create constants based on platform, for windows or posix\n const {\n DOT_LITERAL,\n SLASH_LITERAL,\n ONE_CHAR,\n DOTS_SLASH,\n NO_DOT,\n NO_DOTS,\n NO_DOTS_SLASH,\n STAR,\n START_ANCHOR\n } = constants.globChars(opts.windows);\n\n const nodot = opts.dot ? NO_DOTS : NO_DOT;\n const slashDot = opts.dot ? NO_DOTS_SLASH : NO_DOT;\n const capture = opts.capture ? '' : '?:';\n const state = { negated: false, prefix: '' };\n let star = opts.bash === true ? '.*?' : STAR;\n\n if (opts.capture) {\n star = `(${star})`;\n }\n\n const globstar = opts => {\n if (opts.noglobstar === true) return star;\n return `(${capture}(?:(?!${START_ANCHOR}${opts.dot ? DOTS_SLASH : DOT_LITERAL}).)*?)`;\n };\n\n const create = str => {\n switch (str) {\n case '*':\n return `${nodot}${ONE_CHAR}${star}`;\n\n case '.*':\n return `${DOT_LITERAL}${ONE_CHAR}${star}`;\n\n case '*.*':\n return `${nodot}${star}${DOT_LITERAL}${ONE_CHAR}${star}`;\n\n case '*/*':\n return `${nodot}${star}${SLASH_LITERAL}${ONE_CHAR}${slashDot}${star}`;\n\n case '**':\n return nodot + globstar(opts);\n\n case '**/*':\n return `(?:${nodot}${globstar(opts)}${SLASH_LITERAL})?${slashDot}${ONE_CHAR}${star}`;\n\n case '**/*.*':\n return `(?:${nodot}${globstar(opts)}${SLASH_LITERAL})?${slashDot}${star}${DOT_LITERAL}${ONE_CHAR}${star}`;\n\n case '**/.*':\n return `(?:${nodot}${globstar(opts)}${SLASH_LITERAL})?${DOT_LITERAL}${ONE_CHAR}${star}`;\n\n default: {\n const match = /^(.*?)\\.(\\w+)$/.exec(str);\n if (!match) return;\n\n const source = create(match[1]);\n if (!source) return;\n\n return source + DOT_LITERAL + match[2];\n }\n }\n };\n\n const output = utils.removePrefix(input, state);\n let source = create(output);\n\n if (source && opts.strictSlashes !== true) {\n source += `${SLASH_LITERAL}?`;\n }\n\n return source;\n};\n\nmodule.exports = parse;\n","'use strict';\n\nconst scan = require('./scan');\nconst parse = require('./parse');\nconst utils = require('./utils');\nconst constants = require('./constants');\nconst isObject = val => val && typeof val === 'object' && !Array.isArray(val);\n\n/**\n * Creates a matcher function from one or more glob patterns. The\n * returned function takes a string to match as its first argument,\n * and returns true if the string is a match. The returned matcher\n * function also takes a boolean as the second argument that, when true,\n * returns an object with additional information.\n *\n * ```js\n * const picomatch = require('picomatch');\n * // picomatch(glob[, options]);\n *\n * const isMatch = picomatch('*.!(*a)');\n * console.log(isMatch('a.a')); //=> false\n * console.log(isMatch('a.b')); //=> true\n * ```\n * @name picomatch\n * @param {String|Array} `globs` One or more glob patterns.\n * @param {Object=} `options`\n * @return {Function=} Returns a matcher function.\n * @api public\n */\n\nconst picomatch = (glob, options, returnState = false) => {\n if (Array.isArray(glob)) {\n const fns = glob.map(input => picomatch(input, options, returnState));\n const arrayMatcher = str => {\n for (const isMatch of fns) {\n const state = isMatch(str);\n if (state) return state;\n }\n return false;\n };\n return arrayMatcher;\n }\n\n const isState = isObject(glob) && glob.tokens && glob.input;\n\n if (glob === '' || (typeof glob !== 'string' && !isState)) {\n throw new TypeError('Expected pattern to be a non-empty string');\n }\n\n const opts = options || {};\n const posix = opts.windows;\n const regex = isState\n ? picomatch.compileRe(glob, options)\n : picomatch.makeRe(glob, options, false, true);\n\n const state = regex.state;\n delete regex.state;\n\n let isIgnored = () => false;\n if (opts.ignore) {\n const ignoreOpts = { ...options, ignore: null, onMatch: null, onResult: null };\n isIgnored = picomatch(opts.ignore, ignoreOpts, returnState);\n }\n\n const matcher = (input, returnObject = false) => {\n const { isMatch, match, output } = picomatch.test(input, regex, options, { glob, posix });\n const result = { glob, state, regex, posix, input, output, match, isMatch };\n\n if (typeof opts.onResult === 'function') {\n opts.onResult(result);\n }\n\n if (isMatch === false) {\n result.isMatch = false;\n return returnObject ? result : false;\n }\n\n if (isIgnored(input)) {\n if (typeof opts.onIgnore === 'function') {\n opts.onIgnore(result);\n }\n result.isMatch = false;\n return returnObject ? result : false;\n }\n\n if (typeof opts.onMatch === 'function') {\n opts.onMatch(result);\n }\n return returnObject ? result : true;\n };\n\n if (returnState) {\n matcher.state = state;\n }\n\n return matcher;\n};\n\n/**\n * Test `input` with the given `regex`. This is used by the main\n * `picomatch()` function to test the input string.\n *\n * ```js\n * const picomatch = require('picomatch');\n * // picomatch.test(input, regex[, options]);\n *\n * console.log(picomatch.test('foo/bar', /^(?:([^/]*?)\\/([^/]*?))$/));\n * // { isMatch: true, match: [ 'foo/', 'foo', 'bar' ], output: 'foo/bar' }\n * ```\n * @param {String} `input` String to test.\n * @param {RegExp} `regex`\n * @return {Object} Returns an object with matching info.\n * @api public\n */\n\npicomatch.test = (input, regex, options, { glob, posix } = {}) => {\n if (typeof input !== 'string') {\n throw new TypeError('Expected input to be a string');\n }\n\n if (input === '') {\n return { isMatch: false, output: '' };\n }\n\n const opts = options || {};\n const format = opts.format || (posix ? utils.toPosixSlashes : null);\n let match = input === glob;\n let output = (match && format) ? format(input) : input;\n\n if (match === false) {\n output = format ? format(input) : input;\n match = output === glob;\n }\n\n if (match === false || opts.capture === true) {\n if (opts.matchBase === true || opts.basename === true) {\n match = picomatch.matchBase(input, regex, options, posix);\n } else {\n match = regex.exec(output);\n }\n }\n\n return { isMatch: Boolean(match), match, output };\n};\n\n/**\n * Match the basename of a filepath.\n *\n * ```js\n * const picomatch = require('picomatch');\n * // picomatch.matchBase(input, glob[, options]);\n * console.log(picomatch.matchBase('foo/bar.js', '*.js'); // true\n * ```\n * @param {String} `input` String to test.\n * @param {RegExp|String} `glob` Glob pattern or regex created by [.makeRe](#makeRe).\n * @return {Boolean}\n * @api public\n */\n\npicomatch.matchBase = (input, glob, options) => {\n const regex = glob instanceof RegExp ? glob : picomatch.makeRe(glob, options);\n return regex.test(utils.basename(input));\n};\n\n/**\n * Returns true if **any** of the given glob `patterns` match the specified `string`.\n *\n * ```js\n * const picomatch = require('picomatch');\n * // picomatch.isMatch(string, patterns[, options]);\n *\n * console.log(picomatch.isMatch('a.a', ['b.*', '*.a'])); //=> true\n * console.log(picomatch.isMatch('a.a', 'b.*')); //=> false\n * ```\n * @param {String|Array} str The string to test.\n * @param {String|Array} patterns One or more glob patterns to use for matching.\n * @param {Object} [options] See available [options](#options).\n * @return {Boolean} Returns true if any patterns match `str`\n * @api public\n */\n\npicomatch.isMatch = (str, patterns, options) => picomatch(patterns, options)(str);\n\n/**\n * Parse a glob pattern to create the source string for a regular\n * expression.\n *\n * ```js\n * const picomatch = require('picomatch');\n * const result = picomatch.parse(pattern[, options]);\n * ```\n * @param {String} `pattern`\n * @param {Object} `options`\n * @return {Object} Returns an object with useful properties and output to be used as a regex source string.\n * @api public\n */\n\npicomatch.parse = (pattern, options) => {\n if (Array.isArray(pattern)) return pattern.map(p => picomatch.parse(p, options));\n return parse(pattern, { ...options, fastpaths: false });\n};\n\n/**\n * Scan a glob pattern to separate the pattern into segments.\n *\n * ```js\n * const picomatch = require('picomatch');\n * // picomatch.scan(input[, options]);\n *\n * const result = picomatch.scan('!./foo/*.js');\n * console.log(result);\n * { prefix: '!./',\n * input: '!./foo/*.js',\n * start: 3,\n * base: 'foo',\n * glob: '*.js',\n * isBrace: false,\n * isBracket: false,\n * isGlob: true,\n * isExtglob: false,\n * isGlobstar: false,\n * negated: true }\n * ```\n * @param {String} `input` Glob pattern to scan.\n * @param {Object} `options`\n * @return {Object} Returns an object with\n * @api public\n */\n\npicomatch.scan = (input, options) => scan(input, options);\n\n/**\n * Compile a regular expression from the `state` object returned by the\n * [parse()](#parse) method.\n *\n * @param {Object} `state`\n * @param {Object} `options`\n * @param {Boolean} `returnOutput` Intended for implementors, this argument allows you to return the raw output from the parser.\n * @param {Boolean} `returnState` Adds the state to a `state` property on the returned regex. Useful for implementors and debugging.\n * @return {RegExp}\n * @api public\n */\n\npicomatch.compileRe = (state, options, returnOutput = false, returnState = false) => {\n if (returnOutput === true) {\n return state.output;\n }\n\n const opts = options || {};\n const prepend = opts.contains ? '' : '^';\n const append = opts.contains ? '' : '$';\n\n let source = `${prepend}(?:${state.output})${append}`;\n if (state && state.negated === true) {\n source = `^(?!${source}).*$`;\n }\n\n const regex = picomatch.toRegex(source, options);\n if (returnState === true) {\n regex.state = state;\n }\n\n return regex;\n};\n\n/**\n * Create a regular expression from a parsed glob pattern.\n *\n * ```js\n * const picomatch = require('picomatch');\n * const state = picomatch.parse('*.js');\n * // picomatch.compileRe(state[, options]);\n *\n * console.log(picomatch.compileRe(state));\n * //=> /^(?:(?!\\.)(?=.)[^/]*?\\.js)$/\n * ```\n * @param {String} `state` The object returned from the `.parse` method.\n * @param {Object} `options`\n * @param {Boolean} `returnOutput` Implementors may use this argument to return the compiled output, instead of a regular expression. This is not exposed on the options to prevent end-users from mutating the result.\n * @param {Boolean} `returnState` Implementors may use this argument to return the state from the parsed glob with the returned regular expression.\n * @return {RegExp} Returns a regex created from the given pattern.\n * @api public\n */\n\npicomatch.makeRe = (input, options = {}, returnOutput = false, returnState = false) => {\n if (!input || typeof input !== 'string') {\n throw new TypeError('Expected a non-empty string');\n }\n\n let parsed = { negated: false, fastpaths: true };\n\n if (options.fastpaths !== false && (input[0] === '.' || input[0] === '*')) {\n parsed.output = parse.fastpaths(input, options);\n }\n\n if (!parsed.output) {\n parsed = parse(input, options);\n }\n\n return picomatch.compileRe(parsed, options, returnOutput, returnState);\n};\n\n/**\n * Create a regular expression from the given regex source string.\n *\n * ```js\n * const picomatch = require('picomatch');\n * // picomatch.toRegex(source[, options]);\n *\n * const { output } = picomatch.parse('*.js');\n * console.log(picomatch.toRegex(output));\n * //=> /^(?:(?!\\.)(?=.)[^/]*?\\.js)$/\n * ```\n * @param {String} `source` Regular expression source string.\n * @param {Object} `options`\n * @return {RegExp}\n * @api public\n */\n\npicomatch.toRegex = (source, options) => {\n try {\n const opts = options || {};\n return new RegExp(source, opts.flags || (opts.nocase ? 'i' : ''));\n } catch (err) {\n if (options && options.debug === true) throw err;\n return /$^/;\n }\n};\n\n/**\n * Picomatch constants.\n * @return {Object}\n */\n\npicomatch.constants = constants;\n\n/**\n * Expose \"picomatch\"\n */\n\nmodule.exports = picomatch;\n","'use strict';\n\nconst pico = require('./lib/picomatch');\nconst utils = require('./lib/utils');\n\nfunction picomatch(glob, options, returnState = false) {\n // default to os.platform()\n if (options && (options.windows === null || options.windows === undefined)) {\n // don't mutate the original options object\n options = { ...options, windows: utils.isWindows() };\n }\n\n return pico(glob, options, returnState);\n}\n\nObject.assign(picomatch, pico);\nmodule.exports = picomatch;\n","import nativeFs from \"fs\";\nimport path, { posix } from \"path\";\nimport { fileURLToPath } from \"url\";\nimport { fdir } from \"fdir\";\nimport picomatch from \"picomatch\";\n\n//#region src/utils.ts\nconst isReadonlyArray = Array.isArray;\nconst isWin = process.platform === \"win32\";\nconst ONLY_PARENT_DIRECTORIES = /^(\\/?\\.\\.)+$/;\nfunction getPartialMatcher(patterns, options = {}) {\n\tconst patternsCount = patterns.length;\n\tconst patternsParts = Array(patternsCount);\n\tconst matchers = Array(patternsCount);\n\tconst globstarEnabled = !options.noglobstar;\n\tfor (let i = 0; i < patternsCount; i++) {\n\t\tconst parts = splitPattern(patterns[i]);\n\t\tpatternsParts[i] = parts;\n\t\tconst partsCount = parts.length;\n\t\tconst partMatchers = Array(partsCount);\n\t\tfor (let j = 0; j < partsCount; j++) partMatchers[j] = picomatch(parts[j], options);\n\t\tmatchers[i] = partMatchers;\n\t}\n\treturn (input) => {\n\t\tconst inputParts = input.split(\"/\");\n\t\tif (inputParts[0] === \"..\" && ONLY_PARENT_DIRECTORIES.test(input)) return true;\n\t\tfor (let i = 0; i < patterns.length; i++) {\n\t\t\tconst patternParts = patternsParts[i];\n\t\t\tconst matcher = matchers[i];\n\t\t\tconst inputPatternCount = inputParts.length;\n\t\t\tconst minParts = Math.min(inputPatternCount, patternParts.length);\n\t\t\tlet j = 0;\n\t\t\twhile (j < minParts) {\n\t\t\t\tconst part = patternParts[j];\n\t\t\t\tif (part.includes(\"/\")) return true;\n\t\t\t\tconst match = matcher[j](inputParts[j]);\n\t\t\t\tif (!match) break;\n\t\t\t\tif (globstarEnabled && part === \"**\") return true;\n\t\t\t\tj++;\n\t\t\t}\n\t\t\tif (j === inputPatternCount) return true;\n\t\t}\n\t\treturn false;\n\t};\n}\n/* node:coverage ignore next 2 */\nconst WIN32_ROOT_DIR = /^[A-Z]:\\/$/i;\nconst isRoot = isWin ? (p) => WIN32_ROOT_DIR.test(p) : (p) => p === \"/\";\nfunction buildFormat(cwd, root, absolute) {\n\tif (cwd === root || root.startsWith(`${cwd}/`)) {\n\t\tif (absolute) {\n\t\t\tconst start = isRoot(cwd) ? cwd.length : cwd.length + 1;\n\t\t\treturn (p, isDir) => p.slice(start, isDir ? -1 : void 0) || \".\";\n\t\t}\n\t\tconst prefix = root.slice(cwd.length + 1);\n\t\tif (prefix) return (p, isDir) => {\n\t\t\tif (p === \".\") return prefix;\n\t\t\tconst result = `${prefix}/${p}`;\n\t\t\treturn isDir ? result.slice(0, -1) : result;\n\t\t};\n\t\treturn (p, isDir) => isDir && p !== \".\" ? p.slice(0, -1) : p;\n\t}\n\tif (absolute) return (p) => posix.relative(cwd, p) || \".\";\n\treturn (p) => posix.relative(cwd, `${root}/${p}`) || \".\";\n}\nfunction buildRelative(cwd, root) {\n\tif (root.startsWith(`${cwd}/`)) {\n\t\tconst prefix = root.slice(cwd.length + 1);\n\t\treturn (p) => `${prefix}/${p}`;\n\t}\n\treturn (p) => {\n\t\tconst result = posix.relative(cwd, `${root}/${p}`);\n\t\tif (p.endsWith(\"/\") && result !== \"\") return `${result}/`;\n\t\treturn result || \".\";\n\t};\n}\nconst splitPatternOptions = { parts: true };\nfunction splitPattern(path$1) {\n\tvar _result$parts;\n\tconst result = picomatch.scan(path$1, splitPatternOptions);\n\treturn ((_result$parts = result.parts) === null || _result$parts === void 0 ? void 0 : _result$parts.length) ? result.parts : [path$1];\n}\nconst ESCAPED_WIN32_BACKSLASHES = /\\\\(?![()[\\]{}!+@])/g;\nfunction convertPosixPathToPattern(path$1) {\n\treturn escapePosixPath(path$1);\n}\nfunction convertWin32PathToPattern(path$1) {\n\treturn escapeWin32Path(path$1).replace(ESCAPED_WIN32_BACKSLASHES, \"/\");\n}\n/**\n* Converts a path to a pattern depending on the platform.\n* Identical to {@link escapePath} on POSIX systems.\n* @see {@link https://superchupu.dev/tinyglobby/documentation#convertPathToPattern}\n*/\n/* node:coverage ignore next 3 */\nconst convertPathToPattern = isWin ? convertWin32PathToPattern : convertPosixPathToPattern;\nconst POSIX_UNESCAPED_GLOB_SYMBOLS = /(?<!\\\\)([()[\\]{}*?|]|^!|[!+@](?=\\()|\\\\(?![()[\\]{}!*+?@|]))/g;\nconst WIN32_UNESCAPED_GLOB_SYMBOLS = /(?<!\\\\)([()[\\]{}]|^!|[!+@](?=\\())/g;\nconst escapePosixPath = (path$1) => path$1.replace(POSIX_UNESCAPED_GLOB_SYMBOLS, \"\\\\$&\");\nconst escapeWin32Path = (path$1) => path$1.replace(WIN32_UNESCAPED_GLOB_SYMBOLS, \"\\\\$&\");\n/**\n* Escapes a path's special characters depending on the platform.\n* @see {@link https://superchupu.dev/tinyglobby/documentation#escapePath}\n*/\n/* node:coverage ignore next */\nconst escapePath = isWin ? escapeWin32Path : escapePosixPath;\n/**\n* Checks if a pattern has dynamic parts.\n*\n* Has a few minor differences with [`fast-glob`](https://github.com/mrmlnc/fast-glob) for better accuracy:\n*\n* - Doesn't necessarily return `false` on patterns that include `\\`.\n* - Returns `true` if the pattern includes parentheses, regardless of them representing one single pattern or not.\n* - Returns `true` for unfinished glob extensions i.e. `(h`, `+(h`.\n* - Returns `true` for unfinished brace expansions as long as they include `,` or `..`.\n*\n* @see {@link https://superchupu.dev/tinyglobby/documentation#isDynamicPattern}\n*/\nfunction isDynamicPattern(pattern, options) {\n\tif ((options === null || options === void 0 ? void 0 : options.caseSensitiveMatch) === false) return true;\n\tconst scan = picomatch.scan(pattern);\n\treturn scan.isGlob || scan.negated;\n}\nfunction log(...tasks) {\n\tconsole.log(`[tinyglobby ${(/* @__PURE__ */ new Date()).toLocaleTimeString(\"es\")}]`, ...tasks);\n}\n\n//#endregion\n//#region src/index.ts\nconst PARENT_DIRECTORY = /^(\\/?\\.\\.)+/;\nconst ESCAPING_BACKSLASHES = /\\\\(?=[()[\\]{}!*+?@|])/g;\nconst BACKSLASHES = /\\\\/g;\nfunction normalizePattern(pattern, expandDirectories, cwd, props, isIgnore) {\n\tlet result = pattern;\n\tif (pattern.endsWith(\"/\")) result = pattern.slice(0, -1);\n\tif (!result.endsWith(\"*\") && expandDirectories) result += \"/**\";\n\tconst escapedCwd = escapePath(cwd);\n\tif (path.isAbsolute(result.replace(ESCAPING_BACKSLASHES, \"\"))) result = posix.relative(escapedCwd, result);\n\telse result = posix.normalize(result);\n\tconst parentDirectoryMatch = PARENT_DIRECTORY.exec(result);\n\tconst parts = splitPattern(result);\n\tif (parentDirectoryMatch === null || parentDirectoryMatch === void 0 ? void 0 : parentDirectoryMatch[0]) {\n\t\tconst n = (parentDirectoryMatch[0].length + 1) / 3;\n\t\tlet i = 0;\n\t\tconst cwdParts = escapedCwd.split(\"/\");\n\t\twhile (i < n && parts[i + n] === cwdParts[cwdParts.length + i - n]) {\n\t\t\tresult = result.slice(0, (n - i - 1) * 3) + result.slice((n - i) * 3 + parts[i + n].length + 1) || \".\";\n\t\t\ti++;\n\t\t}\n\t\tconst potentialRoot = posix.join(cwd, parentDirectoryMatch[0].slice(i * 3));\n\t\tif (!potentialRoot.startsWith(\".\") && props.root.length > potentialRoot.length) {\n\t\t\tprops.root = potentialRoot;\n\t\t\tprops.depthOffset = -n + i;\n\t\t}\n\t}\n\tif (!isIgnore && props.depthOffset >= 0) {\n\t\tvar _props$commonPath;\n\t\t(_props$commonPath = props.commonPath) !== null && _props$commonPath !== void 0 || (props.commonPath = parts);\n\t\tconst newCommonPath = [];\n\t\tconst length = Math.min(props.commonPath.length, parts.length);\n\t\tfor (let i = 0; i < length; i++) {\n\t\t\tconst part = parts[i];\n\t\t\tif (part === \"**\" && !parts[i + 1]) {\n\t\t\t\tnewCommonPath.pop();\n\t\t\t\tbreak;\n\t\t\t}\n\t\t\tif (part !== props.commonPath[i] || isDynamicPattern(part) || i === parts.length - 1) break;\n\t\t\tnewCommonPath.push(part);\n\t\t}\n\t\tprops.depthOffset = newCommonPath.length;\n\t\tprops.commonPath = newCommonPath;\n\t\tprops.root = newCommonPath.length > 0 ? posix.join(cwd, ...newCommonPath) : cwd;\n\t}\n\treturn result;\n}\nfunction processPatterns({ patterns = [\"**/*\"], ignore = [], expandDirectories = true }, cwd, props) {\n\tif (typeof patterns === \"string\") patterns = [patterns];\n\tif (typeof ignore === \"string\") ignore = [ignore];\n\tconst matchPatterns = [];\n\tconst ignorePatterns = [];\n\tfor (const pattern of ignore) {\n\t\tif (!pattern) continue;\n\t\tif (pattern[0] !== \"!\" || pattern[1] === \"(\") ignorePatterns.push(normalizePattern(pattern, expandDirectories, cwd, props, true));\n\t}\n\tfor (const pattern of patterns) {\n\t\tif (!pattern) continue;\n\t\tif (pattern[0] !== \"!\" || pattern[1] === \"(\") matchPatterns.push(normalizePattern(pattern, expandDirectories, cwd, props, false));\n\t\telse if (pattern[1] !== \"!\" || pattern[2] === \"(\") ignorePatterns.push(normalizePattern(pattern.slice(1), expandDirectories, cwd, props, true));\n\t}\n\treturn {\n\t\tmatch: matchPatterns,\n\t\tignore: ignorePatterns\n\t};\n}\nfunction formatPaths(paths, relative) {\n\tfor (let i = paths.length - 1; i >= 0; i--) {\n\t\tconst path$1 = paths[i];\n\t\tpaths[i] = relative(path$1);\n\t}\n\treturn paths;\n}\nfunction normalizeCwd(cwd) {\n\tif (!cwd) return process.cwd().replace(BACKSLASHES, \"/\");\n\tif (cwd instanceof URL) return fileURLToPath(cwd).replace(BACKSLASHES, \"/\");\n\treturn path.resolve(cwd).replace(BACKSLASHES, \"/\");\n}\nfunction getCrawler(patterns, inputOptions = {}) {\n\tconst options = process.env.TINYGLOBBY_DEBUG ? {\n\t\t...inputOptions,\n\t\tdebug: true\n\t} : inputOptions;\n\tconst cwd = normalizeCwd(options.cwd);\n\tif (options.debug) log(\"globbing with:\", {\n\t\tpatterns,\n\t\toptions,\n\t\tcwd\n\t});\n\tif (Array.isArray(patterns) && patterns.length === 0) return [{\n\t\tsync: () => [],\n\t\twithPromise: async () => []\n\t}, false];\n\tconst props = {\n\t\troot: cwd,\n\t\tcommonPath: null,\n\t\tdepthOffset: 0\n\t};\n\tconst processed = processPatterns({\n\t\t...options,\n\t\tpatterns\n\t}, cwd, props);\n\tif (options.debug) log(\"internal processing patterns:\", processed);\n\tconst matchOptions = {\n\t\tdot: options.dot,\n\t\tnobrace: options.braceExpansion === false,\n\t\tnocase: options.caseSensitiveMatch === false,\n\t\tnoextglob: options.extglob === false,\n\t\tnoglobstar: options.globstar === false,\n\t\tposix: true\n\t};\n\tconst matcher = picomatch(processed.match, {\n\t\t...matchOptions,\n\t\tignore: processed.ignore\n\t});\n\tconst ignore = picomatch(processed.ignore, matchOptions);\n\tconst partialMatcher = getPartialMatcher(processed.match, matchOptions);\n\tconst format = buildFormat(cwd, props.root, options.absolute);\n\tconst formatExclude = options.absolute ? format : buildFormat(cwd, props.root, true);\n\tconst fdirOptions = {\n\t\tfilters: [options.debug ? (p, isDirectory) => {\n\t\t\tconst path$1 = format(p, isDirectory);\n\t\t\tconst matches = matcher(path$1);\n\t\t\tif (matches) log(`matched ${path$1}`);\n\t\t\treturn matches;\n\t\t} : (p, isDirectory) => matcher(format(p, isDirectory))],\n\t\texclude: options.debug ? (_, p) => {\n\t\t\tconst relativePath = formatExclude(p, true);\n\t\t\tconst skipped = relativePath !== \".\" && !partialMatcher(relativePath) || ignore(relativePath);\n\t\t\tif (skipped) log(`skipped ${p}`);\n\t\t\telse log(`crawling ${p}`);\n\t\t\treturn skipped;\n\t\t} : (_, p) => {\n\t\t\tconst relativePath = formatExclude(p, true);\n\t\t\treturn relativePath !== \".\" && !partialMatcher(relativePath) || ignore(relativePath);\n\t\t},\n\t\tfs: options.fs ? {\n\t\t\treaddir: options.fs.readdir || nativeFs.readdir,\n\t\t\treaddirSync: options.fs.readdirSync || nativeFs.readdirSync,\n\t\t\trealpath: options.fs.realpath || nativeFs.realpath,\n\t\t\trealpathSync: options.fs.realpathSync || nativeFs.realpathSync,\n\t\t\tstat: options.fs.stat || nativeFs.stat,\n\t\t\tstatSync: options.fs.statSync || nativeFs.statSync\n\t\t} : void 0,\n\t\tpathSeparator: \"/\",\n\t\trelativePaths: true,\n\t\tresolveSymlinks: true,\n\t\tsignal: options.signal\n\t};\n\tif (options.deep !== void 0) fdirOptions.maxDepth = Math.round(options.deep - props.depthOffset);\n\tif (options.absolute) {\n\t\tfdirOptions.relativePaths = false;\n\t\tfdirOptions.resolvePaths = true;\n\t\tfdirOptions.includeBasePath = true;\n\t}\n\tif (options.followSymbolicLinks === false) {\n\t\tfdirOptions.resolveSymlinks = false;\n\t\tfdirOptions.excludeSymlinks = true;\n\t}\n\tif (options.onlyDirectories) {\n\t\tfdirOptions.excludeFiles = true;\n\t\tfdirOptions.includeDirs = true;\n\t} else if (options.onlyFiles === false) fdirOptions.includeDirs = true;\n\tprops.root = props.root.replace(BACKSLASHES, \"\");\n\tconst root = props.root;\n\tif (options.debug) log(\"internal properties:\", props);\n\tconst relative = cwd !== root && !options.absolute && buildRelative(cwd, props.root);\n\treturn [new fdir(fdirOptions).crawl(root), relative];\n}\nasync function glob(patternsOrOptions, options) {\n\tif (patternsOrOptions && (options === null || options === void 0 ? void 0 : options.patterns)) throw new Error(\"Cannot pass patterns as both an argument and an option\");\n\tconst isModern = isReadonlyArray(patternsOrOptions) || typeof patternsOrOptions === \"string\";\n\tconst opts = isModern ? options : patternsOrOptions;\n\tconst patterns = isModern ? patternsOrOptions : patternsOrOptions.patterns;\n\tconst [crawler, relative] = getCrawler(patterns, opts);\n\tif (!relative) return crawler.withPromise();\n\treturn formatPaths(await crawler.withPromise(), relative);\n}\nfunction globSync(patternsOrOptions, options) {\n\tif (patternsOrOptions && (options === null || options === void 0 ? void 0 : options.patterns)) throw new Error(\"Cannot pass patterns as both an argument and an option\");\n\tconst isModern = isReadonlyArray(patternsOrOptions) || typeof patternsOrOptions === \"string\";\n\tconst opts = isModern ? options : patternsOrOptions;\n\tconst patterns = isModern ? patternsOrOptions : patternsOrOptions.patterns;\n\tconst [crawler, relative] = getCrawler(patterns, opts);\n\tif (!relative) return crawler.sync();\n\treturn formatPaths(crawler.sync(), relative);\n}\n\n//#endregion\nexport { convertPathToPattern, escapePath, glob, globSync, isDynamicPattern };","/**\n * Template reader - loads templates from embedded or filesystem\n * Uses modern libraries: pathe, tinyglobby, is-binary-path\n */\n\nimport isBinaryPath from \"is-binary-path\";\nimport fs from \"node:fs\";\nimport { fileURLToPath } from \"node:url\";\nimport { dirname, join, extname } from \"pathe\";\nimport { glob } from \"tinyglobby\";\n\nconst __filename = fileURLToPath(import.meta.url);\nconst __dirname = dirname(__filename);\n\n/**\n * Get the root path where templates are stored\n */\nexport function getTemplatesRoot(): string {\n // In development: templates are in the package root\n // In production (npm): templates are in the installed package\n const possiblePaths = [\n join(__dirname, \"../templates\"), // From dist/\n join(__dirname, \"../../templates\"), // From dist/src/\n join(__dirname, \"../../../templates\"), // Alternative layout\n ];\n\n for (const p of possiblePaths) {\n if (fs.existsSync(p)) {\n return p;\n }\n }\n\n throw new Error(\"Templates directory not found. Checked: \" + possiblePaths.join(\", \"));\n}\n\n/**\n * Load all templates from a directory prefix into a Map\n * This is the primary way to load templates for processing\n */\nexport async function loadTemplates(prefix?: string): Promise<Map<string, string>> {\n const templatesRoot = getTemplatesRoot();\n const searchDir = prefix ? join(templatesRoot, prefix) : templatesRoot;\n\n if (!fs.existsSync(searchDir)) {\n return new Map();\n }\n\n const files = await glob(\"**/*\", {\n cwd: searchDir,\n dot: true,\n onlyFiles: true,\n });\n\n const templates = new Map<string, string>();\n\n for (const file of files) {\n const fullPath = join(searchDir, file);\n const relativePath = prefix ? `${prefix}/${file}` : file;\n\n try {\n // Use is-binary-path for comprehensive binary detection\n if (isBinaryPath(file)) {\n templates.set(relativePath, \"[Binary file]\");\n } else {\n const content = fs.readFileSync(fullPath, \"utf-8\");\n templates.set(relativePath, content);\n }\n } catch (error) {\n console.warn(`Failed to read template: ${relativePath}`, error);\n }\n }\n\n return templates;\n}\n\n/**\n * Load a single template file\n */\nexport function loadTemplate(relativePath: string): string | undefined {\n const templatesRoot = getTemplatesRoot();\n const fullPath = join(templatesRoot, relativePath);\n\n if (!fs.existsSync(fullPath)) {\n return undefined;\n }\n\n if (isBinaryPath(relativePath)) {\n return \"[Binary file]\";\n }\n\n return fs.readFileSync(fullPath, \"utf-8\");\n}\n\n/**\n * List all template paths matching a pattern\n */\nexport async function listTemplates(prefix?: string): Promise<string[]> {\n const templatesRoot = getTemplatesRoot();\n const searchDir = prefix ? join(templatesRoot, prefix) : templatesRoot;\n\n if (!fs.existsSync(searchDir)) {\n return [];\n }\n\n const files = await glob(\"**/*\", {\n cwd: searchDir,\n dot: true,\n onlyFiles: true,\n });\n\n return prefix ? files.map((f: string) => `${prefix}/${f}`) : files;\n}\n\n/**\n * Check if path is a binary file\n * Uses is-binary-path package for comprehensive detection\n */\nexport function isBinary(filePath: string): boolean {\n return isBinaryPath(filePath);\n}\n\nexport { getTemplatesRoot as TEMPLATES_ROOT };\n"],"x_google_ignoreList":[0,1,2,3,4,5,6,7,8,9,10],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;kCAAA;CACC;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;C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+ type: "file";
6
+ path: string;
7
+ name: string;
8
+ content: string;
9
+ extension: string;
10
+ }
11
+ interface VirtualDirectory {
12
+ type: "directory";
13
+ path: string;
14
+ name: string;
15
+ children: VirtualNode[];
16
+ }
17
+ type VirtualNode = VirtualFile | VirtualDirectory;
18
+ interface VirtualFileTree {
19
+ root: VirtualDirectory;
20
+ fileCount: number;
21
+ directoryCount: number;
22
+ config: ProjectConfig;
23
+ }
24
+ interface GeneratorOptions {
25
+ config: ProjectConfig;
26
+ templateBasePath?: string;
27
+ templates?: Map<string, string>;
28
+ }
29
+ interface GeneratorResult {
30
+ success: boolean;
31
+ tree?: VirtualFileTree;
32
+ error?: string;
33
+ }
34
+ //#endregion
35
+ export { VirtualFileTree as a, VirtualFile as i, GeneratorResult as n, VirtualNode as o, VirtualDirectory as r, GeneratorOptions as t };
36
+ //# sourceMappingURL=types-BubFnV2d.d.mts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"types-BubFnV2d.d.mts","names":[],"sources":["../src/types.ts"],"sourcesContent":[],"mappings":";;;UAEiB,WAAA;;EAAA,IAAA,EAAA,MAAA;EAQA,IAAA,EAAA,MAAA;EAOL,OAAA,EAAA,MAAW;EAEN,SAAA,EAAA,MAAA;AAOjB;AAMiB,UAtBA,gBAAA,CAwBR;;;;YApBG;;KAGA,WAAA,GAAc,cAAc;UAEvB,eAAA;QACT;;;UAGE;;UAGO,gBAAA;UACP;;cAEI;;UAGG,eAAA;;SAER"}
package/package.json ADDED
@@ -0,0 +1,66 @@
1
+ {
2
+ "name": "@better-t-stack/template-generator",
3
+ "version": "3.13.2-dev.6c6cffb",
4
+ "description": "Virtual file system generator for Better-T-Stack templates - works in browsers and Node.js",
5
+ "keywords": [
6
+ "better-t-stack",
7
+ "cli",
8
+ "template-generator",
9
+ "typescript",
10
+ "virtual-fs"
11
+ ],
12
+ "homepage": "https://better-t-stack.dev/",
13
+ "license": "MIT",
14
+ "author": "Aman Varshney",
15
+ "repository": {
16
+ "type": "git",
17
+ "url": "git+https://github.com/AmanVarshney01/create-better-t-stack.git",
18
+ "directory": "packages/template-generator"
19
+ },
20
+ "files": [
21
+ "dist",
22
+ "scripts",
23
+ "templates"
24
+ ],
25
+ "type": "module",
26
+ "exports": {
27
+ ".": {
28
+ "types": "./dist/index.d.mts",
29
+ "default": "./dist/index.mjs"
30
+ },
31
+ "./fs-writer": {
32
+ "types": "./dist/fs-writer.d.mts",
33
+ "default": "./dist/fs-writer.mjs"
34
+ },
35
+ "./template-reader": {
36
+ "types": "./dist/template-reader.d.mts",
37
+ "default": "./dist/template-reader.mjs"
38
+ }
39
+ },
40
+ "publishConfig": {
41
+ "access": "public"
42
+ },
43
+ "scripts": {
44
+ "generate-templates": "bun scripts/generate-templates.ts",
45
+ "prebuild": "bun run generate-templates",
46
+ "build": "tsdown",
47
+ "prepublishOnly": "bun run build",
48
+ "dev": "tsdown --watch",
49
+ "typecheck": "tsc --noEmit"
50
+ },
51
+ "dependencies": {
52
+ "@better-t-stack/types": "3.13.2-dev.6c6cffb",
53
+ "handlebars": "^4.7.8",
54
+ "memfs": "^4.51.1",
55
+ "pathe": "^2.0.3"
56
+ },
57
+ "devDependencies": {
58
+ "@types/fs-extra": "^11.0.4",
59
+ "@types/node": "^22.10.2",
60
+ "fs-extra": "^11.3.3",
61
+ "is-binary-path": "^3.0.0",
62
+ "tinyglobby": "^0.2.15",
63
+ "tsdown": "^0.17.2",
64
+ "typescript": "^5.7.2"
65
+ }
66
+ }
@@ -0,0 +1,97 @@
1
+ /**
2
+ * Build script to embed templates at build time
3
+ * Generates a TypeScript file with all templates as a Map<string, string>
4
+ * This allows the package to work in browsers without filesystem access
5
+ */
6
+
7
+ import fs from "node:fs";
8
+ import path from "node:path";
9
+ import { fileURLToPath } from "node:url";
10
+ import { glob } from "tinyglobby";
11
+
12
+ const __filename = fileURLToPath(import.meta.url);
13
+ const __dirname = path.dirname(__filename);
14
+
15
+ const TEMPLATES_DIR = path.join(__dirname, "../templates");
16
+ const OUTPUT_FILE = path.join(__dirname, "../src/templates.generated.ts");
17
+
18
+ const BINARY_EXTENSIONS = [
19
+ ".png",
20
+ ".ico",
21
+ ".svg",
22
+ ".jpg",
23
+ ".jpeg",
24
+ ".gif",
25
+ ".webp",
26
+ ".woff",
27
+ ".woff2",
28
+ ".ttf",
29
+ ".eot",
30
+ ".mp4",
31
+ ".webm",
32
+ ];
33
+
34
+ function isBinaryFile(filePath: string): boolean {
35
+ const ext = path.extname(filePath).toLowerCase();
36
+ return BINARY_EXTENSIONS.includes(ext);
37
+ }
38
+
39
+ async function generateTemplates() {
40
+ console.log("📦 Generating embedded templates...");
41
+
42
+ const files = await glob("**/*", {
43
+ cwd: TEMPLATES_DIR,
44
+ dot: true,
45
+ onlyFiles: true,
46
+ });
47
+
48
+ console.log(`📂 Found ${files.length} template files`);
49
+
50
+ const entries: string[] = [];
51
+
52
+ for (const file of files) {
53
+ const fullPath = path.join(TEMPLATES_DIR, file);
54
+ const normalizedPath = file.replace(/\\/g, "/");
55
+
56
+ let content: string;
57
+ if (isBinaryFile(file)) {
58
+ content = "[Binary file]";
59
+ } else {
60
+ content = fs.readFileSync(fullPath, "utf-8");
61
+ }
62
+
63
+ // Escape backticks and ${} for template literal
64
+ const escapedContent = content
65
+ .replace(/\\/g, "\\\\")
66
+ .replace(/`/g, "\\`")
67
+ .replace(/\$\{/g, "\\${");
68
+
69
+ entries.push(` ["${normalizedPath}", \`${escapedContent}\`]`);
70
+ }
71
+
72
+ const output = `/**
73
+ * Auto-generated embedded templates
74
+ * DO NOT EDIT - This file is generated by scripts/generate-templates.ts
75
+ * Run 'bun run generate-templates' to regenerate
76
+ */
77
+
78
+ export const EMBEDDED_TEMPLATES: Map<string, string> = new Map([
79
+ ${entries.join(",\n")}
80
+ ]);
81
+
82
+ export const TEMPLATE_COUNT = ${files.length};
83
+ `;
84
+
85
+ fs.writeFileSync(OUTPUT_FILE, output);
86
+
87
+ const stats = fs.statSync(OUTPUT_FILE);
88
+ const sizeMB = (stats.size / (1024 * 1024)).toFixed(2);
89
+
90
+ console.log(`✅ Generated ${OUTPUT_FILE}`);
91
+ console.log(`📊 File size: ${sizeMB} MB (${files.length} templates)`);
92
+ }
93
+
94
+ generateTemplates().catch((err) => {
95
+ console.error("❌ Failed to generate templates:", err);
96
+ process.exit(1);
97
+ });