profile
viewpoint
fengmk2 fengmk2 Alipay Hangzhou, China https://fengmk2.com Developer of @eggjs

alibaba/macaca 2747

Automation solution for multi-platform. 多端自动化解决方案

aleafs/pm 279

A graceful node library to contribute a permanent "master-worker" server.

eggjs/egg-cancan 43

cancancan like authorization plugin for Egg.js

fengmk2/ChinaMobilePhoneNumberRegex 34

Regular expressions that match the mobile phone number in mainland China.

dannycoates/zkjs 21

Node ZooKeeper Client in pure JS

aleafs/itier-client 13

client library for itier

ali-sdk/ali-mc 10

Aliyun OCS(open cache storage) client. (Just a Memcache client)

fengmk2/ama 3

Ask me anything!

fengmk2/active 2

Active, a user active loging and total service. 用户活跃跟踪统计系统

fengmk2/appjs 1

SDK on top of nodejs to build desktop apps using HTML5/CSS/JS

Pull request review commentnode-modules/mm

feat: [BREAKING] don't allow to mock async function to normal function

 const thenify = require('thenify').withCallback; const Readable = require('stream').Readable; const Duplex = require('stream').Duplex; -const mock = module.exports = function mock() {+const mock = module.exports = function mock(target, property, value) {+  if (typeof target[property] === 'function' && typeof value === 'function') {

还有不支持 node 4 和 node 6

fengmk2

comment created time in a day

pull request commentcnpm/cnpmjs.org

更新Hooks

commit log 改成英文,增加单元测试。

shangwenhe

comment created time in 2 days

Pull request review commentcnpm/cnpmjs.org

更新Hooks

 module.exports = function* save(next) {     name: mod.name,     type: 'package',     version: mod.version,-    hookOwner: null,-    payload: null,+    hookOwner: {+      username: username,+    },+    payload: mod.package,     change: null,   };+  // remove readme content, reduce message body+  envelope.payload.readme = null;

不能删除的,这是 payload 需要的完整信息

shangwenhe

comment created time in 2 days

Pull request review commentcnpm/cnpmjs.org

更新Hooks

 'use strict';  const co = require('co');+const urllib = require('urllib'); const config = require('../config'); const logger = require('../common/logger');  exports.trigger = envelope => {+     if (!config.globalHook) {     return;   }    envelope.time = Date.now();    co(function* () {-    yield config.globalHook(envelope);

为何要改变这里。。。

shangwenhe

comment created time in 2 days

push eventkoajs/joi-router

snyk-bot

commit sha 6dab5db3a1a3f5095ca693e268fe419faf2cfef0

fix: package.json & package-lock.json to reduce vulnerabilities The following vulnerabilities are fixed with an upgrade: - https://snyk.io/vuln/SNYK-JS-HAPIHOEK-548452

view details

push time in 2 days

create barnchkoajs/joi-router

branch : snyk-fix-46c2c71b58c689b917d0d19c2814ca2c

created branch time in 2 days

PR opened node-modules/mm

Reviewers
feat: [BREAKING] don't allow to mock async function to normal function enhancement

drop node support 4, 6, now support node version >= 8

+156 -86

0 comment

7 changed files

pr created time in 2 days

create barnchnode-modules/mm

branch : not-allow-mock-different-functions

created branch time in 2 days

created tagnode-modules/enable

tag3.4.0

Detect es6 features enable or not.

created time in 2 days

push eventnode-modules/enable

fengmk2

commit sha 91e62aaf4e1f576c230577a993c2c6e10e6c4847

Release 3.4.0

view details

push time in 2 days

delete branch node-modules/enable

delete branch : support-async-function

delete time in 2 days

push eventnode-modules/enable

fengmk2

commit sha d831d404c749d0c73184c5357daf7fc6bed24d49

feat: detect arrow and async function (#28) * test: add node 13

view details

push time in 2 days

PR merged node-modules/enable

feat: detect arrow and async function enhancement
+370 -508

0 comment

5 changed files

fengmk2

pr closed time in 2 days

push eventnode-modules/enable

fengmk2

commit sha af1a9e9de449b1a259019c002a96522a0479a706

test: add node 13

view details

push time in 2 days

push eventnode-modules/enable

fengmk2

commit sha c92d92d26feb8d7529ca15ac6a929862247330b9

f

view details

push time in 2 days

push eventnode-modules/enable

fengmk2

commit sha b6f5cbff13514d0ef4ed4878187457ad30da9f59

f

view details

push time in 3 days

push eventnode-modules/enable

fengmk2

commit sha 8c16b819a21d86c910a54b5761f23c3c0704dd58

f

view details

push time in 3 days

push eventnode-modules/enable

fengmk2

commit sha 7590ae16aeb322091dd03fa7a11344d10dd50e46

f

view details

push time in 3 days

PR opened node-modules/enable

feat: detect arrow and async function enhancement
+78 -50

0 comment

5 changed files

pr created time in 3 days

create barnchnode-modules/enable

branch : support-async-function

created branch time in 3 days

startednode-modules/enable

started time in 3 days

fork fengmk2/leoric

🐤JavaScript ORM for MySQL, PostgreSQL, and others.

https://www.cyj.me/leoric

fork in 5 days

delete branch cnpm/bug-versions

delete branch : hotfix-crypto-js-3.2.0

delete time in 6 days

push eventcnpm/bug-versions

fengmk2

commit sha 2f34db128c878c13979ccfa4b71f33df4ec78021

feat: hotfix crypto-js@3.2.0 to 3.1.9-1 (#81) https://github.com/brix/crypto-js/issues/256#issuecomment-584644251

view details

push time in 6 days

PR merged cnpm/bug-versions

feat: hotfix crypto-js@3.2.0 to 3.1.9-1

https://github.com/brix/crypto-js/issues/256#issuecomment-584644251

+7 -1

0 comment

1 changed file

fengmk2

pr closed time in 6 days

PR opened cnpm/bug-versions

feat: hotfix crypto-js@3.2.0 to 3.1.9-1

https://github.com/brix/crypto-js/issues/256#issuecomment-584644251

+7 -1

0 comment

1 changed file

pr created time in 6 days

create barnchcnpm/bug-versions

branch : hotfix-crypto-js-3.2.0

created branch time in 6 days

delete branch cnpm/bug-versions

delete branch : february-2020-security-releases

delete time in 7 days

push eventcnpm/bug-versions

fengmk2

commit sha 75854a3490a38c27f08b65c4a09603872fb8b090

feat: Node.js February 2020 Security Releases (#80) https://nodejs.org/en/blog/vulnerability/february-2020-security-releases/

view details

push time in 7 days

PR merged cnpm/bug-versions

feat: Node.js February 2020 Security Releases enhancement

https://nodejs.org/en/blog/vulnerability/february-2020-security-releases/

+15 -15

0 comment

1 changed file

fengmk2

pr closed time in 7 days

PR opened cnpm/bug-versions

feat: Node.js February 2020 Security Releases

https://nodejs.org/en/blog/vulnerability/february-2020-security-releases/

+15 -15

0 comment

1 changed file

pr created time in 7 days

create barnchcnpm/bug-versions

branch : february-2020-security-releases

created branch time in 7 days

pull request commentcnpm/npminstall

feat: support INIT_CWD env

@afc163 重新安装 cnpm 就获得这个能力了。

fengmk2

comment created time in 13 days

delete branch eggjs/egg-session

delete branch : add-samesite-none-test

delete time in 16 days

push eventeggjs/egg-session

fengmk2

commit sha 75c8ee6c4143362edced399d66c11834bc00ae5f

test: add sameSite=none test case (#14)

view details

push time in 16 days

PR merged eggjs/egg-session

Reviewers
test: add sameSite=none test case

<!-- Thank you for your pull request. Please review below requirements. Bug fixes and new features should include tests and possibly benchmarks. Contributors guide: https://github.com/eggjs/egg/blob/master/CONTRIBUTING.md

感谢您贡献代码。请确认下列 checklist 的完成情况。 Bug 修复和新功能必须包含测试,必要时请附上性能测试。 Contributors guide: https://github.com/eggjs/egg/blob/master/CONTRIBUTING.md -->

Checklist

<!-- Remove items that do not apply. For completed items, change [ ] to [x]. -->

  • [ ] npm test passes
  • [ ] tests and/or benchmarks are included
  • [ ] documentation is changed or added
  • [ ] commit message follows commit guidelines
Affected core subsystem(s)

<!-- Provide affected core subsystem(s). -->

Description of change

<!-- Provide a description of the change below this comment. -->

+55 -1

2 comments

8 changed files

fengmk2

pr closed time in 16 days

push eventeggjs/egg-session

fengmk2

commit sha 76bb2de370bea23e64ec653057a51007f70249eb

f

view details

push time in 16 days

PR opened koajs/session

Reviewers
fix: don't set any value to sameSite by default bug
+3 -2

0 comment

2 changed files

pr created time in 16 days

create barnchkoajs/session

branch : fix-not-set

created branch time in 16 days

push eventeggjs/egg-session

fengmk2

commit sha 4e64e45c4fe0464231c3c962471d58ddf885324d

f

view details

push time in 16 days

pull request commenteggjs/egg-session

test: add sameSite=none test case

deps on https://github.com/koajs/session/pull/193

fengmk2

comment created time in 16 days

PR opened eggjs/egg-session

Reviewers
test: add sameSite=none test case

<!-- Thank you for your pull request. Please review below requirements. Bug fixes and new features should include tests and possibly benchmarks. Contributors guide: https://github.com/eggjs/egg/blob/master/CONTRIBUTING.md

感谢您贡献代码。请确认下列 checklist 的完成情况。 Bug 修复和新功能必须包含测试,必要时请附上性能测试。 Contributors guide: https://github.com/eggjs/egg/blob/master/CONTRIBUTING.md -->

Checklist

<!-- Remove items that do not apply. For completed items, change [ ] to [x]. -->

  • [ ] npm test passes
  • [ ] tests and/or benchmarks are included
  • [ ] documentation is changed or added
  • [ ] commit message follows commit guidelines
Affected core subsystem(s)

<!-- Provide affected core subsystem(s). -->

Description of change

<!-- Provide a description of the change below this comment. -->

+55 -1

0 comment

8 changed files

pr created time in 16 days

create barncheggjs/egg-session

branch : add-samesite-none-test

created branch time in 16 days

PR opened koajs/session

Reviewers
feat: support session cookie sameSite options enhancement
+47 -0

0 comment

3 changed files

pr created time in 17 days

create barnchkoajs/session

branch : support-samesite-options

created branch time in 17 days

create barnchcnpm/cnpmjs.org

branch : snyk-fix-5461ecfa3ddd13806b1c48373f0161c4

created branch time in 24 days

push eventcnpm/cnpmjs.org

snyk-bot

commit sha 18ddef5308facbd10bcba87ac87a964ca118ba9d

fix: package.json to reduce vulnerabilities The following vulnerabilities are fixed with an upgrade: - https://snyk.io/vuln/SNYK-JS-SEQUELIZE-543029

view details

push time in 24 days

issue commenteggjs/egg

RESTful 风格的 URL 定义中,路由名ctx.routerName重复如何解决?

确实可以改善一下。 @xiaopenggithub 可以来贡献一下吗?

xiaopenggithub

comment created time in a month

Pull request review commentcyjake/egg-orm

fix: should set ctx on instance and Class

 function injectContext(app) {           const origin = target[property];           if (!origin) throw new Error(`Model ${property} not found`); -          return (this[property] = class extends origin {+          const ContextClass = class extends origin {             constructor(opts) {               super(opts);               this.ctx = ctx;             }-          });+          };+          ContextClass.ctx = ctx;

2种 ctx 用法

ctx.model.Foo.ctx

const foo = ctx.model.Foo.create();
foo.ctx
fengmk2

comment created time in a month

pull request commentcyjake/egg-orm

fix: should set ctx on instance and Class

需要每次都创建一个新的 Model,并且可以直接 Model.ctx 拿到 ctx,modelInstance.ctx 也能拿到 ctx。

fengmk2

comment created time in a month

PR opened cyjake/egg-orm

fix: should set ctx on instance and Class
+7 -3

0 comment

2 changed files

pr created time in a month

create barnchfengmk2/egg-orm

branch : fix-ContextCLass

created branch time in a month

fork fengmk2/egg-orm

Object relational mapping for Egg framework

fork in a month

startedcyjake/egg-orm

started time in a month

push eventcnpm/npm.taobao.org

fengmk2

commit sha 87e5925848269ea869442d06bd865804e5214e68

fix: remove 2020 log

view details

push time in a month

pull request commentkoajs/compose

conserve this

keep this for what feature? koa use ctx request context, no more this.

bertho-zero

comment created time in a month

created tagcnpm/npminstall

tag3.27.0

Make `npm install` fast and easy.

created time in a month

push eventcnpm/npminstall

fengmk2

commit sha a65662b0d2038d19a897e630ba8c1047d93d4492

Release 3.27.0

view details

push time in a month

pull request commentcnpm/npminstall

feat: support npm_config_user_agent env

3.27.0

fengmk2

comment created time in a month

delete branch cnpm/npminstall

delete branch : user-agent-for-3.x

delete time in a month

push eventcnpm/npminstall

fengmk2

commit sha 62fa887a2f353cb99f72584d1893a54037fda42a

feat: support npm_config_user_agent env (#323) (#324)

view details

push time in a month

PR merged cnpm/npminstall

feat: support npm_config_user_agent env enhancement
+16 -5

0 comment

3 changed files

fengmk2

pr closed time in a month

PR opened cnpm/npminstall

feat: support npm_config_user_agent env (#323) enhancement
+16 -5

0 comment

3 changed files

pr created time in a month

create barnchcnpm/npminstall

branch : user-agent-for-3.x

created branch time in a month

created tagcnpm/npminstall

tag4.7.0

Make `npm install` fast and easy.

created time in a month

push eventcnpm/npminstall

fengmk2

commit sha 880cf71571aa03218ce79cdaae36120db2c8ab20

Release 4.7.0

view details

push time in a month

pull request commentcnpm/npminstall

feat: support npm_config_user_agent env

4.7.0

fengmk2

comment created time in a month

delete branch cnpm/npminstall

delete branch : add-npm_config_user_agent

delete time in a month

push eventcnpm/npminstall

fengmk2

commit sha 9a2dde5baa45709489d07acb442da25871cfff4e

feat: support npm_config_user_agent env (#323)

view details

push time in a month

PR merged cnpm/npminstall

feat: support npm_config_user_agent env enhancement
+15 -5

0 comment

3 changed files

fengmk2

pr closed time in a month

PR opened cnpm/npminstall

feat: support npm_config_user_agent env
+15 -5

0 comment

3 changed files

pr created time in a month

create barnchcnpm/npminstall

branch : add-npm_config_user_agent

created branch time in a month

Pull request review commentcyjake/leoric

refactor: clients => drivers & sqlite support without hacking node-sqlite3

 class Bone {    * post.attributeChanged('title')  // => false    */   attributeChanged(name) {-    if (this.rawUnset.has(name)) return false-    const value = this.attribute(name)-    const valueWas = this.attributeWas(name)-    return !(Object.is(value, valueWas) || deepEqual(value, valueWas))+    if (this.rawUnset.has(name)) return false;+    const value = this.attribute(name);+    const valueWas = this.attributeWas(name);+    return !(Object.is(value, valueWas) || deepEqual(value, valueWas));

value 和 valueWas 都是 object 才使用 deepEqual 吧,这样性能比较好。

cyjake

comment created time in a month

Pull request review commentcyjake/leoric

refactor: clients => drivers & sqlite support without hacking node-sqlite3

+'use strict';++// https://sequelize.org/master/class/lib/model.js~Model.html+module.exports = Bone => {+  return class Model extends Bone {+    static addScope(name, scope) {+      throw new Error('unimplemented');+    }++    static aggregate() {+      throw new Error('unimplemented');+    }++    static belongsTo() {+      throw new Error('unimplemented');+    }++    static belongsToMany() {+      throw new Error('unimplemented');+    }++    static build() {+      throw new Error('unimplemented');+    }++    static bulkCreate() {+      throw new Error('unimplemented');+    }++    static count() {+      throw new Error('unimplemented');+    }++    static create() {+      throw new Error('unimplemented');+    }++    static decrement() {+      throw new Error('unimplemented');+    }++    static describe() {+      throw new Error('unimplemented');+    }++    static drop() {+      throw new Error('unimplemented');+    }++    static findAll() {+      throw new Error('unimplemented');+    }++    static findAndCountAll() {+      throw new Error('unimplemented');+    }++    static findByPk() {+      throw new Error('unimplemented');+    }++    static findCreateFind() {+      throw new Error('unimplemented');+    }++    static findOne() {+        throw new Error('unimplemented');+    }++    static findOrBuild() {+      throw new Error('unimplemented');+    }++    static findOrCreate() {+      throw new Error('unimplemented');+    }++    static getTableName() {+      return this.tableName;+    }++    static hasMany() {+      throw new Error('unimplemented');+    }++    static hasOne() {+      throw new Error('unimplemented');+    }++    static increment() {+      throw new Error('unimplemented');+    }++    static init() {+      throw new Error('unimplemented');+    }++    static max() {+      throw new Error('unimplemented');+    }++    static min() {+      throw new Error('unimplemented');+    }++    static removeAttribute() {+      throw new Error('unimplemented');+    }++    static restore() {+      throw new Error('unimplemented');+    }++    static schema() {+      throw new Error('unimplemented');+    }++    static scope() {+      throw new Error('unimplemented');+    }++    static sum() {+        throw new Error('unimplemented');+    }++    static sync() {+      throw new Error('unimplemented');+    }++    static truncate() {+      throw new Error('unimplemented');+    }++    static unscoped() {+      throw new Error('unimplemented');+    }++    static update() {+      throw new Error('unimplemented');+    }++    static upsert() {+      throw new Error('unimplemented');+    }++    get isNewRecord() {+      throw new Error('unimplemented');+    }++    changed() {+      throw new Error('unimplemented');+    }++    descrement() {+      throw new Error('unimplemented');+    }++    destroy() {+      throw new Error('unimplemented');+    }++    equals() {+      throw new Error('unimplemented');+    }++    equalsOneOf() {+      throw new Error('unimplemented');+    }++    get() {+      throw new Error('unimplemented');+    }++    getDataValue() {+      throw new Error('unimplemented');+    }++    increment() {+      throw new Error('unimplemented');+    }++    isSoftDeleted() {+      throw new Error('unimplemented');+    }++    previous() {+      throw new Error('unimplemented');+    }++    reload() {+      throw new Error('unimplemented');+    }++    save() {

直接声明是 async function?而不是之前的约定返回 promise。

cyjake

comment created time in a month

pull request commentcnpm/npminstall

feat: support INIT_CWD env

@HeavenSky you should create a package.json file and set name property.

fengmk2

comment created time in a month

push eventcnpm/cnpmjs.org

fengmk2

commit sha 2cea5cd1c3667b0a6d7e79e3ba5fda91c427a3c8

Release 3.0.0-rc.31

view details

push time in a month

delete branch cnpm/cnpmjs.org

delete branch : retry-from-cnpmregistry

delete time in a month

push eventcnpm/cnpmjs.org

fengmk2

commit sha a8ff647aa0f73076f4625e395e5da8ced9f61680

feat: retry sync fail on cnpm registry (#1547)

view details

push time in a month

PR merged cnpm/cnpmjs.org

feat: retry sync fail on cnpm registry feat
+19 -6

1 comment

2 changed files

fengmk2

pr closed time in a month

push eventcnpm/cnpmjs.org

fengmk2

commit sha d01cfab9b573e4b49c0f285158acbb2173f0923d

f

view details

push time in a month

PR opened cnpm/cnpmjs.org

feat: retry sync fail on cnpm registry feat
+18 -6

0 comment

2 changed files

pr created time in a month

create barnchcnpm/cnpmjs.org

branch : retry-from-cnpmregistry

created branch time in a month

PR closed cnpm/cnpm

1st goal

<!-- Reviewable:start --> This change is <img src="https://reviewable.io/review_button.svg" height="34" align="absmiddle" alt="Reviewable"/> <!-- Reviewable:end -->

+72 -1

0 comment

3 changed files

kissofire

pr closed time in a month

created tagcnpm/npminstall

tag3.26.0

Make `npm install` fast and easy.

created time in a month

push eventcnpm/npminstall

fengmk2

commit sha d7f60e0de4fd6d53f0215540917a124a9c1366ec

Release 3.26.0

view details

push time in a month

pull request commentcnpm/npminstall

feat: support INIT_CWD env

3.26.0

fengmk2

comment created time in a month

delete branch cnpm/npminstall

delete branch : init-cwd-for-3.x

delete time in a month

push eventcnpm/npminstall

fengmk2

commit sha b21b4ed659e629d437823c8c1ebf2cc4b3536a94

feat: support INIT_CWD env (#322) closes https://github.com/cnpm/cnpm/issues/317

view details

push time in a month

PR merged cnpm/npminstall

feat: support INIT_CWD env enhancement

closes https://github.com/cnpm/cnpm/issues/317

+38 -0

1 comment

4 changed files

fengmk2

pr closed time in a month

push eventcnpm/npminstall

fengmk2

commit sha 522539bbafc377ddb19909a6da10fb03c4d1b566

f

view details

push time in a month

pull request commentcnpm/npminstall

feat: support INIT_CWD env

from https://github.com/cnpm/npminstall/pull/321

fengmk2

comment created time in a month

PR opened cnpm/npminstall

Init cwd for 3.x
+34 -0

0 comment

4 changed files

pr created time in a month

create barnchcnpm/npminstall

branch : init-cwd-for-3.x

created branch time in a month

created tagcnpm/npminstall

tag4.6.0

Make `npm install` fast and easy.

created time in a month

push eventcnpm/npminstall

fengmk2

commit sha ed586f9e651398dc038b4afe104a9ce862125d47

Release 4.6.0

view details

push time in a month

pull request commentcnpm/npminstall

feat: support INIT_CWD env

4.6.0

fengmk2

comment created time in a month

delete branch cnpm/npminstall

delete branch : support-INIT_CWD-env

delete time in a month

push eventcnpm/npminstall

fengmk2

commit sha 2a61ab61a3b304763b1785c08439db7d4b3a1cf1

feat: support INIT_CWD env (#321) closes https://github.com/cnpm/cnpm/issues/317

view details

push time in a month

PR merged cnpm/npminstall

Reviewers
feat: support INIT_CWD env enhancement semver: minor

closes https://github.com/cnpm/cnpm/issues/317

+34 -0

0 comment

4 changed files

fengmk2

pr closed time in a month

issue closedcnpm/cnpm

support $INIT_CWD when install

Reproduce steps

mkdir test
cd test
git init
cnpm i husky@4.0.3 --save-dev

Error message:

husky > Setting up git hooks
Cannot destructure property `name` of 'undefined' or 'null'.
husky > Failed to install

image

原因

cnpm 和 tnpm 没有像 npm 和 yarn 一样添加 $INIT_CWD 环境变量:https://github.com/typicode/husky/blob/0ffe7853853dd7667ddc24a78469b92b5312aeb2/src/installer/bin.ts#L40

相关 issue:https://github.com/yarnpkg/yarn/issues/5698

closed time in a month

afc163
more