Skip to content

Commit

Permalink
Initial commit
Browse files Browse the repository at this point in the history
  • Loading branch information
msmolens committed Nov 10, 2020
0 parents commit 59c5c85
Show file tree
Hide file tree
Showing 102 changed files with 19,450 additions and 0 deletions.
2 changes: 2 additions & 0 deletions .browserslistrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
> 0.25%
not dead
32 changes: 32 additions & 0 deletions .editorconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
# top-most EditorConfig file
root = true

# Unix-style newlines with a newline ending every file
[*]
end_of_line = lf
insert_final_newline = true

# Matches multiple files with brace expansion notation
# Set default charset
[*.{js,py}]
charset = utf-8

# 4 space indentation
[*.py]
indent_style = space
indent_size = 4

# Tab indentation (no size specified)
[Makefile]
indent_style = tab

# Indentation override for all JS under lib directory
[src/**.{js,ts}]
indent_style = space
indent_size = 2

# Matches the exact files either package.json or .travis.yml
[{package.json,.travis.yml}]
indent_style = space
indent_size = 2

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
56 changes: 56 additions & 0 deletions .eslintrc.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
module.exports = {
env: {
es6: true,
browser: true,
webextensions: true,
},
parser: "@typescript-eslint/parser",
parserOptions: {
'ecmaVersion': 9,
'sourceType': 'module',
'tsconfigRootDir': __dirname,
'project': './tsconfig.json',
},
extends: [
'eslint:recommended',
'plugin:@typescript-eslint/recommended',
'plugin:@typescript-eslint/recommended-requiring-type-checking',
'plugin:prettier/recommended'
],
plugins: [
'@typescript-eslint',
'simple-import-sort',
'svelte3',
'prettier'
],
overrides: [
{
files: ['*.svelte'],
processor: 'svelte3/svelte3'
}
],
rules: {
'@typescript-eslint/no-non-null-assertion': 'off',
'simple-import-sort/sort': [
'error',
{
groups: [
// Configuration based on https://github.com/lydell/eslint-plugin-simple-import-sort/blob/7b29c07/examples/.eslintrc.js#L71-L89
// Packages.
["^svelte", "^@?\\w"],
// Internal packages.
["^(@Treetop)(/.*|$)"],
// Side effect imports.
["^\\u0000"],
// Parent imports. Put `..` last.
["^\\.\\.(?!/?$)", "^\\.\\./?$"],
// Other relative imports. Put same-folder imports and `.` last.
["^\\./(?=.*/)(?!/?$)", "^\\.(?!/?$)", "^\\./?$"],
// Style imports.
["^.+\\.s?css$"],
]
}
],
'prettier/prettier': 'error'
}
};
21 changes: 21 additions & 0 deletions .github/workflows/node.js.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
name: CI

on:
push:
branches: '**'
pull_request:
branches: '**'

jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Use Node.js
uses: actions/setup-node@v1
with:
node-version: '14.x'
- run: npm ci
- run: npm run lint
- run: npm run validate
- run: npm test
44 changes: 44 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
on:
push:
tags:
- 'v*'

name: Release

jobs:
build:
name: Upload Release Asset
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v2
- name: Set output filename
id: set-filename
run: echo ::set-output name=filename::treetop-${GITHUB_REF#refs/*/}.zip
- name: Use Node.js
uses: actions/setup-node@v1
with:
node-version: '14.x'
- run: npm ci
- run: npm run build
- run: npx web-ext build --no-input=true --filename "${{ steps.set-filename.outputs.filename}}"
- name: Create Release
id: create_release
uses: actions/create-release@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
tag_name: ${{ github.ref }}
release_name: ${{ github.ref }}
draft: false
prerelease: false
- name: Upload Release Asset
id: upload-release-asset
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ steps.create_release.outputs.upload_url }}
asset_path: ./web-ext-artifacts/${{ steps.set-filename.outputs.filename}}
asset_name: ${{ steps.set-filename.outputs.filename}}
asset_content_type: application/zip
5 changes: 5 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
coverage/
dist/
node_modules/
web-ext-artifacts/
.vscode/
5 changes: 5 additions & 0 deletions .prettierrc.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
singleQuote = true
svelteAllowShorthand = true
svelteBracketNewLine = false
svelteSortOrder = "scripts-styles-markup"
svelteStrictMode = false
13 changes: 13 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
# Treetop Changelog
All notable changes to this project will be documented in this file.

The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/).

## [Unreleased]

## [0.1.0] - 2020-11
### Added
- Initial release.

[Unreleased]: https://github.com/msmolens/treetop/compare/v0.1.0...HEAD
[0.1.0]: https://github.com/msmolens/treetop/releases/tag/v0.1.0
21 changes: 21 additions & 0 deletions LICENSE
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
MIT License

Copyright (c) 2020 Max Smolens

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
79 changes: 79 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,79 @@
![CI](https://github.com/msmolens/treetop/workflows/CI/badge.svg)

# ![Treetop logo](src/icons/generated/icon48.png) Treetop

Treetop is a Firefox extension that provides a high-level live view of your bookmarks:

![Screenshot of Treetop](images/screenshots/treetop.png)

## Usage

### Getting started

- Open Treetop by clicking its icon in the toolbar.

### Always up-to-date

- Treetop updates automatically as you browse.

- Recently visited bookmarks have a larger font.

### Edit your bookmarks

- Right-click to edit or delete bookmarks and folders.

### Customize

- Click the Preferences button to customize Treetop's display.

- Click a folder to set Treetop's root.

## Development

### Requirements

- [Node.js](https://nodejs.org/) 12.x or greater
- Firefox browser

### Prerequisites

Install dependencies:

```
npm install --global web-ext
npm install
```

### Commands

| Command | Description |
| ------------------- | ----------- |
| `npm run build:dev` | Build for development. |
| `npm run build` | Build for release. |
| `npm run lint` | Check code for linting errors. |
| `npm run lint:fix` | Fix linting errors. |
| `npm run validate` | Check for unused CSS, a11y issues, and TypeScript errors with [svelte-check](https://github.com/sveltejs/language-tools/tree/master/packages/svelte-check). |
| `npm test` | Run tests. |
| `web-ext run` | Start Firefox and load the extension temporarily. |
| `web-ext build` | Package the extension. |

### Core Technologies

#### Development
- [Svelte](https://svelte.dev/): Component framework.
- [Typescript](https://www.typescriptlang.org/): Typed JavaScript.
- [Rollup](https://rollupjs.org/): Module bundler.
- [Svelte Material UI](https://sveltematerialui.com/): Material UI components for Svelte.
- [ESLint](https://eslint.org/): Static analyzer.
- [Prettier](https://prettier.io/): Code formatter.
- [web-ext](https://github.com/mozilla/web-ext): Command line tool for web extensions.

#### Testing
- [Jest](https://jestjs.io/): Testing framework.
- [Svelte Testing Library](https://testing-library.com/): Framework to test Svelte components.
- [mockzilla-webextension](https://lusito.github.io/mockzilla-webextension/): Mocking toolkit for web extensions.

## History

Treetop is a modern remake of my [My Portal](https://github.com/msmolens/myportal)
XUL/XPCOM Firefox extension.
Loading

0 comments on commit 59c5c85

Please sign in to comment.