diff --git a/.eslintrc.js b/.eslintrc.js new file mode 100644 index 0000000..9711295 --- /dev/null +++ b/.eslintrc.js @@ -0,0 +1,7 @@ +module.exports = { + extends: ["plugin:vue/vue3-essential", "prettier"], + rules: { + // override/add rules settings here, such as: + "vue/no-unused-vars": "error", + }, +}; diff --git a/.prettierrc.js b/.prettierrc.js new file mode 100644 index 0000000..b2b06e0 --- /dev/null +++ b/.prettierrc.js @@ -0,0 +1,11 @@ +module.exports = { + semi: false, + tabWidth: 2, + useTabs: false, + printWidth: 80, + endOfLine: "auto", + singleQuote: true, + trailingComma: "es5", + bracketSpacing: true, + arrowParens: "always", +}; diff --git a/.vscode/extensions.json b/.vscode/extensions.json deleted file mode 100644 index 22a1505..0000000 --- a/.vscode/extensions.json +++ /dev/null @@ -1,4 +0,0 @@ -{ - "recommendations": ["astro-build.astro-vscode"], - "unwantedRecommendations": [] -} diff --git a/.vscode/launch.json b/.vscode/launch.json deleted file mode 100644 index d642209..0000000 --- a/.vscode/launch.json +++ /dev/null @@ -1,11 +0,0 @@ -{ - "version": "0.2.0", - "configurations": [ - { - "command": "./node_modules/.bin/astro dev", - "name": "Development server", - "request": "launch", - "type": "node-terminal" - } - ] -} diff --git a/.vscode/settings.json b/.vscode/settings.json deleted file mode 100644 index d09a50c..0000000 --- a/.vscode/settings.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "svg.preview.background": "transparent" -} \ No newline at end of file diff --git a/Dockerfile b/Dockerfile index 3eb6439..01a6c67 100644 --- a/Dockerfile +++ b/Dockerfile @@ -2,12 +2,12 @@ FROM node:18-alpine WORKDIR /app -COPY package.json package-lock.json /app/ -RUN ls +COPY package.json /app/ + RUN npm install COPY . . RUN npm run build EXPOSE ${PORT_EXPOSED} -CMD ["node", "dist/server/entry.mjs"] +CMD vite preview --port ${PORT_EXPOSED} diff --git a/License b/License new file mode 100644 index 0000000..9d81d27 --- /dev/null +++ b/License @@ -0,0 +1,21 @@ +MIT License + +Copyright (c) 2021 Shamim Hossain + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. diff --git a/README.md b/README.md index 999a839..a57e14d 100644 --- a/README.md +++ b/README.md @@ -1,54 +1,83 @@ -# Welcome to [Astro](https://astro.build) +# vue-3-stackter -[](https://stackblitz.com/github/withastro/astro/tree/latest/examples/basics) -[](https://codesandbox.io/s/github/withastro/astro/tree/latest/examples/basics) + -> 🧑🚀 **Seasoned astronaut?** Delete this file. Have fun! +A Vue3 starter project setup with these following components, - +- [Vite](https://vitejs.dev/) +- vue-meta-3.0.0-alpha.8 +- Router +- [Pinia](https://pinia.vuejs.org/) (Vue 3 default) +- Eslint +- Prettier +- [Tailwind CSS](https://tailwindcss.com/) +- File based routing with [vite-plugin-pages](https://github.com/hannoeru/vite-plugin-pages). (Like [Nuxt file system routing](https://nuxtjs.org/docs/2.x/features/file-system-routing)) +- Layout system with [vite-plugin-vue-layouts](https://github.com/JohnCampionJr/vite-plugin-vue-layouts). (Like [Nuxt layouts](https://nuxtjs.org/docs/2.x/directory-structure/layouts)) +- Components auto importing with [`unplugin-vue-components`](https://github.com/antfu/unplugin-vue-components) +- `~/` alias for `/src`. So we don't have to write something like `../../../SomeModule` to import modules. +- and some custom setups. +[Check out Typescript version here](https://github.com/shamscorner/vitesse-stackter-clean-architect) -# Deploy : - -node ./dist/server/entry.mjs - -## 🚀 Project Structure - -Inside of your Astro project, you'll see the following folders and files: +### Run this project: ``` -/ -├── public/ -│ └── favicon.svg -├── src/ -│ ├── components/ -│ │ └── Card.astro -│ ├── layouts/ -│ │ └── Layout.astro -│ └── pages/ -│ └── index.astro -└── package.json +yarn +yarn dev ``` -Astro looks for `.astro` or `.md` files in the `src/pages/` directory. Each page is exposed as a route based on its file name. +### Change site name -There's nothing special about `src/components/`, but that's where we like to put any Astro/React/Vue/Svelte/Preact components. +In `App.vue` change the following, -Any static assets, like images, can be placed in the `public/` directory. +```Javascript +const siteName = 'Vite App' // add your site name here +``` -## 🧞 Commands +### Layouts -All commands are run from the root of the project, from a terminal: +You can add layouts in your project if you want. You will find `default.vue` and `404.vue` layout examples in this project. For more details, check out [vite-plugin-vue-layouts](https://github.com/JohnCampionJr/vite-plugin-vue-layouts). (Like [Nuxt layouts](https://nuxtjs.org/docs/2.x/directory-structure/layouts) system). -| Command | Action | -| :--------------------- | :------------------------------------------------- | -| `npm install` | Installs dependencies | -| `npm run dev` | Starts local dev server at `localhost:3000` | -| `npm run build` | Build your production site to `./dist/` | -| `npm run preview` | Preview your build locally, before deploying | -| `npm run astro ...` | Run CLI commands like `astro add`, `astro preview` | -| `npm run astro --help` | Get help using the Astro CLI | +### Pages -## 👀 Want to learn more? +You can add pages to your project. You will find some example pages in the `pages` directory (`index.vue`, `about/[name].vue`, and `[...all].vue`). For more details, check out [vite-plugin-pages](https://github.com/hannoeru/vite-plugin-pages). (Like [Nuxt file system routing](https://nuxtjs.org/docs/2.x/features/file-system-routing)). -Feel free to check [our documentation](https://docs.astro.build) or jump into our [Discord server](https://astro.build/chat). +### Meta info + +You can add meta information in your pages. Here is an example, + +```Javascript + +``` + +## Recommended IDE Setup + +[VSCode](https://code.visualstudio.com/) + [Vetur](https://marketplace.visualstudio.com/items?itemName=octref.vetur). Make sure to enable `vetur.experimental.templateInterpolationService` in settings! + +### If Using ` - -
-