From 9d06e47898de27b5790728e9138bd08d87f78119 Mon Sep 17 00:00:00 2001 From: Mosen Date: Mon, 11 Dec 2023 23:20:40 +1100 Subject: [PATCH] Make user sessions compatible with Jetstream Remove pre-commit and app service config because they arent core requirements Update docker-compose tag so we dont conflict with published tags Fix npm build and vue-tsc bailing Try to fix ziggy TS types (unsuccessfully) --- .pre-commit-config.yaml | 27 -------------- appsvc.yaml | 5 --- ...00000_jetstream_compatible_users_table.php | 35 +++++++++++++++++++ ...023_10_02_104816_create_sessions_table.php | 35 +++++++++++++++++++ docker-compose.wip.yml | 2 +- package.json | 3 +- tsconfig.json | 6 ++-- 7 files changed, 77 insertions(+), 36 deletions(-) delete mode 100644 .pre-commit-config.yaml delete mode 100644 appsvc.yaml create mode 100644 database/migrations/2023_10_02_000000_jetstream_compatible_users_table.php create mode 100644 database/migrations/2023_10_02_104816_create_sessions_table.php diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml deleted file mode 100644 index d23e31df2e..0000000000 --- a/.pre-commit-config.yaml +++ /dev/null @@ -1,27 +0,0 @@ -repos: -- repo: https://github.com/pre-commit/pre-commit-hooks - rev: v2.2.3 - hooks: - - id: check-added-large-files - args: [--maxkb=100] - - id: check-ast - - id: check-byte-order-marker - - id: check-case-conflict - # - id: check-docstring-first - # - id: check-executables-have-shebangs - - id: check-json - - id: check-merge-conflict - - id: check-xml - # - id: check-yaml - # - id: end-of-file-fixer - - id: mixed-line-ending - # - id: trailing-whitespace - # args: [--markdown-linebreak-ext=md] -- repo: https://github.com/digitalpulp/pre-commit-php - rev: 1.3.0 - hooks: - - id: php-lint-all -- repo: https://github.com/python/black - rev: 19.3b0 - hooks: - - id: black diff --git a/appsvc.yaml b/appsvc.yaml deleted file mode 100644 index ca4539e723..0000000000 --- a/appsvc.yaml +++ /dev/null @@ -1,5 +0,0 @@ -# Azure App Service Build (Not Container Mode) -version: 1 - -post-build: | - npm run build diff --git a/database/migrations/2023_10_02_000000_jetstream_compatible_users_table.php b/database/migrations/2023_10_02_000000_jetstream_compatible_users_table.php new file mode 100644 index 0000000000..f65b7cb714 --- /dev/null +++ b/database/migrations/2023_10_02_000000_jetstream_compatible_users_table.php @@ -0,0 +1,35 @@ +foreignId('current_team_id')->nullable(); + $table->string('profile_photo_path', 2048)->nullable(); + }); + } + + /** + * Reverse the migrations. + */ + public function down(): void + { + Schema::table('users', function (Blueprint $table) { + $table->dropColumn([ + 'profile_photo_path', + 'current_team_id', + ]); + }); + } +}; diff --git a/database/migrations/2023_10_02_104816_create_sessions_table.php b/database/migrations/2023_10_02_104816_create_sessions_table.php new file mode 100644 index 0000000000..06c3e45017 --- /dev/null +++ b/database/migrations/2023_10_02_104816_create_sessions_table.php @@ -0,0 +1,35 @@ +string('id')->primary(); + $table->foreignId('user_id')->nullable()->index(); + $table->string('ip_address', 45)->nullable(); + $table->text('user_agent')->nullable(); + $table->longText('payload'); + $table->integer('last_activity')->index(); + }); + } + + /** + * Reverse the migrations. + * + * @return void + */ + public function down() + { + Schema::dropIfExists('sessions'); + } +}; diff --git a/docker-compose.wip.yml b/docker-compose.wip.yml index 384ffce4d3..7d1c51c881 100644 --- a/docker-compose.wip.yml +++ b/docker-compose.wip.yml @@ -4,7 +4,7 @@ services: build: context: ./ dockerfile: Dockerfile - image: ghcr.io/munkireport/munkireport-php:wip + image: munkireport-php:wip restart: always environment: - MODULES=applications, directory_service, disk_report, displays_info, extensions, filevault_status, homebrew, homebrew_info, ibridge, installhistory, inventory, localadmin, managedinstalls, mdm_status, munkiinfo, munkireport, munkireportinfo, network, power, printer, profile, security, softwareupdate, sophos, supported_os, timemachine, usage_stats, user_sessions, warranty, wifi diff --git a/package.json b/package.json index f91ad238a4..f974f080ba 100644 --- a/package.json +++ b/package.json @@ -2,7 +2,8 @@ "private": true, "scripts": { "dev": "vite", - "build": "vue-tsc && vite build", + "build": "npm run type-check && vite build", + "type-check": "vue-tsc --noEmit", "preview": "vite preview", "codegen": "graphql-codegen" }, diff --git a/tsconfig.json b/tsconfig.json index ae751c2464..15e348edc5 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -20,7 +20,8 @@ "vite/client" ], "paths": { - "@/": ["./resources/js/*"] + "@/": ["./resources/js/*"], + "ziggy-js": ["./vendor/tightenco/ziggy"] }, "outDir": "./public/build/assets" }, @@ -31,6 +32,7 @@ ], "exclude": [ "node_modules", - "public" + "public", + "vendor" ] }