@component-hook/create-app 0.2.4-alpha.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 (59) hide show
  1. package/bin/index.js +3 -0
  2. package/dist/index.mjs +105 -0
  3. package/package.json +46 -0
  4. package/template-vue/.github/actions/setup-environment/action.yml +45 -0
  5. package/template-vue/.github/renovate.json +12 -0
  6. package/template-vue/.github/workflows/ci.yml +22 -0
  7. package/template-vue/.github/workflows/deploy.yml +27 -0
  8. package/template-vue/.github/workflows/preview.yml +17 -0
  9. package/template-vue/.gitlab/setup.yml +18 -0
  10. package/template-vue/.husky/commit-msg +3 -0
  11. package/template-vue/.husky/pre-commit +3 -0
  12. package/template-vue/.vscode/extensions.json +10 -0
  13. package/template-vue/.vscode/settings.json +27 -0
  14. package/template-vue/LICENSE +21 -0
  15. package/template-vue/README.md.art +100 -0
  16. package/template-vue/_gitignore +38 -0
  17. package/template-vue/_gitlab-ci.yml +22 -0
  18. package/template-vue/commitlint.config.js +3 -0
  19. package/template-vue/eslint.config.js +18 -0
  20. package/template-vue/index.html.art +26 -0
  21. package/template-vue/lint-staged.config.js +4 -0
  22. package/template-vue/package.json +73 -0
  23. package/template-vue/playwright.config.ts +60 -0
  24. package/template-vue/postcss.config.js +14 -0
  25. package/template-vue/prettier.config.js +11 -0
  26. package/template-vue/public/mockServiceWorker.js +307 -0
  27. package/template-vue/public/vite.svg +1 -0
  28. package/template-vue/src/App.vue +7 -0
  29. package/template-vue/src/__tests__/e2e/IndexPage.spec.ts +49 -0
  30. package/template-vue/src/__tests__/setup/unit-test.ts +6 -0
  31. package/template-vue/src/__tests__/unit/components/indexPage/HelloWorld.test.ts +57 -0
  32. package/template-vue/src/__tests__/unit/render/index.ts +28 -0
  33. package/template-vue/src/assets/images/svgIcons/vue.svg +1 -0
  34. package/template-vue/src/components/common/SvgIcon.vue +29 -0
  35. package/template-vue/src/components/indexPage/HelloWorld.vue +59 -0
  36. package/template-vue/src/components.d.ts +14 -0
  37. package/template-vue/src/locales/en-US.json +3 -0
  38. package/template-vue/src/locales/zh-TW.json +3 -0
  39. package/template-vue/src/main.ts +25 -0
  40. package/template-vue/src/mocks/browser.ts +4 -0
  41. package/template-vue/src/mocks/handlers/index.ts +1 -0
  42. package/template-vue/src/mocks/server.ts +4 -0
  43. package/template-vue/src/pages/IndexPage.vue +34 -0
  44. package/template-vue/src/plugins/i18n.ts +15 -0
  45. package/template-vue/src/router/index.ts +23 -0
  46. package/template-vue/src/stores/index.ts +3 -0
  47. package/template-vue/src/stores/modules/config.ts +20 -0
  48. package/template-vue/src/styles/common/all.postcss +1 -0
  49. package/template-vue/src/styles/common/button.postcss +12 -0
  50. package/template-vue/src/styles/index.postcss +1 -0
  51. package/template-vue/src/styles/tailwind.postcss +39 -0
  52. package/template-vue/src/vite-env.d.ts +12 -0
  53. package/template-vue/tailwind.config.js +20 -0
  54. package/template-vue/tsconfig.app.json +13 -0
  55. package/template-vue/tsconfig.json +14 -0
  56. package/template-vue/tsconfig.node.json +12 -0
  57. package/template-vue/tsconfig.vitest.json +8 -0
  58. package/template-vue/vite.config.ts +49 -0
  59. package/template-vue/vitest.config.ts +21 -0
@@ -0,0 +1,23 @@
1
+ import { createRouter, createWebHistory, type RouteRecordRaw } from 'vue-router';
2
+ import IndexPage from '@/pages/IndexPage.vue';
3
+
4
+ export const routes: Array<RouteRecordRaw> = [
5
+ {
6
+ path: '/:catchAll(.*)',
7
+ redirect: '/',
8
+ },
9
+ {
10
+ path: '/',
11
+ component: IndexPage,
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;
@@ -0,0 +1,3 @@
1
+ import useConfigStore from '@/stores/modules/config';
2
+
3
+ export { useConfigStore };
@@ -0,0 +1,20 @@
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 default defineStore('coding-standards-config', {
13
+ state: () => defaultState,
14
+ getters: {},
15
+ actions: {},
16
+ persist: {
17
+ storage: localStorage,
18
+ pick: [],
19
+ },
20
+ });
@@ -0,0 +1 @@
1
+ @import './button.postcss';
@@ -0,0 +1,12 @@
1
+ button {
2
+ @apply
3
+ rounded-lg
4
+ p-2
5
+ border-[1px]
6
+ border-transparent
7
+ transition-[border-color]
8
+ duration-300
9
+ hover:border-[#646cff]
10
+ focus:outline-4
11
+ focus:outline-[-webkit-focus-ring-color];
12
+ }
@@ -0,0 +1 @@
1
+ @import './common/all.postcss';
@@ -0,0 +1,39 @@
1
+ @tailwind base;
2
+ @tailwind components;
3
+ @tailwind utilities;
4
+
5
+ @layer base {
6
+ :root {
7
+ font-family: Inter, system-ui, Avenir, Helvetica, Arial, sans-serif;
8
+ line-height: 1.5;
9
+ font-weight: 400;
10
+
11
+ color-scheme: light dark;
12
+ color: rgba(255, 255, 255, 0.87);
13
+ background-color: #242424;
14
+
15
+ font-synthesis: none;
16
+ text-rendering: optimizeLegibility;
17
+ -webkit-font-smoothing: antialiased;
18
+ -moz-osx-font-smoothing: grayscale;
19
+ -webkit-text-size-adjust: 100%;
20
+ }
21
+
22
+ body {
23
+ @apply m-0 flex place-items-center min-w-[320px] min-h-screen;
24
+ }
25
+
26
+ #app {
27
+ @apply max-w-7xl mx-auto p-8 text-center;
28
+ }
29
+
30
+ a {
31
+ @apply font-medium text-[#646cff] decoration-inherit hover:text-[#535bf2];
32
+ }
33
+
34
+ @media (prefers-color-scheme: light) {
35
+ :root {
36
+ @apply bg-white text-[#213547];
37
+ }
38
+ }
39
+ }
@@ -0,0 +1,12 @@
1
+ /// <reference types="vite/client" />
2
+
3
+ declare module '*.vue' {
4
+ import { DefineComponent } from 'vue';
5
+ const component: DefineComponent<any, {}, any>;
6
+ export default component;
7
+ }
8
+
9
+ interface ImportMetaEnv extends Readonly<Record<string, string>> {
10
+ readonly VITE_APP_VERSION: string;
11
+ readonly VITE_APP_BUILD_EPOCH?: string;
12
+ }
@@ -0,0 +1,20 @@
1
+ /** @type {import('tailwindcss').Config} */
2
+
3
+ export default {
4
+ content: ['./index.html', './src/**/*.{vue,js,ts,jsx,tsx}'],
5
+ theme: {
6
+ // fontFamily: {
7
+ // sans: ["Monda", "Noto Sans TC", "sans-serif"],
8
+ // },
9
+ extend: {
10
+ colors: {
11
+ primary: '',
12
+ secondary: '',
13
+ },
14
+ backgroundImage: {},
15
+ animation: {},
16
+ keyframes: {},
17
+ },
18
+ },
19
+ plugins: [],
20
+ };
@@ -0,0 +1,13 @@
1
+ {
2
+ "extends": "@vue/tsconfig/tsconfig.dom.json",
3
+ "include": ["src/**/*.ts", "src/**/*.d.ts", "src/**/*.tsx", "src/**/*.vue"],
4
+ "exclude": ["src/**/__tests__/*"],
5
+ "compilerOptions": {
6
+ "composite": true,
7
+ "noEmit": true,
8
+ "baseUrl": "./",
9
+ "paths": {
10
+ "@/*": ["src/*"]
11
+ }
12
+ }
13
+ }
@@ -0,0 +1,14 @@
1
+ {
2
+ "files": [],
3
+ "references": [
4
+ {
5
+ "path": "./tsconfig.node.json"
6
+ },
7
+ {
8
+ "path": "./tsconfig.app.json"
9
+ },
10
+ {
11
+ "path": "./tsconfig.vitest.json"
12
+ }
13
+ ]
14
+ }
@@ -0,0 +1,12 @@
1
+ {
2
+ "extends": "@tsconfig/node22/tsconfig.json",
3
+ "compilerOptions": {
4
+ "composite": true,
5
+ "skipLibCheck": true,
6
+ "module": "ESNext",
7
+ "moduleResolution": "bundler",
8
+ "resolveJsonModule": true,
9
+ "types": ["node"]
10
+ },
11
+ "include": ["vite.config.ts", "package.json", "vitest.config.ts", "playwright.config.ts"]
12
+ }
@@ -0,0 +1,8 @@
1
+ {
2
+ "extends": "./tsconfig.app.json",
3
+ "exclude": [],
4
+ "compilerOptions": {
5
+ "composite": true,
6
+ "types": ["node", "vitest/globals"]
7
+ }
8
+ }
@@ -0,0 +1,49 @@
1
+ import { fileURLToPath, URL } from 'node:url';
2
+ import { dirname, resolve } from 'node:path';
3
+ import { defineConfig } from 'vite';
4
+ import vue from '@vitejs/plugin-vue';
5
+ import Components from 'unplugin-vue-components/vite';
6
+ import vueI18nPlugin from '@intlify/unplugin-vue-i18n/vite';
7
+ import { createSvgIconsPlugin } from 'vite-plugin-svg-icons';
8
+ import { visualizer } from 'rollup-plugin-visualizer';
9
+ import packageJson from './package.json' with { type: 'json' };
10
+
11
+ process.env.VITE_APP_VERSION = packageJson.version;
12
+ process.env.NODE_ENV = process.env.MOCK ? 'mockServiceWorker' : process.env.NODE_ENV;
13
+ if (process.env.NODE_ENV === 'production') {
14
+ process.env.VITE_APP_BUILD_EPOCH = Date.now().toString();
15
+ }
16
+
17
+ export default defineConfig({
18
+ base: './',
19
+ plugins: [
20
+ vue(),
21
+ Components({
22
+ dirs: ['src/components/common'],
23
+ dts: 'src/components.d.ts',
24
+ }),
25
+ vueI18nPlugin({
26
+ include: resolve(dirname(fileURLToPath(import.meta.url)), 'src/locales/**'),
27
+ }),
28
+ createSvgIconsPlugin({
29
+ iconDirs: [resolve(process.cwd(), 'src/assets/images/svgIcons')],
30
+ }),
31
+ visualizer({ gzipSize: true }),
32
+ ],
33
+ esbuild: {
34
+ pure: ['console.log'],
35
+ drop: ['debugger'],
36
+ },
37
+ resolve: {
38
+ alias: {
39
+ '@': fileURLToPath(new URL('src', import.meta.url)),
40
+ },
41
+ },
42
+ build: {
43
+ rollupOptions: {
44
+ output: {
45
+ chunkFileNames: 'chunks/[name]-[hash].js',
46
+ },
47
+ },
48
+ },
49
+ });
@@ -0,0 +1,21 @@
1
+ /// <reference types="vitest" />
2
+ import { fileURLToPath, URL } from 'node:url';
3
+ import { mergeConfig, defineConfig } from 'vitest/config';
4
+ import viteConfig from './vite.config';
5
+
6
+ export default mergeConfig(
7
+ viteConfig,
8
+ defineConfig({
9
+ test: {
10
+ globals: true,
11
+ environment: 'jsdom',
12
+ include: ['src/__tests__/unit/**/*.test.ts'],
13
+ root: fileURLToPath(new URL('./', import.meta.url)),
14
+ setupFiles: ['src/__tests__/setup/unit-test.ts'],
15
+ coverage: {
16
+ provider: 'v8',
17
+ include: ['!src/main.ts', 'src/**/*.ts', 'src/**/*.vue'],
18
+ },
19
+ },
20
+ }),
21
+ );