Skip to content

Commit

Permalink
fix: remove ts args checking (#73)
Browse files Browse the repository at this point in the history
* feat: optimize tsnode mode

* fix: ci

* feat: update nodejs version
  • Loading branch information
whxaxes committed Apr 23, 2021
1 parent 356b464 commit e0f067e
Show file tree
Hide file tree
Showing 5 changed files with 9 additions and 13 deletions.
2 changes: 1 addition & 1 deletion .appveyor.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
environment:
matrix:
- nodejs_version: '8'
- nodejs_version: '12'

install:
- ps: Install-Product node $env:nodejs_version
Expand Down
4 changes: 2 additions & 2 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
sudo: false
language: node_js
node_js:
- '8'
- '10'
- '12'
- '14'
before_install:
- npm i npminstall -g
install:
Expand Down
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -43,8 +43,8 @@
"globby": "^8.0.1",
"mkdirp": "^0.5.1",
"ts-node": "^7.0.0",
"tslib": "^1.9.3",
"typescript": "^3.0.0",
"tslib": "^2.0.0",
"typescript": "^4.0.0",
"yn": "^3.0.0"
},
"publishConfig": {
Expand Down
6 changes: 1 addition & 5 deletions src/register.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
import cluster from 'cluster';
import d from 'debug';
import { get as deepGet } from 'dot-prop';
import { createTsHelperInstance } from './';
import * as util from './utils';
const debug = d('egg-ts-helper#register');
Expand All @@ -25,10 +24,7 @@ function register(watch: boolean) {
// write jsconfig if the project is wrote by js
util.writeJsConfig(cwd);
} else {
const tsNodeMode = deepGet(util.getPkgInfo(cwd), 'egg.typescript') ||
process.argv.includes('--ts') ||
process.argv.includes('--typescript') ||
process.env.EGG_TYPESCRIPT === 'true';
const tsNodeMode = process.env.EGG_TYPESCRIPT === 'true';

// no need to clean in js project
// clean local js file at first.
Expand Down
6 changes: 3 additions & 3 deletions src/watcher.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,9 @@ const generators = utils.loadModules(
);

export interface BaseWatchItem {
ref: string;
ref?: string;
directory: string;
generator: string;
generator?: string;
enabled?: boolean;
ignore?: string | string[];
trigger?: Array<'add' | 'unlink' | 'change'>;
Expand Down Expand Up @@ -62,7 +62,7 @@ export default class Watcher extends EventEmitter {
const generatorName = options.generator || 'class';
this.config = this.helper.config;
this.name = options.name;
this.ref = options.ref;
this.ref = options.ref!;
this.generator = this.getGenerator(generatorName);
options = this.options = {
trigger: [ 'add', 'unlink' ],
Expand Down

0 comments on commit e0f067e

Please sign in to comment.