pwi-plata-type 0.4.4 → 0.4.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.
- package/__BUILD__/bin/plata-runtime.js +12 -65
- package/__BUILD__/bin/plata-runtime.js.map +1 -1
- package/__BUILD__/scripts/post-install/api.js +1 -1
- package/__BUILD__/scripts/post-install/api.js.map +1 -1
- package/package.json +1 -1
- package/src/bin/plata-runtime.ts +16 -78
- package/src/scripts/post-install/api.ts +1 -1
|
@@ -6,13 +6,11 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
6
6
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
7
7
|
exports.compile = void 0;
|
|
8
8
|
const node_path_1 = __importDefault(require("node:path"));
|
|
9
|
-
const node_fs_1 = __importDefault(require("node:fs"));
|
|
10
9
|
const node_assert_1 = require("node:assert");
|
|
11
|
-
const node_readline_1 = __importDefault(require("node:readline"));
|
|
12
10
|
const node_cluster_1 = __importDefault(require("node:cluster"));
|
|
13
11
|
const tsc_prog_1 = require("tsc-prog");
|
|
14
|
-
const glob_1 = __importDefault(require("glob"));
|
|
15
12
|
const _setupRuntime_1 = require("./runtime/_setupRuntime");
|
|
13
|
+
const fs_1 = require("../libs/fs");
|
|
16
14
|
function compile() {
|
|
17
15
|
if (!node_cluster_1.default.isPrimary)
|
|
18
16
|
return;
|
|
@@ -29,7 +27,9 @@ function compile() {
|
|
|
29
27
|
exclude: [
|
|
30
28
|
'./__BUILD__',
|
|
31
29
|
'./node_modules',
|
|
32
|
-
'./.vscode'
|
|
30
|
+
'./.vscode',
|
|
31
|
+
'./.git',
|
|
32
|
+
'.gitignore'
|
|
33
33
|
],
|
|
34
34
|
copyOtherToOutDir: true,
|
|
35
35
|
clean: {
|
|
@@ -40,70 +40,17 @@ function compile() {
|
|
|
40
40
|
});
|
|
41
41
|
}
|
|
42
42
|
exports.compile = compile;
|
|
43
|
+
const shouldCompile = async () => {
|
|
44
|
+
if (process.argv.findIndex(p => p === '--skip-recompile') !== -1)
|
|
45
|
+
return Plata.files.access(node_path_1.default.join(Plata.ProjectDir, '__BUILD__')).then(r => !r);
|
|
46
|
+
return true;
|
|
47
|
+
};
|
|
43
48
|
const main = async () => {
|
|
44
49
|
const g = global;
|
|
45
50
|
g.Plata = await (0, _setupRuntime_1.loadRuntimeLibs)();
|
|
46
|
-
g.Plata.files =
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
try {
|
|
50
|
-
const content = [];
|
|
51
|
-
const stream = node_readline_1.default.createInterface({
|
|
52
|
-
input: node_fs_1.default.createReadStream(file),
|
|
53
|
-
crlfDelay: Infinity
|
|
54
|
-
});
|
|
55
|
-
stream.on('close', () => {
|
|
56
|
-
resolve(content.join('\n'));
|
|
57
|
-
});
|
|
58
|
-
stream.on('line', (line) => {
|
|
59
|
-
content.push(callback(line));
|
|
60
|
-
});
|
|
61
|
-
}
|
|
62
|
-
catch (e) {
|
|
63
|
-
resolve({
|
|
64
|
-
errorID: 'PLTRF0004',
|
|
65
|
-
msg: `Error while reading file: ${file}`,
|
|
66
|
-
error: e
|
|
67
|
-
});
|
|
68
|
-
}
|
|
69
|
-
});
|
|
70
|
-
};
|
|
71
|
-
g.Plata.files.ReadFileAsync = async (file, callback) => {
|
|
72
|
-
return new Promise(resolve => {
|
|
73
|
-
try {
|
|
74
|
-
const promises = [];
|
|
75
|
-
const stream = node_readline_1.default.createInterface({
|
|
76
|
-
input: node_fs_1.default.createReadStream(file),
|
|
77
|
-
crlfDelay: Infinity
|
|
78
|
-
});
|
|
79
|
-
stream.on('close', () => {
|
|
80
|
-
Promise.all(promises).then(() => resolve(null), e => resolve({
|
|
81
|
-
errorID: 'PPFRFA0002',
|
|
82
|
-
msg: `Unexpected error while reading file: ${file}`,
|
|
83
|
-
error: e
|
|
84
|
-
}));
|
|
85
|
-
});
|
|
86
|
-
stream.on('line', line => {
|
|
87
|
-
promises.push(Plata.FastPromise(() => callback(line)));
|
|
88
|
-
});
|
|
89
|
-
}
|
|
90
|
-
catch (e) {
|
|
91
|
-
return resolve({
|
|
92
|
-
errorID: 'PPFRFA0001',
|
|
93
|
-
msg: `Unexpected error while reading file: ${file}`,
|
|
94
|
-
error: e
|
|
95
|
-
});
|
|
96
|
-
}
|
|
97
|
-
});
|
|
98
|
-
};
|
|
99
|
-
g.Plata.files.FindFiles = async (folders, file) => {
|
|
100
|
-
const files = [];
|
|
101
|
-
for (const folder of folders) {
|
|
102
|
-
files.push(...glob_1.default.sync(`${folder.replace(/\\/g, '/')}/**/${file}`));
|
|
103
|
-
}
|
|
104
|
-
return files;
|
|
105
|
-
};
|
|
106
|
-
compile();
|
|
51
|
+
g.Plata.files = fs_1.PlataFs;
|
|
52
|
+
if (await shouldCompile())
|
|
53
|
+
compile();
|
|
107
54
|
module.constructor.prototype.require = function (pathRequire) {
|
|
108
55
|
const self = this;
|
|
109
56
|
(0, node_assert_1.ok)(typeof pathRequire === 'string', 'path must be a string');
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"plata-runtime.js","sourceRoot":"","sources":["../../src/bin/plata-runtime.ts"],"names":[],"mappings":";;;;;;;AAEA,0DAA4B;AAC5B,
|
|
1
|
+
{"version":3,"file":"plata-runtime.js","sourceRoot":"","sources":["../../src/bin/plata-runtime.ts"],"names":[],"mappings":";;;;;;;AAEA,0DAA4B;AAC5B,6CAAgC;AAChC,gEAAkC;AAClC,uCAAgC;AAChC,2DAAyD;AACzD,mCAAoC;AAEpC,SAAgB,OAAO;IACnB,IAAI,CAAC,sBAAO,CAAC,SAAS;QAAE,OAAM;IAE9B,IAAA,gBAAK,EAAC;QACF,QAAQ,EAAE,KAAK,CAAC,UAAU;QAC1B,cAAc,EAAE,eAAe;QAC/B,eAAe,EAAE;YACb,OAAO,EAAE,IAAI;YACb,OAAO,EAAE,GAAG;SACf;QACD,OAAO,EAAE;YACL,QAAQ;SACX;QACD,OAAO,EAAE;YACL,aAAa;YACb,gBAAgB;YAChB,WAAW;YACX,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EAAE;QACvB,CAAC,CAAC,KAAK,CAAC,MAAM,CAAC,GAAG,CAAC,GAAG,OAAO,CAAC,GAAG,CAAC,CAAA;KACrC;IAGD,MAAM,GAAG,GAAG,OAAO,CAAC,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,OAAO,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC,CAAA;IAEvD,MAAM,GAAG,GAAkC,OAAO,CAAC,UAAU,GAAG,EAAE,CAAC,CAAA;IAEnE,MAAM,GAAG,CAAC,IAAI,EAAE,CAAA;AAEpB,CAAC,CAAA;AAED,IAAI,EAAE,CAAA"}
|
|
@@ -15,7 +15,7 @@ async function install(tools, projectPackageJson) {
|
|
|
15
15
|
promises.push(tools.copyFileToDest('Dockerfile'));
|
|
16
16
|
promises.push(tools.copyFileToDest('tsconfig.json'));
|
|
17
17
|
projectPackageJson.scripts.start = 'plata-runtime + plata-api';
|
|
18
|
-
projectPackageJson.scripts.create = 'plata-runtime + plata-create';
|
|
18
|
+
projectPackageJson.scripts.create = 'plata-runtime --skip-recompile + plata-create';
|
|
19
19
|
projectPackageJson.scripts['gen:swagger'] = 'plata-runtime + plata-swagger';
|
|
20
20
|
projectPackageJson.main = undefined;
|
|
21
21
|
await Promise.all(promises);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"api.js","sourceRoot":"","sources":["../../../src/scripts/post-install/api.ts"],"names":[],"mappings":";;;AAEO,KAAK,UAAU,OAAO,CAAC,KAAuB,EAAE,kBAAuB;IAC1E,MAAM,QAAQ,GAAoB,EAAE,CAAA;IAEpC,QAAQ,CAAC,IAAI,CAAC,KAAK,CAAC,kBAAkB,CAAC,UAAU,CAAC,CAAC,CAAA;IACnD,QAAQ,CAAC,IAAI,CAAC,KAAK,CAAC,kBAAkB,CAAC,QAAQ,CAAC,CAAC,CAAA;IACjD,QAAQ,CAAC,IAAI,CAAC,KAAK,CAAC,kBAAkB,CAAC,MAAM,CAAC,CAAC,CAAA;IAC/C,QAAQ,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Q,CAAC,CAAC,CAAA;IACjD,QAAQ,CAAC,IAAI,CAAC,KAAK,CAAC,kBAAkB,CAAC,OAAO,CAAC,CAAC,CAAA;IAChD,QAAQ,CAAC,IAAI,CAAC,KAAK,CAAC,kBAAkB,CAAC,QAAQ,CAAC,CAAC,CAAA;IAEjD,QAAQ,CAAC,IAAI,CAAC,KAAK,CAAC,gBAAgB,CAAC,SAAS,CAAC,CAAC,CAAA;IAChD,QAAQ,CAAC,IAAI,CAAC,KAAK,CAAC,gBAAgB,CAAC,MAAM,CAAC,CAAC,CAAA;IAC7C,QAAQ,CAAC,IAAI,CAAC,KAAK,CAAC,UAAU,CAAC,SAAS,CAAC,CAAC,CAAA;IAE1C,QAAQ,CAAC,IAAI,CAAC,KAAK,CAAC,cAAc,CAAC,YAAY,CAAC,CAAC,CAAA;IACjD,QAAQ,CAAC,IAAI,CAAC,KAAK,CAAC,cAAc,CAAC,eAAe,CAAC,CAAC,CAAA;IAEpD,kBAAkB,CAAC,OAAO,CAAC,KAAK,GAAG,2BAA2B,CAAA;IAC9D,kBAAkB,CAAC,OAAO,CAAC,MAAM,GAAG,+CAA+C,CAAA;IAGnF,kBAAkB,CAAC,OAAO,CAAC,aAAa,CAAC,GAAG,+BAA+B,CAAA;IAE3E,kBAAkB,CAAC,IAAI,GAAG,SAAS,CAAA;IAEnC,MAAM,OAAO,CAAC,GAAG,CAAC,QAAQ,CAAC,CAAA;IAE3B,OAAO,kBAAkB,CAAA;AAE7B,CAAC;AA7BD,0BA6BC"}
|
package/package.json
CHANGED
package/src/bin/plata-runtime.ts
CHANGED
|
@@ -1,13 +1,11 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
|
|
3
3
|
import path from 'node:path'
|
|
4
|
-
import fs from 'node:fs'
|
|
5
4
|
import { ok } from 'node:assert'
|
|
6
|
-
import readline from 'node:readline'
|
|
7
5
|
import cluster from 'node:cluster'
|
|
8
6
|
import { build } from 'tsc-prog'
|
|
9
|
-
import glob from 'glob'
|
|
10
7
|
import { loadRuntimeLibs } from './runtime/_setupRuntime'
|
|
8
|
+
import { PlataFs } from '../libs/fs'
|
|
11
9
|
|
|
12
10
|
export function compile() {
|
|
13
11
|
if (!cluster.isPrimary) return
|
|
@@ -25,7 +23,9 @@ export function compile() {
|
|
|
25
23
|
exclude: [
|
|
26
24
|
'./__BUILD__',
|
|
27
25
|
'./node_modules',
|
|
28
|
-
'./.vscode'
|
|
26
|
+
'./.vscode',
|
|
27
|
+
'./.git',
|
|
28
|
+
'.gitignore'
|
|
29
29
|
],
|
|
30
30
|
copyOtherToOutDir: true,
|
|
31
31
|
clean: {
|
|
@@ -36,86 +36,24 @@ export function compile() {
|
|
|
36
36
|
})
|
|
37
37
|
}
|
|
38
38
|
|
|
39
|
+
const shouldCompile = async () => { // TODO Colocar a compilição e essa função em um arquivo separado
|
|
40
|
+
if (process.argv.findIndex(p => p === '--skip-recompile') !== -1)
|
|
41
|
+
return Plata.files.access(path.join(Plata.ProjectDir, '__BUILD__')).then(r => !r)
|
|
42
|
+
;
|
|
43
|
+
|
|
44
|
+
return true
|
|
45
|
+
}
|
|
46
|
+
|
|
39
47
|
const main = async () => {
|
|
40
48
|
const g = global as any
|
|
41
49
|
|
|
42
50
|
g.Plata = await loadRuntimeLibs()
|
|
43
51
|
|
|
44
|
-
g.Plata.files =
|
|
45
|
-
|
|
46
|
-
g.Plata.files.ReadFileSync = (file: string, callback: (line: string) => string): PlataPromise<string> => {
|
|
47
|
-
return new Promise(resolve => {
|
|
48
|
-
try {
|
|
49
|
-
const content: string[] = []
|
|
50
|
-
const stream = readline.createInterface({
|
|
51
|
-
input: fs.createReadStream(file),
|
|
52
|
-
crlfDelay: Infinity
|
|
53
|
-
})
|
|
54
|
-
|
|
55
|
-
stream.on('close', () => {
|
|
56
|
-
resolve(content.join('\n'))
|
|
57
|
-
})
|
|
58
|
-
|
|
59
|
-
stream.on('line', (line) => {
|
|
60
|
-
content.push(callback(line))
|
|
61
|
-
})
|
|
62
|
-
|
|
63
|
-
} catch(e) {
|
|
64
|
-
resolve({
|
|
65
|
-
errorID: 'PLTRF0004',
|
|
66
|
-
msg: `Error while reading file: ${file}`,
|
|
67
|
-
error: e
|
|
68
|
-
})
|
|
69
|
-
}
|
|
70
|
-
})
|
|
71
|
-
}
|
|
72
|
-
|
|
73
|
-
g.Plata.files.ReadFileAsync = async (file: string, callback: (line: string) => Promise<void>): Promise<MaybePlataError> => {
|
|
74
|
-
return new Promise(resolve => {
|
|
75
|
-
try {
|
|
76
|
-
const promises: any = []
|
|
77
|
-
|
|
78
|
-
const stream = readline.createInterface({
|
|
79
|
-
input: fs.createReadStream(file),
|
|
80
|
-
crlfDelay: Infinity
|
|
81
|
-
})
|
|
82
|
-
|
|
83
|
-
stream.on('close', () => {
|
|
84
|
-
Promise.all(promises).then(
|
|
85
|
-
() => resolve(null),
|
|
86
|
-
e => resolve({
|
|
87
|
-
errorID: 'PPFRFA0002',
|
|
88
|
-
msg: `Unexpected error while reading file: ${file}`,
|
|
89
|
-
error: e
|
|
90
|
-
}),
|
|
91
|
-
)
|
|
92
|
-
})
|
|
93
|
-
|
|
94
|
-
stream.on('line', line => {
|
|
95
|
-
promises.push(Plata.FastPromise(() => callback(line)))
|
|
96
|
-
})
|
|
97
|
-
|
|
98
|
-
} catch (e) {
|
|
99
|
-
return resolve({
|
|
100
|
-
errorID: 'PPFRFA0001',
|
|
101
|
-
msg: `Unexpected error while reading file: ${file}`,
|
|
102
|
-
error: e
|
|
103
|
-
})
|
|
104
|
-
}
|
|
105
|
-
})
|
|
106
|
-
}
|
|
107
|
-
|
|
108
|
-
g.Plata.files.FindFiles = async (folders: string[], file: string): Promise<string[]> => {
|
|
109
|
-
const files: string[] = []
|
|
110
|
-
|
|
111
|
-
for (const folder of folders) {
|
|
112
|
-
files.push(...glob.sync(`${folder.replace(/\\/g, '/')}/**/${file}`))
|
|
113
|
-
}
|
|
114
|
-
|
|
115
|
-
return files
|
|
116
|
-
}
|
|
52
|
+
g.Plata.files = PlataFs
|
|
117
53
|
|
|
118
|
-
|
|
54
|
+
if (await shouldCompile())
|
|
55
|
+
compile()
|
|
56
|
+
;
|
|
119
57
|
|
|
120
58
|
module.constructor.prototype.require = function (pathRequire) {
|
|
121
59
|
const self = this;
|
|
@@ -18,7 +18,7 @@ export async function install(tools: PlataFs.CliTools, projectPackageJson: any)
|
|
|
18
18
|
promises.push(tools.copyFileToDest('tsconfig.json'))
|
|
19
19
|
|
|
20
20
|
projectPackageJson.scripts.start = 'plata-runtime + plata-api'
|
|
21
|
-
projectPackageJson.scripts.create = 'plata-runtime + plata-create'
|
|
21
|
+
projectPackageJson.scripts.create = 'plata-runtime --skip-recompile + plata-create'
|
|
22
22
|
//projectPackageJson.scripts.dev = "npx nodemon -e '.js,.mjs,.json,.ts' --exec npm run debug"
|
|
23
23
|
//projectPackageJson.scripts.debug = 'tsc --sourceMap=true -p . && plata'
|
|
24
24
|
projectPackageJson.scripts['gen:swagger'] = 'plata-runtime + plata-swagger'
|