Skip to content

Commit

Permalink
Restructure and codegen (#451)
Browse files Browse the repository at this point in the history
* Undo shared changes

* Move driver to packages

* Set up lerna

* Rename modules

* Add back testcases

* Fix broken paths

* Make @edgedb/generate package

* Update lint

* Fix Deno generator

* Fix tests

* Fix tests and builds

* Update workflows

* Update workflows

* Update workflows

* Update workflow

* Fix deno test

* Fix ci test, update docs

* Fix setTimeouts

* Update packages

* Fix codegen

* Fix lint

* Update tests

* Fix tets

* Add tests for codegen

* Fix queries tests

* Fix tests

* Implement file mode

* Implement --watch

* Remove watch mode

* Tweak messages

* Add docs, address reviews

* Fix tests

* Update testrunner, remove duplicative generations

* Consolidate syntax

* Move syntax into generate

* Remove comments

* Clean syntax

* Comment out workflows

* Comment out workflows

* Add cli to driver that prints informative message

* Update package version

* Remove logging

* Add no args query

* Remove cardinality inference, implement `filter_single`, split out `interfaces` generator (#460)

* Update copy

* Remove cardinality inference

* Fix tests

* Fix tests

* Separate interfaces generator

* Fix deno. Update docs

* FMC

* Address reviews

* Address reviews

* Run tests

* Run tests

* Run tests

* Simplify $ API

* Move query utils into driver

* Update docs

* Make filter_single work with update and delete

* Add `createHttpClient` api + make client work in browser like environment (#457)

* Add `createHttpClient` api + make client work in browser like environment

* Remove logging

* Update deno/std dependencies

Co-authored-by: Colin McDonnell <[email protected]>

* Update filter docs

* Attempted fix for node-fetch. Fixed interfaces when no edgedb.toml is present

* Update interfaces text

* Fix cast bug

* Fix lint

* Version check on browser tests

* Fix browser test

* Skip browser tests on node < 15

* Add dummy skipped browser test

* Temporarily remove nightly tests

* Simplifications

* Remove plain types from edgeql-js

* Fix expr_Function and linting

* Fix card issue in update

Co-authored-by: James Clarke <[email protected]>
  • Loading branch information
colinhacks and jaclarke authored Oct 20, 2022
1 parent 2fbe94e commit 05f36fd
Show file tree
Hide file tree
Showing 301 changed files with 12,187 additions and 17,070 deletions.
16 changes: 12 additions & 4 deletions .github/workflows/deno-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ jobs:
with:
token: ${{ secrets.RELEASE_BOT_GITHUB_TOKEN }}
repository: edgedb/edgedb-deno
path: edgedb-deno
path: packages/deno

- uses: actions/setup-node@v2
with:
Expand All @@ -30,20 +30,28 @@ jobs:

- name: Install dev deps
run: |
yarn install
yarn
- name: Get version from package.json
id: package-version
uses: martinbeentjes/[email protected]
with:
path: packages/driver


- name: Write version to file
run: |
echo "${{ steps.package-version.outputs.current-version }}"
echo "${{ steps.package-version.outputs.current-version}}" > edgedb-deno/version.txt
# Uncomment to trigger edgedb-deno releases
# - name: Write version to file
# run: |
# echo "${{ steps.package-version.outputs.current-version }}"
# echo "${{ steps.package-version.outputs.current-version}}" > packages/deno/version.txt

- name: Compile for Deno
run: |
yarn build:deno
yarn workspace edgedb build:deno
- name: Push to edgedb-deno
run: ./.github/workflows/push-edgedb-deno.sh
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/push-edgedb-deno.sh
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
cd edgedb-deno
cd packages/deno
git config user.name edgedb-ci
git config user.email [email protected]
git add . -f
git add .

if ! git diff --cached --exit-code > /dev/null;
then
Expand Down
121 changes: 60 additions & 61 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,8 @@ name: release
on:
push:
branches:
- "master"
- "ci"
paths:
- package.json
- master
- ci

jobs:
build_and_publish:
Expand All @@ -18,69 +16,70 @@ jobs:
fetch-depth: 0
submodules: true

- name: Set up Node
uses: actions/setup-node@v1
with:
node-version: 16
# - name: Set up Node
# uses: actions/setup-node@v1
# with:
# node-version: 16

- name: Set up Deno
uses: denoland/setup-deno@v1
with:
deno-version: v1.24.x
# - name: Set up Deno
# uses: denoland/setup-deno@v1
# with:
# deno-version: v1.24.x

- name: Install deps and build
run: |
yarn install
yarn build
# - name: Install deps and build
# run: |
# yarn
# yarn workspaces run build

- id: publish
name: Publish to NPM
uses: JS-DevTools/npm-publish@v1
with:
token: ${{ secrets.NPM_TOKEN }}
dry-run: false
# - id: publish
# name: Publish to NPM
# uses: JS-DevTools/npm-publish@v1
# with:
# package: packages/driver/package.json
# token: ${{ secrets.NPM_TOKEN }}
# dry-run: false

- name: If Publish
if: steps.publish.outputs.type != 'none'
run: |
echo "Published ${{ steps.publish.outputs.type }} version: ${{ steps.publish.outputs.version }}"
# - name: If Publish
# if: steps.publish.outputs.type != 'none'
# run: |
# echo "Published ${{ steps.publish.outputs.type }} version: ${{ steps.publish.outputs.version }}"

- name: If Version Unchanged
if: steps.publish.outputs.type == 'none'
run: |
echo "Version in package.json has not changed. Skipping."
# - name: If Version Unchanged
# if: steps.publish.outputs.type == 'none'
# run: |
# echo "Version in package.json has not changed. Skipping."

- name: Write Changelog Config
run: |
echo '{"categories": [], "template": "## Commits:\n\n${{ '${{UNCATEGORIZED}}' }}", "pr_template": ${{ '"- ${{MERGE_SHA}} ${{TITLE}}"' }} }' > changelog_config.json
cat changelog_config.json
# - name: Write Changelog Config
# run: |
# echo '{"categories": [], "template": "## Commits:\n\n${{ '${{UNCATEGORIZED}}' }}", "pr_template": ${{ '"- ${{MERGE_SHA}} ${{TITLE}}"' }} }' > changelog_config.json
# cat changelog_config.json

- name: Changelog Vars
run: |
echo "last_tag=$(git describe --tags --abbrev=0)" >> $GITHUB_ENV
echo "curr_commit=$(git rev-parse HEAD)" >> $GITHUB_ENV
# - name: Changelog Vars
# run: |
# echo "last_tag=$(git describe --tags --abbrev=0)" >> $GITHUB_ENV
# echo "curr_commit=$(git rev-parse HEAD)" >> $GITHUB_ENV

- name: Build Changelog
id: github_release
uses: mikepenz/[email protected]
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
fromTag: "${{ env.last_tag }}"
toTag: ${{ github.ref }}
commitMode: true
configuration: changelog_config.json
# - name: Build Changelog
# id: github_release
# uses: mikepenz/[email protected]
# env:
# GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
# with:
# fromTag: "${{ env.last_tag }}"
# toTag: ${{ github.ref }}
# commitMode: true
# configuration: changelog_config.json

- name: Create Release
if: steps.publish.outputs.type != 'none'
id: create_release
uses: actions/create-release@latest
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
tag_name: v${{ steps.publish.outputs.version }}
release_name: v${{ steps.publish.outputs.version }}
commitish: ${{ github.ref }}
body: ${{steps.github_release.outputs.changelog}}
draft: false
prerelease: false
# - name: Create Release
# if: steps.publish.outputs.type != 'none'
# id: create_release
# uses: actions/create-release@latest
# env:
# GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
# with:
# tag_name: v${{ steps.publish.outputs.version }}
# release_name: v${{ steps.publish.outputs.version }}
# commitish: ${{ github.ref }}
# body: ${{steps.github_release.outputs.changelog}}
# draft: true
# prerelease: false
29 changes: 10 additions & 19 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,15 +5,9 @@ on:
branches:
- master
- ci
# paths-ignore:
# - "README.md"
# - "docs/**"
pull_request:
branches:
- master
# paths-ignore:
# - "README.md"
# - "docs/**"

jobs:
test:
Expand All @@ -27,9 +21,9 @@ jobs:
os: [ubuntu-latest]
edgedb-version: ["stable"]
include:
- os: ubuntu-latest
node-version: "16"
edgedb-version: "nightly"
# - os: ubuntu-latest
# node-version: "16"
# edgedb-version: "nightly"
- os: ubuntu-latest
node-version: "16"
edgedb-version: "1.4"
Expand All @@ -41,7 +35,7 @@ jobs:
# edgedb-version: "stable"

steps:
- uses: actions/checkout@v1
- uses: actions/checkout@v2
with:
fetch-depth: 50
submodules: true
Expand Down Expand Up @@ -71,16 +65,15 @@ jobs:

- name: Install dev deps
run: |
yarn install
cd qb && yarn install
yarn
- name: Lint
run: |
yarn lint
- name: Build
run: |
yarn build
yarn workspaces run build
# - name: Compile for Deno
# run: |
Expand All @@ -93,19 +86,17 @@ jobs:

- name: Run query builder tests
if: ${{ matrix.node-version >= 14 && matrix.edgedb-version != '1.4'}}
working-directory: qb
run: |
yarn test:ci
yarn workspace @edgedb/generate test:ci
- name: Test qb generation on v1
- name: Test QB generation on v1
if: ${{ matrix.node-version >= 14 && matrix.edgedb-version == '1.4' }}
working-directory: qb
run: |
yarn test:v1
yarn workspace @edgedb/generate test:v1
- name: Run functional tests
run: |
yarn test
yarn workspace edgedb test
# This job exists solely to act as the test job aggregate to be
# targeted by branch policies.
Expand Down
6 changes: 2 additions & 4 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,14 +1,12 @@
dist
/edgedb-deno
/test/deno
packages/deno
/.bench
/.vscode
node_modules
**/.yarn/*
!.yarn/releases

/coverage
/yarn-error.log
**/yarn-error.log
.DS_Store
.vscode
qb/dbschema/edgeql-js
6 changes: 3 additions & 3 deletions .gitmodules
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
[submodule "test/shared-client-testcases"]
path = test/shared-client-testcases
url = https://github.com/edgedb/shared-client-testcases.git
[submodule "packages/driver/test/shared-client-testcases"]
path = packages/driver/test/shared-client-testcases
url = git@github.com:edgedb/shared-client-testcases.git
2 changes: 1 addition & 1 deletion .prettierrc
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"printWidth": 79,
"tabWidth": 2,
"semi": true,
"trailingComma": "es5",
"trailingComma": "none",
"bracketSpacing": false,
"arrowParens": "avoid",
"endOfLine": "auto"
Expand Down
Loading

0 comments on commit 05f36fd

Please sign in to comment.