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

Commit

Permalink
chore: refactor project structure
Browse files Browse the repository at this point in the history
  • Loading branch information
oae committed Apr 9, 2020
1 parent 26fd416 commit ffc4eb0
Show file tree
Hide file tree
Showing 21 changed files with 472 additions and 2,867 deletions.
204 changes: 203 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@

# Created by https://www.gitignore.io/api/vim,linux,sublimetext,visualstudiocode
# Created by https://www.gitignore.io/api/node,linux,webstorm,sublimetext,visualstudiocode
# Edit at https://www.gitignore.io/?templates=node,linux,webstorm,sublimetext,visualstudiocode

### Linux ###
*~
Expand All @@ -16,6 +17,112 @@
# .nfs files are created when an open file is removed but is still being accessed
.nfs*

### Node ###
# Logs
logs
*.log
npm-debug.log*
yarn-debug.log*
yarn-error.log*
lerna-debug.log*

# Diagnostic reports (https://nodejs.org/api/report.html)
report.[0-9]*.[0-9]*.[0-9]*.[0-9]*.json

# 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
*.lcov

# nyc test coverage
.nyc_output

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

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

# node-waf configuration
.lock-wscript

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

# Dependency directories
node_modules/
jspm_packages/

# TypeScript v1 declaration files
typings/

# TypeScript cache
*.tsbuildinfo

# 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
.env.test

# parcel-bundler cache (https://parceljs.org/)
.cache

# next.js build output
.next

# nuxt.js build output
.nuxt

# rollup.js default build output
dist/

# Uncomment the public line if your project uses Gatsby
# https://nextjs.org/blog/next-9-1#public-directory-support
# https://create-react-app.dev/docs/using-the-public-folder/#docsNav
# public

# Storybook build outputs
.out
.storybook-out

# vuepress build output
.vuepress/dist

# Serverless directories
.serverless/

# FuseBox cache
.fusebox/

# DynamoDB Local files
.dynamodb/

# Temporary folders
tmp/
temp/

### SublimeText ###
# Cache files for Sublime Text
*.tmlanguage.cache
Expand Down Expand Up @@ -81,3 +188,98 @@ _build
node_modules
@types
dist
### VisualStudioCode Patch ###
# Ignore all local history of files
.history

### WebStorm ###
# Covers JetBrains IDEs: IntelliJ, RubyMine, PhpStorm, AppCode, PyCharm, CLion, Android Studio and WebStorm
# Reference: https://intellij-support.jetbrains.com/hc/en-us/articles/206544839

# User-specific stuff
.idea/**/workspace.xml
.idea/**/tasks.xml
.idea/**/usage.statistics.xml
.idea/**/dictionaries
.idea/**/shelf

# Generated files
.idea/**/contentModel.xml

# Sensitive or high-churn files
.idea/**/dataSources/
.idea/**/dataSources.ids
.idea/**/dataSources.local.xml
.idea/**/sqlDataSources.xml
.idea/**/dynamic.xml
.idea/**/uiDesigner.xml
.idea/**/dbnavigator.xml

# Gradle
.idea/**/gradle.xml
.idea/**/libraries

# Gradle and Maven with auto-import
# When using Gradle or Maven with auto-import, you should exclude module files,
# since they will be recreated, and may cause churn. Uncomment if using
# auto-import.
# .idea/modules.xml
# .idea/*.iml
# .idea/modules
# *.iml
# *.ipr

# CMake
cmake-build-*/

# Mongo Explorer plugin
.idea/**/mongoSettings.xml

# File-based project format
*.iws

# IntelliJ
out/

# mpeltonen/sbt-idea plugin
.idea_modules/

# JIRA plugin
atlassian-ide-plugin.xml

# Cursive Clojure plugin
.idea/replstate.xml

# Crashlytics plugin (for Android Studio and IntelliJ)
com_crashlytics_export_strings.xml
crashlytics.properties
crashlytics-build.properties
fabric.properties

# Editor-based Rest Client
.idea/httpRequests

# Android studio 3.1+ serialized cache file
.idea/caches/build_file_checksums.ser

### WebStorm Patch ###
# Comment Reason: https://github.com/joeblau/gitignore.io/issues/186#issuecomment-215987721

# *.iml
# modules.xml
# .idea/misc.xml
# *.ipr

# Sonarlint plugin
.idea/**/sonarlint/

# SonarQube Plugin
.idea/**/sonarIssues.xml

# Markdown Navigator plugin
.idea/**/markdown-navigator.xml
.idea/**/markdown-navigator/

# End of https://www.gitignore.io/api/node,linux,webstorm,sublimetext,visualstudiocode

# ts-for-gjs output
7 changes: 6 additions & 1 deletion .ts-for-girrc.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,12 @@
module.exports = {
environments: ['gjs'],
modules: ['Gtk-3.0'],
modules: ['Gtk-3.0', 'Soup-2.4', 'St-1.0'],
prettify: true,
girDirectories: [
'/usr/share/gir-1.0',
'/usr/share/gnome-shell',
'/usr/lib/mutter-6'
],
outdir: './@types',
ignore: []
}
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@
"devDependencies": {
"@typescript-eslint/eslint-plugin": "^2.23.0",
"@typescript-eslint/parser": "^2.23.0",
"copy-webpack-plugin": "^5.1.1",
"css-loader": "^3.4.2",
"eslint": "^6.8.0",
"eslint-config-prettier": "^6.10.0",
Expand Down
7 changes: 7 additions & 0 deletions resources/icons/extensions-sync-download-symbolic.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
7 changes: 7 additions & 0 deletions resources/icons/extensions-sync-synced-symbolic.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
7 changes: 7 additions & 0 deletions resources/icons/extensions-sync-syncing-symbolic.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
7 changes: 7 additions & 0 deletions resources/icons/extensions-sync-upload-symbolic.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
File renamed without changes.
14 changes: 14 additions & 0 deletions src/api/api.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
export enum Status {
SUCCESS,
FAIL
}

export interface Result {
status: Status;
response: any;
}

export interface Provider {
upload(): Result;
download(): any;
}
19 changes: 19 additions & 0 deletions src/api/index.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
import { Github } from "./providers/github";
import { Provider } from "./api";

export class Api {
private provider: Provider;

constructor() {
// We use github as a provider for now.
this.provider = new Github();
}

upload(): void {
this.provider.upload();
}

download(): void {
this.provider.download();
}
}
10 changes: 10 additions & 0 deletions src/api/providers/github.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
import { Provider, Result } from "../api";

export class Github implements Provider {
upload(): Result {
throw new Error("Method not implemented.");
}
download(): any {
throw new Error("Method not implemented.");
}
}
3 changes: 0 additions & 3 deletions src/debug.ts

This file was deleted.

43 changes: 18 additions & 25 deletions src/extension.ts
Original file line number Diff line number Diff line change
@@ -1,37 +1,30 @@
/* extension.js
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http:https://www.gnu.org/licenses/>.
*
* SPDX-License-Identifier: GPL-2.0-or-later
*/
import "./styles/stylesheet.scss";
import { StatusMenu } from "./panel/statusMenu";
import { Sync } from "./sync/sync";
import { Api } from "./api";

/* exported init */
class Extension {
private sync: Sync;
private statusMenu: StatusMenu;
private api: Api;

import { debug } from './debug'
import './stylesheet.scss';
import './metadata.json'
constructor() {
this.api = new Api();
this.sync = new Sync();
this.statusMenu = new StatusMenu(this.api);
}

class Extension {
enable(): void {
debug('-------------------enabled-------------------')
this.statusMenu.show();
this.sync.start();
}

disable(): void {
debug('-------------------disabled-------------------')
this.statusMenu.hide();
this.sync.stop();
}
}

export default function (): Extension {
export default function(): Extension {
return new Extension();
}
5 changes: 5 additions & 0 deletions src/index.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
declare global {
function _(arg: string): string;
}

export {};
Loading

0 comments on commit ffc4eb0

Please sign in to comment.