diff --git a/.gitattributes b/.gitattributes index af3ad12..e3f08fc 100644 --- a/.gitattributes +++ b/.gitattributes @@ -2,3 +2,4 @@ /.yarn/releases/* binary /.yarn/plugins/**/* binary /.pnp.* binary linguist-generated +* text=auto eol=lf diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml new file mode 100644 index 0000000..1ae20e5 --- /dev/null +++ b/.github/workflows/ci.yml @@ -0,0 +1,46 @@ +name: CI + +on: [pull_request, push] + +jobs: + typecheck: + name: Typecheck + runs-on: ubuntu-latest + steps: + - name: Check out the repo + uses: actions/checkout@v4 + with: + submodules: true + + - name: Setup Node.js environment + uses: actions/setup-node@v4 + with: + node-version: lts/* + cache: "yarn" + + - name: Install dependencies + run: yarn install --immutable --network-timeout 1000000 + + - name: Typecheck + run: yarn typecheck + + lint: + name: Lint + runs-on: ubuntu-latest + steps: + - name: Check out the repo + uses: actions/checkout@v4 + with: + submodules: true + + - name: Setup Node.js environment + uses: actions/setup-node@v4 + with: + node-version: lts/* + cache: "yarn" + + - name: Install dependencies + run: yarn install --immutable --network-timeout 1000000 + + - name: Lint + run: yarn lint diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml new file mode 100644 index 0000000..2422087 --- /dev/null +++ b/.github/workflows/release.yml @@ -0,0 +1,68 @@ +name: Release Workflow + +on: + workflow_dispatch: {} + release: + types: [published] + # This can be used to automatically publish nightlies at UTC nighttime + schedule: + - cron: "0 2 * * *" # run at 2 AM UTC + +jobs: + web: + name: Push website Docker image to registry + runs-on: ubuntu-latest + permissions: + packages: write + contents: read + steps: + - name: Check out the repo + uses: actions/checkout@v4 + with: + submodules: true + token: ${{ secrets.GITHUB_TOKEN }} + + - name: Set up QEMU + uses: docker/setup-qemu-action@v3 + + - name: Set up Docker Buildx + id: buildx + uses: docker/setup-buildx-action@v3 + with: + buildkitd-flags: --debug + + - name: Log in to the Container registry + uses: docker/login-action@v3 + with: + registry: ghcr.io + username: ${{ github.actor }} + password: ${{ secrets.GITHUB_TOKEN }} + + - name: Extract metadata (tags, labels) for Docker + id: meta + uses: docker/metadata-action@v5 + with: + images: | + ghcr.io/drop-OSS/drop + tags: | + type=schedule,pattern=nightly + type=semver,pattern=v{{version}} + type=semver,pattern=v{{major}}.{{minor}} + type=semver,pattern=v{{major}} + type=ref,event=branch,prefix=branch- + type=ref,event=pr + type=sha + # set latest tag for stable releases + type=raw,value=latest,enable=${{ github.event_name == 'release' && github.event.release.prerelease == false }} + + - name: Build and push image + id: build-and-push + uses: docker/build-push-action@v6 + with: + context: . + push: true + tags: ${{ steps.meta.outputs.tags }} + labels: ${{ steps.meta.outputs.labels }} + platforms: linux/amd64,linux/arm64 + cache-from: type=gha + cache-to: type=gha,mode=max diff --git a/.gitignore b/.gitignore index 915b82c..705c5c9 100644 --- a/.gitignore +++ b/.gitignore @@ -30,4 +30,7 @@ logs # deploy template deploy-template/* -!deploy-template/compose.yml \ No newline at end of file +!deploy-template/compose.yml + +# generated prisma client +/prisma/client \ No newline at end of file diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 37893f5..de22495 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -29,3 +29,26 @@ build: docker image tag $IMAGE_NAME $PUBLISH_LATEST_IMAGE_NAME docker push $PUBLISH_IMAGE_NAME $PUBLISH_LATEST_IMAGE_NAME fi + +build-arm64: + stage: build + image: arm64v8/docker:latest + tags: + - aarch64 + variables: + IMAGE_NAME: $CI_REGISTRY_IMAGE/$CI_COMMIT_REF_NAME:$CI_COMMIT_SHORT_SHA-arm64 + LATEST_IMAGE_NAME: $CI_REGISTRY_IMAGE/$CI_COMMIT_REF_NAME:latest-arm64 + PUBLISH_IMAGE_NAME: $CI_REGISTRY_IMAGE:$CI_COMMIT_TAG-arm64 + PUBLISH_LATEST_IMAGE_NAME: $CI_REGISTRY_IMAGE:latest-arm64 + script: + - docker build -t $IMAGE_NAME . --platform=linux/arm64 + - docker image tag $IMAGE_NAME $LATEST_IMAGE_NAME + - docker push $IMAGE_NAME + - docker push $LATEST_IMAGE_NAME + - | + if [ $CI_COMMIT_TAG ]; then + docker image tag $IMAGE_NAME $PUBLISH_IMAGE_NAME + docker image tag $IMAGE_NAME $PUBLISH_LATEST_IMAGE_NAME + docker push $PUBLISH_IMAGE_NAME + docker push $PUBLISH_LATEST_IMAGE_NAME + fi diff --git a/.prettierignore b/.prettierignore new file mode 100644 index 0000000..1e7121f --- /dev/null +++ b/.prettierignore @@ -0,0 +1 @@ +drop-base/ diff --git a/.vscode/settings.json b/.vscode/settings.json index 87ca8ef..e426a5e 100644 --- a/.vscode/settings.json +++ b/.vscode/settings.json @@ -1,18 +1,21 @@ { - "spellchecker.ignoreWordsList": [ - "mTLS", - "Wireguard" - ], - "sqltools.connections": [ - { - "previewLimit": 50, - "server": "localhost", - "port": 5432, - "driver": "PostgreSQL", - "name": "drop", - "database": "drop", - "username": "drop", - "password": "drop" - } - ] + "spellchecker.ignoreWordsList": ["mTLS", "Wireguard"], + "sqltools.connections": [ + { + "previewLimit": 50, + "server": "localhost", + "port": 5432, + "driver": "PostgreSQL", + "name": "drop", + "database": "drop", + "username": "drop", + "password": "drop" + } + ], + // allow autocomplete for ArkType expressions like "string | num" + "editor.quickSuggestions": { + "strings": "on" + }, + // prioritize ArkType's "type" for autoimports + "typescript.preferences.autoImportSpecifierExcludeRegexes": ["^(node:)?os$"] } diff --git a/.yarnrc b/.yarnrc deleted file mode 100644 index 9bcf946..0000000 --- a/.yarnrc +++ /dev/null @@ -1 +0,0 @@ -"@drop:registry" "https://lab.deepcore.dev/api/v4/projects/57/packages/npm/" diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index f7a20b4..3d883ae 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -41,7 +41,8 @@ TODO: Add Troubleshooting If not, look at the [Troubleshooting](https://github.com/Drop-OSS/docs/Troubleshooting) page for instructions on how to gather data to better debug your problem. --> -If you cannot find an existing issue, you can go ahead and create an issue with as much + +If you cannot find an existing issue, you can go ahead and create an issue with as much detail as you can provide. It should include the data gathered as indicated above, along with the following: @@ -69,7 +70,8 @@ maintainers) by mentioning their GitHub handle (starting with `@`) in your messa ### Getting started You should be familiar with the basics of -[contributing on GitHub](https://help.github.com/articles/using-pull-requests) +[contributing on GitHub](https://help.github.com/articles/using-pull-requests) + @@ -95,8 +97,8 @@ maintainers) by mentioning their GitHub handle (starting with `@`) in your messa ### You have an addition -We are absolutely accepting more contributions or features to drop, but please, make sure -that it is reasonable. Contributions that only cover a very small niche are likely to not +We are absolutely accepting more contributions or features to drop, but please, make sure +that it is reasonable. Contributions that only cover a very small niche are likely to not be added. Please be so kind as to [search](#use-the-search-luke) for any pending, merged or rejected Pull Requests @@ -109,7 +111,7 @@ maintainers) by mentioning their GitHub handle (starting with `@`) in your messa For any extensive change, such as API changes, you will have to find testers to +1 your PR. ----- +--- ## Use the Search, Luke @@ -126,7 +128,7 @@ to be sure your contribution has not already come up. If all fails, your thing has probably not been reported yet, so you can go ahead and [create an issue](#reporting-issues) or [submit a PR](#submitting-pull-requests). ----- +--- ## Commit Guidelines @@ -161,11 +163,13 @@ type(scope)!: subject Examples: - Commit that changes the `git` plugin: + ``` feat(git): add alias for `git commit` ``` - Commit that changes many plugins: + ``` style: fix inline declaration of arrays ``` @@ -203,6 +207,7 @@ type(scope)!: subject Formatting tricks: the commit subject may contain: - Links to related issues or PRs by writing `#issue`. This will be highlighted by the changelog tool: + ``` feat(archlinux): add support for aura AUR helper (#9467) ``` @@ -219,7 +224,7 @@ Try to keep the first commit line short. It's harder to do using this commit sty concise, and if you need more space, you can use the commit body. Try to make sure that the commit subject is clear and precise enough that users will know what changed by just looking at the changelog. ----- +--- + ## Reference -This contributing guide is adapted from the -[oh-my-zsh contribution guide](https://github.com/ohmyzsh/ohmyzsh/blob/master/CONTRIBUTING.md). -If there are any issues with this, please email admin@deepcore.dev. \ No newline at end of file + +This contributing guide is adapted from the +[oh-my-zsh contribution guide](https://github.com/ohmyzsh/ohmyzsh/blob/master/CONTRIBUTING.md). +If there are any issues with this, please email admin@deepcore.dev. diff --git a/Dockerfile b/Dockerfile index 33e714a..128e0d0 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,28 +1,30 @@ # pull pre-configured and updated build environment -FROM registry.deepcore.dev/drop-oss/drop-server-build-environment/main:latest AS build-system +FROM debian:testing-20250317-slim AS build-system -# setup workdir -RUN mkdir /build -WORKDIR /build +# setup workdir - has to be the same filepath as app because fuckin' Prisma +WORKDIR /app # install dependencies and build +RUN apt-get update -y +RUN apt-get install node-corepack -y RUN corepack enable COPY . . -RUN NUXT_TELEMETRY_DISABLED=1 yarn install +RUN NUXT_TELEMETRY_DISABLED=1 yarn install --network-timeout 1000000 +RUN NUXT_TELEMETRY_DISABLED=1 yarn prisma generate RUN NUXT_TELEMETRY_DISABLED=1 yarn build # create run environment for Drop FROM node:lts-slim AS run-system -RUN mkdir /app WORKDIR /app -COPY --from=build-system /build/.output ./app -COPY --from=build-system /build/prisma ./prisma -COPY --from=build-system /build/build ./startup +COPY --from=build-system /app/.output ./app +COPY --from=build-system /app/prisma ./prisma +COPY --from=build-system /app/package.json ./ +COPY --from=build-system /app/build ./startup # OpenSSL as a dependency for Drop (TODO: seperate build environment) RUN apt-get update -y && apt-get install -y openssl -RUN yarn global add prisma +RUN yarn global add prisma@6.7.0 CMD ["/app/startup/launch.sh"] \ No newline at end of file diff --git a/README.md b/README.md index 4916f96..69ae307 100644 --- a/README.md +++ b/README.md @@ -1,20 +1,16 @@