Skip to content

Commit

Permalink
feat: first monorepo implementation
Browse files Browse the repository at this point in the history
add core module with plugins support
add plugin custom-events package
add utils package
add plugin scroll-snap-fallback
configure eslint, stylelint, commitlint & textlint
setup a test suite
init docs
remove jekyll config
  • Loading branch information
Jakub Freisler committed Feb 2, 2021
1 parent 1b557b3 commit 2312688
Show file tree
Hide file tree
Showing 65 changed files with 16,573 additions and 5,205 deletions.
3 changes: 3 additions & 0 deletions .eslintignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
node_modules
dist
coverage
46 changes: 46 additions & 0 deletions .eslintrc.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
module.exports = {
root: true,
plugins: [
'@typescript-eslint',
'eslint-comments',
'monorepo',
],
env: {
es6: true,
node: true,
},
extends: [
'eslint:recommended',
'plugin:@typescript-eslint/recommended',
'plugin:jest/recommended',
'plugin:jest/style',
'plugin:eslint-comments/recommended'
],
overrides: [
{
files: ['**.ts'],
parser: '@typescript-eslint/parser',
parserOptions: {
sourceType: 'module',
project: [
'./tsconfig.json',
'./packages/*/tsconfig.json',
],
tsconfigRootDir: __dirname,
warnOnUnsupportedTypeScriptVersion: false,
EXPERIMENTAL_useSourceOfProjectReferenceRedirect: true,
},
rules: {
'@typescript-eslint/explicit-module-boundary-types': 'off'
}
},
{
files: ['**/*.spec.ts'],
plugins: ['jest'],
rules: {
// allow console logs in tools and tests
'no-console': 'off',
},
},
],
};
7 changes: 6 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
node_modules
.cache
report.html
report.html
.nyc_output
.vscode
dist
docs/.vuepress/public/packages
coverage
12 changes: 0 additions & 12 deletions .idea/FRS-tiny-carousel.iml

This file was deleted.

6 changes: 0 additions & 6 deletions .idea/misc.xml

This file was deleted.

8 changes: 0 additions & 8 deletions .idea/modules.xml

This file was deleted.

6 changes: 0 additions & 6 deletions .idea/vcs.xml

This file was deleted.

4 changes: 0 additions & 4 deletions .idea/watcherTasks.xml

This file was deleted.

2 changes: 1 addition & 1 deletion .postcssrc
Original file line number Diff line number Diff line change
Expand Up @@ -8,4 +8,4 @@
"clearReportedMessages": true
}
}
}
}
3 changes: 3 additions & 0 deletions .stylelintrc.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
"extends": "stylelint-config-sass-guidelines"
}
38 changes: 38 additions & 0 deletions .textlintrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
{
"filters": {
"comments": true
},
"rules": {
"@textlint-rule/no-unmatched-pair": true,
"abbr-within-parentheses": true,
"alex": {
"allow": []
},
"apostrophe": true,
"common-misspellings": {
"ignore": []
},
"en-capitalization": true,
"no-dead-link": {
"checkRelative": true,
"baseURI": 'https://localhost:8080/tiny-carousel/',
"ignore": [],
"preferGET": [],
"ignoreRedirects": false,
"retry": 2
},
"no-empty-section": true,
"no-start-duplicated-conjunction": true,
"no-todo": true,
"period-in-list-item": true,
"spelling": {
"language": "en",
"skipPatterns": ["JavaScript", "CDN", "frsource", "vanillaJS", "polyfills", "performant", "customizable"]
},
"stop-words": true,
"terminology": true,
"unexpanded-acronym": {
"ignore_acronyms" : ["CSS"]
}
}
}
6 changes: 4 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,2 +1,4 @@
# FRS-tiny-carousel
Mobile & desktop-friendly, tiny, efficient (vanilaJS) carousel which takes advantage of CSS snap points (or polyfills it)!
![Tiny carousel library logo](src/logo.png)

# @frsource/tiny-carousel
Mobile & desktop-friendly, tiny, efficient (vanillaJS) carousel which takes advantage of CSS snap points (or polyfills it)!
1 change: 0 additions & 1 deletion _config.yml

This file was deleted.

3 changes: 3 additions & 0 deletions commitlint.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
module.exports = {
extends: ["@commitlint/config-conventional"]
};
1 change: 0 additions & 1 deletion dist/FRS-table.css

This file was deleted.

10 changes: 0 additions & 10 deletions dist/FRS-table.js

This file was deleted.

1 change: 0 additions & 1 deletion dist/FRS-table.map

This file was deleted.

23 changes: 23 additions & 0 deletions docs/.vuepress/components/Footer.vue
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
<template>
<footer class="footer">
{{ text }} <NavLink :item="item" />
</footer>
</template>

<script>
import NavLink from '@vuepress/theme-default/components/NavLink.vue'
export default {
name: 'Footer',
components: { NavLink },
props: ['text', 'link'],
computed: {
item() {
return {
link: this.link.href,
text: this.link.text,
};
}
}
};
</script>
42 changes: 42 additions & 0 deletions docs/.vuepress/components/HeroSection.vue
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
<template>
<section class="hero footer">
<p class="hero-section">
<slot name="text" />
</p>
<NavLink
class="action-button"
:item="item"
/>
</section>
</template>

<script>
import NavLink from '@vuepress/theme-default/components/NavLink.vue'
export default {
name: 'HeroSection',
components: { NavLink },
props: ['text', 'link'],
computed: {
item() {
return {
link: this.link.href,
text: this.link.text,
};
}
}
};
</script>

<style scoped>
.hero {
padding-left: 0;
display: flex;
align-items: center;
text-align: left;
}
.action-button {
margin-left: 2.5rem;
}
</style>
4 changes: 4 additions & 0 deletions docs/.vuepress/components/NavLink.vue
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
<script>
import NavLink from '@vuepress/theme-default/components/NavLink.vue'
export default NavLink;
</script>
59 changes: 59 additions & 0 deletions docs/.vuepress/config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@
const getConfig = require("vuepress-bar");
const { nav, sidebar } = getConfig();

module.exports = {
title: 'Tiny carousel',
description: 'Plugin for i18next that paires well with Phrase In-Context Editor.',
base: '/tiny-carousel/',
themeConfig: {
logo: '/logo.svg',
nav: [
...nav,
{ text: 'Looking for Web wizards?', link: 'https://www.frsource.org/' }
],
sidebar,
searchPlaceholder: 'Search in docs...',
repo: 'frsource/tiny-carousel',
docsDir: 'docs',
editLinks: true,
editLinkText: 'Help us improve this page on GitHub',
smoothScroll: true,
displayAllHeaders: true,
image: '/logo.jpg',
domain: 'https://www.frsource.org/tiny-carousel/'
},
head: [
['link', { rel: 'preconnect', href: 'https://fonts.gstatic.com/' }],
['link', { as: 'style', href: 'https://fonts.googleapis.com/css2?family=Titillium+Web&display=swap' }],
['link', { rel: 'stylesheet', href: 'https://fonts.googleapis.com/css2?family=Titillium+Web&display=swap' }],
],
plugins: [
'@vuepress/last-updated',
[
'vuepress-plugin-clean-urls',
{
normalSuffix: '/',
indexSuffix: '/',
notFoundPath: '/404.html',
},
],
[
'seo',
{
title: ($page, $site) => $page.path === '/' ? $site.title : $page.title,
description: ($page, $site) => $page.frontmatter.description || $site.description,
type: $page => $page.path === '/' ? 'website' : 'article',
image: ($page, $site) => {
const image = $page.frontmatter.image || $site.themeConfig.image;
return image && ((!image.startsWith('http') && $site.themeConfig.domain || '') + image)
}
},
],
[
() => ({
name: 'scroll-anchor-into-view-plugin',
clientRootMixin: require('path').resolve(__dirname, 'mixins', 'scrollAnchorIntoView.js')
})
]
],
}
17 changes: 17 additions & 0 deletions docs/.vuepress/mixins/scrollAnchorIntoView.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
const scrollToHash = ($route, timeout) => {
setTimeout(() => {
if ($route.hash) {
const element = document.getElementById($route.hash.slice(1));

if (element && element.scrollIntoView) {
element.scrollIntoView();
}
}
}, timeout);
};

module.exports = {
mounted () {
scrollToHash(this.$route, 800);
}
};
Binary file added docs/.vuepress/public/logo.jpg
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
1 change: 1 addition & 0 deletions docs/.vuepress/public/logo.svg
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
14 changes: 14 additions & 0 deletions docs/.vuepress/styles/index.styl
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
body
font-family 'Titillium Web', sans-serif

input, textarea
font inherit

.fw-normal
font-weight normal

.badge
font-weight 600

.home h1
display none
19 changes: 19 additions & 0 deletions docs/.vuepress/styles/palette.styl
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
$accentColor = rgb(38, 166, 154)
$textColor = #242A31
$borderColor = rgb(230, 236, 241)
$codeBgColor = #282c34
$arrowBgColor = #ccc
$badgeTipColor = rgb(38, 166, 154)
$badgeWarningColor = darken(#ffe564, 35%)
$badgeErrorColor = #DA5961

// layout
$navbarHeight = 3.6rem
$sidebarWidth = 20rem
$contentWidth = 740px
$homePageWidth = 960px

// responsive breakpoints
$MQNarrow = 1151px
$MQMobile = 919px
$MQMobileNarrow = 419px

0 comments on commit 2312688

Please sign in to comment.