Skip to content
This repository was archived by the owner on Jun 19, 2024. It is now read-only.

Commit 5f0371d

Browse files
authored
Updating Varie to use grid
1 parent 7842f10 commit 5f0371d

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

65 files changed

+6454
-3784
lines changed

.babelrc

-9
This file was deleted.

.browserslistrc

+4
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
# Browsers that we support
2+
# http://browserl.ist
3+
4+
defaults

.env.example

+4-1
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,5 @@
11
APP_NAME=Varie Documentation
2-
APP_HOST=varie-docs.test
2+
APP_HOST=varie-docs.test
3+
4+
DOC_SEARCH_API_KEY=
5+
RAVEN_URL=

.gitignore

+1-2
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
11
.env
2-
.cache-loader
32
public
4-
node_modules
3+
node_modules

.nvmrc

+1-1
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
10.15.0
1+
10.15.3

.prettierignore

+1-3
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,2 @@
1-
public/
2-
package.json
3-
.cache-loader
1+
public
42
resources/assets/font-awesome

.prettierrc

+13-2
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,15 @@
11
{
2+
"printWidth": 80,
3+
"tabWidth": 2,
4+
"useTabs": false,
5+
"semi" : true,
6+
"singleQuote": false,
27
"trailingComma": "all",
3-
"arrowParens": "always"
4-
}
8+
"bracketSpacing" : true,
9+
"jsxBracketSameLine": false,
10+
"arrowParens": "always",
11+
"rangeStart" : 0,
12+
"requirePragma" : false,
13+
"insertPragma" : false,
14+
"proseWrap" : "preserve"
15+
}

app/app.ts

+3-5
Original file line numberDiff line numberDiff line change
@@ -7,17 +7,15 @@
77
*/
88
import Vue from "vue";
99
import * as Raven from "raven-js";
10-
import { application } from "varie";
10+
import { Application } from "varie";
1111
import RavenVue from "raven-js/plugins/vue";
1212
import BaseLayout from "varie/BaseLayout.vue";
1313
import RouterInterface from "varie/lib/routing/RouterInterface";
1414
import StateServiceInterface from "varie/lib/state/StateServiceInterface";
1515

16-
application.boot().then((app) => {
16+
new Application().boot().then((app) => {
1717
if ($config.get("app.env") === "production") {
18-
Raven.config(
19-
"https://[email protected]/8",
20-
)
18+
Raven.config($config.get("raven.url"))
2119
.addPlugin(RavenVue)
2220
.install();
2321
}

app/globals.ts

+2
Original file line numberDiff line numberDiff line change
@@ -12,4 +12,6 @@ import ApplicationInterface from "varie/lib/foundation/ApplicationInterface";
1212
declare global {
1313
const $config: ConfigInterface;
1414
const $app: ApplicationInterface;
15+
16+
type AnyClass = { new (): any };
1517
}

app/index.d.ts

+31
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
import Vue from "vue";
2+
3+
/*
4+
|--------------------------------------------------------------------------
5+
| Vue Constructor Properties
6+
|--------------------------------------------------------------------------
7+
|
8+
| You can add additional properties to let typescript do its work
9+
|
10+
*/
11+
declare module "vue/types/options" {
12+
interface ComponentOptions<V extends Vue> {
13+
$inject?: Array<string>;
14+
15+
// ...
16+
}
17+
}
18+
19+
/*
20+
|--------------------------------------------------------------------------
21+
| Vue Component Properties
22+
|--------------------------------------------------------------------------
23+
|
24+
| You can add additional properties to let typescript do its work
25+
|
26+
*/
27+
declare module "vue/types/vue" {
28+
interface Vue {
29+
// ...
30+
}
31+
}

app/middleware/LoadingScreen.ts

-71
This file was deleted.

app/middleware/index.ts

+1-3
Original file line numberDiff line numberDiff line change
@@ -1,3 +1 @@
1-
import LoadingScreen from "./LoadingScreen";
2-
3-
export default [LoadingScreen];
1+
export default [];

app/providers/AppServiceProvider.ts

+6-5
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
1-
import ServiceProvider from "varie/lib/support/ServiceProvider";
1+
import { ServiceProvider } from "varie";
2+
23
/*
34
|--------------------------------------------------------------------------
45
| App Service Provider
@@ -8,11 +9,11 @@ import ServiceProvider from "varie/lib/support/ServiceProvider";
89
|
910
*/
1011
export default class AppProviderServiceProvider extends ServiceProvider {
11-
public boot() {
12-
//
12+
public async boot() {
13+
// ...
1314
}
1415

15-
public register() {
16-
//
16+
public async register() {
17+
// ...
1718
}
1819
}

app/providers/DocumentationServiceProvider.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import { injectable } from "inversify";
2-
import ServiceProvider from "varie/lib/support/ServiceProvider";
2+
import { ServiceProvider } from "varie";
33
import DocumentationService from "@app/services/DocumentationService";
44

55
/*

app/providers/RouteServiceProvider.ts

+15-3
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import Routes from "@routes";
2-
import VueRouterService from "varie/lib/routing/VueRouterService";
3-
import ServiceProvider from "varie/lib/routing/RoutingServiceProvider";
2+
import RouterInterface from "varie/lib/routing/RouterInterface";
3+
import { RoutingServiceProvider as ServiceProvider } from "varie";
44

55
/*
66
|--------------------------------------------------------------------------
@@ -9,7 +9,19 @@ import ServiceProvider from "varie/lib/routing/RoutingServiceProvider";
99
|
1010
*/
1111
export default class RoutingServiceProvider extends ServiceProvider {
12-
public $router: VueRouterService;
12+
public $router: RouterInterface;
13+
14+
public async boot() {
15+
super.boot();
16+
17+
// ...
18+
}
19+
20+
public async register() {
21+
super.register();
22+
23+
// ...
24+
}
1325

1426
map() {
1527
this.$router.register(Routes);

app/providers/StateServiceProvider.ts

+14-2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import MenuStore from "@store/menu/MenuStore";
2-
import ServiceProvider from "varie/lib/state/StateServiceProvider";
2+
import { StateServiceProvider as ServiceProvider } from "varie";
33
import StateServiceInterface from "varie/lib/state/StateServiceInterface";
44

55
/*
@@ -11,7 +11,19 @@ import StateServiceInterface from "varie/lib/state/StateServiceInterface";
1111
export default class StateServiceProvider extends ServiceProvider {
1212
public $store: StateServiceInterface;
1313

14-
map() {
14+
public async boot() {
15+
super.boot();
16+
17+
// ...
18+
}
19+
20+
public async register() {
21+
super.register();
22+
23+
// ...
24+
}
25+
26+
public map() {
1527
this.$store.registerStore(MenuStore);
1628
}
1729
}

app/services/DocumentationService.ts

+13-9
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,7 @@ export default class DocumentationService {
3535
// ADDING MOBILE SEARCH TO MENU
3636
return `<div><ul class="search-area"><li><input id="menu-search" type="text" placeholder="Search" name="search"></li></ul>${menuTemplate}</div>`;
3737
} catch (err) {
38+
console.info(err);
3839
this.$router.push("/404");
3940
}
4041
}
@@ -55,22 +56,25 @@ export default class DocumentationService {
5556
}
5657
}
5758

58-
pageMenu(version : string, page : string) {
59+
pageMenu(version: string, page: string) {
5960
let markdownPage = require(`@resources/docs/${version}/${page}.md`);
6061

61-
let routeName = this.$router.currentRoute;
62-
63-
let menu = `<h1 class="text-capitalize">${routeName.params.page.replace('-',' ')}</h1>`;
62+
let menu = `<h1 class="text-capitalize">${page.replace("-", " ")}</h1>`;
6463

6564
let matches = markdownPage.match(/<h(1|2|3).*/g);
6665

67-
matches.forEach((menuItem) => {
68-
menu += menuItem.replace(/<h(\d) id="(.*)">(.*)<.*>/, "<li class='documentation__content__links__level--$1'><a href=\"#$2\">$3</a></li>\n")
69-
})
66+
if (matches) {
67+
matches.forEach((menuItem) => {
68+
menu += menuItem.replace(
69+
/<h(\d) id="(.*)">(.*)<.*>/,
70+
"<li class='documentation__content__links__level--$1'><a href=\"#$2\">$3</a></li>\n",
71+
);
72+
});
73+
}
7074

7175
menu = this._renderRouterLinks(menu, version);
7276

73-
return `<ul class="documentation__content__links">${menu}</ul>`
77+
return `<ul class="documentation__content__links">${menu}</ul>`;
7478
}
7579

7680
private _renderRouterLinks(html, version) {
@@ -88,7 +92,7 @@ export default class DocumentationService {
8892
hash : "#$1"
8993
}'`.replace(/\r?\n|\r/g, ""),
9094
)
91-
.replace(/<li(.*)>(<a.*)<\/li>/g, '<li $1>$2</li>')
95+
.replace(/<li(.*)>(<a.*)<\/li>/g, "<li $1>$2</li>")
9296
.replace(/<a (:to.*)>(.*)<.*\/a>/g, "<router-link $1>$2</router-link>")
9397
.replace(/%7B%7Bversion%7D%7D/g, version);
9498
}

babel.config.js

+10
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
module.exports = {
2+
presets: [
3+
[
4+
"varie-app",
5+
{
6+
jsx: true,
7+
},
8+
],
9+
],
10+
};

config/alerts.ts

+13
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
export default {
2+
/*
3+
|--------------------------------------------------------------------------
4+
| Duration
5+
|--------------------------------------------------------------------------
6+
|
7+
| How long a notification will show up, 0 will make it
8+
| a forever living notification.
9+
|
10+
*/
11+
12+
duration: 0,
13+
};

0 commit comments

Comments
 (0)