@component-hook/create-app 1.4.4 → 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.
Files changed (106) hide show
  1. package/{template-shared/LICENSE → LICENSE} +1 -1
  2. package/README.md +1 -1
  3. package/dist/index.mjs +26 -23
  4. package/package.json +4 -4
  5. package/template-react/.vscode/extensions.json +0 -9
  6. package/template-react/.vscode/settings.json +0 -18
  7. package/template-react/README.md.art +0 -84
  8. package/template-react/eslint.config.js +0 -18
  9. package/template-react/index.html.art +0 -13
  10. package/template-react/lint-staged.config.js +0 -6
  11. package/template-react/package.json +0 -69
  12. package/template-react/public/vite.svg +0 -1
  13. package/template-react/src/App.tsx +0 -6
  14. package/template-react/src/__tests__/e2e/home.spec.ts +0 -40
  15. package/template-react/src/__tests__/unit/pages/home/components/HelloWorld.test.tsx +0 -45
  16. package/template-react/src/__tests__/unit/pages/home/index.test.tsx +0 -19
  17. package/template-react/src/__tests__/unit/render/index.tsx +0 -15
  18. package/template-react/src/assets/svg-icons/react.svg +0 -1
  19. package/template-react/src/components/common/index.ts +0 -1
  20. package/template-react/src/components/common/svg-icon/index.ts +0 -1
  21. package/template-react/src/components/common/svg-icon/src/index.tsx +0 -23
  22. package/template-react/src/main.tsx +0 -26
  23. package/template-react/src/mocks/browser.ts +0 -4
  24. package/template-react/src/mocks/handlers/index.ts +0 -1
  25. package/template-react/src/mocks/server.ts +0 -4
  26. package/template-react/src/pages/home/components/hello-world/index.tsx +0 -49
  27. package/template-react/src/pages/home/index.module.css +0 -8
  28. package/template-react/src/pages/home/index.tsx +0 -37
  29. package/template-react/src/plugins/i18n/index.ts +0 -15
  30. package/template-react/src/plugins/i18n/locales/en-US.json +0 -3
  31. package/template-react/src/plugins/i18n/locales/zh-TW.json +0 -3
  32. package/template-react/src/router/index.tsx +0 -22
  33. package/template-react/src/stores/constants.ts +0 -1
  34. package/template-react/src/stores/index.ts +0 -1
  35. package/template-react/src/stores/middleware.ts +0 -17
  36. package/template-react/src/stores/modules/config.ts +0 -27
  37. package/template-react/src/styles/base.css +0 -68
  38. package/template-react/src/styles/common/all.css +0 -1
  39. package/template-react/src/styles/common/button.css +0 -26
  40. package/template-react/src/styles/index.css +0 -3
  41. package/template-react/src/styles/tailwind.css +0 -14
  42. package/template-react/src/vite-env.d.ts +0 -9
  43. package/template-react/tsconfig.app.json +0 -32
  44. package/template-react/tsconfig.vitest.json +0 -10
  45. package/template-react/vite.config.ts +0 -40
  46. package/template-react/vitest.config.ts +0 -18
  47. package/template-react/vitest.setup.ts +0 -13
  48. package/template-shared/.browserslistrc +0 -10
  49. package/template-shared/.github/actions/setup-environment/action.yml +0 -21
  50. package/template-shared/.github/renovate.json +0 -14
  51. package/template-shared/.github/workflows/ci.yml +0 -22
  52. package/template-shared/.github/workflows/deploy.yml +0 -27
  53. package/template-shared/.github/workflows/preview.yml +0 -17
  54. package/template-shared/.gitlab/setup.yml +0 -18
  55. package/template-shared/.husky/commit-msg +0 -1
  56. package/template-shared/.husky/pre-commit +0 -1
  57. package/template-shared/_gitignore +0 -32
  58. package/template-shared/_gitlab-ci.yml +0 -22
  59. package/template-shared/commitlint.config.js +0 -3
  60. package/template-shared/playwright.config.ts +0 -49
  61. package/template-shared/postcss.config.js +0 -15
  62. package/template-shared/prettier.config.js +0 -13
  63. package/template-shared/scripts/build-info/index.ts +0 -21
  64. package/template-shared/tsconfig.json +0 -14
  65. package/template-shared/tsconfig.node.json +0 -12
  66. package/template-vue/.vscode/extensions.json +0 -10
  67. package/template-vue/.vscode/settings.json +0 -18
  68. package/template-vue/README.md.art +0 -80
  69. package/template-vue/eslint.config.js +0 -18
  70. package/template-vue/index.html.art +0 -28
  71. package/template-vue/lint-staged.config.js +0 -6
  72. package/template-vue/package.json +0 -68
  73. package/template-vue/public/vite.svg +0 -1
  74. package/template-vue/src/App.vue +0 -7
  75. package/template-vue/src/__tests__/e2e/home.spec.ts +0 -61
  76. package/template-vue/src/__tests__/unit/pages/home/components/HelloWorld.test.ts +0 -57
  77. package/template-vue/src/__tests__/unit/pages/home/index.test.ts +0 -17
  78. package/template-vue/src/__tests__/unit/render/index.ts +0 -28
  79. package/template-vue/src/assets/svg-icons/vue.svg +0 -1
  80. package/template-vue/src/components/common/index.ts +0 -1
  81. package/template-vue/src/components/common/svg-icon/index.ts +0 -1
  82. package/template-vue/src/components/common/svg-icon/src/index.vue +0 -29
  83. package/template-vue/src/locales/en-US.json +0 -3
  84. package/template-vue/src/locales/zh-TW.json +0 -3
  85. package/template-vue/src/main.ts +0 -21
  86. package/template-vue/src/mocks/browser.ts +0 -4
  87. package/template-vue/src/mocks/handlers/index.ts +0 -1
  88. package/template-vue/src/mocks/server.ts +0 -4
  89. package/template-vue/src/pages/home/components/HelloWorld.vue +0 -54
  90. package/template-vue/src/pages/home/index.vue +0 -46
  91. package/template-vue/src/plugins/i18n.ts +0 -11
  92. package/template-vue/src/router/index.ts +0 -23
  93. package/template-vue/src/stores/constants.ts.art +0 -1
  94. package/template-vue/src/stores/index.ts +0 -15
  95. package/template-vue/src/stores/modules/config.ts +0 -20
  96. package/template-vue/src/styles/base.css +0 -59
  97. package/template-vue/src/styles/common/all.css +0 -1
  98. package/template-vue/src/styles/common/button.css +0 -15
  99. package/template-vue/src/styles/index.css +0 -3
  100. package/template-vue/src/styles/tailwind.css +0 -1
  101. package/template-vue/src/vite-env.d.ts +0 -9
  102. package/template-vue/tsconfig.app.json +0 -12
  103. package/template-vue/tsconfig.vitest.json +0 -10
  104. package/template-vue/vite.config.ts +0 -46
  105. package/template-vue/vitest.config.ts +0 -18
  106. package/template-vue/vitest.setup.ts +0 -12
@@ -1,54 +0,0 @@
1
- <script setup lang="ts">
2
- import { ref } from 'vue';
3
- import { useI18n } from 'vue-i18n';
4
- import { useConfigStore } from '@/stores';
5
-
6
- defineProps<{ msg: string }>();
7
-
8
- const { locale } = useI18n();
9
- const { version } = useConfigStore();
10
- const count = ref(0);
11
-
12
- function changeLocale() {
13
- locale.value = locale.value === 'en-US' ? 'zh-TW' : 'en-US';
14
- }
15
- </script>
16
-
17
- <template>
18
- <h1>{{ msg }}</h1>
19
-
20
- <div class="p-8">
21
- <button @click="count++">count is {{ count }}</button>
22
- </div>
23
-
24
- <p>
25
- Check out
26
- <a
27
- href="https://vuejs.org/guide/quick-start.html#local"
28
- target="_blank"
29
- >create-vue</a
30
- >, the official Vue + Vite starter
31
- </p>
32
- <p>
33
- Install
34
- <a
35
- href="https://github.com/vuejs/language-tools"
36
- target="_blank"
37
- >Volar</a
38
- >
39
- in your IDE for a better DX
40
- </p>
41
- <p class="read-the-docs">Click on the Vite and Vue logos to learn more</p>
42
- <p class="read-the-docs">
43
- {{ version }}
44
- </p>
45
- <button @click="changeLocale">
46
- {{ $t('language') }}
47
- </button>
48
- </template>
49
-
50
- <style lang="css" scoped>
51
- .read-the-docs {
52
- color: #888;
53
- }
54
- </style>
@@ -1,46 +0,0 @@
1
- <script setup lang="ts">
2
- import { SvgIcon } from '@/components/common';
3
- import HelloWorld from './components/HelloWorld.vue';
4
- </script>
5
-
6
- <template>
7
- <div>
8
- <a
9
- href="https://vitejs.dev"
10
- target="_blank"
11
- >
12
- <img
13
- src="/vite.svg"
14
- class="logo"
15
- alt="Vite logo"
16
- />
17
- </a>
18
- <a
19
- href="https://vuejs.org/"
20
- target="_blank"
21
- aria-label="Vue link"
22
- >
23
- <svg-icon
24
- name="vue"
25
- class="logo hover:drop-shadow-[0_0_2em_#42b883aa]"
26
- />
27
- </a>
28
- </div>
29
-
30
- <hello-world msg="Vite + Vue" />
31
- </template>
32
-
33
- <style lang="css" scoped>
34
- .logo {
35
- width: 96px;
36
- height: 96px;
37
- margin: 0 auto;
38
- padding: 24px;
39
- will-change: filter;
40
- transition: filter 300ms;
41
-
42
- &:hover {
43
- filter: drop-shadow(0 0 2em #646cffaa);
44
- }
45
- }
46
- </style>
@@ -1,11 +0,0 @@
1
- import messages from '@intlify/unplugin-vue-i18n/messages';
2
- import { createI18n } from 'vue-i18n';
3
-
4
- const i18n = createI18n({
5
- legacy: import.meta.env.MODE === 'test',
6
- locale: navigator.language,
7
- fallbackLocale: 'en-US',
8
- messages,
9
- });
10
-
11
- export default i18n;
@@ -1,23 +0,0 @@
1
- import { createRouter, createWebHistory, type RouteRecordRaw } from 'vue-router';
2
- import HomePage from '@/pages/home/index.vue';
3
-
4
- export const routes: Array<RouteRecordRaw> = [
5
- {
6
- path: '/:catchAll(.*)',
7
- redirect: '/',
8
- },
9
- {
10
- path: '/',
11
- component: HomePage,
12
- meta: {
13
- title: 'Vue3 Coding Standards',
14
- },
15
- },
16
- ];
17
-
18
- const router = createRouter({
19
- history: createWebHistory(),
20
- routes,
21
- });
22
-
23
- export default router;
@@ -1 +0,0 @@
1
- export const STORAGE_PREFIX = '{{projectName}}';
@@ -1,15 +0,0 @@
1
- import { createPinia as create } from 'pinia';
2
- import { createPersistedState } from 'pinia-plugin-persistedstate';
3
- import { STORAGE_PREFIX } from './constants';
4
- export { useConfigStore } from './modules/config';
5
-
6
- export function createPinia() {
7
- const pinia = create();
8
- const persistedState = createPersistedState({
9
- key: storeKey => `${STORAGE_PREFIX}-${storeKey}`,
10
- });
11
-
12
- pinia.use(persistedState);
13
-
14
- return pinia;
15
- }
@@ -1,20 +0,0 @@
1
- import { defineStore } from 'pinia';
2
-
3
- const versionString = import.meta.env.DEV
4
- ? `${import.meta.env.VITE_APP_VERSION}-dev`
5
- : import.meta.env.VITE_APP_VERSION;
6
-
7
- const defaultState = {
8
- isDev: import.meta.env.DEV,
9
- version: versionString,
10
- };
11
-
12
- export const useConfigStore = defineStore('config', {
13
- state: () => defaultState,
14
- getters: {},
15
- actions: {},
16
- persist: {
17
- storage: localStorage,
18
- pick: [],
19
- },
20
- });
@@ -1,59 +0,0 @@
1
- :root {
2
- font-family: Inter, 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
- @media (prefers-color-scheme: light) {
23
- :root {
24
- background-color: #ffffff;
25
- color: #213547;
26
- }
27
- }
28
-
29
- body {
30
- margin: 0;
31
- display: flex;
32
- place-items: center;
33
- min-width: 320px;
34
- min-height: 100vh;
35
- }
36
-
37
- img {
38
- -webkit-touch-callout: none;
39
- -webkit-user-drag: none;
40
- user-select: none;
41
- }
42
-
43
- #app {
44
- max-width: 80rem;
45
- margin: auto;
46
- padding: 32px;
47
- text-align: center;
48
- }
49
-
50
- a {
51
- font-weight: 500;
52
- text-decoration-color: inherit;
53
- color: #646cff;
54
- transition: color 150ms;
55
-
56
- &:hover {
57
- color: #535bf2;
58
- }
59
- }
@@ -1 +0,0 @@
1
- @import './button.css';
@@ -1,15 +0,0 @@
1
- button {
2
- border-radius: 8px;
3
- padding: 8px;
4
- border-width: 1px;
5
- border-color: transparent;
6
- transition-property: border-color;
7
- transition-duration: 300ms;
8
- &:hover {
9
- border-color: #646cff;
10
- }
11
- &:focus {
12
- outline-width: 4px;
13
- outline-color: -webkit-focus-ring-color;
14
- }
15
- }
@@ -1,3 +0,0 @@
1
- @import './tailwind.css';
2
- @import './base.css';
3
- @import './common/all.css';
@@ -1 +0,0 @@
1
- @import 'tailwindcss';
@@ -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_BUILD_EPOCH?: string;
8
- readonly VITE_APP_MOCK?: string;
9
- }
@@ -1,12 +0,0 @@
1
- {
2
- "extends": "@vue/tsconfig/tsconfig.dom.json",
3
- "compilerOptions": {
4
- "composite": true,
5
- "tsBuildInfoFile": "./node_modules/.tmp/tsconfig.app.tsbuildinfo",
6
- "paths": {
7
- "@/*": ["./src/*"]
8
- }
9
- },
10
- "include": ["src/**/*.ts", "src/**/*.d.ts", "src/**/*.tsx", "src/**/*.vue"],
11
- "exclude": ["src/**/__tests__/*"]
12
- }
@@ -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", "src/**/*.vue", "vitest.setup.ts"],
9
- "exclude": []
10
- }
@@ -1,46 +0,0 @@
1
- import { dirname, resolve } from 'node:path';
2
- import { fileURLToPath, URL } from 'node:url';
3
- import vueI18nPlugin from '@intlify/unplugin-vue-i18n/vite';
4
- import tailwindcss from '@tailwindcss/vite';
5
- import vue from '@vitejs/plugin-vue';
6
- import { visualizer } from 'rollup-plugin-visualizer';
7
- import { defineConfig } from 'vite';
8
- import { createSvgIconsPlugin } from 'vite-plugin-svg-icons';
9
- import './scripts/build-info';
10
-
11
- export default defineConfig({
12
- base: './',
13
- plugins: [
14
- vue(),
15
- tailwindcss(),
16
- vueI18nPlugin({
17
- include: resolve(dirname(fileURLToPath(import.meta.url)), 'src/locales/**'),
18
- }),
19
- createSvgIconsPlugin({
20
- iconDirs: [resolve(process.cwd(), 'src/assets/svg-icons')],
21
- }),
22
- visualizer({ gzipSize: true }),
23
- ],
24
- esbuild: {
25
- pure: ['console.log'],
26
- drop: ['debugger'],
27
- },
28
- resolve: {
29
- alias: {
30
- '@': fileURLToPath(new URL('src', import.meta.url)),
31
- },
32
- },
33
- build: {
34
- rollupOptions: {
35
- output: {
36
- chunkFileNames: 'chunks/[name]-[hash].js',
37
- assetFileNames: 'assets/[name].[hash].[ext]',
38
- entryFileNames: 'entries/[name].[hash].js',
39
- manualChunks: {
40
- core: ['vue', 'vue-router', 'pinia', 'pinia-plugin-persistedstate', 'vue-i18n'],
41
- vender: ['axios', '@intlify/unplugin-vue-i18n/messages'],
42
- },
43
- },
44
- },
45
- },
46
- });
@@ -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.ts'],
11
- setupFiles: ['./vitest.setup.ts'],
12
- coverage: {
13
- provider: 'v8',
14
- include: ['!src/main.ts', 'src/**/*.ts', 'src/**/*.vue'],
15
- },
16
- },
17
- }),
18
- );
@@ -1,12 +0,0 @@
1
- import { cleanup } from '@testing-library/vue';
2
- import { mswServer } from '@/mocks/server';
3
- import '@testing-library/jest-dom';
4
-
5
- beforeAll(() => mswServer.listen());
6
-
7
- afterEach(() => {
8
- cleanup();
9
- mswServer.resetHandlers();
10
- });
11
-
12
- afterAll(() => mswServer.close());