diff --git a/.browserslistrc b/.browserslistrc new file mode 100644 index 0000000..d6471a3 --- /dev/null +++ b/.browserslistrc @@ -0,0 +1,2 @@ +> 1% +last 2 versions diff --git a/.editorconfig b/.editorconfig new file mode 100644 index 0000000..7053c49 --- /dev/null +++ b/.editorconfig @@ -0,0 +1,5 @@ +[*.{js,jsx,ts,tsx,vue}] +indent_style = space +indent_size = 2 +trim_trailing_whitespace = true +insert_final_newline = true diff --git a/.eslintrc.js b/.eslintrc.js new file mode 100644 index 0000000..98d0431 --- /dev/null +++ b/.eslintrc.js @@ -0,0 +1,17 @@ +module.exports = { + root: true, + env: { + node: true + }, + 'extends': [ + 'plugin:vue/essential', + '@vue/standard' + ], + rules: { + 'no-console': process.env.NODE_ENV === 'production' ? 'error' : 'off', + 'no-debugger': process.env.NODE_ENV === 'production' ? 'error' : 'off' + }, + parserOptions: { + parser: 'babel-eslint' + } +} diff --git a/.gitignore b/.gitignore index 93ee60d..a0dddc6 100644 --- a/.gitignore +++ b/.gitignore @@ -1,5 +1,21 @@ -node_modules/ -public/ -.zanata-cache/etag-cache.xml -npm-debug.log -/zanata.xml +.DS_Store +node_modules +/dist + +# local env files +.env.local +.env.*.local + +# Log files +npm-debug.log* +yarn-debug.log* +yarn-error.log* + +# Editor directories and files +.idea +.vscode +*.suo +*.ntvs* +*.njsproj +*.sln +*.sw? diff --git a/app/data.yml b/app/data.yml deleted file mode 100644 index 963f1c4..0000000 --- a/app/data.yml +++ /dev/null @@ -1,241 +0,0 @@ -meta: - title: Join PeerTube - author: Framasoft - canonical: https://joinpeertube.org - i18n: https://trad.framasoft.org/project/view/join-peertube/master - -txt: -# soft: text from color.soft - -html: -# soft: color.soft - -color: - soft: Framasoft - cuo: Contributopia - evl: EnVenteLibre - - agenda: Framagenda - bag: Framabag - bee: Framabee - bin: Framabin - blog: Framablog - board: Framaboard - book: Framabook - bookin: Framabookin - calc: Framacalc - carte: Framacarte - cloud: Framacloud - colibri: Framacolibri - date: Framadate - docs: Framadocs - drive: Framadrive - drop: Framadrop - dvd: Framadvd - forms: Framaforms - games: Framagames - git: Framagit - key: Framakey - lab: Framalab - lang: Framalang - libre: Framalibre - link: Framalink - listes: Framalistes - maestro: Framaestro - memo: Framemo - mindmap: Framindmap - minetest: Framinetest - my: MyFrama - news: Framanews - notes: Framanotes - pack: Framapack - pad: Framapad - piaf: Framapiaf - pic: Framapic - site: Framasite - slides: Framaslides - sphere: Framasphère - team: Framateam - talk: Framatalk - tube: Framatube - vectoriel: Framavectoriel - vox: Framavox - wiki: Framawiki - zic: Framazic - - huitre: Huitre - tontonroger: Tonton Roger - trouvons: Trouvons.org - -link: - gitPT: https://github.com/Chocobozzz/PeerTube - instancesPT: https://instances.joinpeertube.org - docsPT: https://docs.joinpeertube.org - mastodon: https://joinmastodon.org - activitypub: https://activitypub.rocks - tosdr: https://tosdr.org/#youtube - - soft: https://framasoft.org - dio: https://degooglisons-internet.org - cuo: https://contributopia.org - soutenir: https://soutenir.framasoft.org - contact: https://contact.framasoft.org - newsletter: https://contact.framasoft.org/newsletter - participer: https://participer.framasoft.org - evl: https://enventelibre.org - wikifs: https://wiki.framasoft.org - press: https://wiki.framasoft.org/speakabout - - agenda: https://framagenda.org - bag: https://framabag.org - bee: https://framabee.org - bin: https://framabin.org - blog: https://framablog.org - board: https://framaboard.org - book: https://framabook.org - bookin: https://framabookin.org - calc: https://framacalc.org - carte: https://framacarte.org - cloud: https://framacloud.org - colibri: https://framacolibri.org - date: https://framadate.org - docs: https://docs.framasoft.org - drive: https://framadrive.org - drop: https://framadrop.org - dvd: https://framadvd.org - forms: https://framaforms.org - games: https://framagames.org - git: https://framagit.org - key: https://framakey.org - lab: https://framalab.org - lang: https://participer.framasoft.org/traduction-rejoignez-framalang/ - libre: https://framalibre.org - link: https://frama.link - listes: https://framalistes.org - maestro: https://framaestro.org - memo: https://framemo.org - mindmap: https://framindmap.org - minetest: https://framinetest.org - my: https://my.framasoft.org - news: https://framanews.org - notes: https://framanotes.org - pack: https://framapack.org - pad: https://framapad.org - piaf: https://framapiaf.org - pic: https://framapic.org - site: https://frama.site - slides: https://framaslides.org - sphere: https://framasphere.org - talk: https://framatalk.org - team: https://framateam.org - tube: https://framatube.org - vectoriel: https://framavectoriel.org - vox: https://framavox.org - wiki: https://frama.wiki - zic: https://framazic.org - - huitre: https://huit.re - tontonroger: https://tontonroger.org - trouvons: https://trouvons.org - -icon: - dio: fa-shield - cuo: fa-shield - soutenir: fa-heart - contact: fa-envelop - participer: fa-paw - evl: fa-shopping-cart - - agenda: fa-calendar - bag: fa-briefcase - bee: fa-search - bin: fa-paste - blog: fa-pencil - board: fa-dashboard - book: fa-book - bookin: fa-coffee - calc: fa-th - carte: fa-map - colibri: fa-comment - date: fa-calendar-check-o - docs: fa-graduation-cap - drive: fa-cloud-upload - drop: fa-send - dvd: fa-play-circle-o - forms: fa-list-ul - games: fa-gamepad - git: fa-git - key: fa-usb - lab: fa-flask - lang: fa-language - libre: fa-linux - link: fa-link - listes: fa-group - maestro: fa-magic - memo: fa-object-group - mindmap: fa-sitemap - minetest: fa-cube - my: fa-star - news: fa-newspaper-o - notes: fa-sticky-note - pack: fa-download - pad: fa-align-left - piaf: fa-mastodon - pic: fa-photo - site: fa-globe - slides: fa-pie-chart - sphere: fa-diaspora - talk: fa-video-camera - team: fa-comments-o - tube: fa-film - vectoriel: fa-paint-brush - vox: fa-bullhorn - wiki: fa-puzzle-piece - zic: fa-music - - huitre: fa-link - tontonroger: fa-search - trouvons: fa-search - -license: - lal: Art Libre - cc0: Creative Commons 0 - ccby3: Creative Commons By 3.0 - ccby4: Creative Commons By 4.0 - ccbysa3: Creative Commons By-SA 3.0 - ccbysa4: Creative Commons By-SA 4.0 - ccbysa2fr: Creative Commons By-SA 2.0 - ccbysa3fr: Creative Commons By-SA 3.0 - ccbysa4fr: Creative Commons By-SA 4.0 - gpl2: GNU GPL v2 - gpl3: GNU GPL v3 - gnufdl: GNU FDL - agpl3: GNU AGPL v3 - apache2: Apache 2.0 - cecillb: CeCILL-B - -people: - aka: Alexis Kauffmann - ben: Benjamin Jean - christophe: Christophe Masutti - cyrille: Cyrille Largillier - dorme: Geoffrey Dorme - fat115: fat115 - fla: Flaburgan - fred: Fredéric Urbain - gab: Gabriel Dejeante - gee: Simon « Gee » Giraudot - jo: JosephK - kinou: Christelle Thomas - lam: Lamessen - lldemars: L.L. de Mars - luc: Luc Didry - martin: Martin Gubri - sandra: peupleLà (Sandra Guigonis) - simonl: Simon Leblanc - pouhiou: Pouhiou - pyg: Pierre-Yves Gosset - tcit: Thomas Citharel - -emoji: - wink: 😉 diff --git a/app/index.js b/app/index.js deleted file mode 100644 index dda59c1..0000000 --- a/app/index.js +++ /dev/null @@ -1,202 +0,0 @@ -import Vue from 'vue'; -import VueMatomo from 'vue-matomo'; -import VueRouter from 'vue-router'; -import VueI18n from 'vue-i18n'; -import vueHeadful from 'vue-headful'; - -import App from './App.vue'; -import Home from './views/Home.vue'; - -import './assets/scss/bootstrap.scss'; -import '../node_modules/fork-awesome/css/fork-awesome.css'; -import './assets/scss/main.scss'; - -Vue.use(VueRouter); -Vue.use(VueI18n); -Vue.component('vue-headful', vueHeadful); - -const defaultLocale = 'fr'; -const locales = []; -const pages = []; - -// Import locales list -let req = require.context('./locales/', false, /\.yml$/); -req.keys().forEach((key) => { - locales.push(key.replace(/\.\/(.*)\.yml/, '$1')); -}); -// Import pages list -req = require.context('./views', false, /\.vue$/); -req.keys().forEach((key) => { - pages.push(key.replace(/\.\/(.*)\.vue/, '$1')); -}); - -const lang = window.location.href - .split('/')[(process.env.BASE_URL === '' || (window.location.href.match(/\//g)).length === 3) ? 3 : 4] - .substr(0, 2) - .toLowerCase() || defaultLocale; -document.getElementsByTagName('html')[0].setAttribute('lang', lang); -const userLang = navigator.languages - || [navigator.language || navigator.userLanguage]; -let defaultRouteLang = ''; - -const messages = {}; -messages.locales = require('./lang.yml'); // eslint-disable-line -messages.locales.avalaible = Object.keys(messages.locales).filter(n => locales.indexOf(n) > -1); - -// Data import -let data = {}; -data = require('./data.yml'); // eslint-disable-line -data['/'] = `/${process.env.BASE_URL.replace(/(.+)/, '$1/')}`; -data.hash = window.location.hash.replace('#', ''); -data.txt = data.txt || {}; -data.html = data.html || {}; -Object.keys(data.color).forEach((k) => { - if (data.txt[k] === undefined) { - const tmp = document.createElement('div'); - tmp.innerHTML = data.color[k]; - data.txt[k] = tmp.textContent || tmp.innerText; - } -}); - -Object.keys(data.link).forEach((k) => { - if (data.html[k] === undefined) { - if (data.color[k] !== undefined) { - data.html[k] = `${data.color[k]}`; - } else if (data.txt[k] !== undefined) { - data.html[k] = `${data.txt[k]}`; - } - } -}); - -const routes = [ - { path: '/', component: Home, meta: { id: 'home', lang: defaultLocale } }, -]; - -for (let i = 0; i < locales.length; i += 1) { - messages[locales[i]] = {}; - // Locales import - /* eslint-disable */ - import(/* webpackChunkName: "lang-[request]" */`./locales/${locales[i]}.yml`).then((locale) => { - messages[locales[i]] = locale; - messages[locales[i]].data = data; - messages[locales[i]].lang = locales[i]; - }).catch((err) => { - console.error(err); - }); - /* eslint-enable */ - - // Localized routes - for (let j = 0; j < pages.length; j += 1) { - const component = require(`./views/${pages[j]}.vue`); // eslint-disable-line - routes.push({ - path: `/${locales[i]}${pages[j].toLowerCase().replace(/^/, '/').replace('/home', '')}`, - component: component.default, - meta: { id: pages[j].toLowerCase(), lang: locales[i] }, - }); - } -} - -// define defaultRouteLang -for (let j = 0; j < userLang.length; j += 1) { // check if user locales - for (let i = 0; i < locales.length; i += 1) { // matches with app locales - if (defaultRouteLang === '' && userLang[j].substring(0, 2).toLowerCase() === locales[i]) { - defaultRouteLang = locales[i]; - } - } -} - -// Home redirection -const currentURL = window.location.href.replace(/\/+$/, ''); -if ((currentURL.split('/')[3] === undefined || currentURL.split('/')[3] === process.env.BASE_URL) - && (currentURL.split('/')[4] === undefined)) { - if (defaultRouteLang === '') { - defaultRouteLang = defaultLocale; - } - window.location.href = `${currentURL}/${defaultRouteLang}/`; -} - -// Create VueI18n instance with options -const i18n = new VueI18n({ - locale: lang, - fallbackLocale: defaultLocale, - messages, - silentTranslationWarn: true, -}); - -// Framanav -if (!window.vuefsPrerender - && document.querySelectorAll('script[src$="nav.js"]').length < 1 - && process.env.NODE_ENV !== 'development') { - const navConfig = document.createElement('script'); - navConfig.innerHTML = 'l$ = { js: { j$: \'noConflict\' } }'; - document.getElementsByTagName('head')[0].appendChild(navConfig); - const nav = document.createElement('script'); - nav.src = 'https://framasoft.org/nav/nav.js'; -// document.getElementsByTagName('head')[0].appendChild(nav); -} - -// Routes -const router = new VueRouter({ - routes, - mode: 'history', - base: `${__dirname}${process.env.BASE_URL}`, -}); - -// Stats Matomo -if (!(navigator.doNotTrack === 'yes' - || navigator.doNotTrack === '1' - || navigator.msDoNotTrack === '1' - || window.doNotTrack === '1') -) { - Vue.use(VueMatomo, { - // Configure your matomo server and site - host: 'https://stats.framasoft.org/', - siteId: 68, - - // Enables automatically registering pageviews on the router - router, - - // Require consent before sending tracking information to matomo - // Default: false - requireConsent: false, - - // Whether to track the initial page view - // Default: true - trackInitialView: true, - - // Changes the default .js and .php endpoint's filename - // Default: 'piwik' - trackerFileName: 'p', - - enableLinkTracking: true, - }); - - const _paq = _paq || []; // eslint-disable-line - - // Conformité CNIL - _paq.push([function piwikCNIL() { - const self = this; - function getOriginalVisitorCookieTimeout() { - const now = new Date(); - const nowTs = Math.round(now.getTime() / 1000); - const visitorInfo = self.getVisitorInfo(); - const createTs = parseInt(visitorInfo[2], 10); - const cookieTimeout = 33696000; // 13 mois en secondes - const originalTimeout = (createTs + cookieTimeout) - nowTs; - return originalTimeout; - } - this.setVisitorCookieTimeout(getOriginalVisitorCookieTimeout()); - }]); -} - -new Vue({ // eslint-disable-line no-new - el: '#app', - router, - i18n, - data, - mounted() { - // You'll need this for renderAfterDocumentEvent. - document.dispatchEvent(new Event('render-event')); - }, - render: h => h(App), -}); diff --git a/babel.config.js b/babel.config.js new file mode 100644 index 0000000..ba17966 --- /dev/null +++ b/babel.config.js @@ -0,0 +1,5 @@ +module.exports = { + presets: [ + '@vue/app' + ] +} diff --git a/package.json b/package.json index 2517a37..43fdd2d 100644 --- a/package.json +++ b/package.json @@ -1,61 +1,33 @@ { "name": "joinpeertube", - "description": "", - "version": "1.0.0", - "author": "JosephK", + "version": "0.1.0", "private": true, "scripts": { - "test": "echo \"Error: no test specified\" && exit 1", - "dev": "rm -rf ./public && cross-env NODE_ENV=development webpack-dev-server --open --hot --mode development", - "preview": "rm -rf ./public && cross-env NODE_ENV=preview webpack --progress --hide-modules --mode production", - "prod": "rm -rf ./public && cross-env NODE_ENV=production webpack --progress --hide-modules --mode production" + "serve": "vue-cli-service serve", + "build": "vue-cli-service build", + "lint": "vue-cli-service lint" }, "dependencies": { - "axios": "^0.18.0", + "axios": "^0.19.0", "bootstrap": "^4.3.1", - "bootstrap-vue": "^2.0.0-rc.28", - "fork-awesome": "^1.1.5", - "vue": "^2.5.16", + "bootstrap-vue": "^2.0.0", + "core-js": "^2.6.5", + "vue": "^2.6.10", + "vue-gettext": "^2.1.5", "vue-headful": "^2.0.1", - "vue-i18n": "^8.4.0", - "vue-matomo": "^0.3.2", - "vue-router": "^3.0.2" + "vue-matomo": "^3.9.1-2", + "vue-router": "^3.1.3" }, "devDependencies": { - "@babel/core": "^7.2.0", - "@babel/plugin-proposal-object-rest-spread": "^7.2.0", - "@babel/plugin-syntax-dynamic-import": "^7.2.0", - "@babel/preset-env": "^7.2.0", - "autoprefixer": "^9.4.2", + "@vue/cli-plugin-babel": "^3.11.0", + "@vue/cli-plugin-eslint": "^3.11.0", + "@vue/cli-service": "^3.11.0", + "@vue/eslint-config-standard": "^4.0.0", "babel-eslint": "^10.0.1", - "babel-loader": "^8.0.4", - "copy-webpack-plugin": "^4.6.0", - "cross-env": "^5.2.0", - "css-hot-loader": "^1.4.2", - "css-loader": "^1.0.1", - "eslint": "^5.9.0", - "eslint-config-airbnb-base": "^13.1.0", - "eslint-loader": "^2.1.1", - "eslint-plugin-filenames": "^1.3.2", - "eslint-plugin-html": "^5.0.0", - "eslint-plugin-import": "^2.14.0", - "eslint-plugin-promise": "^4.0.1", + "eslint": "^5.16.0", "eslint-plugin-vue": "^5.0.0", - "file-loader": "^2.0.0", - "html-webpack-plugin": "^3.2.0", - "mini-css-extract-plugin": "^0.4.5", - "node-sass": "^4.10.0", - "optimize-css-assets-webpack-plugin": "^5.0.1", - "postcss-loader": "^3.0.0", - "prerender-spa-plugin": "^3.4.0", - "sass-loader": "^7.1.0", - "style-loader": "^0.23.1", - "terser-webpack-plugin": "^1.1.0", - "vue-loader": "^15.4.2", - "vue-template-compiler": "^2.5.16", - "webpack": "^4.27.1", - "webpack-cli": "^3.1.2", - "webpack-dev-server": "^3.1.10", - "yaml-import-loader": "^1.3.6" + "node-sass": "^4.12.0", + "sass-loader": "^8.0.0", + "vue-template-compiler": "^2.6.10" } } diff --git a/postcss.config.js b/postcss.config.js index c021fc4..961986e 100644 --- a/postcss.config.js +++ b/postcss.config.js @@ -1,5 +1,5 @@ module.exports = { - plugins: [ - require("autoprefixer") - ] + plugins: { + autoprefixer: {} + } } diff --git a/app/assets/fonts/proza-libre-v4-latin-600.woff2 b/public/fonts/proza-libre-v4-latin-600.woff2 similarity index 100% rename from app/assets/fonts/proza-libre-v4-latin-600.woff2 rename to public/fonts/proza-libre-v4-latin-600.woff2 diff --git a/app/assets/fonts/proza-libre-v4-latin-regular.woff2 b/public/fonts/proza-libre-v4-latin-regular.woff2 similarity index 100% rename from app/assets/fonts/proza-libre-v4-latin-regular.woff2 rename to public/fonts/proza-libre-v4-latin-regular.woff2 diff --git a/app/assets/fonts/pt-sans-v11-latin-700.woff2 b/public/fonts/pt-sans-v11-latin-700.woff2 similarity index 100% rename from app/assets/fonts/pt-sans-v11-latin-700.woff2 rename to public/fonts/pt-sans-v11-latin-700.woff2 diff --git a/app/assets/fonts/pt-sans-v11-latin-regular.woff2 b/public/fonts/pt-sans-v11-latin-regular.woff2 similarity index 100% rename from app/assets/fonts/pt-sans-v11-latin-regular.woff2 rename to public/fonts/pt-sans-v11-latin-regular.woff2 diff --git a/app/assets/icons/apple-touch-icon.png b/public/icons/apple-touch-icon.png similarity index 100% rename from app/assets/icons/apple-touch-icon.png rename to public/icons/apple-touch-icon.png diff --git a/app/assets/icons/favicon.png b/public/icons/favicon.png similarity index 100% rename from app/assets/icons/favicon.png rename to public/icons/favicon.png diff --git a/app/assets/img/brand-small.png b/public/img/brand-small.png similarity index 100% rename from app/assets/img/brand-small.png rename to public/img/brand-small.png diff --git a/app/assets/img/brand.png b/public/img/brand.png similarity index 100% rename from app/assets/img/brand.png rename to public/img/brand.png diff --git a/app/assets/img/framasoft-big-logo.png b/public/img/framasoft-big-logo.png similarity index 100% rename from app/assets/img/framasoft-big-logo.png rename to public/img/framasoft-big-logo.png diff --git a/app/assets/img/framasoft-logo-text.png b/public/img/framasoft-logo-text.png similarity index 100% rename from app/assets/img/framasoft-logo-text.png rename to public/img/framasoft-logo-text.png diff --git a/app/assets/img/icons/instance.svg b/public/img/icons/instance.svg similarity index 100% rename from app/assets/img/icons/instance.svg rename to public/img/icons/instance.svg diff --git a/app/assets/img/peertube-federation-2-instances.png b/public/img/peertube-federation-2-instances.png similarity index 100% rename from app/assets/img/peertube-federation-2-instances.png rename to public/img/peertube-federation-2-instances.png diff --git a/app/assets/img/peertube-federation-multiplicity.png b/public/img/peertube-federation-multiplicity.png similarity index 100% rename from app/assets/img/peertube-federation-multiplicity.png rename to public/img/peertube-federation-multiplicity.png diff --git a/app/assets/img/peertube-free-software.png b/public/img/peertube-free-software.png similarity index 100% rename from app/assets/img/peertube-free-software.png rename to public/img/peertube-free-software.png diff --git a/app/assets/img/peertube-interface.png b/public/img/peertube-interface.png similarity index 100% rename from app/assets/img/peertube-interface.png rename to public/img/peertube-interface.png diff --git a/app/assets/img/peertube-mastodon-federation.png b/public/img/peertube-mastodon-federation.png similarity index 100% rename from app/assets/img/peertube-mastodon-federation.png rename to public/img/peertube-mastodon-federation.png diff --git a/app/assets/img/peertube-p2p.png b/public/img/peertube-p2p.png similarity index 100% rename from app/assets/img/peertube-p2p.png rename to public/img/peertube-p2p.png diff --git a/app/assets/img/peertube-upload.png b/public/img/peertube-upload.png similarity index 100% rename from app/assets/img/peertube-upload.png rename to public/img/peertube-upload.png diff --git a/app/assets/img/peertube-you-play.png b/public/img/peertube-you-play.png similarity index 100% rename from app/assets/img/peertube-you-play.png rename to public/img/peertube-you-play.png diff --git a/app/assets/img/sponsors/ipsolution.png b/public/img/sponsors/ipsolution.png similarity index 100% rename from app/assets/img/sponsors/ipsolution.png rename to public/img/sponsors/ipsolution.png diff --git a/app/assets/img/sponsors/qonfucius.png b/public/img/sponsors/qonfucius.png similarity index 100% rename from app/assets/img/sponsors/qonfucius.png rename to public/img/sponsors/qonfucius.png diff --git a/app/App.vue b/src/App.vue similarity index 68% rename from app/App.vue rename to src/App.vue index 394f9fd..caefac5 100644 --- a/app/App.vue +++ b/src/App.vue @@ -1,7 +1,7 @@ diff --git a/app/components/Header.vue b/src/components/Header.vue similarity index 73% rename from app/components/Header.vue rename to src/components/Header.vue index 19c143e..28b9524 100644 --- a/app/components/Header.vue +++ b/src/components/Header.vue @@ -2,13 +2,12 @@