From 6cf5850e58edf2678b2d28034216ff856e085998 Mon Sep 17 00:00:00 2001 From: Nicholas Boll Date: Wed, 6 Nov 2024 15:11:20 -0700 Subject: [PATCH 1/2] fix: Fix Style transform stencil variable lookup (#3038) Fix variable lookups in Stencils during static style transformation. [category:Infrastructure] --- .../styling-transform/lib/utils/handleCreateStencil.ts | 6 +++--- .../styling-transform/lib/utils/parseNodeToStaticValue.ts | 8 ++++---- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/modules/styling-transform/lib/utils/handleCreateStencil.ts b/modules/styling-transform/lib/utils/handleCreateStencil.ts index 7b7ed4f558..89fc302d71 100644 --- a/modules/styling-transform/lib/utils/handleCreateStencil.ts +++ b/modules/styling-transform/lib/utils/handleCreateStencil.ts @@ -341,7 +341,7 @@ function parseStyleBlock( if (ts.isObjectLiteralExpression(property.initializer)) { styleObj = parseObjectToStaticValue(property.initializer, { ...context, - nameScope: `${stencilName}.`, + nameScope: `${stencilName}.vars.`, }); } @@ -350,7 +350,7 @@ function parseStyleBlock( if (returnNode) { styleObj = parseObjectToStaticValue(returnNode, { ...context, - nameScope: `${stencilName}.`, + nameScope: `${stencilName}.vars.`, }); } } @@ -361,7 +361,7 @@ function parseStyleBlock( if (returnNode) { styleObj = parseObjectToStaticValue(returnNode, { ...context, - nameScope: `${stencilName}.`, + nameScope: `${stencilName}.vars.`, }); } } diff --git a/modules/styling-transform/lib/utils/parseNodeToStaticValue.ts b/modules/styling-transform/lib/utils/parseNodeToStaticValue.ts index e4bc76aaf3..1c9bd8b276 100644 --- a/modules/styling-transform/lib/utils/parseNodeToStaticValue.ts +++ b/modules/styling-transform/lib/utils/parseNodeToStaticValue.ts @@ -274,13 +274,13 @@ export function getValueFromAliasedSymbol( function getValueFromProcessedNodes(varName: string, context: TransformerContext): string | void { const {names} = context; - if (names[varName]) { - return names[varName]; - } - if (context.nameScope && names[`${context.nameScope}${varName}`]) { return names[`${context.nameScope}${varName}`]; } + + if (names[varName]) { + return names[varName]; + } } function hasExpression(node: ts.Node): node is ts.Node & {initializer: ts.Expression} { From 5c9ceb54e077d3d6db8f9ccacaf9505d37d7ebe3 Mon Sep 17 00:00:00 2001 From: alanbsmith Date: Wed, 6 Nov 2024 22:12:03 +0000 Subject: [PATCH 2/2] chore: Release v11.1.23 [skip release] --- CHANGELOG.md | 7 +++++++ lerna.json | 2 +- modules/codemod/package.json | 2 +- modules/css/package.json | 2 +- modules/docs/package.json | 10 +++++----- modules/labs-css/package.json | 2 +- modules/labs-react/package.json | 4 ++-- modules/popup-stack/package.json | 2 +- modules/preview-css/package.json | 2 +- modules/preview-react/package.json | 6 +++--- modules/react-fonts/package.json | 2 +- modules/react/package.json | 6 +++--- modules/styling-transform/package.json | 4 ++-- modules/styling/package.json | 4 ++-- 14 files changed, 31 insertions(+), 24 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 47c7b6fd3a..7f7f106078 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -3,6 +3,13 @@ All notable changes to this project will be documented in this file. See [Conventional Commits](https://conventionalcommits.org) for commit guidelines. +## [v11.1.23](https://github.com/Workday/canvas-kit/releases/tag/v11.1.23) (2024-11-06) + +### Infrastructure + +- fix: Fix Style transform stencil variable lookup ([#3038](https://github.com/Workday/canvas-kit/pull/3038)) ([@NicholasBoll](https://github.com/NicholasBoll)) + + ## [v11.1.22](https://github.com/Workday/canvas-kit/releases/tag/v11.1.22) (2024-11-05) ### Components diff --git a/lerna.json b/lerna.json index 55f9d164d7..f139345fe0 100644 --- a/lerna.json +++ b/lerna.json @@ -2,7 +2,7 @@ "packages": [ "modules/**" ], - "version": "11.1.22", + "version": "11.1.23", "npmClient": "yarn", "useWorkspaces": true, "command": { diff --git a/modules/codemod/package.json b/modules/codemod/package.json index 52a3467286..dc9592f128 100644 --- a/modules/codemod/package.json +++ b/modules/codemod/package.json @@ -2,7 +2,7 @@ "name": "@workday/canvas-kit-codemod", "author": "Workday, Inc. (https://www.workday.com)", "license": "Apache-2.0", - "version": "11.1.22", + "version": "11.1.23", "description": "A collection of codemods for use on Workday Canvas Kit packages.", "main": "dist/es6/index.js", "sideEffects": false, diff --git a/modules/css/package.json b/modules/css/package.json index 994527d6c1..f9da0e2556 100644 --- a/modules/css/package.json +++ b/modules/css/package.json @@ -1,6 +1,6 @@ { "name": "@workday/canvas-kit-css", - "version": "11.1.22", + "version": "11.1.23", "description": "The parent module that contains all Workday Canvas Kit CSS components", "author": "Workday, Inc. (https://www.workday.com)", "license": "Apache-2.0", diff --git a/modules/docs/package.json b/modules/docs/package.json index 2948ff7fde..73a4eff935 100644 --- a/modules/docs/package.json +++ b/modules/docs/package.json @@ -1,6 +1,6 @@ { "name": "@workday/canvas-kit-docs", - "version": "11.1.22", + "version": "11.1.23", "description": "Documentation components of Canvas Kit components", "author": "Workday, Inc. (https://www.workday.com)", "license": "Apache-2.0", @@ -44,10 +44,10 @@ "dependencies": { "@emotion/styled": "^11.6.0", "@storybook/csf": "0.0.1", - "@workday/canvas-kit-labs-react": "^11.1.22", - "@workday/canvas-kit-preview-react": "^11.1.22", - "@workday/canvas-kit-react": "^11.1.22", - "@workday/canvas-kit-styling": "^11.1.22", + "@workday/canvas-kit-labs-react": "^11.1.23", + "@workday/canvas-kit-preview-react": "^11.1.23", + "@workday/canvas-kit-react": "^11.1.23", + "@workday/canvas-kit-styling": "^11.1.23", "@workday/canvas-system-icons-web": "^3.0.0", "@workday/canvas-tokens-web": "^2.0.0", "markdown-to-jsx": "^7.2.0", diff --git a/modules/labs-css/package.json b/modules/labs-css/package.json index 87141e0900..66a8b48ee0 100644 --- a/modules/labs-css/package.json +++ b/modules/labs-css/package.json @@ -1,6 +1,6 @@ { "name": "@workday/canvas-kit-labs-css", - "version": "11.1.22", + "version": "11.1.23", "description": "The parent module that contains all Workday Canvas Kit Labs CSS components", "author": "Workday, Inc. (https://www.workday.com)", "license": "Apache-2.0", diff --git a/modules/labs-react/package.json b/modules/labs-react/package.json index 67f703d60d..a60f5d2895 100644 --- a/modules/labs-react/package.json +++ b/modules/labs-react/package.json @@ -1,6 +1,6 @@ { "name": "@workday/canvas-kit-labs-react", - "version": "11.1.22", + "version": "11.1.23", "description": "Canvas Kit Labs is an incubator for new and experimental components. Since we have a rather rigorous process for getting components in at a production level, it can be valuable to make them available earlier while we continuously iterate on the API/functionality. The Labs modules allow us to do that as needed.", "author": "Workday, Inc. (https://www.workday.com)", "license": "Apache-2.0", @@ -46,7 +46,7 @@ "dependencies": { "@emotion/react": "^11.7.1", "@emotion/styled": "^11.6.0", - "@workday/canvas-kit-react": "^11.1.22", + "@workday/canvas-kit-react": "^11.1.23", "@workday/canvas-system-icons-web": "^3.0.0", "@workday/design-assets-types": "^0.2.8", "chroma-js": "^2.1.0", diff --git a/modules/popup-stack/package.json b/modules/popup-stack/package.json index 702ea00c86..bce08ff192 100644 --- a/modules/popup-stack/package.json +++ b/modules/popup-stack/package.json @@ -1,6 +1,6 @@ { "name": "@workday/canvas-kit-popup-stack", - "version": "11.1.22", + "version": "11.1.23", "description": "Stack for managing popup UIs to coordinate global concerns like escape key handling and rendering order", "author": "Workday, Inc. (https://www.workday.com)", "license": "Apache-2.0", diff --git a/modules/preview-css/package.json b/modules/preview-css/package.json index c89b9d618b..0da0a91aca 100644 --- a/modules/preview-css/package.json +++ b/modules/preview-css/package.json @@ -1,6 +1,6 @@ { "name": "@workday/canvas-kit-preview-css", - "version": "11.1.22", + "version": "11.1.23", "description": "The parent module that contains all Workday Canvas Kit Preview CSS components", "author": "Workday, Inc. (https://www.workday.com)", "license": "Apache-2.0", diff --git a/modules/preview-react/package.json b/modules/preview-react/package.json index f4eaf05923..e73f31cd18 100644 --- a/modules/preview-react/package.json +++ b/modules/preview-react/package.json @@ -1,6 +1,6 @@ { "name": "@workday/canvas-kit-preview-react", - "version": "11.1.22", + "version": "11.1.23", "description": "Canvas Kit Preview is made up of components that have the full design and a11y review, are part of the DS ecosystem and are approved for use in product. The API's could be subject to change, but not without strong communication and migration strategies.", "author": "Workday, Inc. (https://www.workday.com)", "license": "Apache-2.0", @@ -46,8 +46,8 @@ "dependencies": { "@emotion/react": "^11.7.1", "@emotion/styled": "^11.6.0", - "@workday/canvas-kit-react": "^11.1.22", - "@workday/canvas-kit-styling": "^11.1.22", + "@workday/canvas-kit-react": "^11.1.23", + "@workday/canvas-kit-styling": "^11.1.23", "@workday/canvas-system-icons-web": "^3.0.0", "@workday/canvas-tokens-web": "^2.0.0", "@workday/design-assets-types": "^0.2.8" diff --git a/modules/react-fonts/package.json b/modules/react-fonts/package.json index 953fbc23aa..73a16ec541 100644 --- a/modules/react-fonts/package.json +++ b/modules/react-fonts/package.json @@ -1,6 +1,6 @@ { "name": "@workday/canvas-kit-react-fonts", - "version": "11.1.22", + "version": "11.1.23", "description": "Fonts for canvas-kit-react", "author": "Workday, Inc. (https://www.workday.com)", "license": "Apache-2.0", diff --git a/modules/react/package.json b/modules/react/package.json index f61497ae72..eedcc4443d 100644 --- a/modules/react/package.json +++ b/modules/react/package.json @@ -1,6 +1,6 @@ { "name": "@workday/canvas-kit-react", - "version": "11.1.22", + "version": "11.1.23", "description": "The parent module that contains all Workday Canvas Kit React components", "author": "Workday, Inc. (https://www.workday.com)", "license": "Apache-2.0", @@ -49,8 +49,8 @@ "@emotion/styled": "^11.6.0", "@popperjs/core": "^2.5.4", "@workday/canvas-colors-web": "^2.0.0", - "@workday/canvas-kit-popup-stack": "^11.1.22", - "@workday/canvas-kit-styling": "^11.1.22", + "@workday/canvas-kit-popup-stack": "^11.1.23", + "@workday/canvas-kit-styling": "^11.1.23", "@workday/canvas-system-icons-web": "^3.0.0", "@workday/canvas-tokens-web": "^2.0.0", "@workday/design-assets-types": "^0.2.8", diff --git a/modules/styling-transform/package.json b/modules/styling-transform/package.json index df0bbf2719..2ffa5a12fe 100644 --- a/modules/styling-transform/package.json +++ b/modules/styling-transform/package.json @@ -1,6 +1,6 @@ { "name": "@workday/canvas-kit-styling-transform", - "version": "11.1.22", + "version": "11.1.23", "description": "The custom CSS in JS solution that takes JS styles and turns them into static CSS", "author": "Workday, Inc. (https://www.workday.com)", "license": "Apache-2.0", @@ -34,7 +34,7 @@ ], "dependencies": { "@emotion/serialize": "^1.0.2", - "@workday/canvas-kit-styling": "^11.1.22", + "@workday/canvas-kit-styling": "^11.1.23", "@workday/canvas-tokens-web": "^2.0.0", "stylis": "4.0.13", "typescript": "4.2" diff --git a/modules/styling/package.json b/modules/styling/package.json index 8d4aa96281..c9e964096c 100644 --- a/modules/styling/package.json +++ b/modules/styling/package.json @@ -1,6 +1,6 @@ { "name": "@workday/canvas-kit-styling", - "version": "11.1.22", + "version": "11.1.23", "description": "The custom CSS in JS solution that takes JS styles and turns them into static CSS", "author": "Workday, Inc. (https://www.workday.com)", "license": "Apache-2.0", @@ -53,7 +53,7 @@ "@emotion/react": "^11.7.1", "@emotion/serialize": "^1.0.2", "@emotion/styled": "^11.6.0", - "@workday/canvas-kit-react": "^11.1.22", + "@workday/canvas-kit-react": "^11.1.23", "@workday/canvas-system-icons-web": "^3.0.0", "@workday/canvas-tokens-web": "^2.0.0", "typescript": "4.2"