Skip to content

Commit

Permalink
svelte wip
Browse files Browse the repository at this point in the history
working

make clean

test

bypass

ci

node version

Deploy

round two

gitattributes

use 8.1 base

ts

format

svelte

svelte

rm js
  • Loading branch information
pjaudiomv committed Jun 14, 2024
1 parent 06675de commit 57071a3
Show file tree
Hide file tree
Showing 78 changed files with 5,964 additions and 13,334 deletions.
1 change: 1 addition & 0 deletions .gitattributes
Original file line number Diff line number Diff line change
Expand Up @@ -10,3 +10,4 @@ icon.png export-ignore
phpunit.xml export-ignore
/Misc export-ignore
/doc export-ignore
.svelte-kit export-ignore
17 changes: 9 additions & 8 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
name: main
on:
push:
branches: ['main']
branches: ['unstable']
tags: ['*']

env:
Expand Down Expand Up @@ -80,6 +80,8 @@ jobs:
make npm
- name: make lint-js 🧹
env:
LARAVEL_BYPASS_ENV_CHECK: '1'
run: |
make lint-js
Expand Down Expand Up @@ -110,10 +112,10 @@ jobs:
run: |
make composer
- name: setup node 16 ❇️
- name: setup node 20 ❇️
uses: actions/setup-node@v4.0.2
with:
node-version: 16
node-version: 20

- name: make frontend 🐥
run: |
Expand Down Expand Up @@ -147,7 +149,7 @@ jobs:
aws s3 cp build/bmlt-root-server.zip s3://${{ secrets.S3_BUCKET }}/bmlt-root-server/bmlt-root-server-$(cat src/config/app.php | grep "'version'" | cut -d"'" -f6)-build${GITHUB_RUN_NUMBER}-${GITHUB_SHA}.zip
- name: Configure AWS Credentials 🪪
if: contains(github.ref_name, 'main') || contains(github.ref_name, 'unstable')
if: contains(github.ref_name, 'unstable')
uses: aws-actions/configure-aws-credentials@v4
with:
role-to-assume: arn:aws:iam::${{ secrets.AWS_ACCOUNT_ID }}:role/github-actions/gh-ci-tf-bmlt-rs
Expand All @@ -161,12 +163,12 @@ jobs:
password: ${{ secrets.DOCKER_PASSWORD }}

- name: make docker 🐳
if: contains(github.ref_name, 'main') || contains(github.ref_name, 'unstable')
if: contains(github.ref_name, 'unstable')
run: |
make docker
- name: make docker-push 🐋
if: contains(github.ref_name, 'main') || contains(github.ref_name, 'unstable')
if: contains(github.ref_name, 'unstable')
id: docker_push_images
run: |
make docker-push
Expand Down Expand Up @@ -195,12 +197,11 @@ jobs:
permissions:
id-token: write
contents: write
if: contains(github.ref_name, 'main')
if: contains(github.ref_name, 'unstable')
strategy:
fail-fast: false
matrix:
env:
- "latest"
- "unstable"
steps:
- name: Checkout 🛒
Expand Down
2 changes: 2 additions & 0 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,8 @@ jobs:
make npm
- name: make lint-js 🧹
env:
LARAVEL_BYPASS_ENV_CHECK: '1'
run: |
make lint-js
Expand Down
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -13,3 +13,4 @@ terraform.tfvars
build
docker/docker-compose.dev.yml
.vscode
.svelte-kit
7 changes: 5 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ ifeq ($(CI)x, x)
IMAGE := rootserver
TAG := local
COMPOSER_ARGS :=
NPM_FLAG := install
COMPOSER_PREFIX := docker run --pull=always -t --rm -v '$(shell pwd)':/code -w /code $(BASE_IMAGE):$(BASE_IMAGE_TAG)
LINT_PREFIX := docker run -t --rm -v '$(shell pwd)':/code -w /code/src $(IMAGE):$(TAG)
TEST_PREFIX := docker run -e XDEBUG_MODE=coverage,debug -t --rm -v '$(shell pwd)/src:/var/www/html/main_server' -v '$(shell pwd)/docker/test-auto-config.inc.php:/var/www/html/auto-config.inc.php' -w /var/www/html/main_server --network host $(IMAGE):$(TAG)
Expand All @@ -31,6 +32,7 @@ else
TAG := unstable
endif
COMPOSER_ARGS := --classmap-authoritative
NPM_FLAG := ci
ifeq ($(DEV)x, x)
COMPOSER_ARGS := $(COMPOSER_ARGS) --no-dev
endif
Expand All @@ -55,7 +57,7 @@ $(CROUTON_JS):
rm -rf src/public/client_interface/html/croutonjs/examples

$(NODE_MODULES):
cd src && npm install
cd src && npm $(NPM_FLAG)

$(FRONTEND): $(NODE_MODULES)
cd src && npm run build
Expand Down Expand Up @@ -141,7 +143,7 @@ lint-fix: ## PHP Lint Fix

.PHONY: lint-js
lint-js: ## JavaScript Lint
cd src && npm run lint
cd src && npm run lint && npm run check

.PHONY: phpstan
phpstan: ## PHP Larastan Code Analysis
Expand All @@ -166,5 +168,6 @@ clean: ## Clean build
rm -rf src/public/local_server
rm -rf src/public/semantic
rm -rf src/node_modules
rm -rf src/.svelte-kit
rm -rf src/vendor
rm -rf build
2 changes: 1 addition & 1 deletion docker/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM bmltenabled/bmlt-root-server-base:latest
FROM bmltenabled/bmlt-root-server-base:8.1

COPY build/bmlt-root-server.zip /tmp/bmlt-root-server.zip
RUN \
Expand Down
4 changes: 1 addition & 3 deletions docker/docker-compose.dev.yml.example
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
version: '3'

services:
bmlt:
environment:
GKEY: ''
NEW_UI_ENABLED: 'false'
NEW_UI_ENABLED: 'false'
2 changes: 0 additions & 2 deletions docker/docker-compose.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
version: '3'

services:
bmlt:
build:
Expand Down
6 changes: 6 additions & 0 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
{}
2 changes: 1 addition & 1 deletion src/.nvmrc
Original file line number Diff line number Diff line change
@@ -1 +1 @@
16.18.0
20.13.1
25 changes: 12 additions & 13 deletions src/.prettierrc
Original file line number Diff line number Diff line change
@@ -1,15 +1,14 @@
{
"jsxSingleQuote": true,
"singleQuote": true,
"semi": true,
"tabWidth": 2,
"trailingComma": "all",
"printWidth": 140,
"bracketSameLine": false,
"useTabs": false,
"arrowParens": "always",
"endOfLine": "auto",
"importOrder": ["^components/(.*)$", "^[./]"],
"importOrderSeparation": true,
"importOrderSortSpecifiers": true
"jsxSingleQuote": true,
"singleQuote": true,
"semi": true,
"tabWidth": 2,
"bracketSameLine": false,
"useTabs": false,
"arrowParens": "always",
"endOfLine": "auto",
"trailingComma": "none",
"printWidth": 200,
"plugins": ["prettier-plugin-svelte"],
"overrides": [{ "files": "*.svelte", "options": { "parser": "svelte" } }]
}
14 changes: 14 additions & 0 deletions src/app.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
<!doctype html>
<html lang="en">
<head>
<meta charset="utf-8" />
<link rel="icon" href="%sveltekit.assets%/favicon.png" />
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.5.2/css/all.min.css" crossorigin="anonymous" referrerpolicy="no-referrer" />
<meta name="viewport" content="width=device-width, initial-scale=1" />
%sveltekit.head%
</head>
<body data-sveltekit-preload-data="hover">
<div style="display: contents">%sveltekit.body%</div>
</body>
</html>

33 changes: 33 additions & 0 deletions src/eslint.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
import js from '@eslint/js';
import ts from 'typescript-eslint';
import svelte from 'eslint-plugin-svelte';
import prettier from 'eslint-config-prettier';
import globals from 'globals';

/** @type {import('eslint').Linter.FlatConfig[]} */
export default [
js.configs.recommended,
...ts.configs.recommended,
...svelte.configs['flat/recommended'],
prettier,
...svelte.configs['flat/prettier'],
{
languageOptions: {
globals: {
...globals.browser,
...globals.node
}
}
},
{
files: ['**/*.svelte'],
languageOptions: {
parserOptions: {
parser: ts.parser
}
}
},
{
ignores: ['build/', 'dist/', '*.md']
}
];
Loading

0 comments on commit 57071a3

Please sign in to comment.