-
Notifications
You must be signed in to change notification settings - Fork 25
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* add v0.8 schema * update system fields to handle base and auth collection types * handle relation fields with multiple items * create enums for select fields that have values * additional typecheck * add user field for backwards compatability * refactor strings * refactor system types * readme * Add lint and formatting (#17) * add linting and formatting * lint codebase * prettier * update test workflow * update test workflow again * fix: url login for pocketbase 0.8.0-rc2 servers (#16) Co-authored-by: Ethan Olsen <[email protected]> * e2e integration test (#18) * add dockerfile to run e2e tests * add db typegen * cleanup * add test * add github workflow * remove interactive flag * intentionally fail integration test * save artifacts in case of failing tests * fix output dir * ignore files Co-authored-by: Ethan Olsen <[email protected]> Co-authored-by: Ethan Olsen <[email protected]>
- Loading branch information
1 parent
a9c8156
commit d04a445
Showing
26 changed files
with
2,950 additions
and
418 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
{ | ||
"env": { | ||
"browser": true, | ||
"es2021": true | ||
}, | ||
"extends": [ | ||
"eslint:recommended", | ||
"plugin:@typescript-eslint/recommended", | ||
"eslint-config-prettier" | ||
], | ||
"overrides": [], | ||
"parser": "@typescript-eslint/parser", | ||
"parserOptions": { | ||
"ecmaVersion": "latest", | ||
"sourceType": "module" | ||
}, | ||
"plugins": ["@typescript-eslint"], | ||
"rules": { | ||
"@typescript-eslint/no-explicit-any": "off", | ||
"@typescript-eslint/ban-ts-comment": "off" | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
name: Integration Test | ||
|
||
on: | ||
push: | ||
branches: [main, rc] | ||
pull_request: | ||
branches: "**" | ||
|
||
jobs: | ||
test: | ||
timeout-minutes: 5 | ||
runs-on: ubuntu-latest | ||
env: | ||
CI: true | ||
|
||
steps: | ||
- name: Checkout code | ||
uses: actions/checkout@v3 | ||
|
||
- name: Run in docker | ||
run: | | ||
docker build . -t pocketbase-typegen:latest | ||
docker run --name integration_test pocketbase-typegen:latest | ||
mkdir -p output | ||
docker cp integration_test:/app/output output | ||
- name: Archive generated type results | ||
uses: actions/upload-artifact@v3 | ||
with: | ||
name: generated-types | ||
path: output/* | ||
retention-days: 5 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
dist | ||
coverage | ||
test/pocketbase-types-example.ts | ||
pocketbase-types.ts |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
# Dockerfile to run e2e integration tests against a test PocketBase server | ||
FROM node:16-alpine3.16 | ||
|
||
ARG POCKETBASE_VERSION=0.8.0-rc2 | ||
|
||
WORKDIR /app/output/ | ||
WORKDIR /app/ | ||
|
||
# Install the dependencies | ||
RUN apk add --no-cache \ | ||
ca-certificates \ | ||
unzip \ | ||
wget \ | ||
zip \ | ||
zlib-dev | ||
|
||
# Download Pocketbase and install it | ||
ADD https://github.com/pocketbase/pocketbase/releases/download/v${POCKETBASE_VERSION}/pocketbase_${POCKETBASE_VERSION}_linux_amd64.zip /tmp/pocketbase.zip | ||
RUN unzip /tmp/pocketbase.zip -d /app/ | ||
|
||
COPY package.json package-lock.json ./ | ||
RUN npm ci | ||
|
||
# Copy test files | ||
COPY test/integration ./ | ||
COPY test/pocketbase-types-example.ts ./ | ||
COPY dist/index.js ./dist/index.js | ||
|
||
RUN chmod +x ./pocketbase | ||
RUN chmod +x ./run.sh | ||
EXPOSE 8090 | ||
|
||
CMD [ "./run.sh" ] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.