From 7ccb75e66e0b68a1835657b49be43b33d82585d7 Mon Sep 17 00:00:00 2001 From: Mathias Boeck Date: Mon, 21 Oct 2024 18:43:28 +0200 Subject: [PATCH] fix: Schematics transpile after build --- CHANGELOG.md | 3 ++- projects/core-ui/package.json | 3 ++- scripts/library/index.ts | 19 ++++++++++++++++--- 3 files changed, 20 insertions(+), 5 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index d00badc40..f1fd062de 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -6,8 +6,9 @@ ### Bug Fixes * **@dlr-eoc/core-ui:** - Update styles for `@clr 17` - - Schemantic add path in tsconfig no baseUrl + - Schematics add path in tsconfig no baseUrl - Replace not found import `IconShapeTuple` from `@cds/core` + - Schematics transpile after build because custom buiulder was removed in [v14.0.0](https://github.com/dlr-eoc/ukis-frontend-libraries/tree/v14.0.0/projects/core-ui/schematics). * **@dlr-eoc/layer-control:** - Fix direction of `@cds` icon diff --git a/projects/core-ui/package.json b/projects/core-ui/package.json index 2f0f3320a..423a34037 100644 --- a/projects/core-ui/package.json +++ b/projects/core-ui/package.json @@ -14,7 +14,8 @@ "scripts": { "build": "ng build core-ui --configuration=production --watch=false", "schematics:build": "tsc -p tsconfig.schematics.json", - "preschematics:test": "npm run build && npm run schematics:build", + "postbuild": "npm run schematics:build", + "preschematics:test": "npm run build", "schematics:test": "npx jasmine ../../dist/core-ui/schematics/**/*_spec.js" }, "ng-add": { diff --git a/scripts/library/index.ts b/scripts/library/index.ts index 91e6f2cef..d91046ce9 100644 --- a/scripts/library/index.ts +++ b/scripts/library/index.ts @@ -4,7 +4,7 @@ * node scripts/projectsVersion.js -l */ -import { fork } from 'child_process'; +import { fork, spawn } from 'child_process'; import { join } from 'path'; import { existsSync } from 'fs'; import { Command } from 'commander'; @@ -112,8 +112,21 @@ function runBuilds(offset = 0, projects) { const project = projects[offset]; const cliArgs = ['build', '--configuration=production', '--watch=false', project]; if (project) { - console.log(consoleLogColors.Bright, `---------------------->>> ${offset + 1}: run ng ${cliArgs.join(' ')}`); - const child = fork(`${__dirname}/run-ng.js`, cliArgs); + + const packageJson: IPackageJSON = require(join(CWD, ANGULARJSON.projects[project].root, 'package.json')); + let child = null; + if(packageJson && packageJson.scripts && packageJson.scripts['build']){ + const spawnCliArgs = ['run', 'build', `--workspace=projects/${project}`]; + console.log(consoleLogColors.Bright, `---------------------->>> ${offset + 1}: npm ${spawnCliArgs.join(' ')}`); + let command = 'npm'; + if (process.platform !== 'win32') { + command = 'npm.cmd' + } + child = spawn(command, spawnCliArgs, { stdio: "inherit", shell: true }); + }else{ + console.log(consoleLogColors.Bright, `---------------------->>> ${offset + 1}: run ng ${cliArgs.join(' ')}`); + child = fork(`${__dirname}/run-ng.js`, cliArgs); + } child.on('close', (code, signal) => { offset++; if (offset >= projects.length) {