Skip to content

Commit

Permalink
Merge pull request #1 from alkrauss48/switch-to-vite
Browse files Browse the repository at this point in the history
Switch to vite
  • Loading branch information
alkrauss48 authored Jul 27, 2023
2 parents 481e57a + 588f280 commit b595942
Show file tree
Hide file tree
Showing 32 changed files with 1,735 additions and 11,463 deletions.
10 changes: 5 additions & 5 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@ name: ci
on: push

jobs:
eslint:
name: ESLint
lint:
name: Lint
runs-on: ubuntu-latest
steps:
- name: Install Node.js
Expand All @@ -22,11 +22,11 @@ jobs:
${{ runner.os }}-node-
- name: Install npm dependencies
run: npm ci --prefer-offline
- name: Run ESLint
run: npm run lint
- name: Run Typescript lint
run: node_modules/.bin/vue-tsc
build:
name: Build
needs: ['eslint']
needs: ['lint']
runs-on: ubuntu-latest
steps:
-
Expand Down
23 changes: 12 additions & 11 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,21 +1,22 @@
.DS_Store
node_modules
/dist


# local env files
.env.local
.env.*.local

# Log files
# Logs
logs
*.log
npm-debug.log*
yarn-debug.log*
yarn-error.log*
pnpm-debug.log*
lerna-debug.log*

node_modules
dist
dist-ssr
*.local

# Editor directories and files
.vscode/*
!.vscode/extensions.json
.idea
.vscode
.DS_Store
*.suo
*.ntvs*
*.njsproj
Expand Down
3 changes: 3 additions & 0 deletions .vscode/extensions.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
"recommendations": ["Vue.volar", "Vue.vscode-typescript-vue-plugin"]
}
47 changes: 33 additions & 14 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,24 +1,43 @@
# simple-slides
# Simple Slides

## Project setup
[Simple Slides](https://simpleslides.dev) is a small Vue app built with Vite and
TypeScript that allows for simple and content-friendly rendering of presentation
slides via Markdown.

Simple Slides follows the [Takahashi Method]() of presenting slides, which
focuses on:

* Prioritizing text-content
* Low amount of content per slide
* Many slides, and changing through slides quickly

## To Install
```
npm install
```

### Compiles and hot-reloads for development
```
npm run serve
## To Run
```
npm run dev # Navigate to http://localhost:5173
### Compiles and minifies for production
```
npm run build
```
# Alternatively, you can run with Docker,
# but that will generate a release build,
# which is not ideal for developing
### Lints and fixes files
```
npm run lint
docker compose up
```

### Customize configuration
See [Configuration Reference](https://cli.vuejs.org/config/).
## Recommended IDE Setup

- [VS Code](https://code.visualstudio.com/) + [Volar](https://marketplace.visualstudio.com/items?itemName=Vue.volar) (and disable Vetur) + [TypeScript Vue Plugin (Volar)](https://marketplace.visualstudio.com/items?itemName=Vue.vscode-typescript-vue-plugin).

## Type Support For `.vue` Imports in TS

TypeScript cannot handle type information for `.vue` imports by default, so we replace the `tsc` CLI with `vue-tsc` for type checking. In editors, we need [TypeScript Vue Plugin (Volar)](https://marketplace.visualstudio.com/items?itemName=Vue.vscode-typescript-vue-plugin) to make the TypeScript language service aware of `.vue` types.

If the standalone TypeScript plugin doesn't feel fast enough to you, Volar has also implemented a [Take Over Mode](https://github.com/johnsoncodehk/volar/discussions/471#discussioncomment-1361669) that is more performant. You can enable it by the following steps:

1. Disable the built-in TypeScript Extension
1. Run `Extensions: Show Built-in Extensions` from VSCode's command palette
2. Find `TypeScript and JavaScript Language Features`, right click and select `Disable (Workspace)`
2. Reload the VSCode window by running `Developer: Reload Window` from the command palette.
8 changes: 0 additions & 8 deletions babel.config.js

This file was deleted.

2 changes: 1 addition & 1 deletion docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,4 +8,4 @@ services:
context: .
dockerfile: docker/frontend/Dockerfile
ports:
- "8080:80"
- "5173:80"
2 changes: 1 addition & 1 deletion docker/frontend/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ COPY package.json package-lock.json ./
RUN npm ci

COPY . .
RUN node_modules/.bin/vue-cli-service build
RUN node_modules/.bin/vite build

# Final Image
FROM nginx:stable-alpine
Expand Down
5 changes: 1 addition & 4 deletions public/index.html → index.html
Original file line number Diff line number Diff line change
Expand Up @@ -32,10 +32,7 @@
<meta name="twitter:creator" content="@thecodeboss">
</head>
<body class="m-0">
<noscript>
<strong>We're sorry but <%= htmlWebpackPlugin.options.title %> doesn't work properly without JavaScript enabled. Please enable it to continue.</strong>
</noscript>
<div id="app"></div>
<!-- built files will be auto injected -->
<script type="module" src="/src/main.ts"></script>
</body>
</html>
19 changes: 0 additions & 19 deletions jsconfig.json

This file was deleted.

Loading

0 comments on commit b595942

Please sign in to comment.