From fffb9e68fb45905a6f8c118efa40a51b3136fd34 Mon Sep 17 00:00:00 2001 From: Martin Marosi Date: Tue, 30 Jan 2024 12:11:25 +0100 Subject: [PATCH 1/2] Exclude PF next directory from tsc-transform-imports --- packages/tsc-transform-imports/src/index.ts | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/packages/tsc-transform-imports/src/index.ts b/packages/tsc-transform-imports/src/index.ts index 2f53cfd625..d9b55d8f22 100644 --- a/packages/tsc-transform-imports/src/index.ts +++ b/packages/tsc-transform-imports/src/index.ts @@ -26,31 +26,35 @@ const VARIANT_MATCH = /Variants?$/g; const POSITION_MATCH = /Position$/g; const SIZE_MATCH = /Sizes?$/g; +function filterNonStableLocation(location: string) { + return !location.includes('next') && !location.includes('deprecated'); +} + function getPossibleLocations(roots: string[], nameBinding: string) { let moduleLocation = roots - .map((root) => glob.sync(`${root}/dist/esm/**/${nameBinding}.js`).filter((p) => !p.includes('deprecated'))) + .map((root) => glob.sync(`${root}/dist/esm/**/${nameBinding}.js`).filter(filterNonStableLocation)) .find((r) => r.length > 0)?.[0]; if (!moduleLocation && nameBinding.match(PROPS_MATCH)) { moduleLocation = roots - .map((root) => glob.sync(`${root}/dist/esm/**/${nameBinding.replace(PROPS_MATCH, '')}.js`).filter((p) => !p.includes('deprecated'))) + .map((root) => glob.sync(`${root}/dist/esm/**/${nameBinding.replace(PROPS_MATCH, '')}.js`).filter(filterNonStableLocation)) .find((r) => r.length > 0)?.[0]; } if (!moduleLocation && nameBinding.match(VARIANT_MATCH)) { moduleLocation = roots - .map((root) => glob.sync(`${root}/dist/esm/**/${nameBinding.replace(VARIANT_MATCH, '')}.js`).filter((p) => !p.includes('deprecated'))) + .map((root) => glob.sync(`${root}/dist/esm/**/${nameBinding.replace(VARIANT_MATCH, '')}.js`).filter(filterNonStableLocation)) .find((r) => r.length > 0)?.[0]; } if (!moduleLocation && nameBinding.match(POSITION_MATCH)) { moduleLocation = roots - .map((root) => glob.sync(`${root}/dist/esm/**/${nameBinding.replace(POSITION_MATCH, '')}.js`).filter((p) => !p.includes('deprecated'))) + .map((root) => glob.sync(`${root}/dist/esm/**/${nameBinding.replace(POSITION_MATCH, '')}.js`).filter(filterNonStableLocation)) .find((r) => r.length > 0)?.[0]; } if (!moduleLocation && nameBinding.match(SIZE_MATCH)) { moduleLocation = roots - .map((root) => glob.sync(`${root}/dist/esm/**/${nameBinding.replace(SIZE_MATCH, '')}.js`).filter((p) => !p.includes('deprecated'))) + .map((root) => glob.sync(`${root}/dist/esm/**/${nameBinding.replace(SIZE_MATCH, '')}.js`).filter(filterNonStableLocation)) .find((r) => r.length > 0)?.[0]; } From d5f88d2ea69da9c1e52952d53667f9c88b9bdbc6 Mon Sep 17 00:00:00 2001 From: NachoBot Date: Tue, 30 Jan 2024 14:07:54 +0100 Subject: [PATCH 2/2] Updating @redhat-cloud-services/tsc-transform-imports to 1.0.7 --- packages/tsc-transform-imports/package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/tsc-transform-imports/package.json b/packages/tsc-transform-imports/package.json index 3e9a8c256d..83dfa61126 100644 --- a/packages/tsc-transform-imports/package.json +++ b/packages/tsc-transform-imports/package.json @@ -1,6 +1,6 @@ { "name": "@redhat-cloud-services/tsc-transform-imports", - "version": "1.0.6", + "version": "1.0.7", "main": "index.js", "types": "index.d.ts", "dependencies": {