Skip to content

Commit

Permalink
feat: new command and for use cases on the website (#273)
Browse files Browse the repository at this point in the history
* feat: add new command

* feat: many typo corrected

* feat: add more use cases

* chore: prepare upgrade
  • Loading branch information
zifeo authored Apr 18, 2023
1 parent 08e2302 commit 7b90f61
Show file tree
Hide file tree
Showing 113 changed files with 3,354 additions and 3,208 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ on:
env:
PYTHON_VERSION: "3.8"
POETRY_VERSION: "1.4.1"
DENO_VERSION: "1.32.3"
DENO_VERSION: "1.32.4"

jobs:
check-bump:
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ env:
PROTOC_VERSION: "3.x"
POETRY_VERSION: "1.4.1"
DENO_BINDGEN_URL: https://github.com/metatypedev/deno_bindgen/raw/main/cli.ts
DENO_VERSION: "1.32.3"
DENO_VERSION: "1.32.4"
PNPM_VERSION: "8.1.0"
NODE_VERSION: "19.8.1"

Expand Down
6 changes: 3 additions & 3 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -15,11 +15,11 @@ repos:
- id: end-of-file-fixer
exclude: typegate/deno.lock
- repo: https://github.com/charliermarsh/ruff-pre-commit
rev: "v0.0.254"
rev: "v0.0.261"
hooks:
- id: ruff
- repo: https://github.com/psf/black
rev: 23.1.0
rev: 23.3.0
hooks:
- id: black
- repo: https://github.com/commitizen-tools/commitizen
Expand Down Expand Up @@ -69,7 +69,7 @@ repos:
entry: bash -c 'deno run -A dev/lock.ts --check'
pass_filenames: false
- repo: https://github.com/Lucas-C/pre-commit-hooks
rev: v1.4.2
rev: v1.5.1
hooks:
- id: insert-license
name: "License header python"
Expand Down
3 changes: 2 additions & 1 deletion .vscode/extensions.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
"ms-python.vscode-pylance",
"ms-python.python",
"errata-ai.vale-server",
"hediet.vscode-drawio"
"hediet.vscode-drawio",
"davidlday.languagetool-linter"
]
}
14 changes: 14 additions & 0 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
Expand Up @@ -37,4 +37,18 @@
"[typescript]": {
"editor.defaultFormatter": "denoland.vscode-deno"
},
"languageToolLinter.languageTool.ignoredWordsInWorkspace": [
"cockroachdb",
"deno",
"faas",
"materializer",
"materializers",
"metatype",
"openapi",
"pbac",
"prisma",
"typegate",
"typegates",
"typegraphs"
],
}
32 changes: 26 additions & 6 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion dev/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
ARG RUST_VERSION=1.68.0
ARG DENO_VERSION=1.32.3
ARG DENO_VERSION=1.32.4
ARG DISTROLESS_TAG=nonroot

FROM rust:${RUST_VERSION} AS base
Expand Down
17 changes: 11 additions & 6 deletions dev/lock.ts
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,6 @@ if (args.bump) {
undefined,
"dev",
)!;
lockfile.released.lock = structuredClone(lockfile.dev.lock);
lockfile.dev.lock.METATYPE_VERSION = newVersion;
console.log(`Bumping ${version}${newVersion}`);
}
Expand All @@ -73,13 +72,19 @@ for (const [channel, { files, rules, lock }] of Object.entries(lockfile)) {

for (const [glob, lookups] of Object.entries(rules)) {
const url = resolve(projectDir, glob);
const paths = Array.from(expandGlobSync(url, {
includeDirs: false,
globstar: true,
exclude: ignores,
}));

if (paths.length == 0) {
console.error(`No files found for ${glob}, please check and retry.`);
Deno.exit(1);
}

for (
const { path } of expandGlobSync(url, {
includeDirs: false,
globstar: true,
exclude: ignores,
})
const { path } of paths
) {
const text = Deno.readTextFileSync(path);
const rewrite = [...text.split("\n")];
Expand Down
28 changes: 5 additions & 23 deletions dev/lock.yml
Original file line number Diff line number Diff line change
Expand Up @@ -34,40 +34,22 @@ dev:
'( TYPEGRAPH_VERSION: ").+(")': TYPEGRAPH_VERSION
website/docusaurus.config.js:
'( tagline: ").+(",)': TAGLINE
lock:
PYTHON_VERSION: '3.8'
POETRY_VERSION: 1.4.1
PROTOC_VERSION: 3.x
RUST_VERSION: 1.68.0
DENO_BINDGEN_URL: 'https://github.com/metatypedev/deno_bindgen/raw/main/cli.ts'
DENO_VERSION: 1.32.3
NODE_VERSION: 19.8.1
PNPM_VERSION: 8.1.0
TYPEGRAPH_VERSION: 0.0.1
METATYPE_VERSION: 0.1.5-dev.0
TAGLINE: >-
Compose your data, anywhere, and build iterative API blocks with
zero-trust and serverless deployment, no matter where and how your
(legacy) systems are.
released:
files: {}
rules:
examples/docker-compose.yml:
examples/**/compose.yml:
'( image: ghcr.io/metatypedev/typegate:v).+()': METATYPE_VERSION
examples/pyproject.toml:
(description = ").+("): TAGLINE
examples/**/pyproject.toml:
(version = ").+("): METATYPE_VERSION
(typegraph = ").+("): METATYPE_VERSION
lock:
PYTHON_VERSION: '3.8'
POETRY_VERSION: 1.4.1
PROTOC_VERSION: 3.x
RUST_VERSION: 1.68.0
DENO_BINDGEN_URL: 'https://github.com/metatypedev/deno_bindgen/raw/main/cli.ts'
DENO_VERSION: 1.32.3
DENO_VERSION: 1.32.4
NODE_VERSION: 19.8.1
PNPM_VERSION: 8.1.0
TYPEGRAPH_VERSION: 0.0.1
METATYPE_VERSION: 0.1.4
METATYPE_VERSION: 0.1.5
TAGLINE: >-
Compose your data, anywhere, and build iterative API blocks with
zero-trust and serverless deployment, no matter where and how your
Expand Down
5 changes: 2 additions & 3 deletions examples/demo/demo.py
Original file line number Diff line number Diff line change
@@ -1,10 +1,9 @@
from typegraph import TypeGraph, policies, t
from typegraph.graph.auth import oauth2
from typegraph.providers.prisma.runtimes.prisma import PrismaRuntime
from typegraph.runtimes.python_wasi import PythonWasiRuntime
from typegraph.runtimes.deno import PureFunMat
from typegraph.runtimes.http import HTTPRuntime

from typegraph.runtimes.python_wasi import PythonWasiRuntime

with TypeGraph(
"public-api",
Expand Down Expand Up @@ -58,7 +57,7 @@
).named("user")

g.expose(
insert_user=db.insert_one(user),
insert_user=db.create(user),
users=db.find_many(user),
default_policy=[github_only],
)
Loading

0 comments on commit 7b90f61

Please sign in to comment.