Skip to content

Commit

Permalink
feat: migrate from nuxt 3 beta to astro
Browse files Browse the repository at this point in the history
  • Loading branch information
felix-berlin committed Nov 11, 2023
1 parent 864a9bb commit 36fdff1
Show file tree
Hide file tree
Showing 112 changed files with 175,630 additions and 41,031 deletions.
3 changes: 3 additions & 0 deletions .browserslistrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
last 2 versions
not dead
> 0.2%
1 change: 1 addition & 0 deletions .editorconfig
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
root = true

[*]
max_line_length = 100
indent_style = space
indent_size = 2
end_of_line = lf
Expand Down
14 changes: 8 additions & 6 deletions .env.example
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
BASE_URL=https://berliner-schnauze.wtf
BASE_API_URL=https://webshaped.de
SENTRY_AUTH_TOKEN=''
SENTRY_DNS=''
SENTRY_ORG=''
SENTRY_PROJECT=''
# WP GraphQL API
API_BASE=""
# WP GraphQL API
PUBLIC_WP_API=""
# WP REST API
PUBLIC_WP_REST_API=""
# Enable or disable analytics
ENABLE_ANALYTICS=false
69 changes: 52 additions & 17 deletions .eslintrc.cjs
Original file line number Diff line number Diff line change
@@ -1,20 +1,55 @@
/* eslint-env node */
module.exports = {
root: true,
env: {
browser: true,
node: true
},
parser: 'vue-eslint-parser',
parserOptions: {
parser: '@typescript-eslint/parser'
},
extends: [
'@nuxtjs',
'plugin:nuxt/recommended',
'@nuxtjs/eslint-config-typescript'
"eslint:recommended",
"plugin:@typescript-eslint/recommended",
"plugin:astro/recommended",
"plugin:astro/jsx-a11y-recommended",
"plugin:vue/vue3-recommended",
"plugin:vuejs-accessibility/recommended",
"prettier",
],
parser: "@typescript-eslint/parser",
plugins: ["@typescript-eslint"],
root: true,
overrides: [
{
// Define the configuration for `.astro` file.
files: ["*.astro"],
// Allows Astro components to be parsed.
parser: "astro-eslint-parser",
// Parse the script in `.astro` as TypeScript by adding the following configuration.
// It's the setting you need when using TypeScript.
parserOptions: {
parser: "@typescript-eslint/parser",
extraFileExtensions: [".astro"],
},
rules: {
// override/add rules settings here, such as:
// "astro/no-set-html-directive": "error"
},
},
{
files: ["*.vue"],
parser: "vue-eslint-parser",
parserOptions: {
parser: "@typescript-eslint/parser",
extraFileExtensions: [".vue"],
},
rules: {
"vuejs-accessibility/label-has-for": [
"error",
{
components: ["VLabel"],
controlComponents: ["VInput"],
required: {
every: ["id"],
},
allowChildren: false,
},
],
},
},
],
plugins: [],
rules: {
'@typescript-eslint/no-unused-vars': 'warn'
}
}
rules: {},
};
11 changes: 0 additions & 11 deletions .github/dependabot.yml

This file was deleted.

38 changes: 31 additions & 7 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,9 +1,33 @@
node_modules
*.log*
.nuxt
.nitro
.cache
.output
# build output
dist/
dev-dist/
.astro

# test output
coverage

# dependencies
node_modules/

# logs
npm-debug.log*
yarn-debug.log*
yarn-error.log*
pnpm-debug.log*


# environment variables
.env
dist
.env.production
.env.development

# macOS-specific files
.DS_Store

# Windows specific files
.

.idea
/test-results/
/playwright-report/
/playwright/.cache/
17 changes: 17 additions & 0 deletions .graphqlrc.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
import type { IGraphQLConfig } from "graphql-config";

const config: IGraphQLConfig = {
schema: "https://cms.webshaped.de/api",
extensions: {
codegen: {
generates: {
"./src/types/generated/graphql.d.ts": {
plugins: ["typescript", "typescript-operations", "introspection"],
preset: "client",
},
},
},
},
};

export default config;
3 changes: 2 additions & 1 deletion .npmrc
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
# Expose Astro dependencies for `pnpm` users
shamefully-hoist=true
strict-peer-dependencies=false
enable-pre-post-scripts=true
10 changes: 10 additions & 0 deletions .postcssrc.cjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
module.exports = {
plugins: [
require("autoprefixer"),
require("postcss-preset-env")({
features: {
"cascade-layers": false,
},
}),
],
};
3 changes: 3 additions & 0 deletions .prettierignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
.astro
coverage
dist
11 changes: 11 additions & 0 deletions .prettierrc.cjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
module.exports = {
plugins: [require.resolve("prettier-plugin-astro")],
overrides: [
{
files: "*.astro",
options: {
parser: "astro",
},
},
],
};
2 changes: 1 addition & 1 deletion .releaserc
Original file line number Diff line number Diff line change
Expand Up @@ -48,4 +48,4 @@
]
],
"dryRun": false
}
}
1 change: 1 addition & 0 deletions .stylelintignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
src/**/*.ts
4 changes: 4 additions & 0 deletions .vscode/extensions.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
{
"recommendations": ["astro-build.astro-vscode"],
"unwantedRecommendations": []
}
11 changes: 11 additions & 0 deletions .vscode/launch.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
{
"version": "0.2.0",
"configurations": [
{
"command": "./node_modules/.bin/astro dev",
"name": "Development server",
"request": "launch",
"type": "node-terminal"
}
]
}
8 changes: 0 additions & 8 deletions README copy.md

This file was deleted.

46 changes: 6 additions & 40 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,42 +1,8 @@
# Nuxt 3 Minimal Starter
# Berliner Schnauze

Look at the [Nuxt 3 documentation](https://nuxt.com/docs/getting-started/introduction) to learn more.
![GitHub Workflow Status](https://img.shields.io/github/workflow/status/felix-berlin/berliner-schnauze/cd?label=website%20build&style=flat-square)
![GitHub package.json version](https://img.shields.io/github/package-json/v/felix-berlin/berliner-schnauze?label=github&style=flat-square)
![Website](https://img.shields.io/website?style=flat-square&url=https%3A%2F%2Fberliner-schnauze.wtf)

## Setup

Make sure to install the dependencies:

```bash
# yarn
yarn install

# npm
npm install

# pnpm
pnpm install
```

## Development Server

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

```bash
npm run dev
```

## Production

Build the application for production:

```bash
npm run build
```

Locally preview production build:

```bash
npm run preview
```

Check out the [deployment documentation](https://nuxt.com/docs/getting-started/deployment) for more information.
> Small Berlinerisch to Hochdeutsch Dictionary.
---
21 changes: 21 additions & 0 deletions alias.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
import path, { dirname } from "node:path";
import { fileURLToPath } from "url";

const __filename = fileURLToPath(import.meta.url);
const __dirname = dirname(__filename);

export default {
"@components": `${path.resolve(__dirname, "./src/components/")}/`,
"@composables": `${path.resolve(__dirname, "./src/composables/")}/`,
"@stores": `${path.resolve(__dirname, "./src/stores/")}/`,
"@layouts": path.resolve(__dirname, "./src/layouts/"),
"@lib": path.resolve(__dirname, "./src/lib/"),
"@utils": path.resolve(__dirname, "./src/utils/"),
"@ts_types": path.resolve(__dirname, "./src/types/"),
"@features": path.resolve(__dirname, "./src/features/"),
"@services": path.resolve(__dirname, "./src/services/"),
"@sass-butler/": `${path.resolve(__dirname, "node_modules/@felix_berlin/sass-butler/")}/`,
"@styles/": `${path.resolve(__dirname, "src/styles/")}/`,
"@types/": `${path.resolve(__dirname, "src/types/")}/`,
"@assets/": `${path.resolve(__dirname, "src/assets/")}/`,
};
48 changes: 48 additions & 0 deletions astro.config.mjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
import { defineConfig } from "astro/config";
import vue from "@astrojs/vue";
import sitemap from "@astrojs/sitemap";
import matomo from "astro-matomo";
import Icons from "unplugin-icons/vite";
import allAlias from "./alias.ts";

// https://astro.build/config
export default defineConfig({
site: import.meta.env.DEV ? "http://localhost:4321" : "https://beta.berliner-schnauze.pages.dev",
prefetch: true,
integrations: [
vue({
appEntrypoint: "/src/pages/_app",
script: {
propsDestructure: true,
},
}),
sitemap({
lastmod: new Date(),
}),
matomo({
enabled: import.meta.env.PROD,
host: "https://analytics.webshaped.de/",
siteId: 8,
debug: true,
heartBeatTimer: 5,
disableCookies: true,
}),
],
vite: {
plugins: [
Icons({
iconCustomizer(collection, icon, props) {
// customize all icons in this collection
if (collection === "tabler" || collection === "lucide") {
props.width = "24";
props.height = "24";
}
},
}), // chooses the compiler automatically
],

resolve: {
alias: allAlias,
},
},
});
13 changes: 13 additions & 0 deletions codegen.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
overwrite: true
schema: "https://cms.webshaped.de/api"
documents: null
generates:
src/types/generated/graphql.d.ts:
plugins:
- typescript
- typescript-operations
config:
maybeValue: "T | null | undefined"
./graphql.schema.json:
plugins:
- "introspection"
1 change: 0 additions & 1 deletion commitlint.config.js

This file was deleted.

Loading

0 comments on commit 36fdff1

Please sign in to comment.