@almadar/cli 0.3.1 → 0.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 +7 -6
- package/scripts/postinstall.js +41 -0
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@almadar/cli",
|
|
3
|
-
"version": "0.3.
|
|
3
|
+
"version": "0.3.2",
|
|
4
4
|
"description": "Almadar CLI - Compile Almadar schemas to full-stack applications",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"repository": {
|
|
@@ -29,6 +29,7 @@
|
|
|
29
29
|
},
|
|
30
30
|
"files": [
|
|
31
31
|
"bin",
|
|
32
|
+
"scripts",
|
|
32
33
|
"README.md"
|
|
33
34
|
],
|
|
34
35
|
"scripts": {
|
|
@@ -47,10 +48,10 @@
|
|
|
47
48
|
"node": ">=16.0.0"
|
|
48
49
|
},
|
|
49
50
|
"optionalDependencies": {
|
|
50
|
-
"@almadar/cli-darwin-x64": "0.3.
|
|
51
|
-
"@almadar/cli-darwin-arm64": "0.3.
|
|
52
|
-
"@almadar/cli-linux-x64": "0.3.
|
|
53
|
-
"@almadar/cli-linux-arm64": "0.3.
|
|
54
|
-
"@almadar/cli-windows-x64": "0.3.
|
|
51
|
+
"@almadar/cli-darwin-x64": "0.3.2",
|
|
52
|
+
"@almadar/cli-darwin-arm64": "0.3.2",
|
|
53
|
+
"@almadar/cli-linux-x64": "0.3.2",
|
|
54
|
+
"@almadar/cli-linux-arm64": "0.3.2",
|
|
55
|
+
"@almadar/cli-windows-x64": "0.3.2"
|
|
55
56
|
}
|
|
56
57
|
}
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
|
|
3
|
+
const fs = require('fs');
|
|
4
|
+
const path = require('path');
|
|
5
|
+
|
|
6
|
+
const platform = process.platform;
|
|
7
|
+
const arch = process.arch;
|
|
8
|
+
|
|
9
|
+
const platformMap = {
|
|
10
|
+
'darwin-x64': '@almadar/cli-darwin-x64',
|
|
11
|
+
'darwin-arm64': '@almadar/cli-darwin-arm64',
|
|
12
|
+
'linux-x64': '@almadar/cli-linux-x64',
|
|
13
|
+
'linux-arm64': '@almadar/cli-linux-arm64',
|
|
14
|
+
'win32-x64': '@almadar/cli-windows-x64',
|
|
15
|
+
};
|
|
16
|
+
|
|
17
|
+
const key = `${platform}-${arch}`;
|
|
18
|
+
const packageName = platformMap[key];
|
|
19
|
+
|
|
20
|
+
if (!packageName) {
|
|
21
|
+
console.warn(`\n⚠️ Almadar CLI: No pre-built binary for ${platform}-${arch}`);
|
|
22
|
+
console.warn(' You can build from source: https://github.com/almadar-io/almadar#building-from-source\n');
|
|
23
|
+
process.exit(0);
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
// Check if the platform-specific package was installed
|
|
27
|
+
const possiblePaths = [
|
|
28
|
+
path.join(__dirname, '..', 'node_modules', packageName),
|
|
29
|
+
path.join(__dirname, '..', '..', packageName),
|
|
30
|
+
path.join(__dirname, '..', '..', '..', packageName),
|
|
31
|
+
];
|
|
32
|
+
|
|
33
|
+
const found = possiblePaths.some(p => fs.existsSync(p));
|
|
34
|
+
|
|
35
|
+
if (found) {
|
|
36
|
+
console.log(`✅ Almadar CLI installed for ${platform}-${arch}`);
|
|
37
|
+
} else {
|
|
38
|
+
console.warn(`\n⚠️ Almadar CLI: Platform package ${packageName} not found`);
|
|
39
|
+
console.warn(' This may happen if optional dependencies were skipped.');
|
|
40
|
+
console.warn(' Try: npm install -g @almadar/cli --include=optional\n');
|
|
41
|
+
}
|