Build: Nx improvements (#88341)

* feat(frontend): introduce project.json for every workspace to improve caching

* refactor(frontend): use nx tags for grafana dependson

* refactor(frontend): clean up nx tags for packages and plugins

* build(nx): make grafana dependent on cacheable generate icons command

* build(nx): clean up project files
pull/94726/head
Jack Westbrook 8 months ago committed by GitHub
parent b28085110d
commit 9e50866356
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
  1. 2
      nx.json
  2. 14
      package.json
  3. 8
      packages/grafana-data/project.json
  4. 8
      packages/grafana-e2e-selectors/project.json
  5. 6
      packages/grafana-eslint-rules/project.json
  6. 8
      packages/grafana-flamegraph/project.json
  7. 11
      packages/grafana-icons/project.json
  8. 6
      packages/grafana-o11y-ds-frontend/project.json
  9. 6
      packages/grafana-plugin-configs/project.json
  10. 8
      packages/grafana-prometheus/project.json
  11. 8
      packages/grafana-runtime/project.json
  12. 8
      packages/grafana-schema/project.json
  13. 6
      packages/grafana-sql/project.json
  14. 8
      packages/grafana-ui/project.json
  15. 6
      project.json
  16. 9
      public/app/plugins/datasource/azuremonitor/project.json
  17. 9
      public/app/plugins/datasource/cloud-monitoring/project.json
  18. 9
      public/app/plugins/datasource/grafana-postgresql-datasource/project.json
  19. 9
      public/app/plugins/datasource/grafana-pyroscope-datasource/project.json
  20. 9
      public/app/plugins/datasource/grafana-testdata-datasource/project.json
  21. 9
      public/app/plugins/datasource/jaeger/project.json
  22. 9
      public/app/plugins/datasource/mysql/project.json
  23. 9
      public/app/plugins/datasource/parca/project.json
  24. 9
      public/app/plugins/datasource/tempo/project.json
  25. 9
      public/app/plugins/datasource/zipkin/project.json

@ -3,7 +3,7 @@
"default": {
"runner": "nx/tasks-runners/default",
"options": {
"cacheableOperations": ["build"]
"cacheableOperations": ["build", "generate"]
}
}
},

@ -31,11 +31,11 @@
"lint:sass": "yarn stylelint '{public/sass,packages}/**/*.scss' --cache",
"test:ci": "mkdir -p reports/junit && JEST_JUNIT_OUTPUT_DIR=reports/junit jest --ci --reporters=default --reporters=jest-junit -w ${TEST_MAX_WORKERS:-100%}",
"lint:fix": "yarn lint:ts --fix",
"packages:build": "nx run-many -t build --projects='@grafana/*'",
"packages:clean": "rimraf ./npm-artifacts && lerna run clean --parallel",
"packages:build": "nx run-many -t build --projects='tag:scope:package'",
"packages:clean": "rimraf ./npm-artifacts && nx run-many -t clean --projects='tag:scope:package' --maxParallel=100",
"packages:prepare": "lerna version --no-push --no-git-tag-version --force-publish --exact",
"packages:pack": "mkdir -p ./npm-artifacts && lerna exec --no-private -- yarn pack --out \"../../npm-artifacts/%s-%v.tgz\"",
"packages:typecheck": "nx run-many -t typecheck --projects='@grafana/*'",
"packages:typecheck": "nx run-many -t typecheck --projects='tag:scope:package'",
"prettier:check": "prettier --check --list-different=false --log-level=warn \"**/*.{ts,tsx,scss,md,mdx,json}\"",
"prettier:checkDocs": "prettier --check --list-different=false --log-level=warn \"docs/**/*.md\" \"*.md\" \"packages/**/*.{ts,tsx,scss,md,mdx,json}\"",
"prettier:write": "prettier --list-different \"**/*.{js,ts,tsx,scss,md,mdx,json}\" --write",
@ -58,10 +58,10 @@
"betterer:stats": "ts-node --transpile-only --project ./scripts/cli/tsconfig.json ./scripts/cli/reportBettererStats.ts",
"betterer:issues": "ts-node --transpile-only --project ./scripts/cli/tsconfig.json ./scripts/cli/generateBettererIssues.ts",
"generate-icons-bundle-cache-file": "node ./scripts/generate-icon-bundle.js",
"plugin:build": "nx run-many -t build --projects='@grafana-plugins/*'",
"plugin:build:commit": "nx run-many -t build:commit --projects='@grafana-plugins/*'",
"plugin:build:dev": "nx run-many -t dev --projects='@grafana-plugins/*' --maxParallel=100",
"generate-icons": "yarn workspace @grafana/saga-icons generate",
"plugin:build": "nx run-many -t build --projects='tag:scope:plugin'",
"plugin:build:commit": "nx run-many -t build:commit --projects='tag:scope:plugin'",
"plugin:build:dev": "nx run-many -t dev --projects='tag:scope:plugin' --maxParallel=100",
"generate-icons": "nx run grafana-icons:generate",
"generate-apis": "rtk-query-codegen-openapi ./scripts/generate-rtk-apis.ts"
},
"grafana": {

@ -0,0 +1,8 @@
{
"$schema": "../../node_modules/nx/schemas/project-schema.json",
"projectType": "library",
"tags": ["scope:package", "type:ui"],
"targets": {
"build": {}
}
}

@ -0,0 +1,8 @@
{
"$schema": "../../node_modules/nx/schemas/project-schema.json",
"projectType": "library",
"tags": ["scope:package", "type:ui"],
"targets": {
"build": {}
}
}

@ -0,0 +1,6 @@
{
"$schema": "../../node_modules/nx/schemas/project-schema.json",
"projectType": "library",
"tags": ["scope:package", "type:build"],
"targets": {}
}

@ -0,0 +1,8 @@
{
"$schema": "../../node_modules/nx/schemas/project-schema.json",
"projectType": "library",
"tags": ["scope:package", "type:ui"],
"targets": {
"build": {}
}
}

@ -0,0 +1,11 @@
{
"$schema": "../../node_modules/nx/schemas/project-schema.json",
"projectType": "library",
"tags": ["scope:package", "type:ui"],
"targets": {
"generate": {
"outputs": ["{projectRoot}/src/icons-gen"]
},
"build": {}
}
}

@ -0,0 +1,6 @@
{
"$schema": "../../node_modules/nx/schemas/project-schema.json",
"projectType": "library",
"tags": ["scope:package", "type:ui"],
"targets": {}
}

@ -0,0 +1,6 @@
{
"$schema": "../../node_modules/nx/schemas/project-schema.json",
"projectType": "library",
"tags": ["scope:package", "type:build"],
"targets": {}
}

@ -0,0 +1,8 @@
{
"$schema": "../../node_modules/nx/schemas/project-schema.json",
"projectType": "library",
"tags": ["scope:package", "type:ui"],
"targets": {
"build": {}
}
}

@ -0,0 +1,8 @@
{
"$schema": "../../node_modules/nx/schemas/project-schema.json",
"projectType": "library",
"tags": ["scope:package", "type:ui"],
"targets": {
"build": {}
}
}

@ -0,0 +1,8 @@
{
"$schema": "../../node_modules/nx/schemas/project-schema.json",
"projectType": "library",
"tags": ["scope:package", "type:ui"],
"targets": {
"build": {}
}
}

@ -0,0 +1,6 @@
{
"$schema": "../../node_modules/nx/schemas/project-schema.json",
"projectType": "library",
"tags": ["scope:package", "type:ui"],
"targets": {}
}

@ -0,0 +1,8 @@
{
"$schema": "../../node_modules/nx/schemas/project-schema.json",
"projectType": "library",
"tags": ["scope:package", "type:ui"],
"targets": {
"build": {}
}
}

@ -6,8 +6,9 @@
"start": {
"dependsOn": [
"themes-generate",
"grafana-icons:generate",
{
"projects": ["@grafana-plugins/**"],
"projects": ["tag:scope:plugin"],
"target": "build"
}
]
@ -15,8 +16,9 @@
"build": {
"dependsOn": [
"themes-generate",
"grafana-icons:generate",
{
"projects": ["@grafana-plugins/**"],
"projects": ["tag:scope:plugin"],
"target": "build"
}
],

@ -0,0 +1,9 @@
{
"$schema": "../../../../../node_modules/nx/schemas/project-schema.json",
"projectType": "library",
"tags": ["scope:plugin", "type:datasource"],
"targets": {
"build": {},
"dev": {}
}
}

@ -0,0 +1,9 @@
{
"$schema": "../../../../../node_modules/nx/schemas/project-schema.json",
"projectType": "library",
"tags": ["scope:plugin", "type:datasource"],
"targets": {
"build": {},
"dev": {}
}
}

@ -0,0 +1,9 @@
{
"$schema": "../../../../../node_modules/nx/schemas/project-schema.json",
"projectType": "library",
"tags": ["scope:plugin", "type:datasource"],
"targets": {
"build": {},
"dev": {}
}
}

@ -0,0 +1,9 @@
{
"$schema": "../../../../../node_modules/nx/schemas/project-schema.json",
"projectType": "library",
"tags": ["scope:plugin", "type:datasource"],
"targets": {
"build": {},
"dev": {}
}
}

@ -0,0 +1,9 @@
{
"$schema": "../../../../../node_modules/nx/schemas/project-schema.json",
"projectType": "library",
"tags": ["scope:plugin", "type:datasource"],
"targets": {
"build": {},
"dev": {}
}
}

@ -0,0 +1,9 @@
{
"$schema": "../../../../../node_modules/nx/schemas/project-schema.json",
"projectType": "library",
"tags": ["scope:plugin", "type:datasource"],
"targets": {
"build": {},
"dev": {}
}
}

@ -0,0 +1,9 @@
{
"$schema": "../../../../../node_modules/nx/schemas/project-schema.json",
"projectType": "library",
"tags": ["scope:plugin", "type:datasource"],
"targets": {
"build": {},
"dev": {}
}
}

@ -0,0 +1,9 @@
{
"$schema": "../../../../../node_modules/nx/schemas/project-schema.json",
"projectType": "library",
"tags": ["scope:plugin", "type:datasource"],
"targets": {
"build": {},
"dev": {}
}
}

@ -0,0 +1,9 @@
{
"$schema": "../../../../../node_modules/nx/schemas/project-schema.json",
"projectType": "library",
"tags": ["scope:plugin", "type:datasource"],
"targets": {
"build": {},
"dev": {}
}
}

@ -0,0 +1,9 @@
{
"$schema": "../../../../../node_modules/nx/schemas/project-schema.json",
"projectType": "library",
"tags": ["scope:plugin", "type:datasource"],
"targets": {
"build": {},
"dev": {}
}
}
Loading…
Cancel
Save