Skip to content

Commit 30410d7

Browse files
Extension build process (#75)
Full commit list: * moved files to new extension build process directory * adjusted imports and undefined var error * updated documentation with extension readme and updated readme * added names and git repo * added version, probably needs a bump or a central location for it
1 parent dc11591 commit 30410d7

19 files changed

Lines changed: 221 additions & 3 deletions

autodocs/other_docs.rst

Whitespace-only changes.
Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
{
2+
"env": {
3+
"browser": true,
4+
"es2021": true,
5+
"node": true
6+
},
7+
"extends": [
8+
"eslint:recommended"
9+
],
10+
"globals": {
11+
"document": false,
12+
"escape": false,
13+
"navigator": false,
14+
"unescape": false,
15+
"window": false,
16+
"describe": true,
17+
"before": true,
18+
"it": true,
19+
"expect": true,
20+
"sinon": true,
21+
"chrome": true
22+
},
23+
"plugins": [],
24+
"parserOptions": {
25+
"ecmaVersion": 2020,
26+
"sourceType": "module"
27+
},
28+
"rules": {
29+
}
30+
}
Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
dist/
2+
node_modules/
Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
# writing-process
2+
3+
Tracks writing in Google Docs, and provides nifty insights to you and your teachers!
4+
5+
## Development
6+
7+
This extension directory structure was created with [Extension CLI](https://oss.mobilefirst.me/extension-cli/).
8+
The original extension, which was just a handful of javascript files, were then copied into the structure.
9+
10+
### To Begin
11+
12+
To get started, run the following:
13+
14+
```bash
15+
cd extention/writing-process
16+
npm install
17+
```
18+
19+
### Available Commands
20+
21+
| Commands | Description |
22+
| --- | --- |
23+
| `npm run start` | builds extension into `dist/`, watches for file changes |
24+
| `npm run build` | generate release version - `release.zip` |
25+
| `npm run docs` | generate source code docs into `public/documentation` |
26+
| `npm run clean` | removes `dist/` directory |
27+
| `npm run test` | run unit tests |
28+
| `npm run sync` | update projects config files for `extension-cli` |
29+
30+
For CLI instructions see [User Guide →](https://oss.mobilefirst.me/extension-cli/)
31+
32+
### Learn More
33+
34+
#### Extension Developer guides
35+
36+
- [Getting started with extension development](https://developer.chrome.com/extensions/getstarted)
37+
- Manifest configuration: [version 3](https://developer.chrome.com/docs/extensions/mv3/intro/)
38+
- [Permissions reference](https://developer.chrome.com/extensions/declare_permissions)
39+
- [Chrome API reference](https://developer.chrome.com/docs/extensions/reference/)
40+
41+
#### Extension Publishing Guides
42+
43+
- [Publishing for Chrome](https://developer.chrome.com/webstore/publish)
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
{
2+
"appName": {
3+
"message": "writing-process"
4+
},
5+
"appShortName": {
6+
"message": "writing-process"
7+
},
8+
"appDescription": {
9+
"message": "Tracks writing in Google Docs, and provides nifty insights to you and your teachers!"
10+
}
11+
}

extension/extension/icons/lousy-fountain-pen-48.png renamed to extension/writing-process/assets/lousy-fountain-pen-48.png

File renamed without changes.
Lines changed: 76 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,76 @@
1+
{
2+
"name": "writing-process",
3+
"description": "Tracks writing in Google Docs, and provides nifty insights to you and your teachers!",
4+
"version": "1.0.0.2",
5+
"homepage": "http://chrome.google.com/webstore",
6+
"author": "Piotr Mitros, Bradley Erickson",
7+
"repository": {
8+
"type": "git",
9+
"url": "https://github.com/ETS-Next-Gen/writing_observer/tree/master/extension/writing-process"
10+
},
11+
"scripts": {
12+
"start": "xt-build -e dev -w",
13+
"start:firefox": "xt-build -e dev -p firefox -w",
14+
"build": "xt-build -e prod",
15+
"build:firefox": "xt-build -e prod -p firefox",
16+
"clean": "xt-clean",
17+
"docs": "xt-docs",
18+
"test": "xt-test",
19+
"coverage": "nyc --reporter=lcov npm run test",
20+
"sync": "xt-sync"
21+
},
22+
"babel": {
23+
"presets": [
24+
"@babel/preset-env"
25+
]
26+
},
27+
"eslintIgnore": [
28+
"test/**/*"
29+
],
30+
"devDependencies": {
31+
"extension-cli": "latest"
32+
},
33+
"xtdocs": {
34+
"source": {
35+
"include": [
36+
"README.md",
37+
"src"
38+
]
39+
}
40+
},
41+
"xtbuild": {
42+
"copyAsIs": [
43+
"./src/pages/*"
44+
],
45+
"js_bundles": [
46+
{
47+
"name": "background",
48+
"src": "./src/background.js"
49+
},
50+
{
51+
"name": "inject",
52+
"src": "./src/inject.js"
53+
},
54+
{
55+
"name": "service_worker",
56+
"src": "./src/service_worker.js"
57+
},
58+
{
59+
"name": "writing_common",
60+
"src": "./src/writing_common.js"
61+
},
62+
{
63+
"name": "writing",
64+
"src": "./src/writing.js"
65+
},
66+
{
67+
"name": "3rdparty/sha256",
68+
"src": "./src/3rdparty/sha256.js"
69+
},
70+
{
71+
"name": "3rdparty/sha256",
72+
"src": "./src/3rdparty/sha256.js"
73+
}
74+
]
75+
}
76+
}
File renamed without changes.

extension/extension/background.js renamed to extension/writing-process/src/background.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ var RAW_DEBUG = false;
1111
*/
1212
var WEBSOCKET_SERVER_URL = "wss://learning-observer.org/wsapi/in/"
1313

14-
14+
import { googledocs_id_from_url } from './writing_common';
1515
/*
1616
TODO: FSM
1717
@@ -111,7 +111,7 @@ function websocket_logger(server) {
111111
function are_we_done() {
112112
if (state.has("chrome_identity") &&
113113
state.has("local_storage")) {
114-
event = {};
114+
var event = {};
115115
event = add_event_metadata('metadata_finished', event);
116116
socket.send(JSON.stringify(event));
117117
state.add("ready");

0 commit comments

Comments
 (0)