@open-audio-stack/core 0.1.29 → 0.1.30

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.
@@ -81,6 +81,11 @@ export class ManagerLocal extends Manager {
81
81
  message: 'Website url',
82
82
  default: `https://github.com/${pkgAnswers.org}/${pkgAnswers.package}`,
83
83
  },
84
+ {
85
+ name: 'donate',
86
+ type: 'input',
87
+ message: 'Donation url',
88
+ },
84
89
  {
85
90
  name: 'audio',
86
91
  type: 'input',
@@ -96,6 +96,7 @@ export declare const PackageVersionValidator: z.ZodObject<{
96
96
  changes: z.ZodString;
97
97
  date: z.ZodString;
98
98
  description: z.ZodString;
99
+ donate: z.ZodOptional<z.ZodString>;
99
100
  files: z.ZodArray<z.ZodObject<{
100
101
  architectures: z.ZodArray<z.ZodNativeEnum<typeof Architecture>, "many">;
101
102
  sha256: z.ZodString;
@@ -169,6 +170,7 @@ export declare const PackageVersionValidator: z.ZodObject<{
169
170
  author: string;
170
171
  changes: string;
171
172
  description: string;
173
+ type: PluginType | PresetType | ProjectType;
172
174
  files: {
173
175
  type: FileType;
174
176
  architectures: Architecture[];
@@ -181,18 +183,19 @@ export declare const PackageVersionValidator: z.ZodObject<{
181
183
  }[];
182
184
  url: string;
183
185
  }[];
184
- type: PluginType | PresetType | ProjectType;
185
186
  url: string;
186
187
  image: string;
187
188
  license: License;
188
189
  name: string;
189
190
  tags: string[];
191
+ donate?: string | undefined;
190
192
  }, {
191
193
  date: string;
192
194
  audio: string;
193
195
  author: string;
194
196
  changes: string;
195
197
  description: string;
198
+ type: PluginType | PresetType | ProjectType;
196
199
  files: {
197
200
  type: FileType;
198
201
  architectures: Architecture[];
@@ -205,12 +208,12 @@ export declare const PackageVersionValidator: z.ZodObject<{
205
208
  }[];
206
209
  url: string;
207
210
  }[];
208
- type: PluginType | PresetType | ProjectType;
209
211
  url: string;
210
212
  image: string;
211
213
  license: License;
212
214
  name: string;
213
215
  tags: string[];
216
+ donate?: string | undefined;
214
217
  }>;
215
218
  export declare function packageRecommendations(pkgVersion: PackageVersion): PackageValidationRec[];
216
- export declare function packageRecommendationsUrl(obj: PackageVersion | PluginFile | PresetFile | ProjectFile, recs: PackageValidationRec[], field: string): void;
219
+ export declare function packageRecommendationsUrl(obj: PackageVersion | PluginFile | PresetFile | ProjectFile, recs: PackageValidationRec[], field: string, domain?: string): void;
@@ -61,6 +61,7 @@ export const PackageVersionValidator = z.object({
61
61
  changes: z.string().min(0).max(256),
62
62
  date: z.string().datetime(),
63
63
  description: z.string().min(0).max(256),
64
+ donate: z.optional(z.string().min(0).max(256).startsWith('https://')),
64
65
  files: z.array(PackageFileValidator),
65
66
  image: z.string().min(0).max(256).startsWith('https://'),
66
67
  license: z.nativeEnum(License),
@@ -72,9 +73,10 @@ export const PackageVersionValidator = z.object({
72
73
  // TODO refactor all this using a proper validation library.
73
74
  export function packageRecommendations(pkgVersion) {
74
75
  const recs = [];
75
- packageRecommendationsUrl(pkgVersion, recs, 'audio');
76
- packageRecommendationsUrl(pkgVersion, recs, 'image');
77
- packageRecommendationsUrl(pkgVersion, recs, 'url');
76
+ packageRecommendationsUrl(pkgVersion, recs, 'audio', 'github');
77
+ packageRecommendationsUrl(pkgVersion, recs, 'image', 'github');
78
+ packageRecommendationsUrl(pkgVersion, recs, 'url', 'github');
79
+ packageRecommendationsUrl(pkgVersion, recs, 'donate');
78
80
  // Image/audio previews
79
81
  if (pkgVersion.image && pkgVersion.image.endsWith('png')) {
80
82
  recs.push({
@@ -102,7 +104,7 @@ export function packageRecommendations(pkgVersion) {
102
104
  });
103
105
  const ext = pathGetExt(file.url);
104
106
  supportedFileFormats[ext] = true;
105
- packageRecommendationsUrl(file, recs, 'url');
107
+ packageRecommendationsUrl(file, recs, 'url', 'github');
106
108
  // Formats which do not support headless installation.
107
109
  if (ext === FileFormat.AppImage)
108
110
  recs.push({ field: 'url', rec: 'requires manual installation steps, consider .deb and .rpm instead' });
@@ -170,7 +172,7 @@ export function packageRecommendations(pkgVersion) {
170
172
  }
171
173
  return recs;
172
174
  }
173
- export function packageRecommendationsUrl(obj, recs, field) {
175
+ export function packageRecommendationsUrl(obj, recs, field, domain) {
174
176
  // @ts-expect-error indexing a field with multiple package types.
175
177
  const val = obj[field];
176
178
  if (typeof val !== 'string')
@@ -181,7 +183,7 @@ export function packageRecommendationsUrl(obj, recs, field) {
181
183
  rec: 'should use https url',
182
184
  });
183
185
  }
184
- if (!val.includes('github.com') && !val.includes('github.io')) {
186
+ if (domain && !val.includes(`${domain}.com`) && !val.includes(`${domain}.io`)) {
185
187
  recs.push({
186
188
  field,
187
189
  rec: 'should point to GitHub',
@@ -17,6 +17,7 @@ export interface PackageBase {
17
17
  changes: string;
18
18
  date: string;
19
19
  description: string;
20
+ donate?: string;
20
21
  image: string;
21
22
  installed?: boolean;
22
23
  license: License;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@open-audio-stack/core",
3
- "version": "0.1.29",
3
+ "version": "0.1.30",
4
4
  "description": "Open-source audio plugin management software",
5
5
  "type": "module",
6
6
  "main": "./build/index.js",