@pplancq/react-template 2.10.1 → 2.10.3

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.
Files changed (35) hide show
  1. package/.env.mock +1 -1
  2. package/.prettierignore +8 -0
  3. package/.stylelintignore +4 -0
  4. package/CHANGELOG.md +36 -0
  5. package/_README.md +2 -2
  6. package/bin/template-install.js +8 -8
  7. package/commitlint.config.mjs +1 -1
  8. package/eslint.config.mjs +12 -9
  9. package/lint-staged.config.mjs +5 -5
  10. package/mise.toml +1 -1
  11. package/mocks/handlers/userHandlers.ts +1 -3
  12. package/mrc.playwright.config.ts +14 -14
  13. package/package.json +22 -24
  14. package/playwright.config.ts +21 -21
  15. package/prettier.config.mjs +1 -1
  16. package/rsbuild.config.ts +23 -23
  17. package/scripts/lint.js +4 -4
  18. package/scripts/playwright.js +19 -19
  19. package/scripts/removeDemo.cjs +115 -89
  20. package/scripts/test.js +6 -6
  21. package/src/app/App.tsx +5 -7
  22. package/src/app/providers/Providers/Providers.tsx +5 -7
  23. package/src/app/providers/QueryClientProvider/QueryClientProvider.tsx +6 -8
  24. package/src/demo/application/use-cases/GetArchitecturePrinciplesUseCase.ts +1 -3
  25. package/src/demo/application/use-cases/GetDemoUsersUseCase.ts +1 -3
  26. package/src/demo/infrastructure/repositories/StaticArchitecturePrincipleRepository.ts +1 -3
  27. package/src/demo/ui/components/DemoFooter/DemoFooter.tsx +8 -10
  28. package/src/demo/ui/components/DemoHeader/DemoHeader.tsx +15 -17
  29. package/src/demo/ui/components/Logo/Logo.tsx +3 -3
  30. package/src/demo/ui/layouts/DemoLayout/DemoLayout.tsx +5 -7
  31. package/src/demo/ui/layouts/MainTemplate/MainTemplate.tsx +10 -12
  32. package/src/demo/ui/pages/DemoHome/DemoHome.tsx +96 -98
  33. package/stylelint.config.mjs +1 -1
  34. package/vitest.config.mts +22 -22
  35. package/vitest.setup.ts +5 -5
package/.env.mock CHANGED
@@ -1 +1 @@
1
- FRONT_MOCK_ENABLE=true
1
+ FRONT_MOCK_ENABLE=true
@@ -0,0 +1,8 @@
1
+ .husky/
2
+ LICENSE
3
+ CHANGELOG.md
4
+ sonar-project.properties
5
+ build
6
+ test-results
7
+ playwright-report
8
+ coverage
@@ -0,0 +1,4 @@
1
+ build
2
+ coverage
3
+ playwright-report
4
+ test-results
package/CHANGELOG.md CHANGED
@@ -1,3 +1,39 @@
1
+ ## 2.10.3 (2026-08-27)
2
+
3
+ ### 📦 Dependencies
4
+
5
+ - Updated @pplancq/commitlint-config to 4.0.6
6
+ - Updated @pplancq/stylelint-config to 6.1.1
7
+ - Updated @pplancq/prettier-config to 4.0.2
8
+ - Updated @pplancq/eslint-config to 6.1.1
9
+ - **deps:** update dependency @hookform/resolvers to ^5.9.1 ([#1865](https://github.com/pplancq/dev-tools/pull/1865))
10
+ - **deps:** update dependency concurrently to ^10.0.5 ([#1868](https://github.com/pplancq/dev-tools/pull/1868))
11
+ - **deps:** update dependency @vitejs/plugin-react to ^6.1.0 ([#1870](https://github.com/pplancq/dev-tools/pull/1870))
12
+ - **deps:** update dependency @testing-library/user-event to ^14.6.6 ([#1863](https://github.com/pplancq/dev-tools/pull/1863))
13
+ - **deps:** update commitlint monorepo to ^21.2.2 ([#1864](https://github.com/pplancq/dev-tools/pull/1864))
14
+ - **deps:** update dependency @rsbuild/core to ^2.1.13 ([#1862](https://github.com/pplancq/dev-tools/pull/1862))
15
+
16
+ ## 2.10.2 (2026-08-14)
17
+
18
+ ### 🐞 Bug Fixes
19
+
20
+ - **react-template:** remove demo tests and format generated files after remove:demo ([#1851](https://github.com/pplancq/dev-tools/pull/1851))
21
+ - **react-template:** remove deprecated prettier integration ([c3522b56](https://github.com/pplancq/dev-tools/commit/c3522b56))
22
+
23
+ ### 📦 Dependencies
24
+
25
+ - Updated @pplancq/commitlint-config to 4.0.5
26
+ - Updated @pplancq/stylelint-config to 6.1.0
27
+ - Updated @pplancq/prettier-config to 4.0.1
28
+ - Updated @pplancq/eslint-config to 6.1.0
29
+ - **deps:** update testing-library monorepo ([#1853](https://github.com/pplancq/dev-tools/pull/1853))
30
+ - **deps:** update dependency react-hook-form to ^7.85.0 ([#1860](https://github.com/pplancq/dev-tools/pull/1860))
31
+ - **deps:** update dependency @hookform/resolvers to ^5.7.1 ([#1857](https://github.com/pplancq/dev-tools/pull/1857))
32
+
33
+ ### ❤️ Thank You
34
+
35
+ - Paul PLANCQ
36
+
1
37
  ## 2.10.1 (2026-08-03)
2
38
 
3
39
  ### ♻️ Code Refactoring
package/_README.md CHANGED
@@ -170,13 +170,13 @@ The tests folder may contain unit tests specific to the package. The idea is to
170
170
  This file allows exposing the component and avoids having to redo imports if the file implementing the component changes its name.
171
171
 
172
172
  ```typescript
173
- export { ComponentName } from './ComponentName';
173
+ export { ComponentName } from "./ComponentName";
174
174
  ```
175
175
 
176
176
  This will allow importing a component like this:
177
177
 
178
178
  ```typescript
179
- import { ComponentName } from '@Demo/ui/components/ComponentName';
179
+ import { ComponentName } from "@Demo/ui/components/ComponentName";
180
180
  ```
181
181
 
182
182
  #### 📄 ComponentName.tsx
@@ -1,18 +1,18 @@
1
1
  #!/usr/bin/env node
2
- import { readFileSync, renameSync, rmSync, writeFileSync } from 'node:fs';
3
- import { resolve } from 'node:path';
4
- import { fileURLToPath } from 'node:url';
2
+ import { readFileSync, renameSync, rmSync, writeFileSync } from "node:fs";
3
+ import { resolve } from "node:path";
4
+ import { fileURLToPath } from "node:url";
5
5
 
6
- const repoDir = resolve(fileURLToPath(import.meta.url), '../..');
7
- const projectName = process.argv[2] || 'react-app';
6
+ const repoDir = resolve(fileURLToPath(import.meta.url), "../..");
7
+ const projectName = process.argv[2] || "react-app";
8
8
 
9
- const repoPackageJson = JSON.parse(readFileSync(resolve(repoDir, 'package.json'), { encoding: 'utf-8' }));
9
+ const repoPackageJson = JSON.parse(readFileSync(resolve(repoDir, "package.json"), { encoding: "utf-8" }));
10
10
 
11
11
  repoPackageJson.name = projectName;
12
12
  repoPackageJson.description = projectName;
13
13
  const { _prepare, _postinstall, ...scripts } = repoPackageJson.scripts;
14
14
  repoPackageJson.scripts = { ...scripts, prepare: _prepare, postinstall: _postinstall };
15
- repoPackageJson.version = '0.1.0';
15
+ repoPackageJson.version = "0.1.0";
16
16
  delete repoPackageJson.author;
17
17
  delete repoPackageJson.repository;
18
18
  delete repoPackageJson.bugs;
@@ -20,7 +20,7 @@ delete repoPackageJson.keywords;
20
20
  delete repoPackageJson.engines;
21
21
  delete repoPackageJson.bin;
22
22
 
23
- writeFileSync(resolve(repoDir, 'package.json'), JSON.stringify(repoPackageJson, null, 2), { encoding: 'utf-8' });
23
+ writeFileSync(resolve(repoDir, "package.json"), JSON.stringify(repoPackageJson, null, 2), { encoding: "utf-8" });
24
24
 
25
25
  renameSync(`${repoDir}/_gitignore`, `${repoDir}/.gitignore`);
26
26
  renameSync(`${repoDir}/_README.md`, `${repoDir}/README.md`);
@@ -1,3 +1,3 @@
1
1
  export default {
2
- extends: ['@pplancq/commitlint-config'],
2
+ extends: ["@pplancq/commitlint-config"],
3
3
  };
package/eslint.config.mjs CHANGED
@@ -1,24 +1,27 @@
1
- import { defineConfig } from '@pplancq/eslint-config';
1
+ import { defineConfig } from "@pplancq/eslint-config";
2
2
 
3
3
  export default defineConfig({
4
4
  enableReact: true,
5
- enablePrettier: 'on',
6
5
  enableVitest: true,
7
- unitTestFiles: ['src/**/*.{test,spec,steps}.{js,jsx,ts,tsx}'],
6
+ unitTestFiles: ["src/**/*.{test,spec,steps}.{js,jsx,ts,tsx}"],
8
7
  enablePlaywright: true,
9
- unitE2eFiles: ['tests/**/*.{test,spec}.{js,jsx,ts,tsx}'],
8
+ unitE2eFiles: ["tests/**/*.{test,spec}.{js,jsx,ts,tsx}"],
9
+ enablePrettier: "disableStyleOnly",
10
10
  extendConfig: [
11
11
  {
12
- files: ['mocks/**/*'],
12
+ ignores: ["build"],
13
+ },
14
+ {
15
+ files: ["mocks/**/*"],
13
16
  rules: {
14
- 'import/no-extraneous-dependencies': 'off',
17
+ "import/no-extraneous-dependencies": "off",
15
18
  },
16
19
  },
17
20
  {
18
- files: ['**/*.config.{js,cjs,mjs,ts,cts,mts}'],
21
+ files: ["**/*.config.{js,cjs,mjs,ts,cts,mts}"],
19
22
  rules: {
20
- 'import/no-default-export': 'off',
21
- 'import/no-extraneous-dependencies': 'off',
23
+ "import/no-default-export": "off",
24
+ "import/no-extraneous-dependencies": "off",
22
25
  },
23
26
  },
24
27
  ],
@@ -1,7 +1,7 @@
1
1
  export default {
2
- '*.{js,jsx,mjs,ts,tsx}': 'eslint --fix',
3
- '*.{ts,tsx}': 'tsc-files --noEmit',
4
- '*.{scss,css}': 'stylelint --fix',
5
- '*.!(js|jsx|mjs|ts|tsx|scss|css)': 'prettier --write --ignore-unknown',
6
- '(package|package-lock).json': 'npm run package:check',
2
+ "*.{js,jsx,mjs,ts,tsx}": "eslint --fix",
3
+ "*.{ts,tsx}": "tsc-files --noEmit",
4
+ "*.{scss,css}": "stylelint --fix",
5
+ "*": "prettier --write --ignore-unknown",
6
+ "(package|package-lock).json": "npm run package:check",
7
7
  };
package/mise.toml CHANGED
@@ -1,3 +1,3 @@
1
1
  [tools]
2
- node = "24.18.1"
2
+ node = "24.19.0"
3
3
  npm = "12.0.2"
@@ -1,6 +1,4 @@
1
1
  import { users } from "@Mocks/fixtures/user";
2
2
  import { http, HttpResponse } from "msw";
3
3
 
4
- export const getUsers200 = http.get("*/users", () => {
5
- return HttpResponse.json(users);
6
- });
4
+ export const getUsers200 = http.get("*/users", () => HttpResponse.json(users));
@@ -1,23 +1,23 @@
1
- import { CoverageReportOptions } from 'monocart-coverage-reports';
1
+ import { CoverageReportOptions } from "monocart-coverage-reports";
2
2
 
3
3
  export const coverageOptions: CoverageReportOptions = {
4
4
  enabled: process.env.CI ?? process.env.ENABLED_COVERAGE,
5
- name: 'Playwright Coverage Report',
6
- outputDir: './playwright-report/coverage',
7
- baseDir: './src/',
5
+ name: "Playwright Coverage Report",
6
+ outputDir: "./playwright-report/coverage",
7
+ baseDir: "./src/",
8
8
  reports: [
9
- 'text',
10
- 'text-summary',
11
- ['html', { subdir: 'html-coverage' }],
12
- ['lcovonly', { file: 'lcov-coverage.info' }],
13
- ['cobertura', { file: 'cobertura-coverage.xml' }],
9
+ "text",
10
+ "text-summary",
11
+ ["html", { subdir: "html-coverage" }],
12
+ ["lcovonly", { file: "lcov-coverage.info" }],
13
+ ["cobertura", { file: "cobertura-coverage.xml" }],
14
14
  ],
15
15
  sourceFilter: {
16
- '**/node_modules/**': false,
17
- '**/mocks/**': false,
18
- '**/*.{test,spec,steps}.{js,jsx,ts,tsx}': false,
19
- 'vitest.setup.ts': false,
20
- '**/*.{js,jsx,ts,tsx}': true,
16
+ "**/node_modules/**": false,
17
+ "**/mocks/**": false,
18
+ "**/*.{test,spec,steps}.{js,jsx,ts,tsx}": false,
19
+ "vitest.setup.ts": false,
20
+ "**/*.{js,jsx,ts,tsx}": true,
21
21
  },
22
22
  watermarks: {
23
23
  statements: [80, 90],
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@pplancq/react-template",
3
- "version": "2.10.1",
3
+ "version": "2.10.3",
4
4
  "license": "MIT",
5
5
  "description": "react template",
6
6
  "author": "pplancq <paul.plancq@outlook.fr>",
@@ -26,12 +26,12 @@
26
26
  "test:e2e:watch": "node scripts/playwright.js test --watch",
27
27
  "test:e2e:ui": "node scripts/playwright.js test --ui",
28
28
  "lint": "node scripts/lint.js",
29
- "lint:eslint": "eslint \"{mocks,public,src,tests}/**/*.{js,jsx,mjs,ts,tsx}\"",
30
- "lint:eslint:fix": "eslint \"{mocks,public,src,tests}/**/*.{js,jsx,mjs,ts,tsx}\" --fix",
31
- "lint:stylelint": "stylelint \"src/**/*.{scss,css}\"",
32
- "lint:stylelint:fix": "stylelint \"src/**/*.{scss,css}\" --fix",
33
- "lint:prettier": "prettier \"{mocks,public,src}/**/*.!(js|jsx|mjs|ts|tsx|scss|css)\" --check --ignore-unknown",
34
- "lint:prettier:fix": "prettier \"{mocks,public,src}/**/*.!(js|jsx|mjs|ts|tsx|scss|css)\" --write --ignore-unknown",
29
+ "lint:eslint": "eslint \"**/*.{js,jsx,mjs,ts,tsx}\"",
30
+ "lint:eslint:fix": "eslint \"**/*.{js,jsx,mjs,ts,tsx}\" --fix",
31
+ "lint:stylelint": "stylelint \"**/*.{scss,css}\"",
32
+ "lint:stylelint:fix": "stylelint \"**/*.{scss,css}\" --fix",
33
+ "lint:prettier": "prettier . --check --ignore-unknown",
34
+ "lint:prettier:fix": "prettier . --write --ignore-unknown",
35
35
  "lint:tsc": "tsc --noEmit",
36
36
  "playwright:install": "playwright install",
37
37
  "playwright:show-report": "playwright show-report",
@@ -49,53 +49,51 @@
49
49
  "template"
50
50
  ],
51
51
  "dependencies": {
52
- "@hookform/resolvers": "^5.5.7",
52
+ "@hookform/resolvers": "^5.9.1",
53
53
  "@tanstack/react-query": "^5.101.4",
54
54
  "@tanstack/react-query-devtools": "^5.101.4",
55
55
  "inversify": "^8.2.3",
56
56
  "react": "^19.2.8",
57
57
  "react-dom": "^19.2.8",
58
- "react-hook-form": "^7.83.0",
58
+ "react-hook-form": "^7.85.0",
59
59
  "react-router": "^8.3.0",
60
60
  "yup": "^1.7.1"
61
61
  },
62
62
  "devDependencies": {
63
63
  "@bdellegrazie/playwright-sonar-reporter": "^0.5.2",
64
- "@commitlint/cli": "^21.2.1",
64
+ "@commitlint/cli": "^21.2.2",
65
65
  "@msw/playwright": "^0.6.7",
66
66
  "@playwright/test": "^1.62.1",
67
- "@pplancq/commitlint-config": "*",
68
- "@pplancq/eslint-config": "*",
69
- "@pplancq/prettier-config": "*",
70
- "@pplancq/stylelint-config": "*",
71
- "@rsbuild/core": "^2.1.9",
67
+ "@pplancq/commitlint-config": "^4.0.6",
68
+ "@pplancq/eslint-config": "^6.1.1",
69
+ "@pplancq/prettier-config": "^4.0.2",
70
+ "@pplancq/stylelint-config": "^6.1.1",
71
+ "@rsbuild/core": "^2.1.13",
72
72
  "@rsbuild/plugin-eslint": "^2.0.2",
73
73
  "@rsbuild/plugin-react": "^2.1.0",
74
74
  "@rsbuild/plugin-sass": "^2.0.1",
75
- "@testing-library/jest-dom": "^7.0.0",
75
+ "@testing-library/jest-dom": "^7.0.1",
76
76
  "@testing-library/react": "^16.3.2",
77
- "@testing-library/user-event": "^14.6.1",
77
+ "@testing-library/user-event": "^14.6.6",
78
78
  "@types/react": "^19.2.18",
79
79
  "@types/react-dom": "^19.2.4",
80
- "@vitejs/plugin-react": "^6.0.5",
81
- "@vitest/coverage-v8": "^4.1.10",
82
- "concurrently": "^10.0.4",
80
+ "@vitejs/plugin-react": "^6.1.0",
81
+ "@vitest/coverage-v8": "^4.1.11",
82
+ "concurrently": "^10.0.5",
83
83
  "eslint": "^9.39.5",
84
- "eslint-plugin-prettier": "^5.5.6",
85
84
  "husky": "^9.1.7",
86
85
  "jsdom": "^30.0.1",
87
- "lint-staged": "^17.2.0",
86
+ "lint-staged": "^17.3.0",
88
87
  "monocart-coverage-reports": "^2.12.12",
89
88
  "msw": "^2.15.0",
90
89
  "nodemon": "^3.1.14",
91
90
  "prettier": "^3.9.6",
92
91
  "rsbuild-plugin-stylelint": "^1.2.0",
93
92
  "stylelint": "^17.14.1",
94
- "stylelint-prettier": "^5.0.3",
95
93
  "tsc-files": "^1.1.4",
96
94
  "typescript": "^6.0.3",
97
95
  "vite-plugin-svgr": "^5.2.0",
98
- "vitest": "^4.1.10",
96
+ "vitest": "^4.1.11",
99
97
  "vitest-axe": "^1.0.0-pre.5",
100
98
  "vitest-sonar-reporter": "^3.0.0"
101
99
  },
@@ -1,48 +1,48 @@
1
- import { defineConfig, devices } from '@playwright/test';
1
+ import { defineConfig, devices } from "@playwright/test";
2
2
 
3
- const appUrl = 'http://localhost:3000';
3
+ const appUrl = "http://localhost:3000";
4
4
 
5
5
  export default defineConfig({
6
- testDir: 'tests/e2e',
7
- outputDir: 'test-results',
6
+ testDir: "tests/e2e",
7
+ outputDir: "test-results",
8
8
  fullyParallel: true,
9
9
  forbidOnly: Boolean(process.env.CI),
10
10
  retries: process.env.CI ? 2 : 0,
11
11
  workers: process.env.CI ? 1 : undefined,
12
12
  reporter: [
13
- ['list'],
14
- ['html', { open: 'never', outputFolder: 'playwright-report/html' }],
15
- ['junit', { outputFile: 'playwright-report/junit-report.xml' }],
13
+ ["list"],
14
+ ["html", { open: "never", outputFolder: "playwright-report/html" }],
15
+ ["junit", { outputFile: "playwright-report/junit-report.xml" }],
16
16
  [
17
- '@bdellegrazie/playwright-sonar-reporter',
18
- { outputFile: 'playwright-report/sonar-results.xml', sonarcloud: true },
17
+ "@bdellegrazie/playwright-sonar-reporter",
18
+ { outputFile: "playwright-report/sonar-results.xml", sonarcloud: true },
19
19
  ],
20
20
  ],
21
- globalSetup: 'tests/e2e/utils/playwright.globalSetup.ts',
22
- globalTeardown: 'tests/e2e/utils/playwright.globalTeardown.ts',
21
+ globalSetup: "tests/e2e/utils/playwright.globalSetup.ts",
22
+ globalTeardown: "tests/e2e/utils/playwright.globalTeardown.ts",
23
23
  use: {
24
24
  baseURL: appUrl,
25
- trace: 'retain-on-failure',
26
- screenshot: 'only-on-failure',
25
+ trace: "retain-on-failure",
26
+ screenshot: "only-on-failure",
27
27
  },
28
28
  projects: [
29
29
  {
30
- name: 'chromium',
31
- use: { ...devices['Desktop Chrome'] },
30
+ name: "chromium",
31
+ use: { ...devices["Desktop Chrome"] },
32
32
  },
33
33
  {
34
- name: 'firefox',
35
- use: { ...devices['Firefox Desktop'] },
34
+ name: "firefox",
35
+ use: { ...devices["Firefox Desktop"] },
36
36
  },
37
37
  {
38
- name: 'webkit',
39
- use: { ...devices['Desktop Safari'] },
38
+ name: "webkit",
39
+ use: { ...devices["Desktop Safari"] },
40
40
  },
41
41
  ],
42
42
  webServer: {
43
- command: 'npm run build -- --env-mode test && npm run preview',
43
+ command: "npm run build -- --env-mode test && npm run preview",
44
44
  url: appUrl,
45
- stdout: 'pipe',
45
+ stdout: "pipe",
46
46
  reuseExistingServer: !process.env.CI,
47
47
  },
48
48
  });
@@ -1,4 +1,4 @@
1
- import defaultConfig from '@pplancq/prettier-config';
1
+ import defaultConfig from "@pplancq/prettier-config";
2
2
 
3
3
  export default {
4
4
  ...defaultConfig,
package/rsbuild.config.ts CHANGED
@@ -1,9 +1,9 @@
1
- import { defineConfig, loadEnv } from '@rsbuild/core';
2
- import { pluginEslint } from '@rsbuild/plugin-eslint';
3
- import { pluginReact } from '@rsbuild/plugin-react';
4
- import { pluginSass } from '@rsbuild/plugin-sass';
5
- import { pluginStylelint } from 'rsbuild-plugin-stylelint';
6
- import packageJson from './package.json';
1
+ import { defineConfig, loadEnv } from "@rsbuild/core";
2
+ import { pluginEslint } from "@rsbuild/plugin-eslint";
3
+ import { pluginReact } from "@rsbuild/plugin-react";
4
+ import { pluginSass } from "@rsbuild/plugin-sass";
5
+ import { pluginStylelint } from "rsbuild-plugin-stylelint";
6
+ import packageJson from "./package.json";
7
7
 
8
8
  const resolveModule = (module: string) => {
9
9
  try {
@@ -14,14 +14,14 @@ const resolveModule = (module: string) => {
14
14
  }
15
15
  };
16
16
 
17
- const { publicVars } = loadEnv({ prefixes: [process.env.ENV_PREFIX ?? 'FRONT_'] });
17
+ const { publicVars } = loadEnv({ prefixes: [process.env.ENV_PREFIX ?? "FRONT_"] });
18
18
 
19
- const publicUrl = process.env.PUBLIC_URL ?? (packageJson as { homepage?: string }).homepage ?? '/';
20
- const publicPath = new URL(publicUrl.endsWith('/') ? publicUrl : `${publicUrl}/`, 'http://localhost').pathname;
21
- const disableSourceMap = (process.env.DISABLE_SOURCE_MAP ?? 'false') === 'true' ? false : 'source-map';
19
+ const publicUrl = process.env.PUBLIC_URL ?? (packageJson as { homepage?: string }).homepage ?? "/";
20
+ const publicPath = new URL(publicUrl.endsWith("/") ? publicUrl : `${publicUrl}/`, "http://localhost").pathname;
21
+ const disableSourceMap = (process.env.DISABLE_SOURCE_MAP ?? "false") === "true" ? false : "source-map";
22
22
 
23
23
  export default defineConfig(({ env }) => {
24
- const isProduction = env === 'production';
24
+ const isProduction = env === "production";
25
25
 
26
26
  return {
27
27
  plugins: [
@@ -29,44 +29,44 @@ export default defineConfig(({ env }) => {
29
29
  pluginSass(),
30
30
  !isProduction &&
31
31
  pluginEslint({
32
- enable: (process.env.DISABLE_ESLINT_PLUGIN ?? 'false') === 'false' && resolveModule('eslint'),
32
+ enable: (process.env.DISABLE_ESLINT_PLUGIN ?? "false") === "false" && resolveModule("eslint"),
33
33
  eslintPluginOptions: {
34
- configType: 'flat',
34
+ configType: "flat",
35
35
  },
36
36
  }),
37
37
  !isProduction &&
38
38
  pluginStylelint({
39
- enable: (process.env.DISABLE_STYLELINT_PLUGIN ?? 'false') === 'false' && resolveModule('stylelint'),
39
+ enable: (process.env.DISABLE_STYLELINT_PLUGIN ?? "false") === "false" && resolveModule("stylelint"),
40
40
  }),
41
41
  ].filter(Boolean),
42
42
  source: {
43
43
  entry: {
44
- index: './src/main.ts',
44
+ index: "./src/main.ts",
45
45
  },
46
46
  define: publicVars,
47
47
  },
48
48
  output: {
49
49
  assetPrefix: publicPath,
50
50
  sourceMap: {
51
- js: isProduction ? disableSourceMap : 'cheap-module-source-map',
52
- css: (process.env.DISABLE_SOURCE_MAP ?? 'false') !== 'true',
51
+ js: isProduction ? disableSourceMap : "cheap-module-source-map",
52
+ css: (process.env.DISABLE_SOURCE_MAP ?? "false") !== "true",
53
53
  },
54
54
  distPath: {
55
- root: 'build',
55
+ root: "build",
56
56
  },
57
57
  copy: [
58
58
  {
59
- from: 'public',
60
- to: '.',
59
+ from: "public",
60
+ to: ".",
61
61
  },
62
62
  ],
63
63
  },
64
64
  server: {
65
- port: Number.parseInt(process.env.PORT ?? '3000', 10),
66
- open: (process.env.BROWSER ?? 'false') === 'true',
65
+ port: Number.parseInt(process.env.PORT ?? "3000", 10),
66
+ open: (process.env.BROWSER ?? "false") === "true",
67
67
  },
68
68
  html: {
69
- template: './index.html',
69
+ template: "./index.html",
70
70
  },
71
71
  };
72
72
  });
package/scripts/lint.js CHANGED
@@ -1,8 +1,8 @@
1
- // eslint-disable-next-line import/no-extraneous-dependencies
2
- import concurrently from 'concurrently';
1
+ // eslint-disable-next-line import/no-unresolved
2
+ import concurrently from "concurrently";
3
3
 
4
- const { result } = concurrently(['npm:lint:*(!fix)'], {
5
- prefixColors: 'auto',
4
+ const { result } = concurrently(["npm:lint:*(!fix)"], {
5
+ prefixColors: "auto",
6
6
  maxProcesses: process.env.CI ? 1 : undefined,
7
7
  });
8
8
 
@@ -1,9 +1,9 @@
1
- import { spawnSync } from 'node:child_process';
2
- import { platform } from 'node:process';
1
+ import { spawnSync } from "node:child_process";
2
+ import { platform } from "node:process";
3
3
 
4
4
  const runCommand = (cmd, args = []) => {
5
- console.info(`> ${cmd} ${args.join(' ')}`);
6
- const result = spawnSync(cmd, args, { shell: platform === 'win32', cwd: process.cwd(), stdio: 'inherit' });
5
+ console.info(`> ${cmd} ${args.join(" ")}`);
6
+ const result = spawnSync(cmd, args, { shell: platform === "win32", cwd: process.cwd(), stdio: "inherit" });
7
7
  if (result.status !== 0) {
8
8
  throw result;
9
9
  }
@@ -14,33 +14,33 @@ const main = async () => {
14
14
 
15
15
  let playwrightArgs = [...args];
16
16
 
17
- if (args.includes('--watch')) {
18
- const filteredArgs = args.filter(a => a !== '--watch');
19
- runCommand('npx', [
20
- 'nodemon',
21
- '--watch',
22
- './tests/',
23
- '--ext',
24
- 'js,jx,ts,tsx',
25
- '--exec',
26
- ['node', 'scripts/playwright.js', ...filteredArgs].join(' '),
17
+ if (args.includes("--watch")) {
18
+ const filteredArgs = args.filter((a) => a !== "--watch");
19
+ runCommand("npx", [
20
+ "nodemon",
21
+ "--watch",
22
+ "./tests/",
23
+ "--ext",
24
+ "js,jx,ts,tsx",
25
+ "--exec",
26
+ ["node", "scripts/playwright.js", ...filteredArgs].join(" "),
27
27
  ]);
28
28
  return;
29
29
  }
30
30
 
31
- if (playwrightArgs.includes('--coverage')) {
32
- process.env.ENABLED_COVERAGE = 'true';
33
- playwrightArgs = playwrightArgs.filter(p => p !== '--coverage');
31
+ if (playwrightArgs.includes("--coverage")) {
32
+ process.env.ENABLED_COVERAGE = "true";
33
+ playwrightArgs = playwrightArgs.filter((p) => p !== "--coverage");
34
34
  }
35
35
 
36
- runCommand('npx', ['playwright', ...playwrightArgs]);
36
+ runCommand("npx", ["playwright", ...playwrightArgs]);
37
37
  };
38
38
 
39
39
  try {
40
40
  await main();
41
41
  } catch (e) {
42
42
  const status =
43
- e && typeof e === 'object' && 'status' in e && typeof e.status === 'number' && Number.isFinite(e.status)
43
+ e && typeof e === "object" && "status" in e && typeof e.status === "number" && Number.isFinite(e.status)
44
44
  ? e.status
45
45
  : 1;
46
46
  process.exit(status);