From 1f657203f3cc458b2a4ea22d8c38f19f7f9134e8 Mon Sep 17 00:00:00 2001 From: Jean-Philippe Zolesio Date: Fri, 15 Jul 2022 09:54:50 -0700 Subject: [PATCH 1/2] Migrate ccs v3 to @adobe/css-tools v4 --- package.json | 2 +- src/utils.js | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/package.json b/package.json index fe373baa..0ddace5b 100644 --- a/package.json +++ b/package.json @@ -35,7 +35,7 @@ "@types/testing-library__jest-dom": "^5.9.1", "aria-query": "^5.0.0", "chalk": "^3.0.0", - "css": "^3.0.0", + "@adobe/css-tools": "^4.0.0", "css.escape": "^1.5.1", "dom-accessibility-api": "^0.5.6", "lodash": "^4.17.15", diff --git a/src/utils.js b/src/utils.js index 2f07fb8e..a7f1c959 100644 --- a/src/utils.js +++ b/src/utils.js @@ -1,5 +1,5 @@ import redent from 'redent' -import cssParse from 'css/lib/parse' +import {parse} from '@adobe/css-tools/dist/cjs/cssTools' import isEqual from 'lodash/isEqual' class GenericTypeError extends Error { @@ -100,7 +100,7 @@ class InvalidCSSError extends Error { } function parseCSS(css, ...args) { - const ast = cssParse(`selector { ${css} }`, {silent: true}).stylesheet + const ast = parse(`selector { ${css} }`, {silent: true}).stylesheet if (ast.parsingErrors && ast.parsingErrors.length > 0) { const {reason, line} = ast.parsingErrors[0] From 2594583dc60e9a5f4afd8f6425e65073ada95735 Mon Sep 17 00:00:00 2001 From: Jean-Philippe Zolesio Date: Wed, 3 Aug 2022 20:19:14 -0700 Subject: [PATCH 2/2] Upgrade @adobe/css-tools to version 4.0.1 (umd build should be usable in nodejs and web browser environment) --- package.json | 2 +- src/utils.js | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/package.json b/package.json index 0ddace5b..0304d2c1 100644 --- a/package.json +++ b/package.json @@ -35,7 +35,7 @@ "@types/testing-library__jest-dom": "^5.9.1", "aria-query": "^5.0.0", "chalk": "^3.0.0", - "@adobe/css-tools": "^4.0.0", + "@adobe/css-tools": "^4.0.1", "css.escape": "^1.5.1", "dom-accessibility-api": "^0.5.6", "lodash": "^4.17.15", diff --git a/src/utils.js b/src/utils.js index a7f1c959..cdbb1088 100644 --- a/src/utils.js +++ b/src/utils.js @@ -1,6 +1,6 @@ import redent from 'redent' -import {parse} from '@adobe/css-tools/dist/cjs/cssTools' import isEqual from 'lodash/isEqual' +import {parse} from '@adobe/css-tools' class GenericTypeError extends Error { constructor(expectedString, received, matcherFn, context) {