@agility-luhn/cli 1.5.1 → 1.5.3
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/CHANGELOG.md +4 -0
- package/dist/commands/db.d.ts.map +1 -1
- package/dist/commands/db.js +12 -13
- package/dist/commands/db.js.map +1 -1
- package/dist/commands/serve.d.ts.map +1 -1
- package/dist/commands/serve.js +19 -20
- package/dist/commands/serve.js.map +1 -1
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,3 +1,7 @@
|
|
|
1
|
+
## [1.5.3](https://github.com/flaviorafaelo-agility/luhn-workspace/compare/cli-v1.5.2...cli-v1.5.3) (2026-07-08)
|
|
2
|
+
|
|
3
|
+
## [1.5.2](https://github.com/flaviorafaelo-agility/luhn-workspace/compare/cli-v1.5.1...cli-v1.5.2) (2026-07-08)
|
|
4
|
+
|
|
1
5
|
## [1.5.1](https://github.com/flaviorafaelo-agility/luhn-workspace/compare/cli-v1.5.0...cli-v1.5.1) (2026-07-08)
|
|
2
6
|
|
|
3
7
|
## [1.5.0](https://github.com/flaviorafaelo-agility/luhn-workspace/compare/cli-v1.4.0...cli-v1.5.0) (2026-07-08)
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"db.d.ts","sourceRoot":"","sources":["../../src/commands/db.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;
|
|
1
|
+
{"version":3,"file":"db.d.ts","sourceRoot":"","sources":["../../src/commands/db.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAIpC,wBAAgB,SAAS,IAAI,OAAO,CAuBnC"}
|
package/dist/commands/db.js
CHANGED
|
@@ -5,6 +5,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
5
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
6
|
exports.dbCommand = dbCommand;
|
|
7
7
|
const commander_1 = require("commander");
|
|
8
|
+
const child_process_1 = require("child_process");
|
|
8
9
|
const path_1 = __importDefault(require("path"));
|
|
9
10
|
function dbCommand() {
|
|
10
11
|
return new commander_1.Command('db')
|
|
@@ -13,19 +14,17 @@ function dbCommand() {
|
|
|
13
14
|
.allowExcessArguments()
|
|
14
15
|
.passThroughOptions()
|
|
15
16
|
.action(async (_options, cmd) => {
|
|
16
|
-
const
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
defaultDriver: 'postgres',
|
|
28
|
-
defaultAdapterPackage: '@agility-luhn/database-postgres'
|
|
17
|
+
const binPath = path_1.default.join(process.cwd(), 'node_modules', '.bin', 'luhn-db');
|
|
18
|
+
await new Promise((resolve, reject) => {
|
|
19
|
+
const child = (0, child_process_1.spawn)(binPath, ['--root', process.cwd(), ...cmd.args], {
|
|
20
|
+
stdio: 'inherit',
|
|
21
|
+
shell: true
|
|
22
|
+
});
|
|
23
|
+
child.on('error', () => reject(new Error('Binario luhn-db nao encontrado. Execute pnpm install no diretorio do projeto.')));
|
|
24
|
+
child.on('close', code => {
|
|
25
|
+
process.exitCode = code ?? 0;
|
|
26
|
+
resolve();
|
|
27
|
+
});
|
|
29
28
|
});
|
|
30
29
|
});
|
|
31
30
|
}
|
package/dist/commands/db.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"db.js","sourceRoot":"","sources":["../../src/commands/db.ts"],"names":[],"mappings":";;;;;
|
|
1
|
+
{"version":3,"file":"db.js","sourceRoot":"","sources":["../../src/commands/db.ts"],"names":[],"mappings":";;;;;AAIA,8BAuBC;AA3BD,yCAAoC;AACpC,iDAAsC;AACtC,gDAAwB;AAExB,SAAgB,SAAS;IACvB,OAAO,IAAI,mBAAO,CAAC,IAAI,CAAC;SACrB,WAAW,CAAC,0EAA0E,CAAC;SACvF,kBAAkB,EAAE;SACpB,oBAAoB,EAAE;SACtB,kBAAkB,EAAE;SACpB,MAAM,CAAC,KAAK,EAAE,QAAQ,EAAE,GAAY,EAAE,EAAE;QACvC,MAAM,OAAO,GAAG,cAAI,CAAC,IAAI,CAAC,OAAO,CAAC,GAAG,EAAE,EAAE,cAAc,EAAE,MAAM,EAAE,SAAS,CAAC,CAAC;QAE5E,MAAM,IAAI,OAAO,CAAO,CAAC,OAAO,EAAE,MAAM,EAAE,EAAE;YAC1C,MAAM,KAAK,GAAG,IAAA,qBAAK,EAAC,OAAO,EAAE,CAAC,QAAQ,EAAE,OAAO,CAAC,GAAG,EAAE,EAAE,GAAG,GAAG,CAAC,IAAI,CAAC,EAAE;gBACnE,KAAK,EAAE,SAAS;gBAChB,KAAK,EAAE,IAAI;aACZ,CAAC,CAAC;YACH,KAAK,CAAC,EAAE,CAAC,OAAO,EAAE,GAAG,EAAE,CAAC,MAAM,CAAC,IAAI,KAAK,CACtC,+EAA+E,CAChF,CAAC,CAAC,CAAC;YACJ,KAAK,CAAC,EAAE,CAAC,OAAO,EAAE,IAAI,CAAC,EAAE;gBACvB,OAAO,CAAC,QAAQ,GAAG,IAAI,IAAI,CAAC,CAAC;gBAC7B,OAAO,EAAE,CAAC;YACZ,CAAC,CAAC,CAAC;QACL,CAAC,CAAC,CAAC;IACL,CAAC,CAAC,CAAC;AACP,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"serve.d.ts","sourceRoot":"","sources":["../../src/commands/serve.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;
|
|
1
|
+
{"version":3,"file":"serve.d.ts","sourceRoot":"","sources":["../../src/commands/serve.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAIpC,wBAAgB,YAAY,IAAI,OAAO,CA8BtC"}
|
package/dist/commands/serve.js
CHANGED
|
@@ -5,6 +5,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
5
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
6
|
exports.serveCommand = serveCommand;
|
|
7
7
|
const commander_1 = require("commander");
|
|
8
|
+
const child_process_1 = require("child_process");
|
|
8
9
|
const path_1 = __importDefault(require("path"));
|
|
9
10
|
function serveCommand() {
|
|
10
11
|
return new commander_1.Command('serve')
|
|
@@ -12,27 +13,25 @@ function serveCommand() {
|
|
|
12
13
|
.option('-p, --port <port>', 'Porta do servidor', process.env['PORT'] ?? '3333')
|
|
13
14
|
.option('--luhn-dir <dir>', 'Diretorio com arquivos .luhn', './luhn')
|
|
14
15
|
.action(async (options) => {
|
|
15
|
-
const
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
catch {
|
|
22
|
-
throw new Error('Pacote @agility-luhn/runtime nao encontrado. Execute pnpm install no diretorio do projeto.');
|
|
23
|
-
}
|
|
24
|
-
const port = Number(options.port) || 3333;
|
|
25
|
-
const luhnDir = path_1.default.resolve(process.cwd(), options.luhnDir);
|
|
26
|
-
const server = await createLuhnServer({ luhnDir });
|
|
27
|
-
await server.listen(port);
|
|
28
|
-
console.log(`Servidor LUHN ativo em http://localhost:${port}`);
|
|
29
|
-
console.log('Health check: GET /health');
|
|
30
|
-
const shutdown = async () => {
|
|
31
|
-
await server.close();
|
|
32
|
-
process.exit(0);
|
|
16
|
+
const serverFile = path_1.default.join(process.cwd(), 'src', 'server.ts');
|
|
17
|
+
const tsxBin = path_1.default.join(process.cwd(), 'node_modules', '.bin', 'tsx');
|
|
18
|
+
const env = {
|
|
19
|
+
...process.env,
|
|
20
|
+
PORT: options.port,
|
|
21
|
+
LUHN_DIR: path_1.default.resolve(process.cwd(), options.luhnDir)
|
|
33
22
|
};
|
|
34
|
-
|
|
35
|
-
|
|
23
|
+
await new Promise((resolve, reject) => {
|
|
24
|
+
const child = (0, child_process_1.spawn)(tsxBin, [serverFile], {
|
|
25
|
+
stdio: 'inherit',
|
|
26
|
+
shell: true,
|
|
27
|
+
env
|
|
28
|
+
});
|
|
29
|
+
child.on('error', () => reject(new Error('tsx nao encontrado. Execute pnpm install no diretorio do projeto.')));
|
|
30
|
+
child.on('close', code => {
|
|
31
|
+
process.exitCode = code ?? 0;
|
|
32
|
+
resolve();
|
|
33
|
+
});
|
|
34
|
+
});
|
|
36
35
|
});
|
|
37
36
|
}
|
|
38
37
|
//# sourceMappingURL=serve.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"serve.js","sourceRoot":"","sources":["../../src/commands/serve.ts"],"names":[],"mappings":";;;;;
|
|
1
|
+
{"version":3,"file":"serve.js","sourceRoot":"","sources":["../../src/commands/serve.ts"],"names":[],"mappings":";;;;;AAIA,oCA8BC;AAlCD,yCAAoC;AACpC,iDAAsC;AACtC,gDAAwB;AAExB,SAAgB,YAAY;IAC1B,OAAO,IAAI,mBAAO,CAAC,OAAO,CAAC;SACxB,WAAW,CAAC,2CAA2C,CAAC;SACxD,MAAM,CAAC,mBAAmB,EAAE,mBAAmB,EAAE,OAAO,CAAC,GAAG,CAAC,MAAM,CAAC,IAAI,MAAM,CAAC;SAC/E,MAAM,CAAC,kBAAkB,EAAE,8BAA8B,EAAE,QAAQ,CAAC;SACpE,MAAM,CAAC,KAAK,EAAE,OAA0C,EAAE,EAAE;QAC3D,MAAM,UAAU,GAAG,cAAI,CAAC,IAAI,CAAC,OAAO,CAAC,GAAG,EAAE,EAAE,KAAK,EAAE,WAAW,CAAC,CAAC;QAChE,MAAM,MAAM,GAAG,cAAI,CAAC,IAAI,CAAC,OAAO,CAAC,GAAG,EAAE,EAAE,cAAc,EAAE,MAAM,EAAE,KAAK,CAAC,CAAC;QAEvE,MAAM,GAAG,GAAG;YACV,GAAG,OAAO,CAAC,GAAG;YACd,IAAI,EAAE,OAAO,CAAC,IAAI;YAClB,QAAQ,EAAE,cAAI,CAAC,OAAO,CAAC,OAAO,CAAC,GAAG,EAAE,EAAE,OAAO,CAAC,OAAO,CAAC;SACvD,CAAC;QAEF,MAAM,IAAI,OAAO,CAAO,CAAC,OAAO,EAAE,MAAM,EAAE,EAAE;YAC1C,MAAM,KAAK,GAAG,IAAA,qBAAK,EAAC,MAAM,EAAE,CAAC,UAAU,CAAC,EAAE;gBACxC,KAAK,EAAE,SAAS;gBAChB,KAAK,EAAE,IAAI;gBACX,GAAG;aACJ,CAAC,CAAC;YACH,KAAK,CAAC,EAAE,CAAC,OAAO,EAAE,GAAG,EAAE,CAAC,MAAM,CAAC,IAAI,KAAK,CACtC,mEAAmE,CACpE,CAAC,CAAC,CAAC;YACJ,KAAK,CAAC,EAAE,CAAC,OAAO,EAAE,IAAI,CAAC,EAAE;gBACvB,OAAO,CAAC,QAAQ,GAAG,IAAI,IAAI,CAAC,CAAC;gBAC7B,OAAO,EAAE,CAAC;YACZ,CAAC,CAAC,CAAC;QACL,CAAC,CAAC,CAAC;IACL,CAAC,CAAC,CAAC;AACP,CAAC"}
|