diff --git a/Makefile b/Makefile index a45c90b5..212c25dc 100644 --- a/Makefile +++ b/Makefile @@ -57,6 +57,14 @@ install-dev: install-packages: pip install -e learning_observer/[${PACKAGES}] + # Just a little bit of dependency hell... + # On Python3.11 with tensorflow, we get some odd errors + # regarding compatibility with `protobuf`. Some installation + # files are missing from the protobuf binary on pip. + # Using the `--no-binary` option includes all files. + pip uninstall -y protobuf + pip install --no-binary=protobuf protobuf==4.25 + # Testing commands test: @if [ -z "$(PKG)" ]; then echo "No module specified, please try again with \"make test PKG=path/to/module\""; exit 1; fi diff --git a/VERSION b/VERSION index 39acef61..5efb812a 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -0.1.0+2025.10.01T21.16.15.146Z.8b205d0c.master +0.1.0+2025.08.15T13.29.30.819Z.f61cb8b1.master diff --git a/docs/versioning.md b/docs/versioning.md new file mode 100644 index 00000000..f0efb4d8 --- /dev/null +++ b/docs/versioning.md @@ -0,0 +1,47 @@ +# Versioning + +## Tracking Versions + +Each module should include a `VERSION` file to specify the module's current version. This version is referenced in the module's setup configuration. Typically, this is done in the `setup.cfg` file as follows: + +```cfg +# setup.cfg +[metadata] +name = Module name +version = file:VERSION +``` + +## Version Format + +The version format is split into 2 pieces, the semantic version and the local version string separated by a `+`. The semantic version is primarily used for uploading to PyPI and resolving dependency conflicts. The local version string contains additional metadata about when the code was last modified and the commit it came from. The versions should follow the following format: + +```sh +major.minor.patch+%Y.%m.%dT%H.%M.%S.%3NZ.abc123.branch.name +``` + +A example version string might look like this: + +```sh +0.1.0+2024.12.16T16.42.38.637Z.abc123.branch.name +``` + +## Bumping Versions + +The local version strings that contain metadata are automatically managed using a Git pre-commit hook. Before each commit is made, the appropriate `VERSION` is updated to reflect the current time and commit. + +Bumping the semantic version is done manually. + +## Setting Up the Pre-Commit Hook + +To enable automatic version bumping, use the `install-pre-commit-hook` command provided in the `Makefile`. This command handles copying the pre-commit hook script into the appropriate location and making it executable. Run the following command: + +```bash +make install-pre-commit-hook +``` + +With this setup, every commit will automatically update the version for you. + +## Notes + +- Ensure that `setup.cfg` properly references the `VERSION` file to avoid version mismatches. +- Avoid manually editing the `VERSION` file; rely on the pre-commit hook for consistency. diff --git a/extension/writing-process/src/background.js b/extension/writing-process/src/background.js index 236a91d3..b6e14c98 100644 --- a/extension/writing-process/src/background.js +++ b/extension/writing-process/src/background.js @@ -65,11 +65,21 @@ function startLogger () { logFromServiceWorker('Extension loaded'); } -function stopLogger () { - if (!loEventActive) return; - loEvent.logEvent('terminate', {}); - loEventActive = false; -} +loEvent.init( + 'org.mitros.writing_analytics', + '0.01', + loggers, + { + debugLevel: loEventDebug.LEVEL.SIMPLE, + metadata: [ + browserInfo(), + chromeAuth(), + localStorageInfo(), + sessionStorageInfo(), + ] + } +); +loEvent.go(); // Function to serve as replacement for // chrome.extension.getBackgroundPage().console.log(event); because it is not allowed in V3 diff --git a/extension/writing-process/src/manifest.json b/extension/writing-process/src/manifest.json index ad7c064a..26d7aa94 100644 --- a/extension/writing-process/src/manifest.json +++ b/extension/writing-process/src/manifest.json @@ -1,46 +1 @@ -{ - "name": "__MSG_appName__", - "short_name": "__MSG_appShortName__", - "description": "__MSG_appDescription__", - "homepage_url": "https://github.com/ETS-Next-Gen/writing_observer/tree/master/extension/writing-process", - "incognito": "not_allowed", - "version": "1.0.0.2", - "version_name": "1.0.0.2", - "manifest_version": 3, - "default_locale": "en", - "minimum_chrome_version": "88", - "permissions": [ - "webRequest", - "declarativeNetRequest", - "identity", - "identity.email", - "storage", - "nativeMessaging", - "scripting", - "activeTab", - "tabs" - ], - "icons": { - "48": "assets/lousy-fountain-pen-48.png" - }, - "background": { - "service_worker": "service_worker.js" - }, - "action": { - "default_popup": "pages/settings.html", - "default_icon": { - "48": "assets/lousy-fountain-pen-48.png" - }, - "default_title": "__MSG_appName__" - }, - "content_scripts": [{ - "matches": ["*://docs.google.com/document/*"], - "js": ["3rdparty/sha256.js", "writing_common.js", "writing.js"] - }], - "host_permissions": [ - "*://docs.google.com/document/*" - ], - "options_ui": { - "page": "pages/options.html" - } -} \ No newline at end of file +{"name":"__MSG_appName__","short_name":"__MSG_appShortName__","description":"__MSG_appDescription__","homepage_url":"https://github.com/ETS-Next-Gen/writing_observer/tree/master/extension/writing-process","incognito":"not_allowed","version":"1.0.0.4","version_name":"1.0.0.4","manifest_version":3,"default_locale":"en","minimum_chrome_version":"88","permissions":["webRequest","identity","identity.email","storage","scripting","activeTab"],"icons":{"48":"assets/lousy-fountain-pen-48.png"},"background":{"service_worker":"service_worker.js"},"action":{"default_popup":"pages/settings.html","default_icon":{"48":"assets/lousy-fountain-pen-48.png"},"default_title":"__MSG_appName__"},"content_scripts":[{"matches":["*://docs.google.com/document/*"],"js":["3rdparty/sha256.js","writing_common.js","writing.js"]}],"host_permissions":["*://docs.google.com/document/*"],"options_ui":{"page":"pages/options.html"}} diff --git a/learning_observer/VERSION b/learning_observer/VERSION index 0aa6c860..5f2ef51a 100644 --- a/learning_observer/VERSION +++ b/learning_observer/VERSION @@ -1 +1 @@ -0.1.0+2025.10.01T17.50.57.101Z.d6047986.master +0.1.0+2025.08.07T20.03.33.270Z.c17a54d7.berickson.202507.new.lti.updates