@mrpelz/boilerplate-preact 9.2.5 → 9.2.6

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/eslint.config.js CHANGED
@@ -5,6 +5,7 @@ import {
5
5
  } from '@mrpelz/boilerplate-dom/eslint.config.js';
6
6
  // @ts-ignore
7
7
  import pluginReactHooks from 'eslint-plugin-react-hooks';
8
+ import { merge } from 'ts-deepmerge';
8
9
 
9
10
  export { configMeta };
10
11
 
@@ -14,16 +15,25 @@ const reactHooksRecommendedRules =
14
15
  );
15
16
 
16
17
  /** @type {import('eslint').Linter.FlatConfig} */
17
- export const config = {
18
- ...configUpstream,
19
- files: ['src/**/*.{js,jsx,ts,tsx}'],
18
+ export const configDownstream = {
19
+ files: ['src/**/*.{jsx,tsx}'],
20
20
  plugins: {
21
- ...configUpstream.plugins,
22
21
  // @ts-ignore
23
22
  'react-hooks': pluginReactHooks,
24
23
  },
25
- rules: { ...configUpstream.rules, ...reactHooksRecommendedRules },
24
+ rules: reactHooksRecommendedRules,
25
+ settings: {
26
+ 'import/resolver': {
27
+ typescript: {
28
+ extensionAlias: {
29
+ '.js': ['.tsx'],
30
+ },
31
+ },
32
+ },
33
+ },
26
34
  };
27
35
 
36
+ const config = merge(configUpstream, configDownstream);
37
+
28
38
  /** @type {import('eslint').Linter.FlatConfig[]} */
29
39
  export default [configMeta, config];
package/jest.config.js CHANGED
@@ -1,13 +1,15 @@
1
1
  // @ts-ignore
2
2
  import configUpstream from '@mrpelz/boilerplate-dom/jest.config.js';
3
+ import { merge } from 'ts-deepmerge';
3
4
 
4
5
  /** @type {import('ts-jest').JestConfigWithTsJest} */
5
- const config = {
6
- ...configUpstream,
6
+ const configDownstream = {
7
7
  moduleNameMapper: {
8
8
  '^(\\./.+)\\.m?jsx?$': '$1',
9
9
  },
10
10
  };
11
11
 
12
+ const config = merge(configUpstream, configDownstream);
13
+
12
14
  /** @type {import('ts-jest').JestConfigWithTsJest} */
13
15
  export default config;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@mrpelz/boilerplate-preact",
3
- "version": "9.2.5",
3
+ "version": "9.2.6",
4
4
  "repository": {
5
5
  "type": "git",
6
6
  "url": "https://github.com/mrpelz/boilerplate.git",
package/webpack.config.js CHANGED
@@ -1,33 +1,42 @@
1
1
  import { resolve } from 'node:path';
2
2
 
3
- import config, {
3
+ import configUpstream, {
4
4
  dirBase,
5
5
  dirSrc,
6
6
  // @ts-ignore
7
7
  } from '@mrpelz/boilerplate-dom/webpack.config.js';
8
+ import { merge } from 'ts-deepmerge';
8
9
 
9
- const { entry } = config;
10
- if (entry) entry[0] = resolve(dirSrc, 'main.tsx');
11
-
12
- config.resolve = {
13
- extensionAlias: {
14
- '.js': ['.ts', '.tsx', '.js'],
15
- '.mjs': ['.mts', '.mjs'],
10
+ // @ts-ignore
11
+ /** @type {import('@mrpelz/boilerplate-dom/webpack.config.js').ConfigurationExtended} */
12
+ const configDownstream = {
13
+ module: {
14
+ rules: [
15
+ {
16
+ exclude: /node_modules/,
17
+ test: /\.tsx$/i,
18
+ use: [
19
+ {
20
+ loader: 'ts-loader',
21
+ options: {
22
+ configFile: resolve(dirBase, 'tsconfig.build.json'),
23
+ },
24
+ },
25
+ ],
26
+ },
27
+ ],
28
+ },
29
+ resolve: {
30
+ extensionAlias: {
31
+ '.js': ['.tsx'],
32
+ },
16
33
  },
17
34
  };
18
35
 
19
- config.module?.rules?.push({
20
- exclude: /node_modules/,
21
- test: /\.tsx$/i,
22
- use: [
23
- {
24
- loader: 'ts-loader',
25
- options: {
26
- configFile: resolve(dirBase, 'tsconfig.build.json'),
27
- },
28
- },
29
- ],
30
- });
36
+ const config = merge(configUpstream, configDownstream);
37
+
38
+ const { entry } = config;
39
+ if (entry && Array.isArray(entry)) entry[0] = resolve(dirSrc, 'main.tsx');
31
40
 
32
41
  // @ts-ignore
33
42
  /** @type {import('@mrpelz/boilerplate-dom/webpack.config.js').ConfigurationExtended} */