Skip to content

Commit 332bfa4

Browse files
committedApr 8, 2025
fix(js-themes-toolkit): use rtlcss for conversion and keep r2 export for compatibility
1 parent fd7a74a commit 332bfa4

File tree

3 files changed

+39
-8
lines changed

3 files changed

+39
-8
lines changed
 

‎projects/js-themes-toolkit/packages/liferay-theme-tasks/lib/r2/index.js

Lines changed: 4 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,7 @@ const gutil = require('gulp-util');
1010
const path = require('path');
1111
const {StringDecoder} = require('string_decoder');
1212
const through = require('through2');
13-
14-
const liferayR2 = require('./liferay-r2');
13+
const rtlcss = require('rtlcss');
1514

1615
const decoder = new StringDecoder('utf8');
1716
const PluginError = gutil.PluginError;
@@ -26,10 +25,7 @@ function gulpR2() {
2625

2726
if (file.isBuffer()) {
2827
try {
29-
file.contents = swapBuffer(
30-
file.contents,
31-
path.relative('.', file.path)
32-
);
28+
file.contents = swapBuffer(file.contents);
3329
}
3430
catch (error) {
3531
this.push(file);
@@ -63,8 +59,8 @@ function gulpR2() {
6359
return task;
6460
}
6561

66-
function swapBuffer(buffer, filename) {
67-
var swapped = liferayR2.swap(decoder.write(buffer), {filename});
62+
function swapBuffer(buffer) {
63+
var swapped = rtlcss.process(decoder.write(buffer));
6864

6965
return new Buffer.from(swapped);
7066
}

‎projects/js-themes-toolkit/packages/liferay-theme-tasks/package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,7 @@
3636
"plugin-error": "^1.0.1",
3737
"portfinder": "^1.0.20",
3838
"resolve": "^1.15.1",
39+
"rtlcss": "^4.3.0",
3940
"sass": "1.64.1",
4041
"tar-fs": "^1.16.3",
4142
"through2": "^2.0.0",

‎yarn.lock

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12818,6 +12818,11 @@ nanoid@^3.2.0:
1281812818
resolved "https://registry.yarnpkg.com/nanoid/-/nanoid-3.2.0.tgz#62667522da6673971cca916a6d3eff3f415ff80c"
1281912819
integrity sha512-fmsZYa9lpn69Ad5eDn7FMcnnSR+8R34W9qJEijxYhTbfOWzr22n1QxCMzXLK+ODyW2973V3Fux959iQoUxzUIA==
1282012820

12821+
nanoid@^3.3.8:
12822+
version "3.3.11"
12823+
resolved "https://registry.yarnpkg.com/nanoid/-/nanoid-3.3.11.tgz#4f4f112cefbe303202f2199838128936266d185b"
12824+
integrity sha512-N8SpfPUnUp1bK+PMYW8qSWdl9U+wwNWI4QKxOYDy9JAro3WMX7p2OeVRF9v+347pnakNevPmiHhNmZ2HbFA76w==
12825+
1282112826
nanomatch@^1.2.9:
1282212827
version "1.2.13"
1282312828
resolved "https://registry.yarnpkg.com/nanomatch/-/nanomatch-1.2.13.tgz#b87a8aa4fc0de8fe6be88895b38983ff265bd119"
@@ -13938,6 +13943,11 @@ picocolors@^1.0.0:
1393813943
resolved "https://registry.yarnpkg.com/picocolors/-/picocolors-1.0.0.tgz#cb5bdc74ff3f51892236eaf79d68bc44564ab81c"
1393913944
integrity sha512-1fygroTLlHu66zi26VoTDv8yRgm0Fccecssto+MhsZ0D/DGW2sm8E8AjW7NU5VVTRt5GxbeZ5qBuJr+HyLYkjQ==
1394013945

13946+
picocolors@^1.1.1:
13947+
version "1.1.1"
13948+
resolved "https://registry.yarnpkg.com/picocolors/-/picocolors-1.1.1.tgz#3d321af3eab939b083c8f929a1d12cda81c26b6b"
13949+
integrity sha512-xceH2snhtb5M9liqDsmEw56le376mTZkEX/jEb/RxNFyegNul7eNslCXP9FDj/Lcu0X8KEyMceP2ntpaHrDEVA==
13950+
1394113951
picomatch@^2.0.4, picomatch@^2.0.5, picomatch@^2.2.1:
1394213952
version "2.2.2"
1394313953
resolved "https://registry.yarnpkg.com/picomatch/-/picomatch-2.2.2.tgz#21f333e9b6b8eaff02468f5146ea406d345f4dad"
@@ -14189,6 +14199,15 @@ postcss@^7.0.14, postcss@^7.0.2, postcss@^7.0.21, postcss@^7.0.26, postcss@^7.0.
1418914199
source-map "^0.6.1"
1419014200
supports-color "^6.1.0"
1419114201

14202+
postcss@^8.4.21:
14203+
version "8.5.3"
14204+
resolved "https://registry.yarnpkg.com/postcss/-/postcss-8.5.3.tgz#1463b6f1c7fb16fe258736cba29a2de35237eafb"
14205+
integrity sha512-dle9A3yYxlBSrt8Fu+IpjGT8SY8hN0mlaA6GY8t0P5PjIOZemULz/E2Bnm/2dcUOena75OTNkHI76uZBNUUq3A==
14206+
dependencies:
14207+
nanoid "^3.3.8"
14208+
picocolors "^1.1.1"
14209+
source-map-js "^1.2.1"
14210+
1419214211
postcss@^8.4.5:
1419314212
version "8.4.6"
1419414213
resolved "https://registry.yarnpkg.com/postcss/-/postcss-8.4.6.tgz#c5ff3c3c457a23864f32cb45ac9b741498a09ae1"
@@ -15338,6 +15357,16 @@ rsvp@^4.8.4:
1533815357
resolved "https://registry.yarnpkg.com/rsvp/-/rsvp-4.8.5.tgz#c8f155311d167f68f21e168df71ec5b083113734"
1533915358
integrity sha512-nfMOlASu9OnRJo1mbEk2cz0D56a1MBNrJ7orjRZQG10XDyuvwksKbuXNp6qa+kbn839HwjwhBzhFmdsaEAfauA==
1534015359

15360+
rtlcss@^4.3.0:
15361+
version "4.3.0"
15362+
resolved "https://registry.yarnpkg.com/rtlcss/-/rtlcss-4.3.0.tgz#f8efd4d5b64f640ec4af8fa25b65bacd9e07cc97"
15363+
integrity sha512-FI+pHEn7Wc4NqKXMXFM+VAYKEj/mRIcW4h24YVwVtyjI+EqGrLc2Hx/Ny0lrZ21cBWU2goLy36eqMcNj3AQJig==
15364+
dependencies:
15365+
escalade "^3.1.1"
15366+
picocolors "^1.0.0"
15367+
postcss "^8.4.21"
15368+
strip-json-comments "^3.1.1"
15369+
1534115370
run-async@^0.1.0:
1534215371
version "0.1.0"
1534315372
resolved "https://registry.yarnpkg.com/run-async/-/run-async-0.1.0.tgz#c8ad4a5e110661e402a7d21b530e009f25f8e389"
@@ -16033,6 +16062,11 @@ source-list-map@^2.0.0, source-list-map@^2.0.1:
1603316062
resolved "https://registry.yarnpkg.com/source-map-js/-/source-map-js-1.0.2.tgz#adbc361d9c62df380125e7f161f71c826f1e490c"
1603416063
integrity sha512-R0XvVJ9WusLiqTCEiGCmICCMplcCkIwwR11mOSD9CR5u+IXYdiseeEuXCVAjS54zqwkLcPNnmU4OeJ6tUrWhDw==
1603516064

16065+
source-map-js@^1.2.1:
16066+
version "1.2.1"
16067+
resolved "https://registry.yarnpkg.com/source-map-js/-/source-map-js-1.2.1.tgz#1ce5650fddd87abc099eda37dcff024c2667ae46"
16068+
integrity sha512-UXWMKhLOwVKb728IUtQPXxfYU+usdybtUrK/8uGE8CQMvrhOpwvzDBwj0QhSL7MQc7vIsISBG8VQ8+IDQxpfQA==
16069+
1603616070
source-map-resolve@^0.5.0, source-map-resolve@^0.5.2:
1603716071
version "0.5.3"
1603816072
resolved "https://registry.yarnpkg.com/source-map-resolve/-/source-map-resolve-0.5.3.tgz#190866bece7553e1f8f267a2ee82c606b5509a1a"

0 commit comments

Comments
 (0)