From 1f5d1f2c8adcb3778bf01105b1750bc7df9d116b Mon Sep 17 00:00:00 2001 From: Nicolas Merget Date: Tue, 10 Dec 2024 10:13:14 +0100 Subject: [PATCH 01/14] fix: migration cli by making packages external --- packages/foundations/scripts/esbuild.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/foundations/scripts/esbuild.js b/packages/foundations/scripts/esbuild.js index 76c1e9b0985..8338a35fb19 100644 --- a/packages/foundations/scripts/esbuild.js +++ b/packages/foundations/scripts/esbuild.js @@ -6,5 +6,5 @@ await build({ outfile: './build/index.js', platform: 'node', format: 'esm', - external: ['chalk'] + packages: 'external' }); From 9f170db1406ce9f76a00502d8eb6184e1864b09c Mon Sep 17 00:00:00 2001 From: Nicolas Merget Date: Tue, 10 Dec 2024 12:16:03 +0100 Subject: [PATCH 02/14] chore: move migration to own package --- .github/scripts/publish-npm.sh | 4 +- .github/workflows/01-build-outputs.yml | 6 +++ .github/workflows/01-build-packages.yml | 6 +++ .xo-config.cjs | 5 +-- package-lock.json | 44 ++++++++++--------- packages/foundations/README.md | 6 +-- packages/foundations/package.json | 11 +---- packages/migration/README.md | 34 ++++++++++++++ .../scripts => migration}/esbuild.js | 2 +- packages/migration/package.json | 41 +++++++++++++++++ .../scripts => migration/src}/cli.ts | 0 .../scripts => migration/src}/data.ts | 0 .../src}/migration/color-q32024.ts | 0 .../src}/migration/icon-q32024.ts | 0 .../src}/migration/index.ts | 7 ++- .../src}/migration/v0.0.5-v0.0.6.ts | 0 .../scripts => migration/src}/program.ts | 0 .../scripts => migration/src}/types.ts | 4 +- .../test/color-q32024/color-q32024.spec.ts | 6 +-- .../test/color-q32024/has-changes.txt | 0 .../test/color-q32024/no-change.txt | 0 .../test/icon-q32024/has-changes.txt | 0 .../test/icon-q32024/icon-q32024.spec.ts | 6 +-- .../test/icon-q32024/no-change.txt | 0 .../test/v0.0.5-v0.0.6/has-changes.txt | 0 .../test/v0.0.5-v0.0.6/no-change.txt | 0 .../test/v0.0.5-v0.0.6/v005_v006.spec.ts | 6 +-- .../scripts => migration}/tsconfig.json | 0 .../scripts => migration}/vitest.config.ts | 2 +- scripts/package.json | 6 ++- 30 files changed, 139 insertions(+), 57 deletions(-) create mode 100644 packages/migration/README.md rename packages/{foundations/scripts => migration}/esbuild.js (81%) create mode 100644 packages/migration/package.json rename packages/{foundations/scripts => migration/src}/cli.ts (100%) rename packages/{foundations/scripts => migration/src}/data.ts (100%) rename packages/{foundations/scripts => migration/src}/migration/color-q32024.ts (100%) rename packages/{foundations/scripts => migration/src}/migration/icon-q32024.ts (100%) rename packages/{foundations/scripts => migration/src}/migration/index.ts (85%) rename packages/{foundations/scripts => migration/src}/migration/v0.0.5-v0.0.6.ts (100%) rename packages/{foundations/scripts => migration/src}/program.ts (100%) rename packages/{foundations/scripts => migration/src}/types.ts (69%) rename packages/{foundations/scripts => migration}/test/color-q32024/color-q32024.spec.ts (72%) rename packages/{foundations/scripts => migration}/test/color-q32024/has-changes.txt (100%) rename packages/{foundations/scripts => migration}/test/color-q32024/no-change.txt (100%) rename packages/{foundations/scripts => migration}/test/icon-q32024/has-changes.txt (100%) rename packages/{foundations/scripts => migration}/test/icon-q32024/icon-q32024.spec.ts (72%) rename packages/{foundations/scripts => migration}/test/icon-q32024/no-change.txt (100%) rename packages/{foundations/scripts => migration}/test/v0.0.5-v0.0.6/has-changes.txt (100%) rename packages/{foundations/scripts => migration}/test/v0.0.5-v0.0.6/no-change.txt (100%) rename packages/{foundations/scripts => migration}/test/v0.0.5-v0.0.6/v005_v006.spec.ts (72%) rename packages/{foundations/scripts => migration}/tsconfig.json (100%) rename packages/{foundations/scripts => migration}/vitest.config.ts (62%) diff --git a/.github/scripts/publish-npm.sh b/.github/scripts/publish-npm.sh index d9abdb13c89..5af84706dc4 100644 --- a/.github/scripts/publish-npm.sh +++ b/.github/scripts/publish-npm.sh @@ -17,13 +17,13 @@ echo "goto build-outputs" cd build-outputs || exit 1 # TODO: Add other build as well -for PACKAGE in 'foundations' 'components' 'ngx-components' 'react-components' 'v-components' 'web-components'; do +for PACKAGE in 'foundations' 'migration' 'components' 'ngx-components' 'react-components' 'v-components' 'web-components'; do echo "Start $PACKAGE bundle:" echo "๐Ÿ†š Update Version" npm version --no-git-tag-version "$VALID_SEMVER_VERSION" --workspace=@db-ui/"$PACKAGE" - if [[ $PACKAGE != 'foundations' ]]; then + if [[ $PACKAGE != 'foundations' && $PACKAGE != 'migration' ]]; then echo "๐Ÿ•ต๏ธโ€ Set foundations dependency" npm pkg set dependencies.@db-ui/foundations="$VALID_SEMVER_VERSION" --workspace=@db-ui/"$PACKAGE" if [[ $PACKAGE != 'components' ]]; then diff --git a/.github/workflows/01-build-outputs.yml b/.github/workflows/01-build-outputs.yml index 21a90a90393..df6d128e7c1 100644 --- a/.github/workflows/01-build-outputs.yml +++ b/.github/workflows/01-build-outputs.yml @@ -27,6 +27,12 @@ jobs: name: db-ui-components-build path: packages/components/build + - name: โฌ Download migration build + uses: actions/download-artifact@v4 + with: + name: db-ui-migration-build + path: packages/migration/build + - name: โฌ Download output uses: actions/download-artifact@v4 with: diff --git a/.github/workflows/01-build-packages.yml b/.github/workflows/01-build-packages.yml index dcbee4cc087..5c8aeae7f58 100644 --- a/.github/workflows/01-build-packages.yml +++ b/.github/workflows/01-build-packages.yml @@ -36,6 +36,12 @@ jobs: name: db-ui-components-build path: packages/components/build + - name: โซ Upload migration build + uses: actions/upload-artifact@v4 + with: + name: db-ui-migration-build + path: packages/migration/build + - name: ๐Ÿ’€ Killing me softly uses: ./.github/actions/cancel-workflow if: failure() diff --git a/.xo-config.cjs b/.xo-config.cjs index 03a6afdcdb7..60542fdfc0d 100644 --- a/.xo-config.cjs +++ b/.xo-config.cjs @@ -1,9 +1,6 @@ module.exports = { prettier: true, - ignores: [ - './showcases/nuxt-showcase/**', - './packages/foundations/scripts/**' - ], + ignores: ['./showcases/nuxt-showcase/**', './packages/migration/**'], overrides: [ { files: ['./showcases/angular-showcase/**'], diff --git a/package-lock.json b/package-lock.json index 1096b4be8d8..5a5fabf2375 100644 --- a/package-lock.json +++ b/package-lock.json @@ -4959,6 +4959,10 @@ "resolved": "packages/foundations", "link": true }, + "node_modules/@db-ui/migration": { + "resolved": "packages/migration", + "link": true + }, "node_modules/@db-ui/mono-e2e": { "resolved": "e2e", "link": true @@ -15212,7 +15216,6 @@ "version": "5.3.0", "resolved": "https://registry.npmjs.org/chalk/-/chalk-5.3.0.tgz", "integrity": "sha512-dLitG79d+GV1Nb/VYcCDFivJeK1hiukt9QjRNVOsUtTy1rR1YJsmpGGTZ3qJos+uw7WmWF4wUwBd9jxjocFC2w==", - "dev": true, "engines": { "node": "^12.17.0 || ^14.13 || >=16.0.0" }, @@ -15868,7 +15871,6 @@ "version": "12.1.0", "resolved": "https://registry.npmjs.org/commander/-/commander-12.1.0.tgz", "integrity": "sha512-Vw8qHK3bZM9y/P10u3Vib8o/DdkvA2OtPtZvD871QKjy74Wj1WSKFILMPRPSdUSx5RFK1arlJzEtA4PkFgnbuA==", - "dev": true, "engines": { "node": ">=18" } @@ -20664,7 +20666,6 @@ "version": "11.0.0", "resolved": "https://registry.npmjs.org/glob/-/glob-11.0.0.tgz", "integrity": "sha512-9UiX/Bl6J2yaBbxKoEBRm4Cipxgok8kQYcOPEhScPwebu2I0HoQOuYdIO6S3hLuWoZgpDpwQZMzTFxgpkyT76g==", - "dev": true, "dependencies": { "foreground-child": "^3.1.0", "jackspeak": "^4.0.1", @@ -20705,7 +20706,6 @@ "version": "2.0.1", "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-2.0.1.tgz", "integrity": "sha512-XnAIvQ8eM+kC6aULx6wuQiwVsnzsi9d3WxzV3FpWTGA19F621kwdbsAcFKXgKUHZWsy+mY6iL1sHTxWEFCytDA==", - "dev": true, "dependencies": { "balanced-match": "^1.0.0" } @@ -20714,7 +20714,6 @@ "version": "10.0.1", "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-10.0.1.tgz", "integrity": "sha512-ethXTt3SGGR+95gudmqJ1eNhRO7eGEGIgYA9vnPatK4/etz2MEVDno5GMCibdMTuBMyElzIlgxMna3K94XDIDQ==", - "dev": true, "dependencies": { "brace-expansion": "^2.0.1" }, @@ -23361,7 +23360,6 @@ "version": "4.0.1", "resolved": "https://registry.npmjs.org/jackspeak/-/jackspeak-4.0.1.tgz", "integrity": "sha512-cub8rahkh0Q/bw1+GxP7aeSe29hHHn2V4m29nnDlvCdlgU+3UGxkZp7Z53jLUdpX3jdTO0nJZUDl3xvbWc2Xog==", - "dev": true, "dependencies": { "@isaacs/cliui": "^8.0.2" }, @@ -24920,7 +24918,6 @@ "version": "11.0.0", "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-11.0.0.tgz", "integrity": "sha512-Qv32eSV1RSCfhY3fpPE2GNZ8jgM9X7rdAfemLWqTUxwiyIC4jJ6Sy0fZ8H+oLWevO6i4/bizg7c8d8i6bxrzbA==", - "dev": true, "engines": { "node": "20 || >=22" } @@ -30395,7 +30392,6 @@ "version": "2.0.0", "resolved": "https://registry.npmjs.org/path-scurry/-/path-scurry-2.0.0.tgz", "integrity": "sha512-ypGJsmGtdXUOeM5u93TyeIEfEhM6s+ljAhrk5vAvSx8uyY/02OvrZnA0YNGUrPXfpJMgI1ODd3nwz8Npx4O4cg==", - "dev": true, "dependencies": { "lru-cache": "^11.0.0", "minipass": "^7.1.2" @@ -32826,7 +32822,6 @@ "version": "8.2.0", "resolved": "https://registry.npmjs.org/replace-in-file/-/replace-in-file-8.2.0.tgz", "integrity": "sha512-hMsQtdYHwWviQT5ZbNsgfu0WuCiNlcUSnnD+aHAL081kbU9dPkPocDaHlDvAHKydTWWpx1apfcEcmvIyQk3CpQ==", - "dev": true, "dependencies": { "chalk": "^5.3.0", "glob": "^10.4.2", @@ -32843,7 +32838,6 @@ "version": "2.0.1", "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-2.0.1.tgz", "integrity": "sha512-XnAIvQ8eM+kC6aULx6wuQiwVsnzsi9d3WxzV3FpWTGA19F621kwdbsAcFKXgKUHZWsy+mY6iL1sHTxWEFCytDA==", - "dev": true, "dependencies": { "balanced-match": "^1.0.0" } @@ -32852,7 +32846,6 @@ "version": "10.4.5", "resolved": "https://registry.npmjs.org/glob/-/glob-10.4.5.tgz", "integrity": "sha512-7Bv8RF0k6xjo7d4A/PxYLbUCfb6c+Vpd2/mB2yRDlew7Jb5hEXiCD9ibfO7wpk8i4sevK6DFny9h7EYbM3/sHg==", - "dev": true, "dependencies": { "foreground-child": "^3.1.0", "jackspeak": "^3.1.2", @@ -32872,7 +32865,6 @@ "version": "3.4.3", "resolved": "https://registry.npmjs.org/jackspeak/-/jackspeak-3.4.3.tgz", "integrity": "sha512-OGlZQpz2yfahA/Rd1Y8Cd9SIEsqvXkLVoSw/cgwhnhFMDbsQFeZYoJJ7bIZBS9BcamUW96asq/npPWugM+RQBw==", - "dev": true, "dependencies": { "@isaacs/cliui": "^8.0.2" }, @@ -32886,14 +32878,12 @@ "node_modules/replace-in-file/node_modules/lru-cache": { "version": "10.4.3", "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-10.4.3.tgz", - "integrity": "sha512-JNAzZcXrCt42VGLuYz0zfAzDfAvJWW6AfYlDBQyDV5DClI2m5sAmK+OIO7s59XfsRsWHp02jAJrRadPRGTt6SQ==", - "dev": true + "integrity": "sha512-JNAzZcXrCt42VGLuYz0zfAzDfAvJWW6AfYlDBQyDV5DClI2m5sAmK+OIO7s59XfsRsWHp02jAJrRadPRGTt6SQ==" }, "node_modules/replace-in-file/node_modules/minimatch": { "version": "9.0.5", "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-9.0.5.tgz", "integrity": "sha512-G6T0ZX48xgozx7587koeX9Ys2NYy6Gmv//P89sEte9V9whIapMNF4idKxnW2QtCcLiTWlb/wfCabAtAFWhhBow==", - "dev": true, "dependencies": { "brace-expansion": "^2.0.1" }, @@ -32908,7 +32898,6 @@ "version": "1.11.1", "resolved": "https://registry.npmjs.org/path-scurry/-/path-scurry-1.11.1.tgz", "integrity": "sha512-Xa4Nw17FS9ApQFJ9umLiJS4orGjm7ZzwUrwamcGQuHSzDyth9boKDaycYdDcZDuqYATXw4HFXgaqWTctW/v1HA==", - "dev": true, "dependencies": { "lru-cache": "^10.2.0", "minipass": "^5.0.0 || ^6.0.2 || ^7.0.0" @@ -41332,16 +41321,29 @@ "devDependencies": { "@csstools/normalize.css": "12.1.1", "@db-ux/core-icons": "^0.0.6", - "commander": "^12.0.0", "cpr": "3.0.1", "cssnano": "^7.0.6", "dotenv": "^16.4.7", - "glob": "^11.0.0", "nodemon": "3.1.7", - "replace-in-file": "^8.2.0", "sass": "1.77.4", "tsx": "^4.19.2", - "vite": "^6.0.3", + "vite": "^6.0.3" + } + }, + "packages/migration": { + "name": "@db-ui/migration", + "version": "0.0.0", + "license": "DB Design License", + "dependencies": { + "commander": "^12.0.0", + "glob": "^11.0.0", + "replace-in-file": "^8.2.0" + }, + "bin": { + "migration": "build/index.js" + }, + "devDependencies": { + "tsx": "^4.19.2", "vitest": "^2.1.8" } }, @@ -41409,7 +41411,7 @@ }, "showcases/next-showcase": { "dependencies": { - "next": "*", + "next": "latest", "react": "18.3.1", "react-dom": "18.3.1" }, diff --git a/packages/foundations/README.md b/packages/foundations/README.md index 86062325f5c..79e388d212a 100644 --- a/packages/foundations/README.md +++ b/packages/foundations/README.md @@ -306,11 +306,7 @@ If you want to optimize the size of the loaded styles, you might skip loading `@ ## Migration -We provide a cli tool to auto migrate your source code. Use this command in your repository: - -```shell -npx @db-ui/foundations migration --src=./src -``` +We provide a [cli tool](https://github.com/db-ui/mono/blob/main/packages/migration/README.md) to auto migrate your source code. ## Deutsche Bahn brand diff --git a/packages/foundations/package.json b/packages/foundations/package.json index ea8d2addcf8..0f7f850dcb5 100644 --- a/packages/foundations/package.json +++ b/packages/foundations/package.json @@ -24,7 +24,6 @@ "build:04_tailwind": "cpr tailwind build/tailwind -o", "build:05_postcss": "postcss build/css/**/*.css --replace", "build:06_ide": "cpr ide build/ide -o", - "build:99_foundations_common": "node scripts/esbuild.js", "clean": "rm -rf build", "copy-build": "npm-run-all copy-build:*", "copy-build:assets": "cpr assets ../../build-outputs/foundations/assets -o", @@ -41,24 +40,18 @@ "prestart": "npm-run-all copy-prepare:*", "regenerate:screenshots": "npx playwright test -c ./test/playwright.config.js --update-snapshots", "start": "nodemon --config nodemon.json", - "test": "vitest run --config scripts/vitest.config.ts", - "test:e2e": "npx playwright test --config=./test/playwright.config.js", - "test:migration": "tsx scripts/cli.ts migration --type v005_v006 --src=./scss --dryRun=true" + "test:e2e": "npx playwright test --config=./test/playwright.config.js" }, "devDependencies": { "@csstools/normalize.css": "12.1.1", "@db-ux/core-icons": "^0.0.6", - "commander": "^12.0.0", "cpr": "3.0.1", "cssnano": "^7.0.6", "dotenv": "^16.4.7", - "glob": "^11.0.0", "nodemon": "3.1.7", - "replace-in-file": "^8.2.0", "sass": "1.77.4", "tsx": "^4.19.2", - "vite": "^6.0.3", - "vitest": "^2.1.8" + "vite": "^6.0.3" }, "publishConfig": { "registry": "https://registry.npmjs.org/", diff --git a/packages/migration/README.md b/packages/migration/README.md new file mode 100644 index 00000000000..0d377297b20 --- /dev/null +++ b/packages/migration/README.md @@ -0,0 +1,34 @@ +# @db-ui/migration + +![Apache 2.0 license badge](https://img.shields.io/badge/License-Apache_2.0-blue.svg) +[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg?style=flat-square)](https://github.com/prettier/prettier) +[![Conventional Commits](https://img.shields.io/badge/Conventional%20Commits-1.0.0-yellow.svg)](https://conventionalcommits.org) +[![PRs Welcome](https://img.shields.io/badge/PRs-welcome-brightgreen.svg?style=flat-square)](https://makeapullrequest.com) + +## Usage + +We provide a cli tool to auto migrate your source code. Use this command in your repository: + +```shell +npx @db-ui/foundations migration --type XXX --src=./src +``` + +## Deutsche Bahn brand + +As we'd like to perfectly support our users and customers on their digital journey, the usage of Deutsche Bahn brand and trademarks are bound of clear guidelines and restrictions even when being used with the code that we're provide with this product; Deutsche Bahn fully reserves all rights regarding the Deutsche Bahn brand, even though that we're providing the code of DB UI products free to use and release it under the Apache 2.0 license. +Please have a look at our brand portal at for any further questions and whom to contact on any brand issues. + +You must remove or replace any Deutsche Bahn brand and design assets as well as protected characteristics and trademarks. We're even also planning to provide a neutral theme that would make it much easier for you to use our product without the trademarks by Deutsche Bahn. + +## Contributions + +Contributions are very welcome, please refer to the [contribution guide](https://github.com/db-ui/mono/blob/main/CONTRIBUTING.md). + +## Code of conduct + +We as members, contributors, and leaders pledge to make participation in our +community a harassment-free experience for everyone โ€“ have a look at our [Contributor Covenant Code of Conduct](https://github.com/db-ui/mono/blob/main/CODE-OF-CONDUCT.md). + +## License + +This project is licensed under [Apache-2.0](LICENSE). diff --git a/packages/foundations/scripts/esbuild.js b/packages/migration/esbuild.js similarity index 81% rename from packages/foundations/scripts/esbuild.js rename to packages/migration/esbuild.js index 8338a35fb19..9cb15585713 100644 --- a/packages/foundations/scripts/esbuild.js +++ b/packages/migration/esbuild.js @@ -1,7 +1,7 @@ import { build } from 'esbuild'; await build({ - entryPoints: ['./scripts/cli.ts'], + entryPoints: ['./src/cli.ts'], bundle: true, outfile: './build/index.js', platform: 'node', diff --git a/packages/migration/package.json b/packages/migration/package.json new file mode 100644 index 00000000000..593829dd1b8 --- /dev/null +++ b/packages/migration/package.json @@ -0,0 +1,41 @@ +{ + "name": "@db-ui/migration", + "version": "0.0.0", + "type": "module", + "description": "Provides basic tokens and assets based on DB UX Design System Core.", + "repository": { + "type": "git", + "url": "https://github.com/db-ui/mono.git" + }, + "license": "DB Design License", + "bin": { + "@db-ui/migration": "build/index.js" + }, + "main": "build.js", + "files": [ + "build" + ], + "scripts": { + "build": "node esbuild.js", + "copy-build": "npm-run-all copy-build:*", + "copy-build:build": "cpr build ../../build-outputs/migration/build -o", + "copy-build:package.json": "cpr package.json ../../build-outputs/migration/package.json -o", + "copy-build:readme": "cpr README.md ../../build-outputs/migration/README.md -o", + "test": "vitest run --config vitest.config.ts", + "test:migration": "tsx src/cli.ts migration --type v005_v006 --src=./scss --dryRun=true" + }, + "dependencies": { + "commander": "^12.0.0", + "glob": "^11.0.0", + "replace-in-file": "^8.2.0" + }, + "devDependencies": { + "cpr": "3.0.1", + "tsx": "^4.19.2", + "vitest": "^2.1.8" + }, + "publishConfig": { + "registry": "https://registry.npmjs.org/", + "access": "public" + } +} diff --git a/packages/foundations/scripts/cli.ts b/packages/migration/src/cli.ts similarity index 100% rename from packages/foundations/scripts/cli.ts rename to packages/migration/src/cli.ts diff --git a/packages/foundations/scripts/data.ts b/packages/migration/src/data.ts similarity index 100% rename from packages/foundations/scripts/data.ts rename to packages/migration/src/data.ts diff --git a/packages/foundations/scripts/migration/color-q32024.ts b/packages/migration/src/migration/color-q32024.ts similarity index 100% rename from packages/foundations/scripts/migration/color-q32024.ts rename to packages/migration/src/migration/color-q32024.ts diff --git a/packages/foundations/scripts/migration/icon-q32024.ts b/packages/migration/src/migration/icon-q32024.ts similarity index 100% rename from packages/foundations/scripts/migration/icon-q32024.ts rename to packages/migration/src/migration/icon-q32024.ts diff --git a/packages/foundations/scripts/migration/index.ts b/packages/migration/src/migration/index.ts similarity index 85% rename from packages/foundations/scripts/migration/index.ts rename to packages/migration/src/migration/index.ts index ccb50312499..a586f71d2c8 100644 --- a/packages/foundations/scripts/migration/index.ts +++ b/packages/migration/src/migration/index.ts @@ -1,5 +1,5 @@ import { globSync } from 'glob'; -import { ReplaceInFileConfig, replaceInFileSync } from 'replace-in-file'; +import { type ReplaceInFileConfig, replaceInFileSync } from 'replace-in-file'; import type { ReplaceResult } from 'replace-in-file'; import type { OptionsType } from '../types'; import { migrationTypes } from '../data'; @@ -21,7 +21,10 @@ export const migrate = ( const replacements: ReplaceInFileConfig[] = Object.entries( migrationTypes ).reduce( - (previousReplacements, [currentKey, currentReplacements]) => + ( + previousReplacements: ReplaceInFileConfig[], + [currentKey, currentReplacements] + ) => type.includes(currentKey) ? [...previousReplacements, ...currentReplacements] : previousReplacements, diff --git a/packages/foundations/scripts/migration/v0.0.5-v0.0.6.ts b/packages/migration/src/migration/v0.0.5-v0.0.6.ts similarity index 100% rename from packages/foundations/scripts/migration/v0.0.5-v0.0.6.ts rename to packages/migration/src/migration/v0.0.5-v0.0.6.ts diff --git a/packages/foundations/scripts/program.ts b/packages/migration/src/program.ts similarity index 100% rename from packages/foundations/scripts/program.ts rename to packages/migration/src/program.ts diff --git a/packages/foundations/scripts/types.ts b/packages/migration/src/types.ts similarity index 69% rename from packages/foundations/scripts/types.ts rename to packages/migration/src/types.ts index 27b92c6e435..cfd22dc126b 100644 --- a/packages/foundations/scripts/types.ts +++ b/packages/migration/src/types.ts @@ -1,3 +1,5 @@ +import { v005_v006 } from './migration/v0.0.5-v0.0.6'; + export type ProgrammOptionsType = { name: string; short?: string; @@ -10,6 +12,6 @@ export type ProgrammOptionsType = { export type OptionsType = { src: string; - type: (string | 'colorQ32024' | 'iconQ32024')[]; + type: (string | 'colorQ32024' | 'iconQ32024' | 'v005_v006')[]; dryRun?: string | boolean; }; diff --git a/packages/foundations/scripts/test/color-q32024/color-q32024.spec.ts b/packages/migration/test/color-q32024/color-q32024.spec.ts similarity index 72% rename from packages/foundations/scripts/test/color-q32024/color-q32024.spec.ts rename to packages/migration/test/color-q32024/color-q32024.spec.ts index 15aff5e9ec8..1bbf59447ea 100644 --- a/packages/foundations/scripts/test/color-q32024/color-q32024.spec.ts +++ b/packages/migration/test/color-q32024/color-q32024.spec.ts @@ -1,11 +1,11 @@ import { describe, expect, test } from 'vitest'; -import { migrate } from '../../migration'; -import { ReplaceResult } from 'replace-in-file'; +import { type ReplaceResult } from 'replace-in-file'; +import { migrate } from '../../src/migration'; describe('color-q32024', () => { test('check if changes are detected', async () => { const result = migrate({ - src: './scripts/test/color-q32024', + src: './test/color-q32024', type: ['colorQ32024'], dryRun: true }); diff --git a/packages/foundations/scripts/test/color-q32024/has-changes.txt b/packages/migration/test/color-q32024/has-changes.txt similarity index 100% rename from packages/foundations/scripts/test/color-q32024/has-changes.txt rename to packages/migration/test/color-q32024/has-changes.txt diff --git a/packages/foundations/scripts/test/color-q32024/no-change.txt b/packages/migration/test/color-q32024/no-change.txt similarity index 100% rename from packages/foundations/scripts/test/color-q32024/no-change.txt rename to packages/migration/test/color-q32024/no-change.txt diff --git a/packages/foundations/scripts/test/icon-q32024/has-changes.txt b/packages/migration/test/icon-q32024/has-changes.txt similarity index 100% rename from packages/foundations/scripts/test/icon-q32024/has-changes.txt rename to packages/migration/test/icon-q32024/has-changes.txt diff --git a/packages/foundations/scripts/test/icon-q32024/icon-q32024.spec.ts b/packages/migration/test/icon-q32024/icon-q32024.spec.ts similarity index 72% rename from packages/foundations/scripts/test/icon-q32024/icon-q32024.spec.ts rename to packages/migration/test/icon-q32024/icon-q32024.spec.ts index 6f883bb43ae..61e64a73701 100644 --- a/packages/foundations/scripts/test/icon-q32024/icon-q32024.spec.ts +++ b/packages/migration/test/icon-q32024/icon-q32024.spec.ts @@ -1,11 +1,11 @@ import { describe, expect, test } from 'vitest'; -import { migrate } from '../../migration'; -import { ReplaceResult } from 'replace-in-file'; +import { type ReplaceResult } from 'replace-in-file'; +import { migrate } from '../../src/migration'; describe('icon-q32024', () => { test('check if changes are detected', async () => { const result = migrate({ - src: './scripts/test/icon-q32024', + src: './test/icon-q32024', type: ['iconQ32024'], dryRun: true }); diff --git a/packages/foundations/scripts/test/icon-q32024/no-change.txt b/packages/migration/test/icon-q32024/no-change.txt similarity index 100% rename from packages/foundations/scripts/test/icon-q32024/no-change.txt rename to packages/migration/test/icon-q32024/no-change.txt diff --git a/packages/foundations/scripts/test/v0.0.5-v0.0.6/has-changes.txt b/packages/migration/test/v0.0.5-v0.0.6/has-changes.txt similarity index 100% rename from packages/foundations/scripts/test/v0.0.5-v0.0.6/has-changes.txt rename to packages/migration/test/v0.0.5-v0.0.6/has-changes.txt diff --git a/packages/foundations/scripts/test/v0.0.5-v0.0.6/no-change.txt b/packages/migration/test/v0.0.5-v0.0.6/no-change.txt similarity index 100% rename from packages/foundations/scripts/test/v0.0.5-v0.0.6/no-change.txt rename to packages/migration/test/v0.0.5-v0.0.6/no-change.txt diff --git a/packages/foundations/scripts/test/v0.0.5-v0.0.6/v005_v006.spec.ts b/packages/migration/test/v0.0.5-v0.0.6/v005_v006.spec.ts similarity index 72% rename from packages/foundations/scripts/test/v0.0.5-v0.0.6/v005_v006.spec.ts rename to packages/migration/test/v0.0.5-v0.0.6/v005_v006.spec.ts index a1d84b73172..d85768603cc 100644 --- a/packages/foundations/scripts/test/v0.0.5-v0.0.6/v005_v006.spec.ts +++ b/packages/migration/test/v0.0.5-v0.0.6/v005_v006.spec.ts @@ -1,11 +1,11 @@ import { describe, expect, test } from 'vitest'; -import { migrate } from '../../migration'; -import { ReplaceResult } from 'replace-in-file'; +import { type ReplaceResult } from 'replace-in-file'; +import { migrate } from '../../src/migration'; describe('v005_v006', () => { test('check if changes are detected', async () => { const result = migrate({ - src: './scripts/test/v0.0.5-v0.0.6', + src: './test/v0.0.5-v0.0.6', type: ['v005_v006'], dryRun: true }); diff --git a/packages/foundations/scripts/tsconfig.json b/packages/migration/tsconfig.json similarity index 100% rename from packages/foundations/scripts/tsconfig.json rename to packages/migration/tsconfig.json diff --git a/packages/foundations/scripts/vitest.config.ts b/packages/migration/vitest.config.ts similarity index 62% rename from packages/foundations/scripts/vitest.config.ts rename to packages/migration/vitest.config.ts index d3230064db1..08aee380068 100644 --- a/packages/foundations/scripts/vitest.config.ts +++ b/packages/migration/vitest.config.ts @@ -2,6 +2,6 @@ import { defineConfig } from 'vitest/config'; export default defineConfig({ test: { - include: ['scripts/**/*.{test,spec}.?(c|m)[jt]s?(x)'] + include: ['test/**/*.{test,spec}.?(c|m)[jt]s?(x)'] } }); diff --git a/scripts/package.json b/scripts/package.json index 252a0e79194..93ab6deb5ae 100644 --- a/scripts/package.json +++ b/scripts/package.json @@ -4,10 +4,11 @@ "type": "module", "description": "contains scripts for monorepo", "scripts": { - "build": "npm-run-all build:foundations build:components", + "build": "npm-run-all build:foundations build:components build:migration", "build-outputs": "npm-run-all -p build-outputs:*", "build-outputs:components": "npm run copy-output --workspace=@db-ui/components", "build-outputs:foundations": "npm run copy-build --workspace=@db-ui/foundations", + "build-outputs:migration": "npm run copy-build --workspace=@db-ui/migration", "build-outputs:ngx-components": "npm run build --workspace=@db-ui/ngx-components", "build-outputs:react-components": "npm run build --workspace=@db-ui/react-components", "build-outputs:stencil-components": "npm run build --workspace=@db-ui/web-components", @@ -24,6 +25,7 @@ "build-showcases:vue": "npm run build --workspace=vue-showcase", "build:components": "npm run build --workspace=@db-ui/components", "build:foundations": "npm run build --workspace=@db-ui/foundations", + "build:migration": "npm run build --workspace=@db-ui/migration", "dev": "tsx dev.js", "dev:angular-components": "npm run dev:angular --workspace=@db-ui/components", "dev:plain-html-components": "npm run dev:html --workspace=@db-ui/components", @@ -60,7 +62,7 @@ "start-showcase:vue": "npm run dev --workspace=vue-showcase", "start:foundations": "npm run start --workspace=@db-ui/foundations", "test": "npm-run-all -p test:*", - "test:foundations-migration": "npm run test --workspace=@db-ui/foundations", + "test:migration": "npm run test --workspace=@db-ui/migration", "update:icon-fonts": "npm-run-all generate:icon-fonts generate:icon-types" }, "devDependencies": { From b530c91c5f807363a2d3aa6d4a981b89788d8507 Mon Sep 17 00:00:00 2001 From: Nicolas Merget Date: Tue, 10 Dec 2024 14:17:10 +0100 Subject: [PATCH 03/14] fix: linting issues --- packages/foundations/scripts/local/generate-icon-overview.ts | 2 ++ 1 file changed, 2 insertions(+) diff --git a/packages/foundations/scripts/local/generate-icon-overview.ts b/packages/foundations/scripts/local/generate-icon-overview.ts index 8353c25f980..d143b47da00 100644 --- a/packages/foundations/scripts/local/generate-icon-overview.ts +++ b/packages/foundations/scripts/local/generate-icon-overview.ts @@ -1,3 +1,5 @@ +/* eslint-disable @typescript-eslint/no-unsafe-call */ + /* * This script can be used to update the icon overview for foundation testing. */ From 3e4c8c3aba6a415916dd90402ab04d378f3431b1 Mon Sep 17 00:00:00 2001 From: Nicolas Merget Date: Tue, 10 Dec 2024 16:30:47 +0100 Subject: [PATCH 04/14] fix: issue with publishing migration library --- .github/scripts/publish-npm.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/scripts/publish-npm.sh b/.github/scripts/publish-npm.sh index 5af84706dc4..118e0e4d56d 100644 --- a/.github/scripts/publish-npm.sh +++ b/.github/scripts/publish-npm.sh @@ -58,7 +58,7 @@ for REGISTRY in 'GITHUB' 'NPM'; do fi # TODO: Add other build as well - for PACKAGE in 'foundations' 'components' 'ngx-components' 'react-components' 'v-components' 'web-components'; do + for PACKAGE in 'foundations' 'migration' 'components' 'ngx-components' 'react-components' 'v-components' 'web-components'; do echo "โคด Publish $PACKAGE with tag $TAG to $REGISTRY" # https://docs.npmjs.com/generating-provenance-statements#example-github-actions-workflow npm publish --tag "$TAG" db-ui-"$PACKAGE"-"$VALID_SEMVER_VERSION".tgz --provenance From 9c6421aa245e041b04c4749a54866e6705c4949d Mon Sep 17 00:00:00 2001 From: Maximilian Franzke <787658+mfranzke@users.noreply.github.com> Date: Tue, 10 Dec 2024 17:15:02 +0100 Subject: [PATCH 05/14] Update README.md --- packages/foundations/README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/foundations/README.md b/packages/foundations/README.md index 79e388d212a..6a06e100eee 100644 --- a/packages/foundations/README.md +++ b/packages/foundations/README.md @@ -306,7 +306,7 @@ If you want to optimize the size of the loaded styles, you might skip loading `@ ## Migration -We provide a [cli tool](https://github.com/db-ui/mono/blob/main/packages/migration/README.md) to auto migrate your source code. +We provide a [CLI tool](https://github.com/db-ui/mono/blob/main/packages/migration/README.md) to auto migrate your source code. ## Deutsche Bahn brand From 0ab4615d17a6089cdef3bc9fa39782b4702b7bcf Mon Sep 17 00:00:00 2001 From: Nicolas Merget Date: Tue, 10 Dec 2024 17:33:08 +0100 Subject: [PATCH 06/14] chore: update package-lock.json --- package-lock.json | 44 +++++++++++++++++++++++--------------------- 1 file changed, 23 insertions(+), 21 deletions(-) diff --git a/package-lock.json b/package-lock.json index 6962f1d1533..f47feb3b510 100644 --- a/package-lock.json +++ b/package-lock.json @@ -4959,6 +4959,10 @@ "resolved": "packages/foundations", "link": true }, + "node_modules/@db-ui/migration": { + "resolved": "packages/migration", + "link": true + }, "node_modules/@db-ui/mono-e2e": { "resolved": "e2e", "link": true @@ -15211,7 +15215,6 @@ "version": "5.3.0", "resolved": "https://registry.npmjs.org/chalk/-/chalk-5.3.0.tgz", "integrity": "sha512-dLitG79d+GV1Nb/VYcCDFivJeK1hiukt9QjRNVOsUtTy1rR1YJsmpGGTZ3qJos+uw7WmWF4wUwBd9jxjocFC2w==", - "dev": true, "engines": { "node": "^12.17.0 || ^14.13 || >=16.0.0" }, @@ -15867,7 +15870,6 @@ "version": "12.1.0", "resolved": "https://registry.npmjs.org/commander/-/commander-12.1.0.tgz", "integrity": "sha512-Vw8qHK3bZM9y/P10u3Vib8o/DdkvA2OtPtZvD871QKjy74Wj1WSKFILMPRPSdUSx5RFK1arlJzEtA4PkFgnbuA==", - "dev": true, "engines": { "node": ">=18" } @@ -20663,7 +20665,6 @@ "version": "11.0.0", "resolved": "https://registry.npmjs.org/glob/-/glob-11.0.0.tgz", "integrity": "sha512-9UiX/Bl6J2yaBbxKoEBRm4Cipxgok8kQYcOPEhScPwebu2I0HoQOuYdIO6S3hLuWoZgpDpwQZMzTFxgpkyT76g==", - "dev": true, "dependencies": { "foreground-child": "^3.1.0", "jackspeak": "^4.0.1", @@ -20704,7 +20705,6 @@ "version": "2.0.1", "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-2.0.1.tgz", "integrity": "sha512-XnAIvQ8eM+kC6aULx6wuQiwVsnzsi9d3WxzV3FpWTGA19F621kwdbsAcFKXgKUHZWsy+mY6iL1sHTxWEFCytDA==", - "dev": true, "dependencies": { "balanced-match": "^1.0.0" } @@ -20713,7 +20713,6 @@ "version": "10.0.1", "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-10.0.1.tgz", "integrity": "sha512-ethXTt3SGGR+95gudmqJ1eNhRO7eGEGIgYA9vnPatK4/etz2MEVDno5GMCibdMTuBMyElzIlgxMna3K94XDIDQ==", - "dev": true, "dependencies": { "brace-expansion": "^2.0.1" }, @@ -23360,7 +23359,6 @@ "version": "4.0.1", "resolved": "https://registry.npmjs.org/jackspeak/-/jackspeak-4.0.1.tgz", "integrity": "sha512-cub8rahkh0Q/bw1+GxP7aeSe29hHHn2V4m29nnDlvCdlgU+3UGxkZp7Z53jLUdpX3jdTO0nJZUDl3xvbWc2Xog==", - "dev": true, "dependencies": { "@isaacs/cliui": "^8.0.2" }, @@ -24919,7 +24917,6 @@ "version": "11.0.0", "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-11.0.0.tgz", "integrity": "sha512-Qv32eSV1RSCfhY3fpPE2GNZ8jgM9X7rdAfemLWqTUxwiyIC4jJ6Sy0fZ8H+oLWevO6i4/bizg7c8d8i6bxrzbA==", - "dev": true, "engines": { "node": "20 || >=22" } @@ -30394,7 +30391,6 @@ "version": "2.0.0", "resolved": "https://registry.npmjs.org/path-scurry/-/path-scurry-2.0.0.tgz", "integrity": "sha512-ypGJsmGtdXUOeM5u93TyeIEfEhM6s+ljAhrk5vAvSx8uyY/02OvrZnA0YNGUrPXfpJMgI1ODd3nwz8Npx4O4cg==", - "dev": true, "dependencies": { "lru-cache": "^11.0.0", "minipass": "^7.1.2" @@ -32825,7 +32821,6 @@ "version": "8.2.0", "resolved": "https://registry.npmjs.org/replace-in-file/-/replace-in-file-8.2.0.tgz", "integrity": "sha512-hMsQtdYHwWviQT5ZbNsgfu0WuCiNlcUSnnD+aHAL081kbU9dPkPocDaHlDvAHKydTWWpx1apfcEcmvIyQk3CpQ==", - "dev": true, "dependencies": { "chalk": "^5.3.0", "glob": "^10.4.2", @@ -32842,7 +32837,6 @@ "version": "2.0.1", "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-2.0.1.tgz", "integrity": "sha512-XnAIvQ8eM+kC6aULx6wuQiwVsnzsi9d3WxzV3FpWTGA19F621kwdbsAcFKXgKUHZWsy+mY6iL1sHTxWEFCytDA==", - "dev": true, "dependencies": { "balanced-match": "^1.0.0" } @@ -32851,7 +32845,6 @@ "version": "10.4.5", "resolved": "https://registry.npmjs.org/glob/-/glob-10.4.5.tgz", "integrity": "sha512-7Bv8RF0k6xjo7d4A/PxYLbUCfb6c+Vpd2/mB2yRDlew7Jb5hEXiCD9ibfO7wpk8i4sevK6DFny9h7EYbM3/sHg==", - "dev": true, "dependencies": { "foreground-child": "^3.1.0", "jackspeak": "^3.1.2", @@ -32871,7 +32864,6 @@ "version": "3.4.3", "resolved": "https://registry.npmjs.org/jackspeak/-/jackspeak-3.4.3.tgz", "integrity": "sha512-OGlZQpz2yfahA/Rd1Y8Cd9SIEsqvXkLVoSw/cgwhnhFMDbsQFeZYoJJ7bIZBS9BcamUW96asq/npPWugM+RQBw==", - "dev": true, "dependencies": { "@isaacs/cliui": "^8.0.2" }, @@ -32885,14 +32877,12 @@ "node_modules/replace-in-file/node_modules/lru-cache": { "version": "10.4.3", "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-10.4.3.tgz", - "integrity": "sha512-JNAzZcXrCt42VGLuYz0zfAzDfAvJWW6AfYlDBQyDV5DClI2m5sAmK+OIO7s59XfsRsWHp02jAJrRadPRGTt6SQ==", - "dev": true + "integrity": "sha512-JNAzZcXrCt42VGLuYz0zfAzDfAvJWW6AfYlDBQyDV5DClI2m5sAmK+OIO7s59XfsRsWHp02jAJrRadPRGTt6SQ==" }, "node_modules/replace-in-file/node_modules/minimatch": { "version": "9.0.5", "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-9.0.5.tgz", "integrity": "sha512-G6T0ZX48xgozx7587koeX9Ys2NYy6Gmv//P89sEte9V9whIapMNF4idKxnW2QtCcLiTWlb/wfCabAtAFWhhBow==", - "dev": true, "dependencies": { "brace-expansion": "^2.0.1" }, @@ -32907,7 +32897,6 @@ "version": "1.11.1", "resolved": "https://registry.npmjs.org/path-scurry/-/path-scurry-1.11.1.tgz", "integrity": "sha512-Xa4Nw17FS9ApQFJ9umLiJS4orGjm7ZzwUrwamcGQuHSzDyth9boKDaycYdDcZDuqYATXw4HFXgaqWTctW/v1HA==", - "dev": true, "dependencies": { "lru-cache": "^10.2.0", "minipass": "^5.0.0 || ^6.0.2 || ^7.0.0" @@ -41331,16 +41320,29 @@ "devDependencies": { "@csstools/normalize.css": "12.1.1", "@db-ux/core-icons": "^0.0.7", - "commander": "^12.0.0", "cpr": "3.0.1", "cssnano": "^7.0.6", "dotenv": "^16.4.7", - "glob": "^11.0.0", "nodemon": "3.1.7", - "replace-in-file": "^8.2.0", "sass": "1.77.4", "tsx": "^4.19.2", - "vite": "^6.0.3", + "vite": "^6.0.3" + } + }, + "packages/migration": { + "version": "0.0.0", + "license": "DB Design License", + "dependencies": { + "commander": "^12.0.0", + "glob": "^11.0.0", + "replace-in-file": "^8.2.0" + }, + "bin": { + "migration": "build/index.js" + }, + "devDependencies": { + "cpr": "3.0.1", + "tsx": "^4.19.2", "vitest": "^2.1.8" } }, @@ -41408,7 +41410,7 @@ }, "showcases/next-showcase": { "dependencies": { - "next": "*", + "next": "latest", "react": "18.3.1", "react-dom": "18.3.1" }, From 4e769dc52f071c26465a59b7984a0fc23dc52aab Mon Sep 17 00:00:00 2001 From: Nicolas Merget Date: Wed, 11 Dec 2024 08:49:00 +0100 Subject: [PATCH 07/14] fix: issues from PR --- packages/migration/README.md | 2 +- packages/migration/package.json | 4 ++-- packages/migration/src/cli.ts | 10 ++-------- packages/migration/src/migration/index.ts | 4 ++-- 4 files changed, 7 insertions(+), 13 deletions(-) diff --git a/packages/migration/README.md b/packages/migration/README.md index 0d377297b20..531fbeeb37d 100644 --- a/packages/migration/README.md +++ b/packages/migration/README.md @@ -10,7 +10,7 @@ We provide a cli tool to auto migrate your source code. Use this command in your repository: ```shell -npx @db-ui/foundations migration --type XXX --src=./src +npx @db-ui/migration -t=v005_v006 -s=./src ``` ## Deutsche Bahn brand diff --git a/packages/migration/package.json b/packages/migration/package.json index 593829dd1b8..bdbac0fe7dd 100644 --- a/packages/migration/package.json +++ b/packages/migration/package.json @@ -2,12 +2,12 @@ "name": "@db-ui/migration", "version": "0.0.0", "type": "module", - "description": "Provides basic tokens and assets based on DB UX Design System Core.", + "description": "Migration script for changing your code in between DB UX Design System v3 versions regarding BREAKING CHANGES.", "repository": { "type": "git", "url": "https://github.com/db-ui/mono.git" }, - "license": "DB Design License", + "license": "Apache-2.0", "bin": { "@db-ui/migration": "build/index.js" }, diff --git a/packages/migration/src/cli.ts b/packages/migration/src/cli.ts index a62f94f97b9..0edbe96c95b 100644 --- a/packages/migration/src/cli.ts +++ b/packages/migration/src/cli.ts @@ -5,14 +5,8 @@ import startProgram from './program'; import { options } from './data'; import { migrate } from './migration'; -const action = async (functionName: string, options: OptionsType) => { - if (functionName === 'migration') { - migrate(options, true); - } else { - console.error( - `There is no function for this library named ${functionName}` - ); - } +const action = async (_: unknown, options: OptionsType) => { + migrate(options, true); }; startProgram( diff --git a/packages/migration/src/migration/index.ts b/packages/migration/src/migration/index.ts index a586f71d2c8..48700783c02 100644 --- a/packages/migration/src/migration/index.ts +++ b/packages/migration/src/migration/index.ts @@ -1,6 +1,6 @@ import { globSync } from 'glob'; -import { type ReplaceInFileConfig, replaceInFileSync } from 'replace-in-file'; -import type { ReplaceResult } from 'replace-in-file'; +import type { ReplaceInFileConfig, ReplaceResult } from 'replace-in-file'; +import { replaceInFileSync } from 'replace-in-file'; import type { OptionsType } from '../types'; import { migrationTypes } from '../data'; From a0f3402e4b7acb4a8e9ab1b6c980ff51ee82d068 Mon Sep 17 00:00:00 2001 From: Maximilian Franzke <787658+mfranzke@users.noreply.github.com> Date: Wed, 11 Dec 2024 08:54:52 +0100 Subject: [PATCH 08/14] Update generate-icon-overview.ts --- packages/foundations/scripts/local/generate-icon-overview.ts | 2 -- 1 file changed, 2 deletions(-) diff --git a/packages/foundations/scripts/local/generate-icon-overview.ts b/packages/foundations/scripts/local/generate-icon-overview.ts index d143b47da00..8353c25f980 100644 --- a/packages/foundations/scripts/local/generate-icon-overview.ts +++ b/packages/foundations/scripts/local/generate-icon-overview.ts @@ -1,5 +1,3 @@ -/* eslint-disable @typescript-eslint/no-unsafe-call */ - /* * This script can be used to update the icon overview for foundation testing. */ From 3c8ed704e5d2b2db81b43085e31adc1f39704264 Mon Sep 17 00:00:00 2001 From: Nicolas Merget Date: Wed, 11 Dec 2024 08:56:41 +0100 Subject: [PATCH 09/14] fix: issues from PR --- packages/migration/README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/migration/README.md b/packages/migration/README.md index 531fbeeb37d..1117b0d2b91 100644 --- a/packages/migration/README.md +++ b/packages/migration/README.md @@ -10,7 +10,7 @@ We provide a cli tool to auto migrate your source code. Use this command in your repository: ```shell -npx @db-ui/migration -t=v005_v006 -s=./src +npx @db-ui/migration --type=v005_v006 --src=./src ``` ## Deutsche Bahn brand From c3c4466ac64030dfa299b78ccd17edacede038c9 Mon Sep 17 00:00:00 2001 From: Nicolas Merget Date: Wed, 11 Dec 2024 09:00:47 +0100 Subject: [PATCH 10/14] chore: update from main --- package-lock.json | 42 ++++++++++++++++++++++-------------------- 1 file changed, 22 insertions(+), 20 deletions(-) diff --git a/package-lock.json b/package-lock.json index a50b93cd17f..bf8eaf78981 100644 --- a/package-lock.json +++ b/package-lock.json @@ -4959,6 +4959,10 @@ "resolved": "packages/foundations", "link": true }, + "node_modules/@db-ui/migration": { + "resolved": "packages/migration", + "link": true + }, "node_modules/@db-ui/mono-e2e": { "resolved": "e2e", "link": true @@ -15211,7 +15215,6 @@ "version": "5.3.0", "resolved": "https://registry.npmjs.org/chalk/-/chalk-5.3.0.tgz", "integrity": "sha512-dLitG79d+GV1Nb/VYcCDFivJeK1hiukt9QjRNVOsUtTy1rR1YJsmpGGTZ3qJos+uw7WmWF4wUwBd9jxjocFC2w==", - "dev": true, "engines": { "node": "^12.17.0 || ^14.13 || >=16.0.0" }, @@ -15867,7 +15870,6 @@ "version": "12.1.0", "resolved": "https://registry.npmjs.org/commander/-/commander-12.1.0.tgz", "integrity": "sha512-Vw8qHK3bZM9y/P10u3Vib8o/DdkvA2OtPtZvD871QKjy74Wj1WSKFILMPRPSdUSx5RFK1arlJzEtA4PkFgnbuA==", - "dev": true, "engines": { "node": ">=18" } @@ -20663,7 +20665,6 @@ "version": "11.0.0", "resolved": "https://registry.npmjs.org/glob/-/glob-11.0.0.tgz", "integrity": "sha512-9UiX/Bl6J2yaBbxKoEBRm4Cipxgok8kQYcOPEhScPwebu2I0HoQOuYdIO6S3hLuWoZgpDpwQZMzTFxgpkyT76g==", - "dev": true, "dependencies": { "foreground-child": "^3.1.0", "jackspeak": "^4.0.1", @@ -20704,7 +20705,6 @@ "version": "2.0.1", "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-2.0.1.tgz", "integrity": "sha512-XnAIvQ8eM+kC6aULx6wuQiwVsnzsi9d3WxzV3FpWTGA19F621kwdbsAcFKXgKUHZWsy+mY6iL1sHTxWEFCytDA==", - "dev": true, "dependencies": { "balanced-match": "^1.0.0" } @@ -20713,7 +20713,6 @@ "version": "10.0.1", "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-10.0.1.tgz", "integrity": "sha512-ethXTt3SGGR+95gudmqJ1eNhRO7eGEGIgYA9vnPatK4/etz2MEVDno5GMCibdMTuBMyElzIlgxMna3K94XDIDQ==", - "dev": true, "dependencies": { "brace-expansion": "^2.0.1" }, @@ -23360,7 +23359,6 @@ "version": "4.0.1", "resolved": "https://registry.npmjs.org/jackspeak/-/jackspeak-4.0.1.tgz", "integrity": "sha512-cub8rahkh0Q/bw1+GxP7aeSe29hHHn2V4m29nnDlvCdlgU+3UGxkZp7Z53jLUdpX3jdTO0nJZUDl3xvbWc2Xog==", - "dev": true, "dependencies": { "@isaacs/cliui": "^8.0.2" }, @@ -24919,7 +24917,6 @@ "version": "11.0.0", "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-11.0.0.tgz", "integrity": "sha512-Qv32eSV1RSCfhY3fpPE2GNZ8jgM9X7rdAfemLWqTUxwiyIC4jJ6Sy0fZ8H+oLWevO6i4/bizg7c8d8i6bxrzbA==", - "dev": true, "engines": { "node": "20 || >=22" } @@ -30394,7 +30391,6 @@ "version": "2.0.0", "resolved": "https://registry.npmjs.org/path-scurry/-/path-scurry-2.0.0.tgz", "integrity": "sha512-ypGJsmGtdXUOeM5u93TyeIEfEhM6s+ljAhrk5vAvSx8uyY/02OvrZnA0YNGUrPXfpJMgI1ODd3nwz8Npx4O4cg==", - "dev": true, "dependencies": { "lru-cache": "^11.0.0", "minipass": "^7.1.2" @@ -32825,7 +32821,6 @@ "version": "8.2.0", "resolved": "https://registry.npmjs.org/replace-in-file/-/replace-in-file-8.2.0.tgz", "integrity": "sha512-hMsQtdYHwWviQT5ZbNsgfu0WuCiNlcUSnnD+aHAL081kbU9dPkPocDaHlDvAHKydTWWpx1apfcEcmvIyQk3CpQ==", - "dev": true, "dependencies": { "chalk": "^5.3.0", "glob": "^10.4.2", @@ -32842,7 +32837,6 @@ "version": "2.0.1", "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-2.0.1.tgz", "integrity": "sha512-XnAIvQ8eM+kC6aULx6wuQiwVsnzsi9d3WxzV3FpWTGA19F621kwdbsAcFKXgKUHZWsy+mY6iL1sHTxWEFCytDA==", - "dev": true, "dependencies": { "balanced-match": "^1.0.0" } @@ -32851,7 +32845,6 @@ "version": "10.4.5", "resolved": "https://registry.npmjs.org/glob/-/glob-10.4.5.tgz", "integrity": "sha512-7Bv8RF0k6xjo7d4A/PxYLbUCfb6c+Vpd2/mB2yRDlew7Jb5hEXiCD9ibfO7wpk8i4sevK6DFny9h7EYbM3/sHg==", - "dev": true, "dependencies": { "foreground-child": "^3.1.0", "jackspeak": "^3.1.2", @@ -32871,7 +32864,6 @@ "version": "3.4.3", "resolved": "https://registry.npmjs.org/jackspeak/-/jackspeak-3.4.3.tgz", "integrity": "sha512-OGlZQpz2yfahA/Rd1Y8Cd9SIEsqvXkLVoSw/cgwhnhFMDbsQFeZYoJJ7bIZBS9BcamUW96asq/npPWugM+RQBw==", - "dev": true, "dependencies": { "@isaacs/cliui": "^8.0.2" }, @@ -32885,14 +32877,12 @@ "node_modules/replace-in-file/node_modules/lru-cache": { "version": "10.4.3", "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-10.4.3.tgz", - "integrity": "sha512-JNAzZcXrCt42VGLuYz0zfAzDfAvJWW6AfYlDBQyDV5DClI2m5sAmK+OIO7s59XfsRsWHp02jAJrRadPRGTt6SQ==", - "dev": true + "integrity": "sha512-JNAzZcXrCt42VGLuYz0zfAzDfAvJWW6AfYlDBQyDV5DClI2m5sAmK+OIO7s59XfsRsWHp02jAJrRadPRGTt6SQ==" }, "node_modules/replace-in-file/node_modules/minimatch": { "version": "9.0.5", "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-9.0.5.tgz", "integrity": "sha512-G6T0ZX48xgozx7587koeX9Ys2NYy6Gmv//P89sEte9V9whIapMNF4idKxnW2QtCcLiTWlb/wfCabAtAFWhhBow==", - "dev": true, "dependencies": { "brace-expansion": "^2.0.1" }, @@ -32907,7 +32897,6 @@ "version": "1.11.1", "resolved": "https://registry.npmjs.org/path-scurry/-/path-scurry-1.11.1.tgz", "integrity": "sha512-Xa4Nw17FS9ApQFJ9umLiJS4orGjm7ZzwUrwamcGQuHSzDyth9boKDaycYdDcZDuqYATXw4HFXgaqWTctW/v1HA==", - "dev": true, "dependencies": { "lru-cache": "^10.2.0", "minipass": "^5.0.0 || ^6.0.2 || ^7.0.0" @@ -41331,16 +41320,29 @@ "devDependencies": { "@csstools/normalize.css": "12.1.1", "@db-ux/core-icons": "0.0.7", - "commander": "^12.0.0", "cpr": "3.0.1", "cssnano": "^7.0.6", "dotenv": "^16.4.7", - "glob": "^11.0.0", "nodemon": "3.1.7", - "replace-in-file": "^8.2.0", "sass": "1.77.4", "tsx": "^4.19.2", - "vite": "^6.0.3", + "vite": "^6.0.3" + } + }, + "packages/migration": { + "version": "0.0.0", + "license": "Apache-2.0", + "dependencies": { + "commander": "^12.0.0", + "glob": "^11.0.0", + "replace-in-file": "^8.2.0" + }, + "bin": { + "migration": "build/index.js" + }, + "devDependencies": { + "cpr": "3.0.1", + "tsx": "^4.19.2", "vitest": "^2.1.8" } }, From 5d380d3dfbe45b44fe1ce1d1e2a42ba452f76cfe Mon Sep 17 00:00:00 2001 From: Maximilian Franzke <787658+mfranzke@users.noreply.github.com> Date: Wed, 11 Dec 2024 11:19:20 +0100 Subject: [PATCH 11/14] Update generate-icon-overview.ts --- packages/foundations/scripts/local/generate-icon-overview.ts | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/packages/foundations/scripts/local/generate-icon-overview.ts b/packages/foundations/scripts/local/generate-icon-overview.ts index 8353c25f980..13c8251dd3e 100644 --- a/packages/foundations/scripts/local/generate-icon-overview.ts +++ b/packages/foundations/scripts/local/generate-icon-overview.ts @@ -30,7 +30,8 @@ const generateIconOverview = () => {
- ${ALL_ICONS.map( + ${// eslint-disable-next-line @typescript-eslint/no-unsafe-call + ALL_ICONS.map( (icon) => `
Date: Wed, 11 Dec 2024 11:33:51 +0100 Subject: [PATCH 12/14] refactor: prettier --- .../foundations/scripts/local/generate-icon-overview.ts | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/packages/foundations/scripts/local/generate-icon-overview.ts b/packages/foundations/scripts/local/generate-icon-overview.ts index 13c8251dd3e..1acc16207f6 100644 --- a/packages/foundations/scripts/local/generate-icon-overview.ts +++ b/packages/foundations/scripts/local/generate-icon-overview.ts @@ -30,9 +30,10 @@ const generateIconOverview = () => {
- ${// eslint-disable-next-line @typescript-eslint/no-unsafe-call + ${ + // eslint-disable-next-line @typescript-eslint/no-unsafe-call ALL_ICONS.map( - (icon) => ` + (icon) => `
` - ).join('\n')} + ).join('\n') + }
`; From dcdd349a6378295dce069a93140de23fb6ff204d Mon Sep 17 00:00:00 2001 From: Maximilian Franzke Date: Tue, 17 Dec 2024 12:42:22 +0100 Subject: [PATCH 13/14] refactor: readded this initial code change --- .../scripts/local/generate-icon-overview.ts | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/packages/foundations/scripts/local/generate-icon-overview.ts b/packages/foundations/scripts/local/generate-icon-overview.ts index d143b47da00..db503430b61 100644 --- a/packages/foundations/scripts/local/generate-icon-overview.ts +++ b/packages/foundations/scripts/local/generate-icon-overview.ts @@ -1,5 +1,3 @@ -/* eslint-disable @typescript-eslint/no-unsafe-call */ - /* * This script can be used to update the icon overview for foundation testing. */ @@ -32,8 +30,10 @@ const generateIconOverview = () => {
- ${ALL_ICONS.map( - (icon) => ` + ${ + /* eslint-disable-next-line @typescript-eslint/no-unsafe-call */ + ALL_ICONS.map( + (icon) => `
` - ).join('\n')} + ).join('\n') + }
`; From 2345e72fb57f8b0682425393ca0ea55ec4e929e1 Mon Sep 17 00:00:00 2001 From: Maximilian Franzke <787658+mfranzke@users.noreply.github.com> Date: Tue, 17 Dec 2024 12:43:40 +0100 Subject: [PATCH 14/14] Update package-lock.json --- package-lock.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package-lock.json b/package-lock.json index ff845315421..c8c99365e7a 100644 --- a/package-lock.json +++ b/package-lock.json @@ -41451,7 +41451,7 @@ }, "showcases/next-showcase": { "dependencies": { - "next": "latest", + "next": "*", "react": "18.3.1", "react-dom": "18.3.1" },