Skip to content

Commit d885225

Browse files
committed
Merge branch 'v1.1.0' into released
2 parents be43caf + cd18cf9 commit d885225

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

45 files changed

+793
-319
lines changed

Diff for: .circleci/config.yml

+70-32
Original file line numberDiff line numberDiff line change
@@ -2,41 +2,39 @@
22
#
33
# Check https://circleci.com/docs/2.0/language-javascript/ for more details
44
#
5-
version: 2
5+
version: 2.1
66
jobs:
77
build:
88
docker:
9-
# specify the version you desire here
109
- image: circleci/node:11.0
11-
12-
# Specify service dependencies here if necessary
13-
# CircleCI maintains a library of pre-built images
14-
# documented at https://circleci.com/docs/2.0/circleci-images/
15-
# - image: circleci/mongo:3.4.4
16-
1710
working_directory: ~/repo
18-
1911
steps:
2012
# build holoflows-kit
21-
- run: |
22-
cd ..
23-
git clone -q --depth=1 https://github.com/DimensionFoundation/holoflows-kit
13+
- run:
14+
name: Clone @holoflows/kit
15+
command: |
16+
cd ..
17+
git clone -q --depth=1 https://github.com/project-holoflows/holoflows-kit
2418
- restore_cache:
2519
keys:
26-
- v1-dependencies-holoflows-{{ checksum "~/holoflows-kit/package.json" }}
20+
- v1-holoflows-{{ checksum "~/holoflows-kit/yarn.lock" }}
2721
# fallback to using the latest cache if no exact match is found
28-
- v1-dependencies-holoflows-
29-
- run: |
30-
cd ../holoflows-kit
31-
yarn install
22+
- v1-holoflows-
23+
- run:
24+
name: Install @holoflows/kit
25+
command: |
26+
cd ../holoflows-kit
27+
yarn install --frozen-lockfile
3228
- save_cache:
3329
paths:
3430
- ~/holoflows-kit/node_modules
35-
key: v1-dependencies-holoflows-{{ checksum "~/holoflows-kit/package.json" }}
36-
- run: |
37-
cd ../holoflows-kit
38-
yarn build
39-
yarn link
31+
key: v1-holoflows-{{ checksum "~/holoflows-kit/yarn.lock" }}
32+
- run:
33+
name: Build @holoflows/kit
34+
command: |
35+
cd ../holoflows-kit
36+
yarn build
37+
yarn link
4038
4139
# build maskbook
4240
- checkout
@@ -45,21 +43,61 @@ jobs:
4543
- tsbuild-cache
4644
- restore_cache:
4745
keys:
48-
- v1-dependencies-{{ checksum "package.json" }}
49-
# fallback to using the latest cache if no exact match is found
50-
- v1-dependencies-
51-
- run: yarn install
46+
- v1-maskbook-{{ .Branch }}-{{ checksum "yarn.lock" }}
47+
- v1-maskbook-{{ .Branch }}-
48+
- v1-maskbook-
49+
- run:
50+
name: Build Maskbook
51+
command: |
52+
yarn install --frozen-lockfile
53+
yarn link @holoflows/kit
54+
yarn build
55+
sudo apt-get install zip
56+
cd build
57+
zip -r ../Maskbook.zip ./*
5258
- save_cache:
5359
paths:
5460
- node_modules
55-
key: v1-dependencies-{{ checksum "package.json" }}
56-
- run: yarn link @holoflows/kit
57-
- run: yarn build
58-
- run: sudo apt-get install zip
61+
key: v1-maskbook-{{ .Branch }}-{{ checksum "yarn.lock" }}
5962
- save_cache:
6063
paths:
6164
- .tscache/
6265
key: tsbuild-cache
63-
- run: zip -r build.zip build/
6466
- store_artifacts:
65-
path: build.zip
67+
path: Maskbook.zip
68+
destination: /Maskbook.zip
69+
- persist_to_workspace:
70+
root: ~/repo/
71+
paths:
72+
- Maskbook.zip
73+
publish-github-release:
74+
docker:
75+
- image: cibuilds/github:0.10
76+
steps:
77+
- checkout
78+
- attach_workspace:
79+
at: ~/repo/
80+
- run:
81+
name: 'Publish Release on GitHub'
82+
command: |
83+
set -o nounset
84+
ghr -t ${GITHUB_TOKEN} -u ${CIRCLE_PROJECT_USERNAME} -r ${CIRCLE_PROJECT_REPONAME} -c ${CIRCLE_SHA1} -b "✔ No breaking changes. / ⚠ Has breaking changes!
85+
86+
🎨 UI Improvements
87+
88+
👩‍💻 Miscellaneous" -replace -draft -prerelease $(git describe HEAD) ~/repo/Maskbook.zip
89+
# -b BODY \ # Set text describing the contents of the release
90+
# -delete \ # Delete release and its git tag in advance if it exists (same as -recreate)
91+
# -n TITLE \ # Set release title
92+
workflows:
93+
version: 2
94+
main:
95+
jobs:
96+
- build
97+
- publish-github-release:
98+
requires:
99+
- build
100+
filters:
101+
branches:
102+
only: released
103+
# test

Diff for: README.md

+53
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,53 @@
1+
# Maskbook · ![GitHub license](https://img.shields.io/badge/license-AGPL-blue.svg?style=flat-square) ![Ciecle CI](https://img.shields.io/circleci/project/github/project-maskbook/Maskbook.svg?style=flat-square&logo=circleci)
2+
3+
[![Join the chat at https://gitter.im/Maskbook/community](https://badges.gitter.im/Maskbook/community.svg)](https://gitter.im/Maskbook/community?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge)
4+
5+
Encrypt your posts & chats on You-Know-Where. Allow only your friends to decrypt.
6+
7+
For general introductions, see https://Maskbook.io/
8+
9+
[Install Maskbook](https://maskbook.io/install/)
10+
11+
## Documentation for developers
12+
13+
- License: AGPL
14+
- Code Style: Use [prettier](https://github.com/prettier/prettier)
15+
- [Git flow](https://github.com/nvie/gitflow) enabled, `master` as the latest branch, `released` as the stable branch
16+
- UI developing: Use `yarn start` / `npm start` to start a [Storybook](https://storybook.js.org/)
17+
- Extension developing: Use `yarn watch` / `npm run watch` to start watch build for extension
18+
- Crypto: We're using [ECDH SECP256-k1](https://en.wikipedia.org/wiki/ECC) and [AES-GCM](https://en.wikipedia.org/wiki/AES)
19+
- Data transfer between users: We're using [gun.js](https://gun.eco)
20+
21+
### Prepare
22+
23+
After `Maskbook` and `@holoflows/kit` gets stable, we will directly add `@holoflows/kit` as a dependency. Currently, you need to install and build the latest version of `@holoflows/kit`.
24+
25+
#### Install dependencies
26+
27+
- `yarn install`
28+
29+
#### Prepare for library @holoflows/kit
30+
31+
- `cd ..`
32+
- `git clone https://github.com/project-holoflows/Holoflows-kit.git`
33+
- `cd Holoflows-kit`
34+
- `yarn install`
35+
- `yarn build`
36+
- `yarn link`
37+
- `cd ../Maskbook`
38+
39+
#### Install @holoflows/kit in Maskbook
40+
41+
- `yarn link @holoflows/kit`
42+
43+
### Folder Structure
44+
45+
- ./public - Resource file
46+
- ./src/components - UI Components
47+
- ./src/crypto - Crypto related
48+
- ./src/key-management - How we manage keys and user infos
49+
- ./src/utils - Utils
50+
- ./src/extension
51+
- - ./background-script - Scripts that running in the background page as a service
52+
- - ./content-script - Script that be injected into the web page
53+
- - ./injected-script - Script that will run in the main frame of the injected web page

Diff for: config-overrides.js

+1
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ module.exports = function override(/** @type{import("webpack").Configuration} */
99
app: path.join(__dirname, './src/index.tsx'),
1010
contentscript: path.join(__dirname, './src/content-script.ts'),
1111
backgroundservice: path.join(__dirname, './src/background-service.ts'),
12+
injectedscript: path.join(__dirname, './src/extension/injected-script/index.ts'),
1213
}
1314
config.output.filename = 'static/js/[name].js'
1415
config.output.chunkFilename = 'static/js/[name].chunk.js'

Diff for: package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "maskbook",
3-
"version": "1.0.0",
3+
"version": "1.1.1",
44
"private": true,
55
"dependencies": {
66
"@material-ui/core": "^3.9.2",

Diff for: public/128x128.png

4.55 KB
Loading

Diff for: public/16x16.png

449 Bytes
Loading

Diff for: public/256x256.png

6.11 KB
Loading

Diff for: public/48x48.png

1.24 KB
Loading

Diff for: public/manifest.json

+14-4
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,20 @@
11
{
22
"$schema": "http://json.schemastore.org/chrome-manifest",
33
"name": "Maskbook",
4-
"version": "1.0",
4+
"version": "1.1.1",
55
"manifest_version": 2,
66
"content_scripts": [
77
{
88
"matches": ["https://www.facebook.com/*"],
99
"js": ["/static/js/contentscript.js"],
1010
"run_at": "document_idle",
1111
"all_frames": true
12+
},
13+
{
14+
"matches": ["https://www.facebook.com/*"],
15+
"js": ["/static/js/injectedscript.js"],
16+
"run_at": "document_start",
17+
"all_frames": true
1218
}
1319
],
1420
"web_accessible_resources": ["*.css", "*.js", "*.jpg", "*.png"],
@@ -22,7 +28,11 @@
2228
"chrome_style": true
2329
},
2430
"icons": {
25-
"256": "/maskbook-icon.png",
26-
"16": "/maskbook-icon-padded.png"
27-
}
31+
"16": "/16x16.png",
32+
"48": "/48x48.png",
33+
"128": "/128x128.png",
34+
"256": "/256x256.png"
35+
},
36+
"homepage_url": "https://maskbook.io",
37+
"description": "Encrypt your posts & chats on You-Know-Where. Allow only your friends to decrypt."
2838
}

Diff for: src/components/DataSource/PeopleRef.ts

+1-6
Original file line numberDiff line numberDiff line change
@@ -5,18 +5,13 @@ import { MessageCenter } from '../../utils/messages'
55
import { PeopleService } from '../../extension/content-script/rpc'
66

77
const ref = new ValueRef<Person[]>([])
8-
ref.startWatch()
98
PeopleService.getAllPeople().then(p => (ref.value = p))
109
MessageCenter.on('newPerson', p => {
1110
const old = ref.value.filter(x => x.username !== p.username)
1211
ref.value = [...old, p]
1312
})
1413
export function usePeople() {
1514
const [people, setPeople] = React.useState<Person[]>([])
16-
const cb = React.useCallback(() => setPeople(ref.value), [setPeople])
17-
React.useEffect(() => {
18-
ref.addListener('onChange', cb)
19-
return () => void ref.removeListener('onChange', cb)
20-
})
15+
React.useEffect(() => ref.addListener(val => setPeople(val)))
2116
return people.filter(x => x.username !== '$self')
2217
}

0 commit comments

Comments
 (0)