Skip to content

Commit

Permalink
Merge pull request #3 from web-ts/main
Browse files Browse the repository at this point in the history
Release 0.0.3
  • Loading branch information
web-ts authored Dec 8, 2022
2 parents 526e00c + 9504b59 commit 8c6db24
Show file tree
Hide file tree
Showing 107 changed files with 3,019 additions and 389 deletions.
25 changes: 25 additions & 0 deletions configs/docs.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
import { defineConfig } from "vite";
import vue from "@vitejs/plugin-vue";
import WindiCSS from "vite-plugin-windicss";
import sharedPlugins from "./shared-plugins";
import Markdown from "vite-plugin-md";
// import code from "@yankeeinlondon/code-builder";
import prism from "markdown-it-prism";
export default defineConfig({
define: {
VERSION: JSON.stringify(process.env.npm_package_version),
__VUE_PROD_DEVTOOLS__: false
},
plugins: [
...sharedPlugins,
WindiCSS(),
vue({
include: [/\.vue$/, /\.md$/] // <--
}),
Markdown({
markdownItSetup(md) {
md.use(prism);
}
})
]
});
19 changes: 19 additions & 0 deletions configs/index.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
import prod from "./prod";
import docs from "./docs";
import test from "./test";
import playground from "./playground";

export function getConfig(env: string) {
switch (env) {
case "prod":
return prod;
case "test":
return test;
case "docs":
return docs;
case "playground":
return playground;
default:
return prod;
}
}
11 changes: 11 additions & 0 deletions configs/playground.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
import { defineConfig } from "vite";
import vue from "@vitejs/plugin-vue";
import sharedPlugins from "./shared-plugins";

export default defineConfig({
define: {
VERSION: JSON.stringify(process.env.npm_package_version),
__VUE_PROD_DEVTOOLS__: false
},
plugins: [...sharedPlugins, vue()]
});
27 changes: 27 additions & 0 deletions configs/prod.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
import { defineConfig } from "vite";
import { resolve } from "path";
import dts from "vite-plugin-dts";
import sharedPlugins from "./shared-plugins";

export default defineConfig({
define: {
VERSION: JSON.stringify(process.env.npm_package_version)
},
build: {
lib: {
entry: resolve(__dirname, "../src/index.ts"),
name: "VueMaterialYou",
fileName: (format) => `vue-material-you.${format}.js`
},
rollupOptions: {
external: ["vue", "vue-router"],
output: {
globals: {
vue: "Vue",
"vue-router": "VueRouter"
}
}
}
},
plugins: [...sharedPlugins, dts()]
});
18 changes: 18 additions & 0 deletions configs/shared-plugins.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
import esLint from "vite-plugin-eslint";
import autoImport from "unplugin-auto-import/vite";
import sassDts from "vite-plugin-sass-dts";
import yaml from "@modyfi/vite-plugin-yaml";
import vitePluginRaw from "vite-plugin-raw";

export default [
vitePluginRaw({
match: /\.svg$/
}),
yaml(),
esLint(),
sassDts(),
autoImport({
imports: ["vue"],
dts: "src/auto-imports.d.ts"
})
];
27 changes: 27 additions & 0 deletions configs/test.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
/// <reference types="vitest" />

import { defineConfig } from "vite";
import vue from "@vitejs/plugin-vue";
import sharedPlugins from "./shared-plugins";

export default defineConfig({
define: {
VERSION: JSON.stringify(process.env.npm_package_version),
__VUE_PROD_DEVTOOLS__: false
},
test: {
globals: true,
include: ["./src/**/*.spec.ts"],
environment: "happy-dom",
coverage: {
lines: 80,
functions: 80,
branches: 80,
statements: 80
},
deps: {
inline: ["@material/material-color-utilities"]
}
},
plugins: [...sharedPlugins, vue()]
});
8 changes: 0 additions & 8 deletions dev/App.ts

This file was deleted.

33 changes: 0 additions & 33 deletions dev/ComponentLoader.ts

This file was deleted.

25 changes: 0 additions & 25 deletions dev/Home.ts

This file was deleted.

37 changes: 0 additions & 37 deletions dev/components/Buttons/index.ts

This file was deleted.

72 changes: 0 additions & 72 deletions dev/components/Dialogs/index.ts

This file was deleted.

1 change: 0 additions & 1 deletion dev/readme.md

This file was deleted.

34 changes: 0 additions & 34 deletions dev/router/index.ts

This file was deleted.

4 changes: 4 additions & 0 deletions docs/App.vue
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
<script setup lang="ts"></script>
<template>
<router-view />
</template>
5 changes: 5 additions & 0 deletions docs/assets/logo.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
5 changes: 5 additions & 0 deletions docs/env.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
declare module "*.md" {
import type { ComponentOptions } from "vue";
const Component: ComponentOptions;
export default Component;
}
Loading

0 comments on commit 8c6db24

Please sign in to comment.