@dg-scripts/webpack-template 5.21.8 → 6.1.0

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/CHANGELOG.md CHANGED
@@ -3,6 +3,42 @@
3
3
  All notable changes to this project will be documented in this file.
4
4
  See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
5
5
 
6
+ # [6.1.0](https://github.com/sabertazimi/bod/compare/v6.0.0...v6.1.0) (2026-01-11)
7
+
8
+
9
+ ### Bug Fixes
10
+
11
+ * **deps:** update dependencies (non-major) ([#1473](https://github.com/sabertazimi/bod/issues/1473)) ([9813107](https://github.com/sabertazimi/bod/commit/981310701d61b681f9854791a9bae6aaa426c516))
12
+
13
+
14
+
15
+
16
+
17
+ # [6.0.0](https://github.com/sabertazimi/bod/compare/v5.21.8...v6.0.0) (2025-12-19)
18
+
19
+
20
+ ### Bug Fixes
21
+
22
+ * **deps:** update dependencies (non-major) ([#1463](https://github.com/sabertazimi/bod/issues/1463)) ([7bb29a8](https://github.com/sabertazimi/bod/commit/7bb29a8a8885fd121c46f2fa89af4843c47171d3))
23
+
24
+
25
+ * refactor(test)!: migrate from Jest to Vitest across all packages (#1468) ([0072508](https://github.com/sabertazimi/bod/commit/0072508a2eb9ab6a472d4cd8146c341df18e80fc)), closes [#1468](https://github.com/sabertazimi/bod/issues/1468)
26
+
27
+
28
+ ### BREAKING CHANGES
29
+
30
+ * Removed Jest.
31
+
32
+ * test: add timeout to template initialization test
33
+
34
+ * test: increase template initialization timeout to 120s
35
+
36
+ * test(coverage): simplify coverage configuration and enable in test:all
37
+
38
+
39
+
40
+
41
+
6
42
  ## [5.21.8](https://github.com/sabertazimi/bod/compare/v5.21.7...v5.21.8) (2025-12-04)
7
43
 
8
44
 
@@ -338,7 +374,6 @@ See [Conventional Commits](https://conventionalcommits.org) for commit guideline
338
374
  * **deps-dev:** bump autoprefixer from 10.3.3 to 10.3.4 ([#92](https://github.com/sabertazimi/boilerplate/issues/92)) ([9103de6](https://github.com/sabertazimi/boilerplate/commit/9103de60e9be8f60fc6feaeaf2c6e6778e9e7859))
339
375
  * **deps-dev:** bump clean-webpack-plugin from 3.0.0 to 4.0.0 ([#90](https://github.com/sabertazimi/boilerplate/issues/90)) ([7b5f704](https://github.com/sabertazimi/boilerplate/commit/7b5f704ed6b12a673fc1c2cdf9467a1baa16a78e))
340
376
  * **deps-dev:** bump mini-css-extract-plugin from 2.2.1 to 2.2.2 ([#91](https://github.com/sabertazimi/boilerplate/issues/91)) ([0b761da](https://github.com/sabertazimi/boilerplate/commit/0b761da515cbaffd451d394033e5ea4c2aef28c4))
341
- * **deps-dev:** bump stylelint-config-bod from 5.3.1 to 5.3.3 ([#96](https://github.com/sabertazimi/boilerplate/issues/96)) ([d3552ce](https://github.com/sabertazimi/boilerplate/commit/d3552cead3caa8edc320141bb94048c3e83b9951))
342
377
  * **deps-dev:** bump webpack from 5.51.1 to 5.52.0 ([#97](https://github.com/sabertazimi/boilerplate/issues/97)) ([d35b2f1](https://github.com/sabertazimi/boilerplate/commit/d35b2f1065fd91ae98245c8f5db26f81bd210003))
343
378
  * **Jest:** enable Jest config intellisense ([01f9140](https://github.com/sabertazimi/boilerplate/commit/01f9140e389f2e9c3e1c59c50afd855490a17b69))
344
379
  * **webpack:** enable webpack config intellisense ([2bcb3aa](https://github.com/sabertazimi/boilerplate/commit/2bcb3aab2f12c0d2b00aae80bb9591f6c883f720))
package/README.md CHANGED
@@ -2,7 +2,6 @@
2
2
 
3
3
  [![Author](https://img.shields.io/badge/author-sabertaz-lightgrey?style=for-the-badge)](https://github.com/sabertazimi)
4
4
  [![LICENSE](https://img.shields.io/github/license/sabertazimi/bod?style=for-the-badge)](https://raw.githubusercontent.com/sabertazimi/bod/main/LICENSE)
5
-
6
5
  [![CI](https://img.shields.io/github/actions/workflow/status/sabertazimi/bod/ci.yml?branch=main&style=for-the-badge&logo=github)](https://github.com/sabertazimi/bod/actions/workflows/ci.yml)
7
6
 
8
7
  > Minimal wbepack boilerplate.
@@ -29,7 +28,7 @@ on repo [Bod](https://github.com/sabertazimi/bod).
29
28
  - `Babel` transpile support.
30
29
  - `Webpack` for hot reload development and dedicated building work
31
30
  with bundle analysis and elegant progressbar.
32
- - `Jest` and `Testing Library` for robust unit tests and detailed coverage report.
31
+ - `Vitest` and `Testing Library` for robust unit tests and detailed coverage report.
33
32
  - `PostCSS` for CSS auto-prefixer support.
34
33
  - `ESLint` with TypeScript parser for TypeScript style check.
35
34
  - `StyleLint` with custom rules for CSS style check.
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@dg-scripts/webpack-template",
3
- "version": "5.21.8",
4
- "packageManager": "pnpm@10.24.0",
3
+ "version": "6.1.0",
4
+ "packageManager": "pnpm@10.26.1",
5
5
  "description": "Minimal webpack boilerplate",
6
6
  "author": "sabertazimi",
7
7
  "license": "MIT",
@@ -45,54 +45,53 @@
45
45
  "changeset": "commit-and-tag-version --dry-run -s",
46
46
  "release": "commit-and-tag-version -s",
47
47
  "start": "pnpm dev",
48
- "test": "jest",
49
- "test:watch": "jest --watch"
48
+ "test": "vitest run",
49
+ "test:watch": "vitest"
50
50
  },
51
51
  "devDependencies": {
52
52
  "@babel/core": "^7.28.5",
53
53
  "@babel/plugin-transform-class-properties": "^7.27.1",
54
54
  "@babel/plugin-transform-object-rest-spread": "^7.28.4",
55
55
  "@babel/preset-env": "^7.28.5",
56
- "@dg-scripts/eslint-config": "^5.21.8",
57
- "@dg-scripts/stylelint-config": "^5.21.8",
56
+ "@dg-scripts/eslint-config": "^6.1.0",
57
+ "@dg-scripts/stylelint-config": "^6.1.0",
58
58
  "@svgr/webpack": "^8.1.0",
59
- "@types/jest": "^30.0.0",
60
- "@types/node": "^24.10.1",
59
+ "@types/node": "^24.10.4",
60
+ "@vitest/coverage-v8": "^4.0.16",
61
61
  "babel-loader": "^10.0.0",
62
62
  "cross-env": "^10.1.0",
63
63
  "css-loader": "^7.1.2",
64
- "css-minimizer-webpack-plugin": "^7.0.2",
64
+ "css-minimizer-webpack-plugin": "^7.0.4",
65
65
  "dotenv": "^17.2.3",
66
- "eslint": "^9.39.1",
66
+ "eslint": "^9.39.2",
67
67
  "eslint-webpack-plugin": "^5.0.2",
68
68
  "file-loader": "^6.2.0",
69
69
  "html-loader": "^5.1.0",
70
70
  "html-webpack-plugin": "^5.6.5",
71
- "jest": "^30.2.0",
72
- "jest-environment-jsdom": "^30.2.0",
71
+ "jsdom": "^27.3.0",
73
72
  "mini-css-extract-plugin": "^2.9.4",
74
73
  "postcss": "^8.5.6",
75
74
  "postcss-flexbugs-fixes": "^5.0.2",
76
75
  "postcss-loader": "^8.2.0",
77
- "postcss-preset-env": "^10.4.0",
78
- "prettier": "^3.7.3",
76
+ "postcss-preset-env": "^10.5.0",
77
+ "prettier": "^3.7.4",
79
78
  "sass-loader": "^16.0.6",
80
79
  "style-loader": "^4.0.0",
81
80
  "stylelint": "^16.26.1",
82
81
  "stylelint-webpack-plugin": "^5.0.1",
83
- "ts-jest": "^29.4.5",
84
82
  "ts-loader": "^9.5.4",
85
83
  "tsconfig-paths-webpack-plugin": "^4.2.0",
86
84
  "tslib": "^2.8.1",
87
- "tsx": "^4.20.6",
85
+ "tsx": "^4.21.0",
88
86
  "typescript": "^5.9.3",
89
87
  "undici": "^7.16.0",
90
88
  "url-loader": "^4.1.1",
91
- "webpack": "^5.103.0",
92
- "webpack-bundle-analyzer": "^5.0.1",
89
+ "vitest": "^4.0.16",
90
+ "webpack": "^5.104.1",
91
+ "webpack-bundle-analyzer": "^5.1.0",
93
92
  "webpack-cli": "^6.0.1",
94
93
  "webpack-dev-server": "^5.2.2",
95
94
  "webpackbar": "^7.0.0"
96
95
  },
97
- "gitHead": "74eab627b3c0388b1f96c802df1674b37d42838f"
96
+ "gitHead": "6a7723d64ab1a869cec85bf8c9f11fdb1e200ec9"
98
97
  }
package/scripts/badge.ts CHANGED
@@ -42,7 +42,7 @@ const getBadgeUrl = (
42
42
  const percentage = getCoveragePercentage(summaryFilePath, coverageType);
43
43
  const coverage = `${percentage}${encodeURI('%')}`;
44
44
  const color = getBadgeColor(percentage);
45
- const url = `https://img.shields.io/badge/${coverageType}-${coverage}-${color}?logo=jest&style=${badgeStyle}`;
45
+ const url = `https://img.shields.io/badge/${coverageType}-${coverage}-${color}?logo=vitest&style=${badgeStyle}`;
46
46
  return url;
47
47
  };
48
48
 
@@ -1,3 +1,4 @@
1
+ import { afterEach, beforeEach, describe, expect, it, vi } from 'vitest'
1
2
  import ExplodingParticle from '../ExplodingParticle'
2
3
 
3
4
  describe('explodingParticle', () => {
@@ -7,12 +8,12 @@ describe('explodingParticle', () => {
7
8
 
8
9
  beforeEach(() => {
9
10
  mockContextFunctions = {
10
- save: jest.fn(),
11
- restore: jest.fn(),
12
- beginPath: jest.fn(),
13
- closePath: jest.fn(),
14
- arc: jest.fn(),
15
- fill: jest.fn(),
11
+ save: vi.fn(),
12
+ restore: vi.fn(),
13
+ beginPath: vi.fn(),
14
+ closePath: vi.fn(),
15
+ arc: vi.fn(),
16
+ fill: vi.fn(),
16
17
  }
17
18
  mockContextProps = {
18
19
  fillStyle: '',
@@ -1,3 +1,4 @@
1
+ import { describe, expect, it } from 'vitest'
1
2
  import ParticleFactory from '../ParticleFactory'
2
3
 
3
4
  describe('particleFactory', () => {
package/tsconfig.json CHANGED
@@ -20,7 +20,7 @@
20
20
  "isolatedModules": true,
21
21
  "skipLibCheck": true
22
22
  },
23
- "include": ["./src/**/*", "index.d.ts"],
23
+ "include": ["./src/**/*", "index.d.ts", "vitest.config.ts", "vitest.setup.ts"],
24
24
  "exclude": [
25
25
  "node_modules",
26
26
  "build",
@@ -0,0 +1,28 @@
1
+ import path from 'node:path'
2
+ import { defineConfig } from 'vitest/config'
3
+
4
+ export default defineConfig({
5
+ test: {
6
+ environment: 'jsdom',
7
+ environmentOptions: {
8
+ url: 'http://localhost',
9
+ },
10
+ setupFiles: ['./vitest.setup.ts'],
11
+ coverage: {
12
+ provider: 'v8',
13
+ reportsDirectory: './coverage',
14
+ },
15
+ exclude: [
16
+ 'node_modules',
17
+ '.cache',
18
+ 'build',
19
+ 'dist',
20
+ 'coverage',
21
+ ],
22
+ },
23
+ resolve: {
24
+ alias: {
25
+ '@': path.resolve(__dirname, './src'),
26
+ },
27
+ },
28
+ })
@@ -0,0 +1,37 @@
1
+ import path from 'node:path'
2
+ import process from 'node:process'
3
+ import dotenv from 'dotenv'
4
+ import { afterEach, vi } from 'vitest'
5
+
6
+ // Load environment variables
7
+ dotenv.config({
8
+ path: path.resolve(process.cwd(), '.test.env'),
9
+ })
10
+
11
+ // Mock matchMedia
12
+ Object.defineProperty(window, 'matchMedia', {
13
+ writable: true,
14
+ value: vi.fn().mockImplementation((query: string) => ({
15
+ matches: false,
16
+ media: query,
17
+ onchange: null,
18
+ addListener: vi.fn(), // deprecated
19
+ removeListener: vi.fn(), // deprecated
20
+ addEventListener: vi.fn(),
21
+ removeEventListener: vi.fn(),
22
+ dispatchEvent: vi.fn(),
23
+ })),
24
+ })
25
+
26
+ // Mock requestAnimationFrame
27
+ window.requestAnimationFrame = function (callback: FrameRequestCallback): number {
28
+ return setTimeout(callback) as unknown as number
29
+ }
30
+
31
+ window.cancelAnimationFrame = window.clearTimeout
32
+
33
+ // Reset mocks after each test
34
+ afterEach(() => {
35
+ vi.restoreAllMocks()
36
+ })
37
+
package/jest.config.js DELETED
@@ -1,39 +0,0 @@
1
- /* eslint-disable @typescript-eslint/no-var-requires */
2
- const { pathsToModuleNameMapper } = require('ts-jest');
3
- const { compilerOptions } = require('./tsconfig.json');
4
-
5
- const paths = pathsToModuleNameMapper(compilerOptions.paths, {
6
- prefix: '<rootDir>/',
7
- });
8
-
9
- /** @type {import('ts-jest').JestConfigWithTsJest} */
10
- module.exports = {
11
- collectCoverage: true,
12
- coverageDirectory: 'coverage',
13
- coverageReporters: ['json-summary', 'lcov', 'text', 'clover'],
14
- preset: 'ts-jest',
15
- moduleNameMapper: {
16
- ...paths,
17
- },
18
- testPathIgnorePatterns: [
19
- 'node_modules',
20
- '\\.cache',
21
- '<rootDir>/build',
22
- '<rootDir>/dist',
23
- '<rootDir>/coverage',
24
- ],
25
- transform: {
26
- '^.+\\.tsx?$': [
27
- 'ts-jest',
28
- {
29
- tsconfig: 'tsconfig.json',
30
- },
31
- ],
32
- },
33
- testEnvironmentOptions: {
34
- url: 'http://localhost',
35
- },
36
- testEnvironment: 'jsdom',
37
- setupFiles: ['<rootDir>/jest.env.setup.js'],
38
- setupFilesAfterEnv: ['<rootDir>/jest.setup.js'],
39
- };
package/jest.env.setup.js DELETED
@@ -1,6 +0,0 @@
1
- const path = require('path');
2
- const dotenv = require('dotenv');
3
-
4
- dotenv.config({
5
- path: path.resolve(process.cwd(), '.test.env'),
6
- });
package/jest.setup.js DELETED
@@ -1,21 +0,0 @@
1
- // require('@testing-library/jest-dom');
2
-
3
- Object.defineProperty(window, 'matchMedia', {
4
- writable: true,
5
- value: jest.fn().mockImplementation((query) => ({
6
- matches: false,
7
- media: query,
8
- onchange: null,
9
- addListener: jest.fn(), // deprecated
10
- removeListener: jest.fn(), // deprecated
11
- addEventListener: jest.fn(),
12
- removeEventListener: jest.fn(),
13
- dispatchEvent: jest.fn(),
14
- })),
15
- });
16
-
17
- window.requestAnimationFrame = function (callback) {
18
- return setTimeout(callback);
19
- };
20
-
21
- window.cancelAnimationFrame = window.clearTimeout;