只运行yarn时执行什么?

Soc*_*tes 5 yarnpkg

当运行在yarn中定义的脚本时,package.json使用yarn的通常方法是yarn run myscriptnameyarn但是,当只在没有 的情况下运行时,到底执行了什么run myscriptname?它仍然编译所有内容,但我想知道它到底从什么以及从哪里获取有关在不带参数调用时运行什么的信息。我正在使用的示例是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/*"
  ]
}
Run Code Online (Sandbox Code Playgroud)

小智 8

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

yarn不使用任何命令运行将运行yarn install,并传递任何提供的标志。