@open-audio-stack/core 0.1.39 → 0.1.40
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,18 +328,20 @@ 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 =
|
|
344
|
+
const openPath = openableFile.open;
|
|
346
345
|
const packageDir = path.join(this.typeDir, slug, versionNum);
|
|
347
346
|
const fullPath = path.isAbsolute(openPath) ? openPath : path.join(packageDir, openPath);
|
|
348
347
|
const command = `"${fullPath}" ${options.join(' ')}`;
|
|
@@ -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
|
-
|
|
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
|
-
|
|
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;
|
package/build/helpers/package.js
CHANGED
|
@@ -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(),
|
package/build/types/File.d.ts
CHANGED
package/build/types/Package.d.ts
CHANGED
package/build/types/Project.d.ts
CHANGED