@dbml/cli 6.2.0-alpha.0 → 6.2.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/__tests__/dbml2sql/filename --oracle --out-file/expect-out-files/schema.sql +6 -6
- package/__tests__/dbml2sql/filename --oracle stdout/stdout.txt +6 -6
- package/__tests__/dbml2sql/filenames --oracle --out-file/expect-out-files/schema.sql +15 -15
- package/__tests__/dbml2sql/filenames --oracle stdout/stdout.txt +15 -15
- package/__tests__/dbml2sql/multiple_schema_oracle/expect-out-files/multiple_schema.out.sql +9 -9
- package/eslint.config.ts +13 -6
- package/lib/index.js +1307 -20
- package/package.json +10 -26
- package/src/cli/import.js +5 -1
- package/src/cli/utils.js +1 -1
- package/src/errors/syntaxError.js +2 -2
- package/tsconfig.json +2 -1
- package/vite.config.ts +50 -0
- package/.babelrc +0 -19
- package/jest.config.ts +0 -14
- package/lib/cli/config.js +0 -29
- package/lib/cli/connector.js +0 -38
- package/lib/cli/export.js +0 -37
- package/lib/cli/import.js +0 -36
- package/lib/cli/index.js +0 -76
- package/lib/cli/outputPlugins/outputConsolePlugin.js +0 -12
- package/lib/cli/outputPlugins/outputFilePlugin.js +0 -28
- package/lib/cli/utils.js +0 -81
- package/lib/cli/validatePlugins/validatePlugins.js +0 -14
- package/lib/errors/domainError.js +0 -15
- package/lib/errors/index.js +0 -20
- package/lib/errors/syntaxError.js +0 -23
- package/lib/helpers/logger.js +0 -74
package/lib/helpers/logger.js
DELETED
|
@@ -1,74 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
Object.defineProperty(exports, "__esModule", {
|
|
4
|
-
value: true
|
|
5
|
-
});
|
|
6
|
-
exports.default = void 0;
|
|
7
|
-
var _winston = require("winston");
|
|
8
|
-
var _chalk = _interopRequireDefault(require("chalk"));
|
|
9
|
-
var _path = _interopRequireDefault(require("path"));
|
|
10
|
-
function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
|
|
11
|
-
const {
|
|
12
|
-
combine,
|
|
13
|
-
timestamp,
|
|
14
|
-
printf
|
|
15
|
-
} = _winston.format;
|
|
16
|
-
const consoleFormat = printf(info => {
|
|
17
|
-
const {
|
|
18
|
-
level,
|
|
19
|
-
message
|
|
20
|
-
} = info;
|
|
21
|
-
return ` ${_chalk.default.red(level.toUpperCase())}: ${message}\n
|
|
22
|
-
A complete log can be found in:
|
|
23
|
-
${_path.default.resolve(process.cwd(), 'dbml-error.log')}`;
|
|
24
|
-
});
|
|
25
|
-
const fileFormat = printf(info => {
|
|
26
|
-
const {
|
|
27
|
-
timestamp,
|
|
28
|
-
stack,
|
|
29
|
-
rootError
|
|
30
|
-
} = info;
|
|
31
|
-
let logContent = `${timestamp}\n${stack}\n`;
|
|
32
|
-
if (rootError) {
|
|
33
|
-
logContent += '\nROOT_ERROR:';
|
|
34
|
-
logContent += `\n${rootError.stack}`;
|
|
35
|
-
if (rootError.location) {
|
|
36
|
-
logContent += `\n${JSON.stringify(rootError.location)}`;
|
|
37
|
-
}
|
|
38
|
-
logContent += '\n';
|
|
39
|
-
}
|
|
40
|
-
return logContent;
|
|
41
|
-
});
|
|
42
|
-
const consoleLogger = (0, _winston.createLogger)({
|
|
43
|
-
format: combine(consoleFormat),
|
|
44
|
-
transports: [new _winston.transports.Console({
|
|
45
|
-
level: 'error'
|
|
46
|
-
})]
|
|
47
|
-
});
|
|
48
|
-
const fileLogger = (0, _winston.createLogger)({
|
|
49
|
-
format: combine(timestamp(), fileFormat),
|
|
50
|
-
transports: [new _winston.transports.File({
|
|
51
|
-
filename: 'dbml-error.log',
|
|
52
|
-
level: 'error'
|
|
53
|
-
})]
|
|
54
|
-
});
|
|
55
|
-
const logger = {
|
|
56
|
-
debug(msg) {
|
|
57
|
-
consoleLogger.debug(msg);
|
|
58
|
-
},
|
|
59
|
-
info(msg) {
|
|
60
|
-
consoleLogger.info(msg);
|
|
61
|
-
},
|
|
62
|
-
warn(msg) {
|
|
63
|
-
consoleLogger.warn(msg);
|
|
64
|
-
},
|
|
65
|
-
error(msg) {
|
|
66
|
-
consoleLogger.error(msg);
|
|
67
|
-
fileLogger.error(msg);
|
|
68
|
-
},
|
|
69
|
-
log(level, msg) {
|
|
70
|
-
const lvl = exports[level];
|
|
71
|
-
lvl(msg);
|
|
72
|
-
}
|
|
73
|
-
};
|
|
74
|
-
var _default = exports.default = logger;
|