@onecx/nx-migration-utils 6.6.0 → 6.8.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@onecx/nx-migration-utils",
|
|
3
|
-
"version": "6.
|
|
3
|
+
"version": "6.8.0",
|
|
4
4
|
"license": "Apache-2.0",
|
|
5
5
|
"peerDependencies": {
|
|
6
6
|
"node-html-parser": "^7.0.1",
|
|
@@ -8,7 +8,8 @@
|
|
|
8
8
|
"@phenomnomnominal/tsquery": "^6",
|
|
9
9
|
"@nx/devkit": "^20.3.0",
|
|
10
10
|
"typescript": "^5.5.4",
|
|
11
|
-
"postcss": "^8.5.3"
|
|
11
|
+
"postcss": "^8.5.3",
|
|
12
|
+
"postcss-scss": "^4.0.9"
|
|
12
13
|
},
|
|
13
14
|
"type": "commonjs",
|
|
14
15
|
"main": "./src/index.js",
|
|
@@ -2,6 +2,7 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.updateStyleSheet = updateStyleSheet;
|
|
4
4
|
const postcss_1 = require("postcss");
|
|
5
|
+
const postcssScss = require("postcss-scss");
|
|
5
6
|
/**
|
|
6
7
|
* Updates a stylesheet file using a provided PostCSS-based updater function.
|
|
7
8
|
* Only writes changes if the updated content differs from the original.
|
|
@@ -14,7 +15,7 @@ function updateStyleSheet(tree, filePath, updater) {
|
|
|
14
15
|
const content = tree.read(filePath, 'utf-8');
|
|
15
16
|
if (!content)
|
|
16
17
|
return;
|
|
17
|
-
const root = postcss_1.default.parse(content);
|
|
18
|
+
const root = filePath.endsWith('.scss') ? postcssScss.parse(content) : postcss_1.default.parse(content);
|
|
18
19
|
const updatedContent = updater(root);
|
|
19
20
|
if (updatedContent !== content) {
|
|
20
21
|
tree.write(filePath, updatedContent);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"update-style-sheet.utils.js","sourceRoot":"","sources":["../../../../../../../libs/nx-migration-utils/src/lib/utils/modification/update-style-sheet.utils.ts"],"names":[],"mappings":";;AAWA,4CAWC;AArBD,qCAA6B;
|
|
1
|
+
{"version":3,"file":"update-style-sheet.utils.js","sourceRoot":"","sources":["../../../../../../../libs/nx-migration-utils/src/lib/utils/modification/update-style-sheet.utils.ts"],"names":[],"mappings":";;AAWA,4CAWC;AArBD,qCAA6B;AAC7B,4CAA2C;AAC3C;;;;;;;GAOG;AACH,SAAgB,gBAAgB,CAAC,IAAU,EAAE,QAAgB,EAAE,OAAoD;IACjH,MAAM,OAAO,GAAG,IAAI,CAAC,IAAI,CAAC,QAAQ,EAAE,OAAO,CAAC,CAAA;IAC5C,IAAI,CAAC,OAAO;QAAE,OAAM;IAEpB,MAAM,IAAI,GAAG,QAAQ,CAAC,QAAQ,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC,WAAW,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC,iBAAO,CAAC,KAAK,CAAC,OAAO,CAAC,CAAA;IAE7F,MAAM,cAAc,GAAG,OAAO,CAAC,IAAI,CAAC,CAAA;IAEpC,IAAI,cAAc,KAAK,OAAO,EAAE,CAAC;QAC/B,IAAI,CAAC,KAAK,CAAC,QAAQ,EAAE,cAAc,CAAC,CAAA;IACtC,CAAC;AACH,CAAC"}
|