From 7291de0d7853d9976f249d6f331aa8bc3e354690 Mon Sep 17 00:00:00 2001 From: Mateusz Baginski Date: Mon, 4 Nov 2024 14:21:26 +0100 Subject: [PATCH] Fix CI --- package.json | 2 +- scripts/preparepackages.mjs | 28 +++++++++---------- .../angular-integration-usage-data.plugin.ts | 4 +-- src/environments/environment.prod.ts | 5 +--- src/environments/environment.ts | 5 +--- 5 files changed, 19 insertions(+), 25 deletions(-) diff --git a/package.json b/package.json index 8ac95ff..bfda5fa 100644 --- a/package.json +++ b/package.json @@ -14,7 +14,7 @@ "coverage": "ng test --watch=false --code-coverage", "lint": "eslint \"*/**/*.+(js|mjs|ts)\"", "changelog": "node ./scripts/changelog.mjs", - "build-package": "ng-packagr -p src/ckeditor/ng-package.json", + "build-package": "ng-packagr -p src/ckeditor/ng-package.json --config tsconfig.json", "release:prepare-packages": "node scripts/preparepackages.mjs", "release:publish-packages": "node scripts/publishpackages.mjs" }, diff --git a/scripts/preparepackages.mjs b/scripts/preparepackages.mjs index 7c237f3..0263c5f 100644 --- a/scripts/preparepackages.mjs +++ b/scripts/preparepackages.mjs @@ -69,22 +69,10 @@ const tasks = new Listr( [ } }, { - title: 'Generating the `dist` directory.', - task: () => { - return devUtils.tools.shExec( 'yarn run build-package', { async: true, verbosity: 'silent' } ); - } - }, - { - title: 'Copying dist to release directory.', - task: () => { - return fs.copy( DIST_DIR, RELEASE_ANGULAR_DIR ); - } - }, - { - title: 'Updating the `#version` field in the `package.json` in the release directory', + title: 'Updating the `#version` field in the `package.json` in the source directory', task: () => { return devUtils.tools.updateJSONFile( - upath.join( RELEASE_ANGULAR_DIR, 'package.json' ), + upath.join( CKEDITOR5_ANGULAR_ROOT_DIR, 'src', 'ckeditor', 'package.json' ), packageJson => { packageJson.version = latestVersion; @@ -100,6 +88,18 @@ const tasks = new Listr( [ return false; } }, + { + title: 'Generating the `dist` directory.', + task: () => { + return devUtils.tools.shExec( 'yarn run build-package', { async: true, verbosity: 'silent' } ); + } + }, + { + title: 'Copying dist to release directory.', + task: () => { + return fs.copy( DIST_DIR, RELEASE_ANGULAR_DIR ); + } + }, { title: 'Copying required assets to the release directory.', task: () => { diff --git a/src/ckeditor/plugins/angular-integration-usage-data.plugin.ts b/src/ckeditor/plugins/angular-integration-usage-data.plugin.ts index deac516..dba24b6 100644 --- a/src/ckeditor/plugins/angular-integration-usage-data.plugin.ts +++ b/src/ckeditor/plugins/angular-integration-usage-data.plugin.ts @@ -5,7 +5,7 @@ import { VERSION } from '@angular/core'; import { createIntegrationUsageDataPlugin } from '@ckeditor/ckeditor5-integrations-common'; -import { environment } from '../../environments/environment'; +import { version } from '../package.json'; /** * This part of the code is not executed in open-source implementations using a GPL key. @@ -15,7 +15,7 @@ import { environment } from '../../environments/environment'; export const AngularIntegrationUsageDataPlugin = createIntegrationUsageDataPlugin( 'angular', { - version: environment.appVersion, + version, frameworkVersion: VERSION.full } ); diff --git a/src/environments/environment.prod.ts b/src/environments/environment.prod.ts index f4e9e82..8b7239d 100644 --- a/src/environments/environment.prod.ts +++ b/src/environments/environment.prod.ts @@ -1,6 +1,3 @@ -import { version } from '../ckeditor/package.json'; - export const environment = { - production: true, - appVersion: version + production: true }; diff --git a/src/environments/environment.ts b/src/environments/environment.ts index 957736a..c988d4f 100644 --- a/src/environments/environment.ts +++ b/src/environments/environment.ts @@ -3,9 +3,6 @@ // `ng build --env=prod` then `environment.prod.ts` will be used instead. // The list of which env maps to which file can be found in `.angular-cli.json`. -import pkg from '../../package.json'; - export const environment = { - production: false, - appVersion: pkg.version + production: false };