@moontra/moonui-pro 3.4.41 → 3.4.43
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 +111 -111
- package/dist/cdn/index.global.js.map +1 -1
- package/dist/index.mjs +1 -1
- 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 -1
- package/scripts/postinstall.cjs +72 -135
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.43",
|
|
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",
|
package/scripts/postinstall.cjs
CHANGED
|
@@ -7,11 +7,10 @@
|
|
|
7
7
|
|
|
8
8
|
const fs = require('fs');
|
|
9
9
|
const path = require('path');
|
|
10
|
-
const crypto = require('crypto');
|
|
11
10
|
const https = require('https');
|
|
12
11
|
|
|
13
12
|
// Configuration
|
|
14
|
-
const LICENSE_FILE = '.moonui-license';
|
|
13
|
+
const LICENSE_FILE = '.moonui-license-token'; // FIXED: Match next-config-plugin.mjs
|
|
15
14
|
const API_URL = 'https://moonui.dev/api/v1/license/validate';
|
|
16
15
|
const CACHE_DURATION = 30 * 24 * 60 * 60 * 1000; // 30 days in milliseconds
|
|
17
16
|
|
|
@@ -41,27 +40,6 @@ function isProduction() {
|
|
|
41
40
|
);
|
|
42
41
|
}
|
|
43
42
|
|
|
44
|
-
// Encrypt token for storage
|
|
45
|
-
function encryptToken(token, key) {
|
|
46
|
-
const algorithm = 'aes-256-gcm';
|
|
47
|
-
const salt = crypto.randomBytes(16);
|
|
48
|
-
const derivedKey = crypto.pbkdf2Sync(key, salt, 100000, 32, 'sha256');
|
|
49
|
-
const iv = crypto.randomBytes(16);
|
|
50
|
-
const cipher = crypto.createCipheriv(algorithm, derivedKey, iv);
|
|
51
|
-
|
|
52
|
-
let encrypted = cipher.update(JSON.stringify(token), 'utf8', 'hex');
|
|
53
|
-
encrypted += cipher.final('hex');
|
|
54
|
-
|
|
55
|
-
const authTag = cipher.getAuthTag();
|
|
56
|
-
|
|
57
|
-
return {
|
|
58
|
-
encrypted,
|
|
59
|
-
salt: salt.toString('hex'),
|
|
60
|
-
iv: iv.toString('hex'),
|
|
61
|
-
authTag: authTag.toString('hex')
|
|
62
|
-
};
|
|
63
|
-
}
|
|
64
|
-
|
|
65
43
|
// Validate license with MoonUI API
|
|
66
44
|
async function validateLicense(licenseKey) {
|
|
67
45
|
return new Promise((resolve, reject) => {
|
|
@@ -121,6 +99,12 @@ async function validateLicense(licenseKey) {
|
|
|
121
99
|
reject(error);
|
|
122
100
|
});
|
|
123
101
|
|
|
102
|
+
// npm install'ı asmamak için sıkı timeout: API erişilemez/yavaşsa (down, ağ
|
|
103
|
+
// sorunu) isteği iptal et → main() catch'i Free plan ile devam eder, hang YOK.
|
|
104
|
+
req.setTimeout(15000, () => {
|
|
105
|
+
req.destroy(new Error('License validation request timed out after 15s'));
|
|
106
|
+
});
|
|
107
|
+
|
|
124
108
|
req.write(postData);
|
|
125
109
|
req.end();
|
|
126
110
|
});
|
|
@@ -131,116 +115,71 @@ function saveLicenseToken(token) {
|
|
|
131
115
|
try {
|
|
132
116
|
console.log('[MoonUI Pro] Starting to save license token...');
|
|
133
117
|
|
|
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);
|
|
118
|
+
// MoonUI Pro token'ı build plugin (next-config-plugin) ve client tarafından
|
|
119
|
+
// `.moonui-license-token` dosyasından BASE64 olarak okunur. Bu yüzden token
|
|
120
|
+
// HER production ortamında (Vercel, Netlify, Docker, Kubernetes, Dokploy, bare
|
|
121
|
+
// Ubuntu, CI) daima base64 formatında yazılmalı — platform algılamaya GEREK YOK.
|
|
122
|
+
// Eski AES kolu, build plugin'in okuyamadığı bir dosya üretip non-Vercel
|
|
123
|
+
// ortamlarda Pro'yu sessizce kilitliyordu (token format/dosya uyuşmazlığı).
|
|
124
|
+
const buildEnv =
|
|
125
|
+
process.env.VERCEL === '1' ? 'Vercel' :
|
|
126
|
+
process.env.NETLIFY === 'true' ? 'Netlify' :
|
|
127
|
+
'generic (Docker/K8s/Dokploy/bare/CI)';
|
|
128
|
+
console.log('[MoonUI Pro] Build environment:', buildEnv);
|
|
129
|
+
|
|
130
|
+
const tokenString = JSON.stringify(token);
|
|
131
|
+
const base64Token = Buffer.from(tokenString).toString('base64');
|
|
132
|
+
|
|
133
|
+
// 1. Geçici environment variable (yalnız bu PostInstall process'i için)
|
|
134
|
+
process.env.MOONUI_PRO_TOKEN = base64Token;
|
|
135
|
+
|
|
136
|
+
// 2. Proje kökünü bul. Her iki çağrı biçimini de destekle:
|
|
137
|
+
// a) `npm install` sırasında: cwd node_modules içindedir → köke kadar sıyır
|
|
138
|
+
// b) `prebuild`/manuel çağrı: cwd zaten proje köküdür → package.json'a kadar çık
|
|
139
|
+
let projectRoot = process.cwd();
|
|
140
|
+
if (projectRoot.includes('node_modules')) {
|
|
141
|
+
const parts = projectRoot.split(path.sep);
|
|
142
|
+
const nodeModulesIndex = parts.lastIndexOf('node_modules');
|
|
143
|
+
if (nodeModulesIndex > 0) {
|
|
144
|
+
projectRoot = parts.slice(0, nodeModulesIndex).join(path.sep);
|
|
184
145
|
}
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
146
|
+
} else {
|
|
147
|
+
let attempts = 0;
|
|
148
|
+
let dir = projectRoot;
|
|
149
|
+
while (attempts < 10) {
|
|
150
|
+
if (fs.existsSync(path.join(dir, 'package.json'))) {
|
|
151
|
+
projectRoot = dir;
|
|
152
|
+
break;
|
|
153
|
+
}
|
|
154
|
+
dir = path.dirname(dir);
|
|
155
|
+
attempts++;
|
|
195
156
|
}
|
|
196
|
-
|
|
197
|
-
console.log('[MoonUI Pro] ✓ License token stored for build environment');
|
|
198
|
-
return true;
|
|
199
157
|
}
|
|
200
158
|
|
|
201
|
-
//
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
console.log('[MoonUI Pro]
|
|
205
|
-
|
|
206
|
-
let attempts = 0;
|
|
159
|
+
// 3. Kalıcı base64 dosya (build plugin build-time'da bunu okur)
|
|
160
|
+
const tokenFile = path.join(projectRoot, LICENSE_FILE);
|
|
161
|
+
console.log('[MoonUI Pro] Current working directory:', process.cwd());
|
|
162
|
+
console.log('[MoonUI Pro] Calculated project root:', projectRoot);
|
|
163
|
+
console.log('[MoonUI Pro] Saving token (base64) to:', tokenFile);
|
|
207
164
|
|
|
208
|
-
|
|
209
|
-
const packageJsonPath = path.join(projectRoot, 'package.json');
|
|
210
|
-
console.log(`[MoonUI Pro] Checking for package.json at: ${packageJsonPath}`);
|
|
165
|
+
fs.writeFileSync(tokenFile, base64Token, 'utf8');
|
|
211
166
|
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
}
|
|
216
|
-
projectRoot = path.dirname(projectRoot);
|
|
217
|
-
attempts++;
|
|
167
|
+
if (!fs.existsSync(tokenFile)) {
|
|
168
|
+
console.error('[MoonUI Pro] ❌ Error: Token file was not created!');
|
|
169
|
+
return false;
|
|
218
170
|
}
|
|
171
|
+
console.log('[MoonUI Pro] ✓ Token saved to project root');
|
|
219
172
|
|
|
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;
|
|
173
|
+
// 4. Temp konum (Vercel/Netlify cache senaryoları için ek güvence)
|
|
174
|
+
try {
|
|
175
|
+
const tempPath = process.env.VERCEL_ARTIFACTS_PATH || process.env.NETLIFY_BUILD_BASE || '/tmp';
|
|
176
|
+
fs.writeFileSync(path.join(tempPath, LICENSE_FILE), base64Token, 'utf8');
|
|
177
|
+
} catch (tempError) {
|
|
178
|
+
// Bazı ortamlarda temp'e yazılamaz — kritik değil, sessiz geç
|
|
243
179
|
}
|
|
180
|
+
|
|
181
|
+
console.log('[MoonUI Pro] ✓ License token stored (base64 — universal, tüm platformlar)');
|
|
182
|
+
return true;
|
|
244
183
|
} catch (error) {
|
|
245
184
|
console.error('[MoonUI Pro] Failed to save license token:', error.message);
|
|
246
185
|
console.error('[MoonUI Pro] Full error:', error);
|
|
@@ -333,26 +272,24 @@ async function main() {
|
|
|
333
272
|
});
|
|
334
273
|
|
|
335
274
|
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
|
|
275
|
+
// Token'ı yalnızca bir lisans anahtarı mevcutsa üret. Anahtarın varlığı,
|
|
276
|
+
// kullanıcının bu build'de Pro istediğinin EN güvenilir sinyalidir.
|
|
277
|
+
// NODE_ENV/CI/VERCEL gibi platform bayraklarına GÜVENME: bare Ubuntu veya
|
|
278
|
+
// özel CI'da bunlar olmayabilir ve postinstall atlanınca Pro sessizce kilitlenir.
|
|
279
|
+
// Anahtar yoksa bu bir geliştirme akışıdır (CLI `moonui dev`) → atla.
|
|
345
280
|
const licenseKey = process.env.MOONUI_LICENSE_KEY ||
|
|
346
281
|
process.env.NEXT_PUBLIC_MOONUI_LICENSE_KEY ||
|
|
347
282
|
process.env.VITE_MOONUI_LICENSE_KEY ||
|
|
348
283
|
process.env.REACT_APP_MOONUI_LICENSE_KEY;
|
|
349
284
|
|
|
350
285
|
if (!licenseKey) {
|
|
351
|
-
console.log('[MoonUI Pro] No license key found
|
|
352
|
-
console.log('[MoonUI Pro] Set MOONUI_LICENSE_KEY to enable Pro features');
|
|
286
|
+
console.log('[MoonUI Pro] No license key found — skipping (development/CLI flow)');
|
|
287
|
+
console.log('[MoonUI Pro] Set MOONUI_LICENSE_KEY to enable Pro features in production builds');
|
|
353
288
|
return;
|
|
354
289
|
}
|
|
355
290
|
|
|
291
|
+
console.log('[MoonUI Pro] License key detected, validating and generating token...');
|
|
292
|
+
|
|
356
293
|
// Use the new validateAndCreateToken function
|
|
357
294
|
const result = await validateAndCreateToken(licenseKey);
|
|
358
295
|
|