Skip to content
This repository has been archived by the owner on Aug 2, 2024. It is now read-only.

Commit

Permalink
fix: fixed github pages + improved linting + cleaned package.json
Browse files Browse the repository at this point in the history
  • Loading branch information
ChristianKienle committed Jul 16, 2019
1 parent 9961a75 commit 0ac627c
Show file tree
Hide file tree
Showing 11 changed files with 48 additions and 38 deletions.
1 change: 0 additions & 1 deletion demo/Overview.vue
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@
</template>

<script>
export default {
computed: {
pages() {
Expand Down
2 changes: 1 addition & 1 deletion demo/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import VirtualScroller from "vue-virtual-scroller";
import VueObserveVisibility from "vue-observe-visibility";
import "./main.scss";

Vue.use(VueObserveVisibility)
Vue.use(VueObserveVisibility);
Vue.use(VirtualScroller);
Vue.use(VueRouter);
Vue.use(FundamentalVue, {
Expand Down
3 changes: 1 addition & 2 deletions demo/pages/popover-default.vue
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,5 @@
</template>

<script>
export default {
};
export default {};
</script>
9 changes: 4 additions & 5 deletions demo/pages/virtualized-list.vue
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@

<template>
<div>
<fd-button data-cy-reset @click="reset">reset</fd-button>
Expand All @@ -12,9 +11,9 @@
style="height: 400px;"
key-field="id"
>
<template #loading>
<div data-cy-loading-indicator>Loading Indicator</div>
</template>
<template #loading>
<div data-cy-loading-indicator>Loading Indicator</div>
</template>
<template #item="{ item, index }">
<div data-cy-item style="height: 30px;">
{{ item.title }}[{{ index }}]
Expand Down Expand Up @@ -50,7 +49,7 @@ export default {
loadMoreItems(done) {
const that = this;
setTimeout(() => {
const { items } = this;
const { items } = that;
items.push(...createItems(items.length, 5));
done();
}, 2000);
Expand Down
28 changes: 18 additions & 10 deletions loaders/remove-docs-loader.js
Original file line number Diff line number Diff line change
@@ -1,16 +1,16 @@
'use strict';
"use strict";

const contentWithoutBlock = (content, block) => {
const selfClosing = `<${block} />`;
const selfClosingIndex = content.indexOf(selfClosing);
if(selfClosingIndex > -1) {
return content.replace(selfClosing, '');
if (selfClosingIndex > -1) {
return content.replace(selfClosing, "");
}
const startTag = '<' + block + '>';
const endTag = '</' + block + '>';
const startTag = "<" + block + ">";
const endTag = "</" + block + ">";
const start = content.indexOf(startTag);
const end = content.indexOf(endTag);
if(start < 0 || end < 0 || end <= start) {
if (start < 0 || end < 0 || end <= start) {
return content;
}
const beforeBlock = content.substring(0, start);
Expand All @@ -19,8 +19,16 @@ const contentWithoutBlock = (content, block) => {
return beforeBlock + afterBlock;
};

module.exports = (content) => {
const blocksToRemove = ['condensed', 'fullscreen-only', 'docs', 'title', 'tip'];
const result = blocksToRemove.reduce((prev, curr) => contentWithoutBlock(prev, curr), content).trim();
return 'export default ' + JSON.stringify(result);
module.exports = content => {
const blocksToRemove = [
"condensed",
"fullscreen-only",
"docs",
"title",
"tip"
];
const result = blocksToRemove
.reduce((prev, curr) => contentWithoutBlock(prev, curr), content)
.trim();
return "export default " + JSON.stringify(result);
};
12 changes: 5 additions & 7 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -17,13 +17,10 @@
"serve:no-api-generate": "vue-cli-service serve src/docs/index.js",
"generate-api": "node src/tools",
"test": "vue-cli-service test:unit",
"lint": "vue-cli-service lint --no-fix --max-warnings 0 --max-errors 0 src",
"bootstrap": "yarn install",
"lint": "vue-cli-service lint --no-fix --max-warnings 0 --max-errors 0 src demo loaders tests",
"build:docs": "cross-env NODE_OPTIONS=--max_old_space_size=8192 node src/tools/index && NODE_ENV=production; NODE_OPTIONS=--max_old_space_size=8192 vue-cli-service build src/docs/index.js",
"build:docs:netlify": "yarn generate-api && cross-env NODE_ENV=production FDV_SPA=true webpack --progress --hide-modules --NETLIFY",
"build:ui:dev": "vue-cli-service build --target lib --report --name FundamentalVue src/index.js --mode development",
"deploy:docs": "yarn build:docs && gh-pages -d dist",
"lint:dev": "vue-cli-service lint",
"build:docs:netlify": "yarn generate-api && cross-env NODE_ENV=production yarn build:docs --NETLIFY",
"deploy:docs": "yarn build:docs && gh-pages -d dist",
"lint:pre-commit": "printf \"running pre-commit lint...\" && yarn lint && printf \"done!\n\"",
"release": "./scripts/publish-release.sh",
"release:create": "create-release",
Expand All @@ -50,7 +47,6 @@
"popper.js": "^1.15.0"
},
"devDependencies": {
"prismjs": "^1.16.0",
"@babel/cli": "^7.4.4",
"@types/jest": "^24.0.13",
"@types/webpack": "^4.4.34",
Expand All @@ -71,6 +67,7 @@
"core-js": "^2.6.5",
"cross-env": "^5.2.0",
"eslint": "^5.16.0",
"eslint-plugin-cypress": "^2.6.0",
"eslint-plugin-prettier": "^3.1.0",
"eslint-plugin-vue": "^5.2.2",
"fundamental-styles": "^0.1.0",
Expand All @@ -84,6 +81,7 @@
"markdown-loader": "^5.0.0",
"pre-commit": "^1.2.2",
"prerender-spa-plugin": "^3.4.0",
"prismjs": "^1.16.0",
"rimraf": "^2.6.3",
"rollup": "^1.12.5",
"rollup-plugin-commonjs": "^10.0.0",
Expand Down
2 changes: 1 addition & 1 deletion src/docs/router/create.js
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ const createRouter = componentApiRepository => {
component: () => import("./../components/d-component-api.vue")
}));
return new Router({
mode: process.env.NODE_ENV === "production" ? "history" : "hash",
mode: "hash",
// Scroll the main component to the top.
scrollBehavior(to) {
const { meta = {} } = to;
Expand Down
4 changes: 1 addition & 3 deletions tests/e2e/.eslintrc.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
module.exports = {
plugins: [
"cypress"
],
plugins: ["cypress"],
env: {
mocha: true,
"cypress/globals": true
Expand Down
4 changes: 3 additions & 1 deletion tests/e2e/specs/menu-selection.js
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,9 @@ describe("combobox", () => {
cy.get("@selected").should("have.text", "a-id-1");
cy.get("@highlighted").should("have.text", "a-id-1");

cy.get("@item-a1").find("a").should("have.class", "is-selected");
cy.get("@item-a1")
.find("a")
.should("have.class", "is-selected");
});

it("can be highlighted from the outside", () => {
Expand Down
12 changes: 6 additions & 6 deletions tests/e2e/specs/virtualized-list.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,9 @@ describe("VirtualizedList", () => {
visitPage("virtualized-list");
});

it("works", () => {
cy.get("[data-cy-loading-indicator]").should("not.exist");
cy.get("[data-cy-list]").scrollTo("bottom");
cy.get("[data-cy-loading-indicator]").should("exist");
});
});
it("works", () => {
cy.get("[data-cy-loading-indicator]").should("not.exist");
cy.get("[data-cy-list]").scrollTo("bottom");
cy.get("[data-cy-loading-indicator]").should("exist");
});
});
9 changes: 8 additions & 1 deletion yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -5039,6 +5039,13 @@ eslint-loader@^2.1.2:
object-hash "^1.1.4"
rimraf "^2.6.1"

eslint-plugin-cypress@^2.6.0:
version "2.6.0"
resolved "https://registry.yarnpkg.com/eslint-plugin-cypress/-/eslint-plugin-cypress-2.6.0.tgz#c726dd1a312cd5234de94765ca79718a14edf0ef"
integrity sha512-/YmvhYFqjFLYw7llDl56U9KW+Z25TZJjDofT47aUnAFRRvOhj1y2nxJzZ1ZTnqBO1ja8gwRhtdT7LfTLg9ANJw==
dependencies:
globals "^11.12.0"

eslint-plugin-prettier@^3.0.0, eslint-plugin-prettier@^3.1.0:
version "3.1.0"
resolved "https://registry.yarnpkg.com/eslint-plugin-prettier/-/eslint-plugin-prettier-3.1.0.tgz#8695188f95daa93b0dc54b249347ca3b79c4686d"
Expand Down Expand Up @@ -6369,7 +6376,7 @@ global-prefix@^3.0.0:
kind-of "^6.0.2"
which "^1.3.1"

globals@^11.0.1, globals@^11.1.0, globals@^11.7.0:
globals@^11.0.1, globals@^11.1.0, globals@^11.12.0, globals@^11.7.0:
version "11.12.0"
resolved "https://registry.yarnpkg.com/globals/-/globals-11.12.0.tgz#ab8795338868a0babd8525758018c2a7eb95c42e"
integrity sha512-WOBp/EEGUiIsJSp7wcv/y6MO+lV9UoncWqxuFfm8eBwzWNgyfBd6Gz+IeKQ9jCmyhoH99g15M3T+QaVHFjizVA==
Expand Down

0 comments on commit 0ac627c

Please sign in to comment.