Skip to content

Commit

Permalink
feat(nuxt3-ts-scss): added nuxt starter
Browse files Browse the repository at this point in the history
added base config for nuxt without autoumports with ts scss linters viewport mixins  and base hooks
  • Loading branch information
DmitryGuseatnicov committed Feb 2, 2024
1 parent f818d35 commit f69ba71
Show file tree
Hide file tree
Showing 29 changed files with 17,238 additions and 0 deletions.
1 change: 1 addition & 0 deletions src/constants.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ export const CURR_DIR = process.cwd();

export const TEMPLATES_LIST = [
'vue3-ts-sass',
'nuxt3-ts-scss',
];

export const DIRECTORY_CONTENT_AVAILABLE_TO_KEEP = [
Expand Down
3 changes: 3 additions & 0 deletions src/templates/nuxt3-ts-scss/.env
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
NUXT_PUBLIC_API_BASE_URL="https://your-api.ru/"
NUXT_PUBLIC_API_DOMAIN="your-api.ru"
NUXT_PUBLICK_BASE_APP_URL="http://localhost:3000"
27 changes: 27 additions & 0 deletions src/templates/nuxt3-ts-scss/.eslintignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
dist
node_modules
.output
.nuxt
.storybook
storybook-static
.github
coverage
*.log
nuxt.d.ts
.output
.DS_Store
.vscode
.md
package.json
package-lock.json
babel.config.js
graphql
types.ts
generated
components.d.ts
icons.d.ts
auto.d.ts
src-tauri
auto-imports.d.ts
components.d.ts
dist
67 changes: 67 additions & 0 deletions src/templates/nuxt3-ts-scss/.eslintrc.cjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,67 @@
module.exports = {
root: true,
env: {
browser: true,
node: true,
},
parser: 'vue-eslint-parser',
parserOptions: {
parser: '@typescript-eslint/parser',
},
extends: ['@vue/eslint-config-airbnb', '@nuxtjs/eslint-config-typescript', 'plugin:prettier/recommended', 'prettier'],
plugins: ['simple-import-sort'],
rules: {
'vue/multi-word-component-names': 'off',
'vue/camelcase': 'off',
'consistent-return': 'off',
'import/no-extraneous-dependencies': 'off',
'no-unused-vars': 'off',
'@typescript-eslint/no-unused-vars': ['error', { ignoreRestSiblings: true }],
'vue/require-default-prop': 'off',
'vue/no-setup-props-destructure': 'off',
'@typescript-eslint/no-explicit-any': 'off',
'@typescript-eslint/consistent-type-imports': 'error',
'import/extensions': 'off',
'import/no-unresolved': 'off',
'no-console': process.env.NODE_ENV === 'production' ? 'warn' : 'off',
'no-debugger': process.env.NODE_ENV === 'production' ? 'warn' : 'off',
camelcase: 'off',
'vuejs-accessibility/click-events-have-key-events': 'off',
'vuejs-accessibility/form-control-has-label': 'off',
'import/prefer-default-export': 'off',
'linebreak-style': ['error', 'unix'],
'vue/component-tags-order': [
'error',
{
order: ['script', 'template', 'style'],
},
],
'import/no-cycle': 'off',
'no-prototype-builtins': 'off',
'vuejs-accessibility/label-has-for': 'off',
'simple-import-sort/imports': [
'error',
{
groups: [
// Node.js builtins. You could also generate this regex if you use a `.js` config.
// For example: `^(${require("module").builtinModules.join("|")})(/|$)`
[
'^(assert|buffer|child_process|cluster|console|constants|crypto|dgram|dns|domain|events|fs|http|https|module|net|os|path|punycode|querystring|readline|repl|stream|string_decoder|sys|timers|tls|tty|url|util|vm|zlib|freelist|v8|process|async_hooks|http2|perf_hooks)(/.*|$)',
],
// Packages. `react` related packages come first.
['^vue', '^~?\\w', '^#imports', '^#components'],
// Internal packages.
['^(~|~company|~ui|components|utils|config|vendored-lib)(/.*|$)'],
// Side effect imports.
['^\\u0000'],
// Parent imports. Put `..` last.
['^\\.\\.(?!/?$)', '^\\.\\./?$'],
// Other relative imports. Put same-folder imports and `.` last.
['^\\./(?=.*/)(?!/?$)', '^\\.(?!/?$)', '^\\./?$'],
// Style imports.
['^.+\\.s?css$'],
],
},
],
},
};
24 changes: 24 additions & 0 deletions src/templates/nuxt3-ts-scss/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
# Nuxt dev/build outputs
.output
.data
.nuxt
.nitro
.cache
dist

# Node dependencies
node_modules

# Logs
logs
*.log

# Misc
.DS_Store
.fleet
.idea

# Local env files
# .env
# .env.*
!.env.example
15 changes: 15 additions & 0 deletions src/templates/nuxt3-ts-scss/.prettierrc.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
{
"$schema": "https://json.schemastore.org/prettierrc",
"arrowParens": "always",
"bracketSpacing": true,
"endOfLine": "lf",
"jsxBracketSameLine": false,
"jsxSingleQuote": false,
"printWidth": 120,
"proseWrap": "preserve",
"semi": true,
"singleQuote": true,
"tabWidth": 2,
"trailingComma": "all",
"useTabs": false
}
75 changes: 75 additions & 0 deletions src/templates/nuxt3-ts-scss/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,75 @@
# Nuxt 3 Minimal Starter

Look at the [Nuxt 3 documentation](https://nuxt.com/docs/getting-started/introduction) to learn more.

## Setup

Make sure to install the dependencies:

```bash
# npm
npm install

# pnpm
pnpm install

# yarn
yarn install

# bun
bun install
```

## Development Server

Start the development server on `http://localhost:3000`:

```bash
# npm
npm run dev

# pnpm
pnpm run dev

# yarn
yarn dev

# bun
bun run dev
```

## Production

Build the application for production:

```bash
# npm
npm run build

# pnpm
pnpm run build

# yarn
yarn build

# bun
bun run build
```

Locally preview production build:

```bash
# npm
npm run preview

# pnpm
pnpm run preview

# yarn
yarn preview

# bun
bun run preview
```

Check out the [deployment documentation](https://nuxt.com/docs/getting-started/deployment) for more information.
5 changes: 5 additions & 0 deletions src/templates/nuxt3-ts-scss/app.vue
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
<template>
<div>
<NuxtWelcome />
</div>
</template>
103 changes: 103 additions & 0 deletions src/templates/nuxt3-ts-scss/nuxt.config.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,103 @@
// https://nuxt.com/docs/api/configuration/nuxt-config
export default defineNuxtConfig({
devtools: { enabled: true },
imports: {
autoImport: false,
},
features: {
inlineStyles: false,
},
srcDir: 'src',
css: ['@/assets/styles/global.scss'],
vite: {
css: {
preprocessorOptions: {
scss: {
additionalData: `
@import "@/assets/styles/variables.scss";
@import "@/assets/styles/mixins.scss";
`,
},
},
},
},
components: [
{
path: '~/components',
pathPrefix: false,
extensions: ['.ts'],
},
],
modules: [
'@nuxtjs/google-fonts',
'@pinia/nuxt',
'nuxt-viewport',
'@nuxt/image',
'nuxt-svgo',
'@vueuse/nuxt',
'@vueuse/nuxt',
'nuxt-schema-org',
'nuxt-simple-sitemap',
],
googleFonts: {
overwriting: true,
preload: true,
families: {
Roboto: [100, 400, 500, 700],
download: true,
},
subsets: ['cyrillic', 'latin'],
},
image: {
domains: [process.env.NUXT_PUBLIC_API_DOMAIN as string],
format: ['webp', 'jpg', 'png'],
},
svgo: {
autoImportPath: './assets/icons/',
componentPrefix: 'Ic',
svgoConfig: {
multipass: true,
plugins: [
{
name: 'preset-default',
params: {
overrides: {
// or disable plugins
removeDoctype: false,
removeViewBox: false,
cleanupIds: false,
},
},
},
],
},
},
viewport: {
breakpoints: {
mobile: 768,
tabletSmall: 769,
tablet: 1024,
desktop: 1025,
},
cookie: {
name: 'viewport',
},
defaultBreakpoints: {
mobile: 'mobile',
tabletSmall: 'tabletSmall',
tablet: 'tablet',
desktop: 'desktop',
},
fallbackBreakpoint: 'desktop',
},
site: {
url: process.env.NUXT_PUBLICK_BASE_APP_URL,
name: process.env.NUXT_PUBLICK_BASE_APP_URL,
},
runtimeConfig: {
public: {
apiBaseUrl: process.env.NUXT_PUBLIC_API_BASE_URL,
baseURL: process.env.NUXT_PUBLICK_BASE_APP_URL,
},
},
});
Loading

0 comments on commit f69ba71

Please sign in to comment.