Skip to content

Commit b663dd0

Browse files
committed
chore(css): remove rtl artifact builds (#11486)
Now that CSS logical properties are used throughout the project, there is no need for `rtl` artifacts to be built. This PR removes those builds. **New** - {{new thing}} **Changed** - {{changed thing}} **Removed** - remove `rtl` builds and artifacts - remove Storybook `rtl` documentation <!-- React and Web Component deploy previews are enabled by default. --> <!-- To enable additional available deploy previews, apply the following --> <!-- labels for the corresponding package: --> <!-- *** "test: e2e": Codesandbox examples and e2e integration tests --> <!-- *** "package: services": Services --> <!-- *** "package: utilities": Utilities --> <!-- *** "RTL": React / Web Components (RTL) --> <!-- *** "feature flag": React / Web Components (experimental) -->
1 parent 9383bd4 commit b663dd0

27 files changed

+77
-222
lines changed
-18.1 KB
Binary file not shown.
Binary file not shown.
63.6 KB
Binary file not shown.
-64.3 KB
Binary file not shown.
-20 KB
Binary file not shown.
797 KB
Binary file not shown.
-799 KB
Binary file not shown.

packages/carbon-web-components/.storybook/preview.js

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,10 @@
1+
/**
2+
* Copyright IBM Corp. 2016, 2024
3+
*
4+
* This source code is licensed under the Apache-2.0 license found in the
5+
* LICENSE file in the root directory of this source tree.
6+
*/
7+
18
import { setCustomElementsManifest } from '@storybook/web-components';
29
import customElements from '../custom-elements.json';
310
import container from './container';
@@ -184,8 +191,11 @@ export const decorators = [
184191
const { hasMainTag } = result;
185192
const { locale, dir, theme } = context.globals;
186193

187-
document.documentElement.setAttribute('storybook-carbon-theme', theme);
194+
if (import.meta.env.STORYBOOK_USE_RTL === 'true') {
195+
document.documentElement.setAttribute('dir', 'rtl');
196+
}
188197

198+
document.documentElement.setAttribute('storybook-carbon-theme', theme);
189199
document.documentElement.lang = locale;
190200
document.documentElement.dir = dir;
191201

packages/carbon-web-components/gulp-tasks/build/dist.js

Lines changed: 6 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -31,9 +31,8 @@ function _getFolders(dir) {
3131
*
3232
* @param {object} [options] The build options.
3333
* @param {string} [options.mode=development] The build mode.
34-
* @param {string} [options.dir=ltr] The UI direction.
3534
*/
36-
async function _buildComponents({ mode = 'development', dir = 'ltr' } = {}) {
35+
async function _buildComponents({ mode = 'development' } = {}) {
3736
if (!fs.existsSync(config.distDestDir)) {
3837
fs.mkdirSync(config.distDestDir);
3938
}
@@ -46,7 +45,7 @@ async function _buildComponents({ mode = 'development', dir = 'ltr' } = {}) {
4645
}
4746
}
4847

49-
return rollup(getRollupConfig({ mode, dir, folders }))
48+
return rollup(getRollupConfig({ mode, folders }))
5049
.then((bundle) => {
5150
bundle.write({
5251
format: 'es',
@@ -63,7 +62,7 @@ async function _buildComponents({ mode = 'development', dir = 'ltr' } = {}) {
6362
/**
6463
* Defined scripts to return as gulp tasks
6564
*
66-
* @type {{ltr: object, rtl: object}}
65+
* @type {{ltr: object}}
6766
* @private
6867
*/
6968
const _scripts = {
@@ -75,26 +74,13 @@ const _scripts = {
7574
return _buildComponents({ mode: 'production' });
7675
},
7776
},
78-
rtl: {
79-
dev() {
80-
return _buildComponents({ dir: 'rtl' });
81-
},
82-
prod() {
83-
return _buildComponents({ mode: 'production', dir: 'rtl' });
84-
},
85-
},
8677
};
8778

88-
// Gulp tasks (LTR)
79+
// Gulp tasks
8980
gulp.task('build:dist:ltr:dev', _scripts.ltr.dev);
9081
gulp.task('build:dist:ltr:prod', _scripts.ltr.prod);
9182
gulp.task('build:dist:ltr', gulp.series(gulp.task('build:dist:ltr:dev'), gulp.task('build:dist:ltr:prod')));
9283

93-
// Gulp tasks (RTL)
94-
gulp.task('build:dist:rtl:dev', _scripts.rtl.dev);
95-
gulp.task('build:dist:rtl:prod', _scripts.rtl.prod);
96-
gulp.task('build:dist:rtl', gulp.series(gulp.task('build:dist:rtl:dev'), gulp.task('build:dist:rtl:prod')));
97-
9884
// Build all components
99-
gulp.task('build:dist', gulp.series(gulp.series(gulp.task('build:dist:ltr:prod'), gulp.task('build:dist:rtl:prod'))));
100-
gulp.task('build:dist:dev', gulp.series(gulp.series(gulp.task('build:dist:ltr:dev'), gulp.task('build:dist:rtl:dev'))));
85+
gulp.task('build:dist', gulp.series(gulp.series(gulp.task('build:dist:ltr:prod'))));
86+
gulp.task('build:dist:dev', gulp.series(gulp.series(gulp.task('build:dist:ltr:dev'))));

0 commit comments

Comments
 (0)