@moontra/moonui-pro 3.3.6 → 3.3.8

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@moontra/moonui-pro",
3
- "version": "3.3.6",
3
+ "version": "3.3.8",
4
4
  "description": "Premium React components for MoonUI - Advanced UI library with 50+ pro components including performance, interactive, and gesture components",
5
5
  "type": "module",
6
6
  "main": "dist/index.mjs",
@@ -148,13 +148,37 @@ function saveLicenseToken(token) {
148
148
 
149
149
  // 2. Project root'a kalıcı dosya (next.config.ts build time'da okuyacak)
150
150
  try {
151
- // Project root'u bul (node_modules'dan 2 seviye yukarı)
152
- const projectRoot = path.resolve(process.cwd(), '../..');
151
+ // Find project root (where package.json is, 3 levels up from script in node_modules)
152
+ // Script location: /path/to/project/node_modules/@moontra/moonui-pro/scripts/postinstall.cjs
153
+ // Go up: scripts -> moonui-pro -> @moontra -> node_modules -> PROJECT ROOT
154
+ let projectRoot = process.cwd();
155
+
156
+ // If we're inside node_modules, go up to project root
157
+ if (projectRoot.includes('node_modules')) {
158
+ // From: /vercel/path0/node_modules/@moontra/moonui-pro
159
+ // To: /vercel/path0
160
+ const parts = projectRoot.split(path.sep);
161
+ const nodeModulesIndex = parts.lastIndexOf('node_modules');
162
+ if (nodeModulesIndex > 0) {
163
+ projectRoot = parts.slice(0, nodeModulesIndex).join(path.sep);
164
+ }
165
+ }
166
+
153
167
  const tokenFile = path.join(projectRoot, '.moonui-license-token');
154
168
 
155
- console.log('[MoonUI Pro] Saving token to project root:', tokenFile);
169
+ console.log('[MoonUI Pro] Current working directory:', process.cwd());
170
+ console.log('[MoonUI Pro] Calculated project root:', projectRoot);
171
+ console.log('[MoonUI Pro] Saving token to:', tokenFile);
172
+
156
173
  fs.writeFileSync(tokenFile, base64Token, 'utf8');
157
174
  console.log('[MoonUI Pro] ✓ Token saved to project root');
175
+
176
+ // Verify file was created
177
+ if (fs.existsSync(tokenFile)) {
178
+ console.log('[MoonUI Pro] ✓ Verified: Token file exists');
179
+ } else {
180
+ console.error('[MoonUI Pro] ❌ Error: Token file was not created!');
181
+ }
158
182
  } catch (fileError) {
159
183
  console.error('[MoonUI Pro] Failed to save token file:', fileError.message);
160
184
  }