Skip to content

Commit

Permalink
Make Clarity peer dependencies more relaxed (#2377)
Browse files Browse the repository at this point in the history
+ update replace-versions.js script to do it automatically for Clarity versions too (not just Angular)
+ bump version to 18.1.6
  • Loading branch information
martinbrom authored Nov 20, 2024
1 parent 1cdeea4 commit bb184c4
Show file tree
Hide file tree
Showing 5 changed files with 20 additions and 16 deletions.
4 changes: 2 additions & 2 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "clr-addons",
"version": "18.1.5",
"version": "18.1.6",
"private": true,
"scripts": {
"build:ui:css": "sass --source-map --precision=8 ./src/clr-addons/themes/phs/phs-theme.scss ./dist/clr-addons/styles/clr-addons-phs.css",
Expand Down
14 changes: 9 additions & 5 deletions replace-versions.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,16 +13,16 @@ readFile('./package.json', 'utf-8', (err, data) => {
const packageJson = JSON.parse(data);
const addonsVersion = packageJson.version;
let angularVersion = packageJson.dependencies['@angular/core'];
const clarityVersion = packageJson.dependencies['@clr/angular'];
const cdsCoreVersion = packageJson.dependencies['@cds/core'];
let clarityVersion = packageJson.dependencies['@clr/angular'];
let cdsCoreVersion = packageJson.dependencies['@cds/core'];

if (angularVersion.indexOf('.') > 0) {
angularVersion = angularVersion.substring(0, angularVersion.indexOf('.')) + '.0.0';
}

if (!angularVersion.startsWith('^')) {
angularVersion = '^' + angularVersion;
}
angularVersion = prependCaretIfMissing(angularVersion);
clarityVersion = prependCaretIfMissing(clarityVersion);
cdsCoreVersion = prependCaretIfMissing(cdsCoreVersion);

const envFile = './src/clr-addons/package.json';
readFile(envFile, 'utf-8', (err, data) => {
Expand All @@ -34,3 +34,7 @@ readFile('./package.json', 'utf-8', (err, data) => {
writeFile(envFile, data, 'utf-8', handleError);
});
});

function prependCaretIfMissing(version) {
return version.startsWith('^') ? version : '^' + version;
}
8 changes: 4 additions & 4 deletions src/clr-addons/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@porscheinformatik/clr-addons",
"version": "18.1.5",
"version": "18.1.6",
"description": "Addon components for Clarity Angular",
"es2015": "esm2015/clr-addons.js",
"homepage": "https://porscheinformatik.github.io/clarity-addons/",
Expand All @@ -21,9 +21,9 @@
"@angular/common": "^18.0.0",
"@angular/core": "^18.0.0",
"@angular/compiler": "^18.0.0",
"@clr/angular": "17.4.0",
"@cds/core": "6.14.0",
"@clr/ui": "17.4.0"
"@clr/angular": "^17.4.0",
"@cds/core": "^6.14.0",
"@clr/ui": "^17.4.0"
},
"author": "porscheinformatik",
"license": "MIT",
Expand Down
8 changes: 4 additions & 4 deletions website/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit bb184c4

Please sign in to comment.