From a88a20feae21458be3ffe374d3591d47a979a51d Mon Sep 17 00:00:00 2001 From: Dang Van Thanh Date: Mon, 2 Oct 2023 09:12:40 +0700 Subject: [PATCH] Update deno for fe --- .github/workflows/deploy.yml | 40 +++++++++++++++++++++++------------- apps/client/deno.json | 8 ++++++++ apps/client/tsconfig.json | 3 +-- apps/client/vite.config.ts | 4 +++- 4 files changed, 38 insertions(+), 17 deletions(-) create mode 100644 apps/client/deno.json diff --git a/.github/workflows/deploy.yml b/.github/workflows/deploy.yml index 2b04480..f241384 100644 --- a/.github/workflows/deploy.yml +++ b/.github/workflows/deploy.yml @@ -1,39 +1,51 @@ name: Deploy + on: push: branches: dangvanthanh/hono pull_request: branches: dangvanthanh/hono + jobs: deploy: - name: Deploy runs-on: ubuntu-latest permissions: - id-token: write # Needed for auth with Deno Deploy - contents: read # Needed to clone the repository + id-token: write + contents: read steps: - name: Clone repository uses: actions/checkout@v3 + - name: Cache .deno/ + id: cache-deno + uses: actions/cache@v3 + with: + path: .deno/ + key: ${{ runner.os }}-deno + + - name: Cache node_modules/ + id: cache-node-modules + uses: actions/cache@v3 + with: + path: node_modules/ + key: ${{ runner.os }}-node-modules + - name: Install Deno uses: denoland/setup-deno@v1 with: deno-version: v1.x - - name: Install Node.js - uses: actions/setup-node@v3 - with: - node-version: lts/* - - - name: Build step - run: "moon install && moon run client:build" # 📝 Update the build command(s) if necessary + - name: Build production + env: + DENO_DIR: .deno + run: deno task build - - name: Upload to Deno Deploy + - name: Deploy to Deno Deploy uses: denoland/deployctl@v1 with: - project: "vue-shopping-cart" - entrypoint: "index.js" # 📝 Update the entrypoint if necessary - root: "." # 📝 Update the root if necessary + project: vue-shopping-cart + root: dist + entrypoint: https://deno.land/std@0.157.0/http/file_server.ts diff --git a/apps/client/deno.json b/apps/client/deno.json new file mode 100644 index 0000000..fc0f5a6 --- /dev/null +++ b/apps/client/deno.json @@ -0,0 +1,8 @@ +{ + "tasks": { + "dev": "deno run -A --unstable --node-modules-dir npm:vite", + "build": "deno run -A --unstable --node-modules-dir npm:vite build", + "preview": "deno run -A --unstable --node-modules-dir npm:vite preview", + "serve": "deno run --allow-net --allow-read main.ts" + } +} diff --git a/apps/client/tsconfig.json b/apps/client/tsconfig.json index 9b17f63..b5be5b8 100644 --- a/apps/client/tsconfig.json +++ b/apps/client/tsconfig.json @@ -22,8 +22,7 @@ "outDir": "../../.moon/cache/types/apps/client", "baseUrl": ".", "paths": { - "@/*": ["./src/*"], - "@styled-system": ["./styled-system/*"] + "@/*": ["./src/*"] } }, "include": [ diff --git a/apps/client/vite.config.ts b/apps/client/vite.config.ts index 6954528..4acb4a3 100644 --- a/apps/client/vite.config.ts +++ b/apps/client/vite.config.ts @@ -2,13 +2,15 @@ import path from 'path' import { defineConfig } from 'vite' import vue from '@vitejs/plugin-vue' +// NOTE(bartlomieju): this is a papercut that shouldn't be required, see README.md +import "npm:vue"; + // https://vitejs.dev/config/ export default defineConfig({ plugins: [vue()], resolve: { alias: { '@': path.resolve(__dirname, 'src'), - '@styled-system': path.resolve(__dirname, 'styled-system'), }, }, })