Skip to content

Commit fcc7522

Browse files
committed
chore: updated laravel package to latest version
1 parent 200bb51 commit fcc7522

File tree

415 files changed

+25729
-22305
lines changed

Some content is hidden

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

415 files changed

+25729
-22305
lines changed
Lines changed: 120 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,120 @@
1+
name: Deploy - Demos Free
2+
run-name: ${{ inputs.is_production && '🚀' || '🧪' }} Deploy - Demos Free
3+
4+
on:
5+
workflow_dispatch:
6+
inputs:
7+
is_production:
8+
type: boolean
9+
description: Is production deployment
10+
11+
jobs:
12+
deployment:
13+
runs-on: ubuntu-latest
14+
env:
15+
STAG_DIR: ${{ secrets.PROD_DIR }}staging/
16+
DEPLOY_DIR: ${{ secrets.PROD_DIR }}${{ !inputs.is_production && 'staging/' || '' }}
17+
steps:
18+
- name: ⚙️ Setup pnpm
19+
uses: pnpm/action-setup@v4
20+
with:
21+
version: 8
22+
23+
- name: ⚙️ Set BRAND_NAME environment variable from repo name
24+
run: echo BRAND_NAME=${{ github.event.repository.name }} | cut -d '-' -f1 >> $GITHUB_ENV
25+
26+
- name: ⬇️ Clone current repo under /<template-name>/vue-laravel-free
27+
uses: actions/checkout@v3
28+
with:
29+
path: ${{ env.BRAND_NAME }}/vue-laravel-free
30+
31+
- name: ⬇️ Clone automation scripts repo under /automation-scripts
32+
uses: actions/checkout@v3
33+
with:
34+
repository: themeselection/automation-scripts
35+
token: ${{ secrets.GH_PAT }}
36+
path: automation-scripts
37+
38+
- name: ⬇️ Install packages in automation-scripts dir
39+
working-directory: automation-scripts/vue
40+
run: pnpm install
41+
42+
- name: ⚙️ Set LARAVEL_CORE_DIR_NAME environment variable from generated env file
43+
working-directory: automation-scripts/vue
44+
run: pnpm tsx src/templates/${{ env.BRAND_NAME }}/scripts/genLaravelCoreDirNameEnvFile.ts --isFree $([[ "${{ inputs.is_production }}" != "true" ]] && echo --staging) && cat .env.laravel-core-dir-name >> $GITHUB_ENV
45+
46+
- name: ⬇️ Install packages in typescript full version
47+
working-directory: ${{ env.BRAND_NAME }}/vue-laravel-free/typescript-version
48+
run: pnpm i && composer install
49+
50+
- name: 🎭 Create .env file from .env.example & generate APP_KEY via `php artisan key:generate`
51+
working-directory: ${{ env.BRAND_NAME }}/vue-laravel-free/typescript-version
52+
run: cp .env.example .env && php artisan key:generate
53+
54+
- name: 📦 Generate demos
55+
working-directory: automation-scripts/vue
56+
run: pnpm tsx src/templates/${{ env.BRAND_NAME }}/scripts/genLaravelDemos.ts --isFree $([[ "${{ inputs.is_production }}" != "true" ]] && echo --staging)
57+
58+
- name: 🚀 Upload demos zip
59+
uses: appleboy/scp-action@master
60+
with:
61+
host: ${{ secrets.HOST }}
62+
username: ${{ secrets.USERNAME }}
63+
port: ${{ secrets.PORT }}
64+
key: ${{ secrets.SSHKEY }}
65+
source: ${{ env.BRAND_NAME }}/vue-laravel-free/typescript-version/*.zip
66+
target: ${{ secrets.LARAVEL_CORE_CONTAINER_DIR }}
67+
strip_components: 3
68+
69+
- name: 🪄 Setup demos
70+
uses: appleboy/[email protected]
71+
with:
72+
host: ${{ secrets.HOST }}
73+
username: ${{ secrets.USERNAME }}
74+
port: ${{ secrets.PORT }}
75+
key: ${{ secrets.SSHKEY }}
76+
script: |
77+
# create deployment dir if doesn't exist
78+
mkdir -p ${{ env.DEPLOY_DIR }}
79+
80+
# navigate to laravel core container dir
81+
cd ${{ secrets.LARAVEL_CORE_CONTAINER_DIR }}
82+
83+
# Remove existing backup zip
84+
rm -rf bak-${{ env.LARAVEL_CORE_DIR_NAME }}-*.zip
85+
86+
# Remove existing laravel core dir
87+
rm -rf ${{ env.LARAVEL_CORE_DIR_NAME }}
88+
89+
# if prod => zip existing laravel core
90+
DEMO_ZIP_NAME="bak-${{ env.LARAVEL_CORE_DIR_NAME }}-$(date +"%Y-%m-%d-%H-%M-%S").zip"
91+
[[ "${{ inputs.is_production }}" == "true" ]] && zip -r $DEMO_ZIP_NAME ${{ env.LARAVEL_CORE_DIR_NAME }} -x "*.zip"
92+
93+
# remove existing staging laravel core & staging demos
94+
# ℹ️ Previously we were only performing this removal if `inputs.is_production` is true but doing this for staging as well might remove permission issue in future
95+
rm -rf ${{ env.STAG_DIR }}/demo
96+
97+
# Remove staging laravel core dir
98+
# ℹ️ This is tricky because if it's staging then `env.LARAVEL_CORE_DIR_NAME` will have `-staging` already suffixed and work perfectly without below command.
99+
# Additionally, below command will result in something like this (that won't do anything) in staging env: `rm -rf <brand>-vuejs-laravel-admin-template-staging-staging`
100+
# However, in production it will allow us to remove staging laravel core dir
101+
rm -rf ${{ env.LARAVEL_CORE_DIR_NAME }}-staging
102+
103+
# remove existing demos
104+
rm -rf ${{ env.DEPLOY_DIR }}/demo
105+
106+
# unzip the uploaded laravel core. "-q" option will silently unzip without logs
107+
unzip -q ${{ env.LARAVEL_CORE_DIR_NAME }}.zip
108+
109+
# remove the uploaded zip
110+
rm -rf ${{ env.LARAVEL_CORE_DIR_NAME }}.zip
111+
112+
# ATM, we have successfully, uploaded the zip to server with file cleanup. Next, just move the demo in its place
113+
114+
mv ${{ env.LARAVEL_CORE_DIR_NAME }}/demo ${{ env.DEPLOY_DIR }}
115+
116+
# create logs dir & laravel.log file in laravel core if doesn't exist. We are doing "echo ls $" because if we don't, "mkdir -p" will create dir as "<brand>*" instead of full name "<brand>-xxx"
117+
mkdir -p ${{ env.LARAVEL_CORE_DIR_NAME }}/storage/logs/ && touch ${{ env.LARAVEL_CORE_DIR_NAME }}/storage/logs/laravel.log
118+
119+
# grant read & write permission to group & other
120+
chmod -R g+rw ${{ env.LARAVEL_CORE_DIR_NAME }}/storage

javascript-version/.env.example

Lines changed: 15 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -8,18 +8,18 @@ LOG_CHANNEL=stack
88
LOG_DEPRECATIONS_CHANNEL=null
99
LOG_LEVEL=debug
1010

11-
DB_CONNECTION=mysql
12-
DB_HOST=127.0.0.1
13-
DB_PORT=3306
14-
DB_DATABASE=laravel
15-
DB_USERNAME=root
11+
DB_CONNECTION=sqlite
12+
DB_HOST=
13+
DB_PORT=
14+
DB_DATABASE=
15+
DB_USERNAME=
1616
DB_PASSWORD=
1717

18-
BROADCAST_DRIVER=log
19-
CACHE_DRIVER=file
18+
BROADCAST_DRIVER=
19+
CACHE_DRIVER=
2020
FILESYSTEM_DISK=local
21-
QUEUE_CONNECTION=sync
22-
SESSION_DRIVER=file
21+
QUEUE_CONNECTION=database
22+
SESSION_DRIVER=database
2323
SESSION_LIFETIME=120
2424

2525
MEMCACHED_HOST=127.0.0.1
@@ -28,9 +28,9 @@ REDIS_HOST=127.0.0.1
2828
REDIS_PASSWORD=null
2929
REDIS_PORT=6379
3030

31-
MAIL_MAILER=smtp
32-
MAIL_HOST=mailpit
33-
MAIL_PORT=1025
31+
MAIL_MAILER=log
32+
MAIL_HOST=127.0.0.1
33+
MAIL_PORT=2525
3434
MAIL_USERNAME=null
3535
MAIL_PASSWORD=null
3636
MAIL_ENCRYPTION=null
@@ -47,9 +47,9 @@ PUSHER_APP_ID=
4747
PUSHER_APP_KEY=
4848
PUSHER_APP_SECRET=
4949
PUSHER_HOST=
50-
PUSHER_PORT=443
51-
PUSHER_SCHEME=https
52-
PUSHER_APP_CLUSTER=mt1
50+
PUSHER_PORT=
51+
PUSHER_SCHEME=
52+
PUSHER_APP_CLUSTER=
5353

5454
VITE_PUSHER_APP_KEY="${PUSHER_APP_KEY}"
5555
VITE_PUSHER_HOST="${PUSHER_HOST}"

javascript-version/.eslintrc-auto-import.json

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,10 +4,14 @@
44
"ComponentPublicInstance": true,
55
"ComputedRef": true,
66
"EffectScope": true,
7+
"ExtractDefaultPropTypes": true,
8+
"ExtractPropTypes": true,
9+
"ExtractPublicPropTypes": true,
710
"InjectionKey": true,
811
"PropType": true,
912
"Ref": true,
1013
"VNode": true,
14+
"WritableComputedRef": true,
1115
"acceptHMRUpdate": true,
1216
"asyncComputed": true,
1317
"autoResetRef": true,
@@ -45,6 +49,7 @@
4549
"h": true,
4650
"ignorableWatch": true,
4751
"inject": true,
52+
"injectLocal": true,
4853
"isDefined": true,
4954
"isProxy": true,
5055
"isReactive": true,
@@ -82,6 +87,7 @@
8287
"onUpdated": true,
8388
"pausableWatch": true,
8489
"provide": true,
90+
"provideLocal": true,
8591
"reactify": true,
8692
"reactifyObject": true,
8793
"reactive": true,
@@ -152,6 +158,7 @@
152158
"useCeil": true,
153159
"useClamp": true,
154160
"useClipboard": true,
161+
"useClipboardItems": true,
155162
"useCloned": true,
156163
"useColorMode": true,
157164
"useConfirmDialog": true,
@@ -258,7 +265,6 @@
258265
"useSpeechRecognition": true,
259266
"useSpeechSynthesis": true,
260267
"useStepper": true,
261-
"useStorage": true,
262268
"useStorageAsync": true,
263269
"useStyleTag": true,
264270
"useSum": true,

javascript-version/.eslintrc.js renamed to javascript-version/.eslintrc.cjs

Lines changed: 32 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,8 @@ module.exports = {
99
'plugin:import/recommended',
1010
'plugin:promise/recommended',
1111
'plugin:sonarjs/recommended',
12+
'plugin:case-police/recommended',
13+
'plugin:regexp/recommended',
1214

1315
// 'plugin:unicorn/recommended',
1416
],
@@ -20,15 +22,18 @@ module.exports = {
2022
plugins: [
2123
'vue',
2224
'regex',
25+
'regexp',
2326
],
24-
ignorePatterns: ['resources/js/@iconify/*.js', 'node_modules', 'dist'],
27+
ignorePatterns: ['resources/js/plugins/iconify/*.js', 'node_modules', 'dist', '*.d.ts', 'vendor', '*.json'],
2528
rules: {
2629
'no-console': process.env.NODE_ENV === 'production' ? 'warn' : 'off',
2730
'no-debugger': process.env.NODE_ENV === 'production' ? 'warn' : 'off',
2831

2932
// indentation (Already present in TypeScript)
3033
'comma-spacing': ['error', { before: false, after: true }],
3134
'key-spacing': ['error', { afterColon: true }],
35+
'n/prefer-global/process': ['off'],
36+
'sonarjs/cognitive-complexity': ['off'],
3237

3338
'vue/first-attribute-linebreak': ['error', {
3439
singleline: 'beside',
@@ -45,6 +50,9 @@ module.exports = {
4550
// Enforce consistent spacing inside braces of object (Already present in TypeScript)
4651
'object-curly-spacing': ['error', 'always'],
4752

53+
// Enforce camelCase naming convention
54+
'camelcase': 'error',
55+
4856
// Disable max-len
4957
'max-len': 'off',
5058

@@ -67,6 +75,9 @@ module.exports = {
6775
allowClassStart: true,
6876
allowObjectStart: true,
6977
allowArrayStart: true,
78+
79+
// We don't want to add extra space above closing SECTION
80+
ignorePattern: '!SECTION',
7081
},
7182
],
7283

@@ -88,7 +99,10 @@ module.exports = {
8899
// Plugin: eslint-plugin-import
89100
'import/prefer-default-export': 'off',
90101
'import/newline-after-import': ['error', { count: 1 }],
91-
'no-restricted-imports': ['error', 'vuetify/components'],
102+
'no-restricted-imports': ['error', 'vuetify/components', {
103+
name: 'vue3-apexcharts',
104+
message: 'apexcharts are auto imported',
105+
}],
92106

93107
// For omitting extension for ts files
94108
'import/extensions': [
@@ -107,6 +121,8 @@ module.exports = {
107121
ignore: [
108122
'~pages$',
109123
'virtual:generated-layouts',
124+
'#auth$',
125+
'#components$',
110126

111127
// Ignore vite's ?raw imports
112128
'.*\?raw',
@@ -124,7 +140,7 @@ module.exports = {
124140
// ESLint plugin vue
125141
'vue/block-tag-newline': 'error',
126142
'vue/component-api-style': 'error',
127-
'vue/component-name-in-template-casing': ['error', 'PascalCase', { registeredComponentsOnly: false }],
143+
'vue/component-name-in-template-casing': ['error', 'PascalCase', { registeredComponentsOnly: false, ignores: ['/^swiper-/'] }],
128144
'vue/custom-event-name-casing': ['error', 'camelCase', {
129145
ignores: [
130146
'/^(click):[a-z]+((\d)|([A-Z0-9][a-z0-9]+))*([A-Z])?/',
@@ -138,8 +154,7 @@ module.exports = {
138154
'vue/no-child-content': 'error',
139155
'vue/require-default-prop': 'off',
140156

141-
// NOTE this rule only supported in SFC, Users of the unplugin-vue-define-options should disable that rule: https://github.com/vuejs/eslint-plugin-vue/issues/1886
142-
// 'vue/no-duplicate-attr-inheritance': 'error',
157+
'vue/no-duplicate-attr-inheritance': 'error',
143158
'vue/no-empty-component-block': 'error',
144159
'vue/no-multiple-objects-in-class': 'error',
145160
'vue/no-reserved-component-names': 'error',
@@ -171,6 +186,8 @@ module.exports = {
171186
// },
172187
// }],
173188

189+
// Internal Rules
190+
174191
// https://github.com/gmullerb/eslint-plugin-regex
175192
'regex/invalid': [
176193
'error',
@@ -181,16 +198,16 @@ module.exports = {
181198
message: 'Use \'@images\' path alias for image imports',
182199
},
183200
{
184-
regex: '@/styles',
201+
regex: '@/assets/styles',
185202
replacement: '@styles',
186-
message: 'Use \'@styles\' path alias for importing styles from \'resources/js/styles\'',
203+
message: 'Use \'@styles\' path alias for importing styles from \'resources/js/assets/styles\'',
187204
},
188205

189-
// {
190-
// id: 'Disallow icon of icon library',
191-
// regex: 'tabler-\\w',
192-
// message: 'Only \'mdi\' icons are allowed',
193-
// },
206+
{
207+
id: 'Disallow icon of icon library',
208+
regex: 'tabler-\\w',
209+
message: 'Only \'mdi\' icons are allowed',
210+
},
194211

195212
{
196213
regex: '@core/\\w',
@@ -206,25 +223,16 @@ module.exports = {
206223
inspect: '^(?!.*(@core|@layouts)).*',
207224
},
208225
},
209-
{
210-
regex: 'import axios from \'axios\'',
211-
replacement: 'import axios from \'@axios\'',
212-
message: 'Use axios instances created in \'resources/js/plugin/axios.js\' instead of unconfigured axios',
213-
files: {
214-
ignore: '^.*plugins/axios.js.*',
215-
},
216-
},
217226
],
218227

219228
// Ignore files
220-
'\.eslintrc\.js',
229+
'\.eslintrc\.cjs',
221230
],
222231
},
223232
settings: {
224233
'import/resolver': {
225-
node: {
226-
extensions: ['.js', '.js', '.jsx', '.jsx', '.mjs', '.png', '.jpg'],
227-
}, alias: { 'extensions': ['.ts', '.js', '.tsx', '.jsx', '.mjs'], 'map': [["@", "./resources/js"], ["@core", "./resources/js/@core"], ["@layouts", "./resources/js/@layouts"], ["@images", "./resources/images/"], ["@styles", "./resources/styles/"], ["@configured-variables", "./resources/styles/variables/_template.scss"], ["@axios", "./resources/js/plugins/axios"], ["apexcharts", "node_modules/apexcharts-clevision"]] },
234+
node: true,
235+
typescript: { project: './jsconfig.json' },
228236
},
229237
},
230238
}

0 commit comments

Comments
 (0)