stacktape 2.23.0-beta.7 → 2.23.0
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/index.js +2 -3264
- package/package.json +9 -26
- package/bin/stacktape.js +0 -164
- package/index.d.ts +0 -6129
- package/index.js.map +0 -7
- package/sdk.d.ts +0 -26116
- package/sdk.js +0 -16869
- package/sdk.js.map +0 -7
package/package.json
CHANGED
|
@@ -1,13 +1,16 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "stacktape",
|
|
3
|
-
"version": "2.23.0
|
|
3
|
+
"version": "2.23.0",
|
|
4
4
|
"description": "PaaS 2.0 that deploys to your own AWS account.",
|
|
5
5
|
"author": "Stacktape team <support@stacktape.com>",
|
|
6
6
|
"license": "MIT",
|
|
7
7
|
"homepage": "https://stacktape.com",
|
|
8
|
-
"repository":
|
|
8
|
+
"repository": {
|
|
9
|
+
"type": "git",
|
|
10
|
+
"url": "git+https://github.com/stacktape/core.git"
|
|
11
|
+
},
|
|
9
12
|
"bugs": {
|
|
10
|
-
"url": "https://github.com/stacktape/
|
|
13
|
+
"url": "https://github.com/stacktape/core/issues"
|
|
11
14
|
},
|
|
12
15
|
"keywords": [
|
|
13
16
|
"serverless",
|
|
@@ -19,29 +22,9 @@
|
|
|
19
22
|
"devops",
|
|
20
23
|
"database"
|
|
21
24
|
],
|
|
22
|
-
"exports": {
|
|
23
|
-
".": {
|
|
24
|
-
"types": "./index.d.ts",
|
|
25
|
-
"default": "./index.js"
|
|
26
|
-
},
|
|
27
|
-
"./sdk": {
|
|
28
|
-
"types": "./sdk.d.ts",
|
|
29
|
-
"default": "./sdk.js"
|
|
30
|
-
}
|
|
31
|
-
},
|
|
32
25
|
"main": "./index.js",
|
|
33
|
-
"
|
|
34
|
-
|
|
35
|
-
"
|
|
36
|
-
"stp": "./bin/stacktape.js"
|
|
37
|
-
},
|
|
38
|
-
"dependencies": {},
|
|
39
|
-
"optionalDependencies": {
|
|
40
|
-
"@stacktape/cli-alpine-x64": "2.23.0-beta.7",
|
|
41
|
-
"@stacktape/cli-darwin-arm64": "2.23.0-beta.7",
|
|
42
|
-
"@stacktape/cli-darwin-x64": "2.23.0-beta.7",
|
|
43
|
-
"@stacktape/cli-linux-arm64": "2.23.0-beta.7",
|
|
44
|
-
"@stacktape/cli-linux-x64": "2.23.0-beta.7",
|
|
45
|
-
"@stacktape/cli-win32-x64": "2.23.0-beta.7"
|
|
26
|
+
"dependencies": {
|
|
27
|
+
"adm-zip": "^0.5.16",
|
|
28
|
+
"tar": "^7.4.3"
|
|
46
29
|
}
|
|
47
30
|
}
|
package/bin/stacktape.js
DELETED
|
@@ -1,164 +0,0 @@
|
|
|
1
|
-
#!/usr/bin/env node
|
|
2
|
-
|
|
3
|
-
/**
|
|
4
|
-
* Stacktape CLI launcher
|
|
5
|
-
* This script detects the current platform and executes the appropriate platform-specific binary
|
|
6
|
-
*/
|
|
7
|
-
|
|
8
|
-
const { spawnSync } = require('node:child_process');
|
|
9
|
-
const { existsSync } = require('node:fs');
|
|
10
|
-
const { platform, arch } = require('node:os');
|
|
11
|
-
const { join } = require('node:path');
|
|
12
|
-
|
|
13
|
-
// Platform to package name mapping
|
|
14
|
-
const PLATFORM_PACKAGES = {
|
|
15
|
-
'win32-x64': '@stacktape/cli-win32-x64',
|
|
16
|
-
'linux-x64': '@stacktape/cli-linux-x64',
|
|
17
|
-
'linux-arm64': '@stacktape/cli-linux-arm64',
|
|
18
|
-
'darwin-x64': '@stacktape/cli-darwin-x64',
|
|
19
|
-
'darwin-arm64': '@stacktape/cli-darwin-arm64',
|
|
20
|
-
'linux-x64-musl': '@stacktape/cli-alpine-x64'
|
|
21
|
-
};
|
|
22
|
-
|
|
23
|
-
// Platform to binary path mapping
|
|
24
|
-
const BINARY_PATHS = {
|
|
25
|
-
'win32-x64': 'bin/stacktape.exe',
|
|
26
|
-
'linux-x64': 'bin/stacktape',
|
|
27
|
-
'linux-arm64': 'bin/stacktape',
|
|
28
|
-
'darwin-x64': 'bin/stacktape',
|
|
29
|
-
'darwin-arm64': 'bin/stacktape',
|
|
30
|
-
'linux-x64-musl': 'bin/stacktape'
|
|
31
|
-
};
|
|
32
|
-
|
|
33
|
-
/**
|
|
34
|
-
* Detects the current platform
|
|
35
|
-
*/
|
|
36
|
-
function detectPlatform() {
|
|
37
|
-
const currentPlatform = platform();
|
|
38
|
-
const currentArch = arch();
|
|
39
|
-
|
|
40
|
-
// Detect Alpine Linux (uses musl instead of glibc)
|
|
41
|
-
if (currentPlatform === 'linux' && currentArch === 'x64') {
|
|
42
|
-
try {
|
|
43
|
-
const { execSync } = require('node:child_process');
|
|
44
|
-
const ldd = execSync('ldd --version 2>&1 || true', { encoding: 'utf8' });
|
|
45
|
-
if (ldd.includes('musl')) {
|
|
46
|
-
return 'linux-x64-musl';
|
|
47
|
-
}
|
|
48
|
-
} catch {
|
|
49
|
-
// If ldd fails, assume glibc
|
|
50
|
-
}
|
|
51
|
-
}
|
|
52
|
-
|
|
53
|
-
const platformKey = `${currentPlatform}-${currentArch}`;
|
|
54
|
-
|
|
55
|
-
if (!PLATFORM_PACKAGES[platformKey]) {
|
|
56
|
-
console.error(`Error: Unsupported platform ${currentPlatform}-${currentArch}`);
|
|
57
|
-
console.error('Stacktape binaries are available for:');
|
|
58
|
-
Object.keys(PLATFORM_PACKAGES).forEach((key) => {
|
|
59
|
-
console.error(` - ${key}`);
|
|
60
|
-
});
|
|
61
|
-
process.exit(1);
|
|
62
|
-
}
|
|
63
|
-
|
|
64
|
-
return platformKey;
|
|
65
|
-
}
|
|
66
|
-
|
|
67
|
-
/**
|
|
68
|
-
* Finds the binary executable path
|
|
69
|
-
*/
|
|
70
|
-
function findBinary() {
|
|
71
|
-
const platformKey = detectPlatform();
|
|
72
|
-
const packageName = PLATFORM_PACKAGES[platformKey];
|
|
73
|
-
const binaryPath = BINARY_PATHS[platformKey];
|
|
74
|
-
|
|
75
|
-
// Try to find the platform-specific package
|
|
76
|
-
const searchPaths = [
|
|
77
|
-
// When installed globally or locally in node_modules
|
|
78
|
-
join(__dirname, '..', '..', '..', packageName, binaryPath),
|
|
79
|
-
// When used with npx or in a monorepo
|
|
80
|
-
join(__dirname, '..', '..', packageName, binaryPath),
|
|
81
|
-
// When platform package is a sibling
|
|
82
|
-
join(__dirname, '..', packageName, binaryPath)
|
|
83
|
-
];
|
|
84
|
-
|
|
85
|
-
for (const searchPath of searchPaths) {
|
|
86
|
-
if (existsSync(searchPath)) {
|
|
87
|
-
return searchPath;
|
|
88
|
-
}
|
|
89
|
-
}
|
|
90
|
-
|
|
91
|
-
// Binary not found
|
|
92
|
-
console.error(
|
|
93
|
-
[
|
|
94
|
-
`Error: Could not find Stacktape binary for ${platformKey}`,
|
|
95
|
-
`Expected to find package: ${packageName}`,
|
|
96
|
-
'',
|
|
97
|
-
'This usually happens when:',
|
|
98
|
-
'1. The platform-specific package failed to install',
|
|
99
|
-
"2. You're using an unsupported platform",
|
|
100
|
-
'',
|
|
101
|
-
'Try reinstalling Stacktape:',
|
|
102
|
-
' npm uninstall -g stacktape',
|
|
103
|
-
' npm install -g stacktape',
|
|
104
|
-
'',
|
|
105
|
-
'If the problem persists, please report it at:',
|
|
106
|
-
' https://github.com/stacktape/stacktape/issues'
|
|
107
|
-
].join('\n')
|
|
108
|
-
);
|
|
109
|
-
process.exit(1);
|
|
110
|
-
}
|
|
111
|
-
|
|
112
|
-
/**
|
|
113
|
-
* Ensures the binary has executable permissions (Unix-like systems only)
|
|
114
|
-
*/
|
|
115
|
-
function ensureExecutablePermissions(binaryPath) {
|
|
116
|
-
// Skip on Windows
|
|
117
|
-
if (process.platform === 'win32') {
|
|
118
|
-
return;
|
|
119
|
-
}
|
|
120
|
-
|
|
121
|
-
try {
|
|
122
|
-
const { chmodSync, statSync } = require('node:fs');
|
|
123
|
-
const stats = statSync(binaryPath);
|
|
124
|
-
const mode = stats.mode;
|
|
125
|
-
|
|
126
|
-
// Check if executable bit is set for owner (0o100)
|
|
127
|
-
if (!(mode & 0o100)) {
|
|
128
|
-
chmodSync(binaryPath, 0o755);
|
|
129
|
-
}
|
|
130
|
-
} catch (error) {
|
|
131
|
-
// If chmod fails, try to execute anyway
|
|
132
|
-
// The error will be caught later if permissions are still wrong
|
|
133
|
-
}
|
|
134
|
-
}
|
|
135
|
-
|
|
136
|
-
/**
|
|
137
|
-
* Executes the binary with the provided arguments
|
|
138
|
-
*/
|
|
139
|
-
function executeBinary() {
|
|
140
|
-
const binaryPath = findBinary();
|
|
141
|
-
|
|
142
|
-
// Ensure the binary has executable permissions
|
|
143
|
-
ensureExecutablePermissions(binaryPath);
|
|
144
|
-
|
|
145
|
-
// Pass through all arguments except the first two (node and script path)
|
|
146
|
-
const args = process.argv.slice(2);
|
|
147
|
-
|
|
148
|
-
// Execute the binary
|
|
149
|
-
const result = spawnSync(binaryPath, args, {
|
|
150
|
-
stdio: 'inherit',
|
|
151
|
-
env: process.env
|
|
152
|
-
});
|
|
153
|
-
|
|
154
|
-
// Exit with the same code as the binary
|
|
155
|
-
if (result.error) {
|
|
156
|
-
console.error(`Error executing Stacktape binary: ${result.error.message}`);
|
|
157
|
-
process.exit(1);
|
|
158
|
-
}
|
|
159
|
-
|
|
160
|
-
process.exit(result.status || 0);
|
|
161
|
-
}
|
|
162
|
-
|
|
163
|
-
// Run the launcher
|
|
164
|
-
executeBinary();
|