egg-ts-helper
Advanced tools
Comparing version 1.30.2 to 1.30.3
@@ -11,3 +11,3 @@ #! /usr/bin/env node | ||
const utils_1 = require("./utils"); | ||
const commands = utils_1.loadModules(path_1.default.resolve(__dirname, './cmd'), true); | ||
const commands = (0, utils_1.loadModules)(path_1.default.resolve(__dirname, './cmd'), true); | ||
let executeCmd; | ||
@@ -19,3 +19,3 @@ // override executeSubCommand to support async subcommand. | ||
const command = commands[executeCmd]; | ||
assert_1.default(command, executeCmd + ' does not exist'); | ||
(0, assert_1.default)(command, executeCmd + ' does not exist'); | ||
await command.run(this, { cwd, argv, args: args.filter(item => item !== this), unknown }); | ||
@@ -61,8 +61,8 @@ }; | ||
} | ||
if (utils_1.checkMaybeIsJsProj(tsHelperConfig.cwd)) { | ||
if ((0, utils_1.checkMaybeIsJsProj)(tsHelperConfig.cwd)) { | ||
// write jsconfig if the project is wrote by js | ||
utils_1.writeJsConfig(tsHelperConfig.cwd); | ||
(0, utils_1.writeJsConfig)(tsHelperConfig.cwd); | ||
} | ||
// create instance | ||
const tsHelper = _1.createTsHelperInstance(tsHelperConfig).build(); | ||
const tsHelper = (0, _1.createTsHelperInstance)(tsHelperConfig).build(); | ||
if (program.oneForAll) { | ||
@@ -69,0 +69,0 @@ // create one for all |
@@ -9,5 +9,5 @@ "use strict"; | ||
async run(_, { cwd }) { | ||
utils_1.cleanJs(cwd); | ||
(0, utils_1.cleanJs)(cwd); | ||
} | ||
} | ||
exports.default = new CleanCommand(); |
@@ -23,3 +23,3 @@ "use strict"; | ||
if (!typeList.includes(type)) { | ||
const result = await enquirer_1.prompt({ | ||
const result = await (0, enquirer_1.prompt)({ | ||
type: 'autocomplete', | ||
@@ -64,3 +64,3 @@ name: 'type', | ||
utils.log('create d.ts ...'); | ||
__1.createTsHelperInstance({ cwd }).build(); | ||
(0, __1.createTsHelperInstance)({ cwd }).build(); | ||
utils.log('complete initialization'); | ||
@@ -67,0 +67,0 @@ } |
@@ -8,3 +8,3 @@ "use strict"; | ||
config.interfaceHandle = config.interfaceHandle || 'AutoInstanceType<typeof {{ 0 }}>'; | ||
const result = class_1.default(config, baseConfig); | ||
const result = (0, class_1.default)(config, baseConfig); | ||
/* istanbul ignore else */ | ||
@@ -11,0 +11,0 @@ if (result.content) { |
@@ -7,3 +7,3 @@ "use strict"; | ||
const utils = tslib_1.__importStar(require("../utils")); | ||
const debug = debug_1.default('egg-ts-helper#generators_class'); | ||
const debug = (0, debug_1.default)('egg-ts-helper#generators_class'); | ||
function ClassGenerator(config, baseConfig) { | ||
@@ -10,0 +10,0 @@ const fileList = config.fileList; |
@@ -9,3 +9,3 @@ "use strict"; | ||
const config_1 = require("../config"); | ||
const debug = debug_1.default('egg-ts-helper#generators_extend'); | ||
const debug = (0, debug_1.default)('egg-ts-helper#generators_extend'); | ||
function ExtendGenerator(config, baseConfig) { | ||
@@ -12,0 +12,0 @@ const fileList = config.file ? [config.file] : config.fileList; |
@@ -8,5 +8,5 @@ "use strict"; | ||
config.interfaceHandle = config.interfaceHandle || 'ReturnType<typeof {{ 0 }}>'; | ||
return class_1.default(config, baseConfig); | ||
return (0, class_1.default)(config, baseConfig); | ||
} | ||
exports.default = FunctionGenerator; | ||
FunctionGenerator.defaultConfig = utils.extend({}, class_1.default.defaultConfig); |
@@ -8,5 +8,5 @@ "use strict"; | ||
config.interfaceHandle = config.interfaceHandle || 'typeof {{ 0 }}'; | ||
return class_1.default(config, baseConfig); | ||
return (0, class_1.default)(config, baseConfig); | ||
} | ||
exports.default = ObjectGenerator; | ||
ObjectGenerator.defaultConfig = utils.extend({}, class_1.default.defaultConfig); |
@@ -68,3 +68,3 @@ "use strict"; | ||
caseStyle: 'upper', | ||
enabled: !dot_prop_1.get(opt === null || opt === void 0 ? void 0 : opt.eggInfo, 'config.customLoader.model'), | ||
enabled: !(0, dot_prop_1.get)(opt === null || opt === void 0 ? void 0 : opt.eggInfo, 'config.customLoader.model'), | ||
}; | ||
@@ -330,3 +330,3 @@ // config | ||
const newConfig = {}; | ||
Object.keys(config).forEach(key => dot_prop_1.set(newConfig, key, config[key])); | ||
Object.keys(config).forEach(key => (0, dot_prop_1.set)(newConfig, key, config[key])); | ||
return newConfig; | ||
@@ -357,3 +357,3 @@ } | ||
// check private generator | ||
assert_1.default(!generator.isPrivateGenerator(item.generator), `${item.generator} is a private generator, can not configure in config file`); | ||
(0, assert_1.default)(!generator.isPrivateGenerator(item.generator), `${item.generator} is a private generator, can not configure in config file`); | ||
// compatible for deprecated fields | ||
@@ -360,0 +360,0 @@ [ |
@@ -8,3 +8,3 @@ "use strict"; | ||
const util = tslib_1.__importStar(require("./utils")); | ||
const debug = debug_1.default('egg-ts-helper#register'); | ||
const debug = (0, debug_1.default)('egg-ts-helper#register'); | ||
/* istanbul ignore else */ | ||
@@ -24,3 +24,3 @@ if (cluster_1.default.isMaster) { | ||
const cwd = process.cwd(); | ||
const instance = _1.createTsHelperInstance({ watch }); | ||
const instance = (0, _1.createTsHelperInstance)({ watch }); | ||
if (util.checkMaybeIsJsProj(cwd)) { | ||
@@ -44,3 +44,3 @@ // write jsconfig if the project is wrote by js | ||
// exec building | ||
_1.createTsHelperInstance({ watch }).build(); | ||
(0, _1.createTsHelperInstance)({ watch }).build(); | ||
} |
@@ -83,3 +83,3 @@ "use strict"; | ||
caches.runningPromise = new Promise((resolve, reject) => { | ||
child_process_1.exec(cmd, opt, err => { | ||
(0, child_process_1.exec)(cmd, opt, err => { | ||
caches.runningPromise = null; | ||
@@ -94,3 +94,3 @@ if (err) | ||
try { | ||
child_process_1.execSync(cmd, opt); | ||
(0, child_process_1.execSync)(cmd, opt); | ||
return end(parseJson(fs_1.default.readFileSync(config_1.eggInfoPath, 'utf-8'))); | ||
@@ -109,3 +109,3 @@ } | ||
case 'boolean': | ||
return yn_1.default(val, { default: defaultVal }); | ||
return (0, yn_1.default)(val, { default: defaultVal }); | ||
case 'number': | ||
@@ -112,0 +112,0 @@ const num = +val; |
@@ -11,3 +11,3 @@ "use strict"; | ||
const debug_1 = tslib_1.__importDefault(require("debug")); | ||
const debug = debug_1.default('egg-ts-helper#watcher'); | ||
const debug = (0, debug_1.default)('egg-ts-helper#watcher'); | ||
class Watcher extends events_1.EventEmitter { | ||
@@ -26,3 +26,3 @@ constructor(helper) { | ||
this.ref = options.ref; | ||
const generator = generator_1.loadGenerator(generatorName, { cwd: this.config.cwd }); | ||
const generator = (0, generator_1.loadGenerator)(generatorName, { cwd: this.config.cwd }); | ||
if (utils.isClass(generator)) { | ||
@@ -39,3 +39,3 @@ const instance = new generator(this.config, this.helper); | ||
.concat(utils.toArray(this.options.ignore).map(p => `!${utils.formatPath(p)}`)); | ||
assert_1.default(options.directory, `options.directory must set in ${generatorName}`); | ||
(0, assert_1.default)(options.directory, `options.directory must set in ${generatorName}`); | ||
const baseDir = options.directory.replace(/\/|\\/, path_1.default.sep); | ||
@@ -42,0 +42,0 @@ this.dir = path_1.default.resolve(this.config.cwd, baseDir); |
1.30.3 / 2022-04-24 | ||
================== | ||
**fixes** | ||
* [[`67e667d`](http://github.com/whxaxes/egg-ts-helper/commit/67e667d21b15de4f972db76ca595de20e8136c13)] - fix: startup failed in node18 (#83) (吖猩 <<whxaxes@gmail.com>>) | ||
1.30.2 / 2022-02-16 | ||
@@ -3,0 +9,0 @@ ================== |
{ | ||
"name": "egg-ts-helper", | ||
"version": "1.30.2", | ||
"version": "1.30.3", | ||
"description": "egg typescript helper", | ||
@@ -44,3 +44,3 @@ "bin": { | ||
"enquirer": "^2.3.0", | ||
"globby": "^8.0.2", | ||
"globby": "^11.0.0", | ||
"json5": "^2.2.0", | ||
@@ -72,4 +72,4 @@ "mkdirp": "^0.5.1", | ||
"egg-sequelize": "^4.3.1", | ||
"eslint": "^7.0.0", | ||
"eslint-config-egg": "^9.0.0", | ||
"eslint": "^8.0.0", | ||
"eslint-config-egg": "^11.0.0", | ||
"extend2": "^1.0.0", | ||
@@ -76,0 +76,0 @@ "runscript": "^1.3.0" |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
140483
+ Added@nodelib/fs.scandir@2.1.5(transitive)
+ Added@nodelib/fs.stat@2.0.5(transitive)
+ Added@nodelib/fs.walk@1.2.8(transitive)
+ Addedarray-union@2.1.0(transitive)
+ Addeddir-glob@3.0.1(transitive)
+ Addedfast-glob@3.3.2(transitive)
+ Addedfastq@1.17.1(transitive)
+ Addedglobby@11.1.0(transitive)
+ Addedignore@5.3.2(transitive)
+ Addedmicromatch@4.0.8(transitive)
+ Addedpath-type@4.0.0(transitive)
+ Addedqueue-microtask@1.2.3(transitive)
+ Addedreusify@1.0.4(transitive)
+ Addedrun-parallel@1.2.0(transitive)
+ Addedslash@3.0.0(transitive)
- Removed@mrmlnc/readdir-enhanced@2.2.1(transitive)
- Removed@nodelib/fs.stat@1.1.3(transitive)
- Removedarr-diff@4.0.0(transitive)
- Removedarr-flatten@1.1.0(transitive)
- Removedarr-union@3.1.0(transitive)
- Removedarray-union@1.0.2(transitive)
- Removedarray-uniq@1.0.3(transitive)
- Removedarray-unique@0.3.2(transitive)
- Removedassign-symbols@1.0.0(transitive)
- Removedatob@2.1.2(transitive)
- Removedbalanced-match@1.0.2(transitive)
- Removedbase@0.11.2(transitive)
- Removedbrace-expansion@1.1.11(transitive)
- Removedbraces@2.3.2(transitive)
- Removedcache-base@1.0.1(transitive)
- Removedcall-me-maybe@1.0.2(transitive)
- Removedclass-utils@0.3.6(transitive)
- Removedcollection-visit@1.0.0(transitive)
- Removedcomponent-emitter@1.3.1(transitive)
- Removedconcat-map@0.0.1(transitive)
- Removedcopy-descriptor@0.1.1(transitive)
- Removeddebug@2.6.9(transitive)
- Removeddecode-uri-component@0.2.2(transitive)
- Removeddefine-property@0.2.51.0.02.0.2(transitive)
- Removeddir-glob@2.0.0(transitive)
- Removedexpand-brackets@2.1.4(transitive)
- Removedextend-shallow@2.0.13.0.2(transitive)
- Removedextglob@2.0.4(transitive)
- Removedfast-glob@2.2.7(transitive)
- Removedfill-range@4.0.0(transitive)
- Removedfor-in@1.0.2(transitive)
- Removedfragment-cache@0.2.1(transitive)
- Removedfs.realpath@1.0.0(transitive)
- Removedfunction-bind@1.1.2(transitive)
- Removedget-value@2.0.6(transitive)
- Removedglob@7.2.3(transitive)
- Removedglob-parent@3.1.0(transitive)
- Removedglob-to-regexp@0.3.0(transitive)
- Removedglobby@8.0.2(transitive)
- Removedhas-value@0.3.11.0.0(transitive)
- Removedhas-values@0.1.41.0.0(transitive)
- Removedhasown@2.0.2(transitive)
- Removedignore@3.3.10(transitive)
- Removedinflight@1.0.6(transitive)
- Removedinherits@2.0.4(transitive)
- Removedis-accessor-descriptor@1.0.1(transitive)
- Removedis-buffer@1.1.6(transitive)
- Removedis-data-descriptor@1.0.1(transitive)
- Removedis-descriptor@0.1.71.0.3(transitive)
- Removedis-extendable@0.1.11.0.1(transitive)
- Removedis-glob@3.1.0(transitive)
- Removedis-number@3.0.0(transitive)
- Removedis-plain-object@2.0.4(transitive)
- Removedis-windows@1.0.2(transitive)
- Removedisarray@1.0.0(transitive)
- Removedisobject@2.1.03.0.1(transitive)
- Removedkind-of@3.2.24.0.06.0.3(transitive)
- Removedmap-cache@0.2.2(transitive)
- Removedmap-visit@1.0.0(transitive)
- Removedmicromatch@3.1.10(transitive)
- Removedminimatch@3.1.2(transitive)
- Removedmixin-deep@1.3.2(transitive)
- Removedms@2.0.0(transitive)
- Removednanomatch@1.2.13(transitive)
- Removedobject-copy@0.1.0(transitive)
- Removedobject-visit@1.0.1(transitive)
- Removedobject.pick@1.3.0(transitive)
- Removedonce@1.4.0(transitive)
- Removedpascalcase@0.1.1(transitive)
- Removedpath-dirname@1.0.2(transitive)
- Removedpath-is-absolute@1.0.1(transitive)
- Removedpath-type@3.0.0(transitive)
- Removedpify@3.0.0(transitive)
- Removedposix-character-classes@0.1.1(transitive)
- Removedregex-not@1.0.2(transitive)
- Removedrepeat-element@1.1.4(transitive)
- Removedrepeat-string@1.6.1(transitive)
- Removedresolve-url@0.2.1(transitive)
- Removedret@0.1.15(transitive)
- Removedsafe-regex@1.1.0(transitive)
- Removedset-value@2.0.1(transitive)
- Removedslash@1.0.0(transitive)
- Removedsnapdragon@0.8.2(transitive)
- Removedsnapdragon-node@2.1.1(transitive)
- Removedsnapdragon-util@3.0.1(transitive)
- Removedsource-map@0.5.7(transitive)
- Removedsource-map-resolve@0.5.3(transitive)
- Removedsource-map-url@0.4.1(transitive)
- Removedsplit-string@3.1.0(transitive)
- Removedstatic-extend@0.1.2(transitive)
- Removedto-object-path@0.3.0(transitive)
- Removedto-regex@3.0.2(transitive)
- Removedto-regex-range@2.1.1(transitive)
- Removedunion-value@1.0.1(transitive)
- Removedunset-value@1.0.0(transitive)
- Removedurix@0.1.0(transitive)
- Removeduse@3.1.1(transitive)
- Removedwrappy@1.0.2(transitive)
Updatedglobby@^11.0.0