mirror of
https://github.com/grafana/grafana.git
synced 2024-11-23 01:16:31 -06:00
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
This commit is contained in:
parent
b28085110d
commit
9e50866356
2
nx.json
2
nx.json
@ -3,7 +3,7 @@
|
||||
"default": {
|
||||
"runner": "nx/tasks-runners/default",
|
||||
"options": {
|
||||
"cacheableOperations": ["build"]
|
||||
"cacheableOperations": ["build", "generate"]
|
||||
}
|
||||
}
|
||||
},
|
||||
|
14
package.json
14
package.json
@ -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": {
|
||||
|
8
packages/grafana-data/project.json
Normal file
8
packages/grafana-data/project.json
Normal file
@ -0,0 +1,8 @@
|
||||
{
|
||||
"$schema": "../../node_modules/nx/schemas/project-schema.json",
|
||||
"projectType": "library",
|
||||
"tags": ["scope:package", "type:ui"],
|
||||
"targets": {
|
||||
"build": {}
|
||||
}
|
||||
}
|
8
packages/grafana-e2e-selectors/project.json
Normal file
8
packages/grafana-e2e-selectors/project.json
Normal file
@ -0,0 +1,8 @@
|
||||
{
|
||||
"$schema": "../../node_modules/nx/schemas/project-schema.json",
|
||||
"projectType": "library",
|
||||
"tags": ["scope:package", "type:ui"],
|
||||
"targets": {
|
||||
"build": {}
|
||||
}
|
||||
}
|
6
packages/grafana-eslint-rules/project.json
Normal file
6
packages/grafana-eslint-rules/project.json
Normal file
@ -0,0 +1,6 @@
|
||||
{
|
||||
"$schema": "../../node_modules/nx/schemas/project-schema.json",
|
||||
"projectType": "library",
|
||||
"tags": ["scope:package", "type:build"],
|
||||
"targets": {}
|
||||
}
|
8
packages/grafana-flamegraph/project.json
Normal file
8
packages/grafana-flamegraph/project.json
Normal file
@ -0,0 +1,8 @@
|
||||
{
|
||||
"$schema": "../../node_modules/nx/schemas/project-schema.json",
|
||||
"projectType": "library",
|
||||
"tags": ["scope:package", "type:ui"],
|
||||
"targets": {
|
||||
"build": {}
|
||||
}
|
||||
}
|
11
packages/grafana-icons/project.json
Normal file
11
packages/grafana-icons/project.json
Normal file
@ -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": {}
|
||||
}
|
||||
}
|
6
packages/grafana-o11y-ds-frontend/project.json
Normal file
6
packages/grafana-o11y-ds-frontend/project.json
Normal file
@ -0,0 +1,6 @@
|
||||
{
|
||||
"$schema": "../../node_modules/nx/schemas/project-schema.json",
|
||||
"projectType": "library",
|
||||
"tags": ["scope:package", "type:ui"],
|
||||
"targets": {}
|
||||
}
|
6
packages/grafana-plugin-configs/project.json
Normal file
6
packages/grafana-plugin-configs/project.json
Normal file
@ -0,0 +1,6 @@
|
||||
{
|
||||
"$schema": "../../node_modules/nx/schemas/project-schema.json",
|
||||
"projectType": "library",
|
||||
"tags": ["scope:package", "type:build"],
|
||||
"targets": {}
|
||||
}
|
8
packages/grafana-prometheus/project.json
Normal file
8
packages/grafana-prometheus/project.json
Normal file
@ -0,0 +1,8 @@
|
||||
{
|
||||
"$schema": "../../node_modules/nx/schemas/project-schema.json",
|
||||
"projectType": "library",
|
||||
"tags": ["scope:package", "type:ui"],
|
||||
"targets": {
|
||||
"build": {}
|
||||
}
|
||||
}
|
8
packages/grafana-runtime/project.json
Normal file
8
packages/grafana-runtime/project.json
Normal file
@ -0,0 +1,8 @@
|
||||
{
|
||||
"$schema": "../../node_modules/nx/schemas/project-schema.json",
|
||||
"projectType": "library",
|
||||
"tags": ["scope:package", "type:ui"],
|
||||
"targets": {
|
||||
"build": {}
|
||||
}
|
||||
}
|
8
packages/grafana-schema/project.json
Normal file
8
packages/grafana-schema/project.json
Normal file
@ -0,0 +1,8 @@
|
||||
{
|
||||
"$schema": "../../node_modules/nx/schemas/project-schema.json",
|
||||
"projectType": "library",
|
||||
"tags": ["scope:package", "type:ui"],
|
||||
"targets": {
|
||||
"build": {}
|
||||
}
|
||||
}
|
6
packages/grafana-sql/project.json
Normal file
6
packages/grafana-sql/project.json
Normal file
@ -0,0 +1,6 @@
|
||||
{
|
||||
"$schema": "../../node_modules/nx/schemas/project-schema.json",
|
||||
"projectType": "library",
|
||||
"tags": ["scope:package", "type:ui"],
|
||||
"targets": {}
|
||||
}
|
8
packages/grafana-ui/project.json
Normal file
8
packages/grafana-ui/project.json
Normal file
@ -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"
|
||||
}
|
||||
],
|
||||
|
9
public/app/plugins/datasource/azuremonitor/project.json
Normal file
9
public/app/plugins/datasource/azuremonitor/project.json
Normal file
@ -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": {}
|
||||
}
|
||||
}
|
9
public/app/plugins/datasource/jaeger/project.json
Normal file
9
public/app/plugins/datasource/jaeger/project.json
Normal file
@ -0,0 +1,9 @@
|
||||
{
|
||||
"$schema": "../../../../../node_modules/nx/schemas/project-schema.json",
|
||||
"projectType": "library",
|
||||
"tags": ["scope:plugin", "type:datasource"],
|
||||
"targets": {
|
||||
"build": {},
|
||||
"dev": {}
|
||||
}
|
||||
}
|
9
public/app/plugins/datasource/mysql/project.json
Normal file
9
public/app/plugins/datasource/mysql/project.json
Normal file
@ -0,0 +1,9 @@
|
||||
{
|
||||
"$schema": "../../../../../node_modules/nx/schemas/project-schema.json",
|
||||
"projectType": "library",
|
||||
"tags": ["scope:plugin", "type:datasource"],
|
||||
"targets": {
|
||||
"build": {},
|
||||
"dev": {}
|
||||
}
|
||||
}
|
9
public/app/plugins/datasource/parca/project.json
Normal file
9
public/app/plugins/datasource/parca/project.json
Normal file
@ -0,0 +1,9 @@
|
||||
{
|
||||
"$schema": "../../../../../node_modules/nx/schemas/project-schema.json",
|
||||
"projectType": "library",
|
||||
"tags": ["scope:plugin", "type:datasource"],
|
||||
"targets": {
|
||||
"build": {},
|
||||
"dev": {}
|
||||
}
|
||||
}
|
9
public/app/plugins/datasource/tempo/project.json
Normal file
9
public/app/plugins/datasource/tempo/project.json
Normal file
@ -0,0 +1,9 @@
|
||||
{
|
||||
"$schema": "../../../../../node_modules/nx/schemas/project-schema.json",
|
||||
"projectType": "library",
|
||||
"tags": ["scope:plugin", "type:datasource"],
|
||||
"targets": {
|
||||
"build": {},
|
||||
"dev": {}
|
||||
}
|
||||
}
|
9
public/app/plugins/datasource/zipkin/project.json
Normal file
9
public/app/plugins/datasource/zipkin/project.json
Normal file
@ -0,0 +1,9 @@
|
||||
{
|
||||
"$schema": "../../../../../node_modules/nx/schemas/project-schema.json",
|
||||
"projectType": "library",
|
||||
"tags": ["scope:plugin", "type:datasource"],
|
||||
"targets": {
|
||||
"build": {},
|
||||
"dev": {}
|
||||
}
|
||||
}
|
Loading…
Reference in New Issue
Block a user