@open-audio-stack/core 0.1.3 → 0.1.5

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.
@@ -37,9 +37,9 @@ export async function archiveExtract(filePath, dirPath) {
37
37
  }
38
38
  }
39
39
  export function dirApp(dirName = 'open-audio-stack') {
40
- if (getSystem() === SystemType.Windows)
40
+ if (getSystem() === SystemType.Win)
41
41
  return process.env.APPDATA || path.join(os.homedir(), dirName);
42
- else if (getSystem() === SystemType.Macintosh)
42
+ else if (getSystem() === SystemType.Mac)
43
43
  return path.join(os.homedir(), 'Library', 'Preferences', dirName);
44
44
  return path.join(os.homedir(), '.local', 'share', dirName);
45
45
  }
@@ -83,9 +83,9 @@ export function dirOpen(dir) {
83
83
  let command = '';
84
84
  if (process.env.CI)
85
85
  return Buffer.from('');
86
- if (getSystem() === SystemType.Windows)
86
+ if (getSystem() === SystemType.Win)
87
87
  command = 'start ""';
88
- else if (getSystem() === SystemType.Macintosh)
88
+ else if (getSystem() === SystemType.Mac)
89
89
  command = 'open';
90
90
  else
91
91
  command = 'xdg-open';
@@ -98,25 +98,25 @@ export function dirPackage(pkg) {
98
98
  return path.join(...parts);
99
99
  }
100
100
  export function dirPlugins() {
101
- if (getSystem() === SystemType.Windows)
101
+ if (getSystem() === SystemType.Win)
102
102
  return path.join('Program Files', 'Common Files');
103
- else if (getSystem() === SystemType.Macintosh)
103
+ else if (getSystem() === SystemType.Mac)
104
104
  return path.join(os.homedir(), 'Library', 'Audio', 'Plug-ins');
105
105
  return path.join('usr', 'local', 'lib');
106
106
  }
107
107
  export function dirPresets() {
108
- if (getSystem() === SystemType.Windows)
108
+ if (getSystem() === SystemType.Win)
109
109
  return path.join(os.homedir(), 'Documents', 'VST3 Presets');
110
- else if (getSystem() === SystemType.Macintosh)
110
+ else if (getSystem() === SystemType.Mac)
111
111
  return path.join(os.homedir(), 'Library', 'Audio', 'Presets');
112
112
  return path.join(os.homedir(), '.vst3', 'presets');
113
113
  }
114
114
  export function dirProjects() {
115
115
  // Windows throws permissions errors if you scan hidden folders
116
116
  // Therefore set to a more specific path than Documents
117
- if (getSystem() === SystemType.Windows)
117
+ if (getSystem() === SystemType.Win)
118
118
  return path.join(os.homedir(), 'Documents', 'Audio');
119
- else if (getSystem() === SystemType.Macintosh)
119
+ else if (getSystem() === SystemType.Mac)
120
120
  return path.join(os.homedir(), 'Documents', 'Audio');
121
121
  return path.join(os.homedir(), 'Documents', 'Audio');
122
122
  }
@@ -124,7 +124,7 @@ export function dirRead(dir, options) {
124
124
  console.log('⌕', dir);
125
125
  // Glob now expects forward slashes on Windows
126
126
  // Convert backslashes from path.join() to forwardslashes
127
- if (getSystem() === SystemType.Windows) {
127
+ if (getSystem() === SystemType.Win) {
128
128
  dir = dir.replace(/\\/g, '/');
129
129
  }
130
130
  return globSync(dir, options);
@@ -199,9 +199,9 @@ export function fileOpen(filePath) {
199
199
  let command = '';
200
200
  if (process.env.CI)
201
201
  return Buffer.from('');
202
- if (getSystem() === SystemType.Windows)
202
+ if (getSystem() === SystemType.Win)
203
203
  command = 'open';
204
- else if (getSystem() === SystemType.Macintosh)
204
+ else if (getSystem() === SystemType.Mac)
205
205
  command = 'start ""';
206
206
  else
207
207
  command = 'xdg-open';
@@ -268,10 +268,10 @@ export async function fileValidateMetadata(filePath, fileMetadata) {
268
268
  return errors;
269
269
  }
270
270
  export function getPlatform() {
271
- if (getSystem() === SystemType.Windows)
272
- return SystemType.Windows;
273
- else if (getSystem() === SystemType.Macintosh)
274
- return SystemType.Macintosh;
271
+ if (getSystem() === SystemType.Win)
272
+ return SystemType.Win;
273
+ else if (getSystem() === SystemType.Mac)
274
+ return SystemType.Mac;
275
275
  return SystemType.Linux;
276
276
  }
277
277
  export function runCliAsAdmin(args) {
@@ -11,9 +11,9 @@ export function getArchitecture() {
11
11
  }
12
12
  export function getSystem() {
13
13
  if (process.platform === 'win32')
14
- return SystemType.Windows;
14
+ return SystemType.Win;
15
15
  else if (process.platform === 'darwin')
16
- return SystemType.Macintosh;
16
+ return SystemType.Mac;
17
17
  return SystemType.Linux;
18
18
  }
19
19
  export function isTests() {
@@ -15,6 +15,7 @@ export * from './types/FileType.js';
15
15
  export * from './types/License.js';
16
16
  export * from './types/Package.js';
17
17
  export * from './types/Plugin.js';
18
+ export * from './types/PluginCategory.js';
18
19
  export * from './types/PluginFormat.js';
19
20
  export * from './types/PluginType.js';
20
21
  export * from './types/Preset.js';
@@ -28,6 +28,7 @@ export * from './types/FileType.js';
28
28
  export * from './types/License.js';
29
29
  export * from './types/Package.js';
30
30
  export * from './types/Plugin.js';
31
+ export * from './types/PluginCategory.js';
31
32
  export * from './types/PluginFormat.js';
32
33
  export * from './types/PluginType.js';
33
34
  export * from './types/Preset.js';
package/build/index.d.ts CHANGED
@@ -20,6 +20,7 @@ export * from './types/FileType.js';
20
20
  export * from './types/License.js';
21
21
  export * from './types/Package.js';
22
22
  export * from './types/Plugin.js';
23
+ export * from './types/PluginCategory.js';
23
24
  export * from './types/PluginFormat.js';
24
25
  export * from './types/PluginType.js';
25
26
  export * from './types/Preset.js';
package/build/index.js CHANGED
@@ -28,6 +28,7 @@ export * from './types/FileType.js';
28
28
  export * from './types/License.js';
29
29
  export * from './types/Package.js';
30
30
  export * from './types/Plugin.js';
31
+ export * from './types/PluginCategory.js';
31
32
  export * from './types/PluginFormat.js';
32
33
  export * from './types/PluginType.js';
33
34
  export * from './types/Preset.js';
@@ -1,7 +1,7 @@
1
1
  export declare enum SystemType {
2
- Macintosh = "mac",
2
+ Mac = "mac",
3
3
  Linux = "linux",
4
- Windows = "win"
4
+ Win = "win"
5
5
  }
6
6
  export interface SystemTypeOption {
7
7
  description: string;
@@ -1,8 +1,8 @@
1
1
  export var SystemType;
2
2
  (function (SystemType) {
3
- SystemType["Macintosh"] = "mac";
3
+ SystemType["Mac"] = "mac";
4
4
  SystemType["Linux"] = "linux";
5
- SystemType["Windows"] = "win";
5
+ SystemType["Win"] = "win";
6
6
  })(SystemType || (SystemType = {}));
7
7
  export const systemTypes = [
8
8
  {
@@ -12,12 +12,12 @@ export const systemTypes = [
12
12
  },
13
13
  {
14
14
  description: 'Operating system designed and sold by Apple, and is known for its ease of use.',
15
- value: SystemType.Macintosh,
16
- name: 'Macintosh',
15
+ value: SystemType.Mac,
16
+ name: 'Mac',
17
17
  },
18
18
  {
19
19
  description: 'Most popular home operating system, preloaded on most new personal computers.',
20
- value: SystemType.Windows,
20
+ value: SystemType.Win,
21
21
  name: 'Windows',
22
22
  },
23
23
  ];
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@open-audio-stack/core",
3
- "version": "0.1.3",
3
+ "version": "0.1.5",
4
4
  "description": "Open-source audio plugin management software",
5
5
  "type": "module",
6
6
  "main": "./build/index.js",