create-packer 1.9.2 → 1.10.2

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 (37) hide show
  1. package/package.json +1 -1
  2. package/template/react-cra/src/index.tsx +1 -1
  3. package/template/react-vite/src/Layout/{index.tsx → View.tsx} +0 -0
  4. package/template/react-vite/src/Layout/index.ts +2 -0
  5. package/template/react-vite/src/main.tsx +1 -1
  6. package/template/react-vite/src/pages/{home/home.css → Home/Home.css} +0 -0
  7. package/template/react-vite/src/pages/{home/home.spec.tsx → Home/Home.spec.tsx} +0 -0
  8. package/template/react-vite/src/pages/{home/index.tsx → Home/View.tsx} +3 -3
  9. package/template/react-vite/src/pages/Home/index.ts +1 -0
  10. package/template/react-vite/src/routes/index.ts +1 -1
  11. package/template/vue-vite/.gitignore +24 -0
  12. package/template/vue-vite/.husky/pre-commit +4 -0
  13. package/template/vue-vite/.prettierignore +4 -0
  14. package/template/vue-vite/.prettierrc +18 -0
  15. package/template/vue-vite/.stylelintrc +21 -0
  16. package/template/vue-vite/.vscode/extensions.json +3 -0
  17. package/template/vue-vite/README.md +16 -0
  18. package/template/vue-vite/index.html +13 -0
  19. package/template/vue-vite/package.json +45 -0
  20. package/template/vue-vite/postcss.config.cjs +9 -0
  21. package/template/vue-vite/public/vite.svg +1 -0
  22. package/template/vue-vite/src/App/View.vue +7 -0
  23. package/template/vue-vite/src/App/controllers/index.ts +1 -0
  24. package/template/vue-vite/src/App/controllers/useApp.ts +9 -0
  25. package/template/vue-vite/src/App/index.ts +2 -0
  26. package/template/vue-vite/src/appInstance.ts +4 -0
  27. package/template/vue-vite/src/assets/vue.svg +1 -0
  28. package/template/vue-vite/src/main.ts +6 -0
  29. package/template/vue-vite/src/pages/Home/View.vue +7 -0
  30. package/template/vue-vite/src/pages/Home/index.ts +1 -0
  31. package/template/vue-vite/src/routes/index.ts +9 -0
  32. package/template/vue-vite/src/style.css +3 -0
  33. package/template/vue-vite/src/vite-env.d.ts +7 -0
  34. package/template/vue-vite/tailwind.config.cjs +8 -0
  35. package/template/vue-vite/tsconfig.json +22 -0
  36. package/template/vue-vite/tsconfig.node.json +9 -0
  37. package/template/vue-vite/vite.config.ts +13 -0
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "create-packer",
3
- "version": "1.9.2",
3
+ "version": "1.10.2",
4
4
  "main": "index.js",
5
5
  "repository": "https://github.com/kevily/create-packer",
6
6
  "author": "1k <bug_zero@163.com>",
@@ -13,7 +13,7 @@ root.render(
13
13
  <Layout>
14
14
  <Routes>
15
15
  {routes.map(({ path, Component }) => {
16
- return <Route path={path} element={<Component />} />
16
+ return <Route key={path} path={path} element={<Component />} />
17
17
  })}
18
18
  </Routes>
19
19
  </Layout>
@@ -0,0 +1,2 @@
1
+ export { default } from './View'
2
+ export * as LayoutTypes from './typings'
@@ -11,7 +11,7 @@ ReactDOM.createRoot(document.getElementById('root') as HTMLElement).render(
11
11
  <Layout>
12
12
  <Routes>
13
13
  {routes.map(({ path, Component }) => {
14
- return <Route path={path} element={<Component />} />
14
+ return <Route key={path} path={path} element={<Component />} />
15
15
  })}
16
16
  </Routes>
17
17
  </Layout>
@@ -1,7 +1,7 @@
1
- import './home.css'
1
+ import './Home.css'
2
2
 
3
- function App() {
3
+ function Home() {
4
4
  return <div className={'flex justify-center items-center'}>sdfs</div>
5
5
  }
6
6
 
7
- export default App
7
+ export default Home
@@ -0,0 +1 @@
1
+ export { default } from './View'
@@ -1,5 +1,5 @@
1
1
  import type { FunctionComponent } from 'react'
2
- import Home from '@/pages/home'
2
+ import Home from '@/pages/Home'
3
3
 
4
4
  export interface routeType {
5
5
  path: string
@@ -0,0 +1,24 @@
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
+
15
+ # Editor directories and files
16
+ .vscode/*
17
+ !.vscode/extensions.json
18
+ .idea
19
+ .DS_Store
20
+ *.suo
21
+ *.ntvs*
22
+ *.njsproj
23
+ *.sln
24
+ *.sw?
@@ -0,0 +1,4 @@
1
+ #!/usr/bin/env sh
2
+ . "$(dirname -- "$0")/_/husky.sh"
3
+
4
+ npm run lint
@@ -0,0 +1,4 @@
1
+ **/*.md
2
+ **/*.svg
3
+ **/*.ejs
4
+ **/*.html
@@ -0,0 +1,18 @@
1
+ {
2
+ "overrides": [
3
+ {
4
+ "files": ".prettierrc",
5
+ "options": { "parser": "json" }
6
+ }
7
+ ],
8
+ "printWidth": 100,
9
+ "tabWidth": 4,
10
+ "useTabs": false,
11
+ "semi": false,
12
+ "singleQuote": true,
13
+ "trailingComma": "none",
14
+ "bracketSpacing": true,
15
+ "jsxBracketSameLine": true,
16
+ "arrowParens": "avoid",
17
+ "rangeStart": 0
18
+ }
@@ -0,0 +1,21 @@
1
+ {
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": ["tailwind", "apply"]
12
+ }
13
+ ],
14
+ "selector-pseudo-class-no-unknown": [
15
+ true,
16
+ {
17
+ "ignorePseudoClasses": ["global"]
18
+ }
19
+ ]
20
+ }
21
+ }
@@ -0,0 +1,3 @@
1
+ {
2
+ "recommendations": ["Vue.volar"]
3
+ }
@@ -0,0 +1,16 @@
1
+ # Vue 3 + TypeScript + Vite
2
+
3
+ This template should help get you started developing with Vue 3 and TypeScript in Vite. The template uses Vue 3 `<script setup>` SFCs, check out the [script setup docs](https://v3.vuejs.org/api/sfc-script-setup.html#sfc-script-setup) to learn more.
4
+
5
+ ## Recommended IDE Setup
6
+
7
+ - [VS Code](https://code.visualstudio.com/) + [Volar](https://marketplace.visualstudio.com/items?itemName=Vue.volar)
8
+
9
+ ## Type Support For `.vue` Imports in TS
10
+
11
+ Since TypeScript cannot handle type information for `.vue` imports, they are shimmed to be a generic Vue component type by default. In most cases this is fine if you don't really care about component prop types outside of templates. However, if you wish to get actual prop types in `.vue` imports (for example to get props validation when using manual `h(...)` calls), you can enable Volar's Take Over mode by following these steps:
12
+
13
+ 1. Run `Extensions: Show Built-in Extensions` from VS Code's command palette, look for `TypeScript and JavaScript Language Features`, then right click and select `Disable (Workspace)`. By default, Take Over mode will enable itself if the default TypeScript extension is disabled.
14
+ 2. Reload the VS Code window by running `Developer: Reload Window` from the command palette.
15
+
16
+ You can learn more about Take Over mode [here](https://github.com/johnsoncodehk/volar/discussions/471).
@@ -0,0 +1,13 @@
1
+ <!DOCTYPE html>
2
+ <html lang="en">
3
+ <head>
4
+ <meta charset="UTF-8" />
5
+ <link rel="icon" type="image/svg+xml" href="/vite.svg" />
6
+ <meta name="viewport" content="width=device-width, initial-scale=1.0" />
7
+ <title>Vite + Vue + TS</title>
8
+ </head>
9
+ <body>
10
+ <div id="app"></div>
11
+ <script type="module" src="/src/main.ts"></script>
12
+ </body>
13
+ </html>
@@ -0,0 +1,45 @@
1
+ {
2
+ "name": "vue-vite",
3
+ "private": true,
4
+ "version": "0.0.0",
5
+ "type": "module",
6
+ "scripts": {
7
+ "dev": "vite",
8
+ "build": "vue-tsc --noEmit && vite build",
9
+ "preview": "vite preview",
10
+ "format": "prettier --write \"src/**/*.{ts,js,tsx,jsx,vue,css,scss,less}\" \"./package.json\"",
11
+ "lint": "eslint ./src/**/*.{tsx,ts,vue} && stylelint ./src/**/*.{css,scss,less}",
12
+ "lint:fix": "eslint ./src/**/*.{tsx,ts,vue} --fix && stylelint ./src/**/*.{css,scss,less} --fix",
13
+ "cz": "cz",
14
+ "push": "npm run commit && git push",
15
+ "commit": "git add . && npm run cz"
16
+ },
17
+ "dependencies": {
18
+ "pinia": "2.0.18",
19
+ "vue": "3.2.37",
20
+ "vue-router": "4.1.3"
21
+ },
22
+ "devDependencies": {
23
+ "@vitejs/plugin-vue": "3.0.3",
24
+ "autoprefixer": "10.4.8",
25
+ "commitizen": "4.2.5",
26
+ "cssnano": "5.1.12",
27
+ "cz-adapter-eslint": "0.3.0",
28
+ "husky": "8.0.1",
29
+ "postcss": "8.4.14",
30
+ "postcss-import": "14.1.0",
31
+ "postcss-nesting": "10.1.10",
32
+ "prettier": "2.7.1",
33
+ "stylelint": "14.9.1",
34
+ "stylelint-config-standard": "26.0.0",
35
+ "tailwindcss": "3.1.8",
36
+ "typescript": "4.6.4",
37
+ "vite": "3.0.7",
38
+ "vue-tsc": "0.39.5"
39
+ },
40
+ "config": {
41
+ "commitizen": {
42
+ "path": "./node_modules/cz-adapter-eslint"
43
+ }
44
+ }
45
+ }
@@ -0,0 +1,9 @@
1
+ module.exports = {
2
+ plugins: {
3
+ 'postcss-import': {},
4
+ 'tailwindcss/nesting': 'postcss-nesting',
5
+ tailwindcss: {},
6
+ autoprefixer: {},
7
+ ...(process.env.NODE_ENV === 'production' ? { cssnano: {} } : {})
8
+ }
9
+ }
@@ -0,0 +1 @@
1
+ <svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" aria-hidden="true" role="img" class="iconify iconify--logos" width="31.88" height="32" preserveAspectRatio="xMidYMid meet" viewBox="0 0 256 257"><defs><linearGradient id="IconifyId1813088fe1fbc01fb466" x1="-.828%" x2="57.636%" y1="7.652%" y2="78.411%"><stop offset="0%" stop-color="#41D1FF"></stop><stop offset="100%" stop-color="#BD34FE"></stop></linearGradient><linearGradient id="IconifyId1813088fe1fbc01fb467" x1="43.376%" x2="50.316%" y1="2.242%" y2="89.03%"><stop offset="0%" stop-color="#FFEA83"></stop><stop offset="8.333%" stop-color="#FFDD35"></stop><stop offset="100%" stop-color="#FFA800"></stop></linearGradient></defs><path fill="url(#IconifyId1813088fe1fbc01fb466)" d="M255.153 37.938L134.897 252.976c-2.483 4.44-8.862 4.466-11.382.048L.875 37.958c-2.746-4.814 1.371-10.646 6.827-9.67l120.385 21.517a6.537 6.537 0 0 0 2.322-.004l117.867-21.483c5.438-.991 9.574 4.796 6.877 9.62Z"></path><path fill="url(#IconifyId1813088fe1fbc01fb467)" d="M185.432.063L96.44 17.501a3.268 3.268 0 0 0-2.634 3.014l-5.474 92.456a3.268 3.268 0 0 0 3.997 3.378l24.777-5.718c2.318-.535 4.413 1.507 3.936 3.838l-7.361 36.047c-.495 2.426 1.782 4.5 4.151 3.78l15.304-4.649c2.372-.72 4.652 1.36 4.15 3.788l-11.698 56.621c-.732 3.542 3.979 5.473 5.943 2.437l1.313-2.028l72.516-144.72c1.215-2.423-.88-5.186-3.54-4.672l-25.505 4.922c-2.396.462-4.435-1.77-3.759-4.114l16.646-57.705c.677-2.35-1.37-4.583-3.769-4.113Z"></path></svg>
@@ -0,0 +1,7 @@
1
+ <template>
2
+ <router-view />
3
+ </template>
4
+
5
+ <script setup lang="ts"></script>
6
+
7
+ <style scoped></style>
@@ -0,0 +1 @@
1
+ export * from './useApp'
@@ -0,0 +1,9 @@
1
+ import { defineStore } from 'pinia'
2
+
3
+ export const useApp = defineStore('app', {
4
+ state: () => {
5
+ return {
6
+ appName: ''
7
+ }
8
+ }
9
+ })
@@ -0,0 +1,2 @@
1
+ export * from './controllers'
2
+ export { default } from './View.vue'
@@ -0,0 +1,4 @@
1
+ import { createApp } from 'vue'
2
+ import App from './App'
3
+
4
+ export default createApp(App)
@@ -0,0 +1 @@
1
+ <svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" aria-hidden="true" role="img" class="iconify iconify--logos" width="37.07" height="36" preserveAspectRatio="xMidYMid meet" viewBox="0 0 256 198"><path fill="#41B883" d="M204.8 0H256L128 220.8L0 0h97.92L128 51.2L157.44 0h47.36Z"></path><path fill="#41B883" d="m0 0l128 220.8L256 0h-51.2L128 132.48L50.56 0H0Z"></path><path fill="#35495E" d="M50.56 0L128 133.12L204.8 0h-47.36L128 51.2L97.92 0H50.56Z"></path></svg>
@@ -0,0 +1,6 @@
1
+ import app from './appInstance'
2
+ import { createPinia } from 'pinia'
3
+ import router from '@/routes'
4
+ import './style.css'
5
+
6
+ app.use(createPinia()).use(router).mount('#app')
@@ -0,0 +1,7 @@
1
+ <template>
2
+ <div>Home</div>
3
+ </template>
4
+
5
+ <script setup lang="ts"></script>
6
+
7
+ <style scoped></style>
@@ -0,0 +1 @@
1
+ export { default } from './View.vue'
@@ -0,0 +1,9 @@
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
+ })
@@ -0,0 +1,3 @@
1
+ @tailwind base;
2
+ @tailwind components;
3
+ @tailwind utilities;
@@ -0,0 +1,7 @@
1
+ /// <reference types="vite/client" />
2
+
3
+ declare module '*.vue' {
4
+ import type { DefineComponent } from 'vue'
5
+ const component: DefineComponent<{}, {}, any>
6
+ export default component
7
+ }
@@ -0,0 +1,8 @@
1
+ /** @type {import('tailwindcss').Config} */
2
+ module.exports = {
3
+ content: ['./index.html', './src/**/*.{ts,tsx}'],
4
+ theme: {
5
+ extend: {}
6
+ },
7
+ plugins: []
8
+ }
@@ -0,0 +1,22 @@
1
+ {
2
+ "compilerOptions": {
3
+ "baseUrl": ".",
4
+ "target": "ESNext",
5
+ "useDefineForClassFields": true,
6
+ "module": "ESNext",
7
+ "moduleResolution": "Node",
8
+ "strict": true,
9
+ "jsx": "preserve",
10
+ "sourceMap": true,
11
+ "resolveJsonModule": true,
12
+ "isolatedModules": true,
13
+ "esModuleInterop": true,
14
+ "lib": ["ESNext", "DOM"],
15
+ "skipLibCheck": true,
16
+ "paths": {
17
+ "@/*": ["src/*"]
18
+ }
19
+ },
20
+ "include": ["src/**/*.ts", "src/**/*.d.ts", "src/**/*.tsx", "src/**/*.vue"],
21
+ "references": [{ "path": "./tsconfig.node.json" }]
22
+ }
@@ -0,0 +1,9 @@
1
+ {
2
+ "compilerOptions": {
3
+ "composite": true,
4
+ "module": "ESNext",
5
+ "moduleResolution": "Node",
6
+ "allowSyntheticDefaultImports": true
7
+ },
8
+ "include": ["vite.config.ts"]
9
+ }
@@ -0,0 +1,13 @@
1
+ import { defineConfig } from 'vite'
2
+ import vue from '@vitejs/plugin-vue'
3
+ import path from 'path'
4
+
5
+ // https://vitejs.dev/config/
6
+ export default defineConfig({
7
+ plugins: [vue()],
8
+ resolve: {
9
+ alias: {
10
+ '@': path.join(__dirname, 'src')
11
+ }
12
+ }
13
+ })