Socket
Socket
Sign inDemoInstall

egg-ts-helper

Package Overview
Dependencies
Maintainers
1
Versions
101
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

egg-ts-helper - npm Package Compare versions

Comparing version 1.30.2 to 1.30.3

10

dist/bin.js

@@ -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"

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc