Skip to content

Commit a97ff64

Browse files
authored
[chore] some fixes for styles extraction and esb-build for format-text (#2131)
<!--- Provide a general summary of your changes in the Title above --> ## Motivation and Context <!--- Why is this change required? What problem does it solve? --> <!--- If it fixes an open issue, please link to the issue here. --> ## How has this been tested? <!--- Please describe in detail how you tested your changes. --> <!--- For example: --> <!--- I have added unit tests --> <!--- I have added Voice Over tests --> <!--- Code cannot be tested automatically so I have tested it only manually --> ## Screenshots (if appropriate): ## Types of changes <!--- What types of changes does your code introduce? Put an `x` in all the boxes that apply: --> - [ ] Bug fix (non-breaking change which fixes an issue). - [ ] New feature (non-breaking change which adds functionality). - [ ] Breaking change (fix or feature that would cause existing functionality to not work as expected). - [ ] Nice improve. ## Checklist: <!--- Go over all the following points, and put an `x` in all the boxes that apply. --> <!--- If you're unsure about any of these, don't hesitate to ask. We're here to help! --> - [ ] My code follows the code style of this project. - [ ] I have updated the documentation accordingly or it's not required. - [ ] Unit tests are not broken. - [ ] I have added changelog note to corresponding `CHANGELOG.md` file with planned publish date. - [ ] I have added new unit tests on added of fixed functionality.
1 parent d5c6e6c commit a97ff64

File tree

8 files changed

+49
-4
lines changed

8 files changed

+49
-4
lines changed

semcore/format-text/CHANGELOG.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,12 @@
22

33
CHANGELOG.md standards are inspired by [keepachangelog.com](https://keepachangelog.com/en/1.0.0/).
44

5+
## [4.42.0] - 2025-05-13
6+
7+
### Added
8+
9+
- Esm-build by vite.
10+
511
## [4.41.3] - 2025-05-09
612

713
### Changed

semcore/format-text/package.json

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,13 +3,18 @@
33
"description": "Semrush FormatText Component",
44
"version": "4.41.3",
55
"main": "lib/cjs/index.js",
6-
"module": "lib/es6/index.js",
6+
"module": "lib/esm/index.mjs",
77
"typings": "lib/types/index.d.ts",
88
"sideEffects": false,
99
"author": "UI-kit team <ui-kit-team@semrush.com>",
1010
"license": "MIT",
1111
"scripts": {
12-
"build": "pnpm semcore-builder"
12+
"build": "pnpm semcore-builder && pnpm vite build"
13+
},
14+
"exports": {
15+
"require": "./lib/cjs/index.js",
16+
"import": "./lib/esm/index.mjs",
17+
"types": "./lib/types/index.d.ts"
1318
},
1419
"dependencies": {
1520
"@semcore/utils": "4.48.4",

semcore/format-text/vite.config.ts

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
import { defineConfig, mergeConfig } from 'vite';
2+
3+
import viteConfig from '../../commonVite.config';
4+
5+
export default mergeConfig(
6+
viteConfig,
7+
defineConfig({
8+
build: {
9+
lib: {
10+
entry: './src/index.tsx',
11+
},
12+
rollupOptions: {
13+
external: ['react', 'react-dom', 'react/jsx-runtime', /@babel\/runtime\/*/, /@semcore\/*/],
14+
},
15+
},
16+
}),
17+
);

semcore/utils/CHANGELOG.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,12 @@
22

33
CHANGELOG.md standards are inspired by [keepachangelog.com](https://keepachangelog.com/en/1.0.0/).
44

5+
## [4.48.5] - 2025-05-13
6+
7+
### Added
8+
9+
- `CSSinJS` to the exports.
10+
511
## [4.48.4] - 2025-05-08
612

713
### Fixed

semcore/utils/package.json

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -156,6 +156,11 @@
156156
"import": "./lib/createUUID.mjs",
157157
"types": "./lib/createUUID.d.ts"
158158
},
159+
"./lib/СSSinJS": {
160+
"require": "./lib/CSSinJS.js",
161+
"import": "./lib/CSSinJS.mjs",
162+
"types": "./lib/CSSinJS.d.ts"
163+
},
159164
"./lib/cssToIntDefault": {
160165
"require": "./lib/cssToIntDefault.js",
161166
"import": "./lib/cssToIntDefault.mjs",

tools/shadow-loader/CHANGELOG.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,12 @@
22

33
CHANGELOG.md standards are inspired by [keepachangelog.com](https://keepachangelog.com/en/1.0.0/).
44

5+
## [1.2.1] - 2025-05-13
6+
7+
### Fixed
8+
9+
- Plugin to work with both esm and cjs.
10+
511
## [1.2.0] - 2025-05-07
612

713
### Fixed

tools/shadow-loader/index.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -109,7 +109,7 @@ async function loader(source) {
109109
);
110110
const [requirePath] = filepath.split('node_modules/').slice(-1);
111111
styleImports.push(requirePath);
112-
return resourcePath.includes('@semcore/flags') ? 'undefined, ' : '(undefined, '; // flags has the old build system
112+
return resourcePath.includes('@semcore/flags') || !es6Mode ? 'undefined, ' : '(undefined, '; // flags and cjs has the old build system
113113
},
114114
)
115115
.replace(/\/\*!__reshadow-styles__:"(.*?)"\*\//g, (match, dep) => {

tools/shadow-loader/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@semcore/shadow-loader",
3-
"version": "1.2.0",
3+
"version": "1.2.1",
44
"main": "index.js",
55
"license": "MIT",
66
"scripts": {

0 commit comments

Comments
 (0)