From 696057e1c12c1c427794ed19fc190f8c985b09e9 Mon Sep 17 00:00:00 2001 From: Max Patiiuk Date: Sun, 11 Feb 2024 10:20:43 -0800 Subject: [PATCH] docs(extension): improve documentation --- docs/privacy/README.md | 7 +-- docs/stats/README.md | 3 ++ package-lock.json | 44 ++++++++++++++++--- .../src/components/Auth/index.tsx | 6 +-- .../common/src/localization/commitText.ts | 24 ++++++---- 5 files changed, 61 insertions(+), 23 deletions(-) create mode 100644 docs/stats/README.md diff --git a/docs/privacy/README.md b/docs/privacy/README.md index 436455d..2342f32 100644 --- a/docs/privacy/README.md +++ b/docs/privacy/README.md @@ -43,9 +43,10 @@ repository, but the features mentioned above will not be available. necessary GitHub repository access**. The Extension processes data locally on your device and only interacts with GitHub's APIs to read from and write to your specified repository. No data is transmitted to any third-party services, except -for a single network request during authentication as required by GitHub to -resolve the OAuth token (this can not be done client-side due to security -implications). +for +[a single network request during authentication](https://github.com/maxpatiiuk/text-hoarder/tree/main/packages/cors-auth-middleware#readme) +as required by GitHub to resolve the OAuth token (this can not be done +client-side due to security implications). ## No Analytics or Tracking diff --git a/docs/stats/README.md b/docs/stats/README.md new file mode 100644 index 0000000..138d544 --- /dev/null +++ b/docs/stats/README.md @@ -0,0 +1,3 @@ +# Text Hoarder Stats + +// FIXME: write this diff --git a/package-lock.json b/package-lock.json index ad84c2c..d8e6c51 100644 --- a/package-lock.json +++ b/package-lock.json @@ -25,6 +25,9 @@ "simple-git": "^3.21.0", "typesafe-reducer": "^1.0.4" }, + "bin": { + "text-hoarder": "packages/cli/dist/cli.bundle.js" + }, "devDependencies": { "@babel/core": "^7.23.3", "@babel/plugin-transform-modules-commonjs": "^7.23.3", @@ -63,7 +66,8 @@ "tsx": "^4.7.0", "typescript": "^5.3.2", "webpack": "^5.89.0", - "webpack-cli": "^5.1.4" + "webpack-cli": "^5.1.4", + "webpack-shebang-plugin": "^1.1.8" } }, "node_modules/@aashutoshrathi/word-wrap": { @@ -16940,9 +16944,23 @@ "dev": true }, "node_modules/safe-buffer": { - "version": "5.1.2", - "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.1.2.tgz", - "integrity": "sha512-Gd2UZBJDkXlY7GbJxfsE8/nvKkUEU1G38c1siN6QP6a9PT9MmHB8GnpscSmMJSoF8LOIrt8ud/wPtojys4G6+g==" + "version": "5.2.1", + "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.2.1.tgz", + "integrity": "sha512-rp3So07KcdmmKbGvgaNxQSJr7bGVSVk5S9Eq1F+ppbRo70+YeaDxkw5Dd8NPN+GD6bjnYm2VuPuCXmpuYvmCXQ==", + "funding": [ + { + "type": "github", + "url": "https://github.com/sponsors/feross" + }, + { + "type": "patreon", + "url": "https://www.patreon.com/feross" + }, + { + "type": "consulting", + "url": "https://feross.org/support" + } + ] }, "node_modules/safe-regex": { "version": "2.1.1", @@ -18732,6 +18750,12 @@ "node": ">=10.0.0" } }, + "node_modules/webpack-shebang-plugin": { + "version": "1.1.8", + "resolved": "https://registry.npmjs.org/webpack-shebang-plugin/-/webpack-shebang-plugin-1.1.8.tgz", + "integrity": "sha512-8iHYp37XjytLuTkw8GCb4wm0s/0IWcv03YsfaDbOeRJfzSuBYVOadvc/QXQvr2b55pOEX1ANAEbz1fFSydJWVA==", + "dev": true + }, "node_modules/webpack-sources": { "version": "3.2.3", "resolved": "https://registry.npmjs.org/webpack-sources/-/webpack-sources-3.2.3.tgz", @@ -31060,9 +31084,9 @@ } }, "safe-buffer": { - "version": "5.1.2", - "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.1.2.tgz", - "integrity": "sha512-Gd2UZBJDkXlY7GbJxfsE8/nvKkUEU1G38c1siN6QP6a9PT9MmHB8GnpscSmMJSoF8LOIrt8ud/wPtojys4G6+g==" + "version": "5.2.1", + "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.2.1.tgz", + "integrity": "sha512-rp3So07KcdmmKbGvgaNxQSJr7bGVSVk5S9Eq1F+ppbRo70+YeaDxkw5Dd8NPN+GD6bjnYm2VuPuCXmpuYvmCXQ==" }, "safe-regex": { "version": "2.1.1", @@ -32419,6 +32443,12 @@ "wildcard": "^2.0.0" } }, + "webpack-shebang-plugin": { + "version": "1.1.8", + "resolved": "https://registry.npmjs.org/webpack-shebang-plugin/-/webpack-shebang-plugin-1.1.8.tgz", + "integrity": "sha512-8iHYp37XjytLuTkw8GCb4wm0s/0IWcv03YsfaDbOeRJfzSuBYVOadvc/QXQvr2b55pOEX1ANAEbz1fFSydJWVA==", + "dev": true + }, "webpack-sources": { "version": "3.2.3", "resolved": "https://registry.npmjs.org/webpack-sources/-/webpack-sources-3.2.3.tgz", diff --git a/packages/browser-extension/src/components/Auth/index.tsx b/packages/browser-extension/src/components/Auth/index.tsx index 1da6fd8..e2474d3 100644 --- a/packages/browser-extension/src/components/Auth/index.tsx +++ b/packages/browser-extension/src/components/Auth/index.tsx @@ -2,7 +2,6 @@ import React from 'react'; import { AuthContext } from '../Contexts/AuthContext'; import { AuthPrompt } from './AuthPrompt'; import { RepositoryList } from './RepositoryList'; -import { urls } from '../../../config'; import { commitText } from '@common/localization/commitText'; const readmeFile = 'README.md'; @@ -24,10 +23,7 @@ export function EnsureAuthenticated({ ?.createFile( readmeFile, commitText.initialize, - commitText.readmeContent( - urls.webStoreUrl, - urls.webStoreReviewUrl, - ), + commitText.readmeContent, ) .catch(console.error) .finally(() => setNeedsSetup(false)) diff --git a/packages/common/src/localization/commitText.ts b/packages/common/src/localization/commitText.ts index 66f5ee7..952cac5 100644 --- a/packages/common/src/localization/commitText.ts +++ b/packages/common/src/localization/commitText.ts @@ -8,11 +8,15 @@ // Refer to "Guidelines for Programmers" in ./README.md before editing this file +import { readerText } from '@common/localization/readerText'; +import { urls } from '../../../browser-extension/config'; import { commonText } from './commonText'; import { dictionary } from './utils'; +import { signInText } from '@common/localization/signInText'; /* eslint-disable @typescript-eslint/naming-convention */ export const commitText = dictionary({ + // Not using conventional commits as those might look weird to non-techy users repositoryInitialize: { en: (documentTitle: string): string => `[${commonText.delete}] ${documentTitle}`, @@ -20,18 +24,22 @@ export const commitText = dictionary({ initialize: { en: 'Initialize Text Hoarder' }, createFile: { en: (documentTitle: string): string => documentTitle }, readmeContent: { - en: ( - webStoreUrl: string, - webStoreReviewUrl: string, - ) => `# Text Hoarder Store + en: `# Text Hoarder Store -This repository is used by the [Text Hoarder](${webStoreUrl}) browser extension +This repository is used by the [Text Hoarder](${urls.webStore}) browser extension for storage of saved snippets of text. -If you are enjoying it, don't forget to [leave a review](${webStoreReviewUrl}) -on the Chrome Web Store! +Did you know that Text Hoarder can compute fancy stats from the articles you +save? [See a guide](${urls.statsDocs}). -// FINAL: improve this +If you are enjoying Text Hoarder, don't forget to +[leave a review](${urls.webStoreReview}) on the Chrome Web Store! + +Helpful links: +- [${readerText.requestFeature}](${urls.requestFeature}) +- [${readerText.reportIssue}](${urls.reportIssue}) +- [${readerText.sourceCode}](${urls.sourceCode}) +- [${signInText.privacyPolicy}](${urls.privacyPolicy}) `, }, });