Skip to content

Commit

Permalink
ci: add prepublish target (#8026)
Browse files Browse the repository at this point in the history
  • Loading branch information
splincode authored Jul 3, 2024
1 parent e9f9627 commit e9c3584
Show file tree
Hide file tree
Showing 20 changed files with 333 additions and 198 deletions.
10 changes: 5 additions & 5 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@
"start:host": "nx serve demo --open --host 0.0.0.0 --disable-host-check",
"build:ssr": "nx build demo && nx run demo:server:production",
"prerender": "nx run demo:prerender",
"test": "nx run-many --target test --all --output-style=stream --parallel=1",
"test": "nx run-many --target test --all --output-style=stream",
"test:e2e": "nx e2e-ui demo-cypress",
"*** Workflow ***": "",
"stylelint": "stylelint '**/*.{less,css}' --config package.json",
Expand All @@ -51,10 +51,10 @@
"release:minor": "ts-node ./scripts/release.ts --release-as minor",
"release:major": "ts-node ./scripts/release.ts --release-as major",
"*** CI ***": "",
"affected:test:libs": "nx affected --target test --exclude=demo --output-style=stream",
"affected:build:libs": "nx affected --target build --exclude=demo --output-style=stream",
"run-many:build:libs": "nx run-many --target build --all --exclude=demo --output-style=stream",
"run-many:publish:libs": "nx run-many --target publish --all --output-style=stream"
"affected:test:libs": "nx affected --target test --exclude=demo --output-style=stream --nxBail",
"affected:build:libs": "nx affected --target build --exclude=demo --output-style=stream --nxBail",
"run-many:build:libs": "nx run-many --target build --all --exclude=demo --output-style=stream --nxBail",
"run-many:publish:libs": "nx run-many --target publish --all --output-style=stream --nxBail"
},
"commitlint": {
"extends": [
Expand Down
29 changes: 19 additions & 10 deletions projects/addon-charts/project.json
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
{
"name": "addon-charts",
"$schema": "../../node_modules/nx/schemas/project-schema.json",
"sourceRoot": "projects/addon-charts",
"sourceRoot": "projects/{projectName}",
"projectType": "library",
"prefix": "tui",
"implicitDependencies": ["!testing"],
"targets": {
"build": {
"executor": "@angular-devkit/build-angular:ng-packagr",
"outputs": ["{workspaceRoot}/dist/addon-charts"],
"outputs": ["{workspaceRoot}/dist/{projectName}"],
"options": {
"tsConfig": "tsconfig.build.json",
"project": "projects/addon-charts/ng-package.json"
Expand All @@ -23,23 +23,32 @@
},
"test": {
"executor": "@nx/jest:jest",
"outputs": ["{workspaceRoot}/coverage/addon-charts"],
"outputs": ["{workspaceRoot}/coverage/{projectName}"],
"options": {
"jestConfig": "jest.config.ts",
"coverageDirectory": "coverage/addon-charts",
"coverageDirectory": "coverage/{projectName}",
"collectCoverageFrom": ["<rootDir>/projects/addon-charts/**/*.ts"],
"testMatch": ["<rootDir>/projects/addon-charts/**/*.spec.ts"]
}
},
"publish": {
"prepublish": {
"executor": "nx:run-commands",
"options": {
"commands": [
"cp ./LICENSE ./dist/addon-charts",
"ts-node ./scripts/publish.ts --path ./dist/addon-charts --dry-run {args.dry-run} --customVersion {args.customVersion} --customTag {args.customTag}"
],
"parallel": false
"command": "cp ./LICENSE ./dist/{projectName}"
}
},
"publish": {
"executor": "nx:run-commands",
"options": {
"command": "ts-node ./scripts/publish.ts --path ./dist/{projectName} --dry-run {args.dry-run} --customVersion {args.customVersion} --customTag {args.customTag}"
},
"dependsOn": [
{
"target": "prepublish",
"params": "ignore",
"dependencies": false
}
]
}
}
}
29 changes: 19 additions & 10 deletions projects/addon-commerce/project.json
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
{
"name": "addon-commerce",
"$schema": "../../node_modules/nx/schemas/project-schema.json",
"sourceRoot": "projects/addon-commerce",
"sourceRoot": "projects/{projectName}",
"projectType": "library",
"prefix": "tui",
"implicitDependencies": ["!testing"],
"targets": {
"build": {
"executor": "@angular-devkit/build-angular:ng-packagr",
"outputs": ["{workspaceRoot}/dist/addon-commerce"],
"outputs": ["{workspaceRoot}/dist/{projectName}"],
"options": {
"tsConfig": "tsconfig.build.json",
"project": "projects/addon-commerce/ng-package.json"
Expand All @@ -23,23 +23,32 @@
},
"test": {
"executor": "@nx/jest:jest",
"outputs": ["{workspaceRoot}/coverage/addon-commerce"],
"outputs": ["{workspaceRoot}/coverage/{projectName}"],
"options": {
"jestConfig": "jest.config.ts",
"coverageDirectory": "coverage/addon-commerce",
"coverageDirectory": "coverage/{projectName}",
"collectCoverageFrom": ["<rootDir>/projects/addon-commerce/**/*.ts"],
"testMatch": ["<rootDir>/projects/addon-commerce/**/*.spec.ts"]
}
},
"publish": {
"prepublish": {
"executor": "nx:run-commands",
"options": {
"commands": [
"cp ./LICENSE ./dist/addon-commerce",
"ts-node ./scripts/publish.ts --path ./dist/addon-commerce --dry-run {args.dry-run} --customVersion {args.customVersion} --customTag {args.customTag}"
],
"parallel": false
"command": "cp ./LICENSE ./dist/{projectName}"
}
},
"publish": {
"executor": "nx:run-commands",
"options": {
"command": "ts-node ./scripts/publish.ts --path ./dist/{projectName} --dry-run {args.dry-run} --customVersion {args.customVersion} --customTag {args.customTag}"
},
"dependsOn": [
{
"target": "prepublish",
"params": "ignore",
"dependencies": false
}
]
}
}
}
29 changes: 19 additions & 10 deletions projects/addon-doc/project.json
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
{
"name": "addon-doc",
"$schema": "../../node_modules/nx/schemas/project-schema.json",
"sourceRoot": "projects/addon-doc",
"sourceRoot": "projects/{projectName}",
"projectType": "library",
"prefix": "tui",
"implicitDependencies": ["!testing"],
"targets": {
"build": {
"executor": "@angular-devkit/build-angular:ng-packagr",
"outputs": ["{workspaceRoot}/dist/addon-doc"],
"outputs": ["{workspaceRoot}/dist/{projectName}"],
"options": {
"tsConfig": "tsconfig.build.json",
"project": "projects/addon-doc/ng-package.json"
Expand All @@ -23,23 +23,32 @@
},
"test": {
"executor": "@nx/jest:jest",
"outputs": ["{workspaceRoot}/coverage/addon-doc"],
"outputs": ["{workspaceRoot}/coverage/{projectName}"],
"options": {
"jestConfig": "jest.config.ts",
"coverageDirectory": "coverage/addon-doc",
"coverageDirectory": "coverage/{projectName}",
"collectCoverageFrom": ["<rootDir>/projects/addon-doc/**/*.ts"],
"testMatch": ["<rootDir>/projects/addon-doc/**/*.spec.ts"]
}
},
"publish": {
"prepublish": {
"executor": "nx:run-commands",
"options": {
"commands": [
"cp ./LICENSE ./dist/addon-doc",
"ts-node ./scripts/publish.ts --path ./dist/addon-doc --dry-run {args.dry-run} --customVersion {args.customVersion} --customTag {args.customTag}"
],
"parallel": false
"command": "cp ./LICENSE ./dist/{projectName}"
}
},
"publish": {
"executor": "nx:run-commands",
"options": {
"command": "ts-node ./scripts/publish.ts --path ./dist/{projectName} --dry-run {args.dry-run} --customVersion {args.customVersion} --customTag {args.customTag}"
},
"dependsOn": [
{
"target": "prepublish",
"params": "ignore",
"dependencies": false
}
]
}
}
}
33 changes: 21 additions & 12 deletions projects/addon-mobile/project.json
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
{
"name": "addon-mobile",
"$schema": "../../node_modules/nx/schemas/project-schema.json",
"sourceRoot": "projects/addon-mobile/src",
"sourceRoot": "projects/{projectName}",
"projectType": "library",
"prefix": "tui",
"implicitDependencies": ["!testing"],
"targets": {
"build": {
"executor": "@angular-devkit/build-angular:ng-packagr",
"outputs": ["{workspaceRoot}/dist/addon-mobile"],
"outputs": ["{workspaceRoot}/dist/{projectName}"],
"options": {
"tsConfig": "tsconfig.build.json",
"project": "projects/addon-mobile/ng-package.json"
Expand All @@ -23,23 +23,32 @@
},
"test": {
"executor": "@nx/jest:jest",
"outputs": ["{workspaceRoot}/coverage/addon-mobile"],
"outputs": ["{workspaceRoot}/coverage/{projectName}"],
"options": {
"jestConfig": "jest.config.ts",
"coverageDirectory": "coverage/addon-mobile",
"collectCoverageFrom": ["<rootDir>/projects/addon-mobile/**/*.ts"],
"testMatch": ["<rootDir>/projects/addon-mobile/**/*.spec.ts"]
"coverageDirectory": "coverage/{projectName}",
"collectCoverageFrom": ["<rootDir>/{projectRoot}/**/*.ts"],
"testMatch": ["<rootDir>/{projectRoot}/**/*.spec.ts"]
}
},
"publish": {
"prepublish": {
"executor": "nx:run-commands",
"options": {
"commands": [
"cp ./LICENSE ./dist/addon-mobile",
"ts-node ./scripts/publish.ts --path ./dist/addon-mobile --dry-run {args.dry-run} --customVersion {args.customVersion} --customTag {args.customTag}"
],
"parallel": false
"command": "cp ./LICENSE ./dist/{projectName}"
}
},
"publish": {
"executor": "nx:run-commands",
"options": {
"command": "ts-node ./scripts/publish.ts --path ./dist/{projectName} --dry-run {args.dry-run} --customVersion {args.customVersion} --customTag {args.customTag}"
},
"dependsOn": [
{
"target": "prepublish",
"params": "ignore",
"dependencies": false
}
]
}
}
}
27 changes: 18 additions & 9 deletions projects/addon-table/project.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "addon-table",
"$schema": "../../node_modules/nx/schemas/project-schema.json",
"sourceRoot": "projects/addon-table",
"sourceRoot": "projects/{projectName}",
"projectType": "library",
"prefix": "tui",
"implicitDependencies": ["!testing"],
Expand All @@ -23,23 +23,32 @@
},
"test": {
"executor": "@nx/jest:jest",
"outputs": ["{workspaceRoot}/coverage/addon-table"],
"outputs": ["{workspaceRoot}/coverage/{projectName}"],
"options": {
"jestConfig": "jest.config.ts",
"coverageDirectory": "coverage/addon-table",
"coverageDirectory": "coverage/{projectName}",
"collectCoverageFrom": ["<rootDir>/projects/addon-table/**/*.ts"],
"testMatch": ["<rootDir>/projects/addon-table/**/*.spec.ts"]
}
},
"publish": {
"prepublish": {
"executor": "nx:run-commands",
"options": {
"commands": [
"cp ./LICENSE ./dist/addon-table",
"ts-node ./scripts/publish.ts --path ./dist/addon-table --dry-run {args.dry-run} --customVersion {args.customVersion} --customTag {args.customTag}"
],
"parallel": false
"command": "cp ./LICENSE ./dist/{projectName}"
}
},
"publish": {
"executor": "nx:run-commands",
"options": {
"command": "ts-node ./scripts/publish.ts --path ./dist/{projectName} --dry-run {args.dry-run} --customVersion {args.customVersion} --customTag {args.customTag}"
},
"dependsOn": [
{
"target": "prepublish",
"params": "ignore",
"dependencies": false
}
]
}
}
}
31 changes: 20 additions & 11 deletions projects/cdk/project.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "cdk",
"$schema": "../../node_modules/nx/schemas/project-schema.json",
"sourceRoot": "projects/cdk",
"sourceRoot": "projects/{projectName}",
"projectType": "library",
"prefix": "tui",
"implicitDependencies": ["!testing", "!core", "!styles"],
Expand All @@ -25,7 +25,7 @@
"outputs": ["{workspaceRoot}/dist/cdk"],
"options": {
"parallel": false,
"commands": ["nx prebuild cdk", "nx postbuild cdk"]
"commands": ["nx prebuild {projectName}", "nx postbuild {projectName}"]
}
},
"postbuild": {
Expand All @@ -37,7 +37,7 @@
"schematics": {
"executor": "nx:run-commands",
"options": {
"command": "schematics ./dist/cdk:updateToV{args.v} --allow-private --dry-run true"
"command": "schematics ./dist/{projectName}:updateToV{args.v} --allow-private --dry-run true"
},
"dependsOn": [
{
Expand All @@ -48,10 +48,10 @@
},
"test": {
"executor": "@nx/jest:jest",
"outputs": ["{workspaceRoot}/coverage/cdk"],
"outputs": ["{workspaceRoot}/coverage/{projectName}"],
"options": {
"jestConfig": "jest.config.ts",
"coverageDirectory": "coverage/cdk",
"coverageDirectory": "coverage/{projectName}",
"collectCoverageFrom": ["<rootDir>/projects/cdk/**/*.ts"],
"testMatch": ["<rootDir>/projects/cdk/**/*.spec.ts"]
},
Expand All @@ -62,15 +62,24 @@
}
]
},
"publish": {
"prepublish": {
"executor": "nx:run-commands",
"options": {
"commands": [
"cp ./LICENSE ./dist/cdk",
"ts-node ./scripts/publish.ts --path ./dist/cdk --dry-run {args.dry-run} --customVersion {args.customVersion} --customTag {args.customTag}"
],
"parallel": false
"command": "cp ./LICENSE ./dist/{projectName}"
}
},
"publish": {
"executor": "nx:run-commands",
"options": {
"command": "ts-node ./scripts/publish.ts --path ./dist/{projectName} --dry-run {args.dry-run} --customVersion {args.customVersion} --customTag {args.customTag}"
},
"dependsOn": [
{
"target": "prepublish",
"params": "ignore",
"dependencies": false
}
]
}
}
}
Loading

0 comments on commit e9c3584

Please sign in to comment.