@lowdefy/node-utils 4.0.0-alpha.8 → 4.0.0-rc.0
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/dist/cleanDirectory.js +1 -1
- package/dist/copyDirectory.js +3 -3
- package/dist/getConfigFromEnv.js +1 -1
- package/dist/getFileExtension.js +1 -1
- package/dist/getSecretsFromEnv.js +1 -1
- package/dist/index.js +1 -1
- package/dist/readFile.js +1 -1
- package/dist/spawnProcess.js +25 -21
- package/dist/writeFile.js +1 -1
- package/package.json +11 -12
package/dist/cleanDirectory.js
CHANGED
package/dist/copyDirectory.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/*
|
|
2
|
-
Copyright 2020-
|
|
2
|
+
Copyright 2020-2022 Lowdefy, Inc
|
|
3
3
|
|
|
4
4
|
Licensed under the Apache License, Version 2.0 (the "License");
|
|
5
5
|
you may not use this file except in compliance with the License.
|
|
@@ -13,7 +13,7 @@
|
|
|
13
13
|
See the License for the specific language governing permissions and
|
|
14
14
|
limitations under the License.
|
|
15
15
|
*/ import fsExtra from 'fs-extra';
|
|
16
|
-
async function copyDirectory(dirPathFrom, dirPathTo) {
|
|
17
|
-
await fsExtra.copy(dirPathFrom, dirPathTo);
|
|
16
|
+
async function copyDirectory(dirPathFrom, dirPathTo, options) {
|
|
17
|
+
await fsExtra.copy(dirPathFrom, dirPathTo, options);
|
|
18
18
|
}
|
|
19
19
|
export default copyDirectory;
|
package/dist/getConfigFromEnv.js
CHANGED
package/dist/getFileExtension.js
CHANGED
package/dist/index.js
CHANGED
package/dist/readFile.js
CHANGED
package/dist/spawnProcess.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/*
|
|
2
|
-
Copyright 2020-
|
|
2
|
+
Copyright 2020-2022 Lowdefy, Inc
|
|
3
3
|
|
|
4
4
|
Licensed under the Apache License, Version 2.0 (the "License");
|
|
5
5
|
you may not use this file except in compliance with the License.
|
|
@@ -13,29 +13,33 @@
|
|
|
13
13
|
See the License for the specific language governing permissions and
|
|
14
14
|
limitations under the License.
|
|
15
15
|
*/ import { spawn } from 'child_process';
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
data.toString('utf8').split('\n').forEach((line)=>{
|
|
22
|
-
if (line) {
|
|
23
|
-
logger.log(line);
|
|
24
|
-
}
|
|
25
|
-
});
|
|
26
|
-
}
|
|
27
|
-
});
|
|
28
|
-
process.stderr.on('data', (data)=>{
|
|
29
|
-
if (!silent) {
|
|
30
|
-
data.toString('utf8').split('\n').forEach((line)=>{
|
|
31
|
-
if (line) {
|
|
32
|
-
logger.warn(line);
|
|
33
|
-
}
|
|
34
|
-
});
|
|
16
|
+
function createStdIOHandler({ lineHandler }) {
|
|
17
|
+
function handler(data) {
|
|
18
|
+
data.toString('utf8').split('\n').forEach((line)=>{
|
|
19
|
+
if (line) {
|
|
20
|
+
lineHandler(line);
|
|
35
21
|
}
|
|
36
22
|
});
|
|
23
|
+
}
|
|
24
|
+
return handler;
|
|
25
|
+
}
|
|
26
|
+
function spawnProcess({ args , command , processOptions , returnProcess , stdErrLineHandler , stdOutLineHandler =()=>{} , }) {
|
|
27
|
+
if (!stdErrLineHandler) {
|
|
28
|
+
stdErrLineHandler = stdOutLineHandler;
|
|
29
|
+
}
|
|
30
|
+
const process = spawn(command, args, processOptions);
|
|
31
|
+
process.stdout.on('data', createStdIOHandler({
|
|
32
|
+
lineHandler: stdOutLineHandler
|
|
33
|
+
}));
|
|
34
|
+
process.stderr.on('data', createStdIOHandler({
|
|
35
|
+
lineHandler: stdErrLineHandler
|
|
36
|
+
}));
|
|
37
|
+
if (returnProcess) {
|
|
38
|
+
return process;
|
|
39
|
+
}
|
|
40
|
+
return new Promise((resolve, reject)=>{
|
|
37
41
|
process.on('error', (error)=>{
|
|
38
|
-
|
|
42
|
+
stdErrLineHandler(error);
|
|
39
43
|
});
|
|
40
44
|
process.on('exit', (code)=>{
|
|
41
45
|
if (code !== 0) {
|
package/dist/writeFile.js
CHANGED
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@lowdefy/node-utils",
|
|
3
|
-
"version": "4.0.0-
|
|
4
|
-
"
|
|
3
|
+
"version": "4.0.0-rc.0",
|
|
4
|
+
"license": "Apache-2.0",
|
|
5
5
|
"description": "",
|
|
6
6
|
"homepage": "https://lowdefy.com",
|
|
7
7
|
"keywords": [
|
|
@@ -34,24 +34,23 @@
|
|
|
34
34
|
"dist/*"
|
|
35
35
|
],
|
|
36
36
|
"scripts": {
|
|
37
|
-
"build": "
|
|
37
|
+
"build": "swc src --out-dir dist --config-file ../../../.swcrc --delete-dir-on-start",
|
|
38
38
|
"clean": "rm -rf dist",
|
|
39
|
-
"
|
|
40
|
-
"swc": "swc src --out-dir dist --config-file ../../../.swcrc --delete-dir-on-start",
|
|
39
|
+
"prepublishOnly": "pnpm build",
|
|
41
40
|
"test": "jest --coverage"
|
|
42
41
|
},
|
|
43
42
|
"dependencies": {
|
|
44
|
-
"@lowdefy/helpers": "4.0.0-
|
|
45
|
-
"fs-extra": "10.
|
|
43
|
+
"@lowdefy/helpers": "4.0.0-rc.0",
|
|
44
|
+
"fs-extra": "10.1.0"
|
|
46
45
|
},
|
|
47
46
|
"devDependencies": {
|
|
48
|
-
"@swc/cli": "0.1.
|
|
49
|
-
"@swc/core": "1.2.
|
|
50
|
-
"@swc/jest": "0.2.
|
|
51
|
-
"jest": "
|
|
47
|
+
"@swc/cli": "0.1.57",
|
|
48
|
+
"@swc/core": "1.2.194",
|
|
49
|
+
"@swc/jest": "0.2.21",
|
|
50
|
+
"jest": "28.1.0"
|
|
52
51
|
},
|
|
53
52
|
"publishConfig": {
|
|
54
53
|
"access": "public"
|
|
55
54
|
},
|
|
56
|
-
"gitHead": "
|
|
55
|
+
"gitHead": "f6872d7ff6da421710096536fce7b2016ef8f35c"
|
|
57
56
|
}
|