@open-audio-stack/core 0.1.1 → 0.1.3

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.
@@ -10,6 +10,7 @@ import { PresetType } from '../types/PresetType.js';
10
10
  import { ProjectFormat } from '../types/ProjectFormat.js';
11
11
  import { ProjectType } from '../types/ProjectType.js';
12
12
  import { SystemType } from '../types/SystemType.js';
13
+ import { PluginCategoryEffect, PluginCategoryInstrument } from '../types/PluginCategory.js';
13
14
  export declare class Config {
14
15
  config: ConfigInterface;
15
16
  constructor(config?: ConfigInterface);
@@ -24,6 +25,10 @@ export declare class Config {
24
25
  fileTypes(): import("../types/FileType.js").FileTypeOption[];
25
26
  license(type: License): import("../types/License.js").LicenseOption;
26
27
  licenses(): import("../types/License.js").LicenseOption[];
28
+ pluginCategoryEffect(effect: PluginCategoryEffect): import("../types/PluginCategory.js").PluginCategoryOption;
29
+ pluginCategoryEffects(): import("../types/PluginCategory.js").PluginCategoryOption[];
30
+ pluginCategoryInstrument(instrument: PluginCategoryInstrument): import("../types/PluginCategory.js").PluginCategoryOption;
31
+ pluginCategoryInstruments(): import("../types/PluginCategory.js").PluginCategoryOption[];
27
32
  pluginFormat(format: PluginFormat): import("../types/PluginFormat.js").PluginFormatOption;
28
33
  pluginFormats(): import("../types/PluginFormat.js").PluginFormatOption[];
29
34
  pluginType(type: PluginType): import("../types/PluginType.js").PluginTypeOption;
@@ -10,6 +10,7 @@ import { presetTypes } from '../types/PresetType.js';
10
10
  import { projectFormats } from '../types/ProjectFormat.js';
11
11
  import { projectTypes } from '../types/ProjectType.js';
12
12
  import { systemTypes } from '../types/SystemType.js';
13
+ import { pluginCategoryEffects, pluginCategoryInstruments, } from '../types/PluginCategory.js';
13
14
  export class Config {
14
15
  config;
15
16
  constructor(config) {
@@ -52,6 +53,18 @@ export class Config {
52
53
  return licenses;
53
54
  }
54
55
  // Plugin formats and types.
56
+ pluginCategoryEffect(effect) {
57
+ return pluginCategoryEffects.filter(pluginCategoryEffect => effect === pluginCategoryEffect.value)[0];
58
+ }
59
+ pluginCategoryEffects() {
60
+ return pluginCategoryEffects;
61
+ }
62
+ pluginCategoryInstrument(instrument) {
63
+ return pluginCategoryInstruments.filter(pluginCategoryInstrument => instrument === pluginCategoryInstrument.value)[0];
64
+ }
65
+ pluginCategoryInstruments() {
66
+ return pluginCategoryInstruments;
67
+ }
55
68
  pluginFormat(format) {
56
69
  return pluginFormats.filter(pluginFormat => format === pluginFormat.value)[0];
57
70
  }
@@ -2,7 +2,8 @@ import path from 'path';
2
2
  import { Package } from './Package.js';
3
3
  import { Manager } from './Manager.js';
4
4
  import { archiveExtract, dirCreate, dirDelete, dirEmpty, dirRead, fileCreate, fileCreateJson, fileExists, fileHash, fileOpen, fileReadJson, filesMove, isAdmin, runCliAsAdmin, } from '../helpers/file.js';
5
- import { isTests, pathGetSlug, pathGetVersion } from '../helpers/utils.js';
5
+ import { pathGetSlug, pathGetVersion } from '../helpers/utils.js';
6
+ import { getArchitecture, getSystem, isTests } from '../helpers/utilsLocal.js';
6
7
  import { apiBuffer } from '../helpers/api.js';
7
8
  import { FileType } from '../types/FileType.js';
8
9
  import { RegistryType } from '../types/Registry.js';
@@ -53,7 +54,7 @@ export class ManagerLocal extends Manager {
53
54
  const dirDownloads = path.join(this.config.get('appDir'), 'downloads', this.type, slug, versionNum);
54
55
  dirCreate(dirDownloads);
55
56
  // Filter for compatible files and download.
56
- const files = packageCompatibleFiles(pkgVersion);
57
+ const files = packageCompatibleFiles(pkgVersion, [getArchitecture()], [getSystem()]);
57
58
  if (!files.length)
58
59
  return console.error(`Error: No compatible files found for ${slug}`);
59
60
  for (const key in files) {
@@ -14,7 +14,8 @@ import { ZodIssueCode } from 'zod';
14
14
  import { SystemType } from '../types/SystemType.js';
15
15
  import { fileURLToPath } from 'url';
16
16
  import sudoPrompt from '@vscode/sudo-prompt';
17
- import { getSystem, log } from './utils.js';
17
+ import { log } from './utils.js';
18
+ import { getSystem } from './utilsLocal.js';
18
19
  export async function archiveExtract(filePath, dirPath) {
19
20
  console.log('⎋', dirPath);
20
21
  const ext = path.extname(filePath).trim().toLowerCase();
@@ -11,7 +11,7 @@ import { ProjectFile } from '../types/Project.js';
11
11
  import { ProjectType } from '../types/ProjectType.js';
12
12
  import { SystemType } from '../types/SystemType.js';
13
13
  import { PackageInterface, PackageValidationRec, PackageVersion } from '../types/Package.js';
14
- export declare function packageCompatibleFiles(pkg: PackageVersion): (PluginFile | PresetFile | ProjectFile)[];
14
+ export declare function packageCompatibleFiles(pkg: PackageVersion, arch: Architecture[], sys: SystemType[]): (PluginFile | PresetFile | ProjectFile)[];
15
15
  export declare function packageVersionLatest(pkg: PackageInterface): string;
16
16
  export declare const PackageSystemValidator: z.ZodObject<{
17
17
  max: z.ZodOptional<z.ZodNumber>;
@@ -170,8 +170,8 @@ export declare const PackageVersionValidator: z.ZodObject<{
170
170
  }>;
171
171
  url: z.ZodString;
172
172
  }, "strip", z.ZodTypeAny, {
173
- date: string;
174
173
  type: PluginType | PresetType | ProjectType;
174
+ date: string;
175
175
  url: string;
176
176
  audio: string;
177
177
  author: string;
@@ -195,8 +195,8 @@ export declare const PackageVersionValidator: z.ZodObject<{
195
195
  name: string;
196
196
  tags: string[];
197
197
  }, {
198
- date: string;
199
198
  type: PluginType | PresetType | ProjectType;
199
+ date: string;
200
200
  url: string;
201
201
  audio: string;
202
202
  author: string;
@@ -8,14 +8,13 @@ import { PluginType } from '../types/PluginType.js';
8
8
  import { PresetType } from '../types/PresetType.js';
9
9
  import { ProjectType } from '../types/ProjectType.js';
10
10
  import { SystemType } from '../types/SystemType.js';
11
- import { getArchitecture, getSystem } from './utils.js';
12
- export function packageCompatibleFiles(pkg) {
11
+ export function packageCompatibleFiles(pkg, arch, sys) {
13
12
  return pkg.files.filter((file) => {
14
13
  const archMatches = file.architectures.filter(architecture => {
15
- return architecture === getArchitecture();
14
+ return arch.includes(architecture);
16
15
  });
17
16
  const sysMatches = file.systems.filter(system => {
18
- return system.type === getSystem();
17
+ return sys.includes(system.type);
19
18
  });
20
19
  return archMatches.length && sysMatches.length;
21
20
  });
@@ -1,11 +1,6 @@
1
1
  import { PackageValidationRec } from '../types/Package.js';
2
2
  import { ZodIssue } from 'zod';
3
- import { SystemType } from '../types/SystemType.js';
4
- import { Architecture } from '../types/Architecture.js';
5
- export declare function getArchitecture(): Architecture;
6
- export declare function getSystem(): SystemType;
7
3
  export declare function inputGetParts(input: string): string[];
8
- export declare function isTests(): boolean;
9
4
  export declare function log(...args: any): boolean;
10
5
  export declare function logEnable(): boolean;
11
6
  export declare function logDisable(): boolean;
@@ -1,31 +1,8 @@
1
1
  import chalk from 'chalk';
2
- import { SystemType } from '../types/SystemType.js';
3
- import { Architecture } from '../types/Architecture.js';
4
2
  let LOGGING_ENABLED = false;
5
- export function getArchitecture() {
6
- if (process.arch === 'arm')
7
- return Architecture.Arm32;
8
- if (process.arch === 'arm64')
9
- return Architecture.Arm64;
10
- if (process.arch === 'ia32')
11
- return Architecture.X32;
12
- return Architecture.X64;
13
- }
14
- export function getSystem() {
15
- if (process.platform === 'win32')
16
- return SystemType.Windows;
17
- else if (process.platform === 'darwin')
18
- return SystemType.Macintosh;
19
- return SystemType.Linux;
20
- }
21
3
  export function inputGetParts(input) {
22
4
  return input.split('@');
23
5
  }
24
- export function isTests() {
25
- const jest = process.env.JEST_WORKER_ID !== undefined;
26
- const vitest = process.env.VITEST_WORKER_ID !== undefined;
27
- return jest || vitest;
28
- }
29
6
  export function log(...args) {
30
7
  if (LOGGING_ENABLED) {
31
8
  console.log(...args);
@@ -0,0 +1,5 @@
1
+ import { SystemType } from '../types/SystemType.js';
2
+ import { Architecture } from '../types/Architecture.js';
3
+ export declare function getArchitecture(): Architecture;
4
+ export declare function getSystem(): SystemType;
5
+ export declare function isTests(): boolean;
@@ -0,0 +1,23 @@
1
+ import { SystemType } from '../types/SystemType.js';
2
+ import { Architecture } from '../types/Architecture.js';
3
+ export function getArchitecture() {
4
+ if (process.arch === 'arm')
5
+ return Architecture.Arm32;
6
+ if (process.arch === 'arm64')
7
+ return Architecture.Arm64;
8
+ if (process.arch === 'ia32')
9
+ return Architecture.X32;
10
+ return Architecture.X64;
11
+ }
12
+ export function getSystem() {
13
+ if (process.platform === 'win32')
14
+ return SystemType.Windows;
15
+ else if (process.platform === 'darwin')
16
+ return SystemType.Macintosh;
17
+ return SystemType.Linux;
18
+ }
19
+ export function isTests() {
20
+ const jest = process.env.JEST_WORKER_ID !== undefined;
21
+ const vitest = process.env.VITEST_WORKER_ID !== undefined;
22
+ return jest || vitest;
23
+ }
@@ -18,6 +18,7 @@ export * from './helpers/config.js';
18
18
  export * from './helpers/package.js';
19
19
  export * from './helpers/registry.js';
20
20
  export * from './helpers/utils.js';
21
+ // export * from './helpers/utilsLocal.js';
21
22
  // Types
22
23
  export * from './types/Architecture.js';
23
24
  export * from './types/Config.js';
package/build/index.d.ts CHANGED
@@ -11,6 +11,7 @@ export * from './helpers/file.js';
11
11
  export * from './helpers/package.js';
12
12
  export * from './helpers/registry.js';
13
13
  export * from './helpers/utils.js';
14
+ export * from './helpers/utilsLocal.js';
14
15
  export * from './types/Architecture.js';
15
16
  export * from './types/Config.js';
16
17
  export * from './types/File.js';
package/build/index.js CHANGED
@@ -18,6 +18,7 @@ export * from './helpers/file.js';
18
18
  export * from './helpers/package.js';
19
19
  export * from './helpers/registry.js';
20
20
  export * from './helpers/utils.js';
21
+ export * from './helpers/utilsLocal.js';
21
22
  // Types
22
23
  export * from './types/Architecture.js';
23
24
  export * from './types/Config.js';
@@ -0,0 +1,24 @@
1
+ export declare enum PluginCategoryEffect {
2
+ Chorus = "chorus",
3
+ Compression = "compression",
4
+ Eq = "eq",
5
+ Filter = "filter",
6
+ Reverb = "reverb"
7
+ }
8
+ export declare enum PluginCategoryInstrument {
9
+ Drums = "drums",
10
+ Guitar = "guitar",
11
+ Keys = "keys",
12
+ Orchestral = "orchestral",
13
+ Samplers = "samplers",
14
+ Synths = "synths",
15
+ Vocals = "vocals"
16
+ }
17
+ export interface PluginCategoryOption {
18
+ description: string;
19
+ value: PluginCategoryEffect | PluginCategoryInstrument;
20
+ name: string;
21
+ tags: string[];
22
+ }
23
+ export declare const pluginCategoryEffects: PluginCategoryOption[];
24
+ export declare const pluginCategoryInstruments: PluginCategoryOption[];
@@ -0,0 +1,94 @@
1
+ export var PluginCategoryEffect;
2
+ (function (PluginCategoryEffect) {
3
+ PluginCategoryEffect["Chorus"] = "chorus";
4
+ PluginCategoryEffect["Compression"] = "compression";
5
+ PluginCategoryEffect["Eq"] = "eq";
6
+ PluginCategoryEffect["Filter"] = "filter";
7
+ PluginCategoryEffect["Reverb"] = "reverb";
8
+ })(PluginCategoryEffect || (PluginCategoryEffect = {}));
9
+ export var PluginCategoryInstrument;
10
+ (function (PluginCategoryInstrument) {
11
+ PluginCategoryInstrument["Drums"] = "drums";
12
+ PluginCategoryInstrument["Guitar"] = "guitar";
13
+ PluginCategoryInstrument["Keys"] = "keys";
14
+ PluginCategoryInstrument["Orchestral"] = "orchestral";
15
+ PluginCategoryInstrument["Samplers"] = "samplers";
16
+ PluginCategoryInstrument["Synths"] = "synths";
17
+ PluginCategoryInstrument["Vocals"] = "vocals";
18
+ })(PluginCategoryInstrument || (PluginCategoryInstrument = {}));
19
+ export const pluginCategoryEffects = [
20
+ {
21
+ description: 'Spatial movement and modulation.',
22
+ value: PluginCategoryEffect.Chorus,
23
+ name: 'Chorus/Phaser',
24
+ tags: ['Chorus', 'Phaser'],
25
+ },
26
+ {
27
+ description: 'Shape dynamics, grit and amplification.',
28
+ value: PluginCategoryEffect.Compression,
29
+ name: 'Compression/Distortion',
30
+ tags: ['Compression', 'Distortion', 'Amplifier', 'Amp'],
31
+ },
32
+ {
33
+ description: 'Balance frequencies and position sounds in the stereo field.',
34
+ value: PluginCategoryEffect.Eq,
35
+ name: 'EQ/Pan',
36
+ tags: ['EQ', 'Equalizer', 'Pan'],
37
+ },
38
+ {
39
+ description: 'Adjust tone and sculpt frequencies.',
40
+ value: PluginCategoryEffect.Filter,
41
+ name: 'Filter',
42
+ tags: ['Filter'],
43
+ },
44
+ {
45
+ description: 'Create depth with echoes, ambience, and space.',
46
+ value: PluginCategoryEffect.Reverb,
47
+ name: 'Reverb/Delay',
48
+ tags: ['Reverb', 'Delay'],
49
+ },
50
+ ];
51
+ export const pluginCategoryInstruments = [
52
+ {
53
+ description: '',
54
+ value: PluginCategoryInstrument.Drums,
55
+ name: 'Drums',
56
+ tags: ['Drums', 'Percussion'],
57
+ },
58
+ {
59
+ description: '',
60
+ value: PluginCategoryInstrument.Guitar,
61
+ name: 'Guitar',
62
+ tags: ['Guitar', 'String'],
63
+ },
64
+ {
65
+ description: '',
66
+ value: PluginCategoryInstrument.Keys,
67
+ name: 'Keys',
68
+ tags: ['Keys', 'Piano'],
69
+ },
70
+ {
71
+ description: '',
72
+ value: PluginCategoryInstrument.Orchestral,
73
+ name: 'Orchestral',
74
+ tags: ['Orchestral', 'Orchestra', 'Strings', 'Woodwind', 'Brass'],
75
+ },
76
+ {
77
+ description: '',
78
+ value: PluginCategoryInstrument.Samplers,
79
+ name: 'Samplers',
80
+ tags: ['Samplers', 'Sampler', 'Sample'],
81
+ },
82
+ {
83
+ description: '',
84
+ value: PluginCategoryInstrument.Synths,
85
+ name: 'Synths',
86
+ tags: ['Synths', 'Synth', 'Synthesizer'],
87
+ },
88
+ {
89
+ description: '',
90
+ value: PluginCategoryInstrument.Vocals,
91
+ name: 'Vocals',
92
+ tags: ['Vocals'],
93
+ },
94
+ ];
@@ -31,61 +31,61 @@ export const projectFormats = [
31
31
  {
32
32
  description: 'Used to store all information about a Live set.',
33
33
  value: ProjectFormat.AbletonLive,
34
- name: 'Ableton Live Project',
34
+ name: 'Ableton Live',
35
35
  },
36
36
  {
37
37
  description: 'Containing all Bitwig project-related information.',
38
38
  value: ProjectFormat.Bitwig,
39
- name: 'Bitwig Project',
39
+ name: 'Bitwig',
40
40
  },
41
41
  {
42
42
  description: 'Used to save Steinberg Cubase arrangements and settings.',
43
43
  value: ProjectFormat.Cubase,
44
- name: 'Cubase Project',
44
+ name: 'Cubase',
45
45
  },
46
46
  {
47
47
  description: 'Open standard for storing various audio project settings.',
48
48
  value: ProjectFormat.DAWproject,
49
- name: 'DAWproject Project',
49
+ name: 'DAWproject',
50
50
  },
51
51
  {
52
52
  description: 'Used for saving FL Studio compositions and arrangements.',
53
53
  value: ProjectFormat.FLStudio,
54
- name: 'FL Studio Project',
54
+ name: 'FL Studio',
55
55
  },
56
56
  {
57
57
  description: 'A package containing audio files and Garageband timeline and settings.',
58
58
  value: ProjectFormat.Garageband,
59
- name: 'Garageband Project',
59
+ name: 'Garageband',
60
60
  },
61
61
  {
62
62
  description: 'Music project for open-source, cross-platform software.',
63
63
  value: ProjectFormat.Lmms,
64
- name: 'LMMS Project',
64
+ name: 'LMMS',
65
65
  },
66
66
  {
67
67
  description: "Containing all Apple's Logic Pro audio, MIDI, and arrangement data.",
68
68
  value: ProjectFormat.Logic,
69
- name: 'Logic Pro Project',
69
+ name: 'Logic Pro',
70
70
  },
71
71
  {
72
72
  description: 'Compressed Musescore project along with metadata and image preview.',
73
73
  value: ProjectFormat.Musescore,
74
- name: 'Musescore Project',
74
+ name: 'Musescore',
75
75
  },
76
76
  {
77
77
  description: 'Used for Avid Pro Tools audio recording and production.',
78
78
  value: ProjectFormat.ProTools,
79
- name: 'Pro Tools Project',
79
+ name: 'Pro Tools',
80
80
  },
81
81
  {
82
82
  description: 'Containing Reaper tracks, arrangements, and settings.',
83
83
  value: ProjectFormat.Reaper,
84
- name: 'Reaper Project',
84
+ name: 'Reaper',
85
85
  },
86
86
  {
87
87
  description: 'Used for Cakewalk Sonar music production and audio editing.',
88
88
  value: ProjectFormat.Sonar,
89
- name: 'Sonar Project',
89
+ name: 'Sonar',
90
90
  },
91
91
  ];
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@open-audio-stack/core",
3
- "version": "0.1.1",
3
+ "version": "0.1.3",
4
4
  "description": "Open-source audio plugin management software",
5
5
  "type": "module",
6
6
  "main": "./build/index.js",