@grame/faustwasm 0.0.48 → 0.0.50
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.
- package/README.md +18 -3
- package/assets/standalone/index-poly.js +214 -0
- package/assets/standalone/index.html +12 -1
- package/assets/standalone/index.js +13 -14
- package/assets/standalone/template-poly.html +3 -3
- package/assets/standalone/template.html +2 -2
- package/assets/standalone/template.js +11 -12
- package/dist/cjs-bundle/index.js +42 -57
- package/dist/cjs-bundle/index.js.map +3 -3
- package/dist/esm-bundle/index.js +42 -57
- package/dist/esm-bundle/index.js.map +3 -3
- package/fileutils.js +31 -4
- package/libfaust-wasm/libfaust-wasm.js +1 -1
- package/libfaust-wasm/libfaust-wasm.wasm +0 -0
- package/package.json +1 -1
- package/scripts/faust2wasm.js +5 -3
- package/src/copyWebStandaloneAssets.d.ts +3 -3
- package/src/copyWebStandaloneAssets.js +30 -15
- package/src/faust2wasmFiles.js +7 -4
- package/test/faustlive-wasm/faust-ui/index.css +416 -0
- package/test/faustlive-wasm/faust-ui/index.css.map +1 -0
- package/test/faustlive-wasm/faust-ui/index.d.ts +1 -0
- package/test/faustlive-wasm/faust-ui/index.js +3476 -0
- package/test/faustlive-wasm/faust-ui/index.js.map +1 -0
- package/test/faustlive-wasm/faustwasm/index.d.ts +1294 -0
- package/test/faustlive-wasm/faustwasm/index.js +3827 -0
- package/test/faustlive-wasm/faustwasm/index.js.map +7 -0
- package/test/midi.dsp +8 -0
- package/test/organ1.dsp +1 -1
package/fileutils.js
CHANGED
|
@@ -11,8 +11,8 @@ const __filename = fileURLToPath(import.meta.url);
|
|
|
11
11
|
*/
|
|
12
12
|
|
|
13
13
|
/**
|
|
14
|
-
* @param {string} src
|
|
15
|
-
* @param {string} dest
|
|
14
|
+
* @param {string} src - The source path.
|
|
15
|
+
* @param {string} dest - The destination path.
|
|
16
16
|
*/
|
|
17
17
|
const cpSync = (src, dest) => {
|
|
18
18
|
if (!fs.existsSync(src)) return;
|
|
@@ -25,7 +25,34 @@ const cpSync = (src, dest) => {
|
|
|
25
25
|
};
|
|
26
26
|
|
|
27
27
|
/**
|
|
28
|
-
* @param {string}
|
|
28
|
+
* @param {string} src - The source path of the file to modify and copy.
|
|
29
|
+
* @param {string} dest - The destination path.
|
|
30
|
+
* @param {string} find - The string to find.
|
|
31
|
+
* @param {string} replace - The string to replace.
|
|
32
|
+
*/
|
|
33
|
+
const cpSyncModify = (src, dest, find, replace) => {
|
|
34
|
+
fs.readFile(src, 'utf8', function (err, data) {
|
|
35
|
+
if (err) {
|
|
36
|
+
console.error(err);
|
|
37
|
+
return;
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
// Create a regular expression from the 'find' string
|
|
41
|
+
const regex = new RegExp(find, 'g');
|
|
42
|
+
|
|
43
|
+
// Replace 'find' with 'replace'
|
|
44
|
+
let modifiedData = data.replace(regex, replace);
|
|
45
|
+
|
|
46
|
+
// Write the modified data to a new file
|
|
47
|
+
fs.writeFile(dest, modifiedData, 'utf8', function (err) {
|
|
48
|
+
if (err) {
|
|
49
|
+
console.error(err);
|
|
50
|
+
}
|
|
51
|
+
});
|
|
52
|
+
});
|
|
53
|
+
}
|
|
54
|
+
/**
|
|
55
|
+
* @param {string} dir - The directory to remove.
|
|
29
56
|
*/
|
|
30
57
|
const rmSync = (dir) => {
|
|
31
58
|
if (!fs.existsSync(dir)) return;
|
|
@@ -37,4 +64,4 @@ const rmSync = (dir) => {
|
|
|
37
64
|
}
|
|
38
65
|
};
|
|
39
66
|
|
|
40
|
-
export { cpSync, rmSync };
|
|
67
|
+
export { cpSync, cpSyncModify, rmSync };
|