From 611745447011c82cbb447dda76381963b62b576f Mon Sep 17 00:00:00 2001 From: Blake Byrnes Date: Thu, 1 Feb 2024 16:44:46 -0500 Subject: [PATCH] chore: convert docpage to vite --- .github/workflows/js-branch.yml | 5 +- cloud/main/env.ts | 3 +- datastore/core/endpoints/DocpageRoutes.ts | 4 +- datastore/docpage/babel.config.js | 10 - datastore/docpage/index.html | 9 +- datastore/docpage/package.json | 29 +- .../docpage/src/assets/icons/datastore.svg | 4 +- datastore/docpage/src/layouts/Navbar.vue | 6 +- datastore/docpage/src/main.ts | 2 - datastore/docpage/src/vite-env.d.ts | 2 + datastore/docpage/vite.config.js | 46 + datastore/docpage/vue.config.js | 31 - yarn.lock | 3449 +---------------- 13 files changed, 220 insertions(+), 3380 deletions(-) delete mode 100644 datastore/docpage/babel.config.js create mode 100644 datastore/docpage/src/vite-env.d.ts create mode 100644 datastore/docpage/vite.config.js delete mode 100644 datastore/docpage/vue.config.js diff --git a/.github/workflows/js-branch.yml b/.github/workflows/js-branch.yml index 1c32f874b..e6250b9c2 100644 --- a/.github/workflows/js-branch.yml +++ b/.github/workflows/js-branch.yml @@ -49,8 +49,11 @@ jobs: run: yarn build working-directory: ./hero + - name: Set timeout + run: yarn config set network-timeout 1000000 -g + - name: Build modules - run: yarn && yarn build:dist --network-timeout 1000000 + run: yarn && yarn build:dist - name: Publish branch run: | diff --git a/cloud/main/env.ts b/cloud/main/env.ts index 7dd632499..f811c0868 100644 --- a/cloud/main/env.ts +++ b/cloud/main/env.ts @@ -1,6 +1,5 @@ -import { loadEnv, parseEnvBool, parseEnvList, parseEnvPath } from '@ulixee/commons/lib/envUtils'; +import { loadEnv, parseEnvBool, parseEnvPath } from '@ulixee/commons/lib/envUtils'; import Identity from '@ulixee/crypto/lib/Identity'; -import * as Path from 'path'; loadEnv(process.cwd()); loadEnv(__dirname); diff --git a/datastore/core/endpoints/DocpageRoutes.ts b/datastore/core/endpoints/DocpageRoutes.ts index bc0a32afc..6fca9f786 100644 --- a/datastore/core/endpoints/DocpageRoutes.ts +++ b/datastore/core/endpoints/DocpageRoutes.ts @@ -77,9 +77,7 @@ export default class DocpageRoutes { } if ( - params[2].startsWith('/js/') || - params[2].startsWith('/css/') || - params[2].startsWith('/img/') || + params[2].startsWith('/assets/') || params[2] === '/favicon.ico' ) { req.url = params[2]; diff --git a/datastore/docpage/babel.config.js b/datastore/docpage/babel.config.js deleted file mode 100644 index e0d66cfc3..000000000 --- a/datastore/docpage/babel.config.js +++ /dev/null @@ -1,10 +0,0 @@ -module.exports = { - presets: [ - '@vue/cli-plugin-babel/preset' - ], - "plugins": [ - ["prismjs", { - "languages": ["javascript", "shell"], - }] - ] -} diff --git a/datastore/docpage/index.html b/datastore/docpage/index.html index d774721b2..4340f6e6a 100644 --- a/datastore/docpage/index.html +++ b/datastore/docpage/index.html @@ -1,19 +1,20 @@ - + - <%= htmlWebpackPlugin.options.title %> + Ulixee
+ diff --git a/datastore/docpage/package.json b/datastore/docpage/package.json index a97e52a44..6ed43997d 100644 --- a/datastore/docpage/package.json +++ b/datastore/docpage/package.json @@ -2,10 +2,11 @@ "name": "@ulixee/datastore-docpage", "version": "2.0.0-alpha.25", "scripts": { - "serve": "vue-cli-service serve", - "build": "vue-cli-service build --mode production", - "build:dist": "cross-env BUILD_DIR=\"build-dist\" vue-cli-service build --mode production", - "lint": "vue-cli-service lint" + "serve": "vite", + "watch": "vite build -w", + "build": "vite build", + "build:dist": "cross-env BUILD_DIR=\"build-dist\" vite build", + "lint": "eslint --ext .ts,.vue --ignore-path .gitignore --fix src" }, "dependencies": { "@headlessui/vue": "^1.5.0", @@ -13,16 +14,9 @@ "@tailwindcss/forms": "^0.5.0", "@types/lodash.kebabcase": "^4.1.7", "@types/node": "^18.19.10", - "@vue/cli-plugin-babel": "~5.0.8", - "@vue/cli-plugin-router": "~5.0.8", - "@vue/cli-plugin-typescript": "~5.0.8", - "@vue/cli-service": "~5.0.8", - "@vue/compiler-sfc": "^3.2.21", "autoprefixer": "^10.4.2", "axios": "^1.6.7", - "babel-plugin-prismjs": "^2.1.0", "concurrently": "^6.2.2", - "core-js": "^3.21.1", "eslint": "^8.17.0", "eslint-plugin-import": "^2.26.0", "eslint-plugin-node": "^11.1.0", @@ -55,12 +49,15 @@ "unist-util-visit": "^4.1.0", "vfile": "^5.3.2", "vue": "^3.2.45", - "vue-inline-svg": "^3.1.0", "vue-router": "^4.0.0-0" }, "devDependencies": { "@ulixee/datastore-packager": "2.0.0-alpha.25", - "typescript": "^5.3.3" + "typescript": "^5.3.3", + "vite": "^2.5.4", + "vite-plugin-prismjs": "^0.0.11", + "vite-svg-loader": "^5.1.0", + "@vitejs/plugin-vue": "^1.6.1" }, "nohoist": [ "**/@typescript-eslint", @@ -71,9 +68,5 @@ "**/vue-loader", "**/vue-template-compiler", "**/postcss" - ], - "resolutions": { - "**/@achrinza/node-ipc": "10.1.6", - "**/@achrinza/event-pubsub": "" - } + ] } diff --git a/datastore/docpage/src/assets/icons/datastore.svg b/datastore/docpage/src/assets/icons/datastore.svg index 9de2352bf..850fdeebb 100644 --- a/datastore/docpage/src/assets/icons/datastore.svg +++ b/datastore/docpage/src/assets/icons/datastore.svg @@ -1,9 +1,9 @@ - + server - \ No newline at end of file + diff --git a/datastore/docpage/src/layouts/Navbar.vue b/datastore/docpage/src/layouts/Navbar.vue index d4cef8487..e2e923ade 100644 --- a/datastore/docpage/src/layouts/Navbar.vue +++ b/datastore/docpage/src/layouts/Navbar.vue @@ -3,7 +3,7 @@