Skip to content

Commit

Permalink
ci: independent monorepo sub path (#7371)
Browse files Browse the repository at this point in the history
  • Loading branch information
splincode committed May 6, 2024
1 parent e68e5d9 commit e47b45d
Show file tree
Hide file tree
Showing 23 changed files with 2,995 additions and 1,324 deletions.
8 changes: 7 additions & 1 deletion .github/workflows/e2e-playwright.yml
Expand Up @@ -19,7 +19,7 @@ jobs:
- run: npx tsc -p tsconfig.playwright.json

- name: Building demo-app of git-branch without cache
run: npx nx build demo
run: npx nx build demo -- --base-href /

- name: Upload cache / ${{ env.CACHE_DIST_KEY }}
uses: actions/cache/save@v4.0.2
Expand Down Expand Up @@ -67,6 +67,12 @@ jobs:
--branch snapshots/demo/next/${{ github.base_ref }} \
https://github.com/${{ github.repository }}.git ${{ env.DIST_NEXT }}
- uses: jacobtomlinson/gha-find-replace@v3
with:
find: '<base href="./">'
replace: '<base href="/">'
include: '${{ env.DIST_NEXT }}/index.html'
regex: false
- name: Serve ${{ env.DIST_NEXT }} in background
run: npx nx serve-compiled demo --path ${{ env.DIST_NEXT }} --port ${{ env.NG_SERVER_PORT }}

Expand Down
4,159 changes: 2,912 additions & 1,247 deletions package-lock.json

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion package.json
Expand Up @@ -125,10 +125,10 @@
"@types/node": "20.11.30",
"@types/webpack-env": "1.18.4",
"cpy-cli": "5.0.0",
"http-server": "14.1.1",
"husky": "9.0.11",
"kill-port": "2.0.1",
"lint-staged": "15.2.2",
"local-web-server": "5.3.3",
"ng-packagr": "16.2.3",
"nx": "18.3.4",
"rollup": "4.17.2",
Expand Down
6 changes: 3 additions & 3 deletions projects/addon-charts/project.json
Expand Up @@ -11,7 +11,7 @@
"outputs": ["{workspaceRoot}/dist/addon-charts"],
"options": {
"tsConfig": "tsconfig.build.json",
"project": "projects/addon-charts/ng-package.json"
"project": "{projectRoot}/ng-package.json"
},
"dependsOn": [
{
Expand All @@ -27,8 +27,8 @@
"options": {
"jestConfig": "jest.config.ts",
"coverageDirectory": "coverage/addon-charts",
"collectCoverageFrom": ["<rootDir>/projects/addon-charts/**/*.ts"],
"testMatch": ["<rootDir>/projects/addon-charts/**/*.spec.ts"]
"collectCoverageFrom": ["<rootDir>/{projectRoot}/**/*.ts"],
"testMatch": ["<rootDir>/{projectRoot}/**/*.spec.ts"]
}
},
"publish": {
Expand Down
6 changes: 3 additions & 3 deletions projects/addon-commerce/project.json
Expand Up @@ -11,7 +11,7 @@
"outputs": ["{workspaceRoot}/dist/addon-commerce"],
"options": {
"tsConfig": "tsconfig.build.json",
"project": "projects/addon-commerce/ng-package.json"
"project": "{projectRoot}/ng-package.json"
},
"dependsOn": [
{
Expand All @@ -27,8 +27,8 @@
"options": {
"jestConfig": "jest.config.ts",
"coverageDirectory": "coverage/addon-commerce",
"collectCoverageFrom": ["<rootDir>/projects/addon-commerce/**/*.ts"],
"testMatch": ["<rootDir>/projects/addon-commerce/**/*.spec.ts"]
"collectCoverageFrom": ["<rootDir>/{projectRoot}/**/*.ts"],
"testMatch": ["<rootDir>/{projectRoot}/**/*.spec.ts"]
}
},
"publish": {
Expand Down
6 changes: 3 additions & 3 deletions projects/addon-doc/project.json
Expand Up @@ -11,7 +11,7 @@
"outputs": ["{workspaceRoot}/dist/addon-doc"],
"options": {
"tsConfig": "tsconfig.build.json",
"project": "projects/addon-doc/ng-package.json"
"project": "{projectRoot}/ng-package.json"
},
"dependsOn": [
{
Expand All @@ -27,8 +27,8 @@
"options": {
"jestConfig": "jest.config.ts",
"coverageDirectory": "coverage/addon-doc",
"collectCoverageFrom": ["<rootDir>/projects/addon-doc/**/*.ts"],
"testMatch": ["<rootDir>/projects/addon-doc/**/*.spec.ts"]
"collectCoverageFrom": ["<rootDir>/{projectRoot}/**/*.ts"],
"testMatch": ["<rootDir>/{projectRoot}/**/*.spec.ts"]
}
},
"publish": {
Expand Down
8 changes: 4 additions & 4 deletions projects/addon-mobile/project.json
@@ -1,7 +1,7 @@
{
"name": "addon-mobile",
"$schema": "../../node_modules/nx/schemas/project-schema.json",
"sourceRoot": "projects/addon-mobile/src",
"sourceRoot": "projects/addon-mobile",
"projectType": "library",
"prefix": "tui",
"implicitDependencies": ["!testing"],
Expand All @@ -11,7 +11,7 @@
"outputs": ["{workspaceRoot}/dist/addon-mobile"],
"options": {
"tsConfig": "tsconfig.build.json",
"project": "projects/addon-mobile/ng-package.json"
"project": "{projectRoot}/ng-package.json"
},
"dependsOn": [
{
Expand All @@ -27,8 +27,8 @@
"options": {
"jestConfig": "jest.config.ts",
"coverageDirectory": "coverage/addon-mobile",
"collectCoverageFrom": ["<rootDir>/projects/addon-mobile/**/*.ts"],
"testMatch": ["<rootDir>/projects/addon-mobile/**/*.spec.ts"]
"collectCoverageFrom": ["<rootDir>/{projectRoot}/**/*.ts"],
"testMatch": ["<rootDir>/{projectRoot}/**/*.spec.ts"]
}
},
"publish": {
Expand Down
8 changes: 4 additions & 4 deletions projects/addon-preview/project.json
@@ -1,7 +1,7 @@
{
"name": "addon-preview",
"$schema": "../../node_modules/nx/schemas/project-schema.json",
"sourceRoot": "projects/addon-preview/src",
"sourceRoot": "projects/addon-preview",
"projectType": "library",
"prefix": "tui",
"implicitDependencies": ["!testing"],
Expand All @@ -11,7 +11,7 @@
"outputs": ["{workspaceRoot}/dist/addon-preview"],
"options": {
"tsConfig": "tsconfig.build.json",
"project": "projects/addon-preview/ng-package.json"
"project": "{projectRoot}/ng-package.json"
},
"dependsOn": [
{
Expand All @@ -27,8 +27,8 @@
"options": {
"jestConfig": "jest.config.ts",
"coverageDirectory": "coverage/addon-preview",
"collectCoverageFrom": ["<rootDir>/projects/addon-preview/**/*.ts"],
"testMatch": ["<rootDir>/projects/addon-preview/**/*.spec.ts"]
"collectCoverageFrom": ["<rootDir>/{projectRoot}/**/*.ts"],
"testMatch": ["<rootDir>/{projectRoot}/**/*.spec.ts"]
}
},
"publish": {
Expand Down
6 changes: 3 additions & 3 deletions projects/addon-table/project.json
Expand Up @@ -11,7 +11,7 @@
"outputs": ["{workspaceRoot}/dist/addon-table"],
"options": {
"tsConfig": "tsconfig.build.json",
"project": "projects/addon-table/ng-package.json"
"project": "{projectRoot}/ng-package.json"
},
"dependsOn": [
{
Expand All @@ -27,8 +27,8 @@
"options": {
"jestConfig": "jest.config.ts",
"coverageDirectory": "coverage/addon-table",
"collectCoverageFrom": ["<rootDir>/projects/addon-table/**/*.ts"],
"testMatch": ["<rootDir>/projects/addon-table/**/*.spec.ts"]
"collectCoverageFrom": ["<rootDir>/{projectRoot}/**/*.ts"],
"testMatch": ["<rootDir>/{projectRoot}/**/*.spec.ts"]
}
},
"publish": {
Expand Down
8 changes: 4 additions & 4 deletions projects/addon-tablebars/project.json
@@ -1,7 +1,7 @@
{
"name": "addon-tablebars",
"$schema": "../../node_modules/nx/schemas/project-schema.json",
"sourceRoot": "projects/addon-tablebars/src",
"sourceRoot": "projects/addon-tablebars",
"projectType": "library",
"prefix": "tui",
"implicitDependencies": ["!testing"],
Expand All @@ -11,7 +11,7 @@
"outputs": ["{workspaceRoot}/dist/addon-tablebars"],
"options": {
"tsConfig": "tsconfig.build.json",
"project": "projects/addon-tablebars/ng-package.json"
"project": "{projectRoot}/ng-package.json"
},
"dependsOn": [
{
Expand All @@ -27,8 +27,8 @@
"options": {
"jestConfig": "jest.config.ts",
"coverageDirectory": "coverage/addon-tablebars",
"collectCoverageFrom": ["<rootDir>/projects/addon-tablebars/**/*.ts"],
"testMatch": ["<rootDir>/projects/addon-tablebars/**/*.spec.ts"]
"collectCoverageFrom": ["<rootDir>/{projectRoot}/**/*.ts"],
"testMatch": ["<rootDir>/{projectRoot}/**/*.spec.ts"]
}
},
"publish": {
Expand Down
8 changes: 4 additions & 4 deletions projects/cdk/project.json
Expand Up @@ -10,7 +10,7 @@
"executor": "@angular-devkit/build-angular:ng-packagr",
"options": {
"tsConfig": "tsconfig.build.json",
"project": "projects/cdk/ng-package.json"
"project": "{projectRoot}/ng-package.json"
},
"dependsOn": [
{
Expand All @@ -31,7 +31,7 @@
"postbuild": {
"executor": "nx:run-commands",
"options": {
"command": "tsc -p ./projects/cdk/schematics/tsconfig.schematics.json"
"command": "tsc -p ./{projectRoot}/schematics/tsconfig.schematics.json"
}
},
"schematics": {
Expand All @@ -52,8 +52,8 @@
"options": {
"jestConfig": "jest.config.ts",
"coverageDirectory": "coverage/cdk",
"collectCoverageFrom": ["<rootDir>/projects/cdk/**/*.ts"],
"testMatch": ["<rootDir>/projects/cdk/**/*.spec.ts"]
"collectCoverageFrom": ["<rootDir>/{projectRoot}/**/*.ts"],
"testMatch": ["<rootDir>/{projectRoot}/**/*.spec.ts"]
},
"dependsOn": [
{
Expand Down
6 changes: 3 additions & 3 deletions projects/core/project.json
Expand Up @@ -11,7 +11,7 @@
"outputs": ["{workspaceRoot}/dist/core"],
"options": {
"tsConfig": "tsconfig.build.json",
"project": "projects/core/ng-package.json"
"project": "{projectRoot}/ng-package.json"
},
"dependsOn": [
{
Expand All @@ -27,8 +27,8 @@
"options": {
"jestConfig": "jest.config.ts",
"coverageDirectory": "coverage/core",
"collectCoverageFrom": ["<rootDir>/projects/core/**/*.ts"],
"testMatch": ["<rootDir>/projects/core/**/*.spec.ts"]
"collectCoverageFrom": ["<rootDir>/{projectRoot}/**/*.ts"],
"testMatch": ["<rootDir>/{projectRoot}/**/*.spec.ts"]
}
},
"publish": {
Expand Down
4 changes: 2 additions & 2 deletions projects/demo-cypress/project.json
@@ -1,14 +1,14 @@
{
"name": "demo-cypress",
"$schema": "../../node_modules/nx/schemas/project-schema.json",
"sourceRoot": "projects/demo-cypress/cypress",
"sourceRoot": "projects/demo-cypress",
"projectType": "application",
"prefix": "app",
"targets": {
"component-test": {
"executor": "@nx/cypress:cypress",
"options": {
"cypressConfig": "projects/demo-cypress/cypress.config.ts",
"cypressConfig": "{projectRoot}/cypress.config.ts",
"testingType": "component",
"skipServe": true,
"devServerTarget": "demo:build"
Expand Down
4 changes: 2 additions & 2 deletions projects/demo-playwright/project.json
@@ -1,14 +1,14 @@
{
"name": "demo-playwright",
"$schema": "../../node_modules/nx/schemas/project-schema.json",
"sourceRoot": "projects/demo-playwright/cypress",
"sourceRoot": "projects/demo-playwright",
"projectType": "application",
"prefix": "app",
"targets": {
"e2e": {
"executor": "nx:run-commands",
"options": {
"command": "playwright test --config projects/demo-playwright/playwright.config.ts"
"command": "playwright test --config {projectRoot}/playwright.config.ts"
}
},
"e2e-ui": {
Expand Down
40 changes: 20 additions & 20 deletions projects/demo/project.json
@@ -1,7 +1,7 @@
{
"name": "demo",
"$schema": "../../node_modules/nx/schemas/project-schema.json",
"sourceRoot": "projects/demo/src",
"sourceRoot": "projects/demo",
"projectType": "application",
"prefix": "app",
"implicitDependencies": ["!testing"],
Expand All @@ -27,15 +27,15 @@
"path": "projects/demo/webpack.config.ts"
},
"outputPath": "dist/demo/browser",
"index": "projects/demo/src/index.html",
"main": "projects/demo/src/main.ts",
"polyfills": "projects/demo/src/polyfills.ts",
"index": "{projectRoot}/src/index.html",
"main": "{projectRoot}/src/main.ts",
"polyfills": "{projectRoot}/src/polyfills.ts",
"tsConfig": "projects/demo/tsconfig.app.json",
"assets": [
"projects/demo/src/404.html",
"{projectRoot}/src/404.html",
{
"glob": "**/*",
"input": "projects/demo/src/assets/",
"input": "{projectRoot}/src/assets/",
"output": "./assets/"
},
{
Expand All @@ -46,9 +46,9 @@
],
"baseHref": "./",
"styles": [
"projects/demo/src/styles/normalize.less",
"projects/demo/src/styles/styles.less",
"projects/demo/src/styles/styles.scss"
"{projectRoot}/src/styles/normalize.less",
"{projectRoot}/src/styles/styles.less",
"{projectRoot}/src/styles/styles.scss"
],
"scripts": [],
"allowedCommonJsDependencies": ["markdown-it"],
Expand All @@ -63,8 +63,8 @@
"production": {
"fileReplacements": [
{
"replace": "projects/demo/src/environments/environment.ts",
"with": "projects/demo/src/environments/environment.prod.ts"
"replace": "{projectRoot}/src/environments/environment.ts",
"with": "{projectRoot}/src/environments/environment.prod.ts"
}
],
"optimization": true,
Expand All @@ -82,17 +82,17 @@
"baseHref": "/",
"fileReplacements": [
{
"replace": "projects/demo/src/emulate/change-detection-strategy.ts",
"with": "projects/demo/src/emulate/change-detection-strategy.def.ts"
"replace": "{projectRoot}/src/emulate/change-detection-strategy.ts",
"with": "{projectRoot}/src/emulate/change-detection-strategy.def.ts"
}
]
},
"shadow": {
"baseHref": "/",
"fileReplacements": [
{
"replace": "projects/demo/src/emulate/view-encapsulation.ts",
"with": "projects/demo/src/emulate/view-encapsulation.shadow.ts"
"replace": "{projectRoot}/src/emulate/view-encapsulation.ts",
"with": "{projectRoot}/src/emulate/view-encapsulation.shadow.ts"
}
]
},
Expand Down Expand Up @@ -188,19 +188,19 @@
"serve-compiled": {
"executor": "nx:run-commands",
"options": {
"command": "http-server {args.path} --brotli --port {args.port} > /dev/null & npx wait-on http://127.0.0.1:{args.port} --timeout 300000",
"command": "ws --port {args.port} --directory {args.path} --spa index.html > /dev/null & npx wait-on http://127.0.0.1:{args.port} --timeout 300000",
"forwardAllArgs": false
}
},
"server": {
"executor": "@nx/angular:webpack-server",
"options": {
"customWebpackConfig": {
"path": "projects/demo/webpack.server.config.ts"
"path": "{projectRoot}/webpack.server.config.ts"
},
"outputPath": "dist/demo/server",
"main": "projects/demo/server.ts",
"tsConfig": "projects/demo/tsconfig.server.json",
"main": "{projectRoot}/server.ts",
"tsConfig": "{projectRoot}/tsconfig.server.json",
"sourceMap": true,
"optimization": false
},
Expand Down Expand Up @@ -250,7 +250,7 @@
"options": {
"jestConfig": "jest.config.ts",
"collectCoverage": false,
"testMatch": ["<rootDir>/projects/demo/**/*.spec.ts"]
"testMatch": ["<rootDir>/{projectRoot}/src/**/*.spec.ts"]
}
}
}
Expand Down

0 comments on commit e47b45d

Please sign in to comment.