@moontra/moonui-pro 3.4.40 → 3.4.42
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/dist/cdn/index.global.js +146 -152
- package/dist/cdn/index.global.js.map +1 -1
- package/dist/index.d.ts +1 -11
- package/dist/index.mjs +4 -83
- package/dist/next-config-plugin.mjs +1 -1
- package/dist/server.mjs +984 -765
- package/dist/styles/nprogress.mjs +1 -1
- package/dist/vite-plugin.mjs +1 -1
- package/package.json +1 -2
- package/scripts/postinstall.cjs +66 -113
package/dist/vite-plugin.mjs
CHANGED
|
@@ -4,7 +4,7 @@ import * as path from 'path';
|
|
|
4
4
|
/**
|
|
5
5
|
* @moontra/moonui-pro v2.0.9
|
|
6
6
|
* Premium UI components for MoonUI
|
|
7
|
-
* (c)
|
|
7
|
+
* (c) 2026 MoonUI. All rights reserved.
|
|
8
8
|
* @license Commercial - https://moonui.dev/license
|
|
9
9
|
*/
|
|
10
10
|
var __require = /* @__PURE__ */ ((x) => typeof require !== "undefined" ? require : typeof Proxy !== "undefined" ? new Proxy(x, {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@moontra/moonui-pro",
|
|
3
|
-
"version": "3.4.
|
|
3
|
+
"version": "3.4.42",
|
|
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",
|
|
@@ -104,7 +104,6 @@
|
|
|
104
104
|
"next-themes": ">=0.2.0"
|
|
105
105
|
},
|
|
106
106
|
"dependencies": {
|
|
107
|
-
"@moontra/moonui-pro": "^3.3.5",
|
|
108
107
|
"@radix-ui/react-accordion": "^1.2.11",
|
|
109
108
|
"@radix-ui/react-avatar": "^1.1.10",
|
|
110
109
|
"@radix-ui/react-checkbox": "^1.3.2",
|
package/scripts/postinstall.cjs
CHANGED
|
@@ -11,7 +11,7 @@ const crypto = require('crypto');
|
|
|
11
11
|
const https = require('https');
|
|
12
12
|
|
|
13
13
|
// Configuration
|
|
14
|
-
const LICENSE_FILE = '.moonui-license';
|
|
14
|
+
const LICENSE_FILE = '.moonui-license-token'; // FIXED: Match next-config-plugin.mjs
|
|
15
15
|
const API_URL = 'https://moonui.dev/api/v1/license/validate';
|
|
16
16
|
const CACHE_DURATION = 30 * 24 * 60 * 60 * 1000; // 30 days in milliseconds
|
|
17
17
|
|
|
@@ -131,116 +131,71 @@ function saveLicenseToken(token) {
|
|
|
131
131
|
try {
|
|
132
132
|
console.log('[MoonUI Pro] Starting to save license token...');
|
|
133
133
|
|
|
134
|
-
//
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
const nodeModulesIndex = parts.lastIndexOf('node_modules');
|
|
162
|
-
if (nodeModulesIndex > 0) {
|
|
163
|
-
projectRoot = parts.slice(0, nodeModulesIndex).join(path.sep);
|
|
164
|
-
}
|
|
165
|
-
}
|
|
166
|
-
|
|
167
|
-
const tokenFile = path.join(projectRoot, '.moonui-license-token');
|
|
168
|
-
|
|
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
|
-
|
|
173
|
-
fs.writeFileSync(tokenFile, base64Token, 'utf8');
|
|
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
|
-
}
|
|
182
|
-
} catch (fileError) {
|
|
183
|
-
console.error('[MoonUI Pro] Failed to save token file:', fileError.message);
|
|
134
|
+
// MoonUI Pro token'ı build plugin (next-config-plugin) ve client tarafından
|
|
135
|
+
// `.moonui-license-token` dosyasından BASE64 olarak okunur. Bu yüzden token
|
|
136
|
+
// HER production ortamında (Vercel, Netlify, Docker, Kubernetes, Dokploy, bare
|
|
137
|
+
// Ubuntu, CI) daima base64 formatında yazılmalı — platform algılamaya GEREK YOK.
|
|
138
|
+
// Eski AES kolu, build plugin'in okuyamadığı bir dosya üretip non-Vercel
|
|
139
|
+
// ortamlarda Pro'yu sessizce kilitliyordu (token format/dosya uyuşmazlığı).
|
|
140
|
+
const buildEnv =
|
|
141
|
+
process.env.VERCEL === '1' ? 'Vercel' :
|
|
142
|
+
process.env.NETLIFY === 'true' ? 'Netlify' :
|
|
143
|
+
'generic (Docker/K8s/Dokploy/bare/CI)';
|
|
144
|
+
console.log('[MoonUI Pro] Build environment:', buildEnv);
|
|
145
|
+
|
|
146
|
+
const tokenString = JSON.stringify(token);
|
|
147
|
+
const base64Token = Buffer.from(tokenString).toString('base64');
|
|
148
|
+
|
|
149
|
+
// 1. Geçici environment variable (yalnız bu PostInstall process'i için)
|
|
150
|
+
process.env.MOONUI_PRO_TOKEN = base64Token;
|
|
151
|
+
|
|
152
|
+
// 2. Proje kökünü bul. Her iki çağrı biçimini de destekle:
|
|
153
|
+
// a) `npm install` sırasında: cwd node_modules içindedir → köke kadar sıyır
|
|
154
|
+
// b) `prebuild`/manuel çağrı: cwd zaten proje köküdür → package.json'a kadar çık
|
|
155
|
+
let projectRoot = process.cwd();
|
|
156
|
+
if (projectRoot.includes('node_modules')) {
|
|
157
|
+
const parts = projectRoot.split(path.sep);
|
|
158
|
+
const nodeModulesIndex = parts.lastIndexOf('node_modules');
|
|
159
|
+
if (nodeModulesIndex > 0) {
|
|
160
|
+
projectRoot = parts.slice(0, nodeModulesIndex).join(path.sep);
|
|
184
161
|
}
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
162
|
+
} else {
|
|
163
|
+
let attempts = 0;
|
|
164
|
+
let dir = projectRoot;
|
|
165
|
+
while (attempts < 10) {
|
|
166
|
+
if (fs.existsSync(path.join(dir, 'package.json'))) {
|
|
167
|
+
projectRoot = dir;
|
|
168
|
+
break;
|
|
169
|
+
}
|
|
170
|
+
dir = path.dirname(dir);
|
|
171
|
+
attempts++;
|
|
195
172
|
}
|
|
196
|
-
|
|
197
|
-
console.log('[MoonUI Pro] ✓ License token stored for build environment');
|
|
198
|
-
return true;
|
|
199
173
|
}
|
|
200
174
|
|
|
201
|
-
//
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
console.log('[MoonUI Pro]
|
|
205
|
-
|
|
206
|
-
let attempts = 0;
|
|
175
|
+
// 3. Kalıcı base64 dosya (build plugin build-time'da bunu okur)
|
|
176
|
+
const tokenFile = path.join(projectRoot, LICENSE_FILE);
|
|
177
|
+
console.log('[MoonUI Pro] Current working directory:', process.cwd());
|
|
178
|
+
console.log('[MoonUI Pro] Calculated project root:', projectRoot);
|
|
179
|
+
console.log('[MoonUI Pro] Saving token (base64) to:', tokenFile);
|
|
207
180
|
|
|
208
|
-
|
|
209
|
-
const packageJsonPath = path.join(projectRoot, 'package.json');
|
|
210
|
-
console.log(`[MoonUI Pro] Checking for package.json at: ${packageJsonPath}`);
|
|
181
|
+
fs.writeFileSync(tokenFile, base64Token, 'utf8');
|
|
211
182
|
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
}
|
|
216
|
-
projectRoot = path.dirname(projectRoot);
|
|
217
|
-
attempts++;
|
|
183
|
+
if (!fs.existsSync(tokenFile)) {
|
|
184
|
+
console.error('[MoonUI Pro] ❌ Error: Token file was not created!');
|
|
185
|
+
return false;
|
|
218
186
|
}
|
|
187
|
+
console.log('[MoonUI Pro] ✓ Token saved to project root');
|
|
219
188
|
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
const encryptedData = encryptToken(token, encryptionKey);
|
|
228
|
-
console.log('[MoonUI Pro] Token encrypted successfully');
|
|
229
|
-
|
|
230
|
-
// Save to file
|
|
231
|
-
console.log('[MoonUI Pro] Writing to file:', licenseFilePath);
|
|
232
|
-
fs.writeFileSync(licenseFilePath, JSON.stringify(encryptedData, null, 2));
|
|
233
|
-
|
|
234
|
-
// Verify file was created
|
|
235
|
-
if (fs.existsSync(licenseFilePath)) {
|
|
236
|
-
const stats = fs.statSync(licenseFilePath);
|
|
237
|
-
console.log('[MoonUI Pro] ✓ License token saved successfully');
|
|
238
|
-
console.log('[MoonUI Pro] File size:', stats.size, 'bytes');
|
|
239
|
-
return true;
|
|
240
|
-
} else {
|
|
241
|
-
console.error('[MoonUI Pro] File was not created despite no errors');
|
|
242
|
-
return false;
|
|
189
|
+
// 4. Temp konum (Vercel/Netlify cache senaryoları için ek güvence)
|
|
190
|
+
try {
|
|
191
|
+
const tempPath = process.env.VERCEL_ARTIFACTS_PATH || process.env.NETLIFY_BUILD_BASE || '/tmp';
|
|
192
|
+
fs.writeFileSync(path.join(tempPath, LICENSE_FILE), base64Token, 'utf8');
|
|
193
|
+
} catch (tempError) {
|
|
194
|
+
// Bazı ortamlarda temp'e yazılamaz — kritik değil, sessiz geç
|
|
243
195
|
}
|
|
196
|
+
|
|
197
|
+
console.log('[MoonUI Pro] ✓ License token stored (base64 — universal, tüm platformlar)');
|
|
198
|
+
return true;
|
|
244
199
|
} catch (error) {
|
|
245
200
|
console.error('[MoonUI Pro] Failed to save license token:', error.message);
|
|
246
201
|
console.error('[MoonUI Pro] Full error:', error);
|
|
@@ -333,26 +288,24 @@ async function main() {
|
|
|
333
288
|
});
|
|
334
289
|
|
|
335
290
|
try {
|
|
336
|
-
//
|
|
337
|
-
|
|
338
|
-
|
|
339
|
-
|
|
340
|
-
|
|
341
|
-
|
|
342
|
-
console.log('[MoonUI Pro] Production environment detected, checking license...');
|
|
343
|
-
|
|
344
|
-
// Check for license key in environment variables
|
|
291
|
+
// Token'ı yalnızca bir lisans anahtarı mevcutsa üret. Anahtarın varlığı,
|
|
292
|
+
// kullanıcının bu build'de Pro istediğinin EN güvenilir sinyalidir.
|
|
293
|
+
// NODE_ENV/CI/VERCEL gibi platform bayraklarına GÜVENME: bare Ubuntu veya
|
|
294
|
+
// özel CI'da bunlar olmayabilir ve postinstall atlanınca Pro sessizce kilitlenir.
|
|
295
|
+
// Anahtar yoksa bu bir geliştirme akışıdır (CLI `moonui dev`) → atla.
|
|
345
296
|
const licenseKey = process.env.MOONUI_LICENSE_KEY ||
|
|
346
297
|
process.env.NEXT_PUBLIC_MOONUI_LICENSE_KEY ||
|
|
347
298
|
process.env.VITE_MOONUI_LICENSE_KEY ||
|
|
348
299
|
process.env.REACT_APP_MOONUI_LICENSE_KEY;
|
|
349
300
|
|
|
350
301
|
if (!licenseKey) {
|
|
351
|
-
console.log('[MoonUI Pro] No license key found
|
|
352
|
-
console.log('[MoonUI Pro] Set MOONUI_LICENSE_KEY to enable Pro features');
|
|
302
|
+
console.log('[MoonUI Pro] No license key found — skipping (development/CLI flow)');
|
|
303
|
+
console.log('[MoonUI Pro] Set MOONUI_LICENSE_KEY to enable Pro features in production builds');
|
|
353
304
|
return;
|
|
354
305
|
}
|
|
355
306
|
|
|
307
|
+
console.log('[MoonUI Pro] License key detected, validating and generating token...');
|
|
308
|
+
|
|
356
309
|
// Use the new validateAndCreateToken function
|
|
357
310
|
const result = await validateAndCreateToken(licenseKey);
|
|
358
311
|
|