angular - 使用 `nx print-affected`删除保存到json中的其他信息

标签 angular docker nrwl-nx

从docker将nx print-affected打印到文件中可以保存除了引起问题的json之外的其他信息。

这是我使用的命令

npm run print:affected -- --base-'origin/master' --target='build' > 'dist/affected.json'

这是我得到的输出

> ktp-web@1.3.4 print:affected /Users/shawntony/projects/ktp-web
> nx print-affected

{
  "tasks": [],
  "projects": [
    "shell-med",
    "shell-med-e2e",
    "modules-qbuilder",
    "shared-components",
    "overall-performance",
    "quiz-history",
    "shell-nursing",
    "shell-nursing-e2e",
    "shell-actlp",
    "shell-actlp-e2e",
    "shell-bar",
    "shell-bar-e2e",
    "shell-admission",
    "shell-admission-e2e",
    "create-quiz",
    "shell-flashcard",
    "shell-flashcard-e2e",
    "flashcards",
    "studyplan",
    "modules-search",
    "shell-upe",
    "shell-upe-e2e",
    "core-services",
    "core-store",
    "shell-qbuilder",
    "shell-qbuilder-e2e",
    "upe-enrolment"
  ],
  "projectGraph": {
    "nodes": [
      "overall-performance",
      "upe-enrolment",
      "quiz-history",
      "shell-admission-e2e",
      "create-quiz",
      "shell-flashcard-e2e",
      "flashcards",
      "shell-qbuilder-e2e",
      "shared-components",
      "studyplan",
      "shell-nursing-e2e",
      "modules-qbuilder",
      "shell-admission",
      "shell-actlp-e2e",
      "shell-flashcard",
      "shell-med-e2e",
      "shell-qbuilder",
      "modules-search",
      "core-services",
      "shell-bar-e2e",
      "shell-nursing",
      "shell-upe-e2e",
      "shell-actlp",
      "shell-med",
      "core-store",
      "shell-bar",
      "shell-upe",
      "@abot/atom-auth",
      "@abot/atom-node-api-health",
      "@abot/atom-node-express",
      "@abot/design-system",
      "@angular/animations",
      "@angular/common",
      "@angular/compiler",
      "@angular/core",
      "@angular/forms",
      "@angular/platform-browser",
      "@angular/platform-browser-dynamic",
      "@angular/router",
      "core-js",
      "rxjs",
      "zone.js",
      "@angular/cdk",
      "@angular/material",
      "@atom-platform/ngx-charts-web",
      "@ngrx/effects",
      "@ngrx/entity",
      "@ngrx/schematics",
      "@ngrx/store",
      "@ngrx/store-devtools",
      "@nrwl/angular",
      "@types/jasmine",
      "angular-gauge",
      "apollo-angular",
      "apollo-angular-link-http",
      "apollo-cache-inmemory",
      "apollo-client",
      "axios",
      "body-parser",
      "bunyan",
      "bunyan-middleware",
      "chart.js",
      "chartjs-plugin-datalabels",
      "co-express",
      "command-line-args",
      "concurrently",
      "cookie-parser",
      "eslint-plugin-jasmine",
      "everyconfig",
      "express",
      "graphql",
      "graphql-tag",
      "hammerjs",
      "hogan-express",
      "jasmine",
      "jasmine-core",
      "jasmine-marbles",
      "jasmine-reporters",
      "jasmine-spec-reporter",
      "jasminewd2",
      "karma-jasmine",
      "karma-jasmine-html-reporter",
      "ktp.loginjson.revise",
      "logrocket",
      "logrocket-ngrx",
      "mixpanel-browser",
      "moment",
      "newrelic",
      "ng2-charts",
      "ng2-cookies",
      "ngx-ui-loader",
      "pa11y",
      "protractor",
      "tslib",
      "webdriver-manager",
      "jest-preset-angular",
      "@angular/compiler-cli",
      "@angular/language-service",
      "@angular-devkit/build-angular",
      "codelyzer",
      "@angular/cli",
      "@nrwl/express",
      "@nrwl/jest",
      "@nrwl/node",
      "@nrwl/workspace",
      "@types/express",
      "@types/jasminewd2",
      "@types/jest",
      "@types/jquery",
      "@types/node",
      "dotenv",
      "jest",
      "jest-cli",
      "jest-junit",
      "karma-jenkins-reporter",
      "prettier",
      "ts-jest",
      "ts-node",
      "tslint",
      "typescript",
      "yarn"
    ],
    "dependencies": {
      "overall-performance": [
        {
          "type": "static",
          "source": "overall-performance",
          "target": "shared-components"
        },
        {
          "type": "static",
          "source": "overall-performance",
          "target": "core-services"
        },
        {
          "type": "static",
          "source": "shell-upe",
          "target": "jest-preset-angular"
        }
      ],
      "@abot/atom-auth": [],
      "@abot/atom-node-api-health": [],
      "@abot/atom-node-express": [],
      "@abot/design-system": [],
      "@angular/animations": [],
      "@angular/common": [],
      "@angular/compiler": [],
      "@angular/core": [],
      "@angular/forms": [],
      "@angular/platform-browser": [],
      "@angular/platform-browser-dynamic": [],
      "@angular/router": [],
      "core-js": [],
      "rxjs": [],
      "zone.js": [],
      "@angular/cdk": [],
      "@angular/material": [],
      "@atom-platform/ngx-charts-web": [],
      "@ngrx/effects": [],
      "@ngrx/entity": [],
      "@ngrx/schematics": [],
      "@ngrx/store": [],
      "@ngrx/store-devtools": [],
      "@nrwl/angular": [],
      "@types/jasmine": [],
      "angular-gauge": [],
      "apollo-angular": [],
      "apollo-angular-link-http": [],
      "apollo-cache-inmemory": [],
      "apollo-client": [],
      "axios": [],
      "body-parser": [],
      "bunyan": [],
      "bunyan-middleware": [],
      "chart.js": [],
      "chartjs-plugin-datalabels": [],
      "co-express": [],
      "command-line-args": [],
      "concurrently": [],
      "cookie-parser": [],
      "eslint-plugin-jasmine": [],
      "everyconfig": [],
      "express": [],
      "graphql": [],
      "graphql-tag": [],
      "hammerjs": [],
      "hogan-express": [],
      "jasmine": [],
      "jasmine-core": [],
      "jasmine-marbles": [],
      "jasmine-reporters": [],
      "jasmine-spec-reporter": [],
      "jasminewd2": [],
      "karma-jasmine": [],
      "karma-jasmine-html-reporter": [],
      "ktp.loginjson.revise": [],
      "logrocket": [],
      "logrocket-ngrx": [],
      "mixpanel-browser": [],
      "moment": [],
      "newrelic": [],
      "ng2-charts": [],
      "ng2-cookies": [],
      "ngx-ui-loader": [],
      "pa11y": [],
      "protractor": [],
      "tslib": [],
      "webdriver-manager": [],
      "jest-preset-angular": [],
      "@angular/compiler-cli": [],
      "@angular/language-service": [],
      "@angular-devkit/build-angular": [],
      "codelyzer": [],
      "@angular/cli": [],
      "@nrwl/express": [],
      "@nrwl/jest": [],
      "@nrwl/node": [],
      "@nrwl/workspace": [],
      "@types/express": [],
      "@types/jasminewd2": [],
      "@types/jest": [],
      "@types/jquery": [],
      "@types/node": [],
      "dotenv": [],
      "jest": [],
      "jest-cli": [],
      "jest-junit": [],
      "karma-jenkins-reporter": [],
      "prettier": [],
      "ts-jest": [],
      "ts-node": [],
      "tslint": [],
      "typescript": [],
      "yarn": []
    }
  }
}

最佳答案

为了防止npm输出,并且仅获得sub命令的输出,您需要--silent标志,因此在您的情况下

npm run --silent print:affected -- --base-'origin/master' --target='build' > 'dist/affected.json'

关于angular - 使用 `nx print-affected`删除保存到json中的其他信息,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/61214577/

相关文章:

docker - 在 Docker 容器中访问 Redis CLI

angular - 在现有的 Angular 应用程序上添加 Nrwl Nx 后 ng g app 在错误的目录中添加应用程序

jestjs - 使用 jest "watch mode"和 nx 测试(nx CLI)

Angular 5 Http 发布请求

javascript - Angular 性能: change detection detached if component is out of viewport

security - 禁用某些 Docker 运行选项

docker - Golang docker 多阶段构建运行失败 : exec: "go": executable file not found in $PATH

node.js - NX : Copy one extra file to build directory

node.js - 在两个不同的主机上托管 Angular 应用程序

angular - 使用 AngularFireAuthGuard 时出现 NullInjectorError