jokalala-cli 0.2.21 → 0.2.23
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/LICENSE +21 -21
- package/bin/jokalala +69 -69
- package/package.json +9 -6
- package/scripts/postinstall.js +48 -22
package/LICENSE
CHANGED
|
@@ -1,21 +1,21 @@
|
|
|
1
|
-
MIT License
|
|
2
|
-
|
|
3
|
-
Copyright (c) 2025 Jokalala Technologies
|
|
4
|
-
|
|
5
|
-
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
-
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
-
in the Software without restriction, including without limitation the rights
|
|
8
|
-
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
-
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
-
furnished to do so, subject to the following conditions:
|
|
11
|
-
|
|
12
|
-
The above copyright notice and this permission notice shall be included in all
|
|
13
|
-
copies or substantial portions of the Software.
|
|
14
|
-
|
|
15
|
-
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
-
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
-
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
-
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
-
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
-
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
-
SOFTWARE.
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2025 Jokalala Technologies
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
package/bin/jokalala
CHANGED
|
@@ -1,70 +1,70 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
|
|
3
|
-
const { execFileSync } = require('child_process');
|
|
4
|
-
const path = require('path');
|
|
5
|
-
const fs = require('fs');
|
|
6
|
-
|
|
7
|
-
// Platform detection
|
|
8
|
-
const PLATFORMS = {
|
|
9
|
-
'win32-x64': '@jokalala-cli/cli-win32-x64',
|
|
10
|
-
'darwin-x64': '@jokalala-cli/cli-darwin-x64',
|
|
11
|
-
'darwin-arm64': '@jokalala-cli/cli-darwin-arm64',
|
|
12
|
-
'linux-x64': '@jokalala-cli/cli-linux-x64',
|
|
13
|
-
'linux-arm64': '@jokalala-cli/cli-linux-arm64',
|
|
14
|
-
};
|
|
15
|
-
|
|
16
|
-
function getBinaryPath() {
|
|
17
|
-
const platformKey = `${process.platform}-${process.arch}`;
|
|
18
|
-
const packageName = PLATFORMS[platformKey];
|
|
19
|
-
|
|
20
|
-
if (!packageName) {
|
|
21
|
-
console.error(`Unsupported platform: ${platformKey}`);
|
|
22
|
-
console.error(`Supported platforms: ${Object.keys(PLATFORMS).join(', ')}`);
|
|
23
|
-
process.exit(1);
|
|
24
|
-
}
|
|
25
|
-
|
|
26
|
-
// Try to find the binary in the platform-specific package
|
|
27
|
-
try {
|
|
28
|
-
const packagePath = require.resolve(`${packageName}/package.json`);
|
|
29
|
-
const packageDir = path.dirname(packagePath);
|
|
30
|
-
const binaryName = process.platform === 'win32' ? 'jokalala.exe' : 'jokalala';
|
|
31
|
-
const binaryPath = path.join(packageDir, 'bin', binaryName);
|
|
32
|
-
|
|
33
|
-
if (fs.existsSync(binaryPath)) {
|
|
34
|
-
return binaryPath;
|
|
35
|
-
}
|
|
36
|
-
} catch (e) {
|
|
37
|
-
// Package not found
|
|
38
|
-
}
|
|
39
|
-
|
|
40
|
-
// Fallback: check if binary is in the current package (for local development)
|
|
41
|
-
const localBinary = path.join(__dirname, '..', 'lib',
|
|
42
|
-
process.platform === 'win32' ? 'jokalala.exe' : 'jokalala');
|
|
43
|
-
|
|
44
|
-
if (fs.existsSync(localBinary)) {
|
|
45
|
-
return localBinary;
|
|
46
|
-
}
|
|
47
|
-
|
|
48
|
-
console.error(`Binary not found for platform: ${platformKey}`);
|
|
49
|
-
console.error('Please reinstall the package: npm install -g jokalala-cli');
|
|
50
|
-
process.exit(1);
|
|
51
|
-
}
|
|
52
|
-
|
|
53
|
-
function main() {
|
|
54
|
-
const binaryPath = getBinaryPath();
|
|
55
|
-
const args = process.argv.slice(2);
|
|
56
|
-
|
|
57
|
-
try {
|
|
58
|
-
execFileSync(binaryPath, args, {
|
|
59
|
-
stdio: 'inherit',
|
|
60
|
-
env: process.env,
|
|
61
|
-
});
|
|
62
|
-
} catch (error) {
|
|
63
|
-
if (error.status !== undefined) {
|
|
64
|
-
process.exit(error.status);
|
|
65
|
-
}
|
|
66
|
-
throw error;
|
|
67
|
-
}
|
|
68
|
-
}
|
|
69
|
-
|
|
70
|
-
main();
|
|
2
|
+
|
|
3
|
+
const { execFileSync } = require('child_process');
|
|
4
|
+
const path = require('path');
|
|
5
|
+
const fs = require('fs');
|
|
6
|
+
|
|
7
|
+
// Platform detection
|
|
8
|
+
const PLATFORMS = {
|
|
9
|
+
'win32-x64': '@jokalala-cli/cli-win32-x64',
|
|
10
|
+
'darwin-x64': '@jokalala-cli/cli-darwin-x64',
|
|
11
|
+
'darwin-arm64': '@jokalala-cli/cli-darwin-arm64',
|
|
12
|
+
'linux-x64': '@jokalala-cli/cli-linux-x64',
|
|
13
|
+
'linux-arm64': '@jokalala-cli/cli-linux-arm64',
|
|
14
|
+
};
|
|
15
|
+
|
|
16
|
+
function getBinaryPath() {
|
|
17
|
+
const platformKey = `${process.platform}-${process.arch}`;
|
|
18
|
+
const packageName = PLATFORMS[platformKey];
|
|
19
|
+
|
|
20
|
+
if (!packageName) {
|
|
21
|
+
console.error(`Unsupported platform: ${platformKey}`);
|
|
22
|
+
console.error(`Supported platforms: ${Object.keys(PLATFORMS).join(', ')}`);
|
|
23
|
+
process.exit(1);
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
// Try to find the binary in the platform-specific package
|
|
27
|
+
try {
|
|
28
|
+
const packagePath = require.resolve(`${packageName}/package.json`);
|
|
29
|
+
const packageDir = path.dirname(packagePath);
|
|
30
|
+
const binaryName = process.platform === 'win32' ? 'jokalala.exe' : 'jokalala';
|
|
31
|
+
const binaryPath = path.join(packageDir, 'bin', binaryName);
|
|
32
|
+
|
|
33
|
+
if (fs.existsSync(binaryPath)) {
|
|
34
|
+
return binaryPath;
|
|
35
|
+
}
|
|
36
|
+
} catch (e) {
|
|
37
|
+
// Package not found
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
// Fallback: check if binary is in the current package (for local development)
|
|
41
|
+
const localBinary = path.join(__dirname, '..', 'lib',
|
|
42
|
+
process.platform === 'win32' ? 'jokalala.exe' : 'jokalala');
|
|
43
|
+
|
|
44
|
+
if (fs.existsSync(localBinary)) {
|
|
45
|
+
return localBinary;
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
console.error(`Binary not found for platform: ${platformKey}`);
|
|
49
|
+
console.error('Please reinstall the package: npm install -g jokalala-cli');
|
|
50
|
+
process.exit(1);
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
function main() {
|
|
54
|
+
const binaryPath = getBinaryPath();
|
|
55
|
+
const args = process.argv.slice(2);
|
|
56
|
+
|
|
57
|
+
try {
|
|
58
|
+
execFileSync(binaryPath, args, {
|
|
59
|
+
stdio: 'inherit',
|
|
60
|
+
env: process.env,
|
|
61
|
+
});
|
|
62
|
+
} catch (error) {
|
|
63
|
+
if (error.status !== undefined) {
|
|
64
|
+
process.exit(error.status);
|
|
65
|
+
}
|
|
66
|
+
throw error;
|
|
67
|
+
}
|
|
68
|
+
}
|
|
69
|
+
|
|
70
|
+
main();
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "jokalala-cli",
|
|
3
|
-
"version": "0.2.
|
|
3
|
+
"version": "0.2.23",
|
|
4
4
|
"description": "Jokalala Static Code Analyzer - Enterprise-grade security scanning CLI",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"security",
|
|
@@ -40,11 +40,14 @@
|
|
|
40
40
|
"scripts": {
|
|
41
41
|
"postinstall": "node scripts/postinstall.js"
|
|
42
42
|
},
|
|
43
|
+
"dependencies": {
|
|
44
|
+
"@jokalala/analyzer-engine": "0.1.10"
|
|
45
|
+
},
|
|
43
46
|
"optionalDependencies": {
|
|
44
|
-
"@jokalala-cli/cli-win32-x64": "0.2.
|
|
45
|
-
"@jokalala-cli/cli-darwin-x64": "0.2.
|
|
46
|
-
"@jokalala-cli/cli-darwin-arm64": "0.2.
|
|
47
|
-
"@jokalala-cli/cli-linux-x64": "0.2.
|
|
48
|
-
"@jokalala-cli/cli-linux-arm64": "0.2.
|
|
47
|
+
"@jokalala-cli/cli-win32-x64": "0.2.23",
|
|
48
|
+
"@jokalala-cli/cli-darwin-x64": "0.2.23",
|
|
49
|
+
"@jokalala-cli/cli-darwin-arm64": "0.2.23",
|
|
50
|
+
"@jokalala-cli/cli-linux-x64": "0.2.23",
|
|
51
|
+
"@jokalala-cli/cli-linux-arm64": "0.2.23"
|
|
49
52
|
}
|
|
50
53
|
}
|
package/scripts/postinstall.js
CHANGED
|
@@ -1,9 +1,11 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
|
|
3
3
|
/**
|
|
4
|
-
* Post-install script
|
|
4
|
+
* Post-install script. File existence is not enough: a binary linked
|
|
5
|
+
* against a newer glibc exists on disk and still cannot run.
|
|
5
6
|
*/
|
|
6
7
|
|
|
8
|
+
const { execFileSync } = require('child_process')
|
|
7
9
|
const fs = require('fs')
|
|
8
10
|
const path = require('path')
|
|
9
11
|
|
|
@@ -15,6 +17,11 @@ const PLATFORMS = {
|
|
|
15
17
|
'linux-arm64': '@jokalala-cli/cli-linux-arm64',
|
|
16
18
|
}
|
|
17
19
|
|
|
20
|
+
function fail(message) {
|
|
21
|
+
console.error(`\nJokalala CLI: ${message}`)
|
|
22
|
+
process.exit(1)
|
|
23
|
+
}
|
|
24
|
+
|
|
18
25
|
function checkInstallation() {
|
|
19
26
|
const platformKey = `${process.platform}-${process.arch}`
|
|
20
27
|
const packageName = PLATFORMS[platformKey]
|
|
@@ -28,31 +35,50 @@ function checkInstallation() {
|
|
|
28
35
|
return
|
|
29
36
|
}
|
|
30
37
|
|
|
38
|
+
let packageDir
|
|
31
39
|
try {
|
|
32
40
|
const packagePath = require.resolve(`${packageName}/package.json`)
|
|
33
|
-
|
|
34
|
-
const binaryName =
|
|
35
|
-
process.platform === 'win32' ? 'jokalala.exe' : 'jokalala'
|
|
36
|
-
const binaryPath = path.join(packageDir, 'bin', binaryName)
|
|
37
|
-
|
|
38
|
-
if (fs.existsSync(binaryPath)) {
|
|
39
|
-
if (process.platform !== 'win32') {
|
|
40
|
-
try {
|
|
41
|
-
fs.chmodSync(binaryPath, 0o755)
|
|
42
|
-
} catch {
|
|
43
|
-
// Ignore chmod errors on read-only installs
|
|
44
|
-
}
|
|
45
|
-
}
|
|
46
|
-
console.log(`Jokalala CLI installed successfully for ${platformKey}`)
|
|
47
|
-
} else {
|
|
48
|
-
console.warn(`\nJokalala CLI: Binary not found at ${binaryPath}`)
|
|
49
|
-
console.warn(' Try reinstalling: npm install -g jokalala-cli\n')
|
|
50
|
-
}
|
|
41
|
+
packageDir = path.dirname(packagePath)
|
|
51
42
|
} catch {
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
43
|
+
fail(
|
|
44
|
+
`Platform package ${packageName} not found. Try: npm install -g jokalala-cli --force`
|
|
45
|
+
)
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
const binaryName = process.platform === 'win32' ? 'jokalala.exe' : 'jokalala'
|
|
49
|
+
const binaryPath = path.join(packageDir, 'bin', binaryName)
|
|
50
|
+
if (!fs.existsSync(binaryPath)) {
|
|
51
|
+
fail(`Binary not found at ${binaryPath}. Try: npm install -g jokalala-cli --force`)
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
if (process.platform !== 'win32') {
|
|
55
|
+
try {
|
|
56
|
+
fs.chmodSync(binaryPath, 0o755)
|
|
57
|
+
} catch {
|
|
58
|
+
// Ignore chmod errors on read-only installs
|
|
59
|
+
}
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
let output = ''
|
|
63
|
+
try {
|
|
64
|
+
output = execFileSync(binaryPath, ['--version'], {
|
|
65
|
+
encoding: 'utf8',
|
|
66
|
+
timeout: 15000,
|
|
67
|
+
stdio: ['ignore', 'pipe', 'pipe'],
|
|
68
|
+
})
|
|
69
|
+
} catch (err) {
|
|
70
|
+
const detail = (err && (err.stderr || err.message)) || 'unknown error'
|
|
71
|
+
fail(
|
|
72
|
+
`${binaryPath} failed to execute (--version).\n${detail}\n` +
|
|
73
|
+
'On Linux this usually means the binary needs a newer glibc than this system provides.'
|
|
74
|
+
)
|
|
75
|
+
}
|
|
76
|
+
|
|
77
|
+
if (!/\d+\.\d+\.\d+/.test(String(output))) {
|
|
78
|
+
fail(`--version did not print a semver.\n${output}`)
|
|
55
79
|
}
|
|
80
|
+
|
|
81
|
+
console.log(`Jokalala CLI installed successfully for ${platformKey}`)
|
|
56
82
|
}
|
|
57
83
|
|
|
58
84
|
checkInstallation()
|