{"version":3,"sources":["jsdelivr-header.js","/npm/fisx-command-search@0.2.0/index.js"],"names":[],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA,ACDA,IAAI,UAAY,QAAQ,gBAExB,QAAQ,KAAO,sBACf,QAAQ,KAAO,4BACf,QAAQ,QAAU,CACd,aAAc,0BACd,cAAe,yCACf,SAAU,0DACV,UAAW,2DACX,OAAQ,iJAER,UAAW,kHAEX,UAAW,sFACX,aAAc,iGACd,mBAAoB,uCAGxB,QAAQ,IAAM,SAAU,EAAM,EAAK,GAC/B,GAAI,EAAK,GAAK,EAAK,KACf,OAAO,EAAI,KAAK,QAAQ,KAAM,QAAQ,SAG1C,EAAK,EAAE,QACP,IAAI,EAAQ,EAAK,EAAE,KAAK,KACpB,EAAU,CACV,KAAM,EAAI,IACV,SAAU,EAAK,OAAS,EAAK,EAC7B,SAAU,EAAK,UAKnB,MAHA,CAAC,OAAQ,QAAS,KAAM,QAAS,QAAS,YAAY,SAAQ,SAAU,GACpE,EAAQ,GAAO,EAAK,EACxB,IACO,UAAU,gBAAgB,EAAI,iBAAiB,GAAI,EAAS,KAC9D,KAAK,UAAU,eAAe,KAAK,KAAM,EAAI,iBAAiB,GAAI,EAAS,MAC3E,MAAK,WACF,OAAO,UAAU,OAAO,EAAO,EACnC,GACR","file":"/npm/fisx-command-search@0.2.0/index.js","sourceRoot":"","sourcesContent":["/**\n * Minified by jsDelivr using Terser v5.39.0.\n * Original file: /npm/fisx-command-search@0.2.0/index.js\n *\n * Do NOT use SRI with dynamically generated files! More information: https://www.jsdelivr.com/using-sri-with-dynamic-files\n */\n","/**\n * @file 入口模块\n * @author sparklewhy@gmail.com\n */\n\nvar pkgManage = require('fisx-package');\n\nexports.name = 'search <components>';\nexports.desc = 'search components package';\nexports.options = {\n    '-h, --help': 'print this help message',\n    '-c, --cache': 'search components using the last cache',\n    '--sort': 'the sort field: `stars`, `forks`, or `updated` (GitHub)',\n    '--order': 'the order field: `asc`， `desc`, default: `desc` （GitHub）',\n    '--in': 'qualifies which fields are searched: `name`, `description`, `readme`, '\n        + 'or any combination of these：`name,description`, default: `name` (GitHub)',\n    '--owner': 'limits searches to a specific user or repository, you can also '\n        + 'search `ecomfe/xx` to specify the owner (GitHub)',\n    '--stars': 'searches repositories based on the number of stars, e.g, `10..20`, `>=500` (GitHub)',\n    '--language': 'searches repositories based on the language they\\'re written in, default: `javascript` (GitHub)',\n    '--registry <url>': 'set the npm default registry to use'\n};\n\nexports.run = function (argv, cli, env) {\n    if (argv.h || argv.help) {\n        return cli.help(exports.name, exports.options);\n    }\n\n    argv._.shift();\n    var query = argv._.join(' ');\n    var options = {\n        root: env.cwd,\n        useCache: argv.cache || argv.c,\n        registry: argv.registry\n    };\n    ['sort', 'order', 'in', 'owner', 'stars', 'language'].forEach(function (key) {\n        options[key] = argv[key];\n    });\n    return pkgManage.initProjectRoot(env.configNameSearch[0], options, fis)\n        .then(pkgManage.loadUserConfig.bind(this, env.configNameSearch[0], options, fis))\n        .then(function () {\n            return pkgManage.search(query, options);\n        });\n};\n"]}