Skip to content

Commit

Permalink
feat: Vue 3.x, Vue Apollo 4.x (#50)
Browse files Browse the repository at this point in the history
  • Loading branch information
nebolsin authored Jun 6, 2024
1 parent 46f19c6 commit b66ad1b
Show file tree
Hide file tree
Showing 55 changed files with 23,388 additions and 15,930 deletions.
15 changes: 0 additions & 15 deletions .eslintrc.js

This file was deleted.

2 changes: 1 addition & 1 deletion .firebaserc
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"projects": {
"prod": "astrograph-io"
"default": "astrograph-io"
}
}
1 change: 1 addition & 0 deletions .husky/pre-commit
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
pnpm lint-staged
28 changes: 5 additions & 23 deletions apollo.config.js
Original file line number Diff line number Diff line change
@@ -1,26 +1,8 @@
const path = require("path");

// Load .env files
const { loadEnv } = require("vue-cli-plugin-apollo/utils/load-env");
const env = loadEnv([
path.resolve(__dirname, ".env"),
path.resolve(__dirname, ".env.local")
]);

module.exports = {
// Docs: https://www.apollographql.com/docs/devtools/apollo-config/
export default {
client: {
service: env.VUE_APP_APOLLO_ENGINE_SERVICE,
service: "astrograph-alpha",
addTypename: false,
includes: ["src/**/*.{js,jsx,ts,tsx,vue,gql}"]
},
service: {
name: env.VUE_APP_APOLLO_ENGINE_SERVICE,
localSchemaFile: path.resolve(
__dirname,
"./node_modules/.temp/graphql/schema.json"
)
},
engine: {
endpoint: process.env.APOLLO_ENGINE_API_ENDPOINT,
apiKey: env.VUE_APP_APOLLO_ENGINE_KEY
}
};
}
6 changes: 0 additions & 6 deletions babel.config.js

This file was deleted.

47 changes: 47 additions & 0 deletions eslint.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
import globals from "globals"
import jsPlugin from "@eslint/js"
import tsPlugin from "typescript-eslint"
import prettierPlugin from "eslint-plugin-prettier/recommended"
import vuePlugin from "eslint-plugin-vue"
import * as graphqlPlugin from "@graphql-eslint/eslint-plugin"

export default tsPlugin.config(
jsPlugin.configs.recommended,
...tsPlugin.configs.recommended,
...vuePlugin.configs["flat/recommended"],
{
languageOptions: {
ecmaVersion: 2022,
sourceType: "module",
globals: {
...globals.browser,
Prism: "readonly"
}
},
plugins: {
"@graphql-eslint": graphqlPlugin
}
},
{
files: ["*.vue", "**/*.vue"],
languageOptions: {
parserOptions: {
parser: tsPlugin.parser
}
}
},
// {
// // Setup recommended config for schema files
// files: [SCHEMA_PATH],
// ...graphqlPlugin.flatConfigs['schema-recommended'],
// },
{
// Setup recommended config for operations files
files: ["src/**/*.{graphql,gql}"],
...graphqlPlugin.flatConfigs["operations-recommended"]
},
{
ignores: ["_playground/**", "dist/**/*.js", "public/**/*.js"]
},
prettierPlugin
)
4 changes: 2 additions & 2 deletions firebase.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"hosting": {
"public": "dist",
"cleanUrls": "true",
"cleanUrls": true,
"ignore": [
"firebase.json",
"**/.*",
Expand Down Expand Up @@ -65,6 +65,6 @@
"type": 301
}
],
"predeploy": "yarn build && yarn docs:schema"
"predeploy": "pnpm build && pnpm run docs:schema"
}
}
16 changes: 16 additions & 0 deletions graphql.config.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
schema: ./server/schema.graphql
documents: ./src/graphql/*.gql

extensions:
codegen:
generates:
./src/types.ts:
plugins:
- typescript
- typescript-resolvers
endpoints:
Astrograph Pubnet:
url: https://pubnet.astrograph.io/graphql
headers:
user-agent: Astrograph.io
introspect: false
115 changes: 115 additions & 0 deletions index.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,115 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8" />
<meta http-equiv="X-UA-Compatible" content="IE=edge" />
<meta name="viewport" content="width=device-width,initial-scale=1.0" />
<title>Astrograph</title>
<link rel="preconnect" href="https://fonts.googleapis.com/" />
<link rel="preconnect" href="https://www.googletagmanager.com/" />
<link rel="preconnect" href="https://www.google-analytics.com" />
<link rel="icon" href="/favicon.ico" />
<link rel="apple-touch-icon" sizes="512x512" href="/icon-512x512.png" />
<meta itemprop="name" content="Astrograph" />
<meta name="description" content="GraphQL interface to Stellar blockchain. Access Stellar ledger via GraphQL" />
<meta itemprop="image" content="/icon-512x512.png" />
<meta name="twitter:card" content="summary" />
<meta name="twitter:site" content="@evilmartians" />
<meta name="twitter:title" content="Astrograph" />
<meta
name="twitter:description"
content="GraphQL interface to Stellar blockchain. Access Stellar ledger via GraphQL"
/>
<meta name="twitter:creator" content="@evilmartians" />
<meta name="twitter:image" content="/icon-512x512.png" />
<meta property="og:title" content="Astrograph" />
<meta property="og:type" content="website" />
<meta property="og:url" content="%BASE_URL%" />
<meta property="og:image" content="/icon-512x512.png" />
<meta property="og:description" content="GraphQL interface to Stellar blockchain. Access Stellar ledger via GraphQL" />
<meta property="og:site_name" content="Astrograph" />
<script type="application/ld+json">
{
"@context": "http://schema.org/",
"@type": "WebSite",
"name": "Astrograph",
"url": "https://astrograph.io"
}
</script>
<script type="application/ld+json">
{
"@context": "http://schema.org/",
"@type": "SoftwareSourceCode",
"image": "https://astrograph.io/icon-512x512.png",
"name": "Astrograph",
"description": "GraphQL interface to Stellar blockchain. Access Stellar ledger via GraphQL",
"codeRepository": "https://github.com/astroband/astrograph"
}
</script>
<script type="application/ld+json">
{
"@context": "http://schema.org/",
"@type": "SoftwareApplication",
"image": "https://astrograph.io/icon-512x512.png",
"name": "Astrograph",
"applicationCategory": "Web",
"operatingSystem": "Any"
}
</script>
<!-- Google Tag Manager -->
<script>
(function(w, d, s, l, i) {
w[l] = w[l] || [];
w[l].push({ "gtm.start": new Date().getTime(), event: "gtm.js" });
var f = d.getElementsByTagName(s)[0],
j = d.createElement(s),
dl = l != "dataLayer" ? "&l=" + l : "";
j.async = true;
j.src = "https://www.googletagmanager.com/gtm.js?id=" + i + dl;
f.parentNode.insertBefore(j, f);
})(window, document, "script", "dataLayer", "GTM-KQNGZJ5");
</script>
<script src="/prism.js"></script>
<!-- End Google Tag Manager -->
</head>

<body>
<!-- Google Tag Manager (noscript) -->
<noscript
><iframe
src="https://www.googletagmanager.com/ns.html?id=GTM-KQNGZJ5"
height="0"
width="0"
style="display:none;visibility:hidden"
></iframe
></noscript>
<!-- End Google Tag Manager (noscript) -->

<noscript>
<h1>Astrograph</h1>
<h2>
GraphQL interface to Stellar blockchain. Access Stellar ledger via
GraphQL
</h2>

<p>
Astrograph is a GraphQL server for the
<a href="https://www.stellar.org/" rel="nofollow">Stellar</a> network.
You can think about it as a GraphQL version of
<a href="https://github.com/stellar/go/tree/master/services/horizon" rel="nofollow">Horizon</a>,
the client-facing API server for the Stellar ecosystem.
</p>

<p>
Astrograph allows you to retrieve various data from the blockchain, as
well as allowing you to subscribe to particular events using
<a href="https://github.com/apollographql/graphql-subscriptions" rel="nofollow">GraphQL subscriptions</a>
mechanisms.
</p>
</noscript>

<div id="app"></div>

<script type="module" src="/src/main.ts"></script>
</body>
</html>
101 changes: 56 additions & 45 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,48 +2,64 @@
"name": "astrograph-landing",
"version": "0.1.0",
"private": true,
"type": "module",
"scripts": {
"serve": "vue-cli-service serve",
"build": "vue-cli-service build",
"lint": "vue-cli-service lint",
"dev": "vite",
"build": "vite build",
"type-check": "vue-tsc --build --force",
"preview": "vite preview",
"test:unit": "vitest",
"lint": "eslint --fix",
"deploy": "firebase deploy",
"docs:schema": "graphdoc -f"
"docs:schema": "graphdoc -s ./server/schema.json -o ./dist/docs/schema -f",
"format": "prettier --write src/",
"prepare": "husky"
},
"dependencies": {
"apollo-client": "^2.0.0",
"apollo-link": "^1.0.0",
"apollo-link-ws": "^1.0.20",
"graphql": "^14.4.2",
"mustache": "^3.0.1",
"prismjs": "^1.23.0",
"regenerator-runtime": "^0.13.7",
"subscriptions-transport-ws": "^0.9.18",
"vue": "^2.6.10",
"vue-apollo": "^3.0.5",
"vue-json-pretty": "^1.7.1"
"@apollo/client": "^3.10.4",
"@vue/apollo-components": "^4.0.0",
"@vue/apollo-composable": "^4.0.2",
"@vue/apollo-option": "^4.0.0",
"@vue/apollo-util": "4.0.0-beta.6",
"graphql": "^16.8.1",
"graphql-ws": "^5.16.0",
"prismjs": "^1.29.0",
"vue": "^3.4.27",
"vue-json-pretty": "^2.4.0"
},
"devDependencies": {
"@2fd/graphdoc": "^2.4.0",
"@babel/core": "^7.12.3",
"@babel/plugin-transform-runtime": "^7.12.1",
"@vue/cli-plugin-babel": "~4.5.0",
"@vue/cli-plugin-eslint": "~4.5.0",
"@vue/cli-service": "^4.5.8",
"@vue/cli-shared-utils": "^4.5.8",
"@vue/eslint-config-prettier": "^6.0.0",
"babel-eslint": "^10.1.0",
"babel-plugin-prismjs": "^1.0.2",
"eslint": "^6.7.2",
"eslint-plugin-graphql": "^4.0.0",
"eslint-plugin-prettier": "^3.1.3",
"eslint-plugin-vue": "^6.2.2",
"firebase-tools": "^8.13.1",
"graphql-tag": "^2.10.1",
"@apollo/rover": "^0.23.0",
"@eslint/js": "^9.4.0",
"@graphql-eslint/eslint-plugin": "4.0.0-alpha-20230810160036-304c2c0",
"@tsconfig/node20": "^20.1.4",
"@types/eslint__js": "^8.42.3",
"@types/jsdom": "^21.1.7",
"@types/node": "^20.14.2",
"@types/prismjs": "^1.26.4",
"@vitejs/plugin-vue": "^5.0.5",
"@vue/compiler-sfc": "^3.4.27",
"@vue/test-utils": "^2.4.6",
"@vue/tsconfig": "^0.5.1",
"autoprefixer": "^10.4.19",
"eslint": "^9.4.0",
"eslint-config-prettier": "^9.1.0",
"eslint-plugin-prettier": "^5.1.3",
"eslint-plugin-vue": "^9.26.0",
"firebase-tools": "^13.11.0",
"globals": "^15.3.0",
"graphql-config": "^5.0.3",
"husky": "^9.0.11",
"jsdom": "^24.1.0",
"lint-staged": "^9.5.0",
"prettier": "^1.19.1",
"typescript": "^4.2.4",
"vue-cli-plugin-apollo": "^0.22.2",
"vue-template-compiler": "^2.6.10"
"prettier": "^3.3.1",
"typescript": "^5.4.5",
"typescript-eslint": "8.0.0-alpha.28",
"vite": "^5.2.12",
"vite-plugin-checker": "^0.6.4",
"vite-plugin-vue-devtools": "^7.2.1",
"vitest": "^1.6.0",
"vue-tsc": "^2.0.19"
},
"postcss": {
"plugins": {
Expand All @@ -55,17 +71,12 @@
"last 2 versions",
"not ie <= 8"
],
"gitHooks": {
"pre-commit": "lint-staged"
"lint-staged": {
"*.{ts,tsx,vue}": ["eslint --fix", "git add"]
},
"graphdoc": {
"endpoint": "https://pubnet.astrograph.io/graphql",
"output": "./dist/docs/schema"
"engines": {
"node": ">=20",
"pnpm": ">=9"
},
"lint-staged": {
"*.{js,jsx,vue}": [
"vue-cli-service lint",
"git add"
]
}
"packageManager": "pnpm@9.2.0+sha512.98a80fd11c2e7096747762304106432b3ddc67dcf54b5a8c01c93f68a2cd5e05e6821849522a06fb76284d41a2660d5e334f2ee3bbf29183bf2e739b1dafa771"
}
Loading

0 comments on commit b66ad1b

Please sign in to comment.