aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLibravatar vnugent <public@vaughnnugent.com>2024-06-06 15:56:36 -0400
committerLibravatar vnugent <public@vaughnnugent.com>2024-06-06 15:56:36 -0400
commit35920ad6c8596fc14bcfed66303511e8c249be8d (patch)
tree5394c287ab9f9d36c43d0f58368256fd9f1bb420
parent3c228b3cc5172fae398af8de72b64bd780ace20c (diff)
ci: Local vite config, force set lib versions
-rw-r--r--ci/taskfile.yaml1
-rw-r--r--front-end/Taskfile.yaml18
-rw-r--r--front-end/package-lock.json18
-rw-r--r--front-end/package.json18
-rw-r--r--front-end/vite.config.ts70
-rw-r--r--lib/Taskfile.yaml5
6 files changed, 79 insertions, 51 deletions
diff --git a/ci/taskfile.yaml b/ci/taskfile.yaml
index 9ca63d4..37c732e 100644
--- a/ci/taskfile.yaml
+++ b/ci/taskfile.yaml
@@ -138,7 +138,6 @@ tasks:
internal: false
dotenv: ['build.env'] #use the local .env file when compiling config variables
cmds:
- - echo "$CACHE_ASM_PATH"
- cmd: powershell mkdir config/ -Force
ignore_error: true
- cmd: powershell './compile.ps1' -InputDir config-templates/ -OutputDir config/
diff --git a/front-end/Taskfile.yaml b/front-end/Taskfile.yaml
index 3645800..c64dc22 100644
--- a/front-end/Taskfile.yaml
+++ b/front-end/Taskfile.yaml
@@ -7,23 +7,25 @@ tasks:
build:
cmds:
+ - cmd: npm version {{ .BUILD_VERSION }}
+ ignore_error: true #error if run when version is not updated
+
#build admin first
- cd ../lib/admin && npm install && npm run build
- #install deps and run build
- - npm install && npm run build
+ #install deps and run main build
+ - npm install
+ - npm run build
#copy artifacts to temp directory
postbuild_success:
cmds:
- - powershell -Command "mkdir bin -Force"
+ - powershell mkdir bin -Force
#tar the dist output and put it in the output dir
- - cd dist && tar -czf '../bin/release.tgz' .
+ - cd dist/ && tar -czf '../bin/release.tgz' .
#clean hook
clean:
ignore_error: true
cmds:
- - cmd: powershell -Command "Remove-Item -Recurse -Force node_modules"
- - cmd: powershell -Command "Remove-Item -Recurse -Force dist"
- - cmd: powershell -Command "Remove-Item -Recurse -Force bin"
- - cmd: powershell -Command "Remove-Item release.tgz" \ No newline at end of file
+ - for: [ node_modules/, dist/, bin/ ]
+ cmd: powershell -Command "Remove-Item -Recurse -Force {{.ITEM}}" \ No newline at end of file
diff --git a/front-end/package-lock.json b/front-end/package-lock.json
index 136fc79..70395d9 100644
--- a/front-end/package-lock.json
+++ b/front-end/package-lock.json
@@ -39,6 +39,7 @@
"@ckeditor/ckeditor5-core": "^40.0.0",
"@ckeditor/ckeditor5-upload": "^40.0.0",
"@types/lodash-es": "^4.14.194",
+ "@types/node": "^20.14.2",
"@types/showdown": "^2.0.1",
"@vitejs/plugin-vue": "^5.0.x",
"autoprefixer": "^10.4.14",
@@ -1295,6 +1296,16 @@
"@types/lodash": "*"
}
},
+ "node_modules/@types/node": {
+ "version": "20.14.2",
+ "resolved": "https://registry.npmjs.org/@types/node/-/node-20.14.2.tgz",
+ "integrity": "sha512-xyu6WAMVwv6AKFLB+e/7ySZVr/0zLCzOa7rSpq6jNwpqOrUbcACDWC+53d4n2QHOnDou0fbIsg8wZu/sxrnI4Q==",
+ "dev": true,
+ "license": "MIT",
+ "dependencies": {
+ "undici-types": "~5.26.4"
+ }
+ },
"node_modules/@types/showdown": {
"version": "2.0.6",
"resolved": "https://registry.npmjs.org/@types/showdown/-/showdown-2.0.6.tgz",
@@ -4473,6 +4484,13 @@
"integrity": "sha512-Y7HYmWaFwPUmkoQCUIAYpKqkOf+SbVj/2fJJZ4RJMCfZp0rTGwRbzQD+HghfnhKOjL9E01okqz+ncJskGYfBNw==",
"dev": true
},
+ "node_modules/undici-types": {
+ "version": "5.26.5",
+ "resolved": "https://registry.npmjs.org/undici-types/-/undici-types-5.26.5.tgz",
+ "integrity": "sha512-JlCMO+ehdEIKqlFxk6IfVoAUVmgz7cU7zD/h9XZ0qzeosSHmUJVOzSQvvYSYWXkFXC+IfLKSIffhv0sVZup6pA==",
+ "dev": true,
+ "license": "MIT"
+ },
"node_modules/universal-cookie": {
"version": "7.1.4",
"resolved": "https://registry.npmjs.org/universal-cookie/-/universal-cookie-7.1.4.tgz",
diff --git a/front-end/package.json b/front-end/package.json
index f310523..6b464e4 100644
--- a/front-end/package.json
+++ b/front-end/package.json
@@ -8,10 +8,8 @@
"repository": "https://github.com/VnUgE/CMNext/tree/master/front-end",
"author": "Vaughn Nugent",
"output_dir": "bin",
-
"main": "index.html",
"license": "agpl3",
-
"scripts": {
"dev": "vite",
"watch": "vite build --watch --mode development --minify false",
@@ -20,7 +18,6 @@
"update": "npm update",
"outdated": "npm outdated"
},
-
"dependencies": {
"@fontsource/source-sans-pro": "^5.0.8",
"@fortawesome/fontawesome-svg-core": "^6.4.0",
@@ -35,22 +32,25 @@
"@vuelidate/validators": "^2.0.2",
"@vueuse/core": "^10.3.x",
"@vueuse/router": "^10.3.x",
- "qrcode.vue": "^3.4.1",
"axios": "^1.4.0",
"base32-encode": "^2.0.0",
"jose": "^5.0.x",
"json-editor-vue": "^0.15.1",
"lodash-es": "^4.17.21",
"otpauth": "^9.1.2",
- "showdown": "^2.1.0",
"pinia": "^2.1.7",
+ "qrcode.vue": "^3.4.1",
+ "showdown": "^2.1.0",
"universal-cookie": "^7.0.x",
"vue": "^3.2.47",
"vue3-otp-input": "^0.5.2"
},
"devDependencies": {
- "@types/showdown": "^2.0.1",
+ "@ckeditor/ckeditor5-core": "^40.0.0",
+ "@ckeditor/ckeditor5-upload": "^40.0.0",
"@types/lodash-es": "^4.14.194",
+ "@types/node": "^20.14.2",
+ "@types/showdown": "^2.0.1",
"@vitejs/plugin-vue": "^5.0.x",
"autoprefixer": "^10.4.14",
"dotenv": "^16.0.3",
@@ -58,12 +58,10 @@
"sass": "^1.62.1",
"tailwindcss": "^3.3.2",
"typescript": "^5.0.2",
- "vite": "^5.0.x",
"unplugin-vue-router": "^0.9.0",
+ "vite": "^5.0.x",
"vue-eslint-parser": "^9.3.0",
"vue-router": "^4.2.0",
- "vue-tsc": "^2.0.6",
- "@ckeditor/ckeditor5-upload": "^40.0.0",
- "@ckeditor/ckeditor5-core": "^40.0.0"
+ "vue-tsc": "^2.0.6"
}
}
diff --git a/front-end/vite.config.ts b/front-end/vite.config.ts
index 9d71447..802ae48 100644
--- a/front-end/vite.config.ts
+++ b/front-end/vite.config.ts
@@ -16,42 +16,50 @@
import { defineConfig } from 'vite'
import vue from '@vitejs/plugin-vue'
import postcss from './postcss.config.js'
-import { server } from './vite.config.local.ts'
//Pages setup
import VueRouter from 'unplugin-vue-router/vite'
// https://vitejs.dev/config/
-export default defineConfig({
- build: {
- cssCodeSplit: true,
- rollupOptions: {
- plugins: [],
- output: {
-
- }
- },
- },
- css: {
- postcss: postcss
- },
- plugins: [
- //Setup the vite pages plugin
- VueRouter({
- extensions: ['vue'],
- routesFolder: 'src/views',
- exclude: ['**/components/**'],
- logs: true,
- getRouteName:(node) => {
- const trimSlashes = /^\/|\/$/g
- const name = node.fullPath.replace(trimSlashes, '')
- return name
+export default defineConfig(async () => {
+
+ let server = {};
+
+ try {
+ //try to import the local config for development
+ server = await import('./vite.config.local.ts')
+ }
+ catch { }
+
+ return {
+ build: {
+ cssCodeSplit: true,
+ rollupOptions: {
+ plugins: [],
+ output: {
+
+ }
},
- importMode: 'async',
- }),
- vue(),
- ],
- server: {
- ...server
+ },
+ css: {
+ postcss: postcss
+ },
+ plugins: [
+ //Setup the vite pages plugin
+ VueRouter({
+ extensions: ['vue'],
+ routesFolder: 'src/views',
+ exclude: ['**/components/**'],
+ logs: true,
+ getRouteName:(node) => {
+ const trimSlashes = /^\/|\/$/g
+ const name = node.fullPath.replace(trimSlashes, '')
+ return name
+ },
+ importMode: 'async',
+ }),
+ vue(),
+ ],
+ server
}
})
diff --git a/lib/Taskfile.yaml b/lib/Taskfile.yaml
index 6b8eb17..fac7f36 100644
--- a/lib/Taskfile.yaml
+++ b/lib/Taskfile.yaml
@@ -8,9 +8,12 @@ tasks:
build:
dir: '{{.USER_WORKING_DIR}}'
cmds:
+
+ - cmd: npm version {{ .BUILD_VERSION }}
+ ignore_error: true #error if run when version is not updated
#install deps and run build
+ - npm version
- npm install
- - npm run build
#copy artifacts to temp directory
postbuild_success: