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": {