Skip to content
This repository has been archived by the owner on Nov 5, 2023. It is now read-only.

Commit

Permalink
Merge pull request #204 from Kocal/develop
Browse files Browse the repository at this point in the history
Release 1.9
  • Loading branch information
Kocal authored May 3, 2018
2 parents 57b25ec + a12ac4c commit 6ee0610
Show file tree
Hide file tree
Showing 91 changed files with 7,311 additions and 11,808 deletions.
File renamed without changes.
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,2 +1,5 @@
/node_modules
/*.log
/dist
/dist-zip
/coverage
27 changes: 20 additions & 7 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,23 +5,36 @@ language: node_js
node_js:
- "node"

cache:
yarn: true
directories:
- node_modules

before_install:
- curl -o- -L https://yarnpkg.com/install.sh | bash
- export PATH="$HOME/.yarn/bin:$PATH"
- yarn global add codecov

before_script:
- git fetch --unshallow
- yarn bootstrap
- yarn

script:
- bash ci/build-extension.sh
- bash ci/test-extension.sh
- bash ci/run-server.sh
- bash ci/test-server.sh
- bash ci/stop-server.sh
- yarn build
- yarn build-zip
- yarn test && codecov
- test -f dist/manifest.json
- test -f dist/background.js
- test -f dist/vendor.js
- test -f dist/vendor.css
- test -f dist/popup/popup.js
- test -f dist/popup/popup.css
- test -f dist/options/options.js
- test -f dist/options/options.css
- test -f "dist-zip/Solary-v$(node -pe "require('./package.json').version").zip"

before_deploy:
- export RELEASE_EXTENSION_FILE=$(ls packages/extension/dist-zip/*.zip)
- export RELEASE_EXTENSION_FILE=$(ls dist-zip/*.zip)
- echo "Deploying ${RELEASE_EXTENSION_FILE} to GitHub releases"

deploy:
Expand Down
90 changes: 4 additions & 86 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Solary

> Projects related to the french WebTV [Solary](https://www.solary.fr).
> Web extension for french WebTV [Solary](https://www.solary.fr).
[![Travis](https://img.shields.io/travis/Kocal/Solary.svg?style=flat-square)](https://travis-ci.org/Kocal/Solary)
[![Codecov](https://img.shields.io/codecov/c/github/kocal/solary.svg?style=flat-square)](https://codecov.io/gh/Kocal/Solary)
Expand All @@ -9,23 +9,12 @@
[![dependencies Status](https://david-dm.org/kocal/solary/status.svg?style=flat-square)](https://david-dm.org/kocal/solary)
[![devDependencies Status](https://david-dm.org/kocal/solary/dev-status.svg?style=flat-square)](https://david-dm.org/kocal/solary?type=dev)

**Extension:**
[![dependencies Status](https://david-dm.org/kocal/solary/status.svg?style=flat-square&path=packages/extension)](https://david-dm.org/kocal/solary?path=packages/extension)
[![devDependencies Status](https://david-dm.org/kocal/solary/dev-status.svg?style=flat-square&path=packages/extension)](https://david-dm.org/kocal/solary?path=packages/extension&type=dev)

**Server:**
[![dependencies Status](https://david-dm.org/kocal/solary/status.svg?style=flat-square&path=packages/server)](https://david-dm.org/kocal/solary?path=packages/server)
[![devDependencies Status](https://david-dm.org/kocal/solary/dev-status.svg?style=flat-square&path=packages/server)](https://david-dm.org/kocal/solary?path=packages/server&type=dev)

---

* [Getting started](#getting-started)
* [Requirements](#requirements)
* [Bootstraping](#bootstraping)
* [Server Bootstraping](#server-bootstraping)
* [Projects](#projects)
* [Extension](#extension)
* [Server & Web UI](#server--web-ui)
* [Commands](#commands)

## Getting started

Expand All @@ -36,66 +25,18 @@

### Bootstraping

Just run `lerna bootstrap`, it will install dependencies for all projects located inside `packages` folder.

### Server Bootstraping

You can ignore this part if you won't work on server.

#### Set-up host

Add `localhost.ssl` host in your `/etc/hosts`:

```
127.0.0.1 localhost.ssl
```

#### SSL certificate

* Generate a fake SSL certificate for the previously created host:

```bash
$ openssl req -x509 -sha256 -nodes -newkey rsa:2048 -days 365 -keyout localhost.ssl.key -out localhost.ssl.crt
```

**Be sure to specify `localhost.ssl` when it's asking for `Common Name (e.g. server FQDN or YOUR name)`**:

![](screenshots/generate-ssl-certificate.png)

* Then copy the file `packages/server/config.js.default` to `packages/server/config.js`.

* Then edit the file `packages/server/config.js` and change `cert`/`key` values:

```js
module.exports = {
cert: '/path/to/localhost.ssl.crt',
key: '/path/to/localhost.ssl.key',
};
```

## Projects
Just run `yarn`.

### Extension

All builds are located [here](https://solary.kocal.fr/builds) (if I think to put them here...).

* [Extension for Chrome](https://chrome.google.com/webstore/detail/solary/hcbdbiggklmbnbhhmepnebffpmajnkai)
* [Extension for Firefox](https://solary.kocal.fr/builds/firefox/)

#### Commands
### Commands

##### `yarn build`

Build the extension for **production**, in folder `dist`.

Production environment will **ONLY** listen WebSocket messages from `wss://solary.kocal.fr`.

##### `yarn build:dev`

Build the extension for **development**, in folder `dist`.

Development environment will **ONLY** listen WebSocket messages from `wss://localhost.ssl:3000`.

##### `yarn watch`

Watch any modifications and then run `yarn build`.
Expand All @@ -107,26 +48,3 @@ Watch any modifications and then run `yarn build:dev`.
##### `yarn build-zip`

Generate a zip of the extension, e.g. `dist-zip/Solary-v1.X.X.zip`.

### Server & Web UI

In production, the web UI is accessible to `https://solary.kocal.fr`, protected by a `.htpasswd`.

In local, the web UI is accessible to `https://localhost.ssl:3000`, also protected by a `.htpasswd`.

Before running the server, you **MUST** [create a `.htpasswd` file](https://www.web2generators.com/apache-tools/htpasswd-generator), at the root of the server project.

#### Commands

##### `yarn start`

Run the server in **production** environment by using pm2.

##### `yarn start:dev`

Run the server in **development** environment by using pm2.
Useful for debugging.

##### `yarn stop`

Stop the server.
Original file line number Diff line number Diff line change
@@ -1,7 +1,3 @@
import { WebSocket } from 'mock-socket';

global.WebSocket = WebSocket;

require('../src/background');

describe('background', function() {
Expand Down
10 changes: 0 additions & 10 deletions ci/build-extension.sh

This file was deleted.

26 changes: 0 additions & 26 deletions ci/run-server.sh

This file was deleted.

12 changes: 0 additions & 12 deletions ci/stop-server.sh

This file was deleted.

16 changes: 0 additions & 16 deletions ci/test-extension.sh

This file was deleted.

25 changes: 0 additions & 25 deletions ci/test-server.sh

This file was deleted.

File renamed without changes.
8 changes: 0 additions & 8 deletions lerna.json

This file was deleted.

53 changes: 46 additions & 7 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,15 +1,21 @@
{
"name": "solary",
"private": true,
"version": "1.9.0",
"description": "Extension navigateur pour la WebTV Solary",
"author": "Hugo Alliaume <[email protected]>",
"license": "MIT",
"typings": "types/index.d.ts",
"scripts": {
"bootstrap": "lerna bootstrap",
"prettier": "prettier 'packages/extension/{src,__tests__}/**/*.{ts,vue}' 'packages/server/**/*.js'",
"build": "cross-env NODE_ENV=production webpack --config webpack.config.js --progress --hide-modules",
"build:dev": "cross-env NODE_ENV=development webpack --config webpack.config.js --progress --hide-modules",
"build-zip": "node scripts/build-zip.js",
"watch": "npm run build -- --watch",
"watch:dev": "npm run build:dev -- --watch",
"test": "jest",
"prettier": "prettier '{src,__tests__}/**/*.{ts,vue}'",
"prettier:write": "npm run prettier -- --write",
"precommit": "pretty-quick --staged",
"lerna-publish": "lerna publish --force-publish=extension,server --skip-npm"
"precommit": "pretty-quick --staged"
},
"repository": {
"type": "git",
Expand All @@ -19,11 +25,44 @@
"url": "https://github.com/Kocal/Solary/issues"
},
"homepage": "https://github.com/Kocal/Solary#readme",
"dependencies": {
"axios": "^0.18.0",
"qs": "^6.5.1",
"vue": "^2.5.13",
"vue-awesome": "^2.3.5",
"vue-router": "^3.0.1"
},
"devDependencies": {
"@babel/core": "^7.0.0-beta.40",
"@babel/preset-env": "^7.0.0-beta.40",
"@types/chrome": "^0.0.64",
"@types/jest": "^22.1.4",
"@types/node": "^10.0.3",
"axios-mock-adapter": "^1.14.1",
"babel-core": "^7.0.0-beta.40",
"babel-jest": "^22.4.1",
"codecov": "^3.0.0",
"copy-webpack-plugin": "^4.5.0",
"cross-env": "^5.1.3",
"css-loader": "^0.28.10",
"file-loader": "^1.1.11",
"husky": "^0.14.3",
"lerna": "^2.9.0",
"prettier": "1.11.1",
"jest": "^22.4.2",
"jest-localstorage-mock": "^2.2.0",
"jest-webextension-mock": "^3.3.0",
"mini-css-extract-plugin": "^0.4.0",
"node-sass": "^4.7.2",
"prettier": "1.12.1",
"pretty-quick": "^1.4.1",
"wsc": "^0.3.0"
"sass-loader": "^7.0.1",
"ts-jest": "^22.4.1",
"ts-loader": "^4.0.1",
"typescript": "^2.7.2",
"vue-loader": "^15.0.6",
"vue-template-compiler": "^2.5.13",
"webpack": "^4.1.0",
"webpack-cli": "^2.0.10",
"webpack-shell-plugin": "^0.5.0",
"zip-folder": "^1.0.0"
}
}
5 changes: 0 additions & 5 deletions packages/extension/.gitignore

This file was deleted.

4 changes: 0 additions & 4 deletions packages/extension/README.md

This file was deleted.

Loading

0 comments on commit 6ee0610

Please sign in to comment.