@component-hook/create-app 1.4.3 → 1.5.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/{template-shared/LICENSE → LICENSE} +1 -1
- package/README.md +1 -1
- package/dist/index.mjs +26 -23
- package/package.json +4 -4
- package/template-react/.vscode/extensions.json +0 -9
- package/template-react/.vscode/settings.json +0 -18
- package/template-react/README.md.art +0 -84
- package/template-react/eslint.config.js +0 -18
- package/template-react/index.html.art +0 -13
- package/template-react/lint-staged.config.js +0 -6
- package/template-react/package.json +0 -69
- package/template-react/public/vite.svg +0 -1
- package/template-react/src/App.tsx +0 -6
- package/template-react/src/__tests__/e2e/home.spec.ts +0 -40
- package/template-react/src/__tests__/unit/pages/home/components/HelloWorld.test.tsx +0 -45
- package/template-react/src/__tests__/unit/pages/home/index.test.tsx +0 -19
- package/template-react/src/__tests__/unit/render/index.tsx +0 -15
- package/template-react/src/assets/svg-icons/react.svg +0 -1
- package/template-react/src/components/common/index.ts +0 -1
- package/template-react/src/components/common/svg-icon/index.ts +0 -1
- package/template-react/src/components/common/svg-icon/src/index.tsx +0 -23
- package/template-react/src/main.tsx +0 -26
- package/template-react/src/mocks/browser.ts +0 -4
- package/template-react/src/mocks/handlers/index.ts +0 -1
- package/template-react/src/mocks/server.ts +0 -4
- package/template-react/src/pages/home/components/hello-world/index.tsx +0 -49
- package/template-react/src/pages/home/index.module.css +0 -8
- package/template-react/src/pages/home/index.tsx +0 -37
- package/template-react/src/plugins/i18n/index.ts +0 -15
- package/template-react/src/plugins/i18n/locales/en-US.json +0 -3
- package/template-react/src/plugins/i18n/locales/zh-TW.json +0 -3
- package/template-react/src/router/index.tsx +0 -22
- package/template-react/src/stores/constants.ts +0 -1
- package/template-react/src/stores/index.ts +0 -1
- package/template-react/src/stores/middleware.ts +0 -17
- package/template-react/src/stores/modules/config.ts +0 -27
- package/template-react/src/styles/base.css +0 -68
- package/template-react/src/styles/common/all.css +0 -1
- package/template-react/src/styles/common/button.css +0 -26
- package/template-react/src/styles/index.css +0 -3
- package/template-react/src/styles/tailwind.css +0 -14
- package/template-react/src/vite-env.d.ts +0 -9
- package/template-react/tsconfig.app.json +0 -32
- package/template-react/tsconfig.vitest.json +0 -10
- package/template-react/vite.config.ts +0 -40
- package/template-react/vitest.config.ts +0 -18
- package/template-react/vitest.setup.ts +0 -13
- package/template-shared/.browserslistrc +0 -10
- package/template-shared/.github/actions/setup-environment/action.yml +0 -21
- package/template-shared/.github/renovate.json +0 -14
- package/template-shared/.github/workflows/ci.yml +0 -22
- package/template-shared/.github/workflows/deploy.yml +0 -27
- package/template-shared/.github/workflows/preview.yml +0 -17
- package/template-shared/.gitlab/setup.yml +0 -18
- package/template-shared/.husky/commit-msg +0 -1
- package/template-shared/.husky/pre-commit +0 -1
- package/template-shared/_gitignore +0 -32
- package/template-shared/_gitlab-ci.yml +0 -22
- package/template-shared/commitlint.config.js +0 -3
- package/template-shared/playwright.config.ts +0 -49
- package/template-shared/postcss.config.js +0 -15
- package/template-shared/prettier.config.js +0 -13
- package/template-shared/scripts/build-info/index.ts +0 -21
- package/template-shared/tsconfig.json +0 -14
- package/template-shared/tsconfig.node.json +0 -12
- package/template-vue/.vscode/extensions.json +0 -10
- package/template-vue/.vscode/settings.json +0 -18
- package/template-vue/README.md.art +0 -80
- package/template-vue/eslint.config.js +0 -18
- package/template-vue/index.html.art +0 -28
- package/template-vue/lint-staged.config.js +0 -6
- package/template-vue/package.json +0 -68
- package/template-vue/public/vite.svg +0 -1
- package/template-vue/src/App.vue +0 -7
- package/template-vue/src/__tests__/e2e/home.spec.ts +0 -61
- package/template-vue/src/__tests__/unit/pages/home/components/HelloWorld.test.ts +0 -57
- package/template-vue/src/__tests__/unit/pages/home/index.test.ts +0 -17
- package/template-vue/src/__tests__/unit/render/index.ts +0 -28
- package/template-vue/src/assets/svg-icons/vue.svg +0 -1
- package/template-vue/src/components/common/index.ts +0 -1
- package/template-vue/src/components/common/svg-icon/index.ts +0 -1
- package/template-vue/src/components/common/svg-icon/src/index.vue +0 -29
- package/template-vue/src/locales/en-US.json +0 -3
- package/template-vue/src/locales/zh-TW.json +0 -3
- package/template-vue/src/main.ts +0 -21
- package/template-vue/src/mocks/browser.ts +0 -4
- package/template-vue/src/mocks/handlers/index.ts +0 -1
- package/template-vue/src/mocks/server.ts +0 -4
- package/template-vue/src/pages/home/components/HelloWorld.vue +0 -54
- package/template-vue/src/pages/home/index.vue +0 -46
- package/template-vue/src/plugins/i18n.ts +0 -11
- package/template-vue/src/router/index.ts +0 -23
- package/template-vue/src/stores/constants.ts.art +0 -1
- package/template-vue/src/stores/index.ts +0 -15
- package/template-vue/src/stores/modules/config.ts +0 -20
- package/template-vue/src/styles/base.css +0 -59
- package/template-vue/src/styles/common/all.css +0 -1
- package/template-vue/src/styles/common/button.css +0 -15
- package/template-vue/src/styles/index.css +0 -3
- package/template-vue/src/styles/tailwind.css +0 -1
- package/template-vue/src/vite-env.d.ts +0 -9
- package/template-vue/tsconfig.app.json +0 -12
- package/template-vue/tsconfig.vitest.json +0 -10
- package/template-vue/vite.config.ts +0 -46
- package/template-vue/vitest.config.ts +0 -18
- package/template-vue/vitest.setup.ts +0 -12
|
@@ -1,49 +0,0 @@
|
|
|
1
|
-
import { useState } from 'react';
|
|
2
|
-
import { useTranslation } from 'react-i18next';
|
|
3
|
-
import { useConfigStore } from '@/stores';
|
|
4
|
-
|
|
5
|
-
interface Props {
|
|
6
|
-
title?: string;
|
|
7
|
-
}
|
|
8
|
-
|
|
9
|
-
export function HelloWorld({ title = '' }: Props) {
|
|
10
|
-
const [count, setCount] = useState(0);
|
|
11
|
-
const { t, i18n } = useTranslation();
|
|
12
|
-
const { appMeta } = useConfigStore();
|
|
13
|
-
|
|
14
|
-
function changeLanguage() {
|
|
15
|
-
const language = i18n.language === 'zh-TW' ? 'en-US' : 'zh-TW';
|
|
16
|
-
|
|
17
|
-
i18n.changeLanguage(language);
|
|
18
|
-
}
|
|
19
|
-
|
|
20
|
-
return (
|
|
21
|
-
<>
|
|
22
|
-
<h1>{title}</h1>
|
|
23
|
-
|
|
24
|
-
<div className="p-8">
|
|
25
|
-
<button
|
|
26
|
-
className="mb-4"
|
|
27
|
-
onClick={() => setCount(originCount => originCount + 1)}
|
|
28
|
-
>
|
|
29
|
-
count is {count}
|
|
30
|
-
</button>
|
|
31
|
-
<p>
|
|
32
|
-
Edit <code>src/App.tsx</code> and save to test HMR
|
|
33
|
-
</p>
|
|
34
|
-
</div>
|
|
35
|
-
|
|
36
|
-
<p className="text-[#888]">Click on the Vite and React logos to learn more</p>
|
|
37
|
-
<p className="mt-1 text-[#888]">
|
|
38
|
-
{appMeta.version} - Built at: {appMeta.builtAt.toLocaleString()}
|
|
39
|
-
</p>
|
|
40
|
-
|
|
41
|
-
<button
|
|
42
|
-
className="my-4"
|
|
43
|
-
onClick={() => changeLanguage()}
|
|
44
|
-
>
|
|
45
|
-
{t('language')}
|
|
46
|
-
</button>
|
|
47
|
-
</>
|
|
48
|
-
);
|
|
49
|
-
}
|
|
@@ -1,37 +0,0 @@
|
|
|
1
|
-
import { SvgIcon } from '@/components/common';
|
|
2
|
-
import { HelloWorld } from './components/hello-world';
|
|
3
|
-
import styles from './index.module.css';
|
|
4
|
-
import viteLogo from '/vite.svg';
|
|
5
|
-
|
|
6
|
-
export function Home() {
|
|
7
|
-
return (
|
|
8
|
-
<>
|
|
9
|
-
<div>
|
|
10
|
-
<a
|
|
11
|
-
href="https://vite.dev"
|
|
12
|
-
target="_blank"
|
|
13
|
-
rel="noreferrer"
|
|
14
|
-
>
|
|
15
|
-
<img
|
|
16
|
-
src={viteLogo}
|
|
17
|
-
className={`${styles.logo} hover:filter-[drop-shadow(0_0_2em_#646cffaa)]`}
|
|
18
|
-
alt="Vite logo"
|
|
19
|
-
/>
|
|
20
|
-
</a>
|
|
21
|
-
<a
|
|
22
|
-
href="https://react.dev"
|
|
23
|
-
target="_blank"
|
|
24
|
-
rel="noreferrer"
|
|
25
|
-
aria-label="React link"
|
|
26
|
-
>
|
|
27
|
-
<SvgIcon
|
|
28
|
-
name="react"
|
|
29
|
-
className={`${styles.logo} motion-safe:animate-logo-spin hover:filter-[drop-shadow(0_0_2em_#61dafbaa)]`}
|
|
30
|
-
/>
|
|
31
|
-
</a>
|
|
32
|
-
</div>
|
|
33
|
-
|
|
34
|
-
<HelloWorld title="Vite + React" />
|
|
35
|
-
</>
|
|
36
|
-
);
|
|
37
|
-
}
|
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
import i18n from 'i18next';
|
|
2
|
-
import { initReactI18next } from 'react-i18next';
|
|
3
|
-
import enUS from './locales/en-US.json' with { type: 'json' };
|
|
4
|
-
import zhTW from './locales/zh-TW.json' with { type: 'json' };
|
|
5
|
-
|
|
6
|
-
i18n.use(initReactI18next).init({
|
|
7
|
-
lng: navigator.language,
|
|
8
|
-
fallbackLng: 'en-US',
|
|
9
|
-
resources: {
|
|
10
|
-
'zh-TW': { translation: zhTW },
|
|
11
|
-
'en-US': { translation: enUS },
|
|
12
|
-
},
|
|
13
|
-
});
|
|
14
|
-
|
|
15
|
-
export default i18n;
|
|
@@ -1,22 +0,0 @@
|
|
|
1
|
-
import { createBrowserRouter, Navigate } from 'react-router-dom';
|
|
2
|
-
import { Home } from '@/pages/home';
|
|
3
|
-
|
|
4
|
-
export const routes = [
|
|
5
|
-
{
|
|
6
|
-
path: '*',
|
|
7
|
-
element: (
|
|
8
|
-
<Navigate
|
|
9
|
-
to="/"
|
|
10
|
-
replace
|
|
11
|
-
/>
|
|
12
|
-
),
|
|
13
|
-
},
|
|
14
|
-
{
|
|
15
|
-
path: '/',
|
|
16
|
-
element: <Home />,
|
|
17
|
-
},
|
|
18
|
-
];
|
|
19
|
-
|
|
20
|
-
const router = createBrowserRouter(routes);
|
|
21
|
-
|
|
22
|
-
export default router;
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export const STORAGE_PREFIX = 'react-starter';
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export { useConfigStore } from './modules/config';
|
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
import { create, type StateCreator } from 'zustand';
|
|
2
|
-
import { createJSONStorage, persist, type PersistOptions } from 'zustand/middleware';
|
|
3
|
-
import { STORAGE_PREFIX } from './constants';
|
|
4
|
-
|
|
5
|
-
export function createPersistedStore<T, S = Partial<T>>(
|
|
6
|
-
id: string,
|
|
7
|
-
initializer: StateCreator<T>,
|
|
8
|
-
persistOptions?: Partial<PersistOptions<T, S>>,
|
|
9
|
-
) {
|
|
10
|
-
return create(
|
|
11
|
-
persist<T, [], [], S>(initializer, {
|
|
12
|
-
name: `${STORAGE_PREFIX}-${id}`,
|
|
13
|
-
storage: createJSONStorage(() => localStorage),
|
|
14
|
-
...persistOptions,
|
|
15
|
-
}),
|
|
16
|
-
);
|
|
17
|
-
}
|
|
@@ -1,27 +0,0 @@
|
|
|
1
|
-
import { createPersistedStore } from '../middleware';
|
|
2
|
-
|
|
3
|
-
interface ConfigState {
|
|
4
|
-
appMeta: {
|
|
5
|
-
version: string;
|
|
6
|
-
builtAt: Date;
|
|
7
|
-
};
|
|
8
|
-
}
|
|
9
|
-
|
|
10
|
-
const versionString = `${import.meta.env.VITE_APP_VERSION}-${import.meta.env.VITE_APP_LAST_COMMIT_HASH}`;
|
|
11
|
-
|
|
12
|
-
const defaultState = {
|
|
13
|
-
appMeta: {
|
|
14
|
-
version: import.meta.env.MODE === 'development' ? `${versionString}-dev` : versionString,
|
|
15
|
-
builtAt: new Date(Number(import.meta.env.VITE_APP_BUILD_EPOCH)),
|
|
16
|
-
},
|
|
17
|
-
};
|
|
18
|
-
|
|
19
|
-
export const useConfigStore = createPersistedStore<ConfigState>(
|
|
20
|
-
'config',
|
|
21
|
-
() => ({
|
|
22
|
-
...defaultState,
|
|
23
|
-
}),
|
|
24
|
-
{
|
|
25
|
-
partialize: () => ({}),
|
|
26
|
-
},
|
|
27
|
-
);
|
|
@@ -1,68 +0,0 @@
|
|
|
1
|
-
:root {
|
|
2
|
-
font-family: system-ui, Avenir, Helvetica, Arial, sans-serif;
|
|
3
|
-
line-height: 1.5;
|
|
4
|
-
font-weight: 400;
|
|
5
|
-
|
|
6
|
-
color-scheme: light dark;
|
|
7
|
-
color: rgba(255, 255, 255, 0.87);
|
|
8
|
-
background-color: #242424;
|
|
9
|
-
|
|
10
|
-
overscroll-behavior: none none;
|
|
11
|
-
touch-action: manipulation;
|
|
12
|
-
user-select: none;
|
|
13
|
-
text-rendering: optimizeLegibility;
|
|
14
|
-
-moz-osx-font-smoothing: grayscale;
|
|
15
|
-
-moz-touch-callout: none;
|
|
16
|
-
-ms-touch-callout: none;
|
|
17
|
-
-webkit-font-smoothing: antialiased;
|
|
18
|
-
-webkit-touch-callout: none;
|
|
19
|
-
-webkit-overflow-scrolling: touch;
|
|
20
|
-
}
|
|
21
|
-
|
|
22
|
-
a {
|
|
23
|
-
font-weight: 500;
|
|
24
|
-
color: #646cff;
|
|
25
|
-
text-decoration: inherit;
|
|
26
|
-
|
|
27
|
-
&:hover {
|
|
28
|
-
color: #535bf2;
|
|
29
|
-
}
|
|
30
|
-
}
|
|
31
|
-
|
|
32
|
-
body {
|
|
33
|
-
margin: 0;
|
|
34
|
-
display: flex;
|
|
35
|
-
place-items: center;
|
|
36
|
-
min-width: 320px;
|
|
37
|
-
min-height: 100vh;
|
|
38
|
-
}
|
|
39
|
-
|
|
40
|
-
img {
|
|
41
|
-
-webkit-touch-callout: none;
|
|
42
|
-
-webkit-user-drag: none;
|
|
43
|
-
user-select: none;
|
|
44
|
-
}
|
|
45
|
-
|
|
46
|
-
h1 {
|
|
47
|
-
font-size: 3.2em;
|
|
48
|
-
line-height: 1.1;
|
|
49
|
-
}
|
|
50
|
-
|
|
51
|
-
#root {
|
|
52
|
-
max-width: 1280px;
|
|
53
|
-
width: 100%;
|
|
54
|
-
margin: 0 auto;
|
|
55
|
-
padding: 2rem;
|
|
56
|
-
text-align: center;
|
|
57
|
-
}
|
|
58
|
-
|
|
59
|
-
@media (prefers-color-scheme: light) {
|
|
60
|
-
:root {
|
|
61
|
-
color: #213547;
|
|
62
|
-
background-color: #ffffff;
|
|
63
|
-
}
|
|
64
|
-
|
|
65
|
-
a:hover {
|
|
66
|
-
color: #747bff;
|
|
67
|
-
}
|
|
68
|
-
}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
@import './button.css';
|
|
@@ -1,26 +0,0 @@
|
|
|
1
|
-
button {
|
|
2
|
-
border-radius: 8px;
|
|
3
|
-
border: 1px solid transparent;
|
|
4
|
-
padding: 0.6em 1.2em;
|
|
5
|
-
font-size: 1em;
|
|
6
|
-
font-weight: 500;
|
|
7
|
-
font-family: inherit;
|
|
8
|
-
background-color: #1a1a1a;
|
|
9
|
-
cursor: pointer;
|
|
10
|
-
transition: border-color 0.25s;
|
|
11
|
-
|
|
12
|
-
&:hover {
|
|
13
|
-
border-color: #646cff;
|
|
14
|
-
}
|
|
15
|
-
|
|
16
|
-
&:focus,
|
|
17
|
-
&:focus-visible {
|
|
18
|
-
outline: 4px auto -webkit-focus-ring-color;
|
|
19
|
-
}
|
|
20
|
-
}
|
|
21
|
-
|
|
22
|
-
@media (prefers-color-scheme: light) {
|
|
23
|
-
button {
|
|
24
|
-
background-color: #f9f9f9;
|
|
25
|
-
}
|
|
26
|
-
}
|
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
/// <reference types="vite/client" />
|
|
2
|
-
|
|
3
|
-
declare module 'virtual:svg-icons-register';
|
|
4
|
-
|
|
5
|
-
interface ImportMetaEnv extends Readonly<Record<string, string>> {
|
|
6
|
-
readonly VITE_APP_VERSION: string;
|
|
7
|
-
readonly VITE_APP_MOCK?: 'service-worker';
|
|
8
|
-
readonly VITE_APP_BUILD_EPOCH?: string;
|
|
9
|
-
}
|
|
@@ -1,32 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"compilerOptions": {
|
|
3
|
-
"composite": true,
|
|
4
|
-
"tsBuildInfoFile": "./node_modules/.tmp/tsconfig.app.tsbuildinfo",
|
|
5
|
-
"target": "ES2020",
|
|
6
|
-
"jsx": "react-jsx",
|
|
7
|
-
"lib": ["ES2020", "DOM", "DOM.Iterable"],
|
|
8
|
-
"moduleDetection": "force",
|
|
9
|
-
"useDefineForClassFields": true,
|
|
10
|
-
"module": "ESNext",
|
|
11
|
-
|
|
12
|
-
/* Bundler mode */
|
|
13
|
-
"moduleResolution": "bundler",
|
|
14
|
-
"paths": {
|
|
15
|
-
"@/*": ["./src/*"]
|
|
16
|
-
},
|
|
17
|
-
"allowImportingTsExtensions": true,
|
|
18
|
-
|
|
19
|
-
/* Linting */
|
|
20
|
-
"strict": true,
|
|
21
|
-
"noFallthroughCasesInSwitch": true,
|
|
22
|
-
"noUnusedLocals": true,
|
|
23
|
-
"noUnusedParameters": true,
|
|
24
|
-
"noEmit": true,
|
|
25
|
-
"verbatimModuleSyntax": true,
|
|
26
|
-
"erasableSyntaxOnly": true,
|
|
27
|
-
"skipLibCheck": true,
|
|
28
|
-
"noUncheckedSideEffectImports": true
|
|
29
|
-
},
|
|
30
|
-
"include": ["src/**/*.ts", "src/**/*.d.ts", "src/**/*.tsx"],
|
|
31
|
-
"exclude": ["src/**/__tests__/*"]
|
|
32
|
-
}
|
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"extends": "./tsconfig.app.json",
|
|
3
|
-
"compilerOptions": {
|
|
4
|
-
"composite": true,
|
|
5
|
-
"tsBuildInfoFile": "./node_modules/.tmp/tsconfig.vitest.tsbuildinfo",
|
|
6
|
-
"types": ["vitest/globals"]
|
|
7
|
-
},
|
|
8
|
-
"include": ["src/**/*.ts", "src/**/*.d.ts", "src/**/*.tsx", "vitest.setup.ts"],
|
|
9
|
-
"exclude": []
|
|
10
|
-
}
|
|
@@ -1,40 +0,0 @@
|
|
|
1
|
-
import { resolve } from 'node:path';
|
|
2
|
-
import { fileURLToPath, URL } from 'node:url';
|
|
3
|
-
import tailwindcss from '@tailwindcss/vite';
|
|
4
|
-
import react from '@vitejs/plugin-react-swc';
|
|
5
|
-
import { defineConfig } from 'vite';
|
|
6
|
-
import { createSvgIconsPlugin } from 'vite-plugin-svg-icons';
|
|
7
|
-
import './scripts/build-info';
|
|
8
|
-
|
|
9
|
-
export default defineConfig({
|
|
10
|
-
base: './',
|
|
11
|
-
plugins: [
|
|
12
|
-
react(),
|
|
13
|
-
tailwindcss(),
|
|
14
|
-
createSvgIconsPlugin({
|
|
15
|
-
iconDirs: [resolve(process.cwd(), 'src/assets/svg-icons')],
|
|
16
|
-
}),
|
|
17
|
-
],
|
|
18
|
-
esbuild: {
|
|
19
|
-
pure: ['console.log'],
|
|
20
|
-
drop: ['debugger'],
|
|
21
|
-
},
|
|
22
|
-
resolve: {
|
|
23
|
-
alias: {
|
|
24
|
-
'@': fileURLToPath(new URL('src', import.meta.url)),
|
|
25
|
-
},
|
|
26
|
-
},
|
|
27
|
-
build: {
|
|
28
|
-
rollupOptions: {
|
|
29
|
-
output: {
|
|
30
|
-
chunkFileNames: 'chunks/[name]-[hash].js',
|
|
31
|
-
assetFileNames: 'assets/[name].[hash].[ext]',
|
|
32
|
-
entryFileNames: 'entries/[name].[hash].js',
|
|
33
|
-
manualChunks: {
|
|
34
|
-
core: ['react', 'react-dom', 'react-i18next', 'react-router-dom', 'zustand', 'i18next'],
|
|
35
|
-
vender: ['axios'],
|
|
36
|
-
},
|
|
37
|
-
},
|
|
38
|
-
},
|
|
39
|
-
},
|
|
40
|
-
});
|
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
import { defineConfig, mergeConfig } from 'vitest/config';
|
|
2
|
-
import viteConfig from './vite.config';
|
|
3
|
-
|
|
4
|
-
export default mergeConfig(
|
|
5
|
-
viteConfig,
|
|
6
|
-
defineConfig({
|
|
7
|
-
test: {
|
|
8
|
-
globals: true,
|
|
9
|
-
environment: 'jsdom',
|
|
10
|
-
include: ['src/__tests__/unit/**/*.test.tsx'],
|
|
11
|
-
setupFiles: ['./vitest.setup.ts'],
|
|
12
|
-
coverage: {
|
|
13
|
-
provider: 'v8',
|
|
14
|
-
include: ['!src/main.tsx', 'src/**/*.tsx', 'src/**/*.ts'],
|
|
15
|
-
},
|
|
16
|
-
},
|
|
17
|
-
}),
|
|
18
|
-
);
|
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
import { cleanup } from '@testing-library/react';
|
|
2
|
-
import { mswServer } from '@/mocks/server';
|
|
3
|
-
import '@testing-library/jest-dom';
|
|
4
|
-
import '@/plugins/i18n';
|
|
5
|
-
|
|
6
|
-
beforeAll(() => mswServer.listen());
|
|
7
|
-
|
|
8
|
-
afterEach(() => {
|
|
9
|
-
cleanup();
|
|
10
|
-
mswServer.resetHandlers();
|
|
11
|
-
});
|
|
12
|
-
|
|
13
|
-
afterAll(() => mswServer.close());
|
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
# Click this link to view browser coverage https://browsersl.ist/#q=%3E+1.5%25%0Aios+%3E%3D+13%0Achrome+%3E%3D+60%0Anot+ie+%3C%3D+11%0Alast+2+versions%0Anot+dead
|
|
2
|
-
|
|
3
|
-
# Browsers that support
|
|
4
|
-
|
|
5
|
-
> 1.5%
|
|
6
|
-
ios >= 13
|
|
7
|
-
chrome >= 60
|
|
8
|
-
not ie <= 11
|
|
9
|
-
last 2 versions
|
|
10
|
-
not dead
|
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
name: Setup environment
|
|
2
|
-
|
|
3
|
-
description: Install dependencies
|
|
4
|
-
|
|
5
|
-
runs:
|
|
6
|
-
using: composite
|
|
7
|
-
steps:
|
|
8
|
-
- name: install pnpm
|
|
9
|
-
uses: pnpm/action-setup@v4
|
|
10
|
-
with:
|
|
11
|
-
run_install: false
|
|
12
|
-
|
|
13
|
-
- name: install Node.js
|
|
14
|
-
uses: actions/setup-node@v6
|
|
15
|
-
with:
|
|
16
|
-
node-version: 24.12.0
|
|
17
|
-
cache: pnpm
|
|
18
|
-
|
|
19
|
-
- name: install dependencies
|
|
20
|
-
shell: bash
|
|
21
|
-
run: pnpm install
|
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"$schema": "https://docs.renovatebot.com/renovate-schema.json",
|
|
3
|
-
"extends": ["config:recommended", "schedule:weekly", "group:allNonMajor"],
|
|
4
|
-
"labels": ["dependencies"],
|
|
5
|
-
"rangeStrategy": "bump",
|
|
6
|
-
"ignoreDeps": ["node"],
|
|
7
|
-
"packageRules": [
|
|
8
|
-
{
|
|
9
|
-
"matchDepTypes": ["peerDependencies"],
|
|
10
|
-
"enabled": false
|
|
11
|
-
}
|
|
12
|
-
],
|
|
13
|
-
"postUpdateOptions": ["pnpmDedupe"]
|
|
14
|
-
}
|
|
@@ -1,22 +0,0 @@
|
|
|
1
|
-
name: CI Pipeline
|
|
2
|
-
|
|
3
|
-
on:
|
|
4
|
-
workflow_call:
|
|
5
|
-
workflow_dispatch:
|
|
6
|
-
|
|
7
|
-
jobs:
|
|
8
|
-
CI:
|
|
9
|
-
runs-on: ubuntu-latest
|
|
10
|
-
steps:
|
|
11
|
-
- uses: actions/checkout@v6
|
|
12
|
-
- name: setup environment
|
|
13
|
-
uses: ./.github/actions/setup-environment
|
|
14
|
-
|
|
15
|
-
- name: install Playwright browsers
|
|
16
|
-
run: npx playwright install --with-deps
|
|
17
|
-
|
|
18
|
-
- name: run unit test
|
|
19
|
-
run: pnpm test:unit
|
|
20
|
-
|
|
21
|
-
- name: run e2e test
|
|
22
|
-
run: pnpm test:ci-e2e
|
|
@@ -1,27 +0,0 @@
|
|
|
1
|
-
name: Deploy to Production
|
|
2
|
-
|
|
3
|
-
on:
|
|
4
|
-
push:
|
|
5
|
-
branches: [main]
|
|
6
|
-
paths:
|
|
7
|
-
- 'src/**'
|
|
8
|
-
- pnpm-lock.yaml
|
|
9
|
-
- package.json
|
|
10
|
-
|
|
11
|
-
jobs:
|
|
12
|
-
CI:
|
|
13
|
-
uses: ./.github/workflows/ci.yml
|
|
14
|
-
|
|
15
|
-
deploy:
|
|
16
|
-
runs-on: ubuntu-latest
|
|
17
|
-
needs: CI
|
|
18
|
-
steps:
|
|
19
|
-
- uses: actions/checkout@v6
|
|
20
|
-
# - name: setup environment
|
|
21
|
-
# uses: './.github/actions/setup-environment'
|
|
22
|
-
|
|
23
|
-
# - name: build production
|
|
24
|
-
# run: pnpm build:production
|
|
25
|
-
|
|
26
|
-
# - name: deploy to production
|
|
27
|
-
# run: pnpm deploy
|
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
name: Preview Pull Request
|
|
2
|
-
|
|
3
|
-
on:
|
|
4
|
-
pull_request:
|
|
5
|
-
types: [opened, synchronize, reopened]
|
|
6
|
-
|
|
7
|
-
jobs:
|
|
8
|
-
CI:
|
|
9
|
-
uses: ./.github/workflows/ci.yml
|
|
10
|
-
|
|
11
|
-
preview:
|
|
12
|
-
runs-on: ubuntu-latest
|
|
13
|
-
needs: CI
|
|
14
|
-
steps:
|
|
15
|
-
- uses: actions/checkout@v6
|
|
16
|
-
# - name: setup environment
|
|
17
|
-
# uses: './.github/actions/setup-environment'
|
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
variables:
|
|
2
|
-
NODE_VERSION: '22'
|
|
3
|
-
CACHE_KEY: '${CI_PROJECT_PATH_SLUG}-${CI_COMMIT_REF_SLUG}'
|
|
4
|
-
|
|
5
|
-
image: node:${NODE_VERSION}-alpine
|
|
6
|
-
|
|
7
|
-
cache:
|
|
8
|
-
key: ${CACHE_KEY}
|
|
9
|
-
paths:
|
|
10
|
-
- .pnpm-store
|
|
11
|
-
- node_modules/
|
|
12
|
-
policy: pull-push
|
|
13
|
-
|
|
14
|
-
before_script:
|
|
15
|
-
- corepack enable
|
|
16
|
-
- corepack prepare --activate
|
|
17
|
-
- pnpm config set store-dir .pnpm-store
|
|
18
|
-
- pnpm install
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
npx --no -- commitlint --edit ${1}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
npx lint-staged
|
|
@@ -1,32 +0,0 @@
|
|
|
1
|
-
# Logs
|
|
2
|
-
logs
|
|
3
|
-
*.log
|
|
4
|
-
npm-debug.log*
|
|
5
|
-
yarn-debug.log*
|
|
6
|
-
yarn-error.log*
|
|
7
|
-
pnpm-debug.log*
|
|
8
|
-
lerna-debug.log*
|
|
9
|
-
|
|
10
|
-
node_modules
|
|
11
|
-
dist
|
|
12
|
-
dist-ssr
|
|
13
|
-
*.local
|
|
14
|
-
.env
|
|
15
|
-
|
|
16
|
-
# Editor directories and files
|
|
17
|
-
.idea
|
|
18
|
-
.DS_Store
|
|
19
|
-
*.suo
|
|
20
|
-
*.ntvs*
|
|
21
|
-
*.njsproj
|
|
22
|
-
*.sln
|
|
23
|
-
*.sw?
|
|
24
|
-
|
|
25
|
-
# Test reports
|
|
26
|
-
coverage
|
|
27
|
-
/test-results/
|
|
28
|
-
/playwright-report/
|
|
29
|
-
/playwright/.cache/
|
|
30
|
-
|
|
31
|
-
# Visualizer
|
|
32
|
-
stats.html
|
|
@@ -1,22 +0,0 @@
|
|
|
1
|
-
stages:
|
|
2
|
-
- test
|
|
3
|
-
# - deploy
|
|
4
|
-
|
|
5
|
-
include:
|
|
6
|
-
- local: .gitlab/setup.yml
|
|
7
|
-
|
|
8
|
-
run_test:
|
|
9
|
-
stage: test
|
|
10
|
-
image: mcr.microsoft.com/playwright:focal
|
|
11
|
-
script:
|
|
12
|
-
- npx playwright install --with-deps
|
|
13
|
-
- pnpm test:unit
|
|
14
|
-
- pnpm test:ci-e2e
|
|
15
|
-
rules:
|
|
16
|
-
- if: $CI_COMMIT_BRANCH
|
|
17
|
-
changes:
|
|
18
|
-
- 'src/**'
|
|
19
|
-
- pnpm-lock.yaml
|
|
20
|
-
- package.json
|
|
21
|
-
- if: '$CI_PIPELINE_SOURCE == "merge_request_event"'
|
|
22
|
-
- when: manual
|