@marvalt/digivalt-core 0.1.0 → 0.1.1

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/bin/init.cjs ADDED
@@ -0,0 +1,42 @@
1
+ #!/usr/bin/env node
2
+
3
+ const fs = require('fs');
4
+ const path = require('path');
5
+
6
+ const sourceDir = path.join(__dirname, '..', 'template');
7
+ const targetDir = process.cwd();
8
+
9
+ console.log('šŸš€ Initializing DigiVAlt Cloudflare Proxy Templates...');
10
+
11
+ function copyRecursiveSync(src, dest) {
12
+ const exists = fs.existsSync(src);
13
+ const stats = exists && fs.statSync(src);
14
+ const isDirectory = exists && stats.isDirectory();
15
+
16
+ if (isDirectory) {
17
+ if (!fs.existsSync(dest)) fs.mkdirSync(dest);
18
+ fs.readdirSync(src).forEach((childItemName) => {
19
+ copyRecursiveSync(path.join(src, childItemName), path.join(dest, childItemName));
20
+ });
21
+ } else {
22
+ // We only copy if it doesn't already exist to prevent overwriting user changes!
23
+ if (fs.existsSync(dest)) {
24
+ console.log(`āš ļø Skipping ${dest.replace(targetDir, '')} (Already exists)`);
25
+ } else {
26
+ fs.copyFileSync(src, dest);
27
+ console.log(`āœ… Copied ${dest.replace(targetDir, '')}`);
28
+ }
29
+ }
30
+ }
31
+
32
+ try {
33
+ copyRecursiveSync(sourceDir, targetDir);
34
+ console.log('\nšŸŽ‰ DigiVAlt Cloudflare proxy routes installed successfully!');
35
+ console.log('šŸ‘‰ Next Steps:');
36
+ console.log('1. Copy .dev.vars.example to .dev.vars and add your API keys.');
37
+ console.log("2. Run `npm install -D wrangler` if you haven't already.");
38
+ console.log("3. Run `npx wrangler pages dev` to test your proxy functions locally.");
39
+ } catch (error) {
40
+ console.error('āŒ Failed to construct templates:', error);
41
+ process.exit(1);
42
+ }
package/dist/index.cjs CHANGED
@@ -2497,6 +2497,10 @@ async function generateAllData() {
2497
2497
  dotenv.config();
2498
2498
  dotenv.config({ path: '.env.local' });
2499
2499
  console.log('šŸš€ Starting DigiVAlt static data generation...');
2500
+ if (process.env.VITE_IS_LOVABLE === 'true') {
2501
+ console.log('⚔ Lovable Environment Detected (VITE_IS_LOVABLE). Skipping static data generation to use GitHub synced static files.');
2502
+ return;
2503
+ }
2500
2504
  const wpSuccess = await generateWordPressData();
2501
2505
  const gfSuccess = await generateGravityFormsData();
2502
2506
  const mauticSuccess = await generateMauticData();