spindb 0.35.2 → 0.35.4

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.
@@ -53,6 +53,7 @@ import {
53
53
  import { Engine, Platform } from '../../types'
54
54
  import {
55
55
  loadEnginesJson,
56
+ filterEnginesByPlatform,
56
57
  type EngineConfig,
57
58
  } from '../../config/engines-registry'
58
59
  import { mysqlBinaryManager } from '../../engines/mysql/binary-manager'
@@ -2156,7 +2157,10 @@ enginesCommand
2156
2157
  .option('--all', 'Include pending and planned engines')
2157
2158
  .action(async (options: { json?: boolean; all?: boolean }) => {
2158
2159
  try {
2159
- const enginesData = await loadEnginesJson()
2160
+ const rawData = await loadEnginesJson()
2161
+ const { platform, arch } = platformService.getPlatformInfo()
2162
+ const platformKey = `${platform}-${arch}`
2163
+ const enginesData = filterEnginesByPlatform(rawData, platformKey)
2160
2164
 
2161
2165
  if (options.json) {
2162
2166
  // Output full JSON
@@ -19,6 +19,8 @@ export type EngineConfig = {
19
19
  clientTools: string[]
20
20
  licensing?: string | string[]
21
21
  notes?: string
22
+ platforms?: string[]
23
+ versionPlatforms?: Record<string, string[]>
22
24
  }
23
25
 
24
26
  export type EnginesJson = {
@@ -92,3 +94,57 @@ export function getAllEngines(): Engine[] {
92
94
  export function clearEnginesCache(): void {
93
95
  cachedEngines = null
94
96
  }
97
+
98
+ /**
99
+ * Filter engines data to only include engines and versions supported on the given platform.
100
+ *
101
+ * - If an engine has `platforms` and the platformKey isn't listed, the engine is removed.
102
+ * - If an engine has `versionPlatforms`, versions whose entry excludes the platformKey are removed.
103
+ * Versions with no entry in `versionPlatforms` are kept (assumed all-platform).
104
+ * - If filtering removes all versions, the engine is removed.
105
+ * - If the defaultVersion is removed, it's set to the first remaining version.
106
+ */
107
+ export function filterEnginesByPlatform(
108
+ enginesData: EnginesJson,
109
+ platformKey: string,
110
+ ): EnginesJson {
111
+ const filtered: Record<string, EngineConfig> = {}
112
+
113
+ for (const [name, config] of Object.entries(enginesData.engines)) {
114
+ // Engine-level platform check
115
+ if (config.platforms && !config.platforms.includes(platformKey)) {
116
+ continue
117
+ }
118
+
119
+ // Version-level platform check
120
+ if (config.versionPlatforms) {
121
+ const filteredVersions = config.supportedVersions.filter((version) => {
122
+ const platforms = config.versionPlatforms![version]
123
+ // If no entry for this version, it's available on all platforms
124
+ if (!platforms) return true
125
+ return platforms.includes(platformKey)
126
+ })
127
+
128
+ if (filteredVersions.length === 0) {
129
+ continue
130
+ }
131
+
132
+ const defaultVersion = filteredVersions.includes(config.defaultVersion)
133
+ ? config.defaultVersion
134
+ : filteredVersions[0]
135
+
136
+ filtered[name] = {
137
+ ...config,
138
+ supportedVersions: filteredVersions,
139
+ defaultVersion,
140
+ }
141
+ } else {
142
+ filtered[name] = config
143
+ }
144
+ }
145
+
146
+ return {
147
+ ...enginesData,
148
+ engines: filtered as Record<Engine, EngineConfig>,
149
+ }
150
+ }
@@ -144,7 +144,8 @@
144
144
  "superuser": "default",
145
145
  "clientTools": ["clickhouse"],
146
146
  "licensing": "Apache-2.0",
147
- "notes": "Column-oriented OLAP database. Uses YY.MM.X.build versioning. Native port 9000, HTTP port 8123. WSL only on Windows."
147
+ "notes": "Column-oriented OLAP database. Uses YY.MM.X.build versioning. Native port 9000, HTTP port 8123. WSL only on Windows.",
148
+ "platforms": ["darwin-arm64", "darwin-x64", "linux-arm64", "linux-x64"]
148
149
  },
149
150
  "qdrant": {
150
151
  "displayName": "Qdrant",
@@ -195,7 +196,17 @@
195
196
  "superuser": null,
196
197
  "clientTools": ["ferretdb", "mongosh", "mongodump", "mongorestore"],
197
198
  "licensing": "Apache-2.0",
198
- "notes": "MongoDB-compatible proxy. v2 uses postgresql-documentdb (macOS/Linux). v1 uses plain PostgreSQL (all platforms incl. Windows)."
199
+ "notes": "MongoDB-compatible proxy. v2 uses postgresql-documentdb (macOS/Linux). v1 uses plain PostgreSQL (all platforms incl. Windows).",
200
+ "versionPlatforms": {
201
+ "1.24.2": [
202
+ "darwin-arm64",
203
+ "darwin-x64",
204
+ "linux-arm64",
205
+ "linux-x64",
206
+ "win32-x64"
207
+ ],
208
+ "2.7.0": ["darwin-arm64", "darwin-x64", "linux-arm64", "linux-x64"]
209
+ }
199
210
  },
200
211
  "couchdb": {
201
212
  "displayName": "CouchDB",
@@ -114,6 +114,19 @@
114
114
  "notes": {
115
115
  "type": "string",
116
116
  "description": "Additional notes about the engine"
117
+ },
118
+ "platforms": {
119
+ "type": "array",
120
+ "items": { "type": "string" },
121
+ "description": "Supported platform-arch combos (e.g. 'darwin-arm64'). If omitted, all platforms are supported."
122
+ },
123
+ "versionPlatforms": {
124
+ "type": "object",
125
+ "additionalProperties": {
126
+ "type": "array",
127
+ "items": { "type": "string" }
128
+ },
129
+ "description": "Per-version platform overrides. Keys are version strings, values are platform-arch arrays."
117
130
  }
118
131
  },
119
132
  "additionalProperties": false
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "spindb",
3
- "version": "0.35.2",
3
+ "version": "0.35.4",
4
4
  "author": "Bob Bass <bob@bbass.co>",
5
5
  "license": "PolyForm-Noncommercial-1.0.0",
6
6
  "description": "Zero-config Docker-free local database containers. Create, backup, and clone a variety of popular databases.",