Skip to content

Commit

Permalink
Pull request #1585: Release/patch 12.2.2
Browse files Browse the repository at this point in the history
Merge in OUI/oblique from release/patch_12.2.2 to master

* commit 'c27633c0076f7062a283d2162b8fee20b8778c40':
  chore(toolchain): release version 12.2.2
  chore(toolchain): update dependencies and refactor accordingly
  fix(cli/new): make sure there is no dependency on `tslib`
  feat(toolchain): add `readVersion` function to `package-json.ts`
  fix(oblique/material): correct color for text inside mat dialog
  fix(sds/side-navigation): make sure a navigation occurs when the version is changed
  • Loading branch information
nina-egger committed Jan 10, 2025
2 parents db1c373 + c27633c commit afde27d
Show file tree
Hide file tree
Showing 29 changed files with 229 additions and 136 deletions.
2 changes: 1 addition & 1 deletion LICENSE
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
The MIT License

Copyright (c) 2020-2024 The Swiss Confederation, represented by the Federal Office of Information Technology, Systems and Telecommunication FOITT
Copyright (c) 2020-2025 The Swiss Confederation, represented by the Federal Office of Information Technology, Systems and Telecommunication FOITT

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
Expand Down
243 changes: 139 additions & 104 deletions package-lock.json

Large diffs are not rendered by default.

6 changes: 3 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"title": "Oblique",
"name": "oblique",
"version": "12.2.1",
"version": "12.2.2",
"license": "MIT",
"organization": {
"name": "Federal Office of Information Technology, Systems and Telecommunication FOITT",
Expand Down Expand Up @@ -75,7 +75,7 @@
"@angular/compiler-cli": "^18.2.13",
"@types/jest": "^29.5.14",
"@types/js-cookie": "^3.0.6",
"@types/node": "^20.17.10",
"@types/node": "^20.17.12",
"@typescript-eslint/eslint-plugin": "^6.21.0",
"@typescript-eslint/parser": "^6.21.0",
"chalk": "^4.1.2",
Expand All @@ -84,7 +84,7 @@
"husky": "^9.1.7",
"jest": "^29.7.0",
"jest-sonar": "^0.2.16",
"lint-staged": "^15.2.11",
"lint-staged": "^15.3.0",
"prettier": "^3.4.2",
"stylelint": "^16.12.0",
"stylelint-config-prettier-scss": "^1.0.0",
Expand Down
6 changes: 6 additions & 0 deletions projects/cli/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,9 @@
# [12.2.2](https://github.com/oblique-bit/oblique/compare/12.2.1...12.2.2) (2025-01-10)

## Bug Fixes

- **new:** make sure there is no dependency on `tslib` ([3e83eaad](https://github.com/oblique-bit/oblique/commit/3e83eaad25229988edcff87a29001115b7095b57))

# [12.1.0](https://github.com/oblique-bit/oblique/compare/12.0.4...12.1.0) (2024-12-09)

## Features
Expand Down
2 changes: 1 addition & 1 deletion projects/cli/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@oblique/cli",
"version": "12.2.1",
"version": "12.2.2",
"description": "Command Line Interface to manage Oblique projects",
"keywords": [
"ob",
Expand Down
25 changes: 23 additions & 2 deletions projects/cli/scripts/pre-build.ts
Original file line number Diff line number Diff line change
@@ -1,14 +1,35 @@
import fs from 'fs';
import path from 'path';
import {Log} from '../../../scripts/shared/log';
import {PackageJson} from '../../../scripts/shared/package-json';
import {Files} from '../../../scripts/shared/files';

const workingDir: string = process.cwd();
const cliDistDir: string = path.resolve(workingDir, '../../dist/cli');

Log.start('Deleting dist/cli folder');
Log.start('Initialize build');
try {
Log.info('Deleting dist/cli folder');
fs.rmSync(cliDistDir, {recursive: true, force: true});
Log.success();
} catch (err) {
Log.error((err as Error).message);
}
addVersionNumber();
addSchemaData();
Log.success();

function addVersionNumber(): void {
Log.info('Add Oblique version to "ob-new.model.ts"');
const version = PackageJson.readVersion();
Files.overwrite('./src/new/ob-new.model.ts', content =>
content.replace(/(?<=const version = ')\d+\.\d+\.\d+(?:-(?:alpha|beta|RC)\.\d+)?/, version)
);
}

function addSchemaData(): void {
Log.info('Add schema data to "ob-new.model.ts"');
const schema = Files.readJson<{properties: object}>('src/new/schema.json');
Files.overwrite('./src/new/ob-new.model.ts', content =>
content.replace(/(?<=const schema = ).*(?= as \{properties: ObNewOptions<ObNewSchemaOption>})/, JSON.stringify(schema))
);
}
2 changes: 1 addition & 1 deletion projects/cli/sonar-project.properties
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
sonar.projectName=@oblique/cli
sonar.projectKey=oblique_cli
sonar.projectVersion=12.2.1
sonar.projectVersion=12.2.2
sonar.typescript.lcov.reportPaths=coverage/cli/lcov.info
sonar.testExecutionReportPaths=coverage/cli/sqr.xml
sonar.tests=projects/cli/src
Expand Down
6 changes: 6 additions & 0 deletions projects/cli/src/new/ob-new.model.ts
Original file line number Diff line number Diff line change
Expand Up @@ -65,3 +65,9 @@ export const obNewConfig = {

export const createsWorkspaceMessage = `\nCreates a new Angular workspace`;
export const ngAddStringCommand = `npx ${getVersionedDependency('@angular/cli')} add ${getVersionedDependency('@oblique/oblique')}`;

/* Generated content, do not edit */
export const version = '12.2.2';
// prettier-ignore
export const schema = {"$id":"oblique-cli-ng-new-schema","title":"Oblique CLI ng new schema","properties":{"title":{"type":"string","defaultValue":"<project-name>","description":"Add the specified application's title: The title will be visible in the header of your application.","defaultValueDescription":"project name.","minLength":1,"mandatory":true,"flagValuePlaceholder":"<project-name>"},"locales":{"type":"string","flagValuePlaceholder":"<locales>","defaultValue":"de-CH fr-CH it-CH","description":"Supported locales: Use a whitespace separated list."},"environments":{"type":"string","defaultValue":"local dev ref test abn prod","flagValuePlaceholder":"<environments>","defaultValueDescription":"local dev ref test abn prod","description":"Environment files: Use a whitespace separated list or leave a whitespace to skip the feature. 'local' will create an 'environment.ts' file, all other environments will create a corresponding 'environment.<env>.ts' file."},"prefix":{"type":"string","flagValuePlaceholder":"<prefix>","defaultValue":"app","description":"Prefix configuration: The prefix for components and directive's selectors. Leave empty for no prefix."},"proxy":{"type":"string","flagValuePlaceholder":"<port>","defaultValue":" ","description":"Proxy configuration: Defines the port for the proxy configuration for server connection."},"jenkins":{"type":"string","flagValuePlaceholder":"<jenkinsConfiguration...>","defaultValue":"","defaultValueDescription":"no jenkins configuration","description":"Jenkins configuration: Defines Jenkins / CF configuration. For example (ORG;APP). Leave empty for no Jenkins / CF configuration."},"ajv":{"type":"boolean","defaultValue":true,"description":"Add Ajv dependency: Value \"true\" enables form validation based on a schema delivered by the server.","resources":["https://www.npmjs.com/package/ajv"]},"unknownRoute":{"type":"boolean","defaultValue":true,"description":"Unknown route management: This will display custom 404 pages instead of redirecting to the home page.","resources":["Oblique's Unknown route API at https://oblique.bit.admin.ch/helpers/unknown-route/api"]},"httpInterceptors":{"type":"boolean","defaultValue":true,"description":"Http interceptor: If set to true, it will provide the ObHttpApiInterceptor in the app.module.ts. The interceptor displays a spinner on API calls and a notification on errors.","resources":["Oblique's ObHttpInterceptor API at https://oblique.bit.admin.ch/helpers/http-interceptor/api"]},"banner":{"type":"boolean","defaultValue":false,"description":"Banner to show current environment: The ObBanner will show the current environment in the header. This feature is only available if at least 1 environment will be defined. To define your environments, use the option --environments <Environments>.","resources":["Oblique's ObBanner API at https://oblique.bit.admin.ch/helpers/banner/api"]},"externalLink":{"type":"boolean","defaultValue":true,"description":"External link: If true, it imports the ObExternalLinkModule. This feature automatically enhances external links.","resources":["Oblique's External link API at https://oblique.bit.admin.ch/components/external-link/api"]},"jest":{"type":"boolean","defaultValue":true,"description":"Jest for unit tests: If true, Karma/Jasmine will be replaced with Jest as your application's testing framework.","resources":["Jest at npm https://www.npmjs.com/package/jest","Jest's documentation: https://jestjs.io/docs/getting-started"]},"protractor":{"type":"boolean","defaultValue":false,"description":"Protractor for end to end tests: If you use this flag, you keep Protractor for e2e tests."},"npmrc":{"type":"boolean","defaultValue":true,"description":"Create .npmrc: If you use this flag, it adds an .npmrc file, suitable for projects located within confederation/federal network."},"sonar":{"type":"boolean","defaultValue":true,"description":"Sonar configuration: If set to true, a Sonar configuration is added."},"static":{"type":"boolean","defaultValue":false,"description":"Cloud foundry static build pack: It adds the static build back for CF.","resources":["Cloud Foundry Documentation at https://docs.cloudfoundry.org/buildpacks/staticfile"]},"eslint":{"type":"boolean","defaultValue":true,"description":"ESLint & Prettier: If true, it adds eslint & prettier configuration as used by the Oblique team.","resources":["ESLint Documentation: https://eslint.org/docs/latest/use/getting-started"]},"husky":{"type":"boolean","defaultValue":true,"description":"Husky configuration: If true, it adds git hooks to automatically format changed files.","resources":["Husky Documentation at https://typicode.github.io/husky/","Husky's package at npm https://www.npmjs.com/package/husky"]}}} as {properties: ObNewOptions<ObNewSchemaOption>};
/* End of generated content */
12 changes: 6 additions & 6 deletions projects/cli/src/new/ob-new.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
import {Command, OptionValues} from '@commander-js/extra-typings';
import {execSync} from 'child_process';
import * as cliPackage from '../../package.json';
import {commandUsageText, getVersionedDependency, optionDescriptions, projectNamePlaceholder, startObCommand} from '../utils/cli-utils';
import {addObNewCommandOptions, convertOptionPropertyNames} from '../utils/ob-configure-command';
import {
Expand All @@ -10,9 +9,10 @@ import {
createsWorkspaceMessage,
immutableOptions,
ngAddStringCommand,
obNewConfig
obNewConfig,
schema,
version
} from './ob-new.model';
import * as obCliNewSchema from './schema.json';

export function createObNewCommand(): Command<[string], OptionValues> {
const command = new Command<[string], OptionValues>();
Expand All @@ -36,7 +36,7 @@ export function createAddObliqueCommand(
projectName: string
): string {
const commandOptions: string[] = [];
const properties = obCliNewSchema.properties as Record<string, ObNewSchemaOption>;
const properties = schema.properties as Record<string, ObNewSchemaOption>;
for (const [key, value] of Object.entries(options)) {
const propertyOptions: ObNewSchemaOption = properties[key];
if (Object.prototype.hasOwnProperty.call(propertyOptions, 'type')) {
Expand All @@ -53,7 +53,7 @@ export function createAddObliqueCommand(
function initializeCommand(command: Command<[string], OptionValues>): Command<[string], OptionValues> {
command
.name('new')
.version(cliPackage.version, optionDescriptions.ob.version.flags, optionDescriptions.ob.version.description)
.version(version, optionDescriptions.ob.version.flags, optionDescriptions.ob.version.description)
.helpOption(optionDescriptions.new.help.flags, optionDescriptions.new.help.description)
.usage(commandUsageText('new'))
.summary(obNewConfig.obNewSummaryText)
Expand All @@ -70,7 +70,7 @@ export function handleAction(options: HandleObNewActionOptions): void {
}

function configureCommandOptions(newCommand: Command<[string], OptionValues>): Command<[string], OptionValues> {
const commandWithOptions = addObNewCommandOptions(obCliNewSchema, newCommand);
const commandWithOptions = addObNewCommandOptions(schema, newCommand);
return addImmutableOptionsText(commandWithOptions);
}

Expand Down
2 changes: 1 addition & 1 deletion projects/design-system/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@oblique/design-system",
"version": "12.2.1",
"version": "12.2.2",
"scripts": {
"lint": "ts-node scripts/lint.ts",
"format": "ts-node scripts/lint.ts --fix",
Expand Down
2 changes: 1 addition & 1 deletion projects/design-system/sonar-project.properties
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
sonar.projectName=@oblique/design-system
sonar.projectKey=oblique_design-system
sonar.projectVersion=12.2.1
sonar.projectVersion=12.2.2
sonar.typescript.lcov.reportPaths=coverage/design-system/lcov.info
sonar.testExecutionReportPaths=coverage/design-system/sqr.xml
sonar.tests=projects/design-system/src/lib
Expand Down
6 changes: 6 additions & 0 deletions projects/oblique/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,9 @@
# [12.2.2](https://github.com/oblique-bit/oblique/compare/12.2.1...12.2.2) (2025-01-10)

## Bug Fixes

- **material:** correct color for text inside mat dialog ([3d7dc7a2](https://github.com/oblique-bit/oblique/commit/3d7dc7a268fc7f11d83836bade6025c7e896c8a6))

# [12.2.1](https://github.com/oblique-bit/oblique/compare/12.2.0...12.2.1) (2024-12-20)

## Bug Fixes
Expand Down
2 changes: 1 addition & 1 deletion projects/oblique/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@oblique/oblique",
"version": "12.2.1",
"version": "12.2.2",
"publishConfig": {
"registry": "https://registry.npmjs.com/"
},
Expand Down
2 changes: 1 addition & 1 deletion projects/oblique/sonar-project.properties
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
sonar.projectName=@oblique/oblique
sonar.projectKey=oblique_oblique
sonar.projectVersion=12.2.1
sonar.projectVersion=12.2.2
sonar.typescript.lcov.reportPaths=coverage/oblique/lcov.info
sonar.testExecutionReportPaths=coverage/oblique/sqr.xml
sonar.tests=projects/oblique/src/lib
Expand Down
2 changes: 1 addition & 1 deletion projects/oblique/src/lib/version.ts
Original file line number Diff line number Diff line change
@@ -1 +1 @@
export const appVersion = '12.2.1';
export const appVersion = '12.2.2';
1 change: 1 addition & 0 deletions projects/oblique/src/styles/scss/material/_mat-dialog.scss
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@

.mat-mdc-dialog-content.mdc-dialog__content {
@include typography.ob-body1();
color: variables.$ob-secondary-800;
}

.mat-mdc-dialog-surface {
Expand Down
2 changes: 1 addition & 1 deletion projects/sandbox-ssr/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@oblique/sandbox-ssr",
"version": "12.2.1",
"version": "12.2.2",
"scripts": {
"start": "ng serve",
"start-ssr": "node ../../dist/sandbox-ssr/server/server.mjs",
Expand Down
2 changes: 1 addition & 1 deletion projects/sandbox-ssr/sonar-project.properties
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
sonar.projectName=@oblique/sandbox-ssr
sonar.projectKey=oblique_sandbox-ssr
sonar.projectVersion=12.2.1
sonar.projectVersion=12.2.2
sonar.typescript.lcov.reportPaths=coverage/sandbox-ssr/lcov.info
sonar.testExecutionReportPaths=coverage/sandbox-ssr/sqr.xml
sonar.tests=projects/sandbox-ssr/src/app
Expand Down
2 changes: 1 addition & 1 deletion projects/sandbox/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@oblique/sandbox",
"version": "12.2.1",
"version": "12.2.2",
"scripts": {
"start": "ng serve",
"start-pams": "ng serve --configuration pams",
Expand Down
2 changes: 1 addition & 1 deletion projects/sandbox/sonar-project.properties
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
sonar.projectName=@oblique/sandbox
sonar.projectKey=oblique_sandbox
sonar.projectVersion=12.2.1
sonar.projectVersion=12.2.2
sonar.typescript.lcov.reportPaths=coverage/sandbox/lcov.info
sonar.testExecutionReportPaths=coverage/sandbox/sqr.xml
sonar.tests=projects/sandbox/src/app
Expand Down
6 changes: 6 additions & 0 deletions projects/sds/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,9 @@
# [12.2.2](https://github.com/oblique-bit/oblique/compare/12.2.1...12.2.2) (2025-01-10)

## Bug Fixes

- **side-navigation:** make sure a navigation occurs when the version is changed ([cad5ced8](https://github.com/oblique-bit/oblique/commit/cad5ced83ae3cc438c4597308e6d0f2c6f9ba871))

# [12.2.1](https://github.com/oblique-bit/oblique/compare/12.2.0...12.2.1) (2024-12-20)

## Bug Fixes
Expand Down
4 changes: 2 additions & 2 deletions projects/sds/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@oblique/sds",
"version": "12.2.1",
"version": "12.2.2",
"scripts": {
"start": "ng serve",
"lint": "ts-node scripts/lint.ts",
Expand All @@ -14,7 +14,7 @@
"release": "ts-node scripts/release.ts"
},
"dependencies": {
"highlight.js": "^11.11.0",
"highlight.js": "^11.11.1",
"jquery": "^3.7.1",
"raw-loader": "^4.0.2"
},
Expand Down
2 changes: 1 addition & 1 deletion projects/sds/sonar-project.properties
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
sonar.projectName=@oblique/sds
sonar.projectKey=oblique_sds
sonar.projectVersion=12.2.1
sonar.projectVersion=12.2.2
sonar.typescript.lcov.reportPaths=coverage/sds/lcov.info
sonar.testExecutionReportPaths=coverage/sds/sqr.xml
sonar.tests=projects/sds/src/app
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -169,13 +169,19 @@ export class SideNavigationComponent {
return +activatedRoute.snapshot.queryParamMap.get('version') || undefined;
}

private getCurrentSlug(): string {
return this.router.url
.replace(/[#|?].*/, '') // remove queryParams & fragment
.split('/')
.pop();
}

private redirectOnVersionChange(): void {
this.version$
.pipe(
skip(3),
combineLatestWith(this.selectedSlug$),
takeUntilDestroyed(),
map(([version, slug]) => this.getNewSlug(version, slug)),
map(version => this.getNewSlug(version, this.getCurrentSlug())),
filter(slug => !!slug)
)
.subscribe(slug => {
Expand All @@ -197,6 +203,7 @@ export class SideNavigationComponent {
case 10:
return 'welcome-10';
case 11:
if (slug === 'getting-started-as-a-designer') return 'welcome';
return ['master-layout-12', 'popover-12'].includes(slug) ? slug.replace('-12', '') : undefined;
case 12:
if (slug === 'language') return 'welcome';
Expand Down
2 changes: 1 addition & 1 deletion projects/sds/src/obliqueVersion.ts
Original file line number Diff line number Diff line change
@@ -1 +1 @@
export const latest = '12.2.1';
export const latest = '12.2.2';
2 changes: 1 addition & 1 deletion projects/service-navigation-web-component/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@oblique/service-navigation-web-component",
"version": "12.2.1",
"version": "12.2.2",
"publishConfig": {
"registry": "https://registry.npmjs.com/"
},
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
sonar.projectName=@oblique/service-navigation
sonar.projectKey=oblique_service-navigation
sonar.projectVersion=12.2.1
sonar.projectVersion=12.2.2
sonar.typescript.lcov.reportPaths=coverage/service-navigation-web-component/lcov.info
sonar.testExecutionReportPaths=coverage/service-navigation-web-component/sqr.xml
sonar.tests=projects/service-navigation-web-component/src/app
Expand Down
Original file line number Diff line number Diff line change
@@ -1 +1 @@
export const appVersion = '12.2.1';
export const appVersion = '12.2.2';
5 changes: 5 additions & 0 deletions scripts/shared/package-json.ts
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,11 @@ export class PackageJson extends StaticScript {
return PackageJson.instance as PackageJson;
}

static readVersion(): string {
const rootPackage = PackageJson.readRootPackageJson();
return typeof rootPackage.version === 'string' ? rootPackage.version : '';
}

private static readRootPackageJson(): PackageJsonContent {
return Files.readJson<PackageJsonContent>('../../package.json');
}
Expand Down

0 comments on commit afde27d

Please sign in to comment.