From 1513ea46a0727fb1ade0027649603f527fe1f418 Mon Sep 17 00:00:00 2001 From: Nikita Guryev Date: Mon, 25 Nov 2024 12:35:17 +0300 Subject: [PATCH] fix(chore,schematics): schematics bundle imports (#449) --- packages/schematics/rollup.config.js | 1 + .../schematics/scripts/copy-meta-to-dist.js | 1 + .../__snapshots__/index.spec.ts.snap | 20 +++++++++---------- .../src/migrations/css-selectors/index.ts | 4 ++-- 4 files changed, 14 insertions(+), 12 deletions(-) diff --git a/packages/schematics/rollup.config.js b/packages/schematics/rollup.config.js index 24e51af10..3f45f97c6 100644 --- a/packages/schematics/rollup.config.js +++ b/packages/schematics/rollup.config.js @@ -27,6 +27,7 @@ module.exports = [ input: { 'ng-add/index': path.join(__dirname, 'src/ng-add/index.ts'), 'utils/package-config': path.join(__dirname, 'src/utils/package-config.ts'), + 'utils/messages': path.join(__dirname, 'src/utils/messages.ts'), ...getMigrations().reduce((res, cur) => { res[`migrations/${cur}/index`] = path.join(__dirname, `src/migrations/${cur}/index.ts`); res[`migrations/${cur}/data`] = path.join(__dirname, `src/migrations/${cur}/data.ts`); diff --git a/packages/schematics/scripts/copy-meta-to-dist.js b/packages/schematics/scripts/copy-meta-to-dist.js index fa6b03b8b..159a9ec32 100644 --- a/packages/schematics/scripts/copy-meta-to-dist.js +++ b/packages/schematics/scripts/copy-meta-to-dist.js @@ -51,6 +51,7 @@ const init = async () => { } await copyFileWrapper(resolvePath('../dist/utils/package-config.js'), join(utilsPath, 'package-config.js')); + await copyFileWrapper(resolvePath('../dist/utils/messages.js'), join(utilsPath, 'messages.js')); }; init().catch((error) => console.error(`Failed to initialize directories and copy files: ${error.message}`)); diff --git a/packages/schematics/src/migrations/css-selectors/__snapshots__/index.spec.ts.snap b/packages/schematics/src/migrations/css-selectors/__snapshots__/index.spec.ts.snap index 5e9e7550c..2cb6f82a6 100644 --- a/packages/schematics/src/migrations/css-selectors/__snapshots__/index.spec.ts.snap +++ b/packages/schematics/src/migrations/css-selectors/__snapshots__/index.spec.ts.snap @@ -4,9 +4,9 @@ exports[`css-selectors should inform about deprecated colors in the file 1`] = ` [ " ------------------------- -Please pay attention! Found deprecated сss-selectors in file: +Please pay attention! Found deprecated сss-selectors in file: ../../../../../projects/app/src/styles.scss -Replace with specified rules: +Replace with specified rules: neutral-white -> brand-default -> brand-palette -> @@ -38,9 +38,9 @@ Replace with specified rules: ", " ------------------------- -Please pay attention! Found deprecated сss-selectors in file: +Please pay attention! Found deprecated сss-selectors in file: ../../../../../projects/app/src/app/app.component.html -Replace with specified rules: +Replace with specified rules: neutral-white -> brand-default -> brand-palette -> @@ -77,9 +77,9 @@ exports[`css-selectors should inform about deprecated selectors for fix = false [ " ------------------------- -Please pay attention! Found deprecated сss-selectors in file: +Please pay attention! Found deprecated сss-selectors in file: ../../../../../projects/app/src/styles.scss -Replace with specified rules: +Replace with specified rules: kbq-display-1-strong -> kbq-display-big-strong kbq-display-2-strong -> kbq-display-normal-strong kbq-display-3-strong -> kbq-display-compact-strong @@ -111,9 +111,9 @@ Pay attention: overwriting is possible. Check the code after automatic replaceme ", " ------------------------- -Please pay attention! Found deprecated сss-selectors in file: +Please pay attention! Found deprecated сss-selectors in file: ../../../../../projects/app/src/app/app.component.html -Replace with specified rules: +Replace with specified rules: kbq-display-1-strong -> kbq-display-big-strong kbq-display-2-strong -> kbq-display-normal-strong kbq-display-3-strong -> kbq-display-compact-strong @@ -145,9 +145,9 @@ Pay attention: overwriting is possible. Check the code after automatic replaceme ", " ------------------------- -Please pay attention! Found deprecated сss-selectors in file: +Please pay attention! Found deprecated сss-selectors in file: ../../../../../projects/app/src/app/app.component.ts -Replace with specified rules: +Replace with specified rules: kbq-display-1-strong -> kbq-display-big-strong kbq-display-2-strong -> kbq-display-normal-strong kbq-display-3-strong -> kbq-display-compact-strong diff --git a/packages/schematics/src/migrations/css-selectors/index.ts b/packages/schematics/src/migrations/css-selectors/index.ts index c21aa4443..609112d06 100644 --- a/packages/schematics/src/migrations/css-selectors/index.ts +++ b/packages/schematics/src/migrations/css-selectors/index.ts @@ -71,9 +71,9 @@ function getBaseReplacements(filePath: Path, foundSelectors: ReplaceData[]) { const parsedFilePath = path.relative(__dirname, `.${filePath}`).replace(/\\/g, '/'); return ` ------------------------- -Please pay attention! Found deprecated сss-selectors in file: +Please pay attention! Found deprecated сss-selectors in file: ${parsedFilePath} -Replace with specified rules: +Replace with specified rules: ${foundSelectors.map(({ replace, replaceWith }) => `\t${replace} -> \t${replaceWith}`).join('\n')} ------------------------- `;