Skip to content

Commit

Permalink
* (bluefox) added patternForWidgetsFiles
Browse files Browse the repository at this point in the history
  • Loading branch information
GermanBluefox committed Sep 21, 2024
1 parent 141fb5c commit 909e255
Show file tree
Hide file tree
Showing 2 changed files with 38 additions and 3 deletions.
9 changes: 6 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ This module is a replacement for gulp that is commonly used in ioBroker reposito

First, you need to install the module:

```
```shell
npm install @iobroker/build-tools --save-dev
```

Expand All @@ -25,11 +25,11 @@ And use in `package.json` `scripts`:

## Converting i18n structure
You can convert the old i18n structure i18n/lang/translations.json to the new structure i18n/lang.json with the following command:
```
```shell
node node_modules/@iobroker/build-tools/convertI18n.js
```
Optionally, you can specify the path to the i18n folder:
```
```shell
node node_modules/@iobroker/build-tools/convertI18n.js path/to/i18n
```

Expand All @@ -38,6 +38,9 @@ node node_modules/@iobroker/build-tools/convertI18n.js path/to/i18n
### **WORK IN PROGRESS**
-->
## Changelog
### **WORK IN PROGRESS**
* (bluefox) added `patternForWidgetsFiles`

### 1.0.7 (2024-09-21)
* (bluefox) Added log outputs

Expand Down
32 changes: 32 additions & 0 deletions index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -439,6 +439,38 @@ function _patchHtmlFile(fileName: string): boolean {
return changed;
}

export function patternForWidgetsFiles(src: string): string[] {
src = src || './src-widgets/';
if (!src.endsWith('/')) {
src += '/';
}

return [
`${src}build/static/js/*fast-xml*.*`,
`${src}build/static/js/*react-swipeable*.*`,
`${src}build/static/js/*moment_*.*`,
`${src}build/static/js/*react-beautiful-dnd*.*`,
`${src}build/static/js/*vis-2-widgets-react-dev_index_jsx*.*`,
`${src}build/static/js/*vis-2-widgets-react-dev_node_modules_babel_runtime_helpers*.*`,
`${src}build/static/js/*runtime_helpers_asyncToGenerator*.*`,
`${src}build/static/js/*modules_color*.*`,
`${src}build/static/js/*echarts-for-react_lib_core_js-node_modules_echarts_core_js-*.chunk.*`,
`${src}build/static/js/*echarts_lib*.*`,
`${src}build/static/js/*vis-2-widgets-react-dev_node_modules_babel_runtime_helpers*.*`,
`${src}build/static/js/*leaflet*.*`,
`${src}build/static/js/*react-circular*.*`,
`${src}build/static/js/*d3-array_src_index_js-node_modules_d3-collection_src_index_js-*.*`,
`${src}build/static/js/*d3-dispatch_*.*`,
`${src}build/static/js/*lodash_*.*`,
`${src}build/static/js/*react-battery-gauge_dist_react-battery-gauge*.*`,
`${src}build/static/js/*react-gauge-chart*.*`,
`${src}build/static/js/*react-liquid-gauge*.*`,
`${src}build/static/js/*helpers_esm_asyncToGener*.*`,
`${src}build/static/js/*emotion_styled_dist*.*`,
`${src}build/static/js/*mui_system_colorManipulator*.*`,
];
}

// Patch an HTML file (async function)
export function patchHtmlFile(fileName: string): Promise<boolean> {
return new Promise(resolve => {
Expand Down

0 comments on commit 909e255

Please sign in to comment.