Skip to content

Commit

Permalink
chore: clean Nx config (#2496)
Browse files Browse the repository at this point in the history
## Proposed change

<!--
Please include a summary of the changes and the related issue.
Please also include relevant motivation and context.
-->

## Related issues

<!--
Please make sure to follow the [contribution
guidelines](https://github.com/amadeus-digital/Otter/blob/main/CONTRIBUTING.md)
-->

*- No issue associated -*

<!-- * 🐛 Fix #issue -->
<!-- * 🐛 Fix resolves #issue -->
<!-- * 🚀 Feature #issue -->
<!-- * 🚀 Feature resolves #issue -->
<!-- * :octocat: Pull Request #issue -->
  • Loading branch information
kpanot authored Nov 22, 2024
2 parents 2569726 + 3cb8376 commit 4c351b1
Show file tree
Hide file tree
Showing 21 changed files with 2,503 additions and 2,481 deletions.
41 changes: 30 additions & 11 deletions nx.json
Original file line number Diff line number Diff line change
Expand Up @@ -25,36 +25,36 @@
"project",
"{workspaceRoot}/yarn.lock",
"{workspaceRoot}/tsconfig.base.json",
"{workspaceRoot}/tsconfig.build.json",
"{workspaceRoot}/nx.json",
"{workspaceRoot}/.nxignore",
"{workspaceRoot}/tools/@o3r/build-helpers/scripts/*.mjs"
],
"base-build": [
"base",
"{workspaceRoot}/tsconfig.build.json"
],
"source": [
"base-build",
"base",
"{projectRoot}/tsconfig.build.json",
"{projectRoot}/tsconfig.build.*.json",
"{projectRoot}/src/**/*",
"!{projectRoot}/**/*.spec.ts",
"!{projectRoot}/**/*.spec.scss"
],
"jasmine-fixtures": [
"base-build",
"base",
"{projectRoot}/tsconfig.build.json",
"{projectRoot}/tsconfig.build.*.json",
"{projectRoot}/tsconfig.fixture.jasmine.json",
"{projectRoot}/**/fixtures/jasmine/**/*.ts"
],
"jest-fixtures": [
"base-build",
"base",
"{projectRoot}/tsconfig.build.json",
"{projectRoot}/tsconfig.build.*.json",
"{projectRoot}/tsconfig.fixture.jest.json",
"{projectRoot}/**/fixtures/jest/**/*.ts"
],
"schemas": [
"{projectRoot}/schemas/*.json"
],
"builders-only": [
"base",
"{projectRoot}/tsconfig.builders.json",
Expand Down Expand Up @@ -238,6 +238,22 @@
],
"cache": true
},
"expose-schemas": {
"executor": "nx:run-script",
"options": {
"script": "copy:schemas"
},
"dependsOn": [
"compile"
],
"inputs": [
"schemas"
],
"outputs": [
"{projectRoot}/dist/schemas/*.json"
],
"cache": true
},
"compile": {
"dependsOn": [
"^build"
Expand Down Expand Up @@ -346,7 +362,8 @@
"build-builders": {
"dependsOn": [
"^build",
"prepare-build-builders"
"prepare-build-builders",
"compile"
],
"inputs": [
"builders",
Expand All @@ -370,7 +387,8 @@
"{projectRoot}/dist/middlewares/**/*.js",
"{projectRoot}/dist/middlewares/**/*.d.ts",
"{projectRoot}/dist/middlewares/**/*.d.ts.map",
"{projectRoot}/build/.tsbuildinfo.builders"
"{projectRoot}/build/.tsbuildinfo.builders",
"{projectRoot}/build/.tsbuildinfo.schematics"
],
"cache": true
},
Expand All @@ -397,7 +415,7 @@
"cache": true
},
"prepare": {
"cache": true,
"executor": "nx:run-script",
"inputs": [
"base"
],
Expand All @@ -406,7 +424,8 @@
],
"options": {
"script": "prepare:compile"
}
},
"cache": true
},
"build-cjs": {
"cache": true,
Expand Down
4 changes: 2 additions & 2 deletions packages/@o3r/components/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,8 @@
"scripts": {
"nx": "nx",
"ng": "yarn nx",
"copy:schemas": "yarn cpy 'schemas/*.json' dist/schemas",
"prepare:build:builders": "yarn cpy 'builders/**/*.json' dist/builders && yarn cpy 'schematics/**/*.json' 'schematics/**/templates/**' dist/schematics && yarn cpy '{builders,collection,migration}.json' dist && yarn copy:schemas",
"copy:schemas": "yarn cpy 'schemas/*.json' 'dist/schemas'",
"prepare:build:builders": "yarn cpy 'builders/**/*.json' dist/builders && yarn cpy 'schematics/**/*.json' 'schematics/**/templates/**' dist/schematics && yarn cpy '{builders,collection,migration}.json' dist",
"prepare:publish": "prepare-publish ./dist",
"prepare:compile": "cp-package-json",
"build:builders": "tsc -b tsconfig.builders.json --pretty && yarn generate-cjs-manifest",
Expand Down
5 changes: 4 additions & 1 deletion packages/@o3r/components/project.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,10 @@
"options": {
"script": "postbuild"
},
"dependsOn": ["build-builders", "compile"]
"dependsOn": ["build-builders", "compile", "expose-schemas"]
},
"expose-schemas": {
"executor": "nx:run-script"
},
"prepare": {
"executor": "nx:run-script"
Expand Down
4 changes: 2 additions & 2 deletions packages/@o3r/design/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
"build:source": "tsc -b tsconfig.build.json && yarn cpy package.json dist/",
"build:builders": "tsc -b tsconfig.builders.json --pretty && generate-cjs-manifest",
"build": "yarn nx build design",
"postbuild": "yarn copy:schemas && patch-package-json-main"
"postbuild": "patch-package-json-main"
},
"exports": {
"./package.json": {
Expand All @@ -32,7 +32,7 @@
"default": "./schemas/*.json"
},
".": {
"es2020": "./dist/src/public_api.js",
"module": "./dist/src/public_api.js",
"default": "./dist/src/public_api.js",
"typings": "./dist/src/public_api.d.ts",
"node": "./dist/src/public_api.js",
Expand Down
6 changes: 5 additions & 1 deletion packages/@o3r/design/project.json
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,13 @@
"dependsOn": [
"^build",
"build-builders",
"compile"
"compile",
"expose-schemas"
]
},
"expose-schemas": {
"executor": "nx:run-script"
},
"compile": {
"executor": "nx:run-script",
"options": {
Expand Down
3 changes: 2 additions & 1 deletion packages/@o3r/rules-engine/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,8 @@
"scripts": {
"nx": "nx",
"ng": "yarn nx",
"prepare:build:builders": "yarn cpy 'builders/**/*.json' dist/builders && yarn cpy 'schematics/**/templates/**' dist/schematics && yarn cpy '{builders,collection,migration}.json' dist && yarn cpy 'schematics/**/*.json' dist/schematics && yarn cpy 'schemas/*.json' 'dist/schemas'",
"copy:schemas": "yarn cpy 'schemas/*.json' 'dist/schemas'",
"prepare:build:builders": "yarn cpy 'builders/**/*.json' dist/builders && yarn cpy 'schematics/**/templates/**' dist/schematics && yarn cpy '{builders,collection,migration}.json' dist && yarn cpy 'schematics/**/*.json' dist/schematics",
"build:builders": "tsc -b tsconfig.builders.json --pretty && yarn generate-cjs-manifest",
"postbuild": "patch-package-json-exports",
"prepare:compile": "cp-package-json",
Expand Down
6 changes: 5 additions & 1 deletion packages/@o3r/rules-engine/project.json
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,8 @@
"build-builders",
"compile",
"build-fixtures",
"extract-rules-engine"
"extract-rules-engine",
"expose-schemas"
]
},
"compile": {
Expand All @@ -27,6 +28,9 @@
"tsConfig": "packages/@o3r/rules-engine/tsconfig.build.json"
}
},
"expose-schemas": {
"executor": "nx:run-script"
},
"prepare": {
"executor": "nx:run-script"
},
Expand Down
5 changes: 1 addition & 4 deletions packages/@o3r/telemetry/project.json
Original file line number Diff line number Diff line change
Expand Up @@ -28,10 +28,7 @@
"tsConfig": "packages/@o3r/telemetry/tsconfig.build.json",
"outputPath": "packages/@o3r/telemetry/dist",
"clean": false
},
"dependsOn": [
"^build"
]
}
},
"prepare-build-builders": {
"executor": "nx:run-script",
Expand Down
4 changes: 2 additions & 2 deletions packages/@o3r/testing/project.json
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@
"executor": "nx:run-script",
"outputs": ["{projectRoot}/dist/src/tools/protractor"],
"inputs": [
"base-build",
"base",
"{projectRoot}/tsconfig.build.tools.json",
"{projectRoot}/src/tools/protractor/fetch-manager/_fetch-manager.ts",
"{projectRoot}/src/tools/protractor/post-message-interceptor/_post-message-interceptor.ts"
Expand All @@ -63,7 +63,7 @@
"{projectRoot}/dist/esm"
],
"inputs": [
"base-build",
"base",
"{projectRoot}/tsconfig.build.utils.json",
"{projectRoot}/src/visual-test/utils.ts"
],
Expand Down
Loading

0 comments on commit 4c351b1

Please sign in to comment.