只运行纱线时执行什么?

时间:2018-04-13 12:44:37

标签: yarnpkg

当运行在package.json内定义的脚本时,通常使用纱线的方法是yarn run myscriptname。但是,只运行yarn而没有run myscriptname时究竟执行了什么?它仍然可以编译所有内容,但是我想知道在没有参数的情况下调用时,从哪些内容获取信息的具体内容和位置。我正在使用的示例是project in GitHub,package.json看起来像这样:

{
  "private": true,
  "name": "parent",
  "version": "0.0.0",
  "engines": {
    "yarn": "1.0.x || >=1.2.1",
    "node": ">=7.9.0"
  },
  "devDependencies": {
    "@types/chai": "^4.0.1",
    "@types/chai-as-promised": "0.0.31",
    "@types/chai-string": "^1.4.0",
    "@types/jsdom": "^11.0.4",
    "@types/mocha": "^2.2.41",
    "@types/sinon": "^2.3.5",
    "@types/temp": "^0.8.29",
    "@types/webdriverio": "^4.7.0",
    "chai": "^4.1.0",
    "chai-string": "^1.4.0",
    "concurrently": "^3.5.0",
    "electron-mocha": "^3.5.0",
    "istanbul": "^0.4.5",
    "istanbul-instrumenter-loader": "^3.0.0",
    "jsdom": "^11.5.1",
    "lerna": "^2.2.0",
    "mocha": "^3.4.2",
    "nyc": "^11.0.3",
    "remap-istanbul": "^0.9.5",
    "rimraf": "^2.6.1",
    "selenium-standalone": "^6.2.0",
    "sinon": "^3.3.0",
    "temp": "^0.8.3",
    "ts-node": "^3.2.0",
    "tslint": "^5.7.0",
    "typedoc": "^0.8",
    "typescript": "^2.7.2",
    "uuid": "^3.1.0",
    "wdio-mocha-framework": "^0.5.9",
    "wdio-phantomjs-service": "^0.2.2",
    "wdio-selenium-standalone-service": "0.0.8",
    "wdio-spec-reporter": "^0.1.0",
    "webdriverio": "^4.6.2"
  },
  "scripts": {
    "prepare": "yarn rebuild:clean && yarn build:clean",
    "build": "run build",
    "build:clean": "run prepare",
    "docs": "run docs \"@theia/!(example-)*\"",
    "test": "yarn test:theia && yarn test:electron && yarn test:browser",
    "test:theia": "run test \"@theia/!(example-)*\" --parallel",
    "test:browser": "yarn rebuild:browser && run test \"@theia/example-browser\"",
    "test:electron": "yarn rebuild:electron && run test \"@theia/example-electron\"",
    "rebuild:clean": "rimraf .browser_modules",
    "rebuild:browser": "theia rebuild:browser",
    "rebuild:electron": "theia rebuild:electron",
    "rebuild:electron:debug": "DEBUG=electron-rebuild && yarn rebuild:electron",
    "watch": "lerna run watch --scope \"@theia/!(example-)*\" --parallel",
    "publish": "yarn && yarn test && yarn publish:latest",
    "publish:latest": "lerna publish --registry=https://registry.npmjs.org/ --skip-git",
    "publish:next": "lerna publish --registry=https://registry.npmjs.org/ --exact --canary=next --npm-tag=next --force-publish --skip-git --yes"
  },
  "workspaces": [
    "dev-packages/*",
    "packages/*",
    "examples/*"
  ]
}

2 个答案:

答案 0 :(得分:1)

根据:https://yarnpkg.com/lang/en/docs/cli/#toc-default-command

  

在没有命令的情况下运行yarn将运行yarn install,并通过任何提供的标志。

答案 1 :(得分:0)

<ion-grid no-padding> <ion-row no-padding> <ion-col col-6 col-sm-3 col-md-6 col-lg-4 col-xl-3 *ngFor="let item of Data" (click)="showDetails(item)"> <ion-card no-margin> <div gallery-title> <h2 item-title text-wrap text-center>{{ item.ProductName }}</h2> </div> </ion-card> </ion-col> </ion-row> </ion-grid> === Invoice::where('total_amount', '<=', function($query) { $query->selectRaw('SUM(amount_received)') ->from('invoice_payments') ->where('invoice_id', DB::raw('invoices.id')); })->paginate();

它只是从package.json及其依赖项安装节点包。

(现在你不应该使用纱线.NPM是最快的)