Skip to content

Commit 05f36fd

Browse files
colinhacksjaclarke
andauthored
Restructure and codegen (#451)
* 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]>
1 parent 2fbe94e commit 05f36fd

File tree

301 files changed

+12187
-17070
lines changed

Some content is hidden

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

301 files changed

+12187
-17070
lines changed

.github/workflows/deno-release.yml

Lines changed: 12 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ jobs:
1818
with:
1919
token: ${{ secrets.RELEASE_BOT_GITHUB_TOKEN }}
2020
repository: edgedb/edgedb-deno
21-
path: edgedb-deno
21+
path: packages/deno
2222

2323
- uses: actions/setup-node@v2
2424
with:
@@ -30,20 +30,28 @@ jobs:
3030

3131
- name: Install dev deps
3232
run: |
33-
yarn install
33+
yarn
3434
3535
- name: Get version from package.json
3636
id: package-version
3737
uses: martinbeentjes/[email protected]
38+
with:
39+
path: packages/driver
40+
3841

3942
- name: Write version to file
4043
run: |
4144
echo "${{ steps.package-version.outputs.current-version }}"
42-
echo "${{ steps.package-version.outputs.current-version}}" > edgedb-deno/version.txt
45+
46+
# Uncomment to trigger edgedb-deno releases
47+
# - name: Write version to file
48+
# run: |
49+
# echo "${{ steps.package-version.outputs.current-version }}"
50+
# echo "${{ steps.package-version.outputs.current-version}}" > packages/deno/version.txt
4351

4452
- name: Compile for Deno
4553
run: |
46-
yarn build:deno
54+
yarn workspace edgedb build:deno
4755
4856
- name: Push to edgedb-deno
4957
run: ./.github/workflows/push-edgedb-deno.sh

.github/workflows/push-edgedb-deno.sh

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
1-
cd edgedb-deno
1+
cd packages/deno
22
git config user.name edgedb-ci
33
git config user.email [email protected]
4-
git add . -f
4+
git add .
55

66
if ! git diff --cached --exit-code > /dev/null;
77
then

.github/workflows/release.yml

Lines changed: 60 additions & 61 deletions
Original file line numberDiff line numberDiff line change
@@ -4,10 +4,8 @@ name: release
44
on:
55
push:
66
branches:
7-
- "master"
8-
- "ci"
9-
paths:
10-
- package.json
7+
- master
8+
- ci
119

1210
jobs:
1311
build_and_publish:
@@ -18,69 +16,70 @@ jobs:
1816
fetch-depth: 0
1917
submodules: true
2018

21-
- name: Set up Node
22-
uses: actions/setup-node@v1
23-
with:
24-
node-version: 16
19+
# - name: Set up Node
20+
# uses: actions/setup-node@v1
21+
# with:
22+
# node-version: 16
2523

26-
- name: Set up Deno
27-
uses: denoland/setup-deno@v1
28-
with:
29-
deno-version: v1.24.x
24+
# - name: Set up Deno
25+
# uses: denoland/setup-deno@v1
26+
# with:
27+
# deno-version: v1.24.x
3028

31-
- name: Install deps and build
32-
run: |
33-
yarn install
34-
yarn build
29+
# - name: Install deps and build
30+
# run: |
31+
# yarn
32+
# yarn workspaces run build
3533

36-
- id: publish
37-
name: Publish to NPM
38-
uses: JS-DevTools/npm-publish@v1
39-
with:
40-
token: ${{ secrets.NPM_TOKEN }}
41-
dry-run: false
34+
# - id: publish
35+
# name: Publish to NPM
36+
# uses: JS-DevTools/npm-publish@v1
37+
# with:
38+
# package: packages/driver/package.json
39+
# token: ${{ secrets.NPM_TOKEN }}
40+
# dry-run: false
4241

43-
- name: If Publish
44-
if: steps.publish.outputs.type != 'none'
45-
run: |
46-
echo "Published ${{ steps.publish.outputs.type }} version: ${{ steps.publish.outputs.version }}"
42+
# - name: If Publish
43+
# if: steps.publish.outputs.type != 'none'
44+
# run: |
45+
# echo "Published ${{ steps.publish.outputs.type }} version: ${{ steps.publish.outputs.version }}"
4746

48-
- name: If Version Unchanged
49-
if: steps.publish.outputs.type == 'none'
50-
run: |
51-
echo "Version in package.json has not changed. Skipping."
47+
# - name: If Version Unchanged
48+
# if: steps.publish.outputs.type == 'none'
49+
# run: |
50+
# echo "Version in package.json has not changed. Skipping."
5251

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

58-
- name: Changelog Vars
59-
run: |
60-
echo "last_tag=$(git describe --tags --abbrev=0)" >> $GITHUB_ENV
61-
echo "curr_commit=$(git rev-parse HEAD)" >> $GITHUB_ENV
57+
# - name: Changelog Vars
58+
# run: |
59+
# echo "last_tag=$(git describe --tags --abbrev=0)" >> $GITHUB_ENV
60+
# echo "curr_commit=$(git rev-parse HEAD)" >> $GITHUB_ENV
6261

63-
- name: Build Changelog
64-
id: github_release
65-
uses: mikepenz/[email protected]
66-
env:
67-
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
68-
with:
69-
fromTag: "${{ env.last_tag }}"
70-
toTag: ${{ github.ref }}
71-
commitMode: true
72-
configuration: changelog_config.json
62+
# - name: Build Changelog
63+
# id: github_release
64+
# uses: mikepenz/[email protected]
65+
# env:
66+
# GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
67+
# with:
68+
# fromTag: "${{ env.last_tag }}"
69+
# toTag: ${{ github.ref }}
70+
# commitMode: true
71+
# configuration: changelog_config.json
7372

74-
- name: Create Release
75-
if: steps.publish.outputs.type != 'none'
76-
id: create_release
77-
uses: actions/create-release@latest
78-
env:
79-
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
80-
with:
81-
tag_name: v${{ steps.publish.outputs.version }}
82-
release_name: v${{ steps.publish.outputs.version }}
83-
commitish: ${{ github.ref }}
84-
body: ${{steps.github_release.outputs.changelog}}
85-
draft: false
86-
prerelease: false
73+
# - name: Create Release
74+
# if: steps.publish.outputs.type != 'none'
75+
# id: create_release
76+
# uses: actions/create-release@latest
77+
# env:
78+
# GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
79+
# with:
80+
# tag_name: v${{ steps.publish.outputs.version }}
81+
# release_name: v${{ steps.publish.outputs.version }}
82+
# commitish: ${{ github.ref }}
83+
# body: ${{steps.github_release.outputs.changelog}}
84+
# draft: true
85+
# prerelease: false

.github/workflows/tests.yml

Lines changed: 10 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -5,15 +5,9 @@ on:
55
branches:
66
- master
77
- ci
8-
# paths-ignore:
9-
# - "README.md"
10-
# - "docs/**"
118
pull_request:
129
branches:
1310
- master
14-
# paths-ignore:
15-
# - "README.md"
16-
# - "docs/**"
1711

1812
jobs:
1913
test:
@@ -27,9 +21,9 @@ jobs:
2721
os: [ubuntu-latest]
2822
edgedb-version: ["stable"]
2923
include:
30-
- os: ubuntu-latest
31-
node-version: "16"
32-
edgedb-version: "nightly"
24+
# - os: ubuntu-latest
25+
# node-version: "16"
26+
# edgedb-version: "nightly"
3327
- os: ubuntu-latest
3428
node-version: "16"
3529
edgedb-version: "1.4"
@@ -41,7 +35,7 @@ jobs:
4135
# edgedb-version: "stable"
4236

4337
steps:
44-
- uses: actions/checkout@v1
38+
- uses: actions/checkout@v2
4539
with:
4640
fetch-depth: 50
4741
submodules: true
@@ -71,16 +65,15 @@ jobs:
7165

7266
- name: Install dev deps
7367
run: |
74-
yarn install
75-
cd qb && yarn install
68+
yarn
7669
7770
- name: Lint
7871
run: |
7972
yarn lint
8073
8174
- name: Build
8275
run: |
83-
yarn build
76+
yarn workspaces run build
8477
8578
# - name: Compile for Deno
8679
# run: |
@@ -93,19 +86,17 @@ jobs:
9386

9487
- name: Run query builder tests
9588
if: ${{ matrix.node-version >= 14 && matrix.edgedb-version != '1.4'}}
96-
working-directory: qb
9789
run: |
98-
yarn test:ci
90+
yarn workspace @edgedb/generate test:ci
9991
100-
- name: Test qb generation on v1
92+
- name: Test QB generation on v1
10193
if: ${{ matrix.node-version >= 14 && matrix.edgedb-version == '1.4' }}
102-
working-directory: qb
10394
run: |
104-
yarn test:v1
95+
yarn workspace @edgedb/generate test:v1
10596
10697
- name: Run functional tests
10798
run: |
108-
yarn test
99+
yarn workspace edgedb test
109100
110101
# This job exists solely to act as the test job aggregate to be
111102
# targeted by branch policies.

.gitignore

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,12 @@
11
dist
2-
/edgedb-deno
3-
/test/deno
2+
packages/deno
43
/.bench
54
/.vscode
65
node_modules
76
**/.yarn/*
87
!.yarn/releases
98

109
/coverage
11-
/yarn-error.log
10+
**/yarn-error.log
1211
.DS_Store
1312
.vscode
14-
qb/dbschema/edgeql-js

.gitmodules

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
1-
[submodule "test/shared-client-testcases"]
2-
path = test/shared-client-testcases
3-
url = https://github.com/edgedb/shared-client-testcases.git
1+
[submodule "packages/driver/test/shared-client-testcases"]
2+
path = packages/driver/test/shared-client-testcases
3+
url = git@github.com:edgedb/shared-client-testcases.git

.prettierrc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
"printWidth": 79,
33
"tabWidth": 2,
44
"semi": true,
5-
"trailingComma": "es5",
5+
"trailingComma": "none",
66
"bracketSpacing": false,
77
"arrowParens": "avoid",
88
"endOfLine": "auto"

0 commit comments

Comments
 (0)