Skip to content

Commit

Permalink
Merge branch 'main' of github.com:exadel-inc/esl into main-beta
Browse files Browse the repository at this point in the history
# Conflicts:
#	site/webpack.config.js
  • Loading branch information
ala-n committed Jan 30, 2024
2 parents f3df99b + ad6bb9f commit 93f6e42
Show file tree
Hide file tree
Showing 10 changed files with 137 additions and 69 deletions.
104 changes: 52 additions & 52 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 3 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -97,8 +97,8 @@
"@semantic-release/npm": "^11.0.2",
"@semantic-release/release-notes-generator": "^12.1.0",
"@types/jest": "^29.5.11",
"@typescript-eslint/eslint-plugin": "^6.19.1",
"@typescript-eslint/parser": "^6.19.1",
"@typescript-eslint/eslint-plugin": "^6.20.0",
"@typescript-eslint/parser": "^6.20.0",
"chokidar-cli": "^3.0.0",
"concurrently": "^8.2.2",
"copyfiles": "^2.4.1",
Expand All @@ -109,7 +109,7 @@
"eslint-plugin-sonarjs": "^0.23.0",
"eslint-plugin-tsdoc": "^0.2.17",
"foreach-cli": "^1.8.1",
"husky": "^9.0.6",
"husky": "^9.0.7",
"jest": "^29.7.0",
"jest-environment-jsdom": "^29.7.0",
"kleur": "^4.1.5",
Expand Down
6 changes: 4 additions & 2 deletions site/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -19,15 +19,17 @@
"minify:css": "cleancss -o \"dist/bundles/localdev.css\" \"dist/bundles/localdev.css\"",
"build": "npm run clean && concurrently \"npm run build:ts\" \"npm run build:less && npm run minify:css\" && npm run build:eleventy",
"build:ts": "webpack --mode=production",
"build:less": "lessc \"src/localdev.less\" \"dist/bundles/localdev.css\" --source-map=dist/bundles/localdev.css.map",
"build:less": "concurrently --kill-others \"npm run build:less:site\" \"npm run build:less:lib\"",
"build:less:site": "lessc \"src/localdev.less\" \"dist/bundles/localdev.css\" --source-map=dist/bundles/localdev.css.map",
"build:less:lib": "lessc \"src/playground/export/lib.less\" \"dist/bundles/lib.css\" --source-map=dist/bundles/lib.css.map",
"build:eleventy": "eleventy -- --env=production",
"build:analyzer": "webpack --mode=production --profile --json ../.report/stats.json && webpack-bundle-analyzer ../.report/stats.json dist/bundles -s gzip -m static -r ../.report/stats.html"
},
"dependencies": {
"@11ty/eleventy": "^2.0.1",
"@11ty/eleventy-dev-server": "^1.0.4",
"@exadel/esl": "../",
"@exadel/ui-playground": "2.0.0-beta.11",
"@exadel/ui-playground": "2.0.0-beta.12",
"@juggle/resize-observer": "^3.4.0",
"@types/prismjs": "^1.26.3",
"@types/smoothscroll-polyfill": "^0.3.3",
Expand Down
2 changes: 1 addition & 1 deletion site/src/localdev.less
Original file line number Diff line number Diff line change
Expand Up @@ -41,4 +41,4 @@
@import './back-link/back-link';

// TODO: load separately async
@import './ui-playground/ui-playground.less';
@import './playground/ui-playground.less';
6 changes: 1 addition & 5 deletions site/src/localdev.ts
Original file line number Diff line number Diff line change
Expand Up @@ -116,9 +116,5 @@ import (/* webpackChunkName: 'common/esl-share' */'./esl-share/esl-share');

if (document.querySelector('uip-root')) {
// Init UI Playground
import (
/* webpackPrefetch: true */
/* webpackChunkName: "common/playground" */
'@exadel/ui-playground/esm/registration.js'
).then(({init}) => init());
import (/* webpackChunkName: "common/playground" */'./playground/ui-playground');
}
23 changes: 23 additions & 0 deletions site/src/playground/export/lib.less
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
@import '../../common/reboot.less';
@import '../../common/typography.less';
@import '../../common/colors.less';

@import '@exadel/esl/modules/all.less';

@import '../../common/accent-lines.less';
@import '../../common/accordion.less';
@import '../../common/alert.less';
@import '../../common/badge.less';
@import '../../common/buttons.less';
@import '../../common/code.less';
@import '../../common/links.less';
@import '../../common/close.less';
@import '../../common/containers.less';
@import '../../common/simple-grid.less';
@import '../../common/forms.less';
@import '../../common/flex.less';
@import '../../common/helpers.less';
@import '../../common/marquee.less';
@import '../../common/scrollbar.less';
@import '../../common/tabs.less';
@import '../../common/dropdown-menu.less';
1 change: 1 addition & 0 deletions site/src/playground/export/lib.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
export * from '@exadel/esl';
Original file line number Diff line number Diff line change
Expand Up @@ -45,4 +45,8 @@ html {
.uip-inactive-setting {
display: none;
}

.uip-preview-h-scroll[inactive] {
display: none;
}
}
23 changes: 23 additions & 0 deletions site/src/playground/ui-playground.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
import {init, UIPJSRenderingPreprocessors, UIPRenderingTemplatesService} from '@exadel/ui-playground';

// Add ESL lib alias
UIPJSRenderingPreprocessors.addRegexReplacer(
'esl-alias',
/["']@exadel\/esl["']/g,
'"/bundles/lib.js"'
);

// Add template
UIPRenderingTemplatesService.add('default', `
<html>
<head>
<title>{title}</title>
<base href="${location.origin}"/>
<link rel="stylesheet" href="/bundles/lib.css">
<script type="module">{script}</script>
</head>
<body>{content}</body>
</html>
`);

init();
31 changes: 25 additions & 6 deletions site/webpack.config.js
Original file line number Diff line number Diff line change
@@ -1,12 +1,8 @@
const path = require('path');

module.exports = {
const BASE_CONFIG = {
mode: 'development',
devtool: 'source-map',
entry: {
'localdev': './src/localdev.ts',
'polyfill': './src/polyfill.ts'
},
resolve: {
modules: ['../node_modules'],
extensions: ['.ts', '.js']
Expand All @@ -30,9 +26,32 @@ module.exports = {
removeAvailableModules: true,
splitChunks: false
},
};

module.exports = [{
...BASE_CONFIG,
entry: {
'localdev': './src/localdev.ts',
'polyfill': './src/polyfill.ts'
},
output: {
path: path.resolve(__dirname, 'dist/bundles'),
filename: '[name].js',
chunkFilename: '[name].js'
}
};
}, {
...BASE_CONFIG,
entry: {
'lib': './src/playground/export/lib.ts',
},
experiments: {
outputModule: true,
},
output: {
path: path.resolve(__dirname, 'dist/bundles'),
filename: '[name].js',
library: {
type: 'module'
}
}
}];

0 comments on commit 93f6e42

Please sign in to comment.