Skip to content

Commit 3b45db4

Browse files
authored
feat: integrate @public-ui/theme-ecl into the project (#7650)
2 parents f7d51f5 + 098ddab commit 3b45db4

File tree

12 files changed

+20
-43
lines changed

12 files changed

+20
-43
lines changed

.github/workflows/publish.yml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -183,6 +183,12 @@ jobs:
183183
env:
184184
NODE_AUTH_TOKEN: ${{secrets.NPMJS_GRANULAR_TOKEN}}
185185
NPM_CONFIG_PROVENANCE: true
186+
- name: Build and publish theme ecl
187+
run: pnpm publish --access ${{env.access}} --no-git-checks --tag ${{github.event.inputs.tag}}
188+
working-directory: packages/themes/ecl
189+
env:
190+
NODE_AUTH_TOKEN: ${{secrets.NPMJS_GRANULAR_TOKEN}}
191+
NPM_CONFIG_PROVENANCE: true
186192
- name: Build and publish sample react
187193
run: pnpm publish --access ${{env.access}} --no-git-checks --tag ${{github.event.inputs.tag}}
188194
working-directory: packages/samples/react

packages/samples/react/.knip.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,10 +14,10 @@
1414
],
1515
"ignoreDependencies": [
1616
"@leanup/stack-webpack",
17-
"@public-ui-/theme-ecl",
1817
"@public-ui/components",
1918
"@public-ui/react",
2019
"@public-ui/theme-default",
20+
"@public-ui/theme-ecl",
2121
"@unocss/preset-uno",
2222
"ajv",
2323
"nightwatch-axe-verbose",

packages/samples/react/package.json

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
"url": "https://github.com/public-ui/kolibri"
99
},
1010
"scripts": {
11-
"prebuild": "pnpm -r --filter=@public-ui/theme-* --filter @public-ui-/theme-* build",
11+
"prebuild": "pnpm -r --filter=@public-ui/theme-* build",
1212
"build": "rimraf dist && cross-env NODE_ENV=production webpack",
1313
"build:deps": "pnpm --filter @public-ui/sample-react^... build",
1414
"format": "prettier --check src",
@@ -34,6 +34,7 @@
3434
"@public-ui/components": "workspace:*",
3535
"@public-ui/react": "workspace:*",
3636
"@public-ui/theme-default": "workspace:*",
37+
"@public-ui/theme-ecl": "workspace:*",
3738
"@stencil/core": "4.22.3",
3839
"@types/node": "22.14.1",
3940
"@types/react": "18.3.4",
@@ -83,9 +84,6 @@
8384
"world_countries_lists": "2.9.0",
8485
"yup": "1.6.1"
8586
},
86-
"optionalDependencies": {
87-
"@public-ui-/theme-ecl": "workspace:*"
88-
},
8987
"files": [
9088
".eslintignore",
9189
".eslintrc.js",

packages/samples/react/src/react.main.tsx

Lines changed: 2 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ import { setTagNameTransformer } from '@public-ui/react';
66
import { bootstrap, KoliBriDevHelper } from '@public-ui/components';
77
import { defineCustomElements } from '@public-ui/components/dist/loader';
88
import { DEFAULT } from '@public-ui/theme-default';
9+
import { ECL_EC, ECL_EU } from '@public-ui/theme-ecl';
910

1011
import { App } from './App';
1112

@@ -34,17 +35,8 @@ const getThemes = async () => {
3435
return [theme];
3536
}
3637

37-
const optionalThemes: Theme[] = [];
38-
const { ECL_EC, ECL_EU } = await import('@public-ui-/theme-ecl');
39-
40-
if (ECL_EC && ECL_EU) {
41-
optionalThemes.push(ECL_EC, ECL_EU);
42-
} else {
43-
console.warn('Theme package @public-ui-/theme-ecl not available. Continuing without it.');
44-
}
45-
4638
/* List of regular sample app themes */
47-
return [DEFAULT, ...optionalThemes] as Theme[];
39+
return [DEFAULT, ECL_EC, ECL_EU] as Theme[];
4840
};
4941

5042
void (async () => {
Lines changed: 0 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,5 @@
11
const webpack = require('webpack');
22

3-
const OPTIONAL_THEME_PACKAGE = '@public-ui-/theme-ecl';
4-
53
/**
64
* @returns {null|string}
75
*/
@@ -30,25 +28,5 @@ module.exports = (...args) => {
3028
}),
3129
);
3230
delete config.devServer.proxy;
33-
34-
config.externals = [
35-
...(config.externals || []),
36-
37-
/* Handle optional theme dependencies */
38-
({ request }, callback) => {
39-
if (request === OPTIONAL_THEME_PACKAGE) {
40-
try {
41-
require.resolve(OPTIONAL_THEME_PACKAGE);
42-
// Package exists, include it
43-
return callback();
44-
} catch (e) {
45-
// Package doesn't exist, replace with empty module
46-
return callback(null, 'null');
47-
}
48-
}
49-
callback();
50-
},
51-
];
52-
5331
return config;
5432
};

packages/themes/ecl/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# KoliBri - ECL-Themes
1+
# KoliBri - ECL-Themes (Draft)
22

33
[![npm](https://img.shields.io/npm/v/@public-ui/theme-ecl)](https://www.npmjs.com/package/@public-ui/components)
44
[![license](https://img.shields.io/npm/l/@public-ui/theme-ecl)](https://github.com/public-ui/kolibri/blob/main/LICENSE)

packages/themes/ecl/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
{
2-
"name": "@public-ui-/theme-ecl",
2+
"name": "@public-ui/theme-ecl",
33
"version": "2.1.3",
44
"private": true,
55
"type": "module",

pnpm-lock.yaml

Lines changed: 3 additions & 4 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

scripts/deprecate-add.sh

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,4 +12,5 @@ npm deprecate @public-ui/vue@$1 "Wir empfehlen die Verwendung einer neueren Vers
1212
npm deprecate @public-ui/components@$1 "Wir empfehlen die Verwendung einer neueren Version (>=$2)."
1313
npm deprecate @public-ui/sample-react@$1 "Wir empfehlen die Verwendung einer neueren Version (>=$2)."
1414
npm deprecate @public-ui/theme-default@$1 "Wir empfehlen die Verwendung einer neueren Version (>=$2)."
15+
npm deprecate @public-ui/theme-ecl@$1 "Wir empfehlen die Verwendung einer neueren Version (>=$2)."
1516
npm deprecate @public-ui/visual-tests@$1 "Wir empfehlen die Verwendung einer neueren Version (>=$2)."

scripts/deprecate-rm.sh

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,4 +12,5 @@ npm deprecate @public-ui/vue@$1 ""
1212
npm deprecate @public-ui/components@$1 ""
1313
npm deprecate @public-ui/sample-react@$1 ""
1414
npm deprecate @public-ui/theme-default@$1 ""
15+
npm deprecate @public-ui/theme-ecl@$1 ""
1516
npm deprecate @public-ui/visual-tests@$1 ""

0 commit comments

Comments
 (0)