Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Rebuild to Astro [wip] #33

Merged
merged 6 commits into from
Jan 27, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .eslintrc.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"extends": ["eslint:recommended", "next", "prettier"],
"extends": ["eslint:recommended", "prettier"],
"parserOptions": {
"ecmaVersion": "latest",
"sourceType": "module"
Expand Down
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -102,3 +102,6 @@ dist

# TernJS port file
.tern-port

# Vercel output directory
.vercel
5 changes: 2 additions & 3 deletions .prettierignore
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,8 @@ pnpm-lock.yaml
package.json

# Build
.next
.vercel
out
dist/
.vercel/

# Readme
README.md
2 changes: 1 addition & 1 deletion .prettierrc
Original file line number Diff line number Diff line change
Expand Up @@ -15,5 +15,5 @@
"trailingComma": "es5",
"useTabs": false,
"vueIndentScriptAndStyle": false,
"plugins": ["prettier-plugin-tailwindcss"]
"plugins": ["prettier-plugin-tailwindcss", "prettier-plugin-astro"]
}
13 changes: 13 additions & 0 deletions astro.config.mjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
// https://astro.build/config
import { defineConfig } from "astro/config";
import tailwind from "@astrojs/tailwind";
import compress from "astro-compress";
import vercel from "@astrojs/vercel/serverless";

// https://astro.build/config
export default defineConfig({
output: "server",
site: "https://views.igorkowalczyk.dev",
adapter: vercel(),
integrations: [tailwind(), compress()],
});
2 changes: 1 addition & 1 deletion database/Connect.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import mongoose from "mongoose";
import Schema from "./Schema";

const uri = process.env.MONGODB_URI;
const uri = import.meta.env.MONGODB_URI;
if (!uri) throw new Error("Please add your Mongo URI to .env file");

const connection = new mongoose.connect(uri, {
Expand Down
2 changes: 2 additions & 0 deletions database/Schema.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
import mongoose from "mongoose";

mongoose.set("strictQuery", true);

const Schema = mongoose.Schema({
username: { type: String, index: true, unique: true },
views: Number,
Expand Down
49 changes: 0 additions & 49 deletions next.config.js

This file was deleted.

44 changes: 20 additions & 24 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,15 +2,16 @@
"name": "@igorkowalczyk/views",
"version": "1.0.0",
"description": "👀 Count the views of your github profile with your own custom badge",
"private": true,
"scripts": {
"start": "next start",
"dev": "NODE_ENV=development next dev",
"build": "next build",
"deploy": "npm run build && npm run start",
"format": "prettier --write . --ignore-unknown",
"dev": "astro dev",
"start": "astro dev",
"build": "astro build",
"preview": "astro preview",
"astro": "astro",
"format": "prettier --write . --ignore-unknown --plugin-search-dir=.",
"format:check": "prettier --check .",
"analyze": "ANALYZE=true next build",
"lint": "next lint"
"lint": "eslint . --ext .js,.jsx,.ts,.tsx,.astro"
},
"repository": {
"type": "git",
Expand All @@ -20,6 +21,7 @@
"views",
"github",
"profile",
"astro",
"mongodb",
"views-counter",
"counter"
Expand All @@ -31,34 +33,28 @@
},
"homepage": "https://github.com/IgorKowalczyk/views#readme",
"dependencies": {
"@astrojs/tailwind": "3.0.0",
"@astrojs/vercel": "^3.0.0",
"@igorkowalczyk/is-browser": "3.0.0",
"@next/font": "13.1.5",
"@vercel/analytics": "0.1.8",
"astro": "2.0.0",
"astro-compress": "1.1.28",
"badge-maker": "3.3.1",
"canvas-confetti": "^1.6.0",
"mini-svg-data-uri": "^1.4.4",
"mongoose": "6.8.4",
"next": "13.1.5",
"react": "18.2.0",
"react-dom": "18.2.0",
"tailwindcss": "3.2.4"
"preact": "^10.11.3",
"prettier-plugin-astro": "^0.7.2",
"tailwindcss": "3.2.4",
"tailwindcss-text-fill": "0.2.0"
},
"devDependencies": {
"@next/bundle-analyzer": "13.1.5",
"@tailwindcss/forms": "0.5.3",
"autoprefixer": "10.4.13",
"compression-webpack-plugin": "10.0.0",
"eslint": "8.32.0",
"eslint-config-next": "13.1.5",
"eslint-config-prettier": "8.6.0",
"lodash-webpack-plugin": "0.11.6",
"postcss": "8.4.21",
"prettier": "2.8.3",
"prettier-plugin-tailwindcss": "0.2.1",
"terser-webpack-plugin": "5.3.6",
"typescript": "4.9.4",
"webpack": "5.75.0"
},
"peerDependencies": {
"typescript": ">=3.3.1"
"prettier-plugin-tailwindcss": "0.2.1"
},
"packageManager": "pnpm@7.26.0"
}
Loading