@open-audio-stack/core 0.1.24 → 0.1.26
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.
|
@@ -112,18 +112,18 @@ export class ManagerLocal extends Manager {
|
|
|
112
112
|
this.addPackage(pkg);
|
|
113
113
|
}
|
|
114
114
|
scan(ext = 'json', installable = true) {
|
|
115
|
-
const filePaths = dirRead(
|
|
115
|
+
const filePaths = dirRead(path.join(this.typeDir, '**', `index.${ext}`));
|
|
116
116
|
filePaths.forEach((filePath) => {
|
|
117
|
-
let subPath = filePath.replace(`${this.typeDir}
|
|
117
|
+
let subPath = filePath.replace(`${this.typeDir}` + path.sep, '');
|
|
118
118
|
// TODO improve this code.
|
|
119
|
-
const parts = subPath.split(
|
|
119
|
+
const parts = subPath.split(path.sep);
|
|
120
120
|
parts.shift();
|
|
121
|
-
subPath = parts.join(
|
|
121
|
+
subPath = parts.join(path.sep);
|
|
122
122
|
const pkgJson = ext === 'yaml' ? fileReadYaml(filePath) : fileReadJson(filePath);
|
|
123
123
|
if (installable)
|
|
124
124
|
pkgJson.installed = true;
|
|
125
|
-
const pkg = new Package(pathGetSlug(subPath));
|
|
126
|
-
const version = pathGetVersion(subPath);
|
|
125
|
+
const pkg = new Package(pathGetSlug(subPath, path.sep));
|
|
126
|
+
const version = pathGetVersion(subPath, path.sep);
|
|
127
127
|
pkg.addVersion(version, pkgJson);
|
|
128
128
|
this.addPackage(pkg);
|
|
129
129
|
});
|
|
@@ -333,18 +333,18 @@ export class ManagerLocal extends Manager {
|
|
|
333
333
|
return this.getPackage(slug)?.getVersion(versionNum);
|
|
334
334
|
}
|
|
335
335
|
// Delete all directories for this package version.
|
|
336
|
-
const versionDirs = dirRead(
|
|
336
|
+
const versionDirs = dirRead(path.join(this.typeDir, '**', slug, versionNum));
|
|
337
337
|
versionDirs.forEach((versionDir) => {
|
|
338
338
|
dirDelete(versionDir);
|
|
339
339
|
});
|
|
340
340
|
// Delete all empty directories for this package.
|
|
341
|
-
const pkgDirs = dirRead(
|
|
341
|
+
const pkgDirs = dirRead(path.join(this.typeDir, '**', slug));
|
|
342
342
|
pkgDirs.forEach((pkgDir) => {
|
|
343
343
|
if (dirEmpty(pkgDir))
|
|
344
344
|
dirDelete(pkgDir);
|
|
345
345
|
});
|
|
346
346
|
// Delete all empty directories for the org.
|
|
347
|
-
const orgDirs = dirRead(
|
|
347
|
+
const orgDirs = dirRead(path.join(this.typeDir, '**', slug.split('/')[0]));
|
|
348
348
|
orgDirs.forEach((orgDir) => {
|
|
349
349
|
if (dirEmpty(orgDir))
|
|
350
350
|
dirDelete(orgDir);
|
|
@@ -10,8 +10,8 @@ export function packageLoadFile(filePath) {
|
|
|
10
10
|
if (!pkgFile)
|
|
11
11
|
log(filePath, `not a valid json file`);
|
|
12
12
|
// Validate package json file structure, fields and values.
|
|
13
|
-
const pkg = new Package(pathGetSlug(filePath));
|
|
14
|
-
pkg.addVersion(pathGetVersion(filePath), pkgFile);
|
|
13
|
+
const pkg = new Package(pathGetSlug(filePath, path.sep));
|
|
14
|
+
pkg.addVersion(pathGetVersion(filePath, path.sep), pkgFile);
|
|
15
15
|
log(JSON.stringify(pkg.getReport()));
|
|
16
16
|
return pkgFile;
|
|
17
17
|
}
|
package/package.json
CHANGED
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@open-audio-stack/core",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.26",
|
|
4
4
|
"description": "Open-source audio plugin management software",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "./build/index.js",
|
|
7
7
|
"exports": {
|
|
8
|
-
"
|
|
8
|
+
"default": "./build/index.js",
|
|
9
9
|
"node": "./build/index.js",
|
|
10
|
-
"
|
|
10
|
+
"browser": "./build/index-browser.js"
|
|
11
11
|
},
|
|
12
12
|
"types": "./build/index.d.ts",
|
|
13
13
|
"files": [
|