Skip to content
This repository was archived by the owner on Oct 18, 2025. It is now read-only.

Commit 721eaba

Browse files
authored
Create Next.js Grafserv package and create an example PostGraphile server (#17)
1 parent 302b724 commit 721eaba

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

43 files changed

+3252
-371
lines changed

.github/workflows/check.yaml

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,11 +24,18 @@ jobs:
2424
uses: actions/[email protected]
2525
with:
2626
fetch-depth: 2
27+
- name: Install Poetry
28+
run: pipx install poetry
2729
- name: Setup Node.js
2830
uses: actions/[email protected]
2931
with:
3032
cache: yarn
3133
node-version-file: .node-version
34+
- name: Setup Python
35+
uses: actions/[email protected]
36+
with:
37+
cache: poetry
38+
python-version-file: .python-version
3239
- name: Install Node.js dependencies
3340
run: yarn install --immutable
3441
- name: Build

.gitignore

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,10 @@
11
*.log
22
.DS_Store
3-
.turbo
4-
node_modules
53
.pnp.*
4+
.turbo
5+
.venv
66
.yarn/*
7+
node_modules
78
!.yarn/patches
89
!.yarn/plugins
910
!.yarn/releases

.python-version

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
3.11

.sqlfluff

Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
[sqlfluff]
2+
dialect = postgres
3+
max_line_length = 120
4+
templater = placeholder
5+
6+
[sqlfluff:templater:placeholder]
7+
DATABASE_OWNER=owner_role
8+
param_style = colon
9+
10+
[sqlfluff:rules:ambiguous.column_references]
11+
group_by_and_order_by_style = explicit
12+
13+
[sqlfluff:rules:ambiguous.join]
14+
fully_qualify_join_types = both
15+
16+
[sqlfluff:rules:capitalisation.functions]
17+
capitalisation_policy = lower
18+
extended_capitalisation_policy = lower
19+
20+
[sqlfluff:rules:capitalisation.identifiers]
21+
capitalisation_policy = lower
22+
extended_capitalisation_policy = lower
23+
24+
[sqlfluff:rules:capitalisation.literals]
25+
capitalisation_policy = upper
26+
27+
[sqlfluff:rules:capitalisation.keywords]
28+
capitalisation_policy = upper
29+
30+
[sqlfluff:rules:capitalisation.types]
31+
extended_capitalisation_policy = lower
32+
33+
[sqlfluff:rules:convention.casting_style]
34+
preferred_type_casting_style = shorthand
35+
36+
[sqlfluff:rules:references.consistent]
37+
single_table_references = unqualified

.sqlfluffignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
**/committed/*.sql
2+
schema.sql

.yarn/patches/ruru-npm-2.0.0-beta.12-299bc077af.patch

Lines changed: 71 additions & 0 deletions
Large diffs are not rendered by default.
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
/* eslint-disable */
2+
//prettier-ignore
3+
module.exports = {
4+
name: "@yarnpkg/plugin-after-install",
5+
factory: function (require) {
6+
"use strict";var plugin=(()=>{var s=Object.defineProperty;var g=Object.getOwnPropertyDescriptor;var x=Object.getOwnPropertyNames;var C=Object.prototype.hasOwnProperty;var r=(t=>typeof require<"u"?require:typeof Proxy<"u"?new Proxy(t,{get:(o,e)=>(typeof require<"u"?require:o)[e]}):t)(function(t){if(typeof require<"u")return require.apply(this,arguments);throw new Error('Dynamic require of "'+t+'" is not supported')});var I=(t,o)=>{for(var e in o)s(t,e,{get:o[e],enumerable:!0})},h=(t,o,e,a)=>{if(o&&typeof o=="object"||typeof o=="function")for(let n of x(o))!C.call(t,n)&&n!==e&&s(t,n,{get:()=>o[n],enumerable:!(a=g(o,n))||a.enumerable});return t};var k=t=>h(s({},"__esModule",{value:!0}),t);var P={};I(P,{default:()=>y});var d=r("@yarnpkg/core");var f=r("@yarnpkg/core"),c={afterInstall:{description:"Hook that will always run after install",type:f.SettingsType.STRING,default:""}};var p=r("clipanion"),u=r("@yarnpkg/core");var m=r("@yarnpkg/shell"),l=async(t,o)=>{let e=t.get("afterInstall"),a=!!t.projectCwd?.endsWith(`dlx-${process.pid}`);return e&&!a?(o&&console.log("Running `afterInstall` hook..."),(0,m.execute)(e,[],{cwd:t.projectCwd||void 0})):0};var i=class extends p.Command{async execute(){let o=await u.Configuration.find(this.context.cwd,this.context.plugins);return l(o,!1)}};i.paths=[["after-install"]];var w={configuration:c,commands:[i],hooks:{afterAllInstalled:async(t,o)=>{if(o?.mode===d.InstallMode.UpdateLockfile)return;if(await l(t.configuration,!0))throw new Error("The `afterInstall` hook failed, see output above.")}}},y=w;return k(P);})();
7+
return plugin;
8+
}
9+
};

.yarnrc.yml

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,10 @@
1+
afterInstall: yarn workspaces foreach -A run postinstall
12
compressionLevel: mixed
2-
33
enableGlobalCache: false
4-
54
nodeLinker: node-modules
6-
75
npmPublishAccess: public
8-
6+
plugins:
7+
- checksum: 0a2a35fbed2f33f0df1ceb1db51bf72554201f994eaecb86cbc62a295c3d05f7cc44fa8be8e64fc5e1c0bee4f529a17a0cc429ea9e3486ad467443291d5a8e3b
8+
path: .yarn/plugins/@yarnpkg/plugin-after-install.cjs
9+
spec: "https://raw.githubusercontent.com/mhassan1/yarn-plugin-after-install/v0.6.0/bundles/@yarnpkg/plugin-after-install.js"
910
yarnPath: .yarn/releases/yarn-4.2.2.cjs

package.json

Lines changed: 11 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
{
2-
"name": "@spear-ai/api-monorepo",
2+
"name": "@spear-ai/monorepo",
33
"version": "1.0.0",
44
"description": "Spear API",
55
"author": {
@@ -10,11 +10,12 @@
1010
"type": "module",
1111
"dependencies": {
1212
"@changesets/changelog-github": "0.5.0",
13-
"@changesets/cli": "2.27.2",
13+
"@changesets/cli": "2.27.3",
1414
"@commitlint/cli": "19.3.0",
1515
"@commitlint/types": "19.0.3",
16-
"@spear-ai/commitlint-config": "3.1.1",
17-
"@spear-ai/eslint-config": "19.0.0",
16+
"@delucis/if-env": "1.1.2",
17+
"@spear-ai/commitlint-config": "3.2.0",
18+
"@spear-ai/eslint-config": "20.0.0",
1819
"@spear-ai/npm-package-json-lint-config": "3.1.1",
1920
"@spear-ai/prettier-config": "2.2.0",
2021
"@spear-ai/tsconfig": "4.0.0",
@@ -36,20 +37,24 @@
3637
"type": "git",
3738
"url": "https://github.com/spear-ai/api.git"
3839
},
40+
"resolutions": {
41+
"ruru@npm:^2.0.0-beta.12": "patch:ruru@npm%3A2.0.0-beta.12#~/.yarn/patches/ruru-npm-2.0.0-beta.12-299bc077af.patch"
42+
},
3943
"scripts": {
4044
"version": "changeset version && yarn workspaces foreach -A run sync-version",
4145
"commitlint:check": "commitlint --from=HEAD^1",
4246
"eslint:check": "eslint --max-warnings 0 .",
4347
"eslint:fix": "yarn eslint:check --fix",
44-
"github-actions:push": "act push -s GH_PAT=$GH_PAT -s GITHUB_TOKEN=$GH_PAT -s NPM_TOKEN=$NPM_TOKEN",
45-
"github-actions:push:release-tag": "act push -e .github/test-events/push-release-tag.json -s GH_PAT=$GH_PAT -s GITHUB_TOKEN=$GH_PAT",
4648
"npmpkgjsonlint:check": "npmPkgJsonLint .",
49+
"postinstall": "if-env VERCEL='1' || (husky install && poetry install --no-root && cp .venv/lib/python3.11/site-packages/spear_ai_sqlfluff_config/.sqlfluff .sqlfluff)",
4750
"prettier:check": "prettier --check .",
4851
"prettier:fix": "prettier --write .",
4952
"publish-packages": "yarn run publish-packages:npm && yarn run publish-packages:github && yarn run publish-packages:custom && yarn changeset tag",
5053
"publish-packages:custom": "yarn workspaces foreach -A run publish-package",
5154
"publish-packages:github": "npm_config_registry=https://npm.pkg.github.com changeset publish --no-git-tag",
5255
"publish-packages:npm": "changeset publish --no-git-tag",
56+
"sqlfluff:check": "poetry run sqlfluff lint packages/example-postgraphile-server/src/**/*.sql",
57+
"sqlfluff:fix": "poetry run sqlfluff fix packages/example-postgraphile-server/src/**/*.sql --force",
5358
"typescript:check": "tsc --noEmit"
5459
},
5560
"workspaces": [
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
POSTGRES_URL=postgresql://postgres:postgres@localhost:5432/postgres

0 commit comments

Comments
 (0)