Skip to content

Commit b3a0ce3

Browse files
refactor(base): move internals to internal dir (#7770)
Co-authored-by: Marcus Notheis <marcus.notheis@sap.com>
1 parent 7312623 commit b3a0ce3

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

43 files changed

+102
-64
lines changed

.github/workflows/main.yml

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ jobs:
5050
run: yarn install --immutable
5151

5252
test:
53-
needs: ['install']
53+
needs: ['build']
5454
uses: './.github/workflows/test.yml'
5555

5656
build:
@@ -83,6 +83,11 @@ jobs:
8383
- name: Build
8484
run: yarn build
8585

86+
- uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4.6.2
87+
with:
88+
name: build-${{ matrix.react }}
89+
path: packages/*/dist
90+
8691
lint:
8792
needs: ['install']
8893
runs-on: ubuntu-latest

.github/workflows/test.yml

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,8 +41,13 @@ jobs:
4141
yarn add "@types/react@18" "@types/react-dom@18" --dev
4242
yarn add react@18 react-dom@18
4343
44+
- uses: actions/download-artifact@634f93cb2916e3fdff6788551b99b062d0335ce0 # v5.0.0
45+
with:
46+
name: build-${{ matrix.react }}
47+
path: packages
48+
4449
- name: Cypress run
45-
uses: cypress-io/github-action@v6
50+
uses: cypress-io/github-action@b8ba51a856ba5f4c15cf39007636d4ab04f23e3c # v6.10.2
4651
with:
4752
browser: chrome
4853
component: true

.storybook/components/ProjectTemplate.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ import {
1212
Text,
1313
ThemeProvider,
1414
} from '@ui5/webcomponents-react';
15-
import { addCustomCSSWithScoping } from '@ui5/webcomponents-react-base/dist/utils/addCustomCSSWithScoping.js';
15+
import { addCustomCSSWithScoping } from '@ui5/webcomponents-react-base/internal/utils';
1616
import { clsx } from 'clsx';
1717
import type { ReactNode } from 'react';
1818
import { useRef, useState } from 'react';

REUSE.toml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -16,19 +16,19 @@ SPDX-FileCopyrightText = "2016-2025 Recharts Group"
1616
SPDX-License-Identifier = "MIT"
1717

1818
[[annotations]]
19-
path = "packages/base/src/hooks/useIsomorphicLayoutEffect.ts"
19+
path = "packages/base/src/internal/hooks/useIsomorphicLayoutEffect.ts"
2020
precedence = "aggregate"
2121
SPDX-FileCopyrightText = "2019 Tanner Linsley"
2222
SPDX-License-Identifier = "MIT"
2323

2424
[[annotations]]
25-
path = "packages/base/src/utils/debounce.ts"
25+
path = "packages/base/src/internal/utils/debounce.ts"
2626
precedence = "aggregate"
2727
SPDX-FileCopyrightText = "2009-2021 Jeremy Ashkenas, Julian Gonggrijp, and DocumentCloud and Investigative Reporters & Editors"
2828
SPDX-License-Identifier = "MIT"
2929

3030
[[annotations]]
31-
path = "packages/base/src/utils/throttle.ts"
31+
path = "packages/base/src/internal/utils/throttle.ts"
3232
precedence = "aggregate"
3333
SPDX-FileCopyrightText = "2009-2021 Jeremy Ashkenas, Julian Gonggrijp, and DocumentCloud and Investigative Reporters & Editors"
3434
SPDX-License-Identifier = "MIT"

package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,15 +15,15 @@
1515
"build:storybook-sitemap": "node ./scripts/create-storybook-sitemap.js --directory .out",
1616
"test:prepare": "rimraf temp && lerna run build",
1717
"test:open": "CYPRESS_COVERAGE=false cypress open --component --browser chrome",
18-
"test": "yarn test:prepare && cypress run --component --browser chrome",
18+
"test": "yarn test:prepare && cypress run --component --browser chrome --spec packages",
1919
"clean": "tsc --build --clean && tsc --build tsconfig.build.json --clean && rimraf temp .out && lerna run clean",
2020
"clean:remove-modules": "yarn clean && rimraf node_modules",
2121
"prettier:all": "prettier --write --config ./prettier.config.js \"**/*\"",
2222
"lint": "eslint .",
2323
"lerna:version-dryrun": "lerna version --conventional-graduate --no-git-tag-version --no-push",
2424
"wrappers:main": "node packages/cli/dist/bin/index.js create-wrappers --packageName @ui5/webcomponents --out ./packages/main/src/webComponents --additionalComponentNote 'This is a UI5 Web Component! [Repository](https://github.com/UI5/webcomponents) | [Documentation](https://ui5.github.io/webcomponents/)'",
2525
"wrappers:fiori": "node packages/cli/dist/bin/index.js create-wrappers --packageName @ui5/webcomponents-fiori --out ./packages/main/src/webComponents --additionalComponentNote 'This is a UI5 Web Component! [Repository](https://github.com/UI5/webcomponents) | [Documentation](https://ui5.github.io/webcomponents/)'",
26-
"wrappers:compat": "WITH_WEB_COMPONENT_IMPORT_PATH='@ui5/webcomponents-react-base/dist/wrapper/withWebComponent.js' node packages/cli/dist/bin/index.js create-wrappers --packageName @ui5/webcomponents-compat --out ./packages/compat/src/components --additionalComponentNote 'This is a UI5 Web Component! [Repository](https://github.com/UI5/webcomponents) | [Documentation](https://ui5.github.io/webcomponents/)' && prettier --log-level silent --write ./packages/compat/src/components",
26+
"wrappers:compat": "WITH_WEB_COMPONENT_IMPORT_PATH='@ui5/webcomponents-react-base/withWebComponent' node packages/cli/dist/bin/index.js create-wrappers --packageName @ui5/webcomponents-compat --out ./packages/compat/src/components --additionalComponentNote 'This is a UI5 Web Component! [Repository](https://github.com/UI5/webcomponents) | [Documentation](https://ui5.github.io/webcomponents/)' && prettier --log-level silent --write ./packages/compat/src/components",
2727
"wrappers:ai": "node packages/cli/dist/bin/index.js create-wrappers --packageName @ui5/webcomponents-ai --out ./packages/ai/src/components --additionalComponentNote 'This is a UI5 Web Component! [Repository](https://github.com/UI5/webcomponents) | [Documentation](https://ui5.github.io/webcomponents/)' && prettier --log-level silent --write ./packages/ai/src/components",
2828
"create-webcomponents-wrapper": "(cd packages/cli && tsc) && yarn run wrappers:main && yarn run wrappers:fiori && prettier --log-level silent --write ./packages/main/src/webComponents && eslint --fix ./packages/main/src/webComponents/*/index.tsx && yarn run sb:prepare-cem",
2929
"create-webcomponents-wrapper-compat": "(cd packages/cli && tsc) && yarn run wrappers:compat && yarn run sb:prepare-cem && eslint --fix ./packages/compat/src/components/*/index.tsx",

packages/base/package.json

Lines changed: 31 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,6 @@
1515
"./dist": "./dist/index.js",
1616
"./dist/*": "./dist/*",
1717
"./dist/*.js": "./dist/*.js",
18-
"./internal/addCustomCSSWithScoping.js": "./dist/utils/addCustomCSSWithScoping.js",
1918
"./Device": {
2019
"types": "./dist/Device/index.d.ts",
2120
"default": "./dist/Device/index.js"
@@ -29,28 +28,49 @@
2928
"default": "./dist/generated/VersionInfo.js"
3029
},
3130
"./I18nStore": {
32-
"types": "./dist/stores/I18nStore.d.ts",
33-
"default": "./dist/stores/I18nStore.js"
31+
"types": "./dist/internal/stores/I18nStore.d.ts",
32+
"default": "./dist/internal/stores/I18nStore.js"
3433
},
3534
"./StyleStore": {
36-
"types": "./dist/stores/StyleStore.d.ts",
37-
"default": "./dist/stores/StyleStore.js"
35+
"types": "./dist/internal/stores/StyleStore.d.ts",
36+
"default": "./dist/internal/stores/StyleStore.js"
3837
},
3938
"./CssSizeVariables": {
40-
"types": "./dist/styling/CssSizeVariables.d.ts",
41-
"default": "./dist/styling/CssSizeVariables.js"
39+
"types": "./dist/internal/styling/CssSizeVariables.d.ts",
40+
"default": "./dist/internal/styling/CssSizeVariables.js"
4241
},
4342
"./ThemingParameters": {
4443
"types": "./dist/styling/ThemingParameters.d.ts",
4544
"default": "./dist/styling/ThemingParameters.js"
4645
},
4746
"./withWebComponent": {
48-
"types": "./dist/wrapper/withWebComponent.d.ts",
49-
"default": "./dist/wrapper/withWebComponent.js"
47+
"types": "./dist/internal/wrapper/withWebComponent.d.ts",
48+
"default": "./dist/internal/wrapper/withWebComponent.js"
5049
},
5150
"./utils": {
52-
"types": "./dist/utils/index.d.ts",
53-
"default": "./dist/utils/index.js"
51+
"types": "./dist/internal/utils/index.d.ts",
52+
"default": "./dist/internal/utils/index.js"
53+
},
54+
"./types": {
55+
"types": "./dist/types/index.d.ts",
56+
"default": "./dist/types/index.js"
57+
},
58+
"./internal/addCustomCSSWithScoping.js": "./dist/internal/utils/addCustomCSSWithScoping.js",
59+
"./internal/hooks": {
60+
"types": "./dist/internal/hooks/index.d.ts",
61+
"default": "./dist/internal/hooks/index.js"
62+
},
63+
"./internal/types": {
64+
"types": "./dist/internal/types/index.d.ts",
65+
"default": "./dist/internal/types/index.js"
66+
},
67+
"./internal/utils": {
68+
"types": "./dist/internal/utils/index.d.ts",
69+
"default": "./dist/internal/utils/index.js"
70+
},
71+
"./internal/*": {
72+
"types": "./dist/internal/*.d.ts",
73+
"default": "./dist/internal/*.js"
5474
}
5575
},
5676
"homepage": "https://ui5.github.io/webcomponents-react",

packages/base/src/hooks/index.ts

Lines changed: 1 addition & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,4 @@
1-
import { useCurrentTheme } from './useCurrentTheme.js';
21
import { useI18nBundle } from './useI18nBundle.js';
3-
import { useIsomorphicLayoutEffect } from './useIsomorphicLayoutEffect.js';
4-
import { useIsRTL } from './useIsRTL.js';
5-
import { useStylesheet } from './useStylesheet.js';
6-
import { useSyncRef } from './useSyncRef.js';
72
import { useViewportRange } from './useViewportRange.js';
83

9-
export {
10-
useI18nBundle,
11-
useIsomorphicLayoutEffect,
12-
useIsRTL,
13-
useSyncRef,
14-
useViewportRange,
15-
useStylesheet,
16-
useCurrentTheme,
17-
};
4+
export { useI18nBundle, useViewportRange };

packages/base/src/hooks/useI18nBundle.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
import I18nBundle from '@ui5/webcomponents-base/dist/i18nBundle.js';
44
import { useEffect, useSyncExternalStore } from 'react';
5-
import { I18nStore } from '../stores/I18nStore.js';
5+
import { I18nStore } from '../internal/stores/I18nStore.js';
66

77
const defaultBundle = new I18nBundle('defaultBundle');
88

packages/base/src/index.ts

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,17 @@
11
import * as Device from './Device/index.js';
22
import VersionInfo from './generated/VersionInfo.js';
33
import * as hooks from './hooks/index.js';
4-
import { I18nStore } from './stores/I18nStore.js';
5-
import { StyleStore } from './stores/StyleStore.js';
4+
import { I18nStore } from './internal/stores/I18nStore.js';
5+
import { StyleStore } from './internal/stores/StyleStore.js';
6+
import { withWebComponent } from './internal/wrapper/withWebComponent.js';
7+
import type { WithWebComponentPropTypes } from './internal/wrapper/withWebComponent.js';
68
import { ThemingParameters } from './styling/ThemingParameters.js';
7-
import { withWebComponent } from './wrapper/withWebComponent.js';
8-
import type { WithWebComponentPropTypes } from './wrapper/withWebComponent.js';
99

10-
export * from './styling/CssSizeVariables.js';
11-
export * from './utils/index.js';
10+
export * from './internal/styling/CssSizeVariables.js';
11+
export * from './internal/utils/index.js';
1212
export * from './hooks/index.js';
13+
export * from './internal/hooks/index.js';
14+
export type * from './internal/types/index.js';
1315
export type * from './types/index.js';
1416

1517
export { I18nStore, StyleStore, ThemingParameters, Device, hooks, withWebComponent };
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
import { useCurrentTheme } from './useCurrentTheme.js';
2+
import { useIsomorphicLayoutEffect } from './useIsomorphicLayoutEffect.js';
3+
import { useIsRTL } from './useIsRTL.js';
4+
import { useStylesheet } from './useStylesheet.js';
5+
import { useSyncRef } from './useSyncRef.js';
6+
7+
export { useIsomorphicLayoutEffect, useIsRTL, useSyncRef, useStylesheet, useCurrentTheme };

0 commit comments

Comments
 (0)