@open-audio-stack/core 0.1.39 → 0.1.41

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.
@@ -105,9 +105,6 @@ export class ManagerLocal extends Manager {
105
105
  { name: 'date', type: 'input', message: 'Date released', default: new Date().toISOString() },
106
106
  { name: 'changes', type: 'input', message: 'List of changes' },
107
107
  ];
108
- if (this.type === RegistryType.Projects) {
109
- pkgVersionQuestions.push({ name: 'open', type: 'input', message: 'File to open' });
110
- }
111
108
  const pkgVersionAnswers = await inquirer.prompt(pkgVersionQuestions);
112
109
  // TODO prompt for each file.
113
110
  pkgVersionAnswers.files = [];
@@ -331,19 +328,23 @@ export class ManagerLocal extends Manager {
331
328
  this.log(`Package ${slug} version ${versionNum} not found`);
332
329
  return false;
333
330
  }
334
- // Check if package has open field
335
- if (!pkgVersion.open) {
336
- this.log(`Package ${slug} has no open command defined`);
337
- return false;
338
- }
339
331
  // Check if package is installed
340
332
  if (!this.isPackageInstalled(slug, versionNum)) {
341
333
  this.log(`Package ${slug} version ${versionNum} not installed`);
342
334
  return false;
343
335
  }
336
+ // Filter compatible files and find one with open field
337
+ const files = packageCompatibleFiles(pkgVersion, [getArchitecture()], [getSystem()], []);
338
+ const openableFile = files.find(file => file.open);
339
+ if (!openableFile) {
340
+ this.log(`Package ${slug} has no compatible file with open command defined`);
341
+ return false;
342
+ }
344
343
  try {
345
- const openPath = pkgVersion.open;
346
- const packageDir = path.join(this.typeDir, slug, versionNum);
344
+ const openPath = openableFile.open;
345
+ const fileExt = path.extname(openableFile.url).slice(1).toLowerCase();
346
+ const formatDir = pluginFormatDir[fileExt];
347
+ const packageDir = path.join(this.typeDir, formatDir, slug, versionNum);
347
348
  const fullPath = path.isAbsolute(openPath) ? openPath : path.join(packageDir, openPath);
348
349
  const command = `"${fullPath}" ${options.join(' ')}`;
349
350
  this.log(`Running: ${command}`);
@@ -91,7 +91,7 @@ export declare const PackageTypeObj: {
91
91
  Tool: PluginType.Tool;
92
92
  };
93
93
  export declare const PackageVersionValidator: z.ZodObject<{
94
- audio: z.ZodString;
94
+ audio: z.ZodOptional<z.ZodString>;
95
95
  author: z.ZodString;
96
96
  changes: z.ZodString;
97
97
  date: z.ZodString;
@@ -166,11 +166,10 @@ export declare const PackageVersionValidator: z.ZodObject<{
166
166
  url: z.ZodString;
167
167
  }, "strip", z.ZodTypeAny, {
168
168
  date: string;
169
- audio: string;
169
+ type: PluginType | PresetType | ProjectType;
170
170
  author: string;
171
171
  changes: string;
172
172
  description: string;
173
- type: PluginType | PresetType | ProjectType;
174
173
  url: string;
175
174
  files: {
176
175
  type: FileType;
@@ -188,14 +187,14 @@ export declare const PackageVersionValidator: z.ZodObject<{
188
187
  license: License;
189
188
  name: string;
190
189
  tags: string[];
190
+ audio?: string | undefined;
191
191
  donate?: string | undefined;
192
192
  }, {
193
193
  date: string;
194
- audio: string;
194
+ type: PluginType | PresetType | ProjectType;
195
195
  author: string;
196
196
  changes: string;
197
197
  description: string;
198
- type: PluginType | PresetType | ProjectType;
199
198
  url: string;
200
199
  files: {
201
200
  type: FileType;
@@ -213,6 +212,7 @@ export declare const PackageVersionValidator: z.ZodObject<{
213
212
  license: License;
214
213
  name: string;
215
214
  tags: string[];
215
+ audio?: string | undefined;
216
216
  donate?: string | undefined;
217
217
  }>;
218
218
  export declare const SemverValidator: z.ZodString;
@@ -57,7 +57,7 @@ export const PackageFileValidator = z.object({
57
57
  });
58
58
  export const PackageTypeObj = { ...PluginType, ...PresetType, ...ProjectType };
59
59
  export const PackageVersionValidator = z.object({
60
- audio: z.string().min(8).max(256).startsWith('https://'),
60
+ audio: z.optional(z.string().min(8).max(256).startsWith('https://')),
61
61
  author: z.string().min(1).max(256),
62
62
  changes: z.string().min(1).max(256),
63
63
  date: z.string().datetime(),
@@ -3,6 +3,7 @@ import { FileType } from './FileType.js';
3
3
  import { System } from './System.js';
4
4
  export interface FileInterface {
5
5
  architectures: Architecture[];
6
+ open?: string;
6
7
  sha256: string;
7
8
  size: number;
8
9
  systems: System[];
@@ -12,7 +12,7 @@ export interface PackageVersions {
12
12
  [version: string]: PackageVersion;
13
13
  }
14
14
  export interface PackageBase {
15
- audio: string;
15
+ audio?: string;
16
16
  author: string;
17
17
  changes: string;
18
18
  date: string;
@@ -5,7 +5,6 @@ import { ProjectType } from './ProjectType.js';
5
5
  import { RegistryType } from './Registry.js';
6
6
  export interface ProjectInterface extends PackageBase {
7
7
  files: ProjectFile[];
8
- open: string;
9
8
  [RegistryType.Plugins]: ProjectPlugins;
10
9
  type: ProjectType;
11
10
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@open-audio-stack/core",
3
- "version": "0.1.39",
3
+ "version": "0.1.41",
4
4
  "description": "Open-source audio plugin management software",
5
5
  "type": "module",
6
6
  "main": "./build/index.js",