autumn-js 0.0.72 → 0.0.76

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 (202) hide show
  1. package/components.json +2 -2
  2. package/dist/libraries/backend/better-auth.d.mts +8 -0
  3. package/dist/libraries/backend/better-auth.d.ts +8 -0
  4. package/dist/libraries/backend/better-auth.js +20061 -0
  5. package/dist/libraries/backend/better-auth.mjs +19201 -0
  6. package/dist/libraries/backend/{chunk-6DZX6EAA.mjs → chunk-XGB3TDIC.mjs} +5 -0
  7. package/dist/libraries/backend/constants.mjs +1 -1
  8. package/dist/libraries/backend/express.d.mts +1 -1
  9. package/dist/libraries/backend/express.d.ts +1 -1
  10. package/dist/libraries/backend/express.mjs +1 -1
  11. package/dist/libraries/backend/fastify.mjs +1 -1
  12. package/dist/libraries/backend/hono.mjs +1 -1
  13. package/dist/libraries/backend/next.mjs +1 -1
  14. package/dist/libraries/backend/react-router.mjs +1 -1
  15. package/dist/libraries/backend/{referralTypes-qdpA4XBw.d.ts → referralTypes-CSbCGBim.d.ts} +2 -0
  16. package/dist/libraries/backend/{referralTypes-C-jpvu6u.d.mts → referralTypes-DiYwS4QY.d.mts} +2 -0
  17. package/dist/libraries/backend/remix_dep.mjs +1 -1
  18. package/dist/libraries/backend/routes/backendRouter.mjs +1 -1
  19. package/dist/libraries/backend/routes/entityRoutes.mjs +1 -1
  20. package/dist/libraries/backend/routes/genRoutes.mjs +1 -1
  21. package/dist/libraries/backend/routes/productRoutes.mjs +1 -1
  22. package/dist/libraries/backend/routes/referralRoutes.mjs +1 -1
  23. package/dist/libraries/backend/supabase.mjs +1 -1
  24. package/dist/libraries/backend/tanstack.mjs +1 -1
  25. package/dist/libraries/backend/utils/backendRes.mjs +1 -1
  26. package/dist/libraries/backend/utils/logBackendErrors.mjs +1 -1
  27. package/dist/libraries/backend/utils/secretKeyCheck.mjs +1 -1
  28. package/dist/libraries/backend/utils/withAuth.d.mts +1 -1
  29. package/dist/libraries/backend/utils/withAuth.d.ts +1 -1
  30. package/dist/libraries/backend/utils/withAuth.mjs +1 -1
  31. package/dist/libraries/react/AutumnContext.d.mts +3 -3
  32. package/dist/libraries/react/AutumnContext.d.ts +3 -3
  33. package/dist/libraries/react/AutumnContext.js +11 -7
  34. package/dist/libraries/react/AutumnContext.mjs +6 -6
  35. package/dist/libraries/react/BaseAutumnProvider.d.mts +3 -3
  36. package/dist/libraries/react/BaseAutumnProvider.d.ts +3 -3
  37. package/dist/libraries/react/BaseAutumnProvider.js +5722 -179
  38. package/dist/libraries/react/BaseAutumnProvider.mjs +19 -10
  39. package/dist/libraries/react/{ReactAutumnClient-4e3t4WTF.d.mts → ReactAutumnClient-BT7tsOG0.d.mts} +2 -2
  40. package/dist/libraries/react/{ReactAutumnClient-B-lWmwRW.d.ts → ReactAutumnClient-DfDXFLBI.d.ts} +2 -2
  41. package/dist/libraries/react/ReactAutumnProvider.d.mts +2 -1
  42. package/dist/libraries/react/ReactAutumnProvider.d.ts +2 -1
  43. package/dist/libraries/react/ReactAutumnProvider.js +5729 -182
  44. package/dist/libraries/react/ReactAutumnProvider.mjs +19 -11
  45. package/dist/libraries/react/{checkTypes-BDNI_s2B.d.ts → checkTypes-ByzZ-KO2.d.ts} +2 -0
  46. package/dist/libraries/react/{checkTypes-CyKIOmeF.d.mts → checkTypes-h2Fyyuh0.d.mts} +2 -0
  47. package/dist/libraries/react/{chunk-4PX3AQKX.mjs → chunk-27OTS3Q5.mjs} +9 -9
  48. package/dist/libraries/react/chunk-2DPUKL2Q.mjs +988 -0
  49. package/dist/libraries/react/{chunk-TBCLSIC2.mjs → chunk-3EYF7OI5.mjs} +1 -1
  50. package/dist/libraries/react/{chunk-CE5BBB5H.mjs → chunk-4CRZJJPY.mjs} +4 -3
  51. package/dist/libraries/react/{chunk-4CGZZYLG.mjs → chunk-4J6OC4ZQ.mjs} +46 -1
  52. package/dist/libraries/react/chunk-5FZ7IV6P.mjs +2021 -0
  53. package/dist/libraries/react/{chunk-LS3NB4DU.mjs → chunk-77N4ARHR.mjs} +2 -2
  54. package/dist/libraries/react/chunk-CMO5LYYU.mjs +241 -0
  55. package/dist/libraries/react/chunk-FEFGYFXQ.mjs +134 -0
  56. package/dist/libraries/react/chunk-FPI3PLEL.mjs +218 -0
  57. package/dist/libraries/react/chunk-KQT5G3HT.mjs +27 -0
  58. package/dist/libraries/react/{chunk-O4HHXBGR.mjs → chunk-P2O4LZFD.mjs} +30 -30
  59. package/dist/libraries/react/{chunk-B7HGBQCO.mjs → chunk-UMZA5GHL.mjs} +1 -1
  60. package/dist/libraries/react/{chunk-4KKWHG2V.mjs → chunk-V5PKOA5A.mjs} +1 -1
  61. package/dist/libraries/react/{chunk-Q7CK32YT.mjs → chunk-WI6WFW54.mjs} +26 -8
  62. package/dist/libraries/react/{chunk-7PRD7RPD.mjs → chunk-XXMAVKQ4.mjs} +2 -2
  63. package/dist/libraries/react/client/ReactAutumnClient.d.mts +3 -3
  64. package/dist/libraries/react/client/ReactAutumnClient.d.ts +3 -3
  65. package/dist/libraries/react/client/ReactAutumnClient.js +11 -7
  66. package/dist/libraries/react/client/ReactAutumnClient.mjs +5 -5
  67. package/dist/libraries/react/client/clientCompMethods.d.mts +3 -3
  68. package/dist/libraries/react/client/clientCompMethods.d.ts +3 -3
  69. package/dist/libraries/react/client/clientCusMethods.d.mts +3 -3
  70. package/dist/libraries/react/client/clientCusMethods.d.ts +3 -3
  71. package/dist/libraries/react/client/clientEntityMethods.d.mts +3 -3
  72. package/dist/libraries/react/client/clientEntityMethods.d.ts +3 -3
  73. package/dist/libraries/react/client/clientEntityMethods.js +9 -6
  74. package/dist/libraries/react/client/clientEntityMethods.mjs +2 -2
  75. package/dist/libraries/react/client/clientGenMethods.d.mts +3 -3
  76. package/dist/libraries/react/client/clientGenMethods.d.ts +3 -3
  77. package/dist/libraries/react/client/clientGenMethods.js +10 -7
  78. package/dist/libraries/react/client/clientGenMethods.mjs +2 -2
  79. package/dist/libraries/react/client/clientProdMethods.d.mts +3 -3
  80. package/dist/libraries/react/client/clientProdMethods.d.ts +3 -3
  81. package/dist/libraries/react/client/clientReferralMethods.d.mts +3 -3
  82. package/dist/libraries/react/client/clientReferralMethods.d.ts +3 -3
  83. package/dist/libraries/react/client/clientReferralMethods.js +9 -6
  84. package/dist/libraries/react/client/clientReferralMethods.mjs +2 -2
  85. package/dist/libraries/react/client/types/clientGenTypes.d.mts +1 -0
  86. package/dist/libraries/react/client/types/clientGenTypes.d.ts +1 -0
  87. package/dist/libraries/react/components/attach-dialog/attach-dialog-synced.d.mts +1 -1
  88. package/dist/libraries/react/components/attach-dialog/attach-dialog-synced.d.ts +1 -1
  89. package/dist/libraries/react/components/attach-dialog/attach-dialog-synced.js +2594 -222
  90. package/dist/libraries/react/components/attach-dialog/attach-dialog-synced.mjs +16 -22
  91. package/dist/libraries/react/components/attach-dialog/lib/attach-content.d.mts +1 -1
  92. package/dist/libraries/react/components/attach-dialog/lib/attach-content.d.ts +1 -1
  93. package/dist/libraries/react/components/check-dialog/check-dialog-synced.d.mts +1 -1
  94. package/dist/libraries/react/components/check-dialog/check-dialog-synced.d.ts +1 -1
  95. package/dist/libraries/react/components/check-dialog/check-dialog-synced.js +2260 -127
  96. package/dist/libraries/react/components/check-dialog/check-dialog-synced.mjs +6 -4
  97. package/dist/libraries/react/components/check-dialog/lib/check-content.d.mts +1 -1
  98. package/dist/libraries/react/components/check-dialog/lib/check-content.d.ts +1 -1
  99. package/dist/libraries/react/components/pricing-table/pricing-table-synced.d.mts +2 -2
  100. package/dist/libraries/react/components/pricing-table/pricing-table-synced.d.ts +2 -2
  101. package/dist/libraries/react/components/pricing-table/pricing-table-synced.js +3083 -719
  102. package/dist/libraries/react/components/pricing-table/pricing-table-synced.mjs +16 -22
  103. package/dist/libraries/react/components/ui/button.d.mts +6 -6
  104. package/dist/libraries/react/components/ui/button.d.ts +6 -6
  105. package/dist/libraries/react/components/ui/button.js +206 -31
  106. package/dist/libraries/react/components/ui/button.mjs +3 -2
  107. package/dist/libraries/react/components/ui/dialog.d.mts +16 -12
  108. package/dist/libraries/react/components/ui/dialog.d.ts +16 -12
  109. package/dist/libraries/react/components/ui/dialog.js +2254 -148
  110. package/dist/libraries/react/components/ui/dialog.mjs +5 -2
  111. package/dist/libraries/react/components/ui/switch.d.mts +2 -3
  112. package/dist/libraries/react/components/ui/switch.d.ts +2 -3
  113. package/dist/libraries/react/components/ui/switch.js +575 -29
  114. package/dist/libraries/react/components/ui/switch.mjs +5 -2
  115. package/dist/libraries/react/hooks/useAutumn.d.mts +3 -3
  116. package/dist/libraries/react/hooks/useAutumn.d.ts +3 -3
  117. package/dist/libraries/react/hooks/useAutumn.js +5793 -134
  118. package/dist/libraries/react/hooks/useAutumn.mjs +21 -9
  119. package/dist/libraries/react/hooks/useAutumnBase.d.mts +3 -3
  120. package/dist/libraries/react/hooks/useAutumnBase.d.ts +3 -3
  121. package/dist/libraries/react/hooks/useAutumnBase.js +5789 -130
  122. package/dist/libraries/react/hooks/useAutumnBase.mjs +21 -8
  123. package/dist/libraries/react/hooks/useCustomer.d.mts +3 -3
  124. package/dist/libraries/react/hooks/useCustomer.d.ts +3 -3
  125. package/dist/libraries/react/hooks/useCustomer.js +5718 -174
  126. package/dist/libraries/react/hooks/useCustomer.mjs +20 -10
  127. package/dist/libraries/react/hooks/useCustomerBase.d.mts +3 -3
  128. package/dist/libraries/react/hooks/useCustomerBase.d.ts +3 -3
  129. package/dist/libraries/react/hooks/useCustomerBase.js +5726 -174
  130. package/dist/libraries/react/hooks/useCustomerBase.mjs +20 -9
  131. package/dist/libraries/react/hooks/useEntity.d.mts +8 -6
  132. package/dist/libraries/react/hooks/useEntity.d.ts +8 -6
  133. package/dist/libraries/react/hooks/useEntity.js +5986 -48
  134. package/dist/libraries/react/hooks/useEntity.mjs +20 -8
  135. package/dist/libraries/react/hooks/useEntityBase.d.mts +9 -11
  136. package/dist/libraries/react/hooks/useEntityBase.d.ts +9 -11
  137. package/dist/libraries/react/hooks/useEntityBase.js +6690 -37
  138. package/dist/libraries/react/hooks/useEntityBase.mjs +25 -1
  139. package/dist/libraries/react/hooks/usePricingTable.d.mts +1 -1
  140. package/dist/libraries/react/hooks/usePricingTable.d.ts +1 -1
  141. package/dist/libraries/react/hooks/usePricingTable.js +36 -14
  142. package/dist/libraries/react/hooks/usePricingTable.mjs +8 -8
  143. package/dist/libraries/react/hooks/usePricingTableBase.d.mts +3 -3
  144. package/dist/libraries/react/hooks/usePricingTableBase.d.ts +3 -3
  145. package/dist/libraries/react/hooks/usePricingTableBase.js +36 -14
  146. package/dist/libraries/react/hooks/usePricingTableBase.mjs +7 -7
  147. package/dist/libraries/react/hooks/useProductsBase.js +11 -7
  148. package/dist/libraries/react/hooks/useProductsBase.mjs +6 -6
  149. package/dist/libraries/react/index.d.ts +9 -7
  150. package/dist/libraries/react/index.js +3504 -1110
  151. package/dist/libraries/react/index.mjs +3502 -1108
  152. package/dist/libraries/react/lib/utils.js +46 -1
  153. package/dist/libraries/react/lib/utils.mjs +1 -1
  154. package/dist/libraries/react/{response-ChCmaLBk.d.mts → response-B37tbVeT.d.mts} +1 -1
  155. package/dist/libraries/react/{response-9K8DyGXf.d.ts → response-CREh0tw3.d.ts} +1 -1
  156. package/dist/libraries/react/utils/toSnakeCase.d.mts +1 -1
  157. package/dist/libraries/react/utils/toSnakeCase.d.ts +1 -1
  158. package/dist/libraries/react/utils/toSnakeCase.js +9 -6
  159. package/dist/libraries/react/utils/toSnakeCase.mjs +1 -1
  160. package/dist/next/client/NextAutumnClient.d.mts +2 -2
  161. package/dist/next/client/NextAutumnClient.d.ts +2 -2
  162. package/dist/next/client/{checkTypes-BHxu_xEV.d.ts → checkTypes-BVlLFoUT.d.ts} +2 -0
  163. package/dist/next/client/{checkTypes-CEaWu4S3.d.mts → checkTypes-CGZpuidI.d.mts} +2 -0
  164. package/dist/next/client/{clientGenTypes-i3cKamAv.d.ts → clientGenTypes-CXkGuJ6W.d.ts} +2 -1
  165. package/dist/next/client/{clientGenTypes-BRfigzSY.d.mts → clientGenTypes-Dh9BiE0s.d.mts} +2 -1
  166. package/dist/next/client/hooks/useAutumn.d.mts +3 -3
  167. package/dist/next/client/hooks/useAutumn.d.ts +3 -3
  168. package/dist/next/client/hooks/useCustomer.d.mts +2 -2
  169. package/dist/next/client/hooks/useCustomer.d.ts +2 -2
  170. package/dist/next/client/hooks/useEntity.d.mts +7 -7
  171. package/dist/next/client/hooks/useEntity.d.ts +7 -7
  172. package/dist/next/client/hooks/usePricingTable.d.mts +1 -1
  173. package/dist/next/client/hooks/usePricingTable.d.ts +1 -1
  174. package/dist/next/index.d.mts +7 -6
  175. package/dist/next/index.d.ts +7 -6
  176. package/dist/next/server/cusActions.d.mts +2 -0
  177. package/dist/next/server/cusActions.d.ts +2 -0
  178. package/dist/next/server/genActions.d.mts +1 -0
  179. package/dist/next/server/genActions.d.ts +1 -0
  180. package/dist/sdk/index.d.mts +2 -0
  181. package/dist/sdk/index.d.ts +2 -0
  182. package/dist/styles/global.css +1093 -1023
  183. package/package.json +14 -13
  184. package/postcss.config.js +19 -1
  185. package/scripts/post-build.js +25 -0
  186. package/scripts/sync-registry.ts +79 -191
  187. package/tailwind.config.ts +96 -0
  188. package/tsup.config.ts +3 -4
  189. package/tsup.dev.config.ts +3 -4
  190. package/dist/libraries/react/chunk-2XYYCR4J.mjs +0 -276
  191. package/dist/libraries/react/chunk-FHANCAHB.mjs +0 -17
  192. package/dist/libraries/react/chunk-GTF7A5TG.mjs +0 -76
  193. package/dist/libraries/react/chunk-NEV76K4V.mjs +0 -552
  194. package/dist/libraries/react/chunk-QMIIDFRP.mjs +0 -85
  195. package/dist/libraries/react/chunk-TFGQQAVB.mjs +0 -38
  196. package/dist/libraries/react/chunk-X3HJKZGO.mjs +0 -58
  197. package/dist/libraries/react/chunk-ZKHBOCMO.mjs +0 -17
  198. package/dist/libraries/react/chunk-ZNPQQ2WK.mjs +0 -24
  199. package/dist/libraries/react/chunk-ZQ6LDLK5.mjs +0 -149
  200. package/dist/libraries/react/chunk-ZWO4QYXI.mjs +0 -20
  201. package/dist/libraries/react/chunk-ZXE5MFKL.mjs +0 -45
  202. package/tailwind.config.js +0 -57
package/package.json CHANGED
@@ -1,16 +1,16 @@
1
1
  {
2
2
  "name": "autumn-js",
3
3
  "description": "Autumn JS Library",
4
- "version": "0.0.72",
4
+ "version": "0.0.76",
5
5
  "main": "./dist/index.js",
6
6
  "scripts": {
7
7
  "cli": "tsx src/cli/index.ts",
8
8
  "test": "echo \"Error: no test specified\" && exit 1",
9
9
  "publish-beta": "npm run build && npm publish --tag beta",
10
- "build": "rm -rf dist && tsup",
11
- "dev": "tsx scripts/sync-registry.ts sync && (tsx scripts/sync-registry.ts watch & nodemon --watch src --ext ts,tsx,css --exec \"tsup --config tsup.dev.config.ts\")",
10
+ "build": "rm -rf dist && tsup && node scripts/post-build.js",
11
+ "dev-old": "tsx scripts/sync-registry.ts sync && (tsx scripts/sync-registry.ts watch & nodemon --watch src --ext ts,tsx,css --exec \"tsup --config tsup.dev.config.ts\")",
12
+ "dev": "(tsx scripts/sync-registry.ts watch & nodemon --watch src --ext ts,tsx,css --exec \"tsup --config tsup.dev.config.ts && node scripts/post-build.js\")",
12
13
  "sync-registry": "tsx scripts/sync-registry.ts sync",
13
- "reverse": "tsx scripts/sync-registry.ts reverse",
14
14
  "watch-registry": "tsx scripts/sync-registry.ts watch"
15
15
  },
16
16
  "module": "./dist/index.mjs",
@@ -70,18 +70,22 @@
70
70
  "author": "John Yeo",
71
71
  "license": "MIT",
72
72
  "devDependencies": {
73
+ "@radix-ui/react-dialog": "^1.1.14",
74
+ "@radix-ui/react-slot": "^1.2.3",
75
+ "@radix-ui/react-switch": "^1.2.5",
73
76
  "@remix-run/node": "^2.16.6",
74
77
  "@supabase/ssr": "^0.6.1",
75
78
  "@tanstack/react-start": "^1.120.5",
76
79
  "@types/express": "^5.0.1",
77
- "@types/node": "^22.14.1",
80
+ "@types/node": "^22.15.32",
78
81
  "@types/react": "^18.3.14",
79
82
  "autoprefixer": "^10.4.21",
80
- "better-auth": "^1.2.7",
83
+ "better-auth": "^1.2.10",
81
84
  "class-variance-authority": "^0.7.1",
82
85
  "clsx": "^2.1.1",
83
86
  "esbuild-plugin-alias": "^0.2.1",
84
87
  "esbuild-plugin-path-alias": "^1.0.7",
88
+ "esbuild-postcss": "^0.0.4",
85
89
  "express": "^5.1.0",
86
90
  "fastify": "^5.3.3",
87
91
  "hono": "^4.7.9",
@@ -90,13 +94,15 @@
90
94
  "next": "^15.2.3",
91
95
  "nodemon": "^3.1.10",
92
96
  "postcss": "^8.5.6",
97
+ "postcss-nested": "^7.0.2",
98
+ "postcss-prefix-selector": "^2.1.1",
93
99
  "tailwind-merge": "^2.6.0",
94
100
  "tailwindcss": "^3.4.1",
101
+ "tailwindcss-animate": "^1.0.7",
95
102
  "tailwindcss-scoped-preflight": "^3.4.12",
96
103
  "tsconfig-paths": "^4.2.0",
97
104
  "tsup": "^8.4.0",
98
105
  "tsx": "^4.19.3",
99
- "tw-animate-css": "^1.3.4",
100
106
  "typescript": "^5.8.3"
101
107
  },
102
108
  "peerDependenciesMeta": {
@@ -105,14 +111,9 @@
105
111
  }
106
112
  },
107
113
  "dependencies": {
108
- "@radix-ui/react-dialog": "^1.1.14",
109
- "@radix-ui/react-slot": "^1.2.3",
110
- "@radix-ui/react-switch": "^1.2.5",
111
114
  "chalk": "^5.4.1",
112
- "postcss-nested": "^7.0.2",
113
115
  "rou3": "^0.6.1",
114
- "swr": "^2.3.3",
115
- "tailwindcss-animate": "1.0.7"
116
+ "swr": "^2.3.3"
116
117
  },
117
118
  "typesVersions": {
118
119
  "*": {
package/postcss.config.js CHANGED
@@ -2,6 +2,24 @@ module.exports = {
2
2
  plugins: {
3
3
  tailwindcss: {},
4
4
  autoprefixer: {},
5
-
5
+ "postcss-nested": {},
6
+ // 'postcss-prefix-selector': {
7
+ // prefix: '.au-root',
8
+ // transform: function (prefix, selector, prefixedSelector) {
9
+ // if (selector.match(/^(html|body)/)) {
10
+ // return selector.replace(/^([^\s]*)/, `$1 ${prefix}`);
11
+ // }
12
+
13
+ // if (selector.match(/^(::?[\w-]+)/)) {
14
+ // return `${prefix}${selector}`;
15
+ // }
16
+
17
+ // if (selector.includes('*')) {
18
+ // return prefixedSelector;
19
+ // }
20
+
21
+ // return prefixedSelector;
22
+ // },
23
+ // },
6
24
  }
7
25
  }
@@ -0,0 +1,25 @@
1
+ const fs = require('fs');
2
+ const path = require('path');
3
+
4
+ // Post-build processing: replace CSS selectors with .au-root prefix
5
+ function processCssFiles() {
6
+ const cssFilePath = path.join(__dirname, '../dist/styles/global.css');
7
+
8
+ if (fs.existsSync(cssFilePath)) {
9
+ console.log('📄 Processing CSS file:', cssFilePath);
10
+
11
+ const builtCss = fs.readFileSync(cssFilePath, 'utf8');
12
+ const updatedCss = builtCss.replace(
13
+ /(\*,\n::before,\n::after)/g,
14
+ '.au-root *,\n.au-root ::before,\n.au-root ::after'
15
+ );
16
+
17
+ fs.writeFileSync(cssFilePath, updatedCss);
18
+ console.log('✅ CSS selectors updated with .au-root prefix');
19
+ } else {
20
+ console.log('⚠️ CSS file not found:', cssFilePath);
21
+ }
22
+ }
23
+
24
+ // Run the processing
25
+ processCssFiles();
@@ -4,268 +4,160 @@ import fs from "fs/promises";
4
4
  import path from "path";
5
5
  import { watch } from "fs";
6
6
 
7
- const REGISTRY_PATH = "../ui/registry";
8
- const OUTPUT_PATH = "./src/libraries/react/components";
7
+ const UI_REGISTRY_PATH = "../ui/registry";
8
+ const SYNCED_COMPONENTS_PATH = "./src/libraries/react/components";
9
9
 
10
10
  interface ComponentConfig {
11
+ syncedName: string;
11
12
  registryName: string;
12
- outputName: string;
13
13
  dependencies?: string[];
14
14
  }
15
15
 
16
16
  const COMPONENTS: ComponentConfig[] = [
17
17
  {
18
+ syncedName: "attach-dialog",
18
19
  registryName: "attach-dialog",
19
- outputName: "attach-dialog",
20
20
  dependencies: ["attach-content"],
21
21
  },
22
22
  {
23
+ syncedName: "check-dialog",
23
24
  registryName: "check-dialog",
24
- outputName: "check-dialog",
25
25
  dependencies: ["check-content"],
26
26
  },
27
27
  {
28
- registryName: "pricing-table",
29
- outputName: "pricing-table",
28
+ syncedName: "pricing-table",
29
+ registryName: "pricing-table",
30
30
  dependencies: ["pricing-table-content"],
31
31
  },
32
32
  ];
33
33
 
34
34
  /**
35
- * Transform import paths from registry format to library format
35
+ * Remove 'au-' prefixes from Tailwind classes
36
36
  */
37
- function transformImports(content: string): string {
38
- // Transform registry-specific lib imports (but NOT @/lib/utils)
39
- content = content.replace(
40
- /@\/registry\/([^\/]+)\/lib\/([^"']+)/g,
41
- "./lib/$2"
42
- );
43
-
44
- // Transform registry component imports to use synced versions
45
- content = content.replace(
46
- /@\/registry\/([^\/]+)\/([^"']+)/g,
47
- "../$1/$1-synced"
48
- );
49
-
50
- // Transform autumn-js imports to use our path aliases
51
- content = content.replace(/from ["']autumn-js\/react["']/g, "from '@/index'");
52
- content = content.replace(/from ["']autumn-js["']/g, "from '@sdk'");
53
-
54
- // Keep @/components/ui and @/lib imports as-is since they work with our path aliases
55
-
56
- return content;
37
+ function removeAuPrefixes(content: string): string {
38
+ // Replace all occurrences of 'au-' with empty string in className attributes
39
+ return content.replace(/au-/g, "");
57
40
  }
58
41
 
59
42
  /**
60
- * Transform import paths from library format back to registry format
43
+ * Transform imports from synced format to registry format
61
44
  */
62
- function reverseTransformImports(content: string): string {
63
- // Transform our path aliases back to autumn-js imports
45
+ function transformImportsToRegistry(content: string): string {
46
+ // Transform path aliases back to autumn-js imports
64
47
  content = content.replace(/from ["']@\/index["']/g, 'from "autumn-js/react"');
65
48
  content = content.replace(/from ["']@sdk["']/g, 'from "autumn-js"');
66
49
 
67
- // Transform synced component imports back to registry format
50
+ // Transform relative lib imports to registry format (but NOT utils)
68
51
  content = content.replace(
69
- /from ["']..\/([^\/]+)\/\1-synced["']/g,
70
- 'from "@/registry/$1/$1"'
52
+ /from ["'].\/lib\/(?!utils)([^"']+)["']/g,
53
+ 'from "@/registry/$COMPONENT_NAME/lib/$1"'
71
54
  );
72
55
 
73
- // Transform component-specific lib imports back to registry format (excluding utils)
56
+ // Transform synced component imports back to registry format
74
57
  content = content.replace(
75
- /from ["'].\/lib\/(?!utils)([^"']+)["']/g,
76
- 'from "@/registry/' + getCurrentComponentName() + '/lib/$1"'
58
+ /from ["']..\/([^\/]+)\/\1-synced["']/g,
59
+ 'from "@/registry/$1/$1"'
77
60
  );
78
61
 
79
- // Keep @/lib/utils and @/components/ui imports as-is (don't transform these)
80
- // ./lib/utils should stay as @/lib/utils
62
+ // Keep @/lib/utils and @/components/ui imports as-is
81
63
 
82
64
  return content;
83
65
  }
84
66
 
85
- let currentComponentName = '';
86
- function getCurrentComponentName(): string {
87
- return currentComponentName;
88
- }
89
-
90
67
  /**
91
- * Copy and transform a single component
68
+ * Sync a single component from synced version to registry
92
69
  */
93
- async function syncComponent(config: ComponentConfig): Promise<void> {
94
- const registryDir = path.join(REGISTRY_PATH, config.registryName);
95
- const outputDir = path.join(OUTPUT_PATH, config.outputName);
96
-
97
- try {
98
- // Create output directory
99
- await fs.mkdir(outputDir, { recursive: true });
100
-
101
- // Copy main component file
102
- let mainFilePath = path.join(registryDir, `${config.registryName}.tsx`);
103
-
104
- // Check if file exists in subdirectory (for pricing-table structure)
105
- try {
106
- await fs.access(mainFilePath);
107
- } catch {
108
- mainFilePath = path.join(registryDir, config.registryName, `${config.registryName}.tsx`);
109
- }
110
-
111
- const mainContent = await fs.readFile(mainFilePath, "utf-8");
112
- const transformedMain = transformImports(mainContent);
113
-
114
- await fs.writeFile(
115
- path.join(outputDir, `${config.registryName}-synced.tsx`),
116
- transformedMain
117
- );
118
-
119
- // Copy lib dependencies if they exist
120
- if (config.dependencies) {
121
- const libDir = path.join(registryDir, "lib");
122
- const outputLibDir = path.join(outputDir, "lib");
123
-
124
- try {
125
- await fs.mkdir(outputLibDir, { recursive: true });
126
-
127
- for (const dep of config.dependencies) {
128
- const depPath = path.join(libDir, `${dep}.tsx`);
129
- const depContent = await fs.readFile(depPath, "utf-8");
130
- const transformedDep = transformImports(depContent);
131
-
132
- await fs.writeFile(
133
- path.join(outputLibDir, `${dep}.tsx`),
134
- transformedDep
135
- );
136
- }
137
- } catch (error) {
138
- console.warn(`No lib directory found for ${config.registryName}`);
139
- }
140
- }
141
-
142
- console.log(`✅ Synced ${config.registryName} -> ${config.outputName}`);
143
- } catch (error) {
144
- console.error(`❌ Failed to sync ${config.registryName}:`, error);
145
- }
146
- }
147
-
148
- /**
149
- * Reverse sync a single component from library back to registry
150
- */
151
- async function reverseSyncComponent(config: ComponentConfig): Promise<void> {
152
- const registryDir = path.join(REGISTRY_PATH, config.registryName);
153
- const outputDir = path.join(OUTPUT_PATH, config.outputName);
154
-
155
- currentComponentName = config.registryName;
70
+ async function syncComponentToRegistry(config: ComponentConfig): Promise<void> {
71
+ const syncedDir = path.join(SYNCED_COMPONENTS_PATH, config.syncedName);
72
+ const registryDir = path.join(UI_REGISTRY_PATH, config.registryName);
156
73
 
157
74
  try {
158
75
  // Read the synced component file
159
- const syncedFilePath = path.join(outputDir, `${config.registryName}-synced.tsx`);
76
+ const syncedFilePath = path.join(syncedDir, `${config.syncedName}-synced.tsx`);
160
77
  const syncedContent = await fs.readFile(syncedFilePath, "utf-8");
161
- const reverseTransformed = reverseTransformImports(syncedContent);
78
+
79
+ // Transform content: remove au- prefixes and transform imports
80
+ let transformedContent = removeAuPrefixes(syncedContent);
81
+ transformedContent = transformImportsToRegistry(transformedContent);
82
+
83
+ // Replace the placeholder with actual component name
84
+ transformedContent = transformedContent.replace(/\$COMPONENT_NAME/g, config.registryName);
162
85
 
163
- // Determine the target path (handle subdirectory structure)
86
+ // Determine target path (handle subdirectory structure)
164
87
  let targetFilePath = path.join(registryDir, `${config.registryName}.tsx`);
165
88
 
166
89
  // Check if registry uses subdirectory structure
90
+ const subDirPath = path.join(registryDir, config.registryName, `${config.registryName}.tsx`);
167
91
  try {
168
- await fs.access(path.join(registryDir, config.registryName, `${config.registryName}.tsx`));
169
- targetFilePath = path.join(registryDir, config.registryName, `${config.registryName}.tsx`);
92
+ await fs.access(subDirPath);
93
+ targetFilePath = subDirPath;
170
94
  } catch {
171
- // Use the direct path
95
+ // Use direct path
172
96
  }
173
97
 
174
- await fs.writeFile(targetFilePath, reverseTransformed);
98
+ // Write the transformed content
99
+ await fs.writeFile(targetFilePath, transformedContent);
175
100
 
176
- // Reverse sync lib dependencies if they exist
101
+ // Sync lib dependencies if they exist
177
102
  if (config.dependencies) {
178
- const outputLibDir = path.join(outputDir, "lib");
179
- const libDir = path.join(registryDir, "lib");
103
+ const syncedLibDir = path.join(syncedDir, "lib");
104
+ const registryLibDir = path.join(registryDir, "lib");
180
105
 
181
106
  try {
182
107
  for (const dep of config.dependencies) {
183
- const syncedDepPath = path.join(outputLibDir, `${dep}.tsx`);
108
+ const syncedDepPath = path.join(syncedLibDir, `${dep}.tsx`);
184
109
  const syncedDepContent = await fs.readFile(syncedDepPath, "utf-8");
185
- const reverseTransformedDep = reverseTransformImports(syncedDepContent);
110
+
111
+ // Transform the dependency content
112
+ let transformedDepContent = removeAuPrefixes(syncedDepContent);
113
+ transformedDepContent = transformImportsToRegistry(transformedDepContent);
114
+ transformedDepContent = transformedDepContent.replace(/\$COMPONENT_NAME/g, config.registryName);
186
115
 
187
116
  await fs.writeFile(
188
- path.join(libDir, `${dep}.tsx`),
189
- reverseTransformedDep
117
+ path.join(registryLibDir, `${dep}.tsx`),
118
+ transformedDepContent
190
119
  );
191
120
  }
192
121
  } catch (error) {
193
- console.warn(`No lib directory found for synced ${config.registryName}`);
122
+ console.warn(`No lib directory found for synced ${config.syncedName}`);
194
123
  }
195
124
  }
196
125
 
197
- console.log(`🔄 Reverse synced ${config.outputName} -> ${config.registryName}`);
126
+ console.log(`✅ Synced ${config.syncedName} -> registry/${config.registryName}`);
198
127
  } catch (error) {
199
- console.error(`❌ Failed to reverse sync ${config.registryName}:`, error);
128
+ console.error(`❌ Failed to sync ${config.syncedName}:`, error);
200
129
  }
201
130
  }
202
131
 
203
132
  /**
204
- * Update the library index to export synced components
133
+ * Sync all components to registry
205
134
  */
206
- async function updateLibraryIndex(): Promise<void> {
207
- const indexPath = path.join(OUTPUT_PATH, "../index.ts");
208
- let currentContent = await fs.readFile(indexPath, "utf-8");
209
-
210
- // Remove existing auto-synced section
211
- currentContent = currentContent.replace(
212
- /\n\n\/\/ Auto-synced components\n[\s\S]*$/g,
213
- ""
214
- );
215
-
216
- // Add exports for synced components
217
- const newExports = COMPONENTS.map((config) => {
218
- const exportName = config.outputName
219
- .split("-")
220
- .map((word) => word.charAt(0).toUpperCase() + word.slice(1))
221
- .join("");
222
- return `export { default as ${exportName} } from "./components/${config.outputName}/${config.registryName}-synced";`;
223
- }).join("\n");
224
-
225
- const updatedContent =
226
- currentContent + "\n\n// Auto-synced components\n" + newExports;
227
- await fs.writeFile(indexPath, updatedContent);
228
- console.log("✅ Updated library index exports");
229
- }
230
-
231
- /**
232
- * Sync all components
233
- */
234
- async function syncAll(): Promise<void> {
235
- console.log("🔄 Syncing registry components...");
135
+ async function syncAllToRegistry(): Promise<void> {
136
+ console.log("🔄 Syncing components to registry...");
236
137
 
237
138
  for (const component of COMPONENTS) {
238
- await syncComponent(component);
139
+ await syncComponentToRegistry(component);
239
140
  }
240
141
 
241
- await updateLibraryIndex();
242
- console.log("🎉 Sync complete!");
142
+ console.log("🎉 Registry sync complete!");
243
143
  }
244
144
 
245
145
  /**
246
- * Reverse sync all components
146
+ * Watch synced components for changes
247
147
  */
248
- async function reverseSyncAll(): Promise<void> {
249
- console.log("🔄 Reverse syncing components back to registry...");
250
-
251
- for (const component of COMPONENTS) {
252
- await reverseSyncComponent(component);
253
- }
254
-
255
- console.log("🎉 Reverse sync complete!");
256
- }
148
+ function watchSyncedComponents(): void {
149
+ console.log("👀 Watching synced components for changes...");
257
150
 
258
- /**
259
- * Watch for changes and auto-sync
260
- */
261
- function watchRegistry(): void {
262
- console.log("👀 Watching registry for changes...");
263
-
264
- watch(REGISTRY_PATH, { recursive: true }, (_, filename) => {
265
- if (filename && filename.endsWith(".tsx")) {
266
- console.log(`📝 Detected change: ${filename}`);
267
- syncAll().catch(console.error);
268
- }
151
+ // Watch each component directory
152
+ COMPONENTS.forEach(config => {
153
+ const componentDir = path.join(SYNCED_COMPONENTS_PATH, config.syncedName);
154
+
155
+ watch(componentDir, { recursive: true }, (_: any, filename: any) => {
156
+ if (filename && filename.endsWith(".tsx")) {
157
+ console.log(`📝 Detected change in ${config.syncedName}: ${filename}`);
158
+ syncComponentToRegistry(config).catch(console.error);
159
+ }
160
+ });
269
161
  });
270
162
  }
271
163
 
@@ -274,19 +166,15 @@ const command = process.argv[2];
274
166
 
275
167
  switch (command) {
276
168
  case "sync":
277
- syncAll().catch(console.error);
278
- break;
279
- case "reverse":
280
- reverseSyncAll().catch(console.error);
169
+ syncAllToRegistry().catch(console.error);
281
170
  break;
282
171
  case "watch":
283
- syncAll()
284
- .then(() => watchRegistry())
172
+ syncAllToRegistry()
173
+ .then(() => watchSyncedComponents())
285
174
  .catch(console.error);
286
175
  break;
287
176
  default:
288
- console.log("Usage: tsx sync-registry.ts [sync|reverse|watch]");
289
- console.log(" sync - Sync from registry to library");
290
- console.log(" reverse - Sync from library back to registry");
291
- console.log(" watch - Sync and watch for changes");
292
- }
177
+ console.log("Usage: tsx sync-registry.ts [sync|watch]");
178
+ console.log(" sync - Sync synced components to registry");
179
+ console.log(" watch - Sync and watch synced components for changes");
180
+ }
@@ -0,0 +1,96 @@
1
+ import type { Config } from "tailwindcss";
2
+ import tailwindAnimate from "tailwindcss-animate";
3
+ import {
4
+ scopedPreflightStyles,
5
+ isolateInsideOfContainer,
6
+ } from "tailwindcss-scoped-preflight";
7
+
8
+ export default {
9
+ prefix: "au-",
10
+ corePlugins: {
11
+ preflight: false, // This removes @tailwind base completely
12
+ },
13
+ darkMode: ["class"],
14
+ content: ["./src/**/*.{html,js,ts,tsx}"],
15
+ theme: {
16
+ extend: {
17
+ colors: {
18
+ background: "hsl(var(--au-background))",
19
+ foreground: "hsl(var(--au-foreground))",
20
+ card: {
21
+ DEFAULT: "hsl(var(--au-card))",
22
+ foreground: "hsl(var(--au-card-foreground))",
23
+ },
24
+ popover: {
25
+ DEFAULT: "hsl(var(--au-popover))",
26
+ foreground: "hsl(var(--au-popover-foreground))",
27
+ },
28
+ primary: {
29
+ DEFAULT: "hsl(var(--au-primary))",
30
+ foreground: "hsl(var(--au-primary-foreground))",
31
+ },
32
+ secondary: {
33
+ DEFAULT: "hsl(var(--au-secondary))",
34
+ foreground: "hsl(var(--au-secondary-foreground))",
35
+ },
36
+ muted: {
37
+ DEFAULT: "hsl(var(--au-muted))",
38
+ foreground: "hsl(var(--au-muted-foreground))",
39
+ },
40
+ accent: {
41
+ DEFAULT: "hsl(var(--au-accent))",
42
+ foreground: "hsl(var(--au-accent-foreground))",
43
+ },
44
+ destructive: {
45
+ DEFAULT: "hsl(var(--au-destructive))",
46
+ foreground: "hsl(var(--au-destructive-foreground))",
47
+ },
48
+ border: "hsl(var(--au-border))",
49
+ input: "hsl(var(--au-input))",
50
+ ring: "hsl(var(--au-ring))",
51
+ chart: {
52
+ "1": "hsl(var(--au-chart-1))",
53
+ "2": "hsl(var(--au-chart-2))",
54
+ "3": "hsl(var(--au-chart-3))",
55
+ "4": "hsl(var(--au-chart-4))",
56
+ "5": "hsl(var(--au-chart-5))",
57
+ },
58
+ },
59
+ borderRadius: {
60
+ lg: "var(--au-radius)",
61
+ md: "calc(var(--au-radius) - 2px)",
62
+ sm: "calc(var(--au-radius) - 4px)",
63
+ },
64
+ keyframes: {
65
+ shine: {
66
+ "0%": { backgroundPosition: "0% 50%" },
67
+ "100%": { backgroundPosition: "200% 50%" },
68
+ },
69
+ bounceFast: {
70
+ "0%, 100%": { transform: "translateY(0)" },
71
+ "20%": { transform: "translateY(-8px)" },
72
+ "40%": { transform: "translateY(-4px)" },
73
+ "60%": { transform: "translateY(-8px)" },
74
+ "80%": { transform: "translateY(-4px)" },
75
+ },
76
+ bounceClick: {
77
+ "0%": { transform: "scale(1)" },
78
+ "20%": { transform: "scale(0.96)" },
79
+ "50%": { transform: "scale(1.04)" },
80
+ "100%": { transform: "scale(1)" },
81
+ },
82
+ },
83
+ animation: {
84
+ shine: "shine 3s ease-in-out infinite",
85
+ "bounce-fast": "bounceFast 0.6s cubic-bezier(0.4,0,0.6,1) infinite",
86
+ "bounce-click": "bounceClick 0.3s cubic-bezier(0.4,0,0.6,1)",
87
+ },
88
+ },
89
+ },
90
+ plugins: [
91
+ tailwindAnimate,
92
+ scopedPreflightStyles({
93
+ isolationStrategy: isolateInsideOfContainer(".au-root"),
94
+ }),
95
+ ],
96
+ } satisfies Config;
package/tsup.config.ts CHANGED
@@ -1,4 +1,5 @@
1
1
  import { defineConfig, Options } from "tsup";
2
+ // @ts-ignore
2
3
  import * as path from "path";
3
4
  import alias from "esbuild-plugin-alias";
4
5
 
@@ -35,8 +36,7 @@ const reactConfigs: Options[] = [
35
36
  external: ["react", "react/jsx-runtime", "react-dom"],
36
37
  bundle: true,
37
38
  banner: {
38
- // js: '"use client";\nrequire("../../styles/global.css");',
39
- js: '"use client";',
39
+ js: '"use client";\nrequire("../../styles/global.css");',
40
40
  },
41
41
  esbuildOptions(options) {
42
42
  options.plugins = options.plugins || [];
@@ -54,8 +54,7 @@ const reactConfigs: Options[] = [
54
54
  external: ["react", "react/jsx-runtime", "react-dom"],
55
55
  bundle: true,
56
56
  banner: {
57
- js: '"use client";',
58
- // js: '"use client";\nimport "../../styles/global.css";',
57
+ js: '"use client";\nimport "../../styles/global.css";',
59
58
  },
60
59
  esbuildOptions(options) {
61
60
  options.plugins = options.plugins || [];
@@ -1,6 +1,7 @@
1
1
  import { defineConfig, Options } from "tsup";
2
2
  import * as path from "path";
3
3
  import alias from "esbuild-plugin-alias";
4
+ import fs from "fs";
4
5
 
5
6
  // Path aliases that match tsconfig.json
6
7
  const pathAliases = {
@@ -35,8 +36,7 @@ const reactConfigs: Options[] = [
35
36
  external: ["react", "react/jsx-runtime", "react-dom"],
36
37
  bundle: true,
37
38
  banner: {
38
- js: '"use client";',
39
- // js: '"use client";\nrequire("../../styles/global.css");',
39
+ js: '"use client";\nrequire("../../styles/global.css");',
40
40
  },
41
41
  esbuildOptions(options) {
42
42
  options.plugins = options.plugins || [];
@@ -54,8 +54,7 @@ const reactConfigs: Options[] = [
54
54
  external: ["react", "react/jsx-runtime", "react-dom"],
55
55
  bundle: true,
56
56
  banner: {
57
- js: '"use client";',
58
- // js: '"use client";\nimport "../../styles/global.css";',
57
+ js: '"use client";\nimport "../../styles/global.css";',
59
58
  },
60
59
  esbuildOptions(options) {
61
60
  options.plugins = options.plugins || [];