@moontra/moonui-pro 3.3.1 → 3.3.2
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 +1 -1
- package/scripts/postinstall.cjs +15 -0
- package/scripts/validate-license.cjs +53 -0
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@moontra/moonui-pro",
|
|
3
|
-
"version": "3.3.
|
|
3
|
+
"version": "3.3.2",
|
|
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
|
@@ -213,6 +213,15 @@ function saveLicenseToken(token) {
|
|
|
213
213
|
|
|
214
214
|
// Main postinstall logic
|
|
215
215
|
async function main() {
|
|
216
|
+
console.log('[MoonUI Pro] === POSTINSTALL SCRIPT STARTED ===');
|
|
217
|
+
console.log('[MoonUI Pro] Environment:', {
|
|
218
|
+
NODE_ENV: process.env.NODE_ENV,
|
|
219
|
+
VERCEL: process.env.VERCEL,
|
|
220
|
+
NETLIFY: process.env.NETLIFY,
|
|
221
|
+
CI: process.env.CI,
|
|
222
|
+
MOONUI_AUTH_TOKEN: !!process.env.MOONUI_AUTH_TOKEN
|
|
223
|
+
});
|
|
224
|
+
|
|
216
225
|
try {
|
|
217
226
|
// Only run in production environments
|
|
218
227
|
if (!isProduction()) {
|
|
@@ -288,10 +297,16 @@ async function main() {
|
|
|
288
297
|
|
|
289
298
|
// Run if called directly (not imported)
|
|
290
299
|
if (require.main === module) {
|
|
300
|
+
console.log('[MoonUI Pro] PostInstall script invoked');
|
|
291
301
|
main().catch(error => {
|
|
292
302
|
console.error('[MoonUI Pro] Unexpected error:', error);
|
|
303
|
+
console.error('[MoonUI Pro] Stack trace:', error.stack);
|
|
293
304
|
process.exit(0); // Don't fail npm install
|
|
305
|
+
}).finally(() => {
|
|
306
|
+
console.log('[MoonUI Pro] === POSTINSTALL SCRIPT FINISHED ===');
|
|
294
307
|
});
|
|
308
|
+
} else {
|
|
309
|
+
console.log('[MoonUI Pro] PostInstall script loaded as module');
|
|
295
310
|
}
|
|
296
311
|
|
|
297
312
|
module.exports = { validateLicense, saveLicenseToken, isProduction };
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* MoonUI Pro License Validation Script
|
|
5
|
+
* Can be called from build scripts or directly
|
|
6
|
+
*/
|
|
7
|
+
|
|
8
|
+
const postinstall = require('./postinstall.cjs');
|
|
9
|
+
|
|
10
|
+
// Force production mode for validation
|
|
11
|
+
process.env.NODE_ENV = 'production';
|
|
12
|
+
|
|
13
|
+
console.log('[MoonUI Pro] Running license validation from build script...');
|
|
14
|
+
|
|
15
|
+
async function validate() {
|
|
16
|
+
try {
|
|
17
|
+
const licenseKey = process.env.MOONUI_LICENSE_KEY ||
|
|
18
|
+
process.env.NEXT_PUBLIC_MOONUI_LICENSE_KEY ||
|
|
19
|
+
process.env.VITE_MOONUI_LICENSE_KEY ||
|
|
20
|
+
process.env.REACT_APP_MOONUI_LICENSE_KEY;
|
|
21
|
+
|
|
22
|
+
if (!licenseKey) {
|
|
23
|
+
console.log('[MoonUI Pro] No license key found in environment variables');
|
|
24
|
+
return;
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
console.log('[MoonUI Pro] Found license key, validating...');
|
|
28
|
+
|
|
29
|
+
// Use the validation function from postinstall
|
|
30
|
+
const result = await postinstall.validateLicense(licenseKey);
|
|
31
|
+
|
|
32
|
+
if (result && result.valid && result.hasProAccess) {
|
|
33
|
+
console.log('[MoonUI Pro] License validated successfully via build script');
|
|
34
|
+
|
|
35
|
+
const token = {
|
|
36
|
+
valid: true,
|
|
37
|
+
hasProAccess: result.hasProAccess,
|
|
38
|
+
plan: result.plan || 'pro',
|
|
39
|
+
expiresAt: Date.now() + (30 * 24 * 60 * 60 * 1000),
|
|
40
|
+
timestamp: Date.now()
|
|
41
|
+
};
|
|
42
|
+
|
|
43
|
+
postinstall.saveLicenseToken(token);
|
|
44
|
+
} else {
|
|
45
|
+
console.log('[MoonUI Pro] License validation failed via build script');
|
|
46
|
+
}
|
|
47
|
+
} catch (error) {
|
|
48
|
+
console.error('[MoonUI Pro] Error during build validation:', error);
|
|
49
|
+
}
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
// Run validation
|
|
53
|
+
validate();
|