Skip to content
This repository has been archived by the owner on Dec 3, 2021. It is now read-only.

Use Vite as our build service #8

Merged
merged 21 commits into from
May 21, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 0 additions & 18 deletions package.json

This file was deleted.

2 changes: 0 additions & 2 deletions packages/awtrix/.eslintrc.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,6 @@ module.exports = {
parser: '@typescript-eslint/parser'
},
extends: [
'@nuxtjs/eslint-config-typescript',
'plugin:nuxt/recommended',
'plugin:@typescript-eslint/recommended',
'plugin:vue/vue3-recommended'
],
Expand Down
5 changes: 1 addition & 4 deletions packages/awtrix/.gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -65,10 +65,7 @@ typings/
# next.js build output
.next

# nuxt.js build output
.nuxt

# Nuxt generate
# Transpilation results
dist

# vuepress build output
Expand Down
10 changes: 10 additions & 0 deletions packages/awtrix/.swcrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
{
"module": {
"type": "commonjs"
},
"jsc": {
"parser": {
"syntax": "typescript"
}
}
}
13 changes: 0 additions & 13 deletions packages/awtrix/bin/run

This file was deleted.

9 changes: 9 additions & 0 deletions packages/awtrix/bin/run.dev.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
import cli from '../src/cli'
import path from 'path'

global.awtrix = {
rootPath: path.dirname(path.resolve(__dirname)),
mode: 'dev'
}

cli(process.argv)
10 changes: 10 additions & 0 deletions packages/awtrix/bin/run.prod.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
#!/usr/bin/env node

const path = require('path')

global.awtrix = {
rootPath: path.dirname(path.resolve(__dirname)),
mode: 'static'
}

require('../dist/backend/cli').default(process.argv)
20 changes: 20 additions & 0 deletions packages/awtrix/import-stylus-variables.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
import type { Plugin } from 'vite'
import path from 'path'

export default function importStylus(): Plugin {
return {
name: 'vite-stylus-import-plugin',
async transform(code, id) {
if (/.stylus$/g.test(id)) {
return {
code: `
@import "${path.resolve(__dirname, 'web/assets/stylus/vars/index')}"
${code}
`,
map: null,
}
}
return null
}
}
}
16 changes: 6 additions & 10 deletions packages/awtrix/index.d.ts
Original file line number Diff line number Diff line change
@@ -1,14 +1,10 @@
// Nuxt Typed Vuex accessor types
import { accessorType } from '~/store'

declare module 'vue/types/vue' {
interface Vue {
$accessor: typeof accessorType
declare namespace NodeJS {
interface GlobalAwtrixOptions {
rootPath: string,
mode: 'dev' | 'static',
}
}

declare module '@nuxt/types' {
interface NuxtAppOptions {
$accessor: typeof accessorType
export interface Global {
awtrix: GlobalAwtrixOptions
}
}
2 changes: 1 addition & 1 deletion packages/awtrix/jsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,5 +8,5 @@
"@@/*": ["./*"]
}
},
"exclude": ["node_modules", ".nuxt", "dist"]
"exclude": ["node_modules", "dist"]
}
3 changes: 3 additions & 0 deletions packages/awtrix/nodemon.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
"watch": ["./src"]
}
103 changes: 0 additions & 103 deletions packages/awtrix/nuxt.config.js

This file was deleted.

16 changes: 0 additions & 16 deletions packages/awtrix/nuxt.d.ts

This file was deleted.

Loading