Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
61 changes: 61 additions & 0 deletions .babelrc.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,61 @@
{
"sourceType": "unambiguous",
"presets": [
[
"@babel/preset-env",
{
"shippedProposals": true,
"loose": true
}
],
"@babel/preset-typescript"
],
"plugins": [
"@babel/plugin-transform-shorthand-properties",
"@babel/plugin-transform-block-scoping",
[
"@babel/plugin-proposal-decorators",
{
"legacy": true
}
],
[
"@babel/plugin-proposal-class-properties",
{
"loose": true
}
],
[
"@babel/plugin-proposal-private-methods",
{
"loose": true
}
],
"@babel/plugin-proposal-export-default-from",
"@babel/plugin-syntax-dynamic-import",
[
"@babel/plugin-proposal-object-rest-spread",
{
"loose": true,
"useBuiltIns": true
}
],
"@babel/plugin-transform-classes",
"@babel/plugin-transform-arrow-functions",
"@babel/plugin-transform-parameters",
"@babel/plugin-transform-destructuring",
"@babel/plugin-transform-spread",
"@babel/plugin-transform-for-of",
"babel-plugin-macros",
"@babel/plugin-proposal-optional-chaining",
"@babel/plugin-proposal-nullish-coalescing-operator",
[
"babel-plugin-polyfill-corejs3",
{
"method": "usage-global",
"absoluteImports": "core-js",
"version": "3.19.0"
}
]
]
}
26 changes: 26 additions & 0 deletions .devcontainer/devcontainer.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
{
"name": "App Container",
"image": "mcr.microsoft.com/devcontainers/javascript-node:latest",
"features": {
"ghcr.io/devcontainers/features/node:1": {
"version": "lts",
"pnpm": "latest"
}
},
"customizations": {
"vscode": {
"settings": {
"terminal.integrated.defaultProfile.linux": "bash",
"editor.tabSize": 2
},
"extensions": [
"dbaeumer.vscode-eslint"
]
}
},
"mounts": [
"source=${localEnv:HOME}/.gitconfig,target=/home/node/.gitconfig,type=bind,consistency=cached",
"source=${localEnv:HOME}/.ssh,target=/home/node/.ssh,type=bind,consistency=cached"
],
"postCreateCommand": "pnpm install"
}
9 changes: 9 additions & 0 deletions .editorconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
root = true

[*]
charset = utf-8
indent_style = space
indent_size = 2
end_of_line = lf
insert_final_newline = true
trim_trailing_whitespace = true
1 change: 1 addition & 0 deletions .env.dev
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
VITE_BUBBLE_URL=https://deskpro.dev-eu.bubble365.app/
3 changes: 3 additions & 0 deletions .env.loc
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
VITE_BUBBLE_URL=https://eu.bubble365.local:5173/
#VITE_BUBBLE_URL=https://deskpro.dev-eu.bubble365.app/
#VITE_BUBBLE_URL=https://deskpro.eu.bubble365.app/
1 change: 1 addition & 0 deletions .env.prod
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
VITE_BUBBLE_URL=https://deskpro.eu.bubble365.app/
8 changes: 8 additions & 0 deletions .eslintignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
build/
dist/
node_modules/
.snapshots/
*.min.js
lib
storybook-static
.storybook
23 changes: 23 additions & 0 deletions .eslintrc.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
module.exports = {
root: true,
ignorePatterns: ["**/*.js", ".dist/**/*", "build/**/*", "dist/**/*"],
parser: "@typescript-eslint/parser",
parserOptions: {
project: "./tsconfig.json",
},
plugins: ["@typescript-eslint"],
extends: [
"eslint:recommended",
"plugin:@typescript-eslint/recommended-type-checked",
"plugin:react-hooks/recommended",
"prettier",
],
rules: {
"@typescript-eslint/no-empty-function": "off",
"@typescript-eslint/no-unused-vars": [
"warn",
{ ignoreRestSiblings: true, argsIgnorePattern: "^_" },
],
"no-console": "warn",
},
};
1 change: 1 addition & 0 deletions .github/CODEOWNERS
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
/manifest.json @deskproapps/developers
8 changes: 8 additions & 0 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
version: 2

updates:
- package-ecosystem: "npm"
directory: "/"
schedule:
interval: "monthly"
time: "09:00"
28 changes: 28 additions & 0 deletions .github/workflows/feature_build.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
name: Feature Build

on:
pull_request:
merge_group: # support for merge queues/groups
workflow_dispatch:

# Allow this job to be canceled when new commits are pushed
concurrency:
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
cancel-in-progress: true

jobs:
build:
uses: ./.github/workflows/subworkflow-build.yml
secrets: inherit
permissions:
contents: write
pull-requests: read

deploy:
uses: ./.github/workflows/subworkflow-deploy.yml
secrets: inherit
if: github.actor != 'dependabot[bot]' && github.event_name == 'pull_request'
needs: [build]
permissions:
contents: read
pull-requests: write
27 changes: 27 additions & 0 deletions .github/workflows/main_merge.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
name: Main Build

on:
push:
branches:
- main

concurrency:
group: ${{ github.workflow }}-build
cancel-in-progress: false

jobs:
build_and_tag:
uses: ./.github/workflows/subworkflow-build.yml
secrets: inherit
with:
push-tag: true
permissions:
contents: write
pull-requests: read

release:
uses: ./.github/workflows/subworkflow-release.yml
secrets: inherit
needs: [build_and_tag]
permissions:
contents: write
143 changes: 143 additions & 0 deletions .github/workflows/subworkflow-build.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,143 @@
name: "Build"

on:
workflow_call:
inputs:
push-tag:
type: boolean
description: "Should the version tag be pushed to the repo"
default: false
required: false
run-lint:
type: boolean
description: "Should the lint checks be run"
default: true
required: false
run-tests:
type: boolean
description: "Should the tests be run"
default: true
required: false

jobs:
build:
name: Lint / Test / Build / Tag
timeout-minutes: 30
runs-on: ubuntu-latest
permissions:
contents: write
pull-requests: read
steps:
- name: Clone repo
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
with:
fetch-depth: 0
fetch-tags: true

- name: Prep local dev
run: |
touch ~/.gitconfig
mkdir ~/.ssh
git config --global user.name "$(git log -1 --pretty=format:%an)"
git config --global user.email "$(git log -1 --pretty=format:%ae)"

- name: Export PR Labels
id: extract_labels
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
if [ -n "${{ github.event.pull_request.number }}" ]; then
# Regular PR case
echo "PR number found: ${{ github.event.pull_request.number }}"
labels=$(jq -r '[.[] | .name] | join(",")' <<< '${{ toJson(github.event.pull_request.labels) }}')
else
# Merge queue case - find PR by head ref
echo "No PR number found, checking for merge group"
PR_NUM=$(git log -1 --pretty=%B | grep -oP '#\K\d+')
echo "PR number found: $PR_NUM"
if [ -n "$PR_NUM" ]; then
labels=$(curl -s -H "Authorization: token $GITHUB_TOKEN" \
"https://api.github.com/repos/${{ github.repository }}/issues/$PR_NUM/labels" | \
jq -r '[.[] | .name] | join(",")')
fi
fi
echo "labels=${labels:-}" >> $GITHUB_OUTPUT

- name: Export Version Tag
id: version_tag
run: |
tag=$(git tag --merged HEAD --sort=-version:refname -l "[0-9]*.[0-9]*.[0-9]*" -l "v[0-9]*.[0-9]*.[0-9]*" | head -n 1);
echo version=$([ -z "$tag" ] && echo "0.0.0" || echo "${tag#v}") >> $GITHUB_OUTPUT;

- name: Lint, Test, Build, and Tag
uses: devcontainers/ci@8bf61b26e9c3a98f69cb6ce2f88d24ff59b785c6 #v0.3
env:
LABELS: "${{ steps.extract_labels.outputs.labels }}"
VERSION: "${{ steps.version_tag.outputs.version }}"
PUSH_TAG: "${{ inputs.push-tag }}"
RUN_LINT: "${{ inputs.run-lint }}"
RUN_TESTS: "${{ inputs.run-tests }}"
SENTRY_AUTH_TOKEN: "${{ secrets.SENTRY_AUTH_TOKEN }}"
SENTRY_ORG: "${{ secrets.SENTRY_ORG }}"
SENTRY_PROJECT: "${{ secrets.SENTRY_PROJECT }}"
with:
env: |
LABELS
VERSION
PUSH_TAG
RUN_LINT
RUN_TESTS
SENTRY_AUTH_TOKEN
SENTRY_ORG
SENTRY_PROJECT
runCmd: |
set -e

# Lint
if [ "$RUN_LINT" = true ]; then
pnpm run lint
pnpm tsc --noemit
fi

# Test
if [ "$RUN_TESTS" = true ]; then
pnpm test:coverage
fi

# Tag
MILESTONE=$(echo "$LABELS" | grep -E 'major-version|minor-version' | head -1)
VERSION_NEW=$(pnpm run bumpManifestVer "$MILESTONE" "$VERSION" | tail -n 1)
if [ "$PUSH_TAG" != "true" ]; then
# Remove serveUrl if not pushing as it wont be deployed to the CDN.
jq 'del(.serveUrl)' manifest.json > manifest.json.tmp && mv manifest.json.tmp manifest.json
fi
pnpm prettier --write manifest.json
git tag -a $VERSION_NEW -m "Version $VERSION_NEW"

# Build
if [ "$PUSH_TAG" != "true" ]; then
## Disable Sentry Release if not pushing
export SENTRY_DISABLED="true"
fi
pnpm run build

# Push
if [ "$PUSH_TAG" = "true" ]; then
git push origin $VERSION_NEW
fi

- name: Package app zip
working-directory: dist
run: |
cp ../manifest.json .
rm **/*.js.map || echo "No source maps to remove"
zip -rq ../app.zip *

- name: Upload package
uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4.6.2
with:
name: app-package
path: |
app.zip
manifest.json
retention-days: 7
Loading