Skip to content

Commit 80c0bf8

Browse files
authored
Merge pull request #71 from konecty/refactor/demeteorize-data
refactor: demeteorize data api
2 parents ea92131 + b576434 commit 80c0bf8

File tree

362 files changed

+24231
-36072
lines changed

Some content is hidden

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

362 files changed

+24231
-36072
lines changed

.babelrc

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
{
2+
"presets": [
3+
[
4+
"@babel/preset-env",
5+
{
6+
"targets": {
7+
"node": "current"
8+
}
9+
}
10+
],
11+
"@babel/preset-typescript"
12+
],
13+
"plugins": ["@babel/plugin-proposal-class-properties", "@babel/plugin-proposal-object-rest-spread", "@babel/plugin-transform-runtime", "tsconfig-paths-module-resolver"],
14+
"ignore": ["**/test.ts", "**/test.js", "**/private/**/*"]
15+
}

.dockerignore

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
node_modules
2+
npm-debug.log
3+
src/imports
4+
src/server
5+
.github
6+
.gitignore
7+
.git
8+
.husky

.eslintignore

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
.yarn
2+
dist
3+
node_modules
4+
private/metadata/test
5+
private/less
6+
client/stylesheets

.eslintrc.js

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
module.exports = {
2+
env: {
3+
node: true,
4+
es2021: true,
5+
jest: true,
6+
'jest/globals': true,
7+
},
8+
parser: '@typescript-eslint/parser',
9+
plugins: ['@typescript-eslint', 'jest', 'prettier'],
10+
extends: ['eslint:recommended', 'plugin:@typescript-eslint/eslint-recommended', 'plugin:@typescript-eslint/recommended', 'plugin:prettier/recommended', 'prettier'],
11+
rules: {
12+
'@typescript-eslint/no-unsafe-member-access': 'off',
13+
'@typescript-eslint/no-unsafe-call': 'off',
14+
'no-case-declarations': 'off',
15+
'@typescript-eslint/no-explicit-any': 'warn',
16+
},
17+
settings: {
18+
'import/parsers': {
19+
'@typescript-eslint/parser': ['.ts', '.tsx'],
20+
},
21+
'import/resolver': {
22+
typescript: {
23+
alwaysTryTypes: true,
24+
},
25+
},
26+
},
27+
root: true,
28+
};

.eslintrc.json

Lines changed: 0 additions & 20 deletions
This file was deleted.

.github/workflows/develop.yaml

Lines changed: 100 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -3,51 +3,125 @@ on:
33
tags:
44
- '[0-9]+.[0-9]+.[0-9]+-dev.[0-9]+'
55
jobs:
6+
install-dependencies:
7+
name: Install Dependencies
8+
runs-on: ubuntu-latest
9+
environment: develop
10+
steps:
11+
- name: Checkout
12+
uses: actions/checkout@v4
13+
with:
14+
fetch-depth: 0
15+
- name: Setup NodeJS
16+
uses: actions/setup-node@v4
17+
with:
18+
node-version: 18
19+
cache: 'yarn'
20+
cache-dependency-path: yarn.lock
21+
- name: Restore Dependencies Cache
22+
uses: actions/cache/restore@v3
23+
id: cache-restore
24+
with:
25+
path: |
26+
node_modules
27+
.husky
28+
key: ${{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock') }}
29+
- name: Install Dependencies
30+
run: yarn --frozen-lockfile --no-progress --non-interactive
31+
if: steps.cache-restore.outputs.cache-hit != 'true'
32+
- name: Save Dependencies Cache
33+
uses: actions/cache/save@v3
34+
if: steps.cache-restore.outputs.cache-hit != 'true'
35+
id: cache-save
36+
with:
37+
path: |
38+
node_modules
39+
.husky
40+
key: ${{ steps.cache-restore.outputs.cache-primary-key }}
41+
test:
42+
name: Run Test
43+
runs-on: ubuntu-latest
44+
needs: [install-dependencies]
45+
steps:
46+
- name: Checkout
47+
uses: actions/checkout@v4
48+
with:
49+
fetch-depth: 0
50+
- name: Setup NodeJS
51+
uses: actions/setup-node@v4
52+
with:
53+
node-version: 18
54+
cache: 'yarn'
55+
cache-dependency-path: yarn.lock
56+
- name: Restore Dependencies Cache
57+
uses: actions/cache/restore@v3
58+
id: cache-restore-yarn
59+
with:
60+
path: |
61+
node_modules
62+
.husky
63+
key: ${{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock') }}
64+
- name: Restore Tests Cache
65+
uses: actions/cache/restore@v3
66+
id: cache-restore-jest
67+
with:
68+
path: .jestcache
69+
key: ${{ runner.os }}-jest-${{ hashFiles('**/yarn.lock') }}
70+
- name: Running tests
71+
env:
72+
TZ: 'America/Sao_Paulo'
73+
run: yarn test --cacheDirectory ".jestcache"
74+
- name: Save Tests Cache
75+
uses: actions/cache/save@v3
76+
id: cache-save
77+
with:
78+
path: .jestcache
79+
key: ${{ steps.cache-restore-jest.outputs.cache-primary-key }}
680
build:
81+
name: Build image
782
runs-on: ubuntu-latest
83+
needs: [test]
884
steps:
9-
- name: get latest release with tag
10-
id: latestrelease
11-
run: |
12-
echo "::set-output name=releasetag::$(curl -s https://api.github.com/repos/konecty/Konecty/releases | jq -r 'map(select(.prerelease)) | first | .tag_name')"
13-
- name: confirm release tag
14-
run: |
15-
echo ${{ steps.latestrelease.outputs.releasetag }}
1685
- name: Checkout
17-
uses: actions/checkout@v3
86+
uses: actions/checkout@v4
1887
with:
1988
ref: ${{ steps.latestrelease.outputs.releasetag }}
20-
- name: Install Meteor
21-
run: |
22-
curl https://install.meteor.com/ | sh
23-
export METEOR_ALLOW_SUPERUSER=true
24-
meteor --version
25-
meteor node --version
26-
meteor npm --version
27-
- name: Build
28-
run: |
29-
meteor npm install
30-
meteor build --server-only /tmp/build
31-
- name: Copy build to GitHub
32-
uses: softprops/action-gh-release@v1
33-
if: startsWith(github.ref, 'refs/tags/')
89+
- name: Setup NodeJS
90+
uses: actions/setup-node@v4
3491
with:
35-
files: /tmp/build/Konecty.tar.gz
92+
node-version: 18
93+
cache: 'yarn'
94+
cache-dependency-path: yarn.lock
95+
- name: Restore Dependencies Cache
96+
uses: actions/cache/restore@v3
97+
id: cache-restore
98+
with:
99+
path: |
100+
node_modules
101+
.husky
102+
key: ${{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock') }}
103+
- name: Build
104+
run: yarn build
105+
- name: Set up QEMU
106+
uses: docker/setup-qemu-action@v3
36107
- name: Setup Docker Buildx
37-
uses: docker/setup-buildx-action@v1
108+
uses: docker/setup-buildx-action@v3
38109
- name: Get the tag name
39110
run: |
40111
echo "Tag name from GITHUB_REF_NAME: $GITHUB_REF_NAME"
41112
echo "Tag name from github.ref_name: ${{ github.ref_name }}"
42113
- name: Login to DockerHub
43-
uses: docker/login-action@v1
114+
uses: docker/login-action@v3
44115
with:
45116
username: ${{ secrets.DOCKER_USER }}
46117
password: ${{ secrets.DOCKER_PASSWORD }}
47118
- name: Build and push
48119
id: docker_build
49-
uses: docker/build-push-action@v2
120+
uses: docker/build-push-action@v5
50121
with:
122+
context: .
123+
platforms: linux/amd64,linux/arm64
124+
file: ./Dockerfile
51125
push: true
52126
tags: konecty/konecty:${{ github.ref_name }}
53127
build-args: |

.github/workflows/merge-requests.yaml

Lines changed: 82 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,82 @@
1+
name: Run Tests on Merge Requests
2+
3+
on:
4+
pull_request:
5+
branches:
6+
- '*'
7+
8+
jobs:
9+
install-dependencies:
10+
name: Install Dependencies
11+
runs-on: ubuntu-latest
12+
environment: develop
13+
steps:
14+
- name: Checkout
15+
uses: actions/checkout@v3
16+
with:
17+
fetch-depth: 0
18+
- name: Setup NodeJS
19+
uses: actions/setup-node@v3
20+
with:
21+
node-version: 18
22+
cache: 'yarn'
23+
cache-dependency-path: yarn.lock
24+
- name: Restore Dependencies Cache
25+
uses: actions/cache/restore@v3
26+
id: cache-restore
27+
with:
28+
path: |
29+
node_modules
30+
.husky
31+
key: ${{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock') }}
32+
- name: Install Dependencies
33+
run: yarn --frozen-lockfile --no-progress --non-interactive
34+
if: steps.cache-restore.outputs.cache-hit != 'true'
35+
- name: Save Dependencies Cache
36+
uses: actions/cache/save@v3
37+
if: steps.cache-restore.outputs.cache-hit != 'true'
38+
id: cache-save
39+
with:
40+
path: |
41+
node_modules
42+
.husky
43+
key: ${{ steps.cache-restore.outputs.cache-primary-key }}
44+
test:
45+
name: Run Test
46+
runs-on: ubuntu-latest
47+
needs: [install-dependencies]
48+
steps:
49+
- name: Checkout
50+
uses: actions/checkout@v3
51+
with:
52+
fetch-depth: 0
53+
- name: Setup NodeJS
54+
uses: actions/setup-node@v3
55+
with:
56+
node-version: 18
57+
cache: 'yarn'
58+
cache-dependency-path: yarn.lock
59+
- name: Restore Dependencies Cache
60+
uses: actions/cache/restore@v3
61+
id: cache-restore-yarn
62+
with:
63+
path: |
64+
node_modules
65+
.husky
66+
key: ${{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock') }}
67+
- name: Restore Tests Cache
68+
uses: actions/cache/restore@v3
69+
id: cache-restore-jest
70+
with:
71+
path: .jestcache
72+
key: ${{ runner.os }}-jest-${{ hashFiles('**/yarn.lock') }}
73+
- name: Running tests
74+
env:
75+
TZ: 'America/Sao_Paulo'
76+
run: yarn test --cacheDirectory ".jestcache"
77+
- name: Save Tests Cache
78+
uses: actions/cache/save@v3
79+
id: cache-save
80+
with:
81+
path: .jestcache
82+
key: ${{ steps.cache-restore-jest.outputs.cache-primary-key }}

.github/workflows/release.yaml

Lines changed: 25 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -20,22 +20,32 @@ jobs:
2020
uses: actions/checkout@v3
2121
with:
2222
ref: ${{ steps.latestrelease.outputs.releasetag }}
23-
- name: Install Meteor
24-
run: |
25-
curl https://install.meteor.com/ | sh
26-
export METEOR_ALLOW_SUPERUSER=true
27-
meteor --version
28-
meteor node --version
29-
meteor npm --version
30-
- name: Build
31-
run: |
32-
meteor npm install
33-
meteor build --server-only /tmp/build
34-
- name: Copy build to GitHub
35-
uses: softprops/action-gh-release@v1
36-
if: startsWith(github.ref, 'refs/tags/')
23+
- name: Setup NodeJS
24+
uses: actions/setup-node@v3
3725
with:
38-
files: /tmp/build/Konecty.tar.gz
26+
node-version: 18
27+
cache: 'yarn'
28+
cache-dependency-path: yarn.lock
29+
- name: Restore Dependencies Cache
30+
uses: actions/cache/restore@v3
31+
id: cache-restore
32+
with:
33+
path: |
34+
node_modules
35+
key: ${{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock') }}
36+
- name: Install Dependencies
37+
run: yarn --frozen-lockfile --no-progress --non-interactive
38+
if: steps.cache-restore.outputs.cache-hit != 'true'
39+
- name: Save Dependencies Cache
40+
uses: actions/cache/save@v3
41+
if: steps.cache-restore.outputs.cache-hit != 'true'
42+
id: cache-save
43+
with:
44+
path: |
45+
node_modules
46+
key: ${{ steps.cache-restore.outputs.cache-primary-key }}
47+
- name: Build
48+
run: yarn build
3949
- name: Setup Docker Buildx
4050
uses: docker/setup-buildx-action@v1
4151
- name: Get the tag name

.gitignore

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
**/bin/**
22
**/build/*
33
**/node_modules/*
4+
node_modules
45
**/tmp/*
56
*.bak
67
*.iml
@@ -66,3 +67,6 @@ typo3temp
6667
.vscode
6768
package-lock.json
6869
.env.docker
70+
dist
71+
coverage
72+
.jestcache

.husky/commit-msg

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
#!/usr/bin/env sh
2+
. "$(dirname -- "$0")/_/husky.sh"
3+
4+
npx --no -- commitlint --edit

.husky/pre-commit

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
#!/usr/bin/env sh
2+
. "$(dirname -- "$0")/_/husky.sh"
3+
4+
yarn lint

.husky/pre-push

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
#!/usr/bin/env sh
2+
. "$(dirname -- "$0")/_/husky.sh"
3+
4+
yarn test
5+
6+
yarn build

0 commit comments

Comments
 (0)