Skip to content

Commit

Permalink
CI: extract scss, icons, fonts to a separate project (#27777)
Browse files Browse the repository at this point in the history
Co-authored-by: Alexander Bulychev <[email protected]>
Co-authored-by: Alexander Bulychev <[email protected]>
  • Loading branch information
3 people authored Jul 18, 2024
1 parent 02aaf52 commit 01eaa62
Show file tree
Hide file tree
Showing 1,806 changed files with 532 additions and 229 deletions.
56 changes: 28 additions & 28 deletions .github/CODEOWNERS
Validating CODEOWNERS rules …
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# General d.ts files

*.d.ts @DevExpress/devextreme-apireviewers @DevExpress/devextreme-techwriters
/packages/devextreme/ts/** @DevExpress/devextreme-apireviewers
*.d.ts @DevExpress/devextreme-apireviewers @DevExpress/devextreme-techwriters
/packages/devextreme/ts/** @DevExpress/devextreme-apireviewers

# Localization strings

Expand All @@ -11,49 +11,49 @@

## grid_core

/packages/devextreme/js/__internal/grids/** @DevExpress/devextreme-grids
/packages/devextreme/js/ui/grid_core/** @DevExpress/devextreme-grids
/packages/devextreme/js/ui/shared/** @DevExpress/devextreme-grids
/packages/devextreme/js/common/grids.d.ts @DevExpress/devextreme-grids @DevExpress/devextreme-apireviewers @DevExpress/devextreme-techwriters
/packages/devextreme/scss/widgets/base/_gridBase.scss @DevExpress/devextreme-grids
/packages/devextreme/scss/widgets/generic/gridBase/** @DevExpress/devextreme-grids
/packages/devextreme/scss/widgets/material/gridBase/** @DevExpress/devextreme-grids
/packages/devextreme/js/__internal/grids/** @DevExpress/devextreme-grids
/packages/devextreme/js/ui/grid_core/** @DevExpress/devextreme-grids
/packages/devextreme/js/ui/shared/** @DevExpress/devextreme-grids
/packages/devextreme/js/common/grids.d.ts @DevExpress/devextreme-grids @DevExpress/devextreme-apireviewers @DevExpress/devextreme-techwriters
/packages/devextreme-scss/scss/widgets/base/_gridBase.scss @DevExpress/devextreme-grids
/packages/devextreme-scss/scss/widgets/generic/gridBase/** @DevExpress/devextreme-grids
/packages/devextreme-scss/scss/widgets/material/gridBase/** @DevExpress/devextreme-grids

## data_grid

/packages/devextreme/js/ui/data_grid.d.ts @DevExpress/devextreme-grids @DevExpress/devextreme-apireviewers @DevExpress/devextreme-techwriters
/packages/devextreme/js/ui/data_grid.js @DevExpress/devextreme-grids
/packages/devextreme/js/ui/data_grid/** @DevExpress/devextreme-grids
/packages/devextreme/scss/widgets/base/dataGrid/** @DevExpress/devextreme-grids
/packages/devextreme/scss/widgets/generic/dataGrid/** @DevExpress/devextreme-grids
/packages/devextreme/scss/widgets/material/dataGrid/** @DevExpress/devextreme-grids
/packages/devextreme/js/ui/data_grid.d.ts @DevExpress/devextreme-grids @DevExpress/devextreme-apireviewers @DevExpress/devextreme-techwriters
/packages/devextreme/js/ui/data_grid.js @DevExpress/devextreme-grids
/packages/devextreme/js/ui/data_grid/** @DevExpress/devextreme-grids
/packages/devextreme-scss/scss/widgets/base/dataGrid/** @DevExpress/devextreme-grids
/packages/devextreme-scss/scss/widgets/generic/dataGrid/** @DevExpress/devextreme-grids
/packages/devextreme-scss/scss/widgets/material/dataGrid/** @DevExpress/devextreme-grids
/packages/devextreme/testing/tests/DevExpress.ui.widgets.dataGrid/** @DevExpress/devextreme-grids
/packages/devextreme/testing/testcafe/model/dataGrid/** @DevExpress/devextreme-grids
/packages/devextreme/testing/testcafe/tests/dataGrid/** @DevExpress/devextreme-grids
/packages/devextreme/testing/testcafe/model/dataGrid/** @DevExpress/devextreme-grids
/packages/devextreme/testing/testcafe/tests/dataGrid/** @DevExpress/devextreme-grids

## tree_list

/packages/devextreme/js/ui/tree_list.d.ts @DevExpress/devextreme-grids @DevExpress/devextreme-apireviewers @DevExpress/devextreme-techwriters
/packages/devextreme/js/ui/tree_list.js @DevExpress/devextreme-grids
/packages/devextreme/js/ui/tree_list/** @DevExpress/devextreme-grids
/packages/devextreme/scss/widgets/base/treeList/** @DevExpress/devextreme-grids
/packages/devextreme/scss/widgets/generic/treeList/** @DevExpress/devextreme-grids
/packages/devextreme/scss/widgets/material/treeList/** @DevExpress/devextreme-grids
/packages/devextreme-scss/scss/widgets/base/treeList/** @DevExpress/devextreme-grids
/packages/devextreme-scss/scss/widgets/generic/treeList/** @DevExpress/devextreme-grids
/packages/devextreme-scss/scss/widgets/material/treeList/** @DevExpress/devextreme-grids
/packages/devextreme/testing/tests/DevExpress.ui.widgets.treeList/** @DevExpress/devextreme-grids
/packages/devextreme/testing/testcafe/model/treeList.ts @DevExpress/devextreme-grids
/packages/devextreme/testing/testcafe/tests/treeList/** @DevExpress/devextreme-grids

## pivot_grid

/packages/devextreme/js/ui/pivot_grid.d.ts @DevExpress/devextreme-grids @DevExpress/devextreme-apireviewers @DevExpress/devextreme-techwriters
/packages/devextreme/js/ui/pivot_grid.js @DevExpress/devextreme-grids
/packages/devextreme/js/ui/pivot_grid/** @DevExpress/devextreme-grids
/packages/devextreme/scss/widgets/base/pivotGrid/** @DevExpress/devextreme-grids
/packages/devextreme/scss/widgets/generic/pivotGrid/** @DevExpress/devextreme-grids
/packages/devextreme/scss/widgets/material/pivotGrid/** @DevExpress/devextreme-grids
/packages/devextreme/js/ui/pivot_grid.d.ts @DevExpress/devextreme-grids @DevExpress/devextreme-apireviewers @DevExpress/devextreme-techwriters
/packages/devextreme/js/ui/pivot_grid.js @DevExpress/devextreme-grids
/packages/devextreme/js/ui/pivot_grid/** @DevExpress/devextreme-grids
/packages/devextreme-scss/scss/widgets/base/pivotGrid/** @DevExpress/devextreme-grids
/packages/devextreme-scss/scss/widgets/generic/pivotGrid/** @DevExpress/devextreme-grids
/packages/devextreme-scss/scss/widgets/material/pivotGrid/** @DevExpress/devextreme-grids
/packages/devextreme/testing/tests/DevExpress.ui.widgets.pivotGrid/** @DevExpress/devextreme-grids
/packages/devextreme/testing/testcafe/model/pivotGrid/** @DevExpress/devextreme-grids
/packages/devextreme/testing/testcafe/tests/pivotGrid/** @DevExpress/devextreme-grids
/packages/devextreme/testing/testcafe/model/pivotGrid/** @DevExpress/devextreme-grids
/packages/devextreme/testing/testcafe/tests/pivotGrid/** @DevExpress/devextreme-grids

# DevOps

Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/lint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -246,8 +246,8 @@ jobs:
pnpm install
- name: Lint CSS
working-directory: ./packages/devextreme
run: pnpx nx lint-css
working-directory: ./packages/devextreme-scss
run: pnpx nx lint

pnpm_lock:
runs-on: devextreme-shr2
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/playgrounds_tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ jobs:
- name: Zip artifacts
working-directory: ./packages/devextreme
run: |
7z a -tzip -mx3 -mmt2 artifacts.zip artifacts scss/bundles
7z a -tzip -mx3 -mmt2 artifacts.zip artifacts ../devextreme-scss/scss/bundles
- name: Upload build artifacts
uses: actions/upload-artifact@v3
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/qunit_tests-additional-renovation.yml
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ jobs:
- name: Zip artifacts
working-directory: ./packages/devextreme
run: |
7z a -tzip -mx3 -mmt2 artifacts.zip artifacts scss/bundles testing/tests/Renovation/widgets.json
7z a -tzip -mx3 -mmt2 artifacts.zip artifacts ../devextreme-scss/scss/bundles testing/tests/Renovation/widgets.json
- name: Upload build artifacts
uses: actions/upload-artifact@v3
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/qunit_tests-renovation.yml
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ jobs:
- name: Zip artifacts
working-directory: ./packages/devextreme
run: |
7z a -tzip -mx3 -mmt2 artifacts.zip artifacts scss/bundles testing/tests/Renovation/widgets.json
7z a -tzip -mx3 -mmt2 artifacts.zip artifacts ../devextreme-scss/scss/bundles testing/tests/Renovation/widgets.json
- name: Upload build artifacts
uses: actions/upload-artifact@v3
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/styles.yml
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ jobs:
pnpm install
- name: Run tests
run: pnpx nx test-styles devextreme-main
run: pnpx nx test devextreme-scss

notify:
runs-on: devextreme-shr2
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/testcafe_tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ jobs:
- name: Zip artifacts
working-directory: ./packages/devextreme
run: |
7z a -tzip -mx3 -mmt2 artifacts.zip artifacts scss/bundles
7z a -tzip -mx3 -mmt2 artifacts.zip artifacts ../devextreme-scss/scss/bundles
- name: Upload build artifacts
uses: actions/upload-artifact@v3
Expand Down
10 changes: 5 additions & 5 deletions .github/workflows/themebuilder_tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ jobs:
pnpm install
- name: Build etalon bundles
working-directory: ./packages/devextreme
working-directory: ./packages/devextreme-scss
run: pnpx gulp style-compiler-themes-ci

- name: Build
Expand All @@ -65,12 +65,12 @@ jobs:
run: pnpx nx test

- name: Check styles for duplicate rules (generic)
working-directory: ./packages/devextreme
run: pnpx stylelint --config testing/styles/bundles-stylelint-config.json "artifacts/**/dx.light.css"
working-directory: ./packages/devextreme-scss
run: pnpx stylelint --config tests/bundles-stylelint-config.json "../devextreme/artifacts/**/dx.light.css"

- name: Check styles for duplicate rules (material)
working-directory: ./packages/devextreme
run: pnpx stylelint --config testing/styles/bundles-stylelint-config.json "artifacts/**/dx.material.blue.light.css"
working-directory: ./packages/devextreme-scss
run: pnpx stylelint --config tests/bundles-stylelint-config.json "../devextreme/artifacts/**/dx.material.blue.light.css"

notify:
runs-on: devextreme-shr2
Expand Down
2 changes: 1 addition & 1 deletion e2e/testcafe-devextreme/tests/common/icons.ts
Original file line number Diff line number Diff line change
Expand Up @@ -333,7 +333,7 @@ test('SVG icon set', async (t) => {

await ClientFunction(() => {
$(`#${id}`)
.append($(`<img src="../../../packages/devextreme/images/icons/${themeName}/${iconName}.svg">`))
.append($(`<img src="../../../packages/devextreme-scss/images/icons/${themeName}/${iconName}.svg">`))
.append($('<div>').text(`${iconName}`));
}, {
dependencies: {
Expand Down
4 changes: 4 additions & 0 deletions packages/devextreme-scss/.browserslistrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
last 2 versions
ios > 9
> 1%
not dead
1 change: 1 addition & 0 deletions packages/devextreme-scss/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
scss/bundles
File renamed without changes.
42 changes: 42 additions & 0 deletions packages/devextreme-scss/build/gulp-data-uri.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
'use strict';

const path = require('path');
const fs = require('fs');
const sass = require('sass-embedded');
const dataUriRegex = /data-uri\((?:'(image\/svg\+xml;charset=UTF-8)',\s)?['"]?([^)'"]+)['"]?\)/g;

const svg = (buffer, svgEncoding) => {
const encoding = svgEncoding || 'image/svg+xml;charset=UTF-8';
const svg = encodeURIComponent(buffer.toString());

return `"data:${encoding},${svg}"`;
};

const img = (buffer, ext) => {
return `"data:image/${ext};base64,${buffer.toString('base64')}"`;
};

const handler = (_, svgEncoding, fileName) => {
const relativePath = path.join(__dirname, '..', fileName);
const filePath = path.resolve(relativePath);
const ext = filePath.split('.').pop();
const data = fs.readFileSync(filePath);
const buffer = Buffer.from(data);
const escapedString = ext === 'svg' ? svg(buffer, svgEncoding) : img(buffer, ext);
return `url(${escapedString})`;
};

const sassFunction = (args) => {
const hasEncoding = args.getLength() === 2;
const encoding = hasEncoding ? args.getValue(0).getValue() : null;
const url = hasEncoding ? args.getValue(1).getValue() : args.getValue(0).getValue();

return new sass.SassString(handler(null, encoding, url), { quotes: false });
};

module.exports = {
resolveDataUri: (content) => content.replace(dataUriRegex, handler),
sassFunctions: {
'data-uri($args...)': sassFunction,
}
};
Original file line number Diff line number Diff line change
Expand Up @@ -13,12 +13,12 @@ const autoPrefix = require('gulp-autoprefixer');
const parseArguments = require('minimist');

const cleanCssSanitizeOptions = require('./clean-css-options.json');
const cleanCssOptions = require('../../../../devextreme-themebuilder/src/data/clean-css-options.json');
const cleanCssOptions = require('../../devextreme-themebuilder/src/data/clean-css-options.json');
const { getThemes } = require('./theme-options');
const functions = require('../gulp-data-uri').sassFunctions;
const starLicense = require('../header-pipes').starLicense;
const functions = require('./gulp-data-uri').sassFunctions;
const starLicense = require('../../devextreme/build/gulp/header-pipes').starLicense;

const cssArtifactsPath = join(process.cwd(), 'artifacts', 'css');
const cssArtifactsPath = join(process.cwd(), '..', 'devextreme', 'artifacts', 'css');

const DEFAULT_DEV_BUNDLE_NAMES = [
'light',
Expand Down Expand Up @@ -152,8 +152,3 @@ task('style-compiler-themes-watch', () => {
watch('scss/**/*', parallel(() => compileBundles(bundles), 'copy-fonts-and-icons'))
.on('ready', () => console.log('style-compiler-themes task is watching for changes...'));
});

module.exports = {
generateScssBundleName,
generateScssBundles
};
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
37 changes: 37 additions & 0 deletions packages/devextreme-scss/gulpfile.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
/* eslint-env node */
/* eslint-disable no-console */

const gulp = require('gulp');
const env = require('../devextreme/build/gulp/env-variables');
const cache = require('gulp-cache');
const shell = require('gulp-shell');

gulp.task('clean', function(callback) {
require('del').sync([
'../devextreme/artifacts/css/**',
'../devextreme/scss/bundles/**'
], { force: true });
cache.clearAll();
callback();
});

require('./build/style-compiler');

if(env.TEST_CI) {
console.warn('Using test CI mode!');
}

function createStyleCompilerBatch() {
return gulp.series(
'clean',
env.TEST_CI
? ['style-compiler-themes-ci']
: ['style-compiler-themes']
);
}

gulp.task('default', createStyleCompilerBatch());

gulp.task('watch', gulp.series(
'style-compiler-themes-watch'
));
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
Loading

0 comments on commit 01eaa62

Please sign in to comment.