├── templates
├── vitesse-lite
│ ├── .npmrc
│ ├── public
│ │ ├── robots.txt
│ │ └── favicon.svg
│ ├── src
│ │ ├── composables
│ │ │ ├── index.ts
│ │ │ └── dark.ts
│ │ ├── pages
│ │ │ ├── [...all].vue
│ │ │ ├── README.md
│ │ │ ├── hi
│ │ │ │ └── [name].vue
│ │ │ └── index.vue
│ │ ├── App.vue
│ │ ├── styles
│ │ │ └── main.css
│ │ ├── main.ts
│ │ └── components
│ │ │ ├── Counter.vue
│ │ │ ├── README.md
│ │ │ └── Footer.vue
│ ├── .gitignore
│ ├── shims.d.ts
│ ├── test
│ │ ├── basic.test.ts
│ │ ├── __snapshots__
│ │ │ └── component.test.ts.snap
│ │ └── component.test.ts
│ ├── netlify.toml
│ ├── components.d.ts
│ ├── tsconfig.json
│ ├── index.html
│ ├── unocss.config.ts
│ ├── LICENSE
│ ├── vite.config.ts
│ ├── package.json
│ ├── README.md
│ └── auto-imports.d.ts
└── build-lib
│ ├── .eslintignore
│ ├── src
│ ├── index.ts
│ ├── types.ts
│ └── entry.ts
│ ├── .eslintrc
│ ├── .npmrc
│ ├── .gitignore
│ ├── build.config.ts
│ ├── README.md
│ ├── tsup.config.ts
│ ├── tsconfig.json
│ ├── package.json
│ └── pnpm-lock.yaml
├── .gitignore
├── README.md
├── package.json
├── LICENSE
├── scripts
└── gen_readme.ts
└── pnpm-lock.yaml
/templates/vitesse-lite/.npmrc:
--------------------------------------------------------------------------------
1 | shamefully-hoist=true
2 |
--------------------------------------------------------------------------------
/templates/build-lib/.eslintignore:
--------------------------------------------------------------------------------
1 | dist
2 | node_modules
3 |
--------------------------------------------------------------------------------
/templates/build-lib/src/index.ts:
--------------------------------------------------------------------------------
1 | export * from './entry'
2 |
--------------------------------------------------------------------------------
/templates/build-lib/.eslintrc:
--------------------------------------------------------------------------------
1 | {
2 | "extends": "@aliuq"
3 | }
4 |
--------------------------------------------------------------------------------
/templates/vitesse-lite/public/robots.txt:
--------------------------------------------------------------------------------
1 | User-agent: *
2 | Allow: /
3 |
--------------------------------------------------------------------------------
/templates/vitesse-lite/src/composables/index.ts:
--------------------------------------------------------------------------------
1 | export * from './dark'
2 |
--------------------------------------------------------------------------------
/.gitignore:
--------------------------------------------------------------------------------
1 | .vscode
2 | .history
3 | node_modules
4 | *.log
5 | dist
6 | *.snap
7 |
--------------------------------------------------------------------------------
/templates/build-lib/src/types.ts:
--------------------------------------------------------------------------------
1 | /* eslint-disable no-use-before-define */
2 |
--------------------------------------------------------------------------------
/templates/build-lib/.npmrc:
--------------------------------------------------------------------------------
1 | # shamefully-hoist = true
2 | # ignore-workspace-root-check = true
3 |
--------------------------------------------------------------------------------
/templates/build-lib/.gitignore:
--------------------------------------------------------------------------------
1 | .vscode
2 | .history
3 | node_modules
4 | *.cache
5 | dist
6 | *.log
7 | .idea
8 |
--------------------------------------------------------------------------------
/templates/vitesse-lite/src/pages/[...all].vue:
--------------------------------------------------------------------------------
1 |
2 |
3 | Not Found
4 |
5 |
6 |
--------------------------------------------------------------------------------
/templates/vitesse-lite/src/composables/dark.ts:
--------------------------------------------------------------------------------
1 | export const isDark = useDark()
2 | export const toggleDark = useToggle(isDark)
3 |
--------------------------------------------------------------------------------
/templates/build-lib/src/entry.ts:
--------------------------------------------------------------------------------
1 | export function hello(msg: string) {
2 | // eslint-disable-next-line no-console
3 | console.log(`hello ${msg}`)
4 | }
5 |
--------------------------------------------------------------------------------
/templates/vitesse-lite/.gitignore:
--------------------------------------------------------------------------------
1 | .DS_Store
2 | .vite-ssg-dist
3 | .vite-ssg-temp
4 | *.local
5 | dist
6 | dist-ssr
7 | node_modules
8 | .idea/
9 | *.log
10 |
--------------------------------------------------------------------------------
/templates/vitesse-lite/src/App.vue:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
--------------------------------------------------------------------------------
/templates/vitesse-lite/shims.d.ts:
--------------------------------------------------------------------------------
1 | declare module '*.vue' {
2 | import type { DefineComponent } from 'vue'
3 | const component: DefineComponent<{}, {}, any>
4 | export default component
5 | }
6 |
--------------------------------------------------------------------------------
/templates/vitesse-lite/src/styles/main.css:
--------------------------------------------------------------------------------
1 | html,
2 | body,
3 | #app {
4 | height: 100%;
5 | margin: 0;
6 | padding: 0;
7 | }
8 |
9 | html.dark {
10 | background: #121212;
11 | }
12 |
--------------------------------------------------------------------------------
/templates/vitesse-lite/test/basic.test.ts:
--------------------------------------------------------------------------------
1 | import { describe, expect, it } from 'vitest'
2 |
3 | describe('Hi', () => {
4 | it('should works', () => {
5 | expect(1 + 1).toEqual(2)
6 | })
7 | })
8 |
--------------------------------------------------------------------------------
/README.md:
--------------------------------------------------------------------------------
1 | # Templates for usually used
2 |
3 | + [build-lib](/templates/build-lib): Build library
4 | + [vitesse-lite](/templates/vitesse-lite): vitesse-lite by [antfu](https://github.com/antfu/vitesse-lite)
5 |
--------------------------------------------------------------------------------
/templates/vitesse-lite/test/__snapshots__/component.test.ts.snap:
--------------------------------------------------------------------------------
1 | // Vitest Snapshot v1
2 |
3 | exports[`Counter.vue > should render 1`] = `"
10
"`;
4 |
--------------------------------------------------------------------------------
/templates/vitesse-lite/netlify.toml:
--------------------------------------------------------------------------------
1 | [build.environment]
2 | NPM_FLAGS = "--version"
3 | NODE_VERSION = "16"
4 |
5 | [build]
6 | publish = "dist"
7 | command = "npx pnpm i --store=node_modules/.pnpm-store && npx pnpm run build"
8 |
9 | [[redirects]]
10 | from = "/*"
11 | to = "/index.html"
12 | status = 200
13 |
--------------------------------------------------------------------------------
/templates/build-lib/build.config.ts:
--------------------------------------------------------------------------------
1 | import { defineBuildConfig } from 'unbuild'
2 |
3 | export default defineBuildConfig({
4 | entries: [
5 | { input: 'src/index', name: 'index' },
6 | ],
7 | clean: true,
8 | declaration: true,
9 | externals: [],
10 | rollup: {
11 | emitCJS: true,
12 | },
13 | })
14 |
--------------------------------------------------------------------------------
/templates/vitesse-lite/src/main.ts:
--------------------------------------------------------------------------------
1 | import routes from 'virtual:generated-pages'
2 | import { ViteSSR } from 'vite-ssr-vue3'
3 | import App from './App.vue'
4 |
5 | import '@unocss/reset/tailwind.css'
6 | import './styles/main.css'
7 | import 'uno.css'
8 |
9 | export const createApp = ViteSSR(App, { routes, base: import.meta.env.BASE_URL })
10 |
--------------------------------------------------------------------------------
/templates/vitesse-lite/public/favicon.svg:
--------------------------------------------------------------------------------
1 |
10 |
--------------------------------------------------------------------------------
/templates/build-lib/README.md:
--------------------------------------------------------------------------------
1 | # Build Lib
2 |
3 | build-lib is a template for creating a build library.
4 |
5 | ## Dev Dependencies
6 |
7 | ```json
8 | {
9 | "@aliuq/eslint-config": "^0.0.3",
10 | "eslint": "^8.15.0",
11 | "tsup": "^5.12.7",
12 | "typescript": "^4.6.4",
13 | "unbuild": "^0.7.4"
14 | }
15 | ```
16 |
17 | ## Scripts
18 |
19 | ```json
20 | {
21 | "dev": "tsup --watch src",
22 | "build": "unbuild"
23 | }
24 | ```
25 |
--------------------------------------------------------------------------------
/templates/vitesse-lite/src/components/Counter.vue:
--------------------------------------------------------------------------------
1 |
8 |
9 |
10 |
11 | {{ count }}
12 |
15 |
18 |
19 |
20 |
--------------------------------------------------------------------------------
/templates/vitesse-lite/components.d.ts:
--------------------------------------------------------------------------------
1 | // generated by unplugin-vue-components
2 | // We suggest you to commit this file into source control
3 | // Read more: https://github.com/vuejs/vue-next/pull/3399
4 |
5 | declare module 'vue' {
6 | export interface GlobalComponents {
7 | Counter: typeof import('./src/components/Counter.vue')['default']
8 | Footer: typeof import('./src/components/Footer.vue')['default']
9 | }
10 | }
11 |
12 | export { }
13 |
--------------------------------------------------------------------------------
/templates/vitesse-lite/src/components/README.md:
--------------------------------------------------------------------------------
1 | ## Components
2 |
3 | Components in this dir will be auto-registered and on-demand, powered by [`unplugin-vue-components`](https://github.com/antfu/unplugin-vue-components).
4 |
5 | ### Icons
6 |
7 | You can use icons from almost any icon sets by the power of [Iconify](https://iconify.design/).
8 |
9 | It will only bundle the icons you use. Check out [`unplugin-icons`](https://github.com/antfu/unplugin-icons) for more details.
10 |
--------------------------------------------------------------------------------
/package.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "templates",
3 | "private": true,
4 | "description": "templates for myself usually used",
5 | "scripts": {
6 | "readme": "esno scripts/gen_readme.ts"
7 | },
8 | "keywords": [
9 | "template"
10 | ],
11 | "author": "liuq",
12 | "license": "MIT",
13 | "homepage": "https://github.com/aliuq/templates",
14 | "devDependencies": {
15 | "@types/fs-extra": "^9.0.13",
16 | "esno": "^0.15.0",
17 | "fs-extra": "^10.1.0"
18 | }
19 | }
20 |
--------------------------------------------------------------------------------
/templates/build-lib/tsup.config.ts:
--------------------------------------------------------------------------------
1 | import type { Options } from 'tsup'
2 |
3 | export default {
4 | entryPoints: {
5 | index: 'src/index.ts',
6 | },
7 | dts: true,
8 | target: 'node14',
9 | format: [
10 | 'esm',
11 | 'cjs',
12 | ],
13 | external: [],
14 | clean: true,
15 | esbuildOptions: (options: any, { format }: any) => {
16 | options.outExtension = { '.js': format === 'cjs' ? '.cjs' : format === 'esm' ? '.mjs' : '.js' }
17 | },
18 | }
19 |
--------------------------------------------------------------------------------
/templates/build-lib/tsconfig.json:
--------------------------------------------------------------------------------
1 | {
2 | "compilerOptions": {
3 | "module": "ESNext",
4 | "target": "es2020",
5 | "lib": [
6 | "ESNext",
7 | "DOM"
8 | ],
9 | "esModuleInterop": true,
10 | "strict": true,
11 | "strictNullChecks": true,
12 | "moduleResolution": "Node",
13 | "resolveJsonModule": true,
14 | "skipLibCheck": true,
15 | "jsx": "preserve"
16 | },
17 | "exclude": [
18 | "**/dist",
19 | "**/node_modules",
20 | "**/test"
21 | ]
22 | }
23 |
--------------------------------------------------------------------------------
/templates/vitesse-lite/src/pages/README.md:
--------------------------------------------------------------------------------
1 | ## File-based Routing
2 |
3 | Routes will be auto-generated for Vue files in this dir with the same file structure.
4 | Check out [`vite-plugin-pages`](https://github.com/hannoeru/vite-plugin-pages) for more details.
5 |
6 | ### Path Aliasing
7 |
8 | `~/` is aliased to `./src/` folder.
9 |
10 | For example, instead of having
11 |
12 | ```ts
13 | import { isDark } from '../../../../composables'
14 | ```
15 |
16 | now, you can use
17 |
18 | ```ts
19 | import { isDark } from '~/composables'
20 | ```
21 |
--------------------------------------------------------------------------------
/templates/vitesse-lite/src/pages/hi/[name].vue:
--------------------------------------------------------------------------------
1 |
5 |
6 |
7 |
8 |
9 |
10 | Hi, {{ props.name }}
11 |
12 |
13 | Dynamic route!
14 |
15 |
16 |
17 |
23 |
24 |
25 |
26 |
--------------------------------------------------------------------------------
/templates/vitesse-lite/src/components/Footer.vue:
--------------------------------------------------------------------------------
1 |
4 |
5 |
6 |
21 |
22 |
--------------------------------------------------------------------------------
/templates/vitesse-lite/tsconfig.json:
--------------------------------------------------------------------------------
1 | {
2 | "compilerOptions": {
3 | "baseUrl": ".",
4 | "module": "ESNext",
5 | "target": "es2016",
6 | "lib": ["DOM", "ESNext"],
7 | "strict": true,
8 | "esModuleInterop": true,
9 | "incremental": false,
10 | "skipLibCheck": true,
11 | "moduleResolution": "node",
12 | "resolveJsonModule": true,
13 | "noUnusedLocals": true,
14 | "strictNullChecks": true,
15 | "forceConsistentCasingInFileNames": true,
16 | "types": [
17 | "vite/client",
18 | "vite-plugin-pages/client"
19 | ],
20 | "paths": {
21 | "~/*": ["src/*"]
22 | }
23 | },
24 | "exclude": ["dist", "node_modules"]
25 | }
26 |
--------------------------------------------------------------------------------
/templates/build-lib/package.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "build_lib",
3 | "version": "0.0.0",
4 | "private": true,
5 | "description": "build-lib is a template for creating a build library.",
6 | "main": "dist/index.cjs",
7 | "module": "dist/index.mjs",
8 | "types": "dist/index.d.ts",
9 | "files": [
10 | "dist",
11 | "bin",
12 | "*.d.ts"
13 | ],
14 | "sideEffects": false,
15 | "scripts": {
16 | "dev": "tsup --watch src",
17 | "build": "unbuild"
18 | },
19 | "devDependencies": {
20 | "@aliuq/eslint-config": "^0.0.3",
21 | "eslint": "^8.15.0",
22 | "tsup": "^5.12.7",
23 | "typescript": "^4.6.4",
24 | "unbuild": "^0.7.4"
25 | },
26 | "engines": {
27 | "node": ">=14.19.1"
28 | }
29 | }
30 |
--------------------------------------------------------------------------------
/templates/vitesse-lite/test/component.test.ts:
--------------------------------------------------------------------------------
1 | import { mount } from '@vue/test-utils'
2 | import { describe, expect, it } from 'vitest'
3 | import Counter from '../src/components/Counter.vue'
4 |
5 | describe('Counter.vue', () => {
6 | it('should render', () => {
7 | const wrapper = mount(Counter, { props: { initial: 10 } })
8 | expect(wrapper.text()).toContain('10')
9 | expect(wrapper.html()).toMatchSnapshot()
10 | })
11 |
12 | it('should be interactive', async() => {
13 | const wrapper = mount(Counter, { props: { initial: 0 } })
14 | expect(wrapper.text()).toContain('0')
15 |
16 | expect(wrapper.find('.inc').exists()).toBe(true)
17 |
18 | await wrapper.get('button').trigger('click')
19 |
20 | expect(wrapper.text()).toContain('1')
21 | })
22 | })
23 |
--------------------------------------------------------------------------------
/templates/vitesse-lite/index.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 | Vitesse Lite
8 |
9 |
10 |
11 |
12 |
20 |
21 |
22 |
23 |
--------------------------------------------------------------------------------
/templates/vitesse-lite/unocss.config.ts:
--------------------------------------------------------------------------------
1 | import {
2 | defineConfig,
3 | presetAttributify,
4 | presetIcons,
5 | presetUno,
6 | presetWebFonts,
7 | transformerDirectives,
8 | transformerVariantGroup,
9 | } from 'unocss'
10 |
11 | export default defineConfig({
12 | shortcuts: [
13 | ['btn', 'px-4 py-1 rounded inline-block bg-teal-600 text-white cursor-pointer hover:bg-teal-700 disabled:cursor-default disabled:bg-gray-600 disabled:opacity-50'],
14 | ['icon-btn', 'text-[0.9em] inline-block cursor-pointer select-none opacity-75 transition duration-200 ease-in-out hover:opacity-100 hover:text-teal-600'],
15 | ],
16 | presets: [
17 | presetUno(),
18 | presetAttributify(),
19 | presetIcons({
20 | scale: 1.2,
21 | warn: true,
22 | }),
23 | presetWebFonts({
24 | fonts: {
25 | sans: 'DM Sans',
26 | serif: 'DM Serif Display',
27 | mono: 'DM Mono',
28 | },
29 | }),
30 | ],
31 | transformers: [
32 | transformerDirectives(),
33 | transformerVariantGroup(),
34 | ],
35 | })
36 |
--------------------------------------------------------------------------------
/LICENSE:
--------------------------------------------------------------------------------
1 | MIT License
2 |
3 | Copyright (c) 2022 liuq
4 |
5 | Permission is hereby granted, free of charge, to any person obtaining a copy
6 | of this software and associated documentation files (the "Software"), to deal
7 | in the Software without restriction, including without limitation the rights
8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9 | copies of the Software, and to permit persons to whom the Software is
10 | furnished to do so, subject to the following conditions:
11 |
12 | The above copyright notice and this permission notice shall be included in all
13 | copies or substantial portions of the Software.
14 |
15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21 | SOFTWARE.
22 |
--------------------------------------------------------------------------------
/templates/vitesse-lite/LICENSE:
--------------------------------------------------------------------------------
1 | MIT License
2 |
3 | Copyright (c) 2020-PRESENT Anthony Fu
4 |
5 | Permission is hereby granted, free of charge, to any person obtaining a copy
6 | of this software and associated documentation files (the "Software"), to deal
7 | in the Software without restriction, including without limitation the rights
8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9 | copies of the Software, and to permit persons to whom the Software is
10 | furnished to do so, subject to the following conditions:
11 |
12 | The above copyright notice and this permission notice shall be included in all
13 | copies or substantial portions of the Software.
14 |
15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21 | SOFTWARE.
22 |
--------------------------------------------------------------------------------
/templates/vitesse-lite/vite.config.ts:
--------------------------------------------------------------------------------
1 | ///
2 |
3 | import path from 'path'
4 | import { defineConfig } from 'vite'
5 | import Vue from '@vitejs/plugin-vue'
6 | import Pages from 'vite-plugin-pages'
7 | import Components from 'unplugin-vue-components/vite'
8 | import AutoImport from 'unplugin-auto-import/vite'
9 | import Unocss from 'unocss/vite'
10 |
11 | export default defineConfig({
12 | resolve: {
13 | alias: {
14 | '~/': `${path.resolve(__dirname, 'src')}/`,
15 | },
16 | },
17 | plugins: [
18 | Vue(),
19 |
20 | // https://github.com/hannoeru/vite-plugin-pages
21 | Pages(),
22 |
23 | // https://github.com/antfu/unplugin-auto-import
24 | AutoImport({
25 | imports: [
26 | 'vue',
27 | 'vue-router',
28 | '@vueuse/core',
29 | ],
30 | dts: true,
31 | }),
32 |
33 | // https://github.com/antfu/vite-plugin-components
34 | Components({
35 | dts: true,
36 | }),
37 |
38 | // https://github.com/antfu/unocss
39 | // see unocss.config.ts for config
40 | Unocss(),
41 |
42 | ],
43 |
44 | // https://github.com/vitest-dev/vitest
45 | test: {
46 | environment: 'jsdom',
47 | },
48 | })
49 |
--------------------------------------------------------------------------------
/templates/vitesse-lite/src/pages/index.vue:
--------------------------------------------------------------------------------
1 |
10 |
11 |
12 |
13 |
14 |
15 |
16 | Vitesse Lite
17 |
18 |
19 |
20 | Opinionated Vite Starter Template
21 |
22 |
23 |
24 |
25 |
39 |
40 |
41 |
48 |
49 |
50 |
51 |
--------------------------------------------------------------------------------
/templates/vitesse-lite/package.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "vitesse-lite",
3 | "private": true,
4 | "packageManager": "pnpm@6.32.3",
5 | "scripts": {
6 | "build": "vite-ssr build",
7 | "dev": "vite-ssr --port 3333",
8 | "lint": "eslint .",
9 | "typecheck": "vue-tsc --noEmit",
10 | "serve": "cross-env NODE_ENV=production vite-ssr",
11 | "test": "vitest"
12 | },
13 | "dependencies": {
14 | "@vueuse/core": "^8.0.0",
15 | "vue": "^3.2.31",
16 | "vue-router": "^4.0.14"
17 | },
18 | "devDependencies": {
19 | "@antfu/eslint-config": "^0.18.8",
20 | "@iconify-json/carbon": "^1.1.1",
21 | "@types/node": "^17.0.21",
22 | "@unocss/reset": "^0.28.0",
23 | "@vitejs/plugin-vue": "^2.2.4",
24 | "@vue/test-utils": "^2.0.0-rc.18",
25 | "cross-env": "^7.0.3",
26 | "eslint": "^8.11.0",
27 | "jsdom": "^19.0.0",
28 | "pnpm": "^6.32.3",
29 | "typescript": "^4.6.2",
30 | "unocss": "^0.28.0",
31 | "unplugin-auto-import": "^0.6.4",
32 | "unplugin-vue-components": "^0.18.0",
33 | "vite": "^2.8.6",
34 | "vite-plugin-pages": "^0.21.4",
35 | "vite-ssr-vue3": "^0.0.5",
36 | "vitest": "^0.6.0",
37 | "vue-tsc": "^0.32.1"
38 | },
39 | "eslintConfig": {
40 | "extends": "@antfu"
41 | }
42 | }
43 |
--------------------------------------------------------------------------------
/scripts/gen_readme.ts:
--------------------------------------------------------------------------------
1 | import fs from 'fs-extra'
2 |
3 | const files = await fs.readdir('templates')
4 |
5 | for await (const file of files) {
6 | const exists = await fs.pathExists(`templates/${file}/README.md`)
7 | if (!exists) {
8 | const pkg = await fs.readJSON(`templates/${file}/package.json`)
9 | const name = pkg.name.split(/[_-]/).map(s => s.charAt(0).toUpperCase() + s.slice(1)).join(' ')
10 | const readme = format(`
11 | # ${name}
12 |
13 | ${pkg.description}
14 |
15 | ${pkg.dependencies ? `
16 | ## Dependencies
17 | \`\`\`json
18 | ${JSON.stringify(pkg.dependencies, null, 2)}
19 | \`\`\`
20 | ` : ''}
21 |
22 | ${pkg.devDependencies ? `
23 | ## Dev Dependencies
24 | \`\`\`json
25 | ${JSON.stringify(pkg.devDependencies, null, 2)}
26 | \`\`\`
27 | ` : ''}
28 |
29 | ${pkg.scripts ? `
30 | ## Scripts
31 |
32 | \`\`\`json
33 | ${JSON.stringify(pkg.scripts, null, 2)}
34 | \`\`\`
35 | ` : ''}
36 | `) + '\n'
37 |
38 | await fs.writeFile(`templates/${file}/README.md`, readme)
39 | }
40 | }
41 |
42 |
43 | function format(str) {
44 | let flag = false
45 | return str
46 | .trim()
47 | .replace(/^(.*?)$/gm, (_, s) => {
48 | let newS = s.trim()
49 |
50 | if (newS.startsWith('{')) {
51 | flag = true
52 | return newS
53 | }
54 | if (newS.startsWith('}')) {
55 | flag = false
56 | return newS
57 | }
58 | if (flag === true) {
59 | return s
60 | }
61 | return newS
62 | })
63 | .replace(/^(.*?)\n+(##.*?)$/gms, '$1\n\n$2')
64 | .replace(/^(#.*?)\n+(.*?)$/gms, '$1\n\n$2')
65 | }
66 |
--------------------------------------------------------------------------------
/templates/vitesse-lite/README.md:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
8 |
9 |
10 | Lightweight version of Vitesse
11 |
12 |
13 |
14 |
15 | ## Features
16 |
17 | - ⚡️ [Vue 3](https://github.com/vuejs/vue-next), [Vite 2](https://github.com/vitejs/vite), [pnpm](https://pnpm.js.org/), [ESBuild](https://github.com/evanw/esbuild) - born with fastness
18 |
19 | - 🗂 [File based routing](./src/pages)
20 |
21 | - 📦 [Components auto importing](./src/components)
22 |
23 | - 🎨 [UnoCSS](https://github.com/antfu/unocss) - The instant on-demand atomic CSS engine.
24 |
25 | - 😃 Use icons from any icon sets in [Pure CSS](https://github.com/antfu/unocss/tree/main/packages/preset-icons)
26 |
27 | - 🔥 Use the [new `