Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
44 changes: 44 additions & 0 deletions .github/workflows/build_deploy_website.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
name: Build and Deploy
on:
push:
branches:
- master
paths-ignore:
- "packages/**"

jobs:
build:
name: Build
runs-on: ubuntu-latest
steps:
- name: Checkout Repo
uses: actions/checkout@master
- name: Go to website
run: cd website
- name: Install Dependencies
run: npm install
- name: Build
run: npm run build
- name: Archive Production Artifact
uses: actions/upload-artifact@master
with:
name: build
path: build
deploy:
name: Deploy
needs: build
runs-on: ubuntu-latest
steps:
- name: Checkout Repo
uses: actions/checkout@master
- name: Download Artifact
uses: actions/download-artifact@master
with:
name: build
path: build
- name: Deploy to Firebase
uses: w9jds/firebase-action@master
with:
args: deploy --only hosting
env:
FIREBASE_TOKEN: ${{ secrets.FIREBASE_TOKEN }}
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ Flutter plugin for accessing information about the battery state(full, charging,

| Android | iOS | MacOS | Web | Linux | Window |
|:-------:|:---:|:-----:|:---:|:-----:|:------:|
| ✔️ | ✔️ | ✔️ | ✔️ | | ✔️ |
| ✔️ | ✔️ | ✔️ | ✔️ | ✔️ | ✔️ |

----

Expand Down Expand Up @@ -118,7 +118,7 @@ Flutter plugin for querying information about the application

| Android | iOS | MacOS | Web | Linux | Window |
|:-------:|:---:|:-----:|:---:|:-----:|:------:|
| ✔️ | ✔️ | ✔️ | ✔️ | | |
| ✔️ | ✔️ | ✔️ | ✔️ | | ✔️ |

----

Expand Down Expand Up @@ -150,7 +150,7 @@ Flutter plugin for sharing content via the platform share UI, using the ACTION_S

| Android | iOS | MacOS | Web | Linux | Window |
|:-------:|:---:|:-----:|:---:|:-----:|:------:|
| ✔️ | ✔️ | | | ✔️ | ✔️ |
| ✔️ | ✔️ | | ✔️ | ✔️ | ✔️ |

----

Expand Down
13 changes: 13 additions & 0 deletions docs/sidebars.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
function toReferenceAPI(plugin) {
return {
type: "link",
label: "Reference API",
href: `https://pub.dev/documentation/${plugin}/latest/`,
};
}

module.exports = {
main: {
"Getting Started": [],
},
};
4 changes: 4 additions & 0 deletions website/.eslintignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
.docusaurus
build
package-lock.json
yarn.lock
23 changes: 23 additions & 0 deletions website/.eslintrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
{
"parser": "@typescript-eslint/parser",
"extends": [
"plugin:@typescript-eslint/recommended",
"prettier/@typescript-eslint",
"plugin:prettier/recommended",
"plugin:react/recommended"
],
"parserOptions": {
"ecmaVersion": 2020, // Allows for the parsing of modern ECMAScript features
"sourceType": "module" // Allows for the use of imports
},
"env": {
"es6": true,
"node": true
},
"rules": {
"react/display-name": 0,
"@typescript-eslint/explicit-function-return-type": 0,
"@typescript-eslint/camelcase": 0,
"@typescript-eslint/ban-ts-ignore": 0
}
}
14 changes: 14 additions & 0 deletions website/.firebaserc
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
{
"projects": {
"default": "flutter-community-dashboard"
},
"targets": {
"flutter-community-dashboard": {
"hosting": {
"plus": [
"flutter-community-plus"
]
}
}
}
}
65 changes: 65 additions & 0 deletions website/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,65 @@
# Logs
logs
*.log
npm-debug.log*
yarn-debug.log*
yarn-error.log*
firebase-debug.log*
.docusaurus
# Firebase cache
.firebase/
build
# Firebase config

# Uncomment this if you'd like others to create their own Firebase project.
# For a team working on the same Firebase project(s), it is recommended to leave
# it commented so all members can deploy to the same project(s) in .firebaserc.
# .firebaserc

# Runtime data
pids
*.pid
*.seed
*.pid.lock

# Directory for instrumented libs generated by jscoverage/JSCover
lib-cov

# Coverage directory used by tools like istanbul
coverage

# nyc test coverage
.nyc_output

# Grunt intermediate storage (http://gruntjs.com/creating-plugins#storing-task-files)
.grunt

# Bower dependency directory (https://bower.io/)
bower_components

# node-waf configuration
.lock-wscript

# Compiled binary addons (http://nodejs.org/api/addons.html)
build/Release

# Dependency directories
node_modules/

# Optional npm cache directory
.npm

# Optional eslint cache
.eslintcache

# Optional REPL history
.node_repl_history

# Output of 'npm pack'
*.tgz

# Yarn Integrity file
.yarn-integrity

# dotenv environment variables file
.env
5 changes: 5 additions & 0 deletions website/.prettierignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
.docusaurus
build
package-lock.json
yarn.lock
**/*.mdx
11 changes: 11 additions & 0 deletions website/.prettierrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
{
"arrowParens": "avoid",
"trailingComma": "all",
"useTabs": false,
"semi": true,
"singleQuote": true,
"bracketSpacing": true,
"jsxBracketSameLine": false,
"tabWidth": 2,
"printWidth": 100
}
19 changes: 16 additions & 3 deletions website/README.md
100644 → 100755
Original file line number Diff line number Diff line change
@@ -1,5 +1,18 @@
# Plus Plugins website
# Flutter Community Plus Packages Overview

https://plus.fluttercommunity.dev/
This website is built using [Docusaurus 2](https://v2.docusaurus.io/), a modern static website generator.

work in progress!
### Installation

```
$ npm i
```

### Local Development

```
$ npm start
```

This command starts a local development server and open up a browser window. Most changes are reflected live without
having to restart the server.
45 changes: 45 additions & 0 deletions website/api.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
const axios = require('axios');

// Fetch the plugins latest version from the pub API
async function fetchPluginVersion(plugin) {
try {
const response = await axios.get(`https://pub.dev/api/packages/${plugin}`);
const versions = response.data.versions;

if (!Array.isArray(versions)) {
return '';
}

return versions[versions.length - 1].version;
} catch (e) {
console.log(`Failed to load version for plugin "${plugin}".`);
return '';
}
}

// Fetch the plugins latest version documentation reference from the API
function fetchPluginApiReference(plugin, version = 'latest') {
return axios
.get(`https://pub.dev/documentation/${plugin}/${version}/index.json`, {
maxRedirects: 0,
})
.then(response => {
if (response.headers['content-type'] === 'application/json') {
return response.data.map(entity => ({
...entity,
version,
plugin,
}));
}

return null;
})
.catch(() => {
return null;
});
}

module.exports = {
fetchPluginVersion,
fetchPluginApiReference,
};
66 changes: 66 additions & 0 deletions website/docusaurus-plugins/favicon-tags.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,66 @@
module.exports = function generateFaviconTags() {
return {
name: '@flutterfire/favicon-tags',
injectHtmlTags() {
return {
headTags: [
{
tagName: 'link',
attributes: {
rel: 'apple-touch-icon',
sizes: '180x180',
href: '/favicon/apple-touch-icon.png',
},
},
{
tagName: 'link',
attributes: {
rel: 'icon',
type: 'image/png',
sizes: '32x32',
href: '/favicon/favicon-32x32.png',
},
},
{
tagName: 'link',
attributes: {
rel: 'icon',
type: 'image/png',
sizes: '16x16',
href: '/favicon/favicon-16x16.png',
},
},
{
tagName: 'link',
attributes: {
rel: 'manifest',
href: '/favicon/site.webmanifest',
},
},
{
tagName: 'link',
attributes: {
rel: 'mask-icon',
href: '/favicon/safari-pinned-tab.svg',
color: '#5bbad5'
},
},
{
tagName: 'meta',
attributes: {
name: 'msapplication-TileColor',
content: '#da532c',
},
},
{
tagName: 'meta',
attributes: {
name: 'theme-color',
content: '#0175c2',
},
},
],
};
},
};
};
Loading