flashorm 2.1.11 โ 2.2.0-beta1
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 +5 -4
- package/scripts/install.js +58 -5
package/package.json
CHANGED
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "flashorm",
|
|
3
|
-
"version": "2.
|
|
4
|
-
"description": "A powerful, database-agnostic
|
|
3
|
+
"version": "2.2.0-beta1",
|
|
4
|
+
"description": "A powerful, database-agnostic ORM with plugin-based architecture - Base CLI only",
|
|
5
5
|
"main": "index.js",
|
|
6
6
|
"bin": {
|
|
7
7
|
"flash": "./bin/flash.js"
|
|
8
8
|
},
|
|
9
9
|
"scripts": {
|
|
10
|
-
"
|
|
10
|
+
"install": "node scripts/install.js"
|
|
11
11
|
},
|
|
12
12
|
"keywords": [
|
|
13
13
|
"orm",
|
|
@@ -20,7 +20,8 @@
|
|
|
20
20
|
"cli",
|
|
21
21
|
"typescript",
|
|
22
22
|
"javascript",
|
|
23
|
-
"type-safe"
|
|
23
|
+
"type-safe",
|
|
24
|
+
"plugins"
|
|
24
25
|
],
|
|
25
26
|
"author": "Rana718",
|
|
26
27
|
"license": "MIT",
|
package/scripts/install.js
CHANGED
|
@@ -4,7 +4,7 @@ const https = require('https');
|
|
|
4
4
|
const fs = require('fs');
|
|
5
5
|
const path = require('path');
|
|
6
6
|
|
|
7
|
-
const VERSION = '2.
|
|
7
|
+
const VERSION = '2.2.0-beta1';
|
|
8
8
|
const REPO = 'Lumos-Labs-HQ/flash';
|
|
9
9
|
|
|
10
10
|
const platform = process.platform;
|
|
@@ -36,13 +36,29 @@ const downloadUrl = `https://github.com/${REPO}/releases/download/v${VERSION}/${
|
|
|
36
36
|
const binDir = path.join(__dirname, '..', 'bin');
|
|
37
37
|
const binaryPath = path.join(binDir, binaryName);
|
|
38
38
|
|
|
39
|
-
console.log(`๐ฆ Installing
|
|
39
|
+
console.log(`๐ฆ Installing FlashORM Base CLI v${VERSION} for ${platform}-${arch}...`);
|
|
40
40
|
console.log(`๐ฅ Downloading from: ${downloadUrl}`);
|
|
41
41
|
|
|
42
42
|
if (!fs.existsSync(binDir)) {
|
|
43
43
|
fs.mkdirSync(binDir, { recursive: true });
|
|
44
44
|
}
|
|
45
45
|
|
|
46
|
+
// Clean up any existing binaries (other platforms)
|
|
47
|
+
const cleanupBinaries = () => {
|
|
48
|
+
const files = fs.readdirSync(binDir);
|
|
49
|
+
files.forEach(file => {
|
|
50
|
+
const filePath = path.join(binDir, file);
|
|
51
|
+
if (file.startsWith('flash') && file !== 'flash.js' && file !== binaryName) {
|
|
52
|
+
try {
|
|
53
|
+
fs.unlinkSync(filePath);
|
|
54
|
+
console.log(`๐งน Cleaned up: ${file}`);
|
|
55
|
+
} catch (err) {
|
|
56
|
+
// Ignore cleanup errors
|
|
57
|
+
}
|
|
58
|
+
}
|
|
59
|
+
});
|
|
60
|
+
};
|
|
61
|
+
|
|
46
62
|
const file = fs.createWriteStream(binaryPath);
|
|
47
63
|
|
|
48
64
|
https.get(downloadUrl, (response) => {
|
|
@@ -52,7 +68,23 @@ https.get(downloadUrl, (response) => {
|
|
|
52
68
|
file.on('finish', () => {
|
|
53
69
|
file.close(() => {
|
|
54
70
|
fs.chmodSync(binaryPath, 0o755);
|
|
55
|
-
|
|
71
|
+
cleanupBinaries();
|
|
72
|
+
console.log(`โ
FlashORM Base CLI installed successfully!`);
|
|
73
|
+
console.log('');
|
|
74
|
+
console.log('๐ฆ Plugin System');
|
|
75
|
+
console.log(' FlashORM now uses a plugin-based architecture.');
|
|
76
|
+
console.log(' The base CLI includes only essential commands:');
|
|
77
|
+
console.log(' โข flash --version (show version)');
|
|
78
|
+
console.log(' โข flash plugins (list plugins)');
|
|
79
|
+
console.log(' โข flash add-plug (install plugins)');
|
|
80
|
+
console.log(' โข flash rm-plug (remove plugins)');
|
|
81
|
+
console.log('');
|
|
82
|
+
console.log(' Install plugins for ORM functionality:');
|
|
83
|
+
console.log('');
|
|
84
|
+
console.log(' flash add-plug core # ORM features (migrations, codegen, export)');
|
|
85
|
+
console.log(' flash add-plug studio # Visual database editor');
|
|
86
|
+
console.log(' flash add-plug all # Everything (core + studio)');
|
|
87
|
+
console.log('');
|
|
56
88
|
console.log(`๐ Run 'flash --help' to get started!`);
|
|
57
89
|
});
|
|
58
90
|
});
|
|
@@ -62,14 +94,35 @@ https.get(downloadUrl, (response) => {
|
|
|
62
94
|
file.on('finish', () => {
|
|
63
95
|
file.close(() => {
|
|
64
96
|
fs.chmodSync(binaryPath, 0o755);
|
|
65
|
-
|
|
97
|
+
cleanupBinaries();
|
|
98
|
+
console.log(`โ
FlashORM Base CLI installed successfully!`);
|
|
99
|
+
console.log('');
|
|
100
|
+
console.log('๐ฆ Plugin System');
|
|
101
|
+
console.log(' FlashORM now uses a plugin-based architecture.');
|
|
102
|
+
console.log(' The base CLI includes only essential commands:');
|
|
103
|
+
console.log(' โข flash --version (show version)');
|
|
104
|
+
console.log(' โข flash plugins (list plugins)');
|
|
105
|
+
console.log(' โข flash add-plug (install plugins)');
|
|
106
|
+
console.log(' โข flash rm-plug (remove plugins)');
|
|
107
|
+
console.log('');
|
|
108
|
+
console.log(' Install plugins for ORM functionality:');
|
|
109
|
+
console.log('');
|
|
110
|
+
console.log(' flash add-plug core # ORM features (migrations, codegen, export)');
|
|
111
|
+
console.log(' flash add-plug studio # Visual database editor');
|
|
112
|
+
console.log(' flash add-plug all # Everything (core + studio)');
|
|
113
|
+
console.log('');
|
|
66
114
|
console.log(`๐ Run 'flash --help' to get started!`);
|
|
67
115
|
});
|
|
68
116
|
});
|
|
69
117
|
}
|
|
70
118
|
}).on('error', (err) => {
|
|
71
|
-
fs.
|
|
119
|
+
if (fs.existsSync(binaryPath)) {
|
|
120
|
+
fs.unlinkSync(binaryPath);
|
|
121
|
+
}
|
|
72
122
|
console.error(`โ Download failed: ${err.message}`);
|
|
73
123
|
console.error(`Please check: ${downloadUrl}`);
|
|
124
|
+
console.error('');
|
|
125
|
+
console.error('You can also download manually from:');
|
|
126
|
+
console.error(` https://github.com/${REPO}/releases/tag/v${VERSION}`);
|
|
74
127
|
process.exit(1);
|
|
75
128
|
});
|