create-packer 1.10.4 → 1.11.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 (107) hide show
  1. package/README.md +4 -9
  2. package/package.json +1 -1
  3. package/template/{react-vite → react}/.eslintrc +0 -0
  4. package/template/{react-vite → react}/.gitignore +0 -0
  5. package/template/{react-cra → react}/.husky/pre-commit +0 -0
  6. package/template/{react-cra → react}/.prettierignore +0 -0
  7. package/template/{react-vite → react}/.prettierrc +0 -0
  8. package/template/{react-vite → react}/.stylelintrc +0 -0
  9. package/template/{react-vite → react}/.vscode/extensions.json +0 -0
  10. package/template/react/README.md +13 -0
  11. package/template/{react-vite → react}/index.html +0 -0
  12. package/template/{react-vite → react}/jest.config.cjs +0 -0
  13. package/template/{react-vite → react}/jest.setup.ts +0 -0
  14. package/template/{react-vite → react}/package.json +4 -2
  15. package/template/{react-vite → react}/postcss.config.cjs +0 -0
  16. package/template/{react-vite → react}/public/vite.svg +0 -0
  17. package/template/react/src/app.store.ts +8 -0
  18. package/template/{react-vite → react}/src/assets/react.svg +0 -0
  19. package/template/{react-vite → react}/src/index.css +0 -0
  20. package/template/react/src/layout/index.ts +2 -0
  21. package/template/react/src/layout/layout.container.tsx +12 -0
  22. package/template/react/src/layout/layout.controller.ts +7 -0
  23. package/template/react/src/main.tsx +13 -0
  24. package/template/react/src/pages/cannotAccess/cannotAccess.container.tsx +3 -0
  25. package/template/react/src/pages/cannotAccess/index.ts +1 -0
  26. package/template/{react-vite/src/pages/Home/View.tsx → react/src/pages/home/home.container.tsx} +2 -4
  27. package/template/{react-cra/src/pages/home/Home.scss → react/src/pages/home/home.css} +0 -0
  28. package/template/{react-vite/src/pages/Home/Home.spec.tsx → react/src/pages/home/home.spec.tsx} +1 -2
  29. package/template/react/src/pages/home/index.ts +1 -0
  30. package/template/react/src/router/index.ts +2 -0
  31. package/template/react/src/router/paths.ts +3 -0
  32. package/template/react/src/router/router.container.tsx +6 -0
  33. package/template/react/src/router/routes.tsx +26 -0
  34. package/template/{react-vite → react}/src/vite-env.d.ts +0 -0
  35. package/template/{react-vite → react}/tailwind.config.cjs +0 -0
  36. package/template/{react-vite → react}/tsconfig.json +0 -0
  37. package/template/{react-vite → react}/tsconfig.node.json +0 -0
  38. package/template/{react-vite → react}/vite.config.ts +2 -1
  39. package/template/{vue-vite → vue}/.eslintrc +0 -0
  40. package/template/{vue-vite → vue}/.gitignore +0 -0
  41. package/template/{react-vite → vue}/.husky/pre-commit +0 -0
  42. package/template/{react-vite → vue}/.prettierignore +0 -0
  43. package/template/{vue-vite → vue}/.prettierrc +0 -0
  44. package/template/{vue-vite → vue}/.stylelintrc +0 -0
  45. package/template/{vue-vite → vue}/.vscode/extensions.json +0 -0
  46. package/template/vue/READEME.md +12 -0
  47. package/template/{vue-vite → vue}/README.md +0 -0
  48. package/template/{vue-vite → vue}/index.html +0 -0
  49. package/template/{vue-vite → vue}/package.json +2 -1
  50. package/template/{vue-vite → vue}/postcss.config.cjs +0 -0
  51. package/template/{vue-vite → vue}/public/vite.svg +0 -0
  52. package/template/vue/src/app/app.container.vue +10 -0
  53. package/template/vue/src/app/app.controller.ts +7 -0
  54. package/template/vue/src/app/app.store.ts +14 -0
  55. package/template/vue/src/app/index.ts +5 -0
  56. package/template/{vue-vite → vue}/src/assets/vue.svg +0 -0
  57. package/template/{vue-vite → vue}/src/main.ts +1 -1
  58. package/template/vue/src/pages/cannotAccess/cannotAccess.container.vue +3 -0
  59. package/template/vue/src/pages/cannotAccess/index.ts +1 -0
  60. package/template/{vue-vite/src/pages/Home/View.vue → vue/src/pages/home/home.container.vue} +0 -0
  61. package/template/vue/src/pages/home/index.ts +1 -0
  62. package/template/vue/src/routes/index.ts +21 -0
  63. package/template/vue/src/routes/names.ts +4 -0
  64. package/template/{vue-vite → vue}/src/style.css +0 -0
  65. package/template/{vue-vite → vue}/src/vite-env.d.ts +0 -0
  66. package/template/{vue-vite → vue}/tailwind.config.cjs +1 -1
  67. package/template/{vue-vite → vue}/tsconfig.json +0 -0
  68. package/template/{vue-vite → vue}/tsconfig.node.json +0 -0
  69. package/template/{vue-vite → vue}/vite.config.ts +2 -1
  70. package/template/react-cra/.env +0 -1
  71. package/template/react-cra/.gitignore +0 -30
  72. package/template/react-cra/.prettierrc.js +0 -20
  73. package/template/react-cra/.stylelintrc.js +0 -21
  74. package/template/react-cra/README.md +0 -9
  75. package/template/react-cra/craco.config.js +0 -14
  76. package/template/react-cra/package.json +0 -61
  77. package/template/react-cra/public/favicon.ico +0 -0
  78. package/template/react-cra/public/index.html +0 -41
  79. package/template/react-cra/public/manifest.json +0 -15
  80. package/template/react-cra/src/Layout/index.tsx +0 -8
  81. package/template/react-cra/src/Layout/typings.ts +0 -1
  82. package/template/react-cra/src/index.scss +0 -5
  83. package/template/react-cra/src/index.tsx +0 -24
  84. package/template/react-cra/src/logo.svg +0 -7
  85. package/template/react-cra/src/pages/home/index.test.tsx +0 -9
  86. package/template/react-cra/src/pages/home/index.tsx +0 -10
  87. package/template/react-cra/src/react-app-env.d.ts +0 -1
  88. package/template/react-cra/src/reportWebVitals.ts +0 -15
  89. package/template/react-cra/src/routes/index.ts +0 -15
  90. package/template/react-cra/src/setupTests.ts +0 -5
  91. package/template/react-cra/tsconfig.json +0 -21
  92. package/template/react-vite/src/Layout/View.tsx +0 -8
  93. package/template/react-vite/src/Layout/index.ts +0 -2
  94. package/template/react-vite/src/Layout/typings.ts +0 -1
  95. package/template/react-vite/src/main.tsx +0 -20
  96. package/template/react-vite/src/pages/Home/Home.css +0 -0
  97. package/template/react-vite/src/pages/Home/index.ts +0 -1
  98. package/template/react-vite/src/routes/index.ts +0 -16
  99. package/template/vue-vite/.husky/pre-commit +0 -4
  100. package/template/vue-vite/.prettierignore +0 -4
  101. package/template/vue-vite/src/App/View.vue +0 -7
  102. package/template/vue-vite/src/App/controllers/index.ts +0 -1
  103. package/template/vue-vite/src/App/controllers/useApp.ts +0 -9
  104. package/template/vue-vite/src/App/index.ts +0 -2
  105. package/template/vue-vite/src/appInstance.ts +0 -4
  106. package/template/vue-vite/src/pages/Home/index.ts +0 -1
  107. package/template/vue-vite/src/routes/index.ts +0 -9
package/README.md CHANGED
@@ -11,12 +11,7 @@ yarn create packer <dirname> -c
11
11
 
12
12
  ## TempInfo
13
13
 
14
- - doc-docusaurus: Based on [Docusaurus 2](https://v2.docusaurus.io/).
15
- - electron: Based on [electron](https://electronjs.org).
16
- - rc-recoil: Based on [create-react-app(4.x)](https://create-react-app.dev/). Use [recoil](https://recoiljs.org/) as state container.
17
- - rc-redux: Based on [create-react-app(4.x)](https://create-react-app.dev/). Use [redux-toolkit](https://redux-toolkit.js.org/) as state container.
18
- - vue-2.x: Based on vue-cli(vue2.x).
19
- - node-base: Based on node.
20
- - node-nest: Based on [nestjs](https://docs.nestjs.com/).
21
- - webpack: Based on [webpack(5.x)](https://webpack.js.org/).
22
- - lib-rollup: Quick create lib template. Based on [Rollup](https://github.com/rollup/rollup)
14
+ - docusaurus: Based on [Docusaurus 2](https://v2.docusaurus.io/).
15
+ - nest: Based on [nestjs](https://docs.nestjs.com/).
16
+ - vue: Based on [vite(3.x)](https://cn.vitejs.dev/), [vue3](https://vuejs.org/).
17
+ - react: Based on [vite(3.x)](https://cn.vitejs.dev/), [react18](https://reactjs.org/).
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "create-packer",
3
- "version": "1.10.4",
3
+ "version": "1.11.0",
4
4
  "main": "index.js",
5
5
  "repository": "https://github.com/kevily/create-packer",
6
6
  "author": "1k <bug_zero@163.com>",
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
@@ -0,0 +1,13 @@
1
+ ## Vite + react18 + Typescript
2
+
3
+ ### Features
4
+ - Vite 3.x
5
+ - React 18.x
6
+ - Typescript 4.x
7
+ - react-router 6.x
8
+ - Zustand 4.x
9
+ - Tailwindcss 3.x
10
+ - Jest 28.x
11
+ - Eslint
12
+ - Prettier
13
+ - Alias @ to <project_root>/src
File without changes
File without changes
File without changes
@@ -22,7 +22,8 @@
22
22
  "dependencies": {
23
23
  "react": "18.2.0",
24
24
  "react-dom": "18.2.0",
25
- "react-router-dom": "6.3.0"
25
+ "react-router-dom": "6.3.0",
26
+ "zustand": "4.0.0"
26
27
  },
27
28
  "devDependencies": {
28
29
  "@testing-library/dom": "8.14.0",
@@ -55,7 +56,8 @@
55
56
  "stylelint-config-standard": "26.0.0",
56
57
  "tailwindcss": "3.1.8",
57
58
  "typescript": "4.7.4",
58
- "vite": "3.0.4"
59
+ "vite": "3.0.9",
60
+ "vite-plugin-eslint": "1.8.1"
59
61
  },
60
62
  "config": {
61
63
  "commitizen": {
File without changes
@@ -0,0 +1,8 @@
1
+ import create from 'zustand'
2
+ import { combine } from 'zustand/middleware'
3
+
4
+ export const useApp = create(
5
+ combine({}, setState => {
6
+ return {}
7
+ })
8
+ )
File without changes
@@ -0,0 +1,2 @@
1
+ export { default } from './layout.container'
2
+ export * from './layout.controller'
@@ -0,0 +1,12 @@
1
+ import React from 'react'
2
+ import { useInit } from './layout.controller'
3
+ import { Outlet } from 'react-router-dom'
4
+
5
+ export default function Layout() {
6
+ useInit()
7
+ return (
8
+ <div>
9
+ <Outlet />
10
+ </div>
11
+ )
12
+ }
@@ -0,0 +1,7 @@
1
+ import { useEffect } from 'react'
2
+
3
+ export function useInit() {
4
+ useEffect(() => {
5
+ console.log('init')
6
+ }, [])
7
+ }
@@ -0,0 +1,13 @@
1
+ import React from 'react'
2
+ import ReactDOM from 'react-dom/client'
3
+ import { BrowserRouter } from 'react-router-dom'
4
+ import Route from '@/router'
5
+ import './index.css'
6
+
7
+ ReactDOM.createRoot(document.getElementById('root') as HTMLElement).render(
8
+ <React.StrictMode>
9
+ <BrowserRouter>
10
+ <Route />
11
+ </BrowserRouter>
12
+ </React.StrictMode>
13
+ )
@@ -0,0 +1,3 @@
1
+ export default function CannotAccess() {
2
+ return <div>404</div>
3
+ }
@@ -0,0 +1 @@
1
+ export { default } from './cannotAccess.container'
@@ -1,7 +1,5 @@
1
- import './Home.css'
1
+ import './home.css'
2
2
 
3
- function Home() {
3
+ export default function Home() {
4
4
  return <div className={'flex justify-center items-center'}>sdfs</div>
5
5
  }
6
-
7
- export default Home
@@ -1,6 +1,5 @@
1
1
  import { render, screen } from '@testing-library/react'
2
-
3
- import Home from './index'
2
+ import Home from './home.container'
4
3
 
5
4
  describe('HelloWorld', () => {
6
5
  it('should renders a msg', () => {
@@ -0,0 +1 @@
1
+ export { default } from './home.container'
@@ -0,0 +1,2 @@
1
+ export { default } from './router.container'
2
+ export { default as routePaths } from './paths'
@@ -0,0 +1,3 @@
1
+ export default {
2
+ root: '/'
3
+ }
@@ -0,0 +1,6 @@
1
+ import { useRoutes } from 'react-router-dom'
2
+ import routes from './routes'
3
+
4
+ export default function Route() {
5
+ return useRoutes(routes)
6
+ }
@@ -0,0 +1,26 @@
1
+ import { lazy } from 'react'
2
+ import { RouteObject } from 'react-router-dom'
3
+ import paths from './paths'
4
+ import Layout from '@/layout'
5
+ import Home from '@/pages/home'
6
+
7
+ const CannotAccess = lazy(() => import('@/pages/cannotAccess'))
8
+
9
+ const routes: RouteObject[] = [
10
+ {
11
+ path: paths.root,
12
+ element: <Layout />,
13
+ children: [
14
+ {
15
+ index: true,
16
+ element: <Home />
17
+ }
18
+ ]
19
+ },
20
+ {
21
+ path: '*',
22
+ element: <CannotAccess />
23
+ }
24
+ ]
25
+
26
+ export default routes
File without changes
File without changes
@@ -1,10 +1,11 @@
1
1
  import { defineConfig } from 'vite'
2
2
  import react from '@vitejs/plugin-react'
3
+ import eslint from 'vite-plugin-eslint'
3
4
  import path from 'path'
4
5
 
5
6
  // https://vitejs.dev/config/
6
7
  export default defineConfig({
7
- plugins: [react()],
8
+ plugins: [eslint(), react()],
8
9
  resolve: {
9
10
  alias: {
10
11
  '@': path.join(__dirname, 'src')
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
@@ -0,0 +1,12 @@
1
+ ## Vite + Vue3.x + Typescript
2
+
3
+ ### Features
4
+ - Vite 3.x
5
+ - Vue 3.x
6
+ - Typescript 4.x
7
+ - vue-router 4.x
8
+ - pinia 2.x
9
+ - Tailwindcss 3.x
10
+ - Eslint
11
+ - Prettier
12
+ - Alias @ to <project_root>/src
File without changes
File without changes
@@ -17,6 +17,7 @@
17
17
  },
18
18
  "dependencies": {
19
19
  "pinia": "2.0.18",
20
+ "vite-plugin-eslint": "1.8.1",
20
21
  "vue": "3.2.37",
21
22
  "vue-router": "4.1.3"
22
23
  },
@@ -40,7 +41,7 @@
40
41
  "stylelint-config-standard": "26.0.0",
41
42
  "tailwindcss": "3.1.8",
42
43
  "typescript": "4.6.4",
43
- "vite": "3.0.7",
44
+ "vite": "3.0.9",
44
45
  "vue-tsc": "0.39.5"
45
46
  },
46
47
  "config": {
File without changes
File without changes
@@ -0,0 +1,10 @@
1
+ <template>
2
+ <router-view />
3
+ </template>
4
+
5
+ <script setup lang="ts">
6
+ import { useInit } from './app.controller'
7
+ useInit()
8
+ </script>
9
+
10
+ <style scoped></style>
@@ -0,0 +1,7 @@
1
+ import { onMounted } from 'vue'
2
+
3
+ export function useInit() {
4
+ onMounted(() => {
5
+ console.log('init')
6
+ })
7
+ }
@@ -0,0 +1,14 @@
1
+ import { defineStore } from 'pinia'
2
+
3
+ export default defineStore('app', {
4
+ state: () => {
5
+ return {
6
+ appName: ''
7
+ }
8
+ },
9
+ actions: {
10
+ setAppName(appName: string) {
11
+ this.appName = appName
12
+ }
13
+ }
14
+ })
@@ -0,0 +1,5 @@
1
+ import { createApp } from 'vue'
2
+ import App from './app.container.vue'
3
+
4
+ export * from './app.controller'
5
+ export default createApp(App)
File without changes
@@ -1,4 +1,4 @@
1
- import app from './appInstance'
1
+ import app from './app'
2
2
  import { createPinia } from 'pinia'
3
3
  import router from '@/routes'
4
4
  import './style.css'
@@ -0,0 +1,3 @@
1
+ <template>
2
+ <div>404</div>
3
+ </template>
@@ -0,0 +1 @@
1
+ export { default } from './cannotAccess.container.vue'
@@ -0,0 +1 @@
1
+ export { default } from './home.container.vue'
@@ -0,0 +1,21 @@
1
+ import { createRouter, createWebHashHistory, RouteRecordRaw } from 'vue-router'
2
+ import names from './names'
3
+ import Home from '@/pages/Home'
4
+
5
+ const routes: (RouteRecordRaw & { name: string })[] = [
6
+ { path: '/', name: names.home, component: Home },
7
+ { path: '/404', name: names.cannotAccess, component: () => import('@/pages/cannotAccess') }
8
+ ]
9
+ const router = createRouter({
10
+ history: createWebHashHistory(),
11
+ routes
12
+ })
13
+ router.beforeEach(async to => {
14
+ if (!Object.values(names).includes(to.name! as string)) {
15
+ return {
16
+ replace: true,
17
+ name: names.cannotAccess
18
+ }
19
+ }
20
+ })
21
+ export default router
@@ -0,0 +1,4 @@
1
+ export default {
2
+ home: 'home',
3
+ cannotAccess: '404'
4
+ }
File without changes
File without changes
@@ -1,6 +1,6 @@
1
1
  /** @type {import('tailwindcss').Config} */
2
2
  module.exports = {
3
- content: ['./index.html', './src/**/*.{ts,tsx}'],
3
+ content: ['./index.html', './src/**/*.{vue,ts,tsx}'],
4
4
  theme: {
5
5
  extend: {}
6
6
  },
File without changes
File without changes
@@ -1,10 +1,11 @@
1
1
  import { defineConfig } from 'vite'
2
2
  import vue from '@vitejs/plugin-vue'
3
+ import eslint from 'vite-plugin-eslint'
3
4
  import path from 'path'
4
5
 
5
6
  // https://vitejs.dev/config/
6
7
  export default defineConfig({
7
- plugins: [vue()],
8
+ plugins: [eslint(), vue()],
8
9
  resolve: {
9
10
  alias: {
10
11
  '@': path.join(__dirname, 'src')
@@ -1 +0,0 @@
1
- BROWSER=none
@@ -1,30 +0,0 @@
1
- # See https://help.github.com/articles/ignoring-files/ for more about ignoring files.
2
-
3
- # dependencies
4
- node_modules/
5
- /.pnp
6
- .pnp.js
7
-
8
- # testing
9
- coverage/
10
-
11
- # production
12
- build/
13
- dist/
14
- .vscode
15
- .idea
16
- .history
17
- lib/
18
- es/
19
- types/
20
-
21
- # misc
22
- .DS_Store
23
- .env.local
24
- .env.development.local
25
- .env.test.local
26
- .env.production.local
27
-
28
- npm-debug.log*
29
- yarn-debug.log*
30
- yarn-error.log*
@@ -1,20 +0,0 @@
1
- // 配置文档: https://prettier.io/docs/en/options.html
2
- // ----------------------------------------------------------------------
3
- module.exports = {
4
- overrides: [
5
- {
6
- files: '.prettierrc',
7
- options: { parser: 'json' }
8
- }
9
- ],
10
- printWidth: 100,
11
- tabWidth: 4,
12
- useTabs: false,
13
- semi: false,
14
- singleQuote: true,
15
- trailingComma: 'none',
16
- bracketSpacing: true,
17
- jsxBracketSameLine: true,
18
- arrowParens: 'avoid',
19
- rangeStart: 0
20
- }
@@ -1,21 +0,0 @@
1
- module.exports = {
2
- extends: 'stylelint-config-standard',
3
- rules: {
4
- indentation: 4,
5
- 'comment-empty-line-before': 'never',
6
- 'no-empty-source': null,
7
- 'no-descending-specificity': null,
8
- 'at-rule-no-unknown': [
9
- true,
10
- {
11
- ignoreAtRules: ['function', 'if', 'each', 'include', 'mixin', 'extend']
12
- }
13
- ],
14
- 'selector-pseudo-class-no-unknown': [
15
- true,
16
- {
17
- ignorePseudoClasses: ['global']
18
- }
19
- ]
20
- }
21
- }
@@ -1,9 +0,0 @@
1
- # rc-template
2
-
3
- > 基于 create-react-app 搭建的模版
4
-
5
- ## 扩展插件
6
-
7
- - recoil
8
- - react-router
9
- - react-router-config
@@ -1,14 +0,0 @@
1
- const { BundleAnalyzerPlugin } = require('webpack-bundle-analyzer')
2
-
3
- const webpackPlugins = []
4
-
5
- if (process.argv[2] === '--analyze') {
6
- webpackPlugins.push(new BundleAnalyzerPlugin())
7
- }
8
-
9
- module.exports = {
10
- webpack: {
11
- alias: {},
12
- plugins: webpackPlugins
13
- }
14
- }
@@ -1,61 +0,0 @@
1
- {
2
- "name": "react-cra",
3
- "version": "0.1.0",
4
- "private": true,
5
- "dependencies": {
6
- "@craco/craco": "6.4.3",
7
- "@testing-library/jest-dom": "5.16.4",
8
- "@testing-library/react": "13.3.0",
9
- "@testing-library/user-event": "14.2.1",
10
- "@types/jest": "27",
11
- "@types/node": "18.0.0",
12
- "@types/react": "18.0.14",
13
- "@types/react-dom": "18.0.5",
14
- "@types/testing-library__jest-dom": "5.14.5",
15
- "react": "18.2.0",
16
- "react-dom": "18.2.0",
17
- "react-router-dom": "6.3.0",
18
- "react-scripts": "5.0.1",
19
- "sass": "1.53.0",
20
- "typescript": "4.7.4",
21
- "web-vitals": "2.1.4"
22
- },
23
- "scripts": {
24
- "prepare": "husky install",
25
- "start": "craco start",
26
- "build": "craco build",
27
- "analyze": "craco build --analyze",
28
- "test": "craco test",
29
- "eject": "react-scripts eject",
30
- "format": "prettier --write \"src/**/*.{ts,js,tsx,jsx,css,scss,less}\" \"./package.json\"",
31
- "lint": "eslint ./src/**/*.{tsx,ts} && stylelint ./src/**/*.{css,scss,less}",
32
- "lint:fix": "eslint ./src/**/*.{tsx,ts} --fix && stylelint ./src/**/*.{css,scss,less} --fix"
33
- },
34
- "eslintConfig": {
35
- "extends": [
36
- "react-app",
37
- "react-app/jest"
38
- ]
39
- },
40
- "browserslist": {
41
- "production": [
42
- ">0.2%",
43
- "not dead",
44
- "not op_mini all"
45
- ],
46
- "development": [
47
- "last 1 chrome version",
48
- "last 1 firefox version",
49
- "last 1 safari version"
50
- ]
51
- },
52
- "devDependencies": {
53
- "@testing-library/dom": "8.14.0",
54
- "@types/recoil": "0.0.9",
55
- "husky": "8.0.1",
56
- "prettier": "2.7.1",
57
- "stylelint": "14.9.1",
58
- "stylelint-config-standard": "26.0.0",
59
- "webpack-bundle-analyzer": "4.5.0"
60
- }
61
- }
@@ -1,41 +0,0 @@
1
- <!DOCTYPE html>
2
- <html lang="en">
3
- <head>
4
- <meta charset="utf-8" />
5
- <link rel="shortcut icon" href="%PUBLIC_URL%/favicon.ico" />
6
- <meta
7
- name="viewport"
8
- content="width=device-width, initial-scale=1, shrink-to-fit=no"
9
- />
10
- <meta name="theme-color" content="#000000" />
11
- <!--
12
- manifest.json provides metadata used when your web app is installed on a
13
- user's mobile device or desktop. See https://developers.google.com/web/fundamentals/web-app-manifest/
14
- -->
15
- <link rel="manifest" href="%PUBLIC_URL%/manifest.json" />
16
- <!--
17
- Notice the use of %PUBLIC_URL% in the tags above.
18
- It will be replaced with the URL of the `public` folder during the build.
19
- Only files inside the `public` folder can be referenced from the HTML.
20
-
21
- Unlike "/favicon.ico" or "favicon.ico", "%PUBLIC_URL%/favicon.ico" will
22
- work correctly both with client-side routing and a non-root public URL.
23
- Learn how to configure a non-root public URL by running `npm run build`.
24
- -->
25
- <title>React App</title>
26
- </head>
27
- <body>
28
- <noscript>You need to enable JavaScript to run this app.</noscript>
29
- <div id="root"></div>
30
- <!--
31
- This HTML file is a template.
32
- If you open it directly in the browser, you will see an empty page.
33
-
34
- You can add webfonts, meta tags, or analytics to this file.
35
- The build step will place the bundled scripts into the <body> tag.
36
-
37
- To begin the development, run `npm start` or `yarn start`.
38
- To create a production bundle, use `npm run build` or `yarn build`.
39
- -->
40
- </body>
41
- </html>
@@ -1,15 +0,0 @@
1
- {
2
- "short_name": "React App",
3
- "name": "Create React App Sample",
4
- "icons": [
5
- {
6
- "src": "favicon.ico",
7
- "sizes": "64x64 32x32 24x24 16x16",
8
- "type": "image/x-icon"
9
- }
10
- ],
11
- "start_url": ".",
12
- "display": "standalone",
13
- "theme_color": "#000000",
14
- "background_color": "#ffffff"
15
- }
@@ -1,8 +0,0 @@
1
- import React, { PropsWithChildren } from 'react'
2
- import { LayoutPropsType } from './typings'
3
-
4
- function Layout({ children }: PropsWithChildren<LayoutPropsType>) {
5
- return <div>{children}</div>
6
- }
7
-
8
- export default Layout
@@ -1 +0,0 @@
1
- export interface LayoutPropsType {}
@@ -1,5 +0,0 @@
1
- body {
2
- margin: 0;
3
- padding: 0;
4
- background-color: #fff;
5
- }
@@ -1,24 +0,0 @@
1
- import React from 'react'
2
- import ReactDOM from 'react-dom/client'
3
- import { BrowserRouter, Routes, Route } from 'react-router-dom'
4
- import Layout from './Layout'
5
- import routes from './routes'
6
- import './index.scss'
7
- import reportWebVitals from './reportWebVitals'
8
-
9
- const root = ReactDOM.createRoot(document.getElementById('root') as HTMLElement)
10
- root.render(
11
- <React.StrictMode>
12
- <BrowserRouter>
13
- <Layout>
14
- <Routes>
15
- {routes.map(({ path, Component }) => {
16
- return <Route key={path} path={path} element={<Component />} />
17
- })}
18
- </Routes>
19
- </Layout>
20
- </BrowserRouter>
21
- </React.StrictMode>
22
- )
23
-
24
- reportWebVitals()
@@ -1,7 +0,0 @@
1
- <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 841.9 595.3">
2
- <g fill="#61DAFB">
3
- <path d="M666.3 296.5c0-32.5-40.7-63.3-103.1-82.4 14.4-63.6 8-114.2-20.2-130.4-6.5-3.8-14.1-5.6-22.4-5.6v22.3c4.6 0 8.3.9 11.4 2.6 13.6 7.8 19.5 37.5 14.9 75.7-1.1 9.4-2.9 19.3-5.1 29.4-19.6-4.8-41-8.5-63.5-10.9-13.5-18.5-27.5-35.3-41.6-50 32.6-30.3 63.2-46.9 84-46.9V78c-27.5 0-63.5 19.6-99.9 53.6-36.4-33.8-72.4-53.2-99.9-53.2v22.3c20.7 0 51.4 16.5 84 46.6-14 14.7-28 31.4-41.3 49.9-22.6 2.4-44 6.1-63.6 11-2.3-10-4-19.7-5.2-29-4.7-38.2 1.1-67.9 14.6-75.8 3-1.8 6.9-2.6 11.5-2.6V78.5c-8.4 0-16 1.8-22.6 5.6-28.1 16.2-34.4 66.7-19.9 130.1-62.2 19.2-102.7 49.9-102.7 82.3 0 32.5 40.7 63.3 103.1 82.4-14.4 63.6-8 114.2 20.2 130.4 6.5 3.8 14.1 5.6 22.5 5.6 27.5 0 63.5-19.6 99.9-53.6 36.4 33.8 72.4 53.2 99.9 53.2 8.4 0 16-1.8 22.6-5.6 28.1-16.2 34.4-66.7 19.9-130.1 62-19.1 102.5-49.9 102.5-82.3zm-130.2-66.7c-3.7 12.9-8.3 26.2-13.5 39.5-4.1-8-8.4-16-13.1-24-4.6-8-9.5-15.8-14.4-23.4 14.2 2.1 27.9 4.7 41 7.9zm-45.8 106.5c-7.8 13.5-15.8 26.3-24.1 38.2-14.9 1.3-30 2-45.2 2-15.1 0-30.2-.7-45-1.9-8.3-11.9-16.4-24.6-24.2-38-7.6-13.1-14.5-26.4-20.8-39.8 6.2-13.4 13.2-26.8 20.7-39.9 7.8-13.5 15.8-26.3 24.1-38.2 14.9-1.3 30-2 45.2-2 15.1 0 30.2.7 45 1.9 8.3 11.9 16.4 24.6 24.2 38 7.6 13.1 14.5 26.4 20.8 39.8-6.3 13.4-13.2 26.8-20.7 39.9zm32.3-13c5.4 13.4 10 26.8 13.8 39.8-13.1 3.2-26.9 5.9-41.2 8 4.9-7.7 9.8-15.6 14.4-23.7 4.6-8 8.9-16.1 13-24.1zM421.2 430c-9.3-9.6-18.6-20.3-27.8-32 9 .4 18.2.7 27.5.7 9.4 0 18.7-.2 27.8-.7-9 11.7-18.3 22.4-27.5 32zm-74.4-58.9c-14.2-2.1-27.9-4.7-41-7.9 3.7-12.9 8.3-26.2 13.5-39.5 4.1 8 8.4 16 13.1 24 4.7 8 9.5 15.8 14.4 23.4zM420.7 163c9.3 9.6 18.6 20.3 27.8 32-9-.4-18.2-.7-27.5-.7-9.4 0-18.7.2-27.8.7 9-11.7 18.3-22.4 27.5-32zm-74 58.9c-4.9 7.7-9.8 15.6-14.4 23.7-4.6 8-8.9 16-13 24-5.4-13.4-10-26.8-13.8-39.8 13.1-3.1 26.9-5.8 41.2-7.9zm-90.5 125.2c-35.4-15.1-58.3-34.9-58.3-50.6 0-15.7 22.9-35.6 58.3-50.6 8.6-3.7 18-7 27.7-10.1 5.7 19.6 13.2 40 22.5 60.9-9.2 20.8-16.6 41.1-22.2 60.6-9.9-3.1-19.3-6.5-28-10.2zM310 490c-13.6-7.8-19.5-37.5-14.9-75.7 1.1-9.4 2.9-19.3 5.1-29.4 19.6 4.8 41 8.5 63.5 10.9 13.5 18.5 27.5 35.3 41.6 50-32.6 30.3-63.2 46.9-84 46.9-4.5-.1-8.3-1-11.3-2.7zm237.2-76.2c4.7 38.2-1.1 67.9-14.6 75.8-3 1.8-6.9 2.6-11.5 2.6-20.7 0-51.4-16.5-84-46.6 14-14.7 28-31.4 41.3-49.9 22.6-2.4 44-6.1 63.6-11 2.3 10.1 4.1 19.8 5.2 29.1zm38.5-66.7c-8.6 3.7-18 7-27.7 10.1-5.7-19.6-13.2-40-22.5-60.9 9.2-20.8 16.6-41.1 22.2-60.6 9.9 3.1 19.3 6.5 28.1 10.2 35.4 15.1 58.3 34.9 58.3 50.6-.1 15.7-23 35.6-58.4 50.6zM320.8 78.4z"/>
4
- <circle cx="420.9" cy="296.5" r="45.7"/>
5
- <path d="M520.5 78.1z"/>
6
- </g>
7
- </svg>
@@ -1,9 +0,0 @@
1
- import React from 'react'
2
- import { render, screen } from '@testing-library/react'
3
- import Home from './index'
4
-
5
- test('renders learn react link', () => {
6
- render(<Home />)
7
- const linkElement = screen.getByText(/learn react/i)
8
- expect(linkElement).toBeInTheDocument()
9
- })
@@ -1,10 +0,0 @@
1
- import React from 'react'
2
- import './Home.scss'
3
-
4
- export interface HomePropsType {}
5
-
6
- const App: React.FC<HomePropsType> = () => {
7
- return <div className="home">home</div>
8
- }
9
-
10
- export default App
@@ -1 +0,0 @@
1
- /// <reference types="react-scripts" />
@@ -1,15 +0,0 @@
1
- import { ReportHandler } from 'web-vitals'
2
-
3
- const reportWebVitals = (onPerfEntry?: ReportHandler) => {
4
- if (onPerfEntry && onPerfEntry instanceof Function) {
5
- import('web-vitals').then(({ getCLS, getFID, getFCP, getLCP, getTTFB }) => {
6
- getCLS(onPerfEntry)
7
- getFID(onPerfEntry)
8
- getFCP(onPerfEntry)
9
- getLCP(onPerfEntry)
10
- getTTFB(onPerfEntry)
11
- })
12
- }
13
- }
14
-
15
- export default reportWebVitals
@@ -1,15 +0,0 @@
1
- import type { FunctionComponent } from 'react'
2
-
3
- export interface routeType {
4
- path: string
5
- Component: FunctionComponent<any>
6
- }
7
-
8
- const routes: routeType[] = [
9
- {
10
- path: '/',
11
- Component: require('../pages/home').default
12
- }
13
- ]
14
-
15
- export default routes
@@ -1,5 +0,0 @@
1
- // jest-dom adds custom jest matchers for asserting on DOM nodes.
2
- // allows you to do things like:
3
- // expect(element).toHaveTextContent(/react/i)
4
- // learn more: https://github.com/testing-library/jest-dom
5
- import '@testing-library/jest-dom'
@@ -1,21 +0,0 @@
1
- {
2
- "compilerOptions": {
3
- "baseUrl": ".",
4
- "target": "es5",
5
- "lib": ["dom", "dom.iterable", "esnext"],
6
- "allowJs": true,
7
- "skipLibCheck": true,
8
- "esModuleInterop": true,
9
- "allowSyntheticDefaultImports": true,
10
- "strict": true,
11
- "forceConsistentCasingInFileNames": true,
12
- "noFallthroughCasesInSwitch": true,
13
- "module": "esnext",
14
- "moduleResolution": "node",
15
- "resolveJsonModule": true,
16
- "isolatedModules": true,
17
- "noEmit": true,
18
- "jsx": "react-jsx"
19
- },
20
- "include": ["src"]
21
- }
@@ -1,8 +0,0 @@
1
- import React, { PropsWithChildren } from 'react'
2
- import { LayoutPropsType } from './typings'
3
-
4
- function Layout({ children }: PropsWithChildren<LayoutPropsType>) {
5
- return <div>{children}</div>
6
- }
7
-
8
- export default Layout
@@ -1,2 +0,0 @@
1
- export { default } from './View'
2
- export * as LayoutTypes from './typings'
@@ -1 +0,0 @@
1
- export interface LayoutPropsType {}
@@ -1,20 +0,0 @@
1
- import React from 'react'
2
- import ReactDOM from 'react-dom/client'
3
- import { BrowserRouter, Routes, Route } from 'react-router-dom'
4
- import Layout from './Layout'
5
- import routes from './routes'
6
- import './index.css'
7
-
8
- ReactDOM.createRoot(document.getElementById('root') as HTMLElement).render(
9
- <React.StrictMode>
10
- <BrowserRouter>
11
- <Layout>
12
- <Routes>
13
- {routes.map(({ path, Component }) => {
14
- return <Route key={path} path={path} element={<Component />} />
15
- })}
16
- </Routes>
17
- </Layout>
18
- </BrowserRouter>
19
- </React.StrictMode>
20
- )
File without changes
@@ -1 +0,0 @@
1
- export { default } from './View'
@@ -1,16 +0,0 @@
1
- import type { FunctionComponent } from 'react'
2
- import Home from '@/pages/Home'
3
-
4
- export interface routeType {
5
- path: string
6
- Component: FunctionComponent<any>
7
- }
8
-
9
- const routes: routeType[] = [
10
- {
11
- path: '/',
12
- Component: Home
13
- }
14
- ]
15
-
16
- export default routes
@@ -1,4 +0,0 @@
1
- #!/usr/bin/env sh
2
- . "$(dirname -- "$0")/_/husky.sh"
3
-
4
- npm run lint
@@ -1,4 +0,0 @@
1
- **/*.md
2
- **/*.svg
3
- **/*.ejs
4
- **/*.html
@@ -1,7 +0,0 @@
1
- <template>
2
- <router-view />
3
- </template>
4
-
5
- <script setup lang="ts"></script>
6
-
7
- <style scoped></style>
@@ -1 +0,0 @@
1
- export * from './useApp'
@@ -1,9 +0,0 @@
1
- import { defineStore } from 'pinia'
2
-
3
- export const useApp = defineStore('app', {
4
- state: () => {
5
- return {
6
- appName: ''
7
- }
8
- }
9
- })
@@ -1,2 +0,0 @@
1
- export * from './controllers'
2
- export { default } from './View.vue'
@@ -1,4 +0,0 @@
1
- import { createApp } from 'vue'
2
- import App from './App'
3
-
4
- export default createApp(App)
@@ -1 +0,0 @@
1
- export { default } from './View.vue'
@@ -1,9 +0,0 @@
1
- import { createRouter, createWebHashHistory, RouteRecordRaw } from 'vue-router'
2
- import Home from '@/pages/Home'
3
-
4
- const routes: RouteRecordRaw[] = [{ path: '/', component: Home }]
5
-
6
- export default createRouter({
7
- history: createWebHashHistory(),
8
- routes
9
- })